+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.
+
2004-06-01 Mark Wielaard <mark@klomp.org>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (requestFocus):
/* 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.
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;
}
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;
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;
/* 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.
public final byte[] sign() throws SignatureException
{
if (state == SIGN)
- {
- state = UNINITIALIZED;
- return engineSign();
- }
+ return engineSign();
else
throw new SignatureException();
}
throws SignatureException
{
if (state == SIGN)
- {
- state = UNINITIALIZED;
- return engineSign(outbuf, offset, len);
- }
+ return engineSign(outbuf, offset, len);
else
throw new SignatureException();
}
public final boolean verify(byte[]signature) throws SignatureException
{
if (state == VERIFY)
- {
- state = UNINITIALIZED;
- return engineVerify(signature);
- }
+ return engineVerify(signature);
else
throw new SignatureException();
}
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)
if (offset + length < signature.length)
throw new IllegalArgumentException("range is out of bounds");
- state = UNINITIALIZED;
return engineVerify(signature, offset, length);
}