From: Abel Tom Date: Wed, 17 Jun 2026 10:11:29 +0000 (+0200) Subject: crypto/pkcs7/pk7_lib.c: fix return value in PKCS7_set_digest() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=206ec55fec48d37960e01df1e12f0ed71a200c35;p=thirdparty%2Fopenssl.git crypto/pkcs7/pk7_lib.c: fix return value in PKCS7_set_digest() Return 0 when the passed object to PKCS7_set_digest() is not of type PKCS7 digest. Fixes: c5a55463892d "Add support for digested data PKCS#7 type." Resolves: https://github.com/openssl/openssl/issues/31551 Reviewed-by: Matt Caswell Reviewed-by: Norbert Pocs Reviewed-by: Eugene Syromiatnikov Reviewed-by: Tim Hudson MergeDate: Mon Jun 22 08:17:32 2026 (Merged from https://github.com/openssl/openssl/pull/31559) --- diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index 0a1d0f61a54..a9640769cf0 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -537,7 +537,7 @@ int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md) } ERR_raise(ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE); - return 1; + return 0; } STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7)