diff options
author | Yuri Penkin <yura.penkin@gmail.com> | 2023-05-23 23:32:23 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2023-06-01 09:49:01 +0200 |
commit | 745a716d9ebd6621bdfac655efe3296eda8fdd46 (patch) | |
tree | 019e58bc88d9e965b20b8f4ae577600e3cc79989 /crypto/evp/p5_crpt2.c | |
parent | 4e258b5fe98146f76bc2d41d366436492fa9ddd0 (diff) |
Ignore the fetch error when a legacy algorithm is found
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/21035)
(cherry picked from commit cb1f87f59d0b290eca9207ec4ef36d8073e6feec)
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 b7455be1cf..3561739023 100644 --- a/crypto/evp/p5_crpt2.c +++ b/crypto/evp/p5_crpt2.c @@ -231,13 +231,16 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, goto err; } + (void)ERR_set_mark(); prfmd = prfmd_fetch = EVP_MD_fetch(libctx, OBJ_nid2sn(hmac_md_nid), propq); if (prfmd == NULL) prfmd = EVP_get_digestbynid(hmac_md_nid); if (prfmd == NULL) { + (void)ERR_clear_last_mark(); ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF); goto err; } + (void)ERR_pop_to_mark(); if (kdf->salt->type != V_ASN1_OCTET_STRING) { ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE); |