summaryrefslogtreecommitdiffstats
path: root/pki/base/common
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2012-01-19 10:11:02 -0800
committerChristina Fu <cfu@redhat.com>2012-01-19 10:16:28 -0800
commit72d5d935ac9091cb4dc7bd99875ccee48318ff25 (patch)
tree191f9620b67fb28c557bc4cc2817315eee0255d3 /pki/base/common
parent413d6cb605497b43a48772b3c234b4062f44de54 (diff)
downloadpki-72d5d935ac9091cb4dc7bd99875ccee48318ff25.tar.gz
pki-72d5d935ac9091cb4dc7bd99875ccee48318ff25.tar.xz
pki-72d5d935ac9091cb4dc7bd99875ccee48318ff25.zip
Bug 769739 - CC: self test verifySystemCertByNickname: certain failure will not cause server to shutdown as expected
There are two issues: 1. The variable, r, returned by verifySystemCertByTag() gets overwritten by the next return value in a while loop. The problem affects both java subsystems and TPS. 2. In the TPS system, within a while loop that calls verifySystemCertByNickname(), one condition does a "continue" without advancing to the next token, causing an infinite loop under that condition. Adding a PL_strtok_r(NULL, ",", &lasts); call resolves the issue.
Diffstat (limited to 'pki/base/common')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java b/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java
index c66d8a71d..12965a52e 100644
--- a/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java
+++ b/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java
@@ -1002,7 +1002,8 @@ public class CertUtils {
String auditMessage = null;
IConfigStore config = CMS.getConfigStore();
String certlsit = "";
- boolean r = true;
+ boolean verifyResult = true;
+ boolean r = true; /* the final return value */
try {
String subsysType = config.getString("cs.type", "");
if (subsysType.equals("")) {
@@ -1014,8 +1015,7 @@ public class CertUtils {
"");
audit(auditMessage);
- r = false;
- return r;
+ return false;
}
subsysType = toLowerCaseSubsystemType(subsysType);
if (subsysType == null) {
@@ -1027,8 +1027,7 @@ public class CertUtils {
"");
audit(auditMessage);
- r = false;
- return r;
+ return false;
}
String certlist = config.getString(subsysType + ".cert.list", "");
if (certlist.equals("")) {
@@ -1041,15 +1040,16 @@ public class CertUtils {
"");
audit(auditMessage);
- r = false;
- return r;
+ return false;
}
StringTokenizer tokenizer = new StringTokenizer(certlist, ",");
while (tokenizer.hasMoreTokens()) {
String tag = tokenizer.nextToken();
tag = tag.trim();
CMS.debug("CertUtils: verifySystemCerts() cert tag=" + tag);
- r = verifySystemCertByTag(tag);
+ verifyResult = verifySystemCertByTag(tag);
+ if (verifyResult == false)
+ r = false; //r captures the value for final return
}
} catch (Exception e) {
// audit here