summaryrefslogtreecommitdiffstats
path: root/pki/base
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base')
-rw-r--r--pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java16
-rw-r--r--pki/base/common/src/com/netscape/cms/listeners/PinRemovalListener.java1
-rw-r--r--pki/base/common/src/com/netscape/cms/logging/RollingLogFile.java4
-rw-r--r--pki/base/common/src/com/netscape/cms/profile/def/AuthTokenSubjectNameDefault.java4
-rw-r--r--pki/base/common/src/com/netscape/cms/profile/def/nsTokenUserKeySubjectNameDefault.java7
-rw-r--r--pki/base/common/src/com/netscape/cms/publish/publishers/LdapEncryptCertPublisher.java4
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java2
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java105
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/ChallengeRevocationServlet1.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/CloneRedirect.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/DisplayCRL.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java7
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java10
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java2
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMLoginPanel.java6
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/MainPageServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java36
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCAServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCRLServlet.java16
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/ocsp/CheckCertServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/ocsp/ListCAServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/ocsp/RemoveCAServlet.java5
-rw-r--r--pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java4
-rw-r--r--pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java9
-rw-r--r--pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java4
-rw-r--r--pki/base/common/src/com/netscape/cmscore/logging/LogSubsystem.java4
-rw-r--r--pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java2
-rw-r--r--pki/base/common/src/com/netscape/cmscore/util/FileAsString.java8
-rw-r--r--pki/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java5
-rw-r--r--pki/base/java-tools/src/com/netscape/cmstools/DRMTool.java8
-rw-r--r--pki/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java3
-rw-r--r--pki/base/kra/src/com/netscape/kra/EnrollmentService.java17
-rw-r--r--pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java10
-rw-r--r--pki/base/kra/src/com/netscape/kra/NetkeyKeygenService.java7
-rwxr-xr-xpki/base/silent/src/com/netscape/pkisilent/argparser/ArgParser.java4
37 files changed, 22 insertions, 333 deletions
diff --git a/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java b/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java
index e102f18f8..b7f7fb346 100644
--- a/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java
+++ b/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java
@@ -906,23 +906,9 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo,
// find from internaldb if it's ca. (ra does not have that.)
// find from internaldb usrgrp info
- if (cert == null) {
+ {
// find from certDB
si.verify(digest, id);
- } else {
- PublicKey signKey = cert.getPublicKey();
- PrivateKey.Type keyType = null;
- String alg = signKey.getAlgorithm();
-
- if (alg.equals("RSA")) {
- keyType = PrivateKey.RSA;
- } else if (alg.equals("DSA")) {
- keyType = PrivateKey.DSA;
- } else {
- }
- PK11PubKey pubK = PK11PubKey.fromRaw(keyType, ((X509Key) signKey).getKey());
-
- si.verify(digest, id, pubK);
}
} //
diff --git a/pki/base/common/src/com/netscape/cms/listeners/PinRemovalListener.java b/pki/base/common/src/com/netscape/cms/listeners/PinRemovalListener.java
index 0c09395c3..2f02774d0 100644
--- a/pki/base/common/src/com/netscape/cms/listeners/PinRemovalListener.java
+++ b/pki/base/common/src/com/netscape/cms/listeners/PinRemovalListener.java
@@ -90,7 +90,6 @@ public class PinRemovalListener implements IRequestListener {
public String[] getConfigParams()
throws EBaseException {
- if (1 == 2) throw new EBaseException("");
return configParams;
}
diff --git a/pki/base/common/src/com/netscape/cms/logging/RollingLogFile.java b/pki/base/common/src/com/netscape/cms/logging/RollingLogFile.java
index 27657ef74..becd8a3b7 100644
--- a/pki/base/common/src/com/netscape/cms/logging/RollingLogFile.java
+++ b/pki/base/common/src/com/netscape/cms/logging/RollingLogFile.java
@@ -321,9 +321,7 @@ public class RollingLogFile extends LogFile {
if (index != -1) { // "/" exist in fileName
pathName = fileName.substring(0, index);
baseName = fileName.substring(index + 1);
- if (dirName == null) {
- dirName = pathName;
- } else {
+ {
dirName = dirName.concat("/" + pathName);
}
}else { // "/" NOT exist in fileName
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/AuthTokenSubjectNameDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/AuthTokenSubjectNameDefault.java
index 63eaf5938..52c588a81 100644
--- a/pki/base/common/src/com/netscape/cms/profile/def/AuthTokenSubjectNameDefault.java
+++ b/pki/base/common/src/com/netscape/cms/profile/def/AuthTokenSubjectNameDefault.java
@@ -79,10 +79,8 @@ public class AuthTokenSubjectNameDefault extends EnrollDefault {
try {
x500name = new X500Name(value);
- if (x500name != null) {
+ {
CMS.debug("AuthTokenSubjectNameDefault: setValue x500name=" + x500name.toString());
- } else {
- CMS.debug("AuthTokenSubjectNameDefault: setValue x500name=null");
}
} catch (IOException e) {
CMS.debug("AuthTokenSubjectNameDefault: setValue " +
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/nsTokenUserKeySubjectNameDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/nsTokenUserKeySubjectNameDefault.java
index e9bb59e65..d36403758 100644
--- a/pki/base/common/src/com/netscape/cms/profile/def/nsTokenUserKeySubjectNameDefault.java
+++ b/pki/base/common/src/com/netscape/cms/profile/def/nsTokenUserKeySubjectNameDefault.java
@@ -429,15 +429,10 @@ ldapInit();
request.setExtData(mLdapStringAttrs[i], escapeValueRfc1779(sla[0], false).toString());
}
}
-//cfu
- if (request != null) {
+ {
CMS.debug("pattern = "+pattern);
sbjname = mapPattern(request, pattern);
CMS.debug("nsTokenUserKeySubjectNameDefault: getSubjectName(): subject name mapping done");
- } else {
- CMS.debug( "nsTokenUserKeySubjectNameDefault::getSubjectName() "
- + "- request is null!" );
- throw new EProfileException( "request is null" );
}
CMS.debug("nsTokenUserKeySubjectNameDefault: getSubjectName(): attributes set in request");
diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapEncryptCertPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapEncryptCertPublisher.java
index dc651c155..902763b48 100644
--- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapEncryptCertPublisher.java
+++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapEncryptCertPublisher.java
@@ -235,10 +235,6 @@ public class LdapEncryptCertPublisher implements ILdapPublisher, IExtendedPlugin
LDAPAttribute attr, byte[] bval) {
LDAPAttribute at = new LDAPAttribute(attr.getName(), bval);
- if (at == null) {
- return at;
- }
-
// determine if the given cert is a signing or an encryption
// certificate
X509CertImpl thisCert = null;
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 5461e8ff5..9b6f50b4f 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
@@ -1523,8 +1523,6 @@ public class CAAdminServlet extends AdminServlet {
*/
IConfigStore eeConfig = null;
- if (eeGateway != null)
- eeConfig = eeGateway.getConfigStore();
IConfigStore caConfig = mCA.getConfigStore();
Enumeration enum1 = req.getParameterNames();
diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
index 67f633468..316654720 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
@@ -1998,111 +1998,6 @@ public class LogAdminServlet extends AdminServlet {
}
// initialize the log
- try {
- if (false) {
- newMgrInst.init(mSys, substore);
- }
- } catch (EBaseException e) {
- // check to see if the log file path parameter was changed
- newLogPath = auditCheckLogPath(req);
-
- // check to see if the log expiration time parameter was changed
- // newExpirationTime = auditCheckLogExpirationTime(req);
-
- // don't commit in this case and cleanup the new substore.
- restore(instancesConfig, id, saveParams);
-
- // store a message in the signed audit log file
- // (regardless of logType)
- if (!(newLogPath.equals(origLogPath))) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_LOG_PATH_CHANGE,
- auditSubjectID,
- ILogger.FAILURE,
- logType,
- newLogPath);
-
- audit(auditMessage);
- }
-
- // store a message in the signed audit log file
- // (regardless of logType)
- /* if (!(newExpirationTime.equals(origExpirationTime))) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_LOG_EXPIRATION_CHANGE,
- auditSubjectID,
- ILogger.FAILURE,
- logType,
- newExpirationTime);
-
- audit(auditMessage);
- } */
-
- // store a message in the signed audit log file
- if (logType.equals(SIGNED_AUDIT_LOG_TYPE)) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_SIGNED_AUDIT,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams(req));
-
- audit(auditMessage);
- }
-
- sendResponse(ERROR, e.toString(getLocale(req)), null,
- resp);
- return;
- } catch (Throwable e) {
- // check to see if the log file path parameter was changed
- newLogPath = auditCheckLogPath(req);
-
- // check to see if the log expiration time parameter was changed
- // newExpirationTime = auditCheckLogExpirationTime(req);
-
- restore(instancesConfig, id, saveParams);
-
- // store a message in the signed audit log file
- // (regardless of logType)
- if (!(newLogPath.equals(origLogPath))) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_LOG_PATH_CHANGE,
- auditSubjectID,
- ILogger.FAILURE,
- logType,
- newLogPath);
-
- audit(auditMessage);
- }
-
- // store a message in the signed audit log file
- // (regardless of logType)
- /* if (!(newExpirationTime.equals(origExpirationTime))) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_LOG_EXPIRATION_CHANGE,
- auditSubjectID,
- ILogger.FAILURE,
- logType,
- newExpirationTime);
-
- audit(auditMessage);
- } */
-
- // store a message in the signed audit log file
- if (logType.equals(SIGNED_AUDIT_LOG_TYPE)) {
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_SIGNED_AUDIT,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams(req));
-
- audit(auditMessage);
- }
-
- sendResponse(ERROR, e.toString(), null,
- resp);
- return;
- }
-
// initialized ok. commiting
try {
mConfig.commit(true);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java
index 57ad7737c..cd3326fb7 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java
@@ -294,7 +294,7 @@ CMS.debug("**** mFormPath = "+mFormPath);
EBaseException ee = new EBaseException("No matched certificate is found");
cmsReq.setError(ee);
- } else if (error == null) {
+ } else {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -303,9 +303,6 @@ CMS.debug("**** mFormPath = "+mFormPath);
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/ChallengeRevocationServlet1.java b/pki/base/common/src/com/netscape/cms/servlet/cert/ChallengeRevocationServlet1.java
index 5218233f1..0b5767950 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/ChallengeRevocationServlet1.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/ChallengeRevocationServlet1.java
@@ -275,7 +275,7 @@ public class ChallengeRevocationServlet1 extends CMSServlet {
EBaseException ee = new EBaseException("No matched certificate is found");
cmsReq.setError(ee);
- } else if (error == null) {
+ } else {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -284,9 +284,6 @@ public class ChallengeRevocationServlet1 extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/CloneRedirect.java b/pki/base/common/src/com/netscape/cms/servlet/cert/CloneRedirect.java
index c9fcf25be..0bc7e2061 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/CloneRedirect.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/CloneRedirect.java
@@ -124,7 +124,7 @@ public class CloneRedirect extends CMSServlet {
try {
ServletOutputStream out = resp.getOutputStream();
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -133,9 +133,6 @@ public class CloneRedirect extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayCRL.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayCRL.java
index 817bf01e3..94c4738c1 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayCRL.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayCRL.java
@@ -149,7 +149,7 @@ public class DisplayCRL extends CMSServlet {
try {
ServletOutputStream out = resp.getOutputStream();
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -158,9 +158,6 @@ public class DisplayCRL extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
index cad231ed7..cb83351af 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
@@ -258,13 +258,6 @@ CMS.debug("**** mFormPath before getTemplate = "+mFormPath);
cmsReq.setStatus(CMSRequest.ERROR);
return;
}
- if (crl == null) {
- log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSGW_FAILED_DECODE_CRL"));
- cmsReq.setError(new ECMSGWException(
- CMS.getUserMessage("CMS_GW_DECODE_CRL_FAILED")));
- cmsReq.setStatus(CMSRequest.ERROR);
- return;
- }
if ((op.equals("importDeltaCRL") || (op.equals("displayCRL") &&
crlDisplayType != null && crlDisplayType.equals("deltaCRL"))) &&
((!(crlIP != null && crlIP.isThisCurrentDeltaCRL(crl))) &&
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java
index c6c0c495a..24dda2a59 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java
@@ -415,16 +415,6 @@ public class HashEnrollServlet extends CMSServlet {
// }
}
- if (certAuthEnroll == true) {
- // log(ILogger.LL_DEBUG, "just gotten subjectDN and serialNumber from ssl client cert");
- if (authToken == null) {
- // authToken is null, can't match to anyone; bail!
- log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSGW_ERR_PROCESS_ENROLL_NO_AUTH"));
- return;
- }
- }
-
// fill certInfo from input types: keygen, cmc, pkcs10 or crmf
KeyGenInfo keyGenInfo =
httpParams.getValueAsKeyGenInfo(SUBJECT_KEYGEN_INFO, null);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java b/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java
index 4931d7869..03cb83f63 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java
@@ -555,8 +555,6 @@ public class CMCOutputTemplate {
} catch (EBaseException ee) {
CMS.debug("CMCOutputTemplate: Certificate in the confirm acceptance control was not found");
}
- if (impl != null)
- confirmAccepted = true;
}
CMCStatusInfo cmcStatusInfo = null;
if (confirmAccepted) {
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMLoginPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMLoginPanel.java
index a3198414a..d8db2f66a 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMLoginPanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMLoginPanel.java
@@ -156,7 +156,7 @@ public class ConfigHSMLoginPanel extends WizardPanelBase {
password = new Password(tokPwd.toCharArray());
- if (password != null) {
+ {
try {
if (token.passwordIsInitialized()) {
CMS.debug(
@@ -188,10 +188,6 @@ public class ConfigHSMLoginPanel extends WizardPanelBase {
context.put("errorString", e.toString());
rv = false;
}
- } else { // no password in password file, get from user
- CMS.debug(
- "ConfigHSMLoginPanel: loginToken():no password in cache, getting from user");
- rv = false;
}
return rv;
}
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java
index 962f87bff..43f3f956a 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java
@@ -249,13 +249,10 @@ public class GetCookie extends CMSServlet {
try {
ServletOutputStream out = httpResp.getOutputStream();
- if (error == null) {
+ {
cmsReq.setStatus(CMSRequest.SUCCESS);
httpResp.setContentType("text/html");
form.renderOutput(out, argSet);
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/MainPageServlet.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/MainPageServlet.java
index efb765966..b0eff4405 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/MainPageServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/MainPageServlet.java
@@ -85,13 +85,10 @@ public class MainPageServlet extends CMSServlet {
try {
ServletOutputStream out = response.getOutputStream();
- if (error == null) {
+ {
cmsReq.setStatus(CMSRequest.SUCCESS);
response.setContentType("text/html");
form.renderOutput(out, argSet);
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
index cf0f3a095..b2bf21be4 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
@@ -180,36 +180,14 @@ public class UpdateNumberRange extends CMSServlet {
String endNumStr = cs.getString(endNumConfig, "");
endNum = new BigInteger(endNumStr, radix);
- if ( endNum == null ) {
- CMS.debug( "UpdateNumberRange::process() - " +
- "request endNum is null!" );
- return;
- }
-
String decrementStr = cs.getString(cloneNumConfig, "");
BigInteger decrement = new BigInteger(decrementStr, radix);
- if (decrement == null) {
- CMS.debug("UpdateNumberRange::process() - " +
- "request decrement string is null!" );
- return;
- }
-
beginNum = endNum.subtract(decrement).add(oneNum);
if (beginNum.compareTo(repo.getTheSerialNumber()) < 0) {
String nextEndNumStr = cs.getString(nextEndConfig, "");
BigInteger endNum2 = new BigInteger(nextEndNumStr, radix);
- if (endNum2 == null) {
- CMS.debug("UpdateNumberRange::process() - " +
- "Unused requests less than cloneTransferNumber!" );
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams);
- audit(auditMessage);
- return;
- } else {
+ {
CMS.debug("Transferring from the end of on-deck range");
String newValStr = endNum2.subtract(decrement).toString(radix);
repo.setNextMaxSerial(newValStr);
@@ -237,18 +215,6 @@ public class UpdateNumberRange extends CMSServlet {
return;
}
- if( endNum == null ) {
- CMS.debug( "UpdateNumberRange::process() - " +
- "endNum is null!" );
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams);
- audit(auditMessage);
- return;
- }
-
// Enable serial number management in master for certs and requests
if (type.equals("replicaId")) {
repo.setEnableSerialMgmt(true);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCAServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCAServlet.java
index e0823d66b..939a0af75 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCAServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCAServlet.java
@@ -292,7 +292,7 @@ public class AddCAServlet extends CMSServlet {
ServletOutputStream out = resp.getOutputStream();
String error = null;
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -301,9 +301,6 @@ public class AddCAServlet extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- // cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCRLServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCRLServlet.java
index ac2f94644..356acd4b4 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCRLServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/AddCRLServlet.java
@@ -311,22 +311,6 @@ public class AddCRLServlet extends CMSServlet {
log(ILogger.LL_INFO, "AddCRLServlet: CRL Issuer DN " +
crl.getIssuerDN().getName());
- // update the CRLIssuingPoint record
- if (crl == null) {
- // error
-
- // store a message in the signed audit log file
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CRL_VALIDATION,
- auditSubjectID,
- ILogger.FAILURE );
-
- audit( auditMessage );
-
- throw new ECMSGWException(
- CMS.getUserMessage("CMS_GW_DECODING_CRL_ERROR"));
- }
-
ICRLIssuingPointRecord pt = null;
try {
diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/CheckCertServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/CheckCertServlet.java
index 1948d06cc..57ec1cc84 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/CheckCertServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/CheckCertServlet.java
@@ -196,7 +196,7 @@ public class CheckCertServlet extends CMSServlet {
ServletOutputStream out = resp.getOutputStream();
String error = null;
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -205,9 +205,6 @@ public class CheckCertServlet extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- // cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/ListCAServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/ListCAServlet.java
index 9c36b18ed..931031a75 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/ListCAServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/ListCAServlet.java
@@ -180,7 +180,7 @@ public class ListCAServlet extends CMSServlet {
ServletOutputStream out = resp.getOutputStream();
String error = null;
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -189,9 +189,6 @@ public class ListCAServlet extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- // cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
diff --git a/pki/base/common/src/com/netscape/cms/servlet/ocsp/RemoveCAServlet.java b/pki/base/common/src/com/netscape/cms/servlet/ocsp/RemoveCAServlet.java
index 2e0b007a6..bc9612e4c 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/ocsp/RemoveCAServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/ocsp/RemoveCAServlet.java
@@ -198,7 +198,7 @@ public class RemoveCAServlet extends CMSServlet {
ServletOutputStream out = resp.getOutputStream();
String error = null;
- if (error == null) {
+ {
String xmlOutput = req.getParameter("xml");
if (xmlOutput != null && xmlOutput.equals("true")) {
outputXML(resp, argSet);
@@ -207,9 +207,6 @@ public class RemoveCAServlet extends CMSServlet {
form.renderOutput(out, argSet);
cmsReq.setStatus(CMSRequest.SUCCESS);
}
- } else {
- cmsReq.setStatus(CMSRequest.ERROR);
- // cmsReq.setError(error);
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
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 a760f4fc1..92331a20d 100644
--- a/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
+++ b/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
@@ -464,10 +464,6 @@ public class CMSEngine implements ICMSEngine {
if (aclStr != null) {
StringTokenizer atok = new StringTokenizer(aclStr, ";");
- if (atok == null) {
- throw new EACLsException(CMS.getUserMessage("CMS_ACL_NULL_VALUE", "atok"));
- }
-
while (atok.hasMoreTokens()) {
String acs = (String) atok.nextToken();
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java b/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java
index 1c437896d..3208a23d7 100644
--- a/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java
@@ -434,18 +434,9 @@ public class DBSubsystem implements IDBSubsystem {
nextRange = (String) attr.getStringValues().nextElement();
BigInteger nextRangeNo = new BigInteger(nextRange);
- if (nextRangeNo == null) {
- throw new EBaseException("nextRangeNo is null!");
- }
-
BigInteger incrementNo = new BigInteger((String) h.get(PROP_INCREMENT));
- if (incrementNo == null) {
- throw new EBaseException("incrementNo is null!");
- }
-
// To make sure attrNextRange always increments, first delete the current value and then
// increment. Two operations in the same transaction
-
LDAPAttribute attrNextRange = new LDAPAttribute(PROP_NEXT_RANGE, nextRangeNo.add(incrementNo).toString());
LDAPModification [] mods = {
new LDAPModification( LDAPModification.DELETE, attr),
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java
index a3a3a98c0..d672b5157 100644
--- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java
+++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java
@@ -84,10 +84,8 @@ public class KeyRecordList implements IKeyRecordList {
entries.addElement(element);
}
}
- if (entries != null) {
+ {
return entries.elements();
- } else {
- return null;
}
}
}
diff --git a/pki/base/common/src/com/netscape/cmscore/logging/LogSubsystem.java b/pki/base/common/src/com/netscape/cmscore/logging/LogSubsystem.java
index 0f1f93042..eeae860c2 100644
--- a/pki/base/common/src/com/netscape/cmscore/logging/LogSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/logging/LogSubsystem.java
@@ -144,10 +144,6 @@ public class LogSubsystem implements ILogSubsystem {
throw new EBaseException(insName + ":Failed to instantiate class " + className + " error: " + e.getMessage());
}
- if (logInst == null) {
- throw new EBaseException("Failed to instantiate class " + className);
- }
-
if (insName == null) {
throw new EBaseException("Failed to instantiate class " + insName);
}
diff --git a/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java b/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
index 753c6cc46..589d5a68c 100644
--- a/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
+++ b/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
@@ -835,8 +835,6 @@ public class KeyCertUtil {
return; // isCA is not optional
if (isCA.equals("null"))
return; // no BasicConstraints requested
- if ((isCA == null) && (certLen == null))
- return;
int len = 0;
boolean bool = false;
diff --git a/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java b/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java
index 715559f84..c0ae1faaf 100644
--- a/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java
+++ b/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java
@@ -84,13 +84,7 @@ public class FileAsString {
br = new BufferedReader(fr);
mFilename = filename;
} catch (IOException e) {
- try {
- if (fr != null) {
- fr.close();
- }
- } catch (Exception f) {
- }
- throw e;
+ throw e;
}
return br;
}
diff --git a/pki/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java b/pki/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
index 7aa83dee9..7298fd2b3 100644
--- a/pki/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
+++ b/pki/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
@@ -288,16 +288,13 @@ public class CMCEnroll {
ByteArrayOutputStream bs = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(bs);
- if (fullEnrollmentReq != null) {
+ {
// format is PR_REQUEST_CMC
ByteArrayOutputStream os = new ByteArrayOutputStream();
fullEnrollmentReq.encode(os);
ps.print(com.netscape.osutil.OSUtil.BtoA(os.toByteArray()));
//fullEnrollmentReq.print(ps); // no header/trailer
- } else {
- // format is PR_REQUEST_PKCS10
- pkcs.print(ps);
}
asciiBASE64Blob = bs.toString();
} catch (Exception e) {
diff --git a/pki/base/java-tools/src/com/netscape/cmstools/DRMTool.java b/pki/base/java-tools/src/com/netscape/cmstools/DRMTool.java
index d92792253..625532330 100644
--- a/pki/base/java-tools/src/com/netscape/cmstools/DRMTool.java
+++ b/pki/base/java-tools/src/com/netscape/cmstools/DRMTool.java
@@ -1632,14 +1632,6 @@ public class DRMTool
// the BINARY BASE 64 byte[] object
try {
cert = new X509CertImpl( decodedBASE64Cert );
- if( cert == null ) {
- log( "ERROR: Unable to parse "
- + "certificate from '"
- + mTargetStorageCertificateFilename
- + "'."
- + NEWLINE, true );
- System.exit( 0 );
- }
} catch( CertificateException exWrapCertificate ) {
log( "ERROR: Error encountered "
+ "in parsing certificate in '"
diff --git a/pki/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java b/pki/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
index 05b0acf9d..5f0999119 100644
--- a/pki/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
+++ b/pki/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
@@ -102,9 +102,6 @@ public class PKCS10Client
dbdir = ".";
try {
- // initialize CryptoManager
- if (dbdir == null)
- dbdir = ".";
String mPrefix = "";
CryptoManager.InitializationValues vals =
new CryptoManager.InitializationValues(dbdir, mPrefix,
diff --git a/pki/base/kra/src/com/netscape/kra/EnrollmentService.java b/pki/base/kra/src/com/netscape/kra/EnrollmentService.java
index 713e276d7..8f9a08b29 100644
--- a/pki/base/kra/src/com/netscape/kra/EnrollmentService.java
+++ b/pki/base/kra/src/com/netscape/kra/EnrollmentService.java
@@ -352,19 +352,6 @@ public class EnrollmentService implements IService {
privateKeyData, owner,
publicKey.getAlgorithmId().getOID().toString(), agentId);
- if (rec == null) {
-
- auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_PRIVATE_KEY_ARCHIVE_REQUEST,
- auditSubjectID,
- ILogger.FAILURE,
- auditRequesterID,
- auditArchiveID);
-
- audit(auditMessage);
- throw new EKRAException(CMS.getUserMessage("CMS_KRA_INVALID_KEYRECORD"));
- }
-
// we deal with RSA key only
try {
RSAPublicKey rsaPublicKey = new RSAPublicKey(publicKeyData);
@@ -787,7 +774,7 @@ public class EnrollmentService implements IService {
}
}
- if (key != null) {
+ {
key = key.trim();
if (key.equals("")) {
@@ -795,8 +782,6 @@ public class EnrollmentService implements IService {
} else {
return key;
}
- } else {
- return ILogger.SIGNED_AUDIT_EMPTY_VALUE;
}
}
/**
diff --git a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
index f055442bc..74bb69543 100644
--- a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
+++ b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
@@ -1688,15 +1688,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
}
}
- if (key != null) {
- key = key.trim();
-
- if (key.equals("")) {
- return ILogger.SIGNED_AUDIT_EMPTY_VALUE;
- } else {
- return key;
- }
- } else {
+ {
return ILogger.SIGNED_AUDIT_EMPTY_VALUE;
}
}
diff --git a/pki/base/kra/src/com/netscape/kra/NetkeyKeygenService.java b/pki/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
index 31b613249..c69ab8c16 100644
--- a/pki/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
+++ b/pki/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
@@ -548,12 +548,7 @@ public class NetkeyKeygenService implements IService {
keypair.getPublic().getAlgorithm(),
agentId);
- if (rec == null) {
- request.setExtData(IRequest.RESULT, Integer.valueOf(11));
- CMS.debug("NetkeyKeygenService: privatekey recording failed");
- return false;
- } else
- CMS.debug("NetkeyKeygenService: got key record");
+ CMS.debug("NetkeyKeygenService: got key record");
// we deal with RSA key only
try {
diff --git a/pki/base/silent/src/com/netscape/pkisilent/argparser/ArgParser.java b/pki/base/silent/src/com/netscape/pkisilent/argparser/ArgParser.java
index f4e07f2e5..29033d6b7 100755
--- a/pki/base/silent/src/com/netscape/pkisilent/argparser/ArgParser.java
+++ b/pki/base/silent/src/com/netscape/pkisilent/argparser/ArgParser.java
@@ -1494,10 +1494,6 @@ public class ArgParser
}
while (c != '%');
- if (nameTail == null)
- { throw new IllegalArgumentException
- ("Null option name given");
- }
if (!nameTail.oneWord)
{ for (ndesc=rec.nameList; ndesc!=null; ndesc=ndesc.next)
{ ndesc.oneWord = false;