What changed, and why it matters
This commit is a simple internal code cleanup in the Cardano app of Trezor firmware. It renames a function parameter from 'payload_first_chunk' to 'payload' and switches from keyword arguments to positional arguments in one call. There is no change to user-visible behavior, security logic, or data handling.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies two files in core/src/apps/cardano. In layout.py, the parameter payload_first_chunk of confirm_message_payload is renamed to payload, and all internal references are updated. In sign_message.py, the call to confirm_message_payload is changed from keyword-argument style to positional-argument style. No logic, validation, buffer sizes, cryptographic operations, or display behavior is altered.
Changed components
core/src/apps/cardano/layout.pycore/src/apps/cardano/sign_message.pyInspect captured patch +9 / −9
diff --git a/core/src/apps/cardano/layout.py b/core/src/apps/cardano/layout.py
index 59c29af3..128a8c90 100644
--- a/core/src/apps/cardano/layout.py
+++ b/core/src/apps/cardano/layout.py
@@ -323,7 +323,7 @@ async def confirm_reference_script(
async def confirm_message_payload(
- payload_first_chunk: bytes,
+ payload: bytes,
payload_size: int,
prefer_hex_display: bool,
) -> None:
@@ -331,17 +331,17 @@ async def confirm_message_payload(
max_displayed_bytes = MAX_CHUNK_SIZE
- if not payload_first_chunk:
+ if not payload:
assert payload_size == 0
props = _get_data_chunk_props(
title=TR.cardano__empty_message,
- first_chunk=payload_first_chunk,
+ first_chunk=payload,
data_size=payload_size,
)
- elif not prefer_hex_display and is_unambiguous_ascii(payload_first_chunk):
+ elif not prefer_hex_display and is_unambiguous_ascii(payload):
props = _get_data_chunk_props(
title=TR.cardano__message_text,
- first_chunk=payload_first_chunk,
+ first_chunk=payload,
data_size=payload_size,
max_displayed_size=max_displayed_bytes,
decoder=lambda chunk: chunk.decode("ascii"),
@@ -349,7 +349,7 @@ async def confirm_message_payload(
else:
props = _get_data_chunk_props(
title=TR.cardano__message_hex,
- first_chunk=payload_first_chunk,
+ first_chunk=payload,
data_size=payload_size,
max_displayed_size=max_displayed_bytes,
)
diff --git a/core/src/apps/cardano/sign_message.py b/core/src/apps/cardano/sign_message.py
index 7965dd78..d85dad8a 100644
--- a/core/src/apps/cardano/sign_message.py
+++ b/core/src/apps/cardano/sign_message.py
@@ -111,9 +111,9 @@ async def _get_confirmed_payload(size: int, prefer_hex_display: bool) -> bytes:
raise ProcessError("The payload is interpreted as a hash and cannot be signed")
await layout.confirm_message_payload(
- payload_size=size,
- payload_first_chunk=payload,
- prefer_hex_display=prefer_hex_display,
+ payload,
+ size,
+ prefer_hex_display,
)
return payload
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.