mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
pki_crypto: Reformat pki_private_key_to_pem
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
@@ -918,7 +918,8 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
|
||||
/* In OpenSSL, the input is the private key seed only, which means
|
||||
* the first half of the SSH private key (the second half is the
|
||||
* public key) */
|
||||
pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_ED25519, NULL,
|
||||
pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_ED25519,
|
||||
NULL,
|
||||
(const uint8_t *)key->ed25519_privkey,
|
||||
ED25519_KEY_LEN);
|
||||
if (pkey == NULL) {
|
||||
@@ -938,7 +939,9 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
|
||||
case SSH_KEYTYPE_ED25519_CERT01:
|
||||
case SSH_KEYTYPE_UNKNOWN:
|
||||
default:
|
||||
SSH_LOG(SSH_LOG_TRACE, "Unknown or invalid private key type %d", key->type);
|
||||
SSH_LOG(SSH_LOG_TRACE,
|
||||
"Unknown or invalid private key type %d",
|
||||
key->type);
|
||||
goto err;
|
||||
}
|
||||
if (rc != 1) {
|
||||
|
||||
Reference in New Issue
Block a user