>From 6119a0222dee4953d51311489d8863daa62d9b14 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Thu, 10 Nov 2011 22:12:52 -0500 Subject: [PATCH] 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. --- pki/base/ca/src/com/netscape/ca/CAService.java | 10 ++-- .../ca/src/com/netscape/ca/CRLIssuingPoint.java | 8 ++-- .../src/com/netscape/ca/CertificateAuthority.java | 2 +- .../common/src/com/netscape/certsrv/apps/CMS.java | 4 +- .../netscape/cms/jobs/RenewalNotificationJob.java | 6 +- .../src/com/netscape/cms/logging/LogFile.java | 10 +--- .../netscape/cms/servlet/admin/CAAdminServlet.java | 50 +++++++++--------- .../cms/servlet/admin/OCSPAdminServlet.java | 4 +- .../netscape/cms/servlet/admin/RAAdminServlet.java | 24 +++++----- .../netscape/cms/servlet/cert/GetEnableStatus.java | 2 +- .../src/com/netscape/cms/servlet/cert/GetInfo.java | 8 ++-- .../com/netscape/cms/servlet/cert/UpdateCRL.java | 2 +- .../cms/servlet/cert/scep/CRSEnrollment.java | 52 ++++++++++---------- .../netscape/cms/servlet/key/RecoverBySerial.java | 2 +- .../com/netscape/cms/servlet/ocsp/OCSPServlet.java | 4 +- .../servlet/profile/ProfileSubmitCMCServlet.java | 2 +- .../cms/servlet/profile/ProfileSubmitServlet.java | 2 +- .../src/com/netscape/cmscore/apps/CMSEngine.java | 2 +- .../com/netscape/cmscore/apps/CommandQueue.java | 2 +- .../cmscore/base/JDialogPasswordCallback.java | 44 ++++++++-------- .../com/netscape/cmscore/jobs/JobsScheduler.java | 10 ++-- .../cmscore/ldapconn/LdapJssSSLSocketFactory.java | 3 +- .../netscape/cmscore/util/ProfileSubsystem.java | 9 ++- .../src/com/netscape/pkisilent/ConfigureCA.java | 4 +- .../src/com/netscape/pkisilent/ConfigureDRM.java | 4 +- .../src/com/netscape/pkisilent/ConfigureOCSP.java | 4 +- .../src/com/netscape/pkisilent/ConfigureRA.java | 4 +- .../src/com/netscape/pkisilent/ConfigureSubCA.java | 4 +- .../src/com/netscape/pkisilent/ConfigureTKS.java | 4 +- .../src/com/netscape/pkisilent/ConfigureTPS.java | 4 +- .../src/com/netscape/pkisilent/common/CMSTask.java | 2 +- .../com/netscape/pkisilent/http/HTTPClient.java | 6 +- .../com/netscape/cmsutil/crypto/CryptoUtil.java | 4 +- .../netscape/cmsutil/http/JssSSLSocketFactory.java | 3 +- .../util/src/netscape/security/pkcs/PKCS8Key.java | 12 ++-- .../security/x509/CRLDistributionPoint.java | 6 +- .../x509/IssuingDistributionPointExtension.java | 6 +- 37 files changed, 164 insertions(+), 165 deletions(-) diff --git a/pki/base/ca/src/com/netscape/ca/CAService.java b/pki/base/ca/src/com/netscape/ca/CAService.java index 9297d421c5b9227ab496ad0aeeb80d0fba43d6cb..159539d453b78c9a89a3a3cc571f743459b95f17 100644 --- a/pki/base/ca/src/com/netscape/ca/CAService.java +++ b/pki/base/ca/src/com/netscape/ca/CAService.java @@ -1422,7 +1422,7 @@ class serviceRenewal implements IServant { if (metaInfo != null) { String renewed = (String) - metaInfo.get(certRecord.META_RENEWED_CERT); + metaInfo.get(ICertRecord.META_RENEWED_CERT); if (renewed != null) { BigInteger serial = new BigInteger(renewed); @@ -1891,7 +1891,7 @@ class serviceGetCRL implements IServant { throws EBaseException { try { ICRLIssuingPointRecord crlRec = - (ICRLIssuingPointRecord) mCA.getCRLRepository().readCRLIssuingPointRecord(mCA.PROP_MASTER_CRL); + (ICRLIssuingPointRecord) mCA.getCRLRepository().readCRLIssuingPointRecord(ICertificateAuthority.PROP_MASTER_CRL); X509CRLImpl crl = new X509CRLImpl(crlRec.getCRL()); request.setExtData(IRequest.CRL, crl.getEncoded()); @@ -1900,14 +1900,14 @@ class serviceGetCRL implements IServant { throw new ECAException( CMS.getUserMessage("CMS_CA_CRL_ISSUEPT_NOT_FOUND", e.toString())); } catch (CRLException e) { - mCA.log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_GETCRL_INST_CRL", mCA.PROP_MASTER_CRL)); + mCA.log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_GETCRL_INST_CRL", ICertificateAuthority.PROP_MASTER_CRL)); throw new ECAException( - CMS.getUserMessage("CMS_CA_CRL_ISSUEPT_NOGOOD", mCA.PROP_MASTER_CRL)); + CMS.getUserMessage("CMS_CA_CRL_ISSUEPT_NOGOOD", ICertificateAuthority.PROP_MASTER_CRL)); } catch (X509ExtensionException e) { mCA.log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_GETCRL_NO_ISSUING_REC")); throw new ECAException( CMS.getUserMessage("CMS_CA_CRL_ISSUEPT_EXT_NOGOOD", - mCA.PROP_MASTER_CRL)); + ICertificateAuthority.PROP_MASTER_CRL)); } return true; } diff --git a/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java b/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java index f02d0905bd7030c7a15bc9fbc395172e687f5c4d..e939d03e64ece0636a947999f0b7d24d897e4ed1 100644 --- a/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java +++ b/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java @@ -449,8 +449,8 @@ public class CRLIssuingPoint implements ICRLIssuingPoint, Runnable { mConfigStore = config; - IConfigStore crlSubStore = mCA.getConfigStore().getSubStore(mCA.PROP_CRL_SUBSTORE); - mPageSize = crlSubStore.getInteger(mCA.PROP_CRL_PAGE_SIZE, CRL_PAGE_SIZE); + IConfigStore crlSubStore = mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); + mPageSize = crlSubStore.getInteger(ICertificateAuthority.PROP_CRL_PAGE_SIZE, CRL_PAGE_SIZE); CMS.debug("CRL Page Size: "+ mPageSize); mCountMod = config.getInteger("countMod",0); @@ -1154,10 +1154,10 @@ public class CRLIssuingPoint implements ICRLIssuingPoint, Runnable { if(onlyContainsCACerts != mCACertsOnly) { IConfigStore config = mCA.getConfigStore(); IConfigStore crlsSubStore = - config.getSubStore(mCA.PROP_CRL_SUBSTORE); + config.getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE); IConfigStore crlSubStore = crlsSubStore.getSubStore(mId); IConfigStore crlExtsSubStore = - crlSubStore.getSubStore(mCA.PROP_CRLEXT_SUBSTORE); + crlSubStore.getSubStore(ICertificateAuthority.PROP_CRLEXT_SUBSTORE); crlExtsSubStore = crlExtsSubStore.getSubStore(IssuingDistributionPointExtension.NAME); if(crlExtsSubStore != null) { diff --git a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java index d8130b02239b83d9b3c423de1b7ccbb3093cf2e4..5353b019ec54954df0fe60f84f26407f4293984c 100644 --- a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -491,7 +491,7 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori * check if the ca is a clone. */ public boolean isClone() { - if (mService.mCLAConnector != null) + if (CAService.mCLAConnector != null) return true; else return false; diff --git a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java index 8136c0b39816d47fd243e161b18a735bb5ad78b5..137a609f1a305723d9ebb1bb7277c629ab99ccae 100644 --- a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java +++ b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java @@ -1563,8 +1563,8 @@ public final class CMS { cms = new CMS(engine); IConfigStore mainConfig = createFileConfigStore(path); - cms.init(null, mainConfig); - cms.startup(); + CMS.init(null, mainConfig); + CMS.startup(); } catch (EBaseException e) { // catch everything here purposely CMS.debug("CMS:Caught EBaseException"); 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 59116bd911407905fb14e9eb417a35ef9d4c227f..70be18a619eb88a9ce965e12e0204de3f1318968 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 b3adeb991180262ad26846226b79525ba97330ef..284ff02d7c30f72e0f8386bc0af31c0f7258304f 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 eea0b29df8a61565293621a6cffcee2738cb5d5e..1cd3240fbe9e4d7ba6cfcfcd2c0bf5486345241f 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 78b88fd82ec447746ac7c2890115916acc15dbfb..9464f48ff879278c98a711e29cfe5b9d3f96c80e 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 24fffd8b88ee0f22d09130901bc90d15f86ad63f..35bbb91aae0fbbe58fcf81c57048a880c1721d66 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 5ac681106896105e3a564bd57fb4d4ca9e8519dd..8b5536ea8e6d9fb46f4a11f458db822aaee54b77 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 5b6b02fa24bf2a67b74ba862073e14fda7abeb8f..9d83d430c88e2854d0883154e9b138b4c11912c9 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 1047c97c3b11a3fd39a7fcea5c08a86e0e0bd122..396f333bcc114d9698cac2f4807f8bfed0d68000 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 1222621decc75600ce4c5c36afee81272701fc58..79151072d3227a47c3ad76b539a3fc8469748c1c 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 b39b3aa69362fb699550f0a48718c6cce7caa698..edcd2bdf6513188df0e06dc5d525e200d11a55ec 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 d1742f2fa74e6622793d90d964854b212f837e01..cfc9197506350d4042ff1880c95396232b654a36 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 0787ebb44e83a5f9a07bb8e5a469815765334b64..b00b13a9d4cf82d17c1ba2dabb39b5e2c03d9578 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 8ca3b6f2d759df1fbecfa7cd4167562c91a5c3ff..184a82b2e71a6150b763a013abd6fe89237777c0 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"); diff --git a/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java index 92331a20d90aa606377620777f580d5ffd37a458..59b38712793fc2cf41e7ff168b33be9ccac2e06a 100644 --- a/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java +++ b/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java @@ -1644,7 +1644,7 @@ public class CMSEngine implements ICMSEngine { while (t1.isAlive() && ((timeOut - startTime) < (60 * 1000))) //wait for 1 minute { try { - Thread.currentThread().sleep(5000); // sleep for 5 sec + Thread.sleep(5000); // sleep for 5 sec }catch (java.lang.InterruptedException e) { } timeOut = time.getTime(); diff --git a/pki/base/common/src/com/netscape/cmscore/apps/CommandQueue.java b/pki/base/common/src/com/netscape/cmscore/apps/CommandQueue.java index e9f1f77aa8fb7f963c90bdecef7d40953fe1079a..5a4dd6fb885b64c67ea29f9a8cad31042a2361f1 100644 --- a/pki/base/common/src/com/netscape/cmscore/apps/CommandQueue.java +++ b/pki/base/common/src/com/netscape/cmscore/apps/CommandQueue.java @@ -62,7 +62,7 @@ public class CommandQueue implements Runnable, ICommandQueue { mShuttingDown = true; while (mCommandQueue.isEmpty() == false) { try { - Thread.currentThread().sleep(5 * 1000); + Thread.sleep(5 * 1000); //gcProcess(); } catch (Exception e) { diff --git a/pki/base/common/src/com/netscape/cmscore/base/JDialogPasswordCallback.java b/pki/base/common/src/com/netscape/cmscore/base/JDialogPasswordCallback.java index 2a7a1ef23b51858580ff5ff1d1bb4bbe20e448ef..cd6959676fcba391436663c920ed44c1a37b288d 100644 --- a/pki/base/common/src/com/netscape/cmscore/base/JDialogPasswordCallback.java +++ b/pki/base/common/src/com/netscape/cmscore/base/JDialogPasswordCallback.java @@ -68,12 +68,12 @@ public class JDialogPasswordCallback implements PasswordCallback { } private void resetGBC(GridBagConstraints gbc) { - gbc.gridx = gbc.RELATIVE; - gbc.gridy = gbc.RELATIVE; + gbc.gridx = GridBagConstraints.RELATIVE; + gbc.gridy = GridBagConstraints.RELATIVE; gbc.gridwidth = 1; gbc.gridheight = 1; - gbc.fill = gbc.HORIZONTAL; - gbc.anchor = gbc.CENTER; + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.anchor = GridBagConstraints.CENTER; gbc.ipadx = 0; gbc.ipady = 0; gbc.weightx = 0.0; @@ -115,8 +115,8 @@ public class JDialogPasswordCallback implements PasswordCallback { warning.setForeground(Color.red); resetGBC(c); - c.anchor = c.NORTHWEST; - c.gridwidth = c.REMAINDER; + c.anchor = GridBagConstraints.NORTHWEST; + c.gridwidth = GridBagConstraints.REMAINDER; // Setting this to NULL causes nasty Exception stack traces // to be printed, although the program still seems to work //warning.setHighlighter(null); @@ -131,8 +131,8 @@ public class JDialogPasswordCallback implements PasswordCallback { // to be printed, although the program still seems to work //label.setHighlighter(null); resetGBC(c); - c.anchor = c.NORTHWEST; - c.gridwidth = c.REMAINDER; + c.anchor = GridBagConstraints.NORTHWEST; + c.gridwidth = GridBagConstraints.REMAINDER; contentPane.add(label, c); /////////////////////////////////////////////////// @@ -163,10 +163,10 @@ public class JDialogPasswordCallback implements PasswordCallback { pwField.setEchoChar('*'); pwField.addActionListener(getPasswordListener); resetGBC(c); - c.anchor = c.CENTER; - c.fill = c.NONE; + c.anchor = GridBagConstraints.CENTER; + c.fill = GridBagConstraints.NONE; c.insets = new Insets(16, 0, 0, 0); - c.gridwidth = c.REMAINDER; + c.gridwidth = GridBagConstraints.REMAINDER; //c.gridy++; contentPane.add(pwField, c); @@ -180,9 +180,9 @@ public class JDialogPasswordCallback implements PasswordCallback { ok.addActionListener(getPasswordListener); resetGBC(c); - c.fill = c.NONE; - c.anchor = c.CENTER; - c.gridheight = c.REMAINDER; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; + c.gridheight = GridBagConstraints.REMAINDER; c.insets = new Insets(10, 0, 0, 4); buttonPanel.add(ok, c); @@ -196,18 +196,18 @@ public class JDialogPasswordCallback implements PasswordCallback { cancel.addActionListener(buttonListener); resetGBC(c); - c.fill = c.NONE; - c.anchor = c.CENTER; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(10, 4, 0, 0); - c.gridheight = c.REMAINDER; - c.gridwidth = c.REMAINDER; + c.gridheight = GridBagConstraints.REMAINDER; + c.gridwidth = GridBagConstraints.REMAINDER; buttonPanel.add(cancel, c); resetGBC(c); - c.fill = c.NONE; - c.anchor = c.CENTER; - c.gridwidth = c.REMAINDER; - c.gridheight = c.REMAINDER; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; + c.gridwidth = GridBagConstraints.REMAINDER; + c.gridheight = GridBagConstraints.REMAINDER; c.insets = new Insets(0, 0, 0, 0); contentPane.add(buttonPanel, c); diff --git a/pki/base/common/src/com/netscape/cmscore/jobs/JobsScheduler.java b/pki/base/common/src/com/netscape/cmscore/jobs/JobsScheduler.java index a37fcf93d5d839c86d37935d504d4fdfc16d45c4..5d1d3668ca8c1f33f88102de3b50defcc3b1243f 100644 --- a/pki/base/common/src/com/netscape/cmscore/jobs/JobsScheduler.java +++ b/pki/base/common/src/com/netscape/cmscore/jobs/JobsScheduler.java @@ -338,7 +338,7 @@ public class JobsScheduler implements Runnable, IJobsScheduler { * is it the right month? */ Vector moy = - jcron.getItem(jcron.CRON_MONTH_OF_YEAR).getElements(); + jcron.getItem(JobCron.CRON_MONTH_OF_YEAR).getElements(); int cronMoy = jcron.MOY_cal2cron(now); @@ -350,8 +350,8 @@ public class JobsScheduler implements Runnable, IJobsScheduler { /** * is it the right date? */ - Vector dow = jcron.getItem(jcron.CRON_DAY_OF_WEEK).getElements(); - Vector dom = jcron.getItem(jcron.CRON_DAY_OF_MONTH).getElements(); + Vector dow = jcron.getItem(JobCron.CRON_DAY_OF_WEEK).getElements(); + Vector dom = jcron.getItem(JobCron.CRON_DAY_OF_MONTH).getElements(); // can't be both empty if ((dow.isEmpty()) && dom.isEmpty()) { @@ -369,7 +369,7 @@ public class JobsScheduler implements Runnable, IJobsScheduler { /** * is it the right hour? */ - Vector hour = jcron.getItem(jcron.CRON_HOUR).getElements(); + Vector hour = jcron.getItem(JobCron.CRON_HOUR).getElements(); if (jcron.isElement(now.get(Calendar.HOUR_OF_DAY), hour) == false) { return false; @@ -379,7 +379,7 @@ public class JobsScheduler implements Runnable, IJobsScheduler { /** * is it the right minute? */ - Vector minute = jcron.getItem(jcron.CRON_MINUTE).getElements(); + Vector minute = jcron.getItem(JobCron.CRON_MINUTE).getElements(); if (jcron.isElement(now.get(Calendar.MINUTE), minute) == false) { return false; diff --git a/pki/base/common/src/com/netscape/cmscore/ldapconn/LdapJssSSLSocketFactory.java b/pki/base/common/src/com/netscape/cmscore/ldapconn/LdapJssSSLSocketFactory.java index 1b98988402170fce7248156ac551fb26146c4259..8aa59e30424b1834d0f86ac897a6f7f5e4a245e5 100644 --- a/pki/base/common/src/com/netscape/cmscore/ldapconn/LdapJssSSLSocketFactory.java +++ b/pki/base/common/src/com/netscape/cmscore/ldapconn/LdapJssSSLSocketFactory.java @@ -56,7 +56,8 @@ public class LdapJssSSLSocketFactory implements LDAPSSLSocketFactoryExt { s = new SSLSocket(host, port); s.setUseClientMode(true); s.enableSSL2(false); - s.enableSSL2Default(false); + //TODO Do we really want to set the default each time? + SSLSocket.enableSSL2Default(false); s.enableV2CompatibleHello(false); SSLHandshakeCompletedListener listener = null; diff --git a/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java b/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java index 85c2a5af19b667431992210315acb700005403df..2d8e63c9fa55492fd5e6c5b9a3256b61c01b0c9b 100644 --- a/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java @@ -212,7 +212,7 @@ public class ProfileSubsystem extends Frame implements ISubsystem, Runnable { updateGeneralPanel(); updateThreadPanel(); // update every second - mMonitoring.sleep(1000); + Thread.sleep(1000); } catch (Exception e) { } } @@ -294,8 +294,11 @@ class ThreadTableEvent extends MouseAdapter { continue; PrintStream err = System.err; - System.setErr(new PrintStream(outArray)); - threads[i].dumpStack(); // not working, print only current thread + System.setErr(new PrintStream(outArray)); + //TODO remove. This was being called on the array object + //But you can only dump stack on the current thread + Thread.dumpStack(); + System.setErr(err); } diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureCA.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureCA.java index 0a1c1666073d5b26e15aa655a3c2dc09aa7ce6d4..337bf9275209b5bf4d7cdcbfb23de148a42e32bc 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureCA.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureCA.java @@ -244,7 +244,7 @@ public class ConfigureCA { if (temp != null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0, index); + HTTPClient.j_session_id = temp.substring(0, index); st = true; } @@ -1561,7 +1561,7 @@ public class ConfigureCA { // and then match the arguments String[] unmatched = null; - unmatched = parser.matchAllArgs(args, 0, parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs(args, 0, ArgParser.EXIT_ON_UNMATCHED); if (unmatched != null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureDRM.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureDRM.java index 29e3cf19c7deb132ae09dbc3653fc7f9f3ff4b00..c79ec4eddc2e9ed0232be0e3ea71cef447a9ae09 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureDRM.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureDRM.java @@ -217,7 +217,7 @@ public class ConfigureDRM if (temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -1272,7 +1272,7 @@ public class ConfigureDRM // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if (unmatched!=null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureOCSP.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureOCSP.java index 55f008181267a047cb309b0066b1b7d5a5895f20..f237b0c70563e827bbca18b5b9a27d8f0529f6a4 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureOCSP.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureOCSP.java @@ -193,7 +193,7 @@ public class ConfigureOCSP if (temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -1136,7 +1136,7 @@ public class ConfigureOCSP // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if (unmatched!=null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureRA.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureRA.java index 6bb7cd2c9558cd957c1b6c63b103e573ad197a37..fc28e8b424e6550b5e3773dc5fb9d62800d87d7e 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureRA.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureRA.java @@ -148,7 +148,7 @@ public class ConfigureRA if(temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -882,7 +882,7 @@ public class ConfigureRA // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if(unmatched!=null) { diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureSubCA.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureSubCA.java index d492d5fcb5cea0e6f1bfa19165dae739701af574..93d115fce2357bdd30af835c3153eb36afc497a5 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureSubCA.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureSubCA.java @@ -199,7 +199,7 @@ public class ConfigureSubCA if (temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -1191,7 +1191,7 @@ public class ConfigureSubCA // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if (unmatched!=null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureTKS.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureTKS.java index b681b84c740b92b3d8f51ae102373c539fc9d323..d89fb5dd0b3084e62f6d37a5703798bd26804d50 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureTKS.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureTKS.java @@ -176,7 +176,7 @@ public class ConfigureTKS if (temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -1087,7 +1087,7 @@ public class ConfigureTKS // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if (unmatched!=null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/ConfigureTPS.java b/pki/base/silent/src/com/netscape/pkisilent/ConfigureTPS.java index fde32131ce2a2ccaa97667ebacbd3a9cdfc0a459..5273fda7364eebd0f136d701b0d414ccde53cda9 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/ConfigureTPS.java +++ b/pki/base/silent/src/com/netscape/pkisilent/ConfigureTPS.java @@ -182,7 +182,7 @@ public class ConfigureTPS if(temp!=null) { int index = temp.indexOf(";"); - hc.j_session_id = temp.substring(0,index); + HTTPClient.j_session_id = temp.substring(0,index); st = true; } @@ -1085,7 +1085,7 @@ public class ConfigureTPS // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if(unmatched!=null) { diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/CMSTask.java b/pki/base/silent/src/com/netscape/pkisilent/common/CMSTask.java index 479e13e6e904654b17afe53affb41ef34d303698..593de3838f212287362145ceea75926bb77b16be 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/CMSTask.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/CMSTask.java @@ -165,7 +165,7 @@ public class CMSTask { // and then match the arguments String[] unmatched = null; - unmatched = parser.matchAllArgs(args, 0, parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs(args, 0, ArgParser.EXIT_ON_UNMATCHED); if (unmatched != null) { System.out.println("ERROR: Argument Mismatch"); diff --git a/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java b/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java index 9c840fcdc7b6269c5bd58ebbb45d0d4137f10051..066fb0b4d5536742b4b0fe60656a1bed7efb2f9c 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java +++ b/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java @@ -130,10 +130,10 @@ public class HTTPClient implements SSLCertificateApprovalCallback { try { - socket.enableSSL3Default(true); + SSLSocket.enableSSL3Default(true); socket.enableSSL3(true); socket.enableSSL2(false); - socket.enableSSL2Default(false); + SSLSocket.enableSSL2Default(false); socket.enableV2CompatibleHello(false); } catch(Exception e) @@ -1296,7 +1296,7 @@ public class HTTPClient implements SSLCertificateApprovalCallback // and then match the arguments String [] unmatched = null; - unmatched = parser.matchAllArgs (args,0,parser.EXIT_ON_UNMATCHED); + unmatched = parser.matchAllArgs (args,0,ArgParser.EXIT_ON_UNMATCHED); if(unmatched!=null) { diff --git a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java index 2cd13111c150c767b86c7907016b5cdf52dd13ff..e659da9b9018316635754a636ff76efe90a5b9d4 100644 --- a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java +++ b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java @@ -661,10 +661,8 @@ public class CryptoUtil { CertificateSubjectName(new X500Name(subjname))); info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter)); - AlgorithmId sigAlgId = new AlgorithmId(); - info.set(X509CertInfo.ALGORITHM_ID, new - CertificateAlgorithmId(sigAlgId.get(alg))); + CertificateAlgorithmId(AlgorithmId.get(alg))); info.set(X509CertInfo.KEY, new CertificateX509Key(x509key)); info.set(X509CertInfo.EXTENSIONS, new CertificateExtensions()); return info; diff --git a/pki/base/util/src/com/netscape/cmsutil/http/JssSSLSocketFactory.java b/pki/base/util/src/com/netscape/cmsutil/http/JssSSLSocketFactory.java index ed4e95187a5e7281073b23bc04dbe5b7fb1b27f3..501886b545bef8b827625cc2571828de8b3fe8c8 100644 --- a/pki/base/util/src/com/netscape/cmsutil/http/JssSSLSocketFactory.java +++ b/pki/base/util/src/com/netscape/cmsutil/http/JssSSLSocketFactory.java @@ -121,7 +121,8 @@ public class JssSSLSocketFactory implements ISocketFactory { s.setUseClientMode(true); s.enableSSL2(false); - s.enableSSL2Default(false); + //TODO Do we rally want to set the default each time? + SSLSocket.enableSSL2Default(false); s.enableV2CompatibleHello(false); SSLHandshakeCompletedListener listener = null; diff --git a/pki/base/util/src/netscape/security/pkcs/PKCS8Key.java b/pki/base/util/src/netscape/security/pkcs/PKCS8Key.java index dfa5a728d7066f2b88123187a6ca0bdf01571cd5..20a788fcb950c8a24a15c0dbfbf9d1f58df45337 100644 --- a/pki/base/util/src/netscape/security/pkcs/PKCS8Key.java +++ b/pki/base/util/src/netscape/security/pkcs/PKCS8Key.java @@ -60,7 +60,7 @@ public class PKCS8Key implements PrivateKey { protected byte[] encodedKey; /* The version for this key */ - public static final BigInteger version = BigInteger.valueOf(0); + public static final BigInteger VERSION = BigInteger.valueOf(0); /** * Default constructor. The key constructed must have its key @@ -104,9 +104,9 @@ public class PKCS8Key implements PrivateKey { throw new IOException ("corrupt private key"); BigInteger parsedVersion = in.data.getInteger().toBigInteger(); - if (!version.equals(parsedVersion)) { + if (!VERSION.equals(parsedVersion)) { throw new IOException("version mismatch: (supported: " + - version + ", parsed: " + + VERSION + ", parsed: " + parsedVersion); } @@ -324,9 +324,9 @@ public class PKCS8Key implements PrivateKey { BigInteger version = val.data.getInteger().toBigInteger(); - if (!version.equals(this.version)) { + if (!version.equals(PKCS8Key.VERSION)) { throw new IOException("version mismatch: (supported: " + - this.version + ", parsed: " + + PKCS8Key.VERSION + ", parsed: " + version); } algid = AlgorithmId.parse (val.data.getDerValue ()); @@ -389,7 +389,7 @@ public class PKCS8Key implements PrivateKey { static void encode(DerOutputStream out, AlgorithmId algid, byte[] key) throws IOException { DerOutputStream tmp = new DerOutputStream(); - tmp.putInteger(new BigInt(version.toByteArray())); + tmp.putInteger(new BigInt(VERSION.toByteArray())); algid.encode(tmp); tmp.putOctetString(key); out.write(DerValue.tag_Sequence, tmp); diff --git a/pki/base/util/src/netscape/security/x509/CRLDistributionPoint.java b/pki/base/util/src/netscape/security/x509/CRLDistributionPoint.java index 532e313a5d9d9f61e19ef2108491175ed1423661..5207e3199a2a7cb71c21d4d26130740dce4b92dd 100644 --- a/pki/base/util/src/netscape/security/x509/CRLDistributionPoint.java +++ b/pki/base/util/src/netscape/security/x509/CRLDistributionPoint.java @@ -405,7 +405,7 @@ public static class Template implements ASN1Template { try { DerValue dv = new DerValue(distPoint.getEncoded()); //toFile("encodedFullName", distPoint.getEncoded()); - dv.resetTag(dv.tag_Sequence); + dv.resetTag(DerValue.tag_Sequence); cdp.setFullName( new GeneralNames(dv) ); } catch(GeneralNamesException e) { throw new InvalidBERException( "fullName: " + e.toString()); @@ -435,7 +435,7 @@ public static class Template implements ASN1Template { : } : } */ - dv.resetTag(dv.tag_Set); + dv.resetTag(DerValue.tag_Set); cdp.setRelativeName( new RDN(dv) ); } catch(IOException e) { throw new InvalidBERException( "relativeName " + @@ -464,7 +464,7 @@ public static class Template implements ASN1Template { } try { DerValue dv = new DerValue( issuer.getEncoded() ); - dv.resetTag(dv.tag_Sequence); + dv.resetTag(DerValue.tag_Sequence); cdp.setCRLIssuer( new GeneralNames(dv) ); } catch(GeneralNamesException e) { throw new InvalidBERException( "cRLIssuer " + e.toString() ); diff --git a/pki/base/util/src/netscape/security/x509/IssuingDistributionPointExtension.java b/pki/base/util/src/netscape/security/x509/IssuingDistributionPointExtension.java index 36cce0300f32e532ee14072c8ad978105f1f79af..d6afd54cc6304494a3dc7349d02181861191902a 100644 --- a/pki/base/util/src/netscape/security/x509/IssuingDistributionPointExtension.java +++ b/pki/base/util/src/netscape/security/x509/IssuingDistributionPointExtension.java @@ -393,14 +393,14 @@ public class IssuingDistributionPointExtension extends Extension generalNames = new GeneralNames(); generalNames.addElement(dn); idp.setFullName(generalNames); - idpExt.set(idpExt.ISSUING_DISTRIBUTION_POINT, idp); + idpExt.set(IssuingDistributionPointExtension.ISSUING_DISTRIBUTION_POINT, idp); // DN + reason BitArray ba = new BitArray(5, new byte[] {(byte)0x28} ); idp = new IssuingDistributionPoint(); idp.setFullName(generalNames); idp.setOnlySomeReasons(ba); - idpExt.set(idpExt.ISSUING_DISTRIBUTION_POINT, idp); + idpExt.set(IssuingDistributionPointExtension.ISSUING_DISTRIBUTION_POINT, idp); // relative DN + reason + crlIssuer @@ -411,7 +411,7 @@ public class IssuingDistributionPointExtension extends Extension idp.setOnlyContainsCACerts(true); idp.setOnlyContainsUserCerts(true); idp.setIndirectCRL(true); - idpExt.set(idpExt.ISSUING_DISTRIBUTION_POINT, idp); + idpExt.set(IssuingDistributionPointExtension.ISSUING_DISTRIBUTION_POINT, idp); idpExt.setCritical(false); idpExt.encode(bos); -- 1.7.7.3