From b4c6e37e7428eec3d46b6737b60df8e423d0a8df Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 21 Nov 2016 16:22:00 +0000 Subject: Add more TLS1.3 record tests Add some tests for the new record construction Reviewed-by: Rich Salz --- util/TLSProxy/Record.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/TLSProxy/Record.pm b/util/TLSProxy/Record.pm index fe78185ccc..202c1ec9a6 100644 --- a/util/TLSProxy/Record.pm +++ b/util/TLSProxy/Record.pm @@ -195,7 +195,8 @@ sub new data => $data, decrypt_data => $decrypt_data, orig_decrypt_data => $decrypt_data, - encrypted => 0 + encrypted => 0, + outer_content_type => RT_APPLICATION_DATA }; return bless $self, $class; @@ -289,7 +290,7 @@ sub reconstruct_record $data = pack('n', $self->len | 0x8000); } else { if (TLSProxy::Proxy->is_tls13() && $self->encrypted) { - $data = pack('Cnn', RT_APPLICATION_DATA, $self->version, + $data = pack('Cnn', $self->outer_content_type, $self->version, $self->len + 1); $tls13_enc = 1; } else { @@ -386,4 +387,12 @@ sub encrypted } return $self->{encrypted}; } +sub outer_content_type +{ + my $self = shift; + if (@_) { + $self->{outer_content_type} = shift; + } + return $self->{outer_content_type}; +} 1; -- cgit v1.2.3