summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2017-05-19 21:35:00 +0200
committerEndi S. Dewata <edewata@redhat.com>2017-05-20 00:30:07 +0200
commitf30be692453ccb323f874e5a751e2381cbb4ebb0 (patch)
tree7e65314352eed0287ef46cf4a2ae0b83e3b5392b /base
parente1fd9685e5442e5e2efa9a26e07bf45274b6fb93 (diff)
downloadpki-f30be692453ccb323f874e5a751e2381cbb4ebb0.tar.gz
pki-f30be692453ccb323f874e5a751e2381cbb4ebb0.tar.xz
pki-f30be692453ccb323f874e5a751e2381cbb4ebb0.zip
Added debug logs for JssSubsystem.
Some debug logs have been added into JssSubsystem to improve code clarity. https://pagure.io/dogtagpki/issue/2695 Change-Id: Ice54cf5cfe1eb4984509b83a1098cd69819e37bc
Diffstat (limited to 'base')
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java
index dab9ac91a..9031a9261 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/security/JssSubsystem.java
@@ -264,12 +264,15 @@ public final class JssSubsystem implements ICryptoSubsystem {
*/
public void init(ISubsystem owner, IConfigStore config)
throws EBaseException {
+
+ CMS.debug("JssSubsystem: initializing JSS subsystem");
+
mLogger = CMS.getLogger();
if (mInited) {
// This used to throw an exeception (e.g. - on Solaris).
// If JSS is already initialized simply return.
- CMS.debug("JssSubsystem already inited.. returning.");
+ CMS.debug("JssSubsystem: already initialized");
return;
}
@@ -277,9 +280,11 @@ public final class JssSubsystem implements ICryptoSubsystem {
// If disabled, just return
boolean enabled = config.getBoolean(PROP_ENABLE, true);
+ CMS.debug("JssSubsystem: enabled: " + enabled);
- if (!enabled)
+ if (!enabled) {
return;
+ }
try {
devRandomInputStream = new FileInputStream("/dev/urandom");
@@ -287,28 +292,28 @@ public final class JssSubsystem implements ICryptoSubsystem {
// XXX - add new exception
}
- // get hardcoded password (for debugging.
- String pw;
+ // get debugging password from config file
+ String pw = config.getString(PASSWORD_ALIAS, null);
- if ((pw = config.getString(PASSWORD_ALIAS, null)) != null) {
- // hardcoded password in config file
+ if (pw != null) {
+ CMS.debug("JssSubsystem: use debug password");
mPWCB = new Password(pw.toCharArray());
- CMS.debug("JssSubsystem init() got password from hardcoded in config");
}
- String certDir;
-
- certDir = config.getString(CONFIG_DIR, null);
+ String certDir = config.getString(CONFIG_DIR, null);
+ CMS.debug("JssSubsystem: NSS database: " + certDir);
CryptoManager.InitializationValues vals = new CryptoManager.InitializationValues(certDir, "", "", "secmod.db");
-
vals.removeSunProvider = false;
vals.installJSSProvider = true;
+
try {
+ CMS.debug("JssSubsystem: initializing CryptoManager");
CryptoManager.initialize(vals);
} catch (AlreadyInitializedException e) {
// do nothing
} catch (Exception e) {
+ CMS.debug(e);
String[] params = { mId, e.toString() };
EBaseException ex = new EBaseException(CMS.getUserMessage("CMS_BASE_CREATE_SERVICE_FAILED", params));
@@ -317,9 +322,11 @@ public final class JssSubsystem implements ICryptoSubsystem {
}
try {
+ CMS.debug("JssSubsystem: initializing SSL");
mCryptoManager = CryptoManager.getInstance();
initSSL();
} catch (CryptoManager.NotInitializedException e) {
+ CMS.debug(e);
String[] params = { mId, e.toString() };
EBaseException ex = new EBaseException(CMS.getUserMessage("CMS_BASE_CREATE_SERVICE_FAILED", params));
@@ -328,6 +335,8 @@ public final class JssSubsystem implements ICryptoSubsystem {
}
mInited = true;
+
+ CMS.debug("JssSubsystem: initialization complete");
}
public String getCipherVersion() throws EBaseException {