From 15dc4928495bab10e107ccf2060f196d12d1071f Mon Sep 17 00:00:00 2001 From: Emanuele Cesena Date: Fri, 8 May 2026 17:07:38 +0200 Subject: [PATCH] trussed-core: surface consent::Level via confirm_user_present_with_level --- core/CHANGELOG.md | 4 +++- core/src/client/ui.rs | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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, }) }