Skip to content

Commit

Permalink
Add a Certificate Policies Test
Browse files Browse the repository at this point in the history
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 #20588)
  • Loading branch information
mattcaswell authored and t8m committed Mar 28, 2023
1 parent b013765 commit 23a4cbe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/recipes/25-test_verify.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub verify {
run(app([@args]));
}

plan tests => 146;
plan tests => 148;

# Canonical success
ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
Expand Down Expand Up @@ -409,3 +409,14 @@ SKIP: {
"ED25519 signature");

}

# Certificate Policies
ok(verify("ee-cert-policies", "sslserver", ["root-cert"], ["ca-pol-cert"],
"-policy_check", "-policy", "1.3.6.1.4.1.16604.998855.1",
"-explicit_policy"),
"Certificate policy");

ok(!verify("ee-cert-policies-bad", "sslserver", ["root-cert"], ["ca-pol-cert"],
"-policy_check", "-policy", "1.3.6.1.4.1.16604.998855.1",
"-explicit_policy"),
"Bad certificate policy");

0 comments on commit 23a4cbe

Please sign in to comment.