3 skip_all('This test is only suitable for the provider')
4 unless $ARGV[0] eq 'provider';
8 my $provider = 'gostprov';
9 my $provider_info = <<EOINF;
12 name: OpenSSL GOST Provider
16 # Normally, this test recipe tests the default GOST provider. However, it's
17 # also possible to test a different provider as well, possibly a custom build.
18 # In that case, use the environment variable PROVIDER_NAME to name it. This
19 # overrides a few things:
21 # - if it exists, we get the text that 'openssl provider -c ${PROVIDER_NAME}'
22 # should print from the file "${PROVIDER_NAME}.info".
23 # - we create an OpenSSL config file for that provider, and use that instead
24 # of the default. We do this by overriding the environment variable
27 # If PROVIDER_NAME isn't set, we rely on an existing OPENSSL_CONF
29 if ($ENV{'PROVIDER_NAME'}) {
30 $provider=$ENV{'PROVIDER_NAME'};
32 if ( -f $provider . ".info") {
33 diag("Reading $provider.info");
34 open my $F, "<", $provider . ".info";
35 read $F,$provider_info,1024;
39 open my $F,">","$provider.cnf";
41 openssl_conf = openssl_def
47 default_algorithms = ALL
50 $ENV{'OPENSSL_CONF'}=abs_path("$provider.cnf");
53 # Let's check that we can load the provider without config file
54 # Note that this still requires a properly defined OPENSSL_MODULES
56 local $ENV{'OPENSSL_CONF'}=abs_path("no_such_file.cfg");
57 my $cmd = "openssl list -provider $provider -providers";
58 unless (is(`$cmd`, $provider_info,
59 "load provider without any config")) {
60 diag("Command was: $cmd");