mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 10:27:22 +09:00
pki_crypto: Always copy ecdsa_nid into duplicated ECDSA keys
BUG: https://red.libssh.org/issues/147 Signed-off-by: Alan Dunn <amdunn@gmail.com>
This commit is contained in:
committed by
Andreas Schneider
parent
15f3988bc8
commit
3d9b1693eb
@@ -345,13 +345,13 @@ ssh_key pki_key_dup(const ssh_key key, int demote)
|
||||
break;
|
||||
case SSH_KEYTYPE_ECDSA:
|
||||
#ifdef HAVE_OPENSSL_ECC
|
||||
new->ecdsa_nid = key->ecdsa_nid;
|
||||
|
||||
/* privkey -> pubkey */
|
||||
if (demote && ssh_key_is_private(key)) {
|
||||
const EC_POINT *p;
|
||||
int ok;
|
||||
|
||||
new->ecdsa_nid = key->ecdsa_nid;
|
||||
|
||||
new->ecdsa = EC_KEY_new_by_curve_name(key->ecdsa_nid);
|
||||
if (new->ecdsa == NULL) {
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user