Commit 72f12ef
committed
vtpm: Add two-layer SealedBlob (AES-256-GCM + TPM2_Seal)
Adds VtpmState (serializable view of the persistent TPM state needed
across cold boots) and SealedBlob — a packed binary container
combining two encryption layers:
Layer 1: AES-256-GCM over the serialized VtpmState. Key + nonce are
derived from a caller-supplied entropy bundle (the kernel
init path uses dual-source HKDF).
Layer 2: TPM2_Seal of a small (60-byte) key bundle holding the AES
key, GCM tag and nonce. This keeps the TPM-sealed payload
well below RSA-2048 size limits while still binding the
bulk data to a TPM-resident parent key.
The packed container is self-describing (magic + version + counter +
PCR digest + length-prefixed sections + SHA-256 trailer) so it can be
written through SealedBlobStore (commit 4) and read back unchanged.
Anti-rollback support: an HMAC-bound monotonic counter is part of the
header so storage backends that share a counter across tenants
(NV index pool) can still distinguish per-VM blob versions.
Signed-off-by: Goodleon-Y <goodleon3@126.com>1 parent 0bdc9df commit 72f12ef
2 files changed
Lines changed: 612 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
0 commit comments