Author: toad
Date: 2009-02-03 18:15:13 +0000 (Tue, 03 Feb 2009)
New Revision: 25502

Modified:
   branches/db4o/freenet/src/freenet/keys/SSKBlock.java
Log:
Fix SSKBlock hashCode


Modified: branches/db4o/freenet/src/freenet/keys/SSKBlock.java
===================================================================
--- branches/db4o/freenet/src/freenet/keys/SSKBlock.java        2009-02-03 
18:12:35 UTC (rev 25501)
+++ branches/db4o/freenet/src/freenet/keys/SSKBlock.java        2009-02-03 
18:15:13 UTC (rev 25502)
@@ -13,6 +13,7 @@
 import freenet.crypt.DSAPublicKey;
 import freenet.crypt.DSASignature;
 import freenet.crypt.SHA256;
+import freenet.support.Fields;
 import freenet.support.HexUtil;
 
 /**
@@ -51,6 +52,7 @@
        final DSAPublicKey pubKey;
     final short hashIdentifier;
     final short symCipherIdentifier;
+    final int hashCode;
     
     public static final short DATA_LENGTH = 1024;
     /* Maximum length of compressed payload */
@@ -85,7 +87,7 @@
     
     @Override
        public int hashCode(){
-       return super.hashCode();
+       return hashCode;
     }
     
        /**
@@ -149,6 +151,7 @@
                if(!Arrays.equals(ehDocname, nodeKey.encryptedHashedDocname))
                        throw new SSKVerifyException("E(H(docname)) wrong - 
wrong key?? \nfrom headers: "+HexUtil.bytesToHex(ehDocname)+"\nfrom key:     
"+HexUtil.bytesToHex(nodeKey.encryptedHashedDocname));
                SHA256.returnMessageDigest(md);
+               hashCode = Fields.hashCode(data) ^ Fields.hashCode(headers) ^ 
nodeKey.hashCode() ^ pubKey.hashCode() ^ hashIdentifier;
        }
 
        public Key getKey() {

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to