aboutsummaryrefslogtreecommitdiff
path: root/src/legacy.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-30 10:16:53 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-30 10:16:53 +0200
commit60b92e458e1cf16f0029d9251e0f117ff27a02d0 (patch)
tree1f099e92f170a4aa3d921efc7adbd5a22f75627a /src/legacy.c
parente2365775030fa3c696e1f75997d5bc856a19e3ed (diff)
downloadlibssh-60b92e458e1cf16f0029d9251e0f117ff27a02d0.tar.gz
libssh-60b92e458e1cf16f0029d9251e0f117ff27a02d0.tar.xz
libssh-60b92e458e1cf16f0029d9251e0f117ff27a02d0.zip
pki: Use consistent API for ssh_pki_export_pubkey_blob().
Diffstat (limited to 'src/legacy.c')
-rw-r--r--src/legacy.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/legacy.c b/src/legacy.c
index f99551af..66528596 100644
--- a/src/legacy.c
+++ b/src/legacy.c
@@ -424,8 +424,8 @@ ssh_string publickey_from_file(ssh_session session, const char *filename,
return NULL;
}
- key_str = ssh_pki_export_pubkey_blob(key);
- if (key_str == NULL) {
+ rc = ssh_pki_export_pubkey_blob(key, &key_str);
+ if (rc < 0) {
return NULL;
}
@@ -477,6 +477,7 @@ ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s) {
ssh_string publickey_to_string(ssh_public_key pubkey) {
ssh_key key;
ssh_string key_blob;
+ int rc;
key = ssh_key_new();
if (key == NULL) {
@@ -489,7 +490,10 @@ ssh_string publickey_to_string(ssh_public_key pubkey) {
key->dsa = pubkey->dsa_pub;
key->rsa = pubkey->rsa_pub;
- key_blob = ssh_pki_export_pubkey_blob(key);
+ rc = ssh_pki_export_pubkey_blob(key, &key_blob);
+ if (rc < 0) {
+ key_blob = NULL;
+ }
key->dsa = NULL;
key->rsa = NULL;