aboutsummaryrefslogtreecommitdiffstats
path: root/apps/req.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-01-01 16:42:49 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-01-01 16:42:49 +0000
commit20432eae41e35ea28a4d43c0dfc7acfdd9672812 (patch)
treeab6b92cdf2f38923e3e106968aa0dca236e0b4f9 /apps/req.c
parent47134b7864fd5e31dbdbc789d9e073742ad4c3ee (diff)
downloadopenssl-20432eae41e35ea28a4d43c0dfc7acfdd9672812.tar.gz
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.
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c10
1 files changed, 4 insertions, 6 deletions
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);
}