diff options
author | Andrew Wnuk <awnuk@redhat.com> | 2012-07-24 14:04:22 -0700 |
---|---|---|
committer | Andrew Wnuk <awnuk@redhat.com> | 2012-07-24 14:04:22 -0700 |
commit | 7168edccfcdb769ead6d5cbc02f7fab9772e1a82 (patch) | |
tree | 2f3ab5595b3059ed46350c29b05c80d09ec245c6 /base | |
parent | 4e1010be23195c3f00be4c0bfd0fdd5bda5f1148 (diff) | |
download | pki-7168edccfcdb769ead6d5cbc02f7fab9772e1a82.tar.gz pki-7168edccfcdb769ead6d5cbc02f7fab9772e1a82.tar.xz pki-7168edccfcdb769ead6d5cbc02f7fab9772e1a82.zip |
elimination of CA crash
This patch eliminates CA crash caused by default Android browser.
Bug: 819123.
Diffstat (limited to 'base')
6 files changed, 30 insertions, 0 deletions
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 901cf5c71..8ce1be3ee 100644 --- a/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java +++ b/base/common/src/com/netscape/cms/profile/input/CMCCertReqInput.java @@ -89,6 +89,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 50fac5a41..e67f5b501 100644 --- a/base/common/src/com/netscape/cms/profile/input/CertReqInput.java +++ b/base/common/src/com/netscape/cms/profile/input/CertReqInput.java @@ -102,6 +102,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 3205fca0a..8a2629667 100644 --- a/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/DualKeyGenInput.java @@ -104,6 +104,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 63c18483c..dae8143ee 100644 --- a/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/EncryptionKeyGenInput.java @@ -104,6 +104,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 8be954024..1b3564ab7 100644 --- a/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/KeyGenInput.java @@ -104,6 +104,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 d60ed551f..6ee2fd42e 100644 --- a/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java +++ b/base/common/src/com/netscape/cms/profile/input/SigningKeyGenInput.java @@ -104,6 +104,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); |