summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-02-14 22:49:26 +0000
committerMatt Caswell <matt@openssl.org>2020-02-21 20:17:02 +0000
commit745fc918e7eeb86b2ac541325a8ae5c6e374ee56 (patch)
tree9c79d0d5d784ec0251bb08f51ab20a04c42e69cc /test
parent980a880ee5a85b94caac3049c7d3be0b765d97d3 (diff)
Introduce the provider property
Replace the properties default, fips and legacy with a single property called "provider". So, for example, instead of writing "default=yes" to get algorithms from the default provider you would instead write "provider=default". We also have a new "fips" property to indicate that an algorithm is compatible with FIPS mode. This applies to all the algorithms in the FIPS provider, as well as any non-cryptographic algorithms (currently only serializers). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11097)
Diffstat (limited to 'test')
-rw-r--r--test/evp_fetch_prov_test.c2
-rw-r--r--test/recipes/30-test_evp_fetch_prov.t68
2 files changed, 45 insertions, 25 deletions
diff --git a/test/evp_fetch_prov_test.c b/test/evp_fetch_prov_test.c
index 15d2bfc4b0..ca39236cd6 100644
--- a/test/evp_fetch_prov_test.c
+++ b/test/evp_fetch_prov_test.c
@@ -40,7 +40,7 @@ const OPTIONS *test_get_options(void)
static const OPTIONS test_options[] = {
OPT_TEST_OPTIONS_WITH_EXTRA_USAGE("[provname...]\n"),
{ "type", OPT_ALG_FETCH_TYPE, 's', "The fetch type to test" },
- { "property", OPT_FETCH_PROPERTY, 's', "The fetch property e.g. fips=yes" },
+ { "property", OPT_FETCH_PROPERTY, 's', "The fetch property e.g. provider=fips" },
{ "fetchfail", OPT_FETCH_FAILURE, '-', "fetch is expected to fail" },
{ "defaultctx", OPT_USE_DEFAULTCTX, '-',
"Use the default context if this is set" },
diff --git a/test/recipes/30-test_evp_fetch_prov.t b/test/recipes/30-test_evp_fetch_prov.t
index 82d984353b..ce7c834039 100644
--- a/test/recipes/30-test_evp_fetch_prov.t
+++ b/test/recipes/30-test_evp_fetch_prov.t
@@ -33,16 +33,16 @@ my @testdata = (
providers => [ 'default' ],
tests => [ { providers => [] },
{ },
- { args => [ '-property', 'default=yes' ],
- message => 'using property "default=yes"' },
- { args => [ '-property', 'fips=no' ],
- message => 'using property "fips=no"' },
- { args => [ '-property', 'default=no', '-fetchfail' ],
+ { args => [ '-property', 'provider=default' ],
+ message => 'using property "provider=default"' },
+ { args => [ '-property', 'provider!=fips' ],
+ message => 'using property "provider!=fips"' },
+ { args => [ '-property', 'provider!=default', '-fetchfail' ],
message =>
- 'using property "default=no" is expected to fail' },
- { args => [ '-property', 'fips=yes', '-fetchfail' ],
+ 'using property "provider!=default" is expected to fail' },
+ { args => [ '-property', 'provider=fips', '-fetchfail' ],
message =>
- 'using property "fips=yes" is expected to fail' } ] }
+ 'using property "provider=fips" is expected to fail' } ] }
);
unless ($no_fips) {
@@ -60,28 +60,48 @@ unless ($no_fips) {
providers => [ 'fips' ],
tests => [
{ args => [ '-property', '' ] },
- { args => [ '-property', 'fips=yes' ],
- message => 'using property "fips=yes"' },
- { args => [ '-property', 'default=no' ],
- message => 'using property "default = no"' },
- { args => [ '-property', 'default=yes', '-fetchfail' ],
+ { args => [ '-property', 'provider=fips' ],
+ message => 'using property "provider=fips"' },
+ { args => [ '-property', 'provider!=default' ],
+ message => 'using property "provider!=default"' },
+ { args => [ '-property', 'provider=default', '-fetchfail' ],
message =>
- 'using property "default=yes" is expected to fail' },
- { args => [ '-property', 'fips=no', '-fetchfail' ],
+ 'using property "provider=default" is expected to fail' },
+ { args => [ '-property', 'provider!=fips', '-fetchfail' ],
message =>
- 'using property "fips=no" is expected to fail' } ] },
+ 'using property "provider!=fips" is expected to fail' },
+ { args => [ '-property', 'fips=yes' ],
+ message => 'using property "fips=yes"' },
+ { args => [ '-property', 'fips!=no' ],
+ message => 'using property "fips!=no"' },
+ { args => [ '-property', '-fips' ],
+ message => 'using property "-fips"' },
+ { args => [ '-property', 'fips=no', '-fetchfail' ],
+ message => 'using property "fips=no is expected to fail"' },
+ { args => [ '-property', 'fips!=yes', '-fetchfail' ],
+ message => 'using property "fips!=yes is expected to fail"' } ] },
{ config => srctop_file("test", "default-and-fips.cnf"),
providers => [ 'default', 'fips' ],
tests => [
{ args => [ '-property', '' ] },
- { args => [ '-property', 'default=no' ],
- message => 'using property "default=no"' },
- { args => [ '-property', 'default=yes' ],
- message => 'using property "default=yes"' },
- { args => [ '-property', 'fips=no' ],
- message => 'using property "fips=no"' },
- { args => [ '-property', 'fips=yes' ],
- message => 'using property "fips=yes"' } ] }
+ { args => [ '-property', 'provider!=default' ],
+ message => 'using property "provider!=default"' },
+ { args => [ '-property', 'provider=default' ],
+ message => 'using property "provider=default"' },
+ { args => [ '-property', 'provider!=fips' ],
+ message => 'using property "provider!=fips"' },
+ { args => [ '-property', 'provider=fips' ],
+ message => 'using property "provider=fips"' },
+ { args => [ '-property', 'fips=yes' ],
+ message => 'using property "fips=yes"' },
+ { args => [ '-property', 'fips!=no' ],
+ message => 'using property "fips!=no"' },
+ { args => [ '-property', '-fips' ],
+ message => 'using property "-fips"' },
+ { args => [ '-property', 'fips=no' ],
+ message => 'using property "fips=no"' },
+ { args => [ '-property', 'fips!=yes' ],
+ message => 'using property "fips!=yes"' } ] },
);
}