diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2014-04-23 11:16:28 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-04-23 11:16:28 +0200 |
commit | 2884bbf5b1bfe915160a1dc03eddbcd000555ec1 (patch) | |
tree | a0b037c734d56b00a2cd946193fcf594bf89c434 /src/pki.c | |
parent | f48a99b97c399174ad35b83a91df922f106ade13 (diff) | |
download | libssh-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.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: |