Coverity 1453633: Error handling issues (CHECKED_RETURN)
authorPauli <paul.dale@oracle.com>
Sun, 8 Sep 2019 22:04:45 +0000 (08:04 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 10 Sep 2019 22:27:27 +0000 (08:27 +1000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9805)

providers/common/kdfs/pbkdf2.c

index ce395576dd54fb381203b5e4e072e692facac043..c8480125b20e81f35c5d7f39283871a7e350169d 100644 (file)
@@ -107,7 +107,9 @@ static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
 
     params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
                                                  SN_sha1, 0);
-    ossl_prov_digest_load_from_params(&ctx->digest, params, provctx);
+    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+        /* This is an error, but there is no way to indicate such directly */
+        ossl_prov_digest_reset(&ctx->digest);
     ctx->iter = PKCS5_DEFAULT_ITER;
     ctx->lower_bound_checks = KDF_PBKDF2_DEFAULT_CHECKS;
 }