aboutsummaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 98d46d3e5ead..9c8da5437e3c 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.120 2015/02/21 21:46:57 halex Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.122 2015/03/26 12:32:38 naddy Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -79,7 +79,9 @@ static char *default_files[] = {
#endif
#endif /* WITH_OPENSSL */
_PATH_SSH_CLIENT_ID_ED25519,
+#ifdef WITH_SSH1
_PATH_SSH_CLIENT_IDENTITY,
+#endif
NULL
};
@@ -164,11 +166,10 @@ delete_all(int agent_fd)
{
int ret = -1;
- if (ssh_remove_all_identities(agent_fd, 1) == 0)
+ if (ssh_remove_all_identities(agent_fd, 2) == 0)
ret = 0;
- /* ignore error-code for ssh2 */
- /* XXX revisit */
- ssh_remove_all_identities(agent_fd, 2);
+ /* ignore error-code for ssh1 */
+ ssh_remove_all_identities(agent_fd, 1);
if (ret == 0)
fprintf(stderr, "All identities removed.\n");
@@ -364,11 +365,16 @@ static int
list_identities(int agent_fd, int do_fp)
{
char *fp;
- int version, r, had_identities = 0;
+ int r, had_identities = 0;
struct ssh_identitylist *idlist;
size_t i;
+#ifdef WITH_SSH1
+ int version = 1;
+#else
+ int version = 2;
+#endif
- for (version = 1; version <= 2; version++) {
+ for (; version <= 2; version++) {
if ((r = ssh_fetch_identitylist(agent_fd, version,
&idlist)) != 0) {
if (r != SSH_ERR_AGENT_NO_IDENTITIES)