From 20432eae41e35ea28a4d43c0dfc7acfdd9672812 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 1 Jan 2000 16:42:49 +0000 Subject: Fix some of the command line password stuff. New function that can automatically determine the type of a DER encoded "traditional" format private key and change some of the d2i functions to use it instead of requiring the application to work out the key type. --- apps/req.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apps/req.c') diff --git a/apps/req.c b/apps/req.c index 24e666f0dc..5c14c71e57 100644 --- a/apps/req.c +++ b/apps/req.c @@ -237,14 +237,13 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv,"-envpassout") == 0) { if (--argc < 1) goto bad; - if(!(passout= getenv(*(++argv)))) + if(!(passout= getenv(*(++argv)))) { BIO_printf(bio_err, "Can't read environment variable %s\n", *argv); badops = 1; } - argv++; } else if (strcmp(*argv,"-passout") == 0) { @@ -527,10 +526,9 @@ bad: goto end; } -/* if (keyform == FORMAT_ASN1) - rsa=d2i_RSAPrivateKey_bio(in,NULL); - else */ - if (keyform == FORMAT_PEM) + if (keyform == FORMAT_ASN1) + pkey=d2i_PrivateKey_bio(in,NULL); + else if (keyform == FORMAT_PEM) { pkey=PEM_read_bio_PrivateKey(in,NULL,PEM_cb,passin); } -- cgit v1.2.3