From 5b373fe3ed40198ed9f6d558e05c0521bdd1b92c Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Thu, 04 Oct 2007 16:18:59 +0000
Subject: [PATCH] Enable test case org.opends.server.types.CryptoManagerTestCase#testCompromisedKey.

---
 opends/src/server/org/opends/server/core/TrustStoreSyncThread.java |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/TrustStoreSyncThread.java b/opends/src/server/org/opends/server/core/TrustStoreSyncThread.java
index d096375..7b2e99e 100644
--- a/opends/src/server/org/opends/server/core/TrustStoreSyncThread.java
+++ b/opends/src/server/org/opends/server/core/TrustStoreSyncThread.java
@@ -724,11 +724,34 @@
   public void handleModifyOperation(PostResponseModifyOperation modifyOperation,
                                     Entry oldEntry, Entry newEntry)
   {
-    if (!modifyOperation.getEntryDN().isDescendantOf(instanceKeysDN))
+    if (modifyOperation.getEntryDN().isDescendantOf(instanceKeysDN))
     {
-      return;
+      handleInstanceKeyModifyOperation(newEntry);
     }
+    else if (modifyOperation.getEntryDN().isDescendantOf(secretKeysDN))
+    {
+      try
+      {
+        if (newEntry.hasObjectClass(ocCipherKey))
+        {
+          DirectoryServer.getCryptoManager().importCipherKeyEntry(newEntry);
+        }
+        else if (newEntry.hasObjectClass(ocMacKey))
+        {
+          DirectoryServer.getCryptoManager().importMacKeyEntry(newEntry);
+        }
+      }
+      catch (CryptoManager.CryptoManagerException e)
+      {
+        Message message = Message.raw("Failed to import modified key entry: %s",
+                                      e.getMessage());
+        ErrorLogger.logError(message);
+      }
+    }
+  }
 
+  private void handleInstanceKeyModifyOperation(Entry newEntry)
+  {
     RDN srcRDN = newEntry.getDN().getRDN();
 
     // Only process the entry if it has the expected form of RDN.

--
Gitblit v1.10.0