From 0ec628ccd486f1b34b8bf272b5a52f9289263d33 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 12 Feb 2020 17:18:30 +0100 Subject: [PATCH] legacy: fix CALLBACK checker --- legacy/firmware/protob/Makefile | 4 ++-- legacy/firmware/protob/messages-common.options | 3 +++ legacy/firmware/protob/messages-debug.options | 6 ++++++ legacy/script/cibuild | 2 +- python/src/trezorlib/client.py | 6 +----- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/legacy/firmware/protob/Makefile b/legacy/firmware/protob/Makefile index 3ebe6dd30..34433bafa 100644 --- a/legacy/firmware/protob/Makefile +++ b/legacy/firmware/protob/Makefile @@ -9,11 +9,11 @@ ifeq ($(BITCOIN_ONLY), 1) SKIPPED_MESSAGES += Ethereum Lisk NEM Stellar endif -all: messages_map.h messages_map_limits.h messages-bitcoin.pb.c messages-common.pb.c messages-crypto.pb.c messages-debug.pb.c messages-ethereum.pb.c messages-management.pb.c messages-nem.pb.c messages.pb.c messages-stellar.pb.c messages-lisk.pb.c messages_nem_pb2.py +all: messages_map.h messages_map_limits.h messages-bitcoin.pb.h messages-common.pb.h messages-crypto.pb.h messages-debug.pb.h messages-ethereum.pb.h messages-management.pb.h messages-nem.pb.h messages.pb.h messages-stellar.pb.h messages-lisk.pb.h messages_nem_pb2.py PYTHON ?= python -%.pb.c: %.pb %.options +%.pb.h: %.pb %.options @printf " NANOPB $@\n" $(Q)nanopb_generator $< \ -L '#include "%s"' \ diff --git a/legacy/firmware/protob/messages-common.options b/legacy/firmware/protob/messages-common.options index 6060e696b..51ecb6ad2 100644 --- a/legacy/firmware/protob/messages-common.options +++ b/legacy/firmware/protob/messages-common.options @@ -5,6 +5,9 @@ Failure.message max_size:256 PinMatrixAck.pin max_size:10 PassphraseAck.passphrase max_size:51 +PassphraseAck._state max_size:32 + +Deprecated_PassphraseStateRequest.state max_size:1 HDNodeType.chain_code max_size:32 HDNodeType.private_key max_size:32 diff --git a/legacy/firmware/protob/messages-debug.options b/legacy/firmware/protob/messages-debug.options index 496ed2278..fc7e915ea 100644 --- a/legacy/firmware/protob/messages-debug.options +++ b/legacy/firmware/protob/messages-debug.options @@ -17,3 +17,9 @@ DebugLinkMemoryWrite.memory max_size:1024 # unused fields DebugLinkState.layout_lines max_count:10 max_size:30 DebugLinkLayout.lines max_count:10 max_size:30 +DebugLinkRecordScreen.target_directory max_size:1 +DebugLinkShowText.header_text max_size:1 +DebugLinkShowText.body_text max_count:1 +DebugLinkShowText.header_icon max_size:1 +DebugLinkShowText.icon_color max_size:1 +DebugLinkShowTextItem.content max_size:1 diff --git a/legacy/script/cibuild b/legacy/script/cibuild index 189efbdeb..436907572 100755 --- a/legacy/script/cibuild +++ b/legacy/script/cibuild @@ -20,7 +20,7 @@ if [ "$EMULATOR" != 1 ]; then fi # invoking nanopb_generator to make sure its proto files are generated -nanopb_generator 2>/dev/null || true +nanopb_generator >/dev/null || true make -C firmware/protob make -C firmware diff --git a/python/src/trezorlib/client.py b/python/src/trezorlib/client.py index 5d00fe401..cfb624393 100644 --- a/python/src/trezorlib/client.py +++ b/python/src/trezorlib/client.py @@ -187,12 +187,8 @@ class TrezorClient: available_on_device = Capability.PassphraseEntry in self.features.capabilities def send_passphrase(passphrase=None, on_device=None): - if self.features.model == "1": - state = None - else: - state = self.session_id msg = messages.PassphraseAck( - _state=state, passphrase=passphrase, on_device=on_device + _state=self.session_id, passphrase=passphrase, on_device=on_device ) resp = self.call_raw(msg) if isinstance(resp, messages.Deprecated_PassphraseStateRequest):