Fix DTLS1.2 buffers
authorHiroyuki YAMAMORI <h-yamamo@db3.so-net.ne.jp>
Wed, 26 Aug 2015 14:04:09 +0000 (15:04 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 1 Sep 2015 23:37:58 +0000 (00:37 +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/s3_both.c

index 019e21cd02741ccc70c1a81b11cffe9be535fd3a..09d0661e81f64ee75335a352ee012f044357ef38 100644 (file)
@@ -648,7 +648,7 @@ int ssl3_setup_read_buffer(SSL *s)
     unsigned char *p;
     size_t len, align = 0, headerlen;
 
-    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;
@@ -687,7 +687,7 @@ int ssl3_setup_write_buffer(SSL *s)
     unsigned char *p;
     size_t len, align = 0, headerlen;
 
-    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;