OpenSSL 1.1.1-pre2
This commit is contained in:
@@ -12,6 +12,11 @@ package TLSProxy::ServerHello;
|
||||
use vars '@ISA';
|
||||
push @ISA, 'TLSProxy::Message';
|
||||
|
||||
my $hrrrandom = pack("C*", 0xCF, 0x21, 0xAD, 0x74, 0xE5, 0x9A, 0x61, 0x11, 0xBE,
|
||||
0x1D, 0x8C, 0x02, 0x1E, 0x65, 0xB8, 0x91, 0xC2, 0xA2,
|
||||
0x11, 0x16, 0x7A, 0xBB, 0x8C, 0x5E, 0x07, 0x9E, 0x09,
|
||||
0xE2, 0xC8, 0xA8, 0x33, 0x9C);
|
||||
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
@@ -45,16 +50,23 @@ sub parse
|
||||
my $self = shift;
|
||||
my $ptr = 2;
|
||||
my ($server_version) = unpack('n', $self->data);
|
||||
my $neg_version = $server_version;
|
||||
|
||||
my $random = substr($self->data, $ptr, 32);
|
||||
$ptr += 32;
|
||||
my $session_id_len = unpack('C', substr($self->data, $ptr));
|
||||
my $session_id_len = 0;
|
||||
my $session = "";
|
||||
$session_id_len = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
my $session = substr($self->data, $ptr, $session_id_len);
|
||||
$session = substr($self->data, $ptr, $session_id_len);
|
||||
$ptr += $session_id_len;
|
||||
|
||||
my $ciphersuite = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my $comp_meth = unpack('C', substr($self->data, $ptr));
|
||||
my $comp_meth = 0;
|
||||
$comp_meth = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
|
||||
my $extensions_len = unpack('n', substr($self->data, $ptr));
|
||||
if (!defined $extensions_len) {
|
||||
$extensions_len = 0;
|
||||
@@ -82,6 +94,20 @@ sub parse
|
||||
my $extdata = substr($extension_data, 4, $size);
|
||||
$extension_data = substr($extension_data, 4 + $size);
|
||||
$extensions{$type} = $extdata;
|
||||
if ($type == TLSProxy::Message::EXT_SUPPORTED_VERSIONS) {
|
||||
$neg_version = unpack('n', $extdata);
|
||||
}
|
||||
}
|
||||
|
||||
if ($random eq $hrrrandom) {
|
||||
TLSProxy::Proxy->is_tls13(1);
|
||||
# TODO(TLS1.3): Replace this reference to draft version before release
|
||||
} elsif ($neg_version == TLSProxy::Record::VERS_TLS_1_3_DRAFT) {
|
||||
$neg_version = TLSProxy::Record::VERS_TLS_1_3;
|
||||
TLSProxy::Proxy->is_tls13(1);
|
||||
|
||||
TLSProxy::Record->server_encrypting(1);
|
||||
TLSProxy::Record->client_encrypting(1);
|
||||
}
|
||||
|
||||
$self->server_version($server_version);
|
||||
@@ -89,11 +115,13 @@ sub parse
|
||||
$self->session_id_len($session_id_len);
|
||||
$self->session($session);
|
||||
$self->ciphersuite($ciphersuite);
|
||||
TLSProxy::Proxy->ciphersuite($ciphersuite);
|
||||
$self->comp_meth($comp_meth);
|
||||
$self->extension_data(\%extensions);
|
||||
|
||||
$self->process_data();
|
||||
|
||||
|
||||
print " Server Version:".$server_version."\n";
|
||||
print " Session ID Len:".$session_id_len."\n";
|
||||
print " Ciphersuite:".$ciphersuite."\n";
|
||||
@@ -145,9 +173,9 @@ sub server_version
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{client_version} = shift;
|
||||
$self->{server_version} = shift;
|
||||
}
|
||||
return $self->{client_version};
|
||||
return $self->{server_version};
|
||||
}
|
||||
sub random
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user