summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-17 18:53:34 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 00:18:45 +1100
commit83f8ffa6a55ccd0ce9d8a205e3e7439ec18fedf5 (patch)
tree8c9b2b72047a4dd63b2df52772e4fb805db8b340 /sshd.c
parent369d61f17657b814124268f99c033e4dc6e436c1 (diff)
upstream commit
fix hostkeys on ssh agent; found by unit test I'm about to commit
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sshd.c b/sshd.c
index 4f97da820..a4611e4d3 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.432 2015/01/14 20:05:27 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.433 2015/01/17 18:53:34 djm 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
@@ -1713,7 +1713,11 @@ main(int ac, char **av)
1713 if (strcmp(options.host_key_agent, SSH_AUTHSOCKET_ENV_NAME)) 1713 if (strcmp(options.host_key_agent, SSH_AUTHSOCKET_ENV_NAME))
1714 setenv(SSH_AUTHSOCKET_ENV_NAME, 1714 setenv(SSH_AUTHSOCKET_ENV_NAME,
1715 options.host_key_agent, 1); 1715 options.host_key_agent, 1);
1716 have_agent = ssh_get_authentication_socket(NULL); 1716 if ((r = ssh_get_authentication_socket(NULL)) == 0)
1717 have_agent = 1;
1718 else
1719 error("Could not connect to agent \"%s\": %s",
1720 options.host_key_agent, ssh_err(r));
1717 } 1721 }
1718 1722
1719 for (i = 0; i < options.num_host_key_files; i++) { 1723 for (i = 0; i < options.num_host_key_files; i++) {
@@ -2113,7 +2117,7 @@ main(int ac, char **av)
2113 } else if (compat20 && have_agent) { 2117 } else if (compat20 && have_agent) {
2114 if ((r = ssh_get_authentication_socket(&auth_sock)) != 0) { 2118 if ((r = ssh_get_authentication_socket(&auth_sock)) != 0) {
2115 error("Unable to get agent socket: %s", ssh_err(r)); 2119 error("Unable to get agent socket: %s", ssh_err(r));
2116 have_agent = -1; 2120 have_agent = 0;
2117 } 2121 }
2118 } 2122 }
2119 2123