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 10:12:15 -0500
commitc7128845f4c45198e2c3e95770bd45149441ae79 (patch)
tree31b8fc45f32faeca6539a7a6d4152b6aa1072dde
parent40e58f937d49f1a0029a226ab714cb54f12a9239 (diff)
downloadpki-abhishek-33.zip
pki-abhishek-33.tar.gz
pki-abhishek-33.tar.xz
Fix for improper crl retrieval from CA.abhishek-33
-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 a5a48cc..9bfbc86 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) {
}
}