summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-12-01 12:54:44 +0000
committerMatt Caswell <matt@openssl.org>2016-12-08 17:20:28 +0000
commit7caf619f1a7c7901a63b8257ac7133dd1c584243 (patch)
treeb23d6c97907a4372750c78b316300f5acb2af679 /test
parenta1448c26d2bbec390db4c00bf3867c4369af7d15 (diff)
Add some extra key_share tests
Check that the extension framework properly handles extensions specific to a protocol version Perl changes reviewed by Richard Levitte. Non-perl changes reviewed by Rich Salz Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/recipes/70-test_key_share.t22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/recipes/70-test_key_share.t b/test/recipes/70-test_key_share.t
index 380b1a8a10..339dc3c494 100755
--- a/test/recipes/70-test_key_share.t
+++ b/test/recipes/70-test_key_share.t
@@ -74,7 +74,7 @@ $testtype = EMPTY_EXTENSION;
$direction = CLIENT_TO_SERVER;
$proxy->filter(\&modify_key_shares_filter);
$proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
-plan tests => 17;
+plan tests => 19;
#TODO(TLS1.3): Actually this should succeed after a HelloRetryRequest - but
#we've not implemented that yet, so for now we look for a fail
ok(TLSProxy::Message->fail(), "Empty key_shares");
@@ -188,6 +188,26 @@ $testtype = TRAILING_DATA;
$proxy->start();
ok(TLSProxy::Message->fail(), "key_share trailing data in ServerHello");
+#Test 18: 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 19: 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");
sub modify_key_shares_filter
{