diff options
author | Adam Young <ayoung@redhat.com> | 2011-11-10 22:12:52 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-12-06 11:20:03 -0500 |
commit | 6119a0222dee4953d51311489d8863daa62d9b14 (patch) | |
tree | dc30408d3be499e1f84c1c49d41bbc109731fb7a /pki/base/common/src/com/netscape/cms | |
parent | 3c1a4af339dc1761b3a68abe9b0f26bd3cb389cf (diff) | |
download | pki-6119a0222dee4953d51311489d8863daa62d9b14.tar.gz pki-6119a0222dee4953d51311489d8863daa62d9b14.tar.xz pki-6119a0222dee4953d51311489d8863daa62d9b14.zip |
call statics statically
https://bugzilla.redhat.com/show_bug.cgi?id=728303
Updated with changes from code review
Leaving in the warning in GenericASN1Extension, ans that is an indication of a real problem, which will get addressed in a separate patch.
Diffstat (limited to 'pki/base/common/src/com/netscape/cms')
13 files changed, 82 insertions, 86 deletions
diff --git a/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java b/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java index 59116bd91..70be18a61 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java @@ -652,7 +652,7 @@ class CertRecProcessor implements IElementProcessor { numFailCounted = true; if (mJob.mSummary == true) mJob.buildItemParams(IEmailFormProcessor.TOKEN_STATUS, - mJob.STATUS_FAILURE); + AJobBase.STATUS_FAILURE); mJob.log(ILogger.LL_FAILURE, CMS.getLogMessage("JOBS_GET_CERT_ERROR", cr.getCertificate().getSerialNumber().toString(16))); @@ -693,13 +693,13 @@ class CertRecProcessor implements IElementProcessor { cr); mJob.buildItemParams(IEmailFormProcessor.TOKEN_STATUS, - mJob.STATUS_SUCCESS); + AJobBase.STATUS_SUCCESS); mIC.mNumSuccessful++; } catch (Exception e) { CMS.debug("RenewalNotificationJob Exception: "+e.toString()); - mJob.buildItemParams(IEmailFormProcessor.TOKEN_STATUS, mJob.STATUS_FAILURE); + mJob.buildItemParams(IEmailFormProcessor.TOKEN_STATUS, AJobBase.STATUS_FAILURE); mJob.log(ILogger.LL_FAILURE, e.toString(), ILogger.L_MULTILINE); if (numFailCounted == false) { mIC.mNumFail++; diff --git a/pki/base/common/src/com/netscape/cms/logging/LogFile.java b/pki/base/common/src/com/netscape/cms/logging/LogFile.java index b3adeb991..284ff02d7 100644 --- a/pki/base/common/src/com/netscape/cms/logging/LogFile.java +++ b/pki/base/common/src/com/netscape/cms/logging/LogFile.java @@ -673,8 +673,7 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo { * Retrieves the log on/off. */ public String getOn() { - String logStatus = null; - return logStatus.valueOf( mOn ); + return String.valueOf( mOn ); } /** @@ -1399,7 +1398,6 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo { Vector v = new Vector(); try { - String logStatus = null; if (mType == null) { v.addElement(PROP_TYPE + "="); @@ -1407,7 +1405,7 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo { v.addElement(PROP_TYPE + "=" + mConfig.getString(PROP_TYPE)); } - v.addElement(PROP_ON + "=" + logStatus.valueOf( mOn ) ); + v.addElement(PROP_ON + "=" + String.valueOf( mOn ) ); if (mLevel == 0) v.addElement(PROP_LEVEL + "=" + ILogger.LL_DEBUG_STRING); else if (mLevel == 1) @@ -1433,10 +1431,8 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo { v.addElement(PROP_FLUSH_INTERVAL + "=" + mFlushInterval / 1000); if( (mType != null) && mType.equals( ILogger.PROP_SIGNED_AUDIT ) ) { - String logSigning = null; - v.addElement( PROP_SIGNED_AUDIT_LOG_SIGNING + "=" - + logSigning.valueOf( mLogSigning ) ); + + String.valueOf( mLogSigning ) ); if( mSAuditCertNickName == null ) { v.addElement( PROP_SIGNED_AUDIT_CERT_NICKNAME + "=" ); diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java index eea0b29df..1cd3240fb 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java @@ -259,8 +259,8 @@ public class CAAdminServlet extends AdminServlet { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mCA.PROP_CERT_REVOKED_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); + IConfigStore rc = nc.getSubStore(ICertificateAuthority.PROP_CERT_REVOKED_SUBSTORE); getNotificationCompConfig(req, resp, rc); } @@ -271,8 +271,8 @@ public class CAAdminServlet extends AdminServlet { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mCA.PROP_CERT_ISSUED_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); + IConfigStore rc = nc.getSubStore(ICertificateAuthority.PROP_CERT_ISSUED_SUBSTORE); getNotificationCompConfig(req, resp, rc); } @@ -288,9 +288,9 @@ public class CAAdminServlet extends AdminServlet { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore riq = nc.getSubStore(mCA.PROP_REQ_IN_Q_SUBSTORE); + IConfigStore riq = nc.getSubStore(ICertificateAuthority.PROP_REQ_IN_Q_SUBSTORE); Enumeration e = req.getParameterNames(); @@ -321,9 +321,9 @@ public class CAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore riq = nc.getSubStore(mCA.PROP_REQ_IN_Q_SUBSTORE); + IConfigStore riq = nc.getSubStore(ICertificateAuthority.PROP_REQ_IN_Q_SUBSTORE); //set rest of the parameters Enumeration e = req.getParameterNames(); @@ -433,9 +433,9 @@ public class CAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mCA.PROP_CERT_REVOKED_SUBSTORE); + IConfigStore rc = nc.getSubStore(ICertificateAuthority.PROP_CERT_REVOKED_SUBSTORE); setNotificationCompConfig(req, resp, rc, mCA.getCertRevokedListener()); } @@ -445,9 +445,9 @@ public class CAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mCA.getConfigStore(); IConfigStore nc = - config.getSubStore(mCA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mCA.PROP_CERT_ISSUED_SUBSTORE); + IConfigStore rc = nc.getSubStore(ICertificateAuthority.PROP_CERT_ISSUED_SUBSTORE); setNotificationCompConfig(req, resp, rc, mCA.getCertIssuedListener()); @@ -586,7 +586,7 @@ public class CAAdminServlet extends AdminServlet { } IConfigStore crlSubStore = - mCA.getConfigStore().getSubStore(mCA.PROP_CRL_SUBSTORE); + mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); Enumeration crlNames = crlSubStore.getSubStoreNames(); while (crlNames.hasMoreElements()) { @@ -741,7 +741,7 @@ public class CAAdminServlet extends AdminServlet { } IConfigStore crlSubStore = - mCA.getConfigStore().getSubStore(mCA.PROP_CRL_SUBSTORE); + mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); boolean done = false; Enumeration crlNames = crlSubStore.getSubStoreNames(); @@ -859,7 +859,7 @@ public class CAAdminServlet extends AdminServlet { if (id != null && id.length() > 0) { IConfigStore crlSubStore = - mCA.getConfigStore().getSubStore(mCA.PROP_CRL_SUBSTORE); + mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); boolean done = false; Enumeration crlNames = crlSubStore.getSubStoreNames(); @@ -1007,10 +1007,10 @@ public class CAAdminServlet extends AdminServlet { IConfigStore config = mCA.getConfigStore(); IConfigStore crlsSubStore = - config.getSubStore(mCA.PROP_CRL_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); IConfigStore crlSubStore = crlsSubStore.getSubStore(ipId); IConfigStore crlExtsSubStore = - crlSubStore.getSubStore(mCA.PROP_CRLEXT_SUBSTORE); + crlSubStore.getSubStore(ICertificateAuthority.PROP_CRLEXT_SUBSTORE); String id = req.getParameter(Constants.RS_ID); @@ -1099,13 +1099,13 @@ public class CAAdminServlet extends AdminServlet { String id = req.getParameter(Constants.PR_ID); if (id == null || id.length() <= 0) { - id = mCA.PROP_MASTER_CRL; + id = ICertificateAuthority.PROP_MASTER_CRL; } IConfigStore config = mCA.getConfigStore(); - IConfigStore crlsSubStore = config.getSubStore(mCA.PROP_CRL_SUBSTORE); + IConfigStore crlsSubStore = config.getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); IConfigStore crlSubStore = crlsSubStore.getSubStore(id); - IConfigStore crlExtsSubStore = crlSubStore.getSubStore(mCA.PROP_CRLEXT_SUBSTORE); + IConfigStore crlExtsSubStore = crlSubStore.getSubStore(ICertificateAuthority.PROP_CRLEXT_SUBSTORE); if (crlExtsSubStore != null) { Enumeration enumExts = crlExtsSubStore.getSubStoreNames(); @@ -1216,13 +1216,13 @@ public class CAAdminServlet extends AdminServlet { if (id == null || id.length() <= 0 || id.equals(Constants.RS_ID_CONFIG)) { - id = mCA.PROP_MASTER_CRL; + id = ICertificateAuthority.PROP_MASTER_CRL; } ICRLIssuingPoint ip = mCA.getCRLIssuingPoint(id); //Save New Settings to the config file IConfigStore config = mCA.getConfigStore(); - IConfigStore crlsSubStore = config.getSubStore(mCA.PROP_CRL_SUBSTORE); + IConfigStore crlsSubStore = config.getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); IConfigStore crlSubStore = crlsSubStore.getSubStore(id); //set reset of the parameters @@ -1310,10 +1310,10 @@ public class CAAdminServlet extends AdminServlet { if (id == null || id.length() <= 0 || id.equals(Constants.RS_ID_CONFIG)) { - id = mCA.PROP_MASTER_CRL; + id = ICertificateAuthority.PROP_MASTER_CRL; } IConfigStore crlsSubStore = - mCA.getConfigStore().getSubStore(mCA.PROP_CRL_SUBSTORE); + mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); IConfigStore crlSubStore = crlsSubStore.getSubStore(id); Enumeration e = req.getParameterNames(); @@ -1479,7 +1479,7 @@ public class CAAdminServlet extends AdminServlet { IConfigStore caConfig = mCA.getConfigStore(); - value = caConfig.getString(mCA.PROP_ENABLE_PAST_CATIME, "false"); + value = caConfig.getString(ICertificateAuthority.PROP_ENABLE_PAST_CATIME, "false"); params.add(Constants.PR_VALIDITY, value); getSigningAlgConfig(params); diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java index 78b88fd82..9464f48ff 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java @@ -422,8 +422,8 @@ public class OCSPAdminServlet extends AdminServlet { throws ServletException, IOException, EBaseException { NameValuePairs params = new NameValuePairs(); IConfigStore config = mOCSP.getConfigStore(); - String defStore = config.getString(mOCSP.PROP_DEF_STORE_ID); - IConfigStore SubStore = config.getSubStore(mOCSP.PROP_STORE); + String defStore = config.getString(IOCSPAuthority.PROP_DEF_STORE_ID); + IConfigStore SubStore = config.getSubStore(IOCSPAuthority.PROP_STORE); Enumeration enumStores = SubStore.getSubStoreNames(); while (enumStores.hasMoreElements()) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java index 24fffd8b8..35bbb91aa 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java @@ -215,9 +215,9 @@ public class RAAdminServlet extends AdminServlet { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mRA.PROP_CERT_ISSUED_SUBSTORE); + IConfigStore rc = nc.getSubStore(IRegistrationAuthority.PROP_CERT_ISSUED_SUBSTORE); getNotificationCompConfig(req, resp, rc); @@ -229,9 +229,9 @@ public class RAAdminServlet extends AdminServlet { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mRA.PROP_CERT_REVOKED_SUBSTORE); + IConfigStore rc = nc.getSubStore(IRegistrationAuthority.PROP_CERT_REVOKED_SUBSTORE); getNotificationCompConfig(req, resp, rc); @@ -248,9 +248,9 @@ public class RAAdminServlet extends AdminServlet { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore riq = nc.getSubStore(mRA.PROP_REQ_IN_Q_SUBSTORE); + IConfigStore riq = nc.getSubStore(IRegistrationAuthority.PROP_REQ_IN_Q_SUBSTORE); Enumeration e = req.getParameterNames(); @@ -282,9 +282,9 @@ public class RAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore riq = nc.getSubStore(mRA.PROP_REQ_IN_Q_SUBSTORE); + IConfigStore riq = nc.getSubStore(IRegistrationAuthority.PROP_REQ_IN_Q_SUBSTORE); //set rest of the parameters Enumeration e = req.getParameterNames(); @@ -359,9 +359,9 @@ public class RAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mRA.PROP_CERT_ISSUED_SUBSTORE); + IConfigStore rc = nc.getSubStore(IRegistrationAuthority.PROP_CERT_ISSUED_SUBSTORE); setNotificationCompConfig(req, resp, rc, mRA.getCertIssuedListener()); @@ -372,9 +372,9 @@ public class RAAdminServlet extends AdminServlet { IOException, EBaseException { IConfigStore config = mRA.getConfigStore(); IConfigStore nc = - config.getSubStore(mRA.PROP_NOTIFY_SUBSTORE); + config.getSubStore(IRegistrationAuthority.PROP_NOTIFY_SUBSTORE); - IConfigStore rc = nc.getSubStore(mRA.PROP_CERT_REVOKED_SUBSTORE); + IConfigStore rc = nc.getSubStore(IRegistrationAuthority.PROP_CERT_REVOKED_SUBSTORE); setNotificationCompConfig(req, resp, rc, mRA.getCertRevokedListener()); } diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetEnableStatus.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetEnableStatus.java index 5ac681106..8b5536ea8 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetEnableStatus.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetEnableStatus.java @@ -145,7 +145,7 @@ public class GetEnableStatus extends CMSServlet { IAuthSubsystem authSS = (IAuthSubsystem) CMS.getSubsystem(CMS.SUBSYSTEM_AUTH); IAuthManager authMgr = authSS.get(val); HashAuthentication mgr = (HashAuthentication) authMgr; - long timeout = mgr.DEFAULT_TIMEOUT / 1000; + long timeout = HashAuthentication.DEFAULT_TIMEOUT / 1000; header.addStringValue("timeout", "" + timeout); header.addStringValue("reqHost", reqHost); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java index 5b6b02fa2..9d83d430c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java @@ -303,9 +303,9 @@ CMS.debug("*** formFile = "+formFile); if (recentChanges.length() > 0) recentChanges += "+"; - if (ip.isCRLUpdateInProgress() == ip.CRL_PUBLISHING_STARTED) { + if (ip.isCRLUpdateInProgress() == ICRLIssuingPoint.CRL_PUBLISHING_STARTED) { recentChanges += "Publishing CRL #" + ip.getCRLNumber(); - } else if (ip.isCRLUpdateInProgress() == ip.CRL_UPDATE_STARTED) { + } else if (ip.isCRLUpdateInProgress() == ICRLIssuingPoint.CRL_UPDATE_STARTED) { recentChanges += "Creating CRL #" + ip.getNextCRLNumber(); } else { // ip.CRL_UPDATE_DONE recentChanges += ip.getNumberOfRecentlyRevokedCerts() + ", " + @@ -345,8 +345,8 @@ CMS.debug("*** formFile = "+formFile); header.addStringValue("master_host", masterHost); header.addStringValue("master_port", masterPort); - header.addStringValue("masterCRLIssuingPoint", mCA.PROP_MASTER_CRL); - ICRLIssuingPoint ip0 = mCA.getCRLIssuingPoint(mCA.PROP_MASTER_CRL); + header.addStringValue("masterCRLIssuingPoint", ICertificateAuthority.PROP_MASTER_CRL); + ICRLIssuingPoint ip0 = mCA.getCRLIssuingPoint(ICertificateAuthority.PROP_MASTER_CRL); if (ip0 != null) { header.addStringValue("defaultAlgorithm", ip0.getSigningAlgorithm()); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java b/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java index 1047c97c3..396f333bc 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java @@ -325,7 +325,7 @@ public class UpdateCRL extends CMSServlet { } } if (crlIssuingPointId == null) { - crlIssuingPointId = mCA.PROP_MASTER_CRL; + crlIssuingPointId = ICertificateAuthority.PROP_MASTER_CRL; } ICRLIssuingPoint crlIssuingPoint = diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java index 1222621de..79151072d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java @@ -882,7 +882,7 @@ protected IProfileSubsystem mProfileSubsystem = null; CMS.debug(e); throw new ServletException("Could not decode the request."); } - crsResp.setMessageType(crsResp.mType_CertRep); + crsResp.setMessageType(CRSPKIMessage.mType_CertRep); // Create a new crypto context for doing all the crypto operations cx = new CryptoContext(); @@ -925,7 +925,7 @@ protected IProfileSubsystem mProfileSubsystem = null; } // now run appropriate code, depending on message type - if (mt.equals(req.mType_PKCSReq)) { + if (mt.equals(CRSPKIMessage.mType_PKCSReq)) { CMS.debug("Processing PKCSReq"); try { // Check if there is an existing request. If this returns non-null, @@ -949,7 +949,7 @@ protected IProfileSubsystem mProfileSubsystem = null; throw new ServletException("Couldn't handle CEP request (PKCSReq) - "+e.getMessage()); } } - else if (mt.equals(req.mType_GetCertInitial)) { + else if (mt.equals(CRSPKIMessage.mType_GetCertInitial)) { CMS.debug("Processing GetCertInitial"); cert = handleGetCertInitial(req,crsResp); } else { @@ -962,7 +962,7 @@ protected IProfileSubsystem mProfileSubsystem = null; catch (CRSInvalidSignatureException e) { CMS.debug("handlePKIMessage exception " + e); CMS.debug(e); - crsResp.setFailInfo(crsResp.mFailInfo_badMessageCheck); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badMessageCheck); } catch (Exception e) { CMS.debug("handlePKIMessage exception " + e); @@ -1064,8 +1064,8 @@ protected IProfileSubsystem mProfileSubsystem = null; } if (foundRequest == null) { - resp.setFailInfo(resp.mFailInfo_badCertId); - resp.setPKIStatus(resp.mStatus_FAILURE); + resp.setFailInfo(CRSPKIMessage.mFailInfo_badCertId); + resp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); return null; } @@ -1203,8 +1203,8 @@ private void getDetailFromRequest(CRSPKIMessage req, CRSPKIMessage crsResp) PKCS10 p10 = (PKCS10)req.getP10(); if (p10 == null) { - crsResp.setFailInfo(crsResp.mFailInfo_badMessageCheck); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badMessageCheck); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); throw new CRSFailureException("Failed to decode pkcs10 from CEP request"); } @@ -1389,8 +1389,8 @@ private void getDetailFromRequest(CRSPKIMessage req, CRSPKIMessage crsResp) req.put(CERTINFO, certInfo); } catch (Exception e) { - crsResp.setFailInfo(crsResp.mFailInfo_badMessageCheck); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badMessageCheck); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); return ; } // NEED TO FIX } @@ -1532,8 +1532,8 @@ private void getDetailFromRequest(CRSPKIMessage req, CRSPKIMessage crsResp) else { CMS.debug("duplicated transaction id"); log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSGW_ENROLL_FAIL_DUP_TRANS_ID")); - crsResp.setFailInfo(crsResp.mFailInfo_badRequest); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badRequest); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); return null; } } @@ -1544,8 +1544,8 @@ private void getDetailFromRequest(CRSPKIMessage req, CRSPKIMessage crsResp) if (authFailed) { CMS.debug("authentication failed"); log(ILogger.LL_SECURITY, CMS.getLogMessage("CMSGW_ENROLL_FAIL_NO_AUTH")); - crsResp.setFailInfo(crsResp.mFailInfo_badIdentity); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badIdentity); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); // perform audit log @@ -1576,14 +1576,14 @@ private void getDetailFromRequest(CRSPKIMessage req, CRSPKIMessage crsResp) CMS.debug("failed to decrypt the request " + e); log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSGW_ENROLL_FAIL_NO_DECRYPT_PKCS10", e.getMessage())); - crsResp.setFailInfo(crsResp.mFailInfo_badMessageCheck); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badMessageCheck); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); } catch (EBaseException e) { CMS.debug("operation failure - " + e); log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSGW_ERNOLL_FAIL_NO_NEW_REQUEST_POSTED", e.getMessage())); - crsResp.setFailInfo(crsResp.mFailInfo_internalCAError); - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_internalCAError); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); } return null; } @@ -1743,7 +1743,7 @@ throws EBaseException { rq.processRequest(pkiReq); - crsResp.setPKIStatus(crsResp.mStatus_SUCCESS); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_SUCCESS); mLogger.log(ILogger.EV_AUDIT, ILogger.S_OTHER, AuditFormat.LEVEL, @@ -1807,7 +1807,7 @@ throws EBaseException { } else { CMS.debug("CRSEnrollment: Found certificate"); } - crsResp.setPKIStatus(crsResp.mStatus_SUCCESS); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_SUCCESS); return cert; } @@ -1827,22 +1827,22 @@ throws EBaseException { return null; } issuedCert = issuedCertBuf[0]; - crsResp.setPKIStatus(crsResp.mStatus_SUCCESS); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_SUCCESS); } else { // status is not 'success' - there must've been a problem - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); - crsResp.setFailInfo(crsResp.mFailInfo_badAlg); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badAlg); } } else if (status.equals(RequestStatus.REJECTED_STRING) || status.equals(RequestStatus.CANCELED_STRING)) { - crsResp.setPKIStatus(crsResp.mStatus_FAILURE); - crsResp.setFailInfo(crsResp.mFailInfo_badRequest); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_FAILURE); + crsResp.setFailInfo(CRSPKIMessage.mFailInfo_badRequest); } else { // not complete - crsResp.setPKIStatus(crsResp.mStatus_PENDING); + crsResp.setPKIStatus(CRSPKIMessage.mStatus_PENDING); } return issuedCert; diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/RecoverBySerial.java b/pki/base/common/src/com/netscape/cms/servlet/key/RecoverBySerial.java index b39b3aa69..edcd2bdf6 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/RecoverBySerial.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/RecoverBySerial.java @@ -238,7 +238,7 @@ public class RecoverBySerial extends CMSServlet { header.addStringValue(OUT_ERROR, CMS.getUserMessage(locale[0], "CMS_BASE_INTERNAL_ERROR", e.toString())); } finally { - ctx.releaseContext(); + SessionContext.releaseContext(); } // return status page diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/OCSPServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/OCSPServlet.java index d1742f2fa..cfc919750 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/OCSPServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/OCSPServlet.java @@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; +import java.net.URLDecoder; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -122,9 +123,8 @@ public class OCSPServlet extends CMSServlet { CMS.debug("Servlet Path=" + httpReq.getServletPath()); CMS.debug("RequestURI=" + httpReq.getRequestURI()); String pathInfo = httpReq.getPathInfo(); - java.net.URLDecoder urldecoder = new java.net.URLDecoder(); if (pathInfo != null && pathInfo.indexOf('%') != -1) { - pathInfo = urldecoder.decode(pathInfo); + pathInfo = URLDecoder.decode(pathInfo); } CMS.debug("PathInfo=" + pathInfo); diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java index 0787ebb44..b00b13a9d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java @@ -809,7 +809,7 @@ profile, IRequest req) { error_codes); } } finally { - context.releaseContext(); + SessionContext.releaseContext(); } } diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java index 8ca3b6f2d..184a82b2e 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java @@ -1457,7 +1457,7 @@ public class ProfileSubmitServlet extends ProfileServlet { } throw eAudit1; } finally { - context.releaseContext(); + SessionContext.releaseContext(); } if (statsSub != null) { statsSub.endTiming("enrollment"); |