diff options
author | Matt Caswell <matt@openssl.org> | 2016-08-02 17:24:54 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-15 23:14:30 +0100 |
commit | a2a0c86bb0d602253d02ded2a848ed69e8cc425a (patch) | |
tree | 55052ad87615adcd3848bd0ff2abfc9c87d227dd /util/TLSProxy/Record.pm | |
parent | a01c86a25198921c5b8adb45c9379088ace4e42e (diff) | |
download | openssl-a2a0c86bb0d602253d02ded2a848ed69e8cc425a.tar.gz |
Add some SSLv2 ClientHello tests
Test that we handle a TLS ClientHello in an SSLv2 record correctly.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'util/TLSProxy/Record.pm')
-rw-r--r-- | util/TLSProxy/Record.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/util/TLSProxy/Record.pm b/util/TLSProxy/Record.pm index 2a605e33a7..423bad3bf1 100644 --- a/util/TLSProxy/Record.pm +++ b/util/TLSProxy/Record.pm @@ -98,6 +98,7 @@ sub get_records $content_type, $version, $len, + 0, $len_real, $decrypt_len, substr($packet, TLS_RECORD_HEADER_LENGTH, $len_real), @@ -167,6 +168,7 @@ sub new $content_type, $version, $len, + $sslv2, $len_real, $decrypt_len, $data, @@ -177,6 +179,7 @@ sub new content_type => $content_type, version => $version, len => $len, + sslv2 => $sslv2, len_real => $len_real, decrypt_len => $decrypt_len, data => $data, @@ -247,7 +250,11 @@ sub reconstruct_record my $self = shift; my $data; - $data = pack('Cnn', $self->content_type, $self->version, $self->len); + if ($self->sslv2) { + $data = pack('n', $self->len | 0x8000); + } else { + $data = pack('Cnn', $self->content_type, $self->version, $self->len); + } $data .= $self->data; return $data; @@ -269,6 +276,11 @@ sub version my $self = shift; return $self->{version}; } +sub sslv2 +{ + my $self = shift; + return $self->{sslv2}; +} sub len_real { my $self = shift; |