xref: /freebsd/crypto/openssl/test/recipes/15-test_genpkey.t (revision e7be843b4a162e68651d3911f0357ed464915629)
1*e7be843bSPierre Pronchery#! /usr/bin/env perl
2*e7be843bSPierre Pronchery# Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
3*e7be843bSPierre Pronchery#
4*e7be843bSPierre Pronchery# Licensed under the Apache License 2.0 (the "License").  You may not use
5*e7be843bSPierre Pronchery# this file except in compliance with the License.  You can obtain a copy
6*e7be843bSPierre Pronchery# in the file LICENSE in the source distribution or at
7*e7be843bSPierre Pronchery# https://www.openssl.org/source/license.html
8*e7be843bSPierre Pronchery
9*e7be843bSPierre Proncheryuse strict;
10*e7be843bSPierre Proncheryuse warnings;
11*e7be843bSPierre Pronchery
12*e7be843bSPierre Proncheryuse OpenSSL::Test qw/:DEFAULT/;
13*e7be843bSPierre Proncheryuse OpenSSL::Test::Utils;
14*e7be843bSPierre Pronchery
15*e7be843bSPierre Proncherysetup("test_genpkey");
16*e7be843bSPierre Pronchery
17*e7be843bSPierre Proncherymy @algs = ();
18*e7be843bSPierre Proncherypush @algs, qw(RSA) unless disabled("rsa");
19*e7be843bSPierre Proncherypush @algs, qw(DSA) unless disabled("dsa");
20*e7be843bSPierre Proncherypush @algs, qw(DH DHX) unless disabled("dh");
21*e7be843bSPierre Proncherypush @algs, qw(EC) unless disabled("ec");
22*e7be843bSPierre Proncherypush @algs, qw(X25519 X448) unless disabled("ecx");
23*e7be843bSPierre Proncherypush @algs, qw(SM2) unless disabled("sm2");
24*e7be843bSPierre Pronchery
25*e7be843bSPierre Proncheryplan tests => scalar(@algs);
26*e7be843bSPierre Pronchery
27*e7be843bSPierre Proncheryforeach (@algs) {
28*e7be843bSPierre Pronchery    my $alg = $_;
29*e7be843bSPierre Pronchery
30*e7be843bSPierre Pronchery    ok(run(app([ 'openssl', 'genpkey', '-algorithm', $alg, '-help'])),
31*e7be843bSPierre Pronchery       "show genpkey pkeyopt values for $alg");
32*e7be843bSPierre Pronchery}
33