mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +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
8b3be050c9
commit
6f089a098b
@@ -345,13 +345,13 @@ ssh_key pki_key_dup(const ssh_key key, int demote)
|
|||||||
break;
|
break;
|
||||||
case SSH_KEYTYPE_ECDSA:
|
case SSH_KEYTYPE_ECDSA:
|
||||||
#ifdef HAVE_OPENSSL_ECC
|
#ifdef HAVE_OPENSSL_ECC
|
||||||
|
new->ecdsa_nid = key->ecdsa_nid;
|
||||||
|
|
||||||
/* privkey -> pubkey */
|
/* privkey -> pubkey */
|
||||||
if (demote && ssh_key_is_private(key)) {
|
if (demote && ssh_key_is_private(key)) {
|
||||||
const EC_POINT *p;
|
const EC_POINT *p;
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
new->ecdsa_nid = key->ecdsa_nid;
|
|
||||||
|
|
||||||
new->ecdsa = EC_KEY_new_by_curve_name(key->ecdsa_nid);
|
new->ecdsa = EC_KEY_new_by_curve_name(key->ecdsa_nid);
|
||||||
if (new->ecdsa == NULL) {
|
if (new->ecdsa == NULL) {
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|||||||
Reference in New Issue
Block a user