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

coulbeck
04.36.2007 4384a49cbed68c17b410afee97abd69799617e57
Use ConcurrentHashMap for the secret key caches to make access to them thread-safe.
1 files modified
9 ■■■■■ changed files
opends/src/server/org/opends/server/types/CryptoManager.java 9 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/types/CryptoManager.java
@@ -37,6 +37,7 @@
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;
import java.util.zip.Inflater;
@@ -131,8 +132,8 @@
  private final String preferredDigestAlgorithm;
  // The map from encryption key ID to MacKeyEntry (cache).
  private final HashMap<KeyEntryID, MacKeyEntry> macKeyEntryCache
          = new HashMap<KeyEntryID, MacKeyEntry>();
  private final Map<KeyEntryID, MacKeyEntry> macKeyEntryCache
          = new ConcurrentHashMap<KeyEntryID, MacKeyEntry>();
  // The preferred MAC algorithm for the Directory Server.
  private final String preferredMACAlgorithm;
@@ -141,8 +142,8 @@
  private final int preferredMACAlgorithmKeyLengthBits;
  // The map from encryption key ID to CipherKeyEntry (cache).
  private final HashMap<KeyEntryID, CipherKeyEntry>
      cipherKeyEntryCache = new HashMap<KeyEntryID, CipherKeyEntry>();
  private final Map<KeyEntryID, CipherKeyEntry> cipherKeyEntryCache
       = new ConcurrentHashMap<KeyEntryID, CipherKeyEntry>();
  // The preferred cipher for the Directory Server.
  private final String preferredCipherTransformation;