H Birkholz Fraunhofer

Sit K Zandberg

Intended status: Standards Track Arm Limited

This specification describes the format of a manifest. A manifest is a bundle of metadata about the firmware for an IoT device, where to find the firmware, the devices to which it applies, and cryptographic information protecting the manifest. Firmware updates and secure boot both tend to use sequences of common operations, so the manifest encodes those sequences of operations, rather than declaring the metadata. The manifest also serves as a building block for secure boot.

Introduction

A firmware update mechanism is an essential security feature for IoT devices to deal with vulnerabilities. While the transport of firmware images to the devices themselves is important there are already various techniques available. Equally important is the inclusion of metadata about the conveyed firmware image (in the form of a manifest) and the use of a security wrapper to provide end-toend security protection to detect modifications and (optionally) to make reverse engineering more difficult. End-to-end security allows the author, who builds the firmware image, to be sure that no other party (including potential adversaries) can install firmware updates on IoT devices without adequate privileges. For confidentiality protected firmware images it is additionally required to encrypt the firmware image. Starting security protection at the author is a risk mitigation technique so firmware images and manifests can be stored on untrusted repositories; it also reduces the scope of a compromise of any repository or intermediate system to be no worse than a denial of service.

A manifest is a bundle of metadata about the firmware for an IoT device, where to find the firmware, the devices to which it applies, and cryptographic information protecting the manifest. This specification defines the SUIT manifest format and it is intended to meet several goals:

-Meet the requirements defined in The SUIT manifest can be used for a variety of purposes throughout its lifecycle, such as:

-the Firmware Author to reason about releasing a firmware.

-the Network Operator to reason about compatibility of a firmware.

-the Device Operator to reason about the impact of a firmware.

-the Device Operator to manage distribution of firmware to devices.

-the Plant Manager to reason about timing and acceptance of firmware updates.

-the device to reason about the authority & authenticity of a firmware prior to installation.

-the device to reason about the applicability of a firmware.

-the device to reason about the installation of a firmware.

-the device to reason about the authenticity & encoding of a firmware at boot.

Each of these uses happens at a different stage of the manifest lifecycle, so each has different requirements.

It is assumed that the reader is familiar with the high-level firmware update architecture [I-D.ietf-suit-architecture] and the threats, requirements, and user stories in [I-D.ietf-suit-information-model].

The design of this specification is based on an observation that the vast majority of operations that a device can perform during an update or secure boot are composed of a small group of operations:

-Copy some data from one place to another -Transform some data -Digest some data and compare to an expected value -Compare some system parameters to an expected value Moran, et -Run some code

In the SUIT manifest specification, these operations are called commands. Commands are classed as either conditions or directives.

Conditions have no side-effects, while directives do have sideeffects. Conceptually, a sequence of commands is like a script but the used language is tailored to software updates and secure boot.

The available commands support simple steps, such as copying a firmware image from one place to another, checking that a firmware image is correct, verifying that the specified firmware is the correct firmware for the device, or unpacking a firmware. By using these steps in different orders and changing the parameters they use, a broad range of use cases can be supported. The SUIT manifest uses this observation to optimize metadata for consumption by constrained devices.

While the SUIT manifest is informed by and optimized for firmware update and secure boot use cases, there is nothing in the [I-D.ietf-suit-information-model] that restricts its use to only those use cases. Other use cases include the management of trusted applications in a Trusted Execution Environment (TEE), see [I-D.ietf-teep-architecture].

Conventions and Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [START_REF] Leiba | Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words[END_REF] when, and only when, they appear in all capitals, as shown here.

The following terminology is used throughout this document:

-SUIT: Software Update for the Internet of Things, also the IETF working group for this standard.

-Payload: A piece of information to be delivered. Typically Firmware for the purposes of SUIT.

-Resource: A piece of information that is used to construct a payload.

-Manifest: A manifest is a bundle of metadata about the firmware for an IoT device, where to find the firmware, and the devices to which it applies. -Envelope: A container with the manifest, an authentication wrapper with cryptographic information protecting the manifest, authorization information, and severed fields.

-Update: One or more manifests that describe one or more payloads.

-Update Authority: The owner of a cryptographic key used to sign updates, trusted by Recipients.

-Recipient: The system, typically an IoT device, that receives and processes a manifest.

-Manifest Processor: A component of the Recipient that consumes Manifests and executes the commands in the Manifest.

-Component: An updatable logical block of the Firmware, Software, configuration, or data of the Recipient.

-Component Set: A group of interdependent Components that must be updated simultaneously.

-Command: A Condition or a Directive.

-Condition: A test for a property of the Recipient or its Components.

-Directive: An action for the Recipient to perform.

-Trusted Execution: A process by which a system ensures that only trusted code is executed, for example secure boot.

-A/B images: Dividing a Recipient's storage into two or more bootable images, at different offsets, such that the active image can write to the inactive image(s).

-Record: The result of a Command and any metadata about it.

-Report: A list of Records.

-Procedure: The process of invoking one or more sequences of commands.

-Update Procedure: A procedure that updates a Recipient by fetching dependencies, software images, and installing them.

-Boot Procedure: A procedure that boots a Recipient by verifying dependencies and images, loading images, and invoking one or more image. -Software: Instructions and data that allow a Recipient to perform a useful function.

-Firmware: Instructions and data that allow a Recipient to perform a useful function. Typically, changed infrequently, stored in nonvolatile memory, and small enough to apply to [START_REF] Bormann | Terminology for Constrained-Node Networks[END_REF] Class 0-2 devices.

-Image: Information that a Recipient uses to perform its function, typically firmware/software, configuration, or resource data such as text or images. Also, a Payload, once installed is an Image.

-Slot: One of several possible storage locations for a given Component, typically used in A/B image systems -Abort: The Manifest Processor immediately halts execution of the current Procedure. It creates a Record of an error condition.

How to use this Document

This specification covers five aspects of firmware update:

-Section 4 describes the device constraints, use cases, and design principles that informed the structure of the manifest.

-Section 5 gives a general overview of the metadata structure to inform the following sections -Section 6 describes what actions a Manifest processor should take.

-Section 7 describes the process of creating a Manifest.

-Section 8 specifies the content of the Envelope and the Manifest.

To implement an updatable device, see Section 6 and Section 8. To implement a tool that generates updates, see Section 7 and Section 8.

The IANA consideration section, see Section 11, provides instructions to IANA to create several registries. This section also provides the CBOR labels for the structures defined in this document. The various constraints of IoT devices and the range of use cases that need to be supported create a broad set of urequirements. For example, devices with:

-limited processing power and storage may require a simple representation of metadata.

-bandwidth constraints may require firmware compression or partial update support.

-bootloader complexity constraints may require simple selection between two bootable images.

-small internal storage may require external storage support.

-multiple microcontrollers may require coordinated update of all applications.

-large storage and complex functionality may require parallel update of many software components.

-extra information may need to be conveyed in the manifest in the earlier stages of the device lifecycle before those data items are stripped when the manifest is delivery to a constrained device.

Supporting the requirements introduced by the constraints on IoT devices requires the flexibility to represent a diverse set of possible metadata, but also requires that the encoding is kept simple.

SUIT Workflow Model

There are several fundamental assumptions that inform the model of Update Procedure workflow:

-Compatibility must be checked before any other operation is performed.

-All dependency manifests should be present before any payload is fetched.

-In some applications, payloads must be fetched and validated prior to installation.

There are several fundamental assumptions that inform the model of the Boot Procedure workflow:

-Compatibility must be checked before any other operation is performed.

-All dependencies and payloads must be validated prior to loading.

-All loaded images must be validated prior to execution.

Based on these assumptions, the manifest is structured to work with a pull parser, where each section of the manifest is used in sequence.

The expected workflow for a Recipient installing an update can be broken down into five steps:

1. Verify the signature of the manifest.

2. Verify the applicability of the manifest.

3. Resolve dependencies.

4. Fetch payload(s).

Install payload(s).

When installation is complete, similar information can be used for validating and running images in a further three steps:

1. Verify image(s).

Load image(s).

3. Run image(s). If verification and running is implemented in a bootloader, then the bootloader MUST also verify the signature of the manifest and the applicability of the manifest in order to implement secure boot workflows. The bootloader may add its own authentication, e.g. a MAC, to the manifest in order to prevent further verifications.

When multiple manifests are used for an update, each manifest's steps occur in a lockstep fashion; all manifests have dependency resolution performed before any manifest performs a payload fetch, etc.

Metadata Structure Overview

This section provides a high level overview of the manifest structure. The full description of the manifest structure is in Section 8.6

The manifest is structured from several key components:

