| | |
| | | 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; |
| | |
| | | } |
| | | 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); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (! (saslStateInfo instanceof ASN1OctetString)) |
| | | if (! (saslStateInfo instanceof ByteString)) |
| | | { |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | ASN1OctetString challenge = (ASN1OctetString) saslStateInfo; |
| | | ByteString challenge = (ByteString) saslStateInfo; |
| | | |
| | | // Wipe out the stored challenge so it can't be used again. |
| | | clientConnection.setSASLAuthStateInfo(null); |
| | |
| | | // 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) |
| | | { |
| | |
| | | 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. |