diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-07-31 03:10:27 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-07-31 13:13:26 +1000 |
commit | 74287f5df9966a0648b4a68417451dd18f079ab8 (patch) | |
tree | d65deaf7d3ef15405cf8bdbffc9d96b88341a314 /auth2-gss.c | |
parent | 1a66079c0669813306cc69e5776a4acd9fb49015 (diff) |
upstream: delay bailout for invalid authentic
=?UTF-8?q?ating=20user=20until=20after=20the=20packet=20containing=20the?=
=?UTF-8?q?=20request=20has=20been=20fully=20parsed.=20Reported=20by=20Dar?=
=?UTF-8?q?iusz=20Tytko=20and=20Micha=C5=82=20Sajdak;=20ok=20deraadt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
OpenBSD-Commit-ID: b4891882fbe413f230fe8ac8a37349b03bd0b70d
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); |