mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add debugging around restore verification
for some reason we're getting a bogus failure on restore...
This commit is contained in:
parent
15ca22eacf
commit
a5685c9e62
1 changed files with 4 additions and 2 deletions
|
|
@ -1480,6 +1480,7 @@ impl<'a> RootKeys {
|
||||||
pb.set_percentage(96);
|
pb.set_percentage(96);
|
||||||
let pubkey = match update_type {
|
let pubkey = match update_type {
|
||||||
UpdateType::Restore => {
|
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_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")
|
_ => 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
|
/// 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 {
|
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 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 {
|
let pubkey = if let Some(pk) = maybe_pubkey {
|
||||||
pk
|
pk
|
||||||
} else {
|
} else {
|
||||||
&local_pk
|
&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 gateware_region = self.gateware();
|
||||||
|
|
||||||
let mut sig_region: [u8; core::mem::size_of::<SignatureInFlash>()] = [0; core::mem::size_of::<SignatureInFlash>()];
|
let mut sig_region: [u8; core::mem::size_of::<SignatureInFlash>()] = [0; core::mem::size_of::<SignatureInFlash>()];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue