mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Reinstate functionality of CONF_ssh_show_banner.
Apparently this option to not display the authentication banner got completely lost during the breakup of the old monolithic ssh.c.
This commit is contained in:
parent
209dd65ead
commit
fda1e6b71f
1
ssh.c
1
ssh.c
@ -251,6 +251,7 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv,
|
||||
userauth_layer = ssh2_userauth_new(
|
||||
connection_layer, ssh->savedhost, ssh->fullhostname,
|
||||
conf_get_filename(ssh->conf, CONF_keyfile),
|
||||
conf_get_bool(ssh->conf, CONF_ssh_show_banner),
|
||||
conf_get_bool(ssh->conf, CONF_tryagent), username,
|
||||
conf_get_bool(ssh->conf, CONF_change_username),
|
||||
conf_get_bool(ssh->conf, CONF_try_ki_auth),
|
||||
|
@ -23,7 +23,7 @@ struct ssh2_userauth_state {
|
||||
|
||||
PacketProtocolLayer *transport_layer, *successor_layer;
|
||||
Filename *keyfile;
|
||||
bool tryagent, change_username;
|
||||
bool show_banner, tryagent, change_username;
|
||||
char *hostname, *fullhostname;
|
||||
char *default_username;
|
||||
bool try_ki_auth, try_gssapi_auth, try_gssapi_kex_auth, gssapi_fwd;
|
||||
@ -125,7 +125,7 @@ static const struct PacketProtocolLayerVtable ssh2_userauth_vtable = {
|
||||
PacketProtocolLayer *ssh2_userauth_new(
|
||||
PacketProtocolLayer *successor_layer,
|
||||
const char *hostname, const char *fullhostname,
|
||||
Filename *keyfile, bool tryagent,
|
||||
Filename *keyfile, bool show_banner, bool tryagent,
|
||||
const char *default_username, bool change_username,
|
||||
bool try_ki_auth, bool try_gssapi_auth, bool try_gssapi_kex_auth,
|
||||
bool gssapi_fwd, struct ssh_connection_shared_gss_state *shgss)
|
||||
@ -138,6 +138,7 @@ PacketProtocolLayer *ssh2_userauth_new(
|
||||
s->hostname = dupstr(hostname);
|
||||
s->fullhostname = dupstr(fullhostname);
|
||||
s->keyfile = filename_copy(keyfile);
|
||||
s->show_banner = show_banner;
|
||||
s->tryagent = tryagent;
|
||||
s->default_username = dupstr(default_username);
|
||||
s->change_username = change_username;
|
||||
@ -193,6 +194,11 @@ static void ssh2_userauth_filter_queue(struct ssh2_userauth_state *s)
|
||||
while ((pktin = pq_peek(s->ppl.in_pq)) != NULL) {
|
||||
switch (pktin->type) {
|
||||
case SSH2_MSG_USERAUTH_BANNER:
|
||||
if (!s->show_banner) {
|
||||
pq_pop(s->ppl.in_pq);
|
||||
break;
|
||||
}
|
||||
|
||||
string = get_string(pktin);
|
||||
if (string.len > BANNER_LIMIT - bufchain_size(&s->banner))
|
||||
string.len = BANNER_LIMIT - bufchain_size(&s->banner);
|
||||
|
2
sshppl.h
2
sshppl.h
@ -107,7 +107,7 @@ PacketProtocolLayer *ssh2_transport_new(
|
||||
PacketProtocolLayer *ssh2_userauth_new(
|
||||
PacketProtocolLayer *successor_layer,
|
||||
const char *hostname, const char *fullhostname,
|
||||
Filename *keyfile, bool tryagent,
|
||||
Filename *keyfile, bool show_banner, bool tryagent,
|
||||
const char *default_username, bool change_username,
|
||||
bool try_ki_auth,
|
||||
bool try_gssapi_auth, bool try_gssapi_kex_auth,
|
||||
|
Loading…
Reference in New Issue
Block a user