-
Notifications
You must be signed in to change notification settings - Fork 11
/
draft-ietf-suit-manifest.xml
4917 lines (4169 loc) · 259 KB
/
draft-ietf-suit-manifest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.31 (Ruby 3.2.2) -->
<!DOCTYPE rfc [
<!ENTITY nbsp " ">
<!ENTITY zwsp "​">
<!ENTITY nbhy "‑">
<!ENTITY wj "⁠">
]>
<?rfc rfcedstyle="yes"?>
<?rfc tocindent="yes"?>
<?rfc strict="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc text-list-symbols="-o*+"?>
<?rfc docmapping="yes"?>
<?rfc toc_levels="4"?>
<rfc ipr="trust200902" docName="draft-ietf-suit-manifest-29" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
<front>
<title abbrev="CBOR-based SUIT Manifest">A Concise Binary Object Representation (CBOR)-based Serialization Format for the Software Updates for Internet of Things (SUIT) Manifest</title>
<author initials="B." surname="Moran" fullname="Brendan Moran">
<organization>Arm Limited</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="H." surname="Tschofenig" fullname="Hannes Tschofenig">
<organization></organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="H." surname="Birkholz" fullname="Henk Birkholz">
<organization>Fraunhofer SIT</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="K." surname="Zandberg" fullname="Koen Zandberg">
<organization>Inria</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="Ø." surname="Rønningstad" fullname="Øyvind Rønningstad">
<organization>Nordic Semiconductor</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date year="2024" month="November" day="07"/>
<area>Security</area>
<workgroup>SUIT</workgroup>
<keyword>Internet-Draft</keyword>
<abstract>
<t>This specification describes the format of a manifest. A manifest is
a bundle of metadata about code/data obtained by a recipient (chiefly
the firmware for an IoT device), where to find the code/data, the
devices to which it applies, and cryptographic information protecting
the manifest. Software updates and Trusted Invocation both tend to use
sequences of common operations, so the manifest encodes those sequences
of operations, rather than declaring the metadata.</t>
</abstract>
</front>
<middle>
<section anchor="introduction"><name>Introduction</name>
<t>A firmware update mechanism is an essential security feature for IoT devices to deal with vulnerabilities. The transport of firmware images to the devices themselves is important security aspect. Luckily, there are already various device management solutions available offering the distribution of firmware images to IoT devices. Equally important is the inclusion of metadata about the conveyed firmware image (in the form of a manifest) and the use of a security wrapper to provide end-to-end security protection to detect modifications and (optionally) to make reverse engineering more difficult. Firmware signing allows the author, who builds the firmware image, to be sure that no other party (including potential adversaries) can install firmware updates on IoT devices without adequate privileges. For confidentiality protected firmware images it is additionally required to encrypt the firmware image and to distribute the content encryption key securely. The support for firmware and payload encryption via the SUIT manifest format is described in a companion document <xref target="I-D.ietf-suit-firmware-encryption"/>. Starting security protection at the author is a risk mitigation technique so firmware images and manifests can be stored on untrusted repositories; it also reduces the scope of a compromise of any repository or intermediate system to be no worse than a denial of service.</t>
<t>A manifest is a bundle of metadata about the firmware for an IoT device, where to
find the firmware, and the devices to which it applies.</t>
<t>This specification defines the SUIT manifest format.
It is intended to meet several goals:</t>
<t><list style="symbols">
<t>Meet the requirements defined in <xref target="RFC9124"/>.</t>
<t>Simple to parse on a constrained node.</t>
<t>Simple to process on a constrained node.</t>
<t>Compact encoding.</t>
<t>Comprehensible by an intermediate system.</t>
<t>Expressive enough to enable advanced use cases on advanced nodes.</t>
<t>Extensible.</t>
</list></t>
<t>The SUIT manifest can be used for a variety of purposes throughout its lifecycle, such as:</t>
<t><list style="symbols">
<t>a Network Operator to reason about compatibility of a firmware, such as timing and acceptance of firmware updates.</t>
<t>a Device Operator to reason about the impact of a firmware.</t>
<t>a device to reason about the authority & authenticity of a firmware prior to installation.</t>
<t>a device to reason about the applicability of a firmware.</t>
<t>a device to reason about the installation of a firmware.</t>
<t>a device to reason about the authenticity & encoding of a firmware at boot.</t>
</list></t>
<t>Each of these uses happens at a different stage of the manifest lifecycle, so each has different requirements.</t>
<t>It is assumed that the reader is familiar with the high-level firmware update architecture <xref target="RFC9019"/> and the threats, requirements, and user stories in <xref target="RFC9124"/>.</t>
<t>The design of this specification is based on an observation that the vast majority of operations that a device can perform during an update or Trusted Invocation are composed of a small group of operations:</t>
<t><list style="symbols">
<t>Copy some data from one place to another</t>
<t>Transform some data</t>
<t>Digest some data and compare to an expected value</t>
<t>Compare some system parameters to an expected value</t>
<t>Run some code</t>
</list></t>
<t>In this document, these operations are called commands. Commands are classed as either conditions or directives. Conditions have no side-effects, while directives do have side-effects. Conceptually, a sequence of commands is like a script but the language is tailored to software updates and Trusted Invocation.</t>
<t>The available commands support simple steps, such as copying a firmware image from one place to another, checking that a firmware image is correct, verifying that the specified firmware is the correct firmware for the device, or unpacking a firmware. By using these steps in different orders and changing the parameters they use, a broad range of use cases can be supported. The SUIT manifest uses this observation to optimize metadata for consumption by constrained devices.</t>
<t>While the SUIT manifest is informed by and optimized for firmware update and Trusted Invocation use cases, there is nothing in the SUIT Information Model <xref target="RFC9124"/> that restricts its use to only those use cases. Other use cases include the management of trusted applications (TAs) in a Trusted Execution Environment (TEE), as discussed in <xref target="RFC9397"/>.</t>
</section>
<section anchor="conventions-and-terminology"><name>Conventions and Terminology</name>
<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
<t>Additionally, the following terminology is used throughout this document:</t>
<t><list style="symbols">
<t>SUIT: Software Update for the Internet of Things, also the IETF working group for this standard.</t>
<t>Payload: A piece of information to be delivered. Typically Firmware for the purposes of SUIT.</t>
<t>Resource: A piece of information that is used to construct a payload.</t>
<t>Manifest: A manifest is a bundle of metadata about the firmware for an IoT device, where to
find the firmware, and the devices to which it applies.</t>
<t>Envelope: A container with the manifest, an authentication wrapper with cryptographic information protecting the manifest, authorization information, and severable elements. Severable elements can be removed from the manifest without impacting its security, see <xref target="severable-fields"/>.</t>
<t>Update: One or more manifests that describe one or more payloads.</t>
<t>Update Authority: The owner of a cryptographic key used to sign updates, trusted by Recipients.</t>
<t>Recipient: The system, typically an IoT device, that receives and processes a manifest.</t>
<t>Manifest Processor: A component of the Recipient that consumes Manifests and executes the commands in the Manifest.</t>
<t>Component: An updatable logical block of the Firmware, Software, configuration, or data of the Recipient.</t>
<t>Component Set: A group of interdependent Components that must be updated simultaneously.</t>
<t>Command: A Condition or a Directive.</t>
<t>Condition: A test for a property of the Recipient or its Components.</t>
<t>Directive: An action for the Recipient to perform.</t>
<t>Trusted Invocation: A process by which a system ensures that only trusted code is executed, for example secure boot or launching a Trusted Application.</t>
<t>A/B images: Dividing a Recipient's storage into two or more bootable images, at different offsets, such that the active image can write to the inactive image(s).</t>
<t>Record: The result of a Command and any metadata about it.</t>
<t>Report: A list of Records.</t>
<t>Procedure: The process of invoking one or more sequences of commands.</t>
<t>Update Procedure: A procedure that updates a Recipient by fetching dependencies and images, and installing them.</t>
<t>Invocation Procedure: A procedure in which a Recipient verifies dependencies and images, loading images, and invokes one or more image.</t>
<t>Software: Instructions and data that allow a Recipient to perform a useful function.</t>
<t>Firmware: Software that is typically changed infrequently, stored in nonvolatile memory, and small enough to apply to <xref target="RFC7228"/> Class 0-2 devices.</t>
<t>Image: Information that a Recipient uses to perform its function, typically firmware/software, configuration, or resource data such as text or images. Also, a Payload, once installed is an Image.</t>
<t>Slot: One of several possible storage locations for a given Component, typically used in A/B image systems</t>
<t>Abort: An event in which the Manifest Processor immediately halts execution of the current Procedure. It creates a Record of an error condition.</t>
<t>Pull parser: A parser that traverses the data and extracts information on an as-needed basis.</t>
<t>Severable element: An element of the manifest that supports elision of hashed data. If a hash of the data is included in the manifest and the data is included in the envelope, then that data may be elided.</t>
</list></t>
</section>
<section anchor="how-to-use-this-document"><name>How to use this Document</name>
<t>This specification covers five aspects of firmware update:</t>
<t><list style="symbols">
<t><xref target="background"/> describes the device constraints, use cases, and design principles that informed the structure of the manifest.</t>
<t><xref target="metadata-structure-overview"/> gives a general overview of the metadata structure to inform the following sections</t>
<t><xref target="interpreter-behavior"/> describes what actions a Manifest processor should take.</t>
<t><xref target="creating-manifests"/> describes the process of creating a Manifest.</t>
<t><xref target="metadata-structure"/> specifies the content of the Envelope and the Manifest.</t>
</list></t>
<t>To implement an updatable device, see <xref target="interpreter-behavior"/> and <xref target="metadata-structure"/>.
To implement a tool that generates updates, see <xref target="creating-manifests"/> and <xref target="metadata-structure"/>.</t>
<t>The IANA consideration section, see <xref target="iana"/>, provides instructions to IANA to create several registries. This section also provides the CBOR labels for the structures defined in this document.</t>
<t>The complete CDDL description is provided in <xref target="full-cddl"/>, examples are given in <xref target="examples"/> and a design rationale is offered in <xref target="design-rationale"/>. Finally, <xref target="implementation-matrix"/> summarizes the mandatory-to-implement features of this specification.</t>
<t>Additional specifications describe functionality needed to implement all of the requirements of <xref target="RFC9124"/>, such as:</t>
<t><list style="symbols">
<t>Firmware encryption <xref target="I-D.ietf-suit-firmware-encryption"/></t>
<t>Update management <xref target="I-D.ietf-suit-update-management"/></t>
<t>Dependency manifests <xref target="I-D.ietf-suit-trust-domains"/></t>
<t>Secure reporting of the update status <xref target="I-D.ietf-suit-report"/></t>
</list></t>
<t>A technique to compress firmware images may be standardized in the future.</t>
</section>
<section anchor="background"><name>Background</name>
<t>Distributing software updates to diverse devices with diverse trust anchors in a coordinated system presents unique challenges. Devices have a broad set of constraints, requiring different metadata to make appropriate decisions. There may be many actors in production IoT systems, each of whom has some authority. Distributing firmware in such a multi-party environment presents additional challenges. Each party requires a different subset of data. Some data may not be accessible to all parties. Multiple signatures may be required from parties with different authorities. This topic is covered in more depth in <xref target="RFC9019"/>. The security aspects are described in <xref target="RFC9124"/>.</t>
<section anchor="iot-firmware-update-constraints"><name>IoT Firmware Update Constraints</name>
<t>The various constraints of IoT devices and the range of use cases that need to be supported create a broad set of requirements. For example, devices with:</t>
<t><list style="symbols">
<t>limited processing power and storage may require a simple representation of metadata.</t>
<t>bandwidth constraints may require firmware compression or partial update support.</t>
<t>bootloader complexity constraints may require simple selection between two bootable images.</t>
<t>small internal storage may require external storage support.</t>
<t>multiple microcontrollers may require coordinated update of all applications.</t>
<t>large storage and complex functionality may require parallel update of many software components.</t>
<t>extra information may need to be conveyed in the manifest in the earlier stages of the device lifecycle before those data items are stripped when the manifest is delivered to a constrained device.</t>
</list></t>
<t>Supporting the requirements introduced by the constraints on IoT devices requires the flexibility to represent a diverse set of possible metadata, but also requires that the encoding is kept simple.</t>
</section>
<section anchor="suit-workflow-model"><name>SUIT Workflow Model</name>
<t>There are several fundamental assumptions that inform the model of Update Procedure workflow:</t>
<t><list style="symbols">
<t>Compatibility must be checked before any other operation is performed.</t>
<t>In some applications, payloads must be fetched and validated prior to installation.</t>
</list></t>
<t>There are several fundamental assumptions that inform the model of the Invocation Procedure workflow:</t>
<t><list style="symbols">
<t>Compatibility must be checked before any other operation is performed.</t>
<t>All payloads must be validated prior to loading.</t>
<t>All loaded images must be validated prior to execution.</t>
</list></t>
<t>Based on these assumptions, the manifest is structured to work with a pull parser, where each section of the manifest is used in sequence. The expected workflow for a Recipient installing an update can be broken down into five steps:</t>
<t><list style="numbers">
<t>Verify the signature of the manifest.</t>
<t>Verify the applicability of the manifest.</t>
<t>Fetch payload(s).</t>
<t>Install payload(s).</t>
<t>Verify image(s).</t>
</list></t>
<t>When installation is complete, similar information can be used for validating and invoking images in a further three steps:</t>
<t><list style="numbers">
<t>Verify image(s).</t>
<t>Load image(s).</t>
<t>Invoke image(s).</t>
</list></t>
<t>If verification and invocation is implemented in a bootloader, then the bootloader <bcp14>MUST</bcp14> also verify the signature of the manifest and the applicability of the manifest in order to implement secure boot workflows. Because signature verifications can be costly in constrained applications, the bootloader may add its own authentication, e.g. a Message Authentication Code (MAC), to the manifest in order to prevent further signature verifications and save energy, provided that the bootloader can protect its authentication key.</t>
</section>
</section>
<section anchor="metadata-structure-overview"><name>Metadata Structure Overview</name>
<t>This section provides a high level overview of the manifest structure. The full description of the manifest structure is in <xref target="manifest-structure"/></t>
<t>The manifest is structured from several key components:</t>
<t><list style="numbers">
<t>The Envelope (see <xref target="ovr-envelope"/>) contains the Authentication Block, the Manifest, any Severable Elements, and any Integrated Payloads.</t>
<t>The Authentication Block (see <xref target="ovr-auth"/>) contains a list of signatures or MACs of the manifest.</t>
<t>The Manifest (see <xref target="ovr-manifest"/>) contains all critical, non-severable metadata that the Recipient requires. It is further broken down into: <list style="numbers">
<t>Critical metadata, such as sequence number.</t>
<t>Common metadata, such as affected components.</t>
<t>Command sequences, directing the Recipient how to install and use the payload(s).</t>
<t>Integrity check values for severable elements.</t>
</list></t>
<t>Severable elements (see <xref target="ovr-severable"/>).</t>
<t>Integrated payloads (see <xref target="ovr-integrated"/>).</t>
</list></t>
<t>The diagram below illustrates the hierarchy of the Envelope.</t>
<figure><artwork><![CDATA[
+-------------------------+
| Envelope |
+-------------------------+
| Authentication Block |
| Manifest --------------> +------------------------------+
| Severable Elements | | Manifest |
| Integrated Payloads | +------------------------------+
+-------------------------+ | Structure Version |
| Sequence Number |
| Reference to Full Manifest |
+------ Common Structure |
| +---- Command Sequences |
+-------------------------+ | | | Digests of Envelope Elements |
| Common Structure | <--+ | +------------------------------+
+-------------------------+ |
| Components IDs | +-> +-----------------------+
| Common Command Sequence ---------> | Command Sequence |
+-------------------------+ +-----------------------+
| List of ( pairs of ( |
| * command code |
| * argument / |
| reporting policy |
| )) |
+-----------------------+
]]></artwork></figure>
<section anchor="ovr-envelope"><name>Envelope</name>
<t>The SUIT Envelope is a container that encloses the Authentication Block, the Manifest, any Severable Elements, and any integrated payloads. The Envelope is used instead of conventional cryptographic envelopes, such as COSE_Envelope because it allows modular processing, severing of elements, and integrated payloads in a way that avoids substantial complexity that would be needed with existing solutions. See <xref target="design-rationale-envelope"/> for a description of the reasoning for this.</t>
<t>See <xref target="envelope"/> for more detail.</t>
</section>
<section anchor="ovr-auth"><name>Authentication Block</name>
<t>The Authentication Block contains a bstr-wrapped SUIT Digest Container, see <xref target="SUIT_Digest"/>, and one or more <xref target="RFC9052"/> CBOR Object Signing and Encryption (COSE) authentication blocks. These blocks are one of:</t>
<t><list style="symbols">
<t>COSE_Sign_Tagged</t>
<t>COSE_Sign1_Tagged</t>
<t>COSE_Mac_Tagged</t>
<t>COSE_Mac0_Tagged</t>
</list></t>
<t>Each of these objects is used in detached payload mode. The payload is the bstr-wrapped SUIT_Digest.</t>
<t>See <xref target="authentication-info"/> for more detail.</t>
</section>
<section anchor="ovr-manifest"><name>Manifest</name>
<t>The Manifest contains most metadata about one or more images. The Manifest is divided into Critical Metadata, Common Metadata, Command Sequences, and Integrity Check Values.</t>
<t>See <xref target="manifest-structure"/> for more detail.</t>
<section anchor="ovr-critical"><name>Critical Metadata</name>
<t>Some metadata needs to be accessed before the manifest is processed. This metadata can be used to determine which manifest is newest and whether the structure version is supported. It also <bcp14>MAY</bcp14> provide a URI for obtaining a canonical copy of the manifest and Envelope.</t>
<t>See <xref target="manifest-version"/>, <xref target="manifest-seqnr"/>, and <xref target="manifest-reference-uri"/> for more detail.</t>
</section>
<section anchor="ovr-common"><name>Common</name>
<t>Some metadata is used repeatedly and in more than one command sequence. In order to reduce the size of the manifest, this metadata is collected into the Common section. Common is composed of two parts: a list of components referenced by the manifest, and a command sequence to execute prior to each other command sequence. The common command sequence is typically used to set commonly used values and perform compatibility checks. The common command sequence <bcp14>MUST NOT</bcp14> have any side-effects outside of setting parameter values.</t>
<t>See <xref target="manifest-common"/> for more detail.</t>
</section>
<section anchor="ovr-commands"><name>Command Sequences</name>
<t>Command sequences provide the instructions that a Recipient requires in order to install or use an image. These sequences tell a device to set parameter values, test system parameters, copy data from one place to another, transform data, digest data, and run code.</t>
<t>Command sequences are broken up into three groups: Common Command Sequence (see <xref target="ovr-common"/>), update commands, and secure boot commands.</t>
<t>Update Command Sequences are: Payload Fetch, Payload Installation and, System Validation. An Update Procedure is the complete set of each Update Command Sequence, each preceded by the Common Command Sequence.</t>
<t>Invocation Command Sequences are: System Validation, Image Loading, and Image Invocation. An Invocation Procedure is the complete set of each Invocation Command Sequence, each preceded by the Common Command Sequence.</t>
<t>Command Sequences are grouped into these sets to ensure that there is common coordination between dependencies and dependents on when to execute each command (dependencies are not defined in this specification).</t>
<t>See <xref target="manifest-commands"/> for more detail.</t>
</section>
<section anchor="ovr-integrity"><name>Integrity Check Values</name>
<t>To enable severable elements <xref target="ovr-severable"/>, there needs to be a mechanism to verify the integrity of the severed data. While the severed data stays outside the manifest, for efficiency reasons, Integrity Check Values are used to include the digest of the data in the manifest. Note that Integrated Payloads, see <xref target="ovr-integrated"/>, are integrity-checked using Command Sequences.</t>
<t>See <xref target="integrity-checks"/> for more detail.</t>
</section>
<section anchor="ovr-text"><name>Human-Readable Text</name>
<t>Text is typically a Severable Element (<xref target="ovr-severable"/>). It contains all the text that describes the update. Because text is explicitly for human consumption, it is all grouped together so that it can be Severed easily. The text section has space both for describing the manifest as a whole and for describing each individual component.</t>
<t>See <xref target="manifest-digest-text"/> for more detail.</t>
</section>
</section>
<section anchor="ovr-severable"><name> Severable Elements</name>
<t>Severable Elements are elements of the Envelope (<xref target="ovr-envelope"/>) that have Integrity Check Values (<xref target="ovr-integrity"/>) in the Manifest (<xref target="ovr-manifest"/>). This is a form of elision of hashed data. The elements in the envelope are verified by Integrity Check Values and therefore cannot be replaced with other elements even if they are authenticated elements.</t>
<t>Because of this organisation, these elements can be discarded or "Severed" from the Envelope without changing the signature of the Manifest. This allows savings based on the size of the Envelope in several scenarios, for example:</t>
<t><list style="symbols">
<t>A management system severs the Text sections before sending an Envelope to a constrained Recipient, which saves Recipient bandwidth.</t>
<t>A Recipient severs the Installation section after installing the Update, which saves storage space.</t>
</list></t>
<t>See <xref target="severable-fields"/> for more detail.</t>
</section>
<section anchor="ovr-integrated"><name>Integrated Payloads</name>
<t>In some cases, it is beneficial to include a payload in the Envelope of a manifest. For example:</t>
<t><list style="symbols">
<t>When an update is delivered via a comparatively unconstrained medium, such as a removable mass storage device, it may be beneficial to bundle updates into single files.</t>
<t>When a manifest transports a small payload, such as an encrypted key, that payload may be placed in the manifest's envelope.</t>
</list></t>
<t>See <xref target="template-integrated-payload"/> for more detail.</t>
</section>
</section>
<section anchor="interpreter-behavior"><name>Manifest Processor Behavior</name>
<t>This section describes the behavior of the manifest processor and focuses primarily on interpreting commands in the manifest. However, there are several other important behaviors of the manifest processor: encoding version detection, rollback protection, and authenticity verification are chief among these.</t>
<section anchor="interpreter-setup"><name>Manifest Processor Setup</name>
<t>Prior to executing any command sequence, the manifest processor or its host application <bcp14>MUST</bcp14> inspect the manifest version field and fail when it encounters an unsupported encoding version. Next, the manifest processor or its host application <bcp14>MUST</bcp14> extract the manifest sequence number and perform a rollback check using this sequence number. The exact logic of rollback protection may vary by application, but it has the following properties:</t>
<t><list style="symbols">
<t>Whenever the manifest processor can choose between several manifests, it <bcp14>MUST</bcp14> select the latest valid, authentic manifest.</t>
<t>If the latest valid, authentic manifest fails, it <bcp14>MAY</bcp14> select the next latest valid, authentic manifest, according to application-specific policy.</t>
</list></t>
<t>Here, valid means that a manifest has a supported encoding version and it has not been excluded for other reasons. Reasons for excluding typically involve first executing the manifest and may include:</t>
<t><list style="symbols">
<t>Test failed (e.g. Vendor ID/Class ID).</t>
<t>Unsupported command encountered.</t>
<t>Unsupported parameter encountered.</t>
<t>Unsupported Component Identifier encountered.</t>
<t>Payload not available.</t>
<t>Application crashed when executed.</t>
<t>Watchdog timeout occurred.</t>
<t>Payload verification failed.</t>
<t>Missing required component from a Component Set.</t>
<t>Required parameter not supplied.</t>
</list></t>
<t>These failure reasons <bcp14>MAY</bcp14> be combined with retry mechanisms prior to marking a manifest as invalid.</t>
<t>Selecting an older manifest in the event of failure of the latest valid manifest is one possible strategy to provide robustness of the firmware update process. It may not be appropriate for all applications. In particular Trusted Execution Environments <bcp14>MAY</bcp14> require a failure to invoke a new installation, rather than a rollback approach. See <xref section="4.2.1" sectionFormat="comma" target="RFC9124"/> for more discussion on the security considerations that apply to rollback.</t>
<t>Following these initial tests, the manifest processor clears all parameter storage. This ensures that the manifest processor begins without any leaked data.</t>
</section>
<section anchor="required-checks"><name> Required Checks</name>
<t>The <bcp14>RECOMMENDED</bcp14> process is to verify the signature of the manifest prior to parsing/executing any section of the manifest. This guards the parser against arbitrary input by unauthenticated third parties, but it costs extra energy when a Recipient receives an incompatible manifest.</t>
<t>When validating authenticity of manifests, the manifest processor <bcp14>MAY</bcp14> use an ACL (see <xref target="access-control-lists"/>) to determine the extent of the rights conferred by that authenticity.</t>
<t>Once a valid, authentic manifest has been selected, the manifest processor <bcp14>MUST</bcp14> examine the component list and
check that the number of components listed in the manifest is not larger than the number in the target system.</t>
<t>For each listed component, the manifest processor <bcp14>MUST</bcp14> provide storage for the supported parameters. If the manifest processor does not have sufficient temporary storage to process the parameters for all components, it <bcp14>MAY</bcp14> process components serially for each command sequence. See <xref target="serial-processing"/> for more details.</t>
<t>The manifest processor <bcp14>SHOULD</bcp14> check that the shared sequence contains at least Check Vendor Identifier command and at least one Check Class Identifier command.</t>
<t>Because the shared sequence contains Check Vendor Identifier and Check Class Identifier command(s), no custom commands are permitted in the shared sequence. This ensures that any custom commands are only executed by devices that understand them.</t>
<t>If the manifest contains more than one component, each command sequence <bcp14>MUST</bcp14> begin with a Set Component Index <xref target="suit-directive-set-component-index"/>.</t>
<t>If a Recipient supports groups of interdependent components (a Component Set), then it <bcp14>SHOULD</bcp14> verify that all Components in the Component Set are specified by one update, that is:</t>
<t><list style="numbers">
<t>the manifest Author has sufficient permissions for the requested operations (see <xref target="access-control-lists"/>) and</t>
<t>the manifest specifies a digest and a payload for every Component in the Component Set.</t>
</list></t>
</section>
<section anchor="interpreter-fundamental-properties"><name>Interpreter Fundamental Properties</name>
<t>The interpreter has a small set of design goals:</t>
<t><list style="numbers">
<t>Executing an update <bcp14>MUST</bcp14> either result in an error, or a correct system state that can be checked against known digests.</t>
<t>Executing a Trusted Invocation <bcp14>MUST</bcp14> either result in an error, or an invoked image.</t>
<t>Executing the same manifest on multiple Recipients <bcp14>MUST</bcp14> result in the same system state.</t>
</list></t>
<t>NOTE: when using A/B images, the manifest functions as two (or more) logical manifests, each of which applies to a system in a particular starting state. With that provision, design goal 3 holds.</t>
<section anchor="resilience-to-disruption"><name>Resilience to Disruption</name>
<t>As required in <xref section="3" sectionFormat="of" target="RFC9019"/> and as an extension of design goal 1, devices must remain operable after a disruption, such as a power failure or network interruption, interrupts the update process.</t>
<t>The manifest processor must be resilient to these faults. In order to enable this resilience, systems implementing the manifest processor <bcp14>MUST</bcp14> make the following guarantees:</t>
<t>One of:
1. A fallback/recovery image is provided so that a disrupted system can apply the SUIT Manifest again.
2. Manifest Authors <bcp14>MUST</bcp14> construct Manifests in such a way that repeated partial invocations of any Manifest always results in a correct system state. Typically this is done by using Try-Each and Conditions to bypass operations that have already been completed.
3. A journal of manifest operations is stored in nonvolatile memory. The journal enables the parser to re-create the state just prior to the disruption. This journal can, for example, be a SUIT Report or a journaling file system.</t>
<figure><artwork><![CDATA[
AND
]]></artwork></figure>
<t><list style="numbers">
<t>Where a command is not repeatable because of the way in which it alters system state (e.g. swapping images or in-place delta) it <bcp14>MUST</bcp14> be resumable or revertible. This applies to commands that modify at least one source component as well as the destination component.</t>
</list></t>
</section>
</section>
<section anchor="command-behavior"><name>Abstract Machine Description</name>
<t>The heart of the manifest is the list of commands, which are processed by a Manifest Processor -- a form of interpreter. This Manifest Processor can be modeled as a simple abstract machine. This machine consists of several data storage locations that are modified by commands.</t>
<t>There are two types of commands, namely those that modify state (directives) and those that perform tests (conditions). Parameters are used as the inputs to commands. Some directives offer control flow operations. Directives target a specific component. A component is a unit of code or data that can be targeted by an update. Components are identified by Component Identifiers, but referenced in commands by Component Index; Component Identifiers are arrays of binary strings and a Component Index is an index into the array of Component Identifiers.</t>
<t>Conditions <bcp14>MUST NOT</bcp14> have any side-effects other than informing the interpreter of success or failure. The Interpreter does not Abort if the Soft Failure flag (<xref target="suit-parameter-soft-failure"/>) is set when a Condition reports failure.</t>
<t>Directives <bcp14>MAY</bcp14> have side-effects in the parameter table, the interpreter state, or the current component. The Interpreter <bcp14>MUST</bcp14> Abort if a Directive reports failure regardless of the Soft Failure flag.</t>
<t>To simplify the logic describing the command semantics, the object "current" is used. It represents the component identified by the Component Index:</t>
<figure><artwork><![CDATA[
current := components[component-index]
]]></artwork></figure>
<t>As a result, Set Component Index is described as current := components[arg].</t>
<t>The following table describes the semantics of each operation. The pseudo-code semantics are inspired by the Python programming language.</t>
<texttable>
<ttcol align='left'>pseudo-code operation</ttcol>
<ttcol align='left'>Semantics</ttcol>
<c>assert(test)</c>
<c>When test is false, causes an error return</c>
<c>store(dest, source)</c>
<c>Writes source into dest</c>
<c>expression0 for-each e in l else expression1</c>
<c>Performs expression0 once for each element in iterable l; performs expression1 if no break is encountered</c>
<c>break</c>
<c>halt a for-each loop</c>
<c>now()</c>
<c>return the current UTC time</c>
<c>expression if test</c>
<c>performs expression if test is true</c>
</texttable>
<t>The following table describes the behavior of each command. "params" represents the parameters for the current component. Most commands operate on a component.</t>
<texttable>
<ttcol align='left'>Command Name</ttcol>
<ttcol align='left'>Semantic of the Operation</ttcol>
<c>Check Vendor Identifier</c>
<c>assert(binary-match(current, current.params[vendor-id]))</c>
<c>Check Class Identifier</c>
<c>assert(binary-match(current, current.params[class-id]))</c>
<c>Verify Image</c>
<c>assert(binary-match(digest(current), current.params[digest]))</c>
<c>Check Content</c>
<c>assert(binary-match(current, current.params[content]))</c>
<c>Set Component Index</c>
<c>current := components[arg]</c>
<c>Override Parameters</c>
<c>current.params[k] := v for-each k,v in arg</c>
<c>Invoke</c>
<c>invoke(current)</c>
<c>Fetch</c>
<c>store(current, fetch(current.params[uri]))</c>
<c>Write</c>
<c>store(current, current.params[content])</c>
<c>Use Before</c>
<c>assert(now() < arg)</c>
<c>Check Component Slot</c>
<c>assert(current.slot-index == arg)</c>
<c>Check Device Identifier</c>
<c>assert(binary-match(current, current.params[device-id]))</c>
<c>Abort</c>
<c>assert(0)</c>
<c>Try Each</c>
<c>(break if (exec(seq) is not error)) for-each seq in arg else assert(0)</c>
<c>Copy</c>
<c>store(current, current.params[src-component])</c>
<c>Swap</c>
<c>swap(current, current.params[src-component])</c>
<c>Run Sequence</c>
<c>exec(arg)</c>
<c>Invoke with Arguments</c>
<c>invoke(current, arg)</c>
</texttable>
</section>
<section anchor="index-true"><name>Special Cases of Component Index</name>
<t>Component Index can take on one of three types:</t>
<t><list style="numbers">
<t>Integer</t>
<t>Array of integers</t>
<t>True</t>
</list></t>
<t>Integers <bcp14>MUST</bcp14> always be supported by Set Component Index. Arrays of integers <bcp14>MUST</bcp14> be supported by Set Component Index if the Recipient supports 3 or more components. True <bcp14>MUST</bcp14> be supported by Set Component Index if the Recipient supports 2 or more components. Each of these operates on the list of components declared in the manifest.</t>
<t>Integer indices are the default case as described in the previous section. An array of integers represents a list of the components (Set Component Index) to which each subsequent command applies. The value True replaces the list of component indices with the full list of components, as defined in the manifest.</t>
<t>When a command is executed, it</t>
<t><list style="numbers">
<t>operates on the component identified by the component index if that index is an integer, or</t>
<t>it operates on each component identified by an array of indicies, or</t>
<t>it operates on every component if the index is the boolean True.</t>
</list></t>
<t>This is described by the following pseudocode:</t>
<figure><artwork><![CDATA[
if component-index is True:
current-list = components
else if component-index is array:
current-list = [ components[idx] for idx in component-index ]
else:
current-list = [ components[component-index] ]
for current in current-list:
cmd(current)
]]></artwork></figure>
<t>Try Each and Run Sequence are affected in the same way as other commands: they are invoked once for each possible Component. This means that the sequences that are arguments to Try Each and Run Sequence are not invoked with Component Index = True, nor are they invoked with array indices. They are only invoked with integer indices. The interpreter loops over the whole sequence, setting the Component Index to each index in turn.</t>
</section>
<section anchor="serial-processing"><name>Serialized Processing Interpreter</name>
<t>In highly constrained devices, where storage for parameters is limited, the manifest processor <bcp14>MAY</bcp14> handle one component at a time, traversing the manifest tree once for each listed component. In this mode, the interpreter ignores any commands executed while the component index is not the current component. This reduces the overall volatile storage required to process the update so that the only limit on number of components is the size of the manifest. However, this approach requires additional processing power.</t>
<t>In order to operate in this mode, the manifest processor loops on each section for every supported component, simply ignoring commands when the current component is not selected.</t>
<t>When a serialized Manifest Processor encounters a component index of True, it does not ignore any commands. It applies them to the current component on each iteration.</t>
</section>
<section anchor="parallel-processing"><name>Parallel Processing Interpreter</name>
<t>To enable parallel or out-of-order processing of Command Sequences, Recipients <bcp14>MAY</bcp14> make use of the Strict Order parameter. The Strict Order parameter indicates to the Manifest Processor that Commands <bcp14>MUST</bcp14> be executed strictly in order. When the Strict Order parameter is False, this indicates to the Manifest Processor that Commands <bcp14>MAY</bcp14> be executed in parallel and/or out of order.</t>
<t>To perform parallel processing, once the Strict Order parameter is set to False, the Recipient <bcp14>MAY</bcp14> add each command to an issue queue for parallel processing or an issue pool for out-of-order processing. The Manifest Processor then executes these pending commands in whatever order or parallelism it deems appropriate. Once there are no more commands to add to the issue queue/pool, the Manifest Processor drains the issue queue/pool by issuing all pending commands and waits for every issued command to complete. The Manifest Processor <bcp14>MAY</bcp14> issue commands before it has completed adding all remaining commands to the issue queue/pool.</t>
<t>While adding commands to the issue queue or pool, if the Manifest Processor encounters any of the following commands, it <bcp14>MUST</bcp14> treat the command as a barrier, draining the issue queue/pool and waiting for all issued commands to complete.</t>
<t><list style="symbols">
<t>Override Parameters.</t>
<t>Set Strict Order = True.</t>
<t>Set Component Index.</t>
</list></t>
<t>Extensions <bcp14>MAY</bcp14> alter this list. Once all issued commands have completed, the Manifest Processor issues the barrier command, after which it may resume parallel processing if Strict Order is still False.</t>
<t>A Component <bcp14>MUST NOT</bcp14> be both a target of an operation and a source of data (for example, in Copy or Swap) in a Command Sequence where Strict Order is False. This would cause a race condition if the Component is written to, then later read from. The Manifest Processor <bcp14>MUST</bcp14> issue an Abort if it detects this exception.</t>
<t>To perform more useful parallel operations, a manifest author may collect sequences of commands in a Run Sequence command. Then, each of these sequences <bcp14>MAY</bcp14> be run in parallel. There are several invocation options for Run Sequence:</t>
<t><list style="symbols">
<t>Component Index is a positive integer, Strict Order is False: Strict Order is set to True before the sequence argument is run. The sequence argument <bcp14>MUST</bcp14> begin with set-component-index.</t>
<t>Component Index is true or an array of positive integers, Strict Order is False: The sequence argument is run once for each component (or each component in the array); the Manifest Processor presets the component index and Strict Order = True before each iteration of the sequence argument.</t>
<t>Component Index is a positive integer, Strict Order is True: No special considerations</t>
<t>Component Index is True or an array of positive integers, Strict Order is True: The sequence argument is run once for each component (or each component in the array); the Manifest Processor presets the component index before each iteration of the sequence argument.</t>
</list></t>
<t>These rules isolate each sequence from each other sequence, ensuring that they operate as expected. When Strict Order = False, any further Set Component Index directives in the Run Sequence command sequence argument <bcp14>MUST</bcp14> cause an Abort. This allows the interpreter that issues Run Sequence commands to check that the first element is correct, then issue the sequence to a parallel execution context to handle the remainder of the sequence.</t>
</section>
</section>
<section anchor="creating-manifests"><name>Creating Manifests</name>
<t>Manifests are created using tools for constructing COSE structures, calculating cryptographic values and compiling desired system state into a sequence of operations required to achieve that state. The process of constructing COSE structures and the calculation of cryptographic values is covered in <xref target="RFC9052"/>.</t>
<t>Compiling desired system state into a sequence of operations can be accomplished in many ways. Several templates are provided below to cover common use-cases. These templates can be combined to produce more complex behavior.</t>
<t>The author <bcp14>MUST</bcp14> ensure that all parameters consumed by a command are set prior to invoking that command. Where Component Index = True, this means that the parameters consumed by each command <bcp14>MUST</bcp14> have been set for each Component.</t>
<t>This section details a set of templates for creating manifests. These templates explain which parameters, commands, and orders of commands are necessary to achieve a stated goal.</t>
<t>NOTE: On systems that support only a single component, Set Component Index has no effect and can be omitted.</t>
<t>NOTE: <strong>A digest <bcp14>MUST</bcp14> always be set using Override Parameters.</strong></t>
<section anchor="template-compatibility-check"><name>Compatibility Check Template</name>
<t>The goal of the compatibility check template ensure that Recipients only install compatible images.</t>
<t>In this template all information is contained in the shared sequence and the following sequence of commands is used:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Vendor ID and Class ID (see <xref target="secparameters"/>)</t>
<t>Check Vendor Identifier condition (see <xref target="uuid-identifiers"/>)</t>
<t>Check Class Identifier condition (see <xref target="uuid-identifiers"/>)</t>
</list></t>
</section>
<section anchor="template-secure-boot"><name>Trusted Invocation Template</name>
<t>The goal of the Trusted Invocation template is to ensure that only authorized code is invoked; such as in Secure Boot or when a Trusted Application is loaded into a TEE.</t>
<t>The following commands are placed into the shared sequence:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Image Digest and Image Size (see <xref target="secparameters"/>)</t>
</list></t>
<t>The system validation sequence contains the following commands:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Check Image Match condition (see <xref target="suit-condition-image-match"/>)</t>
</list></t>
<t>Then, the run sequence contains the following commands:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Invoke directive (see <xref target="suit-directive-invoke"/>)</t>
</list></t>
</section>
<section anchor="firmware-download-template"><name>Component Download Template</name>
<t>The goal of the Component Download template is to acquire and store an image.</t>
<t>The following commands are placed into the shared sequence:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Image Digest and Image Size (see <xref target="secparameters"/>)</t>
</list></t>
<t>Then, the install sequence contains the following commands:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for URI (see <xref target="suit-parameter-uri"/>)</t>
<t>Fetch directive (see <xref target="suit-directive-fetch"/>)</t>
<t>Check Image Match condition (see <xref target="suit-condition-image-match"/>)</t>
</list></t>
<t>The Fetch directive needs the URI parameter to be set to determine where the image is retrieved from. Additionally, the destination of where the component shall be stored has to be configured. The URI is configured via the Set Parameters directive while the destination is configured via the Set Component Index directive.</t>
</section>
<section anchor="template-install"><name>Install Template</name>
<t>The goal of the Install template is to use an image already stored in an identified component to copy into a second component.</t>
<t>This template is typically used with the Component Download template, however a modification to that template is required: the Component Download operations are moved from the Payload Install sequence to the Payload Fetch sequence.</t>
<t>Then, the install sequence contains the following commands:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Source Component (see <xref target="suit-parameter-source-component"/>)</t>
<t>Copy directive (see <xref target="suit-directive-copy"/>)</t>
<t>Check Image Match condition (see <xref target="suit-condition-image-match"/>)</t>
</list></t>
</section>
<section anchor="template-integrated-payload"><name>Integrated Payload Template</name>
<t>The goal of the Integrated Payload template is to install a payload that is included in the manifest envelope. It is identical to the Component Download template (<xref target="firmware-download-template"/>).</t>
<t>An Author <bcp14>MAY</bcp14> choose to place a payload in the envelope of a manifest. The payload envelope key <bcp14>MUST</bcp14> be a string. The payload <bcp14>MUST</bcp14> be serialized in a bstr element.</t>
<t>The URI for a payload enclosed in this way <bcp14>MAY</bcp14> be expressed as a fragment-only reference, as defined in <xref section="4.4" sectionFormat="comma" target="RFC3986"/>, for example: "#device-model-v1.2.3.bin".</t>
<t>An intermediary, such as a Network Operator, <bcp14>MAY</bcp14> choose to pre-fetch a payload and add it to the manifest envelope, using the URI as the key.</t>
</section>
<section anchor="template-load-ext"><name>Load from Nonvolatile Storage Template</name>
<t>The goal of the Load from Nonvolatile Storage template is to load an image from a non-volatile component into a volatile component, for example loading a firmware image from external Flash into RAM.</t>
<t>The following commands are placed into the load sequence:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Source Component (see <xref target="secparameters"/>)</t>
<t>Copy directive (see <xref target="suit-directive-copy"/>)</t>
</list></t>
<t>As outlined in <xref target="command-behavior"/>, the Copy directive needs a source and a destination to be configured. The source is configured via Component Index (with the Set Parameters directive) and the destination is configured via the Set Component Index directive.</t>
</section>
<section anchor="a-b-template"><name>A/B Image Template</name>
<t>The goal of the A/B Image Template is to acquire, validate, and invoke one of two images, based on a test.</t>
<t>The following commands are placed in the common block:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Try Each
<list style="symbols">
<t>First Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot A</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Image Digest A and Image Size A (see <xref target="secparameters"/>)</t>
</list></t>
<t>Second Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot B</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>) for Image Digest B and Image Size B (see <xref target="secparameters"/>)</t>
</list></t>
</list></t>
</list></t>
<t>The following commands are placed in the fetch block or install block</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Try Each
<list style="symbols">
<t>First Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot A</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
<t>Set Parameters directive (see <xref target="suit-directive-override-parameters"/>) for URI A (see <xref target="secparameters"/>)</t>
</list></t>
<t>Second Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot B</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
<t>Set Parameters directive (see <xref target="suit-directive-override-parameters"/>) for URI B (see <xref target="secparameters"/>)</t>
</list></t>
</list></t>
<t>Fetch</t>
</list></t>
<t>If Trusted Invocation (<xref target="template-secure-boot"/>) is used, only the run sequence is added to this template, since the shared sequence is populated by this template:</t>
<t><list style="symbols">
<t>Set Component Index directive (see <xref target="suit-directive-set-component-index"/>)</t>
<t>Try Each
<list style="symbols">
<t>First Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot A</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
</list></t>
<t>Second Sequence:
<list style="symbols">
<t>Override Parameters directive (see <xref target="suit-directive-override-parameters"/>, <xref target="secparameters"/>) for Slot B</t>
<t>Check Slot Condition (see <xref target="suit-condition-component-slot"/>)</t>
</list></t>
</list></t>
<t>Invoke</t>
</list></t>
<t>NOTE: Any test can be used to select between images, Check Slot Condition is used in this template because it is a typical test for execute-in-place devices.</t>
</section>
</section>
<section anchor="metadata-structure"><name>Metadata Structure</name>
<t>The metadata for SUIT updates is composed of several primary constituent parts: Authentication Information, Manifest, Severable Elements and Integrated Payloads.</t>
<t>For a diagram of the metadata structure, see <xref target="metadata-structure-overview"/>.</t>
<section anchor="encoding"><name>Encoding Considerations</name>
<t>The map indices in the envelope encoding are reset to 1 for each map within the structure. This is to keep the indices as small as possible. The goal is to keep the index objects to single bytes (CBOR positive integers 1-23).</t>
<t>Wherever enumerations are used, they are started at 1. This allows detection of several common software errors that are caused by uninitialized variables. Positive numbers in enumerations are reserved for IANA registration. Negative numbers are used to identify application-specific values, as described in <xref target="iana"/>.</t>
<t>All elements of the envelope must be wrapped in a bstr to minimize the complexity of the code that evaluates the cryptographic integrity of the element and to ensure correct serialization for integrity and authenticity checks.</t>
<t>All CBOR maps in the Manifest and manifest envelope <bcp14>MUST</bcp14> be encoded with the canonical CBOR ordering as defined in <xref target="RFC8949"/>.</t>
</section>
<section anchor="envelope"><name>Envelope</name>
<t>The Envelope contains each of the other primary constituent parts of the SUIT metadata. It allows for modular processing of the manifest by ordering components in the expected order of processing.</t>
<t>The Envelope is encoded as a CBOR Map. Each element of the Envelope is enclosed in a bstr, which allows computation of a message digest against known bounds.</t>
</section>
<section anchor="authentication-info"><name>Authenticated Manifests</name>
<t>SUIT_Authentication contains a list of elements, which consist of a SUIT_Digest calculated over the manifest, and zero or more SUIT_Authentication_Block's calculated over the SUIT_Digest.</t>
<figure><artwork><![CDATA[
SUIT_Authentication = [
bstr .cbor SUIT_Digest,
* bstr .cbor SUIT_Authentication_Block
]
SUIT_Authentication_Block /= COSE_Mac_Tagged
SUIT_Authentication_Block /= COSE_Sign_Tagged
SUIT_Authentication_Block /= COSE_Mac0_Tagged
SUIT_Authentication_Block /= COSE_Sign1_Tagged
]]></artwork></figure>
<t>The SUIT_Digest is computed over the bstr-wrapped SUIT_Manifest that is present in the SUIT_Envelope at the suit-manifest key. The SUIT_Digest <bcp14>MUST</bcp14> always be present. The Manifest Processor requires a SUIT_Authentication_Block to be present. The manifest <bcp14>MUST</bcp14> be protected from tampering between the time of creation and the time of signing/MACing.</t>
<t>The SUIT_Authentication_Block is computed using detached payloads, as described in RFC 9052 <xref target="RFC9052"/>. The detached payload in each case is the bstr-wrapped SUIT_Digest at the beginning of the list. Signers (or MAC calculators) <bcp14>MUST</bcp14> verify the SUIT_Digest prior to performing the cryptographic computation to avoid "Time-of-check to time-of-use" type of attack. When multiple SUIT_Authentication_Blocks are present, then each SUIT_Authentication_Block <bcp14>MUST</bcp14> be computed over the same SUIT_Digest but using a different algorithm or signing/MAC authority. This feature also allows to transition to new algorithms, such as post-quantum cryptography (PQC) algorithms.</t>
<t>The SUIT_Authentication structure <bcp14>MUST</bcp14> come before the suit-manifest element, regardless of canonical encoding of CBOR. The algorithms used in SUIT_Authentication are defined by the profiles declared in <xref target="I-D.ietf-suit-mti"/>.</t>
</section>
<section anchor="manifest-structure"><name>Manifest</name>
<t>The manifest contains:</t>
<t><list style="symbols">
<t>a version number (see <xref target="manifest-version"/>)</t>
<t>a sequence number (see <xref target="manifest-seqnr"/>)</t>
<t>a reference URI (see <xref target="manifest-reference-uri"/>)</t>
<t>a common structure with information that is shared between command sequences (see <xref target="manifest-common"/>)</t>
<t>one or more lists of commands that the Recipient should perform (see <xref target="manifest-commands"/>)</t>
<t>a reference to the full manifest (see <xref target="manifest-reference-uri"/>)</t>
<t>human-readable text describing the manifest found in the SUIT_Envelope (see <xref target="manifest-digest-text"/>)</t>
</list></t>
<t>The Text section, or any Command Sequence of the Update Procedure (Image Fetch, Image Installation and, System Validation) can be either a CBOR structure or a SUIT_Digest. In each of these cases, the SUIT_Digest provides for a severable element. Severable elements are <bcp14>RECOMMENDED</bcp14> to implement. In particular, the human-readable text <bcp14>SHOULD</bcp14> be severable, since most useful text elements occupy more space than a SUIT_Digest, but are not needed by the Recipient. Because SUIT_Digest is a CBOR Array and each severable element is a CBOR bstr, it is straight-forward for a Recipient to determine whether an element has been severed. The key used for a severable element is the same in the SUIT_Manifest and in the SUIT_Envelope so that a Recipient can easily identify the correct data in the envelope. See <xref target="integrity-checks"/> for more detail.</t>
<section anchor="manifest-version"><name>suit-manifest-version</name>
<t>The suit-manifest-version indicates the version of serialization used to encode the manifest. Version 1 is the version described in this document. suit-manifest-version is <bcp14>REQUIRED</bcp14> to implement.</t>
</section>
<section anchor="manifest-seqnr"><name>suit-manifest-sequence-number</name>
<t>The suit-manifest-sequence-number is a monotonically increasing anti-rollback counter. Each Recipient <bcp14>MUST</bcp14> reject any manifest that has a sequence number lower than its current sequence number. For convenience, an implementer <bcp14>MAY</bcp14> use a UTC timestamp in seconds as the sequence number. suit-manifest-sequence-number is <bcp14>REQUIRED</bcp14> to implement.</t>
</section>
<section anchor="manifest-reference-uri"><name>suit-reference-uri</name>
<t>suit-reference-uri is a URI where a full version of this manifest can be found. This is convenient for allowing management systems to show the severed elements of a manifest when this URI is reported by a Recipient after installation.
This document is only concerned with the transport of a URI which is
intended for machine readable uses, not human readable uses. The encoding is the same as CBOR
Tag 32, however the tag is omitted because it is implied by context.</t>
</section>
<section anchor="manifest-digest-text"><name>suit-text</name>
<t>suit-text <bcp14>SHOULD</bcp14> be a severable element. suit-text is a map of language identifiers (identical to Tag38 of RFC9290, Appendix A) to language-specific text maps. Each language-specific text map is a map containing two different types of pair:</t>
<t><list style="symbols">
<t>integer => text</t>
<t>SUIT_Component_Identifier => map</t>
</list></t>
<t>The SUIT_Text_Map is defined in the following CDDL.</t>
<figure><artwork><![CDATA[
tag38-ltag = text .regexp "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"
SUIT_Text_Map = {
+ tag38-ltag => SUIT_Text_LMap
}
SUIT_Text_LMap = {
SUIT_Text_Keys,
* SUIT_Component_Identifier => {
SUIT_Text_Component_Keys
}
}
]]></artwork></figure>
<t>Each SUIT_Component_Identifier => map entry contains a map of integer => text values. All SUIT_Component_Identifiers present in suit-text <bcp14>MUST</bcp14> also be present in suit-common (<xref target="manifest-common"/>).</t>
<t>suit-text contains all the human-readable information that describes any and all parts of the manifest, its payload(s) and its resource(s). The text section is typically severable, allowing manifests to be distributed without the text, since end-nodes do not require text. The meaning of each field is described below.</t>
<t>Each section <bcp14>MAY</bcp14> be present. If present, each section <bcp14>MUST</bcp14> be as described. Negative integer IDs are reserved for application-specific text values.</t>
<t>The following table describes the text fields available in suit-text:</t>
<texttable>
<ttcol align='left'>CDDL Structure</ttcol>
<ttcol align='left'>Description</ttcol>
<c>suit-text-manifest-description</c>
<c>Free text description of the manifest</c>
<c>suit-text-update-description</c>
<c>Free text description of the update</c>
<c>suit-text-manifest-json-source</c>
<c>The JSON-formatted document that was used to create the manifest</c>
<c>suit-text-manifest-yaml-source</c>
<c>The YAML-formatted document <xref target="YAML"/> that was used to create the manifest</c>
</texttable>
<t>The following table describes the text fields available in each map identified by a SUIT_Component_Identifier.</t>
<texttable>
<ttcol align='left'>CDDL Structure</ttcol>
<ttcol align='left'>Description</ttcol>
<c>suit-text-vendor-name</c>
<c>Free text vendor name</c>
<c>suit-text-model-name</c>
<c>Free text model name</c>
<c>suit-text-vendor-domain</c>
<c>The domain used to create the vendor-id condition (see <xref target="uuid-identifiers"/>)</c>
<c>suit-text-model-info</c>
<c>The information used to create the class-id condition (see <xref target="uuid-identifiers"/>)</c>