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

to review the following change.


Change subject: crypto_epoch: wipe key material with secure_memzero()
......................................................................

crypto_epoch: wipe key material with secure_memzero()

CLEAR() is a plain memset(), which the compiler may drop for stack
variables that are not read afterwards. Use secure_memzero() for the
derived send/recv data keys and the epoch keys freed in
free_epoch_key_ctx().

Change-Id: Ic7ca54d4e2ec667532c0052f110aaf2e9ad5bf82
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/crypto_epoch.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/03/2103/1

diff --git a/src/openvpn/crypto_epoch.c b/src/openvpn/crypto_epoch.c
index 69a1852..35f9b55 100644
--- a/src/openvpn/crypto_epoch.c
+++ b/src/openvpn/crypto_epoch.c
@@ -181,7 +181,7 @@

     init_key_bi_ctx_send(&co->key_ctx_bi.encrypt, &send_key, 
&co->epoch_key_type, name);
     reset_packet_id_send(&co->packet_id.send);
-    CLEAR(send_key);
+    secure_memzero(&send_key, sizeof(send_key));
 }


@@ -196,7 +196,7 @@
     snprintf(name, sizeof(name), "Epoch Data key %" PRIu16, 
co->epoch_key_recv.epoch);

     init_key_bi_ctx_recv(ctx, &recv_key, &co->epoch_key_type, name);
-    CLEAR(recv_key);
+    secure_memzero(&recv_key, sizeof(recv_key));
 }

 void
@@ -346,8 +346,8 @@
     free(co->epoch_data_keys_future);
     free_key_ctx(&co->epoch_retiring_data_receive_key);
     free(co->epoch_retiring_key_pid_recv.seq_list);
-    CLEAR(co->epoch_key_recv);
-    CLEAR(co->epoch_key_send);
+    secure_memzero(&co->epoch_key_recv, sizeof(co->epoch_key_recv));
+    secure_memzero(&co->epoch_key_send, sizeof(co->epoch_key_send));
 }

 void

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2103?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: Ic7ca54d4e2ec667532c0052f110aaf2e9ad5bf82
Gerrit-Change-Number: 2103
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[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