mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Don't try to load GSSAPI libs unless we'll use them.
A user reports that in a particular situation one of the calls to LoadLibrary from wingss.c has unwanted side effects, and points out that this happens even when the saved session has GSSAPI disabled. So I've evaluated as much as possible of the condition under which we check the results of GSS library loading, and deferred the library loading itself until after that condition says we even care about the results. (cherry picked from commit 9a08d9a7c10458356b934af54206f0b642ecf715)
This commit is contained in:
parent
d4e5b0dd1c
commit
d61c6cad0b
15
ssh.c
15
ssh.c
@ -9148,11 +9148,20 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
||||
s->can_keyb_inter = conf_get_int(ssh->conf, CONF_try_ki_auth) &&
|
||||
in_commasep_string("keyboard-interactive", methods, methlen);
|
||||
#ifndef NO_GSSAPI
|
||||
if (conf_get_int(ssh->conf, CONF_try_gssapi_auth) &&
|
||||
in_commasep_string("gssapi-with-mic", methods, methlen)) {
|
||||
/* Try loading the GSS libraries and see if we
|
||||
* have any. */
|
||||
if (!ssh->gsslibs)
|
||||
ssh->gsslibs = ssh_gss_setup(ssh->conf);
|
||||
s->can_gssapi = conf_get_int(ssh->conf, CONF_try_gssapi_auth) &&
|
||||
in_commasep_string("gssapi-with-mic", methods, methlen) &&
|
||||
ssh->gsslibs->nlibraries > 0;
|
||||
s->can_gssapi = (ssh->gsslibs->nlibraries > 0);
|
||||
} else {
|
||||
/* No point in even bothering to try to load the
|
||||
* GSS libraries, if the user configuration and
|
||||
* server aren't both prepared to attempt GSSAPI
|
||||
* auth in the first place. */
|
||||
s->can_gssapi = FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user