diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-08-27 00:08:17 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-08-27 00:08:17 +0000 |
commit | 87a25f90324aa6f48d903a22852ff2ce1aa9dde0 (patch) | |
tree | bcd666bfc43093138c8be8ed9256b1ba899a4901 /apps/req.c | |
parent | f9150e54214b26fb03f9d933926cb1176198d6c0 (diff) |
Allow the extension section specified in config files to be overridden
on the command line for various utilities.
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/req.c b/apps/req.c index fa8f7339f3..cc524de8e2 100644 --- a/apps/req.c +++ b/apps/req.c @@ -310,8 +310,17 @@ int MAIN(int argc, char **argv) /* ok */ digest=md_alg; } + else if (strcmp(*argv,"-extensions") == 0) + { + if (--argc < 1) goto bad; + extensions = *(++argv); + } + else if (strcmp(*argv,"-reqexts") == 0) + { + if (--argc < 1) goto bad; + req_exts = *(++argv); + } else - { BIO_printf(bio_err,"unknown option %s\n",*argv); badops=1; @@ -349,6 +358,8 @@ bad: BIO_printf(bio_err," -asn1-kludge Output the 'request' in a format that is wrong but some CA's\n"); BIO_printf(bio_err," have been reported as requiring\n"); BIO_printf(bio_err," [ It is now always turned on but can be turned off with -no-asn1-kludge ]\n"); + BIO_printf(bio_err," -extensions .. specify certificate extension section (override value in config file)\n"); + BIO_printf(bio_err," -reqexts .. specify request extension section (override value in config file)\n"); goto end; } @@ -427,7 +438,8 @@ bad: digest=md_alg; } - extensions = CONF_get_string(req_conf, SECTION, V3_EXTENSIONS); + if(!extensions) + extensions = CONF_get_string(req_conf, SECTION, V3_EXTENSIONS); if(extensions) { /* Check syntax of file */ X509V3_CTX ctx; @@ -440,7 +452,8 @@ bad: } } - req_exts = CONF_get_string(req_conf, SECTION, REQ_EXTENSIONS); + if(!req_exts) + req_exts = CONF_get_string(req_conf, SECTION, REQ_EXTENSIONS); if(req_exts) { /* Check syntax of file */ X509V3_CTX ctx; |