summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaif S. Naffah <raif@swiftdsl.com.au>2006-01-28 06:50:58 +0000
committerRaif S. Naffah <raif@swiftdsl.com.au>2006-01-28 06:50:58 +0000
commit779d85b246a2c749904327b07dd55ce543450ef1 (patch)
tree1ea82a47f9c075aba09c199825ff2f477514b2db
parent7626b5350df97c8ac0d690d3790f696a5b6afe8e (diff)
downloadclasspath-779d85b246a2c749904327b07dd55ce543450ef1.tar.gz
2006-01-28 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/javax/crypto/jce/mac/MacAdapter.java (MacAdapter(IMac, Map)): New constructor for cloning purposes. (clone): New implementation that ensures cloning.
-rw-r--r--ChangeLog3
-rw-r--r--gnu/javax/crypto/jce/mac/MacAdapter.java18
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 008b1f730..f6f9cb9b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-01-28 Raif S. Naffah <raif@swiftdsl.com.au>
+ * gnu/javax/crypto/jce/mac/MacAdapter.java (MacAdapter(IMac, Map)): New
+ constructor for cloning purposes.
+ (clone): New implementation that ensures cloning.
* gnu/javax/crypto/mac/HMac.java (clone): Implement Cloneable.
* gnu/java/security/Registry.java: Changed value of GNU_SECURITY to
"GNU".
diff --git a/gnu/javax/crypto/jce/mac/MacAdapter.java b/gnu/javax/crypto/jce/mac/MacAdapter.java
index 86cc29c30..c323413a4 100644
--- a/gnu/javax/crypto/jce/mac/MacAdapter.java
+++ b/gnu/javax/crypto/jce/mac/MacAdapter.java
@@ -58,7 +58,7 @@ import javax.crypto.MacSpi;
* message authentication code algorithm, such as the <i>Hashed Message
* Authentication Code</i> (<b>HMAC</b>) algorithms.</p>
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
class MacAdapter extends MacSpi implements Cloneable
{
@@ -86,6 +86,20 @@ class MacAdapter extends MacSpi implements Cloneable
attributes = new HashMap();
}
+ /**
+ * Private constructor for cloning purposes.
+ *
+ * @param mac a clone of the internal {@link IMac} instance.
+ * @param attributes a clone of the current {@link Map} of attributes.
+ */
+ private MacAdapter(IMac mac, Map attributes)
+ {
+ super();
+
+ this.mac = mac;
+ this.attributes = attributes;
+ }
+
// Class methods
// -----------------------------------------------------------------------
@@ -96,7 +110,7 @@ class MacAdapter extends MacSpi implements Cloneable
public Object clone() throws CloneNotSupportedException
{
- return super.clone();
+ return new MacAdapter((IMac) mac.clone(), new HashMap(attributes));
}
// Instance methods implementing javax.crypto.MacSpi ---------------------