From: Michael Koch Date: Tue, 1 Jun 2004 11:57:10 +0000 (+0000) Subject: 2004-06-01 Michael Koch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ef44cfd0bb7d3cd4d534748d424a171f761b792;p=gcc.git 2004-06-01 Michael Koch * 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. From-SVN: r82543 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index aed49734797..d775572f229 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2004-06-01 Michael Koch + + * 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. + 2004-06-01 Mark Wielaard * gnu/java/awt/peer/gtk/GtkComponentPeer.java (requestFocus): diff --git a/libjava/java/security/Security.java b/libjava/java/security/Security.java index 25cadcac465..6c8d2b4c04c 100644 --- a/libjava/java/security/Security.java +++ b/libjava/java/security/Security.java @@ -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 @@ public final class Security 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 @@ public final class Security 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 @@ public final class Security 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; diff --git a/libjava/java/security/Signature.java b/libjava/java/security/Signature.java index bf614e388b3..b7979791042 100644 --- a/libjava/java/security/Signature.java +++ b/libjava/java/security/Signature.java @@ -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 abstract class Signature extends SignatureSpi public final byte[] sign() throws SignatureException { if (state == SIGN) - { - state = UNINITIALIZED; - return engineSign(); - } + return engineSign(); else throw new SignatureException(); } @@ -398,10 +395,7 @@ public abstract class Signature extends SignatureSpi throws SignatureException { if (state == SIGN) - { - state = UNINITIALIZED; - return engineSign(outbuf, offset, len); - } + return engineSign(outbuf, offset, len); else throw new SignatureException(); } @@ -425,10 +419,7 @@ public abstract class Signature extends SignatureSpi public final boolean verify(byte[]signature) throws SignatureException { if (state == VERIFY) - { - state = UNINITIALIZED; - return engineVerify(signature); - } + return engineVerify(signature); else throw new SignatureException(); } @@ -464,7 +455,7 @@ public abstract class Signature extends SignatureSpi 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 @@ public abstract class Signature extends SignatureSpi if (offset + length < signature.length) throw new IllegalArgumentException("range is out of bounds"); - state = UNINITIALIZED; return engineVerify(signature, offset, length); }