Skip to content

Commit 79ea37f

Browse files
committed
tests: Use force flag for adsb_soc extraction
These images require a different key.
1 parent b76f242 commit 79ea37f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_dji_imah_fwsig_rebin1.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,17 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
183183
module_changes_limit = 2 + 384 + 32 + 3*16
184184
elif (m := re.match(r'^.*/(pm320)([._].*)?[.](bin|cfg|enc|fw|img|sig|ta|txt)$', modl_inp_fn, re.IGNORECASE)):
185185
platform = m.group(1)
186-
if (re.match(r'^.*{:s}_0702_[^/]*[.]fw_0702.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
186+
# specific nested modules
187+
if (re.match(r'^.*{:s}_0802_[^/]*[.]fw_0802.*adsb_soc.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
188+
module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
189+
# allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
190+
module_changes_limit = 2 + 4 + 4 + 256 + 11*16 + 32
191+
# specific nested modules
192+
elif (re.match(r'^.*{:s}_0702_[^/]*[.]fw_0702.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
187193
module_cmdopts = "-k PRAK-2020-01 -k TBIE-2020-02"
188194
# allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 9x16 chunk padding, 32 payload digest, 6x16 unknown additional
189195
module_changes_limit = 2 + 4 + 4 + 256 + 9*16 + 32 + 6*16
196+
# specific nested modules
190197
elif (re.match(r'^.*{:s}_0802_[^/]*[.]fw_0802.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
191198
module_cmdopts = "-k PRAK-2020-01 -k TBIE-2020-02"
192199
# allow change of 2 bytes from auth key name, 256 from signature, up to 3x16 chunk padding
@@ -378,7 +385,8 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
378385
elif (m := re.match(r'^.*/(wm170|wm232|gl170|pm430|ag500)([._].*)?[.](bin|cfg|enc|fw|img|sig|ta|txt)$', modl_inp_fn, re.IGNORECASE)):
379386
platform = m.group(1)
380387
# specific nested modules
381-
if (re.match(r'^.*{:s}_0801_[^/]*[.]fw_0801.*adsb_soc.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
388+
if (re.match(r'^.*{:s}_0801_[^/]*[.]fw_0801.*adsb_soc.*$'.format(platform), modl_inp_fn, re.IGNORECASE) or
389+
re.match(r'^.*{:s}_0802_[^/]*[.]fw_0802.*adsb_soc.*$'.format(platform), modl_inp_fn, re.IGNORECASE)):
382390
module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
383391
# allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
384392
module_changes_limit = 2 + 4 + 4 + 256 + 11*16 + 32

0 commit comments

Comments
 (0)