diff --git a/ssh/ppl.h b/ssh/ppl.h index 025a5615..4ffeffe9 100644 --- a/ssh/ppl.h +++ b/ssh/ppl.h @@ -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, diff --git a/ssh/ssh.c b/ssh/ssh.c index c7e03ff8..aba09769 100644 --- a/ssh/ssh.c +++ b/ssh/ssh.c @@ -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);