summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 1e5b8ea5a..bab3916d8 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.329 2020/03/13 04:01:56 djm Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.332 2020/09/09 21:57:27 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
@@ -89,11 +89,14 @@ expand_proxy_command(const char *proxy_command, const char *user,
89 const char *host, const char *host_arg, int port) 89 const char *host, const char *host_arg, int port)
90{ 90{
91 char *tmp, *ret, strport[NI_MAXSERV]; 91 char *tmp, *ret, strport[NI_MAXSERV];
92 const char *keyalias = options.host_key_alias ?
93 options.host_key_alias : host_arg;
92 94
93 snprintf(strport, sizeof strport, "%d", port); 95 snprintf(strport, sizeof strport, "%d", port);
94 xasprintf(&tmp, "exec %s", proxy_command); 96 xasprintf(&tmp, "exec %s", proxy_command);
95 ret = percent_expand(tmp, 97 ret = percent_expand(tmp,
96 "h", host, 98 "h", host,
99 "k", keyalias,
97 "n", host_arg, 100 "n", host_arg,
98 "p", strport, 101 "p", strport,
99 "r", options.user, 102 "r", options.user,
@@ -594,7 +597,7 @@ confirm(const char *prompt, const char *fingerprint)
594 if (p[0] == '\0' || strcasecmp(p, "no") == 0) 597 if (p[0] == '\0' || strcasecmp(p, "no") == 0)
595 ret = 0; 598 ret = 0;
596 else if (strcasecmp(p, "yes") == 0 || (fingerprint != NULL && 599 else if (strcasecmp(p, "yes") == 0 || (fingerprint != NULL &&
597 strcasecmp(p, fingerprint) == 0)) 600 strcmp(p, fingerprint) == 0))
598 ret = 1; 601 ret = 1;
599 free(cp); 602 free(cp);
600 if (ret != -1) 603 if (ret != -1)
@@ -1437,7 +1440,8 @@ maybe_add_key_to_agent(const char *authfile, struct sshkey *private,
1437 if (sshkey_is_sk(private)) 1440 if (sshkey_is_sk(private))
1438 skprovider = options.sk_provider; 1441 skprovider = options.sk_provider;
1439 if ((r = ssh_add_identity_constrained(auth_sock, private, 1442 if ((r = ssh_add_identity_constrained(auth_sock, private,
1440 comment == NULL ? authfile : comment, 0, 1443 comment == NULL ? authfile : comment,
1444 options.add_keys_to_agent_lifespan,
1441 (options.add_keys_to_agent == 3), 0, skprovider)) == 0) 1445 (options.add_keys_to_agent == 3), 0, skprovider)) == 0)
1442 debug("identity added to agent: %s", authfile); 1446 debug("identity added to agent: %s", authfile);
1443 else 1447 else