Changeset c79e3389


Ignore:
Timestamp:
Aug 23, 2014 1:48:13 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6ff500f
Parents:
68b15aa
Message:

SSU intro key checks

Location:
router/java/src/net/i2p/router/transport/udp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/IntroductionManager.java

    r68b15aa rc79e3389  
    219219            cur.setIntroducerTime();
    220220            UDPAddress ura = new UDPAddress(ra);
     221            byte[] ikey = ura.getIntroKey();
     222            if (ikey == null)
     223                continue;
    221224            ssuOptions.setProperty(UDPAddress.PROP_INTRO_HOST_PREFIX + found, Addresses.toString(ip));
    222225            ssuOptions.setProperty(UDPAddress.PROP_INTRO_PORT_PREFIX + found, String.valueOf(port));
    223             ssuOptions.setProperty(UDPAddress.PROP_INTRO_KEY_PREFIX + found, Base64.encode(ura.getIntroKey()));
     226            ssuOptions.setProperty(UDPAddress.PROP_INTRO_KEY_PREFIX + found, Base64.encode(ikey));
    224227            ssuOptions.setProperty(UDPAddress.PROP_INTRO_TAG_PREFIX + found, String.valueOf(cur.getTheyRelayToUsAs()));
    225228            found++;
  • router/java/src/net/i2p/router/transport/udp/UDPAddress.java

    r68b15aa rc79e3389  
    1818    private InetAddress _hostAddress;
    1919    private final int _port;
    20     private byte[] _introKey;
     20    private final byte[] _introKey;
    2121    private String _introHosts[];
    2222    private InetAddress _introAddresses[];
     
    6363            _host = null;
    6464            _port = 0;
     65            _introKey = null;
    6566            return;
    6667        }
     
    7980            if (ik != null && ik.length == SessionKey.KEYSIZE_BYTES)
    8081                _introKey = ik;
     82            else
     83                _introKey = null;
     84        } else {
     85            _introKey = null;
    8186        }
    8287       
     
    168173    public int getPort() { return _port; }
    169174
     175    /**
     176     *  @return shouldn't be null but will be if invalid
     177     */
    170178    byte[] getIntroKey() { return _introKey; }
    171179   
Note: See TracChangeset for help on using the changeset viewer.