2016-04-22 19:21:51 +08:00
|
|
|
#! /usr/bin/env perl
|
2020-04-23 20:55:52 +08:00
|
|
|
# Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
2016-04-22 19:21:51 +08:00
|
|
|
#
|
2018-12-06 20:05:25 +08:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-04-22 19:21:51 +08:00
|
|
|
# this file except in compliance with the License. You can obtain a copy
|
|
|
|
# in the file LICENSE in the source distribution or at
|
|
|
|
# https://www.openssl.org/source/license.html
|
|
|
|
|
2015-04-18 02:13:58 +08:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use File::Spec;
|
2016-01-30 08:05:33 +08:00
|
|
|
use OpenSSL::Test qw/:DEFAULT srctop_file/;
|
2015-09-20 05:19:14 +08:00
|
|
|
use OpenSSL::Test::Utils;
|
2015-04-18 02:13:58 +08:00
|
|
|
|
|
|
|
setup("test_dsa");
|
|
|
|
|
2020-02-06 19:10:23 +08:00
|
|
|
plan skip_all => 'DSA is not supported in this build' if disabled('dsa');
|
|
|
|
plan tests => 7;
|
|
|
|
|
2016-01-30 08:05:33 +08:00
|
|
|
require_ok(srctop_file('test','recipes','tconversion.pl'));
|
2015-04-18 02:13:58 +08:00
|
|
|
|
2020-03-03 09:03:47 +08:00
|
|
|
ok(run(test(["dsatest"])), "running dsatest");
|
|
|
|
ok(run(test(["dsa_no_digest_size_test"])),
|
|
|
|
"running dsa_no_digest_size_test");
|
|
|
|
|
|
|
|
subtest "dsa conversions using 'openssl dsa' -- private key" => sub {
|
2020-10-15 22:53:29 +08:00
|
|
|
tconversion( -type => 'dsa', -prefix => 'dsa-priv',
|
|
|
|
-in => srctop_file("test","testdsa.pem") );
|
2020-03-03 09:03:47 +08:00
|
|
|
};
|
|
|
|
subtest "dsa conversions using 'openssl dsa' -- public key" => sub {
|
2020-10-15 22:53:29 +08:00
|
|
|
tconversion( -type => 'msb', -prefix => 'dsa-msb-pub',
|
|
|
|
-in => srctop_file("test","testdsapub.pem"),
|
|
|
|
-args => ["dsa", "-pubin", "-pubout"] );
|
2020-03-03 09:03:47 +08:00
|
|
|
};
|
2020-02-06 19:10:23 +08:00
|
|
|
|
|
|
|
subtest "dsa conversions using 'openssl pkey' -- private key PKCS#8" => sub {
|
2020-10-15 22:53:29 +08:00
|
|
|
tconversion( -type => 'dsa', -prefix => 'dsa-pkcs8',
|
|
|
|
-in => srctop_file("test","testdsa.pem"),
|
|
|
|
-args => ["pkey"] );
|
2020-02-06 19:10:23 +08:00
|
|
|
};
|
|
|
|
subtest "dsa conversions using 'openssl pkey' -- public key" => sub {
|
2020-10-15 22:53:29 +08:00
|
|
|
tconversion( -type => 'dsa', -prefix => 'dsa-pkey-pub',
|
|
|
|
-in => srctop_file("test","testdsapub.pem"),
|
|
|
|
-args => ["pkey", "-pubin", "-pubout"] );
|
2020-02-06 19:10:23 +08:00
|
|
|
};
|