refactor(core/eckhart): replace `String<99>` with `ShortString`
What changed, and why it matters
This is a small internal code cleanup in the Trezor firmware's PIN entry screen. It swaps one fixed-size text container (`String<99>`) for another (`ShortString`) that was already enlarged to 128 bytes in a prior commit. The behavior and safety limits remain the same, and there is no indication of a security fix.
No security action needed. Treat as normal refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors space_out_pin in the Eckhart layout’s PIN keyboard to use ShortString instead of String<99>. A previous commit (9695e1c2ef) increased ShortString capacity to 128, making it large enough for the spaced-out PIN (max 50 digits + 49 spaces = 99 characters). The TODO referencing PR#4531 is removed. No functional or security change is evident from the diff.
Changed components
core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rsInspect captured patch +2 / −3
### core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rs
@@ -332,9 +332,8 @@ impl PinInput {
/// Adds spaces between characters. Output length is capped at 99 since
/// PIN_MAX_LEN is 50. Example: "12345" becomes "1 2 3 4 5"
- /// TODO: Switch to ShortString if and when we can increase its size PR#4531
- fn space_out_pin(pin: &str) -> String<99> {
- let mut spaced_out_pin: String<99> = String::new();
+ fn space_out_pin(pin: &str) -> ShortString {
+ let mut spaced_out_pin = ShortString::new();
for (i, c) in pin.chars().enumerate() {
unwrap!(spaced_out_pin.push(c));
if i < pin.len() - 1 {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.