]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2016-2110: auth/gensec: fix the client side of a new_spnego exchange
authorStefan Metzmacher <metze@samba.org>
Fri, 20 Nov 2015 10:42:55 +0000 (11:42 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 28 Mar 2016 22:42:06 +0000 (00:42 +0200)
Even for SMB where the server provides its mech list,
the client needs to remember its own mech list for the
mechListMIC calculation.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
auth/gensec/spnego.c

index 74ed23437dccf0f0645a98d43b966daeb6fe92ca..af5231ae1427d2fc2e29293e26ee376bd62a1fa1 100644 (file)
@@ -784,6 +784,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
 
                const char *my_mechs[] = {NULL, NULL};
                NTSTATUS nt_status = NT_STATUS_INVALID_PARAMETER;
+               bool ok;
 
                if (!in.length) {
                        /* client to produce negTokenInit */
@@ -846,6 +847,14 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
                                return NT_STATUS_INVALID_PARAMETER;
                }
 
+               ok = spnego_write_mech_types(spnego_state,
+                                            my_mechs,
+                                            &spnego_state->mech_types);
+               if (!ok) {
+                       DEBUG(1, ("SPNEGO: Failed to write mechTypes\n"));
+                       return NT_STATUS_NO_MEMORY;
+               }
+
                /* set next state */
                spnego_state->expected_packet = SPNEGO_NEG_TOKEN_TARG;
                spnego_state->state_position = SPNEGO_CLIENT_TARG;