Make user feedback fields private
This commit is contained in:
@@ -71,7 +71,7 @@ pub struct CtapHid {
|
||||
// In packets, the ID encoding is Big Endian to match what is used throughout CTAP (with the
|
||||
// u32::to/from_be_bytes methods).
|
||||
allocated_cids: usize,
|
||||
pub wink_permission: TimedPermission,
|
||||
pub(crate) wink_permission: TimedPermission,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -399,6 +399,10 @@ impl CtapHid {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn should_wink(&self, now: ClockValue) -> bool {
|
||||
self.wink_permission.is_granted(now)
|
||||
}
|
||||
|
||||
#[cfg(feature = "with_ctap1")]
|
||||
fn ctap1_error_message(
|
||||
cid: ChannelID,
|
||||
|
||||
@@ -334,7 +334,7 @@ pub struct CtapState {
|
||||
persistent_store: PersistentStore,
|
||||
client_pin: ClientPin,
|
||||
#[cfg(feature = "with_ctap1")]
|
||||
pub u2f_up_state: U2fUserPresenceState,
|
||||
pub(crate) u2f_up_state: U2fUserPresenceState,
|
||||
// The state initializes to Reset and its timeout, and never goes back to Reset.
|
||||
stateful_command_permission: StatefulPermission,
|
||||
large_blobs: LargeBlobs,
|
||||
@@ -1332,6 +1332,16 @@ impl CtapState {
|
||||
auth_data.extend(&signature_counter);
|
||||
Ok(auth_data)
|
||||
}
|
||||
|
||||
#[cfg(feature = "with_ctap1")]
|
||||
pub fn u2f_grant_user_presence(&mut self, now: ClockValue) {
|
||||
self.u2f_up_state.grant_up(now)
|
||||
}
|
||||
|
||||
#[cfg(feature = "with_ctap1")]
|
||||
pub fn u2f_needs_user_presence(&mut self, now: ClockValue) -> bool {
|
||||
self.u2f_up_state.is_up_needed(now)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user