summaryrefslogtreecommitdiff
path: root/test/recipes/25-test_x509.t
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-03-26 16:07:02 +0000
committerMatt Caswell <matt@openssl.org>2019-03-27 10:09:04 +0000
commit1f019cd0ac9343c51dfdcef1df9a1859cf8fbe03 (patch)
tree88465a9163452c3c49640ea81683927bf7290c17 /test/recipes/25-test_x509.t
parentfc4e500b037fcbe89238b1c9f0c1ccf46a7c6559 (diff)
downloadopenssl-new-1f019cd0ac9343c51dfdcef1df9a1859cf8fbe03.tar.gz
Fix no-ec
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8588)
Diffstat (limited to 'test/recipes/25-test_x509.t')
-rw-r--r--test/recipes/25-test_x509.t41
1 files changed, 23 insertions, 18 deletions
diff --git a/test/recipes/25-test_x509.t b/test/recipes/25-test_x509.t
index 2ff49f6243..4780247ea0 100644
--- a/test/recipes/25-test_x509.t
+++ b/test/recipes/25-test_x509.t
@@ -11,6 +11,7 @@ use strict;
use warnings;
use File::Spec;
+use OpenSSL::Test::Utils;
use OpenSSL::Test qw/:DEFAULT srctop_file/;
setup("test_x509");
@@ -34,24 +35,28 @@ is(cmp_text($out, srctop_file("test/certs", "cyrillic.utf8")),
0, 'Comparing utf8 output');
unlink $out;
-# producing and checking self-issued (but not self-signed) cert
-my @path = qw(test certs);
-my $subj = "/CN=CA"; # using same DN as in issuer of ee-cert.pem
-my $pkey = srctop_file(@path, "ca-key.pem"); # issuer private key
-my $pubkey = "ca-pubkey.pem"; # the corresponding issuer public key
-# use any (different) key for signing our self-issued cert:
-my $signkey = srctop_file(@path, "ee-ecdsa-key.pem");
-my $selfout = "self-issued.out";
-my $testcert = srctop_file(@path, "ee-cert.pem");
-ok(run(app(["openssl", "pkey", "-in", $pkey, "-pubout", "-out", $pubkey]))
- &&
- run(app(["openssl", "x509", "-new", "-force_pubkey", $pubkey,
- "-subj", $subj, "-signkey", $signkey, "-out", $selfout]))
- &&
- run(app(["openssl", "verify", "-no_check_time",
- "-trusted", $selfout, $testcert])));
-unlink $pubkey;
-unlink $selfout;
+SKIP: {
+ skip "EC disabled", 1 if disabled("ec");
+
+ # producing and checking self-issued (but not self-signed) cert
+ my @path = qw(test certs);
+ my $subj = "/CN=CA"; # using same DN as in issuer of ee-cert.pem
+ my $pkey = srctop_file(@path, "ca-key.pem"); # issuer private key
+ my $pubkey = "ca-pubkey.pem"; # the corresponding issuer public key
+ # use any (different) key for signing our self-issued cert:
+ my $signkey = srctop_file(@path, "ee-ecdsa-key.pem");
+ my $selfout = "self-issued.out";
+ my $testcert = srctop_file(@path, "ee-cert.pem");
+ ok(run(app(["openssl", "pkey", "-in", $pkey, "-pubout", "-out", $pubkey]))
+ &&
+ run(app(["openssl", "x509", "-new", "-force_pubkey", $pubkey,
+ "-subj", $subj, "-signkey", $signkey, "-out", $selfout]))
+ &&
+ run(app(["openssl", "verify", "-no_check_time",
+ "-trusted", $selfout, $testcert])));
+ unlink $pubkey;
+ unlink $selfout;
+}
subtest 'x509 -- x.509 v1 certificate' => sub {
tconversion("x509", srctop_file("test","testx509.pem"));