X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Frecipes%2F70-test_key_share.t;h=46370c56000ef63e36b8c7f77e159b31d014b810;hp=f4cc764be282f48671362d8fd3c17f9914a0bb07;hb=d8434cf85691f32a17dcdfed6e81769a001074dd;hpb=c5856878f709edb00759d56a55ccddb2ecd67d87 diff --git a/test/recipes/70-test_key_share.t b/test/recipes/70-test_key_share.t index f4cc764be2..46370c5600 100644 --- a/test/recipes/70-test_key_share.t +++ b/test/recipes/70-test_key_share.t @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 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 @@ -199,26 +199,30 @@ $testtype = TRAILING_DATA; $proxy->start(); ok(TLSProxy::Message->fail(), "key_share trailing data in ServerHello"); -#Test 20: key_share should not be sent if the client is not capable of -# negotiating TLSv1.3 -$proxy->clear(); -$proxy->filter(undef); -$proxy->clientflags("-no_tls1_3"); -$proxy->start(); -my $clienthello = $proxy->message_list->[0]; -ok(TLSProxy::Message->success() - && !defined $clienthello->extension_data->{TLSProxy::Message::EXT_KEY_SHARE}, - "No key_share for TLS<=1.2 client"); -$proxy->filter(\&modify_key_shares_filter); - -#Test 21: A server not capable of negotiating TLSv1.3 should not attempt to -# process a key_share -$proxy->clear(); -$direction = CLIENT_TO_SERVER; -$testtype = NO_ACCEPTABLE_KEY_SHARES; -$proxy->serverflags("-no_tls1_3"); -$proxy->start(); -ok(TLSProxy::Message->success(), "Ignore key_share for TLS<=1.2 server"); +SKIP: { + skip "No TLSv1.2 support in this OpenSSL build", 2 if disabled("tls1_2"); + + #Test 20: key_share should not be sent if the client is not capable of + # negotiating TLSv1.3 + $proxy->clear(); + $proxy->filter(undef); + $proxy->clientflags("-no_tls1_3"); + $proxy->start(); + my $clienthello = $proxy->message_list->[0]; + ok(TLSProxy::Message->success() + && !defined $clienthello->extension_data->{TLSProxy::Message::EXT_KEY_SHARE}, + "No key_share for TLS<=1.2 client"); + $proxy->filter(\&modify_key_shares_filter); + + #Test 21: A server not capable of negotiating TLSv1.3 should not attempt to + # process a key_share + $proxy->clear(); + $direction = CLIENT_TO_SERVER; + $testtype = NO_ACCEPTABLE_KEY_SHARES; + $proxy->serverflags("-no_tls1_3"); + $proxy->start(); + ok(TLSProxy::Message->success(), "Ignore key_share for TLS<=1.2 server"); +} #Test 22: The server sending an HRR but not requesting a new key_share should # fail