Skip to content

Commit

Permalink
Adds a hardware failure state for user presence
Browse files Browse the repository at this point in the history
Introduced in #580

The conversion to libtock's ErrorCode has to happen outside of the
library.
  • Loading branch information
kaczmarczyck committed Apr 20, 2023
1 parent 5f7eb31 commit bbf7b53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/opensk/src/api/user_presence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub enum UserPresenceError {
Canceled,
/// User presence check timed out.
Timeout,
/// Unexpected (e.g., hardware) failures
Fail,
}

pub type UserPresenceResult = Result<(), UserPresenceError>;
Expand Down
1 change: 1 addition & 0 deletions libraries/opensk/src/ctap/status_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl From<UserPresenceError> for Ctap2StatusCode {
UserPresenceError::Timeout => Self::CTAP2_ERR_USER_ACTION_TIMEOUT,
UserPresenceError::Declined => Self::CTAP2_ERR_OPERATION_DENIED,
UserPresenceError::Canceled => Self::CTAP2_ERR_KEEPALIVE_CANCEL,
UserPresenceError::Fail => Self::CTAP2_ERR_VENDOR_HARDWARE_FAILURE,
}
}
}
Expand Down

0 comments on commit bbf7b53

Please sign in to comment.