diff --git a/test/recipes/15-test_pkey.t b/test/recipes/15-test_pkey.t index 583608cf0b2ec0..ab039ab8628c09 100644 --- a/test/recipes/15-test_pkey.t +++ b/test/recipes/15-test_pkey.t @@ -42,22 +42,27 @@ subtest "=== pkey en-/decryption using AES256-CBC ===" => sub { subtest "=== pkey handling of identical input and output files, using 3DES and -traditional ===" => sub { plan tests => 4; - my $encrypted_key2 = 'encrypted_key2.pem'; - my $inout = 'inout.pem'; - copy($in_key, $inout); - ok(run(app(['openssl', 'pkey', '-des3', '-traditional', '-in', $inout, - '-out', $inout, '-passout', 'pass:password'])), - "identical infile and outfile, encrypt"); - copy($inout, $encrypted_key2); - ok(run(app(['openssl', 'pkey', '-in', $inout, - '-out', $inout, '-passin', 'pass:password'])), - "identical infile and outfile, decrypt"); - is(compare($in_key, $inout), 0, - "Same file contents after encrypting and decrypting in same file"); - - sub file_line_contains { grep /$_[0]/, ((open F, $_[1]), , close F) } - ok(file_line_contains("DEK-Info: DES-EDE3-CBC,", $encrypted_key2), - "encrypted traditional file contains \"DEK-Info: DES-EDE3-CBC,\""); + SKIP: { + skip "DES isn't supported in this build", 4 + if disabled("des"); + + my $encrypted_key2 = 'encrypted_key2.pem'; + my $inout = 'inout.pem'; + copy($in_key, $inout); + ok(run(app(['openssl', 'pkey', '-des3', '-traditional', '-in', $inout, + '-out', $inout, '-passout', 'pass:password'])), + "identical infile and outfile, encrypt"); + copy($inout, $encrypted_key2); + ok(run(app(['openssl', 'pkey', '-in', $inout, + '-out', $inout, '-passin', 'pass:password'])), + "identical infile and outfile, decrypt"); + is(compare($in_key, $inout), 0, + "Same file contents after encrypting and decrypting in same file"); + + sub file_line_contains { grep /$_[0]/, ((open F, $_[1]), , close F) } + ok(file_line_contains("DEK-Info: DES-EDE3-CBC,", $encrypted_key2), + "encrypted traditional file contains \"DEK-Info: DES-EDE3-CBC,\""); + } }; subtest "=== pkey handling of public keys ===" => sub {