Zeroize static ephemeral key buffer before free

F-2144

SetStaticEphemeralKey loaded a private key file into keyBuf and freed it
without ForceZero. Static ephemeral keys are long-lived, so zeroize the
buffer before XFREE.
This commit is contained in:
Juliusz Sosinowicz
2026-04-17 16:46:57 +02:00
parent 9790719955
commit fa3feb7442
+1
View File
@@ -18645,6 +18645,7 @@ static int SetStaticEphemeralKey(WOLFSSL_CTX* ctx,
#ifndef NO_FILESYSTEM
/* done with keyFile buffer */
if (keyFile && keyBuf) {
ForceZero(keyBuf, keySz);
XFREE(keyBuf, heap, DYNAMIC_TYPE_TMP_BUFFER);
}
#endif