]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Call ERR_clear_error on EVP_MD_fetch or EVP_##alg error
authorMark Andrews <marka@isc.org>
Tue, 5 Sep 2023 07:53:04 +0000 (17:53 +1000)
committerMark Andrews <marka@isc.org>
Wed, 6 Sep 2023 00:28:56 +0000 (00:28 +0000)
lib/isc/md.c

index da655c2e5832147547c0b7266832cb6b9844882c..0587bbaac82f5e79f62cf34f9f01be75773001aa 100644 (file)
@@ -181,6 +181,9 @@ const isc_md_type_t *isc__md_sha512 = NULL;
        {                                                          \
                REQUIRE(isc__md_##alg == NULL);                    \
                isc__md_##alg = EVP_MD_fetch(NULL, algname, NULL); \
+               if (isc__md_##alg == NULL) {                       \
+                       ERR_clear_error();                         \
+               }                                                  \
        }
 
 #define md_unregister_algorithm(alg)                                    \
@@ -195,6 +198,9 @@ const isc_md_type_t *isc__md_sha512 = NULL;
 #define md_register_algorithm(alg, algname)  \
        {                                    \
                isc__md_##alg = EVP_##alg(); \
+               if (isc__md_##alg == NULL) { \
+                       ERR_clear_error();   \
+               }                            \
        }
 #define md_unregister_algorithm(alg)
 #endif