Skip to content

Commit dda529e

Browse files
mattcaswellt8m
authored andcommitted
Add a Certificate Policies Test
Test that a valid certificate policy is accepted and that an invalid certificate policy is rejected. Specifically we are checking that a leaf certificate with an invalid policy is detected. Related-to: CVE-2023-0465 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #20587)
1 parent 1dd43e0 commit dda529e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/recipes/25-test_verify.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sub verify {
2929
run(app([@args]));
3030
}
3131

32-
plan tests => 164;
32+
plan tests => 166;
3333

3434
# Canonical success
3535
ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
@@ -516,3 +516,14 @@ SKIP: {
516516
ok(run(app([ qw(openssl verify -trusted), $rsapluscert_file, $cert_file ])),
517517
'Mixed key + cert file test');
518518
}
519+
520+
# Certificate Policies
521+
ok(verify("ee-cert-policies", "", ["root-cert"], ["ca-pol-cert"],
522+
"-policy_check", "-policy", "1.3.6.1.4.1.16604.998855.1",
523+
"-explicit_policy"),
524+
"Certificate policy");
525+
526+
ok(!verify("ee-cert-policies-bad", "", ["root-cert"], ["ca-pol-cert"],
527+
"-policy_check", "-policy", "1.3.6.1.4.1.16604.998855.1",
528+
"-explicit_policy"),
529+
"Bad certificate policy");

0 commit comments

Comments
 (0)