]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add a test case for the name constraints bug
authorMatt Caswell <matt@openssl.org>
Fri, 3 Dec 2021 15:28:31 +0000 (15:28 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 14 Dec 2021 13:48:34 +0000 (13:48 +0000)
Where a chain has name constraints but a certificate does not have a SAN
extension but the CN meets the constraints, then this should be acceptable.
However, and OpenSSL bug meant that an internal error was being reported.
This adds a test case for that scenario.

Test for CVE-2021-4044

Reviewed-by: Tomas Mraz <tomas@openssl.org>
test/recipes/25-test_verify.t

index bcd823bcfb0aede506dfb755dc39279f9d5f048e..700bbd849c9539d2201c08d2cf0317264d7788e8 100644 (file)
@@ -29,7 +29,7 @@ sub verify {
     run(app([@args]));
 }
 
-plan tests => 159;
+plan tests => 160;
 
 # Canonical success
 ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
@@ -337,6 +337,9 @@ ok(verify("alt3-cert", "", ["root-cert"], ["ncca1-cert", "ncca3-cert"], ),
 ok(verify("goodcn1-cert", "", ["root-cert"], ["ncca1-cert"], ),
    "Name Constraints CNs permitted");
 
+ok(verify("goodcn2-cert", "", ["root-cert"], ["ncca1-cert"], ),
+   "Name Constraints CNs permitted - no SAN extension");
+
 ok(!verify("badcn1-cert", "", ["root-cert"], ["ncca1-cert"], ),
    "Name Constraints CNs not permitted");