From a0d32a39804dbf96a155951199e612afcdbda334 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Wed, 18 Oct 2023 17:08:01 +1300 Subject: =?UTF-8?q?tests/krb5:=20Make=20=E2=80=98keybytes=E2=80=99=20a=20b?= =?UTF-8?q?ytes=20object=20rather=20than=20a=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- python/samba/tests/krb5/kcrypto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/samba/tests/krb5/kcrypto.py b/python/samba/tests/krb5/kcrypto.py index 79df0b58a3e..98b8465f3ab 100755 --- a/python/samba/tests/krb5/kcrypto.py +++ b/python/samba/tests/krb5/kcrypto.py @@ -279,9 +279,9 @@ class _DES3CBC(_SimplifiedEnctype): b &= ~1 return b if bin(b & ~1).count('1') % 2 else b | 1 assert len(seed) == 7 - firstbytes = [parity(b & ~1) for b in seed] + firstbytes = bytes(parity(b & ~1) for b in seed) lastbyte = parity(sum((seed[i] & 1) << i + 1 for i in range(7))) - keybytes = bytes([b for b in firstbytes + [lastbyte]]) + keybytes = firstbytes + bytes([lastbyte]) if _is_weak_des_key(keybytes): keybytes[7] = bytes([keybytes[7] ^ 0xF0]) return keybytes -- cgit v1.2.3