xref: /aosp_15_r20/external/arm-trusted-firmware/docs/components/cot-binding.rst (revision 54fd6939e177f8ff529b10183254802c76df6d08)
1*54fd6939SJiyong ParkChain of trust bindings
2*54fd6939SJiyong Park=======================
3*54fd6939SJiyong Park
4*54fd6939SJiyong ParkThe device tree allows to describe the chain of trust with the help of
5*54fd6939SJiyong Park'cot' node which contain 'manifests' and 'images' as sub-nodes.
6*54fd6939SJiyong Park'manifests' and 'images' nodes contains number of sub-nodes (i.e. 'certificate'
7*54fd6939SJiyong Parkand 'image' nodes) mentioning properties of the certificate and image respectively.
8*54fd6939SJiyong Park
9*54fd6939SJiyong ParkAlso, device tree describes 'non-volatile-counters' node which contains number of
10*54fd6939SJiyong Parksub-nodes mentioning properties of all non-volatile-counters used in the chain of trust.
11*54fd6939SJiyong Park
12*54fd6939SJiyong Parkcot
13*54fd6939SJiyong Park------------------------------------------------------------------
14*54fd6939SJiyong ParkThis is root node which contains 'manifests' and 'images' as sub-nodes
15*54fd6939SJiyong Park
16*54fd6939SJiyong Park
17*54fd6939SJiyong ParkManifests and Certificate node bindings definition
18*54fd6939SJiyong Park----------------------------------------------------------------
19*54fd6939SJiyong Park
20*54fd6939SJiyong Park- Manifests node
21*54fd6939SJiyong Park        Description: Container of certificate nodes.
22*54fd6939SJiyong Park
23*54fd6939SJiyong Park        PROPERTIES
24*54fd6939SJiyong Park
25*54fd6939SJiyong Park        - compatible:
26*54fd6939SJiyong Park                Usage: required
27*54fd6939SJiyong Park
28*54fd6939SJiyong Park                Value type: <string>
29*54fd6939SJiyong Park
30*54fd6939SJiyong Park                Definition: must be "arm, cert-descs"
31*54fd6939SJiyong Park
32*54fd6939SJiyong Park- Certificate node
33*54fd6939SJiyong Park        Description:
34*54fd6939SJiyong Park
35*54fd6939SJiyong Park        Describes certificate properties which are used
36*54fd6939SJiyong Park        during the authentication process.
37*54fd6939SJiyong Park
38*54fd6939SJiyong Park        PROPERTIES
39*54fd6939SJiyong Park
40*54fd6939SJiyong Park        - root-certificate
41*54fd6939SJiyong Park               Usage:
42*54fd6939SJiyong Park
43*54fd6939SJiyong Park               Required for the certificate with no parent.
44*54fd6939SJiyong Park               In other words, certificates which are validated
45*54fd6939SJiyong Park               using root of trust public key.
46*54fd6939SJiyong Park
47*54fd6939SJiyong Park               Value type: <boolean>
48*54fd6939SJiyong Park
49*54fd6939SJiyong Park        - image-id
50*54fd6939SJiyong Park                Usage: Required for every certificate with unique id.
51*54fd6939SJiyong Park
52*54fd6939SJiyong Park                Value type: <u32>
53*54fd6939SJiyong Park
54*54fd6939SJiyong Park        - parent
55*54fd6939SJiyong Park                Usage:
56*54fd6939SJiyong Park
57*54fd6939SJiyong Park                It refers to their parent image, which typically contains
58*54fd6939SJiyong Park                information to authenticate the certificate.
59*54fd6939SJiyong Park                This property is required for all non-root certificates.
60*54fd6939SJiyong Park
61*54fd6939SJiyong Park                This property is not required for root-certificates
62*54fd6939SJiyong Park                as root-certificates are validated using root of trust
63*54fd6939SJiyong Park                public key provided by platform.
64*54fd6939SJiyong Park
65*54fd6939SJiyong Park                Value type: <phandle>
66*54fd6939SJiyong Park
67*54fd6939SJiyong Park        - signing-key
68*54fd6939SJiyong Park                Usage:
69*54fd6939SJiyong Park
70*54fd6939SJiyong Park                This property is used to refer public key node present in
71*54fd6939SJiyong Park                parent certificate node and it is required property for all
72*54fd6939SJiyong Park                non-root certificates which are authenticated using public-key
73*54fd6939SJiyong Park                present in parent certificate.
74*54fd6939SJiyong Park
75*54fd6939SJiyong Park                This property is not required for root-certificates
76*54fd6939SJiyong Park                as root-certificates are validated using root of trust
77*54fd6939SJiyong Park                public key provided by platform.
78*54fd6939SJiyong Park
79*54fd6939SJiyong Park                Value type: <phandle>
80*54fd6939SJiyong Park
81*54fd6939SJiyong Park        - antirollback-counter
82*54fd6939SJiyong Park                Usage:
83*54fd6939SJiyong Park
84*54fd6939SJiyong Park                This property is used by all certificates which are
85*54fd6939SJiyong Park                protected against rollback attacks using a non-volatile
86*54fd6939SJiyong Park                counter and it is an optional property.
87*54fd6939SJiyong Park
88*54fd6939SJiyong Park                This property is used to refer one of the non-volatile
89*54fd6939SJiyong Park                counter sub-node present in 'non-volatile counters' node.
90*54fd6939SJiyong Park
91*54fd6939SJiyong Park                Value type: <phandle>
92*54fd6939SJiyong Park
93*54fd6939SJiyong Park
94*54fd6939SJiyong Park        SUBNODES
95*54fd6939SJiyong Park            - Description:
96*54fd6939SJiyong Park
97*54fd6939SJiyong Park              Hash and public key information present in the certificate
98*54fd6939SJiyong Park              are shown by these nodes.
99*54fd6939SJiyong Park
100*54fd6939SJiyong Park            - public key node
101*54fd6939SJiyong Park                  Description: Provide public key information in the certificate.
102*54fd6939SJiyong Park
103*54fd6939SJiyong Park                  PROPERTIES
104*54fd6939SJiyong Park
105*54fd6939SJiyong Park                  - oid
106*54fd6939SJiyong Park                     Usage:
107*54fd6939SJiyong Park
108*54fd6939SJiyong Park                     This property provides the Object ID of public key
109*54fd6939SJiyong Park                     provided in the certificate which the help of which
110*54fd6939SJiyong Park                     public key information can be extracted.
111*54fd6939SJiyong Park
112*54fd6939SJiyong Park                     Value type: <string>
113*54fd6939SJiyong Park
114*54fd6939SJiyong Park            - hash node
115*54fd6939SJiyong Park                 Description: Provide the hash information in the certificate.
116*54fd6939SJiyong Park
117*54fd6939SJiyong Park                 PROPERTIES
118*54fd6939SJiyong Park
119*54fd6939SJiyong Park                 - oid
120*54fd6939SJiyong Park                     Usage:
121*54fd6939SJiyong Park
122*54fd6939SJiyong Park                     This property provides the Object ID of hash provided in
123*54fd6939SJiyong Park                     the certificate which the help of which hash information
124*54fd6939SJiyong Park                     can be extracted.
125*54fd6939SJiyong Park
126*54fd6939SJiyong Park                     Value type: <string>
127*54fd6939SJiyong Park
128*54fd6939SJiyong ParkExample:
129*54fd6939SJiyong Park
130*54fd6939SJiyong Park.. code:: c
131*54fd6939SJiyong Park
132*54fd6939SJiyong Park   cot {
133*54fd6939SJiyong Park      manifests {
134*54fd6939SJiyong Park         compatible = "arm, cert-descs”
135*54fd6939SJiyong Park
136*54fd6939SJiyong Park         trusted-key-cert: trusted-key-cert {
137*54fd6939SJiyong Park            root-certificate;
138*54fd6939SJiyong Park            image-id = <TRUSTED_KEY_CERT_ID>;
139*54fd6939SJiyong Park            antirollback-counter = <&trusted_nv_counter>;
140*54fd6939SJiyong Park
141*54fd6939SJiyong Park            trusted-world-pk: trusted-world-pk {
142*54fd6939SJiyong Park               oid = TRUSTED_WORLD_PK_OID;
143*54fd6939SJiyong Park            };
144*54fd6939SJiyong Park            non-trusted-world-pk: non-trusted-world-pk {
145*54fd6939SJiyong Park               oid = NON_TRUSTED_WORLD_PK_OID;
146*54fd6939SJiyong Park            };
147*54fd6939SJiyong Park         };
148*54fd6939SJiyong Park
149*54fd6939SJiyong Park         scp_fw_key_cert: scp_fw_key_cert {
150*54fd6939SJiyong Park            image-id = <SCP_FW_KEY_CERT_ID>;
151*54fd6939SJiyong Park            parent = <&trusted-key-cert>;
152*54fd6939SJiyong Park            signing-key = <&trusted_world_pk>;
153*54fd6939SJiyong Park            antirollback-counter = <&trusted_nv_counter>;
154*54fd6939SJiyong Park
155*54fd6939SJiyong Park            scp_fw_content_pk: scp_fw_content_pk {
156*54fd6939SJiyong Park               oid = SCP_FW_CONTENT_CERT_PK_OID;
157*54fd6939SJiyong Park            };
158*54fd6939SJiyong Park         };
159*54fd6939SJiyong Park         .
160*54fd6939SJiyong Park         .
161*54fd6939SJiyong Park         .
162*54fd6939SJiyong Park
163*54fd6939SJiyong Park         next-certificate {
164*54fd6939SJiyong Park
165*54fd6939SJiyong Park         };
166*54fd6939SJiyong Park      };
167*54fd6939SJiyong Park   };
168*54fd6939SJiyong Park
169*54fd6939SJiyong ParkImages and Image node bindings definition
170*54fd6939SJiyong Park-----------------------------------------
171*54fd6939SJiyong Park
172*54fd6939SJiyong Park- Images node
173*54fd6939SJiyong Park        Description: Container of image nodes
174*54fd6939SJiyong Park
175*54fd6939SJiyong Park        PROPERTIES
176*54fd6939SJiyong Park
177*54fd6939SJiyong Park        - compatible:
178*54fd6939SJiyong Park                Usage: required
179*54fd6939SJiyong Park
180*54fd6939SJiyong Park                Value type: <string>
181*54fd6939SJiyong Park
182*54fd6939SJiyong Park                Definition: must be "arm, img-descs"
183*54fd6939SJiyong Park
184*54fd6939SJiyong Park- Image node
185*54fd6939SJiyong Park        Description:
186*54fd6939SJiyong Park
187*54fd6939SJiyong Park        Describes image properties which will be used during
188*54fd6939SJiyong Park        authentication process.
189*54fd6939SJiyong Park
190*54fd6939SJiyong Park        PROPERTIES
191*54fd6939SJiyong Park
192*54fd6939SJiyong Park        - image-id
193*54fd6939SJiyong Park                Usage: Required for every image with unique id.
194*54fd6939SJiyong Park
195*54fd6939SJiyong Park                Value type: <u32>
196*54fd6939SJiyong Park
197*54fd6939SJiyong Park        - parent
198*54fd6939SJiyong Park                Usage:
199*54fd6939SJiyong Park
200*54fd6939SJiyong Park                Required for every image to provide a reference to
201*54fd6939SJiyong Park                its parent image, which contains the necessary information
202*54fd6939SJiyong Park                to authenticate it.
203*54fd6939SJiyong Park
204*54fd6939SJiyong Park                Value type: <phandle>
205*54fd6939SJiyong Park
206*54fd6939SJiyong Park        - hash
207*54fd6939SJiyong Park                Usage:
208*54fd6939SJiyong Park
209*54fd6939SJiyong Park                Required for all images which are validated using
210*54fd6939SJiyong Park                hash method. This property is used to refer hash
211*54fd6939SJiyong Park                node present in parent certificate node.
212*54fd6939SJiyong Park
213*54fd6939SJiyong Park                Value type: <phandle>
214*54fd6939SJiyong Park
215*54fd6939SJiyong Park                Note:
216*54fd6939SJiyong Park
217*54fd6939SJiyong Park                Currently, all images are validated using 'hash'
218*54fd6939SJiyong Park                method. In future, there may be multiple methods can
219*54fd6939SJiyong Park                be used to validate the image.
220*54fd6939SJiyong Park
221*54fd6939SJiyong ParkExample:
222*54fd6939SJiyong Park
223*54fd6939SJiyong Park.. code:: c
224*54fd6939SJiyong Park
225*54fd6939SJiyong Park   cot {
226*54fd6939SJiyong Park      images {
227*54fd6939SJiyong Park         compatible = "arm, img-descs";
228*54fd6939SJiyong Park
229*54fd6939SJiyong Park         scp_bl2_image {
230*54fd6939SJiyong Park            image-id = <SCP_BL2_IMAGE_ID>;
231*54fd6939SJiyong Park            parent = <&scp_fw_content_cert>;
232*54fd6939SJiyong Park            hash = <&scp_fw_hash>;
233*54fd6939SJiyong Park         };
234*54fd6939SJiyong Park
235*54fd6939SJiyong Park         .
236*54fd6939SJiyong Park         .
237*54fd6939SJiyong Park         .
238*54fd6939SJiyong Park
239*54fd6939SJiyong Park         next-img {
240*54fd6939SJiyong Park
241*54fd6939SJiyong Park         };
242*54fd6939SJiyong Park      };
243*54fd6939SJiyong Park   };
244*54fd6939SJiyong Park
245*54fd6939SJiyong Parknon-volatile counter node binding definition
246*54fd6939SJiyong Park--------------------------------------------
247*54fd6939SJiyong Park
248*54fd6939SJiyong Park- non-volatile counters node
249*54fd6939SJiyong Park        Description: Contains properties for non-volatile counters.
250*54fd6939SJiyong Park
251*54fd6939SJiyong Park        PROPERTIES
252*54fd6939SJiyong Park
253*54fd6939SJiyong Park        - compatible:
254*54fd6939SJiyong Park                Usage: required
255*54fd6939SJiyong Park
256*54fd6939SJiyong Park                Value type: <string>
257*54fd6939SJiyong Park
258*54fd6939SJiyong Park                Definition: must be "arm, non-volatile-counter"
259*54fd6939SJiyong Park
260*54fd6939SJiyong Park        - #address-cells
261*54fd6939SJiyong Park                Usage: required
262*54fd6939SJiyong Park
263*54fd6939SJiyong Park                Value type: <u32>
264*54fd6939SJiyong Park
265*54fd6939SJiyong Park                Definition:
266*54fd6939SJiyong Park
267*54fd6939SJiyong Park                Must be set according to address size
268*54fd6939SJiyong Park                of non-volatile counter register
269*54fd6939SJiyong Park
270*54fd6939SJiyong Park        - #size-cells
271*54fd6939SJiyong Park                Usage: required
272*54fd6939SJiyong Park
273*54fd6939SJiyong Park                Value type: <u32>
274*54fd6939SJiyong Park
275*54fd6939SJiyong Park                Definition: must be set to 0
276*54fd6939SJiyong Park
277*54fd6939SJiyong Park        SUBNODE
278*54fd6939SJiyong Park            - counters node
279*54fd6939SJiyong Park                    Description: Contains various non-volatile counters present in the platform.
280*54fd6939SJiyong Park
281*54fd6939SJiyong Park            PROPERTIES
282*54fd6939SJiyong Park                - id
283*54fd6939SJiyong Park                    Usage: Required for every nv-counter with unique id.
284*54fd6939SJiyong Park
285*54fd6939SJiyong Park                    Value type: <u32>
286*54fd6939SJiyong Park
287*54fd6939SJiyong Park                - reg
288*54fd6939SJiyong Park                    Usage:
289*54fd6939SJiyong Park
290*54fd6939SJiyong Park                    Register base address of non-volatile counter and it is required
291*54fd6939SJiyong Park                    property.
292*54fd6939SJiyong Park
293*54fd6939SJiyong Park                    Value type: <u32>
294*54fd6939SJiyong Park
295*54fd6939SJiyong Park                - oid
296*54fd6939SJiyong Park                    Usage:
297*54fd6939SJiyong Park
298*54fd6939SJiyong Park                    This property provides the Object ID of non-volatile counter
299*54fd6939SJiyong Park                    provided in the certificate and it is required property.
300*54fd6939SJiyong Park
301*54fd6939SJiyong Park                    Value type: <string>
302*54fd6939SJiyong Park
303*54fd6939SJiyong ParkExample:
304*54fd6939SJiyong ParkBelow is non-volatile counters example for ARM platform
305*54fd6939SJiyong Park
306*54fd6939SJiyong Park.. code:: c
307*54fd6939SJiyong Park
308*54fd6939SJiyong Park   non_volatile_counters: non_volatile_counters {
309*54fd6939SJiyong Park        compatible = "arm, non-volatile-counter";
310*54fd6939SJiyong Park        #address-cells = <1>;
311*54fd6939SJiyong Park        #size-cells = <0>;
312*54fd6939SJiyong Park
313*54fd6939SJiyong Park        trusted-nv-counter: trusted_nv_counter {
314*54fd6939SJiyong Park           id  = <TRUSTED_NV_CTR_ID>;
315*54fd6939SJiyong Park           reg = <TFW_NVCTR_BASE>;
316*54fd6939SJiyong Park           oid = TRUSTED_FW_NVCOUNTER_OID;
317*54fd6939SJiyong Park        };
318*54fd6939SJiyong Park
319*54fd6939SJiyong Park        non_trusted_nv_counter: non_trusted_nv_counter {
320*54fd6939SJiyong Park           id  = <NON_TRUSTED_NV_CTR_ID>;
321*54fd6939SJiyong Park           reg = <NTFW_CTR_BASE>;
322*54fd6939SJiyong Park           oid = NON_TRUSTED_FW_NVCOUNTER_OID;
323*54fd6939SJiyong Park        };
324*54fd6939SJiyong Park   };
325*54fd6939SJiyong Park
326*54fd6939SJiyong ParkFuture update to chain of trust binding
327*54fd6939SJiyong Park---------------------------------------
328*54fd6939SJiyong Park
329*54fd6939SJiyong ParkThis binding document needs to be revisited to generalise some terminologies
330*54fd6939SJiyong Parkwhich are currently specific to X.509 certificates for e.g. Object IDs.
331*54fd6939SJiyong Park
332*54fd6939SJiyong Park*Copyright (c) 2020, Arm Limited. All rights reserved.*
333