This is the mail archive of the java-patches@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 ...


Hi,

On Fri, 2002-08-16 at 01:28, Vladimir Puskas wrote:
> 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").

I had actually already done that for Classpath and will do that now also
for libgcj since that makes it at least usable for now. Raif already
send me patches to make MessageDigest handle classes that extend
MessageDigestSpi (and implements algorithm aliases) which is a more
generic solution. We will add that later when we have tested them a bit
more.

Thanks,

Mark
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1405
diff -u -r1.1405 ChangeLog
--- ChangeLog	14 Aug 2002 19:53:54 -0000	1.1405
+++ ChangeLog	18 Aug 2002 18:26:52 -0000
@@ -1,3 +1,9 @@
+2002-08-18  Mark Wielaard  <mark@klomp.org>
+
+	Thanks to Vladimir Puskas <vpuskas@eunet.yu>
+	* gnu/java/security/provider/MD5.java: Extends MessageDigest, not
+	MessageDigestSpi (fixes Classpath bug #783).
+
 2002-08-14  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
 
 	* java/lang/natPosixProcess.cc (cleanup): Added `path' argument.
Index: gnu/java/security/provider/MD5.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/security/provider/MD5.java,v
retrieving revision 1.4
diff -u -r1.4 MD5.java
--- gnu/java/security/provider/MD5.java	11 Aug 2002 12:08:03 -0000	1.4
+++ gnu/java/security/provider/MD5.java	18 Aug 2002 18:26:53 -0000
@@ -1,5 +1,5 @@
 /* MD5.java -- Class implementing the MD5 algorithm as specified in RFC1321.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -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]