From 7f89f2d6bc9279f9e9aa3d656ac02917e96e970d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 5 Sep 2023 17:53:04 +1000 Subject: [PATCH] Call ERR_clear_error on EVP_MD_fetch or EVP_##alg error (cherry picked from commit 28adcf1831715735e3af4428f334c9dae18db62f) --- lib/isc/md.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/isc/md.c b/lib/isc/md.c index 53ce2c16c7..a8c63129e2 100644 --- a/lib/isc/md.c +++ b/lib/isc/md.c @@ -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);