Commit 654d4da0f5 for bind
commit 654d4da0f58693304cfe68c82152222a3c9c3635
Author: OndÅ™ej Surý <ondrej@isc.org>
Date: Wed Nov 25 12:11:24 2026 +0100
Wipe the hashed secret after creating an HMAC key
A secret longer than the block size of the digest is hashed before it
is stored in the HMAC key, and the hash, which can be used in place of
the secret, was left behind on the stack.
Assisted-by: Claude:claude-mythos-5-2
diff --git a/lib/isc/crypto/ossl3.c b/lib/isc/crypto/ossl3.c
index 6da322a54d..2189b60a80 100644
--- a/lib/isc/crypto/ossl3.c
+++ b/lib/isc/crypto/ossl3.c
@@ -334,6 +334,9 @@ isc_hmac_key_create(isc_md_type_t type, const void *secret, const size_t len,
memmove(key->secret, secret, key_len);
isc_mem_attach(mctx, &key->mctx);
+ /* The digest of a long secret is as good as the secret itself. */
+ isc_safe_memwipe(digest, sizeof(digest));
+
*keyp = key;
return ISC_R_SUCCESS;