File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
cryptography-x509-verification/src/policy Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ mod tests {
592
592
critical : bool ,
593
593
ext : & T ,
594
594
) -> Vec < u8 > {
595
- let ext_value = asn1:: write_single ( & ext) . unwrap ( ) ;
595
+ let ext_value = asn1:: write_single ( ext) . unwrap ( ) ;
596
596
let ext = Extension {
597
597
extn_id : oid,
598
598
critical,
Original file line number Diff line number Diff line change @@ -680,7 +680,7 @@ mod tests {
680
680
assert ! ( WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS . contains( & RSASSA_PSS_SHA256 . deref( ) ) ) ;
681
681
let exp_encoding = b"0A\x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \n 04\xa0 \x0f 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x01 \x05 \x00 \xa1 \x1c 0\x1a \x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \x08 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x01 \x05 \x00 \xa2 \x03 \x02 \x01 " ;
682
682
assert_eq ! (
683
- asn1:: write_single( & RSASSA_PSS_SHA256 . deref( ) ) . unwrap( ) ,
683
+ asn1:: write_single( RSASSA_PSS_SHA256 . deref( ) ) . unwrap( ) ,
684
684
exp_encoding
685
685
) ;
686
686
}
@@ -689,7 +689,7 @@ mod tests {
689
689
assert ! ( WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS . contains( & RSASSA_PSS_SHA384 . deref( ) ) ) ;
690
690
let exp_encoding = b"0A\x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \n 04\xa0 \x0f 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x02 \x05 \x00 \xa1 \x1c 0\x1a \x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \x08 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x02 \x05 \x00 \xa2 \x03 \x02 \x01 0" ;
691
691
assert_eq ! (
692
- asn1:: write_single( & RSASSA_PSS_SHA384 . deref( ) ) . unwrap( ) ,
692
+ asn1:: write_single( RSASSA_PSS_SHA384 . deref( ) ) . unwrap( ) ,
693
693
exp_encoding
694
694
) ;
695
695
}
@@ -698,7 +698,7 @@ mod tests {
698
698
assert ! ( WEBPKI_PERMITTED_SIGNATURE_ALGORITHMS . contains( & RSASSA_PSS_SHA512 . deref( ) ) ) ;
699
699
let exp_encoding = b"0A\x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \n 04\xa0 \x0f 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x03 \x05 \x00 \xa1 \x1c 0\x1a \x06 \t *\x86 H\x86 \xf7 \r \x01 \x01 \x08 0\r \x06 \t `\x86 H\x01 e\x03 \x04 \x02 \x03 \x05 \x00 \xa2 \x03 \x02 \x01 @" ;
700
700
assert_eq ! (
701
- asn1:: write_single( & RSASSA_PSS_SHA512 . deref( ) ) . unwrap( ) ,
701
+ asn1:: write_single( RSASSA_PSS_SHA512 . deref( ) ) . unwrap( ) ,
702
702
exp_encoding
703
703
) ;
704
704
}
Original file line number Diff line number Diff line change @@ -190,9 +190,9 @@ fn sign_and_serialize<'p>(
190
190
// Subset of values OpenSSL provides:
191
191
// https://github.com/openssl/openssl/blob/667a8501f0b6e5705fd611d5bb3ca24848b07154/crypto/pkcs7/pk7_smime.c#L150
192
192
// removing all the ones that are bad cryptography
193
- & asn1:: SequenceOfWriter :: new ( [ oid:: AES_256_CBC_OID ] ) ,
194
- & asn1:: SequenceOfWriter :: new ( [ oid:: AES_192_CBC_OID ] ) ,
195
- & asn1:: SequenceOfWriter :: new ( [ oid:: AES_128_CBC_OID ] ) ,
193
+ asn1:: SequenceOfWriter :: new ( [ oid:: AES_256_CBC_OID ] ) ,
194
+ asn1:: SequenceOfWriter :: new ( [ oid:: AES_192_CBC_OID ] ) ,
195
+ asn1:: SequenceOfWriter :: new ( [ oid:: AES_128_CBC_OID ] ) ,
196
196
] ) ) ?;
197
197
198
198
#[ allow( clippy:: type_complexity) ]
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ impl Certificate {
93
93
py : pyo3:: Python < ' p > ,
94
94
algorithm : & pyo3:: Bound < ' p , pyo3:: PyAny > ,
95
95
) -> CryptographyResult < pyo3:: Bound < ' p , pyo3:: types:: PyBytes > > {
96
- let serialized = asn1:: write_single ( & self . raw . borrow_dependent ( ) ) ?;
96
+ let serialized = asn1:: write_single ( self . raw . borrow_dependent ( ) ) ?;
97
97
98
98
let mut h = hashes:: Hash :: new ( py, algorithm, None ) ?;
99
99
h. update_bytes ( & serialized) ?;
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ pub(crate) struct CertificateRevocationList {
93
93
94
94
impl CertificateRevocationList {
95
95
fn public_bytes_der ( & self ) -> CryptographyResult < Vec < u8 > > {
96
- Ok ( asn1:: write_single ( & self . owned . borrow_dependent ( ) ) ?)
96
+ Ok ( asn1:: write_single ( self . owned . borrow_dependent ( ) ) ?)
97
97
}
98
98
99
99
fn revoked_cert ( & self , py : pyo3:: Python < ' _ > , idx : usize ) -> RevokedCertificate {
@@ -239,7 +239,7 @@ impl CertificateRevocationList {
239
239
py : pyo3:: Python < ' p > ,
240
240
encoding : pyo3:: Bound < ' p , pyo3:: PyAny > ,
241
241
) -> CryptographyResult < pyo3:: Bound < ' p , pyo3:: types:: PyBytes > > {
242
- let result = asn1:: write_single ( & self . owned . borrow_dependent ( ) ) ?;
242
+ let result = asn1:: write_single ( self . owned . borrow_dependent ( ) ) ?;
243
243
244
244
encode_der_data ( py, "X509 CRL" . to_string ( ) , result, & encoding)
245
245
}
You can’t perform that action at this time.
0 commit comments