Skip to content

Commit d1b6da4

Browse files
committed
[ambz2] Fix CI
1 parent ae07966 commit d1b6da4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ltchiptool/soc/ambz2/util/models/images.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
FLASH_CALIBRATION = b"\x99\x99\x96\x96\x3F\xCC\x66\xFC\xC0\x33\xCC\x03\xE5\xDC\x31\x62"
3131

32+
IMAGE_SIGNATURE_OFFSET = 0
3233
IMAGE_PUBLIC_KEY_OFFSET = 32
3334

3435

ltchiptool/soc/ambz2/util/ota.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright (c) Martin Prokopič 2024-12-02
22

3-
from .models.images import IMAGE_PUBLIC_KEY_OFFSET
3+
from .models.images import IMAGE_PUBLIC_KEY_OFFSET, IMAGE_SIGNATURE_OFFSET
44

55

66
def patch_firmware_for_ota(data: bytes) -> bytes:
77
copy = bytearray(data)
8-
copy[0] ^= 0xff # negate first signature byte
9-
copy[IMAGE_PUBLIC_KEY_OFFSET] ^= 0xff # negate first pubkey byte
8+
copy[IMAGE_SIGNATURE_OFFSET] ^= 0xFF # negate first signature byte
9+
copy[IMAGE_PUBLIC_KEY_OFFSET] ^= 0xFF # negate first pubkey byte
1010
return bytes(copy)

0 commit comments

Comments
 (0)