diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2014-04-23 11:16:28 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-05-06 08:54:11 +0200 |
commit | cfb4d27c479028f833c9ed3370b3e5f4a5899a42 (patch) | |
tree | 9dc865b9195f6d268b414d8b5add193362b604d3 | |
parent | d366e289f3dcd20c554d2fbf6de7b7b58b744adc (diff) | |
download | libssh-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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: |