1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

libcrypto: Report errors from OpenSSL key import and export

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2023-08-24 11:08:12 +02:00
parent 04acf9a8ab
commit 63be7f7651
2 changed files with 6 additions and 0 deletions

View File

@@ -1481,6 +1481,9 @@ int evp_build_pkey(const char* name, OSSL_PARAM_BLD *param_bld,
rc = EVP_PKEY_fromdata(ctx, pkey, selection, params);
if (rc != 1) {
SSH_LOG(SSH_LOG_WARNING,
"Failed to import private key: %s\n",
ERR_error_string(ERR_get_error(), NULL));
OSSL_PARAM_free(params);
EVP_PKEY_CTX_free(ctx);
return -1;

View File

@@ -967,6 +967,9 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
pkey = NULL;
if (rc != 1) {
SSH_LOG(SSH_LOG_WARNING,
"Failed to write private key: %s\n",
ERR_error_string(ERR_get_error(), NULL));
goto err;
}