From: Hiroyuki YAMAMORI Date: Wed, 26 Aug 2015 13:45:40 +0000 (+0100) Subject: Fix DTLS1.2 buffers X-Git-Tag: OpenSSL_1_1_0-pre1~741 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=246b52f39aac36d1f4bc705c27c6354cb67041f4;p=oweals%2Fopenssl.git Fix DTLS1.2 buffers Fix the setup of DTLS1.2 buffers to take account of the Header Reviewed-by: Emilia Käsper Reviewed-by: Matt Caswell --- diff --git a/ssl/record/ssl3_buffer.c b/ssl/record/ssl3_buffer.c index 66fb721b1d..7685e69262 100644 --- a/ssl/record/ssl3_buffer.c +++ b/ssl/record/ssl3_buffer.c @@ -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;