diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-11-19 21:20:37 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-21 10:12:15 -0500 |
commit | c7128845f4c45198e2c3e95770bd45149441ae79 (patch) | |
tree | 31b8fc45f32faeca6539a7a6d4152b6aa1072dde | |
parent | 40e58f937d49f1a0029a226ab714cb54f12a9239 (diff) | |
download | pki-abhishek-33.tar.gz pki-abhishek-33.tar.xz pki-abhishek-33.zip |
Fix for improper crl retrieval from CA.abhishek-33
-rw-r--r-- | base/common/src/com/netscape/cms/servlet/cert/GetCRL.java | 43 |
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) { } } |