From 4ab6bff693548b41bf2be6403e18423107c57009 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Thu, 4 Apr 2024 11:47:25 +0200 Subject: [PATCH] Add ThpUnallocatedChannel and ThpUnallocatedSession Failure types --- common/protob/messages-common.proto | 2 + core/src/trezor/enums/FailureType.py | 2 + core/src/trezor/enums/__init__.py | 2 + python/src/trezorlib/messages.py | 2 + .../src/protos/generated/messages_common.rs | 93 +++++++++++-------- 5 files changed, 61 insertions(+), 40 deletions(-) diff --git a/common/protob/messages-common.proto b/common/protob/messages-common.proto index e7a0ac715..b287b71fb 100644 --- a/common/protob/messages-common.proto +++ b/common/protob/messages-common.proto @@ -39,6 +39,8 @@ message Failure { Failure_PinMismatch = 12; Failure_WipeCodeMismatch = 13; Failure_InvalidSession = 14; + Failure_ThpUnallocatedChannel=15; + Failure_ThpUnallocatedSession=16; Failure_FirmwareError = 99; } } diff --git a/core/src/trezor/enums/FailureType.py b/core/src/trezor/enums/FailureType.py index fbb2001e5..cab30ed7c 100644 --- a/core/src/trezor/enums/FailureType.py +++ b/core/src/trezor/enums/FailureType.py @@ -16,4 +16,6 @@ NotInitialized = 11 PinMismatch = 12 WipeCodeMismatch = 13 InvalidSession = 14 +ThpUnallocatedChannel = 15 +ThpUnallocatedSession = 16 FirmwareError = 99 diff --git a/core/src/trezor/enums/__init__.py b/core/src/trezor/enums/__init__.py index 3b079468e..82ec8e02e 100644 --- a/core/src/trezor/enums/__init__.py +++ b/core/src/trezor/enums/__init__.py @@ -288,6 +288,8 @@ if TYPE_CHECKING: PinMismatch = 12 WipeCodeMismatch = 13 InvalidSession = 14 + ThpUnallocatedChannel = 15 + ThpUnallocatedSession = 16 FirmwareError = 99 class ButtonRequestType(IntEnum): diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py index 87f9839a6..e1fa6dafd 100644 --- a/python/src/trezorlib/messages.py +++ b/python/src/trezorlib/messages.py @@ -297,6 +297,8 @@ class FailureType(IntEnum): PinMismatch = 12 WipeCodeMismatch = 13 InvalidSession = 14 + ThpUnallocatedChannel = 15 + ThpUnallocatedSession = 16 FirmwareError = 99 diff --git a/rust/trezor-client/src/protos/generated/messages_common.rs b/rust/trezor-client/src/protos/generated/messages_common.rs index 7688e2d41..b296004d4 100644 --- a/rust/trezor-client/src/protos/generated/messages_common.rs +++ b/rust/trezor-client/src/protos/generated/messages_common.rs @@ -414,6 +414,10 @@ pub mod failure { Failure_WipeCodeMismatch = 13, // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_InvalidSession) Failure_InvalidSession = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_ThpUnallocatedChannel) + Failure_ThpUnallocatedChannel = 15, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_ThpUnallocatedSession) + Failure_ThpUnallocatedSession = 16, // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_FirmwareError) Failure_FirmwareError = 99, } @@ -441,6 +445,8 @@ pub mod failure { 12 => ::std::option::Option::Some(FailureType::Failure_PinMismatch), 13 => ::std::option::Option::Some(FailureType::Failure_WipeCodeMismatch), 14 => ::std::option::Option::Some(FailureType::Failure_InvalidSession), + 15 => ::std::option::Option::Some(FailureType::Failure_ThpUnallocatedChannel), + 16 => ::std::option::Option::Some(FailureType::Failure_ThpUnallocatedSession), 99 => ::std::option::Option::Some(FailureType::Failure_FirmwareError), _ => ::std::option::Option::None } @@ -462,6 +468,8 @@ pub mod failure { "Failure_PinMismatch" => ::std::option::Option::Some(FailureType::Failure_PinMismatch), "Failure_WipeCodeMismatch" => ::std::option::Option::Some(FailureType::Failure_WipeCodeMismatch), "Failure_InvalidSession" => ::std::option::Option::Some(FailureType::Failure_InvalidSession), + "Failure_ThpUnallocatedChannel" => ::std::option::Option::Some(FailureType::Failure_ThpUnallocatedChannel), + "Failure_ThpUnallocatedSession" => ::std::option::Option::Some(FailureType::Failure_ThpUnallocatedSession), "Failure_FirmwareError" => ::std::option::Option::Some(FailureType::Failure_FirmwareError), _ => ::std::option::Option::None } @@ -482,6 +490,8 @@ pub mod failure { FailureType::Failure_PinMismatch, FailureType::Failure_WipeCodeMismatch, FailureType::Failure_InvalidSession, + FailureType::Failure_ThpUnallocatedChannel, + FailureType::Failure_ThpUnallocatedSession, FailureType::Failure_FirmwareError, ]; } @@ -508,7 +518,9 @@ pub mod failure { FailureType::Failure_PinMismatch => 11, FailureType::Failure_WipeCodeMismatch => 12, FailureType::Failure_InvalidSession => 13, - FailureType::Failure_FirmwareError => 14, + FailureType::Failure_ThpUnallocatedChannel => 14, + FailureType::Failure_ThpUnallocatedSession => 15, + FailureType::Failure_FirmwareError => 16, }; Self::enum_descriptor().value_by_index(index) } @@ -2427,9 +2439,9 @@ impl ::protobuf::reflect::ProtobufValue for HDNodeType { static file_descriptor_proto_data: &'static [u8] = b"\ \n\x15messages-common.proto\x12\x19hw.trezor.messages.common\x1a\x0emess\ ages.proto\"%\n\x07Success\x12\x1a\n\x07message\x18\x01\x20\x01(\t:\0R\ - \x07message\"\x8f\x04\n\x07Failure\x12B\n\x04code\x18\x01\x20\x01(\x0e2.\ + \x07message\"\xd5\x04\n\x07Failure\x12B\n\x04code\x18\x01\x20\x01(\x0e2.\ .hw.trezor.messages.common.Failure.FailureTypeR\x04code\x12\x18\n\x07mes\ - sage\x18\x02\x20\x01(\tR\x07message\"\xa5\x03\n\x0bFailureType\x12\x1d\n\ + sage\x18\x02\x20\x01(\tR\x07message\"\xeb\x03\n\x0bFailureType\x12\x1d\n\ \x19Failure_UnexpectedMessage\x10\x01\x12\x1a\n\x16Failure_ButtonExpecte\ d\x10\x02\x12\x15\n\x11Failure_DataError\x10\x03\x12\x1b\n\x17Failure_Ac\ tionCancelled\x10\x04\x12\x17\n\x13Failure_PinExpected\x10\x05\x12\x18\n\ @@ -2438,43 +2450,44 @@ static file_descriptor_proto_data: &'static [u8] = b"\ essError\x10\t\x12\x1a\n\x16Failure_NotEnoughFunds\x10\n\x12\x1a\n\x16Fa\ ilure_NotInitialized\x10\x0b\x12\x17\n\x13Failure_PinMismatch\x10\x0c\ \x12\x1c\n\x18Failure_WipeCodeMismatch\x10\r\x12\x1a\n\x16Failure_Invali\ - dSession\x10\x0e\x12\x19\n\x15Failure_FirmwareError\x10c\"\x91\x06\n\rBu\ - ttonRequest\x12N\n\x04code\x18\x01\x20\x01(\x0e2:.hw.trezor.messages.com\ - mon.ButtonRequest.ButtonRequestTypeR\x04code\x12\x14\n\x05pages\x18\x02\ - \x20\x01(\rR\x05pages\"\x99\x05\n\x11ButtonRequestType\x12\x17\n\x13Butt\ - onRequest_Other\x10\x01\x12\"\n\x1eButtonRequest_FeeOverThreshold\x10\ - \x02\x12\x1f\n\x1bButtonRequest_ConfirmOutput\x10\x03\x12\x1d\n\x19Butto\ - nRequest_ResetDevice\x10\x04\x12\x1d\n\x19ButtonRequest_ConfirmWord\x10\ - \x05\x12\x1c\n\x18ButtonRequest_WipeDevice\x10\x06\x12\x1d\n\x19ButtonRe\ - quest_ProtectCall\x10\x07\x12\x18\n\x14ButtonRequest_SignTx\x10\x08\x12\ - \x1f\n\x1bButtonRequest_FirmwareCheck\x10\t\x12\x19\n\x15ButtonRequest_A\ - ddress\x10\n\x12\x1b\n\x17ButtonRequest_PublicKey\x10\x0b\x12#\n\x1fButt\ - onRequest_MnemonicWordCount\x10\x0c\x12\x1f\n\x1bButtonRequest_MnemonicI\ - nput\x10\r\x120\n(_Deprecated_ButtonRequest_PassphraseType\x10\x0e\x1a\ - \x02\x08\x01\x12'\n#ButtonRequest_UnknownDerivationPath\x10\x0f\x12\"\n\ - \x1eButtonRequest_RecoveryHomepage\x10\x10\x12\x19\n\x15ButtonRequest_Su\ - ccess\x10\x11\x12\x19\n\x15ButtonRequest_Warning\x10\x12\x12!\n\x1dButto\ - nRequest_PassphraseEntry\x10\x13\x12\x1a\n\x16ButtonRequest_PinEntry\x10\ - \x14\"\x0b\n\tButtonAck\"\xbb\x02\n\x10PinMatrixRequest\x12T\n\x04type\ - \x18\x01\x20\x01(\x0e2@.hw.trezor.messages.common.PinMatrixRequest.PinMa\ - trixRequestTypeR\x04type\"\xd0\x01\n\x14PinMatrixRequestType\x12\x20\n\ - \x1cPinMatrixRequestType_Current\x10\x01\x12!\n\x1dPinMatrixRequestType_\ - NewFirst\x10\x02\x12\"\n\x1ePinMatrixRequestType_NewSecond\x10\x03\x12&\ - \n\"PinMatrixRequestType_WipeCodeFirst\x10\x04\x12'\n#PinMatrixRequestTy\ - pe_WipeCodeSecond\x10\x05\"\x20\n\x0cPinMatrixAck\x12\x10\n\x03pin\x18\ - \x01\x20\x02(\tR\x03pin\"5\n\x11PassphraseRequest\x12\x20\n\n_on_device\ - \x18\x01\x20\x01(\x08R\x08OnDeviceB\x02\x18\x01\"g\n\rPassphraseAck\x12\ - \x1e\n\npassphrase\x18\x01\x20\x01(\tR\npassphrase\x12\x19\n\x06_state\ - \x18\x02\x20\x01(\x0cR\x05StateB\x02\x18\x01\x12\x1b\n\ton_device\x18\ - \x03\x20\x01(\x08R\x08onDevice\"=\n!Deprecated_PassphraseStateRequest\ - \x12\x14\n\x05state\x18\x01\x20\x01(\x0cR\x05state:\x02\x18\x01\"#\n\x1d\ - Deprecated_PassphraseStateAck:\x02\x18\x01\"\xc0\x01\n\nHDNodeType\x12\ - \x14\n\x05depth\x18\x01\x20\x02(\rR\x05depth\x12\x20\n\x0bfingerprint\ - \x18\x02\x20\x02(\rR\x0bfingerprint\x12\x1b\n\tchild_num\x18\x03\x20\x02\ - (\rR\x08childNum\x12\x1d\n\nchain_code\x18\x04\x20\x02(\x0cR\tchainCode\ - \x12\x1f\n\x0bprivate_key\x18\x05\x20\x01(\x0cR\nprivateKey\x12\x1d\n\np\ - ublic_key\x18\x06\x20\x02(\x0cR\tpublicKeyB>\n#com.satoshilabs.trezor.li\ - b.protobufB\x13TrezorMessageCommon\x80\xa6\x1d\x01\ + dSession\x10\x0e\x12!\n\x1dFailure_ThpUnallocatedChannel\x10\x0f\x12!\n\ + \x1dFailure_ThpUnallocatedSession\x10\x10\x12\x19\n\x15Failure_FirmwareE\ + rror\x10c\"\x91\x06\n\rButtonRequest\x12N\n\x04code\x18\x01\x20\x01(\x0e\ + 2:.hw.trezor.messages.common.ButtonRequest.ButtonRequestTypeR\x04code\ + \x12\x14\n\x05pages\x18\x02\x20\x01(\rR\x05pages\"\x99\x05\n\x11ButtonRe\ + questType\x12\x17\n\x13ButtonRequest_Other\x10\x01\x12\"\n\x1eButtonRequ\ + est_FeeOverThreshold\x10\x02\x12\x1f\n\x1bButtonRequest_ConfirmOutput\ + \x10\x03\x12\x1d\n\x19ButtonRequest_ResetDevice\x10\x04\x12\x1d\n\x19But\ + tonRequest_ConfirmWord\x10\x05\x12\x1c\n\x18ButtonRequest_WipeDevice\x10\ + \x06\x12\x1d\n\x19ButtonRequest_ProtectCall\x10\x07\x12\x18\n\x14ButtonR\ + equest_SignTx\x10\x08\x12\x1f\n\x1bButtonRequest_FirmwareCheck\x10\t\x12\ + \x19\n\x15ButtonRequest_Address\x10\n\x12\x1b\n\x17ButtonRequest_PublicK\ + ey\x10\x0b\x12#\n\x1fButtonRequest_MnemonicWordCount\x10\x0c\x12\x1f\n\ + \x1bButtonRequest_MnemonicInput\x10\r\x120\n(_Deprecated_ButtonRequest_P\ + assphraseType\x10\x0e\x1a\x02\x08\x01\x12'\n#ButtonRequest_UnknownDeriva\ + tionPath\x10\x0f\x12\"\n\x1eButtonRequest_RecoveryHomepage\x10\x10\x12\ + \x19\n\x15ButtonRequest_Success\x10\x11\x12\x19\n\x15ButtonRequest_Warni\ + ng\x10\x12\x12!\n\x1dButtonRequest_PassphraseEntry\x10\x13\x12\x1a\n\x16\ + ButtonRequest_PinEntry\x10\x14\"\x0b\n\tButtonAck\"\xbb\x02\n\x10PinMatr\ + ixRequest\x12T\n\x04type\x18\x01\x20\x01(\x0e2@.hw.trezor.messages.commo\ + n.PinMatrixRequest.PinMatrixRequestTypeR\x04type\"\xd0\x01\n\x14PinMatri\ + xRequestType\x12\x20\n\x1cPinMatrixRequestType_Current\x10\x01\x12!\n\ + \x1dPinMatrixRequestType_NewFirst\x10\x02\x12\"\n\x1ePinMatrixRequestTyp\ + e_NewSecond\x10\x03\x12&\n\"PinMatrixRequestType_WipeCodeFirst\x10\x04\ + \x12'\n#PinMatrixRequestType_WipeCodeSecond\x10\x05\"\x20\n\x0cPinMatrix\ + Ack\x12\x10\n\x03pin\x18\x01\x20\x02(\tR\x03pin\"5\n\x11PassphraseReques\ + t\x12\x20\n\n_on_device\x18\x01\x20\x01(\x08R\x08OnDeviceB\x02\x18\x01\"\ + g\n\rPassphraseAck\x12\x1e\n\npassphrase\x18\x01\x20\x01(\tR\npassphrase\ + \x12\x19\n\x06_state\x18\x02\x20\x01(\x0cR\x05StateB\x02\x18\x01\x12\x1b\ + \n\ton_device\x18\x03\x20\x01(\x08R\x08onDevice\"=\n!Deprecated_Passphra\ + seStateRequest\x12\x14\n\x05state\x18\x01\x20\x01(\x0cR\x05state:\x02\ + \x18\x01\"#\n\x1dDeprecated_PassphraseStateAck:\x02\x18\x01\"\xc0\x01\n\ + \nHDNodeType\x12\x14\n\x05depth\x18\x01\x20\x02(\rR\x05depth\x12\x20\n\ + \x0bfingerprint\x18\x02\x20\x02(\rR\x0bfingerprint\x12\x1b\n\tchild_num\ + \x18\x03\x20\x02(\rR\x08childNum\x12\x1d\n\nchain_code\x18\x04\x20\x02(\ + \x0cR\tchainCode\x12\x1f\n\x0bprivate_key\x18\x05\x20\x01(\x0cR\nprivate\ + Key\x12\x1d\n\npublic_key\x18\x06\x20\x02(\x0cR\tpublicKeyB>\n#com.satos\ + hilabs.trezor.lib.protobufB\x13TrezorMessageCommon\x80\xa6\x1d\x01\ "; /// `FileDescriptorProto` object which was a source for this generated file