summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-05 21:29:44 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-05 21:29:44 +0000
commit05018cfd0d57d14336c66e04768f272e6531f9b7 (patch)
treed35b93a870d0aaa5a6f06904664577c7a90da367 /gnu
parentd5f93b478d8bbafd9e0c4e8bf24800ee4b16bef8 (diff)
downloadclasspath-05018cfd0d57d14336c66e04768f272e6531f9b7.tar.gz
2008-05-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/21869 * gnu/javax/crypto/assembly/TransformerException.java, * gnu/javax/crypto/cipher/BaseCipher.java, * gnu/javax/crypto/jce/sig/DHParameters.java, * gnu/javax/crypto/key/KeyAgreementException.java, * gnu/javax/crypto/mode/BaseMode.java, * gnu/javax/crypto/pad/BasePad.java, * gnu/javax/crypto/sasl/crammd5/CramMD5Util.java, * gnu/javax/crypto/sasl/crammd5/PasswordFile.java, * gnu/javax/crypto/sasl/plain/PasswordFile.java, * gnu/javax/crypto/sasl/plain/PlainClient.java, * gnu/javax/crypto/sasl/srp/PasswordFile.java, * gnu/javax/crypto/sasl/srp/SRPClient.java, * gnu/javax/crypto/sasl/srp/SRPServer.java, * gnu/javax/crypto/sasl/srp/ServerStore.java: Swap use of StringBuffer for CPStringBuilder,
Diffstat (limited to 'gnu')
-rw-r--r--gnu/javax/crypto/assembly/TransformerException.java4
-rw-r--r--gnu/javax/crypto/cipher/BaseCipher.java4
-rw-r--r--gnu/javax/crypto/jce/sig/DHParameters.java4
-rw-r--r--gnu/javax/crypto/key/KeyAgreementException.java4
-rw-r--r--gnu/javax/crypto/mode/BaseMode.java4
-rw-r--r--gnu/javax/crypto/pad/BasePad.java4
-rw-r--r--gnu/javax/crypto/sasl/crammd5/CramMD5Util.java4
-rw-r--r--gnu/javax/crypto/sasl/crammd5/PasswordFile.java6
-rw-r--r--gnu/javax/crypto/sasl/plain/PasswordFile.java6
-rw-r--r--gnu/javax/crypto/sasl/plain/PlainClient.java4
-rw-r--r--gnu/javax/crypto/sasl/srp/PasswordFile.java12
-rw-r--r--gnu/javax/crypto/sasl/srp/SRPClient.java4
-rw-r--r--gnu/javax/crypto/sasl/srp/SRPServer.java4
-rw-r--r--gnu/javax/crypto/sasl/srp/ServerStore.java4
14 files changed, 48 insertions, 20 deletions
diff --git a/gnu/javax/crypto/assembly/TransformerException.java b/gnu/javax/crypto/assembly/TransformerException.java
index 2c972f858..4e93322ef 100644
--- a/gnu/javax/crypto/assembly/TransformerException.java
+++ b/gnu/javax/crypto/assembly/TransformerException.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.assembly;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.PrintStream;
import java.io.PrintWriter;
@@ -129,7 +131,7 @@ public class TransformerException
*/
public String toString()
{
- StringBuffer sb = new StringBuffer(this.getClass().getName())
+ CPStringBuilder sb = new CPStringBuilder(this.getClass().getName())
.append(": ").append(super.toString());
if (_exception != null)
sb.append("; caused by: ").append(_exception.toString());
diff --git a/gnu/javax/crypto/cipher/BaseCipher.java b/gnu/javax/crypto/cipher/BaseCipher.java
index a5bbe6987..bae142a63 100644
--- a/gnu/javax/crypto/cipher/BaseCipher.java
+++ b/gnu/javax/crypto/cipher/BaseCipher.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.cipher;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Configuration;
import java.security.InvalidKeyException;
@@ -88,7 +90,7 @@ public abstract class BaseCipher
public String name()
{
- StringBuffer sb = new StringBuffer(name).append('-');
+ CPStringBuilder sb = new CPStringBuilder(name).append('-');
if (currentKey == null)
sb.append(String.valueOf(8 * defaultBlockSize));
else
diff --git a/gnu/javax/crypto/jce/sig/DHParameters.java b/gnu/javax/crypto/jce/sig/DHParameters.java
index 0357c163d..a917e2230 100644
--- a/gnu/javax/crypto/jce/sig/DHParameters.java
+++ b/gnu/javax/crypto/jce/sig/DHParameters.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.jce.sig;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Registry;
import gnu.java.security.der.DER;
import gnu.java.security.der.DERReader;
@@ -195,7 +197,7 @@ public class DHParameters
protected String engineToString()
{
- StringBuffer sb = new StringBuffer("p=");
+ CPStringBuilder sb = new CPStringBuilder("p=");
if (p == null)
sb.append("???");
else
diff --git a/gnu/javax/crypto/key/KeyAgreementException.java b/gnu/javax/crypto/key/KeyAgreementException.java
index f0fb1bb83..405f011ad 100644
--- a/gnu/javax/crypto/key/KeyAgreementException.java
+++ b/gnu/javax/crypto/key/KeyAgreementException.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.key;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Serializable;
@@ -157,7 +159,7 @@ public class KeyAgreementException
*/
public String toString()
{
- StringBuffer sb = new StringBuffer(this.getClass().getName()).append(": ")
+ CPStringBuilder sb = new CPStringBuilder(this.getClass().getName()).append(": ")
.append(super.toString());
if (cause != null)
sb.append("; caused by: ").append(cause.toString());
diff --git a/gnu/javax/crypto/mode/BaseMode.java b/gnu/javax/crypto/mode/BaseMode.java
index 6d9418cca..02e432290 100644
--- a/gnu/javax/crypto/mode/BaseMode.java
+++ b/gnu/javax/crypto/mode/BaseMode.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.mode;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.javax.crypto.cipher.IBlockCipher;
import java.security.InvalidKeyException;
@@ -110,7 +112,7 @@ public abstract class BaseMode
public String name()
{
- return new StringBuffer(name).append('(').append(cipher.name()).append(')')
+ return new CPStringBuilder(name).append('(').append(cipher.name()).append(')')
.toString();
}
diff --git a/gnu/javax/crypto/pad/BasePad.java b/gnu/javax/crypto/pad/BasePad.java
index 8b475d2d8..adc2c9bbc 100644
--- a/gnu/javax/crypto/pad/BasePad.java
+++ b/gnu/javax/crypto/pad/BasePad.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.pad;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Configuration;
import java.util.Map;
@@ -67,7 +69,7 @@ public abstract class BasePad
public String name()
{
- final StringBuffer sb = new StringBuffer(name);
+ final CPStringBuilder sb = new CPStringBuilder(name);
if (blockSize != -1)
sb.append('-').append(String.valueOf(8 * blockSize));
return sb.toString();
diff --git a/gnu/javax/crypto/sasl/crammd5/CramMD5Util.java b/gnu/javax/crypto/sasl/crammd5/CramMD5Util.java
index 214551221..a6a06b6b8 100644
--- a/gnu/javax/crypto/sasl/crammd5/CramMD5Util.java
+++ b/gnu/javax/crypto/sasl/crammd5/CramMD5Util.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.crammd5;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Registry;
import gnu.java.security.util.Util;
import gnu.javax.crypto.mac.HMacFactory;
@@ -83,7 +85,7 @@ class CramMD5Util
final byte[] result;
try
{
- result = new StringBuffer("<")
+ result = new CPStringBuilder("<")
.append(encoded.substring(0,encoded.length()))
.append(".").append(String.valueOf(System.currentTimeMillis()))
.append("@").append(hostname).append(">")
diff --git a/gnu/javax/crypto/sasl/crammd5/PasswordFile.java b/gnu/javax/crypto/sasl/crammd5/PasswordFile.java
index df9521116..4900842a7 100644
--- a/gnu/javax/crypto/sasl/crammd5/PasswordFile.java
+++ b/gnu/javax/crypto/sasl/crammd5/PasswordFile.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.crammd5;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.javax.crypto.sasl.NoSuchUserException;
import gnu.javax.crypto.sasl.UserAlreadyExistsException;
@@ -201,13 +203,13 @@ public class PasswordFile
pw = new PrintWriter(fos);
String key;
String[] fields;
- StringBuffer sb;
+ CPStringBuilder sb;
int i;
for (Iterator it = entries.keySet().iterator(); it.hasNext();)
{
key = (String) it.next();
fields = (String[]) entries.get(key);
- sb = new StringBuffer(fields[0]);
+ sb = new CPStringBuilder(fields[0]);
for (i = 1; i < fields.length; i++)
sb.append(":").append(fields[i]);
pw.println(sb.toString());
diff --git a/gnu/javax/crypto/sasl/plain/PasswordFile.java b/gnu/javax/crypto/sasl/plain/PasswordFile.java
index b6fb3f87e..4888214d8 100644
--- a/gnu/javax/crypto/sasl/plain/PasswordFile.java
+++ b/gnu/javax/crypto/sasl/plain/PasswordFile.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.plain;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.action.GetPropertyAction;
import gnu.javax.crypto.sasl.NoSuchUserException;
import gnu.javax.crypto.sasl.UserAlreadyExistsException;
@@ -205,13 +207,13 @@ public class PasswordFile
pw = new PrintWriter(fos);
String key;
String[] fields;
- StringBuffer sb;
+ CPStringBuilder sb;
Enumeration keys = entries.keys();
while (keys.hasMoreElements())
{
key = (String) keys.nextElement();
fields = (String[]) entries.get(key);
- sb = new StringBuffer(fields[0]);
+ sb = new CPStringBuilder(fields[0]);
for (int i = 1; i < fields.length; i++)
sb.append(":" + fields[i]);
pw.println(sb.toString());
diff --git a/gnu/javax/crypto/sasl/plain/PlainClient.java b/gnu/javax/crypto/sasl/plain/PlainClient.java
index 5c60578db..87fffa01e 100644
--- a/gnu/javax/crypto/sasl/plain/PlainClient.java
+++ b/gnu/javax/crypto/sasl/plain/PlainClient.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.plain;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Registry;
import gnu.javax.crypto.sasl.ClientMechanism;
@@ -128,7 +130,7 @@ public class PlainClient
}
if (password == null)
throw new SaslException("null password supplied");
- final StringBuffer sb = new StringBuffer();
+ final CPStringBuilder sb = new CPStringBuilder();
if (authorizationID != null)
sb.append(authorizationID);
sb.append('\0');
diff --git a/gnu/javax/crypto/sasl/srp/PasswordFile.java b/gnu/javax/crypto/sasl/srp/PasswordFile.java
index 36888df87..7946e84fb 100644
--- a/gnu/javax/crypto/sasl/srp/PasswordFile.java
+++ b/gnu/javax/crypto/sasl/srp/PasswordFile.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.srp;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Registry;
import gnu.java.security.util.Util;
import gnu.javax.crypto.key.srp6.SRPAlgorithm;
@@ -445,12 +447,12 @@ public class PasswordFile
{
String ndx;
String[] mpi;
- StringBuffer sb;
+ CPStringBuilder sb;
for (Iterator it = configurations.keySet().iterator(); it.hasNext();)
{
ndx = (String) it.next();
mpi = (String[]) configurations.get(ndx);
- sb = new StringBuffer(ndx)
+ sb = new CPStringBuilder(ndx)
.append(":").append(mpi[0])
.append(":").append(mpi[1]);
pw.println(sb.toString());
@@ -591,7 +593,7 @@ public class PasswordFile
{
String user, digestID;
HashMap fields, verifiers;
- StringBuffer sb1, sb2;
+ CPStringBuilder sb1, sb2;
Iterator j;
final Iterator i = entries.keySet().iterator();
while (i.hasNext())
@@ -601,7 +603,7 @@ public class PasswordFile
if (! user.equals(fields.get(USER_FIELD)))
throw new IOException("Inconsistent SRP password data");
verifiers = (HashMap) fields.get(VERIFIERS_FIELD);
- sb1 = new StringBuffer(user)
+ sb1 = new CPStringBuilder(user)
.append(":").append((String) verifiers.get("0"))
.append(":").append((String) fields.get(SALT_FIELD))
.append(":").append((String) fields.get(CONFIG_FIELD));
@@ -614,7 +616,7 @@ public class PasswordFile
if (! "0".equals(digestID))
{
// #0 is the default digest, already present in tpasswd!
- sb2 = new StringBuffer(digestID)
+ sb2 = new CPStringBuilder(digestID)
.append(":").append(user)
.append(":").append((String) verifiers.get(digestID));
pw2.println(sb2.toString());
diff --git a/gnu/javax/crypto/sasl/srp/SRPClient.java b/gnu/javax/crypto/sasl/srp/SRPClient.java
index f4ef4cc34..3406c14ce 100644
--- a/gnu/javax/crypto/sasl/srp/SRPClient.java
+++ b/gnu/javax/crypto/sasl/srp/SRPClient.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.srp;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Configuration;
import gnu.java.security.Registry;
import gnu.java.security.hash.MD5;
@@ -863,7 +865,7 @@ public class SRPClient
// For now we just select the defaults. Later we need to add support for
// properties (perhaps in a file) where a user can specify the list of
// algorithms they would prefer to use.
- final StringBuffer sb = new StringBuffer();
+ final CPStringBuilder sb = new CPStringBuilder();
sb.append(SRPRegistry.OPTION_SRP_DIGEST)
.append("=").append(mdName).append(",");
if (replayDetection)
diff --git a/gnu/javax/crypto/sasl/srp/SRPServer.java b/gnu/javax/crypto/sasl/srp/SRPServer.java
index ff7e4e9d6..3f000deef 100644
--- a/gnu/javax/crypto/sasl/srp/SRPServer.java
+++ b/gnu/javax/crypto/sasl/srp/SRPServer.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.srp;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.Configuration;
import gnu.java.security.Registry;
import gnu.java.security.util.PRNG;
@@ -612,7 +614,7 @@ public class SRPServer
s = (String) properties.get(SRPRegistry.SRP_REPLAY_DETECTION);
final boolean replayDetection = (s == null ? SRPRegistry.DEFAULT_REPLAY_DETECTION
: Boolean.valueOf(s).booleanValue());
- final StringBuffer sb = new StringBuffer();
+ final CPStringBuilder sb = new CPStringBuilder();
sb.append(SRPRegistry.OPTION_SRP_DIGEST).append("=")
.append(srp.getAlgorithm()).append(",");
diff --git a/gnu/javax/crypto/sasl/srp/ServerStore.java b/gnu/javax/crypto/sasl/srp/ServerStore.java
index e9b1a7282..9fa83295a 100644
--- a/gnu/javax/crypto/sasl/srp/ServerStore.java
+++ b/gnu/javax/crypto/sasl/srp/ServerStore.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.crypto.sasl.srp;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.HashMap;
/**
@@ -84,7 +86,7 @@ public class ServerStore
static synchronized final byte[] getNewSessionID()
{
final String sid = String.valueOf(++counter);
- return new StringBuffer("SID-")
+ return new CPStringBuilder("SID-")
.append("0000000000".substring(0, 10 - sid.length())).append(sid)
.toString().getBytes();
}