summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-01-28 18:24:40 +0100
committerRichard Levitte <levitte@openssl.org>2017-01-28 20:07:04 +0100
commit929860d0e6112f5c7766d9ea036c3f8bd8d3d719 (patch)
tree51143dfcbb4279867e82770b2b933a5f0d80dd7b
parent2d60c923141e7853c268364f26195343a5e995bf (diff)
Add a couple of test to check CRL fingerprint
Reviewed-by: Kurt Roeckx <kurt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2314)
-rw-r--r--test/recipes/25-test_crl.t19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/recipes/25-test_crl.t b/test/recipes/25-test_crl.t
index 872138efe8..e8ce5f8552 100644
--- a/test/recipes/25-test_crl.t
+++ b/test/recipes/25-test_crl.t
@@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
setup("test_crl");
-plan tests => 3;
+plan tests => 5;
require_ok(srctop_file('test','recipes','tconversion.pl'));
@@ -24,3 +24,20 @@ subtest 'crl conversions' => sub {
};
ok(run(test(['crltest'])));
+
+ok(compare1stline([qw{openssl crl -noout -fingerprint -in},
+ srctop_file('test', 'testcrl.pem')],
+ 'SHA1 Fingerprint=BA:F4:1B:AD:7A:9B:2F:09:16:BC:60:A7:0E:CE:79:2E:36:00:E7:B2'));
+ok(compare1stline([qw{openssl crl -noout -fingerprint -sha256 -in},
+ srctop_file('test', 'testcrl.pem')],
+ 'SHA256 Fingerprint=B3:A9:FD:A7:2E:8C:3D:DF:D0:F1:C3:1A:96:60:B5:FD:B0:99:7C:7F:0E:E4:34:F5:DB:87:62:36:BC:F1:BC:1B'));
+
+sub compare1stline {
+ my ($cmdarray, $str) = @_;
+ my @lines = run(app($cmdarray), capture => 1);
+
+ return 1 if $lines[0] =~ m|^\Q${str}\E\R$|;
+ note "Got ", $lines[0];
+ note "Expected ", $str;
+ return 0;
+}