fix(core): raise `wire.Error` from `EvoluIndexManagement` handler
What changed, and why it matters
This commit fixes how a Trezor hardware wallet reports a specific user error. Previously, when someone tried to set an already-set identity key rotation index, the device returned a generic 'FirmwareError'—the type normally reserved for unexpected internal failures like running out of memory. Now it returns a clearer 'ProcessError', which tells the host software that the problem is an expected business-rule violation, not a device malfunction. There is no direct evidence this could be exploited to steal funds or bypass security; it is mainly a correctness and user-experience improvement.
No urgent action required. Treat as a routine code-quality fix. If auditing, confirm that no other expected user-input errors in the evolu app are still surfacing as FirmwareError.
Security signals we found
Error-type correction: internal/unexpected error category replaced with expected/process error category
No change to access control, authorization, cryptographic operations, or state-transition logic
Test expectations updated to match new error type
Evidence from the diff
In core/src/apps/evolu/index_management.py, the handler for EvoluIndexManagement changed the exception raised when msg.rotation_index is supplied but a rotation index is already stored from a plain ValueError (which the framework translates to FirmwareError) to trezor.wire.ProcessError. FirmwareError indicates unexpected/internal failures, whereas ProcessError is the intended wire-level error for expected protocol/state violations. The accompanying test updates simply expect ProcessError in the failure string instead of FirmwareError. The change is cosmetic at the wire level for this particular error path.
Changed components
core/src/apps/evolu/index_management.pytests/device_tests/evolu/test_delegated_identity_key_rotation.pyInspect captured patch +6 / −4
diff --git a/core/src/apps/evolu/index_management.py b/core/src/apps/evolu/index_management.py
index 55b9541a..dccded82 100644
--- a/core/src/apps/evolu/index_management.py
+++ b/core/src/apps/evolu/index_management.py
@@ -26,6 +26,8 @@ async def index_management(msg: EvoluIndexManagement) -> EvoluIndexManagementRes
set_delegated_identity_key_rotation_index(msg.rotation_index)
stored_index = msg.rotation_index
else:
- raise ValueError("Rotation index already set.")
+ from trezor.wire import ProcessError
+
+ raise ProcessError("Rotation index already set.")
return EvoluIndexManagementResponse(rotation_index=stored_index)
diff --git a/tests/device_tests/evolu/test_delegated_identity_key_rotation.py b/tests/device_tests/evolu/test_delegated_identity_key_rotation.py
index 416c4428..01631b02 100644
--- a/tests/device_tests/evolu/test_delegated_identity_key_rotation.py
+++ b/tests/device_tests/evolu/test_delegated_identity_key_rotation.py
@@ -89,7 +89,7 @@ def test_rotate_affects_index_management(client: Client):
with pytest.raises(
TrezorFailure,
- match=r"FirmwareError: Rotation index already set.",
+ match=r"ProcessError: Rotation index already set.",
):
evolu.index_management(client.get_session(), rotation_index=50)
@@ -103,13 +103,13 @@ def test_index_management_cannot_overwrite_existing_index(client: Client):
with pytest.raises(
TrezorFailure,
- match=r"FirmwareError: Rotation index already set.",
+ match=r"ProcessError: Rotation index already set.",
):
evolu.index_management(client.get_session(), rotation_index=5)
with pytest.raises(
TrezorFailure,
- match=r"FirmwareError: Rotation index already set.",
+ match=r"ProcessError: Rotation index already set.",
):
evolu.index_management(client.get_session(), rotation_index=15)
Why this scored 21/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.