mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 18:00:39 +01:00
Catch exceptions thrown during signature checking. Some versions of Android cannot reliably check ECDSA signatures! Resolves issue 160.
This commit is contained in:
parent
58971b6728
commit
a77d071d35
@ -237,10 +237,17 @@ public class Peer {
|
||||
}
|
||||
|
||||
private void processAlert(AlertMessage m) {
|
||||
if (m.isSignatureValid()) {
|
||||
log.info("Received alert from peer {}: {}", toString(), m.getStatusBar());
|
||||
} else {
|
||||
log.warn("Received alert with invalid signature from peer {}: {}", toString(), m.getStatusBar());
|
||||
try {
|
||||
if (m.isSignatureValid()) {
|
||||
log.info("Received alert from peer {}: {}", toString(), m.getStatusBar());
|
||||
} else {
|
||||
log.warn("Received alert with invalid signature from peer {}: {}", toString(), m.getStatusBar());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// Signature checking can FAIL on Android platforms before Gingerbread apparently due to bugs in their
|
||||
// BigInteger implementations! See issue 160 for discussion. As alerts are just optional and not that
|
||||
// useful, we just swallow the error here.
|
||||
log.error("Failed to check signature: bug in platform libraries?", t);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user