From 6e37b34294f9c93600eba5b05836de813dd04036 Mon Sep 17 00:00:00 2001 From: "miodrag%netscape.com" Date: Mon, 10 Apr 2000 17:45:59 +0000 Subject: [PATCH] Just return the raw bytes rather than a string in getCredentials (391585) git-svn-id: svn://10.0.0.236/trunk@65550 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ldap/client/opers/JDAPBindResponse.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/client/opers/JDAPBindResponse.java b/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/client/opers/JDAPBindResponse.java index 8e5bce82ea6..c9d8a73adec 100644 --- a/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/client/opers/JDAPBindResponse.java +++ b/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/client/opers/JDAPBindResponse.java @@ -25,7 +25,6 @@ import java.util.*; import netscape.ldap.client.*; import netscape.ldap.ber.stream.*; import java.io.*; -import java.net.*; /** * This class implements the bind response. This object @@ -47,7 +46,7 @@ public class JDAPBindResponse extends JDAPResult implements JDAPProtocolOp { /** * Internal variables */ - protected String m_credentials = null; + protected byte[] m_credentials = null; /** * Constructs bind response. @@ -57,19 +56,19 @@ public class JDAPBindResponse extends JDAPResult implements JDAPProtocolOp { super(((BERTag)element).getValue()); /* LDAPv3 Sasl Credentials support */ BERSequence s = (BERSequence)((BERTag)element).getValue(); - if (s.size() <= 3) + if (s.size() <= 3) { return; + } BERElement e = s.elementAt(3); if (e.getType() == BERElement.TAG) { BERElement el = ((BERTag)e).getValue(); - if (el instanceof BERSequence) - { + if (el instanceof BERSequence) { el = ((BERSequence)el).elementAt(0); } BEROctetString str = (BEROctetString)el; try{ - m_credentials = new String(str.getValue(),"UTF8"); - } catch(Throwable x) + m_credentials = str.getValue(); + } catch(Exception ex) {} } } @@ -78,7 +77,7 @@ public class JDAPBindResponse extends JDAPResult implements JDAPProtocolOp { * Retrieves Sasl Credentials. LDAPv3 support. * @return credentials */ - public String getCredentials() { + public byte[] getCredentials() { return m_credentials; }