Imported OpenSSL 1.1.1b
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -16,7 +16,7 @@ sub new
|
||||
$encrypted,
|
||||
$level,
|
||||
$description) = @_;
|
||||
|
||||
|
||||
my $self = {
|
||||
server => $server,
|
||||
encrypted => $encrypted,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -138,11 +138,6 @@ sub set_message_contents
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
}
|
||||
}
|
||||
$data = pack('C', length($self->context()));
|
||||
$data .= $self->context;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -124,11 +124,6 @@ sub extension_contents
|
||||
$extension .= pack("n", $key);
|
||||
$extension .= pack("n", length($extdata));
|
||||
$extension .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
$extension .= pack("n", $key);
|
||||
$extension .= pack("n", length($extdata));
|
||||
$extension .= $extdata;
|
||||
}
|
||||
return $extension;
|
||||
}
|
||||
|
||||
@@ -151,6 +146,8 @@ sub set_message_contents
|
||||
foreach my $key (keys %{$self->extension_data}) {
|
||||
next if ($key == TLSProxy::Message::EXT_PSK);
|
||||
$extensions .= $self->extension_contents($key);
|
||||
#Add extension twice if we are duplicating that extension
|
||||
$extensions .= $self->extension_contents($key) if ($key == $self->dupext);
|
||||
}
|
||||
#PSK extension always goes last...
|
||||
if (defined ${$self->extension_data}{TLSProxy::Message::EXT_PSK}) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -81,11 +81,6 @@ sub set_message_contents
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
}
|
||||
}
|
||||
|
||||
$data = pack('n', length($extensions));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -86,10 +86,7 @@ use constant {
|
||||
EXT_SIG_ALGS_CERT => 50,
|
||||
EXT_RENEGOTIATE => 65281,
|
||||
EXT_NPN => 13172,
|
||||
# This extension is an unofficial extension only ever written by OpenSSL
|
||||
# (i.e. not read), and even then only when enabled. We use it to test
|
||||
# handling of duplicate extensions.
|
||||
EXT_DUPLICATE_EXTENSION => 0xfde8,
|
||||
EXT_CRYPTOPRO_BUG_EXTENSION => 0xfde8,
|
||||
EXT_UNKNOWN => 0xfffe,
|
||||
#Unknown extension that should appear last
|
||||
EXT_FORCE_LAST => 0xffff
|
||||
@@ -241,7 +238,7 @@ sub get_messages
|
||||
$startoffset = $recoffset;
|
||||
$recoffset += 4;
|
||||
$payload = "";
|
||||
|
||||
|
||||
if ($recoffset <= $record->decrypt_len) {
|
||||
#Some payload data is present in this record
|
||||
if ($record->decrypt_len - $recoffset >= $messlen) {
|
||||
@@ -413,14 +410,15 @@ sub new
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens) = @_;
|
||||
|
||||
|
||||
my $self = {
|
||||
server => $server,
|
||||
data => $data,
|
||||
records => $records,
|
||||
mt => $mt,
|
||||
startoffset => $startoffset,
|
||||
message_frag_lens => $message_frag_lens
|
||||
message_frag_lens => $message_frag_lens,
|
||||
dupext => -1
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
@@ -575,6 +573,14 @@ sub encoded_length
|
||||
my $self = shift;
|
||||
return TLS_MESSAGE_HEADER_LENGTH + length($self->data);
|
||||
}
|
||||
sub dupext
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{dupext} = shift;
|
||||
}
|
||||
return $self->{dupext};
|
||||
}
|
||||
sub successondata
|
||||
{
|
||||
my $class = shift;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -44,7 +44,7 @@ BEGIN
|
||||
$s->close();
|
||||
};
|
||||
if ($@ eq "") {
|
||||
$IP_factory = sub { IO::Socket::INET6->new(@_); };
|
||||
$IP_factory = sub { IO::Socket::INET6->new(Domain => AF_INET6, @_); };
|
||||
$have_IPv6 = 1;
|
||||
} else {
|
||||
eval {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -173,7 +173,7 @@ sub new
|
||||
$decrypt_len,
|
||||
$data,
|
||||
$decrypt_data) = @_;
|
||||
|
||||
|
||||
my $self = {
|
||||
flight => $flight,
|
||||
content_type => $content_type,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -25,7 +25,7 @@ sub new
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens) = @_;
|
||||
|
||||
|
||||
my $self = $class->SUPER::new(
|
||||
$server,
|
||||
TLSProxy::Message::MT_SERVER_HELLO,
|
||||
@@ -78,7 +78,7 @@ sub parse
|
||||
my $extension_data;
|
||||
if ($extensions_len != 0) {
|
||||
$extension_data = substr($self->data, $ptr);
|
||||
|
||||
|
||||
if (length($extension_data) != $extensions_len) {
|
||||
die "Invalid extension length\n";
|
||||
}
|
||||
@@ -154,7 +154,7 @@ sub set_message_contents
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
if ($key == $self->dupext) {
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -20,7 +20,7 @@ sub new
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens) = @_;
|
||||
|
||||
|
||||
my $self = $class->SUPER::new(
|
||||
$server,
|
||||
TLSProxy::Message::MT_SERVER_KEY_EXCHANGE,
|
||||
|
||||
Reference in New Issue
Block a user