Author: toad
Date: 2008-03-01 00:02:38 +0000 (Sat, 01 Mar 2008)
New Revision: 18276
Modified:
trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Remove bothNoderefs back compatibility code.
Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2008-02-29
23:59:41 UTC (rev 18275)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2008-03-01
00:02:38 UTC (rev 18276)
@@ -581,8 +581,7 @@
processJFKMessage2(payload, 4, pn, replyTo, true,
setupType);
} else if(packetType == 3) {
// Phase 4
- if(!processJFKMessage4(payload, 4, pn, replyTo, false,
true, setupType, true))
- processJFKMessage4(payload, 4, pn, replyTo,
false, true, setupType, false);
+ processJFKMessage4(payload, 4, pn, replyTo, false,
true, setupType);
} else {
Logger.error(this, "Invalid phase "+packetType+" for
anonymous-initiator (we are the responder)");
}
@@ -684,8 +683,7 @@
* using the same keys as in the previous
message.
* The signature is non-message recovering
*/
- if(!processJFKMessage4(payload, 3, pn, replyTo,
oldOpennetPeer, false, -1, true))
- processJFKMessage4(payload, 3, pn,
replyTo, oldOpennetPeer, false, -1, false);
+ processJFKMessage4(payload, 3, pn, replyTo,
oldOpennetPeer, false, -1);
}
} else {
Logger.error(this, "Decrypted auth packet but unknown
negotiation type "+negType+" from "+replyTo+" possibly from "+pn);
@@ -1214,7 +1212,7 @@
* @param pn The PeerNode we are talking to. Cannot be null as we are
the initiator.
* @param replyTo The Peer we are replying to.
*/
- private boolean processJFKMessage4(byte[] payload, int inputOffset,
PeerNode pn, Peer replyTo, boolean oldOpennetPeer, boolean unknownInitiator,
int setupType, boolean bothNoderefs)
+ private boolean processJFKMessage4(byte[] payload, int inputOffset,
PeerNode pn, Peer replyTo, boolean oldOpennetPeer, boolean unknownInitiator,
int setupType)
{
final long t1 = System.currentTimeMillis();
if(logMINOR) Logger.minor(this, "Got a JFK(4) message,
processing it - "+pn.getPeer());
@@ -1230,8 +1228,7 @@
final int expectedLength = HASH_LENGTH + // HMAC of the
cyphertext
(c.getBlockSize() >> 3) + // IV
-
HASH_LENGTH + // the signature
-
(bothNoderefs ? pn.jfkMyRef.length : 0) // my reference
+
HASH_LENGTH // the signature
;
if(payload.length < expectedLength + 3) {
Logger.error(this, "Packet too short from
"+pn.getPeer()+": "+payload.length+" after decryption in JFK(4), should be
"+(expectedLength + 3));
@@ -1279,7 +1276,7 @@
byte[] data = new byte[decypheredPayload.length -
decypheredPayloadOffset];
System.arraycopy(decypheredPayload, decypheredPayloadOffset,
data, 0, decypheredPayload.length - decypheredPayloadOffset);
long bootID = Fields.bytesToLong(data);
- byte[] hisRef = new byte[data.length - (bothNoderefs ?
pn.jfkMyRef.length : 0) - 8];
+ byte[] hisRef = new byte[data.length - 8];
System.arraycopy(data, 8, hisRef, 0, hisRef.length);
// verify the signature