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/+/2075?usp=email

to review the following change.


Change subject: ssl: Wipe the key source material in key_state_free()
......................................................................

ssl: Wipe the key source material in key_state_free()

ks->key_src holds the pre_master and random values that the peers
exchange in key method 2. It is wiped after the data channel keys have
been generated and on the error paths of key_method_2_read() and
key_method_2_write(). When a key state is freed before the keys are
generated, for example because an --auth-user-pass-verify script or a
client-connect script rejects the client, key_state_free() frees it
with plain free() and the key material stays in freed memory, on the
server and on the client.

Wipe it with secure_memzero() before freeing it.

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



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/75/2075/1

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 086a6fc..eef8e7d 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -934,6 +934,10 @@

     free(ks->rec_ack);
     free(ks->lru_acks);
+    if (ks->key_src)
+    {
+        secure_memzero(ks->key_src, sizeof(*ks->key_src));
+    }
     free(ks->key_src);

     packet_id_free(&ks->crypto_options.packet_id);

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2075?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: I4d35f54402460c5866aeba26216ac1b2d2f8ebdc
Gerrit-Change-Number: 2075
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