@@ -294,15 +294,31 @@ of the output JSON file.
294294
295295The verification of capsules is performed via
296296[ public-key cryptography] [ wiki-pkc ] (the concepts most relevant here: key pairs
297- and subkeys). This security mechanism uses a root key pair like this:
297+ and subkeys). This security mechanism is meant to use a root key pair like
298+ this:
298299
2993001 . Public key is embedded into the firmware at build time (one key is enough,
300301 but using multiple keys is also supported).
3013022 . Private key is used to (indirectly, via a subkey) sign capsules.
3023033 . Signature embedded in the capsule is validated against the public key when
303304 an update is attempted to decide whether to perform the update.
304305
305- Things to note:
306+ The above describes a situation when ` FmpDxe ` is part of the firmware rather
307+ than a capsule. The latter is more desirable in practice because it distributes
308+ update code in the capsule, thus permitting changes to the update process which
309+ were not anticipated at the time of the previous release. Because ` FmpDxe ` is
310+ the entity responsible for capsule verification, moving it into the capsule
311+ removes the security guarantee unless it's enforced by other means.
312+ ` SignedCapsulePkg ` is one way of addressing this situation which it does by
313+ having a two-part driver: a smaller part lives in the firmware and another one
314+ goes into capsules. However, ` SignedCapsulePkg ` comes with a lot of baggage
315+ and is hard to use when EDK is a payload for a multitude of different devices,
316+ which is why [ sealed capsules] were implemented as a much simpler alternative.
317+ In short: an update capsule with ` FmpDxe ` is embedded as a payload of a capsule
318+ with no drivers, firmware checks signature on the outer capsule's payload and
319+ then processes the inner capsule in its place.
320+
321+ More things to note:
306322
307323- public root key is well-known
308324- private root key is stored in a safe place and nobody but the owner should
@@ -328,6 +344,7 @@ versions will be compatible with one another (unless `LowestSupportedVersion`
328344interferes).
329345
330346[ wiki-pkc ] : https://en.wikipedia.org/wiki/Public-key_cryptography
347+ [ sealed capsules ] : https://github.com/tianocore/edk2/pull/12254
331348
332349## Generating signing keys with OpenSSL
333350
@@ -687,6 +704,18 @@ Output file name is generated based on coreboot options like
687704- ` emulation-qemu-q35-v0.2.0.cap `
688705- ` msi-ms7d25-ddr4-v1.1.9.cap `
689706
707+ ### Sealed capsules
708+
709+ When ` CONFIG_EDK2_CAPSULES_V2 ` is set but ` CONFIG_EDK2_CAPSULES_V2_TRANSITION `
710+ isn't, ` capsule.sh ` produces a two-level capsule where the outer one is signed
711+ by the keys specified by the parameters and the inner one is signed with EDK's
712+ test keys.
713+
714+ The inner capsule is signed because ` FmpDxe ` fails if there is no signature.
715+ The test keys are used because it doesn't matter what the keys are as long as
716+ the signature is valid and matches root key embedded into ` FmpDxe ` (not to be
717+ confused with the key embedded into the firmware itself).
718+
690719### Generating test signing keys
691720
692721In order to test capsules signed with unsupported keys, one needs to generate a
0 commit comments