I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit dceef0da authored by zzz's avatar zzz
Browse files

Router: Ban hash of all-zero RI

seen live on the net
parent 68ebda19
No related branches found
No related tags found
No related merge requests found
Pipeline #2220 passed
...@@ -57,7 +57,7 @@ class BanlistRenderer { ...@@ -57,7 +57,7 @@ class BanlistRenderer {
buf.append("<li>").append(_context.commSystem().renderPeerHTML(key)); buf.append("<li>").append(_context.commSystem().renderPeerHTML(key));
buf.append(' '); buf.append(' ');
String expireString = DataHelper.formatDuration2(expires); String expireString = DataHelper.formatDuration2(expires);
if (key.equals(Hash.FAKE_HASH)) if (key.equals(Hash.FAKE_HASH) || key.equals(Banlist.HASH_ZERORI))
buf.append(_t("Permanently banned")); buf.append(_t("Permanently banned"));
else if (expires < 5l*24*60*60*1000) else if (expires < 5l*24*60*60*1000)
buf.append(_t("Temporary ban expiring in {0}", expireString)); buf.append(_t("Temporary ban expiring in {0}", expireString));
......
...@@ -18,6 +18,7 @@ import java.util.Map; ...@@ -18,6 +18,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.i2p.data.Base64;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
import net.i2p.data.Hash; import net.i2p.data.Hash;
import net.i2p.router.peermanager.PeerProfile; import net.i2p.router.peermanager.PeerProfile;
...@@ -35,6 +36,12 @@ public class Banlist { ...@@ -35,6 +36,12 @@ public class Banlist {
private final Log _log; private final Log _log;
private final RouterContext _context; private final RouterContext _context;
private final Map<Hash, Entry> _entries; private final Map<Hash, Entry> _entries;
/**
* hash of 387 zeros
* @since 0.9.66
*/
public static final Hash HASH_ZERORI = new Hash(Base64.decode("MRn86w6tHQgE25D7DIejOBCJ-dImSjdsQaOaBuUypkE="));
public static class Entry { public static class Entry {
/** when it should expire, per the i2p clock */ /** when it should expire, per the i2p clock */
...@@ -70,6 +77,7 @@ public class Banlist { ...@@ -70,6 +77,7 @@ public class Banlist {
_context.jobQueue().addJob(new Cleanup(_context)); _context.jobQueue().addJob(new Cleanup(_context));
// i2pd bug? // i2pd bug?
banlistRouterForever(Hash.FAKE_HASH, "Invalid Hash"); banlistRouterForever(Hash.FAKE_HASH, "Invalid Hash");
banlistRouterForever(HASH_ZERORI, "Invalid Hash");
} }
private class Cleanup extends JobImpl { private class Cleanup extends JobImpl {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment