aboutsummaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-28 13:52:55 -0400
committerRich Salz <rsalz@openssl.org>2015-05-28 17:28:33 -0400
commitcc01d21756cc9c79231ef21039782c5fe42008a2 (patch)
treecb92584cc79d9994f9859b15c04a645d0b020389 /apps/x509.c
parentf097f81c891bb1f479426d8ac9c9541390334983 (diff)
downloadopenssl-cc01d21756cc9c79231ef21039782c5fe42008a2.tar.gz
RT3876: Only load config when needed
Create app_load_config(), a routine to load config file. Remove the "always load config" from the main app. Change the places that used to load config to call the new common routine. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/apps/x509.c b/apps/x509.c
index f22eef18f3..1a6e32782b 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -521,19 +521,9 @@ int x509_main(int argc, char **argv)
}
if (extfile) {
- long errorline = -1;
X509V3_CTX ctx2;
- extconf = NCONF_new(NULL);
- if (!NCONF_load(extconf, extfile, &errorline)) {
- if (errorline <= 0)
- BIO_printf(bio_err,
- "error loading the config file '%s'\n", extfile);
- else
- BIO_printf(bio_err,
- "error on line %ld of config file '%s'\n",
- errorline, extfile);
+ if ((extconf = app_load_config(extfile)) == NULL)
goto end;
- }
if (!extsect) {
extsect = NCONF_get_string(extconf, "default", "extensions");
if (!extsect) {