From 52211f078e020d5f840abc073f930155649c8582 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 8 Jun 2022 20:15:32 +0800 Subject: [PATCH] adjust autotest flow for UDP-based button pressing --- apps/vault/src/ctap/mod.rs | 1 + apps/vault/src/main.rs | 5 +++++ apps/vault/src/ux.rs | 10 +++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/vault/src/ctap/mod.rs b/apps/vault/src/ctap/mod.rs index 0f268dbde..928e3179d 100644 --- a/apps/vault/src/ctap/mod.rs +++ b/apps/vault/src/ctap/mod.rs @@ -952,6 +952,7 @@ where _ => return Err(Ctap2StatusCode::CTAP2_ERR_NOT_ALLOWED), } //(self.check_user_presence)(cid)?; + #[cfg(not(feature="autotest"))] if crate::ux::request_permission_blocking(t!("vault.u2f.reset_check", xous::LANG).to_string(), cid).is_none() { return Err(Ctap2StatusCode::CTAP2_ERR_NOT_ALLOWED) } diff --git a/apps/vault/src/main.rs b/apps/vault/src/main.rs index 29cfb2328..9e58e24ae 100644 --- a/apps/vault/src/main.rs +++ b/apps/vault/src/main.rs @@ -16,6 +16,11 @@ use ctap::CtapState; mod shims; use shims::*; +// CTAP2 testing notes: +// run our branch and use this to forward the prompts on to the device: +// netcat -k -u -l 6502 > /dev/ttyS0 +// use the "autotest" feature to remove some excess prompts that interfere with the test + /* UI concept: diff --git a/apps/vault/src/ux.rs b/apps/vault/src/ux.rs index 0b64c87ed..a94545e8e 100644 --- a/apps/vault/src/ux.rs +++ b/apps/vault/src/ux.rs @@ -130,8 +130,8 @@ pub(crate) fn start_ux_thread() { let mut app_info: Option = None; let pddb = pddb::Pddb::new(); pddb.is_mounted_blocking(); - #[cfg(feature="autotest")] - modals.show_notification("WARNING: FIDO configured for autotest. Do not use for production!", None).unwrap(); + //#[cfg(feature="autotest")] + //modals.show_notification("WARNING: FIDO configured for autotest. Do not use for production!", None).unwrap(); let mut num_fido_auths = 0; // only counts FIDO2 flow auths, not U2F auths loop { let mut msg = xous::receive_message(sid).unwrap(); @@ -404,14 +404,14 @@ pub(crate) fn start_ux_thread() { } } // check if we got a hit - #[cfg(not(feature="autotest"))] + //#[cfg(not(feature="autotest"))] let key_hit = kbhit.load(Ordering::SeqCst); - #[cfg(feature="autotest")] + /*#[cfg(feature="autotest")] let key_hit = if num_fido_auths != 82 { // 82 is the test number of "don't touch it" 'y' as u32 } else { 0 - }; + };*/ if key_hit != 0 { num_fido_auths += 1; log::info!("got user presence! count: {}", num_fido_auths);