Index: pki/dogtag/ca-ui/shared/webapps/ca/ee/ca/ProfileSelect.template =================================================================== --- pki/dogtag/ca-ui/shared/webapps/ca/ee/ca/ProfileSelect.template (revision 2439) +++ pki/dogtag/ca-ui/shared/webapps/ca/ee/ca/ProfileSelect.template (working copy) @@ -212,7 +212,7 @@ keyTransportCert = transportCert; } // generate keys for nsm. - if (typeof(crypto.version) != "undefined") { + if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { var encKeyType = "rsa-ex"; var signKeyType = "rsa-sign"; var dualKeyType = "rsa-dual-use"; @@ -314,7 +314,7 @@ document.writeln(""); } document.writeln('
'); - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.writeln(''); } else { document.writeln(''); @@ -588,7 +588,7 @@ } else if (inputListSet[n].inputSyntax == 'dual_keygen_request') { if (navigator.appName == "Microsoft Internet Explorer") { document.writeln(''); - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.write(''); document.write('  '); document.write(keyTypeOptions("encryption")+'  (Encryption),  '); @@ -606,7 +606,7 @@ if (navigator.appName == "Microsoft Internet Explorer") { document.writeln(''); document.writeln('  '); - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.write(''); document.write(''); document.write('   '+keyTypeOptions("")+'  '); @@ -627,7 +627,7 @@ keygen_request = 'true'; if (navigator.appName == "Microsoft Internet Explorer") { document.writeln('Not Supported'); - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.writeln('crmf'); } else { document.writeln('Not Supported'); @@ -638,7 +638,7 @@ keygen_request = 'true'; if (navigator.appName == "Microsoft Internet Explorer") { document.writeln('pkcs10'); - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.writeln('crmf'); } else { document.writeln('keygen'); @@ -670,7 +670,7 @@ } else { document.writeln(''); } - } else if (typeof(crypto.version) != "undefined") { + } else if (typeof(crypto) != "undefined" && typeof(crypto.version) != "undefined") { document.writeln(''); } else { document.writeln(''); Index: pki/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java (working copy) @@ -107,6 +107,11 @@ "CMS_PROFILE_UNKNOWN_CERT_REQ_TYPE", "")); } + if (keygen_request == null) { + CMS.debug("KeyGenInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } if (keygen_request_type.startsWith(EnrollProfile.REQ_TYPE_PKCS10)) { PKCS10 pkcs10 = mEnrollProfile.parsePKCS10(getLocale(request), keygen_request); Index: pki/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java (working copy) @@ -96,6 +96,11 @@ X509CertInfo info = request.getExtDataInCertInfo(EnrollProfile.REQUEST_CERTINFO); + if (cert_request == null) { + CMS.debug("CMCCertReqInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } TaggedRequest msgs[] = mEnrollProfile.parseCMC(getLocale(request), cert_request); if (msgs == null) { Index: pki/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java (working copy) @@ -105,6 +105,11 @@ "CMS_PROFILE_UNKNOWN_CERT_REQ_TYPE", "")); } + if (keygen_request == null) { + CMS.debug("DualKeyGenInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } if (keygen_request_type.startsWith("pkcs10")) { PKCS10 pkcs10 = mEnrollProfile.parsePKCS10(getLocale(request), keygen_request); Index: pki/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java (working copy) @@ -107,6 +107,11 @@ "CMS_PROFILE_UNKNOWN_CERT_REQ_TYPE", "")); } + if (keygen_request == null) { + CMS.debug("EncryptionKeyGenInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } if (keygen_request_type.startsWith(EnrollProfile.REQ_TYPE_PKCS10)) { PKCS10 pkcs10 = mEnrollProfile.parsePKCS10(getLocale(request), keygen_request); Index: pki/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java (working copy) @@ -107,6 +107,11 @@ "CMS_PROFILE_UNKNOWN_CERT_REQ_TYPE", "")); } + if (keygen_request == null) { + CMS.debug("SigningKeyGenInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } if (keygen_request_type.startsWith(EnrollProfile.REQ_TYPE_PKCS10)) { PKCS10 pkcs10 = mEnrollProfile.parsePKCS10(getLocale(request), keygen_request); Index: pki/base/common/src/com/netscape/cms/profile/input/CertReqInput.java =================================================================== --- pki/base/common/src/com/netscape/cms/profile/input/CertReqInput.java (revision 2439) +++ pki/base/common/src/com/netscape/cms/profile/input/CertReqInput.java (working copy) @@ -106,6 +106,11 @@ "CMS_PROFILE_UNKNOWN_CERT_REQ_TYPE", "")); } + if (cert_request == null) { + CMS.debug("CertReqInput: populate - invalid certificate request"); + throw new EProfileException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_NO_CERT_REQ")); + } if (cert_request_type.equals(EnrollProfile.REQ_TYPE_PKCS10)) { PKCS10 pkcs10 = mEnrollProfile.parsePKCS10(getLocale(request), cert_request);