Compare commits

...

4 Commits

Author SHA1 Message Date
zzz
6f9871e344 Plugins: Sort plugins.config when saving
Some checks failed
Daily Workflow / daily-job (push) Has been cancelled
Daily Workflow / javadoc-latest (push) Has been cancelled
Daily Workflow / build-java7 (push) Has been cancelled
Java CI / build (push) Has been cancelled
Java CI / javadoc-latest (push) Has been cancelled
Java CI / build-java7 (push) Has been cancelled
Dockerhub / docker (push) Has been cancelled
Java with IzPack Snapshot Setup / setup (push) Has been cancelled
2025-05-04 14:02:12 -04:00
zzz
0da4cf49c1 Router: Hopefully fix rare shutdown deadlock
via RouterAppManager.shutdown() ... log(CRIT) ... addBubble()
2025-05-04 13:58:26 -04:00
zzz
3490a1a6ec Console: Add new hostname to addressbook bubble if count is 1 2025-05-03 11:17:35 -04:00
zzz
0bd60989de NTCP2: On inbound MSB check fail,
ban IP and do probing resistance, as on AEAD fail
2025-05-03 10:14:52 -04:00
4 changed files with 28 additions and 3 deletions

View File

@@ -182,6 +182,7 @@ class Daemon {
long start = DEBUG ? System.currentTimeMillis() : 0;
int old = 0, nnew = 0, invalid = 0, conflict = 0, total = 0;
int deleted = 0;
String newname = null;
while(iter.hasNext()) {
Map.Entry<String, HostTxtEntry> entry = iter.next();
total++;
@@ -280,6 +281,8 @@ class Daemon {
if (log != null && !success)
log.append("Add to published address book " + publishedNS.getName() + " failed for " + key);
}
if (nnew == 0)
newname = key;
nnew++;
continue;
} else {
@@ -503,6 +506,8 @@ class Daemon {
// keep track for later dup check
knownNames.add(key);
}
if (nnew == 0)
newname = key;
nnew++;
} else if (key == null) {
// 'remove' actions
@@ -677,6 +682,8 @@ class Daemon {
if (cmgr != null) {
int nc = cmgr.getBubbleCount(PortMapper.SVC_SUSIDNS) + nnew;
String msg = ngettext("{0} new host", "{0} new hosts", nc);
if (nc == 1)
msg += ": " + newname;
cmgr.setBubble(PortMapper.SVC_SUSIDNS, nc, msg);
}
}

View File

@@ -36,6 +36,7 @@ import net.i2p.util.FileSuffixFilter;
import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import net.i2p.util.OrderedProperties;
import net.i2p.util.PortMapper;
import net.i2p.util.SimpleTimer2;
import net.i2p.util.SystemVersion;
@@ -804,6 +805,11 @@ public class PluginStarter implements Runnable {
* plugins.config
*/
public static void storePluginProperties(Properties props) {
if (!(props instanceof OrderedProperties)) {
Properties p = new OrderedProperties();
p.putAll(props);
props = p;
}
File cfgFile = new File(I2PAppContext.getGlobalContext().getConfigDir(), CONFIG_FILE);
try {
DataHelper.storeProps(props, cfgFile);

View File

@@ -261,8 +261,10 @@ public class RouterAppManager extends ClientAppManagerImpl {
* @since 0.9.66
*/
@Override
public synchronized void addBubble(String svc, String text) {
setBubble(svc, getBubbleCount(svc) + 1, text);
public void addBubble(String svc, String text) {
synchronized(_bubbles) {
setBubble(svc, getBubbleCount(svc) + 1, text);
}
}
/// end ClientAppManager interface

View File

@@ -304,7 +304,17 @@ class InboundEstablishState extends EstablishBase implements NTCP2Payload.Payloa
}
// fast MSB check for key < 2^255
if ((_X[KEY_SIZE - 1] & 0x80) != 0) {
fail("Bad PK msg 1");
// same probing resistance strategy as below
_padlen1 = _context.random().nextInt(PADDING1_FAIL_MAX) - src.remaining();
if (_padlen1 > 0) {
if (_log.shouldWarn())
_log.warn("Bad PK msg 1, X = " + Base64.encode(_X, 0, KEY_SIZE) + " with " + src.remaining() +
" more bytes, waiting for " + _padlen1 + " more bytes");
changeState(State.IB_NTCP2_READ_RANDOM);
} else {
fail("Bad PK msg 1, X = " + Base64.encode(_X, 0, KEY_SIZE) + " remaining = " + src.remaining());
}
_transport.getPumper().blockIP(_con.getRemoteIP());
return;
}