electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 7ebff5616e81e75542ee0d8570a5b54bcc023755
parent 0438bbc2c26d32ec17c76a0c8f1beb69255142f2
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu, 14 Jun 2018 20:14:38 +0200

ecc.py: _MyVerifyingKey.from_signature is raising low level exception

Traceback (most recent call last):
  File "...\electrum\gui\qt\util.py", line 645, in run
    result = task.task()
  File "...\electrum\lib\wallet.py", line 1500, in sign_transaction
    k.sign_transaction(tx, password)
  File "...\electrum\plugins\keepkey\keepkey.py", line 67, in sign_transaction
    self.plugin.sign_transaction(self, tx, prev_tx, xpub_path)
  File "...\electrum\plugins\keepkey\keepkey.py", line 263, in sign_transaction
    tx.update_signatures(signatures)
  File "...\electrum\lib\transaction.py", line 667, in update_signatures
    public_key = ecc.ECPubkey.from_sig_string(sig_string, recid, pre_hash)
  File "...\electrum\lib\ecc.py", line 180, in from_sig_string
    ecdsa_verifying_key = _MyVerifyingKey.from_signature(sig_string, recid, msg_hash, curve=SECP256k1)
  File "...\electrum\lib\ecc.py", line 152, in from_signature
    Q = inv_r * ( s * R + minus_e * G )
  File "...\Python\Python36-32\lib\site-packages\ecdsa\ellipticcurve.py", line 143, in __rmul__
    return self * other
  File "...\electrum\lib\ecc_fast.py", line 120, in mul
    public_pair_bytes = b'\4' + self.x().to_bytes(32, byteorder="big") + self.y().to_bytes(32, byteorder="big")
OverflowError: int too big to convert

Diffstat:
Mlib/ecc.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/ecc.py b/lib/ecc.py @@ -149,7 +149,10 @@ class _MyVerifyingKey(ecdsa.VerifyingKey): minus_e = -e % order # 1.6 compute Q = r^-1 (sR - eG) inv_r = numbertheory.inverse_mod(r,order) - Q = inv_r * ( s * R + minus_e * G ) + try: + Q = inv_r * ( s * R + minus_e * G ) + except: + raise InvalidECPointException() return klass.from_public_point( Q, curve )