Skip to content

Commit

Permalink
add: decode component metadata declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kentakayama committed Nov 26, 2024
1 parent d647d43 commit 3a098ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions inc/csuit/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ extern "C" {
#define LIBCSUIT_DISABLE_CONDITION_MINIMUM_BATTERY
#define LIBCSUIT_DISABLE_CONDITION_UPDATE_AUTHORIZED
#define LIBCSUIT_DISABLE_CONDITION_VERSION
#define LIBCSUIT_DISABLE_PARAMETER_COMPONENT_METADATA
#endif /* LIBCSUIT_DISABLE_UPDATE_MANAGEMENT */

#if defined(LIBCSUIT_DISABLE_ENCRYPTED_PAYLOAD)
Expand Down Expand Up @@ -207,10 +208,6 @@ extern "C" {
#define LIBCSUIT_DISABLE_DIRECTIVE_WAIT
#endif

#if defined(LIBCSUIT_DISABLE_PARAMETER_COMPONENT_METADATA)
#define LIBCSUIT_DISABLE_COMPONENT_METADATA
#endif

#if defined(LIBCSUIT_DISABLE_PARAMETER_SOURCE_COMPONENT)
#define LIBCSUIT_DISABLE_DIRECTIVE_COPY
#define LIBCSUIT_DISABLE_DIRECTIVE_SWAP
Expand Down
4 changes: 4 additions & 0 deletions inc/csuit/suit_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ typedef enum suit_parameter_key {
#define SUIT_PARAMETER_CONTAINS_UPDATE_PRIORITY BIT(SUIT_PARAMETER_UPDATE_PRIORITY)
#define SUIT_PARAMETER_CONTAINS_VERSION BIT(SUIT_PARAMETER_VERSION)
#define SUIT_PARAMETER_CONTAINS_WAIT_INFO BIT(SUIT_PARAMETER_WAIT_INFO)
#define SUIT_PARAMETER_CONTAINS_COMPONENT_METADATA BIT(SUIT_PARAMETER_COMPONENT_METADATA)

/* draft-suit-trust-domains */
#define SUIT_PARAMETER_CONTAINS_ENCRYPTION_INFO BIT(SUIT_PARAMETER_ENCRYPTION_INFO)
Expand Down Expand Up @@ -1114,6 +1115,9 @@ typedef struct suit_parameter_args {
/*! used in suit-directive-wait */
suit_wait_event_t wait_info;

/*! used in suit-directive-fetch, suit-directive-write, ... */
suit_component_metadata_t component_metadata;

/* in draft-ietf-suit-trust-domains */


Expand Down
5 changes: 5 additions & 0 deletions inc/csuit/suit_manifest_decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ suit_err_t suit_decode_version_match(const suit_buf_t *buf,
suit_version_match_t *version_match);
suit_err_t suit_decode_wait_event(const suit_buf_t *buf,
suit_wait_event_t *wait_event);

suit_err_t suit_decode_component_metadata(const suit_buf_t *buf,
suit_component_metadata_t *component_metadata);
suit_err_t suit_decode_component_metadata_from_item(QCBORDecodeContext *context,
QCBORItem *item,
bool next,
suit_component_metadata_t *component_metadata);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 3a098ea

Please sign in to comment.