From d1d7d3d26a5c1030b35cfe0848858f305150423a Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 11 Jan 2015 20:30:21 -0500 Subject: [PATCH] Clear existing extension state. When parsing ClientHello clear any existing extension state from SRP login and SRTP profile. (Imported from upstream's 4f605ccb779e32a770093d687e0554e0bbb137d3) More state that should be systematically reset across handshakes. Add a reset on the ServerHello end too since that was missed. Change-Id: Ibb4549acddfd87caf7b6ff853e2adbfa4b7e7856 Reviewed-on: https://boringssl-review.googlesource.com/2838 Reviewed-by: Adam Langley --- ssl/t1_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index a420989c..799f2402 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1394,6 +1394,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, CBS *cbs, int *out_alert) { CBS extensions; s->should_ack_sni = 0; + s->srtp_profile = NULL; s->s3->next_proto_neg_seen = 0; s->s3->tmp.certificate_status_expected = 0; s->s3->tmp.extended_master_secret = 0; @@ -1746,10 +1747,10 @@ static int ssl_scan_serverhello_tlsext(SSL *s, CBS *cbs, int *out_alert) { * systematically reset on a new handshake; perhaps allocate it fresh each * time so it's not even kept around post-handshake. */ s->s3->next_proto_neg_seen = 0; - s->tlsext_ticket_expected = 0; s->s3->tmp.certificate_status_expected = 0; s->s3->tmp.extended_master_secret = 0; + s->srtp_profile = NULL; if (s->s3->alpn_selected) { OPENSSL_free(s->s3->alpn_selected);