Banlist: Ban all-zero hash

NetDb: Drop all-zero lookups and stores, add stats
SSU:
 - Fix debug logging of dumped packets
 - Drop sessions with bad clock skew, banlist peer, add stats
 - Drop sessions with corrupt DSM, banlist peer, add stats
Log tweaks
This commit is contained in:
zzz
2015-05-27 21:00:46 +00:00
parent 03dfa6515b
commit fba0372339
6 changed files with 113 additions and 8 deletions

View File

@@ -103,6 +103,13 @@ public class DatabaseStoreMessage extends FastI2NPMessageImpl {
int curIndex = offset;
_key = Hash.create(data, curIndex);
// i2pd bug? Generally followed by corrupt gzipped content.
// Fast-fail here to save resources.
if (_key.equals(Hash.FAKE_HASH)) {
// createRateStat in KNDF
_context.statManager().addRateData("netDb.DSMAllZeros", 1);
throw new I2NPMessageException("DSM all zeros");
}
curIndex += Hash.HASH_LENGTH;
// as of 0.9.18, ignore other 7 bits of the type byte, in preparation for future options