diff --git a/services/pddb/locales/i18n.json b/services/pddb/locales/i18n.json index e2bcf0505..ae8f9f5da 100644 --- a/services/pddb/locales/i18n.json +++ b/services/pddb/locales/i18n.json @@ -29,6 +29,12 @@ "zh": "⚠ PDDB 需要重新加密。⚠\n为了安全地执行此操作,您现在必须解锁所有秘密基地。 任何被锁定的基础都可以被覆盖。", "en-tts": "⚠ PDDB needs to be keyed to this device. ⚠\nYou must enumerate all secret Bases now. Any Basis not disclosed could be overwritten." }, + "pddb.churn.request": { + "en": "⚠ PDDB `churn` requested. ⚠\nYou must enumerate all secret Bases now. Any Basis not disclosed could be overwritten.", + "ja": "⚠ PDDBの「チャーン」が要求されました。 ⚠\nこれを安全に行うには、今すぐすべてのシークレットベースのロックを解除する必要があります。 ロックされたままのベーシスは上書きされる可能性があります。", + "zh": "⚠ 请求 PDDB `churn`。⚠\n为了安全地执行此操作,您现在必须解锁所有秘密基地。 任何被锁定的基础都可以被覆盖。", + "en-tts": "⚠ PDDB `churn` requested. ⚠\nYou must enumerate all secret Bases now. Any Basis not disclosed could be overwritten." + }, "pddb.freespace.enumerate": { "en": "Enumerate a Basis?", "ja": "根拠を開示しますか?", @@ -71,6 +77,12 @@ "zh": "继续重新加密?", "en-tts": "Enumeration finished.\n\nShall we proceed to rekeying?" }, + "pddb.churn.finished": { + "en": "Enumeration finished.\n\nShall we proceed to churning? This process takes about 20 minutes.", + "ja": "列挙が終了しました。\n\n攪拌に進みましょうか? このプロセスには約20分かかります。", + "zh": "枚举完成。\n\n我们要继续搅拌吗? 这个过程大约需要 20 分钟。", + "en-tts": "Enumeration finished.\n\nShall we proceed to churning? This process takes about 20 minutes." + }, "pddb.okay": { "en": "Okay", "ja": "OK", diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index 3adf3487a..b5cde8abc 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -85,6 +85,7 @@ impl Deref for StaticCryptoData { #[derive(Eq, PartialEq)] enum DnaMode { Normal, + Churn, Migration, } #[derive(Zeroize)] @@ -685,7 +686,7 @@ impl PddbOs { aad.extend_from_slice(PDDB_FAST_SPACE_SYSTEM_BASIS.as_bytes()); aad.extend_from_slice(&PDDB_VERSION.to_le_bytes()); match self.dna_mode { - DnaMode::Normal => aad.extend_from_slice(&self.dna.to_le_bytes()), + DnaMode::Normal | DnaMode::Churn => aad.extend_from_slice(&self.dna.to_le_bytes()), DnaMode::Migration => aad.extend_from_slice(&self.migration_dna.to_le_bytes()), } } @@ -1237,7 +1238,7 @@ impl PddbOs { aad.extend_from_slice(&name.as_bytes()); aad.extend_from_slice(&PDDB_VERSION.to_le_bytes()); match self.dna_mode { - DnaMode::Normal => aad.extend_from_slice(&self.dna.to_le_bytes()), + DnaMode::Normal | DnaMode::Churn => aad.extend_from_slice(&self.dna.to_le_bytes()), DnaMode::Migration => aad.extend_from_slice(&self.migration_dna.to_le_bytes()), } aad @@ -1854,6 +1855,7 @@ impl PddbOs { log::info!("migrating from dna 0x{:x} -> 0x{:x}", self.migration_dna, self.dna); self.fast_space_read(); // we hawe to re-read the FSCB, because it would have failed previously with lots of warnings }, + PddbRekeyOp::Churn => self.dna_mode = DnaMode::Churn, _ => (), }; @@ -2113,6 +2115,7 @@ impl PddbOs { match self.dna_mode { DnaMode::Normal => t!("pddb.freespace.request", xous::LANG), DnaMode::Migration => t!("pddb.rekey.request", xous::LANG), + DnaMode::Churn => t!("pddb.churn.request", xous::LANG), }, None).ok(); self.tt.sleep_ms(SWAP_DELAY_MS).unwrap(); @@ -2194,6 +2197,7 @@ impl PddbOs { match self.dna_mode { DnaMode::Normal => t!("pddb.freespace.finished", xous::LANG), DnaMode::Migration => t!("pddb.rekey.finished", xous::LANG), + DnaMode::Churn => t!("pddb.churn.finished", xous::LANG), }) { Some(ret) } else {