Support signedAndEnveloped content in PKCS7_decrypt()
authorTomas Mraz <tomas@openssl.org>
Wed, 18 Jan 2023 17:07:55 +0000 (18:07 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 7 Feb 2023 16:05:10 +0000 (17:05 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/pkcs7/pk7_smime.c

index a635e4ddceffe2158f88126a16410942cb947918..5b7b8e26badbe2b1c61934a8f051b8d3f7af8d17 100644 (file)
@@ -481,7 +481,8 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags)
         return 0;
     }
 
-    if (!PKCS7_type_is_enveloped(p7)) {
+    if (!PKCS7_type_is_enveloped(p7)
+        && !PKCS7_type_is_signedAndEnveloped(p7)) {
         ERR_raise(ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE);
         return 0;
     }