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;
14 # Normally, this test recipe tests the default GOST provider. However, it's
15 # also possible to test a different provider as well, possibly a custom build.
16 # In that case, use the environment variable PROVIDER_NAME to name it. This
17 # overrides a few things:
19 # - if it exists, we get the text that 'openssl provider -c ${PROVIDER_NAME}'
20 # should print from the file "${PROVIDER_NAME}.info".
21 # - we create an OpenSSL config file for that provider, and use that instead
22 # of the default. We do this by overriding the environment variable
25 # If PROVIDER_NAME isn't set, we rely on an existing OPENSSL_CONF
27 if ($ENV{'PROVIDER_NAME'}) {
28 $provider=$ENV{'PROVIDER_NAME'};
30 if ( -f $provider . ".info") {
31 diag("Reading $provider.info");
32 open my $F, "<", $provider . ".info";
33 read $F,$provider_info,1024;
37 open my $F,">","$provider.cnf";
39 openssl_conf = openssl_def
45 default_algorithms = ALL
48 $ENV{'OPENSSL_CONF'}=abs_path("$provider.cnf");
51 # Let's check that we can load the provider without config file
52 # Note that this still requires a properly defined OPENSSL_MODULES
54 local $ENV{'OPENSSL_CONF'}=abs_path("no_such_file.cfg");
55 my $cmd = "openssl list -provider $provider -providers";
56 unless (is(`$cmd`, $provider_info,
57 "load provider without any config")) {
58 diag("Command was: $cmd");