summaryrefslogtreecommitdiff
path: root/apps/req.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2002-08-22 23:43:48 +0000
committerDr. Stephen Henson <steve@openssl.org>2002-08-22 23:43:48 +0000
commitfc85ac20c7540c2db46235f32b3505db6ca7f304 (patch)
treef3cd8b40f0c672c2b2b7b7e1632cc3e9aa551b89 /apps/req.c
parente88479243cdb19d1bc194f280923395b7856380b (diff)
downloadopenssl-new-fc85ac20c7540c2db46235f32b3505db6ca7f304.tar.gz
Make -nameopt work in req and add support for -reqopt
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/req.c b/apps/req.c
index 1105e59e67..c4bec05436 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -155,7 +155,7 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ECDSA
EC_KEY *ec_params = NULL;
#endif
- unsigned long nmflag = 0;
+ unsigned long nmflag = 0, reqflag = 0;
int ex=1,x509=0,days=30;
X509 *x509ss=NULL;
X509_REQ *req=NULL;
@@ -408,6 +408,11 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
}
+ else if (strcmp(*argv,"-reqopt") == 0)
+ {
+ if (--argc < 1) goto bad;
+ if (!set_cert_ex(&reqflag, *(++argv))) goto bad;
+ }
else if (strcmp(*argv,"-subject") == 0)
subject=1;
else if (strcmp(*argv,"-text") == 0)
@@ -503,7 +508,8 @@ bad:
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");
BIO_printf(bio_err," -utf8 input characters are UTF8 (default ASCII)\n");
- BIO_printf(bio_err," -nameopt arg - various certificate name options\n");
+ BIO_printf(bio_err," -nameopt arg - various certificate name options\n");
+ BIO_printf(bio_err," -reqopt arg - various request text options\n\n");
goto end;
}
@@ -1051,9 +1057,9 @@ loop:
if (text)
{
if (x509)
- X509_print(out,x509ss);
+ X509_print_ex(out, x509ss, nmflag, reqflag);
else
- X509_REQ_print(out,req);
+ X509_REQ_print_ex(out, req, nmflag, reqflag);
}
if(subject)