From 6c2dae79767257aa61c05c36189489861ca6f0f0 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Thu, 06 Mar 2014 14:37:45 +0000
Subject: [PATCH] Checkpoint OPENDJ-1343 Migrate dsconfig - Removed the PasswordReader class as now we only support >JDK6   - Replaced calls to PasswordReader.readPassword to ConsoleApplication.readPassword() - Minor code cleanup / removed unused on the SecureConnectionCli class.

---
 opendj3-server-dev/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java b/opendj3-server-dev/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java
index 7c71500..2ac18a6 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -55,6 +55,7 @@
 import javax.security.sasl.SaslClient;
 
 import com.forgerock.opendj.cli.ClientException;
+import com.forgerock.opendj.cli.ConsoleApplication;
 import com.forgerock.opendj.cli.ReturnCode;
 
 import org.forgerock.i18n.LocalizableMessage;
@@ -69,7 +70,6 @@
 import org.opends.server.types.LDAPException;
 import org.opends.server.types.Control;
 import org.opends.server.util.Base64;
-import org.opends.server.util.PasswordReader;
 
 import static org.opends.messages.ToolMessages.*;
 import static org.opends.server.protocols.ldap.LDAPConstants.*;
@@ -3582,7 +3582,14 @@
           if (gssapiAuthPW == null)
           {
             System.out.print(INFO_LDAPAUTH_PASSWORD_PROMPT.get(gssapiAuthID));
-            gssapiAuthPW = PasswordReader.readPassword();
+            try
+            {
+              gssapiAuthPW = ConsoleApplication.readPassword();
+            }
+            catch (ClientException e)
+            {
+              throw new UnsupportedCallbackException(cb, e.getLocalizedMessage());
+            }
           }
 
           ((PasswordCallback) cb).setPassword(gssapiAuthPW);

--
Gitblit v1.10.0