Allow a zero length extension block
authorAdam Langley <agl@google.com>
Fri, 12 Jun 2015 07:05:49 +0000 (08:05 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 12 Jun 2015 14:40:33 +0000 (15:40 +0100)
It is valid for an extension block to be present in a ClientHello, but to
be of zero length.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/t1_lib.c

index f0565a2291fff9d6a1cb0666f5ff21976893171d..402047a237b1f9f2b8e4f7f01828374a2f1f97c7 100644 (file)
@@ -1940,12 +1940,12 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
 
     s->srtp_profile = NULL;
 
-    if (data >= (d + n - 2)) {
-        if (data != d + n)
-            goto err;
-        else
-            goto ri_check;
-    }
+    if (data == d + n)
+        goto ri_check;
+
+    if (data > (d + n - 2))
+        goto err;
+
     n2s(data, len);
 
     if (data > (d + n - len))