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

jvergara
12.14.2008 466627bf6d29a84a71825af598b7772f64f4b67b
Fix for issue 2923 (setup : nullpointer exception for null value on key store pin)

Just add some checks to verify that the provided password is not an empty string.
3 files modified
26 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/quicksetup.properties 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/quicksetup.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Portions Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2008 Sun Microsystems, Inc.
@@ -278,6 +278,10 @@
INFO_ERROR_ACCESSING_PKCS12_KEYSTORE=Could not access the PKCS#12 key store. \
 Check that the contents of the file correspond to a valid PKCS#12 key store, \
 that you have access rights to it and that the provided PIN is valid.
INFO_ERROR_NO_KEYSTORE_PASSWORD=You must provide the PIN of the keystore \
 to retrieve the certificate to be used by the server.
INFO_ERROR_EMPTY_KEYSTORE_PASSWORD=The provided PIN of the keystore is \
 empty.
INFO_ERROR_APPLY_LDIF_ADD=Error processing add operation of %s: %s
INFO_ERROR_APPLY_LDIF_DELETE=Error processing delete operation of %s: %s
INFO_ERROR_APPLY_LDIF_MODIFY=Error processing modification operation of %s: \
@@ -833,7 +837,6 @@
 is not a directory.
INFO_REVERT_ERROR_NULL_FILES_DIR=The specified reversion archive directory is \
 invalid or could not be determined.
INFO_REVERT_ERROR_NOT_REVERSION_FILES_DIR=The
INFO_REVERT_LAUNCHER_USAGE_DESCRIPTION=This utility reverts the current \
 installation of the Directory Server to a version prior to running the \
 upgrade utility.
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Portions Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2008 Sun Microsystems, Inc.
opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java
@@ -1622,7 +1622,18 @@
        errorWithPath = true;
      }
    }
    if (!errorWithPath)
    boolean pwdProvided = true;
    if (pwd == null)
    {
      pwdProvided = false;
      errorMessages.add(INFO_ERROR_NO_KEYSTORE_PASSWORD.get());
    }
    else if (pwd.length() == 0)
    {
      pwdProvided = false;
      errorMessages.add(INFO_ERROR_EMPTY_KEYSTORE_PASSWORD.get());
    }
    if (!errorWithPath && pwdProvided)
    {
      try
      {
@@ -1927,7 +1938,9 @@
          msg.getDescriptor().equals(INFO_PKCS11_KEYSTORE_DOES_NOT_EXIST) ||
          msg.getDescriptor().equals(INFO_ERROR_ACCESSING_JKS_KEYSTORE) ||
          msg.getDescriptor().equals(INFO_ERROR_ACCESSING_PKCS12_KEYSTORE) ||
          msg.getDescriptor().equals(INFO_ERROR_ACCESSING_PKCS11_KEYSTORE))
          msg.getDescriptor().equals(INFO_ERROR_ACCESSING_PKCS11_KEYSTORE) ||
          msg.getDescriptor().equals(INFO_ERROR_NO_KEYSTORE_PASSWORD) ||
          msg.getDescriptor().equals(INFO_ERROR_EMPTY_KEYSTORE_PASSWORD))
      {
        found = true;
        break;