mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
07.49.2014 0cd253538aca548c4b601f3e2353bbe274923cb1
OPENDJ-1307 Migrate server ASN1 classes to SDK

org.opends.server.protocols.asn1.ASN1* => org.forgerock.opendj.io.ASN1*
ASN1Exception => DecodeException, IOException
ASN1Constants.* => ASN1.*
1 files modified
12 ■■■■■ changed files
opendj-server3x-adapter/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java 12 ●●●●● patch | view | raw | blame | history
opendj-server3x-adapter/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java
@@ -31,6 +31,9 @@
import java.util.Collections;
import java.util.List;
import org.forgerock.opendj.io.ASN1;
import org.forgerock.opendj.io.ASN1Reader;
import org.forgerock.opendj.io.ASN1Writer;
import org.forgerock.opendj.ldap.Attribute;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ByteStringBuilder;
@@ -49,9 +52,6 @@
import org.opends.server.core.BindOperation;
import org.opends.server.core.CompareOperation;
import org.opends.server.core.ExtendedOperation;
import org.opends.server.protocols.asn1.ASN1;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPControl;
import org.opends.server.protocols.ldap.LDAPFilter;
@@ -417,7 +417,6 @@
     * @return the converted value
     */
    public static Control from(final org.opends.server.types.Control control) {
        String oid = null;
        boolean isCritical = false;
        ByteString value = null;
@@ -640,15 +639,14 @@
     * @return the converted value
     */
    public static ByteString getCredentials(final byte[] authenticationValue) {
        final org.opends.server.protocols.asn1.ASN1Reader reader =
                ASN1.getReader(authenticationValue);
        final ASN1Reader reader = ASN1.getReader(authenticationValue);
        ByteString saslCred = ByteString.empty();
        try {
            reader.readOctetStringAsString(); // Reads SASL Mechanism - RFC 4511 4.2
            if (reader.hasNextElement()) {
                saslCred = reader.readOctetString(); // Reads credentials.
            }
        } catch (ASN1Exception e) {
        } catch (IOException e) {
            // Nothing to do.
        }