Skip to content

Commit

Permalink
keys: Add support for nes suit-install key
Browse files Browse the repository at this point in the history
Add support for generating manifests with new suit-install key value.

Ref: NCSDK-NONE

Signed-off-by: Tomasz Chyrowicz <[email protected]>
  • Loading branch information
tomchy committed Oct 15, 2024
1 parent 199ed3c commit 6d31d4f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions suit_generator/suit/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
suit_candidate_verification,
suit_payload_fetch,
suit_install,
suit_install_legacy,
suit_text,
suit_integrated_payloads,
suit_integrated_dependencies,
Expand All @@ -42,6 +43,7 @@ class SuitEnvelopeSimplified(SuitKeyValue):
suit_payload_fetch: SuitBstr,
suit_candidate_verification: SuitBstr,
suit_install: SuitBstr,
suit_install_legacy: SuitBstr,
suit_text: SuitBstr,
suit_integrated_payloads: SuitIntegratedPayloadMap,
suit_integrated_dependencies: SuitIntegratedPayloadMap,
Expand All @@ -62,6 +64,7 @@ class SuitEnvelope(SuitKeyValue):
suit_payload_fetch: cbstr(SuitCommandSequence),
suit_candidate_verification: cbstr(SuitCommandSequence),
suit_install: cbstr(SuitCommandSequence),
suit_install_legacy: cbstr(SuitCommandSequence),
suit_text: cbstr(SuitTextMap),
suit_integrated_payloads: SuitIntegratedPayloadMap,
suit_integrated_dependencies: SuitIntegratedPayloadMap,
Expand Down Expand Up @@ -104,6 +107,7 @@ def update_severable_digests(self):
suit_payload_fetch,
suit_candidate_verification,
suit_install,
suit_install_legacy,
]
for severable_element in severable_elements:
if severable_element in self.SuitEnvelopeTagged.value.SuitEnvelope[suit_manifest].SuitManifest and hasattr(
Expand Down
2 changes: 2 additions & 0 deletions suit_generator/suit/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
suit_invoke,
suit_payload_fetch,
suit_install,
suit_install_legacy,
suit_text_manifest_description,
suit_text_manifest_json_source,
suit_text_manifest_yaml_source,
Expand Down Expand Up @@ -468,6 +469,7 @@ class SuitManifest(SuitKeyValue):
suit_invoke: cbstr(SuitCommandSequence),
suit_payload_fetch: SuitSeverableCommandSequence,
suit_install: SuitSeverableCommandSequence,
suit_install_legacy: SuitSeverableCommandSequence,
suit_text: SuitSeverableText,
suit_dependency_resolution: SuitSeverableCommandSequence,
suit_candidate_verification: SuitSeverableCommandSequence,
Expand Down
9 changes: 8 additions & 1 deletion suit_generator/suit/types/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,17 @@ class suit_payload_fetch(suit_key):
name = "suit-payload-fetch"


class suit_install_legacy(suit_key):
"""suit-install metadata (before v27)."""

id = 17
name = "suit-install-legacy"


class suit_install(suit_key):
"""suit-install metadata."""

id = 17
id = 20
name = "suit-install"


Expand Down
4 changes: 2 additions & 2 deletions tests/test_suit_envelope_severable.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@
"ENVELOPE_2_SEVERED_TEXT_FETCH_INSTALL": (
"d86ba602458143822f400358cea601010201035857a2028384414d4218ff451a0e054000451a0005600084414"
"d410e451a2e054000451a000560008241444100045829840c0114a201507617daa571fd5a858f94e28d735ce9"
"f40250d622bafd4337518590bc6368cda7fbca11822f5820f0b65173c03a9c481a0fe3ea62ed744bcfb0bef21"
"f40250d622bafd4337518590bc6368cda7fbca14822f5820f0b65173c03a9c481a0fe3ea62ed744bcfb0bef21"
"43d4380e52dd67d5ee4200d10822f5820814a3a9e09cf691e5fa77c315c0a69a9929ee86601d5dfdca8b24819"
"e0be745917822f5820aac171d7a184ecd31c01495ac6b656b2e60a5aa43de6f6d1c9acdac29bb540c211581e9"
"e0be745917822f5820aac171d7a184ecd31c01495ac6b656b2e60a5aa43de6f6d1c9acdac29bb540c214581e9"
"00c0214a115692366696c652e62696e150003000c0114a11602160003001050840c0214a115692366696c652e"
"62696e175896a162656ea184414d4102451a0e0aa000451a00056000a60178184e6f726469632053656d69636"
"f6e647563746f7220415341026e6e5246353432305f637075617070036e6e6f7264696373656d692e636f6d04"
Expand Down

0 comments on commit 6d31d4f

Please sign in to comment.