1. The Envelope (see Section 5.

Authentication Block

The Authentication Block contains one or more COSE authentication blocks. These blocks are one of:

-COSE_Sign_Tagged -COSE_Sign1_Tagged -COSE_Mac_Tagged -COSE_Mac0_Tagged
The payload element in each of these COSE elements is a SUIT_Digest Section 10.

See Section 8.4 for more detail.

Manifest

The Manifest contains most metadata about one or more images. The Manifest is divided into Critical Metadata, Common Metadata, Command Sequences, and Integrity Check Values.

See Section 8.6 for more detail.

Critical Metadata

Some metadata needs to be accessed before the manifest is processed. This metadata can be used to determine which the newest manifest is and whether the structure version is supported. It also MAY provide a URI for obtaining a canonical copy of the manifest and Envelope.

See Section 8.6.1, Section 8.6.2, Section 8.6.3 for more detail.

Common

Some metadata is used repeatedly and in more than one command sequence. In order to reduce the size of the manifest, this metadata is collected into the Common section. Command Sequences are grouped into these sets to ensure that there is common coordination between dependencies and dependents on when to execute each command.

See Section 8.7.3 for more detail.

Integrity Check Values

To enable Section 5.5, there needs to be a mechanism to verify integrity of any metadata outside the manifest. Because of this organisation, these elements can be discarded or "Severed" from the Envelope without changing the signature of the Manifest. This allows savings based on the size of the Envelope in several scenarios, for example:

-A management system Severs the Text and CoSWID sections before sending an Envelope to a constrained Recipient, which saves Recipient bandwidth.

-A Recipient Severs the Installation section after installing the Update, which saves storage space.

See Section 8.8 for more detail.

Integrated Dependencies and Payloads

In some cases, it is beneficial to include a dependency or a payload in the Envelope of a manifest. For example:

-When an update is delivered via a comparatively unconstrained medium, such as a removable mass storage device, it may be beneficial to bundle updates into single files.

-When a manifest requires encryption, it must be referenced as a dependency, so a trivial manifest may be used to enclose the encrypted manifest. The encrypted manifest may be contained in the dependent manifest's envelope.

-When a manifest transports a small payload, such as an encrypted key, that payload may be placed in the manifest's envelope.

See Section 7.8.1, Section 8.5 for more detail.

Interpreter Behavior

This section describes the behavior of the manifest interpreter and focuses primarily on interpreting commands in the manifest. However, there are several other important behaviors of the interpreter: encoding version detection, rollback protection, and authenticity verification are chief among these. -Test failed (e.g. Vendor ID/Class ID).

-Unsupported command encountered.

-Unsupported parameter encountered.

-Unsupported component ID encountered.

-Payload not available.

-Dependency not available.

-Application crashed when executed.

-Watchdog timeout occurred.

-Dependency or Payload verification failed.

-Missing component from a set.

-Required parameter not supplied.

These failure reasons MAY be combined with retry mechanisms prior to marking a manifest as invalid. Following these initial tests, the interpreter clears all parameter storage. This ensures that the interpreter begins without any leaked data.

Required Checks

The RECOMMENDED process is to verify the signature of the manifest prior to parsing/executing any section of the manifest. This guards the parser against arbitrary input by unauthenticated third parties, but it costs extra energy when a Recipient receives an incompatible manifest.

When validating authenticity of manifests, the interpreter MAY use an ACL (see Section 9) to determine the extent of the rights conferred by that authenticity. Where a device supports only one level of access, it MAY choose to skip signature verification of dependencies, since they are referenced by digest. Where a device supports more than one trusted party, it MAY choose to defer the verification of signatures of dependencies until the list of affected components is known so that it can skip redundant signature verifications. For example, a dependency signed by the same author as the dependent does not require a signature verification. Similarly, if the signer of the dependent has full rights to the device, according to the ACL, then no signature verification is necessary on the dependency.

Once a valid, authentic manifest has been selected, the interpreter MUST examine the component list and verify that its maximum number of components is not exceeded and that each listed component ID is supported.

For each listed component, the interpreter MUST provide storage for the supported parameters. If the interpreter does not have sufficient temporary storage to process the parameters for all components, it MAY process components serially for each command sequence. See Section 6.6 for more details.

The interpreter SHOULD check that the common section contains at least one vendor ID check and at least one class ID check.

If the manifest contains more than one component, each command sequence MUST begin with a Set Current Component command.

If a dependency is specified, then the interpreter MUST perform the following checks:

1. At the beginning of each section in the dependent: all previous sections of each dependency have been executed. The interpreter has a small set of design goals:

1. Executing an update MUST either result in an error, or a verifiably correct system state.

2. Executing a secure boot MUST either result in an error, or a booted system.

3. Executing the same manifest on multiple Recipients MUST result in the same system state. NOTE: when using A/B images, the manifest functions as two (or more) logical manifests, each of which applies to a system in a particular starting state. With that provision, design goal 3 holds.

Abstract Machine Description

The heart of the manifest is the list of commands, which are processed by an interpreter. This interpreter can be modeled as a simple abstract machine. This machine consists of several data storage locations that are modified by commands.

There are two types of commands, namely those that modify state (directives) and those that perform tests (conditions). Parameters are used as the inputs to commands. The interpreter loops over the whole sequence, setting the Component Index or Dependency Index to each possible index in turn.

Serialized Processing Interpreter

In highly constrained devices, where storage for parameters is limited, the manifest processor MAY handle one component at a time, traversing the manifest tree once for each listed component. In this mode, the interpreter ignores any commands executed while the component index is not the current component. This reduces the overall volatile storage required to process the update so that the only limit on number of components is the size of the manifest. However, this approach requires additional processing power.

In order to operate in this mode, the manifest processor loops on each section for every supported component, simply ignoring commands when the current component is not selected.

When a serialized Manifest Processor encounters a component or dependency index of True, it does not ignore any commands. It applies them to the current component or dependency on each iteration.

Parallel Processing Interpreter

Advanced Recipients MAY make use of the Strict Order parameter and enable parallel processing of some Command Sequences, or it may reorder some Command Sequences. To perform parallel processing, once the Strict Order parameter is set to False, the Recipient may fork a process for each command until the Strict Order parameter is returned to True or the Command Sequence ends. Then, it joins all forked processes before continuing processing of commands. To perform outof-order processing, a similar approach is used, except the Recipient consumes all commands after the Strict Order parameter is set to False, then it sorts these commands into its preferred order, invokes them all, then continues processing.

Under each of these scenarios the parallel processing must halt:

-Set Parameters.

-Override Parameters. -Set Dependency Index.

-Set Component Index.

To perform more useful parallel operations, sequences of commands may be collected in a suit-directive-run-sequence. Then, each of these sequences may be run in parallel. Each sequence defaults to Strict Order = True. To isolate each sequence from each other sequence, each sequence MUST begin with a Set Component Index directive. The interpreter MUST track each Set Component Index directive, and cause an Abort if more than one Set Component Index directive targets the same Component Index. When Strict Order = False, each suitdirective-run-sequence MUST begin with a Set Component Index directive. Any further Set Component Index directives MUST cause an Abort. This allows the interpreter that forks suit-directive-runsequence processes to check that the first element is correct, then fork a process to handle the remainder of the sequence.

Processing Dependencies

As described in Section 6.2, each manifest must invoke each of its dependencies sections from the corresponding section of the dependent. Any changes made to parameters by the dependency persist in the dependent.

When a Process Dependency command is encountered, the interpreter loads the dependency identified by the Current Dependency Index. The interpreter first executes the common-sequence section of the identified dependency, then it executes the section of the dependency that corresponds to the currently executing section of the dependent.

The Manifest Processor MUST also support a Dependency Index of True, which applies to every dependency, as described in Section 6.5

The interpreter also performs the checks described in Section 6.2 to ensure that the dependent is processing the dependency correctly.

Multiple Manifest Processors

When a system has multiple security domains they MAY require independent verification of authenticity or security policies. Security domains may be divided by separation technology such as Arm TrustZone, or Intel SGX. Security domains may also be divided into separate processors and memory spaces, with a communication interface between them. For example, an application processor may have an attached communications module that contains a processor. The communications module may require metadata signed by a specific Trust Authority for regulatory approval. This may be a different Trust Authority than the application processor.

When there are two or more security domains, a manifest processor MAY be required in each. The first manifest processor is the normal manifest processor as described for the Recipient in Abstract Machine. The second manifest processor only executes sections when the first manifest processor requests it. An API interface is provided from the second manifest processor to the first. This allows the first manifest processor to request a limited set of operations from the second. These operations are limited to: setting parameters, inserting an Envelope, invoking a Manifest Command Sequence. The second manifest processor declares a prefix to the first, which tells the first manifest processor when it should delegate to the second. These rules are enforced by underlying separation of privilege infrastructure, such as TEEs, or physical separation.

When the first manifest processor encounters a dependency prefix, that informs the first manifest processor that it should provide the second manifest processor with the corresponding dependency Envelope. This is done when the dependency is fetched. The second manifest processor immediately verifies any authentication information in the dependency Envelope. When a parameter is set for any component that matches the prefix, this parameter setting is passed to the second manifest processor via an API. As the first manifest processor works through the Procedure (set of command sequences) it is executing, each time it sees a Process Dependency command that is associated with the prefix declared by the second manifest processor, it uses the API to ask the second manifest processor to invoke that dependency section instead.

Creating Manifests

Manifests are created using tools for constructing COSE structures, calculating cryptographic values and compiling desired system state into a sequence of operations required to achieve that state. The process of constructing COSE structures and the calculation of cryptographic values is covered in [START_REF] Schaad | CBOR Object Signing and Encryption (COSE)[END_REF].

Compiling desired system state into a sequence of operations can be accomplished in many ways. Several templates are provided below to cover common use-cases. These templates can be combined to produce more complex behavior. The Fetch directive needs the URI parameter to be set to determine where the image is retrieved from. Additionally, the destination of where the component shall be stored has to be configured. The URI is configured via the Set Parameters directive while the destination is configured via the Set Component Index directive.

Install Template

This template modifies the Firmware Download template and adds an additional sequence. The Firmware Download operations are moved from the Payload Install sequence to the Payload Fetch sequence.

Then, the Install sequence contains the following operations:

-Set Component Index directive (see Section 8.7.7. An implementor MAY choose to place a payload in the envelope of a manifest. The payload envelope key MAY be a positive or negative integer. The payload envelope key MUST NOT be a value between 0 and 24 and it MUST NOT be used by any other envelope element in the manifest. The payload MUST be serialized in a bstr element.

The URI for a payload enclosed in this way MUST be expressed as a fragment-only reference, as defined in [START_REF] Berners-Lee | Uniform Resource Identifier (URI): Generic Syntax[END_REF], Section 4.4. The fragment identifier is the stringified envelope key of the payload. For example, an envelope that contains a payload a key 42 would use a URI "#42", key -73 would use a URI "#-73".

Load from Nonvolatile Storage Template

This directive loads an firmware image from external storage.

The following operations are placed into the load block:

-Set Component Index directive (see Section 8.7.7.

Composite Manifests

An implementor MAY choose to place a dependency's envelope in the envelope of its dependent. The dependent envelope key for the dependency envelope MUST NOT be a value between 0 and 24 and it MUST NOT be used by any other envelope element in the dependent manifest.

The URI for a dependency enclosed in this way MUST be expressed as a fragment-only reference, as defined in [START_REF] Berners-Lee | Uniform Resource Identifier (URI): Generic Syntax[END_REF], Section 4.4. The fragment identifier is the stringified envelope key of the dependency. For example, an envelope that contains a dependency at key 42 would use a URI "#42", key -73 would use a URI "#-73". For a diagram of the metadata structure, see Section 5.

Encoding Considerations

The map indices in the envelope encoding are reset to 1 for each map within the structure. This is to keep the indices as small as possible. The goal is to keep the index objects to single bytes (CBOR positive integers 1-23).

Wherever enumerations are used, they are started at 1. This allows detection of several common software errors that are caused by uninitialised variables. Positive numbers in enumerations are reserved for IANA registration. Negative numbers are used to identify application-specific implementations.

All elements of the envelope must be wrapped in a bstr to minimize the complexity of the code that evaluates the cryptographic integrity of the element and to ensure correct serialization for integrity and authenticity checks.

Envelope

The Envelope contains each of the other primary constituent parts of the SUIT metadata. It allows for modular processing of the manifest by ordering components in the expected order of processing.

The Envelope is encoded as a CBOR Map. Each element of the Envelope is enclosed in a bstr, which allows computation of a message digest against known bounds.

Delegation Chains

The suit-delegation field MAY carry one or more CBOR Web Tokens (CWTs) [START_REF] Jones | CBOR Web Token (CWT)[END_REF], with [START_REF] Jones | Proof-of-Possession Key Semantics for CBOR Web Tokens (CWTs)[END_REF] A SUIT_Envelope that has not had authentication information added MUST still contain the suit-authentication-wrapper element, but the content MUST be an empty list.

Encrypted Manifests

To use an encrypted manifest, it must be a dependency of a plaintext manifest. This allows fine-grained control of what information is accessible to intermediate systems for the purposes of management, while still preserving the confidentiality of the manifest contents. This also means that a Recipient can process an encrypted manifest in the same way as an encrypted payload, allowing code reuse.

A template for using an encrypted manifest is covered in Encrypted Manifest Template (Section 7.9).

Manifest

The manifest contains:

-a version number (see Section 8.6. suit-text contains all the human-readable information that describes any and all parts of the manifest, its payload(s) and its resource(s). The text section is typically severable, allowing manifests to be distributed without the text, since end-nodes do not require text. The meaning of each field is described below. The suit-dependency-prefix element contains a SUIT_Component_Identifier (see Section 8.7.2.2). This specifies the scope at which the dependency operates. This allows the dependency to be forwarded on to a component that is capable of parsing its own manifests. It also allows one manifest to be deployed to multiple dependent Recipients without those Recipients needing consistent component hierarchy. This element is OPTIONAL.

A dependency prefix can be used with a component identifier. This allows complex systems to understand where dependencies need to be applied. The dependency prefix can be used in one of two ways. The first simply prepends the prefix to all Component Identifiers in the dependency.

A dependency prefix can also be used to indicate when a dependency manifest needs to be processed by a secondary manifest processor, as described in Section 6.9. This hierarchical construction allows a component identifier to identify any part of a complex, multi-component system.

SUIT_Command_Sequence

A SUIT_Command_Sequence defines a series of actions that the Recipient MUST take to accomplish a particular goal. These goals are defined in the manifest and include: 2. Payload Fetch: suit-payload-fetch is a SUIT_Command_Sequence to execute in order to obtain a payload. Some manifests may include these actions in the suit-install section instead if they operate in a streaming installation mode. This is particularly relevant for constrained devices without any temporary storage for staging the update. suit-payload-fetch is OPTIONAL to implement.

3. Payload Installation: suit-install is a SUIT_Command_Sequence to execute in order to install a payload. Typical actions include verifying a payload stored in temporary storage, copying a staged payload from temporary storage, and unpacking a payload. suitinstall is OPTIONAL to implement.

4. Image Validation: suit-validate is a SUIT_Command_Sequence to execute in order to validate that the result of applying the update is correct. Typical actions involve image validation and manifest validation. suit-validate is REQUIRED to implement. If the manifest contains dependencies, one process-dependency invocation per dependency or one process-dependency invocation targeting all dependencies SHOULD be present in validate.

5. Image Loading: suit-load is a SUIT_Command_Sequence to execute in order to prepare a payload for execution. Typical actions include copying an image from permanent storage into RAM, optionally including actions such as decryption or decompression. suit-load is OPTIONAL to implement.

6. Run or Boot: suit-run is a SUIT_Command_Sequence to execute in order to run an image. suit-run typically contains a single instruction: either the "run" directive for the bootable manifest or the "process dependencies" directive for any dependents of the bootable manifest. suit-run is OPTIONAL to implement. Only one manifest in an update may contain the "run" directive.

Goals 1,2,3 form the Update Procedure. Goals 4,5,6 form the Boot Procedure.

Each Command Sequence follows exactly the same structure to ensure that the parser is as simple as possible.

Lists of commands are constructed from two kinds of element: Each condition is a command code identifier, followed by a SUIT_Reporting_Policy (Section 8.7.4).

Each directive is composed of: Reporting policies provide a hint to the manifest processor of whether or not to add the success or failure of a command to any report that it generates.

Many conditions and directives apply to a given component, and these generally grouped together. Therefore, a special command to set the current component index is provided with a matching command to set the current dependency index. This index is a numeric index into the component ID tables defined at the beginning of the document. For the purpose of setting the index, the two component ID tables are considered to be concatenated together. ----------------------------+-------------------------------------+ Any or all of these policies may be enabled at once.

If the component index is set to True when a command is executed with a non-zero reporting policy, then the Reporting Engine MUST receive one Record for each Component, in the order expressed in the Components list. If the dependency index is set to True when a command is executed with a non-zero reporting policy, then the Reporting Engine MUST receive one Record for each Dependency, in the order expressed in the Dependencies list.

SUIT does NOT REQUIRE a particular format of Records or Reports. SUIT only defines hints to the Reporting engine for which Records it should aggregate into the Report.

For example, a system using DICE certificates MAY use instances of suit-send-sysinfo-success to construct its certificates.

An OPTIONAL Record format, SUIT_Record is defined in [full-cddl]. It is encoded as a map, with the following elements. The defined manifest parameters are described below. Moran, et al. Expires January 14, 2021 [Page 41] CBOR-encoded object parameters are still wrapped in a bstr. This is because it allows a parser that is aggregating parameters to reference the object with a single pointer and traverse it without understanding the contents. This is important for modularization and division of responsibility within a pull parser. The same consideration does not apply to Directives because those elements are invoked with their arguments immediately 8.7.5.1. Constructing Identifiers Several conditions use identifiers to determine whether a manifest matches a given Recipient or not. These identifiers are defined to be RFC 4122 [START_REF] Leach | A Universally Unique IDentifier (UUID) URN Namespace[END_REF] UUIDs. These UUIDs are not human-readable and are therefore used for machine-based processing only.

+----------------+----------------------------------+---------------+ | Name | CDDL Structure | Reference |
A Recipient MAY match any number of UUIDs for vendor or class identifier. This may be relevant to physical or software modules. For example, a Recipient that has an OS and one or more applications might list one Vendor ID for the OS and one or more additional Vendor IDs for the applications. This Recipient might also have a Class ID that must be matched for the OS and one or more Class IDs for the applications.

Identifiers are used for compatibility checks. They MUST NOT be used as assertions of identity. They are evaluated by identifier conditions (Section 8.7.6.1). This allows the OS, WiFi module, and application to be updated independently. To combat possible incompatibilities, the OS class ID can be changed each time the OS has a change to its API.

This approach allows a vendor to target, for example, all devices with a particular WiFi module with an update, which is a very powerful mechanism, particularly when used for security updates.

UUIDs MUST be created according to RFC 4122 [START_REF] Leach | A Universally Unique IDentifier (UUID) URN Namespace[END_REF]. UUIDs SHOULD use versions 3, 4, or 5, as described in RFC4122. Versions 1 and 2 do not provide a tangible benefit over version 4 for this application.

The RECOMMENDED method to create a vendor ID is: Vendor ID = UUID5(DNS_PREFIX, vendor domain name)

The RECOMMENDED method to create a class ID is: Class ID = UUID5(Vendor ID, Class-Specific-Information)

Class-specific information is composed of a variety of data, for example:

-Model number.

-Hardware revision.

-Bootloader version (for immutable bootloaders). 8.7.5.10. suit-parameter-compression-info Compression Info defines any information that is required for a Recipient to perform decompression operations. Typically, this includes the algorithm identifier. This document defines the use of ZLIB [RFC1950], Brotli [START_REF] Alakuijala | Brotli Compressed Data Format[END_REF], and ZSTD [I-D.kucherawy-rfc8478bis].

Additional compression formats can be registered through the IANAmaintained registry. 8.7.5.11. suit-parameter-unpack-info SUIT_Unpack_Info defines the information required for a Recipient to interpret a packed format. This document defines the use of the following binary encodings: Intel HEX [HEX], Motorola S-record [SREC], Executable and Linkable Format (ELF) [ELF], and Common Object File Format (COFF) [COFF].

Additional packing formats can be registered through the IANAmaintained registry. 8.7.5.12. suit-parameter-uri A URI from which to fetch a resource. This parameter sets the priority of the update. This parameter is encoded as an integer. It is used along with suit-condition-updateauthorized [START_REF] Moran | [END_REF] to ask an application for permission to initiate an update. This does not constitute a privilege inversion because an explicit request for authorization has been provided by the Update Authority in the form of the suit-condition-update-authorized command.

Applications MAY define their own meanings for the update priority. For example, critical reliability & vulnerability fixes MAY be given negative numbers, while bug fixes MAY be given small positive numbers, and feature additions MAY be given larger positive numbers, which allows an application to make an informed decision about whether and when to allow an update to proceed.

suit-parameter-version

Indicates allowable versions for the specified component. Allowable versions can be specified, either with a list or with range matching. This parameter is compared with version asserted by the current component when Section 8.7.6.8 is invoked. The current component may assert the current version in many ways, including storage in a parameter storage database, in a metadata object, or in a known location within the component itself.

The component version can be compared as:

-Greater.

-Greater or Equal.

-Equal.

-Lesser or Equal.

-Lesser.

Versions are encoded as a CBOR list of integers. Comparisons are done on each integer in sequence. Comparison stops after all integers in the list defined by the manifest have been consumed OR after a non-equal match has occurred. For example, if the manifest defines a comparison, "Equal [START_REF] Moran | [END_REF]", then this will match all version sequences starting with 1. If a manifest defines both "Greater or Equal [START_REF] Moran | [END_REF]0]" and "Lesser [START_REF] Moran | [END_REF]10]", then it will match versions 1.0.x up to, but not including 1.10. While the exact encoding of versions is application-defined, semantic versions map conveniently. For example,

-1.2.3 = [1,2,3]. -1.2-rc3 = [1,2,-1,3]. -1.2-beta = [1,2,-2]. -1.2-alpha = [1,2,-3]. -1.2-alpha4 = [1,2,-3,4].
suit-condition-version is OPTIONAL to implement.

Versions SHOULD be provided as follows:

1. The first integer represents the major number. This indicates breaking changes to the component.

2. The second integer represents the minor number. This is typically reserved for new features or large, non-breaking changes.

3. The third integer is the patch version. This is typically reserved for bug fixes.

4. The fourth integer is the build number.

Where Alpha (-3), Beta (-2), and Release Candidate (-1) are used, they are inserted as a negative number between Minor and Patch numbers. This allows these releases to compare correctly with final releases. For example, Version 2.0, RC1 should be lower than Version 2.0.0 and higher than any Version 1.x. By encoding RC as -1, this works correctly: [2,0,-1,1] compares as lower than [2,0,0]. Similarly, beta (-2) is lower than RC and alpha (-3) is lower than RC.

8.7.5.18. suit-parameter-wait-info suit-directive-wait Section 8.7.7.12 directs the manifest processor to pause until a specified event occurs. The suit-parameter-waitinfo encodes the parameters needed for the directive.

The exact implementation of the pause is implementation-defined. For example, this could be done by blocking on a semaphore, registering an event handler and suspending the manifest processor, polling for a suit-parameter-wait-info is encoded as a map of wait events. When ALL wait events are satisfied, the Manifest Processor continues. The wait events currently defined are described in the following table.

suit-wait-event-other-device-version reuses the encoding of suitparameter-version-match. It is encoded as a sequence that contains an implementation-defined bstr identifier for the other device, and a list of one or more SUIT_Parameter_Version_Match.

suit-parameter-uri-list

Indicates a list of URIs from which to fetch a resource. The URI list is encoded as a list of tstr, in priority order. The Recipient should attempt to fetch the resource from each URI in turn, ruling out each, in order, if the resource is inaccessible or it is otherwise undesirable to fetch from that URI. suit-parameter-uri-list is consumed by Section 8.7.7.9. The Strict Order Parameter allows a manifest to govern when directives can be executed out-of-order. This allows for systems that have a sensitivity to order of updates to choose the order in which they are executed. It also allows for more advanced systems to parallelize their handling of updates. Strict Order defaults to True. It MAY be set to False when the order of operations does not matter. When arriving at the end of a command sequence, ALL commands MUST have completed, regardless of the state of SUIT_Parameter_Strict_Order. If SUIT_Parameter_Strict_Order is returned to True, ALL preceding commands MUST complete before the next command is executed.

See Section 6.7 for behavioral description of Strict Order. 8.7.5.22. suit-parameter-soft-failure

When executing a command sequence inside Section 8.7.7.4 or Section 8.7.7.13 and a condition failure occurs, the manifest processor aborts the sequence. For suit-directive-try-each, if Soft Failure is True, the next sequence in Try Each is invoked, otherwise suit-directive-try-each fails with the condition failure code. In suit-directive-run-sequence, if Soft Failure is True the suitdirective-run-sequence simply halts with no side-effects and the Manifest Processor continues with the following command, otherwise, the suit-directive-run-sequence fails with the condition failure code.

suit-parameter-soft-failure is scoped to the enclosing SUIT_Command_Sequence. Its value is discarded when SUIT_Command_Sequence terminates. It MUST NOT be set outside of suit-directive-try-each or suit-directive-run-sequence.

When suit-directive-try-each is invoked, Soft Failure defaults to

True. An Update Author may choose to set Soft Failure to False if they require a failed condition in a sequence to force an Abort.

When suit-directive-run-sequence is invoked, Soft Failure defaults to False. An Update Author may choose to make failures soft within a suit-directive-run-sequence. Conditions compare parameters against properties of the system. These properties may be asserted in many different ways, including: calculation on-demand, volatile definition in memory, static definition within the manifest processor, storage in known location within an image, storage within a key storage system, storage in One-Time-Programmable memory, inclusion in mask ROM, or inclusion as a register in hardware. Some of these assertion methods are global in scope, such as a hardware register, some are scoped to an individual --------------+-------------------------------------+-------------+ The abstract description of these commands is defined in Section 6.4. Set Dependency Index defines the manifest to which successive directives and conditions will apply. The supplied argument MUST be either a boolean or an unsigned integer index into the dependencies.

If the following directives apply to ALL dependencies, then the boolean value "True" is used instead of an index. If the following directives apply to NO dependencies, then the boolean value "False" is used. When suit-directive-set-component-index is used, suitdirective-set-dependency-index = False is implied. When suitdirective-set-dependency-index is used, suit-directive-set-componentindex = False is implied.

If dependency index is set to True when a command is invoked, then the command applies to all dependencies, in the order they appear in suit-common-components. When the Manifest Processor invokes a command while the dependency index is set to True, it must execute the command once for each possible dependency index, ensuring that the command receives the parameters corresponding to that dependency index.

Typical operations that require suit-directive-set-dependency-index include setting a source URI or Encryption Information, invoking The argument to suit-directive-try-each is a list of SUIT_Command_Sequence. suit-directive-try-each does not specify a reporting policy. 8.7.7.5. suit-directive-process-dependency Execute the commands in the common section of the current dependency, followed by the commands in the equivalent section of the current dependency. For example, if the current section is "fetch payload," this will execute "common" in the current dependency, then "fetch payload" in the current dependency. Once this is complete, the command following suit-directive-process-dependency will be processed.

If the current dependency is False, this directive has no effect. If the current dependency is True, then this directive applies to all dependencies. If the current section is "common," this directive MUST have no effect.

When SUIT_Process_Dependency completes, it forwards the last status code that occurred in the dependency. parameters also allows a manifest to modify the behavior of its dependencies.

Available parameters are defined in Section 8.7.5.

If a parameter is already set, suit-directive-set-parameters will skip setting the parameter to its argument. This provides the core of the override mechanism, allowing dependent manifests to change the behavior of a manifest. The behavior of suit-directive-copy can be modified by setting one or more of SUIT_Parameter_Encryption_Info, SUIT_Parameter_Compression_Info, SUIT_Parameter_Unpack_Info. These three parameters each activate and configure a processing step that can be applied to the data that is transferred during suit-directivecopy.

suit-directive-copy reads its source from Section 8.7.5.13. 8.7.7.11. suit-directive-run suit-directive-run directs the manifest processor to transfer execution to the current Component Index. When this is invoked, the manifest processor MAY be unloaded and execution continues in the Component Index. Arguments are provided to suit-directive-run through suit-parameter-run-arguments (Section 8.7.5.14) and are forwarded to the executable code located in Component Index in an application-specific way. For example, this could form the Linux Kernel Command Line if booting a Linux device.

If the executable code at Component Index is constructed in such a way that it does not unload the manifest processor, then the manifest processor may resume execution after the executable completes. This allows the manifest processor to invoke suitable helpers and to verify them with image conditions. To enable conditional commands, and to allow several strictly ordered sequences to be executed out-of-order, suit-directive-run-sequence allows the manifest processor to execute its argument as a SUIT_Command_Sequence. The argument must be wrapped in a bstr.

When a sequence is executed, any failure of a condition causes immediate termination of the sequence.

When suit-directive-run-sequence completes, it forwards the last status code that occurred in the sequence. If the Soft Failure parameter is true, then suit-directive-run-sequence only fails when a directive in the argument sequence fails.

Section 8.7.5.22 defaults to False when suit-directive-run-sequence begins. Its value is discarded when suit-directive-run-sequence terminates.

8.7.7.14. suit-directive-swap suit-directive-swap instructs the manifest processor to move the source to the destination and the destination to the source simultaneously. Swap has nearly identical semantics to suitdirective-copy except that suit-directive-swap replaces the source with the current contents of the destination in an applicationdefined way. If SUIT_Parameter_Compression_Info or SUIT_Parameter_Encryption_Info are present, they MUST be handled in a symmetric way, so that the source is decompressed into the

Access Control Lists

To manage permissions in the manifest, there are three models that can be used.

First, the simplest model requires that all manifests are authenticated by a single trusted key. This mode has the advantage that only a root manifest needs to be authenticated, since all of its dependencies have digests included in the root manifest.

This simplest model can be extended by adding key delegation without much increase in complexity.

A second model requires an ACL to be presented to the Recipient, authenticated by a trusted party or stored on the Recipient. This ACL grants access rights for specific component IDs or component ID prefixes to the listed identities or identity groups. Any identity may verify an image digest, but fetching into or fetching from a component ID requires approval from the ACL.

A third model allows a Recipient to provide even more fine-grained controls: The ACL lists the component ID or component ID prefix that an identity may use, and also lists the commands that the identity may use in combination with that component ID.

SUIT Digest Container

RFC 8152 [START_REF] Schaad | CBOR Object Signing and Encryption (COSE)[END_REF] provides containers for signature, MAC, and encryption, but no basic digest container. The container needed for a digest requires a type identifier and a container for the raw digest data. Some forms of digest may require additional parameters. These can be added following the digest.

The SUIT digest is a CBOR List containing two elements: a suitdigest-algorithm-id and a bstr containing the bytes of the digest.

IANA Considerations

IANA is requested to:

-allocate a CBOR tag for the SUIT Envelope and another for the SUIT Manifest.

-allocate a media type for suit: application/suit-envelope -setup several registries as described below In order to provide flexible behavior to constrained devices, while still allowing more powerful devices to use their full capabilities, the SUIT manifest encodes the required behavior of a Recipient device. Behavior is encoded as a specialized byte code, contained in a CBOR list. This promotes a flat encoding, which simplifies the parser. The information encoded by this byte code closely matches the operations that a device will perform, which promotes ease of processing. The core operations used by most update and trusted execution operations are represented in the byte code. The byte code can be extended by registering new operations.

The specialized byte code approach gives benefits equivalent to those provided by a scripting language or conventional byte code, with two substantial differences. First, the language is extremely high level, consisting of only the operations that a device may perform during update and trusted execution of a firmware image. Second, the language specifies linear behavior, without reverse branches. Conditional processing is supported, and parallel and out-of-order processing may be performed by sufficiently capable devices.

By structuring the data in this way, the manifest processor becomes a very simple engine that uses a pull parser to interpret the manifest. This pull parser invokes a series of command handlers that evaluate a Condition or execute a Directive. Most data is structured in a highly regular pattern, which simplifies the parser.

The results of this allow a Recipient to implement a very small parser for constrained applications. If needed, such a parser also allows the Recipient to perform complex updates with reduced overhead. Conditional execution of commands allows a simple device to perform important decisions at validation-time.

Dependency handling is vastly simplified as well. Dependencies function like subroutines of the language. When a manifest has a dependency, it can invoke that dependency's commands and modify their behavior by setting parameters. Because some parameters come with security implications, the dependencies also have a mechanism to reject modifications to parameters on a fine-grained level.

Developing a robust permissions system works in this model too. The Recipient can use a simple ACL that is a table of Identities and Component Identifier permissions to ensure that operations on components fail unless they are permitted by the ACL. This table can be further refined with individual parameters and commands.

Capability reporting is similarly simplified. A Recipient can report the Commands, Parameters, Algorithms, and Component Identifiers that it supports. This is sufficiently precise for a manifest author to create a manifest that the Recipient can accept.

The simplicity of design in the Recipient due to all of these benefits allows even a highly constrained platform to use advanced update capabilities.

C.1. C.1 Design Rationale: Envelope

The Envelope is used instead of a COSE structure for several reasons:

1. This enables the use of Severable Elements (Section 8.8)

2. This enables modular processing of manifests, particularly with large signatures.

3. This enables multiple authentication schemes. Four authentication objects are supported by the Envelope:

-COSE_Sign_Tagged -COSE_Sign1_Tagged

-COSE_Mac_Tagged -COSE_Mac0_Tagged

The SUIT Envelope allows an Update Authority or intermediary to mix and match any number of different authentication blocks it wants without any concern for modifying the integrity of another authentication block. This also allows the addition or removal of an authentication blocks without changing the integrity check of the Manifest, which is important for dependency handling. See Section 6.2

C.2. C.2 Byte String Wrappers

Byte string wrappers are used in several places in the suit manifest. The primary reason for wrappers it to limit the parser extent when invoked at different times, with a possible loss of context.

The elements of the suit envelope are wrapped both to set the extents used by the parser and to simplify integrity checks by clearly defining the length of each element.

The common block is re-parsed in order to find components identifiers from their indices, to find dependency prefixes and digests from their identifiers, and to find the common sequence. The common sequence is wrapped so that it matches other sequences, simplifying the code path.

A severed SUIT command sequence will appear in the envelope, so it must be wrapped as with all envelope elements. For consistency, command sequences are also wrapped in the manifest. This also allows the parser to discern the difference between a command sequence and a SUIT_Digest.

Parameters that are structured types (arrays and maps) are also wrapped in a bstr. This is so that parser extents can be set correctly using only a reference to the beginning of the parameter. This enables a parser to store a simple list of references to parameters that can be retrieved when needed.

D. Implementation Conformance Matrix

This section summarizes the functionality a minimal implementation needs to offer to claim conformance to this specification, in the absence of an application profile standard specifying otherwise.

The subsequent table shows the conditions.

+-------------------+-----------------+----------------+

8. 7

 7 .7.6. suit-directive-set-parameters suit-directive-set-parameters allows the manifest to configure behavior of future directives by changing parameters that are read by those directives. When dependencies are used, suit-directive-set-Moran, et al. Expires January 14, 2021 [Page 58]

  -event-authorization = 1 suit-wait-event-power = 2 suit-wait-event-network = 3 suit-wait-event-other-device-version = 4 suit-wait-event-time = 5 suit-wait-event-time-of-day = 6 suit-wait-event-day-of-week =

  Common is composed of three parts: a list of dependencies, a list of components referenced by the manifest, and a command sequence to execute prior to each other command sequence. The common command sequence is typically used to set commonly used values and perform compatibility checks. The common command sequence MUST NOT have any side-effects outside of setting parameter values.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	5.4.3. Command Sequences
	Command sequences provide the instructions that a Recipient requires
	in order to install or use an image. These sequences tell a device
	to set parameter values, test system parameters, copy data from one
	place to another, transform data, digest data, and run code.
	Command sequences are broken up into three groups: Common Command
	Sequence (see Section 5.4.2), update commands, and secure boot
	commands.
	Update Command Sequences are: Dependency Resolution, Payload Fetch,
	and Payload Installation. An Update Procedure is the complete set of
	each Update Command Sequence, each preceded by the Common Command
	Sequence.
	See Section 8.7.2, Section 8.7.2.1 for more detail.
	Moran, et al.	Expires January 14, 2021	[Page 13]

Boot Command Sequences are: System Validation, Image Loading, and Image Invocation. A Boot Procedure is the complete set of each Boot Command Sequence, each preceded by the Common Command Sequence.

  Try Each and Run Sequence are affected in the same way as other commands: they are invoked once for each possible Component or Dependency. This means that the sequences that are arguments to Try Each and Run Sequence are NOT invoked with Component Index = True or Dependency Index = True. They are only invoked with integer indices.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	if iscomponent(current):
	if current is true:
	cmd(component) for-each component in components
	else:
	cmd(current)
	else:
	if current is true:
	cmd(dependency) for-each dependency in dependencies
	else:
	cmd(current)
	Moran, et al.	Expires January 14, 2021	[Page 21]

Some directives offer control flow operations. Directives target a specific component or dependency. A dependency is another SUIT_Envelope that describes additional components. Dependencies are identified by digest, but referenced in commands by Dependency Index, the index into the array of Dependencies. A component is a unit of code or data that can be targeted by an update. Components are identified by Component Identifiers, i.e. arrays of binary strings, but referenced in commands by Component Index, the index into the array of Component Identifiers. Conditions MUST NOT have any side-effects other than informing the interpreter of success or failure. The Interpreter does not Abort if the Soft Failure flag is set when a Condition reports failure. Directives MAY have side-effects in the parameter table, the interpreter state, or the current component. The Interpreter MUST Abort if a Directive reports failure regardless of the Soft Failure flag. The following table describes the behavior of each command. "params" represents the parameters for the current component or dependency. Moran, et al. Expires January 14, 2021 [Page 19] 6.5. Special Cases of Component Index and Dependency Index

The interpreter MUST support a special case of Component Index if more than two or more components are supported: setting Component Index to True is allowed. When a command is invoked and the Component Index is True, the command MUST be invoked once for each Component, in the order listed in the array of Component Identifiers.

The interpreter MUST support a special case of Dependency Index when two or more dependencies are supported. When a command is invoked and the Dependency Index is True, the command MUST be invoked once for each Dependency, in the order listed in the array of Dependencies.

This is represented by the following pseudocode.

  According to Section 6.4, the Run directive applies to the component referenced by the current Component Index. Hence, the Set Component Index directive has to be used to target a specific component.

	Internet-Draft Internet-Draft	CBOR-based SUIT Manifest CBOR-based SUIT Manifest	July 2020 July 2020
	The Author MUST ensure that all parameters consumed by a command are
	set prior to invoking that command. Where Component Index = True or
	Dependency Index = True, this means that the parameters consumed by
	each command MUST have been set for each Component or Dependency,
	respectively. 7.3. Firmware Download Template
	NOTE: On systems that support only a single component, Set Current This template triggers the download of firmware.
	Component has no effect and can be omitted.
	The following operations are placed into the common block:
	NOTE: *A digest MUST always be set using Override Parameters, since
	this prevents a less-privileged dependent from replacing the digest.* -Set Component Index directive (see Section 8.7.7.1)
	7.1. Compatibility Check Template -Override Parameters directive (see Section 8.7.7.7) for Image
	Digest and Image Size (see Section 8.7.5)
	The compatibility check ensures that Recipients only install
	compatible images. In this template all information is contained in Then, the install block contains the following operations:
	the common block and the following sequence of operations are used:
	-Set Component Index directive (see Section 8.7.7.1)
	-Set Component Index directive (see Section 8.7.7.1)
	-Set Parameters directive (see Section 8.7.7.6) for URI (see
	-Set Parameters directive (see Section 8.7.7.6) for Vendor ID and Section 8.7.5.12)
	Class ID (see Section 8.7.5)
	-Check Vendor Identifier condition (see Section 8.7.5.1)
	-Check Class Identifier condication (see Section 8.7.5.1)
	7.2. Secure Boot Template
	This template performs a secure boot operation.
	The following operations are placed into the common block:
	-Set Component Index directive (see Section 8.7.7.1)
	-Override Parameters directive (see Section 8.7.7.7) for Image
	Digest and Image Size (see Section 8.7.5)
	Then, the run block contains the following operations:
	-Set Component Index directive (see Section 8.7.7.1)
	-Check Image Match condition (see Section 8.7.6.2)
	-Run directive (see Section 8.7.7.13)
	Moran, et al. Moran, et al.	Expires January 14, 2021 Expires January 14, 2021	[Page 24] [Page 25]

-Fetch directive (see Section 8.7.7.8) -Check Image Match condition (see Section 8.7.6.2)

  cnf claims. They can be used to perform enhanced authorization decisions. The CWTs are arranged into a list of lists. Each list starts with CWT authorized by a Trust Anchor, and finishes with a key used to authenticate the Manifest (see Section 8.4). This allows an Update Authority to delegate from a long term Trust Anchor, down through intermediaries, to a delegate without any out-of-band updates Trust Anchors.A Recipient MAY choose to cache intermediaries and/or delegates. If an Update Distributor knows that a targeted Recipient has cached some intermediaries or delegates, it MAY choose to strip any cached intermediaries or delegates from the Delegation Chains in order to reduce bandwidth and energy.The suit-authentication-wrapper contains a list of one or more cryptographic authentication wrappers for the Manifest. These are implemented as COSE_Mac_Tagged or COSE_Sign_Tagged blocks. Each of these blocks contains a SUIT_Digest of the Manifest. This enables modular processing of the manifest. The COSE_Mac_Tagged and COSE_Sign_Tagged blocks are described in RFC 8152[START_REF] Schaad | CBOR Object Signing and Encryption (COSE)[END_REF]. The suit-authentication-wrapper MUST come before any element in the SUIT_Envelope, except for the OPTIONAL suit-delegation, regardless of canonical encoding of CBOR. All validators MUST reject any SUIT_Envelope that begins with any element other than a suitauthentication-wrapper or suit-delegation.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	8.4. Authenticated Manifests
	Moran, et al.	Expires January 14, 2021	[Page 31]

  Text section, or any Command Sequence of the Update Procedure (Dependency Resolution, Image Fetch, Image Installation) can be either a CBOR structure or a SUIT_Digest. In each of these cases, the SUIT_Digest provides for a severable field. Severable fields are RECOMMENDED to implement. In particular, the humanreadable text SHOULD be severable, since most useful text elements occupy more space than a SUIT_Digest, but are not needed by the Recipient. Because SUIT_Digest is a CBOR Array and each severable element is a CBOR bstr, it is straight-forward for a Recipient to determine whether an element has been severed. The key used for a severable element is the same in the SUIT_Manifest and in the SUIT_Envelope so that a Recipient can easily identify the correct data in the envelope. See Section 8.7.8 for more detail.

	Internet-Draft Internet-Draft	CBOR-based SUIT Manifest CBOR-based SUIT Manifest	July 2020 July 2020
	-human-readable text describing the manifest found in the 8.6.4. suit-text
	SUIT_Envelope (see Section 8.6.4)
	suit-text SHOULD be a severable element. suit-text is a map of pairs.
	-a Concise Software Identifier found in the SUIT_Envelope (see It MAY contain two different types of pair:
	Section 8.7.1)
	-integer => text mappings
	1) -a sequence number (see Section 8.6.2) -SUIT_Component_Identifier => map mappings Each SUIT_Component_Identifier => map entry contains a map of integer => text values. All SUIT_Component_Identifiers present in suit-text MUST also be present in suit-common (Section 8.7.2) or the suit-The CoSWID, 8.6.3. suit-reference-uri common of a dependency.
	-a reference URI (see Section 8.6.3)
	suit-reference-uri is a text string that encodes a URI where a full
	-a common structure with information that is shared between command version of this manifest can be found. This is convenient for
	sequences (see Section 8.7.2) allowing management systems to show the severed elements of a
	manifest when this URI is reported by a Recipient after installation.
	-one or more lists of commands that the Recipient should perform
	(see Section 8.7.3)
	-a reference to the full manifest (see Section 8.6.3)
	Moran, et al. Moran, et al.	Expires January 14, 2021 Expires January 14, 2021	[Page 32] [Page 33]

8.6.1. suit-manifest-version

The suit-manifest-version indicates the version of serialization used to encode the manifest. Version 1 is the version described in this document. suit-manifest-version is REQUIRED to implement.

8.6.2. suit-manifest-sequence-number

The suit-manifest-sequence-number is a monotonically increasing antirollback counter. It also helps Recipients to determine which in a set of manifests is the "root" manifest in a given update. Each manifest MUST have a sequence number higher than each of its dependencies. Each Recipient MUST reject any manifest that has a sequence number lower than its current sequence number. It MAY be convenient to use a UTC timestamp in seconds as the sequence number. suit-manifest-sequence-number is REQUIRED to implement.

  To facilitate construction of Reports that describe the success, or failure of a given Procedure, each command is given a Reporting Policy. This is an integer bitfield that follows the command and indicates what the Recipient should do with the Record of executing the command. The options are summarized in the table below. +-

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	8.7.4. Reporting Policy
	To facilitate optional conditions, a special directive,
	Section 8.7.7.4, is provided. It runs several new lists of
	conditions/directives, one after another, that are contained as an
	argument to the directive. By default, it assumes that a failure of
	a condition should not indicate a failure of the update/boot, but a
	parameter is provided to override this behavior. See
	Section 8.7.5.22.
	Moran, et al.	Expires January 14, 2021	[Page 39]

  If component index is set to True when a command is invoked, then the command applies to all components, in the order they appear in suitcommon-components. When the Manifest Processor invokes a command while the component index is set to True, it must execute the command once for each possible component index, ensuring that the command receives the parameters corresponding to that component index.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	When a Recipient executes a Directive, it MUST report a result code.
	If the Directive reports failure, then the current Command Sequence
	MUST terminate.
	8.7.7.1. suit-directive-set-component-index
	Set Component Index defines the component to which successive
	directives and conditions will apply. The supplied argument MUST be
	either a boolean or an unsigned integer index into suit-components.
	If the following commands apply to ALL components, then the boolean
	value "True" is used instead of an index. If the following commands
	apply to NO components, then the boolean value "False" is used. When
	suit-directive-set-dependency-index is used, suit-directive-set-
	component-index = False is implied. When suit-directive-set-
	component-index is used, suit-directive-set-dependency-index = False
	is implied.
	8.7.7.2. suit-directive-set-dependency-index
	Moran, et al.	Expires January 14, 2021	[Page 56]

  True at the beginning of each sequence. If one sequence aborts due to a condition failure, the next is started. If no sequence completes without condition failure, then suit-directive-try-each returns an error. If a particular application calls for all sequences to fail and still continue, then an empty sequence (nil) can be added to the Try Each Argument.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	"Fetch," or invoking "Process Dependency" for an individual
	dependency.
	8.7.7.3. suit-directive-abort
	Unconditionally fail. This operation is typically used in
	conjunction with suit-directive-try-each.
	8.7.7.4. suit-directive-try-each
	This command runs several SUIT_Command_Sequence, one after another,
	in a strict order. Use this command to implement a "try/catch-try/
	catch" sequence. Manifest processors MAY implement this command.
	Section 8.7.5.22 is initialized to
	Moran, et al.	Expires January 14, 2021	[Page 57]

  Text section, or any Command Sequence of the Update Procedure is made severable, it is moved to the Envelope and replaced with a SUIT_Digest. The SUIT_Digest is computed over the entire bstr enclosing the Manifest element that has been moved to the Envelope. Each element that is made severable from the Manifest is placed in the Envelope with an identical key, so that it matches the key of the corresponding Integrity Check Value.Because the manifest can be used by different actors at different times, some parts of the manifest can be removed or "Severed" without affecting later stages of the lifecycle. Severing of information is achieved by separating that information from the signed container so that removing it does not affect the signature. This means that ensuring integrity of severable parts of the manifest is a requirement for the signed portion of the manifest. Severing some parts makes it possible to discard parts of the manifest that are no longer necessary. This is important because it allows the storage used by the manifest to be greatly reduced. For example, no text size limits are needed if text is removed from the manifest prior to delivery to a constrained device.

	Internet-Draft Internet-Draft	CBOR-based SUIT Manifest CBOR-based SUIT Manifest	July 2020 July 2020
	destination and the destination is compressed into the source. The
	source is decrypted into the destination and the destination is
	encrypted into the source. suit-directive-swap is OPTIONAL to
	implement.
	8.7.8. Integrity Check Values
	When the CoSWID, Each Integrity Check Value covers the corresponding Envelope Element
	as described in Section 8.8.
	8.8. Severable Elements
	Elements are made severable by removing them from the manifest,
	encoding them in a bstr, and placing a SUIT_Digest of the bstr in the
	manifest so that they can still be authenticated. The SUIT_Digest
	typically consumes 4 bytes more than the size of the raw digest,
	therefore elements smaller than (Digest Bits)/8 + 4 SHOULD NOT be
	severable. Elements larger than (Digest Bits)/8 + 4 MAY be
	severable, while elements that are much larger than (Digest Bits)/8 +
	4 SHOULD be severable.
	Because of this, all command sequences in the manifest are encoded in
	a bstr so that there is a single code path needed for all command
	sequences.
	Moran, et al. Moran, et al.	Expires January 14, 2021 Expires January 14, 2021	[Page 61] [Page 62]

  This allows integrity verification by a dependent to be unaffected by adding or removing authentication structures.Modular processing is important because it allows a Manifest Processor to iterate forward over an Envelope, processing Delegation Chains and Authentication Blocks, retaining only intermediate values, without any need to seek forward and backwards in a stream until it gets to the Manifest itself. This allows the use of large, Post-Quantum signatures without requiring retention of the signature itself, or seeking forward and back.

	Internet-Draft	CBOR-based SUIT Manifest	July 2020
	4.
	Moran, et al.	Expires January 14, 2021	[Page 104]

11.2. SUIT Parameters Moran, et al. Expires January 14, 2021 [Page 65]

Moran, et al. Expires January 14, 2021 [Page 66]

11.5. SUIT Algorithm Identifiers 11.5.1. SUIT Digest Algorithm Identifiers Moran, et al. Expires January 14, 2021 [Page 67]

Moran, et al. Expires January 14, 2021 [Page 68]

 +-------------------+--------------------------------------------+--------------

Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.

Total size of the Envelope without COSE authentication object or Severable Elements: 191 Envelope: a10358bba70101020203585fa202818141000458568614a40150fa6b4a53 d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab45 0358248202582000112233445566778899aabbccddeeff0123456789abcd effedcba98765432100e1987d0010f020f09820258203ee96dc79641970a e46b929ccf0b72ba9536dd846020dbdc9f949d84ea0e18d20a4382030f0c 438217020d8202582023f48b2e2838650f43c144234aee18401ffe3cce47 33b23881c3a8ae2d2b66e8 Moran, et al. Expires January 14, 2021 [Page 90] Internet-Draft CBOR-based SUIT Manifest July 2020 Total size of the Envelope with COSE authentication object but without Severable Elements: 340 Envelope: a202589281588fd28443a10126a058448202584037353638353537396138 336261626437316563386566323266613439616338373366373861373038 6134336136373465373832616433306236353938643137615840faca7079 6c319ce6dae69690a64ced3ab91b9bb7f3e9a5004122d629d2816216a870 448424ce4410d658b80215185e32d8ec6feb15c7275d64437c36418463e4 0358bba70101020203585fa202818141000458568614a40150fa6b4a53d5 ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab4503 58248202582000112233445566778899aabbccddeeff0123456789abcdef fedcba98765432100e1987d0010f020f09820258203ee96dc79641970ae4 6b929ccf0b72ba9536dd846020dbdc9f949d84ea0e18d20a4382030f0c43 8217020d8202582023f48b2e2838650f43c144234aee18401ffe3cce4733 b23881c3a8ae2d2b66e8 Total size of Envelope with COSE authentication object: 923 Envelope with COSE authentication object: Moran, et al. Expires January 14, 2021 [Page 91] Internet-Draft CBOR-based SUIT Manifest July 2020 a402589281588fd28443a10126a058448202584037353638353537396138 336261626437316563386566323266613439616338373366373861373038 6134336136373465373832616433306236353938643137615840faca7079 6c319ce6dae69690a64ced3ab91b9bb7f3e9a5004122d629d2816216a870 448424ce4410d658b80215185e32d8ec6feb15c7275d64437c36418463e4 0358bba70101020203585fa202818141000458568614a40150fa6b4a53d5 ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab4503 58248202582000112233445566778899aabbccddeeff0123456789abcdef fedcba98765432100e1987d0010f020f09820258203ee96dc79641970ae4 6b929ccf0b72ba9536dd846020dbdc9f949d84ea0e18d20a4382030f0c43 8217020d8202582023f48b2e2838650f43c144234aee18401ffe3cce4733 b23881c3a8ae2d2b66e809583c8613a1157832687474703a2f2f6578616d 706c652e636f6d2f766572792f6c6f6e672f706174682f746f2f66696c65 2f66696c652e62696e1502030f0d590204a20179019d2323204578616d70 6c6520323a2053696d756c74616e656f757320446f776e6c6f61642c2049 6e7374616c6c6174696f6e2c2053656375726520426f6f742c2053657665 726564204669656c64730a0a2020202054686973206578616d706c652063 6f766572732074686520666f6c6c6f77696e672074656d706c617465733a 0a202020200a202020202a20436f6d7061746962696c6974792043686563 6b20287b7b74656d706c6174652d636f6d7061746962696c6974792d6368 65636b7d7d290a202020202a2053656375726520426f6f7420287b7b7465 6d706c6174652d7365637572652d626f6f747d7d290a202020202a204669 726d7761726520446f776e6c6f616420287b7b6669726d776172652d646f 776e6c6f61642d74656d706c6174657d7d290a202020200a202020205468 6973206578616d706c6520616c736f2064656d6f6e737472617465732073 6576657261626c6520656c656d656e747320287b7b6f76722d7365766572 61626c657d7d292c20616e64207465787420287b7b6d616e69666573742d 6469676573742d746578747d7d292e814100a2036761726d2e636f6d0578 525468697320636f6d706f6e656e7420697320612064656d6f6e73747261 74696f6e2e205468652064696765737420697320612073616d706c652070 61747465726e2c206e6f742061207265616c206f6e652e B.4. Example 3: A/B images Internet-Draft CBOR-based SUIT Manifest July 2020 a10359011ba5010102030358aaa202818141000458a18814a20150fa6b4a 53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab 450f8258368614a105198400050514a20358248202582000112233445566 778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d058 3a8614a1051a00084400050514a2035824820258200123456789abcdeffe dcba987654321000112233445566778899aabbccddeeff0e1a00012c2201 0f020f095861860f82582a8613a105198400050513a115781c687474703a 2f2f6578616d706c652e636f6d2f66696c65312e62696e582c8613a1051a 00084400050513a115781c687474703a2f2f6578616d706c652e636f6d2f 66696c65322e62696e1502030f0a4382030f Total size of Envelope with COSE authentication object: 437 Envelope with COSE authentication object: a202589281588fd28443a10126a058448202584061653063316561363839 633938303061383433353530663338373936623666646264353261306337 386265356432363031316438653738346461343364343763584010222ddb ce4e82a85f6ec7b72db34d7c5be8d2e822e4b2d099a4cf1d08aa2174c56c 2e93bf20c785bca298900208d92d352faf86e6cddc902a726bbc443c21ff 0359011ba5010102030358aaa202818141000458a18814a20150fa6b4a53 d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab45 0f8258368614a105198400050514a2035824820258200011223344556677 8899aabbccddeeff0123456789abcdeffedcba98765432100e1987d0583a 8614a1051a00084400050514a2035824820258200123456789abcdeffedc ba987654321000112233445566778899aabbccddeeff0e1a00012c22010f 020f095861860f82582a8613a105198400050513a115781c687474703a2f 2f6578616d706c652e636f6d2f66696c65312e62696e582c8613a1051a00 084400050513a115781c687474703a2f2f6578616d706c652e636f6d2f66 696c65322e62696e1502030f0a4382030f B.5. Example 4: Load and Decompress from External Storage Total size of Envelope without COSE authentication object: 245 Envelope: a10358f1a801010204035867a20283814100814102814101045858880c00 14a40150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48 bf429b2d51f2ab450358248202582000112233445566778899aabbccddee ff0123456789abcdeffedcba98765432100e1987d0010f020f085827880c 0113a115781b687474703a2f2f6578616d706c652e636f6d2f66696c652e 62696e1502030f094b880c0013a116011602030f0a45840c00030f0b583a 880c0213a4035824820258200123456789abcdeffedcba98765432100011 2233445566778899aabbccddeeff0e1a00012c22130116001602030f0c45 840c021702 Total size of Envelope with COSE authentication object: 394 Envelope with COSE authentication object: Moran, et al. Expires January 14, 2021 [Page 99] Internet-Draft CBOR-based SUIT Manifest July 2020 a202589281588fd28443a10126a058448202584034623463376338633066 646137366339633935393161396462313630393138653262336339366135 3862306135653439383466643465386639333539613932385840d7063361 f653d57e63691e1bd9c856058c773b94e488bff58d599c45277788e90eb9 2fbef666f584e8d35b3b20ceef50a69b94dcff12beee92e426a06ea31320 0358f1a801010204035867a20283814100814102814101045858880c0014 a40150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf 429b2d51f2ab450358248202582000112233445566778899aabbccddeeff 0123456789abcdeffedcba98765432100e1987d0010f020f085827880c01 13a115781b687474703a2f2f6578616d706c652e636f6d2f66696c652e62 696e1502030f094b880c0013a116011602030f0a45840c00030f0b583a88 0c0213a4035824820258200123456789abcdeffedcba9876543210001122 33445566778899aabbccddeeff0e1a00012c22130116001602030f0c4584 0c021702 B.6. Example 5: Two Images Internet-Draft CBOR-based SUIT Manifest July 2020 a103590103a601010205035895a202828141008141010458898c0c0014a4 0150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf42 9b2d51f2ab450358248202582000112233445566778899aabbccddeeff01 23456789abcdeffedcba98765432100e1987d0010f020f0c0114a2035824 820258200123456789abcdeffedcba987654321000112233445566778899 aabbccddeeff0e1a00012c2209584f900c0013a115781c687474703a2f2f 6578616d706c652e636f6d2f66696c65312e62696e1502030f0c0113a115 781c687474703a2f2f6578616d706c652e636f6d2f66696c65322e62696e 1502030f0a49880c00030f0c01030f0c47860c0017021702 Total size of Envelope with COSE authentication object: 413 Envelope with COSE authentication object: a202589281588fd28443a10126a058448202584032313062313238353063 323339303931643865383263306539653931303636326236386163383432 3435386136343138653333663637303165643538333432635840b5b8cb30 c2bbb646c4d32426d72768668d6d6af54c26ac46c4020ca37ada47b94683 40b4d0b2ddd15db824a7e6b0bc233e753940dfb7131fa145ddc456da3cf6 03590103a601010205035895a202828141008141010458898c0c0014a401 50fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b 2d51f2ab450358248202582000112233445566778899aabbccddeeff0123 456789abcdeffedcba98765432100e1987d0010f020f0c0114a203582482 0258200123456789abcdeffedcba987654321000112233445566778899aa bbccddeeff0e1a00012c2209584f900c0013a115781c687474703a2f2f65 78616d706c652e636f6d2f66696c65312e62696e1502030f0c0113a11578 1c687474703a2f2f6578616d706c652e636f6d2f66696c65322e62696e15

CBOR-based SUIT Manifest

July 2020 8.7.6.2. suit-condition-image-match Verify that the current component matches the Section 8.7.5.5 for the current component. The digest is verified against the digest specified in the Component's parameters list. If no digest is specified, the condition fails. suit-condition-image-match is REQUIRED to implement. 8.7.6.3. suit-condition-image-not-match

Verify that the current component does not match the Section 8.7.5.5. If no digest is specified, the condition fails. suit-condition-imagenot-match is OPTIONAL to implement. 8.7.6.4. suit-condition-use-before

Verify that the current time is BEFORE the specified time. suitcondition-use-before is used to specify the last time at which an update should be installed. The recipient evaluates the current time against the suit-parameter-use-before parameter (Section 8.7.5.7), which must have already been set as a parameter, encoded as a POSIX timestamp, that is seconds after 1970-01-01 00:00:00. Timestamp conditions MUST be evaluated in 64 bits, regardless of encoded CBOR size. suit-condition-use-before is OPTIONAL to implement. 8.7.6.5. suit-condition-component-offset

Verify that the offset of the current component matches the offset set in Section 8.7.5.8. This condition allows a manifest to select between several images to match a target offset. 8.7.6.6. suit-condition-minimum-battery suit-condition-minimum-battery provides a mechanism to test a Recipient's battery level before installing an update. This condition is primarily for use in primary-cell applications, where the battery is only ever discharged. For batteries that are charged, suit-directive-wait is more appropriate, since it defines a "wait" until the battery level is sufficient to install the update. suitcondition-minimum-battery is specified in mWh. suit-conditionminimum-battery is OPTIONAL to implement. suit-condition-minimumbattery consumes Section 8.7.5.15. +---------------+-------------------------------------+-------------+ --------------+-------------------------------------+------------- ; Named Information Hash Algorithm Identifiers suit-digest-algorithm-ids /= algorithm-id-sha224 suit-digest-algorithm-ids /= algorithm-id-sha256 suit-digest-algorithm-ids /= algorithm-id-sha384 suit-digest-algorithm-ids /= algorithm-id-sha512 suit-digest-algorithm-ids /= algorithm-id-sha3-224 suit-digest-algorithm-ids /= algorithm-id-sha3-256 suit-digest-algorithm-ids /= algorithm-id-sha3-384 suit-digest-algorithm-ids /= algorithm-id-sha3-512 The following examples demonstrate a small subset of the functionality of the manifest. However, despite this, even a simple manifest processor can execute most of these manifests.

The examples are signed using the following ECDSA secp256r1 key:

The corresponding public key can be used to verify these examples:

-----BEGIN PUBLIC KEY-----MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhJaBGq4LqqvSYVcYnuzaJr6qi/Eb bz/m4rVlnIXbwK07HypLbAmBMcCjbazR14vTgdzfsJwFLbM5kdtzOLSolg== -----END PUBLIC KEY-----Each example uses SHA256 as the digest function.

Note that reporting policies are declared for each non-flow-control command in these examples. The reporting policies used in the examples are described in the following tables.