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

Valery Kharseko
yesterday e333af0c8fbb8d69d79f420de01ce39dcade5930
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
@@ -392,6 +392,9 @@
                        requestedKeyWrappingTransformation));
        isAcceptable = false;
      }
      else if (!isKeyWrappingTransformationSupported(requestedKeyWrappingTransformation, unacceptableReasons)) {
        isAcceptable = false;
      }
      else {
        try {
          /* Note that the TrustStoreBackend not available at initial,
@@ -430,6 +433,29 @@
    return isAcceptable;
  }
  /**
   * Checks that this Java runtime provides the key wrapping transformation. Only a refusal here
   * names the key-wrapping-transformation property: the wrap which follows it also needs an MD5
   * digest and a 1024-bit RSA key, and changing the property does not help when one of those is
   * what the runtime refuses.
   */
  private static boolean isKeyWrappingTransformationSupported(
      final String transformation, final List<LocalizableMessage> unacceptableReasons)
  {
    try
    {
      Cipher.getInstance(transformation);
      return true;
    }
    catch (GeneralSecurityException ex)
    {
      logger.traceException(ex);
      unacceptableReasons.add(
          ERR_CRYPTOMGR_KEY_WRAPPING_TRANSFORMATION_UNSUPPORTED.get(transformation, getExceptionMessage(ex)));
      return false;
    }
  }
  @Override
  public ConfigChangeResult applyConfigurationChange(CryptoManagerCfg cfg)
  {