diff --git a/plugins/keepkey/clientbase.py b/plugins/keepkey/clientbase.py index acbdb200a..9e1875573 100644 --- 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 index d1126e071..1c3207412 100644 --- 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()