traffic: change machine creds secure channel type
authorJoe Guo <joeg@catalyst.net.nz>
Wed, 2 May 2018 22:12:51 +0000 (22:12 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 14 May 2018 00:53:16 +0000 (02:53 +0200)
SEC_CHAN_WKSTA --> SEC_CHAN_BDC

This will fix netlogon failure against windows.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/emulate/traffic.py
python/samba/emulate/traffic_packets.py

index 503e1e4c5bf2621e9bd4dfb3dd5e3f1cd6bdd3dd..2dc27d95100f756b6ed29daed3727974808f0a0f 100644 (file)
@@ -44,7 +44,7 @@ from samba.credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS
 from samba.auth import system_session
 from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_PASSWD_NOTREQD
 from samba.dsdb import UF_NORMAL_ACCOUNT
-from samba.dcerpc.misc import SEC_CHAN_WKSTA
+from samba.dcerpc.misc import SEC_CHAN_BDC
 from samba import gensec
 from samba import sd_utils
 
@@ -511,7 +511,7 @@ class ReplayContext(object):
         self.machine_creds = Credentials()
         self.machine_creds.guess(self.lp)
         self.machine_creds.set_workstation(self.netbios_name)
-        self.machine_creds.set_secure_channel_type(SEC_CHAN_WKSTA)
+        self.machine_creds.set_secure_channel_type(SEC_CHAN_BDC)
         self.machine_creds.set_password(self.machinepass)
         self.machine_creds.set_username(self.netbios_name + "$")
         self.machine_creds.set_domain(self.domain)
@@ -523,7 +523,7 @@ class ReplayContext(object):
         self.machine_creds_bad = Credentials()
         self.machine_creds_bad.guess(self.lp)
         self.machine_creds_bad.set_workstation(self.netbios_name)
-        self.machine_creds_bad.set_secure_channel_type(SEC_CHAN_WKSTA)
+        self.machine_creds_bad.set_secure_channel_type(SEC_CHAN_BDC)
         self.machine_creds_bad.set_password(self.machinepass[:-4])
         self.machine_creds_bad.set_username(self.netbios_name + "$")
         if self.prefer_kerberos:
index 1413c8bfb80aa23c2d9c1b499960584eddbec05a..3f5db4317a36b239e7eaf7e0c407d4a6d6f83468 100644 (file)
@@ -35,7 +35,6 @@ from samba.ntstatus import (
     NT_STATUS_OBJECT_NAME_NOT_FOUND,
     NT_STATUS_NO_SUCH_DOMAIN
 )
-from samba.dcerpc.misc import SEC_CHAN_WKSTA
 import samba
 samba.ensure_third_party_module("dns", "dnspython")
 import dns.resolver
@@ -573,7 +572,7 @@ def packet_rpc_netlogon_30(packet, conversation, context):
                               # must ends with $, so use get_username instead
                               # of get_workstation here
                               context.machine_creds.get_username(),
-                              SEC_CHAN_WKSTA,
+                              context.machine_creds.get_secure_channel_type(),
                               context.netbios_name,
                               auth,
                               pwd)