From: Douglas Bagnall Date: Tue, 11 Jun 2024 23:17:22 +0000 (+1200) Subject: py:emulate: remove py2 str/bytes workaround in traffic_packets X-Git-Tag: tdb-1.4.11~375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46933bc25de6515866c6b9d1ae76fad6701fb252;p=thirdparty%2Fsamba.git py:emulate: remove py2 str/bytes workaround in traffic_packets Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/emulate/traffic_packets.py b/python/samba/emulate/traffic_packets.py index 95c7465d2fc..2fca6234a6a 100644 --- a/python/samba/emulate/traffic_packets.py +++ b/python/samba/emulate/traffic_packets.py @@ -569,10 +569,10 @@ def packet_rpc_netlogon_30(packet, conversation, context): # subsequent runs newpass = context.machine_creds.get_password().encode('utf-16-le') pwd_len = len(newpass) - filler = [x if isinstance(x, int) else ord(x) for x in os.urandom(DATA_LEN - pwd_len)] + filler = list(os.urandom(DATA_LEN - pwd_len)) pwd = netlogon.netr_CryptPassword() pwd.length = pwd_len - pwd.data = filler + [x if isinstance(x, int) else ord(x) for x in newpass] + pwd.data = filler + list(newpass) context.machine_creds.encrypt_netr_crypt_password(pwd) c.netr_ServerPasswordSet2(context.server, # must ends with $, so use get_username instead @@ -650,10 +650,10 @@ def samlogon_logon_info(domain_name, computer_name, creds): logon = netlogon.netr_NetworkInfo() - logon.challenge = [x if isinstance(x, int) else ord(x) for x in challenge] + logon.challenge = list(challenge) logon.nt = netlogon.netr_ChallengeResponse() logon.nt.length = len(response["nt_response"]) - logon.nt.data = [x if isinstance(x, int) else ord(x) for x in response["nt_response"]] + logon.nt.data = list(response["nt_response"]) logon.identity_info = netlogon.netr_IdentityInfo()