summaryrefslogtreecommitdiff
path: root/auth2-gss.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2-gss.c')
-rw-r--r--auth2-gss.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/auth2-gss.c b/auth2-gss.c
index fd411d3a7..88bc3ae7b 100644
--- a/auth2-gss.c
+++ b/auth2-gss.c
@@ -104,9 +104,6 @@ userauth_gssapi(struct ssh *ssh)
104 u_int len; 104 u_int len;
105 u_char *doid = NULL; 105 u_char *doid = NULL;
106 106
107 if (!authctxt->valid || authctxt->user == NULL)
108 return (0);
109
110 mechs = packet_get_int(); 107 mechs = packet_get_int();
111 if (mechs == 0) { 108 if (mechs == 0) {
112 debug("Mechanism negotiation is not supported"); 109 debug("Mechanism negotiation is not supported");
@@ -137,6 +134,12 @@ userauth_gssapi(struct ssh *ssh)
137 return (0); 134 return (0);
138 } 135 }
139 136
137 if (!authctxt->valid || authctxt->user == NULL) {
138 debug2("%s: disabled because of invalid user", __func__);
139 free(doid);
140 return (0);
141 }
142
140 if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, &goid)))) { 143 if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, &goid)))) {
141 if (ctxt != NULL) 144 if (ctxt != NULL)
142 ssh_gssapi_delete_ctx(&ctxt); 145 ssh_gssapi_delete_ctx(&ctxt);