From 7bdcb41c0f62967ec42d552f6002577dfb7019ca Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Tue, 02 Nov 2010 15:45:49 +0000
Subject: [PATCH] Sync from OpenDS (matthew_swift) Remove Platform class as it is no longer needed. Remove all getter methods which return passwords as Strings. Replace all setter methods which accept passwords as Strings with methods which accept passwords as char arrays, as per Java API security recommendations.

---
 sdk/src/com/sun/opends/sdk/util/StringPrepProfile.java |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/sdk/src/com/sun/opends/sdk/util/StringPrepProfile.java b/sdk/src/com/sun/opends/sdk/util/StringPrepProfile.java
index c7fa64e..78d3e39 100644
--- a/sdk/src/com/sun/opends/sdk/util/StringPrepProfile.java
+++ b/sdk/src/com/sun/opends/sdk/util/StringPrepProfile.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2009 Sun Microsystems, Inc.
+ *      Copyright 2010 Sun Microsystems, Inc.
  */
 package com.sun.opends.sdk.util;
 
@@ -30,6 +30,8 @@
 
 import static com.sun.opends.sdk.util.Validator.ensureNotNull;
 
+import java.text.Normalizer;
+import java.text.Normalizer.Form;
 import java.util.HashMap;
 import java.util.HashSet;
 
@@ -492,7 +494,9 @@
         // Map the attribute value.
         map(buffer, sequence.subSequence(i, length), trim, foldCase);
         // Normalize the attribute value.
-        normalize(buffer);
+        String normalizedForm = Normalizer.normalize(buffer, Form.NFKD);
+        buffer.setLength(0);
+        buffer.append(normalizedForm);
         break;
       }
       int buffLen = buffer.length();
@@ -575,14 +579,6 @@
 
 
 
-  // Normalizes the input string with NFKC Form.
-  private static void normalize(final StringBuilder buffer)
-  {
-    Platform.normalize(buffer);
-  }
-
-
-
   // Prevent instantiation.
   private StringPrepProfile()
   {

--
Gitblit v1.10.0