Clear OpenSSL errors on SHA failures
(cherry picked from commit 247422c69f)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user