commit ffbd0ccecd719c37c7f7182c4a8c47fe7a449390 parent d69318ff148f99c2b77ba8acd17a7988797191cd Author: SomberNight <somber.night@protonmail.com> Date: Fri, 30 Mar 2018 22:05:55 +0200 fix #2670 Diffstat:
M | plugins/keepkey/clientbase.py | | | 8 | +++++++- |
M | plugins/trezor/clientbase.py | | | 8 | +++++++- |
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/plugins/keepkey/clientbase.py b/plugins/keepkey/clientbase.py @@ -69,7 +69,13 @@ class GuiMixin(object): if passphrase is None: return self.proto.Cancel() passphrase = bip39_normalize_passphrase(passphrase) - return self.proto.PassphraseAck(passphrase=passphrase) + + ack = self.proto.PassphraseAck(passphrase=passphrase) + length = len(ack.passphrase) + if length > 50: + self.handler.show_error(_("Too long passphrase ({} > 50 chars).").format(length)) + return self.proto.Cancel() + return ack def callback_WordRequest(self, msg): self.step += 1 diff --git a/plugins/trezor/clientbase.py b/plugins/trezor/clientbase.py @@ -72,7 +72,13 @@ class GuiMixin(object): if passphrase is None: return self.proto.Cancel() passphrase = bip39_normalize_passphrase(passphrase) - return self.proto.PassphraseAck(passphrase=passphrase) + + ack = self.proto.PassphraseAck(passphrase=passphrase) + length = len(ack.passphrase) + if length > 50: + self.handler.show_error(_("Too long passphrase ({} > 50 chars).").format(length)) + return self.proto.Cancel() + return ack def callback_PassphraseStateRequest(self, msg): return self.proto.PassphraseStateAck()