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

Jean-Noël Rouvignac
20.42.2016 61b9eb1be03fc03a9f4bb0013a08ff44a1059503
opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java
@@ -16,8 +16,6 @@
 */
package org.opends.server.extensions;
import static org.opends.messages.ExtensionMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.util.ServerConstants.*;
@@ -78,10 +76,7 @@
  /** The identity mapper that will be used to map identities. */
  private IdentityMapper<?> identityMapper;
  /**
   * The properties to use when creating a SASL server to process the
   * GSSAPI authentication.
   */
  /** The properties to use when creating a SASL server to process the GSSAPI authentication. */
  private HashMap<String, String> saslProps;
  /** The fully qualified domain name used when creating the SASL server. */
@@ -91,8 +86,6 @@
  private volatile LoginContext loginContext;
  private final Object loginContextLock = new Object();
  /**
   * Creates a new instance of this SASL mechanism handler. No
   * initialization should be done in this method, as it should all be
@@ -104,9 +97,6 @@
    super();
  }
  /** {@inheritDoc} */
  @Override
  public void initializeSASLMechanismHandler(
      GSSAPISASLMechanismHandlerCfg configuration) throws ConfigException,
@@ -133,8 +123,6 @@
    }
  }
  /**
   * Checks to make sure that the ds-cfg-kdc-address and dc-cfg-realm
   * are both defined in the configuration. If only one is set, then
@@ -161,12 +149,9 @@
    {
      System.setProperty(KRBV_PROPERTY_KDC, kdcAddress);
      System.setProperty(KRBV_PROPERTY_REALM, realm);
    }
  }
  /**
   * During login, callbacks are usually used to prompt for passwords.
   * All of the GSSAPI login information is provided in the properties
@@ -182,8 +167,6 @@
  {
  }
  /**
   * Returns the fully qualified name either defined in the
   * configuration, or, determined by examining the system
@@ -208,7 +191,6 @@
  }
  /**
   *
   * Return the login context. If it's not been initialized yet,
   * create a login context or login using the principal and keytab
   * information specified in the configuration.
@@ -234,11 +216,7 @@
    return loginContext;
  }
  /**
   * Logout of the current login context.
   */
  /** Logout of the current login context. */
  private void logout()
  {
    try
@@ -258,8 +236,6 @@
    }
  }
  /**
   * Creates an login.conf file from information in the specified
   * configuration. This file is used during the login phase.
@@ -320,9 +296,6 @@
    return configFileName;
  }
  /** {@inheritDoc} */
  @Override
  public void finalizeSASLMechanismHandler() {
    logout();
@@ -335,7 +308,6 @@
    logger.error(INFO_GSSAPI_STOPPED);
  }
private void clearProperties() {
  System.clearProperty(KRBV_PROPERTY_KDC);
  System.clearProperty(KRBV_PROPERTY_REALM);
@@ -343,7 +315,6 @@
  System.clearProperty(JAAS_PROPERTY_SUBJECT_CREDS_ONLY);
}
  /** {@inheritDoc} */
  @Override
  public void processSASLBind(BindOperation bindOp)
  {
@@ -394,7 +365,6 @@
    }
  }
  /**
   * Get the underlying GSSException messages that really tell what the
   * problem is. The major code is the GSS-API status and the minor is the
@@ -417,8 +387,6 @@
    return message.toMessage();
  }
  /** {@inheritDoc} */
  @Override
  public boolean isPasswordBased(String mechanism)
  {
@@ -426,8 +394,6 @@
    return false;
  }
  /** {@inheritDoc} */
  @Override
  public boolean isSecure(String mechanism)
  {
@@ -435,9 +401,6 @@
    return true;
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationAcceptable(
      SASLMechanismHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons)
@@ -447,9 +410,6 @@
    return isConfigurationChangeAcceptable(newConfig, unacceptableReasons);
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationChangeAcceptable(
      GSSAPISASLMechanismHandlerCfg newConfiguration,
@@ -496,9 +456,6 @@
    return isAcceptable;
  }
  /** {@inheritDoc} */
  @Override
  public ConfigChangeResult applyConfigurationChange(GSSAPISASLMechanismHandlerCfg newConfiguration)
  {