RouterInfo: Log the full RI, not the hash of the data

(which is useless) on signature verification fail,
in an attempt to find the culprit
This commit is contained in:
zzz
2015-12-12 23:14:39 +00:00
parent 68ecd82755
commit 4fe24790fd

View File

@ -487,16 +487,10 @@ public class RouterInfo extends DatabaseEntry {
if (!_isValid) { if (!_isValid) {
Log log = I2PAppContext.getGlobalContext().logManager().getLog(RouterInfo.class); Log log = I2PAppContext.getGlobalContext().logManager().getLog(RouterInfo.class);
byte data[] = null; // TODO change to warn
try { //if (log.shouldWarn()) {
data = getBytes(); log.error("Sig verify fail: " + toString(), new Exception("from"));
} catch (DataFormatException dfe) { //}
log.error("Error validating", dfe);
return;
}
log.error("Invalid [" + SHA256Generator.getInstance().calculateHash(data).toBase64()
+ (log.shouldLog(Log.WARN) ? ("]\n" + toString()) : ""),
new Exception("Signature failed"));
} }
} }