diff options
author | Petr Gotthard <petr.gotthard@centrum.cz> | 2020-12-26 21:32:14 +0100 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-05 10:24:04 +1000 |
commit | 7dc67708c8ae6ec06c7fec34781225ed60b5e68d (patch) | |
tree | c48ecd0e6c3a24a5837a09a7e7497c458052d4c6 /apps/include | |
parent | 88444854affe31ce08a5daaf4b6afc86e6972c63 (diff) |
apps/openssl: add -propquery command line option
Fixes #13656. Right now all openssl commands use a NULL propq. This
patch adds a possibility to specify a custom propq.
The implementation follows the example of set_nameopt/get_nameopt.
Various tools had to be modified to call app_get0_propq after it has
been populated. Otherwise the -propquery has no effect.
The tests then verify the -propquery affects the tool behaviour by
requesting a non-existing property.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13707)
Diffstat (limited to 'apps/include')
-rw-r--r-- | apps/include/apps.h | 1 | ||||
-rw-r--r-- | apps/include/opt.h | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/include/apps.h b/apps/include/apps.h index c0e351b3b9..d4241fa61e 100644 --- a/apps/include/apps.h +++ b/apps/include/apps.h @@ -323,6 +323,7 @@ int app_provider_load(OSSL_LIB_CTX *libctx, const char *provider_name); void app_providers_cleanup(void); OSSL_LIB_CTX *app_get0_libctx(void); +int app_set_propq(const char *arg); const char *app_get0_propq(void); #endif diff --git a/apps/include/opt.h b/apps/include/opt.h index 5f3efe5105..d23bf262fc 100644 --- a/apps/include/opt.h +++ b/apps/include/opt.h @@ -270,7 +270,7 @@ */ # define OPT_PROV_ENUM \ OPT_PROV__FIRST=1600, \ - OPT_PROV_PROVIDER, OPT_PROV_PROVIDER_PATH, \ + OPT_PROV_PROVIDER, OPT_PROV_PROVIDER_PATH, OPT_PROV_PROPQUERY, \ OPT_PROV__LAST # define OPT_CONFIG_OPTION \ @@ -279,12 +279,14 @@ # define OPT_PROV_OPTIONS \ OPT_SECTION("Provider"), \ { "provider-path", OPT_PROV_PROVIDER_PATH, 's', "Provider load path (must be before 'provider' argument if required)" }, \ - { "provider", OPT_PROV_PROVIDER, 's', "Provider to load (can be specified multiple times)" } + { "provider", OPT_PROV_PROVIDER, 's', "Provider to load (can be specified multiple times)" }, \ + { "propquery", OPT_PROV_PROPQUERY, 's', "Property query used when fetching algorithms" } # define OPT_PROV_CASES \ OPT_PROV__FIRST: case OPT_PROV__LAST: break; \ case OPT_PROV_PROVIDER: \ - case OPT_PROV_PROVIDER_PATH + case OPT_PROV_PROVIDER_PATH: \ + case OPT_PROV_PROPQUERY /* * Option parsing. |