Adds a hardware failure state for user presence (#616)
Introduced in https://github.com/google/OpenSK/pull/580 The conversion to libtock's ErrorCode has to happen outside of the library.
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user