Latest update

This commit is contained in:
2019-04-01 00:21:15 +09:00
parent c03e0c45f8
commit 48ec086472
209 changed files with 7552 additions and 2495 deletions
+25 -1
View File
@@ -11,11 +11,12 @@ use strict;
use warnings;
use File::Spec;
use OpenSSL::Test::Utils;
use OpenSSL::Test qw/:DEFAULT srctop_file/;
setup("test_x509");
plan tests => 9;
plan tests => 10;
require_ok(srctop_file('test','recipes','tconversion.pl'));
@@ -34,6 +35,29 @@ is(cmp_text($out, srctop_file("test/certs", "cyrillic.utf8")),
0, 'Comparing utf8 output');
unlink $out;
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"));
};