extend sealed data to contain a toolchain hash field

the sealed data records are laid out with some extra space
at the end for future expansion.

The first such expansion added is a toolchain hash, which allows
us to note which toolchain is required to reproduce the current
image.

The change is backward compatible so the version field of
the record is *not* incremented.
This commit is contained in:
bunnie 2026-02-16 18:10:08 +08:00
parent 692fb5fed9
commit da895b2c1f
No known key found for this signature in database

View file

@ -162,6 +162,16 @@ pub struct SealedFields {
///
/// If no valid keys are found, the device is effectively bricked and goes into a "die" state.
pub pubkeys: [Pubkey; 4],
/// Placeholder for baobit commit: this is the hash of the toolchain used to generate the image.
/// In many images, this is just 0's; but for signed release images, this is injected into the file
/// prior to applying the final signature. This injection has to happen after everything is done
/// because the rules of the reproducible build system disallow it from knowing its final commit
/// state: you have to commit its final state, which changes its reported commit state, and so
/// forth, so at build time you can't know what toolchain was used to build you - only after
/// the build is complete is the information revealed to the user.
///
/// This field is long enough to hold a SHA-1 git hash.
pub toolchain: [u8; 20],
}
impl AsRef<[u8]> for SealedFields {
@ -178,6 +188,7 @@ impl Default for SealedFields {
min_semver: [0u8; 16],
semver: [0u8; 16],
pubkeys: [Pubkey::default(); 4],
toolchain: [0u8; 20],
}
}
}