diff options
Diffstat (limited to 'auth2-gss.c')
-rw-r--r-- | auth2-gss.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/auth2-gss.c b/auth2-gss.c index 47308c5ce..9351e0428 100644 --- a/auth2-gss.c +++ b/auth2-gss.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth2-gss.c,v 1.28 2018/07/10 09:13:30 djm Exp $ */ | 1 | /* $OpenBSD: auth2-gss.c,v 1.29 2018/07/31 03:10:27 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | 4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. |
@@ -70,9 +70,6 @@ userauth_gssapi(struct ssh *ssh) | |||
70 | size_t len; | 70 | size_t len; |
71 | u_char *doid = NULL; | 71 | u_char *doid = NULL; |
72 | 72 | ||
73 | if (!authctxt->valid || authctxt->user == NULL) | ||
74 | return (0); | ||
75 | |||
76 | if ((r = sshpkt_get_u32(ssh, &mechs)) != 0) | 73 | if ((r = sshpkt_get_u32(ssh, &mechs)) != 0) |
77 | fatal("%s: %s", __func__, ssh_err(r)); | 74 | fatal("%s: %s", __func__, ssh_err(r)); |
78 | 75 | ||
@@ -106,6 +103,12 @@ userauth_gssapi(struct ssh *ssh) | |||
106 | return (0); | 103 | return (0); |
107 | } | 104 | } |
108 | 105 | ||
106 | if (!authctxt->valid || authctxt->user == NULL) { | ||
107 | debug2("%s: disabled because of invalid user", __func__); | ||
108 | free(doid); | ||
109 | return (0); | ||
110 | } | ||
111 | |||
109 | if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, &goid)))) { | 112 | if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, &goid)))) { |
110 | if (ctxt != NULL) | 113 | if (ctxt != NULL) |
111 | ssh_gssapi_delete_ctx(&ctxt); | 114 | ssh_gssapi_delete_ctx(&ctxt); |