diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index d856e387cf0..32a39ae5a16 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased -- +### Added + +- Add `UiClient::confirm_user_present_with_level`. ## [v0.2.0](https://github.com/trussed-dev/trussed/releases/tag/core-v0.2.0) (2025-03-20) diff --git a/core/src/client/ui.rs b/core/src/client/ui.rs index cd6d7e4aa6f..259c5f1afe7 100644 --- a/core/src/client/ui.rs +++ b/core/src/client/ui.rs @@ -11,9 +11,20 @@ pub trait UiClient: PollClient { fn confirm_user_present( &mut self, timeout_milliseconds: u32, + ) -> ClientResult<'_, reply::RequestUserConsent, Self> { + self.confirm_user_present_with_level(Level::Normal, timeout_milliseconds) + } + + /// Same as [`Self::confirm_user_present`] but the caller chooses the + /// [`Level`] of the user-presence check. Used for stronger ceremonies + /// (e.g. CTAP 2.3 long-touch reset) that require [`Level::Strong`]. + fn confirm_user_present_with_level( + &mut self, + level: Level, + timeout_milliseconds: u32, ) -> ClientResult<'_, reply::RequestUserConsent, Self> { self.request(request::RequestUserConsent { - level: Level::Normal, + level, timeout_milliseconds, }) }