Skip to content

Commit 6ef8e9f

Browse files
committed
Fix ASN.1 for S/MIME capabilities.
The current implementation defines the SMIMECapabilities attribute so that its value is a SEQUENCE of all the algorithm OIDs that are supported. However, the S/MIME v3 spec (RFC 2633) specifies that each algorithm should be specified in its own SEQUENCE: SMIMECapabilities ::= SEQUENCE OF SMIMECapability SMIMECapability ::= SEQUENCE { capabilityID OBJECT IDENTIFIER, parameters ANY DEFINED BY capabilityID OPTIONAL } (RFC 2633, Appendix A) This commit changes the implementation so that each algorithm is inside its own SEQUENCE. This also matches the OpenSSL implementation.
1 parent 4e7c2c7 commit 6ef8e9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rust/src/pkcs7.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ fn sign_and_serialize<'p>(
104104
// Subset of values OpenSSL provides:
105105
// https://github.com/openssl/openssl/blob/667a8501f0b6e5705fd611d5bb3ca24848b07154/crypto/pkcs7/pk7_smime.c#L150
106106
// removing all the ones that are bad cryptography
107-
AES_256_CBC_OID,
108-
AES_192_CBC_OID,
109-
AES_128_CBC_OID,
107+
&asn1::SequenceOfWriter::new([AES_256_CBC_OID]),
108+
&asn1::SequenceOfWriter::new([AES_192_CBC_OID]),
109+
&asn1::SequenceOfWriter::new([AES_128_CBC_OID]),
110110
]))?;
111111

112112
let py_signers: Vec<(

0 commit comments

Comments
 (0)