提交 4e96633a 编写于 作者: D Dr. Stephen Henson

PR: 2262

Submitted By: Victor Wagner <vitus@cryptocom.ru>

Fix error reporting in load_key function.
上级 77cf9e09
...@@ -875,10 +875,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin, ...@@ -875,10 +875,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
if (format == FORMAT_ENGINE) if (format == FORMAT_ENGINE)
{ {
if (!e) if (!e)
BIO_printf(bio_err,"no engine specified\n"); BIO_printf(err,"no engine specified\n");
else else
{
pkey = ENGINE_load_private_key(e, file, pkey = ENGINE_load_private_key(e, file,
ui_method, &cb_data); ui_method, &cb_data);
if (!pkey)
{
BIO_printf(err,"cannot load %s from engine\n",key_descrip);
ERR_print_errors(err);
}
}
goto end; goto end;
} }
#endif #endif
...@@ -937,8 +944,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin, ...@@ -937,8 +944,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
} }
end: end:
if (key != NULL) BIO_free(key); if (key != NULL) BIO_free(key);
if (pkey == NULL) if (pkey == NULL)
{
BIO_printf(err,"unable to load %s\n", key_descrip); BIO_printf(err,"unable to load %s\n", key_descrip);
ERR_print_errors(err);
}
return(pkey); return(pkey);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册