s4:auth/gensec: let GENSEC_FEATURE_SESSION_KEY result in GSS_C_INTEG_FLAG
authorStefan Metzmacher <metze@samba.org>
Fri, 20 Dec 2013 07:52:52 +0000 (08:52 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 07:13:22 +0000 (09:13 +0200)
This is important to allow the 'new_spnego' with mech_list protection to work
for a SMB session setup.

This is not strictly needed as we always announce GENSEC_FEATURE_SESSION_KEY
in gensec_gssapi_have_feature(), but it's better to send GSS_C_INTEG_FLAG
over the wire.

This may prevent a ticket from a Samba client to an SMB server
(particularly a DC) being misused to connect to the LDAP server on that
DC, as the LDAP server will require GSSAPI signing of the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/gensec/gensec_gssapi.c

index dd03a960c99f0dbcbc6bdf0a91ed41a2b1ac564a..8bc5452f3b9ce3b468c4fb2b09a424cc00fa3b98 100644 (file)
@@ -177,6 +177,9 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
                gensec_gssapi_state->gss_want_flags |= GSS_C_SEQUENCE_FLAG;
        }
 
+       if (gensec_security->want_features & GENSEC_FEATURE_SESSION_KEY) {
+               gensec_gssapi_state->gss_want_flags |= GSS_C_INTEG_FLAG;
+       }
        if (gensec_security->want_features & GENSEC_FEATURE_SIGN) {
                gensec_gssapi_state->gss_want_flags |= GSS_C_INTEG_FLAG;
        }