+ /* The GSSAPI supports the mechs in gss_mechs, but which ones do
+ we have credentials for? We only get one try, so we don't want
+ to propose a mechanism we know is going to fail. */
+ maj_stat = gss_create_empty_oid_set(&min_stat, &my_mechs);
+ for (i=0; supported_mechs[i].name != NULL; i++) {
+ maj_stat = gss_test_oid_set_member(&min_stat, &supported_mechs[i].oid,
+ gss_mechs, &present);
+ if (present) {
+ if (!GSS_ERROR(ssh_gssapi_client_ctx(&ctx, &supported_mechs[i].oid,
+ host))) {
+ maj_stat = gss_add_oid_set_member(&min_stat,
+ &supported_mechs[i].oid,
+ &my_mechs);
+ debug("GSSAPI mechanism %s supported", supported_mechs[i].name);
+ } else {
+ debug("no credentials for GSSAPI mechanism %s",
+ supported_mechs[i].name);
+ }
+ } else {
+ debug("GSSAPI mechanism %s not supported", supported_mechs[i].name);
+ }
+ }
+