summaryrefslogtreecommitdiffhomepage
path: root/cli-authpubkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-07-06 14:02:45 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-07-06 14:02:45 +0000
commit8a19a049b25f72062cc38a0940d9dc5f928cdb0e (patch)
tree4ab2dfaabab66d954baa7508e7f48d218472e54f /cli-authpubkey.c
parentc742137dc8c8dd2163a2353d3382fdf2cae44c24 (diff)
- Client auth using an agent's key works. Still need to implement client
agent forwarding. --HG-- branch : agent-client extra : convert_revision : 276cf5e82276b6c879d246ba64739ec6868f5150
Diffstat (limited to 'cli-authpubkey.c')
-rw-r--r--cli-authpubkey.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/cli-authpubkey.c b/cli-authpubkey.c
index 0ad0031..a990631 100644
--- a/cli-authpubkey.c
+++ b/cli-authpubkey.c
@@ -174,7 +174,7 @@ static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) {
sigbuf = buf_new(4 + SHA1_HASH_SIZE + ses.writepayload->len);
buf_putstring(sigbuf, ses.session_id, SHA1_HASH_SIZE);
buf_putbytes(sigbuf, ses.writepayload->data, ses.writepayload->len);
- buf_put_sign(ses.writepayload, key, type, sigbuf->data, sigbuf->len);
+ cli_buf_put_sign(ses.writepayload, key, type, sigbuf->data, sigbuf->len);
buf_free(sigbuf); /* Nothing confidential in the buffer */
}
@@ -202,8 +202,22 @@ int cli_auth_pubkey() {
TRACE(("leave cli_auth_pubkey-success"))
return 1;
} else {
+ /* no more keys left */
TRACE(("leave cli_auth_pubkey-failure"))
return 0;
}
}
+
+void cli_auth_pubkey_cleanup() {
+
+#ifdef ENABLE_CLI_AGENTFWD
+ m_close(cli_opts.agent_fd);
+ cli_opts.agent_fd = -1;
+#endif
+
+ while (cli_opts.privkeys->first) {
+ sign_key * key = list_remove(cli_opts.privkeys->first);
+ sign_key_free(key);
+ }
+}
#endif /* Pubkey auth */