Skip to content

Commit

Permalink
Add draft for the forced delay on the failed rev hotp verification
Browse files Browse the repository at this point in the history
  • Loading branch information
szszszsz committed Dec 1, 2022
1 parent d8392b4 commit 8f37263
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ where
None => {
// Failed verification
self.wink_bad();
self.delay_on_failure();
return Err(Status::VerificationFailed);
}
Some(val) => val
Expand Down Expand Up @@ -837,6 +838,12 @@ where
// TODO blink green LED for 10 seconds, highest priority
syscall!(self.trussed.wink(Duration::from_secs(10)));
}

fn delay_on_failure(&mut self){
use crate::FAILURE_FORCED_DELAY_MILLISECONDS;
// TODO block for the time defined in the constant
// DESIGN allow only a couple of failures per power cycle? Similarly to the FIDO2 PIN
}
}

#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub const YUBICO_OATH_AID: &[u8] = &hex!("A000000527 2101");// 01");

/// This constant defines timeout for the regular UP confirmation
pub const UP_TIMEOUT_MILLISECONDS: u32 = 15 * 1000;
pub const FAILURE_FORCED_DELAY_MILLISECONDS: u32 = 1 * 1000;

// class AID(bytes, Enum):
// OTP = b'\xa0\x00\x00\x05\x27 \x20\x01'
Expand Down

0 comments on commit 8f37263

Please sign in to comment.