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]

Patch: java.securtiy


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to merge fixes from GNU classpath 
into mainline.


Michael


2004-06-01  Michael Koch  <konqueror@gmx.de>

	* java/security/Security.java
	(insertProviderAt): Use equals() instead of ==.
	(removeProvicer): Likewise.
	(getProvider): Likewise.
	* java/security/Signature.java
	(sign): Don't set state to UNINITIALIZED.
	(verify): Likewise.
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAvG97WSOgCCdjSDsRAulJAJ9ocaSD+eigAa4+sQSB0J9icYfPHwCgn6cl
g8RNItInASmWi5+uc7lSbpk=
=xXmz
-----END PGP SIGNATURE-----
Index: java/security/Security.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/security/Security.java,v
retrieving revision 1.18
diff -u -b -B -r1.18 Security.java
--- java/security/Security.java	3 May 2004 20:06:09 -0000	1.18
+++ java/security/Security.java	1 Jun 2004 11:54:33 -0000
@@ -1,5 +1,5 @@
 /* Security.java --- Java base security class implementation
-   Copyright (C) 1999, 2001, 2002, 2003, 2004, Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -237,7 +237,7 @@
     int max = providers.size ();
     for (int i = 0; i < max; i++)
       {
-	if (((Provider) providers.elementAt(i)).getName() == provider.getName())
+	if (((Provider) providers.elementAt(i)).getName().equals(provider.getName()))
 	  return -1;
       }
 
@@ -312,7 +312,7 @@
     int max = providers.size ();
     for (int i = 0; i < max; i++)
       {
-	if (((Provider) providers.elementAt(i)).getName() == name)
+	if (((Provider) providers.elementAt(i)).getName().equals(name))
 	  {
 	    providers.remove(i);
 	    break;
@@ -349,7 +349,7 @@
     for (int i = 0; i < max; i++)
       {
 	p = (Provider) providers.elementAt(i);
-	if (p.getName() == name)
+	if (p.getName().equals(name))
 	  return p;
       }
     return null;
Index: java/security/Signature.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/security/Signature.java,v
retrieving revision 1.7
diff -u -b -B -r1.7 Signature.java
--- java/security/Signature.java	20 Apr 2004 14:44:56 -0000	1.7
+++ java/security/Signature.java	1 Jun 2004 11:54:33 -0000
@@ -1,5 +1,5 @@
 /* Signature.java --- Signature Class
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -368,10 +368,7 @@
   public final byte[] sign() throws SignatureException
   {
     if (state == SIGN)
-      {
-        state = UNINITIALIZED;
         return engineSign();
-      }
     else
       throw new SignatureException();
   }
@@ -398,10 +395,7 @@
     throws SignatureException
   {
     if (state == SIGN)
-      {
-        state = UNINITIALIZED;
         return engineSign(outbuf, offset, len);
-      }
     else
       throw new SignatureException();
   }
@@ -425,10 +419,7 @@
   public final boolean verify(byte[]signature) throws SignatureException
   {
     if (state == VERIFY)
-      {
-        state = UNINITIALIZED;
         return engineVerify(signature);
-      }
     else
       throw new SignatureException();
   }
@@ -464,7 +455,7 @@
       throw new SignatureException("illegal state");
 
     if (signature == null)
-      throw new IllegalArgumentException("signaure is null");
+      throw new IllegalArgumentException("signature is null");
     if (offset < 0)
       throw new IllegalArgumentException("offset is less than 0");
     if (length < 0)
@@ -472,7 +463,6 @@
     if (offset + length < signature.length)
       throw new IllegalArgumentException("range is out of bounds");
 
-    state = UNINITIALIZED;
     return engineVerify(signature, offset, length);
   }
 

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