Send TLSv1.2 as the record version when using TLSv1.3

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/4701)
This commit is contained in:
Matt Caswell 2017-11-07 16:04:35 +00:00
parent a5816a5ab9
commit 2d729db2f0
2 changed files with 4 additions and 3 deletions

View file

@ -816,7 +816,8 @@ 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++) {
unsigned int version = SSL_TREAT_AS_TLS13(s) ? TLS1_VERSION : s->version;
unsigned int version = SSL_TREAT_AS_TLS13(s) ? TLS1_2_VERSION
: s->version;
unsigned char *compressdata = NULL;
size_t maxcomplen;
unsigned int rectype;

View file

@ -87,7 +87,7 @@ $testtype = REVERSE_ORDER_VERSIONS;
$proxy->start();
$record = pop @{$proxy->record_list};
ok(TLSProxy::Message->success()
&& $record->version() == TLSProxy::Record::VERS_TLS_1_0
&& $record->version() == TLSProxy::Record::VERS_TLS_1_2
&& TLSProxy::Proxy->is_tls13(),
"Reverse order versions");
@ -107,7 +107,7 @@ $testtype = WITH_TLS1_4;
$proxy->start();
$record = pop @{$proxy->record_list};
ok(TLSProxy::Message->success()
&& $record->version() == TLSProxy::Record::VERS_TLS_1_0
&& $record->version() == TLSProxy::Record::VERS_TLS_1_2
&& TLSProxy::Proxy->is_tls13(),
"TLS1.4 in supported versions extension");