diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-16 17:54:10 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-16 17:54:10 +0200 |
commit | 9b84464748d5d4cd67b7868a6cfba5664a169503 (patch) | |
tree | 9ee1e76a53f891a9ca8e21c7f974a425c8e1eff1 /src/legacy.c | |
parent | a40f1d85972986c8baa2e32fe666c7bf19423045 (diff) | |
download | libssh-9b84464748d5d4cd67b7868a6cfba5664a169503.tar.gz libssh-9b84464748d5d4cd67b7868a6cfba5664a169503.tar.xz libssh-9b84464748d5d4cd67b7868a6cfba5664a169503.zip |
pki: Make publickey_to_string a legacy function.
Diffstat (limited to 'src/legacy.c')
-rw-r--r-- | src/legacy.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/legacy.c b/src/legacy.c index c021a4b..ac9ace1 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -381,6 +381,29 @@ ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s) { return pubkey; } +ssh_string publickey_to_string(ssh_public_key pubkey) { + ssh_key key; + ssh_string key_blob; + + key = ssh_key_new(); + if (key == NULL) { + return NULL; + } + + key->type = pubkey->type; + key->type_c = pubkey->type_c; + + key->dsa = pubkey->dsa_pub; + key->rsa = pubkey->rsa_pub; + + key_blob = ssh_pki_publickey_to_blob(key); + + key->dsa = NULL; + key->rsa = NULL; + ssh_key_free(key); + + return key_blob; +} /**************************************************************************** * SERVER SUPPORT ****************************************************************************/ |