summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-03-25 19:29:58 +0000
committerDamien Miller <djm@mindrot.org>2015-03-27 12:02:16 +1100
commit47842f71e31da130555353c1d57a1e5a8937f1c0 (patch)
treef9bb469b3654c8ba5aeedf80718f98ca9d147528 /ssh-add.c
parent5f57e77f91bf2230c09eca96eb5ecec39e5f2da6 (diff)
upstream commit
ignore v1 errors on ssh-add -D; only try v2 keys on -l/-L (unless WITH_SSH1) ok djm@
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 98d46d3e5..37e4cc580 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.120 2015/02/21 21:46:57 halex Exp $ */ 1/* $OpenBSD: ssh-add.c,v 1.121 2015/03/25 19:29:58 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -164,11 +164,10 @@ delete_all(int agent_fd)
164{ 164{
165 int ret = -1; 165 int ret = -1;
166 166
167 if (ssh_remove_all_identities(agent_fd, 1) == 0) 167 if (ssh_remove_all_identities(agent_fd, 2) == 0)
168 ret = 0; 168 ret = 0;
169 /* ignore error-code for ssh2 */ 169 /* ignore error-code for ssh1 */
170 /* XXX revisit */ 170 ssh_remove_all_identities(agent_fd, 1);
171 ssh_remove_all_identities(agent_fd, 2);
172 171
173 if (ret == 0) 172 if (ret == 0)
174 fprintf(stderr, "All identities removed.\n"); 173 fprintf(stderr, "All identities removed.\n");
@@ -364,11 +363,16 @@ static int
364list_identities(int agent_fd, int do_fp) 363list_identities(int agent_fd, int do_fp)
365{ 364{
366 char *fp; 365 char *fp;
367 int version, r, had_identities = 0; 366 int r, had_identities = 0;
368 struct ssh_identitylist *idlist; 367 struct ssh_identitylist *idlist;
369 size_t i; 368 size_t i;
369#ifdef WITH_SSH1
370 int version = 1;
371#else
372 int version = 2;
373#endif
370 374
371 for (version = 1; version <= 2; version++) { 375 for (; version <= 2; version++) {
372 if ((r = ssh_fetch_identitylist(agent_fd, version, 376 if ((r = ssh_fetch_identitylist(agent_fd, version,
373 &idlist)) != 0) { 377 &idlist)) != 0) {
374 if (r != SSH_ERR_AGENT_NO_IDENTITIES) 378 if (r != SSH_ERR_AGENT_NO_IDENTITIES)