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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user