Store the number of extensions in CLIENTHELLO_MSG
authorBenjamin Kaduk <bkaduk@akamai.com>
Mon, 23 Jan 2017 22:59:23 +0000 (16:59 -0600)
committerRichard Levitte <levitte@openssl.org>
Thu, 23 Feb 2017 18:24:36 +0000 (19:24 +0100)
Keep track of the length of the pre_proc_exts array.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2279)

ssl/ssl_locl.h
ssl/statem/statem_srvr.c

index 655783426565460180b38442e80abc0b79240d98..f671860fa33964470bcd32248df480cecb3f04f8 100644 (file)
@@ -1797,6 +1797,7 @@ typedef struct {
     size_t compressions_len;
     unsigned char compressions[MAX_COMPRESSIONS_SIZE];
     PACKET extensions;
+    size_t pre_proc_exts_len;
     RAW_EXTENSION *pre_proc_exts;
 } CLIENTHELLO_MSG;
 
index 28f3b24cd6da374311987407f591e3fe4fadc7ef..ca020c551106a2ed9f6f9094d4cadd0c33573082 100644 (file)
@@ -1423,7 +1423,8 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt)
     /* Preserve the raw extensions PACKET for later use */
     extensions = clienthello.extensions;
     if (!tls_collect_extensions(s, &extensions, EXT_CLIENT_HELLO,
-                                &clienthello.pre_proc_exts, &al, NULL)) {
+                                &clienthello.pre_proc_exts, &al,
+                                &clienthello.pre_proc_exts_len)) {
         /* SSLerr already been called */
         goto f_err;
     }