diff options
| author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2023-10-18 17:08:01 +1300 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2023-10-19 21:37:36 +0000 |
| commit | a0d32a39804dbf96a155951199e612afcdbda334 (patch) | |
| tree | 772d6a6f18df269839bbf2fe93b260779c2158cf /python | |
| parent | 69db1b58882d42b4f159404a994054439b973fc1 (diff) | |
| download | samba-a0d32a39804dbf96a155951199e612afcdbda334.tar.gz samba-a0d32a39804dbf96a155951199e612afcdbda334.tar.bz2 samba-a0d32a39804dbf96a155951199e612afcdbda334.zip | |
tests/krb5: Make ‘keybytes’ a bytes object rather than a list
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
| -rwxr-xr-x | python/samba/tests/krb5/kcrypto.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
