diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index 54791cb33..9eddd154b 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -2510,7 +2510,7 @@ impl PddbOs { } } self.entropy.borrow_mut().get_slice(&mut temp); - if (offset / PAGE_SIZE) % 256 == 0 { + if (offset / PAGE_SIZE) % 32 == 0 { // ~one update per megabyte log::info!("Cryptographic 'erase': {}/{}", offset, PDDB_A_LEN); if let Some(modals) = progress { diff --git a/services/pddb/src/main.rs b/services/pddb/src/main.rs index 07eecfa19..9d532801b 100644 --- a/services/pddb/src/main.rs +++ b/services/pddb/src/main.rs @@ -841,7 +841,11 @@ fn wrapped_main() -> ! { unreachable!(); } PasswordState::Incorrect(_failcount) => { - unreachable!(); + log::warn!("PDDB formatted, but keys rotated. Formatting PDDB!"); + pddb_os.pddb_format(false, None).expect("couldn't format PDDB"); + if !try_mount(&mut pddb_os, &mut basis_cache, &mut basis_monitor_notifications) { + panic!("Couldn't format & mount PDDB"); + } } } // the above operation should either succeed or panic, so we are always "success" here