From: Joseph Sutton Date: Wed, 18 Oct 2023 04:08:01 +0000 (+1300) Subject: tests/krb5: Make ‘keybytes’ a bytes object rather than a list X-Git-Tag: talloc-2.4.2~1217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0d32a39804dbf96a155951199e612afcdbda334;p=thirdparty%2Fsamba.git tests/krb5: Make ‘keybytes’ a bytes object rather than a list Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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