From 75b30f723e017a5d89feee5d8591a81eafc62d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Mon, 18 Jul 2022 17:32:09 +0200 Subject: [PATCH] chore(vault): use new generic storage in vendor commands --- apps/vault/src/vendor_commands.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/vault/src/vendor_commands.rs b/apps/vault/src/vendor_commands.rs index df315a5e3..5cd862c1a 100644 --- a/apps/vault/src/vendor_commands.rs +++ b/apps/vault/src/vendor_commands.rs @@ -104,7 +104,7 @@ fn handle_restore(data: Vec, xns: &xous_names::XousNames) -> Result, notes: t!("vault.notes", xous::LANG).to_string(), }; - storage.new_totp_record(totp, None)? + storage.new_record(totp, None)? } Ok(vec![0xca, 0xfe, 0xba, 0xbe]) @@ -113,7 +113,7 @@ fn handle_restore(data: Vec, xns: &xous_names::XousNames) -> Result, fn handle_backup(xns: &xous_names::XousNames) -> Result, BackupError> { let mut storage = crate::storage::Manager::new(xns); - let totp_codes = storage.all_totp()?; + let totp_codes: Vec = storage.all(crate::storage::ContentKind::TOTP)?; let mut ret = vec![]; @@ -126,6 +126,7 @@ fn handle_backup(xns: &xous_names::XousNames) -> Result, BackupError> { crate::totp::TotpAlgorithm::HmacSha1 => backup::HashAlgorithms::SHA1, crate::totp::TotpAlgorithm::HmacSha256 => backup::HashAlgorithms::SHA256, crate::totp::TotpAlgorithm::HmacSha512 => backup::HashAlgorithms::SHA512, + _ => panic!("invalid algorithm") }, name: raw_code.name, });