mirror of https://github.com/openssl/openssl.git
25-test_verify.t: add test for trusted root excluding key usage KeyCertSign
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18764)
This commit is contained in:
parent
dcac2c9e29
commit
2bd5e6f338
|
@ -223,6 +223,8 @@ OPENSSL_KEYBITS=4096 \
|
|||
OPENSSL_KEYBITS=8192 \
|
||||
./mkcert.sh genee server.example ee-key-8192 ee-cert-8192 ca-key ca-cert
|
||||
|
||||
# root CA cert with explicit keyUsage not including KeyCertSign
|
||||
openssl req -new -x509 -key root-key.pem -subj /CN="Root CA" -out root-no-KeyCertSign.pem -addext keyUsage=digitalSignature -days 36525
|
||||
# self-signed end-entity cert with explicit keyUsage not including KeyCertSign
|
||||
openssl req -new -x509 -key ee-key.pem -subj /CN=ee-self-signed -out ee-self-signed.pem -addext keyUsage=digitalSignature -days 36525
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ sub verify {
|
|||
run(app([@args]));
|
||||
}
|
||||
|
||||
plan tests => 205;
|
||||
plan tests => 206;
|
||||
|
||||
# Canonical success
|
||||
ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
|
||||
|
@ -39,6 +39,8 @@ ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]),
|
|||
# Root CA variants
|
||||
ok(!verify("ee-cert", "sslserver", [qw(root-nonca)], [qw(ca-cert)]),
|
||||
"fail trusted non-ca root");
|
||||
ok(!verify("ee-cert", "sslserver", [qw(root-no-KeyCertSign)], [qw(ca-cert)]),
|
||||
"fail trusted root excluding key usage KeyCertSign");
|
||||
ok(!verify("ee-cert", "sslserver", [qw(nroot+serverAuth)], [qw(ca-cert)]),
|
||||
"fail server trust non-ca root");
|
||||
ok(!verify("ee-cert", "sslserver", [qw(nroot+anyEKU)], [qw(ca-cert)]),
|
||||
|
|
Loading…
Reference in New Issue