mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-30 23:02:15 +00:00
Catch NullPointerException from bouncy castle signature verification. This can be triggered by a specially crafted signature. Thanks to Sergio Damian Lerner for finding this.
This commit is contained in:
parent
4b4eb7b623
commit
32cc7b4880
@ -326,6 +326,9 @@ public class ECKey implements Serializable {
|
|||||||
return signer.verifySignature(data, r.getPositiveValue(), s.getPositiveValue());
|
return signer.verifySignature(data, r.getPositiveValue(), s.getPositiveValue());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
// Bug in BouncyCastle can cause this for invalid signatures.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user