forked from I2P_Developers/i2p.i2p
SSU2 fixes
Fix NPE in PS2 Fix Token Request message type
This commit is contained in:
@@ -124,11 +124,11 @@ class OutboundEstablishState2 extends OutboundEstablishState implements SSU2Payl
|
||||
public synchronized void restart(long token) {
|
||||
_token = token;
|
||||
HandshakeState old = _handshakeState;
|
||||
byte[] pub = new byte[32];
|
||||
old.getRemotePublicKey().getPublicKey(pub, 0);
|
||||
createNewState(_routerAddress);
|
||||
if (old != null)
|
||||
if (old != null) {
|
||||
// TODO pass the old keys over to createNewState()
|
||||
old.destroy();
|
||||
}
|
||||
createNewState(_routerAddress);
|
||||
//_rcvHeaderEncryptKey2 will be set after the Session Request message is created
|
||||
_rcvHeaderEncryptKey2 = null;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ class PacketBuilder2 {
|
||||
*/
|
||||
public UDPPacket buildTokenRequestPacket(OutboundEstablishState2 state) {
|
||||
long n = _context.random().signedNextInt() & 0xFFFFFFFFL;
|
||||
UDPPacket packet = buildLongPacketHeader(state.getSendConnID(), n, SESSION_REQUEST_FLAG_BYTE,
|
||||
UDPPacket packet = buildLongPacketHeader(state.getSendConnID(), n, TOKEN_REQUEST_FLAG_BYTE,
|
||||
state.getRcvConnID(), 0);
|
||||
DatagramPacket pkt = packet.getPacket();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user