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

to review the following change.


Change subject: options: reject --hand-window 0
......................................................................

options: reject --hand-window 0

--hand-window was parsed with positive_atoi(), which accepts 0. A UDP
server then divided by zero in calculate_session_id_hmac() when the
first client reset arrived, and no handshake could complete within 0
seconds anyway.

Require a value of at least 1, like --tls-timeout.

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



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/01/2401/1

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 1e0b4d8..5997247 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -7494,7 +7494,10 @@
     else if (streq(p[0], "hand-window") && p[1] && !p[2])
     {
         VERIFY_PERMISSION(OPT_P_TLS_PARMS);
-        options->handshake_window = positive_atoi(p[1], msglevel);
+        if (!atoi_constrained(p[1], &options->handshake_window, p[0], 1, 
INT_MAX, msglevel))
+        {
+            goto err;
+        }
     }
     else if (streq(p[0], "tran-window") && p[1] && !p[2])
     {

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