Author: toad
Date: 2007-12-22 14:51:28 +0000 (Sat, 22 Dec 2007)
New Revision: 16779
Modified:
trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Javadocs, only check for pn==null if we constructed it for anon-initiator.
Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-12-22
13:15:39 UTC (rev 16778)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-12-22
14:51:28 UTC (rev 16779)
@@ -696,6 +696,7 @@
* @param unknownInitiator If true, we (the responder) don't know the
* initiator, and should check for fields which would be skipped in a
* normal setup where both sides know the other (indicated with *
below).
+ * @param setupType The type of unknown-initiator setup.
*
* format :
* Ni
@@ -871,6 +872,7 @@
* Note that this packet is exactly the same for known initiator as for
unknown initiator.
*
* @param payload The buffer containing the decrypted auth packet.
+ * @param inputOffset The offset in the buffer at which the packet
starts.
* @param replyTo The peer to which we need to send the packet
* @param pn The peerNode we are talking to. Cannot be null as we are
the initiator.
*/
@@ -1103,14 +1105,13 @@
// construct the peernode
if(unknownInitiator) {
pn = getPeerNodeFromUnknownInitiator(hisRef, setupType,
pn);
+ if(pn == null) {
+ // Reject
+ Logger.normal(this, "Rejecting... unable to
construct PeerNode");
+ return;
+ }
}
- if(pn == null) {
- // Reject
- Logger.normal(this, "Rejecting...");
- return;
- }
-
// verify the signature
DSASignature remoteSignature = new DSASignature(new
NativeBigInteger(1,r), new NativeBigInteger(1,s));
if(!DSA.verify(pn.peerPubKey, remoteSignature, new
NativeBigInteger(1, SHA256.digest(assembleDHParams(nonceInitiator,
nonceResponder, _hisExponential, _ourExponential, crypto.myIdentity, data))),
false)) {