提交 3058b742 编写于 作者: D David Benjamin 提交者: Matt Caswell

Address review comments.

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 5cf6d7c5
...@@ -23,8 +23,8 @@ plan skip_all => "$test_name needs the dynamic engine feature enabled" ...@@ -23,8 +23,8 @@ plan skip_all => "$test_name needs the dynamic engine feature enabled"
plan skip_all => "$test_name needs the sock feature enabled" plan skip_all => "$test_name needs the sock feature enabled"
if disabled("sock"); if disabled("sock");
plan skip_all => "$test_name needs TLSv1.2 enabled" plan skip_all => "$test_name needs TLSv1.1 enabled"
if disabled("tls1_2"); if disabled("tls1_1");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(
...@@ -34,23 +34,21 @@ my $proxy = TLSProxy::Proxy->new( ...@@ -34,23 +34,21 @@ my $proxy = TLSProxy::Proxy->new(
(!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE}) (!$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 # 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. # CI. See https://github.com/openssl/openssl/issues/1440.
my @test_offsets = (0, 128, 254, 255); my @test_offsets = (0, 128, 254, 255);
plan tests => 1 + scalar(@test_offsets);
# Test that maximally-padded records are accepted. # Test that maximally-padded records are accepted.
my $bad_padding_offset = -1;
$proxy->start() or plan skip_all => "Unable to start up Proxy for tests"; $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"); ok(TLSProxy::Message->success(), "Maximally-padded record test");
# Test that invalid padding is rejected. # Test that invalid padding is rejected.
foreach my $offset (@test_offsets) { foreach my $offset (@test_offsets) {
$proxy->clear(); $proxy->clear();
$bad_padding_offset = $offset; $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"); ok(TLSProxy::Message->fail(), "Invalid padding byte $bad_padding_offset");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册