Update of /cvsroot/freenet/freenet/src/freenet/crypt
In directory sc8-pr-cvs1:/tmp/cvs-serv8807/src/freenet/crypt

Modified Files:
      Tag: stable
        CryptTest.java CryptoKey.java DHGroup.java DSA.java 
        DSAGroup.java DSASignature.java DSSVerifyingInputStream.java 
        DiffieHellman.java KEProtocol.java KeyPair.java 
        ProgressiveHashInputStream.java 
        ProgressiveHashOutputStream.java 
        ThrottledAsyncEntropyYarrow.java Yarrow.java 
Log Message:
5030: Merge minor(ish) changes from unstable:
Open Connections infolet
     Minor implementation changes on normal mode
     Show total bytes transmitted/received so far
     Much new information on the PeerHandler mode
Fixed tons of eclipse warnings (almost all are style issues, not functional changes - 
relating to logger and imports mostly). Remove deprecated FieldSet.add(String,String).
      Update TestLocalNIOInterface to current API
Make 5029 mandatory (it can't connect to us anyway, only vice versa).
If incoming HTL is 25, 50% chance of not decrementing it, so we have some plausible 
deniability when we send out an HTL 25 request (the client level HTL perturb mechanism 
is insufficient although useful).
Don't use seednodes with no physical address.
Use our own URLEncoder/URLDecoder's, catch the exceptions. We were using java's, which 
are deprecated.
Add support for deprecated options. These will be read form config file and handled, 
but will not be written to it by --config. Currently bandwidthLimit and 
averageBandwidthLimit are in this category. Separate code logs an error when these are 
set.
Change the way bandwidthLimit set but others not set, to prevent it from constantly 
getting 100% load due to bandwidth limit (0!) exceeded.
Set priority of entropy thread to MIN.
Remove old datastore code, GOOD RIDDENS!
Add a memory usage test for the Failure Table
Increase size of failure table to 20,000 (from 2,000).
Don't show the key request form in simple mode on the default infolet.
Major refactoring of HTML reporting, writing to disk, in NGRouting estimators.
Relative times in (for example) ?date= in fproxy: ?date=-1year gives the edition of a 
DBR one year ago.
NIO refactoring (ASL.ChannelAttachmentPairQueue).
Logging.


Index: CryptTest.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/CryptTest.java,v
retrieving revision 1.2.6.1
retrieving revision 1.2.6.2
diff -u -w -r1.2.6.1 -r1.2.6.2
--- CryptTest.java      21 May 2003 19:54:47 -0000      1.2.6.1
+++ CryptTest.java      1 Nov 2003 16:55:26 -0000       1.2.6.2
@@ -64,7 +64,7 @@
      */
     public void testSHA1() {
         int i, j;
-        SHA1 s = SHA1.getInstance();
+        SHA1 s = (SHA1)SHA1.getInstance();
 
 /*      "abc"
         A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D */

Index: CryptoKey.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/CryptoKey.java,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -u -w -r1.1.1.1.6.1 -r1.1.1.1.6.2
--- CryptoKey.java      21 May 2003 19:54:48 -0000      1.1.1.1.6.1
+++ CryptoKey.java      1 Nov 2003 16:55:26 -0000       1.1.1.1.6.2
@@ -1,9 +1,13 @@
 package freenet.crypt;
 
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Method;
 import java.math.BigInteger;
-import java.lang.reflect.*;
-import java.util.Hashtable;
-import java.io.*;
 
 public abstract class CryptoKey implements CryptoElement, Serializable {
 

Index: DHGroup.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DHGroup.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.6.1
diff -u -w -r1.1.1.1 -r1.1.1.1.6.1
--- DHGroup.java        13 Jan 2002 05:24:23 -0000      1.1.1.1
+++ DHGroup.java        1 Nov 2003 16:55:26 -0000       1.1.1.1.6.1
@@ -30,8 +30,8 @@
     public static CryptoKey readFromField(String field) {
        BigInteger p,q,g;
        StringTokenizer str=new StringTokenizer(field, ",");
-       p=Util.byteArrayToMPI(Util.hexToBytes(str.nextToken()));
-       g=Util.byteArrayToMPI(Util.hexToBytes(str.nextToken()));
+       p=new BigInteger(1, Util.hexToBytes(str.nextToken()));
+       g=new BigInteger(1, Util.hexToBytes(str.nextToken()));
        return new DHGroup(p,g);
     }
 

Index: DSA.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DSA.java,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -u -w -r1.1.1.1.6.1 -r1.1.1.1.6.2
--- DSA.java    28 Oct 2003 20:20:30 -0000      1.1.1.1.6.1
+++ DSA.java    1 Nov 2003 16:55:26 -0000       1.1.1.1.6.2
@@ -2,7 +2,6 @@
 
 import java.math.BigInteger;
 import java.util.Random;
-import java.io.*;
 
 /**
  * Implements the Digital Signature Algorithm (DSA) described in FIPS-186

Index: DSAGroup.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DSAGroup.java,v
retrieving revision 1.1.1.1.4.1.2.3
retrieving revision 1.1.1.1.4.1.2.4
diff -u -w -r1.1.1.1.4.1.2.3 -r1.1.1.1.4.1.2.4
--- DSAGroup.java       28 Oct 2003 20:20:30 -0000      1.1.1.1.4.1.2.3
+++ DSAGroup.java       1 Nov 2003 16:55:26 -0000       1.1.1.1.4.1.2.4
@@ -1,11 +1,13 @@
 package freenet.crypt;
 
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.math.BigInteger;
 import java.util.Random;
 import java.util.StringTokenizer;
 import java.util.Vector;
-import freenet.support.Fields;
-import java.io.*;
 
 /**
  * Holds DSA group parameters.  These are the public (possibly shared) values

Index: DSASignature.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DSASignature.java,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -u -w -r1.1.1.1.6.1 -r1.1.1.1.6.2
--- DSASignature.java   28 Oct 2003 20:20:30 -0000      1.1.1.1.6.1
+++ DSASignature.java   1 Nov 2003 16:55:26 -0000       1.1.1.1.6.2
@@ -1,8 +1,9 @@
 package freenet.crypt;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.math.BigInteger;
-import java.io.*;
-import java.util.Random;
 
 
 public class DSASignature implements CryptoElement, java.io.Serializable {

Index: DSSVerifyingInputStream.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DSSVerifyingInputStream.java,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -u -w -r1.1.1.1.6.1 -r1.1.1.1.6.2
--- DSSVerifyingInputStream.java        21 May 2003 19:54:48 -0000      1.1.1.1.6.1
+++ DSSVerifyingInputStream.java        1 Nov 2003 16:55:26 -0000       1.1.1.1.6.2
@@ -65,7 +65,7 @@
     public void checkPart(int cb) throws IOException, DataNotValidIOException {
        super.checkPart(cb);
        byte[] hash=ctx.digest();
-       BigInteger m=Util.byteArrayToMPI(hash);
+       BigInteger m=new BigInteger(1, hash);
 
        if (!DSA.verify(kp, signature, m)) {
            Core.logger.log(this,"Failed verification",Logger.DEBUGGING);

Index: DiffieHellman.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/DiffieHellman.java,v
retrieving revision 1.2.6.2
retrieving revision 1.2.6.3
diff -u -w -r1.2.6.2 -r1.2.6.3
--- DiffieHellman.java  28 Oct 2003 20:20:30 -0000      1.2.6.2
+++ DiffieHellman.java  1 Nov 2003 16:55:26 -0000       1.2.6.3
@@ -4,12 +4,11 @@
   It is distributed under the GNU Public Licence (GPL) version 2.  See
   http://www.gnu.org/ for further details of the GPL.
 */
-import java.io.*;
 import java.math.BigInteger;
-import java.util.Stack;
 import java.util.Random;
-import freenet.support.*;
-import freenet.*;
+import java.util.Stack;
+
+import freenet.Core;
 
 public class DiffieHellman {
     private static final int PRECALC = 15;

Index: KEProtocol.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/KEProtocol.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.6.1
diff -u -w -r1.1.1.1 -r1.1.1.1.6.1
--- KEProtocol.java     13 Jan 2002 05:24:24 -0000      1.1.1.1
+++ KEProtocol.java     1 Nov 2003 16:55:26 -0000       1.1.1.1.6.1
@@ -1,7 +1,8 @@
 package freenet.crypt;
 
-import java.io.*;
-import java.util.Random;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 /*
   This code is part of the Java Adaptive Network Client by Ian Clarke. 

Index: KeyPair.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/KeyPair.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.6.1
diff -u -w -r1.1.1.1 -r1.1.1.1.6.1
--- KeyPair.java        13 Jan 2002 05:24:24 -0000      1.1.1.1
+++ KeyPair.java        1 Nov 2003 16:55:26 -0000       1.1.1.1.6.1
@@ -1,8 +1,8 @@
 package freenet.crypt;
 
-import freenet.support.Loader;
-import java.math.BigInteger;
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 /**
  * Describes a general key pair system with support for multiple-value

Index: ProgressiveHashInputStream.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/ProgressiveHashInputStream.java,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -u -w -r1.1.1.1.6.1 -r1.1.1.1.6.2
--- ProgressiveHashInputStream.java     21 May 2003 19:54:48 -0000      1.1.1.1.6.1
+++ ProgressiveHashInputStream.java     1 Nov 2003 16:55:26 -0000       1.1.1.1.6.2
@@ -1,13 +1,14 @@
 package freenet.crypt;
-import freenet.support.io.*;
-import freenet.support.FileBucket;
-import freenet.Presentation;
-import freenet.Key;
-import freenet.Address;
-
-import java.io.*;
-import java.util.Stack;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
+
+import freenet.Presentation;
+import freenet.support.FileBucket;
+import freenet.support.io.DataNotValidIOException;
+import freenet.support.io.VerifyingInputStream;
 
 
 /**

Index: ProgressiveHashOutputStream.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/ProgressiveHashOutputStream.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.6.1
diff -u -w -r1.1.1.1 -r1.1.1.1.6.1
--- ProgressiveHashOutputStream.java    13 Jan 2002 05:24:25 -0000      1.1.1.1
+++ ProgressiveHashOutputStream.java    1 Nov 2003 16:55:26 -0000       1.1.1.1.6.1
@@ -1,9 +1,13 @@
 package freenet.crypt;
-import freenet.support.io.*;
-import freenet.support.Bucket;
-import freenet.Presentation;
-import java.io.*;
+import java.io.BufferedOutputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Stack;
+
+import freenet.Presentation;
+import freenet.support.Bucket;
 
 /**
  * A progressive hash stream is a stream of data where each part is preceded

Index: ThrottledAsyncEntropyYarrow.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/ThrottledAsyncEntropyYarrow.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -w -r1.2.2.1 -r1.2.2.2
--- ThrottledAsyncEntropyYarrow.java    28 Oct 2003 20:20:30 -0000      1.2.2.1
+++ ThrottledAsyncEntropyYarrow.java    1 Nov 2003 16:55:26 -0000       1.2.2.2
@@ -55,6 +55,7 @@
                        }
                });
                entropyProcessor.setDaemon(true);
+               entropyProcessor.setPriority(Thread.MIN_PRIORITY);
                entropyProcessor.setName("PRNG/Yarrow entropy processing thread");
                entropyProcessor.start();
        }

Index: Yarrow.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/crypt/Yarrow.java,v
retrieving revision 1.7.6.2
retrieving revision 1.7.6.3
diff -u -w -r1.7.6.2 -r1.7.6.3
--- Yarrow.java 28 Oct 2003 20:20:30 -0000      1.7.6.2
+++ Yarrow.java 1 Nov 2003 16:55:26 -0000       1.7.6.3
@@ -1,10 +1,17 @@
 package freenet.crypt;
 
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
 import freenet.Core;
 import freenet.support.Logger;
-import java.math.BigInteger;
-import java.util.*;
-import java.io.*;
 
 /*
   This code is part of the Java Adaptive Network Client by Ian Clarke. 

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to