Fix DTLS1.2 buffers
authorHiroyuki YAMAMORI <h-yamamo@db3.so-net.ne.jp>
Wed, 26 Aug 2015 13:45:40 +0000 (14:45 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 1 Sep 2015 23:34:14 +0000 (00:34 +0100)
Fix the setup of DTLS1.2 buffers to take account of the Header

Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/record/ssl3_buffer.c

index 66fb721..7685e69 100644 (file)
@@ -147,7 +147,7 @@ int ssl3_setup_read_buffer(SSL *s)
     
     b = RECORD_LAYER_get_rbuf(&s->rlayer);
 
-    if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
+    if (SSL_IS_DTLS(s))
         headerlen = DTLS1_RT_HEADER_LENGTH;
     else
         headerlen = SSL3_RT_HEADER_LENGTH;
@@ -189,7 +189,7 @@ int ssl3_setup_write_buffer(SSL *s)
 
     wb = RECORD_LAYER_get_wbuf(&s->rlayer);
 
-    if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
+    if (SSL_IS_DTLS(s))
         headerlen = DTLS1_RT_HEADER_LENGTH + 1;
     else
         headerlen = SSL3_RT_HEADER_LENGTH;