提交 feba02f3 编写于 作者: D Dr. Stephen Henson 提交者: Matt Caswell

Fix crash in dtls1_get_record whilst in the listen state where you get two

separate reads performed - one for the header and one for the body of the
handshake record.

CVE-2014-3571
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 4a4d4158
...@@ -645,8 +645,6 @@ again: ...@@ -645,8 +645,6 @@ again:
/* now s->packet_length == DTLS1_RT_HEADER_LENGTH */ /* now s->packet_length == DTLS1_RT_HEADER_LENGTH */
i=rr->length; i=rr->length;
n=ssl3_read_n(s,i,i,1); n=ssl3_read_n(s,i,i,1);
if (n <= 0) return(n); /* error or non-blocking io */
/* this packet contained a partial record, dump it */ /* this packet contained a partial record, dump it */
if ( n != i) if ( n != i)
{ {
......
...@@ -197,6 +197,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend) ...@@ -197,6 +197,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
* at once (as long as it fits into the buffer). */ * at once (as long as it fits into the buffer). */
if (SSL_IS_DTLS(s)) if (SSL_IS_DTLS(s))
{ {
if (left == 0 && extend)
return 0;
if (left > 0 && n > left) if (left > 0 && n > left)
n = left; n = left;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册