cot-binding.rst 8.68 KB
Newer Older
1
2
3
Chain of trust bindings
=======================

4
5
6
7
The device tree allows to describe the chain of trust with the help of
'cot' node which contain 'manifests' and 'images' as sub-nodes.
'manifests' and 'images' nodes contains number of sub-nodes (i.e. 'certificate'
and 'image' nodes) mentioning properties of the certificate and image respectively.
8

9
10
Also, device tree describes 'non-volatile-counters' node which contains number of
sub-nodes mentioning properties of all non-volatile-counters used in the chain of trust.
11

12
13
14
cot
------------------------------------------------------------------
This is root node which contains 'manifests' and 'images' as sub-nodes
15

16
17

Manifests and Certificate node bindings definition
18
19
----------------------------------------------------------------

20
- Manifests node
21
22
23
24
25
26
27
28
29
        Description: Container of certificate nodes.

        PROPERTIES

        - compatible:
                Usage: required

                Value type: <string>

30
                Definition: must be "arm, cert-descs"
31
32

- Certificate node
33
34
35
36
        Description:

        Describes certificate properties which are used
        during the authentication process.
37
38
39
40

        PROPERTIES

        - root-certificate
41
42
43
44
45
               Usage:

               Required for the certificate with no parent.
               In other words, certificates which are validated
               using root of trust public key.
46

47
               Value type: <boolean>
48
49
50
51
52
53
54

        - image-id
                Usage: Required for every certificate with unique id.

                Value type: <u32>

        - parent
55
                Usage:
56

57
58
59
60
61
62
63
                It refers to their parent image, which typically contains
                information to authenticate the certificate.
                This property is required for all non-root certificates.

                This property is not required for root-certificates
                as root-certificates are validated using root of trust
                public key provided by platform.
64
65
66
67

                Value type: <phandle>

        - signing-key
68
69
70
71
72
73
                Usage:

                This property is used to refer public key node present in
                parent certificate node and it is required property for all
                non-root certificates which are authenticated using public-key
                present in parent certificate.
74

75
76
77
                This property is not required for root-certificates
                as root-certificates are validated using root of trust
                public key provided by platform.
78
79
80
81

                Value type: <phandle>

        - antirollback-counter
82
                Usage:
83

84
85
86
87
88
89
                This property is used by all certificates which are
                protected against rollback attacks using a non-volatile
                counter and it is an optional property.

                This property is used to refer one of the non-volatile
                counter sub-node present in 'non-volatile counters' node.
90
91
92

                Value type: <phandle>

93

94
        SUBNODES
95
            - Description:
96

97
98
              Hash and public key information present in the certificate
              are shown by these nodes.
99

100
101
            - public key node
                  Description: Provide public key information in the certificate.
102

103
104
105
106
                  PROPERTIES

                  - oid
                     Usage:
107

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
                     This property provides the Object ID of public key
                     provided in the certificate which the help of which
                     public key information can be extracted.

                     Value type: <string>

            - hash node
                 Description: Provide the hash information in the certificate.

                 PROPERTIES

                 - oid
                     Usage:

                     This property provides the Object ID of hash provided in
                     the certificate which the help of which hash information
                     can be extracted.

                     Value type: <string>
127
128
129
130
131

Example:

.. code:: c

132
133
134
   cot {
      manifests {
         compatible = "arm, cert-descs”
135
136

         trusted-key-cert: trusted-key-cert {
137
138
139
            root-certificate;
            image-id = <TRUSTED_KEY_CERT_ID>;
            antirollback-counter = <&trusted_nv_counter>;
140

141
142
143
144
145
146
147
            trusted-world-pk: trusted-world-pk {
               oid = TRUSTED_WORLD_PK_OID;
            };
            non-trusted-world-pk: non-trusted-world-pk {
               oid = NON_TRUSTED_WORLD_PK_OID;
            };
         };
148

149
150
151
152
153
         scp_fw_key_cert: scp_fw_key_cert {
            image-id = <SCP_FW_KEY_CERT_ID>;
            parent = <&trusted-key-cert>;
            signing-key = <&trusted_world_pk>;
            antirollback-counter = <&trusted_nv_counter>;
154

155
156
157
158
159
160
161
            scp_fw_content_pk: scp_fw_content_pk {
               oid = SCP_FW_CONTENT_CERT_PK_OID;
            };
         };
         .
         .
         .
162

163
164
165
166
         next-certificate {

         };
      };
167
168
   };

