Add a test for correct handling of the cryptopro bug extension

This was complicated by the fact that we were using this extension for our
duplicate extension handling tests. In order to add tests for cryptopro
bug the duplicate extension handling tests needed to change first.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7984)
This commit is contained in:
Matt Caswell 2019-01-04 16:55:15 +00:00
parent 23fed8ba0e
commit 9effc496ad
6 changed files with 42 additions and 25 deletions

View file

@ -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
@ -420,7 +417,8 @@ sub new
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;