Update the tests for SNI changes
authorMatt Caswell <matt@openssl.org>
Tue, 1 Aug 2017 14:46:29 +0000 (15:46 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 31 Aug 2017 14:02:58 +0000 (15:02 +0100)
If there is no SNI in the session then s_client no longer sends the SNI
extension. Update the tests to take account of that

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/3926)

test/recipes/70-test_sslmessages.t
test/recipes/70-test_tls13kexmodes.t
test/recipes/70-test_tls13messages.t
test/recipes/70-test_tls13psk.t

index a763486f5b5c2c421980243aca2e7e86328a61c6..6aab5af33c6cb3b79ecd7f97f5847c956b105994 100644 (file)
@@ -164,7 +164,8 @@ $proxy->clientflags("-no_tls1_3 -sess_in ".$session);
 $proxy->clientstart();
 checkhandshake($proxy, checkhandshake::RESUME_HANDSHAKE,
                checkhandshake::DEFAULT_EXTENSIONS
-               & ~checkhandshake::SESSION_TICKET_SRV_EXTENSION,
+               & ~checkhandshake::SESSION_TICKET_SRV_EXTENSION
+               & ~checkhandshake::SERVER_NAME_CLI_EXTENSION,
                "Resumption handshake test");
 unlink $session;
 
index ec23e132e2cd98e1b087022df6e5458737b13cb3..fe7415ac560744890ebbc85b5b120d543e4cf23b 100644 (file)
@@ -143,6 +143,7 @@ my $proxy = TLSProxy::Proxy->new(
 #Test 1: First get a session
 (undef, my $session) = tempfile();
 $proxy->clientflags("-sess_out ".$session);
+$proxy->serverflags("-servername localhost");
 $proxy->sessionfile($session);
 $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
 plan tests => 11;
index c21185167f103d2d5b4c210f7122ea4fe4f6715f..24ffb80b2ed596090b209167705344a36a01dcc7 100644 (file)
@@ -157,9 +157,10 @@ $proxy->clearClient();
 $proxy->clientflags("-sess_in ".$session);
 $proxy->clientstart();
 checkhandshake($proxy, checkhandshake::RESUME_HANDSHAKE,
-               checkhandshake::DEFAULT_EXTENSIONS
-               | checkhandshake::PSK_CLI_EXTENSION
-               | checkhandshake::PSK_SRV_EXTENSION,
+               (checkhandshake::DEFAULT_EXTENSIONS
+                | checkhandshake::PSK_CLI_EXTENSION
+                | checkhandshake::PSK_SRV_EXTENSION)
+               & ~checkhandshake::SERVER_NAME_CLI_EXTENSION,
                "Resumption handshake test");
 
 #Test 3: A status_request handshake (client request only)
@@ -300,10 +301,11 @@ $proxy->clientflags("-sess_in ".$session);
 $proxy->serverflags("-curves P-256");
 $proxy->start();
 checkhandshake($proxy, checkhandshake::HRR_RESUME_HANDSHAKE,
-               checkhandshake::DEFAULT_EXTENSIONS
-               | checkhandshake::KEY_SHARE_HRR_EXTENSION
-               | checkhandshake::PSK_CLI_EXTENSION
-               | checkhandshake::PSK_SRV_EXTENSION,
+               (checkhandshake::DEFAULT_EXTENSIONS
+                | checkhandshake::KEY_SHARE_HRR_EXTENSION
+                | checkhandshake::PSK_CLI_EXTENSION
+                | checkhandshake::PSK_SRV_EXTENSION)
+               & ~checkhandshake::SERVER_NAME_CLI_EXTENSION,
                "Resumption handshake with HRR test");
 
 #Test 16: Acceptable but non preferred key_share
index 23767f9cafceceb795b1b00124f70f7d9b032d47..e344b75959a11490ed2f3e3d2a3172952a19fd16 100644 (file)
@@ -48,6 +48,7 @@ use constant {
 #Test 1: First get a session
 (undef, my $session) = tempfile();
 $proxy->clientflags("-sess_out ".$session);
+$proxy->serverflags("-servername localhost");
 $proxy->sessionfile($session);
 $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
 plan tests => 5;