Skip to content

Commit

Permalink
suit: Rename downgrade disabled option
Browse files Browse the repository at this point in the history
It is better to use the "downgrade prevention enabled" name instead.

Signed-off-by: Tomasz Chyrowicz <[email protected]>
  • Loading branch information
tomchy committed Feb 13, 2024
1 parent 17f8176 commit c101ece
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions suit_generator/cmd_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def add_arguments(parser):
)

cmd_mpi_generate.add_argument(
"--downgrade-disabled",
"--downgrade-prevention-enabled",
required=False,
action="store_true",
help="Disable downgrades (enable downgrade prevention policy).",
help="Enable downgrade prevention policy.",
)
cmd_mpi_generate.add_argument(
"--independent-updates", required=False, action="store_true", help="Enable independent updateability."
Expand Down Expand Up @@ -101,7 +101,7 @@ def generate(
class_name: str,
address: int,
size: int,
downgrade_disabled: bool,
downgrade_prevention_enabled: bool,
independent_updates: bool,
signature_verification: str,
) -> None:
Expand All @@ -119,10 +119,10 @@ def generate(
vid = uuid.uuid5(uuid.NAMESPACE_DNS, vendor_name)
cid = uuid.uuid5(vid, class_name)

if downgrade_disabled:
downgrade_disabled_bytes = b"\02"
if downgrade_prevention_enabled:
downgrade_prevention_enabled_bytes = b"\02"
else:
downgrade_disabled_bytes = b"\01"
downgrade_prevention_enabled_bytes = b"\01"

if independent_updates:
independent_updates_bytes = b"\02"
Expand All @@ -140,7 +140,7 @@ def generate(

mpi = (
version.to_bytes(1, MpiGenerator.BYTE_ORDER)
+ downgrade_disabled_bytes
+ downgrade_prevention_enabled_bytes
+ independent_updates_bytes
+ signature_verification_bytes
+ b"\xFF" * 12 # Reserved for future use
Expand Down Expand Up @@ -195,7 +195,7 @@ def main(**kwargs) -> None:
* **file** - a single MPI configuration area to merge
* **vendor_name** - vendor name to use for UUID generation
* **class_name** - device class name to use for UUID generation
* **downgrade_disabled** - disable downgrades (enable downgrade prevention policy)
* **downgrade_prevention_enabled** - enable downgrade prevention policy
* **independent_updates** - enable independent updateability
* **signature_verification** - enable signature verification of update candidate and/or installed manifests
"""
Expand All @@ -206,7 +206,7 @@ def main(**kwargs) -> None:
kwargs["class_name"],
kwargs["address"],
kwargs["size"],
kwargs["downgrade_disabled"],
kwargs["downgrade_prevention_enabled"],
kwargs["independent_updates"],
kwargs["signature_verification"],
)
Expand Down

0 comments on commit c101ece

Please sign in to comment.