What changed, and why it matters
This commit adds user-interface screens for a new Trezor feature called THP (Trezor Host Protocol) on the Delizia hardware model. It defines a new yellow color and implements two previously unimplemented or placeholder screens: one showing a pairing code and one showing pairing details with highlighted host/app names. There is no indication of a security bug or vulnerability in the change itself.
No security action required; this is a normal feature-implementation UI commit. Continue standard review and testing of the THP pairing flow.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a UI-only chore for the Delizia layout. It adds a YELLOW theme constant and fills in two FirmwareUI methods: confirm_thp_pairing_code now builds a centered monospaced pairing code with a description, and confirm_thp_pairing now parses an interpolated format string, substitutes up to two arguments in yellow emphasis, and returns a confirmation flow instead of NotImplementedError. The interpolation uses existing util::interpolate::parse and bounds-checks argument indices, returning Error::OutOfRange if an index is missing.
Changed components
core/embed/rust/src/ui/layout_delizia/theme/mod.rscore/embed/rust/src/ui/layout_delizia/ui_firmware.rsInspect captured patch +47 / −18
### core/embed/rust/src/ui/layout_delizia/theme/mod.rs
@@ -33,6 +33,7 @@ pub const GREEN_LIME: Color = Color::rgb(0x9B, 0xE8, 0x87);
pub const ORANGE_DARK: Color = Color::rgb(0x18, 0x0C, 0x0A);
pub const ORANGE_DIMMED: Color = Color::rgb(0x9E, 0x57, 0x42);
pub const ORANGE_LIGHT: Color = Color::rgb(0xFF, 0x8D, 0x6A); // cancel button
+pub const YELLOW: Color = Color::rgb(0xFF, 0xE4, 0x58); // host_name and app_name emphasis
pub const FATAL_ERROR_COLOR: Color = Color::rgb(0xE7, 0x0E, 0x0E);
pub const FATAL_ERROR_HIGHLIGHT_COLOR: Color = Color::rgb(0xFF, 0x41, 0x41);
### core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
@@ -43,6 +43,7 @@ use crate::ui::ui_firmware::{
MAX_MENU_ITEMS, MAX_WORD_QUIZ_ITEMS,
};
use crate::ui::ModelUI;
+use crate::util::interpolate::Item;
impl FirmwareUI for UIDelizia {
fn confirm_action(
@@ -951,28 +952,55 @@ impl FirmwareUI for UIDelizia {
description: TString<'static>,
code: TString<'static>,
) -> Result<impl LayoutMaybeTrace, Error> {
- Self::confirm_action(
- title,
- Some(code),
- Some(description),
- None,
- None,
- true,
- None,
- false,
- false,
- false,
- false,
- None,
- false,
- )
+ let style = theme::TEXT_NORMAL;
+ let mut ops = OpTextLayout::new(style);
+ ops.add_alignment(geometry::Alignment::Center)
+ .add_text_with_font(code, fonts::FONT_MONO)
+ .add_alignment(geometry::Alignment::Start)
+ .add_newline()
+ .add_newline()
+ .add_text_with_font(description, style.text_font);
+
+ let flow = flow::new_confirm_action_simple(
+ FormattedText::new(ops).vertically_centered(),
+ ConfirmActionExtra::Menu(ConfirmActionMenuStrings::new()),
+ ConfirmActionStrings::new(title, None, None, Some(title)),
+ ConfirmActionOptions::new(),
+ )?;
+ Ok(flow)
}
fn confirm_thp_pairing(
- _title: TString<'static>,
- _description: (StrBuffer, Obj),
+ title: TString<'static>,
+ description: (StrBuffer, Obj),
) -> Result<impl LayoutMaybeTrace, Error> {
- Err::<RootComponent<Empty, ModelUI>, Error>(Error::NotImplementedError)
+ let (format, args_obj) = description;
+ let args: heapless::Vec<TString<'static>, 2> = util::iter_into_vec(args_obj)?;
+ let style = theme::TEXT_NORMAL;
+ let mut ops = OpTextLayout::new(style);
+ for part in crate::util::interpolate::parse(format) {
+ match part {
+ Item::Text(s) => {
+ ops.add_text_with_font(s, style.text_font);
+ }
+ Item::Arg(i) => match args.get(i) {
+ Some(&s) => {
+ ops.add_color(theme::YELLOW);
+ ops.add_text_with_font(s, style.text_font);
+ ops.add_color(style.text_color);
+ }
+ None => return Err(Error::OutOfRange),
+ },
+ };
+ }
+
+ let flow = flow::new_confirm_action_simple(
+ FormattedText::new(ops).vertically_centered(),
+ ConfirmActionExtra::Menu(ConfirmActionMenuStrings::new()),
+ ConfirmActionStrings::new(title, None, None, Some(title)),
+ ConfirmActionOptions::new(),
+ )?;
+ Ok(flow)
}
fn show_info(Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.