From 47ce1e314918f4924d9eea23b3dabf08acd9fd44 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 18 Sep 2022 21:53:35 +0800 Subject: [PATCH] add version history for TOTP records --- apps/vault/src/storage.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/vault/src/storage.rs b/apps/vault/src/storage.rs index 2f7decde7..ed52f5284 100644 --- a/apps/vault/src/storage.rs +++ b/apps/vault/src/storage.rs @@ -12,6 +12,13 @@ const VAULT_PASSWORD_DICT: &'static str = "vault.passwords"; const VAULT_TOTP_DICT: &'static str = "vault.totp"; const VAULT_TOTP_ALLOC_HINT: usize = 128; const VAULT_PASSWORD_REC_VERSION: u32 = 1; + +// Version history TOTP record: +// - v1 created, basic record for TOTP +// - v2 add HOTP support: +// - `hotp` field added. If 1, then HOTP record. If not existent or not 1, then TOTP +// - If HOTP, then the `timestep` field is re-purposed as the `count` field. +// - v1 records read directly onto v2 records, and `hotp` is always `false` for v1 records const VAULT_TOTP_REC_VERSION: u32 = 2; #[derive(Debug)]