Add missing assignment to EVP_get_digestbynid()
authorndossche <niels.dossche@ugent.be>
Tue, 7 Mar 2023 12:27:15 +0000 (13:27 +0100)
committerPauli <pauli@openssl.org>
Tue, 14 Mar 2023 21:33:41 +0000 (08:33 +1100)
The assignment of the result of EVP_get_digestbynid() did not happen
which made the fallback not actually perform the fallback.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20447)

crypto/evp/evp_pbe.c

index 5208f7cef8418dea10bc106722dbbfb615f08cd6..d943dfeaddfd12df6c4160536e002b7bfa2b1f97 100644 (file)
@@ -143,7 +143,7 @@ int EVP_PBE_CipherInit_ex(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
         md = md_fetch = EVP_MD_fetch(libctx, OBJ_nid2sn(md_nid), propq);
         /* Fallback to legacy method */
         if (md == NULL)
-            EVP_get_digestbynid(md_nid);
+            md = EVP_get_digestbynid(md_nid);
 
         if (md == NULL) {
             (void)ERR_clear_last_mark();