Latest update.
This commit is contained in:
@@ -27,7 +27,7 @@ sub verify {
|
||||
run(app([@args]));
|
||||
}
|
||||
|
||||
plan tests => 134;
|
||||
plan tests => 135;
|
||||
|
||||
# Canonical success
|
||||
ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
|
||||
@@ -361,6 +361,8 @@ ok(verify("some-names2", "sslserver", ["many-constraints"], ["many-constraints"]
|
||||
"Not too many names and constraints to check (2)");
|
||||
ok(verify("some-names2", "sslserver", ["many-constraints"], ["many-constraints"], ),
|
||||
"Not too many names and constraints to check (3)");
|
||||
ok(verify("root-cert-rsa2", "sslserver", ["root-cert-rsa2"], [], "-check_ss_sig"),
|
||||
"Public Key Algorithm rsa instead of rsaEncryption");
|
||||
|
||||
SKIP: {
|
||||
skip "Ed25519 is not supported by this OpenSSL build", 1
|
||||
|
||||
@@ -88,9 +88,11 @@ sub inject_duplicate_extension
|
||||
foreach my $message (@{$proxy->message_list}) {
|
||||
if ($message->mt == $message_type) {
|
||||
my %extensions = %{$message->extension_data};
|
||||
# Add a duplicate (unknown) extension.
|
||||
$message->set_extension(TLSProxy::Message::EXT_DUPLICATE_EXTENSION, "");
|
||||
$message->set_extension(TLSProxy::Message::EXT_DUPLICATE_EXTENSION, "");
|
||||
# Add a duplicate extension. We use cryptopro_bug since we never
|
||||
# normally write that one, and it is allowed as unsolicited in the
|
||||
# ServerHello
|
||||
$message->set_extension(TLSProxy::Message::EXT_CRYPTOPRO_BUG_EXTENSION, "");
|
||||
$message->dupext(TLSProxy::Message::EXT_CRYPTOPRO_BUG_EXTENSION);
|
||||
$message->repack();
|
||||
}
|
||||
}
|
||||
@@ -173,9 +175,23 @@ sub inject_unsolicited_extension
|
||||
$sent_unsolisited_extension = 1;
|
||||
}
|
||||
|
||||
sub inject_cryptopro_extension
|
||||
{
|
||||
my $proxy = shift;
|
||||
|
||||
# We're only interested in the initial ClientHello
|
||||
if ($proxy->flight != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
my $message = ${$proxy->message_list}[0];
|
||||
$message->set_extension(TLSProxy::Message::EXT_CRYPTOPRO_BUG_EXTENSION, "");
|
||||
$message->repack();
|
||||
}
|
||||
|
||||
# Test 1-2: Sending a duplicate extension should fail.
|
||||
$proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
|
||||
plan tests => 7;
|
||||
plan tests => 8;
|
||||
ok($fatal_alert, "Duplicate ClientHello extension");
|
||||
|
||||
$fatal_alert = 0;
|
||||
@@ -234,3 +250,11 @@ SKIP: {
|
||||
$proxy->start();
|
||||
ok($fatal_alert, "Unsolicited server name extension (TLSv1.3)");
|
||||
}
|
||||
|
||||
#Test 8: Send the cryptopro extension in a ClientHello. Normally this is an
|
||||
# unsolicited extension only ever seen in the ServerHello. We should
|
||||
# ignore it in a ClientHello
|
||||
$proxy->clear();
|
||||
$proxy->filter(\&inject_cryptopro_extension);
|
||||
$proxy->start();
|
||||
ok(TLSProxy::Message->success(), "Cryptopro extension in ClientHello");
|
||||
@@ -12,11 +12,11 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
|
||||
setup("test_gost");
|
||||
|
||||
# The GOST ciphers are dynamically loaded via the GOST engine, so we must be
|
||||
# able to support that. The engine also uses DSA and CMS symbols, so we skip
|
||||
# this test on no-dsa or no-cms.
|
||||
# able to support that. The engine also uses DSA, CMS and CMAC symbols, so we
|
||||
# skip this test on no-dsa, no-cms or no-cmac.
|
||||
plan skip_all => "GOST support is disabled in this OpenSSL build"
|
||||
if disabled("gost") || disabled("engine") || disabled("dynamic-engine")
|
||||
|| disabled("dsa") || disabled("cms");
|
||||
|| disabled("dsa") || disabled("cms") || disabled("cmac");
|
||||
|
||||
plan skip_all => "TLSv1.3 or TLSv1.2 are disabled in this OpenSSL build"
|
||||
if disabled("tls1_3") || disabled("tls1_2");
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
use OpenSSL::Test qw/:DEFAULT bldtop_dir bldtop_file/;
|
||||
use OpenSSL::Test::Utils;
|
||||
use File::Temp qw(tempfile);
|
||||
|
||||
#Load configdata.pm
|
||||
|
||||
@@ -20,7 +21,7 @@ use configdata;
|
||||
plan skip_all => "Test only supported in a shared build" if disabled("shared");
|
||||
plan skip_all => "Test is disabled on AIX" if config('target') =~ m|^aix|;
|
||||
|
||||
plan tests => 4;
|
||||
plan tests => 10;
|
||||
|
||||
# When libssl and libcrypto are compiled on Linux with "-rpath", but not
|
||||
# "--enable-new-dtags", the RPATH takes precedence over LD_LIBRARY_PATH,
|
||||
@@ -30,14 +31,31 @@ plan tests => 4;
|
||||
my $libcrypto = bldtop_file(shlib('libcrypto'));
|
||||
my $libssl = bldtop_file(shlib('libssl'));
|
||||
|
||||
ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl])),
|
||||
"running shlibloadtest -crypto_first");
|
||||
ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl])),
|
||||
"running shlibloadtest -ssl_first");
|
||||
ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl])),
|
||||
"running shlibloadtest -just_crypto");
|
||||
ok(run(test(["shlibloadtest", "-dso_ref", $libcrypto, $libssl])),
|
||||
"running shlibloadtest -dso_ref");
|
||||
(my $fh, my $filename) = tempfile();
|
||||
ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl, $filename])),
|
||||
"running shlibloadtest -crypto_first $filename");
|
||||
ok(check_atexit($fh));
|
||||
unlink $filename;
|
||||
($fh, $filename) = tempfile();
|
||||
ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl, $filename])),
|
||||
"running shlibloadtest -ssl_first $filename");
|
||||
ok(check_atexit($fh));
|
||||
unlink $filename;
|
||||
($fh, $filename) = tempfile();
|
||||
ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl, $filename])),
|
||||
"running shlibloadtest -just_crypto $filename");
|
||||
ok(check_atexit($fh));
|
||||
unlink $filename;
|
||||
($fh, $filename) = tempfile();
|
||||
ok(run(test(["shlibloadtest", "-dso_ref", $libcrypto, $libssl, $filename])),
|
||||
"running shlibloadtest -dso_ref $filename");
|
||||
ok(check_atexit($fh));
|
||||
unlink $filename;
|
||||
($fh, $filename) = tempfile();
|
||||
ok(run(test(["shlibloadtest", "-no_atexit", $libcrypto, $libssl, $filename])),
|
||||
"running shlibloadtest -no_atexit $filename");
|
||||
ok(!check_atexit($fh));
|
||||
unlink $filename;
|
||||
|
||||
sub shlib {
|
||||
my $lib = shift;
|
||||
@@ -49,3 +67,12 @@ sub shlib {
|
||||
$lib =~ s|\.\$\(SHLIB_VERSION_NUMBER\)|.$config{shlib_version}|;
|
||||
return $lib;
|
||||
}
|
||||
|
||||
sub check_atexit {
|
||||
my $fh = shift;
|
||||
my $data = <$fh>;
|
||||
|
||||
return 1 if (defined $data && $data =~ m/atexit\(\) run/);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user