diff options
author | Emilia Kasper <emilia@openssl.org> | 2015-09-15 12:06:12 +0200 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2015-09-28 16:00:47 +0200 |
commit | 7f6d90ac751e2dff6c1a7aad94ce9c5fdd0eb725 (patch) | |
tree | c95842125447a093fef36f4c57b01c44073de419 /test | |
parent | RT2772: accept empty SessionTicket (diff) | |
download | openssl-7f6d90ac751e2dff6c1a7aad94ce9c5fdd0eb725.tar.xz openssl-7f6d90ac751e2dff6c1a7aad94ce9c5fdd0eb725.zip |
Empty session ticket: add a test
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'test')
-rwxr-xr-x | test/recipes/70-test_sslsessiontick.t | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/recipes/70-test_sslsessiontick.t b/test/recipes/70-test_sslsessiontick.t index 7f90beae63..bf07fd1162 100755 --- a/test/recipes/70-test_sslsessiontick.t +++ b/test/recipes/70-test_sslsessiontick.t @@ -82,7 +82,7 @@ my $proxy = TLSProxy::Proxy->new( top_file("apps", "server.pem") ); -plan tests => 5; +plan tests => 6; #Test 1: By default with no existing session we should get a session ticket #Expected result: ClientHello extension seen; ServerHello extension seen @@ -135,6 +135,27 @@ $proxy->clientstart(); checkmessages(5, "Session resumption with ticket capable client without a " ."ticket", 1, 1, 1, 0); +#Test 6: Client accepts empty ticket. +#Expected result: ClientHello extension seen; ServerHello extension seen; +# NewSessionTicket message seen; Full handshake. +clearall(); +$proxy->filter(\&ticket_filter); +$proxy->start(); +checkmessages(6, "Empty ticket test", 1, 1, 1, 1); + + +sub ticket_filter +{ + my $proxy = shift; + + foreach my $message (@{$proxy->message_list}) { + if ($message->mt == TLSProxy::Message::MT_NEW_SESSION_TICKET) { + $message->ticket(""); + $message->repack(); + } + } +} + sub checkmessages($$$$$$) { my ($testno, $testname, $testch, $testsh, $testtickseen, $testhand) = @_; @@ -164,7 +185,7 @@ sub checkmessages($$$$$$) plan tests => 5; - ok(TLSProxy::Message->success, "Hanshake"); + ok(TLSProxy::Message->success, "Handshake"); ok(($testch && $chellotickext) || (!$testch && !$chellotickext), "ClientHello extension Session Ticket check"); ok(($testsh && $shellotickext) || (!$testsh && !$shellotickext), |