From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk

---
 opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java b/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
index afd8b15..5b7165d 100644
--- a/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
+++ b/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
@@ -48,7 +48,6 @@
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.PasswordPolicyState;
 import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.types.AuthenticationInfo;
 import org.opends.server.types.ByteString;
 import org.opends.server.types.ConfigChangeResult;
@@ -215,8 +214,8 @@
       }
       challengeString.append('>');
 
-      ASN1OctetString challenge =
-           new ASN1OctetString(challengeString.toString());
+      ByteString challenge =
+          ByteString.valueOf(challengeString.toString());
       clientConnection.setSASLAuthStateInfo(challenge);
       bindOperation.setServerSASLCredentials(challenge);
       bindOperation.setResultCode(ResultCode.SASL_BIND_IN_PROGRESS);
@@ -238,7 +237,7 @@
       return;
     }
 
-    if (! (saslStateInfo instanceof ASN1OctetString))
+    if (! (saslStateInfo instanceof  ByteString))
     {
       bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS);
 
@@ -247,7 +246,7 @@
       return;
     }
 
-    ASN1OctetString  challenge = (ASN1OctetString) saslStateInfo;
+    ByteString  challenge = (ByteString) saslStateInfo;
 
     // Wipe out the stored challenge so it can't be used again.
     clientConnection.setSASLAuthStateInfo(null);
@@ -257,7 +256,7 @@
     // It should be a username followed by a space and a digest string.  Since
     // the username itself may contain spaces but the digest string may not,
     // look for the last space and use it as the delimiter.
-    String credString = clientCredentials.stringValue();
+    String credString = clientCredentials.toString();
     int spacePos = credString.lastIndexOf(' ');
     if (spacePos < 0)
     {
@@ -516,8 +515,8 @@
   private byte[] generateDigest(ByteString password, ByteString challenge)
   {
     // Get the byte arrays backing the password and challenge.
-    byte[] p = password.value();
-    byte[] c = challenge.value();
+    byte[] p = password.toByteArray();
+    byte[] c = challenge.toByteArray();
 
 
     // Grab a lock to protect the MD5 digest generation.

--
Gitblit v1.10.0