diff options
author | Rich Salz <rsalz@akamai.com> | 2020-06-28 21:11:48 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-07-15 23:17:29 +0200 |
commit | 5744dacb3a9d785d587afb61831cb1ff2be6ed0d (patch) | |
tree | 88e93dfa7992a174b506380074298bb6f7ba03be /apps | |
parent | d3b243d15bdbd4191a8c615f3654d00e1194d17c (diff) |
Make -provider_name and -section_name optional
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12311)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/fipsinstall.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/fipsinstall.c b/apps/fipsinstall.c index fde82ef8a7..7efdd65d46 100644 --- a/apps/fipsinstall.c +++ b/apps/fipsinstall.c @@ -22,8 +22,6 @@ DEFINE_STACK_OF_STRING() #define BUFSIZE 4096 -#define DEFAULT_MAC_NAME "HMAC" -#define DEFAULT_FIPS_SECTION "fips_check_section" /* Configuration file values */ #define VERSION_KEY "version" @@ -268,10 +266,12 @@ end: int fipsinstall_main(int argc, char **argv) { int ret = 1, verify = 0, gotkey = 0, gotdigest = 0; + const char *section_name = "fips_sect"; + const char *mac_name = "HMAC"; + const char *prov_name = "fips"; BIO *module_bio = NULL, *mem_bio = NULL, *fout = NULL; - char *in_fname = NULL, *out_fname = NULL, *prog, *section_name = NULL; - char *prov_name = NULL, *module_fname = NULL; - static const char *mac_name = DEFAULT_MAC_NAME; + char *in_fname = NULL, *out_fname = NULL, *prog; + char *module_fname = NULL; EVP_MAC_CTX *ctx = NULL, *ctx2 = NULL; STACK_OF(OPENSSL_STRING) *opts = NULL; OPTION_CHOICE o; @@ -283,7 +283,6 @@ int fipsinstall_main(int argc, char **argv) EVP_MAC *mac = NULL; CONF *conf = NULL; - section_name = DEFAULT_FIPS_SECTION; if ((opts = sk_OPENSSL_STRING_new_null()) == NULL) goto end; @@ -345,7 +344,7 @@ opthelp: argc = opt_num_rest(); if (module_fname == NULL || (verify && in_fname == NULL) - || (!verify && (out_fname == NULL || prov_name == NULL)) + || (!verify && out_fname == NULL) || argc != 0) goto opthelp; @@ -357,7 +356,6 @@ opthelp: /* Use the default FIPS HMAC digest and key if not specified. */ if (!gotdigest && !sk_OPENSSL_STRING_push(opts, "digest:SHA256")) goto end; - /* Use the default FIPS HMAC key if not specified. */ if (!gotkey && !sk_OPENSSL_STRING_push(opts, "hexkey:" FIPS_KEY_STRING)) goto end; |