diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-05-29 17:16:22 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2021-06-01 15:28:18 +1000 |
commit | 3c15d677054b952c707aeaf781aec42b86a54ebb (patch) | |
tree | 8c5ab3b0a701a67ba464358bf157271b303c74ac /crypto/evp/p5_crpt2.c | |
parent | 9ff4b7b0c7b445bcc9b98fde9107fa9520d17f04 (diff) |
Fix error stack for some fetch calls.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15532)
Diffstat (limited to 'crypto/evp/p5_crpt2.c')
-rw-r--r-- | crypto/evp/p5_crpt2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c index e7a2b51091..54773304fd 100644 --- a/crypto/evp/p5_crpt2.c +++ b/crypto/evp/p5_crpt2.c @@ -141,15 +141,18 @@ int PKCS5_v2_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, goto err; } + (void)ERR_set_mark(); cipher = cipher_fetch = EVP_CIPHER_fetch(libctx, ciph_name, propq); /* Fallback to legacy method */ if (cipher == NULL) cipher = EVP_get_cipherbyname(ciph_name); if (cipher == NULL) { + (void)ERR_clear_last_mark(); ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER); goto err; } + (void)ERR_pop_to_mark(); /* Fixup cipher based on AlgorithmIdentifier */ if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de)) |