Author: toad
Date: 2006-11-29 01:03:18 +0000 (Wed, 29 Nov 2006)
New Revision: 11104

Modified:
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
Identity is optional.

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2006-11-29 00:48:54 UTC 
(rev 11103)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2006-11-29 01:03:18 UTC 
(rev 11104)
@@ -1660,16 +1660,20 @@
     private synchronized boolean innerProcessNewNoderef(SimpleFieldSet fs, 
boolean forARK) throws FSParseException {
         boolean changedAnything = false;
         String identityString = fs.get("identity");
-        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(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);
+               }
+        }
         String newVersion = fs.get("version");
         if(newVersion == null) {
                // Version may be ommitted for an ARK.


Reply via email to