diff options
author | Colin Watson <cjwatson@debian.org> | 2015-08-19 17:00:17 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2015-08-19 17:00:17 +0100 |
commit | 544df7a04ae5b5c1fc30be7c445ad685d7a02dc9 (patch) | |
tree | 33d2a87dd50fe5894ac6ec4579c83401b7ab00a4 /ssh-add.c | |
parent | baccdb349b31c47cd76fb63211f754ed33a9707e (diff) | |
parent | 7de4b03a6e4071d454b72927ffaf52949fa34545 (diff) |
Import openssh_6.9p1.orig.tar.gz
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 20 |
1 files changed, 13 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.122 2015/03/26 12:32:38 naddy 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 |
@@ -79,7 +79,9 @@ static char *default_files[] = { | |||
79 | #endif | 79 | #endif |
80 | #endif /* WITH_OPENSSL */ | 80 | #endif /* WITH_OPENSSL */ |
81 | _PATH_SSH_CLIENT_ID_ED25519, | 81 | _PATH_SSH_CLIENT_ID_ED25519, |
82 | #ifdef WITH_SSH1 | ||
82 | _PATH_SSH_CLIENT_IDENTITY, | 83 | _PATH_SSH_CLIENT_IDENTITY, |
84 | #endif | ||
83 | NULL | 85 | NULL |
84 | }; | 86 | }; |
85 | 87 | ||
@@ -164,11 +166,10 @@ delete_all(int agent_fd) | |||
164 | { | 166 | { |
165 | int ret = -1; | 167 | int ret = -1; |
166 | 168 | ||
167 | if (ssh_remove_all_identities(agent_fd, 1) == 0) | 169 | if (ssh_remove_all_identities(agent_fd, 2) == 0) |
168 | ret = 0; | 170 | ret = 0; |
169 | /* ignore error-code for ssh2 */ | 171 | /* ignore error-code for ssh1 */ |
170 | /* XXX revisit */ | 172 | ssh_remove_all_identities(agent_fd, 1); |
171 | ssh_remove_all_identities(agent_fd, 2); | ||
172 | 173 | ||
173 | if (ret == 0) | 174 | if (ret == 0) |
174 | fprintf(stderr, "All identities removed.\n"); | 175 | fprintf(stderr, "All identities removed.\n"); |
@@ -364,11 +365,16 @@ static int | |||
364 | list_identities(int agent_fd, int do_fp) | 365 | list_identities(int agent_fd, int do_fp) |
365 | { | 366 | { |
366 | char *fp; | 367 | char *fp; |
367 | int version, r, had_identities = 0; | 368 | int r, had_identities = 0; |
368 | struct ssh_identitylist *idlist; | 369 | struct ssh_identitylist *idlist; |
369 | size_t i; | 370 | size_t i; |
371 | #ifdef WITH_SSH1 | ||
372 | int version = 1; | ||
373 | #else | ||
374 | int version = 2; | ||
375 | #endif | ||
370 | 376 | ||
371 | for (version = 1; version <= 2; version++) { | 377 | for (; version <= 2; version++) { |
372 | if ((r = ssh_fetch_identitylist(agent_fd, version, | 378 | if ((r = ssh_fetch_identitylist(agent_fd, version, |
373 | &idlist)) != 0) { | 379 | &idlist)) != 0) { |
374 | if (r != SSH_ERR_AGENT_NO_IDENTITIES) | 380 | if (r != SSH_ERR_AGENT_NO_IDENTITIES) |