diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-02-08 02:34:59 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-02-08 02:34:59 +0100 |
commit | f07fb9b24be9ae2d21647257d830da565561df3b (patch) | |
tree | 4ca3e722e549cbc804b0b60e4ef1a27e59f88260 /apps/gendsa.c | |
parent | des_modes is a section 7 manual, so let's make sure that's where it ends up (diff) | |
download | openssl-f07fb9b24be9ae2d21647257d830da565561df3b.tar.xz openssl-f07fb9b24be9ae2d21647257d830da565561df3b.zip |
Add command line password options to the reamining utilities,
amend docs.
Diffstat (limited to 'apps/gendsa.c')
-rw-r--r-- | apps/gendsa.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/gendsa.c b/apps/gendsa.c index 49ae0a0676..0c56b1410a 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -79,6 +79,7 @@ int MAIN(int argc, char **argv) int ret=1; char *outfile=NULL; char *inrand=NULL,*dsaparams=NULL; + char *passout = NULL; BIO *out=NULL,*in=NULL; EVP_CIPHER *enc=NULL; @@ -98,6 +99,22 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; outfile= *(++argv); } + else if (strcmp(*argv,"-envpassout") == 0) + { + if (--argc < 1) goto bad; + if(!(passout= getenv(*(++argv)))) + { + BIO_printf(bio_err, + "Can't read environment variable %s\n", + *argv); + goto bad; + } + } + else if (strcmp(*argv,"-passout") == 0) + { + if (--argc < 1) goto bad; + passout= *(++argv); + } else if (strcmp(*argv,"-rand") == 0) { if (--argc < 1) goto bad; @@ -188,7 +205,7 @@ bad: app_RAND_write_file(NULL, bio_err); - if (!PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,NULL,NULL)) + if (!PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,PEM_cb, passout)) goto end; ret=0; end: |