summaryrefslogtreecommitdiffstats
path: root/pki
diff options
context:
space:
mode:
authorcfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2010-09-03 03:05:03 +0000
committercfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2010-09-03 03:05:03 +0000
commitbaaf98125048870e9385fce9f8a31ea1a4113a85 (patch)
tree1c99f5ba1a7a55b8e697014c3e4bda364a1f30f6 /pki
parent05ef43f1efa8af6af68afc5ccf27e4cc5a298973 (diff)
downloadpki-baaf98125048870e9385fce9f8a31ea1a4113a85.tar.gz
pki-baaf98125048870e9385fce9f8a31ea1a4113a85.tar.xz
pki-baaf98125048870e9385fce9f8a31ea1a4113a85.zip
Bugzilla 629677 - TPS: token enrollment fails
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1259 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki')
-rw-r--r--pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java36
1 files changed, 25 insertions, 11 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java
index a3b99545a..b60b73c9a 100644
--- a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java
+++ b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java
@@ -95,13 +95,6 @@ public abstract class EnrollProfile extends BasicProfile
CMS.debug("EnrollProfile: request type is null");
}
- /* cert request must not be null */
- if (cert_request == null) {
- CMS.debug("EnrollProfile: cert_request null");
- throw new EProfileException(
- CMS.getUserMessage(locale, "CMS_PROFILE_INVALID_REQUEST"));
- }
-
int num_requests = 1; // default to 1 request
if (cert_request_type != null && cert_request_type.startsWith("pkcs10")) {
@@ -314,11 +307,18 @@ public abstract class EnrollProfile extends BasicProfile
public TaggedRequest[] parseCMC(Locale locale, String certreq)
throws EProfileException {
+ /* cert request must not be null */
+ if (certreq == null) {
+ CMS.debug("EnrollProfile: parseCMC() certreq null");
+ throw new EProfileException(
+ CMS.getUserMessage(locale, "CMS_PROFILE_INVALID_REQUEST"));
+ }
+ CMS.debug("EnrollProfile: Start parseCMC(): " + certreq);
+
Hashtable t1 = new Hashtable();
TaggedRequest msgs[] = null;
String creq = normalizeCertReq(certreq);
- CMS.debug("Start parseCMC " + certreq);
try {
byte data[] = CMS.AtoB(creq);
ByteArrayInputStream cmcBlobIn =
@@ -692,9 +692,16 @@ public abstract class EnrollProfile extends BasicProfile
public CertReqMsg[] parseCRMF(Locale locale, String certreq)
throws EProfileException {
- CertReqMsg msgs[] = null;
- CMS.debug("Start parseCRMF " + certreq);
+ /* cert request must not be null */
+ if (certreq == null) {
+ CMS.debug("EnrollProfile: parseCRMF() certreq null");
+ throw new EProfileException(
+ CMS.getUserMessage(locale, "CMS_PROFILE_INVALID_REQUEST"));
+ }
+ CMS.debug("EnrollProfile: Start parseCRMF(): " + certreq);
+
+ CertReqMsg msgs[] = null;
String creq = normalizeCertReq(certreq);
try {
byte data[] = CMS.AtoB(creq);
@@ -907,7 +914,14 @@ public abstract class EnrollProfile extends BasicProfile
public PKCS10 parsePKCS10(Locale locale, String certreq)
throws EProfileException {
- CMS.debug("xx Start parsePKCS10 " + certreq);
+ /* cert request must not be null */
+ if (certreq == null) {
+ CMS.debug("EnrollProfile:parsePKCS10() certreq null");
+ throw new EProfileException(
+ CMS.getUserMessage(locale, "CMS_PROFILE_INVALID_REQUEST"));
+ }
+ CMS.debug("Start parsePKCS10(): " + certreq);
+
// trim header and footer
String creq = normalizeCertReq(certreq);