From 87c92d0d2e170e0c7a6c307fcf98c8b7a0438dda Mon Sep 17 00:00:00 2001 From: Andrew Wnuk Date: Tue, 24 Jul 2012 11:44:32 -0700 Subject: elimination of CA crash This patch eliminates CA crash caused by default Android browser. Bug: 819123. --- base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java | 5 +++++ base/common/src/com/netscape/cms/profile/input/CertReqInput.java | 5 +++++ base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java | 5 +++++ .../src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java | 5 +++++ base/common/src/com/netscape/cms/profile/input/KeyGenInput.java | 5 +++++ .../src/com/netscape/cms/profile/input/SigningKeyGenInput.java | 5 +++++ 6 files changed, 30 insertions(+) (limited to 'base') diff --git a/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java b/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java index 4c368c03e..d2a2fc718 100644 --- a/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java +++ b/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java @@ -96,6 +96,11 @@ public class CMCCertReqInput extends EnrollInput implements IProfileInput { 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) { diff --git a/base/common/src/com/netscape/cms/profile/input/CertReqInput.java b/base/common/src/com/netscape/cms/profile/input/CertReqInput.java index 565b7795e..958845335 100644 --- a/base/common/src/com/netscape/cms/profile/input/CertReqInput.java +++ b/base/common/src/com/netscape/cms/profile/input/CertReqInput.java @@ -106,6 +106,11 @@ public class CertReqInput extends EnrollInput implements IProfileInput { "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); diff --git a/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java b/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java index dfb7be887..178977f86 100644 --- a/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java @@ -105,6 +105,11 @@ public class DualKeyGenInput extends EnrollInput implements IProfileInput { "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); diff --git a/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java b/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java index 4fb7ae863..b70a800d5 100644 --- a/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java @@ -107,6 +107,11 @@ public class EncryptionKeyGenInput extends EnrollInput implements IProfileInput "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); diff --git a/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java b/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java index cc8f9a70d..abf5d334f 100644 --- a/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java @@ -107,6 +107,11 @@ public class KeyGenInput extends EnrollInput implements IProfileInput { "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); diff --git a/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java b/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java index 93aaa11b9..5a35bd0ab 100644 --- a/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java @@ -107,6 +107,11 @@ public class SigningKeyGenInput extends EnrollInput implements IProfileInput { "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); -- cgit