aboutsummaryrefslogtreecommitdiffstats
path: root/apps/req.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-02-18 00:54:21 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-02-18 00:54:21 +0000
commit8a208cba97b0d08cfc6f07bb2f0e0d1f305a0b13 (patch)
tree6daa5b98977cc35fac41071a861e13f207ea16bf /apps/req.c
parent5c2ec54f120270d1edc5ec7caa6384355a670355 (diff)
downloadopenssl-8a208cba97b0d08cfc6f07bb2f0e0d1f305a0b13.tar.gz
New functions and option to use NEW in certificate requests.
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/req.c b/apps/req.c
index 07a47c607f..79a7394088 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -150,7 +150,7 @@ int MAIN(int argc, char **argv)
int i,badops=0,newreq=0,newkey= -1,pkey_type=0;
BIO *in=NULL,*out=NULL;
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
- int nodes=0,kludge=0;
+ int nodes=0,kludge=0,newhdr=0;
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
char *extensions = NULL;
char *req_exts = NULL;
@@ -306,6 +306,8 @@ int MAIN(int argc, char **argv)
newreq=1;
}
+ else if (strcmp(*argv,"-newhdr") == 0)
+ newhdr=1;
else if (strcmp(*argv,"-modulus") == 0)
modulus=1;
else if (strcmp(*argv,"-verify") == 0)
@@ -378,6 +380,7 @@ bad:
BIO_printf(bio_err," -new new request.\n");
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
BIO_printf(bio_err," -days number of days a x509 generated by -x509 is valid for.\n");
+ BIO_printf(bio_err," -newhdr output \"NEW\" in the header lines\n");
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," -extensions .. specify certificate extension section (override value in config file)\n");
@@ -834,9 +837,10 @@ loop:
{
if (outformat == FORMAT_ASN1)
i=i2d_X509_REQ_bio(out,req);
- else if (outformat == FORMAT_PEM)
- i=PEM_write_bio_X509_REQ(out,req);
- else {
+ else if (outformat == FORMAT_PEM) {
+ if(newhdr) i=PEM_write_bio_X509_REQ_NEW(out,req);
+ else i=PEM_write_bio_X509_REQ(out,req);
+ } else {
BIO_printf(bio_err,"bad output format specified for outfile\n");
goto end;
}