]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix SPNEGO one-hop interop against old IIS
authorGreg Hudson <ghudson@mit.edu>
Tue, 10 Dec 2013 17:04:18 +0000 (12:04 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 12 Dec 2013 15:51:34 +0000 (10:51 -0500)
IIS 6.0 and similar return a zero length reponse buffer in the last
SPNEGO packet when context initiation is performed without mutual
authentication.  In this case the underlying Kerberos mechanism has
already completed successfully on the first invocation, and SPNEGO
does not expect a mech response token in the answer.  If we get an
empty mech response token when the mech is complete during
negotiation, ignore it.

[ghudson@mit.edu: small code style and commit message changes]

ticket: 7797 (new)
target_version: 1.12.1
tags: pullup

src/lib/gssapi/spnego/spnego_mech.c

index 393766274b017d86121e7d57cab40ad7c1c621a7..d82934b6cd6d6144319e2b3e963645300c216c6d 100644 (file)
@@ -760,6 +760,12 @@ init_ctx_nego(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc,
                        map_errcode(minor_status);
                        ret = GSS_S_DEFECTIVE_TOKEN;
                }
+       } else if ((*responseToken)->length == 0 && sc->mech_complete) {
+               /* Handle old IIS servers returning empty token instead of
+                * null tokens in the non-mutual auth case. */
+               *negState = ACCEPT_COMPLETE;
+               *tokflag = NO_TOKEN_SEND;
+               ret = GSS_S_COMPLETE;
        } else if (sc->mech_complete) {
                /* Reject spurious mech token. */
                ret = GSS_S_DEFECTIVE_TOKEN;