From 55db81f0fccb271451d00f355afcc6717d3ce5d4 Mon Sep 17 00:00:00 2001 From: M1nd3r <petrsedlacek.km@seznam.cz> Date: Tue, 28 Jan 2025 08:39:28 +0100 Subject: [PATCH] fixup! fixup! temp: update pairing process, part 1 --- common/protob/messages-debug.proto | 2 +- common/protob/messages-thp.proto | 4 +- core/src/apps/debug/__init__.py | 14 +- core/src/apps/thp/pairing.py | 4 +- core/src/trezor/messages.py | 8 +- python/src/trezorlib/messages.py | 10 +- .../src/protos/generated/messages_debug.rs | 84 +++++----- .../src/protos/generated/messages_thp.rs | 149 +++++++++--------- 8 files changed, 139 insertions(+), 136 deletions(-) diff --git a/common/protob/messages-debug.proto b/common/protob/messages-debug.proto index a6896ceb31..357496f37b 100644 --- a/common/protob/messages-debug.proto +++ b/common/protob/messages-debug.proto @@ -134,7 +134,7 @@ message DebugLinkState { repeated string tokens = 13; // current layout represented as a list of string tokens optional uint32 thp_pairing_code_entry_code = 14; optional bytes thp_pairing_code_qr_code = 15; - optional bytes thp_pairing_code_nfc_unidirectional = 16; + optional bytes thp_pairing_code_nfc = 16; } /** diff --git a/common/protob/messages-thp.proto b/common/protob/messages-thp.proto index 4977c18c5c..489c0f9901 100644 --- a/common/protob/messages-thp.proto +++ b/common/protob/messages-thp.proto @@ -82,7 +82,7 @@ message ThpCreateNewSession{ /** * Request: Start pairing process. * @start - * @next ThpPairingRequestAck + * @next ThpPairingRequestApproved */ message ThpPairingRequest{ optional string host_name = 1; // Human-readable host name @@ -93,7 +93,7 @@ message ThpPairingRequest{ * @start * @next ThpSelectMethod */ -message ThpPairingRequestAck{ +message ThpPairingRequestApproved{ } /** diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index d7364f14f2..bec09fda6e 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -252,7 +252,7 @@ if __debug__: def _state( thp_pairing_code_entry_code: int | None = None, thp_pairing_code_qr_code: bytes | None = None, - thp_pairing_code_nfc_unidirectional: bytes | None = None, + thp_pairing_code_nfc: bytes | None = None, ) -> DebugLinkState: from trezor.messages import DebugLinkState @@ -274,7 +274,7 @@ if __debug__: tokens=tokens, thp_pairing_code_entry_code=thp_pairing_code_entry_code, thp_pairing_code_qr_code=thp_pairing_code_qr_code, - thp_pairing_code_nfc_unidirectional=thp_pairing_code_nfc_unidirectional, + thp_pairing_code_nfc=thp_pairing_code_nfc, ) async def dispatch_DebugLinkGetState( @@ -283,7 +283,7 @@ if __debug__: thp_pairing_code_entry_code: int | None = None thp_pairing_code_qr_code: bytes | None = None - thp_pairing_code_nfc_unidirectional: bytes | None = None + thp_pairing_code_nfc: bytes | None = None if utils.USE_THP and msg.thp_channel_id is not None: channel_id = int.from_bytes(msg.thp_channel_id, "big") @@ -301,13 +301,15 @@ if __debug__: if ctx is not None and isinstance(ctx, PairingContext): thp_pairing_code_entry_code = ctx.display_data.code_code_entry thp_pairing_code_qr_code = ctx.display_data.code_qr_code - thp_pairing_code_nfc_unidirectional = ctx.display_data.code_nfc + thp_pairing_code_nfc = ctx.display_data.code_nfc + if msg.host_nfc_secret is not None: + ctx.host_nfc_secret = msg.host_nfc_secret if msg.wait_layout == DebugWaitType.IMMEDIATE: return _state( thp_pairing_code_entry_code, thp_pairing_code_qr_code, - thp_pairing_code_nfc_unidirectional, + thp_pairing_code_nfc, ) assert DEBUG_CONTEXT is not None @@ -322,7 +324,7 @@ if __debug__: return _state( thp_pairing_code_entry_code, thp_pairing_code_qr_code, - thp_pairing_code_nfc_unidirectional, + thp_pairing_code_nfc, ) async def dispatch_DebugLinkRecordScreen(msg: DebugLinkRecordScreen) -> Success: diff --git a/core/src/apps/thp/pairing.py b/core/src/apps/thp/pairing.py index 221b44edf6..28a6796cea 100644 --- a/core/src/apps/thp/pairing.py +++ b/core/src/apps/thp/pairing.py @@ -21,7 +21,7 @@ from trezor.messages import ( ThpNfcTagTrezor, ThpPairingPreparationsFinished, ThpPairingRequest, - ThpPairingRequestAck, + ThpPairingRequestApproved, ThpQrCodeSecret, ThpQrCodeTag, ThpSelectMethod, @@ -97,7 +97,7 @@ async def handle_pairing_request( # TODO show dialog select_method_msg: ThpSelectMethod = await ctx.call( - ThpPairingRequestAck(), ThpSelectMethod + ThpPairingRequestApproved(), ThpSelectMethod ) assert select_method_msg.selected_pairing_method is not None diff --git a/core/src/trezor/messages.py b/core/src/trezor/messages.py index bf0e38a162..77ba585117 100644 --- a/core/src/trezor/messages.py +++ b/core/src/trezor/messages.py @@ -2930,7 +2930,7 @@ if TYPE_CHECKING: tokens: "list[str]" thp_pairing_code_entry_code: "int | None" thp_pairing_code_qr_code: "bytes | None" - thp_pairing_code_nfc_unidirectional: "bytes | None" + thp_pairing_code_nfc: "bytes | None" def __init__( self, @@ -2950,7 +2950,7 @@ if TYPE_CHECKING: mnemonic_type: "BackupType | None" = None, thp_pairing_code_entry_code: "int | None" = None, thp_pairing_code_qr_code: "bytes | None" = None, - thp_pairing_code_nfc_unidirectional: "bytes | None" = None, + thp_pairing_code_nfc: "bytes | None" = None, ) -> None: pass @@ -6240,10 +6240,10 @@ if TYPE_CHECKING: def is_type_of(cls, msg: Any) -> TypeGuard["ThpPairingRequest"]: return isinstance(msg, cls) - class ThpPairingRequestAck(protobuf.MessageType): + class ThpPairingRequestApproved(protobuf.MessageType): @classmethod - def is_type_of(cls, msg: Any) -> TypeGuard["ThpPairingRequestAck"]: + def is_type_of(cls, msg: Any) -> TypeGuard["ThpPairingRequestApproved"]: return isinstance(msg, cls) class ThpSelectMethod(protobuf.MessageType): diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py index c2d376f30f..0e7de6b7a6 100644 --- a/python/src/trezorlib/messages.py +++ b/python/src/trezorlib/messages.py @@ -4203,7 +4203,7 @@ class DebugLinkState(protobuf.MessageType): 13: protobuf.Field("tokens", "string", repeated=True, required=False, default=None), 14: protobuf.Field("thp_pairing_code_entry_code", "uint32", repeated=False, required=False, default=None), 15: protobuf.Field("thp_pairing_code_qr_code", "bytes", repeated=False, required=False, default=None), - 16: protobuf.Field("thp_pairing_code_nfc_unidirectional", "bytes", repeated=False, required=False, default=None), + 16: protobuf.Field("thp_pairing_code_nfc", "bytes", repeated=False, required=False, default=None), } def __init__( @@ -4224,7 +4224,7 @@ class DebugLinkState(protobuf.MessageType): mnemonic_type: Optional["BackupType"] = None, thp_pairing_code_entry_code: Optional["int"] = None, thp_pairing_code_qr_code: Optional["bytes"] = None, - thp_pairing_code_nfc_unidirectional: Optional["bytes"] = None, + thp_pairing_code_nfc: Optional["bytes"] = None, ) -> None: self.tokens: Sequence["str"] = tokens if tokens is not None else [] self.layout = layout @@ -4241,7 +4241,7 @@ class DebugLinkState(protobuf.MessageType): self.mnemonic_type = mnemonic_type self.thp_pairing_code_entry_code = thp_pairing_code_entry_code self.thp_pairing_code_qr_code = thp_pairing_code_qr_code - self.thp_pairing_code_nfc_unidirectional = thp_pairing_code_nfc_unidirectional + self.thp_pairing_code_nfc = thp_pairing_code_nfc class DebugLinkStop(protobuf.MessageType): @@ -7978,8 +7978,8 @@ class ThpPairingRequest(protobuf.MessageType): self.host_name = host_name -class ThpPairingRequestAck(protobuf.MessageType): - MESSAGE_WIRE_TYPE = None +class ThpPairingRequestApproved(protobuf.MessageType): + MESSAGE_WIRE_TYPE = 1007 class ThpSelectMethod(protobuf.MessageType): diff --git a/rust/trezor-client/src/protos/generated/messages_debug.rs b/rust/trezor-client/src/protos/generated/messages_debug.rs index 3197a4fab4..a36190201d 100644 --- a/rust/trezor-client/src/protos/generated/messages_debug.rs +++ b/rust/trezor-client/src/protos/generated/messages_debug.rs @@ -1494,8 +1494,8 @@ pub struct DebugLinkState { pub thp_pairing_code_entry_code: ::std::option::Option<u32>, // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.thp_pairing_code_qr_code) pub thp_pairing_code_qr_code: ::std::option::Option<::std::vec::Vec<u8>>, - // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.thp_pairing_code_nfc_unidirectional) - pub thp_pairing_code_nfc_unidirectional: ::std::option::Option<::std::vec::Vec<u8>>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.thp_pairing_code_nfc) + pub thp_pairing_code_nfc: ::std::option::Option<::std::vec::Vec<u8>>, // special fields // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkState.special_fields) pub special_fields: ::protobuf::SpecialFields, @@ -1898,40 +1898,40 @@ impl DebugLinkState { self.thp_pairing_code_qr_code.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - // optional bytes thp_pairing_code_nfc_unidirectional = 16; + // optional bytes thp_pairing_code_nfc = 16; - pub fn thp_pairing_code_nfc_unidirectional(&self) -> &[u8] { - match self.thp_pairing_code_nfc_unidirectional.as_ref() { + pub fn thp_pairing_code_nfc(&self) -> &[u8] { + match self.thp_pairing_code_nfc.as_ref() { Some(v) => v, None => &[], } } - pub fn clear_thp_pairing_code_nfc_unidirectional(&mut self) { - self.thp_pairing_code_nfc_unidirectional = ::std::option::Option::None; + pub fn clear_thp_pairing_code_nfc(&mut self) { + self.thp_pairing_code_nfc = ::std::option::Option::None; } - pub fn has_thp_pairing_code_nfc_unidirectional(&self) -> bool { - self.thp_pairing_code_nfc_unidirectional.is_some() + pub fn has_thp_pairing_code_nfc(&self) -> bool { + self.thp_pairing_code_nfc.is_some() } // Param is passed by value, moved - pub fn set_thp_pairing_code_nfc_unidirectional(&mut self, v: ::std::vec::Vec<u8>) { - self.thp_pairing_code_nfc_unidirectional = ::std::option::Option::Some(v); + pub fn set_thp_pairing_code_nfc(&mut self, v: ::std::vec::Vec<u8>) { + self.thp_pairing_code_nfc = ::std::option::Option::Some(v); } // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. - pub fn mut_thp_pairing_code_nfc_unidirectional(&mut self) -> &mut ::std::vec::Vec<u8> { - if self.thp_pairing_code_nfc_unidirectional.is_none() { - self.thp_pairing_code_nfc_unidirectional = ::std::option::Option::Some(::std::vec::Vec::new()); + pub fn mut_thp_pairing_code_nfc(&mut self) -> &mut ::std::vec::Vec<u8> { + if self.thp_pairing_code_nfc.is_none() { + self.thp_pairing_code_nfc = ::std::option::Option::Some(::std::vec::Vec::new()); } - self.thp_pairing_code_nfc_unidirectional.as_mut().unwrap() + self.thp_pairing_code_nfc.as_mut().unwrap() } // Take field - pub fn take_thp_pairing_code_nfc_unidirectional(&mut self) -> ::std::vec::Vec<u8> { - self.thp_pairing_code_nfc_unidirectional.take().unwrap_or_else(|| ::std::vec::Vec::new()) + pub fn take_thp_pairing_code_nfc(&mut self) -> ::std::vec::Vec<u8> { + self.thp_pairing_code_nfc.take().unwrap_or_else(|| ::std::vec::Vec::new()) } fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { @@ -2013,9 +2013,9 @@ impl DebugLinkState { |m: &mut DebugLinkState| { &mut m.thp_pairing_code_qr_code }, )); fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "thp_pairing_code_nfc_unidirectional", - |m: &DebugLinkState| { &m.thp_pairing_code_nfc_unidirectional }, - |m: &mut DebugLinkState| { &mut m.thp_pairing_code_nfc_unidirectional }, + "thp_pairing_code_nfc", + |m: &DebugLinkState| { &m.thp_pairing_code_nfc }, + |m: &mut DebugLinkState| { &mut m.thp_pairing_code_nfc }, )); ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<DebugLinkState>( "DebugLinkState", @@ -2086,7 +2086,7 @@ impl ::protobuf::Message for DebugLinkState { self.thp_pairing_code_qr_code = ::std::option::Option::Some(is.read_bytes()?); }, 130 => { - self.thp_pairing_code_nfc_unidirectional = ::std::option::Option::Some(is.read_bytes()?); + self.thp_pairing_code_nfc = ::std::option::Option::Some(is.read_bytes()?); }, tag => { ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; @@ -2146,7 +2146,7 @@ impl ::protobuf::Message for DebugLinkState { if let Some(v) = self.thp_pairing_code_qr_code.as_ref() { my_size += ::protobuf::rt::bytes_size(15, &v); } - if let Some(v) = self.thp_pairing_code_nfc_unidirectional.as_ref() { + if let Some(v) = self.thp_pairing_code_nfc.as_ref() { my_size += ::protobuf::rt::bytes_size(16, &v); } my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); @@ -2200,7 +2200,7 @@ impl ::protobuf::Message for DebugLinkState { if let Some(v) = self.thp_pairing_code_qr_code.as_ref() { os.write_bytes(15, v)?; } - if let Some(v) = self.thp_pairing_code_nfc_unidirectional.as_ref() { + if let Some(v) = self.thp_pairing_code_nfc.as_ref() { os.write_bytes(16, v)?; } os.write_unknown_fields(self.special_fields.unknown_fields())?; @@ -2235,7 +2235,7 @@ impl ::protobuf::Message for DebugLinkState { self.tokens.clear(); self.thp_pairing_code_entry_code = ::std::option::Option::None; self.thp_pairing_code_qr_code = ::std::option::Option::None; - self.thp_pairing_code_nfc_unidirectional = ::std::option::Option::None; + self.thp_pairing_code_nfc = ::std::option::Option::None; self.special_fields.clear(); } @@ -2256,7 +2256,7 @@ impl ::protobuf::Message for DebugLinkState { tokens: ::std::vec::Vec::new(), thp_pairing_code_entry_code: ::std::option::Option::None, thp_pairing_code_qr_code: ::std::option::Option::None, - thp_pairing_code_nfc_unidirectional: ::std::option::Option::None, + thp_pairing_code_nfc: ::std::option::Option::None, special_fields: ::protobuf::SpecialFields::new(), }; &instance @@ -3856,7 +3856,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\ (\x0e29.hw.trezor.messages.debug.DebugLinkGetState.DebugWaitType:\tIMMED\ IATER\nwaitLayout\x12$\n\x0ethp_channel_id\x18\x04\x20\x01(\x0cR\x0cthpC\ hannelId\"C\n\rDebugWaitType\x12\r\n\tIMMEDIATE\x10\0\x12\x0f\n\x0bNEXT_\ - LAYOUT\x10\x01\x12\x12\n\x0eCURRENT_LAYOUT\x10\x02\"\xdb\x05\n\x0eDebugL\ + LAYOUT\x10\x01\x12\x12\n\x0eCURRENT_LAYOUT\x10\x02\"\xbe\x05\n\x0eDebugL\ inkState\x12\x16\n\x06layout\x18\x01\x20\x01(\x0cR\x06layout\x12\x10\n\ \x03pin\x18\x02\x20\x01(\tR\x03pin\x12\x16\n\x06matrix\x18\x03\x20\x01(\ \tR\x06matrix\x12'\n\x0fmnemonic_secret\x18\x04\x20\x01(\x0cR\x0emnemoni\ @@ -3871,22 +3871,22 @@ static file_descriptor_proto_data: &'static [u8] = b"\ monicType\x12\x16\n\x06tokens\x18\r\x20\x03(\tR\x06tokens\x12<\n\x1bthp_\ pairing_code_entry_code\x18\x0e\x20\x01(\rR\x17thpPairingCodeEntryCode\ \x126\n\x18thp_pairing_code_qr_code\x18\x0f\x20\x01(\x0cR\x14thpPairingC\ - odeQrCode\x12L\n#thp_pairing_code_nfc_unidirectional\x18\x10\x20\x01(\ - \x0cR\x1fthpPairingCodeNfcUnidirectional\"\x0f\n\rDebugLinkStop\"P\n\x0c\ - DebugLinkLog\x12\x14\n\x05level\x18\x01\x20\x01(\rR\x05level\x12\x16\n\ - \x06bucket\x18\x02\x20\x01(\tR\x06bucket\x12\x12\n\x04text\x18\x03\x20\ - \x01(\tR\x04text\"G\n\x13DebugLinkMemoryRead\x12\x18\n\x07address\x18\ - \x01\x20\x01(\rR\x07address\x12\x16\n\x06length\x18\x02\x20\x01(\rR\x06l\ - ength\")\n\x0fDebugLinkMemory\x12\x16\n\x06memory\x18\x01\x20\x01(\x0cR\ - \x06memory\"^\n\x14DebugLinkMemoryWrite\x12\x18\n\x07address\x18\x01\x20\ - \x01(\rR\x07address\x12\x16\n\x06memory\x18\x02\x20\x01(\x0cR\x06memory\ - \x12\x14\n\x05flash\x18\x03\x20\x01(\x08R\x05flash\"-\n\x13DebugLinkFlas\ - hErase\x12\x16\n\x06sector\x18\x01\x20\x01(\rR\x06sector\".\n\x14DebugLi\ - nkEraseSdCard\x12\x16\n\x06format\x18\x01\x20\x01(\x08R\x06format\"0\n\ - \x14DebugLinkWatchLayout\x12\x14\n\x05watch\x18\x01\x20\x01(\x08R\x05wat\ - ch:\x02\x18\x01\"\x1f\n\x19DebugLinkResetDebugEvents:\x02\x18\x01\"\x1a\ - \n\x18DebugLinkOptigaSetSecMaxB=\n#com.satoshilabs.trezor.lib.protobufB\ - \x12TrezorMessageDebug\x80\xa6\x1d\x01\ + odeQrCode\x12/\n\x14thp_pairing_code_nfc\x18\x10\x20\x01(\x0cR\x11thpPai\ + ringCodeNfc\"\x0f\n\rDebugLinkStop\"P\n\x0cDebugLinkLog\x12\x14\n\x05lev\ + el\x18\x01\x20\x01(\rR\x05level\x12\x16\n\x06bucket\x18\x02\x20\x01(\tR\ + \x06bucket\x12\x12\n\x04text\x18\x03\x20\x01(\tR\x04text\"G\n\x13DebugLi\ + nkMemoryRead\x12\x18\n\x07address\x18\x01\x20\x01(\rR\x07address\x12\x16\ + \n\x06length\x18\x02\x20\x01(\rR\x06length\")\n\x0fDebugLinkMemory\x12\ + \x16\n\x06memory\x18\x01\x20\x01(\x0cR\x06memory\"^\n\x14DebugLinkMemory\ + Write\x12\x18\n\x07address\x18\x01\x20\x01(\rR\x07address\x12\x16\n\x06m\ + emory\x18\x02\x20\x01(\x0cR\x06memory\x12\x14\n\x05flash\x18\x03\x20\x01\ + (\x08R\x05flash\"-\n\x13DebugLinkFlashErase\x12\x16\n\x06sector\x18\x01\ + \x20\x01(\rR\x06sector\".\n\x14DebugLinkEraseSdCard\x12\x16\n\x06format\ + \x18\x01\x20\x01(\x08R\x06format\"0\n\x14DebugLinkWatchLayout\x12\x14\n\ + \x05watch\x18\x01\x20\x01(\x08R\x05watch:\x02\x18\x01\"\x1f\n\x19DebugLi\ + nkResetDebugEvents:\x02\x18\x01\"\x1a\n\x18DebugLinkOptigaSetSecMaxB=\n#\ + com.satoshilabs.trezor.lib.protobufB\x12TrezorMessageDebug\x80\xa6\x1d\ + \x01\ "; /// `FileDescriptorProto` object which was a source for this generated file diff --git a/rust/trezor-client/src/protos/generated/messages_thp.rs b/rust/trezor-client/src/protos/generated/messages_thp.rs index 7b438976e2..bd04e4d9b0 100644 --- a/rust/trezor-client/src/protos/generated/messages_thp.rs +++ b/rust/trezor-client/src/protos/generated/messages_thp.rs @@ -863,38 +863,38 @@ impl ::protobuf::reflect::ProtobufValue for ThpPairingRequest { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>; } -// @@protoc_insertion_point(message:hw.trezor.messages.thp.ThpPairingRequestAck) +// @@protoc_insertion_point(message:hw.trezor.messages.thp.ThpPairingRequestApproved) #[derive(PartialEq,Clone,Default,Debug)] -pub struct ThpPairingRequestAck { +pub struct ThpPairingRequestApproved { // special fields - // @@protoc_insertion_point(special_field:hw.trezor.messages.thp.ThpPairingRequestAck.special_fields) + // @@protoc_insertion_point(special_field:hw.trezor.messages.thp.ThpPairingRequestApproved.special_fields) pub special_fields: ::protobuf::SpecialFields, } -impl<'a> ::std::default::Default for &'a ThpPairingRequestAck { - fn default() -> &'a ThpPairingRequestAck { - <ThpPairingRequestAck as ::protobuf::Message>::default_instance() +impl<'a> ::std::default::Default for &'a ThpPairingRequestApproved { + fn default() -> &'a ThpPairingRequestApproved { + <ThpPairingRequestApproved as ::protobuf::Message>::default_instance() } } -impl ThpPairingRequestAck { - pub fn new() -> ThpPairingRequestAck { +impl ThpPairingRequestApproved { + pub fn new() -> ThpPairingRequestApproved { ::std::default::Default::default() } fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { let mut fields = ::std::vec::Vec::with_capacity(0); let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ThpPairingRequestAck>( - "ThpPairingRequestAck", + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ThpPairingRequestApproved>( + "ThpPairingRequestApproved", fields, oneofs, ) } } -impl ::protobuf::Message for ThpPairingRequestAck { - const NAME: &'static str = "ThpPairingRequestAck"; +impl ::protobuf::Message for ThpPairingRequestApproved { + const NAME: &'static str = "ThpPairingRequestApproved"; fn is_initialized(&self) -> bool { true @@ -933,36 +933,36 @@ impl ::protobuf::Message for ThpPairingRequestAck { &mut self.special_fields } - fn new() -> ThpPairingRequestAck { - ThpPairingRequestAck::new() + fn new() -> ThpPairingRequestApproved { + ThpPairingRequestApproved::new() } fn clear(&mut self) { self.special_fields.clear(); } - fn default_instance() -> &'static ThpPairingRequestAck { - static instance: ThpPairingRequestAck = ThpPairingRequestAck { + fn default_instance() -> &'static ThpPairingRequestApproved { + static instance: ThpPairingRequestApproved = ThpPairingRequestApproved { special_fields: ::protobuf::SpecialFields::new(), }; &instance } } -impl ::protobuf::MessageFull for ThpPairingRequestAck { +impl ::protobuf::MessageFull for ThpPairingRequestApproved { fn descriptor() -> ::protobuf::reflect::MessageDescriptor { static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("ThpPairingRequestAck").unwrap()).clone() + descriptor.get(|| file_descriptor().message_by_package_relative_name("ThpPairingRequestApproved").unwrap()).clone() } } -impl ::std::fmt::Display for ThpPairingRequestAck { +impl ::std::fmt::Display for ThpPairingRequestApproved { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -impl ::protobuf::reflect::ProtobufValue for ThpPairingRequestAck { +impl ::protobuf::reflect::ProtobufValue for ThpPairingRequestApproved { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>; } @@ -4104,59 +4104,60 @@ static file_descriptor_proto_data: &'static [u8] = b"\ ession\x12\x1e\n\npassphrase\x18\x01\x20\x01(\tR\npassphrase\x12\x1b\n\t\ on_device\x18\x02\x20\x01(\x08R\x08onDevice\x12%\n\x0ederive_cardano\x18\ \x03\x20\x01(\x08R\rderiveCardano\"0\n\x11ThpPairingRequest\x12\x1b\n\th\ - ost_name\x18\x01\x20\x01(\tR\x08hostName\"\x16\n\x14ThpPairingRequestAck\ - \"s\n\x0fThpSelectMethod\x12`\n\x17selected_pairing_method\x18\x01\x20\ - \x01(\x0e2(.hw.trezor.messages.thp.ThpPairingMethodR\x15selectedPairingM\ - ethod\"\x20\n\x1eThpPairingPreparationsFinished\"8\n\x16ThpCodeEntryComm\ - itment\x12\x1e\n\ncommitment\x18\x01\x20\x01(\x0cR\ncommitment\"5\n\x15T\ - hpCodeEntryChallenge\x12\x1c\n\tchallenge\x18\x01\x20\x01(\x0cR\tchallen\ - ge\"P\n\x17ThpCodeEntryCpaceTrezor\x125\n\x17cpace_trezor_public_key\x18\ - \x01\x20\x01(\x0cR\x14cpaceTrezorPublicKey\"_\n\x18ThpCodeEntryCpaceHost\ - Tag\x121\n\x15cpace_host_public_key\x18\x01\x20\x01(\x0cR\x12cpaceHostPu\ - blicKey\x12\x10\n\x03tag\x18\x02\x20\x01(\x0cR\x03tag\",\n\x12ThpCodeEnt\ - rySecret\x12\x16\n\x06secret\x18\x01\x20\x01(\x0cR\x06secret\"\x20\n\x0c\ - ThpQrCodeTag\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\")\n\x0fThpQr\ - CodeSecret\x12\x16\n\x06secret\x18\x01\x20\x01(\x0cR\x06secret\"!\n\rThp\ - NfcTagHost\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\"#\n\x0fThpNfcT\ - agTrezor\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\"f\n\x14ThpCreden\ - tialRequest\x12,\n\x12host_static_pubkey\x18\x01\x20\x01(\x0cR\x10hostSt\ - aticPubkey\x12\x20\n\x0bautoconnect\x18\x02\x20\x01(\x08R\x0bautoconnect\ - \"i\n\x15ThpCredentialResponse\x120\n\x14trezor_static_pubkey\x18\x01\ - \x20\x01(\x0cR\x12trezorStaticPubkey\x12\x1e\n\ncredential\x18\x02\x20\ - \x01(\x0cR\ncredential\"\x0f\n\rThpEndRequest\"\x10\n\x0eThpEndResponse\ - \"\\\n\x15ThpCredentialMetadata\x12\x1b\n\thost_name\x18\x01\x20\x01(\tR\ - \x08hostName\x12\x20\n\x0bautoconnect\x18\x02\x20\x01(\x08R\x0bautoconne\ - ct:\x04\x98\xb2\x19\x01\"\x82\x01\n\x14ThpPairingCredential\x12R\n\rcred\ - _metadata\x18\x01\x20\x01(\x0b2-.hw.trezor.messages.thp.ThpCredentialMet\ - adataR\x0ccredMetadata\x12\x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac:\ - \x04\x98\xb2\x19\x01\"\xa8\x01\n\x1eThpAuthenticatedCredentialData\x12,\ - \n\x12host_static_pubkey\x18\x01\x20\x01(\x0cR\x10hostStaticPubkey\x12R\ - \n\rcred_metadata\x18\x02\x20\x01(\x0b2-.hw.trezor.messages.thp.ThpCrede\ - ntialMetadataR\x0ccredMetadata:\x04\x98\xb2\x19\x01*\xeb\x06\n\x0eThpMes\ - sageType\x12-\n\"ThpMessageType_ThpCreateNewSession\x10\xe8\x07\x1a\x04\ - \x80\xa6\x1d\x01\x12+\n\x20ThpMessageType_ThpPairingRequest\x10\xee\x07\ - \x1a\x04\x80\xa6\x1d\x01\x123\n(ThpMessageType_ThpPairingRequestApproved\ - \x10\xef\x07\x1a\x04\x80\xa6\x1d\x01\x12)\n\x1eThpMessageType_ThpSelectM\ - ethod\x10\xf0\x07\x1a\x04\x80\xa6\x1d\x01\x128\n-ThpMessageType_ThpPairi\ - ngPreparationsFinished\x10\xf1\x07\x1a\x04\x80\xa6\x1d\x01\x12.\n#ThpMes\ - sageType_ThpCredentialRequest\x10\xf2\x07\x1a\x04\x80\xa6\x1d\x01\x12/\n\ - $ThpMessageType_ThpCredentialResponse\x10\xf3\x07\x1a\x04\x80\xa6\x1d\ - \x01\x12'\n\x1cThpMessageType_ThpEndRequest\x10\xf4\x07\x1a\x04\x80\xa6\ - \x1d\x01\x12(\n\x1dThpMessageType_ThpEndResponse\x10\xf5\x07\x1a\x04\x80\ - \xa6\x1d\x01\x120\n%ThpMessageType_ThpCodeEntryCommitment\x10\xf8\x07\ - \x1a\x04\x80\xa6\x1d\x01\x12/\n$ThpMessageType_ThpCodeEntryChallenge\x10\ - \xf9\x07\x1a\x04\x80\xa6\x1d\x01\x121\n&ThpMessageType_ThpCodeEntryCpace\ - Trezor\x10\xfa\x07\x1a\x04\x80\xa6\x1d\x01\x122\n'ThpMessageType_ThpCode\ - EntryCpaceHostTag\x10\xfb\x07\x1a\x04\x80\xa6\x1d\x01\x12,\n!ThpMessageT\ - ype_ThpCodeEntrySecret\x10\xfc\x07\x1a\x04\x80\xa6\x1d\x01\x12&\n\x1bThp\ - MessageType_ThpQrCodeTag\x10\x80\x08\x1a\x04\x80\xa6\x1d\x01\x12)\n\x1eT\ - hpMessageType_ThpQrCodeSecret\x10\x81\x08\x1a\x04\x80\xa6\x1d\x01\x12'\n\ - \x1cThpMessageType_ThpNfcTagHost\x10\x88\x08\x1a\x04\x80\xa6\x1d\x01\x12\ - )\n\x1eThpMessageType_ThpNfcTagTrezor\x10\x89\x08\x1a\x04\x80\xa6\x1d\ - \x01\"\x05\x08\0\x10\xe7\x07\"\t\x08\xcc\x08\x10\xff\xff\xff\xff\x07*G\n\ - \x10ThpPairingMethod\x12\x0f\n\x0bSkipPairing\x10\x01\x12\r\n\tCodeEntry\ - \x10\x02\x12\n\n\x06QrCode\x10\x03\x12\x07\n\x03NFC\x10\x04B;\n#com.sato\ - shilabs.trezor.lib.protobufB\x10TrezorMessageThp\x80\xa6\x1d\x01\ + ost_name\x18\x01\x20\x01(\tR\x08hostName\"\x1b\n\x19ThpPairingRequestApp\ + roved\"s\n\x0fThpSelectMethod\x12`\n\x17selected_pairing_method\x18\x01\ + \x20\x01(\x0e2(.hw.trezor.messages.thp.ThpPairingMethodR\x15selectedPair\ + ingMethod\"\x20\n\x1eThpPairingPreparationsFinished\"8\n\x16ThpCodeEntry\ + Commitment\x12\x1e\n\ncommitment\x18\x01\x20\x01(\x0cR\ncommitment\"5\n\ + \x15ThpCodeEntryChallenge\x12\x1c\n\tchallenge\x18\x01\x20\x01(\x0cR\tch\ + allenge\"P\n\x17ThpCodeEntryCpaceTrezor\x125\n\x17cpace_trezor_public_ke\ + y\x18\x01\x20\x01(\x0cR\x14cpaceTrezorPublicKey\"_\n\x18ThpCodeEntryCpac\ + eHostTag\x121\n\x15cpace_host_public_key\x18\x01\x20\x01(\x0cR\x12cpaceH\ + ostPublicKey\x12\x10\n\x03tag\x18\x02\x20\x01(\x0cR\x03tag\",\n\x12ThpCo\ + deEntrySecret\x12\x16\n\x06secret\x18\x01\x20\x01(\x0cR\x06secret\"\x20\ + \n\x0cThpQrCodeTag\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\")\n\ + \x0fThpQrCodeSecret\x12\x16\n\x06secret\x18\x01\x20\x01(\x0cR\x06secret\ + \"!\n\rThpNfcTagHost\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\"#\n\ + \x0fThpNfcTagTrezor\x12\x10\n\x03tag\x18\x01\x20\x01(\x0cR\x03tag\"f\n\ + \x14ThpCredentialRequest\x12,\n\x12host_static_pubkey\x18\x01\x20\x01(\ + \x0cR\x10hostStaticPubkey\x12\x20\n\x0bautoconnect\x18\x02\x20\x01(\x08R\ + \x0bautoconnect\"i\n\x15ThpCredentialResponse\x120\n\x14trezor_static_pu\ + bkey\x18\x01\x20\x01(\x0cR\x12trezorStaticPubkey\x12\x1e\n\ncredential\ + \x18\x02\x20\x01(\x0cR\ncredential\"\x0f\n\rThpEndRequest\"\x10\n\x0eThp\ + EndResponse\"\\\n\x15ThpCredentialMetadata\x12\x1b\n\thost_name\x18\x01\ + \x20\x01(\tR\x08hostName\x12\x20\n\x0bautoconnect\x18\x02\x20\x01(\x08R\ + \x0bautoconnect:\x04\x98\xb2\x19\x01\"\x82\x01\n\x14ThpPairingCredential\ + \x12R\n\rcred_metadata\x18\x01\x20\x01(\x0b2-.hw.trezor.messages.thp.Thp\ + CredentialMetadataR\x0ccredMetadata\x12\x10\n\x03mac\x18\x02\x20\x01(\ + \x0cR\x03mac:\x04\x98\xb2\x19\x01\"\xa8\x01\n\x1eThpAuthenticatedCredent\ + ialData\x12,\n\x12host_static_pubkey\x18\x01\x20\x01(\x0cR\x10hostStatic\ + Pubkey\x12R\n\rcred_metadata\x18\x02\x20\x01(\x0b2-.hw.trezor.messages.t\ + hp.ThpCredentialMetadataR\x0ccredMetadata:\x04\x98\xb2\x19\x01*\xeb\x06\ + \n\x0eThpMessageType\x12-\n\"ThpMessageType_ThpCreateNewSession\x10\xe8\ + \x07\x1a\x04\x80\xa6\x1d\x01\x12+\n\x20ThpMessageType_ThpPairingRequest\ + \x10\xee\x07\x1a\x04\x80\xa6\x1d\x01\x123\n(ThpMessageType_ThpPairingReq\ + uestApproved\x10\xef\x07\x1a\x04\x80\xa6\x1d\x01\x12)\n\x1eThpMessageTyp\ + e_ThpSelectMethod\x10\xf0\x07\x1a\x04\x80\xa6\x1d\x01\x128\n-ThpMessageT\ + ype_ThpPairingPreparationsFinished\x10\xf1\x07\x1a\x04\x80\xa6\x1d\x01\ + \x12.\n#ThpMessageType_ThpCredentialRequest\x10\xf2\x07\x1a\x04\x80\xa6\ + \x1d\x01\x12/\n$ThpMessageType_ThpCredentialResponse\x10\xf3\x07\x1a\x04\ + \x80\xa6\x1d\x01\x12'\n\x1cThpMessageType_ThpEndRequest\x10\xf4\x07\x1a\ + \x04\x80\xa6\x1d\x01\x12(\n\x1dThpMessageType_ThpEndResponse\x10\xf5\x07\ + \x1a\x04\x80\xa6\x1d\x01\x120\n%ThpMessageType_ThpCodeEntryCommitment\ + \x10\xf8\x07\x1a\x04\x80\xa6\x1d\x01\x12/\n$ThpMessageType_ThpCodeEntryC\ + hallenge\x10\xf9\x07\x1a\x04\x80\xa6\x1d\x01\x121\n&ThpMessageType_ThpCo\ + deEntryCpaceTrezor\x10\xfa\x07\x1a\x04\x80\xa6\x1d\x01\x122\n'ThpMessage\ + Type_ThpCodeEntryCpaceHostTag\x10\xfb\x07\x1a\x04\x80\xa6\x1d\x01\x12,\n\ + !ThpMessageType_ThpCodeEntrySecret\x10\xfc\x07\x1a\x04\x80\xa6\x1d\x01\ + \x12&\n\x1bThpMessageType_ThpQrCodeTag\x10\x80\x08\x1a\x04\x80\xa6\x1d\ + \x01\x12)\n\x1eThpMessageType_ThpQrCodeSecret\x10\x81\x08\x1a\x04\x80\ + \xa6\x1d\x01\x12'\n\x1cThpMessageType_ThpNfcTagHost\x10\x88\x08\x1a\x04\ + \x80\xa6\x1d\x01\x12)\n\x1eThpMessageType_ThpNfcTagTrezor\x10\x89\x08\ + \x1a\x04\x80\xa6\x1d\x01\"\x05\x08\0\x10\xe7\x07\"\t\x08\xcc\x08\x10\xff\ + \xff\xff\xff\x07*G\n\x10ThpPairingMethod\x12\x0f\n\x0bSkipPairing\x10\ + \x01\x12\r\n\tCodeEntry\x10\x02\x12\n\n\x06QrCode\x10\x03\x12\x07\n\x03N\ + FC\x10\x04B;\n#com.satoshilabs.trezor.lib.protobufB\x10TrezorMessageThp\ + \x80\xa6\x1d\x01\ "; /// `FileDescriptorProto` object which was a source for this generated file @@ -4180,7 +4181,7 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { messages.push(ThpHandshakeCompletionReqNoisePayload::generated_message_descriptor_data()); messages.push(ThpCreateNewSession::generated_message_descriptor_data()); messages.push(ThpPairingRequest::generated_message_descriptor_data()); - messages.push(ThpPairingRequestAck::generated_message_descriptor_data()); + messages.push(ThpPairingRequestApproved::generated_message_descriptor_data()); messages.push(ThpSelectMethod::generated_message_descriptor_data()); messages.push(ThpPairingPreparationsFinished::generated_message_descriptor_data()); messages.push(ThpCodeEntryCommitment::generated_message_descriptor_data());