Enable TLSProxy to talk TLS1.3
[openssl.git] / test / recipes / 70-test_sslcbcpadding.t
index c6eca2f713fd9c2eb9629f057f278ad8390d803b..22825a096d055c6acf778afc505ca7c5e91feecc 100644 (file)
@@ -34,19 +34,22 @@ my $proxy = TLSProxy::Proxy->new(
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
-plan tests => 1 + 256;
+# 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);
 
+# Test that maximally-padded records are accepted.
 my $bad_padding_offset = -1;
-
-# Test 1: Maximally-padded records are accepted.
+$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");
 
-# Tests 2 through 257: Invalid padding.
-for ($bad_padding_offset = 0; $bad_padding_offset < 256;
-     $bad_padding_offset++) {
+# Test that invalid padding is rejected.
+foreach my $offset (@test_offsets) {
     $proxy->clear();
-    $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";;
+    $bad_padding_offset = $offset;
+    $proxy->start();
     ok(TLSProxy::Message->fail(), "Invalid padding byte $bad_padding_offset");
 }
 
@@ -95,6 +98,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,