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

dugan
03.10.2009 fb26edfd7275b479531d2cc1fb715e114622f11e
This fix prevents a null certificate from being passed into the MessageDigest digest() method. That method throws a NPE if the certificate is null. This fix is related to: Issue 3119 NPE when disabling referential integrity plugin.
2 files modified
17 ■■■■ changed files
opends/src/messages/messages/core.properties 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/crypto/CryptoManagerImpl.java 13 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/core.properties
@@ -1818,3 +1818,7 @@
registered with the network group '%s'
INFO_ERGONOMIC_SIZING_OF_WORKER_THREAD_POOL_720=No worker queue thread \
pool size specified: sizing automatically to use %d threads
SEVERE_ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL_721=CryptoManager \
failed to retrieve entry "%s" (the instance-key-pair public-key-certificate): \
The entry does not contain a public-key certificate
opends/src/server/org/opends/server/crypto/CryptoManagerImpl.java
@@ -489,11 +489,13 @@
   * from the ADS backed keystore). If the certificate entry does not
   * yet exist in the truststore backend, the truststore is signaled
   * to initialized that entry, and the newly generated certificate
   * is then retrieved and returned.
   * is then retrieved and returned. The certificate returned can never
   * be null.
   *
   * @return This instance's instance-key public-key certificate from
   * the local truststore backend.
   * @throws CryptoManagerException If the certificate cannot be
   * retrieved.
   * retrieved, or, was not able to be initialized by the trust-store.
   */
  static byte[] getInstanceKeyCertificateFromLocalTruststore()
          throws CryptoManagerException {
@@ -572,6 +574,13 @@
            ERR_CRYPTOMGR_FAILED_TO_RETRIEVE_INSTANCE_CERTIFICATE.get(
                    entryDN.toString(), getExceptionMessage(ex)), ex);
    }
    //The certificate can never be null. The Message digest code that will
    //use it later throws a NPE if the certificate is null.
    if(certificate == null) {
      Message msg =
        ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL.get(entryDN.toString());
        throw new CryptoManagerException(msg);
    }
    return(certificate);
  }