Compare commits

...

7 Commits

Author SHA1 Message Date
idk
67266e5ee8 stash 2023-06-16 16:07:32 -04:00
idk
b2fea266ee bump build time 2023-06-14 13:31:20 -04:00
idk
c30ad8d386 update geolite database 2023-06-14 12:45:36 -04:00
idk
3ce34ed338 Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p 2023-06-10 22:23:05 -04:00
idk
f3794ecd10 reverse the last change to i2psnark-standalone 2023-06-10 22:16:25 -04:00
idk
0bb220b85d Merge branch '2.2.1-xormsgmask-mr' into 'master'
Router/Tunnel: Constrain xor message ID mask to >= 0

See merge request i2p-hackers/i2p.i2p!92
2023-06-11 02:05:56 +00:00
badcf76e2f Router/Tunnel: Constrain xor message ID mask to >= 0 2023-06-11 02:05:55 +00:00
11 changed files with 14 additions and 27 deletions

View File

@ -8,8 +8,6 @@ import java.util.Properties;
import org.eclipse.jetty.util.log.Log;
import net.i2p.I2PAppContext;
import net.i2p.app.MenuCallback;
import net.i2p.app.MenuHandle;
import net.i2p.apps.systray.UrlLauncher;
import net.i2p.data.DataHelper;
import net.i2p.desktopgui.ExternalMain;
@ -135,22 +133,9 @@ public class RunStandalone {
System.setProperty("java.awt.headless", "false");
ExternalMain dtg = new ExternalMain(_context, _context.clientAppManager(), null);
dtg.startup();
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {}
Callback cb = new Callback();
MenuHandle mh = dtg.addMenu("i2psnark is running", cb);
if (mh == null)
System.out.println("addMenu failed!");
}
} catch (Throwable t) {
t.printStackTrace();
}
}
private static class Callback implements MenuCallback {
public void clicked(MenuHandle handle) {
System.out.println("Clicked! " + handle.getID());
}
}
}

View File

@ -34,10 +34,10 @@ public class BuildTime {
private static final long _latestTime;
private static final long YEARS_25 = 25L*365*24*60*60*1000;
/** update this periodically */
private static final String EARLIEST = "2023-01-01 12:00:00 UTC";
private static final String EARLIEST = "2023-06-14 12:00:00 UTC";
// fallback if parse fails ticket #1976
// date -d 202x-xx-xx +%s
private static final long EARLIEST_LONG = 1672531200 * 1000L;
private static final long EARLIEST_LONG = 1686700800 * 1000L;
static {
// this is the standard format of build.timestamp as set in the top-level build.xml

View File

@ -8,6 +8,7 @@ import java.util.Properties;
import net.i2p.data.Base64;
import net.i2p.data.Hash;
import net.i2p.data.SessionKey;
import net.i2p.data.i2np.I2NPMessage;
import net.i2p.util.ConcurrentHashSet;
import net.i2p.util.NativeBigInteger;
import net.i2p.util.RandomSource;
@ -118,7 +119,7 @@ public class TunnelPoolSettings {
_IPRestriction = DEFAULT_IP_RESTRICTION;
_unknownOptions = new Properties();
_randomKey = generateRandomKey();
_msgIDBloomXor = RandomSource.getInstance().nextLong();
_msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
if (_isExploratory && !_isInbound)
_priority = EXPLORATORY_PRIORITY;

View File

@ -34,9 +34,9 @@ public class GarlicMessageHandler implements HandlerJobBuilder {
public GarlicMessageHandler(RouterContext context) {
_context = context;
_msgIDBloomXorLocal = RandomSource.getInstance().nextLong();
_msgIDBloomXorRouter = RandomSource.getInstance().nextLong();
_msgIDBloomXorTunnel = RandomSource.getInstance().nextLong();
_msgIDBloomXorLocal = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
_msgIDBloomXorRouter = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
_msgIDBloomXorTunnel = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
}
public GarlicMessageHandler(RouterContext context, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel) {

View File

@ -26,7 +26,7 @@ public class FloodfillDatabaseLookupMessageHandler implements HandlerJobBuilder
private RouterContext _context;
private FloodfillNetworkDatabaseFacade _facade;
private Log _log;
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
public FloodfillDatabaseLookupMessageHandler(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
_context = context;

View File

@ -24,7 +24,7 @@ import net.i2p.util.RandomSource;
public class FloodfillDatabaseStoreMessageHandler implements HandlerJobBuilder {
private RouterContext _context;
private FloodfillNetworkDatabaseFacade _facade;
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
public FloodfillDatabaseStoreMessageHandler(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
_context = context;

View File

@ -988,7 +988,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
rv.setReceivedBy(to);
} else if (leaseSet.getReceivedAsReply()) {
rv.setReceivedAsReply();
}
} else
if (leaseSet.getReceivedAsPublished()) {
rv.setReceivedAsPublished(true);
}

View File

@ -13,6 +13,7 @@ import java.util.Set;
import net.i2p.data.Hash;
import net.i2p.data.router.RouterInfo;
import net.i2p.data.i2np.I2NPMessage;
import net.i2p.router.JobImpl;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
@ -59,7 +60,7 @@ class StartExplorersJob extends JobImpl {
private static final long MAX_LAG = 100;
private static final long MAX_MSG_DELAY = 1500;
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
public StartExplorersJob(RouterContext context, KademliaNetworkDatabaseFacade facade) {
super(context);

View File

@ -136,7 +136,7 @@ public class TransportManager implements TransportEventListener {
_dhThread = (_enableUDP || enableNTCP2) ? new DHSessionKeyBuilder.PrecalcRunner(context) : null;
// always created, even if NTCP2 is not enabled, because ratchet needs it
_xdhThread = new X25519KeyFactory(context);
_msgIDBloomXor = _context.random().nextLong();
_msgIDBloomXor = _context.random().nextLong(I2NPMessage.MAX_ID_VALUE);
}
/**

View File

@ -57,7 +57,7 @@ class InboundMessageDistributor implements GarlicMessageReceiver.CloveReceiver {
_msgIDBloomXor = clienttps.getMsgIdBloomXor();
} else {
_clientNickname = "NULL/Expl";
_msgIDBloomXor = RandomSource.getInstance().nextLong();
_msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Initializing null or exploratory InboundMessageDistributor");
}