diff options
author | David von Oheimb <dev@ddvo.net> | 2022-07-31 07:15:40 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2022-09-16 10:07:15 +0200 |
commit | 4fdc16af05d5e1e79ffebbae2b427f3a388227e3 (patch) | |
tree | 65739aaeaf3df49054961932093793fc2950d828 /crypto/pkcs7/pk7_smime.c | |
parent | fcff5bd43c85418cc4aa8052e3dc3dba344d763e (diff) |
X509_STORE_CTX_set_default(): improve error handling, also in its use
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/18918)
Diffstat (limited to 'crypto/pkcs7/pk7_smime.c')
-rw-r--r-- | crypto/pkcs7/pk7_smime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index 5dbf6bdc14..21a317446d 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -281,7 +281,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, ERR_raise(ERR_LIB_PKCS7, ERR_R_X509_LIB); goto err; } - X509_STORE_CTX_set_default(cert_ctx, "smime_sign"); + if (!X509_STORE_CTX_set_default(cert_ctx, "smime_sign")) + goto err; } else if (!X509_STORE_CTX_init(cert_ctx, store, signer, NULL)) { ERR_raise(ERR_LIB_PKCS7, ERR_R_X509_LIB); goto err; |