summaryrefslogtreecommitdiffstats
path: root/base/server/cms/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'base/server/cms/src/com')
-rw-r--r--base/server/cms/src/com/netscape/cms/profile/def/EnrollDefault.java11
-rw-r--r--base/server/cms/src/com/netscape/cms/profile/def/GenericExtDefault.java17
2 files changed, 26 insertions, 2 deletions
diff --git a/base/server/cms/src/com/netscape/cms/profile/def/EnrollDefault.java b/base/server/cms/src/com/netscape/cms/profile/def/EnrollDefault.java
index 5c2029a0f..8a6fa4cef 100644
--- a/base/server/cms/src/com/netscape/cms/profile/def/EnrollDefault.java
+++ b/base/server/cms/src/com/netscape/cms/profile/def/EnrollDefault.java
@@ -259,7 +259,11 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
setValue(name, locale, info, value);
- request.setExtData(IEnrollProfile.REQUEST_CERTINFO, info);
+ boolean ret = request.setExtData(IEnrollProfile.REQUEST_CERTINFO, info);
+ if (ret == false) {
+ CMS.debug("EnrollDefault: setValue(): request.setExtData() returned false");
+ throw new EPropertyException("EnrollDefault: setValue(): request.setExtData() failed");
+ }
}
/**
@@ -328,6 +332,11 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
protected Extension getExtension(String name, X509CertInfo info) {
CertificateExtensions exts = null;
+ if (info == null) {
+ CMS.debug("EnrollDefault: getExtension(), info == null");
+ return null;
+ }
+
try {
exts = (CertificateExtensions)
info.get(X509CertInfo.EXTENSIONS);
diff --git a/base/server/cms/src/com/netscape/cms/profile/def/GenericExtDefault.java b/base/server/cms/src/com/netscape/cms/profile/def/GenericExtDefault.java
index f344648ab..5c9fdd5c8 100644
--- a/base/server/cms/src/com/netscape/cms/profile/def/GenericExtDefault.java
+++ b/base/server/cms/src/com/netscape/cms/profile/def/GenericExtDefault.java
@@ -99,6 +99,11 @@ public class GenericExtDefault extends EnrollExtDefault {
public void setValue(String name, Locale locale,
X509CertInfo info, String value)
throws EPropertyException {
+ if (info == null) {
+ CMS.debug("GenericExtDefault: setValue() info == null");
+ throw new EPropertyException("GenericExtDefault: setValue() info == null");
+ }
+
try {
Extension ext = null;
@@ -136,7 +141,11 @@ public class GenericExtDefault extends EnrollExtDefault {
replaceExtension(ext.getExtensionId().toString(), ext, info);
} catch (EProfileException e) {
- CMS.debug("GenericExtDefault: setValue " + e.toString());
+ CMS.debug("GenericExtDefault: setValue() " + e.toString());
+ throw new EPropertyException("GenericExtDefault:"+ e.toString());
+ } catch (Exception e) {
+ // catch all other exceptions
+ CMS.debug("GenericExtDefault: setValue() " + e.toString());
}
}
@@ -150,6 +159,12 @@ public class GenericExtDefault extends EnrollExtDefault {
locale, "CMS_INVALID_PROPERTY", name));
}
+ if (info == null) {
+ CMS.debug("GenericExtDefault : getValue(): info == null");
+ throw new EPropertyException(CMS.getUserMessage(
+ locale, "GenericExtDefault : getValue(): info == null"));
+ }
+
ObjectIdentifier oid = new ObjectIdentifier(getConfig(CONFIG_OID));
ext = getExtension(oid.toString(), info);