diff options
author | Richard Levitte <levitte@openssl.org> | 2020-05-28 13:53:48 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-06-02 09:42:34 +0200 |
commit | e306f83c8cfc7ac970d04a36c90634ab8573a594 (patch) | |
tree | 352bf9880fde70731de7f42a64b6892c6e72a73d /crypto/conf | |
parent | Remove getenv(OPENSSL_FIPS) in openssl command (diff) | |
download | openssl-e306f83c8cfc7ac970d04a36c90634ab8573a594.tar.xz openssl-e306f83c8cfc7ac970d04a36c90634ab8573a594.zip |
APPS: Remove make_config_name, use CONF_get1_default_config_file instead
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11983)
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_mod.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index 504d9b181a..9d3db8eb31 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -516,25 +516,23 @@ void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data) char *CONF_get1_default_config_file(void) { + const char *t; char *file, *sep = ""; - int len; + size_t size; if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) return OPENSSL_strdup(file); - len = strlen(X509_get_default_cert_area()); + t = X509_get_default_cert_area(); #ifndef OPENSSL_SYS_VMS - len++; sep = "/"; #endif - len += strlen(OPENSSL_CONF); - - file = OPENSSL_malloc(len + 1); + size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1; + file = OPENSSL_malloc(size); if (file == NULL) return NULL; - BIO_snprintf(file, len + 1, "%s%s%s", X509_get_default_cert_area(), - sep, OPENSSL_CONF); + BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF); return file; } |