Skip to content

Commit fa3feb7

Browse files
committed
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.
1 parent 9790719 commit fa3feb7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/ssl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18645,6 +18645,7 @@ static int SetStaticEphemeralKey(WOLFSSL_CTX* ctx,
1864518645
#ifndef NO_FILESYSTEM
1864618646
/* done with keyFile buffer */
1864718647
if (keyFile && keyBuf) {
18648+
ForceZero(keyBuf, keySz);
1864818649
XFREE(keyBuf, heap, DYNAMIC_TYPE_TMP_BUFFER);
1864918650
}
1865018651
#endif

0 commit comments

Comments
 (0)