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

neil_a_wilson
07.57.2007 63b21778e37cab7f2b7de77a2b5623e2b29ac0b3
Update the code for processing the LDAP bind request protocol op so that it is
not possible to alter the authentication type independently of setting the
credentials. This eliminates the possibility that the credentials could be out
of sync with the authentication type.

OpenDS Issue Number: 744
2 files modified
18 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindRequestProtocolOp.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindRequestProtocolOp.java
@@ -54,9 +54,6 @@
public class BindRequestProtocolOp
       extends ProtocolOp
{
  // The bind DN for this request.
  private ASN1OctetString dn;
@@ -209,18 +206,6 @@
  /**
   * Specifies the authentication type for this bind request.
   *
   * @param  authenticationType  The authentication type for this bind request.
   */
  public void setAuthenticationType(AuthenticationType authenticationType)
  {
    this.authenticationType = authenticationType;
  }
  /**
   * Retrieves the simple authentication password for this bind request.
   *
   * @return  The simple authentication password for this bind request, or
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java
@@ -165,7 +165,6 @@
         sasl.setProtocolVersion(2);
         simple.setProtocolVersion(2);
         sasl.setSASLAuthenticationInfo(SASL_MECHANISM_GSSAPI, saslCreds);
         sasl.setAuthenticationType(AuthenticationType.INTERNAL);
         
         ASN1Element simpleElement = simple.encode();
         ASN1Element saslElement = sasl.encode();
@@ -190,6 +189,6 @@
         String saslOpTypeStr=saslOp.getAuthenticationType().toString();
 //        Reporter.log(saslTypeStr);
 //        Reporter.log(saslOpTypeStr);
         assertFalse(saslOpTypeStr.equals(saslTypeStr));
         assertTrue(saslOpTypeStr.equals(saslTypeStr));
     }
}