Changeset db54edc for router


Ignore:
Timestamp:
Aug 26, 2018 12:05:49 PM (23 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1f92232
Parents:
3adbea9
Message:

NTCP2: Publish outbound address after transition to firewalled
Fix exception thrower

Location:
router/java/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/com/southernstorm/noise/protocol/Noise.java

    r3adbea9 rdb54edc  
    2323package com.southernstorm.noise.protocol;
    2424
     25import java.lang.reflect.InvocationTargetException;
    2526import java.security.MessageDigest;
    2627import java.security.NoSuchAlgorithmException;
     
    129130                        Class<?> c = Class.forName("javax.crypto.AEADBadTagException");
    130131                        throw (BadPaddingException)(c.getDeclaredConstructor().newInstance());
    131                 } catch (Exception e) {
     132                } catch (ClassNotFoundException e) {
     133                } catch (InstantiationException e) {
     134                } catch (IllegalAccessException e) {
     135                } catch (InvocationTargetException e) {
     136                } catch (NoSuchMethodException e) {
    132137                }
    133138                throw new BadPaddingException();
  • router/java/src/net/i2p/router/RouterVersion.java

    r3adbea9 rdb54edc  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 2;
     21    public final static long BUILD = 3;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/ntcp/InboundEstablishState.java

    r3adbea9 rdb54edc  
    950950    public void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws DataFormatException {
    951951        // Validate Alice static key
    952         String s = null;
    953952        // find address with matching version
    954953        List<RouterAddress> addrs = ri.getTargetAddresses(NTCPTransport.STYLE, NTCPTransport.STYLE2);
     954        if (addrs.isEmpty()) {
     955            _msg3p2FailReason = NTCPConnection.REASON_S_MISMATCH;
     956            throw new DataFormatException("no NTCP in RI: " + ri);
     957        }
     958        String s = null;
    955959        for (RouterAddress addr : addrs) {
    956960            String v = addr.getOption("v");
     
    965969        if (s == null) {
    966970            _msg3p2FailReason = NTCPConnection.REASON_S_MISMATCH;
    967             throw new DataFormatException("no s in RI");
     971            throw new DataFormatException("no s in RI: " + ri);
    968972        }
    969973        byte[] sb = Base64.decode(s);
    970974        if (sb == null || sb.length != KEY_SIZE) {
    971975            _msg3p2FailReason = NTCPConnection.REASON_S_MISMATCH;
    972             throw new DataFormatException("bad s in RI");
     976            throw new DataFormatException("bad s in RI: " + ri);
    973977        }
    974978        byte[] nb = new byte[32];
     
    977981        if (!DataHelper.eqCT(sb, 0, nb, 0, KEY_SIZE)) {
    978982            _msg3p2FailReason = NTCPConnection.REASON_S_MISMATCH;
    979             throw new DataFormatException("s mismatch in RI");
     983            throw new DataFormatException("s mismatch in RI: " + ri);
    980984        }
    981985        _aliceIdent = ri.getIdentity();
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r3adbea9 rdb54edc  
    15291529            if (_log.shouldLog(Log.INFO))
    15301530                _log.info("old host: " + ohost + " config: " + name + " new: null");
    1531             newAddr = null;
     1531            if (_enableNTCP2) {
     1532                // addNTCP2Options() called below
     1533                newProps.clear();
     1534                newAddr = new RouterAddress(STYLE2, newProps, NTCP2_OUTBOUND_COST);
     1535            } else {
     1536                newAddr = null;
     1537            }
    15321538            changed = true;
    15331539        }
Note: See TracChangeset for help on using the changeset viewer.