X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Frecipes%2F70-test_sslcbcpadding.t;h=85b26b8243681409ca75e1c540c81efb8874ea8f;hp=fddbeab0159ce8cda9e6aa091c195d22ff7eacca;hb=efe749c84050b99a8470aa58a6c464cf886cfc00;hpb=5cf6d7c51f16fd78de7921dc441e24897c8b3cc6 diff --git a/test/recipes/70-test_sslcbcpadding.t b/test/recipes/70-test_sslcbcpadding.t index fddbeab015..85b26b8243 100644 --- a/test/recipes/70-test_sslcbcpadding.t +++ b/test/recipes/70-test_sslcbcpadding.t @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-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 @@ -15,7 +15,7 @@ my $test_name = "test_sslcbcpadding"; setup($test_name); plan skip_all => "TLSProxy isn't usable on $^O" - if $^O =~ /^(VMS|MSWin32)$/; + if $^O =~ /^(VMS)$/; plan skip_all => "$test_name needs the dynamic engine feature enabled" if disabled("engine") || disabled("dynamic-engine"); @@ -34,23 +34,23 @@ my $proxy = TLSProxy::Proxy->new( (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE}) ); -my $bad_padding_offset = -1; - # TODO: We could test all 256 values, but then the log file gets too large for # CI. See https://github.com/openssl/openssl/issues/1440. my @test_offsets = (0, 128, 254, 255); -plan tests => 1 + scalar(@test_offsets); - # Test that maximally-padded records are accepted. +my $bad_padding_offset = -1; +$proxy->serverflags("-tls1_2"); $proxy->start() or plan skip_all => "Unable to start up Proxy for tests"; +plan tests => 1 + scalar(@test_offsets); ok(TLSProxy::Message->success(), "Maximally-padded record test"); # Test that invalid padding is rejected. foreach my $offset (@test_offsets) { $proxy->clear(); + $proxy->serverflags("-tls1_2"); $bad_padding_offset = $offset; - $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";; + $proxy->start(); ok(TLSProxy::Message->fail(), "Invalid padding byte $bad_padding_offset"); } @@ -99,6 +99,7 @@ sub add_maximal_padding_filter TLSProxy::Record::RT_APPLICATION_DATA, TLSProxy::Record::VERS_TLS_1_2, length($data), + 0, length($data), $plaintext_len, $data,