summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7/pk7_smime.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-12-11 19:24:46 +1000
committerTomas Mraz <tomas@openssl.org>2021-01-18 15:01:26 +0100
commit038f4dc68edd16f719ce5cf140eda2fb5b86a62a (patch)
treec91c66bd82817b4bd83810278bc5b0074854d69d /crypto/pkcs7/pk7_smime.c
parent84af8027c5f2132a9166673e7a47b0f31c7cfe1d (diff)
Fix PKCS7 potential segfault
As the code that handles libctx, propq for PKCS7 is very similar to CMS code, a similiar fix for issue #13624 needs to be applied. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13668)
Diffstat (limited to 'crypto/pkcs7/pk7_smime.c')
-rw-r--r--crypto/pkcs7/pk7_smime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c
index 770534d9f6..b5dfc916a5 100644
--- a/crypto/pkcs7/pk7_smime.c
+++ b/crypto/pkcs7/pk7_smime.c
@@ -266,7 +266,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
/* Now verify the certificates */
p7_ctx = pkcs7_get0_ctx(p7);
- cert_ctx = X509_STORE_CTX_new_ex(p7_ctx->libctx, p7_ctx->propq);
+ cert_ctx = X509_STORE_CTX_new_ex(pkcs7_ctx_get0_libctx(p7_ctx),
+ pkcs7_ctx_get0_propq(p7_ctx));
if (cert_ctx == NULL)
goto err;
if (!(flags & PKCS7_NOVERIFY))