]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:join: avoid useless use of py2-compat string_to_byte_array
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 11 Jun 2024 23:19:55 +0000 (11:19 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Jun 2024 08:14:34 +0000 (08:14 +0000)
This was a workaround for the migration to Python 3, but is now just
extra work for the computer and cognitive load for us.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/join.py

index 724dd6e258e13db59c58a3985a3fbf83727811a1..7b09445a52adb3e878e1b70393115fe20844df87 100644 (file)
@@ -20,7 +20,7 @@
 
 from samba.auth import system_session
 from samba.samdb import SamDB
-from samba import gensec, Ldb, drs_utils, arcfour_encrypt, string_to_byte_array
+from samba import gensec, Ldb, drs_utils, arcfour_encrypt
 import ldb
 import samba
 import uuid
@@ -1407,7 +1407,7 @@ class DCJoinContext(object):
         except RuntimeError:
             pass
 
-        password_blob = string_to_byte_array(ctx.trustdom_pass.encode('utf-16-le'))
+        password_blob = list(ctx.trustdom_pass.encode('utf-16-le'))
 
         clear_value = drsblobs.AuthInfoClear()
         clear_value.size = len(password_blob)
@@ -1443,7 +1443,7 @@ class DCJoinContext(object):
 
         auth_blob = lsa.DATA_BUF2()
         auth_blob.size = len(encrypted_trustpass)
-        auth_blob.data = string_to_byte_array(encrypted_trustpass)
+        auth_blob.data = list(encrypted_trustpass)
 
         auth_info = lsa.TrustDomainInfoAuthInfoInternal()
         auth_info.auth_blob = auth_blob