]> 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)
committerOndřej Surý <ondrej@isc.org>
Wed, 6 Sep 2023 15:47:05 +0000 (15:47 +0000)
(cherry picked from commit 28adcf1831715735e3af4428f334c9dae18db62f)

lib/isc/md.c

index 53ce2c16c7efc0714f8ed71f3e5b53d0c703846e..a8c63129e2f92458d4987b9e55ca005790596cc3 100644 (file)
@@ -168,8 +168,14 @@ end:
        return (res);
 }
 
-#define md_register_algorithm(alg) \
-       const isc_md_type_t *isc__md_##alg(void) { return (EVP_##alg()); }
+#define md_register_algorithm(alg)                        \
+       const isc_md_type_t *isc__md_##alg(void) {        \
+               const isc_md_type_t *value = EVP_##alg(); \
+               if (value == NULL) {                      \
+                       ERR_clear_error();                \
+               }                                         \
+               return (value);                           \
+       }
 
 md_register_algorithm(md5);
 md_register_algorithm(sha1);