summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Dunn <amdunn@gmail.com>2014-02-17 09:17:18 -0600
committerAndreas Schneider <asn@cryptomilk.org>2014-03-12 14:16:43 +0100
commit6f089a098bfdca7533677e3caf9c4ac3ae0371ac (patch)
tree5e0065a01282013c136cd7d2b2323b02c3949238 /src
parent8b3be050c9a3bf2bef1cff0a194956d6a8948568 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/pki_crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 9a7c3e28..cbd2c784 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -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;