summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-08-26 10:03:51 +0100
committerPauli <pauli@openssl.org>2021-08-31 20:47:25 +1000
commit59f4a51a7f2c53b9fd161b032d0fcb8a85f4f19d (patch)
treeeea17df53070f7364599f15a0356194cb2215aee
parentc7f8edfc1186a48463c14cfdc7f70456cbcb1cda (diff)
Add a test for verifying an email with a bad othername type
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16443)
-rw-r--r--test/recipes/25-test_eai_data.t14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/recipes/25-test_eai_data.t b/test/recipes/25-test_eai_data.t
index 8aebf5d621..522982ddfb 100644
--- a/test/recipes/25-test_eai_data.t
+++ b/test/recipes/25-test_eai_data.t
@@ -12,7 +12,7 @@ use warnings;
use File::Spec;
use OpenSSL::Test::Utils;
-use OpenSSL::Test qw/:DEFAULT srctop_file/;
+use OpenSSL::Test qw/:DEFAULT srctop_file with/;
setup("test_eai_data");
@@ -21,7 +21,7 @@ setup("test_eai_data");
#./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/utf8_chain.pem test/recipes/25-test_eai_data/ascii_leaf.pem
#./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/ascii_chain.pem test/recipes/25-test_eai_data/utf8_leaf.pem
-plan tests => 11;
+plan tests => 12;
require_ok(srctop_file('test','recipes','tconversion.pl'));
my $folder = "test/recipes/25-test_eai_data";
@@ -60,3 +60,13 @@ ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile"
ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $utf8_pem])));
ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $ascii_pem])));
+#Check that we get the expected failure return code
+with({ exit_checker => sub { return shift == 2; } },
+ sub {
+ ok(run(app(["openssl", "verify", "-CAfile",
+ srctop_file("test", "certs", "bad-othername-namec.pem"),
+ "-partial_chain", "-no_check_time", "-verify_email",
+ 'foo@example.com',
+ srctop_file("test", "certs", "bad-othername-namec.pem")])));
+ });
+