mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
fix some minor bugs
- test entries for passwords at 100 entries. it's...pretty slow at 300 passwords, about 8 seconds to scan/read-in the database. once the database is read-in, sorting and viewing is fast. good news is that heap usage is about 300k for that many entries, no OOM crashes found. just slow. - fix an unimplemented()! error - strip out some debug
This commit is contained in:
parent
847e64c46a
commit
3c82898780
2 changed files with 6 additions and 6 deletions
|
|
@ -459,7 +459,7 @@ impl ActionManager {
|
||||||
let dict = match entry.mode {
|
let dict = match entry.mode {
|
||||||
VaultMode::Password => VAULT_PASSWORD_DICT,
|
VaultMode::Password => VAULT_PASSWORD_DICT,
|
||||||
VaultMode::Fido => crate::fido::U2F_APP_DICT,
|
VaultMode::Fido => crate::fido::U2F_APP_DICT,
|
||||||
VaultMode::Totp => unimplemented!(),
|
VaultMode::Totp => VAULT_TOTP_DICT,
|
||||||
};
|
};
|
||||||
match entry.mode {
|
match entry.mode {
|
||||||
VaultMode::Password => {
|
VaultMode::Password => {
|
||||||
|
|
@ -885,13 +885,13 @@ impl ActionManager {
|
||||||
"._weird~yy%\":'test", "//WHYwhyWHY", "Xyz|zy", "foo:bar", "f🍕🍔🍟🌭d", "💎🙌", "some ノート", "笔录4u", "@u", "sane text", "Käsesoßenrührlöffel"];
|
"._weird~yy%\":'test", "//WHYwhyWHY", "Xyz|zy", "foo:bar", "f🍕🍔🍟🌭d", "💎🙌", "some ノート", "笔录4u", "@u", "sane text", "Käsesoßenrührlöffel"];
|
||||||
let weights = [1; 21];
|
let weights = [1; 21];
|
||||||
const TARGET_ENTRIES: usize = 35;
|
const TARGET_ENTRIES: usize = 35;
|
||||||
const TARGET_ENTRIES_PW: usize = 300;
|
const TARGET_ENTRIES_PW: usize = 100;
|
||||||
// for each database, populate up to TARGET_ENTRIES
|
// for each database, populate up to TARGET_ENTRIES
|
||||||
// as this is testing code, it's written a bit more fragile in terms of error handling (fail-panic, rather than fail-dialog)
|
// as this is testing code, it's written a bit more fragile in terms of error handling (fail-panic, rather than fail-dialog)
|
||||||
// --- passwords ---
|
// --- passwords ---
|
||||||
let pws = self.pddb.borrow().list_keys(VAULT_PASSWORD_DICT, None).unwrap_or(Vec::new());
|
let pws = self.pddb.borrow().list_keys(VAULT_PASSWORD_DICT, None).unwrap_or(Vec::new());
|
||||||
if pws.len() < TARGET_ENTRIES_PW {
|
if pws.len() < TARGET_ENTRIES_PW {
|
||||||
let extra_count = TARGET_ENTRIES - pws.len();
|
let extra_count = TARGET_ENTRIES_PW - pws.len();
|
||||||
for _ in 0..extra_count {
|
for _ in 0..extra_count {
|
||||||
let desc = random_pick::pick_multiple_from_slice(&words, &weights, 3);
|
let desc = random_pick::pick_multiple_from_slice(&words, &weights, 3);
|
||||||
let description = format!("{} {} {}", desc[0], desc[1], desc[2]);
|
let description = format!("{} {} {}", desc[0], desc[1], desc[2]);
|
||||||
|
|
@ -981,10 +981,10 @@ impl ActionManager {
|
||||||
}
|
}
|
||||||
let xns = xous_names::XousNames::new().unwrap();
|
let xns = xous_names::XousNames::new().unwrap();
|
||||||
let mut rng = ctap_crypto::rng256::XousRng256::new(&xns);
|
let mut rng = ctap_crypto::rng256::XousRng256::new(&xns);
|
||||||
for _ in 0..extra_fido {
|
for index in 0..extra_fido {
|
||||||
use crate::ctap::data_formats::*;
|
use crate::ctap::data_formats::*;
|
||||||
let c_id = random_pick::pick_multiple_from_slice(&words, &weights, 2);
|
let c_id = random_pick::pick_multiple_from_slice(&words, &weights, 2);
|
||||||
let cred_id = format!("{} {}", c_id[0], c_id[1]);
|
let cred_id = format!("{} {} {}", c_id[0], c_id[1], index);
|
||||||
let r_id = random_pick::pick_multiple_from_slice(&words, &weights, 2);
|
let r_id = random_pick::pick_multiple_from_slice(&words, &weights, 2);
|
||||||
let rp_id = format!("{} {}", r_id[0], r_id[1]);
|
let rp_id = format!("{} {}", r_id[0], r_id[1]);
|
||||||
let handle = random_pick::pick_from_slice(&words, &weights).unwrap().to_string();
|
let handle = random_pick::pick_from_slice(&words, &weights).unwrap().to_string();
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ impl VaultUx {
|
||||||
let mut name_bytes = Vec::<u8>::new();
|
let mut name_bytes = Vec::<u8>::new();
|
||||||
match style_key.read_to_end(&mut name_bytes) {
|
match style_key.read_to_end(&mut name_bytes) {
|
||||||
Ok(_len) => {
|
Ok(_len) => {
|
||||||
log::info!("name_bytes: {:?} {:?}", name_bytes, String::from_utf8(name_bytes.to_vec()));
|
log::debug!("name_bytes: {:?} {:?}", name_bytes, String::from_utf8(name_bytes.to_vec()));
|
||||||
name_to_style(&String::from_utf8(name_bytes).unwrap_or("regular".to_string()))
|
name_to_style(&String::from_utf8(name_bytes).unwrap_or("regular".to_string()))
|
||||||
.unwrap_or(GlyphStyle::Regular)
|
.unwrap_or(GlyphStyle::Regular)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue