aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-04-23 11:16:28 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-05-06 08:54:11 +0200
commitcfb4d27c479028f833c9ed3370b3e5f4a5899a42 (patch)
tree9dc865b9195f6d268b414d8b5add193362b604d3
parentd366e289f3dcd20c554d2fbf6de7b7b58b744adc (diff)
downloadlibssh-cfb4d27c479028f833c9ed3370b3e5f4a5899a42.tar.gz
libssh-cfb4d27c479028f833c9ed3370b3e5f4a5899a42.tar.xz
libssh-cfb4d27c479028f833c9ed3370b3e5f4a5899a42.zip
pki: Correctly update the ECDSA keytype.
(cherry picked from commit 2884bbf5b1bfe915160a1dc03eddbcd000555ec1)
-rw-r--r--src/pki.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pki.c b/src/pki.c
index 63b3547d..90c4ad5e 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -738,6 +738,9 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
if (rc < 0) {
goto fail;
}
+
+ /* Update key type */
+ key->type_c = ssh_pki_key_ecdsa_name(key);
}
break;
#endif
@@ -994,8 +997,12 @@ int ssh_pki_generate(enum ssh_keytypes_e type, int parameter,
case SSH_KEYTYPE_ECDSA:
#ifdef HAVE_ECC
rc = pki_key_generate_ecdsa(key, parameter);
- if(rc == SSH_ERROR)
+ if (rc == SSH_ERROR) {
goto error;
+ }
+
+ /* Update key type */
+ key->type_c = ssh_pki_key_ecdsa_name(key);
break;
#endif
case SSH_KEYTYPE_UNKNOWN: