aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/security/Signature.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-06-01 11:57:10 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-06-01 11:57:10 +0000
commit6ef44cfd0bb7d3cd4d534748d424a171f761b792 (patch)
tree1ca0ef7ef911e89dea84f63192fe8dc1b2b0538e /libjava/java/security/Signature.java
parent1460af9501354afbba460db4c8e731fdc8f5805f (diff)
downloadgcc-6ef44cfd0bb7d3cd4d534748d424a171f761b792.zip
gcc-6ef44cfd0bb7d3cd4d534748d424a171f761b792.tar.gz
gcc-6ef44cfd0bb7d3cd4d534748d424a171f761b792.tar.bz2
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. From-SVN: r82543
Diffstat (limited to 'libjava/java/security/Signature.java')
-rw-r--r--libjava/java/security/Signature.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/libjava/java/security/Signature.java b/libjava/java/security/Signature.java
index bf614e3..b797979 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);
}