15-test_genpkey.t 931 B

1234567891011121314151617181920212223242526272829303132
  1. #! /usr/bin/env perl
  2. # Copyright 2022-2023 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 OpenSSL::Test qw/:DEFAULT/;
  11. use OpenSSL::Test::Utils;
  12. setup("test_genpkey");
  13. my @algs = ();
  14. push @algs, qw(RSA) unless disabled("rsa");
  15. push @algs, qw(DSA) unless disabled("dsa");
  16. push @algs, qw(DH DHX) unless disabled("dh");
  17. push @algs, qw(EC) unless disabled("ec");
  18. push @algs, qw(X25519 X448) unless disabled("ecx");
  19. push @algs, qw(SM2) unless disabled("sm2");
  20. plan tests => scalar(@algs);
  21. foreach (@algs) {
  22. my $alg = $_;
  23. ok(run(app([ 'openssl', 'genpkey', '-algorithm', $alg, '-help'])),
  24. "show genpkey pkeyopt values for $alg");
  25. }