This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: security providers and ...


On Monday 15 July 2002 00:19, Mark Wielaard wrote:
> But I don't think they are very well tested so please let us know
> if they work correctly for you.
>

gnu.java.security.provider.MD5 should extend java.security.DigestMessage 
instead of DigestMessageSpi, because now it throws exception:
java.lang.ClassCastException:
 gnu.java.security.provider.MD5 cannot be cast to java.security.MessageDigest
when trying to MessageDigest.getInstance("MD5").

public class t  {
	public static void main(String[]argv) {
		try {
			java.security.MessageDigest.getInstance("MD5");
		} catch(Throwable t) {
			t.printStackTrace();
		}
	}
}

Bellow are the changes I made to get it work. Can you, please, commit them?
V.Puskas

===================================================================
--- cvs/libjava/gnu/java/security/provider/MD5.java	Sun Aug 11 14:08:03 2002
+++ gcc/libjava/gnu/java/security/provider/MD5.java	Fri Aug 16 00:46:35 2002
@@ -37,14 +37,14 @@
 
 
 package gnu.java.security.provider;
-import java.security.MessageDigestSpi;
+import java.security.MessageDigest;
 
 /**
    This class implements the MD5 algorithm as described in RFC1321.
 
    @see java.security.MessageDigest
 */
-public class MD5 extends MessageDigestSpi implements Cloneable
+public class MD5 extends MessageDigest implements Cloneable
 {
   private final int W[] = new int[16];
   private long bytecount;
@@ -55,7 +55,7 @@
 
   public MD5()
   {
-    super();
+    super("MD5");
     engineReset ();
   }




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]