python3: struct-unpack C strings into Python bytes (#31171)

This commit is contained in:
Paul Marillonnet 2019-04-10 13:50:26 +02:00
parent c1c8ca9182
commit 185e59fdbe
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ def aes_base64url_deterministic_decrypt(key, urlencoded, salt, raise_on_error=Tr
magic, mode, count = struct.unpack('<2sBH', raw[:5])
except struct.error as e:
raise DecryptionError('invalid packing', e)
if magic != 'a2':
if magic != b'a2':
raise DecryptionError('invalid magic string', magic)
if mode != 1:
raise DecryptionError('mode is not AES128-SHA256', mode)