diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -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 | |||
364 | list_identities(int agent_fd, int do_fp) | 363 | list_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) |