X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Frecipes%2F70-test_sslversions.t;h=c2d76239dda847a81e0cddf6fdf0b04de047ac8c;hp=5c9ee6c67fb2f004150918057db859c19378c4e3;hb=86ed2e1cb04158371385047e0e7832c34273022c;hpb=73cc84a132a08a02253ae168600fc4d16cd400d8 diff --git a/test/recipes/70-test_sslversions.t b/test/recipes/70-test_sslversions.t index 5c9ee6c67f..c2d76239dd 100644 --- a/test/recipes/70-test_sslversions.t +++ b/test/recipes/70-test_sslversions.t @@ -18,7 +18,8 @@ use constant { NO_EXTENSION => 3, EMPTY_EXTENSION => 4, TLS1_1_AND_1_0_ONLY => 5, - WITH_TLS1_4 => 6 + WITH_TLS1_4 => 6, + BAD_LEGACY_VERSION => 7 }; my $testtype; @@ -55,7 +56,7 @@ my $proxy = TLSProxy::Proxy->new( $testtype = EMPTY_EXTENSION; $proxy->filter(\&modify_supported_versions_filter); $proxy->start() or plan skip_all => "Unable to start up Proxy for tests"; -plan tests => 7; +plan tests => 8; ok(TLSProxy::Message->fail(), "Empty supported versions"); #Test 2: supported_versions extension with no recognised versions should not @@ -111,6 +112,12 @@ ok(TLSProxy::Message->success() && TLSProxy::Proxy->is_tls13(), "TLS1.4 in supported versions extension"); +#Test 8: Set the legacy version to SSLv3 with supported versions. Should fail +$proxy->clear(); +$testtype = BAD_LEGACY_VERSION; +$proxy->start(); +ok(TLSProxy::Message->fail(), "Legacy version is SSLv3 with supported versions"); + sub modify_supported_versions_filter { my $proxy = shift; @@ -138,8 +145,7 @@ sub modify_supported_versions_filter $ext = pack "C5", 0x04, # Length 0x03, 0x03, #TLSv1.2 - #TODO(TLS1.3): Fix before release - 0x7f, 0x1c; #TLSv1.3 (draft 28) + 0x03, 0x04; #TLSv1.3 } elsif ($testtype == UNRECOGNISED_VERSIONS) { $ext = pack "C5", 0x04, # Length @@ -153,8 +159,8 @@ sub modify_supported_versions_filter } elsif ($testtype == WITH_TLS1_4) { $ext = pack "C5", 0x04, # Length - #TODO(TLS1.3): Fix before release - 0x7f, 0x1c; #TLSv1.3 (draft 28) + 0x03, 0x05, #TLSv1.4 + 0x03, 0x04; #TLSv1.3 } if ($testtype == REVERSE_ORDER_VERSIONS || $testtype == UNRECOGNISED_VERSIONS @@ -165,14 +171,15 @@ sub modify_supported_versions_filter } elsif ($testtype == EMPTY_EXTENSION) { $message->set_extension( TLSProxy::Message::EXT_SUPPORTED_VERSIONS, ""); - } else { + } elsif ($testtype == NO_EXTENSION) { $message->delete_extension( TLSProxy::Message::EXT_SUPPORTED_VERSIONS); + } else { + # BAD_LEGACY_VERSION + $message->client_version(TLSProxy::Record::VERS_SSL_3_0); } $message->repack(); } } } - -