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, });