Browse Source

Test whether recovered public keys are not infinity

Fixes a bug discovered by Sergio Demian Lerner.
master
Pieter Wuille 8 years ago
parent
commit
4861f83686
  1. 2
      src/ecdsa_impl.h

2
src/ecdsa_impl.h

@ -128,7 +128,7 @@ static int secp256k1_ecdsa_sig_recover(const secp256k1_ecdsa_sig_t *sig, secp256 @@ -128,7 +128,7 @@ static int secp256k1_ecdsa_sig_recover(const secp256k1_ecdsa_sig_t *sig, secp256
secp256k1_num_free(&rn);
secp256k1_num_free(&u1);
secp256k1_num_free(&u2);
return 1;
return !secp256k1_gej_is_infinity(&qj);
}
static int secp256k1_ecdsa_sig_verify(const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_num_t *message) {

Loading…
Cancel
Save