Always use TLSv1.0 for record layer version in TLSv1.3
authorMatt Caswell <matt@openssl.org>
Mon, 2 Jan 2017 11:40:16 +0000 (11:40 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 10 Jan 2017 23:02:50 +0000 (23:02 +0000)
TLSv1.3 freezes the record layer version and ensures that it is always set
to TLSv1.0. Some implementations check this.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2157)

ssl/record/rec_layer_s3.c

index 3ffe29ad0052261300c23e92d7b976b3b70f4d3a..01e3db26cbe68cefb715e5a78991a78fa56a2f8a 100644 (file)
@@ -784,7 +784,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
     /* Clear our SSL3_RECORD structures */
     memset(wr, 0, sizeof wr);
     for (j = 0; j < numpipes; j++) {
     /* Clear our SSL3_RECORD structures */
     memset(wr, 0, sizeof wr);
     for (j = 0; j < numpipes; j++) {
-        unsigned int version = s->version;
+        unsigned int version = SSL_IS_TLS13(s) ? TLS1_VERSION : s->version;
         unsigned char *compressdata = NULL;
         size_t maxcomplen;
         unsigned int rectype;
         unsigned char *compressdata = NULL;
         size_t maxcomplen;
         unsigned int rectype;