TLS: reject duplicate extensions
Adapted from BoringSSL. Added a test. The extension parsing code is already attempting to already handle this for some individual extensions, but it is doing so inconsistently. Duplicate efforts in individual extension parsing will be cleaned up in a follow-up. Reviewed-by: Stephen Henson <steve@openssl.org>
This commit is contained in:
@@ -101,6 +101,16 @@ my %message_type = (
|
||||
MT_NEXT_PROTO, "NextProto"
|
||||
);
|
||||
|
||||
use constant {
|
||||
EXT_STATUS_REQUEST => 5,
|
||||
EXT_ENCRYPT_THEN_MAC => 22,
|
||||
EXT_EXTENDED_MASTER_SECRET => 23,
|
||||
EXT_SESSION_TICKET => 35,
|
||||
# This extension does not exist and isn't recognised by OpenSSL.
|
||||
# We use it to test handling of duplicate extensions.
|
||||
EXT_DUPLICATE_EXTENSION => 1234
|
||||
};
|
||||
|
||||
my $payload = "";
|
||||
my $messlen = -1;
|
||||
my $mt;
|
||||
|
Reference in New Issue
Block a user