diff options
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sshconnect.c b/sshconnect.c index af08be415..9ec0618a9 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) |
@@ -1430,7 +1433,8 @@ maybe_add_key_to_agent(const char *authfile, struct sshkey *private, | |||
1430 | if (sshkey_is_sk(private)) | 1433 | if (sshkey_is_sk(private)) |
1431 | skprovider = options.sk_provider; | 1434 | skprovider = options.sk_provider; |
1432 | if ((r = ssh_add_identity_constrained(auth_sock, private, | 1435 | if ((r = ssh_add_identity_constrained(auth_sock, private, |
1433 | comment == NULL ? authfile : comment, 0, | 1436 | comment == NULL ? authfile : comment, |
1437 | options.add_keys_to_agent_lifespan, | ||
1434 | (options.add_keys_to_agent == 3), 0, skprovider)) == 0) | 1438 | (options.add_keys_to_agent == 3), 0, skprovider)) == 0) |
1435 | debug("identity added to agent: %s", authfile); | 1439 | debug("identity added to agent: %s", authfile); |
1436 | else | 1440 | else |