Merge pull request #339 from felipediel/patch-3

Fix padding algorithm for CBC mode
This commit is contained in:
Matthew Garrett 2020-04-13 17:40:48 -07:00 committed by GitHub
commit af99f92721
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,7 +265,7 @@ class device:
# pad the payload for AES encryption
if payload:
payload += bytearray(16 - len(payload)%16)
payload += bytearray((16 - len(payload)) % 16)
checksum = adler32(payload, 0xbeaf) & 0xffff
packet[0x34] = checksum & 0xff