diff --git a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java index fb899bcbd27e6216a7a803bf133683951ef9a402..bf6059d4393e584a956ae7b2ffc436dd47143aac 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java +++ b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java @@ -893,11 +893,16 @@ public class TrackerClient implements Runnable { } catch (URISyntaxException use) { return false; } + String path = url.getPath(); + if (path == null || !path.startsWith("/")) + return false; return "http".equals(url.getScheme()) && url.getHost() != null && (url.getHost().endsWith(".i2p") || url.getHost().equals("i2p")); } /** + * This also validates the URL. + * * @param ann an announce URL non-null * @return a Hash for i2p hosts only, null otherwise * @since 0.9.5 @@ -914,8 +919,12 @@ public class TrackerClient implements Runnable { String host = url.getHost(); if (host == null) return null; - if (host.endsWith(".i2p")) + if (host.endsWith(".i2p")) { + String path = url.getPath(); + if (path == null || !path.startsWith("/")) + return null; return ConvertToHash.getHash(host); + } if (host.equals("i2p")) { String path = url.getPath(); if (path == null || path.length() < 517 || @@ -941,6 +950,10 @@ public class TrackerClient implements Runnable { int consecutiveFails; int seenPeers; + /** + * @param a must be a valid http URL with a path + * @param p true if primary + */ public TCTracker(String a, boolean p) { announce = a; diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index 4325d3acf680bc89e019855c50426fd56e7c84c8..09c4699bd6108d86e6318bf0b0467f4ea96baf1f 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -1085,8 +1085,9 @@ public class I2PSnarkServlet extends BasicServlet { // should be only one if (df.delete()) _manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath())); - else + else if (df.exists()) _manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath())); + // else already gone } break; } @@ -1094,8 +1095,9 @@ public class I2PSnarkServlet extends BasicServlet { for (File df : storage.getFiles()) { if (df.delete()) { //_manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath())); - } else { + } else if (df.exists()) { _manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath())); + // else already gone } } // step 2 delete dirs bottom-up @@ -1109,11 +1111,12 @@ public class I2PSnarkServlet extends BasicServlet { if (df.delete()) { ok = true; //_manager.addMessage(_t("Data dir deleted: {0}", df.getAbsolutePath())); - } else { + } else if (df.exists()) { ok = false; _manager.addMessage(_t("Directory could not be deleted: {0}", df.getAbsolutePath())); if (_log.shouldLog(Log.WARN)) _log.warn("Could not delete dir " + df); + // else already gone } } // step 3 message for base (last one) diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/Packet.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/Packet.java index a887dc3d2ba54496d91459733c3faf9a893ee816..483a8d4eeda85e5405b14b2f37a1c4857870b00b 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/Packet.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/Packet.java @@ -780,7 +780,12 @@ class Packet { if (isFlagSet(FLAG_MAX_PACKET_SIZE_INCLUDED)) buf.append(" MS ").append(_optionMaxSize); if (isFlagSet(FLAG_PROFILE_INTERACTIVE)) buf.append(" INTERACTIVE"); if (isFlagSet(FLAG_RESET)) buf.append(" RESET"); - if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) buf.append(" SIG ").append(_optionSignature.length()); + if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) { + if (_optionSignature != null) + buf.append(" SIG ").append(_optionSignature.length()); + else + buf.append(" (to be signed)"); + } if (isFlagSet(FLAG_SIGNATURE_REQUESTED)) buf.append(" SIGREQ"); if (isFlagSet(FLAG_SYNCHRONIZE)) buf.append(" SYN"); } diff --git a/build.xml b/build.xml index 90e8a1fac54196f3ec6e19c36dd088948042cafa..847629bb2a0632feb27c9b64802ecc26a13c6d67 100644 --- a/build.xml +++ b/build.xml @@ -1400,6 +1400,7 @@ <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" /> <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" /> + <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" /> <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" /> <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" /> <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" /> @@ -1413,6 +1414,7 @@ <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" /> <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" /> <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" /> + <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" /> <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" /> <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" /> <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" /> @@ -1915,8 +1917,9 @@ <!-- <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" > <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows"> ---> <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows"> +--> + <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows"> <echo message="New version number is ${release.number}" /> <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" /> <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" /> diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index 10b5fb777b1deb38b563ebbe2f80bf456d9d6717..b867cf76f67bb242de1a69692a32edbf2b808bb6 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -640,7 +640,9 @@ public class NativeBigInteger extends BigInteger { } /** - * @throws ArithmeticException if m <= 0 + * @param m must be postive + * @param exponent must be postive + * @throws ArithmeticException if m <= 0 or exponent <=0 */ @Override public BigInteger modPow(BigInteger exponent, BigInteger m) { @@ -654,7 +656,9 @@ public class NativeBigInteger extends BigInteger { } /** - * @throws ArithmeticException if m <= 0 + * @param exponent must be postive + * @param m must be postive and odd + * @throws ArithmeticException if m <= 0 or m is even or exponent <=0 * @since 0.9.26 and libjbigi version 3 and GMP version 5 */ public BigInteger modPowCT(BigInteger exponent, BigInteger m) { diff --git a/history.txt b/history.txt index 36abe51295d71538369c47262c8d578f11707ebc..77602ec9e46bc0e2ea4119e4af9a79bb451b98f9 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,8 @@ +2016-08-02 zzz + * i2psnark: Fix SIOOBE on bad announce URL (ticket #1823) + * SSU: Fix peer test stuck when IPv6-only (ticket #1819) + * Streaming: Fix debug NPE (ticket #1821) + 2016-07-20 zzz * SSU: - Increase minimum peers if we have a IPv6 address diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fecba78d6973d87e9930d631de787e05fec2a510..a6204817e3d9e640632604f1432a96320e1992ce 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 7; + public final static long BUILD = 8; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index 7b94b14d7cfd48d53c68b54d0282343a17570073..dfd96266b13373d406094b75e2444ff5bd0aad7a 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -3303,7 +3303,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority locked_runTest(false); } else if (_haveIPv6Address &&_forceRun == FORCE_IPV6 && sinceRunV6 >= MIN_TEST_FREQUENCY) { locked_runTest(true); - } else if (sinceRunV4 >= TEST_FREQUENCY) { + } else if (sinceRunV4 >= TEST_FREQUENCY && getIPv6Config() != IPV6_ONLY) { locked_runTest(false); } else if (_haveIPv6Address && sinceRunV6 >= TEST_FREQUENCY) { locked_runTest(true); @@ -3316,7 +3316,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority if (_alive) { long delay = (TEST_FREQUENCY / 2) + _context.random().nextInt(TEST_FREQUENCY); // if we have 2 addresses, give IPv6 a chance also - if (_haveIPv6Address) + if (_haveIPv6Address && getIPv6Config() != IPV6_ONLY) delay /= 2; schedule(delay); }