diff options
author | Matt Caswell <matt@openssl.org> | 2016-10-28 15:57:12 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-11-02 13:28:21 +0000 |
commit | 837e591d42ae499c89930a7277005c5034a12b04 (patch) | |
tree | dca6dabb07739b129e09bb65e317ad0095bf8473 /util/TLSProxy | |
parent | aad22ba2c6172508f70263bcf53f6af6257c8b14 (diff) | |
download | openssl-new-837e591d42ae499c89930a7277005c5034a12b04.tar.gz |
Enable TLSProxy to talk TLS1.3
Now that ossltest knows about a TLS1.3 cipher we can now do TLS1.3 in
TLSProxy
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'util/TLSProxy')
-rw-r--r-- | util/TLSProxy/Proxy.pm | 8 | ||||
-rw-r--r-- | util/TLSProxy/Record.pm | 27 |
2 files changed, 19 insertions, 16 deletions
diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm index c15019dace..16fd09463f 100644 --- a/util/TLSProxy/Proxy.pm +++ b/util/TLSProxy/Proxy.pm @@ -48,7 +48,7 @@ sub new cert => $cert, debug => $debug, cipherc => "", - ciphers => "AES128-SHA", + ciphers => "AES128-SHA:TLS13-AES-128-GCM-SHA256", flight => 0, record_list => [], message_list => [], @@ -113,7 +113,7 @@ sub clear my $self = shift; $self->clearClient; - $self->{ciphers} = "AES128-SHA"; + $self->{ciphers} = "AES128-SHA:TLS13-AES-128-GCM-SHA256"; $self->{serverflags} = ""; $self->{serverconnects} = 1; $self->{serverpid} = 0; @@ -147,10 +147,8 @@ sub start or die "Failed to redirect stdout: $!"; open(STDERR, ">&STDOUT"); } - # TODO(TLS1.3): Temporarily disabled for TLS1.3...no shared cipher - # because the TLS1.3 ciphersuites are not compatible with ossltest my $execcmd = $self->execute - ." s_server -no_tls1_3 -no_comp -rev -engine ossltest -accept " + ." s_server -no_comp -rev -engine ossltest -accept " .($self->server_port) ." -cert ".$self->cert." -naccept ".$self->serverconnects; if ($self->ciphers ne "") { diff --git a/util/TLSProxy/Record.pm b/util/TLSProxy/Record.pm index 423bad3bf1..93a3a4bd5e 100644 --- a/util/TLSProxy/Record.pm +++ b/util/TLSProxy/Record.pm @@ -107,7 +107,7 @@ sub get_records if (($server && $server_ccs_seen) || (!$server && $client_ccs_seen)) { - if ($etm) { + if ($version != VERS_TLS_1_3() && $etm) { $record->decryptETM(); } else { $record->decrypt(); @@ -221,22 +221,27 @@ sub decryptETM sub decrypt() { my ($self) = shift; - + my $mactaglen = 20; my $data = $self->data; - if($self->version >= VERS_TLS_1_1()) { - #TLS1.1+ has an explicit IV. Throw it away + #Throw away any IVs + if ($self->version >= VERS_TLS_1_3()) { + #8 bytes for a GCM IV + $data = substr($data, 8); + $mactaglen = 16; + } elsif ($self->version >= VERS_TLS_1_1()) { + #16 bytes for a standard IV $data = substr($data, 16); - } - #Find out what the padding byte is - my $padval = unpack("C", substr($data, length($data) - 1)); + #Find out what the padding byte is + my $padval = unpack("C", substr($data, length($data) - 1)); - #Throw away the padding - $data = substr($data, 0, length($data) - ($padval + 1)); + #Throw away the padding + $data = substr($data, 0, length($data) - ($padval + 1)); + } - #Throw away the MAC (assumes MAC is 20 bytes for now. FIXME) - $data = substr($data, 0, length($data) - 20); + #Throw away the MAC or TAG + $data = substr($data, 0, length($data) - $mactaglen); $self->decrypt_data($data); $self->decrypt_len(length($data)); |