aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-04-23 11:16:28 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-04-23 11:16:28 +0200
commit2884bbf5b1bfe915160a1dc03eddbcd000555ec1 (patch)
treea0b037c734d56b00a2cd946193fcf594bf89c434 /src/pki.c
parentf48a99b97c399174ad35b83a91df922f106ade13 (diff)
downloadlibssh-2884bbf5b1bfe915160a1dc03eddbcd000555ec1.tar.gz
libssh-2884bbf5b1bfe915160a1dc03eddbcd000555ec1.tar.xz
libssh-2884bbf5b1bfe915160a1dc03eddbcd000555ec1.zip
pki: Correctly update the ECDSA keytype.
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pki.c b/src/pki.c
index 0beab362..40cafd1c 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: