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

Nicolas Capponi
07.06.2014 c01c421b26e6409febd6af1db1c9db11b7b347a4
opendj3-server-dev/src/server/org/opends/server/crypto/CryptoManagerSync.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 */
package org.opends.server.crypto;
@@ -150,10 +151,10 @@
    try
    {
      adminSuffixDN = DN.decode(ADSContext.getAdministrationSuffixDN());
      instanceKeysDN = adminSuffixDN.concat(DN.decode("cn=instance keys"));
      secretKeysDN = adminSuffixDN.concat(DN.decode("cn=secret keys"));
      trustStoreRootDN = DN.decode(ConfigConstants.DN_TRUST_STORE_ROOT);
      adminSuffixDN = DN.valueOf(ADSContext.getAdministrationSuffixDN());
      instanceKeysDN = adminSuffixDN.child(DN.valueOf("cn=instance keys"));
      secretKeysDN = adminSuffixDN.child(DN.valueOf("cn=secret keys"));
      trustStoreRootDN = DN.valueOf(ConfigConstants.DN_TRUST_STORE_ROOT);
      keySearchFilter =
           SearchFilter.createFilterFromString("(|" +
                "(objectclass=" + OC_CRYPTO_INSTANCE_KEY + ")" +
@@ -300,13 +301,13 @@
  private void handleInstanceKeySearchEntry(SearchResultEntry searchEntry)
       throws DirectoryException
  {
    RDN srcRDN = searchEntry.getDN().getRDN();
    RDN srcRDN = searchEntry.getDN().rdn();
    // Only process the entry if it has the expected form of RDN.
    if (!srcRDN.isMultiValued() &&
         srcRDN.getAttributeType(0).equals(attrAlias))
    {
      DN dstDN = trustStoreRootDN.concat(srcRDN);
      DN dstDN = trustStoreRootDN.child(srcRDN);
      // Extract any change notification control.
      EntryChangeNotificationControl ecn = null;
@@ -521,13 +522,13 @@
  private void handleInstanceKeyAddOperation(Entry entry)
  {
    RDN srcRDN = entry.getDN().getRDN();
    RDN srcRDN = entry.getDN().rdn();
    // Only process the entry if it has the expected form of RDN.
    if (!srcRDN.isMultiValued() &&
         srcRDN.getAttributeType(0).equals(attrAlias))
    {
      DN dstDN = trustStoreRootDN.concat(srcRDN);
      DN dstDN = trustStoreRootDN.child(srcRDN);
      if (!entry.hasAttribute(attrCompromisedTime))
      {
@@ -547,7 +548,7 @@
      return;
    }
    RDN srcRDN = entry.getDN().getRDN();
    RDN srcRDN = entry.getDN().rdn();
    // Only process the entry if it has the expected form of RDN.
    // FIXME: Technically it is possible to perform a subtree in
@@ -556,7 +557,7 @@
    if (!srcRDN.isMultiValued() &&
         srcRDN.getAttributeType(0).equals(attrAlias))
    {
      DN dstDN = trustStoreRootDN.concat(srcRDN);
      DN dstDN = trustStoreRootDN.child(srcRDN);
      deleteEntry(dstDN);
    }
@@ -596,13 +597,13 @@
  private void handleInstanceKeyModifyOperation(Entry newEntry)
  {
    RDN srcRDN = newEntry.getDN().getRDN();
    RDN srcRDN = newEntry.getDN().rdn();
    // Only process the entry if it has the expected form of RDN.
    if (!srcRDN.isMultiValued() &&
         srcRDN.getAttributeType(0).equals(attrAlias))
    {
      DN dstDN = trustStoreRootDN.concat(srcRDN);
      DN dstDN = trustStoreRootDN.child(srcRDN);
      // Get any existing local trust store entry.
      Entry dstEntry = null;