diff --git a/rosenpass/src/cli.rs b/rosenpass/src/cli.rs index bd8b837..f242a92 100644 --- a/rosenpass/src/cli.rs +++ b/rosenpass/src/cli.rs @@ -490,7 +490,7 @@ impl CliArgs { cfg_peer.key_out, broker_peer, cfg_peer.endpoint.clone(), - cfg_peer.protocol_version.into(), + cfg_peer.protocol_version, cfg_peer.osk_domain_separator.try_into()?, )?; } diff --git a/rosenpass/src/config.rs b/rosenpass/src/config.rs index a4f494b..31a4b5c 100644 --- a/rosenpass/src/config.rs +++ b/rosenpass/src/config.rs @@ -200,7 +200,7 @@ impl RosenpassPeerOskDomainSeparator { pub fn org_and_label(&self) -> anyhow::Result)>> { match (&self.osk_organization, &self.osk_label) { (None, None) => Ok(None), - (Some(org), Some(label)) => Ok(Some((&org, &label))), + (Some(org), Some(label)) => Ok(Some((org, label))), (Some(_), None) => bail!("Specified osk_organization but not osk_label in config file. You need to specify both, or none."), (None, Some(_)) => bail!("Specified osk_label but not osk_organization in config file. You need to specify both, or none."), } diff --git a/rosenpass/src/protocol/protocol.rs b/rosenpass/src/protocol/protocol.rs index 778a1be..568ef08 100644 --- a/rosenpass/src/protocol/protocol.rs +++ b/rosenpass/src/protocol/protocol.rs @@ -1943,7 +1943,7 @@ impl CryptoServer { &mut self, rx_buf: &[u8], tx_buf: &mut [u8], - host_identification: &H, + _host_identification: &H, ) -> Result { self.handle_msg(rx_buf, tx_buf) } @@ -3231,7 +3231,7 @@ impl HandshakeState { let k = bk.get(srv).value.secret(); let pt = biscuit.as_bytes(); - XAead.encrypt_with_nonce_in_ctxt(biscuit_ct, k, &*n, &ad, pt)?; + XAead.encrypt_with_nonce_in_ctxt(biscuit_ct, k, &n, &ad, pt)?; self.mix(biscuit_ct) } @@ -3421,7 +3421,7 @@ impl CryptoServer { // IHI3 protocol_section!("IHI3", { - EphemeralKem.keygen(hs.eski.secret_mut(), &mut *hs.epki)?; + EphemeralKem.keygen(hs.eski.secret_mut(), &mut hs.epki)?; ih.epki.copy_from_slice(&hs.epki.value); }); diff --git a/rosenpass/tests/api-integration-tests-api-setup.rs b/rosenpass/tests/api-integration-tests-api-setup.rs index ee9341a..54ae051 100644 --- a/rosenpass/tests/api-integration-tests-api-setup.rs +++ b/rosenpass/tests/api-integration-tests-api-setup.rs @@ -105,7 +105,7 @@ fn api_integration_api_setup(protocol_version: ProtocolVersion) -> anyhow::Resul peer: format!("{}", peer_b_wg_peer_id.fmt_b64::<8129>()), extra_params: vec![], }), - protocol_version: protocol_version.clone(), + protocol_version: protocol_version, osk_domain_separator: Default::default(), }], }; @@ -127,7 +127,7 @@ fn api_integration_api_setup(protocol_version: ProtocolVersion) -> anyhow::Resul endpoint: Some(peer_a_endpoint.to_owned()), pre_shared_key: None, wg: None, - protocol_version: protocol_version.clone(), + protocol_version: protocol_version, osk_domain_separator: Default::default(), }], }; diff --git a/rosenpass/tests/api-integration-tests.rs b/rosenpass/tests/api-integration-tests.rs index 18380c2..ef54d28 100644 --- a/rosenpass/tests/api-integration-tests.rs +++ b/rosenpass/tests/api-integration-tests.rs @@ -82,7 +82,7 @@ fn api_integration_test(protocol_version: ProtocolVersion) -> anyhow::Result<()> endpoint: None, pre_shared_key: None, wg: None, - protocol_version: protocol_version.clone(), + protocol_version: protocol_version, osk_domain_separator: Default::default(), }], }; @@ -104,7 +104,7 @@ fn api_integration_test(protocol_version: ProtocolVersion) -> anyhow::Result<()> endpoint: Some(peer_a_endpoint.to_owned()), pre_shared_key: None, wg: None, - protocol_version: protocol_version.clone(), + protocol_version: protocol_version, osk_domain_separator: Default::default(), }], }; diff --git a/rosenpass/tests/integration_test.rs b/rosenpass/tests/integration_test.rs index d5b5f22..6d16ac9 100644 --- a/rosenpass/tests/integration_test.rs +++ b/rosenpass/tests/integration_test.rs @@ -144,7 +144,7 @@ fn check_example_config() { let tmp_dir = tempdir().unwrap(); let config_path = tmp_dir.path().join("config.toml"); - let mut config_file = File::create(config_path.to_owned()).unwrap(); + let mut config_file = File::create(&config_path).unwrap(); config_file .write_all( diff --git a/secret-memory/src/secret.rs b/secret-memory/src/secret.rs index 90282ef..ec235ec 100644 --- a/secret-memory/src/secret.rs +++ b/secret-memory/src/secret.rs @@ -379,10 +379,7 @@ impl StoreSecret for Secret { #[cfg(test)] mod test { - use crate::{ - secret_policy_try_use_memfd_secrets, secret_policy_use_only_malloc_secrets, - test_spawn_process_provided_policies, - }; + use crate::{secret_policy_use_only_malloc_secrets, test_spawn_process_provided_policies}; use super::*; use std::{fs, os::unix::fs::PermissionsExt}; diff --git a/util/src/mio/uds_recv_fd.rs b/util/src/mio/uds_recv_fd.rs index 8cba2a3..31e0f9c 100644 --- a/util/src/mio/uds_recv_fd.rs +++ b/util/src/mio/uds_recv_fd.rs @@ -39,7 +39,7 @@ use crate::fd::{claim_fd_inplace, IntoStdioErr}; /// &io_stream, /// &mut read_fd_buffer, /// ); -//// +/// /// // Simulated reads; the actual operations will depend on the protocol (implementation details) /// let mut recv_buffer = Vec::::new(); /// let bytes_read = fd_passing_sock.read(&mut recv_buffer[..]).expect("error reading from socket");