Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2076?usp=email

to review the following change.


Change subject: auth_token: Wipe the server secret key after loading it
......................................................................

auth_token: Wipe the server secret key after loading it

auth_token_init_secret() reads the auth-token server key into a 2048
byte buffer, copies it into a struct key on the stack and frees the
buffer with free_buf(), so both copies of the key stay in memory.
tls_crypt_v2_init_server_key() already wipes its struct key after
init_key_ctx(); do the same here and clear the buffer before freeing it.

Found by scanning freed heap blocks for the key from test_auth_token.

Assisted-by: Claude Code:claude-opus-5-5
Change-Id: Ib5eb24b156acb5a99c614050fb1bd64fe46d8b52
Signed-off-by: Hansaem Wi <[email protected]>
---
M src/openvpn/auth_token.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/76/2076/1

diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c
index 969f37f..188e5e6 100644
--- a/src/openvpn/auth_token.c
+++ b/src/openvpn/auth_token.c
@@ -172,6 +172,8 @@
     key_parameters_from_key(&key_params, &key);
     init_key_ctx(key_ctx, &key_params, &kt, false, "auth-token secret");

+    secure_memzero(&key, sizeof(key));
+    buf_clear(&server_secret_key);
     free_buf(&server_secret_key);
 }


--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2076?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib5eb24b156acb5a99c614050fb1bd64fe46d8b52
Gerrit-Change-Number: 2076
Gerrit-PatchSet: 1
Gerrit-Owner: Hansaem Wi <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to