feat(core): increase `ShortString` size to 128 bytes
What changed, and why it matters
This commit simply increases the maximum size of a commonly used short text buffer in the Trezor firmware from 50 bytes to 128 bytes. The stated purpose is to support longer passphrases on Trezor Core devices, while keeping the PIN length limit at 50 bytes. There is no indication in the commit that this fixes a security vulnerability or introduces a security-relevant bug.
No security action required. Treat as a normal feature commit. If reviewing for security, verify downstream callers of `ShortString` do not rely on the previous 50-byte limit for safety invariants, though the commit itself gives no evidence of such reliance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change updates the ShortString type alias from String<50> to String<128> in core/embed/rust/src/strutil.rs, and updates an associated comment in core/embed/rust/src/ui/util.rs to reflect the new 128-byte assumption. The commit message explicitly frames this as a feature for longer passphrases and notes that PIN length remains capped at 50 bytes. No bounds-checking, allocation, or parsing logic is modified beyond the constant change.
Changed components
core/embed/rust/src/strutil.rscore/embed/rust/src/ui/util.rsInspect captured patch +2 / −2
### core/embed/rust/src/strutil.rs
@@ -8,7 +8,7 @@ use crate::micropython::{buffer::StrBuffer, obj::Obj};
use crate::translations::TR;
/// Unified-length String type, long enough for most simple use-cases.
-pub type ShortString = String<50>;
+pub type ShortString = String<128>;
pub fn hexlify(data: &[u8], buffer: &mut [u8]) {
const HEX_LOWER: [u8; 16] = *b"0123456789abcdef";
### core/embed/rust/src/ui/util.rs
@@ -71,7 +71,7 @@ pub fn split_two_lines(text: &str, text_font: Font, available_width: i16) -> (&s
/// Returns text to be fit on one line of a given length.
/// When the text is too long to fit, it is truncated with ellipsis
/// on the left side.
-/// This assumes no lines are longer than 50 chars (ShortString limit)
+/// This assumes no lines are longer than 128 bytes (ShortString limit)
pub fn long_line_content_with_ellipsis(
text: &str,
ellipsis: &str,Why this scored 17/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.