Browse Source

Merge pull request #2545 from chriseth/ecInfinity

Do not accept the point at infinity as valid public key for ecrecover.
cl-refactor
Gav Wood 10 years ago
parent
commit
600ae091c0
  1. 2
      libdevcrypto/CryptoPP.cpp

2
libdevcrypto/CryptoPP.cpp

@ -287,6 +287,8 @@ Public Secp256k1PP::recover(Signature _signature, bytesConstRef _message)
{
// todo: make generator member
p = m_curve.CascadeMultiply(u2, x, u1, m_params.GetSubgroupGenerator());
if (p.identity)
return Public();
m_curve.EncodePoint(recoveredbytes, p, false);
}
memcpy(recovered.data(), &recoveredbytes[1], 64);

Loading…
Cancel
Save