Author: toad
Date: 2006-01-23 20:10:20 +0000 (Mon, 23 Jan 2006)
New Revision: 7902

Modified:
   trunk/freenet/src/freenet/keys/NodeSSK.java
   trunk/freenet/src/freenet/node/Version.java
Log:
374: (mandatory)
Really fix the SSK bug.

Modified: trunk/freenet/src/freenet/keys/NodeSSK.java
===================================================================
--- trunk/freenet/src/freenet/keys/NodeSSK.java 2006-01-23 20:00:42 UTC (rev 
7901)
+++ trunk/freenet/src/freenet/keys/NodeSSK.java 2006-01-23 20:10:20 UTC (rev 
7902)
@@ -140,15 +140,16 @@
                                }
                                byte[] newPubKeyHash = 
md256.digest(pubKey2.asBytes());
                                if(Arrays.equals(pubKeyHash, newPubKeyHash)) {
-                                       if(pubKey != null)
+                                       if(pubKey != null) {
+                                               // same hash, yet different 
keys!
                                                Logger.error(this, "Found 
SHA-256 collision or something... WTF?");
-                                       else {
+                                               throw new 
SSKVerifyException("Invalid new pubkey: "+pubKey2+" old pubkey: "+pubKey);
+                                       } else {
                                                // Valid key, assign.
                                        }
                                } else {
                                        throw new SSKVerifyException("New 
pubkey has invalid hash");
                                }
-                               throw new SSKVerifyException("Invalid new 
pubkey: "+pubKey2+" old pubkey: "+pubKey);
                        }
                        pubKey = pubKey2;
                }

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-01-23 20:00:42 UTC (rev 
7901)
+++ trunk/freenet/src/freenet/node/Version.java 2006-01-23 20:10:20 UTC (rev 
7902)
@@ -20,10 +20,10 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       public static final int buildNumber = 373;
+       public static final int buildNumber = 374;

        /** Oldest build of Fred we will talk to */
-       public static final int lastGoodBuild = 372;
+       public static final int lastGoodBuild = 374;

        /** The highest reported build of fred */
        public static int highestSeenBuild = buildNumber;


Reply via email to