summaryrefslogtreecommitdiffstats
path: root/apps/pkey.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-03-28 14:35:32 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-03-28 14:35:32 +0000
commit3e4585c8fd0b23f884d775462736502599146af6 (patch)
tree27b73970dedcc4215d6f7c4def10ee3990674143 /apps/pkey.c
parent3e84b6e15fe6a580177b9e242c66e1d1ab6c2164 (diff)
New utility pkeyparam. Enhance and bugfix algorithm specific parameter
functions to support it.
Diffstat (limited to 'apps/pkey.c')
-rw-r--r--apps/pkey.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/pkey.c b/apps/pkey.c
index b34974b8d1..e53b43a4e3 100644
--- a/apps/pkey.c
+++ b/apps/pkey.c
@@ -1,4 +1,4 @@
-/* pkey.c */
+/* apps/pkey.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 2006
*/
@@ -81,6 +81,7 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL;
#endif
+ int ret = 1;
if (bio_err == NULL)
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
@@ -203,7 +204,7 @@ int MAIN(int argc, char **argv)
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout))
{
BIO_printf(bio_err, "Error getting passwords\n");
- return 1;
+ goto end;
}
if (outfile)
@@ -212,7 +213,7 @@ int MAIN(int argc, char **argv)
{
BIO_printf(bio_err,
"Can't open output file %s\n", outfile);
- return (1);
+ goto end;
}
}
else
@@ -233,10 +234,7 @@ int MAIN(int argc, char **argv)
pkey = load_key(bio_err, infile, informat, 1,
passin, e, "key");
if (!pkey)
- {
- BIO_free_all(out);
- return 1;
- }
+ goto end;
if (!noout)
{
@@ -258,7 +256,7 @@ int MAIN(int argc, char **argv)
else
{
BIO_printf(bio_err, "Bad format specified for key\n");
- return (1);
+ goto end;
}
}
@@ -271,6 +269,8 @@ int MAIN(int argc, char **argv)
EVP_PKEY_print_private(out, pkey, 0, NULL);
}
+ ret = 0;
+
end:
EVP_PKEY_free(pkey);
BIO_free_all(out);
@@ -280,5 +280,5 @@ int MAIN(int argc, char **argv)
if (passout)
OPENSSL_free(passout);
- return (0);
+ return ret;
}