aboutsummaryrefslogtreecommitdiff
path: root/src/server.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/server.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/server.c')
-rw-r--r--src/server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server.c b/src/server.c
index 9de93adc..7f3618a4 100644
--- a/src/server.c
+++ b/src/server.c
@@ -159,6 +159,7 @@ static int dh_handshake_server(ssh_session session) {
ssh_string pubkey_blob;
ssh_string sig_blob;
ssh_string f;
+ int rc;
if (dh_generate_y(session) < 0) {
ssh_set_error(session, SSH_FATAL, "Could not create y number");
@@ -196,9 +197,9 @@ static int dh_handshake_server(ssh_session session) {
return -1;
}
- pubkey_blob = ssh_pki_export_pubkey_blob(pubkey);
+ rc = ssh_pki_export_pubkey_blob(pubkey, &pubkey_blob);
ssh_key_free(pubkey);
- if (pubkey_blob == NULL) {
+ if (rc < 0) {
ssh_set_error_oom(session);
ssh_string_free(f);
return -1;
@@ -960,8 +961,8 @@ int ssh_message_auth_reply_pk_ok_simple(ssh_message msg) {
return SSH_ERROR;
}
- pubkey_blob = ssh_pki_export_pubkey_blob(msg->auth_request.pubkey);
- if (pubkey_blob == NULL) {
+ ret = ssh_pki_export_pubkey_blob(msg->auth_request.pubkey, &pubkey_blob);
+ if (ret < 0) {
ssh_string_free(algo);
return SSH_ERROR;
}