]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - ssh.c
Fix __uint128_t compile error on MinGW.
[PuTTY.git] / ssh.c
diff --git a/ssh.c b/ssh.c
index b654eb17e7d8c4bbd086461e40d8980779c8f39f..79c6ebf73c1f5455f1fb2578505d34e67519f4ce 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -6197,6 +6197,7 @@ static struct kexinit_algorithm *ssh2_kexinit_addalg(struct kexinit_algorithm
            return &list[i];
        }
     assert(!"No space in KEXINIT list");
+    return NULL;
 }
 
 /*
@@ -9358,11 +9359,20 @@ static void do_ssh2_authconn(Ssh ssh, const 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 (!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;
+                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 = (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
            }