fix(cardano): Change display_ascii flag to prefer_hex_display
What changed, and why it matters
This commit renames and slightly changes a Cardano message-signing display option. Previously, the host had to explicitly request ASCII display, and the device would reject payloads that were not clean, readable ASCII. Now the host can ask the device to prefer hex display, and if ASCII display is preferred but the payload is not clean ASCII, the device falls back to showing hex instead of rejecting the request. This is a user-experience and consistency change, not a fix for a clear security vulnerability.
Treat as a routine UX/consistency patch. Review whether the fallback-to-hex behavior matches product expectations for ambiguous payloads, and verify downstream host software updates the renamed field. No urgent security action is indicated by the diff alone.
Security signals we found
UI display-mode flag renamed and semantics inverted
Previous hard error on non-unambiguous ASCII removed; behavior now falls back to hex display
No cryptographic, parsing, or authorization bypass changes observed
No vendor disclosure of security relevance in commit message or diff
Evidence from the diff
The protobuf field display_ascii in CardanoSignMessageInit is renamed to prefer_hex_display across the protocol definition, generated Python/Rust bindings, and host libraries. The device logic in core/src/apps/cardano/layout.py is inverted: instead of raising ProcessError when ASCII display is requested but the payload is not unambiguous ASCII, it now shows ASCII only when prefer_hex_display is false and the payload is unambiguous ASCII; otherwise it shows hex. Test fixtures are updated to reflect the new flag and the removed error cases.
Changed components
Cardano message signing flowCardanoSignMessageInit protobuf messagecore/src/apps/cardano/layout.pycore/src/apps/cardano/sign_message.pytrezorlib Cardano host bindingsCardano sign_message test fixturesInspect captured patch +87 / −90
diff --git a/common/protob/messages-cardano.proto b/common/protob/messages-cardano.proto
index e0011cd4..0b8607e5 100644
--- a/common/protob/messages-cardano.proto
+++ b/common/protob/messages-cardano.proto
@@ -538,7 +538,7 @@ message CardanoSignMessageInit {
repeated uint32 signing_path = 3; // BIP-32-style path to derive the signing key from master node
required uint32 payload_size = 4; // size of the payload to be signed
required bool hash_payload = 5; // whether to hash the payload before signing
- required bool display_ascii = 6; // decode payload as ASCII
+ required bool prefer_hex_display = 6; // whether to decode payload as hex even if valid ascii
optional CardanoAddressParametersType address_parameters = 7;
required CardanoDerivationType derivation_type = 8;
}
diff --git a/common/tests/fixtures/cardano/sign_message.failed.json b/common/tests/fixtures/cardano/sign_message.failed.json
index dff5d7dd..b9c9dc67 100644
--- a/common/tests/fixtures/cardano/sign_message.failed.json
+++ b/common/tests/fixtures/cardano/sign_message.failed.json
@@ -15,7 +15,7 @@
},
"payload": "",
"hash_payload": false,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"error_message": "Must specify network_id and protocol_magic if using address_parameters"
@@ -29,39 +29,11 @@
"protocol_magic": 764824073,
"payload": "566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765",
"hash_payload": false,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"error_message": "Payload too long to sign without hashing"
}
- },
- {
- "description": "Payload cannot be decoded to ASCII",
- "parameters": {
- "signing_path": "m/1852'/1815'/4'/0/0",
- "network_id": 1,
- "protocol_magic": 764824073,
- "payload": "ff",
- "hash_payload": false,
- "display_ascii": true
- },
- "result": {
- "error_message": "Payload cannot be decoded as ASCII or its decoding leads to a visually ambiguous string"
- }
- },
- {
- "description": "Payload is ambiguous when decoded as ASCII",
- "parameters": {
- "signing_path": "m/1852'/1815'/4'/0/0",
- "network_id": 1,
- "protocol_magic": 764824073,
- "payload": "20",
- "hash_payload": false,
- "display_ascii": true
- },
- "result": {
- "error_message": "Payload cannot be decoded as ASCII or its decoding leads to a visually ambiguous string"
- }
}
]
}
diff --git a/common/tests/fixtures/cardano/sign_message.json b/common/tests/fixtures/cardano/sign_message.json
index d3b72a67..f8f67275 100644
--- a/common/tests/fixtures/cardano/sign_message.json
+++ b/common/tests/fixtures/cardano/sign_message.json
@@ -10,7 +10,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "ff00",
"hash_payload": false,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "5ad6ba670e65353b2c1ad4053a1ed4a9348a73fe965ffa0afafa24bad06e3eb3e325d49029604c09bf665c3c43a750ec81a43b1f8b746b07e999b913b980d006",
@@ -30,7 +30,7 @@
"path": "m/1852'/1815'/0'/0/0",
"stakingPath": "m/1852'/1815'/0'/2/0"
},
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "9efaff0b74c0beb2cadd727d8bafe13b31107235c5fc46c6c33e596e024d391c9fbe37072e43965add6ee0a4788562382031486b74fd59d636aa1ca3b1ddfe06",
@@ -43,7 +43,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "ff00",
"hash_payload": true,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "2c325e542fa78d76d916e50f50b85e770354a44e071f08fdb8ec5d0bcbf844cf70dcf5c87b7a51cd7f0269a59eec8d438c3c27eb42b971e7ccb7f864714c4b06",
@@ -56,7 +56,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "54657374",
"hash_payload": false,
- "display_ascii": true
+ "prefer_hex_display": false
},
"result": {
"signature": "2201b8e7fa9ea919935e06ecc3e845433855066acaaf61cb8e624a2eb7139b73a9d126e7ee04548fff06ac933bd5419fc78c5aebee9b536cbee1481b52ec3e03",
@@ -69,7 +69,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "54657374",
"hash_payload": false,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "2201b8e7fa9ea919935e06ecc3e845433855066acaaf61cb8e624a2eb7139b73a9d126e7ee04548fff06ac933bd5419fc78c5aebee9b536cbee1481b52ec3e03",
@@ -82,7 +82,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "",
"hash_payload": false,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "b09177a06cb2deba7ada89fec96fc4380e746f67c6b16a9ef9ae6b7cbbe941fdad8a8a573b809cd88db296b91b476c436033a29d86a63959e270047e47cd5d0d",
@@ -95,7 +95,7 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "",
"hash_payload": true,
- "display_ascii": false
+ "prefer_hex_display": true
},
"result": {
"signature": "a2503039a8ec620e05d9e4345339d61cd11480fbfcc75ea1a10789751a7c5f46ba06786eb1719da62db76c20313ad3445839b8117abac206cc4bd63ea623fc07",
@@ -108,12 +108,42 @@
"signing_path": "m/1852'/1815'/4'/0/0",
"payload": "566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765566572794c6f6e674d657373616765",
"hash_payload": true,
- "display_ascii": true
+ "prefer_hex_display": false
},
"result": {
"signature": "92331e75bb4c3208317ac422f2fc9d8b9b09d3f81cc487edaa7028d262553e5691532fb166a40e45eb2e4addd4280ff7e07bd4249e964d969e91555317b05f08",
"address": "d9553a4de9c7ad8532abdb1d0a7f425b8007d25c9f1edcf0b5f5c3ba"
}
+ },
+ {
+ "description": "Non-ASCII payload falls back to hex",
+ "parameters": {
+ "signing_path": "m/1852'/1815'/4'/0/0",
+ "network_id": 1,
+ "protocol_magic": 764824073,
+ "payload": "ff",
+ "hash_payload": false,
+ "prefer_hex_display": false
+ },
+ "result": {
+ "signature": "eb7e48bb2de912b24ea4e295cfbf338e95e2a2d9c5eb41d72ddd8ebf96ca6128696e91e65e20a755821781b8ea0b4aa7ffcfa6ab0c7da2c67ecaf33fcd596509",
+ "address": "d9553a4de9c7ad8532abdb1d0a7f425b8007d25c9f1edcf0b5f5c3ba"
+ }
+ },
+ {
+ "description": "Ambiguous ASCII payload falls back to hex",
+ "parameters": {
+ "signing_path": "m/1852'/1815'/4'/0/0",
+ "network_id": 1,
+ "protocol_magic": 764824073,
+ "payload": "20",
+ "hash_payload": false,
+ "prefer_hex_display": false
+ },
+ "result": {
+ "signature": "1cd79c511e58e0d00bc402c24631a982c0f596e13cad38447d4f31213d085b23b9990b45023450f5ab4d47987993af662702b07bfc8195feb80b2c9e1c1dc10f",
+ "address": "d9553a4de9c7ad8532abdb1d0a7f425b8007d25c9f1edcf0b5f5c3ba"
+ }
}
]
}
diff --git a/core/src/apps/cardano/layout.py b/core/src/apps/cardano/layout.py
index a5ea5240..c673c480 100644
--- a/core/src/apps/cardano/layout.py
+++ b/core/src/apps/cardano/layout.py
@@ -11,7 +11,6 @@ from trezor.enums import (
from trezor.strings import format_amount, format_amount_unit
from trezor.ui import layouts
from trezor.ui.layouts import confirm_metadata, confirm_properties
-from trezor.wire import ProcessError
from apps.cardano.helpers.chunks import MAX_CHUNK_SIZE
from apps.common.paths import address_n_to_str
@@ -328,7 +327,7 @@ async def confirm_message_payload(
payload_hash: bytes,
payload_size: int,
is_signing_hash: bool,
- display_ascii: bool,
+ prefer_hex_display: bool,
) -> None:
props: list[PropertyType]
@@ -343,11 +342,7 @@ async def confirm_message_payload(
first_chunk=payload_first_chunk,
data_size=payload_size,
)
- elif display_ascii:
- if not is_unambiguous_ascii(payload_first_chunk):
- raise ProcessError(
- "Payload cannot be decoded as ASCII or its decoding leads to a visually ambiguous string"
- )
+ elif not prefer_hex_display and is_unambiguous_ascii(payload_first_chunk):
props = _get_data_chunk_props(
title="Message text",
first_chunk=payload_first_chunk,
diff --git a/core/src/apps/cardano/sign_message.py b/core/src/apps/cardano/sign_message.py
index edd00014..a8fb8f88 100644
--- a/core/src/apps/cardano/sign_message.py
+++ b/core/src/apps/cardano/sign_message.py
@@ -102,7 +102,7 @@ async def _get_payload_hash_and_first_chunk(size: int) -> tuple[bytes, bytes]:
async def _get_confirmed_payload(
- size: int, is_signing_hash: bool, display_ascii: bool
+ size: int, is_signing_hash: bool, prefer_hex_display: bool
) -> bytes:
from . import layout
@@ -113,7 +113,7 @@ async def _get_confirmed_payload(
payload_first_chunk=first_chunk,
payload_hash=hash,
is_signing_hash=is_signing_hash,
- display_ascii=display_ascii,
+ prefer_hex_display=prefer_hex_display,
)
return hash if is_signing_hash else first_chunk
@@ -162,7 +162,7 @@ async def sign_message(
payload = await _get_confirmed_payload(
size=msg.payload_size,
is_signing_hash=msg.hash_payload,
- display_ascii=msg.display_ascii,
+ prefer_hex_display=msg.prefer_hex_display,
)
address = await _get_confirmed_header_address(msg, keychain)
diff --git a/core/src/trezor/messages.py b/core/src/trezor/messages.py
index 211277b2..86c7176c 100644
--- a/core/src/trezor/messages.py
+++ b/core/src/trezor/messages.py
@@ -1790,7 +1790,7 @@ if TYPE_CHECKING:
signing_path: "list[int]"
payload_size: "int"
hash_payload: "bool"
- display_ascii: "bool"
+ prefer_hex_display: "bool"
address_parameters: "CardanoAddressParametersType | None"
derivation_type: "CardanoDerivationType"
@@ -1799,7 +1799,7 @@ if TYPE_CHECKING:
*,
payload_size: "int",
hash_payload: "bool",
- display_ascii: "bool",
+ prefer_hex_display: "bool",
derivation_type: "CardanoDerivationType",
signing_path: "list[int] | None" = None,
protocol_magic: "int | None" = None,
diff --git a/python/src/trezorlib/cardano.py b/python/src/trezorlib/cardano.py
index 77284eca..900a94a3 100644
--- a/python/src/trezorlib/cardano.py
+++ b/python/src/trezorlib/cardano.py
@@ -1025,7 +1025,7 @@ def sign_message(
signing_path: Path,
payload: bytes,
hash_payload: bool,
- display_ascii: bool,
+ prefer_hex_display: bool,
address_parameters: Optional[messages.CardanoAddressParametersType] = None,
derivation_type: messages.CardanoDerivationType = messages.CardanoDerivationType.ICARUS,
protocol_magic: Optional[int] = None,
@@ -1041,7 +1041,7 @@ def sign_message(
payload_size=size,
hash_payload=hash_payload,
address_parameters=address_parameters,
- display_ascii=display_ascii,
+ prefer_hex_display=prefer_hex_display,
protocol_magic=protocol_magic,
network_id=network_id,
derivation_type=derivation_type,
diff --git a/python/src/trezorlib/cli/cardano.py b/python/src/trezorlib/cli/cardano.py
index 2b7f7f85..cd207aa6 100644
--- a/python/src/trezorlib/cli/cardano.py
+++ b/python/src/trezorlib/cli/cardano.py
@@ -347,7 +347,7 @@ def sign_message(
client,
payload=bytes.fromhex(request["payload"]),
hash_payload=request["hash_payload"],
- display_ascii=request["display_ascii"],
+ prefer_hex_display=request["prefer_hex_display"],
signing_path=tools.parse_path(request["signing_path"]),
address_parameters=cardano.parse_optional_address_parameters(
request.get("address_parameters")
diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py
index 734fa41d..20f5b8dd 100644
--- a/python/src/trezorlib/messages.py
+++ b/python/src/trezorlib/messages.py
@@ -2911,7 +2911,7 @@ class CardanoSignMessageInit(protobuf.MessageType):
3: protobuf.Field("signing_path", "uint32", repeated=True, required=False, default=None),
4: protobuf.Field("payload_size", "uint32", repeated=False, required=True),
5: protobuf.Field("hash_payload", "bool", repeated=False, required=True),
- 6: protobuf.Field("display_ascii", "bool", repeated=False, required=True),
+ 6: protobuf.Field("prefer_hex_display", "bool", repeated=False, required=True),
7: protobuf.Field("address_parameters", "CardanoAddressParametersType", repeated=False, required=False, default=None),
8: protobuf.Field("derivation_type", "CardanoDerivationType", repeated=False, required=True),
}
@@ -2921,7 +2921,7 @@ class CardanoSignMessageInit(protobuf.MessageType):
*,
payload_size: "int",
hash_payload: "bool",
- display_ascii: "bool",
+ prefer_hex_display: "bool",
derivation_type: "CardanoDerivationType",
signing_path: Optional[Sequence["int"]] = None,
protocol_magic: Optional["int"] = None,
@@ -2931,7 +2931,7 @@ class CardanoSignMessageInit(protobuf.MessageType):
self.signing_path: Sequence["int"] = signing_path if signing_path is not None else []
self.payload_size = payload_size
self.hash_payload = hash_payload
- self.display_ascii = display_ascii
+ self.prefer_hex_display = prefer_hex_display
self.derivation_type = derivation_type
self.protocol_magic = protocol_magic
self.network_id = network_id
diff --git a/rust/trezor-client/src/protos/generated/messages_cardano.rs b/rust/trezor-client/src/protos/generated/messages_cardano.rs
index 64f2bd1a..950178fe 100644
--- a/rust/trezor-client/src/protos/generated/messages_cardano.rs
+++ b/rust/trezor-client/src/protos/generated/messages_cardano.rs
@@ -9637,8 +9637,8 @@ pub struct CardanoSignMessageInit {
pub payload_size: ::std::option::Option<u32>,
// @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignMessageInit.hash_payload)
pub hash_payload: ::std::option::Option<bool>,
- // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignMessageInit.display_ascii)
- pub display_ascii: ::std::option::Option<bool>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignMessageInit.prefer_hex_display)
+ pub prefer_hex_display: ::std::option::Option<bool>,
// @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignMessageInit.address_parameters)
pub address_parameters: ::protobuf::MessageField<CardanoAddressParametersType>,
// @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignMessageInit.derivation_type)
@@ -9735,23 +9735,23 @@ impl CardanoSignMessageInit {
self.hash_payload = ::std::option::Option::Some(v);
}
- // required bool display_ascii = 6;
+ // required bool prefer_hex_display = 6;
- pub fn display_ascii(&self) -> bool {
- self.display_ascii.unwrap_or(false)
+ pub fn prefer_hex_display(&self) -> bool {
+ self.prefer_hex_display.unwrap_or(false)
}
- pub fn clear_display_ascii(&mut self) {
- self.display_ascii = ::std::option::Option::None;
+ pub fn clear_prefer_hex_display(&mut self) {
+ self.prefer_hex_display = ::std::option::Option::None;
}
- pub fn has_display_ascii(&self) -> bool {
- self.display_ascii.is_some()
+ pub fn has_prefer_hex_display(&self) -> bool {
+ self.prefer_hex_display.is_some()
}
// Param is passed by value, moved
- pub fn set_display_ascii(&mut self, v: bool) {
- self.display_ascii = ::std::option::Option::Some(v);
+ pub fn set_prefer_hex_display(&mut self, v: bool) {
+ self.prefer_hex_display = ::std::option::Option::Some(v);
}
// required .hw.trezor.messages.cardano.CardanoDerivationType derivation_type = 8;
@@ -9805,9 +9805,9 @@ impl CardanoSignMessageInit {
|m: &mut CardanoSignMessageInit| { &mut m.hash_payload },
));
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
- "display_ascii",
- |m: &CardanoSignMessageInit| { &m.display_ascii },
- |m: &mut CardanoSignMessageInit| { &mut m.display_ascii },
+ "prefer_hex_display",
+ |m: &CardanoSignMessageInit| { &m.prefer_hex_display },
+ |m: &mut CardanoSignMessageInit| { &mut m.prefer_hex_display },
));
fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoAddressParametersType>(
"address_parameters",
@@ -9837,7 +9837,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
if self.hash_payload.is_none() {
return false;
}
- if self.display_ascii.is_none() {
+ if self.prefer_hex_display.is_none() {
return false;
}
if self.derivation_type.is_none() {
@@ -9873,7 +9873,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
self.hash_payload = ::std::option::Option::Some(is.read_bool()?);
},
48 => {
- self.display_ascii = ::std::option::Option::Some(is.read_bool()?);
+ self.prefer_hex_display = ::std::option::Option::Some(is.read_bool()?);
},
58 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.address_parameters)?;
@@ -9908,7 +9908,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
if let Some(v) = self.hash_payload {
my_size += 1 + 1;
}
- if let Some(v) = self.display_ascii {
+ if let Some(v) = self.prefer_hex_display {
my_size += 1 + 1;
}
if let Some(v) = self.address_parameters.as_ref() {
@@ -9939,7 +9939,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
if let Some(v) = self.hash_payload {
os.write_bool(5, v)?;
}
- if let Some(v) = self.display_ascii {
+ if let Some(v) = self.prefer_hex_display {
os.write_bool(6, v)?;
}
if let Some(v) = self.address_parameters.as_ref() {
@@ -9970,7 +9970,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
self.signing_path.clear();
self.payload_size = ::std::option::Option::None;
self.hash_payload = ::std::option::Option::None;
- self.display_ascii = ::std::option::Option::None;
+ self.prefer_hex_display = ::std::option::Option::None;
self.address_parameters.clear();
self.derivation_type = ::std::option::Option::None;
self.special_fields.clear();
@@ -9983,7 +9983,7 @@ impl ::protobuf::Message for CardanoSignMessageInit {
signing_path: ::std::vec::Vec::new(),
payload_size: ::std::option::Option::None,
hash_payload: ::std::option::Option::None,
- display_ascii: ::std::option::Option::None,
+ prefer_hex_display: ::std::option::Option::None,
address_parameters: ::protobuf::MessageField::none(),
derivation_type: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
@@ -11639,21 +11639,21 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x03\x20\x02(\x0cR\tsignature\x12\x1d\n\nchain_code\x18\x04\x20\x01(\x0c\
R\tchainCode\"\x12\n\x10CardanoTxHostAck\",\n\x11CardanoTxBodyHash\x12\
\x17\n\x07tx_hash\x18\x01\x20\x02(\x0cR\x06txHash\"\x17\n\x15CardanoSign\
- TxFinished\"\xb1\x03\n\x16CardanoSignMessageInit\x12%\n\x0eprotocol_magi\
+ TxFinished\"\xba\x03\n\x16CardanoSignMessageInit\x12%\n\x0eprotocol_magi\
c\x18\x01\x20\x01(\rR\rprotocolMagic\x12\x1d\n\nnetwork_id\x18\x02\x20\
\x01(\rR\tnetworkId\x12!\n\x0csigning_path\x18\x03\x20\x03(\rR\x0bsignin\
gPath\x12!\n\x0cpayload_size\x18\x04\x20\x02(\rR\x0bpayloadSize\x12!\n\
- \x0chash_payload\x18\x05\x20\x02(\x08R\x0bhashPayload\x12#\n\rdisplay_as\
- cii\x18\x06\x20\x02(\x08R\x0cdisplayAscii\x12g\n\x12address_parameters\
- \x18\x07\x20\x01(\x0b28.hw.trezor.messages.cardano.CardanoAddressParamet\
- ersTypeR\x11addressParameters\x12Z\n\x0fderivation_type\x18\x08\x20\x02(\
- \x0e21.hw.trezor.messages.cardano.CardanoDerivationTypeR\x0ederivationTy\
- pe\"\x17\n\x15CardanoMessageItemAck\"0\n\x1aCardanoMessagePayloadChunk\
- \x12\x12\n\x04data\x18\x01\x20\x02(\x0cR\x04data\"\x1b\n\x19CardanoMessa\
- geItemHostAck\"T\n\x1aCardanoSignMessageFinished\x12\x1c\n\tsignature\
- \x18\x01\x20\x02(\x0cR\tsignature\x12\x18\n\x07address\x18\x02\x20\x02(\
- \x0cR\x07address*B\n\x15CardanoDerivationType\x12\n\n\x06LEDGER\x10\0\
- \x12\n\n\x06ICARUS\x10\x01\x12\x11\n\rICARUS_TREZOR\x10\x02*\xd2\x01\n\
+ \x0chash_payload\x18\x05\x20\x02(\x08R\x0bhashPayload\x12,\n\x12prefer_h\
+ ex_display\x18\x06\x20\x02(\x08R\x10preferHexDisplay\x12g\n\x12address_p\
+ arameters\x18\x07\x20\x01(\x0b28.hw.trezor.messages.cardano.CardanoAddre\
+ ssParametersTypeR\x11addressParameters\x12Z\n\x0fderivation_type\x18\x08\
+ \x20\x02(\x0e21.hw.trezor.messages.cardano.CardanoDerivationTypeR\x0eder\
+ ivationType\"\x17\n\x15CardanoMessageItemAck\"0\n\x1aCardanoMessagePaylo\
+ adChunk\x12\x12\n\x04data\x18\x01\x20\x02(\x0cR\x04data\"\x1b\n\x19Carda\
+ noMessageItemHostAck\"T\n\x1aCardanoSignMessageFinished\x12\x1c\n\tsigna\
+ ture\x18\x01\x20\x02(\x0cR\tsignature\x12\x18\n\x07address\x18\x02\x20\
+ \x02(\x0cR\x07address*B\n\x15CardanoDerivationType\x12\n\n\x06LEDGER\x10\
+ \0\x12\n\n\x06ICARUS\x10\x01\x12\x11\n\rICARUS_TREZOR\x10\x02*\xd2\x01\n\
\x12CardanoAddressType\x12\x08\n\x04BASE\x10\0\x12\x13\n\x0fBASE_SCRIPT_\
KEY\x10\x01\x12\x13\n\x0fBASE_KEY_SCRIPT\x10\x02\x12\x16\n\x12BASE_SCRIP\
T_SCRIPT\x10\x03\x12\x0b\n\x07POINTER\x10\x04\x12\x12\n\x0ePOINTER_SCRIP\
diff --git a/tests/device_tests/cardano/test_sign_message.py b/tests/device_tests/cardano/test_sign_message.py
index e134396d..170d529d 100644
--- a/tests/device_tests/cardano/test_sign_message.py
+++ b/tests/device_tests/cardano/test_sign_message.py
@@ -36,7 +36,7 @@ def call_sign_message(
client,
payload=bytes.fromhex(parameters["payload"]),
hash_payload=parameters["hash_payload"],
- display_ascii=parameters["display_ascii"],
+ prefer_hex_display=parameters["prefer_hex_display"],
signing_path=tools.parse_path(parameters["signing_path"]),
address_parameters=cardano.parse_optional_address_parameters(
parameters.get("address_parameters")
Why this scored 29/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.