summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2024-02-23 10:32:14 +0100
committerTomas Mraz <tomas@openssl.org>2024-04-02 17:35:25 +0200
commit387418893e45e588d1cbd4222549b5113437c9ab (patch)
tree3b9639ab7a2c91f0119346995649384f77aef891 /test
parent36e2fbe38b21ce6d4a6bfde3b6deb692ca32fa39 (diff)
Fix openssl req with -addext subjectAltName=dirName
The syntax check of the -addext fails because the X509V3_CTX is used to lookup the referenced section, but the wrong configuration file is used, where only a default section with all passed in -addext lines is available. Thus it was not possible to use the subjectAltName=dirName:section as an -addext parameter. Probably other extensions as well. This change affects only the syntax check, the real extension was already created with correct parameters. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23669)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/25-test_req.t3
-rw-r--r--test/test.cnf6
2 files changed, 8 insertions, 1 deletions
diff --git a/test/recipes/25-test_req.t b/test/recipes/25-test_req.t
index 50188cbae5..3d4cbcec62 100644
--- a/test/recipes/25-test_req.t
+++ b/test/recipes/25-test_req.t
@@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
setup("test_req");
-plan tests => 107;
+plan tests => 108;
require_ok(srctop_file('test', 'recipes', 'tconversion.pl'));
@@ -53,6 +53,7 @@ ok(!run(app([@addext_args, "-addext", $val, "-addext", $val2])));
ok(!run(app([@addext_args, "-addext", $val, "-addext", $val3])));
ok(!run(app([@addext_args, "-addext", $val2, "-addext", $val3])));
ok(run(app([@addext_args, "-addext", "SXNetID=1:one, 2:two, 3:three"])));
+ok(run(app([@addext_args, "-addext", "subjectAltName=dirName:dirname_sec"])));
# If a CSR is provided with neither of -key or -CA/-CAkey, this should fail.
ok(!run(app(["openssl", "req", "-x509",
diff --git a/test/test.cnf b/test/test.cnf
index 8b2f92ad8e..8f68982a9f 100644
--- a/test/test.cnf
+++ b/test/test.cnf
@@ -72,3 +72,9 @@ commonName = CN field
commonName_value = Eric Young
emailAddress = email field
emailAddress_value = eay@mincom.oz.au
+
+[ dirname_sec ]
+C = UK
+O = My Organization
+OU = My Unit
+CN = My Name