8000 Handles failed param decryption before writing output by jstaylor11 · Pull Request #828 · bkerler/edl · GitHub
[go: up one dir, main page]

Skip to content

Handles failed param decryption before writing output - #828

Open
jstaylor11 wants to merge 1 commit into
bkerler:masterfrom
jstaylor11:master
Open

jstaylor11 wants to merge 1 commit into
bkerler:masterfrom
jstaylor11:master

Conversation

@jstaylor11
Copy link
Copy Markdown

This fixes two small problems that have the potentially difficult to track down problems.

First, when an encrypted-record decryption fails, setparamvalue() is called, which references undefined mdata, masking the failure with UnboundLocalError.

The setparam CLI also opens the .patched output before validation, which can create an empty file or truncate an existing output.

This change:

  • Raises ValueError when decryptsid() returns no item data.
  • Computes the patched data before opening the output file.
  • Adds synthetic regression tests for failure handling, successful encrypted updates, and preservation of output files.

Validation:
python -B -m unittest discover -s tests -p test_oneplus_param.py -v
All three tests pass.

Related to #815. This addresses failure handling only; it does not
resolve the underlying serial-derived-key compatibility issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0