diff options
author | Simon Tatham <anakin@pobox.com> | 2022-08-24 21:21:39 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2022-09-01 22:43:23 +0300 |
commit | a92aeca1115cbaa787e5d1e46b9357d922cf2f5b (patch) | |
tree | e19cb071659e73d24c16e0536f93265925ae4d86 /ssh | |
parent | 761df2fca63ad4ac2badec4e0d359ae18a94608d (diff) |
Pass port through to userauth.
I'm going to want to use it in an upcoming commit, because together
with 'savedhost', it forms the identification of an SSH server (at
least as far as the host key cache is concerned, and therefore it's
appropriate for other uses too).
We were already passing the hostname through for use in user-facing
prompts (not to mention the FQDN version for use in GSSAPI).
Diffstat (limited to 'ssh')
-rw-r--r-- | ssh/ppl.h | 2 | ||||
-rw-r--r-- | ssh/ssh.c | 3 | ||||
-rw-r--r-- | ssh/userauth2-client.c | 4 |
3 files changed, 6 insertions, 3 deletions
@@ -109,7 +109,7 @@ PacketProtocolLayer *ssh2_transport_new( const SshServerConfig *ssc); PacketProtocolLayer *ssh2_userauth_new( PacketProtocolLayer *successor_layer, - const char *hostname, const char *fullhostname, + const char *hostname, int port, const char *fullhostname, Filename *keyfile, Filename *detached_cert, bool show_banner, bool tryagent, bool notrivialauth, const char *default_username, bool change_username, @@ -253,7 +253,8 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, char *username = get_remote_username(ssh->conf); userauth_layer = ssh2_userauth_new( - connection_layer, ssh->savedhost, ssh->fullhostname, + connection_layer, ssh->savedhost, ssh->savedport, + ssh->fullhostname, conf_get_filename(ssh->conf, CONF_keyfile), conf_get_filename(ssh->conf, CONF_detached_cert), conf_get_bool(ssh->conf, CONF_ssh_show_banner), diff --git a/ssh/userauth2-client.c b/ssh/userauth2-client.c index 5f7a9b52..836e89fb 100644 --- a/ssh/userauth2-client.c +++ b/ssh/userauth2-client.c @@ -30,6 +30,7 @@ struct ssh2_userauth_state { Filename *keyfile, *detached_cert_file; bool show_banner, tryagent, notrivialauth, change_username; char *hostname, *fullhostname; + int port; char *default_username; bool try_ki_auth, try_gssapi_auth, try_gssapi_kex_auth, gssapi_fwd; @@ -129,7 +130,7 @@ static const PacketProtocolLayerVtable ssh2_userauth_vtable = { PacketProtocolLayer *ssh2_userauth_new( PacketProtocolLayer *successor_layer, - const char *hostname, const char *fullhostname, + const char *hostname, int port, const char *fullhostname, Filename *keyfile, Filename *detached_cert_file, bool show_banner, bool tryagent, bool notrivialauth, const char *default_username, bool change_username, @@ -142,6 +143,7 @@ PacketProtocolLayer *ssh2_userauth_new( s->successor_layer = successor_layer; s->hostname = dupstr(hostname); + s->port = port; s->fullhostname = dupstr(fullhostname); s->keyfile = filename_copy(keyfile); s->detached_cert_file = filename_copy(detached_cert_file); |