Clear existing extension state.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 5 Dec 2014 13:39:14 +0000 (13:39 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 2 Jan 2015 22:30:20 +0000 (22:30 +0000)
When parsing ClientHello clear any existing extension state from
SRP login and SRTP profile.

Thanks to Karthikeyan Bhargavan for reporting this issue.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 47606dda672a5008168f62d4b7d7f94cd2d31313)

Conflicts:
ssl/t1_lib.c

ssl/t1_lib.c

index 1a5f4c1..179b467 100644 (file)
@@ -1005,6 +1005,16 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
                ssl_check_for_safari(s, data, d, n);
 #endif /* !OPENSSL_NO_EC */
 
+#ifndef OPENSSL_NO_SRP
+       if (s->srp_ctx.login != NULL)
+               {
+               OPENSSL_free(s->srp_ctx.login);
+               s->srp_ctx.login = NULL;
+               }
+#endif
+
+       s->srtp_profile = NULL;
+
        if (data >= (d+n-2))
                goto ri_check;
        n2s(data,len);