From 6938440d6822be3545108411e2149a34f2aee377 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 27 May 2010 14:09:13 +0000 Subject: [PATCH] PR: 2262 Submitted By: Victor Wagner Fix error reporting in load_key function. --- apps/apps.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/apps.c b/apps/apps.c index 91d2f189c6..acc50df04e 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -875,10 +875,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 @@ -937,8 +944,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); } -- 2.25.1