Skip to content

Commit

Permalink
Revert "Error concatenating lists and bytearray fixed."
Browse files Browse the repository at this point in the history
This reverts commit e74f489.

Reverting this commit makes things work for @tonke.

References:
- #1
  • Loading branch information
amotl committed Oct 31, 2021
1 parent 7038230 commit 3de0019
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dragino/LoRaWAN/DataPayload.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def decrypt_payload(self, key, direction, mic):
cipher = AES.new(bytes(key))
s = cipher.encrypt(bytes(a))

padded_payload = bytearray()
padded_payload = []
padding=[0x00] * 16
for i in range(k):
idx = (i + 1) * 16
Expand Down Expand Up @@ -88,8 +88,8 @@ def encrypt_payload(self, key, direction, data):
cipher = AES.new(bytes(key))
s = cipher.encrypt(bytes(a))

padded_payload = bytearray()
padding=bytearray([0x00]*16)
padded_payload = []
padding=[0x00]*16
for i in range(k):
idx = (i + 1) * 16
padded_payload += (data[idx - 16:idx] + padding)[:16]
Expand Down

0 comments on commit 3de0019

Please sign in to comment.