From: Jakub Zelenka Date: Thu, 16 Jul 2026 08:20:04 +0000 (+0200) Subject: apps: cover the crl -crlnumber and -issuer print options X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ffa7eb92109a8f95faf83482086f9d4e33d86a6a;p=thirdparty%2Fopenssl.git apps: cover the crl -crlnumber and -issuer print options Add a subtest exercising the -crlnumber and -issuer print options of the crl app: with a CRL that carries a CRL Number extension (printed as a hex value), with a CRL that has none (printed as ), and checking the printed issuer DN in both cases. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: Daniel Kubec Reviewed-by: Matt Caswell MergeDate: Mon Jul 27 10:15:03 2026 (Merged from https://github.com/openssl/openssl/pull/31969) --- diff --git a/test/recipes/25-test_crl.t b/test/recipes/25-test_crl.t index a65b2c6ce87..aecda2a4235 100644 --- a/test/recipes/25-test_crl.t +++ b/test/recipes/25-test_crl.t @@ -16,7 +16,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/; setup("test_crl"); -plan tests => 12; +plan tests => 13; require_ok(srctop_file('test','recipes','tconversion.pl')); @@ -45,6 +45,31 @@ ok(compare1stline_stdin([qw{openssl crl -hash -noout}], '106cd822'), "crl piped input test"); +# Cover the -crlnumber and -issuer print options. +subtest 'crl -crlnumber and -issuer' => sub { + plan tests => 4; + + my $crl_num = + srctop_file("test/certs", "delta-crl-as-complete-delta.pem"); + my $crl_nonum = srctop_file("test", "testcrl.pem"); + my $issuer_num = "issuer=CN=Delta CRL as Complete Test CA"; + my $issuer_nonum = "issuer=C=US, O=RSA Data Security, Inc.," + . " OU=Secure Server Certification Authority"; + + ok(compare1stline([qw{openssl crl -noout -crlnumber -in}, $crl_num], + 'crlNumber=0x2000'), + "-crlnumber prints the CRL Number"); + ok(compare1stline([qw{openssl crl -noout -crlnumber -in}, $crl_nonum], + 'crlNumber='), + "-crlnumber prints when the CRL has no CRL Number"); + ok(compare1stline([qw{openssl crl -noout -issuer -in}, $crl_num], + $issuer_num), + "-issuer prints the CRL issuer DN"); + ok(compare1stline([qw{openssl crl -noout -issuer -in}, $crl_nonum], + $issuer_nonum), + "-issuer prints another CRL issuer DN"); +}; + ok(!run(app(["openssl", "crl", "-text", "-in", $pem, "-inform", "DER", "-out", $out, "-nameopt", "utf8"]))); ok(run(app(["openssl", "crl", "-text", "-in", $pem, "-inform", "PEM",