]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Guess Samba client mutual flag using ap_options
authorAndreas Schneider <asn@cryptomilk.org>
Thu, 25 Aug 2016 08:41:33 +0000 (10:41 +0200)
committerTom Yu <tlyu@mit.edu>
Fri, 2 Sep 2016 18:49:39 +0000 (14:49 -0400)
To work correctly with older Samba clients, we should guess the mutual
flag based on the ap_options from the AP-REQ and not set it
unconditionally.  Found by the Samba torture testsuite.

[ghudson@mit.edu: edited comments and commit message]

(cherry picked from commit 7919818c0eec534828521aed01b89aa72e5e7e81)

ticket: 8486
version_fixed: 1.14.4

src/lib/gssapi/krb5/accept_sec_context.c

index b7fffeb3c72a893c10335f5518a98508fb5cbd79..580d08cbf53eba4170d67e62cb41b01bd001d70c 100644 (file)
@@ -699,7 +699,10 @@ kg_accept_krb5(minor_status, context_handle,
             goto fail;
         }
 
-        gss_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG;
+        /* Use ap_options from the request to guess the mutual flag. */
+        gss_flags = GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG;
+        if (ap_req_options & AP_OPTS_MUTUAL_REQUIRED)
+            gss_flags |= GSS_C_MUTUAL_FLAG;
     } else {
         /* gss krb5 v1 */