mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-22 07:00:12 +01:00
Merge pull request #339 from felipediel/patch-3
Fix padding algorithm for CBC mode
This commit is contained in:
commit
af99f92721
@ -265,7 +265,7 @@ class device:
|
|||||||
|
|
||||||
# pad the payload for AES encryption
|
# pad the payload for AES encryption
|
||||||
if payload:
|
if payload:
|
||||||
payload += bytearray(16 - len(payload)%16)
|
payload += bytearray((16 - len(payload)) % 16)
|
||||||
|
|
||||||
checksum = adler32(payload, 0xbeaf) & 0xffff
|
checksum = adler32(payload, 0xbeaf) & 0xffff
|
||||||
packet[0x34] = checksum & 0xff
|
packet[0x34] = checksum & 0xff
|
||||||
|
Loading…
Reference in New Issue
Block a user