summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-05-27 14:09:22 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-05-27 14:09:22 +0000
commitc1f1a03d0c9372ddd92941d7797f297e332b4e1c (patch)
treeceb96d93ffccb03b634aac826d5ee0ce296b5239 /apps
parent278a447ee8accb9bcc77c2bf42d504f067fda30a (diff)
PR: 2262
Submitted By: Victor Wagner <vitus@cryptocom.ru> Fix error reporting in load_key function.
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/apps.c b/apps/apps.c
index 35b62b8b09..ab60b700b0 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -866,10 +866,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
if (format == FORMAT_ENGINE)
{
if (!e)
- BIO_printf(bio_err,"no engine specified\n");
+ BIO_printf(err,"no engine specified\n");
else
+ {
pkey = ENGINE_load_private_key(e, file,
ui_method, &cb_data);
+ if (!pkey)
+ {
+ BIO_printf(err,"cannot load %s from engine\n",key_descrip);
+ ERR_print_errors(err);
+ }
+ }
goto end;
}
#endif
@@ -919,8 +926,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
}
end:
if (key != NULL) BIO_free(key);
- if (pkey == NULL)
+ if (pkey == NULL)
+ {
BIO_printf(err,"unable to load %s\n", key_descrip);
+ ERR_print_errors(err);
+ }
return(pkey);
}