s3-winbindd Only use SamLogonEx when we can get unencrypted session keys
authorAndrew Bartlett <abartlet@samba.org>
Wed, 14 Dec 2011 23:00:36 +0000 (10:00 +1100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 20 Mar 2012 20:36:03 +0000 (21:36 +0100)
This ensures that we have some check on the session keys being returned
as the RC4 cipher is not checksumed.

The check comes from the fact that the credentials chain is tied to
the session key, and so if the credentials check passes then the
netlogon session key will be correct, and so the user session key
will be correctly decrypted.

Andrew Bartlett

Part of a fix for bug #8599 (WINBINDD_PAM_AUTH_CRAP returns invalid user session
key).

source3/winbindd/winbindd_pam.c

index 9801f53134f740876031efe313baa761a45b01d6..4c078dfadee5f9201e72175f5b07694b01c318b0 100644 (file)
@@ -1233,7 +1233,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
                        domain->can_do_validation6 = false;
                }
 
-               if (domain->can_do_samlogon_ex) {
+               if (domain->can_do_samlogon_ex && domain->can_do_validation6) {
                        result = rpccli_netlogon_sam_network_logon_ex(
                                        netlogon_pipe,
                                        mem_ctx,
@@ -1243,7 +1243,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
                                        domainname,     /* target domain */
                                        workstation,    /* workstation */
                                        chal,
-                                       domain->can_do_validation6 ? 6 : 3,
+                                       6,
                                        lm_response,
                                        nt_response,
                                        info3);