15-test_dsa.t 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /usr/bin/env perl
  2. # Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. use strict;
  9. use warnings;
  10. use File::Spec;
  11. use OpenSSL::Test qw/:DEFAULT srctop_file/;
  12. use OpenSSL::Test::Utils;
  13. setup("test_dsa");
  14. plan skip_all => 'DSA is not supported in this build' if disabled('dsa');
  15. plan tests => 7;
  16. require_ok(srctop_file('test','recipes','tconversion.pl'));
  17. ok(run(test(["dsatest"])), "running dsatest");
  18. ok(run(test(["dsa_no_digest_size_test"])),
  19. "running dsa_no_digest_size_test");
  20. subtest "dsa conversions using 'openssl dsa' -- private key" => sub {
  21. tconversion("dsa", srctop_file("test","testdsa.pem"));
  22. };
  23. subtest "dsa conversions using 'openssl dsa' -- public key" => sub {
  24. tconversion("msb", srctop_file("test","testdsapub.pem"), "dsa",
  25. "-pubin", "-pubout");
  26. };
  27. subtest "dsa conversions using 'openssl pkey' -- private key PKCS#8" => sub {
  28. tconversion("dsa", srctop_file("test","testdsa.pem"), "pkey");
  29. };
  30. subtest "dsa conversions using 'openssl pkey' -- public key" => sub {
  31. tconversion("dsa", srctop_file("test","testdsapub.pem"), "pkey",
  32. "-pubin", "-pubout");
  33. };