idnits 2.17.1 draft-ietf-suit-manifest-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 45 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 09, 2020) is 1389 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 1642 -- Looks like a reference, but probably isn't: '2' on line 1642 -- Looks like a reference, but probably isn't: '3' on line 1636 == Missing Reference: '-1' is mentioned on line 1636, but not defined == Missing Reference: '-2' is mentioned on line 1638, but not defined == Missing Reference: '-3' is mentioned on line 1642, but not defined -- Looks like a reference, but probably isn't: '4' on line 1642 ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-16) exists of draft-ietf-suit-architecture-11 == Outdated reference: A later version (-13) exists of draft-ietf-suit-information-model-07 == Outdated reference: A later version (-19) exists of draft-ietf-teep-architecture-08 == Outdated reference: A later version (-06) exists of draft-kucherawy-rfc8478bis-05 Summary: 1 error (**), 0 flaws (~~), 9 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SUIT B. Moran 3 Internet-Draft H. Tschofenig 4 Intended status: Standards Track Arm Limited 5 Expires: December 11, 2020 H. Birkholz 6 Fraunhofer SIT 7 K. Zandberg 8 Inria 9 June 09, 2020 11 A Concise Binary Object Representation (CBOR)-based Serialization Format 12 for the Software Updates for Internet of Things (SUIT) Manifest 13 draft-ietf-suit-manifest-07 15 Abstract 17 This specification describes the format of a manifest. A manifest is 18 a bundle of metadata about the firmware for an IoT device, where to 19 find the firmware, the devices to which it applies, and cryptographic 20 information protecting the manifest. Firmware updates and secure 21 boot both tend to use sequences of common operations, so the manifest 22 encodes those sequences of operations, rather than declaring the 23 metadata. The manifest also serves as a building block for secure 24 boot. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at https://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on December 11, 2020. 43 Copyright Notice 45 Copyright (c) 2020 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (https://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 5 62 3. How to use this Document . . . . . . . . . . . . . . . . . . 6 63 4. Background . . . . . . . . . . . . . . . . . . . . . . . . . 7 64 4.1. IoT Firmware Update Constraints . . . . . . . . . . . . . 7 65 4.2. Update Workflow Model . . . . . . . . . . . . . . . . . . 8 66 5. Severed Fields . . . . . . . . . . . . . . . . . . . . . . . 9 67 6. Interpreter Behavior . . . . . . . . . . . . . . . . . . . . 10 68 6.1. Interpreter Setup . . . . . . . . . . . . . . . . . . . . 10 69 6.2. Required Checks . . . . . . . . . . . . . . . . . . . . . 11 70 6.3. Interpreter Fundamental Properties . . . . . . . . . . . 12 71 6.4. Abstract Machine Description . . . . . . . . . . . . . . 12 72 6.5. Serialized Processing Interpreter . . . . . . . . . . . . 14 73 6.6. Parallel Processing Interpreter . . . . . . . . . . . . . 14 74 6.7. Processing Dependencies . . . . . . . . . . . . . . . . . 15 75 7. Creating Manifests . . . . . . . . . . . . . . . . . . . . . 15 76 7.1. Compatibility Check Template . . . . . . . . . . . . . . 16 77 7.2. Secure Boot Template . . . . . . . . . . . . . . . . . . 16 78 7.3. Firmware Download Template . . . . . . . . . . . . . . . 16 79 7.4. Load from External Storage Template . . . . . . . . . . . 17 80 7.5. Load & Decompress from External Storage Template . . . . 17 81 7.6. Dependency Template . . . . . . . . . . . . . . . . . . . 18 82 8. Envelope . . . . . . . . . . . . . . . . . . . . . . . . . . 18 83 8.1. Authenticated Manifests . . . . . . . . . . . . . . . . . 19 84 8.2. Encrypted Manifests . . . . . . . . . . . . . . . . . . . 20 85 8.3. Delegation Info . . . . . . . . . . . . . . . . . . . . . 20 86 8.4. Severable Fields . . . . . . . . . . . . . . . . . . . . 20 87 8.5. Human-Readable Text . . . . . . . . . . . . . . . . . . . 20 88 8.6. COSWID . . . . . . . . . . . . . . . . . . . . . . . . . 21 89 8.7. Encoding Considerations . . . . . . . . . . . . . . . . . 21 90 9. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 22 91 9.1. suit-manifest-version . . . . . . . . . . . . . . . . . . 22 92 9.2. suit-manifest-sequence-number . . . . . . . . . . . . . . 23 93 9.3. suit-reference-uri . . . . . . . . . . . . . . . . . . . 23 94 9.4. suit-text . . . . . . . . . . . . . . . . . . . . . . . . 23 95 9.5. suit-coswid . . . . . . . . . . . . . . . . . . . . . . . 23 96 9.6. Dependencies . . . . . . . . . . . . . . . . . . . . . . 23 97 9.7. SUIT_Component_Reference . . . . . . . . . . . . . . . . 24 98 9.8. SUIT_Command_Sequence . . . . . . . . . . . . . . . . . . 24 99 9.8.1. suit-common . . . . . . . . . . . . . . . . . . . . . 26 100 9.8.2. SUIT_Parameters . . . . . . . . . . . . . . . . . . . 26 101 9.8.3. SUIT_Condition . . . . . . . . . . . . . . . . . . . 31 102 9.8.4. SUIT_Directive . . . . . . . . . . . . . . . . . . . 36 103 10. Access Control Lists . . . . . . . . . . . . . . . . . . . . 42 104 11. SUIT Digest Container . . . . . . . . . . . . . . . . . . . . 43 105 12. Creating Conditional Sequences . . . . . . . . . . . . . . . 43 106 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45 107 13.1. SUIT Directives . . . . . . . . . . . . . . . . . . . . 45 108 13.2. SUIT Conditions . . . . . . . . . . . . . . . . . . . . 46 109 13.3. SUIT Parameters . . . . . . . . . . . . . . . . . . . . 46 110 13.4. SUIT Text Values . . . . . . . . . . . . . . . . . . . . 48 111 13.5. SUIT Algorithm Identifiers . . . . . . . . . . . . . . . 48 112 13.5.1. Hash Algorithms . . . . . . . . . . . . . . . . . . 48 113 13.5.2. Unpack Algorithms . . . . . . . . . . . . . . . . . 49 114 14. Security Considerations . . . . . . . . . . . . . . . . . . . 49 115 15. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 49 116 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 50 117 16.1. Normative References . . . . . . . . . . . . . . . . . . 50 118 16.2. Informative References . . . . . . . . . . . . . . . . . 51 119 A. Full CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . 53 120 B. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 121 B.1. Example 0: Secure Boot . . . . . . . . . . . . . . . . . 61 122 B.2. Example 1: Simultaneous Download and Installation of 123 Payload . . . . . . . . . . . . . . . . . . . . . . . . . 63 124 B.3. Example 2: Simultaneous Download, Installation, and 125 Secure Boot . . . . . . . . . . . . . . . . . . . . . . . 66 126 B.4. Example 3: Load from External Storage . . . . . . . . . . 68 127 B.5. Example 4: Load and Decompress from External Storage . . 71 128 B.6. Example 5: Compatibility Test, Download, Installation, 129 and Secure Boot . . . . . . . . . . . . . . . . . . . . . 73 130 B.7. Example 6: Two Images . . . . . . . . . . . . . . . . . . 76 131 C. Design Rational . . . . . . . . . . . . . . . . . . . . . . . 79 132 D. Implementation Conformance Matrix . . . . . . . . . . . . . . 80 133 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 84 135 1. Introduction 137 A firmware update mechanism is an essential security feature for IoT 138 devices to deal with vulnerabilities. While the transport of 139 firmware images to the devices themselves is important there are 140 already various techniques available. Equally important is the 141 inclusion of metadata about the conveyed firmware image (in the form 142 of a manifest) and the use of a security wrapper to provide end-to- 143 end security protection to detect modifications and (optionally) to 144 make reverse engineering more difficult. End-to-end security allows 145 the author, who builds the firmware image, to be sure that no other 146 party (including potential adversaries) can install firmware updates 147 on IoT devices without adequate privileges. For confidentiality 148 protected firmware images it is additionally required to encrypt the 149 firmware image. Starting security protection at the author is a risk 150 mitigation technique so firmware images and manifests can be stored 151 on untrusted repositories; it also reduces the scope of a compromise 152 of any repository or intermediate system to be no worse than a denial 153 of service. 155 A manifest is a bundle of metadata about the firmware for an IoT 156 device, where to find the firmware, the devices to which it applies, 157 and cryptographic information protecting the manifest. 159 This specification defines the SUIT manifest format and it is 160 intended to meet several goals: 162 - Meet the requirements defined in 163 [I-D.ietf-suit-information-model]. 165 - Simple to parse on a constrained node 167 - Simple to process on a constrained node 169 - Compact encoding 171 - Comprehensible by an intermediate system 173 - Expressive enough to enable advanced use cases on advanced nodes 175 - Extensible 177 The SUIT manifest can be used for a variety of purposes throughout 178 its lifecycle, such as: 180 - the Firmware Author to reason about releasing a firmware. 182 - the Network Operator to reason about compatibility of a firmware. 184 - the Device Operator to reason about the impact of a firmware. 186 - the Device Operator to manage distribution of firmware to devices. 188 - the Plant Manager to reason about timing and acceptance of 189 firmware updates. 191 - the device to reason about the authority & authenticity of a 192 firmware prior to installation. 194 - the device to reason about the applicability of a firmware. 196 - the device to reason about the installation of a firmware. 198 - the device to reason about the authenticity & encoding of a 199 firmware at boot. 201 Each of these uses happens at a different stage of the manifest 202 lifecycle, so each has different requirements. 204 It is assumed that the reader is familiar with the high-level 205 firmware update architecture [I-D.ietf-suit-architecture] and the 206 threats, requirements, and user stories in 207 [I-D.ietf-suit-information-model]. 209 A core concept of the SUIT manifest specification are commands. 210 Commands are either conditions or directives used to define the 211 required behavior. Conceptually, a sequence of commands is like a 212 script but the used language is tailored to software updates and 213 secure boot. 215 The available commands support simple steps, such as copying a 216 firmware image from one place to another, checking that a firmware 217 image is correct, verifying that the specified firmware is the 218 correct firmware for the device, or unpacking a firmware. By using 219 these steps in different orders and changing the parameters they use, 220 a broad range of use cases can be supported. The SUIT manifest uses 221 this observation to heavily optimize metadata for consumption by 222 constrained devices. 224 While the SUIT manifest is informed by and optimized for firmware 225 update and secure boot use cases, there is nothing in the 226 [I-D.ietf-suit-information-model] that restricts its use to only 227 those use cases. Other use cases include the management of trusted 228 applications in a Trusted Execution Environment (TEE), see 229 [I-D.ietf-teep-architecture]. 231 2. Conventions and Terminology 233 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 234 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 235 "OPTIONAL" in this document are to be interpreted as described in 236 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 237 capitals, as shown here. 239 The following terminology is used throughout this document: 241 - SUIT: Software Update for the Internet of Things, the IETF working 242 group for this standard. 244 - Payload: A piece of information to be delivered. Typically 245 Firmware for the purposes of SUIT. 247 - Resource: A piece of information that is used to construct a 248 payload. 250 - Manifest: A manifest is a bundle of metadata about the firmware 251 for an IoT device, where to find the firmware, the devices to 252 which it applies, and cryptographic information protecting the 253 manifest. 255 - Envelope: A container with the manifest, an authentication 256 wrapper, authorization information, and severed fields. 258 - Update: One or more manifests that describe one or more payloads. 260 - Update Authority: The owner of a cryptographic key used to sign 261 updates, trusted by Recipients. 263 - Recipient: The system, typically an IoT device, that receives a 264 manifest. 266 - Command: A Condition or a Directive. 268 - Condition: A test for a property of the Recipient or its 269 components. 271 - Directive: An action for the Recipient to perform. 273 - Trusted Execution: A process by which a system ensures that only 274 trusted code is executed, for example secure boot. 276 - A/B images: Dividing a device's storage into two or more bootable 277 images, at different offsets, such that the active image can write 278 to the inactive image(s). 280 3. How to use this Document 282 This specification covers four aspects of firmware update: 284 - Section 4 describes the device constraints, use cases, and design 285 principles that informed the structure of the manifest. 287 - Section 6 describes what actions a manifest processor should take. 289 - Section 7 describes the process of creating a manifest. 291 - Section 9 specifies the content of the manifest and the envelope. 293 To implement an updatable device, see Section 6 and Section 9. To 294 implement a tool that generates updates, see Section 7 and Section 9. 296 The IANA consideration section, see Section 13, provides instructions 297 to IANA to create several registries. This section also provides the 298 CBOR labels for the structures defined in this document. 300 The complete CDDL description is provided in Appendix A, examples are 301 given in Appendix B and a design rational is offered in Appendix C. 302 Finally, Appendix D gives a summarize of the mandatory-to-implement 303 features of this specification. 305 4. Background 307 Distributing firmware updates to diverse devices with diverse trust 308 anchors in a coordinated system presents unique challenges. Devices 309 have a broad set of constraints, requiring different metadata to make 310 appropriate decisions. There may be many actors in production IoT 311 systems, each of whom has some authority. Distributing firmware in 312 such a multi-party environment presents additional challenges. Each 313 party requires a different subset of data. Some data may not be 314 accessible to all parties. Multiple signatures may be required from 315 parties with different authorities. This topic is covered in more 316 depth in [I-D.ietf-suit-architecture]. The security aspects are 317 described in [I-D.ietf-suit-information-model]. 319 4.1. IoT Firmware Update Constraints 321 The various constraints of IoT devices and the range of use cases 322 that need to be supported create a broad set of urequirements. For 323 example, devices with: 325 - limited processing power and storage may require a simple 326 representation of metadata. 328 - bandwidth constraints may require firmware compression or partial 329 update support. 331 - bootloader complexity constraints may require simple selection 332 between two bootable images. 334 - small internal storage may require external storage support. 336 - multiple microcontrollers may require coordinated update of all 337 applications. 339 - large storage and complex functionality may require parallel 340 update of many software components. 342 - extra information may need to be conveyed in the manifest in the 343 earlier stages of the device lifecycle before those data items are 344 stripped when the manifest is delivery to a constrained device. 346 Supporting the requirements introduced by the constraints on IoT 347 devices requires the flexibility to represent a diverse set of 348 possible metadata, but also requires that the encoding is kept 349 simple. 351 4.2. Update Workflow Model 353 There are several fundamental assumptions that inform the model of 354 the firmware update workflow: 356 - Compatibility must be checked before any other operation is 357 performed. 359 - All dependency manifests should be present before any payload is 360 fetched. 362 - In some applications, payloads must be fetched and validated prior 363 to installation. 365 There are several fundamental assumptions that inform the model of 366 the secure boot workflow: 368 - Compatibility must be checked before any other operation is 369 performed. 371 - All dependencies and payloads must be validated prior to loading. 373 - All loaded images must be validated prior to execution. 375 Based on these assumptions, the manifest is structured to work with a 376 pull parser, where each section of the manifest is used in sequence. 377 The expected workflow for a device installing an update can be broken 378 down into five steps: 380 1. Verify the signature of the manifest. 382 2. Verify the applicability of the manifest. 384 3. Resolve dependencies. 386 4. Fetch payload(s). 388 5. Install payload(s). 390 When installation is complete, similar information can be used for 391 validating and running images in a further three steps: 393 1. Verify image(s). 395 2. Load image(s). 397 3. Run image(s). 399 If verification and running is implemented in a bootloader, then the 400 bootloader must also verify the signature of the manifest and the 401 applicability of the manifest in order to implement secure boot 402 workflows. The bootloader may add its own authentication, e.g. a 403 MAC, to the manifest in order to prevent further verifications. 405 When multiple manifests are used for an update, each manifest's steps 406 occur in a lockstep fashion; all manifests have dependency resolution 407 performed before any manifest performs a payload fetch, etc. 409 5. Severed Fields 411 Because the manifest can be used by different actors at different 412 times, some parts of the manifest can be removed without affecting 413 later stages of the lifecycle. This is called "Severing." Severing 414 of information is achieved by separating that information from the 415 signed container so that removing it does not affect the signature. 416 This means that ensuring authenticity of severable parts of the 417 manifest is a requirement for the signed portion of the manifest. 418 Severing some parts makes it possible to discard parts of the 419 manifest that are no longer necessary. This is important because it 420 allows the storage used by the manifest to be greatly reduced. For 421 example, no text size limits are needed if text is removed from the 422 manifest prior to delivery to a constrained device. 424 Elements are made severable by removing them from the manifest, 425 encoding them in a bstr, and placing a SUIT_Digest of the bstr in the 426 manifest so that they can still be authenticated. The SUIT_Digest 427 typically consumes 4 bytes more than the size of the raw digest, 428 therefore elements smaller than (Digest Bits)/8 + 4 should never be 429 severable. Elements larger than (Digest Bits)/8 + 4 may be 430 severable, while elements that are much larger than (Digest Bits)/8 + 431 4 should be severable. 433 Because of this, all command sequences in the manifest are encoded in 434 a bstr so that there is a single code path needed for all command 435 sequences. 437 6. Interpreter Behavior 439 This section describes the behavior of the manifest interpreter and 440 focuses primarily on interpreting commands in the manifest. However, 441 there are several other important behaviors of the interpreter: 442 encoding version detection, rollback protection, and authenticity 443 verification are chief among these. 445 6.1. Interpreter Setup 447 Prior to executing any command sequence, the interpreter or its host 448 application MUST inspect the manifest version field and fail when it 449 encounters an unsupported encoding version. Next, the interpreter or 450 its host application MUST extract the manifest sequence number and 451 perform a rollback check using this sequence number. The exact logic 452 of rollback protection may vary by application, but it has the 453 following properties: 455 - Whenever the interpreter can choose between several manifests, it 456 MUST select the latest valid, authentic manifest. 458 - If the latest valid, authentic manifest fails, it MAY select the 459 next latest valid, authentic manifest. 461 Here, valid means that a manifest has a supported encoding version 462 and it has not been excluded for other reasons. Reasons for 463 excluding typically involve first executing the manifest and may 464 include: 466 - Test failed (e.g. Vendor ID/Class ID). 468 - Unsupported command encountered. 470 - Unsupported parameter encountered. 472 - Unsupported component ID encountered. 474 - Payload not available. 476 - Dependency not available. 478 - Application crashed when executed. 480 - Watchdog timeout occurred. 482 - Dependency or Payload verification failed. 484 These failure reasons MAY be combined with retry mechanisms prior to 485 marking a manifest as invalid. 487 Following these initial tests, the interpreter clears all parameter 488 storage. This ensures that the interpreter begins without any leaked 489 data. 491 6.2. Required Checks 493 The RECOMMENDED process is to verify the signature of the manifest 494 prior to parsing/executing any section of the manifest. This guards 495 the parser against arbitrary input by unauthenticated third parties, 496 but it costs extra energy when a device receives an incompatible 497 manifest. 499 A device MAY choose to parse and execute only the SUIT_Common section 500 of the manifest prior to signature verification, if - it expects to 501 receive many incompatible manifests, and - it has power budget that 502 makes signature verification undesirable. 504 The guidelines in Creating Manifests (Section 7) require that the 505 common section contains the applicability checks, so this section is 506 sufficient for applicability verification. The manifest parser MUST 507 NOT execute any command with side-effects outside the parser (for 508 example, Run, Copy, Swap, or Fetch commands) prior to authentication 509 and any such command MUST result in an error. 511 Once a valid, authentic manifest has been selected, the interpreter 512 MUST examine the component list and verify that its maximum number of 513 components is not exceeded and that each listed component ID is 514 supported. 516 For each listed component, the interpreter MUST provide storage for 517 the supported parameters. If the interpreter does not have 518 sufficient temporary storage to process the parameters for all 519 components, it MAY process components serially for each command 520 sequence. See Section 6.5 for more details. 522 The interpreter SHOULD check that the common section contains at 523 least one vendor ID check and at least one class ID check. 525 If the manifest contains more than one component, each command 526 sequence MUST begin with a Set Current Component command. 528 If a dependency is specified, then the interpreter MUST perform the 529 following checks: 531 1. At the beginning of each section in the dependent: all previous 532 sections of each dependency have been executed. 534 2. At the end of each section in the dependent: The corresponding 535 section in each dependency has been executed. 537 If the interpreter does not support dependencies and a manifest 538 specifies a dependency, then the interpreter MUST reject the 539 manifest. 541 6.3. Interpreter Fundamental Properties 543 The interpreter has a small set of design goals: 545 1. Executing an update MUST either result in an error, or a 546 verifiably correct system state. 548 2. Executing a secure boot MUST either result in an error, or a 549 booted system. 551 3. Executing the same manifest on multiple devices MUST result in 552 the same system state. 554 NOTE: when using A/B images, the manifest functions as two (or more) 555 logical manifests, each of which applies to a system in a particular 556 starting state. With that provision, design goal 3 holds. 558 6.4. Abstract Machine Description 560 The heart of the manifest is the list of commands, which are 561 processed by an interpreter. This interpreter can be modeled as a 562 simple abstract machine. This machine consists of several data 563 storage locations that are modified by commands. 565 There are two types of commands, namely those that modify state 566 (directives) and those that perform tests (conditions). Parameters 567 are used as the inputs to commands. Some directives offer control 568 flow operations. Directives target a specific component. A 569 component is a unit of code or data that can be targeted by an 570 update. Components are identified by a Component Index, i.e. arrays 571 of binary strings. 573 The following table describes the behavior of each command. "params" 574 represents the parameters for the current component or dependency. 576 +--------------------+----------------------------------------------+ 577 | Command Name | Semantic of the Operation | 578 +--------------------+----------------------------------------------+ 579 | Check Vendor | binary-match(component, params[vendor-id]) | 580 | Identifier | | 581 | | | 582 | Check Class | binary-match(component, params[class-id]) | 583 | Identifier | | 584 | | | 585 | Verify Image | binary-match(digest(component), | 586 | | params[digest]) | 587 | | | 588 | Set Component | component := components[arg] | 589 | Index | | 590 | | | 591 | Override | params[k] := v for k,v in arg | 592 | Parameters | | 593 | | | 594 | Set Dependency | dependency := dependencies[arg] | 595 | Index | | 596 | | | 597 | Set Parameters | params[k] := v if not k in params for k,v in | 598 | | arg | 599 | | | 600 | Process Dependency | exec(dependency[common]); exec(dependency | 601 | | [current-segment]) | 602 | | | 603 | Run | run(component) | 604 | | | 605 | Fetch | store(component, fetch(params[uri])) | 606 | | | 607 | Use Before | assert(now() < arg) | 608 | | | 609 | Check Component | assert(offsetof(component) == arg) | 610 | Offset | | 611 | | | 612 | Check Device | binary-match(component, params[device-id]) | 613 | Identifier | | 614 | | | 615 | Check Image Not | not binary-match(digest(component), | 616 | Match | params[digest]) | 617 | | | 618 | Check Minimum | assert(battery >= arg) | 619 | Battery | | 620 | | | 621 | Check Update | assert(isAuthorized()) | 622 | Authorized | | 623 | | | 624 | Check Version | assert(version_check(component, arg)) | 625 | | | 626 | Abort | assert(0) | 627 | | | 628 | Try Each | break if exec(seq) is not error for seq in | 629 | | arg | 630 | | | 631 | Copy | store(component, params[src-component]) | 632 | | | 633 | Swap | swap(component, params[src-component]) | 634 | | | 635 | Wait For Event | until event(arg), wait | 636 | | | 637 | Run Sequence | exec(arg) | 638 | | | 639 | Run with Arguments | run(component, arg) | 640 +--------------------+----------------------------------------------+ 642 6.5. Serialized Processing Interpreter 644 Because each manifest has a list of components and a list of 645 components defined by its dependencies, it is possible for the 646 manifest processor to handle one component at a time, traversing the 647 manifest tree once for each listed component. In this mode, the 648 interpreter ignores any commands executed while the component index 649 is not the current component. This reduces the overall volatile 650 storage required to process the update so that the only limit on 651 number of components is the size of the manifest. However, this 652 approach requires additional processing power. 654 6.6. Parallel Processing Interpreter 656 Advanced devices may make use of the Strict Order parameter and 657 enable parallel processing of some segments, or it may reorder some 658 segments. To perform parallel processing, once the Strict Order 659 parameter is set to False, the device may fork a process for each 660 command until the Strict Order parameter is returned to True or the 661 command sequence ends. Then, it joins all forked processes before 662 continuing processing of commands. To perform out-of-order 663 processing, a similar approach is used, except the device consumes 664 all commands after the Strict Order parameter is set to False, then 665 it sorts these commands into its preferred order, invokes them all, 666 then continues processing. 668 Under each of these scenarios the parallel processing must halt: 670 - Set Parameters. 672 - Override Parameters. 674 - Set Strict Order = True. 676 - Set Dependency Index. 678 - Set Component Index. 680 To perform more useful parallel operations, sequences of commands may 681 be collected in a suit-directive-run-sequence. Then, each of these 682 sequences may be run in parallel. Each sequence defaults to Strict 683 Order = True. To isolate each sequence from each other sequence, 684 each sequence must declare a single target component. Set Component 685 Index is not permitted inside this sequence. 687 6.7. Processing Dependencies 689 As described in Section 6.2, each manifest must invoke each of its 690 dependencies sections from the corresponding section of the 691 dependent. Any changes made to parameters by the dependency persist 692 in the dependent. 694 When a Process Dependency command is encountered, the interpreter 695 loads the dependency identified by the Current Dependency Index. The 696 interpreter first executes the common-sequence section of the 697 identified dependency, then it executes the section of the dependency 698 that corresponds to the currently executing section of the dependent. 700 The interpreter also performs the checks described in Section 6.2 to 701 ensure that the dependent is processing the dependency correctly. 703 7. Creating Manifests 705 Manifests are created using tools for constructing COSE structures, 706 calculating cryptographic values and compiling desired system state 707 into a sequence of operations required to achieve that state. The 708 process of constructing COSE structures and the calculation of 709 cryptographic values is covered in [RFC8152]. 711 Compiling desired system state into a sequence of operations can be 712 accomplished in many ways. Several templates are provided below to 713 cover common use-cases. These templates can be combined to produce 714 more complex behavior. 716 NOTE: On systems that support only a single component, Set Current 717 Component has no effect and can be omitted. 719 NOTE: A digest should always be set using Override Parameters, since 720 this prevents a less-privileged dependent from replacing the digest. 722 7.1. Compatibility Check Template 724 The compatibility check ensures that devices only install compatible 725 images. In this template all information is contained in the common 726 block and the following sequence of operations are used: 728 - Set Component Index directive (see Section 9.8.4.1) 730 - Set Parameters directive (see Section 9.8.4.6) for Vendor ID and 731 Class ID (see Section 9.8.2) 733 - Check Vendor Identifier condition (see Section 9.8.3.1) 735 - Check Class Identifier condication (see Section 9.8.3.1) 737 7.2. Secure Boot Template 739 This template performs a secure boot operation. 741 The following operations are placed into the common block: 743 - Set Component Index directive (see Section 9.8.4.1) 745 - Override Parameters directive (see Section 9.8.4.7) for Image 746 Digest and Image Size (see Section 9.8.2) 748 Then, the run block contains the following operations: 750 - Set Component Index directive (see Section 9.8.4.1) 752 - Check Image Match condition (see Section 9.8.3.2) 754 - Run directive (see Section 9.8.4.12) 756 According to Section 6.4, the Run directive applies to the component 757 referenced by the current Component Index. Hence, the Set Component 758 Index directive has to be used to target a specific component. 760 7.3. Firmware Download Template 762 This template triggers the download of firmware. 764 The following operations are placed into the common block: 766 - Set Component Index directive (see Section 9.8.4.1) 768 - Override Parameters directive (see Section 9.8.4.7) for Image 769 Digest and Image Size (see Section 9.8.2) 771 Then, the install block contains the following operations: 773 - Set Component Index directive (see Section 9.8.4.1) 775 - Set Parameters directive (see Section 9.8.4.6) for URI (see 776 Section 9.8.2) 778 - Fetch directive (see Section 9.8.4.8) 780 The Fetch directive needs the URI parameter to be set to determine 781 where the image is retrieved from. Additionally, the destination of 782 where the component shall be stored has to be configured. The URI is 783 configured via the Set Parameters directive while the destination is 784 configured via the Set Component Index directive. 786 7.4. Load from External Storage Template 788 This directive loads an firmware image from external storage. 790 The following operations are placed into the load block: 792 - Set Component Index directive (see Section 9.8.4.1) 794 - Set Parameters directive (see Section 9.8.4.6) for Component Index 795 (see Section 9.8.2) 797 - Copy directive (see Section 9.8.4.9) 799 As outlined in Section 6.4, the Copy directive needs a source and a 800 destination to be configured. The source is configured via Component 801 Index (with the Set Parameters directive) and the destination is 802 configured via the Set Component Index directive. 804 7.5. Load & Decompress from External Storage Template 806 The following operations are placed into the load block: 808 - Set Component Index directive (see Section 9.8.4.1) 810 - Set Parameters directive (see Section 9.8.4.6) for Component Index 811 and Compression Info (see Section 9.8.2) 813 - Copy directive (see Section 9.8.4.9) 815 This example is similar to the previous case but additionally 816 performs decompression. Hence, the only difference is in setting the 817 Compression Info parameter. 819 7.6. Dependency Template 821 The following operations are placed into the dependency resolution 822 block: 824 - Set Dependency Index directive (see Section 9.8.4.2) 826 - Set Parameters directive (see Section 9.8.4.6) for URI (see 827 Section 9.8.2) 829 - Fetch directive (see Section 9.8.4.8) 831 - Check Image Match condition (see Section 9.8.3.2) 833 - Process Dependency directive (see Section 9.8.4.5) 835 Then, the validate block contains the following operations: 837 - Set Dependency Index directive (see Section 9.8.4.2) 839 - Check Image Match condition (see Section 9.8.3.2) 841 - Process Dependency directive (see Section 9.8.4.5) 843 NOTE: Any changes made to parameters in a dependency persist in the 844 dependent. 846 8. Envelope 848 The diagram below shows high-level structure of the SUIT manifest 849 embedded in the envelope, the top-level structure. 851 +------------------------+ 852 | Envelope | 853 +------------------------+ 854 | Delegation Info | 855 | Authentication Wrapper | 856 | Plaintext or -+---------> +----------------------------+ 857 | Encrypted Manifest-+ | | Manifest | 858 | Severable Fields | +----------------------------+ 859 | Human-Readable Text | | Version | 860 | COSWID | | Sequence Number | 861 +------------------------+ +----- Common Structure | 862 | +--- Commands | 863 | | | Digest of Enveloped Fields | 864 +-----------------------+ | | | Reference to Full Manifest | 865 | Common Structure | <-+ | +----------------------------+ 866 +-----------------------+ | 867 | Dependencies | +->+-----------------------+ 868 | Components IDs | +->| Commands | 869 | Component References | | +-----------------------+ 870 | Common Commands ------------+ | List of ( pairs of ( | 871 +-----------------------+ | * command code | 872 | * argument | 873 | )) | 874 +----------------------- 876 8.1. Authenticated Manifests 878 The suit-authentication-wrapper contains a list of 1 or more 879 cryptographic authentication wrappers for the core part of the 880 manifest. These are implemented as COSE_Mac_Tagged or 881 COSE_Sign_Tagged blocks. Each of these blocks contains a SUIT_Digest 882 of the manifest. This enables modular processing of the manifest. 883 The COSE_Mac_Tagged and COSE_Sign_Tagged blocks are described in RFC 884 8152 [RFC8152]. The suit-authentication-wrapper MUST come before any 885 element in the SUIT_Envelope, except for the OPTIONAL suit- 886 delegation, regardless of canonical encoding of CBOR. All validators 887 MUST reject any SUIT_Envelope that begins with any element other than 888 a suit-authentication-wrapper or suit-delegation. 890 A SUIT_Envelope that has not had authentication information added 891 MUST still contain the suit-authentication-wrapper element, but the 892 content MUST be nil. 894 For manifests that are only authenticated the envelope MUST contain 895 the plaintext manifest in SUIT_Manifest structure. 897 8.2. Encrypted Manifests 899 For encrypted manifest both a SUIT_Encryption_Wrapper and the 900 ciphertext of a manifest is included in the envelope. 902 When the envelope contains the SUIT_Encryption_Wrapper, the suit- 903 authentication-wrapper MUST authenticate the plaintext of suit- 904 manifest-encrypted. This ensures that the manifest can be stored 905 decrypted and that a recipient MAY convert the suit-manifest- 906 encrypted element to a suit-manifest element. 908 The SUIT_Manifest structure describes the payload(s) to be installed 909 and any dependencies on other manifests. 911 The suit-manifest-encryption-info structure contains information 912 required to decrypt a ciphertext manifest and the suit-manifest- 913 encrypted structure contains the ciphertext. 915 8.3. Delegation Info 917 The suit-delegation field may carry one or multiple CBOR Web Tokens 918 (CWTs) [RFC8392]. They can be used to perform enhanced authorization 919 decisions. 921 8.4. Severable Fields 923 Each of suit-dependency-resolution, suit-payload-fetch, and suit- 924 payload-installation contain the severable contents of the 925 identically named portions of the manifest, described in Section 9. 927 8.5. Human-Readable Text 929 suit-text contains all the human-readable information that describes 930 any and all parts of the manifest, its payload(s) and its 931 resource(s). The text section is typically severable, allowing 932 manifests to be distributed without the text, since end-nodes do not 933 require text. The meaning of each field is described below. 935 Each section MAY be present. If present, each section MUST be as 936 described. Negative integer IDs are reserved for application- 937 specific text values. 939 +---------------------------------+---------------------------------+ 940 | CDDL Structure | Description | 941 +---------------------------------+---------------------------------+ 942 | suit-text-manifest-description | Free text description of the | 943 | | manifest | 944 | | | 945 | suit-text-update-description | Free text description of the | 946 | | update | 947 | | | 948 | suit-text-vendor-name | Free text vendor name | 949 | | | 950 | suit-text-model-name | Free text model name | 951 | | | 952 | suit-text-vendor-domain | The domain used to create the | 953 | | vendor-id condition | 954 | | | 955 | suit-text-model-info | The information used to create | 956 | | the class-id condition | 957 | | | 958 | suit-text-component-description | Free text description of each | 959 | | component in the manifest | 960 | | | 961 | suit-text-manifest-json-source | The JSON-formatted document | 962 | | that was used to create the | 963 | | manifest | 964 | | | 965 | suit-text-manifest-yaml-source | The yaml-formatted document | 966 | | that was used to create the | 967 | | manifest | 968 | | | 969 | suit-text-version-dependencies | List of component versions | 970 | | required by the manifest | 971 +---------------------------------+---------------------------------+ 973 8.6. COSWID 975 suit-coswid contains a Concise Software Identifier. This may be 976 discarded by the Recipient, if not needed. 978 8.7. Encoding Considerations 980 The map indices in the envelope encoding are reset to 1 for each map 981 within the structure. This is to keep the indices as small as 982 possible. The goal is to keep the index objects to single bytes 983 (CBOR positive integers 1-23). 985 Wherever enumerations are used, they are started at 1. This allows 986 detection of several common software errors that are caused by 987 uninitialised variables. Positive numbers in enumerations are 988 reserved for IANA registration. Negative numbers are used to 989 identify application-specific implementations. 991 All elements of the envelope must be wrapped in a bstr to minimize 992 the complexity of the code that evaluates the cryptographic integrity 993 of the element and to ensure correct serialization for integrity and 994 authenticity checks. 996 9. Manifest 998 The manifest contains: 1000 - a version number (see Section 9.1) 1002 - a sequence number (see Section 9.2) 1004 - a common structure with information that is shared between command 1005 sequences (see Section 9.8.1) 1007 - a list of commands that the Recipient should perform (see 1008 Section 9.8) 1010 - a reference to the full manifest (see Section 9.3) 1012 - a digest of human-readable text describing the manifest found in 1013 the SUIT_Envelope (see Section 9.4) 1015 - a digest of the Concise Software Identifier found in the 1016 SUIT_Envelope (see Section 9.5) 1018 Several fields in the Manifest can be either a CBOR structure or a 1019 SUIT_Digest. In each of these cases, the SUIT_Digest provides for a 1020 severable field. Severable fields are RECOMMENDED to implement. In 1021 particular, the human-readable text SHOULD be severable, since most 1022 useful text elements occupy more space than a SUIT_Digest, but are 1023 not needed by the Recipient. Because SUIT_Digest is a CBOR Array and 1024 each severable element is a CBOR bstr, it is straight-forward for a 1025 Recipient to determine whether an element has been severed. The key 1026 used for a severable element is the same in the SUIT_Manifest and in 1027 the SUIT_Envelope so that a Recipient can easily identify the correct 1028 data in the envelope. 1030 9.1. suit-manifest-version 1032 The suit-manifest-version indicates the version of serialization used 1033 to encode the manifest. Version 1 is the version described in this 1034 document. suit-manifest-version is REQUIRED to implement. 1036 9.2. suit-manifest-sequence-number 1038 The suit-manifest-sequence-number is a monotonically increasing anti- 1039 rollback counter. It also helps devices to determine which in a set 1040 of manifests is the "root" manifest in a given update. Each manifest 1041 MUST have a sequence number higher than each of its dependencies. 1042 Each Recipient MUST reject any manifest that has a sequence number 1043 lower than its current sequence number. It MAY be convenient to use 1044 a UTC timestamp in seconds as the sequence number. suit-manifest- 1045 sequence-number is REQUIRED to implement. 1047 9.3. suit-reference-uri 1049 suit-reference-uri is a text string that encodes a URI where a full 1050 version of this manifest can be found. This is convenient for 1051 allowing management systems to show the severed elements of a 1052 manifest when this URI is reported by a device after installation. 1054 9.4. suit-text 1056 suit-text is a digest that uniquely identifies the content of the 1057 Text that is packaged in the SUIT_Envelope. suit-text is OPTIONAL to 1058 implement. 1060 9.5. suit-coswid 1062 suit-coswid is a digest that uniquely identifies the content of the 1063 concise-software-identifier that is packaged in the SUIT_Envelope. 1064 suit-coswid is OPTIONAL to implement. 1066 9.6. Dependencies 1068 SUIT_Dependency specifies a manifest that describes a dependency of 1069 the current manifest. 1071 The suit-dependency-digest specifies the dependency manifest uniquely 1072 by identifying a particular Manifest structure. The digest is 1073 calculated over the Manifest structure instead of the COSE 1074 Sig_structure or Mac_structure. This means that a digest may need to 1075 be calculated more than once, however this is necessary to ensure 1076 that removing a signature from a manifest does not break dependencies 1077 due to missing signature elements. This is also necessary to support 1078 the trusted intermediary use case, where an intermediary re-signs the 1079 Manifest, removing the original signature, potentially with a 1080 different algorithm, or trading COSE_Sign for COSE_Mac. 1082 The suit-dependency-prefix element contains a 1083 SUIT_Component_Identifier. This specifies the scope at which the 1084 dependency operates. This allows the dependency to be forwarded on 1085 to a component that is capable of parsing its own manifests. It also 1086 allows one manifest to be deployed to multiple dependent devices 1087 without those devices needing consistent component hierarchy. This 1088 element is OPTIONAL. 1090 9.7. SUIT_Component_Reference 1092 The SUIT_Component_Reference describes an image that is defined by 1093 another manifest. This is useful for overriding the behavior of 1094 another manifest, for example by directing the recipient to look at a 1095 different URI for the image or by changing the expected format, such 1096 as when a gateway performs decryption on behalf of a constrained 1097 device. 1099 9.8. SUIT_Command_Sequence 1101 A SUIT_Command_Sequence defines a series of actions that the 1102 Recipient MUST take to accomplish a particular goal. These goals are 1103 defined in the manifest and include: 1105 1. Dependency Resolution: suit-dependency-resolution is a 1106 SUIT_Command_Sequence to execute in order to perform dependency 1107 resolution. Typical actions include configuring URIs of 1108 dependency manifests, fetching dependency manifests, and 1109 validating dependency manifests' contents. suit-dependency- 1110 resolution is REQUIRED to implement and to use when suit- 1111 dependencies is present. 1113 2. Payload Fetch: suit-payload-fetch is a SUIT_Command_Sequence to 1114 execute in order to obtain a payload. Some manifests may include 1115 these actions in the suit-install section instead if they operate 1116 in a streaming installation mode. This is particularly relevant 1117 for constrained devices without any temporary storage for staging 1118 the update. suit-payload-fetch is OPTIONAL to implement. 1120 3. Payload Installation: suit-install is a SUIT_Command_Sequence to 1121 execute in order to install a payload. Typical actions include 1122 verifying a payload stored in temporary storage, copying a staged 1123 payload from temporary storage, and unpacking a payload. suit- 1124 install is OPTIONAL to implement. 1126 4. Image Validation: suit-validate is a SUIT_Command_Sequence to 1127 execute in order to validate that the result of applying the 1128 update is correct. Typical actions involve image validation and 1129 manifest validation. suit-validate is REQUIRED to implement. If 1130 the manifest contains dependencies, one process-dependency 1131 invocation per dependency or one process-dependency invocation 1132 targeting all dependencies SHOULD be present in validate. 1134 5. Image Loading: suit-load is a SUIT_Command_Sequence to execute in 1135 order to prepare a payload for execution. Typical actions 1136 include copying an image from permanent storage into RAM, 1137 optionally including actions such as decryption or decompression. 1138 suit-load is OPTIONAL to implement. 1140 6. Run or Boot: suit-run is a SUIT_Command_Sequence to execute in 1141 order to run an image. suit-run typically contains a single 1142 instruction: either the "run" directive for the bootable manifest 1143 or the "process dependencies" directive for any dependents of the 1144 bootable manifest. suit-run is OPTIONAL to implement. Only one 1145 manifest in an update may contain the "run" directive. 1147 Each of these follows exactly the same structure to ensure that the 1148 parser is as simple as possible. 1150 Lists of commands are constructed from two kinds of element: 1152 1. Conditions that MUST be true-any failure is treated as a failure 1153 of the update/load/boot 1155 2. Directives that MUST be executed. 1157 Each condition is a command code identifier, followed by Nil. 1159 Each directive is composed of: 1161 1. A command code identifier 1163 2. An argument block or Nil 1165 Argument blocks are defined for each type of directive. 1167 Many conditions and directives apply to a given component, and these 1168 generally grouped together. Therefore, a special command to set the 1169 current component index is provided with a matching command to set 1170 the current dependency index. This index is a numeric index into the 1171 component ID tables defined at the beginning of the document. For 1172 the purpose of setting the index, the two component ID tables are 1173 considered to be concatenated together. 1175 To facilitate optional conditions, a special directive is provided. 1176 It runs several new lists of conditions/directives, one after 1177 another, that are contained as an argument to the directive. By 1178 default, it assumes that a failure of a condition should not indicate 1179 a failure of the update/boot, but a parameter is provided to override 1180 this behavior. 1182 9.8.1. suit-common 1184 suit-common encodes all the information that is shared between each 1185 of the command sequences, including: suit-dependencies, suit- 1186 components, suit-dependency-components, and suit-common-sequence. 1187 suit-common is REQUIRED to implement. 1189 suit-dependencies is a list of SUIT_Dependency blocks that specify 1190 manifests that must be present before the current manifest can be 1191 processed. suit-dependencies is OPTIONAL to implement. 1193 In order to distinguish between components that are affected by the 1194 current manifest and components that are affected by a dependency, 1195 they are kept in separate lists. Components affected by the current 1196 manifest only list the component identifier. Components affected by 1197 a dependency include the component identifier and the index of the 1198 dependency that defines the component. 1200 suit-components is a list of SUIT_Component blocks that specify the 1201 component identifiers that will be affected by the content of the 1202 current manifest. suit-components is OPTIONAL to implement, but at 1203 least one manifest MUST contain a suit-components block. 1205 suit-dependency-components is a list of SUIT_Component_Reference 1206 blocks that specify component identifiers that will be affected by 1207 the content of a dependency of the current manifest. suit-dependency- 1208 components is OPTIONAL to implement. 1210 suit-common-sequence is a SUIT_Command_Sequence to execute prior to 1211 executing any other command sequence. Typical actions in suit- 1212 common-sequence include setting expected device identity and image 1213 digests when they are conditional (see Section 12 for more 1214 information on conditional sequences). suit-common-sequence is 1215 RECOMMENDED to implement. 1217 9.8.2. SUIT_Parameters 1219 Many conditions and directives require additional information. That 1220 information is contained within parameters that can be set in a 1221 consistent way. This allows reduction of manifest size and 1222 replacement of parameters from one manifest to the next. 1224 The defined manifest parameters are described below. 1226 +----------------+----------------------------------+---------------+ 1227 | Name | CDDL Structure | Reference | 1228 +----------------+----------------------------------+---------------+ 1229 | Vendor ID | suit-parameter-vendor-identifier | Section | 1230 | | | 9.8.2.1 | 1231 | | | | 1232 | Class ID | suit-parameter-class-identifier | Section | 1233 | | | 9.8.2.2 | 1234 | | | | 1235 | Image Digest | suit-parameter-image-digest | Section | 1236 | | | 9.8.2.3 | 1237 | | | | 1238 | Image Size | suit-parameter-image-size | Section | 1239 | | | 9.8.2.4 | 1240 | | | | 1241 | Use Before | suit-parameter-use-before | Section | 1242 | | | 9.8.2.5 | 1243 | | | | 1244 | Component | suit-parameter-component-offset | Section | 1245 | Offset | | 9.8.2.6 | 1246 | | | | 1247 | Encryption | suit-parameter-encryption-info | Section | 1248 | Info | | 9.8.2.7 | 1249 | | | | 1250 | Compression | suit-parameter-compression-info | Section | 1251 | Info | | 9.8.2.8 | 1252 | | | | 1253 | Unpack Info | suit-parameter-unpack-info | Section | 1254 | | | 9.8.2.9 | 1255 | | | | 1256 | URI | suit-parameter-uri | Section | 1257 | | | 9.8.2.10 | 1258 | | | | 1259 | Source | suit-parameter-source-component | Section | 1260 | Component | | 9.8.2.11 | 1261 | | | | 1262 | Run Args | suit-parameter-run-args | Section | 1263 | | | 9.8.2.12 | 1264 | | | | 1265 | Device ID | suit-parameter-device-identifier | Section | 1266 | | | 9.8.2.13 | 1267 | | | | 1268 | Minimum | suit-parameter-minimum-battery | Section | 1269 | Battery | | 9.8.2.14 | 1270 | | | | 1271 | Update | suit-parameter-update-priority | Section | 1272 | Priority | | 9.8.2.15 | 1273 | | | | 1274 | Version | suit-parameter-version | Section | 1275 | | | 9.8.2.16 | 1276 | | | | 1277 | Wait Info | suit-parameter-wait-info | Section | 1278 | | | 9.8.2.17 | 1279 | | | | 1280 | URI List | suit-parameter-uri-list | Section | 1281 | | | 9.8.2.18 | 1282 | | | | 1283 | Strict Order | suit-parameter-strict-order | Section | 1284 | | | 9.8.2.19 | 1285 | | | | 1286 | Soft Failure | suit-parameter-soft-failure | Section | 1287 | | | 9.8.2.20 | 1288 | | | | 1289 | Custom | suit-parameter-custom | Section | 1290 | | | 9.8.2.21 | 1291 +----------------+----------------------------------+---------------+ 1293 CBOR-encoded object parameters are still wrapped in a bstr. This is 1294 because it allows a parser that is aggregating parameters to 1295 reference the object with a single pointer and traverse it without 1296 understanding the contents. This is important for modularization and 1297 division of responsibility within a pull parser. The same 1298 consideration does not apply to Directives because those elements are 1299 invoked with their arguments immediately 1301 9.8.2.1. suit-parameter-vendor-identifier 1303 A RFC 4122 UUID representing the vendor of the device or component. 1305 9.8.2.2. suit-parameter-class-identifier 1307 A RFC 4122 UUID representing the class of the device or component 1309 9.8.2.3. suit-parameter-image-digest 1311 A fingerprint computed over the image itself encoded in the 1312 SUIT_Digest structure. 1314 9.8.2.4. suit-parameter-image-size 1316 The size of the firmware image in bytes. 1318 9.8.2.5. suit-parameter-use-before 1320 An expire date for the use of the manifest encoded as a POSIX 1321 timestamp. 1323 9.8.2.6. suit-parameter-component-offset 1325 This parameter sets the offset in a component. 1327 9.8.2.7. suit-parameter-encryption-info 1329 Encryption Info defines the mechanism that Fetch or Copy should use 1330 to decrypt the data they transfer. SUIT_Parameter_Encryption_Info is 1331 encoded as a COSE_Encrypt_Tagged or a COSE_Encrypt0_Tagged, wrapped 1332 in a bstr. 1334 9.8.2.8. suit-parameter-compression-info 1336 Compression Info defines any information that is required for a 1337 device to perform decompression operations. Typically, this includes 1338 the algorithm identifier. This document defines the use of ZLIB 1339 [RFC1950], Brotli [RFC7932], and ZSTD [I-D.kucherawy-rfc8478bis]. 1341 Additional compression formats can be registered through the IANA- 1342 maintained registry. 1344 9.8.2.9. suit-parameter-unpack-info 1346 SUIT_Unpack_Info defines the information required for a device to 1347 interpret a packed format. This document defines the use of the 1348 following binary encodings: Intel HEX [HEX], Motorola S-record 1349 [SREC], Executable and Linkable Format (ELF) [ELF], and Common Object 1350 File Format (COFF) [COFF]. 1352 Additional packing formats can be registered through the IANA- 1353 maintained registry. 1355 9.8.2.10. suit-parameter-uri 1357 A URI from which to fetch a resource. 1359 9.8.2.11. suit-parameter-source-component 1361 This parameter sets the source component. 1363 9.8.2.12. suit-parameter-run-args 1365 This parameter contains an encoded set of arguments for Run. 1367 9.8.2.13. suit-parameter-device-identifier 1369 A RFC 4122 UUID representing the device or component. 1371 9.8.2.14. suit-parameter-minimum-battery 1373 This parameter sets the minimum battery level in mWh. 1375 9.8.2.15. suit-parameter-update-priority 1377 This parameter sets the priority of the update. 1379 9.8.2.16. suit-parameter-version 1381 Allows to indicate the version numbers of firmware to which the 1382 manifest applies, either with a list or with range matching. 1384 9.8.2.17. suit-parameter-wait-info 1386 suit-directive-wait Section 9.8.4.11 directs the manifest processor 1387 to pause until a specified event occurs. The suit-parameter-wait- 1388 info encodes the parameters needed for the directive. 1390 9.8.2.18. suit-parameter-uri-list 1392 Indicates a list of URIs from which to fetch a resource. 1394 9.8.2.19. suit-parameter-strict-order 1396 The Strict Order Parameter allows a manifest to govern when 1397 directives can be executed out-of-order. This allows for systems 1398 that have a sensitivity to order of updates to choose the order in 1399 which they are executed. It also allows for more advanced systems to 1400 parallelize their handling of updates. Strict Order defaults to 1401 True. It MAY be set to False when the order of operations does not 1402 matter. When arriving at the end of a command sequence, ALL commands 1403 MUST have completed, regardless of the state of 1404 SUIT_Parameter_Strict_Order. If SUIT_Parameter_Strict_Order is 1405 returned to True, ALL preceding commands MUST complete before the 1406 next command is executed. 1408 9.8.2.20. suit-parameter-soft-failure 1410 When executing a command sequence inside SUIT_Directive_Try_Each and 1411 a condition failure occurs, the manifest processor aborts the 1412 sequence. If Soft Failure is True, it returns Success. Otherwise, 1413 it returns the original condition failure. 1414 SUIT_Parameter_Soft_Failure is scoped to the enclosing 1415 SUIT_Command_Sequence. Its value is discarded when 1416 SUIT_Command_Sequence terminates. 1418 9.8.2.21. suit-parameter-custom 1420 This parameter is an extension point for any proprietary, application 1421 specific conditions and directives. 1423 9.8.3. SUIT_Condition 1425 Conditions are used to define mandatory properties of a system in 1426 order for an update to be applied. They can be pre-conditions or 1427 post-conditions of any directive or series of directives, depending 1428 on where they are placed in the list. Conditions never take 1429 arguments; conditions should test using parameters instead. 1430 Conditions include: 1432 +----------------+----------------------------------+---------------+ 1433 | Name | CDDL Structure | Reference | 1434 +----------------+----------------------------------+---------------+ 1435 | Vendor | suit-condition-vendor-identifier | Section | 1436 | Identifier | | 9.8.3.1 | 1437 | | | | 1438 | Class | suit-condition-class-identifier | Section | 1439 | Identifier | | 9.8.3.1 | 1440 | | | | 1441 | Device | suit-condition-device-identifier | Section | 1442 | Identifier | | 9.8.3.1 | 1443 | | | | 1444 | Image Match | suit-condition-image-match | Section | 1445 | | | 9.8.3.2 | 1446 | | | | 1447 | Image Not | suit-condition-image-not-match | Section | 1448 | Match | | 9.8.3.3 | 1449 | | | | 1450 | Use Before | suit-condition-use-before | Section | 1451 | | | 9.8.3.4 | 1452 | | | | 1453 | Component | suit-condition-component-offset | Section | 1454 | Offset | | 9.8.3.5 | 1455 | | | | 1456 | Minimum | suit-condition-minimum-battery | Section | 1457 | Battery | | 9.8.3.6 | 1458 | | | | 1459 | Update | suit-condition-update-authorized | Section | 1460 | Authorized | | 9.8.3.7 | 1461 | | | | 1462 | Version | suit-condition-version | Section | 1463 | | | 9.8.3.8 | 1464 | | | | 1465 | Custom | SUIT_Condition_Custom | Section | 1466 | Condition | | 9.8.3.9 | 1467 +----------------+----------------------------------+---------------+ 1469 Each condition MUST report a result code on completion. If a 1470 condition reports failure, then the current sequence of commands MUST 1471 terminate. If a condition requires additional information, this MUST 1472 be specified in one or more parameters before the condition is 1473 executed. If a Recipient attempts to process a condition that 1474 expects additional information and that information has not been set, 1475 it MUST report a failure. If a Recipient encounters an unknown 1476 condition, it MUST report a failure. 1478 Condition labels in the positive number range are reserved for IANA 1479 registration while those in the negative range are custom conditions 1480 reserved for proprietary use. 1482 Several conditions use identifiers to determine whether a manifest 1483 matches a given Recipient or not. These identifiers are defined to 1484 be RFC 4122 [RFC4122] UUIDs. These UUIDs are not human-readable and 1485 are therefore used for machine-based processing only. 1487 A device may match any number of UUIDs for vendor or class 1488 identifier. This may be relevant to physical or software modules. 1489 For example, a device that has an OS and one or more applications 1490 might list one Vendor ID for the OS and one or more additional Vendor 1491 IDs for the applications. This device might also have a Class ID 1492 that must be matched for the OS and one or more Class IDs for the 1493 applications. 1495 A more complete example: Imagine a device has the following physical 1496 components: 1. A host MCU 2. A WiFi module 1498 This same device has three software modules: 1. An operating system 1499 2. A WiFi module interface driver 3. An application 1501 Suppose that the WiFi module's firmware has a proprietary update 1502 mechanism and doesn't support manifest processing. This device can 1503 report four class IDs: 1505 1. hardware model/revision 1507 2. OS 1509 3. WiFi module model/revision 1511 4. Application 1513 This allows the OS, WiFi module, and application to be updated 1514 independently. To combat possible incompatibilities, the OS class ID 1515 can be changed each time the OS has a change to its API. 1517 This approach allows a vendor to target, for example, all devices 1518 with a particular WiFi module with an update, which is a very 1519 powerful mechanism, particularly when used for security updates. 1521 UUIDs MUST be created according to RFC 4122 [RFC4122]. UUIDs SHOULD 1522 use versions 3, 4, or 5, as described in RFC4122. Versions 1 and 2 1523 do not provide a tangible benefit over version 4 for this 1524 application. 1526 The RECOMMENDED method to create a vendor ID is: Vendor ID = 1527 UUID5(DNS_PREFIX, vendor domain name) 1529 The RECOMMENDED method to create a class ID is: Class ID = 1530 UUID5(Vendor ID, Class-Specific-Information) 1532 Class-specific information is composed of a variety of data, for 1533 example: 1535 - Model number. 1537 - Hardware revision. 1539 - Bootloader version (for immutable bootloaders). 1541 9.8.3.1. suit-condition-vendor-identifier, suit-condition-class- 1542 identifier, and suit-condition-device-identifier 1544 There are three identifier-based conditions: suit-condition-vendor- 1545 identifier, suit-condition-class-identifier, and suit-condition- 1546 device-identifier. Each of these conditions match a RFC 4122 1547 [RFC4122] UUID that MUST have already been set as a parameter. The 1548 installing device MUST match the specified UUID in order to consider 1549 the manifest valid. These identifiers MAY be scoped by component. 1551 The Recipient uses the ID parameter that has already been set using 1552 the Set Parameters directive. If no ID has been set, this condition 1553 fails. suit-condition-class-identifier and suit-condition-vendor- 1554 identifier are REQUIRED to implement. suit-condition-device- 1555 identifier is OPTIONAL to implement. 1557 9.8.3.2. suit-condition-image-match 1559 Verify that the current component matches the digest parameter for 1560 the current component. The digest is verified against the digest 1561 specified in the Component's parameters list. If no digest is 1562 specified, the condition fails. suit-condition-image-match is 1563 REQUIRED to implement. 1565 9.8.3.3. suit-condition-image-not-match 1567 Verify that the current component does not match the supplied digest. 1568 If no digest is specified, then the digest is compared against the 1569 digest specified in the Component's parameters list. If no digest is 1570 specified, the condition fails. suit-condition-image-not-match is 1571 OPTIONAL to implement. 1573 9.8.3.4. suit-condition-use-before 1575 Verify that the current time is BEFORE the specified time. suit- 1576 condition-use-before is used to specify the last time at which an 1577 update should be installed. The recipient evaluates the current time 1578 against the suit-parameter-use-before parameter, which must have 1579 already been set as a parameter, encoded as a POSIX timestamp, that 1580 is seconds after 1970-01-01 00:00:00. Timestamp conditions MUST be 1581 evaluated in 64 bits, regardless of encoded CBOR size. suit- 1582 condition-use-before is OPTIONAL to implement. 1584 9.8.3.5. suit-condition-component-offset 1586 TBD. 1588 9.8.3.6. suit-condition-minimum-battery 1590 suit-condition-minimum-battery provides a mechanism to test a 1591 device's battery level before installing an update. This condition 1592 is for use in primary-cell applications, where the battery is only 1593 ever discharged. For batteries that are charged, suit-directive-wait 1594 is more appropriate, since it defines a "wait" until the battery 1595 level is sufficient to install the update. suit-condition-minimum- 1596 battery is specified in mWh. suit-condition-minimum-battery is 1597 OPTIONAL to implement. 1599 9.8.3.7. suit-condition-update-authorized 1601 Request Authorization from the application and fail if not 1602 authorized. This can allow a user to decline an update. Argument is 1603 an integer priority level. Priorities are application defined. suit- 1604 condition-update-authorized is OPTIONAL to implement. 1606 9.8.3.8. suit-condition-version 1608 suit-condition-version allows comparing versions of firmware. 1609 Verifying image digests is preferred to version checks because 1610 digests are more precise. The image can be compared as: 1612 - Greater. 1614 - Greater or Equal. 1616 - Equal. 1618 - Lesser or Equal. 1620 - Lesser. 1622 Versions are encoded as a CBOR list of integers. Comparisons are 1623 done on each integer in sequence. Comparison stops after all 1624 integers in the list defined by the manifest have been consumed OR 1625 after a non-equal match has occurred. For example, if the manifest 1626 defines a comparison, "Equal [1]", then this will match all version 1627 sequences starting with 1. If a manifest defines both "Greater or 1628 Equal [1,0]" and "Lesser [1,10]", then it will match versions 1.0.x 1629 up to, but not including 1.10. 1631 While the exact encoding of versions is application-defined, semantic 1632 versions map conveniently. For example, 1634 - 1.2.3 = [1,2,3]. 1636 - 1.2-rc3 = [1,2,-1,3]. 1638 - 1.2-beta = [1,2,-2]. 1640 - 1.2-alpha = [1,2,-3]. 1642 - 1.2-alpha4 = [1,2,-3,4]. 1644 suit-condition-version is OPTIONAL to implement. 1646 9.8.3.9. SUIT_Condition_Custom 1648 SUIT_Condition_Custom describes any proprietary, application specific 1649 condition. This is encoded as a negative integer, chosen by the 1650 firmware developer. If additional information must be provided to 1651 the condition, it should be encoded in a custom parameter (a nint) as 1652 described in Section 9.8.2. SUIT_Condition_Custom is OPTIONAL to 1653 implement. 1655 9.8.4. SUIT_Directive 1657 Directives are used to define the behavior of the recipient. 1658 Directives include: 1660 +---------------+-------------------------------------+-------------+ 1661 | Name | CDDL Structure | Reference | 1662 +---------------+-------------------------------------+-------------+ 1663 | Set Component | suit-directive-set-component-index | Section | 1664 | Index | | 9.8.4.1 | 1665 | | | | 1666 | Set | suit-directive-set-dependency-index | Section | 1667 | Dependency | | 9.8.4.2 | 1668 | Index | | | 1669 | | | | 1670 | Abort | suit-directive-abort | Section | 1671 | | | 9.8.4.3 | 1672 | | | | 1673 | Try Each | suit-directive-try-each | Section | 1674 | | | 9.8.4.4 | 1675 | | | | 1676 | Process | suit-directive-process-dependency | Section | 1677 | Dependency | | 9.8.4.5 | 1678 | | | | 1679 | Set | suit-directive-set-parameters | Section | 1680 | Parameters | | 9.8.4.6 | 1681 | | | | 1682 | Override | suit-directive-override-parameters | Section | 1683 | Parameters | | 9.8.4.7 | 1684 | | | | 1685 | Fetch | suit-directive-fetch | Section | 1686 | | | 9.8.4.8 | 1687 | | | | 1688 | Copy | suit-directive-copy | Section | 1689 | | | 9.8.4.9 | 1690 | | | | 1691 | Run | suit-directive-run | Section | 1692 | | | 9.8.4.10 | 1693 | | | | 1694 | Wait For | suit-directive-wait | Section | 1695 | Event | | 9.8.4.11 | 1696 | | | | 1697 | Run Sequence | suit-directive-run-sequence | Section | 1698 | | | 9.8.4.12 | 1699 | | | | 1700 | Swap | suit-directive-swap | Section | 1701 | | | 9.8.4.13 | 1702 +---------------+-------------------------------------+-------------+ 1704 When a Recipient executes a Directive, it MUST report a result code. 1705 If the Directive reports failure, then the current Command Sequence 1706 MUST terminate. 1708 9.8.4.1. suit-directive-set-component-index 1710 Set Component Index defines the component to which successive 1711 directives and conditions will apply. The supplied argument MUST be 1712 either a boolean or an unsigned integer index into the concatenation 1713 of suit-components and suit-dependency-components. If the following 1714 directives apply to ALL components, then the boolean value "True" is 1715 used instead of an index. True does not apply to dependency 1716 components. If the following directives apply to NO components, then 1717 the boolean value "False" is used. When suit-directive-set- 1718 dependency-index is used, suit-directive-set-component-index = False 1719 is implied. When suit-directive-set-component-index is used, suit- 1720 directive-set-dependency-index = False is implied. 1722 9.8.4.2. suit-directive-set-dependency-index 1724 Set Dependency Index defines the manifest to which successive 1725 directives and conditions will apply. The supplied argument MUST be 1726 either a boolean or an unsigned integer index into the dependencies. 1727 If the following directives apply to ALL dependencies, then the 1728 boolean value "True" is used instead of an index. If the following 1729 directives apply to NO dependencies, then the boolean value "False" 1730 is used. When suit-directive-set-component-index is used, suit- 1731 directive-set-dependency-index = False is implied. When suit- 1732 directive-set-dependency-index is used, suit-directive-set-component- 1733 index = False is implied. 1735 Typical operations that require suit-directive-set-dependency-index 1736 include setting a source URI, invoking "Fetch," or invoking "Process 1737 Dependency" for an individual dependency. 1739 9.8.4.3. suit-directive-abort 1741 Unconditionally fail. This operation is typically used in 1742 conjunction with suit-directive-try-each. 1744 9.8.4.4. suit-directive-try-each 1746 This command runs several SUIT_Command_Sequence, one after another, 1747 in a strict order. Use this command to implement a "try/catch-try/ 1748 catch" sequence. Manifest processors MAY implement this command. 1750 SUIT_Parameter_Soft_Failure is initialized to True at the beginning 1751 of each sequence. If one sequence aborts due to a condition failure, 1752 the next is started. If no sequence completes without condition 1753 failure, then suit-directive-try-each returns an error. If a 1754 particular application calls for all sequences to fail and still 1755 continue, then an empty sequence (nil) can be added to the Try Each 1756 Argument. 1758 9.8.4.5. suit-directive-process-dependency 1760 Execute the commands in the common section of the current dependency, 1761 followed by the commands in the equivalent section of the current 1762 dependency. For example, if the current section is "fetch payload," 1763 this will execute "common" in the current dependency, then "fetch 1764 payload" in the current dependency. Once this is complete, the 1765 command following suit-directive-process-dependency will be 1766 processed. 1768 If the current dependency is False, this directive has no effect. If 1769 the current dependency is True, then this directive applies to all 1770 dependencies. If the current section is "common," this directive 1771 MUST have no effect. 1773 When SUIT_Process_Dependency completes, it forwards the last status 1774 code that occurred in the dependency. 1776 9.8.4.6. suit-directive-set-parameters 1778 suit-directive-set-parameters allows the manifest to configure 1779 behavior of future directives by changing parameters that are read by 1780 those directives. When dependencies are used, suit-directive-set- 1781 parameters also allows a manifest to modify the behavior of its 1782 dependencies. 1784 Available parameters are defined in Section 9.8.2. 1786 If a parameter is already set, suit-directive-set-parameters will 1787 skip setting the parameter to its argument. This provides the core 1788 of the override mechanism, allowing dependent manifests to change the 1789 behavior of a manifest. 1791 9.8.4.7. suit-directive-override-parameters 1793 suit-directive-override-parameters replaces any listed parameters 1794 that are already set with the values that are provided in its 1795 argument. This allows a manifest to prevent replacement of critical 1796 parameters. 1798 Available parameters are defined in Section 9.8.2. 1800 9.8.4.8. suit-directive-fetch 1802 suit-directive-fetch instructs the manifest processor to obtain one 1803 or more manifests or payloads, as specified by the manifest index and 1804 component index, respectively. 1806 suit-directive-fetch can target one or more manifests and one or more 1807 payloads. suit-directive-fetch retrieves each component and each 1808 manifest listed in component-index and manifest-index, respectively. 1809 If component-index or manifest-index is True, instead of an integer, 1810 then all current manifest components/manifests are fetched. The 1811 current manifest's dependent-components are not automatically 1812 fetched. In order to pre-fetch these, they MUST be specified in a 1813 component-index integer. 1815 suit-directive-fetch typically takes no arguments unless one is 1816 needed to modify fetch behavior. If an argument is needed, it must 1817 be wrapped in a bstr. 1819 suit-directive-fetch reads the URI or URI List parameter to find the 1820 source of the fetch it performs. 1822 The behavior of suit-directive-fetch can be modified by setting one 1823 or more of SUIT_Parameter_Encryption_Info, 1824 SUIT_Parameter_Compression_Info, SUIT_Parameter_Unpack_Info. These 1825 three parameters each activate and configure a processing step that 1826 can be applied to the data that is transferred during suit-directive- 1827 fetch. 1829 9.8.4.9. suit-directive-copy 1831 suit-directive-copy instructs the manifest processor to obtain one or 1832 more payloads, as specified by the component index. suit-directive- 1833 copy retrieves each component listed in component-index, 1834 respectively. If component-index is True, instead of an integer, 1835 then all current manifest components are copied. The current 1836 manifest's dependent-components are not automatically copied. In 1837 order to copy these, they MUST be specified in a component-index 1838 integer. 1840 The behavior of suit-directive-copy can be modified by setting one or 1841 more of SUIT_Parameter_Encryption_Info, 1842 SUIT_Parameter_Compression_Info, SUIT_Parameter_Unpack_Info. These 1843 three parameters each activate and configure a processing step that 1844 can be applied to the data that is transferred during suit-directive- 1845 copy. 1847 *N.B.* Fetch and Copy are very similar. Merging them into one 1848 command may be appropriate. 1850 suit-directive-copy reads its source from 1851 SUIT_Parameter_Source_Component. 1853 9.8.4.10. suit-directive-run 1855 suit-directive-run directs the manifest processor to transfer 1856 execution to the current Component Index. When this is invoked, the 1857 manifest processor MAY be unloaded and execution continues in the 1858 Component Index. Arguments provided to Run are forwarded to the 1859 executable code located in Component Index, in an application- 1860 specific way. For example, this could form the Linux Kernel Command 1861 Line if booting a Linux device. 1863 If the executable code at Component Index is constructed in such a 1864 way that it does not unload the manifest processor, then the manifest 1865 processor may resume execution after the executable completes. This 1866 allows the manifest processor to invoke suitable helpers and to 1867 verify them with image conditions. 1869 9.8.4.11. suit-directive-wait 1871 suit-directive-wait directs the manifest processor to pause until a 1872 specified event occurs. Some possible events include: 1874 1. Authorization 1876 2. External Power 1878 3. Network availability 1880 4. Other Device Firmware Version 1882 5. Time 1884 6. Time of Day 1886 7. Day of Week 1888 9.8.4.12. suit-directive-run-sequence 1890 To enable conditional commands, and to allow several strictly ordered 1891 sequences to be executed out-of-order, suit-directive-run-sequence 1892 allows the manifest processor to execute its argument as a 1893 SUIT_Command_Sequence. The argument must be wrapped in a bstr. 1895 When a sequence is executed, any failure of a condition causes 1896 immediate termination of the sequence. 1898 When suit-directive-run-sequence completes, it forwards the last 1899 status code that occurred in the sequence. If the Soft Failure 1900 parameter is true, then suit-directive-run-sequence only fails when a 1901 directive in the argument sequence fails. 1903 SUIT_Parameter_Soft_Failure defaults to False when suit-directive- 1904 run-sequence begins. Its value is discarded when suit-directive-run- 1905 sequence terminates. 1907 9.8.4.13. suit-directive-swap 1909 suit-directive-swap instructs the manifest processor to move the 1910 source to the destination and the destination to the source 1911 simultaneously. Swap has nearly identical semantics to suit- 1912 directive-copy except that suit-directive-swap replaces the source 1913 with the current contents of the destination in an application- 1914 defined way. If SUIT_Parameter_Compression_Info or 1915 SUIT_Parameter_Encryption_Info are present, they must be handled in a 1916 symmetric way, so that the source is decompressed into the 1917 destination and the destination is compressed into the source. The 1918 source is decrypted into the destination and the destination is 1919 encrypted into the source. suit-directive-swap is OPTIONAL to 1920 implement. 1922 10. Access Control Lists 1924 To manage permissions in the manifest, there are three models that 1925 can be used. 1927 First, the simplest model requires that all manifests are 1928 authenticated by a single trusted key. This mode has the advantage 1929 that only a root manifest needs to be authenticated, since all of its 1930 dependencies have digests included in the root manifest. 1932 This simplest model can be extended by adding key delegation without 1933 much increase in complexity. 1935 A second model requires an ACL to be presented to the device, 1936 authenticated by a trusted party or stored on the device. This ACL 1937 grants access rights for specific component IDs or component ID 1938 prefixes to the listed identities or identity groups. Any identity 1939 may verify an image digest, but fetching into or fetching from a 1940 component ID requires approval from the ACL. 1942 A third model allows a device to provide even more fine-grained 1943 controls: The ACL lists the component ID or component ID prefix that 1944 an identity may use, and also lists the commands that the identity 1945 may use in combination with that component ID. 1947 11. SUIT Digest Container 1949 RFC 8152 [RFC8152] provides containers for signature, MAC, and 1950 encryption, but no basic digest container. The container needed for 1951 a digest requires a type identifier and a container for the raw 1952 digest data. Some forms of digest may require additional parameters. 1953 These can be added following the digest. 1955 The algorithms listed are sufficient for verifying integrity of 1956 Firmware Updates as of this writing, however this may change over 1957 time. 1959 12. Creating Conditional Sequences 1961 For some use cases, it is important to provide a sequence that can 1962 fail without terminating an update. For example, a dual-image XIP 1963 MCU may require an update that can be placed at one of two offsets. 1964 This has two implications, first, the digest of each offset will be 1965 different. Second, the image fetched for each offset will have a 1966 different URI. Conditional sequences allow this to be resolved in a 1967 simple way. 1969 The following JSON representation of a manifest demonstrates how this 1970 would be represented. It assumes that the bootloader and manifest 1971 processor take care of A/B switching and that the manifest is not 1972 aware of this distinction. 1974 { 1975 "structure-version" : 1, 1976 "sequence-number" : 7, 1977 "common" :{ 1978 "components" : [ 1979 [b'0'] 1980 ], 1981 "common-sequence" : [ 1982 { 1983 "directive-set-var" : { 1984 "size": 32567 1985 }, 1986 }, 1987 { 1988 "try-each" : [ 1989 [ 1990 {"condition-component-offset" : ""}, 1991 { 1992 "directive-set-var": { 1993 "digest" : "" 1994 } 1995 } 1996 ], 1997 [ 1998 {"condition-component-offset" : ""}, 1999 { 2000 "directive-set-var": { 2001 "digest" : "" 2002 } 2003 } 2004 ], 2005 [{ "abort" : null }] 2006 ] 2007 } 2008 ] 2009 } 2010 "fetch" : [ 2011 { 2012 "try-each" : [ 2013 [ 2014 {"condition-component-offset" : ""}, 2015 { 2016 "directive-set-var": { 2017 "uri" : "" 2018 } 2019 } 2020 ], 2021 [ 2022 {"condition-component-offset" : ""}, 2023 { 2024 "directive-set-var": { 2025 "uri" : "" 2026 } 2027 } 2028 ], 2029 [{ "directive-abort" : null }] 2030 ] 2031 }, 2032 "fetch" : null 2033 ] 2034 } 2036 13. IANA Considerations 2038 IANA is requested to setup a registry for SUIT manifests. Several 2039 registries defined in the subsections below need to be created. 2041 For each registry, values 0-23 are Standards Action, 24-255 are IETF 2042 Review, 256-65535 are Expert Review, and 65536 or greater are First 2043 Come First Served. 2045 Negative values -23 to 0 are Experimental Use, -24 and lower are 2046 Private Use. 2048 13.1. SUIT Directives 2050 +-------+----------------------+ 2051 | Label | Name | 2052 +-------+----------------------+ 2053 | 12 | Set Component Index | 2054 | | | 2055 | 13 | Set Dependency Index | 2056 | | | 2057 | 14 | Abort | 2058 | | | 2059 | 15 | Try Each | 2060 | | | 2061 | 16 | Reserved | 2062 | | | 2063 | 17 | Reserved | 2064 | | | 2065 | 18 | Process Dependency | 2066 | | | 2067 | 19 | Set Parameters | 2068 | | | 2069 | 20 | Override Parameters | 2070 | | | 2071 | 21 | Fetch | 2072 | | | 2073 | 22 | Copy | 2074 | | | 2075 | 23 | Run | 2076 | | | 2077 | 29 | Wait For Event | 2078 | | | 2079 | 30 | Run Sequence | 2080 | | | 2081 | 32 | Swap | 2082 +-------+----------------------+ 2084 13.2. SUIT Conditions 2086 +-------+-------------------+ 2087 | Label | Name | 2088 +-------+-------------------+ 2089 | 1 | Vendor Identifier | 2090 | | | 2091 | 2 | Class Identifier | 2092 | | | 2093 | 24 | Device Identifier | 2094 | | | 2095 | 3 | Image Match | 2096 | | | 2097 | 25 | Image Not Match | 2098 | | | 2099 | 4 | Use Before | 2100 | | | 2101 | 5 | Component Offset | 2102 | | | 2103 | 26 | Minimum Battery | 2104 | | | 2105 | 27 | Update Authorized | 2106 | | | 2107 | 28 | Version | 2108 | | | 2109 | nint | Custom Condition | 2110 +-------+-------------------+ 2112 13.3. SUIT Parameters 2113 +-------+------------------+ 2114 | Label | Name | 2115 +-------+------------------+ 2116 | 1 | Vendor ID | 2117 | | | 2118 | 2 | Class ID | 2119 | | | 2120 | 3 | Image Digest | 2121 | | | 2122 | 4 | Use Before | 2123 | | | 2124 | 5 | Component Offset | 2125 | | | 2126 | 12 | Strict Order | 2127 | | | 2128 | 13 | Soft Failure | 2129 | | | 2130 | 14 | Image Size | 2131 | | | 2132 | 18 | Encryption Info | 2133 | | | 2134 | 19 | Compression Info | 2135 | | | 2136 | 20 | Unpack Info | 2137 | | | 2138 | 21 | URI | 2139 | | | 2140 | 22 | Source Component | 2141 | | | 2142 | 23 | Run Args | 2143 | | | 2144 | 24 | Device ID | 2145 | | | 2146 | 26 | Minimum Battery | 2147 | | | 2148 | 27 | Update Priority | 2149 | | | 2150 | 28 | Version | 2151 | | | 2152 | 29 | Wait Info | 2153 | | | 2154 | 30 | URI List | 2155 | | | 2156 | 31 | Component Index | 2157 | | | 2158 | nint | Custom | 2159 +-------+------------------+ 2161 13.4. SUIT Text Values 2163 +-------+--------------------------------+ 2164 | Label | Name | 2165 +-------+--------------------------------+ 2166 | 1 | Manifest Description | 2167 | | | 2168 | 2 | Update Description | 2169 | | | 2170 | 3 | Vendor Name | 2171 | | | 2172 | 4 | Model Name | 2173 | | | 2174 | 5 | Vendor Domain | 2175 | | | 2176 | 6 | Model Info | 2177 | | | 2178 | 7 | Component Description | 2179 | | | 2180 | 8 | Manifest JSON Source | 2181 | | | 2182 | 9 | Manifest YAML Source | 2183 | | | 2184 | 10 | Component Version Dependencies | 2185 +-------+--------------------------------+ 2187 13.5. SUIT Algorithm Identifiers 2189 13.5.1. Hash Algorithms 2190 +-------+----------+ 2191 | Label | Name | 2192 +-------+----------+ 2193 | 1 | SHA224 | 2194 | | | 2195 | 2 | SHA256 | 2196 | | | 2197 | 3 | SHA384 | 2198 | | | 2199 | 4 | SHA512 | 2200 | | | 2201 | 5 | SHA3-224 | 2202 | | | 2203 | 6 | SHA3-256 | 2204 | | | 2205 | 7 | SHA3-384 | 2206 | | | 2207 | 8 | SHA3-512 | 2208 +-------+----------+ 2210 13.5.2. Unpack Algorithms 2212 +-------+------+ 2213 | Label | Name | 2214 +-------+------+ 2215 | 1 | HEX | 2216 | | | 2217 | 2 | ELF | 2218 | | | 2219 | 3 | COFF | 2220 | | | 2221 | 4 | SREC | 2222 +-------+------+ 2224 14. Security Considerations 2226 This document is about a manifest format describing and protecting 2227 firmware images and as such it is part of a larger solution for 2228 offering a standardized way of delivering firmware updates to IoT 2229 devices. A detailed security treatment can be found in the 2230 architecture [I-D.ietf-suit-architecture] and in the information 2231 model [I-D.ietf-suit-information-model] documents. 2233 15. Acknowledgements 2235 We would like to thank the following persons for their support in 2236 designing this mechanism: 2238 - Milosch Meriac 2240 - Geraint Luff 2242 - Dan Ros 2244 - John-Paul Stanford 2246 - Hugo Vincent 2248 - Carsten Bormann 2250 - Oeyvind Roenningstad 2252 - Frank Audun Kvamtroe 2254 - Krzysztof Chruściński 2256 - Andrzej Puzdrowski 2258 - Michael Richardson 2260 - David Brown 2262 - Emmanuel Baccelli 2264 16. References 2266 16.1. Normative References 2268 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2269 Requirement Levels", BCP 14, RFC 2119, 2270 DOI 10.17487/RFC2119, March 1997, 2271 . 2273 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 2274 Unique IDentifier (UUID) URN Namespace", RFC 4122, 2275 DOI 10.17487/RFC4122, July 2005, 2276 . 2278 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2279 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2280 . 2282 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2283 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2284 May 2017, . 2286 16.2. Informative References 2288 [COFF] Wikipedia, ., "Common Object File Format (COFF)", 2020, 2289 . 2291 [ELF] Wikipedia, ., "Executable and Linkable Format (ELF)", 2292 2020, . 2295 [HEX] Wikipedia, ., "Intel HEX", 2020, 2296 . 2298 [I-D.ietf-suit-architecture] 2299 Moran, B., Tschofenig, H., Brown, D., and M. Meriac, "A 2300 Firmware Update Architecture for Internet of Things", 2301 draft-ietf-suit-architecture-11 (work in progress), May 2302 2020. 2304 [I-D.ietf-suit-information-model] 2305 Moran, B., Tschofenig, H., and H. Birkholz, "An 2306 Information Model for Firmware Updates in IoT Devices", 2307 draft-ietf-suit-information-model-07 (work in progress), 2308 June 2020. 2310 [I-D.ietf-teep-architecture] 2311 Pei, M., Tschofenig, H., Thaler, D., and D. Wheeler, 2312 "Trusted Execution Environment Provisioning (TEEP) 2313 Architecture", draft-ietf-teep-architecture-08 (work in 2314 progress), April 2020. 2316 [I-D.kucherawy-rfc8478bis] 2317 Collet, Y. and M. Kucherawy, "Zstandard Compression and 2318 the application/zstd Media Type", draft-kucherawy- 2319 rfc8478bis-05 (work in progress), April 2020. 2321 [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format 2322 Specification version 3.3", RFC 1950, 2323 DOI 10.17487/RFC1950, May 1996, 2324 . 2326 [RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data 2327 Format", RFC 7932, DOI 10.17487/RFC7932, July 2016, 2328 . 2330 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2331 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2332 May 2018, . 2334 [SREC] Wikipedia, ., "SREC (file format)", 2020, 2335 . 2337 A. Full CDDL 2339 In order to create a valid SUIT Manifest document the structure of 2340 the corresponding CBOR message MUST adhere to the following CDDL data 2341 definition. 2343 SUIT_Envelope = { 2344 ? suit-delegation => bstr .cbor SUIT_Delegation 2345 ? suit-authentication-wrapper 2346 => bstr .cbor SUIT_Authentication_Wrapper / nil, 2347 $$SUIT_Manifest_Wrapped, 2348 * $$SUIT_Severed_Fields, 2349 } 2351 SUIT_Delegation = [ + [ + CWT ] ] 2353 CWT = SUIT_Authentication_Block 2355 SUIT_Authentication_Wrapper = [ + bstr .cbor SUIT_Authentication_Block ] 2357 SUIT_Authentication_Block /= COSE_Mac_Tagged 2358 SUIT_Authentication_Block /= COSE_Sign_Tagged 2359 SUIT_Authentication_Block /= COSE_Mac0_Tagged 2360 SUIT_Authentication_Block /= COSE_Sign1_Tagged 2362 $$SUIT_Manifest_Wrapped //= (suit-manifest => bstr .cbor SUIT_Manifest) 2363 $$SUIT_Manifest_Wrapped //= ( 2364 suit-manifest-encryption-info => bstr .cbor SUIT_Encryption_Wrapper, 2365 suit-manifest-encrypted => bstr 2366 ) 2368 SUIT_Encryption_Wrapper = COSE_Encrypt_Tagged / COSE_Encrypt0_Tagged 2370 $$SUIT_Severed_Fields //= ( suit-dependency-resolution => 2371 bstr .cbor SUIT_Command_Sequence) 2372 $$SUIT_Severed_Fields //= (suit-payload-fetch => 2373 bstr .cbor SUIT_Command_Sequence) 2374 $$SUIT_Severed_Fields //= (suit-install => 2375 bstr .cbor SUIT_Command_Sequence) 2376 $$SUIT_Severed_Fields //= (suit-text => 2377 bstr .cbor SUIT_Text_Map) 2378 $$SUIT_Severed_Fields //= (suit-coswid => 2379 bstr .cbor concise-software-identity) 2381 COSE_Mac_Tagged = any 2382 COSE_Sign_Tagged = any 2383 COSE_Mac0_Tagged = any 2384 COSE_Sign1_Tagged = any 2385 COSE_Encrypt_Tagged = any 2386 COSE_Encrypt0_Tagged = any 2388 SUIT_Digest = [ 2389 suit-digest-algorithm-id : suit-digest-algorithm-ids, 2390 suit-digest-bytes : bstr, 2391 ? suit-digest-parameters : any 2392 ] 2394 ; Named Information Hash Algorithm Identifiers 2395 suit-digest-algorithm-ids /= algorithm-id-sha224 2396 suit-digest-algorithm-ids /= algorithm-id-sha256 2397 suit-digest-algorithm-ids /= algorithm-id-sha384 2398 suit-digest-algorithm-ids /= algorithm-id-sha512 2399 suit-digest-algorithm-ids /= algorithm-id-sha3-224 2400 suit-digest-algorithm-ids /= algorithm-id-sha3-256 2401 suit-digest-algorithm-ids /= algorithm-id-sha3-384 2402 suit-digest-algorithm-ids /= algorithm-id-sha3-512 2404 algorithm-id-sha224 = 1 2405 algorithm-id-sha256 = 2 2406 algorithm-id-sha384 = 3 2407 algorithm-id-sha512 = 4 2408 algorithm-id-sha3-224 = 5 2409 algorithm-id-sha3-256 = 6 2410 algorithm-id-sha3-384 = 7 2411 algorithm-id-sha3-512 = 8 2413 SUIT_Manifest = { 2414 suit-manifest-version => 1, 2415 suit-manifest-sequence-number => uint, 2416 suit-common => bstr .cbor SUIT_Common, 2417 ? suit-reference-uri => #6.32(tstr), 2418 * $$SUIT_Severable_Command_Sequences, 2419 * $$SUIT_Command_Sequences, 2420 * $$SUIT_Protected_Elements, 2421 } 2423 $$SUIT_Severable_Command_Sequences //= (suit-dependency-resolution => 2424 SUIT_Severable_Command_Sequence) 2425 $$SUIT_Severable_Command_Sequences //= (suit-payload-fetch => 2426 SUIT_Severable_Command_Sequence) 2427 $$SUIT_Severable_Command_Sequences //= (suit-install => 2428 SUIT_Severable_Command_Sequence) 2430 SUIT_Severable_Command_Sequence = 2431 SUIT_Digest / bstr .cbor SUIT_Command_Sequence 2433 $$SUIT_Command_Sequences //= ( suit-validate => 2434 bstr .cbor SUIT_Command_Sequence ) 2435 $$SUIT_Command_Sequences //= ( suit-load => 2436 bstr .cbor SUIT_Command_Sequence ) 2437 $$SUIT_Command_Sequences //= ( suit-run => 2438 bstr .cbor SUIT_Command_Sequence ) 2440 $$SUIT_Protected_Elements //= ( suit-text => SUIT_Digest ) 2441 $$SUIT_Protected_Elements //= ( suit-coswid => SUIT_Digest ) 2443 SUIT_Common = { 2444 ? suit-dependencies => bstr .cbor SUIT_Dependencies, 2445 ? suit-components => bstr .cbor SUIT_Components, 2446 ? suit-dependency-components 2447 => bstr .cbor SUIT_Component_References, 2448 ? suit-common-sequence => bstr .cbor SUIT_Command_Sequence, 2449 } 2451 SUIT_Dependencies = [ + SUIT_Dependency ] 2452 SUIT_Components = [ + SUIT_Component_Identifier ] 2453 SUIT_Component_References = [ + SUIT_Component_Reference ] 2455 concise-software-identity = any 2457 SUIT_Dependency = { 2458 suit-dependency-digest => SUIT_Digest, 2459 suit-dependency-prefix => SUIT_Component_Identifier, 2460 } 2462 SUIT_Component_Identifier = [* bstr] 2464 SUIT_Component_Reference = { 2465 suit-component-identifier => SUIT_Component_Identifier, 2466 suit-component-dependency-index => uint 2467 } 2469 SUIT_Command_Sequence = [ + ( 2470 SUIT_Condition // SUIT_Directive // SUIT_Command_Custom 2471 ) ] 2473 SUIT_Command_Custom = (suit-command-custom, bstr/tstr/int/nil) 2474 SUIT_Condition //= (suit-condition-vendor-identifier, nil) 2475 SUIT_Condition //= (suit-condition-class-identifier, nil) 2476 SUIT_Condition //= (suit-condition-device-identifier, nil) 2477 SUIT_Condition //= (suit-condition-image-match, nil) 2478 SUIT_Condition //= (suit-condition-image-not-match, nil) 2479 SUIT_Condition //= (suit-condition-use-before, nil) 2480 SUIT_Condition //= (suit-condition-minimum-battery, nil) 2481 SUIT_Condition //= (suit-condition-update-authorized, nil) 2482 SUIT_Condition //= (suit-condition-version, nil) 2483 SUIT_Condition //= (suit-condition-component-offset, nil) 2485 SUIT_Directive //= (suit-directive-set-component-index, uint/bool) 2486 SUIT_Directive //= (suit-directive-set-dependency-index, uint/bool) 2487 SUIT_Directive //= (suit-directive-run-sequence, 2488 bstr .cbor SUIT_Command_Sequence) 2489 SUIT_Directive //= (suit-directive-try-each, 2490 SUIT_Directive_Try_Each_Argument) 2491 SUIT_Directive //= (suit-directive-process-dependency, nil) 2492 SUIT_Directive //= (suit-directive-set-parameters, 2493 {+ SUIT_Parameters}) 2494 SUIT_Directive //= (suit-directive-override-parameters, 2495 {+ SUIT_Parameters}) 2496 SUIT_Directive //= (suit-directive-fetch, nil) 2497 SUIT_Directive //= (suit-directive-copy, nil) 2498 SUIT_Directive //= (suit-directive-swap, nil) 2499 SUIT_Directive //= (suit-directive-run, nil) 2500 SUIT_Directive //= (suit-directive-wait, nil) 2501 SUIT_Directive //= (suit-directive-abort, nil) 2503 SUIT_Directive_Try_Each_Argument = [ 2504 + bstr .cbor SUIT_Command_Sequence, 2505 nil / bstr .cbor SUIT_Command_Sequence 2506 ] 2508 SUIT_Wait_Event = { + SUIT_Wait_Events } 2510 SUIT_Wait_Events //= (suit-wait-event-authorization => int) 2511 SUIT_Wait_Events //= (suit-wait-event-power => int) 2512 SUIT_Wait_Events //= (suit-wait-event-network => int) 2513 SUIT_Wait_Events //= (suit-wait-event-other-device-version 2514 => SUIT_Wait_Event_Argument_Other_Device_Version) 2515 SUIT_Wait_Events //= (suit-wait-event-time => uint); Timestamp 2516 SUIT_Wait_Events //= (suit-wait-event-time-of-day 2517 => uint); Time of Day (seconds since 00:00:00) 2518 SUIT_Wait_Events //= (suit-wait-event-day-of-week 2519 => uint); Days since Sunday 2521 SUIT_Wait_Event_Argument_Other_Device_Version = [ 2522 other-device: bstr, 2523 other-device-version: [+int] 2524 ] 2526 SUIT_Parameters //= (suit-parameter-vendor-identifier => RFC4122_UUID) 2527 SUIT_Parameters //= (suit-parameter-class-identifier => RFC4122_UUID) 2528 SUIT_Parameters //= (suit-parameter-image-digest 2529 => bstr .cbor SUIT_Digest) 2530 SUIT_Parameters //= (suit-parameter-image-size => uint) 2531 SUIT_Parameters //= (suit-parameter-use-before => uint) 2532 SUIT_Parameters //= (suit-parameter-component-offset => uint) 2534 SUIT_Parameters //= (suit-parameter-encryption-info 2535 => bstr .cbor SUIT_Encryption_Info) 2536 SUIT_Parameters //= (suit-parameter-compression-info 2537 => bstr .cbor SUIT_Compression_Info) 2538 SUIT_Parameters //= (suit-parameter-unpack-info 2539 => bstr .cbor SUIT_Unpack_Info) 2541 SUIT_Parameters //= (suit-parameter-uri => tstr) 2542 SUIT_Parameters //= (suit-parameter-source-component => uint) 2543 SUIT_Parameters //= (suit-parameter-run-args => bstr) 2545 SUIT_Parameters //= (suit-parameter-device-identifier => RFC4122_UUID) 2546 SUIT_Parameters //= (suit-parameter-minimum-battery => uint) 2547 SUIT_Parameters //= (suit-parameter-update-priority => uint) 2548 SUIT_Parameters //= (suit-parameter-version => 2549 SUIT_Parameter_Version_Match) 2550 SUIT_Parameters //= (suit-parameter-wait-info => 2551 bstr .cbor SUIT_Wait_Event) 2553 SUIT_Parameters //= (suit-parameter-custom => int/bool/tstr/bstr) 2555 SUIT_Parameters //= (suit-parameter-strict-order => bool) 2556 SUIT_Parameters //= (suit-parameter-soft-failure => bool) 2558 RFC4122_UUID = bstr .size 16 2560 SUIT_Parameter_Version_Match = [ 2561 suit-condition-version-comparison-type: 2562 SUIT_Condition_Version_Comparison_Types, 2563 suit-condition-version-comparison-value: 2564 SUIT_Condition_Version_Comparison_Value 2565 ] 2566 SUIT_Condition_Version_Comparison_Types /= 2567 suit-condition-version-comparison-greater 2568 SUIT_Condition_Version_Comparison_Types /= 2569 suit-condition-version-comparison-greater-equal 2570 SUIT_Condition_Version_Comparison_Types /= 2571 suit-condition-version-comparison-equal 2572 SUIT_Condition_Version_Comparison_Types /= 2573 suit-condition-version-comparison-lesser-equal 2574 SUIT_Condition_Version_Comparison_Types /= 2575 suit-condition-version-comparison-lesser 2577 suit-condition-version-comparison-greater = 1 2578 suit-condition-version-comparison-greater-equal = 2 2579 suit-condition-version-comparison-equal = 3 2580 suit-condition-version-comparison-lesser-equal = 4 2581 suit-condition-version-comparison-lesser = 5 2583 SUIT_Condition_Version_Comparison_Value = [+int] 2585 SUIT_Encryption_Info = COSE_Encrypt_Tagged/COSE_Encrypt0_Tagged 2586 SUIT_Compression_Info = { 2587 suit-compression-algorithm => SUIT_Compression_Algorithms, 2588 ? suit-compression-parameters => bstr 2589 } 2591 SUIT_Compression_Algorithms /= SUIT_Compression_Algorithm_zlib 2592 SUIT_Compression_Algorithms /= SUIT_Compression_Algorithm_brotli 2593 SUIT_Compression_Algorithms /= SUIT_Compression_Algorithm_zstd 2595 SUIT_Compression_Algorithm_zlib = 1 2596 SUIT_Compression_Algorithm_brotli = 2 2597 SUIT_Compression_Algorithm_zstd = 3 2599 SUIT_Unpack_Info = { 2600 suit-unpack-algorithm => SUIT_Unpack_Algorithms, 2601 ? suit-unpack-parameters => bstr 2602 } 2604 SUIT_Unpack_Algorithms /= SUIT_Unpack_Algorithm_Hex 2605 SUIT_Unpack_Algorithms /= SUIT_Unpack_Algorithm_Elf 2606 SUIT_Unpack_Algorithms /= SUIT_Unpack_Algorithm_Coff 2607 SUIT_Unpack_Algorithms /= SUIT_Unpack_Algorithm_Srec 2609 SUIT_Unpack_Algorithm_Hex = 1 2610 SUIT_Unpack_Algorithm_Elf = 2 2611 SUIT_Unpack_Algorithm_Coff = 3 2612 SUIT_Unpack_Algorithm_Srec = 4 2614 SUIT_Text_Map = {SUIT_Text_Keys => tstr} 2616 SUIT_Text_Keys /= suit-text-manifest-description 2617 SUIT_Text_Keys /= suit-text-update-description 2618 SUIT_Text_Keys /= suit-text-vendor-name 2619 SUIT_Text_Keys /= suit-text-model-name 2620 SUIT_Text_Keys /= suit-text-vendor-domain 2621 SUIT_Text_Keys /= suit-text-model-info 2622 SUIT_Text_Keys /= suit-text-component-description 2623 SUIT_Text_Keys /= suit-text-manifest-json-source 2624 SUIT_Text_Keys /= suit-text-manifest-yaml-source 2625 SUIT_Text_Keys /= suit-text-version-dependencies 2627 suit-delegation = 1 2628 suit-authentication-wrapper = 2 2629 suit-manifest = 3 2631 suit-manifest-encryption-info = 4 2632 suit-manifest-encrypted = 5 2634 suit-manifest-version = 1 2635 suit-manifest-sequence-number = 2 2636 suit-common = 3 2637 suit-reference-uri = 4 2638 suit-dependency-resolution = 7 2639 suit-payload-fetch = 8 2640 suit-install = 9 2641 suit-validate = 10 2642 suit-load = 11 2643 suit-run = 12 2644 suit-text = 13 2645 suit-coswid = 14 2647 suit-dependencies = 1 2648 suit-components = 2 2649 suit-dependency-components = 3 2650 suit-common-sequence = 4 2652 suit-dependency-digest = 1 2653 suit-dependency-prefix = 2 2655 suit-component-identifier = 1 2656 suit-component-dependency-index = 2 2658 suit-command-custom = nint 2660 suit-condition-vendor-identifier = 1 2661 suit-condition-class-identifier = 2 2662 suit-condition-image-match = 3 2663 suit-condition-use-before = 4 2664 suit-condition-component-offset = 5 2666 suit-condition-device-identifier = 24 2667 suit-condition-image-not-match = 25 2668 suit-condition-minimum-battery = 26 2669 suit-condition-update-authorized = 27 2670 suit-condition-version = 28 2672 suit-directive-set-component-index = 12 2673 suit-directive-set-dependency-index = 13 2674 suit-directive-abort = 14 2675 suit-directive-try-each = 15 2676 ;suit-directive-do-each = 16 ; TBD 2677 ;suit-directive-map-filter = 17 ; TBD 2678 suit-directive-process-dependency = 18 2679 suit-directive-set-parameters = 19 2680 suit-directive-override-parameters = 20 2681 suit-directive-fetch = 21 2682 suit-directive-copy = 22 2683 suit-directive-run = 23 2685 suit-directive-wait = 29 2686 suit-directive-run-sequence = 30 2687 suit-directive-swap = 32 2689 suit-wait-event-authorization = 1 2690 suit-wait-event-power = 2 2691 suit-wait-event-network = 3 2692 suit-wait-event-other-device-version = 4 2693 suit-wait-event-time = 5 2694 suit-wait-event-time-of-day = 6 2695 suit-wait-event-day-of-week = 7 2697 suit-parameter-vendor-identifier = 1 2698 suit-parameter-class-identifier = 2 2699 suit-parameter-image-digest = 3 2700 suit-parameter-use-before = 4 2701 suit-parameter-component-offset = 5 2703 suit-parameter-strict-order = 12 2704 suit-parameter-soft-failure = 13 2705 suit-parameter-image-size = 14 2707 suit-parameter-encryption-info = 18 2708 suit-parameter-compression-info = 19 2709 suit-parameter-unpack-info = 20 2710 suit-parameter-uri = 21 2711 suit-parameter-source-component = 22 2712 suit-parameter-run-args = 23 2714 suit-parameter-device-identifier = 24 2715 suit-parameter-minimum-battery = 26 2716 suit-parameter-update-priority = 27 2717 suit-parameter-version = 28 2718 suit-parameter-wait-info = 29 2719 suit-parameter-uri-list = 30 2720 suit-parameter-custom = nint 2722 suit-compression-algorithm = 1 2723 suit-compression-parameters = 2 2725 suit-unpack-algorithm = 1 2726 suit-unpack-parameters = 2 2728 suit-text-manifest-description = 1 2729 suit-text-update-description = 2 2730 suit-text-vendor-name = 3 2731 suit-text-model-name = 4 2732 suit-text-vendor-domain = 5 2733 suit-text-model-info = 6 2734 suit-text-component-description = 7 2735 suit-text-manifest-json-source = 8 2736 suit-text-manifest-yaml-source = 9 2737 suit-text-version-dependencies = 10 2739 B. Examples 2741 The following examples demonstrate a small subset of the 2742 functionality of the manifest. However, despite this, even a simple 2743 manifest processor can execute most of these manifests. 2745 The examples are signed using the following ECDSA secp256r1 key: 2747 -----BEGIN PRIVATE KEY----- 2748 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgApZYjZCUGLM50VBC 2749 CjYStX+09jGmnyJPrpDLTz/hiXOhRANCAASEloEarguqq9JhVxie7NomvqqL8Rtv 2750 P+bitWWchdvArTsfKktsCYExwKNtrNHXi9OB3N+wnAUtszmR23M4tKiW 2751 -----END PRIVATE KEY----- 2753 The corresponding public key can be used to verify these examples: 2755 -----BEGIN PUBLIC KEY----- 2756 MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhJaBGq4LqqvSYVcYnuzaJr6qi/Eb 2757 bz/m4rVlnIXbwK07HypLbAmBMcCjbazR14vTgdzfsJwFLbM5kdtzOLSolg== 2758 -----END PUBLIC KEY----- 2760 Each example uses SHA256 as the digest function. 2762 B.1. Example 0: Secure Boot 2764 Secure boot and compatibility check. 2766 { 2767 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820655 2769 f1230fd3833ca828c18200498fd1cd90656a9a2620c6989921c06623703515840a0416 2770 20607b7765a51fe0566e5d8fed95491ee6df622132524fdbe67607bf7f2794d7a71dad 2771 7230d3cab86c5091a226d00061b0a74a01b3d371e07d5b3eca3d4' / [ 2772 h'd28443a10126a0582482025820655f1230fd3833ca828c18200498fd1cd9 2773 0656a9a2620c6989921c06623703515840a041620607b7765a51fe0566e5d8fed95491 2774 ee6df622132524fdbe67607bf7f2794d7a71dad7230d3cab86c5091a226d00061b0a74 2775 a01b3d371e07d5b3eca3d4' / 18([ 2776 / protected / h'a10126' / { 2777 / alg / 1:-7 / "ES256" /, 2778 } /, 2779 / unprotected / { 2780 }, 2781 / payload / h'82025820655f1230fd3833ca828c18200498fd1c 2782 d90656a9a2620c6989921c0662370351' / [ 2783 / algorithm-id / 2 / "sha256" /, 2784 / digest-bytes / 2785 h'"655f1230fd3833ca828c18200498fd1cd90656a9a2620c6989921c0662370351"' 2786 ] /, 2787 / signature / h'"a041620607b7765a51fe0566e5d8fed95491e 2788 e6df622132524fdbe67607bf7f2794d7a71dad7230d3cab86c5091a226d00061b0a74a 2789 01b3d371e07d5b3eca3d4"' 2790 ]) / 2791 ] /, 2792 / manifest / 3:h'a501010201035860a20244818141000458568614a40150fa6 2793 b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582 2794 48202582000112233445566778899aabbccddeeff0123456789abcdeffedcba9876543 2795 2100e1987d001f602f60a438203f60c438217f6' / { 2796 / manifest-version / 1:1, 2797 / manifest-sequence-number / 2:1, 2798 / common / 3:h'a20244818141000458568614a40150fa6b4a53d5ad5fdfb 2799 e9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112 2800 233445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f 2801 602f6' / { 2802 / components / 2:h'81814100' / [ 2803 [h'"00"'] 2804 ] /, 2805 / common-sequence / 4:h'8614a40150fa6b4a53d5ad5fdfbe9de663 2806 e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582482025820001122334455 2807 66778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602f6' 2808 / [ 2809 / directive-override-parameters / 20,{ 2810 / vendor-id / 2811 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 2812 be9d-e663e4d41ffe /, 2813 / class-id / 2814 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 2815 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 2816 / image-digest / 3:h'8202582000112233445566778899a 2818 abbccddeeff0123456789abcdeffedcba9876543210' / [ 2819 / algorithm-id / 2 / "sha256" /, 2820 / digest-bytes / 2821 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 2822 ] /, 2823 / image-size / 14:34768, 2824 } , 2825 / condition-vendor-identifier / 1,F6 / nil / , 2826 / condition-class-identifier / 2,F6 / nil / 2827 ] /, 2828 } /, 2829 / validate / 10:h'8203f6' / [ 2830 / condition-image-match / 3,F6 / nil / 2831 ] /, 2832 / run / 12:h'8217f6' / [ 2833 / directive-run / 23,F6 / nil / 2834 ] /, 2835 } /, 2836 } 2838 Total size of manifest without COSE authentication object: 118 2840 Manifest: 2842 a1035872a501010201035860a20244818141000458568614a40150fa6b4a 2843 53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab 2844 450358248202582000112233445566778899aabbccddeeff0123456789ab 2845 cdeffedcba98765432100e1987d001f602f60a438203f60c438217f6 2847 Total size of manifest with COSE authentication object: 235 2849 Manifest with COSE authentication object: 2851 a202587281586fd28443a10126a0582482025820655f1230fd3833ca828c 2852 18200498fd1cd90656a9a2620c6989921c06623703515840a041620607b7 2853 765a51fe0566e5d8fed95491ee6df622132524fdbe67607bf7f2794d7a71 2854 dad7230d3cab86c5091a226d00061b0a74a01b3d371e07d5b3eca3d40358 2855 72a501010201035860a20244818141000458568614a40150fa6b4a53d5ad 2856 5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358 2857 248202582000112233445566778899aabbccddeeff0123456789abcdeffe 2858 dcba98765432100e1987d001f602f60a438203f60c438217f6 2860 B.2. Example 1: Simultaneous Download and Installation of Payload 2862 Simultaneous download and installation of payload. 2864 { 2865 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820815 2867 32771898e4ebcccf12c607420eba62b5086192cac4c99692835b58ee62f7b584081592 2868 1e5148e9b81e79d8be570de6bb42ba2e903c8549f0e13dee4d0ee420d90dd9f8537ebe 2869 ad3f92b37df703539879129183b0beaf3ba75cacd8a91e075a24e' / [ 2870 h'd28443a10126a058248202582081532771898e4ebcccf12c607420eba62b 2871 5086192cac4c99692835b58ee62f7b5840815921e5148e9b81e79d8be570de6bb42ba2 2872 e903c8549f0e13dee4d0ee420d90dd9f8537ebead3f92b37df703539879129183b0bea 2873 f3ba75cacd8a91e075a24e' / 18([ 2874 / protected / h'a10126' / { 2875 / alg / 1:-7 / "ES256" /, 2876 } /, 2877 / unprotected / { 2878 }, 2879 / payload / h'8202582081532771898e4ebcccf12c607420eba6 2880 2b5086192cac4c99692835b58ee62f7b' / [ 2881 / algorithm-id / 2 / "sha256" /, 2882 / digest-bytes / 2883 h'"81532771898e4ebcccf12c607420eba62b5086192cac4c99692835b58ee62f7b"' 2884 ] /, 2885 / signature / h'"815921e5148e9b81e79d8be570de6bb42ba2e 2886 903c8549f0e13dee4d0ee420d90dd9f8537ebead3f92b37df703539879129183b0beaf 2887 3ba75cacd8a91e075a24e"' 2888 ]) / 2889 ] /, 2890 / manifest / 3:h'a501010202035860a20244818141000458568614a40150fa6 2891 b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582 2892 48202582000112233445566778899aabbccddeeff0123456789abcdeffedcba9876543 2893 2100e1987d001f602f60958258613a115781b687474703a2f2f6578616d706c652e636 2894 f6d2f66696c652e62696e15f603f60a438203f6' / { 2895 / manifest-version / 1:1, 2896 / manifest-sequence-number / 2:2, 2897 / common / 3:h'a20244818141000458568614a40150fa6b4a53d5ad5fdfb 2898 e9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112 2899 233445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f 2900 602f6' / { 2901 / components / 2:h'81814100' / [ 2902 [h'"00"'] 2903 ] /, 2904 / common-sequence / 4:h'8614a40150fa6b4a53d5ad5fdfbe9de663 2905 e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582482025820001122334455 2906 66778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602f6' 2907 / [ 2908 / directive-override-parameters / 20,{ 2909 / vendor-id / 2910 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 2911 be9d-e663e4d41ffe /, 2912 / class-id / 2913 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 2914 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 2915 / image-digest / 3:h'8202582000112233445566778899a 2916 abbccddeeff0123456789abcdeffedcba9876543210' / [ 2917 / algorithm-id / 2 / "sha256" /, 2918 / digest-bytes / 2919 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 2920 ] /, 2921 / image-size / 14:34768, 2922 } , 2923 / condition-vendor-identifier / 1,F6 / nil / , 2924 / condition-class-identifier / 2,F6 / nil / 2925 ] /, 2926 } /, 2927 / install / 9:h'8613a115781b687474703a2f2f6578616d706c652e636f 2928 6d2f66696c652e62696e15f603f6' / [ 2929 / directive-set-parameters / 19,{ 2930 / uri / 21:'http://example.com/file.bin', 2931 } , 2932 / directive-fetch / 21,F6 / nil / , 2933 / condition-image-match / 3,F6 / nil / 2934 ] /, 2935 / validate / 10:h'8203f6' / [ 2936 / condition-image-match / 3,F6 / nil / 2937 ] /, 2938 } /, 2939 } 2941 Total size of manifest without COSE authentication object: 153 2943 Manifest: 2945 a1035895a501010202035860a20244818141000458568614a40150fa6b4a 2946 53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab 2947 450358248202582000112233445566778899aabbccddeeff0123456789ab 2948 cdeffedcba98765432100e1987d001f602f60958258613a115781b687474 2949 703a2f2f6578616d706c652e636f6d2f66696c652e62696e15f603f60a43 2950 8203f6 2952 Total size of manifest with COSE authentication object: 270 2954 Manifest with COSE authentication object: 2956 a202587281586fd28443a10126a058248202582081532771898e4ebcccf1 2957 2c607420eba62b5086192cac4c99692835b58ee62f7b5840815921e5148e 2958 9b81e79d8be570de6bb42ba2e903c8549f0e13dee4d0ee420d90dd9f8537 2959 ebead3f92b37df703539879129183b0beaf3ba75cacd8a91e075a24e0358 2960 95a501010202035860a20244818141000458568614a40150fa6b4a53d5ad 2961 5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358 2962 248202582000112233445566778899aabbccddeeff0123456789abcdeffe 2963 dcba98765432100e1987d001f602f60958258613a115781b687474703a2f 2964 2f6578616d706c652e636f6d2f66696c652e62696e15f603f60a438203f6 2966 B.3. Example 2: Simultaneous Download, Installation, and Secure Boot 2968 Compatibility test, simultaneous download and installation, and 2969 secure boot. 2971 { 2972 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820883 2973 90f8988639d8a2cfb6da969fce488333ac5ba77aaf0d66b5623009bbf341158401929f 2974 fd488c455ab40eaf1aa96a7df4a9c16c658221055c3a113232fb81c5751a23a74b5efc 2975 06c459eb47a07028ef3c6a0d9051185dd78899c654249f9070dea' / [ 2976 h'd28443a10126a058248202582088390f8988639d8a2cfb6da969fce48833 2977 3ac5ba77aaf0d66b5623009bbf341158401929ffd488c455ab40eaf1aa96a7df4a9c16 2978 c658221055c3a113232fb81c5751a23a74b5efc06c459eb47a07028ef3c6a0d9051185 2979 dd78899c654249f9070dea' / 18([ 2980 / protected / h'a10126' / { 2981 / alg / 1:-7 / "ES256" /, 2982 } /, 2983 / unprotected / { 2984 }, 2985 / payload / h'8202582088390f8988639d8a2cfb6da969fce488 2986 333ac5ba77aaf0d66b5623009bbf3411' / [ 2987 / algorithm-id / 2 / "sha256" /, 2988 / digest-bytes / 2989 h'"88390f8988639d8a2cfb6da969fce488333ac5ba77aaf0d66b5623009bbf3411"' 2990 ] /, 2991 / signature / h'"1929ffd488c455ab40eaf1aa96a7df4a9c16c 2992 658221055c3a113232fb81c5751a23a74b5efc06c459eb47a07028ef3c6a0d9051185d 2993 d78899c654249f9070dea"' 2994 ]) / 2995 ] /, 2996 / manifest / 3:h'a601010203035860a20244818141000458568614a40150fa6 2997 b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582 2998 48202582000112233445566778899aabbccddeeff0123456789abcdeffedcba9876543 2999 2100e1987d001f602f60958258613a115781b687474703a2f2f6578616d706c652e636 3000 f6d2f66696c652e62696e15f603f60a438203f60c438217f6' / { 3001 / manifest-version / 1:1, 3002 / manifest-sequence-number / 2:3, 3003 / common / 3:h'a20244818141000458568614a40150fa6b4a53d5ad5fdfb 3005 e9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112 3006 233445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f 3007 602f6' / { 3008 / components / 2:h'81814100' / [ 3009 [h'"00"'] 3010 ] /, 3011 / common-sequence / 4:h'8614a40150fa6b4a53d5ad5fdfbe9de663 3012 e4d41ffe02501492af1425695e48bf429b2d51f2ab4503582482025820001122334455 3013 66778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602f6' 3014 / [ 3015 / directive-override-parameters / 20,{ 3016 / vendor-id / 3017 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 3018 be9d-e663e4d41ffe /, 3019 / class-id / 3020 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 3021 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 3022 / image-digest / 3:h'8202582000112233445566778899a 3023 abbccddeeff0123456789abcdeffedcba9876543210' / [ 3024 / algorithm-id / 2 / "sha256" /, 3025 / digest-bytes / 3026 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 3027 ] /, 3028 / image-size / 14:34768, 3029 } , 3030 / condition-vendor-identifier / 1,F6 / nil / , 3031 / condition-class-identifier / 2,F6 / nil / 3032 ] /, 3033 } /, 3034 / install / 9:h'8613a115781b687474703a2f2f6578616d706c652e636f 3035 6d2f66696c652e62696e15f603f6' / [ 3036 / directive-set-parameters / 19,{ 3037 / uri / 21:'http://example.com/file.bin', 3038 } , 3039 / directive-fetch / 21,F6 / nil / , 3040 / condition-image-match / 3,F6 / nil / 3041 ] /, 3042 / validate / 10:h'8203f6' / [ 3043 / condition-image-match / 3,F6 / nil / 3044 ] /, 3045 / run / 12:h'8217f6' / [ 3046 / directive-run / 23,F6 / nil / 3047 ] /, 3048 } /, 3049 } 3051 Total size of manifest without COSE authentication object: 158 3052 Manifest: 3054 a103589aa601010203035860a20244818141000458568614a40150fa6b4a 3055 53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab 3056 450358248202582000112233445566778899aabbccddeeff0123456789ab 3057 cdeffedcba98765432100e1987d001f602f60958258613a115781b687474 3058 703a2f2f6578616d706c652e636f6d2f66696c652e62696e15f603f60a43 3059 8203f60c438217f6 3061 Total size of manifest with COSE authentication object: 275 3063 Manifest with COSE authentication object: 3065 a202587281586fd28443a10126a058248202582088390f8988639d8a2cfb 3066 6da969fce488333ac5ba77aaf0d66b5623009bbf341158401929ffd488c4 3067 55ab40eaf1aa96a7df4a9c16c658221055c3a113232fb81c5751a23a74b5 3068 efc06c459eb47a07028ef3c6a0d9051185dd78899c654249f9070dea0358 3069 9aa601010203035860a20244818141000458568614a40150fa6b4a53d5ad 3070 5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358 3071 248202582000112233445566778899aabbccddeeff0123456789abcdeffe 3072 dcba98765432100e1987d001f602f60958258613a115781b687474703a2f 3073 2f6578616d706c652e636f6d2f66696c652e62696e15f603f60a438203f6 3074 0c438217f6 3076 B.4. Example 3: Load from External Storage 3078 Compatibility test, simultaneous download and installation, load from 3079 external storage, and secure boot. 3081 { 3082 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820568 3083 56a72f9ac0ee73b4ea3a866cf2e5c990e8ed8c6056608bc221efd42172b2758402a9d7 3084 573ef6dcf5653b39027fdf87b81adeb0f03122bef0ecf5af9c7d77323c32827230f660 3085 8342b7bf5c125f17148bd67880420ab0d03e235e6ca1d15127499' / [ 3086 h'd28443a10126a058248202582056856a72f9ac0ee73b4ea3a866cf2e5c99 3087 0e8ed8c6056608bc221efd42172b2758402a9d7573ef6dcf5653b39027fdf87b81adeb 3088 0f03122bef0ecf5af9c7d77323c32827230f6608342b7bf5c125f17148bd67880420ab 3089 0d03e235e6ca1d15127499' / 18([ 3090 / protected / h'a10126' / { 3091 / alg / 1:-7 / "ES256" /, 3092 } /, 3093 / unprotected / { 3094 }, 3095 / payload / h'8202582056856a72f9ac0ee73b4ea3a866cf2e5c 3096 990e8ed8c6056608bc221efd42172b27' / [ 3097 / algorithm-id / 2 / "sha256" /, 3098 / digest-bytes / 3099 h'"56856a72f9ac0ee73b4ea3a866cf2e5c990e8ed8c6056608bc221efd42172b27"' 3100 ] /, 3101 / signature / h'"2a9d7573ef6dcf5653b39027fdf87b81adeb0 3102 f03122bef0ecf5af9c7d77323c32827230f6608342b7bf5c125f17148bd67880420ab0 3103 d03e235e6ca1d15127499"' 3104 ]) / 3105 ] /, 3106 / manifest / 3:h'a701010204035865a2024782814100814101045858880c001 3107 4a40150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f 3108 2ab450358248202582000112233445566778899aabbccddeeff0123456789abcdeffed 3109 cba98765432100e1987d001f602f6095827880c0013a115781b687474703a2f2f65786 3110 16d706c652e636f6d2f66696c652e62696e15f603f60a45840c0003f60b4b880c0113a 3111 1160016f603f60c45840c0117f6' / { 3112 / manifest-version / 1:1, 3113 / manifest-sequence-number / 2:4, 3114 / common / 3:h'a2024782814100814101045858880c0014a40150fa6b4a5 3115 3d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab45035824820 3116 2582000112233445566778899aabbccddeeff0123456789abcdeffedcba98765432100 3117 e1987d001f602f6' / { 3118 / components / 2:h'82814100814101' / [ 3119 [h'"00"'] , 3120 [h'"01"'] 3121 ] /, 3122 / common-sequence / 4:h'880c0014a40150fa6b4a53d5ad5fdfbe9d 3123 e663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112233 3124 445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602 3125 f6' / [ 3126 / directive-set-component-index / 12,0 , 3127 / directive-override-parameters / 20,{ 3128 / vendor-id / 3129 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 3130 be9d-e663e4d41ffe /, 3131 / class-id / 3132 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 3133 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 3134 / image-digest / 3:h'8202582000112233445566778899a 3135 abbccddeeff0123456789abcdeffedcba9876543210' / [ 3136 / algorithm-id / 2 / "sha256" /, 3137 / digest-bytes / 3138 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 3139 ] /, 3140 / image-size / 14:34768, 3141 } , 3142 / condition-vendor-identifier / 1,F6 / nil / , 3143 / condition-class-identifier / 2,F6 / nil / 3144 ] /, 3145 } /, 3146 / install / 9:h'880c0013a115781b687474703a2f2f6578616d706c652e 3147 636f6d2f66696c652e62696e15f603f6' / [ 3148 / directive-set-component-index / 12,0 , 3149 / directive-set-parameters / 19,{ 3150 / uri / 21:'http://example.com/file.bin', 3151 } , 3152 / directive-fetch / 21,F6 / nil / , 3153 / condition-image-match / 3,F6 / nil / 3154 ] /, 3155 / validate / 10:h'840c0003f6' / [ 3156 / directive-set-component-index / 12,0 , 3157 / condition-image-match / 3,F6 / nil / 3158 ] /, 3159 / load / 11:h'880c0113a1160016f603f6' / [ 3160 / directive-set-component-index / 12,1 , 3161 / directive-set-parameters / 19,{ 3162 / source-component / 22:0 / [h'"00"'] /, 3163 } , 3164 / directive-copy / 22,F6 / nil / , 3165 / condition-image-match / 3,F6 / nil / 3166 ] /, 3167 / run / 12:h'840c0117f6' / [ 3168 / directive-set-component-index / 12,1 , 3169 / directive-run / 23,F6 / nil / 3170 ] /, 3171 } /, 3172 } 3174 Total size of manifest without COSE authentication object: 182 3176 Manifest: 3178 a10358b2a701010204035865a2024782814100814101045858880c0014a4 3179 0150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf42 3180 9b2d51f2ab450358248202582000112233445566778899aabbccddeeff01 3181 23456789abcdeffedcba98765432100e1987d001f602f6095827880c0013 3182 a115781b687474703a2f2f6578616d706c652e636f6d2f66696c652e6269 3183 6e15f603f60a45840c0003f60b4b880c0113a1160016f603f60c45840c01 3184 17f6 3186 Total size of manifest with COSE authentication object: 299 3188 Manifest with COSE authentication object: 3190 a202587281586fd28443a10126a058248202582056856a72f9ac0ee73b4e 3191 a3a866cf2e5c990e8ed8c6056608bc221efd42172b2758402a9d7573ef6d 3192 cf5653b39027fdf87b81adeb0f03122bef0ecf5af9c7d77323c32827230f 3193 6608342b7bf5c125f17148bd67880420ab0d03e235e6ca1d151274990358 3194 b2a701010204035865a2024782814100814101045858880c0014a40150fa 3195 6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51 3196 f2ab450358248202582000112233445566778899aabbccddeeff01234567 3197 89abcdeffedcba98765432100e1987d001f602f6095827880c0013a11578 3198 1b687474703a2f2f6578616d706c652e636f6d2f66696c652e62696e15f6 3199 03f60a45840c0003f60b4b880c0113a1160016f603f60c45840c0117f6 3201 B.5. Example 4: Load and Decompress from External Storage 3203 Compatibility test, simultaneous download and installation, load and 3204 decompress from external storage, and secure boot. 3206 { 3207 / authentication-wrapper / 2:h'81586fd28443a10126a058248202582057b 3208 edc0076919ba83908365faf6d205e95c71268d29a94dc5e82698edd3a48225840e0a4d 3209 c500266518742802f2364b65f983175f060c1555d3d0b186f447500ba60c66e3231674 3210 1c3b642c68fed73d47542c3375c0ab72e0f4b94ec392ab398599d' / [ 3211 h'd28443a10126a058248202582057bedc0076919ba83908365faf6d205e95 3212 c71268d29a94dc5e82698edd3a48225840e0a4dc500266518742802f2364b65f983175 3213 f060c1555d3d0b186f447500ba60c66e32316741c3b642c68fed73d47542c3375c0ab7 3214 2e0f4b94ec392ab398599d' / 18([ 3215 / protected / h'a10126' / { 3216 / alg / 1:-7 / "ES256" /, 3217 } /, 3218 / unprotected / { 3219 }, 3220 / payload / h'8202582057bedc0076919ba83908365faf6d205e 3221 95c71268d29a94dc5e82698edd3a4822' / [ 3222 / algorithm-id / 2 / "sha256" /, 3223 / digest-bytes / 3224 h'"57bedc0076919ba83908365faf6d205e95c71268d29a94dc5e82698edd3a4822"' 3225 ] /, 3226 / signature / h'"e0a4dc500266518742802f2364b65f983175f 3227 060c1555d3d0b186f447500ba60c66e32316741c3b642c68fed73d47542c3375c0ab72 3228 e0f4b94ec392ab398599d"' 3229 ]) / 3230 ] /, 3231 / manifest / 3:h'a701010205035865a2024782814100814101045858880c001 3232 4a40150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f 3233 2ab450358248202582000112233445566778899aabbccddeeff0123456789abcdeffed 3234 cba98765432100e1987d001f602f6095827880c0013a115781b687474703a2f2f65786 3235 16d706c652e636f6d2f66696c652e62696e15f603f60a45840c0003f60b4d880c0113a 3236 21301160016f603f60c45840c0117f6' / { 3237 / manifest-version / 1:1, 3238 / manifest-sequence-number / 2:5, 3239 / common / 3:h'a2024782814100814101045858880c0014a40150fa6b4a5 3240 3d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab45035824820 3241 2582000112233445566778899aabbccddeeff0123456789abcdeffedcba98765432100 3242 e1987d001f602f6' / { 3243 / components / 2:h'82814100814101' / [ 3244 [h'"00"'] , 3245 [h'"01"'] 3246 ] /, 3247 / common-sequence / 4:h'880c0014a40150fa6b4a53d5ad5fdfbe9d 3248 e663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112233 3249 445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602 3250 f6' / [ 3251 / directive-set-component-index / 12,0 , 3252 / directive-override-parameters / 20,{ 3253 / vendor-id / 3254 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 3255 be9d-e663e4d41ffe /, 3256 / class-id / 3257 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 3258 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 3259 / image-digest / 3:h'8202582000112233445566778899a 3260 abbccddeeff0123456789abcdeffedcba9876543210' / [ 3261 / algorithm-id / 2 / "sha256" /, 3262 / digest-bytes / 3263 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 3264 ] /, 3265 / image-size / 14:34768, 3266 } , 3267 / condition-vendor-identifier / 1,F6 / nil / , 3268 / condition-class-identifier / 2,F6 / nil / 3269 ] /, 3270 } /, 3271 / install / 9:h'880c0013a115781b687474703a2f2f6578616d706c652e 3272 636f6d2f66696c652e62696e15f603f6' / [ 3273 / directive-set-component-index / 12,0 , 3274 / directive-set-parameters / 19,{ 3275 / uri / 21:'http://example.com/file.bin', 3276 } , 3277 / directive-fetch / 21,F6 / nil / , 3278 / condition-image-match / 3,F6 / nil / 3279 ] /, 3280 / validate / 10:h'840c0003f6' / [ 3281 / directive-set-component-index / 12,0 , 3282 / condition-image-match / 3,F6 / nil / 3283 ] /, 3284 / load / 11:h'880c0113a21301160016f603f6' / [ 3285 / directive-set-component-index / 12,1 , 3286 / directive-set-parameters / 19,{ 3287 / source-component / 22:0 / [h'"00"'] /, 3288 / compression-info / 19:1 / "gzip" /, 3289 } , 3290 / directive-copy / 22,F6 / nil / , 3291 / condition-image-match / 3,F6 / nil / 3292 ] /, 3293 / run / 12:h'840c0117f6' / [ 3294 / directive-set-component-index / 12,1 , 3295 / directive-run / 23,F6 / nil / 3296 ] /, 3297 } /, 3298 } 3300 Total size of manifest without COSE authentication object: 184 3302 Manifest: 3304 a10358b4a701010205035865a2024782814100814101045858880c0014a4 3305 0150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf42 3306 9b2d51f2ab450358248202582000112233445566778899aabbccddeeff01 3307 23456789abcdeffedcba98765432100e1987d001f602f6095827880c0013 3308 a115781b687474703a2f2f6578616d706c652e636f6d2f66696c652e6269 3309 6e15f603f60a45840c0003f60b4d880c0113a21301160016f603f60c4584 3310 0c0117f6 3312 Total size of manifest with COSE authentication object: 301 3314 Manifest with COSE authentication object: 3316 a202587281586fd28443a10126a058248202582057bedc0076919ba83908 3317 365faf6d205e95c71268d29a94dc5e82698edd3a48225840e0a4dc500266 3318 518742802f2364b65f983175f060c1555d3d0b186f447500ba60c66e3231 3319 6741c3b642c68fed73d47542c3375c0ab72e0f4b94ec392ab398599d0358 3320 b4a701010205035865a2024782814100814101045858880c0014a40150fa 3321 6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51 3322 f2ab450358248202582000112233445566778899aabbccddeeff01234567 3323 89abcdeffedcba98765432100e1987d001f602f6095827880c0013a11578 3324 1b687474703a2f2f6578616d706c652e636f6d2f66696c652e62696e15f6 3325 03f60a45840c0003f60b4d880c0113a21301160016f603f60c45840c0117 3326 f6 3328 B.6. Example 5: Compatibility Test, Download, Installation, and Secure 3329 Boot 3331 Compatibility test, download, installation, and secure boot. 3333 { 3334 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820ecc 3335 95235f2ab00b9912f8189b213b3e4ade42b792f491644e76004cd2ba87dc8584093952 3336 6b77d63dac2e138bf074aac757c5f010e8b2cf3ae9fcbba4cafc2d0f81c9ae46bc973c 3337 c0565410a1cb6bf10d2b3d0a2865392255cc4288d0337af3de837' / [ 3338 h'd28443a10126a0582482025820ecc95235f2ab00b9912f8189b213b3e4ad 3339 e42b792f491644e76004cd2ba87dc85840939526b77d63dac2e138bf074aac757c5f01 3340 0e8b2cf3ae9fcbba4cafc2d0f81c9ae46bc973cc0565410a1cb6bf10d2b3d0a2865392 3341 255cc4288d0337af3de837' / 18([ 3342 / protected / h'a10126' / { 3343 / alg / 1:-7 / "ES256" /, 3344 } /, 3345 / unprotected / { 3346 }, 3347 / payload / h'82025820ecc95235f2ab00b9912f8189b213b3e4 3348 ade42b792f491644e76004cd2ba87dc8' / [ 3349 / algorithm-id / 2 / "sha256" /, 3350 / digest-bytes / 3351 h'"ecc95235f2ab00b9912f8189b213b3e4ade42b792f491644e76004cd2ba87dc8"' 3352 ] /, 3353 / signature / h'"939526b77d63dac2e138bf074aac757c5f010 3354 e8b2cf3ae9fcbba4cafc2d0f81c9ae46bc973cc0565410a1cb6bf10d2b3d0a28653922 3355 55cc4288d0337af3de837"' 3356 ]) / 3357 ] /, 3358 / manifest / 3:h'a701010205035865a2024782814100814101045858880c001 3359 4a40150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f 3360 2ab450358248202582000112233445566778899aabbccddeeff0123456789abcdeffed 3361 cba98765432100e1987d001f602f6085823840c0113a115781b687474703a2f2f65786 3362 16d706c652e636f6d2f66696c652e62696e094b880c0013a1160116f603f60a45840c0 3363 003f60c45840c0017f6' / { 3364 / manifest-version / 1:1, 3365 / manifest-sequence-number / 2:5, 3366 / common / 3:h'a2024782814100814101045858880c0014a40150fa6b4a5 3367 3d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab45035824820 3368 2582000112233445566778899aabbccddeeff0123456789abcdeffedcba98765432100 3369 e1987d001f602f6' / { 3370 / components / 2:h'82814100814101' / [ 3371 [h'"00"'] , 3372 [h'"01"'] 3373 ] /, 3374 / common-sequence / 4:h'880c0014a40150fa6b4a53d5ad5fdfbe9d 3375 e663e4d41ffe02501492af1425695e48bf429b2d51f2ab450358248202582000112233 3376 445566778899aabbccddeeff0123456789abcdeffedcba98765432100e1987d001f602 3377 f6' / [ 3378 / directive-set-component-index / 12,0 , 3379 / directive-override-parameters / 20,{ 3380 / vendor-id / 3381 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 3382 be9d-e663e4d41ffe /, 3383 / class-id / 3384 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 3385 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 3386 / image-digest / 3:h'8202582000112233445566778899a 3387 abbccddeeff0123456789abcdeffedcba9876543210' / [ 3388 / algorithm-id / 2 / "sha256" /, 3389 / digest-bytes / 3390 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 3391 ] /, 3392 / image-size / 14:34768, 3393 } , 3394 / condition-vendor-identifier / 1,F6 / nil / , 3395 / condition-class-identifier / 2,F6 / nil / 3396 ] /, 3397 } /, 3398 / payload-fetch / 8:h'840c0113a115781b687474703a2f2f6578616d70 3399 6c652e636f6d2f66696c652e62696e' / [ 3400 / directive-set-component-index / 12,1 , 3401 / directive-set-parameters / 19,{ 3402 / uri / 21:'http://example.com/file.bin', 3403 } 3404 ] /, 3405 / install / 9:h'880c0013a1160116f603f6' / [ 3406 / directive-set-component-index / 12,0 , 3407 / directive-set-parameters / 19,{ 3408 / source-component / 22:1 / [h'"01"'] /, 3409 } , 3410 / directive-copy / 22,F6 / nil / , 3411 / condition-image-match / 3,F6 / nil / 3412 ] /, 3413 / validate / 10:h'840c0003f6' / [ 3414 / directive-set-component-index / 12,0 , 3415 / condition-image-match / 3,F6 / nil / 3416 ] /, 3417 / run / 12:h'840c0017f6' / [ 3418 / directive-set-component-index / 12,0 , 3419 / directive-run / 23,F6 / nil / 3420 ] /, 3421 } /, 3422 } 3424 Total size of manifest without COSE authentication object: 178 3426 Manifest: 3428 a10358aea701010205035865a2024782814100814101045858880c0014a4 3429 0150fa6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf42 3430 9b2d51f2ab450358248202582000112233445566778899aabbccddeeff01 3431 23456789abcdeffedcba98765432100e1987d001f602f6085823840c0113 3432 a115781b687474703a2f2f6578616d706c652e636f6d2f66696c652e6269 3433 6e094b880c0013a1160116f603f60a45840c0003f60c45840c0017f6 3435 Total size of manifest with COSE authentication object: 295 3437 Manifest with COSE authentication object: 3439 a202587281586fd28443a10126a0582482025820ecc95235f2ab00b9912f 3440 8189b213b3e4ade42b792f491644e76004cd2ba87dc85840939526b77d63 3441 dac2e138bf074aac757c5f010e8b2cf3ae9fcbba4cafc2d0f81c9ae46bc9 3442 73cc0565410a1cb6bf10d2b3d0a2865392255cc4288d0337af3de8370358 3443 aea701010205035865a2024782814100814101045858880c0014a40150fa 3444 6b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51 3445 f2ab450358248202582000112233445566778899aabbccddeeff01234567 3446 89abcdeffedcba98765432100e1987d001f602f6085823840c0113a11578 3447 1b687474703a2f2f6578616d706c652e636f6d2f66696c652e62696e094b 3448 880c0013a1160116f603f60a45840c0003f60c45840c0017f6 3450 B.7. Example 6: Two Images 3452 Compatibility test, 2 images, simultaneous download and installation, 3453 and secure boot. 3455 { 3456 / authentication-wrapper / 2:h'81586fd28443a10126a0582482025820732 3457 5a7d3acf130d161810c4874f275f658970b7bc5a63cda56e9920a4aaba3a3584088cb9 3458 6211bcc4cdb59cb0022cb213017b2d117bac1a5460ae92903acc196282f7888368bf0a 3459 065756e43f53cdbeee367e9523312063e8eaad0889a7cee371859' / [ 3460 h'd28443a10126a05824820258207325a7d3acf130d161810c4874f275f658 3461 970b7bc5a63cda56e9920a4aaba3a3584088cb96211bcc4cdb59cb0022cb213017b2d1 3462 17bac1a5460ae92903acc196282f7888368bf0a065756e43f53cdbeee367e952331206 3463 3e8eaad0889a7cee371859' / 18([ 3464 / protected / h'a10126' / { 3465 / alg / 1:-7 / "ES256" /, 3466 } /, 3467 / unprotected / { 3468 }, 3469 / payload / h'820258207325a7d3acf130d161810c4874f275f6 3470 58970b7bc5a63cda56e9920a4aaba3a3' / [ 3471 / algorithm-id / 2 / "sha256" /, 3472 / digest-bytes / 3473 h'"7325a7d3acf130d161810c4874f275f658970b7bc5a63cda56e9920a4aaba3a3"' 3474 ] /, 3475 / signature / h'"88cb96211bcc4cdb59cb0022cb213017b2d11 3477 7bac1a5460ae92903acc196282f7888368bf0a065756e43f53cdbeee367e9523312063 3478 e8eaad0889a7cee371859"' 3479 ]) / 3480 ] /, 3481 / manifest / 3:h'a50101020303589da20244818141000458938814a20150fa6 3482 b4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450f825 3483 8308405f614a20358248202582000112233445566778899aabbccddeeff0123456789a 3484 bcdeffedcba98765432100e1987d058328405f614a2035824820258200123456789abc 3485 deffedcba987654321000112233445566778899aabbccddeeff0e1a00012c2201f602f 3486 6095853860f8258248405f613a115781c687474703a2f2f6578616d706c652e636f6d2 3487 f66696c65312e62696e58248405f613a115781c687474703a2f2f6578616d706c652e6 3488 36f6d2f66696c65322e62696e15f603f60a438203f6' / { 3489 / manifest-version / 1:1, 3490 / manifest-sequence-number / 2:3, 3491 / common / 3:h'a20244818141000458938814a20150fa6b4a53d5ad5fdfb 3492 e9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450f8258308405f614a20 3493 358248202582000112233445566778899aabbccddeeff0123456789abcdeffedcba987 3494 65432100e1987d058328405f614a2035824820258200123456789abcdeffedcba98765 3495 4321000112233445566778899aabbccddeeff0e1a00012c2201f602f6' / { 3496 / components / 2:h'81814100' / [ 3497 [h'"00"'] 3498 ] /, 3499 / common-sequence / 4:h'8814a20150fa6b4a53d5ad5fdfbe9de663 3500 e4d41ffe02501492af1425695e48bf429b2d51f2ab450f8258308405f614a203582482 3501 02582000112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210 3502 0e1987d058328405f614a2035824820258200123456789abcdeffedcba987654321000 3503 112233445566778899aabbccddeeff0e1a00012c2201f602f6' / [ 3504 / directive-override-parameters / 20,{ 3505 / vendor-id / 3506 1:h'"fa6b4a53d5ad5fdfbe9de663e4d41ffe"' / fa6b4a53-d5ad-5fdf- 3507 be9d-e663e4d41ffe /, 3508 / class-id / 3509 2:h'"1492af1425695e48bf429b2d51f2ab45"' / 3510 1492af14-2569-5e48-bf42-9b2d51f2ab45 /, 3511 } , 3512 / directive-try-each / 15,[ 3513 h'8405f614a20358248202582000112233445566778899aabb 3514 ccddeeff0123456789abcdeffedcba98765432100e1987d0' / [ 3515 / condition-component-offset / 5,F6 / nil / , 3516 / directive-override-parameters / 20,{ 3517 / image-digest / 3:h'820258200011223344556 3518 6778899aabbccddeeff0123456789abcdeffedcba9876543210' / [ 3519 / algorithm-id / 2 / "sha256" /, 3520 / digest-bytes / 3521 h'"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210"' 3522 ] /, 3523 / image-size / 14:34768, 3524 } 3526 ] / , 3527 h'8405f614a2035824820258200123456789abcdeffedcba98 3528 7654321000112233445566778899aabbccddeeff0e1a00012c22' / [ 3529 / condition-component-offset / 5,F6 / nil / , 3530 / directive-override-parameters / 20,{ 3531 / image-digest / 3:h'820258200123456789abc 3532 deffedcba987654321000112233445566778899aabbccddeeff' / [ 3533 / algorithm-id / 2 / "sha256" /, 3534 / digest-bytes / 3535 h'"0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff"' 3536 ] /, 3537 / image-size / 14:76834, 3538 } 3539 ] / 3540 ] , 3541 / condition-vendor-identifier / 1,F6 / nil / , 3542 / condition-class-identifier / 2,F6 / nil / 3543 ] /, 3544 } /, 3545 / install / 9:h'860f8258248405f613a115781c687474703a2f2f657861 3546 6d706c652e636f6d2f66696c65312e62696e58248405f613a115781c687474703a2f2f 3547 6578616d706c652e636f6d2f66696c65322e62696e15f603f6' / [ 3548 / directive-try-each / 15,[ 3549 h'8405f613a115781c687474703a2f2f6578616d706c652e636f6d 3550 2f66696c65312e62696e' / [ 3551 / condition-component-offset / 5,F6 / nil / , 3552 / directive-set-parameters / 19,{ 3553 / uri / 21:'http://example.com/file1.bin', 3554 } 3555 ] / , 3556 h'8405f613a115781c687474703a2f2f6578616d706c652e636f6d 3557 2f66696c65322e62696e' / [ 3558 / condition-component-offset / 5,F6 / nil / , 3559 / directive-set-parameters / 19,{ 3560 / uri / 21:'http://example.com/file2.bin', 3561 } 3562 ] / 3563 ] , 3564 / directive-fetch / 21,F6 / nil / , 3565 / condition-image-match / 3,F6 / nil / 3566 ] /, 3567 / validate / 10:h'8203f6' / [ 3568 / condition-image-match / 3,F6 / nil / 3569 ] /, 3570 } /, 3571 } 3573 Total size of manifest without COSE authentication object: 261 3574 Manifest: 3576 a103590100a50101020303589da20244818141000458938814a20150fa6b 3577 4a53d5ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2 3578 ab450f8258308405f614a20358248202582000112233445566778899aabb 3579 ccddeeff0123456789abcdeffedcba98765432100e1987d058328405f614 3580 a2035824820258200123456789abcdeffedcba9876543210001122334455 3581 66778899aabbccddeeff0e1a00012c2201f602f6095853860f8258248405 3582 f613a115781c687474703a2f2f6578616d706c652e636f6d2f66696c6531 3583 2e62696e58248405f613a115781c687474703a2f2f6578616d706c652e63 3584 6f6d2f66696c65322e62696e15f603f60a438203f6 3586 Total size of manifest with COSE authentication object: 378 3588 Manifest with COSE authentication object: 3590 a202587281586fd28443a10126a05824820258207325a7d3acf130d16181 3591 0c4874f275f658970b7bc5a63cda56e9920a4aaba3a3584088cb96211bcc 3592 4cdb59cb0022cb213017b2d117bac1a5460ae92903acc196282f7888368b 3593 f0a065756e43f53cdbeee367e9523312063e8eaad0889a7cee3718590359 3594 0100a50101020303589da20244818141000458938814a20150fa6b4a53d5 3595 ad5fdfbe9de663e4d41ffe02501492af1425695e48bf429b2d51f2ab450f 3596 8258308405f614a20358248202582000112233445566778899aabbccddee 3597 ff0123456789abcdeffedcba98765432100e1987d058328405f614a20358 3598 24820258200123456789abcdeffedcba9876543210001122334455667788 3599 99aabbccddeeff0e1a00012c2201f602f6095853860f8258248405f613a1 3600 15781c687474703a2f2f6578616d706c652e636f6d2f66696c65312e6269 3601 6e58248405f613a115781c687474703a2f2f6578616d706c652e636f6d2f 3602 66696c65322e62696e15f603f60a438203f6 3604 C. Design Rational 3606 In order to provide flexible behavior to constrained devices, while 3607 still allowing more powerful devices to use their full capabilities, 3608 the SUIT manifest encodes the required behavior of a Recipient 3609 device. Behavior is encoded as a specialized byte code, contained in 3610 a CBOR list. This promotes a flat encoding, which simplifies the 3611 parser. The information encoded by this byte code closely matches 3612 the operations that a device will perform, which promotes ease of 3613 processing. The core operations used by most update and trusted 3614 execution operations are represented in the byte code. The byte code 3615 can be extended by registering new operations. 3617 The specialized byte code approach gives benefits equivalent to those 3618 provided by a scripting language or conventional byte code, with two 3619 substantial differences. First, the language is extremely high 3620 level, consisting of only the operations that a device may perform 3621 during update and trusted execution of a firmware image. Second, the 3622 language specifies linear behavior, without reverse branches. 3623 Conditional processing is supported, and parallel and out-of-order 3624 processing may be performed by sufficiently capable devices. 3626 By structuring the data in this way, the manifest processor becomes a 3627 very simple engine that uses a pull parser to interpret the manifest. 3628 This pull parser invokes a series of command handlers that evaluate a 3629 Condition or execute a Directive. Most data is structured in a 3630 highly regular pattern, which simplifies the parser. 3632 The results of this allow a Recipient to implement a very small 3633 parser for constrained applications. If needed, such a parser also 3634 allows the Recipient to perform complex updates with reduced 3635 overhead. Conditional execution of commands allows a simple device 3636 to perform important decisions at validation-time. 3638 Dependency handling is vastly simplified as well. Dependencies 3639 function like subroutines of the language. When a manifest has a 3640 dependency, it can invoke that dependency's commands and modify their 3641 behavior by setting parameters. Because some parameters come with 3642 security implications, the dependencies also have a mechanism to 3643 reject modifications to parameters on a fine-grained level. 3645 Developing a robust permissions system works in this model too. The 3646 Recipient can use a simple ACL that is a table of Identities and 3647 Component Identifier permissions to ensure that operations on 3648 components fail unless they are permitted by the ACL. This table can 3649 be further refined with individual parameters and commands. 3651 Capability reporting is similarly simplified. A Recipient can report 3652 the Commands, Parameters, Algorithms, and Component Identifiers that 3653 it supports. This is sufficiently precise for a manifest author to 3654 create a manifest that the Recipient can accept. 3656 The simplicity of design in the Recipient due to all of these 3657 benefits allows even a highly constrained platform to use advanced 3658 update capabilities. 3660 D. Implementation Conformance Matrix 3662 This section summarizes the functionality a minimal implementation 3663 needs to offer to claim conformance to this specification, in the 3664 absence of an application profile standard specifying otherwise. 3666 The subsequent table shows the conditions. 3668 +-------------------+-----------------+----------------+ 3669 | Name | Reference | Implementation | 3670 +-------------------+-----------------+----------------+ 3671 | Vendor Identifier | Section 9.8.3.1 | REQUIRED | 3672 | | | | 3673 | Class Identifier | Section 9.8.3.1 | REQUIRED | 3674 | | | | 3675 | Device Identifier | Section 9.8.3.1 | OPTIONAL | 3676 | | | | 3677 | Image Match | Section 9.8.3.2 | REQUIRED | 3678 | | | | 3679 | Image Not Match | Section 9.8.3.3 | OPTIONAL | 3680 | | | | 3681 | Use Before | Section 9.8.3.4 | OPTIONAL | 3682 | | | | 3683 | Component Offset | Section 9.8.3.5 | OPTIONAL | 3684 | | | | 3685 | Minimum Battery | Section 9.8.3.6 | OPTIONAL | 3686 | | | | 3687 | Update Authorized | Section 9.8.3.7 | OPTIONAL | 3688 | | | | 3689 | Version | Section 9.8.3.8 | OPTIONAL | 3690 | | | | 3691 | Custom Condition | Section 9.8.3.9 | OPTIONAL | 3692 +-------------------+-----------------+----------------+ 3694 The subsequent table shows the directives. 3696 +-------------------+----------------+------------------------------+ 3697 | Name | Reference | Implementation | 3698 +-------------------+----------------+------------------------------+ 3699 | Set Component | Section | REQUIRED if more than one | 3700 | Index | 9.8.4.1 | component | 3701 | | | | 3702 | Set Dependency | Section | REQUIRED if dependencies | 3703 | Index | 9.8.4.2 | used | 3704 | | | | 3705 | Abort | Section | OPTIONAL | 3706 | | 9.8.4.3 | | 3707 | | | | 3708 | Try Each | Section | OPTIONAL | 3709 | | 9.8.4.4 | | 3710 | | | | 3711 | Process | Section | OPTIONAL | 3712 | Dependency | 9.8.4.5 | | 3713 | | | | 3714 | Set Parameters | Section | OPTIONAL | 3715 | | 9.8.4.6 | | 3716 | | | | 3717 | Override | Section | REQUIRED | 3718 | Parameters | 9.8.4.7 | | 3719 | | | | 3720 | Fetch | Section | REQUIRED for Updater | 3721 | | 9.8.4.8 | | 3722 | | | | 3723 | Copy | Section | OPTIONAL | 3724 | | 9.8.4.9 | | 3725 | | | | 3726 | Run | Section | REQUIRED for Bootloader | 3727 | | 9.8.4.10 | | 3728 | | | | 3729 | Wait For Event | Section | OPTIONAL | 3730 | | 9.8.4.11 | | 3731 | | | | 3732 | Run Sequence | Section | OPTIONAL | 3733 | | 9.8.4.12 | | 3734 | | | | 3735 | Swap | Section | OPTIONAL | 3736 | | 9.8.4.13 | | 3737 +-------------------+----------------+------------------------------+ 3739 The subsequent table shows the parameters. 3741 +------------------+------------------+----------------+ 3742 | Name | Reference | Implementation | 3743 +------------------+------------------+----------------+ 3744 | Vendor ID | Section 9.8.2.1 | REQUIRED | 3745 | | | | 3746 | Class ID | Section 9.8.2.2 | REQUIRED | 3747 | | | | 3748 | Image Digest | Section 9.8.2.3 | REQUIRED | 3749 | | | | 3750 | Image Size | Section 9.8.2.4 | REQUIRED | 3751 | | | | 3752 | Use Before | Section 9.8.2.5 | OPTIONAL | 3753 | | | | 3754 | Component Offset | Section 9.8.2.6 | OPTIONAL | 3755 | | | | 3756 | Encryption Info | Section 9.8.2.7 | OPTIONAL | 3757 | | | | 3758 | Compression Info | Section 9.8.2.8 | OPTIONAL | 3759 | | | | 3760 | Unpack Info | Section 9.8.2.9 | OPTIONAL | 3761 | | | | 3762 | URI | Section 9.8.2.10 | OPTIONAL | 3763 | | | | 3764 | Source Component | Section 9.8.2.11 | OPTIONAL | 3765 | | | | 3766 | Run Args | Section 9.8.2.12 | OPTIONAL | 3767 | | | | 3768 | Device ID | Section 9.8.2.13 | OPTIONAL | 3769 | | | | 3770 | Minimum Battery | Section 9.8.2.14 | OPTIONAL | 3771 | | | | 3772 | Update Priority | Section 9.8.2.15 | OPTIONAL | 3773 | | | | 3774 | Version | Section 9.8.2.16 | OPTIONAL | 3775 | | | | 3776 | Wait Info | Section 9.8.2.17 | OPTIONAL | 3777 | | | | 3778 | URI List | Section 9.8.2.18 | OPTIONAL | 3779 | | | | 3780 | Strict Order | Section 9.8.2.19 | OPTIONAL | 3781 | | | | 3782 | Soft Failure | Section 9.8.2.20 | OPTIONAL | 3783 | | | | 3784 | Custom | Section 9.8.2.21 | OPTIONAL | 3785 +------------------+------------------+----------------+ 3787 Authors' Addresses 3789 Brendan Moran 3790 Arm Limited 3792 EMail: Brendan.Moran@arm.com 3794 Hannes Tschofenig 3795 Arm Limited 3797 EMail: hannes.tschofenig@arm.com 3799 Henk Birkholz 3800 Fraunhofer SIT 3802 EMail: henk.birkholz@sit.fraunhofer.de 3804 Koen Zandberg 3805 Inria 3807 EMail: koen.zandberg@inria.fr