Author: toad
Date: 2007-07-04 17:27:47 +0000 (Wed, 04 Jul 2007)
New Revision: 13918
Modified:
trunk/freenet/src/freenet/node/NodeCrypto.java
trunk/freenet/src/freenet/node/PeerNode.java
Log:
Don't include identity, it's invariant. Don't parse it either.
Modified: trunk/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 17:13:33 UTC
(rev 13917)
+++ trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 17:27:47 UTC
(rev 13918)
@@ -295,9 +295,9 @@
SimpleFieldSet fs = new SimpleFieldSet(true);
int[] negTypes = packetMangler.supportedNegTypes();
fs.put("auth.negTypes", negTypes);
- fs.putSingle("identity", Base64.encode(myIdentity)); // FIXME
!forSetup after 11104 is mandatory
if(!forSetup) {
// These are invariant. They cannot change on
connection setup. They can safely be excluded.
+ fs.putSingle("identity", Base64.encode(myIdentity));
fs.put("dsaGroup", cryptoGroup.asFieldSet());
fs.put("dsaPubKey", pubKey.asFieldSet());
}
Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java 2007-07-04 17:13:33 UTC
(rev 13917)
+++ trunk/freenet/src/freenet/node/PeerNode.java 2007-07-04 17:27:47 UTC
(rev 13918)
@@ -1670,21 +1670,6 @@
* @throws FSParseException */
protected synchronized boolean innerProcessNewNoderef(SimpleFieldSet fs,
boolean forARK) throws FSParseException {
boolean changedAnything = false;
- String identityString = fs.get("identity");
- if(identityString != null) {
- // REDFLAG this is optional now, because it is invariant.
- // But if it IS there, check it.
- try {
- byte[] newIdentity = Base64.decode(identityString);
- if(!Arrays.equals(newIdentity, identity))
- throw new FSParseException("Identity
changed!!");
-
- } catch (NumberFormatException e) {
- throw new FSParseException(e);
- } catch (IllegalBase64Exception e) {
- throw new FSParseException(e);
- }
- }
if(node.testnetEnabled != Fields.stringToBool(fs.get("testnet"),
true)) {
String err = "Preventing connection to node "+detectedPeer+" -
peer.testnet="+!node.testnetEnabled+'(' +fs.get("testnet")+") but
node.testnet="+node.testnetEnabled;
Logger.error(this, err);