diff options
| author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2024-06-12 11:21:09 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2024-06-12 08:14:34 +0000 |
| commit | f8fb9f19bca909fe4d29378f255bad33ccb1d778 (patch) | |
| tree | 02a9de09c1276124dec97daaf4e9fae23ff75c8f /python | |
| parent | 3b349c29b59ebe7e1e389dc0d51b2063c657b210 (diff) | |
| download | samba-f8fb9f19bca909fe4d29378f255bad33ccb1d778.tar.gz samba-f8fb9f19bca909fe4d29378f255bad33ccb1d778.tar.bz2 samba-f8fb9f19bca909fe4d29378f255bad33ccb1d778.zip | |
python:lsa_utils: avoid useless use of py2-compat string_to_byte_array
`pw.encode('utf-16-le')` is always bytes.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/lsa_utils.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/python/samba/lsa_utils.py b/python/samba/lsa_utils.py index a56675d6b63..043e65f3341 100644 --- a/python/samba/lsa_utils.py +++ b/python/samba/lsa_utils.py @@ -22,7 +22,6 @@ from samba import ( NTSTATUSError, aead_aes_256_cbc_hmac_sha512, arcfour_encrypt, - string_to_byte_array ) from samba.ntstatus import ( NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE @@ -81,7 +80,7 @@ def CreateTrustedDomainRelax( ): def generate_AuthInfoInternal(session_key, incoming=None, outgoing=None): - confounder = string_to_byte_array(token_bytes(512)) + confounder = list(token_bytes(512)) trustpass = drsblobs.trustDomainPasswords() @@ -95,7 +94,7 @@ def CreateTrustedDomainRelax( 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 @@ -169,12 +168,12 @@ def CreateTrustedDomainFallback( auth_blob = lsa.DATA_BUF2() auth_blob.size = len(ciphertext) - auth_blob.data = string_to_byte_array(ciphertext) + auth_blob.data = list(ciphertext) auth_info = lsa.TrustDomainInfoAuthInfoInternalAES() auth_info.cipher = auth_blob - auth_info.salt = string_to_byte_array(iv) - auth_info.auth_data = string_to_byte_array(auth_data) + auth_info.salt = list(iv) + auth_info.auth_data = list(auth_data) return conn.CreateTrustedDomainEx3( policy_handle, |
