setup("test_dsa");
plan skip_all => 'DSA is not supported in this build' if disabled('dsa');
-plan tests => 7;
+plan tests => 9;
require_ok(srctop_file('test','recipes','tconversion.pl'));
-in => srctop_file("test","testdsapub.pem"),
-args => ["pkey", "-pubin", "-pubout"] );
};
+
+SKIP: {
+ skip "Skipping PVK conversion test", 1
+ if disabled("rc4") || disabled("legacy") || disabled("pvkkdf");
+
+ subtest "dsa conversions using 'openssl dsa' -- PVK" => sub {
+ tconversion( -type => 'pvk', -prefix => 'dsa-pvk',
+ -in => srctop_file("test", "testdsa.pem"),
+ -args => ["dsa", "-passin", "pass:testpass",
+ "-passout", "pass:testpass",
+ "-provider", "default",
+ "-provider", "legacy"] );
+ };
+}
+
+subtest "dsa PVK output is rejected for public key input" => sub {
+ plan tests => 1;
+
+ # Note: -noout would short-circuit before the format check, so request
+ # an actual encoding to reach the PVK-with-public-key rejection.
+ ok(!run(app(['openssl', 'dsa', '-pubin', '-outform', 'PVK',
+ '-in', srctop_file("test", "testdsapub.pem"),
+ '-out', 'dsa-pubin.pvk'])),
+ "-outform PVK with -pubin is rejected");
+};