add debugging around restore verification

for some reason we're getting a bogus failure on restore...
This commit is contained in:
bunnie 2022-07-17 18:50:10 +08:00
parent 15ca22eacf
commit a5685c9e62

View file

@ -1480,6 +1480,7 @@ impl<'a> RootKeys {
pb.set_percentage(96);
let pubkey = match update_type {
UpdateType::Restore => {
log::info!("Restore process is verifying using staged public key");
PublicKey::from_bytes(&self.read_staged_key_256(KeyRomLocs::SELFSIGN_PUBKEY)).expect("public key was not valid")
}
_ => PublicKey::from_bytes(&self.read_key_256(KeyRomLocs::SELFSIGN_PUBKEY)).expect("public key was not valid")
@ -2272,14 +2273,15 @@ impl<'a> RootKeys {
/// This is a fast check on the gateware meant to be called on boot just to confirm that we're using a self-signed gateware
pub fn verify_gateware_self_signature(&mut self, maybe_pubkey: Option<&PublicKey>) -> bool {
log::info!("verifying gateware self signature");
log::info!("Verifying gateware called with pubkey {:?}", maybe_pubkey);
let local_pk = PublicKey::from_bytes(&self.read_key_256(KeyRomLocs::SELFSIGN_PUBKEY)).expect("public key was not valid");
let pubkey = if let Some(pk) = maybe_pubkey {
pk
} else {
&local_pk
};
// read the public key directly out of the keyrom
log::info!("Finally decided to use public key {:?}", pubkey);
// read the signature directly out of the keyrom
let gateware_region = self.gateware();
let mut sig_region: [u8; core::mem::size_of::<SignatureInFlash>()] = [0; core::mem::size_of::<SignatureInFlash>()];