Support signedAndEnveloped content in PKCS7_decrypt()

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Tomas Mraz 2023-01-18 18:07:55 +01:00
parent c47b6fe9e6
commit 35da6af1f8

View 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;
}