tMerge pull request #1434 from keepkey/master - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 127f5f8804fb46267ebddc798265f96dd2a6b7be DIR parent 6704844f31cd420284d0a79a6c49c46c7d15d051 HTML Author: ThomasV <electrumdev@gmail.com> Date: Tue, 1 Sep 2015 09:43:36 +0200 Merge pull request #1434 from keepkey/master made sure to check if x_pubkey is valid xpub before parsing it Diffstat: M plugins/keepkey.py | 15 ++++++++------- M plugins/trezor.py | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) --- DIR diff --git a/plugins/keepkey.py b/plugins/keepkey.py t@@ -283,13 +283,14 @@ class Plugin(BasePlugin): ) # find which key is mine for x_pubkey in x_pubkeys: - xpub, s = BIP32_Account.parse_xpubkey(x_pubkey) - if xpub in self.xpub_path: - xpub_n = self.get_client().expand_path(self.xpub_path[xpub]) - txinputtype.address_n.extend(xpub_n + s) - break - else: - raise + if is_extended_pubkey(x_pubkey): + xpub, s = BIP32_Account.parse_xpubkey(x_pubkey) + if xpub in self.xpub_path: + xpub_n = self.get_client().expand_path(self.xpub_path[xpub]) + txinputtype.address_n.extend(xpub_n + s) + break + else: + raise prev_hash = unhexlify(txin['prevout_hash']) prev_index = txin['prevout_n'] DIR diff --git a/plugins/trezor.py b/plugins/trezor.py t@@ -282,13 +282,14 @@ class Plugin(BasePlugin): ) # find which key is mine for x_pubkey in x_pubkeys: - xpub, s = BIP32_Account.parse_xpubkey(x_pubkey) - if xpub in self.xpub_path: - xpub_n = self.get_client().expand_path(self.xpub_path[xpub]) - txinputtype.address_n.extend(xpub_n + s) - break - else: - raise + if is_extended_pubkey(x_pubkey): + xpub, s = BIP32_Account.parse_xpubkey(x_pubkey) + if xpub in self.xpub_path: + xpub_n = self.get_client().expand_path(self.xpub_path[xpub]) + txinputtype.address_n.extend(xpub_n + s) + break + else: + raise prev_hash = unhexlify(txin['prevout_hash']) prev_index = txin['prevout_n']