File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
ltchiptool/soc/ambz2/util Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 2929
3030FLASH_CALIBRATION = b"\x99 \x99 \x96 \x96 \x3F \xCC \x66 \xFC \xC0 \x33 \xCC \x03 \xE5 \xDC \x31 \x62 "
3131
32+ IMAGE_SIGNATURE_OFFSET = 0
3233IMAGE_PUBLIC_KEY_OFFSET = 32
3334
3435
Original file line number Diff line number Diff line change 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
66def 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 )
You can’t perform that action at this time.
0 commit comments