169
Images and Image node bindings definition
170
171
172
173
174
175
176
177
178
179
180
181
-----------------------------------------

- Images node
        Description: Container of image nodes

        PROPERTIES

        - compatible:
                Usage: required

                Value type: <string>

182
                Definition: must be "arm, img-descs"
183
184

- Image node
185
186
187
188
        Description:

        Describes image properties which will be used during
        authentication process.
189
190
191
192
193
194
195
196
197

        PROPERTIES

        - image-id
                Usage: Required for every image with unique id.

                Value type: <u32>

        - parent
198
199
200
201
202
                Usage:

                Required for every image to provide a reference to
                its parent image, which contains the necessary information
                to authenticate it.
203
204
205
206

                Value type: <phandle>

        - hash
207
208
209
210
211
                Usage:

                Required for all images which are validated using
                hash method. This property is used to refer hash
                node present in parent certificate node.
212
213
214

                Value type: <phandle>

215
216
217
218
219
                Note:

                Currently, all images are validated using 'hash'
                method. In future, there may be multiple methods can
                be used to validate the image.
220
221
222
223
224

Example:

.. code:: c

225
226
227
   cot {
      images {
         compatible = "arm, img-descs";
228
229

         scp_bl2_image {
230
231
232
            image-id = <SCP_BL2_IMAGE_ID>;
            parent = <&scp_fw_content_cert>;
            hash = <&scp_fw_hash>;
233
234
235
236
237
238
239
         };

         .
         .
         .

         next-img {
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
   };

non-volatile counter node binding definition
--------------------------------------------

- non-volatile counters node
        Description: Contains properties for non-volatile counters.

        PROPERTIES

        - compatible:
                Usage: required

                Value type: <string>

                Definition: must be "arm, non-volatile-counter"

        - #address-cells
                Usage: required

                Value type: <u32>

265
266
267
268
                Definition:

                Must be set according to address size
                of non-volatile counter register
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283

        - #size-cells
                Usage: required

                Value type: <u32>

                Definition: must be set to 0

        SUBNODE
            - counters node
                    Description: Contains various non-volatile counters present in the platform.

            PROPERTIES

                - reg
284
285
286
287
                    Usage:

                    Register base address of non-volatile counter and it is required
                    property.
288
289
290
291

                    Value type: <u32>

                - oid
292
293
294
295
                    Usage:

                    This property provides the Object ID of non-volatile counter
                    provided in the certificate and it is required property.
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

                    Value type: <string>

Example:
Below is non-volatile counters example for ARM platform

.. code:: c

   non-volatile-counters {
        compatible = "arm, non-volatile-counter";
        #address-cells = <1>;
        #size-cells = <0>;

        counters {
            trusted-nv-counter: trusted_nv_counter {
                reg = <TFW_NVCTR_BASE>;
                oid = TRUSTED_FW_NVCOUNTER_OID;
            };
            non_trusted_nv_counter: non_trusted_nv_counter {
                reg = <NTFW_CTR_BASE>;
                oid = NON_TRUSTED_FW_NVCOUNTER_OID;

            };
        };
   };

Future update to chain of trust binding
---------------------------------------

325
326
This binding document needs to be revisited to generalise some terminologies
which are currently specific to X.509 certificates for e.g. Object IDs.
327

328
*Copyright (c) 2020, Arm Limited. All rights reserved.*