fix(common): correct wire direction for authenticity-related messages
What changed, and why it matters
This commit fixes a labeling error in the Trezor firmware's protocol definitions. Two message types used for device authenticity checks had their directions swapped: one was marked as outgoing when it should be incoming, and the other as incoming when it should be outgoing. The fix only changes metadata annotations and the matching generated Rust code; it does not change actual message handling logic. Because the patch is small and limited to generated descriptors, the direct security impact is low, but incorrect wire direction metadata could theoretically confuse host software or protocol validation tools.
Verify that the corrected wire directions match the actual message handler implementations in the firmware and host libraries, and ensure any other generated language bindings are regenerated from the updated .proto file. Consider adding a changelog entry for traceability.
Security signals we found
Protocol metadata direction correction for authenticity-related messages
Generated protobuf descriptor regenerated to match source annotation change
No changelog entry provided
No device-side message handler changes present in the diff
Evidence from the diff
The protobuf enum MessageType in common/protob/messages.proto incorrectly declared MessageType_AuthenticateDevice (97) as wire_out and MessageType_AuthenticityProof (98) as wire_in. The commit swaps them to wire_in and wire_out respectively, matching the intended request/response flow. The generated Rust descriptor in rust/trezor-client/src/protos/generated/messages.rs is regenerated to reflect the same bit flags (0x90 vs 0x98). No C/device-side message dispatch code is modified in this commit, so runtime behavior on the device is likely unaffected unless other code consumes these annotations.
Changed components
common/protob/messages.protorust/trezor-client/src/protos/generated/messages.rsInspect captured patch +4 / −4
diff --git a/common/protob/messages.proto b/common/protob/messages.proto
index b1dd5f47..7674fad0 100644
--- a/common/protob/messages.proto
+++ b/common/protob/messages.proto
@@ -70,8 +70,8 @@ enum MessageType {
MessageType_UnlockedPathRequest = 94 [(bitcoin_only) = true, (wire_out) = true];
MessageType_ShowDeviceTutorial = 95 [(bitcoin_only) = true, (wire_in) = true];
MessageType_UnlockBootloader = 96 [(bitcoin_only) = true, (wire_in) = true];
- MessageType_AuthenticateDevice = 97 [(bitcoin_only) = true, (wire_out) = true];
- MessageType_AuthenticityProof = 98 [(bitcoin_only) = true, (wire_in) = true];
+ MessageType_AuthenticateDevice = 97 [(bitcoin_only) = true, (wire_in) = true];
+ MessageType_AuthenticityProof = 98 [(bitcoin_only) = true, (wire_out) = true];
MessageType_ChangeLanguage = 990 [(bitcoin_only) = true, (wire_in) = true];
MessageType_DataChunkRequest = 991 [(bitcoin_only) = true, (wire_out) = true];
MessageType_DataChunkAck = 992 [(bitcoin_only) = true, (wire_in) = true];
diff --git a/rust/trezor-client/src/protos/generated/messages.rs b/rust/trezor-client/src/protos/generated/messages.rs
index 1c040404..54287f05 100644
--- a/rust/trezor-client/src/protos/generated/messages.rs
+++ b/rust/trezor-client/src/protos/generated/messages.rs
@@ -1852,8 +1852,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x98\xb5\x18\x01\x12,\n\x1eMessageType_ShowDeviceTutorial\x10_\x1a\x08\
\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12*\n\x1cMessageType_UnlockBootloader\
\x10`\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12,\n\x1eMessageType_Auth\
- enticateDevice\x10a\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12+\n\x1dMe\
- ssageType_AuthenticityProof\x10b\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\
+ enticateDevice\x10a\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12+\n\x1dMe\
+ ssageType_AuthenticityProof\x10b\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\
\x12)\n\x1aMessageType_ChangeLanguage\x10\xde\x07\x1a\x08\x80\xa6\x1d\
\x01\x90\xb5\x18\x01\x12+\n\x1cMessageType_DataChunkRequest\x10\xdf\x07\
\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12'\n\x18MessageType_DataChunk\
Why this scored 34/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.