diff --git a/src/rust/cryptography-x509-verification/src/policy/extension.rs b/src/rust/cryptography-x509-verification/src/policy/extension.rs index 80221a4c0ff8..fa034ac10d00 100644 --- a/src/rust/cryptography-x509-verification/src/policy/extension.rs +++ b/src/rust/cryptography-x509-verification/src/policy/extension.rs @@ -592,7 +592,7 @@ mod tests { critical: bool, ext: &T, ) -> Vec { - let ext_value = asn1::write_single(&ext).unwrap(); + let ext_value = asn1::write_single(ext).unwrap(); let ext = Extension { extn_id: oid, critical, diff --git a/src/rust/cryptography-x509-verification/src/policy/mod.rs b/src/rust/cryptography-x509-verification/src/policy/mod.rs index 8c2216b71fe4..935113fcdf3c 100644 --- a/src/rust/cryptography-x509-verification/src/policy/mod.rs +++ b/src/rust/cryptography-x509-verification/src/policy/mod.rs @@ -680,7 +680,7 @@ mod tests { assert!(WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS.contains(&RSASSA_PSS_SHA256.deref())); let exp_encoding = b"0A\x06\t*\x86H\x86\xf7\r\x01\x01\n04\xa0\x0f0\r\x06\t`\x86H\x01e\x03\x04\x02\x01\x05\x00\xa1\x1c0\x1a\x06\t*\x86H\x86\xf7\r\x01\x01\x080\r\x06\t`\x86H\x01e\x03\x04\x02\x01\x05\x00\xa2\x03\x02\x01 "; assert_eq!( - asn1::write_single(&RSASSA_PSS_SHA256.deref()).unwrap(), + asn1::write_single(RSASSA_PSS_SHA256.deref()).unwrap(), exp_encoding ); } @@ -689,7 +689,7 @@ mod tests { assert!(WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS.contains(&RSASSA_PSS_SHA384.deref())); let exp_encoding = b"0A\x06\t*\x86H\x86\xf7\r\x01\x01\n04\xa0\x0f0\r\x06\t`\x86H\x01e\x03\x04\x02\x02\x05\x00\xa1\x1c0\x1a\x06\t*\x86H\x86\xf7\r\x01\x01\x080\r\x06\t`\x86H\x01e\x03\x04\x02\x02\x05\x00\xa2\x03\x02\x010"; assert_eq!( - asn1::write_single(&RSASSA_PSS_SHA384.deref()).unwrap(), + asn1::write_single(RSASSA_PSS_SHA384.deref()).unwrap(), exp_encoding ); } @@ -698,7 +698,7 @@ mod tests { assert!(WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS.contains(&RSASSA_PSS_SHA512.deref())); let exp_encoding = b"0A\x06\t*\x86H\x86\xf7\r\x01\x01\n04\xa0\x0f0\r\x06\t`\x86H\x01e\x03\x04\x02\x03\x05\x00\xa1\x1c0\x1a\x06\t*\x86H\x86\xf7\r\x01\x01\x080\r\x06\t`\x86H\x01e\x03\x04\x02\x03\x05\x00\xa2\x03\x02\x01@"; assert_eq!( - asn1::write_single(&RSASSA_PSS_SHA512.deref()).unwrap(), + asn1::write_single(RSASSA_PSS_SHA512.deref()).unwrap(), exp_encoding ); } diff --git a/src/rust/src/pkcs7.rs b/src/rust/src/pkcs7.rs index d1c1c6f15003..f6d8a5cfcd6a 100644 --- a/src/rust/src/pkcs7.rs +++ b/src/rust/src/pkcs7.rs @@ -190,9 +190,9 @@ fn sign_and_serialize<'p>( // Subset of values OpenSSL provides: // https://github.com/openssl/openssl/blob/667a8501f0b6e5705fd611d5bb3ca24848b07154/crypto/pkcs7/pk7_smime.c#L150 // removing all the ones that are bad cryptography - &asn1::SequenceOfWriter::new([oid::AES_256_CBC_OID]), - &asn1::SequenceOfWriter::new([oid::AES_192_CBC_OID]), - &asn1::SequenceOfWriter::new([oid::AES_128_CBC_OID]), + asn1::SequenceOfWriter::new([oid::AES_256_CBC_OID]), + asn1::SequenceOfWriter::new([oid::AES_192_CBC_OID]), + asn1::SequenceOfWriter::new([oid::AES_128_CBC_OID]), ]))?; #[allow(clippy::type_complexity)] diff --git a/src/rust/src/x509/certificate.rs b/src/rust/src/x509/certificate.rs index 2fbf280eaf7b..5c18c2246db9 100644 --- a/src/rust/src/x509/certificate.rs +++ b/src/rust/src/x509/certificate.rs @@ -93,7 +93,7 @@ impl Certificate { py: pyo3::Python<'p>, algorithm: &pyo3::Bound<'p, pyo3::PyAny>, ) -> CryptographyResult> { - let serialized = asn1::write_single(&self.raw.borrow_dependent())?; + let serialized = asn1::write_single(self.raw.borrow_dependent())?; let mut h = hashes::Hash::new(py, algorithm, None)?; h.update_bytes(&serialized)?; diff --git a/src/rust/src/x509/crl.rs b/src/rust/src/x509/crl.rs index 4d4ca9540f4d..027c178efe42 100644 --- a/src/rust/src/x509/crl.rs +++ b/src/rust/src/x509/crl.rs @@ -93,7 +93,7 @@ pub(crate) struct CertificateRevocationList { impl CertificateRevocationList { fn public_bytes_der(&self) -> CryptographyResult> { - Ok(asn1::write_single(&self.owned.borrow_dependent())?) + Ok(asn1::write_single(self.owned.borrow_dependent())?) } fn revoked_cert(&self, py: pyo3::Python<'_>, idx: usize) -> RevokedCertificate { @@ -239,7 +239,7 @@ impl CertificateRevocationList { py: pyo3::Python<'p>, encoding: pyo3::Bound<'p, pyo3::PyAny>, ) -> CryptographyResult> { - let result = asn1::write_single(&self.owned.borrow_dependent())?; + let result = asn1::write_single(self.owned.borrow_dependent())?; encode_der_data(py, "X509 CRL".to_string(), result, &encoding) }