提交 fb0bc2b2 编写于 作者: G Gabor Tyukasz 提交者: Matt Caswell

Fix race condition in ssl_parse_serverhello_tlsext

CVE-2014-3509
Reviewed-by: NTim Hudson <tjh@openssl.org>
Reviewed-by: NDr. Stephen Henson <steve@openssl.org>
上级 0042fb5f
...@@ -2647,6 +2647,8 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char ...@@ -2647,6 +2647,8 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char
*al = TLS1_AD_DECODE_ERROR; *al = TLS1_AD_DECODE_ERROR;
return 0; return 0;
} }
if (!s->hit)
{
s->session->tlsext_ecpointformatlist_length = 0; s->session->tlsext_ecpointformatlist_length = 0;
if (s->session->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->session->tlsext_ecpointformatlist); if (s->session->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->session->tlsext_ecpointformatlist);
if ((s->session->tlsext_ecpointformatlist = OPENSSL_malloc(ecpointformatlist_length)) == NULL) if ((s->session->tlsext_ecpointformatlist = OPENSSL_malloc(ecpointformatlist_length)) == NULL)
...@@ -2656,6 +2658,7 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char ...@@ -2656,6 +2658,7 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char
} }
s->session->tlsext_ecpointformatlist_length = ecpointformatlist_length; s->session->tlsext_ecpointformatlist_length = ecpointformatlist_length;
memcpy(s->session->tlsext_ecpointformatlist, sdata, ecpointformatlist_length); memcpy(s->session->tlsext_ecpointformatlist, sdata, ecpointformatlist_length);
}
#if 0 #if 0
fprintf(stderr,"ssl_parse_serverhello_tlsext s->session->tlsext_ecpointformatlist "); fprintf(stderr,"ssl_parse_serverhello_tlsext s->session->tlsext_ecpointformatlist ");
sdata = s->session->tlsext_ecpointformatlist; sdata = s->session->tlsext_ecpointformatlist;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册