Changeset 0ff87ef8


Ignore:
Timestamp:
Nov 28, 2014 8:39:57 PM (6 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
947a3a2
Parents:
ec20150 (diff), be8832e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '3e6cfe9a01136316f39f1bd294a515e6bc91ff8e'

and 'b4b595d294ace07f7fde583957d8e00e96af347c'

Files:
2 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    rec20150 r0ff87ef8  
    13401340                byte[] rk = new byte[32];
    13411341                _context.random().nextBytes(rk);
    1342                 config.setProperty(OPT + p, Base64.encode(rk));
     1342                config.setProperty(p, Base64.encode(rk));
    13431343                p = OPT + "outbound.randomKey";
    13441344                _context.random().nextBytes(rk);
    1345                 config.setProperty(OPT + p, Base64.encode(rk));
     1345                config.setProperty(p, Base64.encode(rk));
    13461346            }
    13471347        }
  • apps/routerconsole/java/src/net/i2p/router/news/NewsMetadata.java

    rec20150 r0ff87ef8  
    4242        @Override
    4343        public int compareTo(Update other) {
    44             return Integer.compare(getTypeOrder(), other.getTypeOrder());
     44            return getTypeOrder() - other.getTypeOrder();
    4545        }
    4646
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java

    rec20150 r0ff87ef8  
    349349           .append("</a></h4>\n");
    350350        if (!SigType.ECDSA_SHA256_P256.isAvailable()) {
    351             buf.append("<hr>\n<h4><a href=\"/logs\" target=\"_top\" title=\"")
    352                .append(_("See more information on the logs page"))
     351            buf.append("<hr>\n<h4><a href=\"http://trac.i2p2.i2p/wiki/Crypto/ECDSA");
     352            if ("ru".equals(Messages.getLanguage(_context)))
     353                buf.append("-ru");
     354            buf.append("\" target=\"_top\" title=\"")
     355               .append(_("See more information on the wiki"))
    353356               .append("\">")
    354357               .append(_("Warning: ECDSA is not available. Update your Java or OS"))
  • apps/sam/java/src/net/i2p/sam/SAMStreamSession.java

    rec20150 r0ff87ef8  
    8383     *
    8484     * @param dest Base64-encoded destination and private keys (same format as PrivateKeyFile)
    85      * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH")
     85     * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH") or "__v3__" if extended by SAMv3StreamSession
    8686     * @param props Properties to setup the I2P session
    8787     * @param recv Object that will receive incoming data
     
    9999     *
    100100     * @param destStream Input stream containing the destination and private keys (same format as PrivateKeyFile)
    101      * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH")
     101     * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH") or "__v3__" if extended by SAMv3StreamSession
    102102     * @param props Properties to setup the I2P session
    103103     * @param recv Object that will receive incoming data
     
    112112
    113113        boolean canReceive;
     114        boolean startAcceptor;
    114115        if (dir.equals("BOTH")) {
    115116            canCreate = true;
    116117            canReceive = true;
     118            startAcceptor = true;
     119        } else if (dir.equals("__v3__")) {
     120            // we are super to SAMv3StreamSession, don't start thread, he handles it
     121            canCreate = true;
     122            canReceive = true;
     123            startAcceptor = false;
    117124        } else if (dir.equals("CREATE")) {
    118125            canCreate = true;
    119126            canReceive = false;
     127            startAcceptor = false;
    120128        } else if (dir.equals("RECEIVE")) {
    121129            canCreate = false;
    122130            canReceive = true;
     131            startAcceptor = true;
    123132        } else {
    124133            _log.error("BUG! Wrong direction passed to SAMStreamSession: "
     
    163172       
    164173
    165         if (canReceive) {
     174        if (startAcceptor) {
    166175            server = new SAMStreamSessionServer();
    167176            Thread t = new I2PAppThread(server, "SAMStreamSessionServer");
  • apps/sam/java/src/net/i2p/sam/SAMv3StreamSession.java

    rec20150 r0ff87ef8  
    6262                        throws IOException, DataFormatException, SAMException
    6363            {
    64                 super(getDB().get(login).getDest(), "BOTH",
     64                super(getDB().get(login).getDest(), "__v3__",
    6565                      getDB().get(login).getProps(),
    6666                      getDB().get(login).getHandler());
  • build.properties

    rec20150 r0ff87ef8  
    1212javasedocs.url=http://docs.oracle.com/javase/6/docs/api/
    1313javaeedocs.url=http://docs.oracle.com/javaee/6/api/
    14 jettydocs.url=http://download.eclipse.org/jetty/stable-7/apidocs/
     14jettydocs.url=http://download.eclipse.org/jetty/stable-8/apidocs/
    1515jrobindocs.url=http://docs.i2p-projekt.de/jrobin/javadoc/
    1616wrapperdocs.url=http://wrapper.tanukisoftware.com/jdoc/
  • core/java/src/net/i2p/data/PrivateKeyFile.java

    rec20150 r0ff87ef8  
    170170                return;
    171171            }
    172             System.out.println(pkf);
    173             pkf.write();
    174             verifySignature(pkf.getDestination());
     172            if (mode != 0) {
     173                System.out.println(pkf);
     174                pkf.write();
     175                verifySignature(pkf.getDestination());
     176            }
    175177        } catch (Exception e) {
    176178            e.printStackTrace();
  • core/java/src/net/i2p/data/Signature.java

    rec20150 r0ff87ef8  
    99 *
    1010 */
     11
     12import java.util.Arrays;
    1113
    1214import net.i2p.crypto.SigType;
     
    103105        return buf.toString();
    104106    }
     107
     108    /**
     109     *  @since 0.9.17
     110     */
     111    @Override
     112    public int hashCode() {
     113        return DataHelper.hashCode(_type) ^ super.hashCode();
     114    }
     115
     116    /**
     117     *  @since 0.9.17
     118     */
     119    @Override
     120    public boolean equals(Object obj) {
     121        if (obj == this) return true;
     122        if (obj == null || !(obj instanceof Signature)) return false;
     123        Signature s = (Signature) obj;
     124        return _type == s._type && Arrays.equals(_data, s._data);
     125    }
    105126}
  • core/java/src/net/i2p/data/SigningPrivateKey.java

    rec20150 r0ff87ef8  
    99 *
    1010 */
     11
     12import java.util.Arrays;
    1113
    1214import net.i2p.crypto.KeyGenerator;
     
    105107        return buf.toString();
    106108    }
     109
     110    /**
     111     *  @since 0.9.17
     112     */
     113    @Override
     114    public int hashCode() {
     115        return DataHelper.hashCode(_type) ^ super.hashCode();
     116    }
     117
     118    /**
     119     *  @since 0.9.17
     120     */
     121    @Override
     122    public boolean equals(Object obj) {
     123        if (obj == this) return true;
     124        if (obj == null || !(obj instanceof SigningPrivateKey)) return false;
     125        SigningPrivateKey s = (SigningPrivateKey) obj;
     126        return _type == s._type && Arrays.equals(_data, s._data);
     127    }
    107128}
  • core/java/src/net/i2p/data/SigningPublicKey.java

    rec20150 r0ff87ef8  
    1313import java.io.IOException;
    1414import java.io.OutputStream;
     15import java.util.Arrays;
    1516
    1617import net.i2p.crypto.SigType;
     
    114115
    115116    /**
    116      *  Up-convert this from an untyped (type 0) SPK to a typed SPK based on the Key Cert given
     117     *  Up-convert this from an untyped (type 0) SPK to a typed SPK based on the Key Cert given.
     118     *  The type of the returned key will be null if the kcert sigtype is null.
    117119     *
    118120     *  @throws IllegalArgumentException if this is already typed to a different type
     
    127129        if (_type != SigType.DSA_SHA1)
    128130            throw new IllegalArgumentException("Cannot convert " + _type + " to " + newType);
     131        // unknown type, keep the 128 bytes of data
     132        if (newType == null)
     133            return new SigningPublicKey(null, _data);
    129134        int newLen = newType.getPubkeyLen();
    130135        if (newLen == SigType.DSA_SHA1.getPubkeyLen())
     
    146151     *  if any
    147152     *
    148      *  @return leading padding length > 0 or null
     153     *  @return leading padding length > 0 or null if no padding or type is unknown
    149154     *  @throws IllegalArgumentException if this is already typed to a different type
    150155     *  @since 0.9.12
     
    154159            throw new IllegalStateException();
    155160        SigType newType = kcert.getSigType();
    156         if (_type == newType)
     161        if (_type == newType || newType == null)
    157162            return null;
    158163        if (_type != SigType.DSA_SHA1)
     
    201206        _cache.clear();
    202207    }
     208
     209    /**
     210     *  @since 0.9.17
     211     */
     212    @Override
     213    public int hashCode() {
     214        return DataHelper.hashCode(_type) ^ super.hashCode();
     215    }
     216
     217    /**
     218     *  @since 0.9.17
     219     */
     220    @Override
     221    public boolean equals(Object obj) {
     222        if (obj == this) return true;
     223        if (obj == null || !(obj instanceof SigningPublicKey)) return false;
     224        SigningPublicKey s = (SigningPublicKey) obj;
     225        return _type == s._type && Arrays.equals(_data, s._data);
     226    }
    203227}
  • history.txt

    rec20150 r0ff87ef8  
    1 2014-11-28 kytv
    2  * Updated PO files from Transifex
    3  * Updates to geoip.txt and geoipv6.dat.gz based on Maxmind GeoLite Country
    4    database from 2014-11-05.
     12014-11-26 zzz
     2 * BuildRequestor: Reduce delay when client build can't find
     3   a paired tunnel (ticket #1412)
     4 * Data:
     5   - Fix NPE on unknown sig type in destination
     6   - Fix hashcode and equals for typed data
     7 * Tunnels: Disallow changing allowZeroHop setting for exploratory
     8
     92014-11-24 zzz
     10 * i2ptunnel: Fix automatic setting of random key
     11 * PrivateKeyFile: Don't rewrite file in main() if no options
     12
     132014-11-23 zzz
     14 * Reseed hosts update
     15
     162014-11-22 zzz
     17 * PeerSelector: If non-DSA, don't use incompatible peers
     18   for exploratory tunnels or closest-hop in client tunnels
     19 * SAM: Fix v3 bug accepting incoming connections
     20
     212014-11-17 zzz
     22 * NetDB: Exclude A1/A2 "countries" from auto-floodfill
     23
     242014-11-15 zzz
     25 * I2NP:
     26   - Set lookup type flags even if no reply tunnel specified
     27   - Reduce object churn when writing some messages
    528
    6292014-11-13 zzz
  • installer/resources/deletelist.txt

    rec20150 r0ff87ef8  
    55certificates/forum.i2p2.de.crt
    66certificates/cowpuncher.drollette.com.crt
     7certificates/ssl/i2p.feared.eu.crt
    78certificates/ssl/reseed.pkol.de.crt
    89# old translated proxy error pages
  • router/java/src/net/i2p/router/RouterVersion.java

    rec20150 r0ff87ef8  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 7;
     21    public final static long BUILD = 10;
    2222
    2323    /** for example "-test" */
    24     public final static String EXTRA = "";
     24    public final static String EXTRA = "-rc";
    2525    public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
    2626    public static void main(String args[]) {
  • router/java/src/net/i2p/router/TunnelPoolSettings.java

    rec20150 r0ff87ef8  
    245245            String value = (String) e.getValue();
    246246            if (name.startsWith(prefix)) {
    247                 if (name.equalsIgnoreCase(prefix + PROP_ALLOW_ZERO_HOP))
    248                     _allowZeroHop = getBoolean(value, DEFAULT_ALLOW_ZERO_HOP);
    249                 else if (name.equalsIgnoreCase(prefix + PROP_BACKUP_QUANTITY))
     247                if (name.equalsIgnoreCase(prefix + PROP_ALLOW_ZERO_HOP)) {
     248                    if (!_isExploratory)
     249                        _allowZeroHop = getBoolean(value, DEFAULT_ALLOW_ZERO_HOP);
     250                } else if (name.equalsIgnoreCase(prefix + PROP_BACKUP_QUANTITY))
    250251                    _backupQuantity = getInt(value, DEFAULT_BACKUP_QUANTITY);
    251252                //else if (name.equalsIgnoreCase(prefix + PROP_DURATION))
  • router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java

    rec20150 r0ff87ef8  
    7171     */
    7272    public static final String DEFAULT_SEED_URL =
    73               //http://netdb.i2p2.de/" + "," +
    7473              "http://reseed.i2p-projekt.de/" + "," +
    75              //"http://euve5653.vserver.de/netDb/" +  "," +
    7674              "http://cowpuncher.drollette.com/netdb/" + "," +
    7775              "http://i2p.mooo.com/netDb/" + "," +
     
    8482              "http://i2p-netdb.innovatio.no/" + "," +
    8583              "http://ieb9oopo.mooo.com/";
    86               // Temp disabled since h2ik have been AWOL since 06-03-2013
    87               //"http://i2p.feared.eu/";
    8884
    8985    /** @since 0.8.2 */
    9086    public static final String DEFAULT_SSL_SEED_URL =
    91               //"https://netdb.i2p2.de/" + "," +
    9287              "https://reseed.i2p-projekt.de/" + "," +
    93               //"https://euve5653.vserver.de/netDb/" + "," +
    9488              "https://cowpuncher.drollette.com/netdb/" + "," +
    9589              "https://i2p.mooo.com/netDb/" + "," +
     
    10296              "https://i2p-netdb.innovatio.no/" + "," +
    10397              "https://ssl.webpack.de/ivae2he9.sg4.e-plaza.de/" + "," + // Only HTTPS and SU3 (v2) support
     98              "https://link.mx24.eu/" + "," + // Only HTTPS and SU3 (v3) support
    10499              "https://ieb9oopo.mooo.com/";
    105               // Temp disabled since h2ik have been AWOL since 06-03-2013
    106               //"https://i2p.feared.eu/";
    107100
    108101    private static final String SU3_FILENAME = "i2pseeds.su3";
  • router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java

    rec20150 r0ff87ef8  
    167167            // Not even an exploratory tunnel? We are in big trouble.
    168168            // Let's not spin through here too fast.
    169             try { Thread.sleep(250); } catch (InterruptedException ie) {}
     169            // But don't let a client tunnel waiting for exploratories slow things down too much,
     170            // as there may be other tunnel pools who can build
     171            int ms = pool.getSettings().isExploratory() ? 250 : 25;
     172            try { Thread.sleep(ms); } catch (InterruptedException ie) {}
    170173            return false;
    171174        }
  • router/java/src/net/i2p/router/tunnel/pool/ClientPeerSelector.java

    rec20150 r0ff87ef8  
    3737            Set<Hash> matches = new HashSet<Hash>(length);
    3838            if (length == 1) {
     39                // closest-hop restrictions
     40                Set<Hash> moreExclude = getClosestHopExclude(settings.isInbound());
     41                if (moreExclude != null)
     42                    exclude.addAll(moreExclude);
    3943                ctx.profileOrganizer().selectFastPeers(length, exclude, matches, 0);
    4044                matches.remove(ctx.routerHash());
     
    4751                // OBEP or IB last hop
    4852                // group 0 or 1 if two hops, otherwise group 0
     53                Set<Hash> firstHopExclude;
    4954                if (!settings.isInbound()) {
    50                     // exclude existing OBEPs to get some diversity
     55                    // exclude existing OBEPs to get some diversity ?
     56
     57                    // closest-hop restrictions
     58                    Set<Hash> moreExclude = getClosestHopExclude(false);
     59                    if (moreExclude != null) {
     60                        moreExclude.addAll(exclude);
     61                        firstHopExclude = moreExclude;
     62                    } else {
     63                        firstHopExclude = exclude;
     64                    }
     65                } else {
     66                    firstHopExclude = exclude;
    5167                }
    52                 ctx.profileOrganizer().selectFastPeers(1, exclude, matches, settings.getRandomKey(), length == 2 ? 2 : 4);
     68                ctx.profileOrganizer().selectFastPeers(1, firstHopExclude, matches, settings.getRandomKey(), length == 2 ? 2 : 4);
    5369                matches.remove(ctx.routerHash());
    5470                exclude.addAll(matches);
     
    7490                // group 2 or 3 if two hops, otherwise group 1
    7591                if (settings.isInbound()) {
    76                     // exclude existing IBGWs to get some diversity
     92                    // exclude existing IBGWs to get some diversity ?
     93
     94                    // closest-hop restrictions
     95                    Set<Hash> moreExclude = getClosestHopExclude(true);
     96                    if (moreExclude != null)
     97                        exclude.addAll(moreExclude);
    7798                }
    7899                ctx.profileOrganizer().selectFastPeers(1, exclude, matches, settings.getRandomKey(), length == 2 ? 3 : 5);
  • router/java/src/net/i2p/router/tunnel/pool/ExploratoryPeerSelector.java

    rec20150 r0ff87ef8  
    4343        Set<Hash> exclude = getExclude(settings.isInbound(), true);
    4444        exclude.add(ctx.routerHash());
     45        // closest-hop restrictions
     46        // Since we're applying orderPeers() later, we don't know
     47        // which will be the closest hop, so just appply to all peers for now.
     48        Set<Hash> moreExclude = getClosestHopExclude(settings.isInbound());
     49        if (moreExclude != null)
     50            exclude.addAll(moreExclude);
     51
    4552        // Don't use ff peers for exploratory tunnels to lessen exposure to netDb searches and stores
    4653        // Hmm if they don't get explored they don't get a speed/capacity rating
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java

    rec20150 r0ff87ef8  
    1515import net.i2p.I2PAppContext;
    1616import net.i2p.crypto.SHA256Generator;
     17import net.i2p.crypto.SigType;
    1718import net.i2p.data.DataFormatException;
    1819import net.i2p.data.Hash;
     
    328329    }
    329330   
     331    /**
     332     *  Pick peers that we want to avoid for the first OB hop or last IB hop.
     333     *  This is only filled in if our router sig type is not DSA.
     334     *
     335     *  @param isInbound unused
     336     *  @return null if none
     337     *  @since 0.9.17
     338     */
     339    protected Set<Hash> getClosestHopExclude(boolean isInbound) {
     340        RouterInfo ri = ctx.router().getRouterInfo();
     341        if (ri == null)
     342            return null;
     343        SigType type = ri.getIdentity().getSigType();
     344        if (type == SigType.DSA_SHA1)
     345            return null;
     346        Set<Hash> rv = new HashSet<Hash>(1024);
     347        FloodfillNetworkDatabaseFacade fac = (FloodfillNetworkDatabaseFacade)ctx.netDb();
     348        List<RouterInfo> known = fac.getKnownRouterData();
     349        if (known != null) {
     350            for (int i = 0; i < known.size(); i++) {
     351                RouterInfo peer = known.get(i);
     352                String v = peer.getOption("router.version");
     353                if (v == null)
     354                    continue;
     355                // RI sigtypes added in 0.9.16
     356                // SSU inbound connection bug fixed in 0.9.17, but it won't bid, so NTCP only,
     357                // no need to check
     358                if (VersionComparator.comp(v, "0.9.16") < 0)
     359                    rv.add(peer.getIdentity().calculateHash());
     360            }
     361        }
     362        return rv;
     363    }
     364   
    330365    /** warning, this is also called by ProfileOrganizer.isSelectable() */
    331366    public static boolean shouldExclude(RouterContext ctx, RouterInfo peer) {
Note: See TracChangeset for help on using the changeset viewer.