From 46933bc25de6515866c6b9d1ae76fad6701fb252 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 12 Jun 2024 11:17:22 +1200 Subject: [PATCH] py:emulate: remove py2 str/bytes workaround in traffic_packets Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/emulate/traffic_packets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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()