@@ -252,4 +252,103 @@ For more information on FIT security, see
252252The mechanism is also widely covered in conference talks, some of which are
253253listed at `elinux.org <https://elinux.org/Boot_Loaders#U-Boot >`_.
254254
255+ .. _certificate_chain_validation :
256+
257+ Certificate chain validation
258+ ----------------------------
259+
260+ FIT supports certificate chain validation as an alternative to direct public
261+ key verification.
262+ This enables a chain-of-trust model similar to Authenticode with UEFI Secure
263+ Boot.
264+
265+ When the signature's ``format `` property is ``pkcs7 ``, the ``value `` property
266+ contains a PKCS#7/CMS SignedData structure (as used by Authenticode).
267+ The certificate chain is embedded within the SignedData.
268+
269+ Validation proceeds as follows:
270+
271+ #. Parse the PKCS#7 SignedData structure from the ``value `` property
272+ #. Extract the signing certificate and any intermediate certificates
273+ #. Verify the signature using the signing certificate's public key
274+ #. Walk the certificate chain, verifying each certificate's signature against
275+ its issuer's public key
276+ #. Verify the root certificate is trusted by checking its hash against the
277+ bootloader's trust store
278+ #. Verify each certificate's validity period (NotBefore/NotAfter) against
279+ the current time, if a reliable time source is available
280+ #. Verify each certificate includes the Code Signing Extended Key Usage (EKU)
281+ extension (OID ``1.3.6.1.5.5.7.3.3 ``)
282+ #. Check the signature's ``generation `` property against the bootloader's
283+ minimum acceptable generation (see :ref: `certificate_revocation `)
284+
285+ If any step fails, the signature must be rejected.
286+
287+ This format enables compatibility with existing Authenticode tooling and
288+ workflows.
289+
290+ Trust anchors
291+ ~~~~~~~~~~~~~
292+
293+ The bootloader stores trusted root CA certificate hashes in the same secure
294+ storage used for direct public keys (e.g., UEFI secure variables or U-Boot's
295+ control FDT). A root certificate is trusted if its SHA-256 hash matches one in
296+ the trust store.
297+
298+ Extended Key Usage
299+ ~~~~~~~~~~~~~~~~~~
300+
301+ Certificates used for FIT signing must include the Code Signing EKU extension
302+ (OID ``1.3.6.1.5.5.7.3.3 ``, id-kp-codeSigning).
303+ This is the same OID used by Authenticode and UEFI Secure Boot.
304+ It prevents certificates issued for other purposes (e.g., TLS, email) from
305+ being misused to sign firmware images.
306+
307+ Intermediate CA certificates in the chain should include the
308+ ``anyExtendedKeyUsage `` OID or the Code Signing OID.
309+
310+ .. _certificate_revocation :
311+
312+ Certificate revocation
313+ ----------------------
314+
315+ FIT uses generation-based revocation for simplicity.
316+
317+ The signature node includes:
318+
319+ - ``compatible ``: identifies the signing authority (e.g.,
320+ ``"vendor,product-signing" ``)
321+ - ``generation ``: integer generation number
322+
323+ The bootloader maintains a minimum acceptable generation per ``compatible ``
324+ value in secure storage.
325+ This allows different signing authorities to manage revocation independently;
326+ one vendor can revoke old signatures without affecting another vendor's
327+ signatures.
328+
329+ During validation, the bootloader:
330+
331+ #. Looks up the minimum generation for the signature's ``compatible `` value
332+ #. Rejects the signature if its ``generation `` is less than the stored minimum
333+
334+ To revoke, the system administrator increments the minimum generation for a
335+ specific ``compatible `` value in the bootloader's secure storage;
336+ all signatures with that ``compatible `` and lower generation numbers become
337+ invalid.
338+
339+ This approach has several advantages:
340+
341+ - Simple to implement (integer comparison per signing authority)
342+ - No need to track individual revoked certificate serial numbers
343+ - No network access required (unlike OCSP)
344+ - Deterministic and fast
345+ - Multiple signing authorities can coexist
346+
347+ To revoke and re-issue:
348+
349+ #. Issue new signatures with a higher generation number
350+ #. Update the FIT with new signatures
351+ #. Increment the bootloader's minimum generation for that ``compatible `` value
352+ #. All older signatures from that authority are now rejected
353+
255354..
sectionauthor ::
Simon Glass <[email protected] >
0 commit comments