Changeset 5f50f23


Ignore:
Timestamp:
Nov 5, 2015 9:37:21 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b15138d
Parents:
d5e2def
Message:

Streaming: Split blacklist into one for EC and one for Ed

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java

    rd5e2def r5f50f23  
    2828import net.i2p.client.streaming.I2PSocketManager;
    2929import net.i2p.client.streaming.I2PSocketOptions;
     30import net.i2p.crypto.SigAlgo;
    3031import net.i2p.crypto.SigType;
    3132import net.i2p.data.Certificate;
     
    6364    private final AtomicBoolean _isDestroyed = new AtomicBoolean();
    6465
    65     /** @since 0.9.21 */
    66     private static final Set<Hash> _dsaOnly = new HashSet<Hash>(16);
    67     private static final String[] DSA_ONLY_HASHES = {
     66    /**
     67     *  Does not support EC
     68     *  @since 0.9.21
     69     */
     70    private static final Set<Hash> _ecUnsupported = new HashSet<Hash>(16);
     71    private static final String[] EC_UNSUPPORTED_HASHES = {
    6872        // list from http://zzz.i2p/topics/1682?page=1#p8414
    6973        // bzr.welterde.i2p
     
    8791        // paste.i2p2.i2p
    8892        "DoyMyUUgOSTddvRpqYfKHFPPjkkX~iQmResyfjjBYWs=",
    89         // syndie.wetlerde.i2p
     93        // syndie.welterde.i2p
    9094        "xMxC54BFgyp-~zzrQI3F8m2CK--9XMcNmSAep6RH4Kk=",
    9195        // ugha.i2p
     
    96100        "im9gytzKT15mT1sB5LC9bHXCcwytQ4EPcrGQhoam-4w="
    97101    };
     102
     103    /**
     104     *  Does not support Ed
     105     *  @since 0.9.23
     106     */
     107    private static final Set<Hash> _edUnsupported = new HashSet<Hash>(16);
     108    private static final String[] ED_UNSUPPORTED_HASHES = {
     109        // list from http://zzz.i2p/topics/1682?page=1#p8414
     110        // minus those tested to support Ed
     111        // last tested 2015-11-04
     112        // bzr.welterde.i2p
     113        "Cvs1gCZTTkgD2Z2byh2J9atPmh5~I8~L7BNQnQl0hUE=",
     114        // docs.i2p2.i2p
     115        "WCXV87RdrF6j-mnn6qt7kVSBifHTlPL0PmVMFWwaolo=",
     116        // i2jump.i2p
     117        "9vaoGZbOaeqdRK2qEunlwRM9mUSW-I9R4OON35TDKK4=",
     118        // irc.welterde.i2p
     119        "5rjezx4McFk3bNhoJV-NTLlQW1AR~jiUcN6DOWMCCVc=",
     120        // lists.i2p2.i2p
     121        "qwtgoFoMSK0TOtbT4ovBX1jHUzCoZCPzrJVxjKD7RCg=",
     122        // mtn.i2p2.i2p
     123        "X5VDzYaoX9-P6bAWnrVSR5seGLkOeORP2l3Mh4drXPo=",
     124        // nntp.welterde.i2p
     125        "VXwmNIwMy1BcUVmut0oZ72jbWoqFzvxJukmS-G8kAAE=",
     126        // paste.i2p2.i2p
     127        "DoyMyUUgOSTddvRpqYfKHFPPjkkX~iQmResyfjjBYWs=",
     128        // syndie.welterde.i2p
     129        "xMxC54BFgyp-~zzrQI3F8m2CK--9XMcNmSAep6RH4Kk=",
     130        // tracker.welterde.i2p
     131        "EVkFgKkrDKyGfI7TIuDmlHoAmvHC~FbnY946DfujR0A=",
     132        // www.i2p2.i2p
     133        "im9gytzKT15mT1sB5LC9bHXCcwytQ4EPcrGQhoam-4w="
     134    };
    98135   
    99136    static {
    100         for (int i = 0; i < DSA_ONLY_HASHES.length; i++) {
    101             String s = DSA_ONLY_HASHES[i];
     137        for (int i = 0; i < EC_UNSUPPORTED_HASHES.length; i++) {
     138            String s = EC_UNSUPPORTED_HASHES[i];
    102139            Hash h = ConvertToHash.getHash(s);
    103140            if (h != null)
    104                 _dsaOnly.add(h);
     141                _ecUnsupported.add(h);
     142            else
     143                System.out.println("Bad hash " + s);
     144        }
     145        for (int i = 0; i < ED_UNSUPPORTED_HASHES.length; i++) {
     146            String s = ED_UNSUPPORTED_HASHES[i];
     147            Hash h = ConvertToHash.getHash(s);
     148            if (h != null)
     149                _edUnsupported.add(h);
    105150            else
    106151                System.out.println("Bad hash " + s);
     
    487532            updateUserDsaList();
    488533            Hash h = peer.calculateHash();
    489             if (_dsaOnly.contains(h) || (!_userDsaOnly.isEmpty() && _userDsaOnly.contains(h))) {
     534            SigAlgo myAlgo = session.getMyDestination().getSigType().getBaseAlgorithm();
     535            if ((myAlgo == SigAlgo.EC && _ecUnsupported.contains(h)) ||
     536                (myAlgo == SigAlgo.EdDSA && _edUnsupported.contains(h)) ||
     537                (!_userDsaOnly.isEmpty() && _userDsaOnly.contains(h))) {
    490538                // FIXME just taking the first one for now
    491539                for (I2PSession sess : _subsessions) {
     
    513561    /**
    514562     * Update the global user DSA-only list.
    515      * This does not affect the hardcoded DSA_ONLY_HASHES list above,
     563     * This does not affect the hardcoded Ex_UNSUPPORTED_HASHES lists above,
    516564     * the user can only add, not remove.
    517565     *
  • history.txt

    rd5e2def r5f50f23  
     12015-11-05 zzz
     2 * I2CP: Fix additional connections getting rejected during tunnel open (ticket #1650)
     3 * Streaming: Split blacklist into one for EC and one for Ed
     4
    152015-11-04 zzz
    26 * Threads: More conversions to I2PAppThread
  • router/java/src/net/i2p/router/RouterVersion.java

    rd5e2def r5f50f23  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 22;
     21    public final static long BUILD = 23;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.