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);