From 900efd613f18bd75168fc183ae97bcbe99da49a7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 13 Jul 2023 14:41:00 +1000 Subject: [PATCH] Clear OpenSSL errors on SHA failures (cherry picked from commit 247422c69fe7a865408e3ad099c37f4c5db32027) --- lib/isc/iterated_hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/isc/iterated_hash.c b/lib/isc/iterated_hash.c index 80d219c56b..ad623814e6 100644 --- a/lib/isc/iterated_hash.c +++ b/lib/isc/iterated_hash.c @@ -44,18 +44,22 @@ isc_iterated_hash(unsigned char *out, const unsigned int hashalg, do { if (SHA1_Init(&ctx) != 1) { + ERR_clear_error(); return (0); } if (SHA1_Update(&ctx, buf, len) != 1) { + ERR_clear_error(); return (0); } if (SHA1_Update(&ctx, salt, saltlength) != 1) { + ERR_clear_error(); return (0); } if (SHA1_Final(out, &ctx) != 1) { + ERR_clear_error(); return (0); }