Add AGL's "beer mug" PEM file as another test input
[openssl.git] / test / recipes / 04-test_pem.t
index 291f2ba3da5047a005166c89bfdf37536cabe640..23d1ef8a93ea5357f25732978cf111fb2b90aa76 100644 (file)
@@ -76,7 +76,7 @@ my %dsa_expected = (
     "dsa.pem" => 1
 );
 
-plan tests =>  scalar keys(%cert_expected) + scalar keys(%dsa_expected);
+plan tests =>  scalar keys(%cert_expected) + scalar keys(%dsa_expected) + 1;
 
 foreach my $input (keys %cert_expected) {
     my @common = ($cmd, "x509", "-text", "-noout", "-inform", "PEM", "-in");
@@ -93,3 +93,10 @@ SKIP: {
         is((scalar @match > 0 ? 1 : 0), $dsa_expected{$input});
     }
 }
+SKIP: {
+    skip "RSA support disabled, skipping...", 1 unless !disabled("rsa");
+    my @common = ($cmd, "pkey", "-inform", "PEM", "-noout", "-text", "-in");
+    my @data = run(app([@common, data_file("beermug.pem")], stderr => undef), capture => 1);
+    my @match = grep /00:a0:3a:21:14:5d:cd:b6:d5:a0:3e:49:23:c1:3a:/, @data;
+    ok(scalar @match > 0 ? 1 : 0);
+}