put the test key into the devkey slot

i feel a little more comfortable with this because there are
checks that *any* key in that slot would be treated as a devkey
and would lead to key erasure. so just in case i messed up
something in the other checks, this would trigger a key erasure.

I think there is no way around signing at least a beta image
containing the third party keys if i truly want to check all
the paths, so trying to isolate what it can do is important.
This commit is contained in:
bunnie 2026-02-04 03:14:29 +08:00
parent cf267f096c
commit f17b67c16d

View file

@ -266,8 +266,8 @@ pub fn sign_image(
.map_err(|e| format!("{}", e))?;
let derived_public_key = sk.public_key();
// replace first random data with the derived public key of the fake signer
header.sealed_data.pubkeys[0].pk.copy_from_slice(derived_public_key.as_ref());
// replace devkey slot with the derived public key of the fake signer
header.sealed_data.pubkeys[3].pk.copy_from_slice(derived_public_key.as_ref());
}
let mut protected = Vec::new();