summaryrefslogtreecommitdiffhomepage
path: root/cli-authpubkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-08-10 17:09:52 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-08-10 17:09:52 +0000
commita712baa8e566bfd8403a3e2bfdf350a0dc50ea9f (patch)
tree87dd64b7ca8331c29936a32aab69e9f09f63dccf /cli-authpubkey.c
parent254e8e34524db48e5ad73d26a923d20b03dd8bf3 (diff)
just checkpointing
--HG-- extra : convert_revision : fbbf404290f3fea3dfa9f6f53eba9389057e9044
Diffstat (limited to 'cli-authpubkey.c')
-rw-r--r--cli-authpubkey.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli-authpubkey.c b/cli-authpubkey.c
index 6b6ab51..33514ce 100644
--- a/cli-authpubkey.c
+++ b/cli-authpubkey.c
@@ -13,17 +13,22 @@ static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign);
void cli_pubkeyfail() {
struct PubkeyList *keyitem;
+ struct PubkeyList **previtem;
TRACE(("enter cli_pubkeyfail"));
+ previtem = &cli_opts.pubkeys;
+
/* Find the key we failed with, and remove it */
for (keyitem = cli_opts.pubkeys; keyitem != NULL; keyitem = keyitem->next) {
- if (keyitem->next == cli_ses.lastpubkey) {
- keyitem->next = cli_ses.lastpubkey->next;
+ if (keyitem == cli_ses.lastpubkey) {
+ *previtem = keyitem->next;
}
+ previtem = &keyitem;
}
sign_key_free(cli_ses.lastpubkey->key); /* It won't be used again */
m_free(cli_ses.lastpubkey);
+
TRACE(("leave cli_pubkeyfail"));
}
@@ -145,6 +150,7 @@ int cli_auth_pubkey() {
/* Send a trial request */
send_msg_userauth_pubkey(cli_opts.pubkeys->key,
cli_opts.pubkeys->type, 0);
+ cli_ses.lastpubkey = cli_opts.pubkeys;
TRACE(("leave cli_auth_pubkey-success"));
return 1;
} else {