chore: negative indices and more bytes types
What changed, and why it matters
This commit changes the numeric codes used to identify Ethereum data types in Trezor's device-to-computer protocol. It also allows path numbers in one message type to be negative (signed integers) instead of only positive (unsigned integers). The changes are described as a routine cleanup ('chore') with no changelog entry. There is no direct evidence in the commit that this fixes a security vulnerability.
Treat as a compatibility/API maintenance change. Verify that firmware, trezorlib, and rust client versions using these enum values are updated together to avoid mismatched ABI type decoding or path parsing. No security patch action is indicated by the supplied commit alone.
Security signals we found
Protocol wire-format field type change (uint32 -> sint32) for repeated path indices
Enum value renumbering that could affect cross-version compatibility if not deployed consistently
No changelog entry and commit message frames change as non-security routine work
Evidence from the diff
The diff updates protobuf-generated enum bindings across Python, Rust, and the .proto definition for EthereumABIType: ABI_BYTES32 is renumbered from 17 to 20, ABI_BYTES from 20 to 30, ABI_STRING from 21 to 31, and new fixed-size byte types ABI_BYTES16/8/4 are added. The EthereumERC7730Path.path field changes from repeated uint32 to repeated sint32, with generated code updated accordingly. The commit message is purely a chore and explicitly says ‘[no changelog]’. No security relevance, advisory, CVE, or researcher attribution is present in the supplied materials.
Changed components
common/protob/messages-definitions.protocore/src/trezor/enums/EthereumABIType.pycore/src/trezor/enums/__init__.pypython/src/trezorlib/messages.pyrust/trezor-client/src/protos/generated/messages_definitions.rsInspect captured patch +74 / −41
diff --git a/common/protob/messages-definitions.proto b/common/protob/messages-definitions.proto
index 09c501f2..c3f0396f 100644
--- a/common/protob/messages-definitions.proto
+++ b/common/protob/messages-definitions.proto
@@ -92,9 +92,14 @@ enum EthereumABIType {
ABI_UINT16 = 14;
ABI_UINT8 = 15;
ABI_BOOL = 16;
- ABI_BYTES32 = 17;
- ABI_BYTES = 20;
- ABI_STRING = 21;
+ ABI_BYTES32 = 20;
+ ABI_BYTES16 = 21;
+ ABI_BYTES8 = 22;
+ ABI_BYTES4 = 23;
+
+ // dynamic types
+ ABI_BYTES = 30;
+ ABI_STRING = 31;
}
/**
@@ -150,7 +155,7 @@ enum EthereumERC7730ContainerPath {
*/
message EthereumERC7730Path {
// Exactly one of the following should be set:
- repeated uint32 path = 1; // eg. (0,) is encoded as [0], (1, 2) is encoded as [1, 2], etc.
+ repeated sint32 path = 1; // eg. (0,) is encoded as [0], (1, 2) is encoded as [1, 2], etc.
optional EthereumERC7730ContainerPath container_path = 2;
}
diff --git a/core/src/trezor/enums/EthereumABIType.py b/core/src/trezor/enums/EthereumABIType.py
index 4f995cb6..8946b6d4 100644
--- a/core/src/trezor/enums/EthereumABIType.py
+++ b/core/src/trezor/enums/EthereumABIType.py
@@ -19,6 +19,9 @@ ABI_UINT24 = 13
ABI_UINT16 = 14
ABI_UINT8 = 15
ABI_BOOL = 16
-ABI_BYTES32 = 17
-ABI_BYTES = 20
-ABI_STRING = 21
+ABI_BYTES32 = 20
+ABI_BYTES16 = 21
+ABI_BYTES8 = 22
+ABI_BYTES4 = 23
+ABI_BYTES = 30
+ABI_STRING = 31
diff --git a/core/src/trezor/enums/__init__.py b/core/src/trezor/enums/__init__.py
index 0df2d151..27a8d10b 100644
--- a/core/src/trezor/enums/__init__.py
+++ b/core/src/trezor/enums/__init__.py
@@ -315,9 +315,12 @@ if TYPE_CHECKING:
ABI_UINT16 = 14
ABI_UINT8 = 15
ABI_BOOL = 16
- ABI_BYTES32 = 17
- ABI_BYTES = 20
- ABI_STRING = 21
+ ABI_BYTES32 = 20
+ ABI_BYTES16 = 21
+ ABI_BYTES8 = 22
+ ABI_BYTES4 = 23
+ ABI_BYTES = 30
+ ABI_STRING = 31
class EthereumERC7730FieldFormatterType(IntEnum):
FORMATTER_ADDRESS_NAME = 0
diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py
index f310fa0f..765b1994 100644
--- a/python/src/trezorlib/messages.py
+++ b/python/src/trezorlib/messages.py
@@ -357,9 +357,12 @@ class EthereumABIType(IntEnum):
ABI_UINT16 = 14
ABI_UINT8 = 15
ABI_BOOL = 16
- ABI_BYTES32 = 17
- ABI_BYTES = 20
- ABI_STRING = 21
+ ABI_BYTES32 = 20
+ ABI_BYTES16 = 21
+ ABI_BYTES8 = 22
+ ABI_BYTES4 = 23
+ ABI_BYTES = 30
+ ABI_STRING = 31
class EthereumERC7730FieldFormatterType(IntEnum):
@@ -4809,7 +4812,7 @@ class EthereumABIValueInfo(protobuf.MessageType):
class EthereumERC7730Path(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
- 1: protobuf.Field("path", "uint32", repeated=True, required=False, default=None),
+ 1: protobuf.Field("path", "sint32", repeated=True, required=False, default=None),
2: protobuf.Field("container_path", "EthereumERC7730ContainerPath", repeated=False, required=False, default=None),
}
diff --git a/rust/trezor-client/src/protos/generated/messages_definitions.rs b/rust/trezor-client/src/protos/generated/messages_definitions.rs
index ef46255a..77037655 100644
--- a/rust/trezor-client/src/protos/generated/messages_definitions.rs
+++ b/rust/trezor-client/src/protos/generated/messages_definitions.rs
@@ -1357,7 +1357,7 @@ impl ::protobuf::reflect::ProtobufValue for EthereumABIValueInfo {
pub struct EthereumERC7730Path {
// message fields
// @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730Path.path)
- pub path: ::std::vec::Vec<u32>,
+ pub path: ::std::vec::Vec<i32>,
// @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730Path.container_path)
pub container_path: ::std::option::Option<::protobuf::EnumOrUnknown<EthereumERC7730ContainerPath>>,
// special fields
@@ -1430,10 +1430,10 @@ impl ::protobuf::Message for EthereumERC7730Path {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
- is.read_repeated_packed_uint32_into(&mut self.path)?;
+ is.read_repeated_packed_sint32_into(&mut self.path)?;
},
8 => {
- self.path.push(is.read_uint32()?);
+ self.path.push(is.read_sint32()?);
},
16 => {
self.container_path = ::std::option::Option::Some(is.read_enum_or_unknown()?);
@@ -1451,7 +1451,7 @@ impl ::protobuf::Message for EthereumERC7730Path {
fn compute_size(&self) -> u64 {
let mut my_size = 0;
for value in &self.path {
- my_size += ::protobuf::rt::uint32_size(1, *value);
+ my_size += ::protobuf::rt::sint32_size(1, *value);
};
if let Some(v) = self.container_path {
my_size += ::protobuf::rt::int32_size(2, v.value());
@@ -1463,7 +1463,7 @@ impl ::protobuf::Message for EthereumERC7730Path {
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
for v in &self.path {
- os.write_uint32(1, *v)?;
+ os.write_sint32(1, *v)?;
};
if let Some(v) = self.container_path {
os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?;
@@ -2427,11 +2427,17 @@ pub enum EthereumABIType {
// @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BOOL)
ABI_BOOL = 16,
// @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES32)
- ABI_BYTES32 = 17,
+ ABI_BYTES32 = 20,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES16)
+ ABI_BYTES16 = 21,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES8)
+ ABI_BYTES8 = 22,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES4)
+ ABI_BYTES4 = 23,
// @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES)
- ABI_BYTES = 20,
+ ABI_BYTES = 30,
// @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_STRING)
- ABI_STRING = 21,
+ ABI_STRING = 31,
}
impl ::protobuf::Enum for EthereumABIType {
@@ -2460,9 +2466,12 @@ impl ::protobuf::Enum for EthereumABIType {
14 => ::std::option::Option::Some(EthereumABIType::ABI_UINT16),
15 => ::std::option::Option::Some(EthereumABIType::ABI_UINT8),
16 => ::std::option::Option::Some(EthereumABIType::ABI_BOOL),
- 17 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES32),
- 20 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES),
- 21 => ::std::option::Option::Some(EthereumABIType::ABI_STRING),
+ 20 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES32),
+ 21 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES16),
+ 22 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES8),
+ 23 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES4),
+ 30 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES),
+ 31 => ::std::option::Option::Some(EthereumABIType::ABI_STRING),
_ => ::std::option::Option::None
}
}
@@ -2487,6 +2496,9 @@ impl ::protobuf::Enum for EthereumABIType {
"ABI_UINT8" => ::std::option::Option::Some(EthereumABIType::ABI_UINT8),
"ABI_BOOL" => ::std::option::Option::Some(EthereumABIType::ABI_BOOL),
"ABI_BYTES32" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES32),
+ "ABI_BYTES16" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES16),
+ "ABI_BYTES8" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES8),
+ "ABI_BYTES4" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES4),
"ABI_BYTES" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES),
"ABI_STRING" => ::std::option::Option::Some(EthereumABIType::ABI_STRING),
_ => ::std::option::Option::None
@@ -2512,6 +2524,9 @@ impl ::protobuf::Enum for EthereumABIType {
EthereumABIType::ABI_UINT8,
EthereumABIType::ABI_BOOL,
EthereumABIType::ABI_BYTES32,
+ EthereumABIType::ABI_BYTES16,
+ EthereumABIType::ABI_BYTES8,
+ EthereumABIType::ABI_BYTES4,
EthereumABIType::ABI_BYTES,
EthereumABIType::ABI_STRING,
];
@@ -2543,8 +2558,11 @@ impl ::protobuf::EnumFull for EthereumABIType {
EthereumABIType::ABI_UINT8 => 15,
EthereumABIType::ABI_BOOL => 16,
EthereumABIType::ABI_BYTES32 => 17,
- EthereumABIType::ABI_BYTES => 18,
- EthereumABIType::ABI_STRING => 19,
+ EthereumABIType::ABI_BYTES16 => 18,
+ EthereumABIType::ABI_BYTES8 => 19,
+ EthereumABIType::ABI_BYTES4 => 20,
+ EthereumABIType::ABI_BYTES => 21,
+ EthereumABIType::ABI_STRING => 22,
};
Self::enum_descriptor().value_by_index(index)
}
@@ -2727,11 +2745,11 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x20\x01(\x0b24.hw.trezor.messages.definitions.EthereumABITupleInfoR\x05\
tuple\x12J\n\x05array\x18\x04\x20\x01(\x0b24.hw.trezor.messages.definiti\
ons.EthereumABIValueInfoR\x05array\"\x8e\x01\n\x13EthereumERC7730Path\
- \x12\x12\n\x04path\x18\x01\x20\x03(\rR\x04path\x12c\n\x0econtainer_path\
- \x18\x02\x20\x01(\x0e2<.hw.trezor.messages.definitions.EthereumERC7730Co\
- ntainerPathR\rcontainerPath\"\x94\x03\n\x18EthereumERC7730FieldInfo\x12G\
- \n\x04path\x18\x01\x20\x02(\x0b23.hw.trezor.messages.definitions.Ethereu\
- mERC7730PathR\x04path\x12\x14\n\x05label\x18\x02\x20\x02(\tR\x05label\
+ \x12\x12\n\x04path\x18\x01\x20\x03(\x11R\x04path\x12c\n\x0econtainer_pat\
+ h\x18\x02\x20\x01(\x0e2<.hw.trezor.messages.definitions.EthereumERC7730C\
+ ontainerPathR\rcontainerPath\"\x94\x03\n\x18EthereumERC7730FieldInfo\x12\
+ G\n\x04path\x18\x01\x20\x02(\x0b23.hw.trezor.messages.definitions.Ethere\
+ umERC7730PathR\x04path\x12\x14\n\x05label\x18\x02\x20\x02(\tR\x05label\
\x12_\n\tformatter\x18\x03\x20\x02(\x0e2A.hw.trezor.messages.definitions\
.EthereumERC7730FieldFormatterTypeR\tformatter\x12R\n\ntoken_path\x18\
\x04\x20\x01(\x0b23.hw.trezor.messages.definitions.EthereumERC7730PathR\
@@ -2747,7 +2765,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x20\x03(\x0b28.hw.trezor.messages.definitions.EthereumERC7730FieldInfoR\
\x10fieldDefinitions*i\n\x0eDefinitionType\x12\x14\n\x10ETHEREUM_NETWORK\
\x10\0\x12\x12\n\x0eETHEREUM_TOKEN\x10\x01\x12\x10\n\x0cSOLANA_TOKEN\x10\
- \x02\x12\x1b\n\x17ETHEREUM_DISPLAY_FORMAT\x10\x03*\xd5\x02\n\x0fEthereum\
+ \x02\x12\x1b\n\x17ETHEREUM_DISPLAY_FORMAT\x10\x03*\x86\x03\n\x0fEthereum\
ABIType\x12\x0f\n\x0bABI_ADDRESS\x10\0\x12\x0f\n\x0bABI_UINT256\x10\x01\
\x12\x0f\n\x0bABI_UINT248\x10\x02\x12\x0f\n\x0bABI_UINT160\x10\x03\x12\
\x0f\n\x0bABI_UINT128\x10\x04\x12\x0f\n\x0bABI_UINT120\x10\x05\x12\x0f\n\
@@ -2755,14 +2773,15 @@ static file_descriptor_proto_data: &'static [u8] = b"\
T72\x10\x08\x12\x0e\n\nABI_UINT64\x10\t\x12\x0e\n\nABI_UINT48\x10\n\x12\
\x0e\n\nABI_UINT40\x10\x0b\x12\x0e\n\nABI_UINT32\x10\x0c\x12\x0e\n\nABI_\
UINT24\x10\r\x12\x0e\n\nABI_UINT16\x10\x0e\x12\r\n\tABI_UINT8\x10\x0f\
- \x12\x0c\n\x08ABI_BOOL\x10\x10\x12\x0f\n\x0bABI_BYTES32\x10\x11\x12\r\n\
- \tABI_BYTES\x10\x14\x12\x0e\n\nABI_STRING\x10\x15*\x85\x01\n!EthereumERC\
- 7730FieldFormatterType\x12\x1a\n\x16FORMATTER_ADDRESS_NAME\x10\0\x12\x14\
- \n\x10FORMATTER_AMOUNT\x10\x01\x12\x1a\n\x16FORMATTER_TOKEN_AMOUNT\x10\
- \x02\x12\x12\n\x0eFORMATTER_UNIT\x10\x03*;\n\x1cEthereumERC7730Container\
- Path\x12\x08\n\x04FROM\x10\x01\x12\t\n\x05VALUE\x10\x02\x12\x06\n\x02TO\
- \x10\x03B?\n#com.satoshilabs.trezor.lib.protobufB\x18TrezorMessageDefini\
- tions\
+ \x12\x0c\n\x08ABI_BOOL\x10\x10\x12\x0f\n\x0bABI_BYTES32\x10\x14\x12\x0f\
+ \n\x0bABI_BYTES16\x10\x15\x12\x0e\n\nABI_BYTES8\x10\x16\x12\x0e\n\nABI_B\
+ YTES4\x10\x17\x12\r\n\tABI_BYTES\x10\x1e\x12\x0e\n\nABI_STRING\x10\x1f*\
+ \x85\x01\n!EthereumERC7730FieldFormatterType\x12\x1a\n\x16FORMATTER_ADDR\
+ ESS_NAME\x10\0\x12\x14\n\x10FORMATTER_AMOUNT\x10\x01\x12\x1a\n\x16FORMAT\
+ TER_TOKEN_AMOUNT\x10\x02\x12\x12\n\x0eFORMATTER_UNIT\x10\x03*;\n\x1cEthe\
+ reumERC7730ContainerPath\x12\x08\n\x04FROM\x10\x01\x12\t\n\x05VALUE\x10\
+ \x02\x12\x06\n\x02TO\x10\x03B?\n#com.satoshilabs.trezor.lib.protobufB\
+ \x18TrezorMessageDefinitions\
";
/// `FileDescriptorProto` object which was a source for this generated file
Why this scored 16/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.