diff options
author | Kan <chenxinpingc2306@163.com> | 2022-06-21 14:55:55 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-07-11 10:01:17 +1000 |
commit | 8403c7350fd836ea44baf69c0b7dc3af1189253f (patch) | |
tree | c9ee83a094f35c27d9e84c4a76d9eb2cd28b2c64 /apps/speed.c | |
parent | b4ba4c8ee8f75ac60d1e26eb80110b68527b44d8 (diff) |
Add config option for speed command
Fixed #16986
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18616)
Diffstat (limited to 'apps/speed.c')
-rw-r--r-- | apps/speed.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c index c56f8e69f6..65220d31f1 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -210,7 +210,7 @@ static int opt_found(const char *name, unsigned int *result, typedef enum OPTION_choice { OPT_COMMON, OPT_ELAPSED, OPT_EVP, OPT_HMAC, OPT_DECRYPT, OPT_ENGINE, OPT_MULTI, - OPT_MR, OPT_MB, OPT_MISALIGN, OPT_ASYNCJOBS, OPT_R_ENUM, OPT_PROV_ENUM, + OPT_MR, OPT_MB, OPT_MISALIGN, OPT_ASYNCJOBS, OPT_R_ENUM, OPT_PROV_ENUM, OPT_CONFIG, OPT_PRIMES, OPT_SECONDS, OPT_BYTES, OPT_AEAD, OPT_CMAC } OPTION_CHOICE; @@ -237,6 +237,7 @@ const OPTIONS speed_options[] = { {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, #endif {"primes", OPT_PRIMES, 'p', "Specify number of primes (for RSA only)"}, + OPT_CONFIG_OPTION, OPT_SECTION("Selection"), {"evp", OPT_EVP, 's', "Use EVP-named cipher or digest"}, @@ -1342,6 +1343,7 @@ static EVP_PKEY *get_ecdsa(const EC_CURVE *curve) int speed_main(int argc, char **argv) { + CONF *conf = NULL; ENGINE *e = NULL; loopargs_t *loopargs = NULL; const char *prog; @@ -1598,6 +1600,11 @@ int speed_main(int argc, char **argv) if (!opt_provider(o)) goto end; break; + case OPT_CONFIG: + conf = app_load_config_modules(opt_arg()); + if (conf == NULL) + goto end; + break; case OPT_PRIMES: primes = opt_int_arg(); break; @@ -3350,6 +3357,7 @@ int speed_main(int argc, char **argv) release_engine(e); EVP_CIPHER_free(evp_cipher); EVP_MAC_free(mac); + NCONF_free(conf); return ret; } |