25-test_x509.t: Make test case w.r.t. self-issued cert run also without EC enabled

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13711)
This commit is contained in:
Dr. David von Oheimb 2020-12-10 17:01:45 +01:00 committed by Dr. David von Oheimb
parent abc4439c92
commit 49b36afb0b

View File

@ -47,29 +47,23 @@ is(cmp_text($out_utf8, srctop_file(@certs, "cyrillic.utf8")),
# not unlinking $out_pem # not unlinking $out_pem
} }
SKIP: { # producing and checking self-issued (but not self-signed) cert
skip "EC disabled", 1 if disabled("ec"); my $subj = "/CN=CA"; # using same DN as in issuer of ee-cert.pem
my $extfile = srctop_file("test", "v3_ca_exts.cnf");
# producing and checking self-issued (but not self-signed) cert my $pkey = srctop_file(@certs, "ca-key.pem"); # issuer private key
my $subj = "/CN=CA"; # using same DN as in issuer of ee-cert.pem my $pubkey = "ca-pubkey.pem"; # the corresponding issuer public key
my $extfile = srctop_file("test", "v3_ca_exts.cnf"); # use any (different) key for signing our self-issued cert:
my $pkey = srctop_file(@certs, "ca-key.pem"); # issuer private key my $signkey = srctop_file(@certs, "serverkey.pem");
my $pubkey = "ca-pubkey.pem"; # the corresponding issuer public key my $selfout = "self-issued.out";
# use any (different) key for signing our self-issued cert: my $testcert = srctop_file(@certs, "ee-cert.pem");
my $signkey = srctop_file(@certs, "ee-ecdsa-key.pem"); ok(run(app(["openssl", "pkey", "-in", $pkey, "-pubout", "-out", $pubkey]))
my $selfout = "self-issued.out"; && run(app(["openssl", "x509", "-new", "-force_pubkey", $pubkey,
my $testcert = srctop_file(@certs, "ee-cert.pem"); "-subj", $subj, "-extfile", $extfile,
ok(run(app(["openssl", "pkey", "-in", $pkey, "-pubout", "-out", $pubkey])) "-signkey", $signkey, "-out", $selfout]))
&& && run(app(["openssl", "verify", "-no_check_time",
run(app(["openssl", "x509", "-new", "-force_pubkey", $pubkey, "-trusted", $selfout, "-partial_chain", $testcert])));
"-subj", $subj, "-extfile", $extfile, # not unlinking $pubkey
"-signkey", $signkey, "-out", $selfout])) # not unlinking $selfout
&&
run(app(["openssl", "verify", "-no_check_time",
"-trusted", $selfout, "-partial_chain", $testcert])));
# not unlinking $pubkey
# not unlinking $selfout
}
subtest 'x509 -- x.509 v1 certificate' => sub { subtest 'x509 -- x.509 v1 certificate' => sub {
tconversion( -type => 'x509', -prefix => 'x509v1', tconversion( -type => 'x509', -prefix => 'x509v1',