summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-11-19 21:20:37 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-11-21 12:16:37 -0500
commit066789642947768eceb024a4064af88efeed24b0 (patch)
treedd4b9e2a321ac15dde5343f8cfea5d9767c95efe
parent871b4423babc140d984d4b49aa380710cfcaf72a (diff)
downloadpki-066789642947768eceb024a4064af88efeed24b0.tar.gz
pki-066789642947768eceb024a4064af88efeed24b0.tar.xz
pki-066789642947768eceb024a4064af88efeed24b0.zip
Fix for improper crl retrieval from CA.
-rw-r--r--base/common/src/com/netscape/cms/servlet/cert/GetCRL.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java b/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
index a5a48cc6f..9bfbc86f9 100644
--- a/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
+++ b/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
@@ -343,25 +343,26 @@ public class GetCRL extends CMSServlet {
while (i < length) {
int k = crlBase64Encoded.indexOf('\n', i);
+ if (k < 0)
+ break;
- if (n < 100 && k > -1) {
+ if (n < 100) {
n++;
i = k + 1;
} else {
n = 1;
IArgBlock rarg = CMS.createArgBlock();
-
- if (k > -1) {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
- i = k + 1;
- j = i;
- } else {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
- i = length;
- }
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
+ i = k + 1;
+ j = i;
argSet.addRepeatRecord(rarg);
}
}
+ if (j < length) {
+ IArgBlock rarg = CMS.createArgBlock();
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
+ argSet.addRepeatRecord(rarg);
+ }
} catch (CRLException e) {
}
} else if (crlDisplayType.equals("deltaCRL")) {
@@ -383,25 +384,25 @@ public class GetCRL extends CMSServlet {
while (i < length) {
int k = crlBase64Encoded.indexOf('\n', i);
-
- if (n < 100 && k > -1) {
+ if (k < 0)
+ break;
+ if (n < 100) {
n++;
i = k + 1;
} else {
n = 1;
IArgBlock rarg = CMS.createArgBlock();
-
- if (k > -1) {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
- i = k + 1;
- j = i;
- } else {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
- i = length;
- }
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
+ i = k + 1;
+ j = i;
argSet.addRepeatRecord(rarg);
}
}
+ if (j < length) {
+ IArgBlock rarg = CMS.createArgBlock();
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
+ argSet.addRepeatRecord(rarg);
+ }
} catch (CRLException e) {
}
}