>From 45cb28b1b990b31c6ba615acf19896967825cd0f Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Fri, 22 Jun 2012 17:25:32 -0400
Subject: [PATCH] Fix for handling null object value passed to DBAttrMapper as
 part of Coverity fix for Forward NULL cases in DogTag 10.

---
 .../com/netscape/cmscore/dbs/CertRecordMapper.java |   16 ++--
 .../com/netscape/cmscore/dbs/DateArrayMapper.java  |    3 +-
 .../src/com/netscape/cmscore/dbs/DateMapper.java   |    4 +
 .../com/netscape/cmscore/dbs/IntegerMapper.java    |    4 +
 .../com/netscape/cmscore/dbs/KeyRecordMapper.java  |    4 +-
 .../com/netscape/cmscore/dbs/KeyStateMapper.java   |    4 +
 .../src/com/netscape/cmscore/dbs/LongMapper.java   |    7 ++
 .../com/netscape/cmscore/dbs/MetaInfoMapper.java   |    4 +
 .../netscape/cmscore/dbs/ObjectStreamMapper.java   |    7 +-
 .../netscape/cmscore/dbs/RevocationInfoMapper.java |    3 +
 .../netscape/cmscore/dbs/StringVectorMapper.java   |    4 +
 .../com/netscape/cmscore/dbs/X500NameMapper.java   |    3 +
 .../netscape/cmscore/dbs/X509CertImplMapper.java   |    3 +
 .../netscape/cmscore/request/RequestRecord.java    |   93 ++++++++++++--------
 .../com/netscape/cmscore/security/KeyCertUtil.java |    4 +-
 .../com/netscape/pkisilent/http/HTTPClient.java    |    2 +-
 .../security/extensions/GenericASN1Extension.java  |    1 +
 17 files changed, 112 insertions(+), 54 deletions(-)

diff --git a/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java b/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java
index 61d823b8882e40455657b648e2bef929d459a3f8..a074b41e687a6b06f6498cda878af22fa1015c7b 100644
--- a/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java
@@ -59,17 +59,13 @@ public class CertRecordMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
             Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
-        try {
-            CertRecord rec = (CertRecord) obj;
-
-            attrs.add(new LDAPAttribute(
-                    CertDBSchema.LDAP_ATTR_CERT_RECORD_ID,
-                    rec.getSerialNumber().toString()));
-        } catch (Exception e) {
-            Debug.trace(e.toString());
-            throw new EDBException(
-                    CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
         }
+        CertRecord rec = (CertRecord) obj;
+        attrs.add(new LDAPAttribute(
+                CertDBSchema.LDAP_ATTR_CERT_RECORD_ID,
+                rec.getSerialNumber().toString()));
     }
 
     public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs,
diff --git a/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java b/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java
index 2b60be4f6c773fe2493836acdcbd292f9b633aa1..7e55222f4d5b127b4b95a1e4fc2697039241c4e1 100644
--- a/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java
@@ -24,6 +24,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -65,7 +66,7 @@ public class DateArrayMapper implements IDBAttrMapper {
         Date dates[] = (Date[]) obj;
 
         if (dates == null)
-            return;
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
         LDAPAttribute attr = new LDAPAttribute(mLdapName);
 
         for (int i = 0; i < dates.length; i++) {
diff --git a/base/common/src/com/netscape/cmscore/dbs/DateMapper.java b/base/common/src/com/netscape/cmscore/dbs/DateMapper.java
index ab2b2e225ed33a1d760bed5b6033b529a9742efd..cb287f05e7aff5e48c9baa0dd9789d5636e12485 100644
--- a/base/common/src/com/netscape/cmscore/dbs/DateMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/DateMapper.java
@@ -26,6 +26,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -66,6 +67,9 @@ public class DateMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         attrs.add(new LDAPAttribute(mLdapName,
                 dateToDB((Date) obj)));
     }
diff --git a/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java b/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java
index 574030c423b94036f7e9e6f1820af5aedadabe0e..a50ce99d7d66be1ca1511262d52bfb82f654eb87 100644
--- a/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java
@@ -23,6 +23,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -61,6 +62,9 @@ public class IntegerMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         attrs.add(new LDAPAttribute(mLdapName,
                 ((Integer) obj).toString()));
     }
diff --git a/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java b/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java
index 15e6935e212821dc2e81751d7b2455777ab2bb8c..8cf2c12ebece8c0129dff54af5c5283dd98d0f1c 100644
--- a/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java
@@ -59,13 +59,15 @@ public class KeyRecordMapper implements IDBAttrMapper {
 
     public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
             Object obj, LDAPAttributeSet attrs) throws EBaseException {
+        if(obj == null){
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         try {
             KeyRecord rec = (KeyRecord) obj;
 
             attrs.add(new LDAPAttribute(KeyDBSchema.LDAP_ATTR_KEY_RECORD_ID,
                     rec.getSerialNumber().toString()));
         } catch (Exception e) {
-
             /*LogDoc
              *
              * @phase  Maps object to ldap attribute set
diff --git a/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java b/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java
index afb88bf668f7b8678a63d25415bf43477f9e44bc..02b49b1c8ef3d0bae0d161c022e9c398a9a77a2b 100644
--- a/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java
@@ -23,6 +23,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -53,6 +54,9 @@ public class KeyStateMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         attrs.add(new LDAPAttribute(mLdapName,
                 ((KeyState) obj).toString()));
     }
diff --git a/base/common/src/com/netscape/cmscore/dbs/LongMapper.java b/base/common/src/com/netscape/cmscore/dbs/LongMapper.java
index 0afa95c7258c0bef4ef8a43e5851df5402823cb6..2fece86aecd7ddbc10a784508455851430bb762f 100644
--- a/base/common/src/com/netscape/cmscore/dbs/LongMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/LongMapper.java
@@ -23,6 +23,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -61,6 +62,9 @@ public class LongMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         attrs.add(new LDAPAttribute(mLdapName,
                 LongToDB((Long) obj)));
     }
@@ -99,6 +103,9 @@ public class LongMapper implements IDBAttrMapper {
     }
 
     public static String LongToDB(Long i) {
+        if (i == null) {
+            return null;
+        }
         int len = i.toString().length();
         String ret = null;
 
diff --git a/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java b/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java
index f30d13bf69cfd750e8b752bcc2c7cce68c5a6687..f4913b93690799564b675299fe2de5e88bc22180 100644
--- a/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java
@@ -24,6 +24,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.MetaInfo;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
@@ -71,6 +72,9 @@ public class MetaInfoMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         MetaInfo info = (MetaInfo) obj;
         Enumeration<String> e = info.getElements();
 
diff --git a/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java b/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java
index b6f39818a2d6f8f55500273c4b3e2b39983359ea..5c61d36af10f4c0b943906db3e282dbf0af14ade 100644
--- a/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java
@@ -78,13 +78,12 @@ public class ObjectStreamMapper implements IDBAttrMapper {
             byte data[] = bos.toByteArray();
             if (data == null) {
                 CMS.debug("ObjectStreamMapper:mapObjectToLDAPAttributeSet " +
-                           name + " size=0");
+                        name + " size=0");
             } else {
                 CMS.debug("ObjectStreamMapper:mapObjectToLDAPAttributeSet " +
-                           name + " size=" + data.length);
+                        name + " size=" + data.length);
             }
-            attrs.add(new LDAPAttribute(mLdapName,
-                    data));
+            attrs.add(new LDAPAttribute(mLdapName, data));
         } catch (IOException e) {
 
             /*LogDoc
diff --git a/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java b/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
index 2b9bca3d5b9e30e0ea4631f38ca0dcd2aff4d4c0..e033f815496834b6e45ae507386cdb2d484d149e 100644
--- a/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
@@ -64,6 +64,9 @@ public class RevocationInfoMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
             Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         try {
             // in format of <date>;<extensions>
             StringBuffer value = new StringBuffer();
diff --git a/base/common/src/com/netscape/cmscore/dbs/StringVectorMapper.java b/base/common/src/com/netscape/cmscore/dbs/StringVectorMapper.java
index 60dec48b76fd387a13fa248f34c2f86e1ae23d32..db2c9ee589c4e48e20c1db12b3527cae03f54d18 100644
--- a/base/common/src/com/netscape/cmscore/dbs/StringVectorMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/StringVectorMapper.java
@@ -23,6 +23,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
 import com.netscape.certsrv.dbs.IDBObj;
@@ -61,6 +62,9 @@ public class StringVectorMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         @SuppressWarnings("unchecked")
         Vector<String> v = (Vector<String>) obj;
         int s = v.size();
diff --git a/base/common/src/com/netscape/cmscore/dbs/X500NameMapper.java b/base/common/src/com/netscape/cmscore/dbs/X500NameMapper.java
index 684f27c22f74e887701911cb0d7cf0f294b0fe8b..50d938d81a57ddc4d8071e49aa68bd899567071f 100644
--- a/base/common/src/com/netscape/cmscore/dbs/X500NameMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/X500NameMapper.java
@@ -68,6 +68,9 @@ public class X500NameMapper implements IDBAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
             String name, Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         attrs.add(new LDAPAttribute(mLdapName,
                 ((X500Name) obj).toString()));
     }
diff --git a/base/common/src/com/netscape/cmscore/dbs/X509CertImplMapper.java b/base/common/src/com/netscape/cmscore/dbs/X509CertImplMapper.java
index 6fbb2cfcaa5acdf6be01d32085b9c321c3b85c2f..15fe408dd707dcd014099b3f377c6c61bcb1277c 100644
--- a/base/common/src/com/netscape/cmscore/dbs/X509CertImplMapper.java
+++ b/base/common/src/com/netscape/cmscore/dbs/X509CertImplMapper.java
@@ -71,6 +71,9 @@ public class X509CertImplMapper implements IDBAttrMapper {
 
     public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
             Object obj, LDAPAttributeSet attrs) throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         try {
             X509CertImpl cert = (X509CertImpl) obj;
             // make information searchable
diff --git a/base/common/src/com/netscape/cmscore/request/RequestRecord.java b/base/common/src/com/netscape/cmscore/request/RequestRecord.java
index fe6320ca6c6ddd071c30ac1f14a60aa3f83a459c..2c81a1354e3511c2f8dcd08b3fb8ab436fbe7e4e 100644
--- a/base/common/src/com/netscape/cmscore/request/RequestRecord.java
+++ b/base/common/src/com/netscape/cmscore/request/RequestRecord.java
@@ -33,6 +33,7 @@ import java.util.Vector;
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
 
+import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.dbs.EDBException;
 import com.netscape.certsrv.dbs.IDBAttrMapper;
@@ -337,7 +338,10 @@ class RequestStateMapper
 
     //
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
-            String name, Object obj, LDAPAttributeSet attrs) {
+            String name, Object obj, LDAPAttributeSet attrs) throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         RequestStatus rs = (RequestStatus) obj;
 
         attrs.add(new LDAPAttribute(Schema.LDAP_ATTR_REQUEST_STATE,
@@ -388,7 +392,10 @@ class RequestIdMapper
 
     //
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
-            String name, Object obj, LDAPAttributeSet attrs) {
+            String name, Object obj, LDAPAttributeSet attrs) throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         RequestId rid = (RequestId) obj;
 
         String v = BigIntegerMapper.BigIntegerToDB(new BigInteger(rid.toString()));
@@ -410,7 +417,7 @@ class RequestIdMapper
                 BigIntegerMapper.BigIntegerFromDB(value).toString()));
     }
 
-    public String mapSearchFilter(String name, String op, String value) {
+    public String mapSearchFilter(String name, String op, String value) throws EBaseException {
         String v = null;
 
         try {
@@ -450,14 +457,18 @@ class RequestAttrsMapper
 
     //
     public void mapObjectToLDAPAttributeSet(IDBObj parent,
-            String name, Object obj, LDAPAttributeSet attrs) {
+            String name, Object obj, LDAPAttributeSet attrs) throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         @SuppressWarnings("unchecked")
         Hashtable<String, Object> ht = (Hashtable<String, Object>) obj;
         Enumeration<String> e = ht.keys();
-
+        ByteArrayOutputStream bos = null;
+        ObjectOutputStream os = null;
         try {
-            ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            ObjectOutputStream os = new ObjectOutputStream(bos);
+            bos = new ByteArrayOutputStream();
+            os = new ObjectOutputStream(bos);
 
             String key = null;
             Object value = null;
@@ -487,16 +498,33 @@ class RequestAttrsMapper
             }
 
             os.writeObject(null);
-            os.close();
+            os.flush();
 
             attrs.add(new LDAPAttribute(Schema.LDAP_ATTR_REQUEST_ATTRS,
                     bos.toByteArray()));
         } catch (Exception x) {
-            Debug.trace("Output Mapping Error in requeset ID " +
-                    ((RequestRecord) parent).getRequestId().toString() + " : " + x);
+            if (parent != null)
+                Debug.trace("Output Mapping Error in requeset ID " +
+                        ((RequestRecord) parent).getRequestId().toString() + " : " + x);
             //if (Debug.ON) {
             Debug.printStackTrace(x);
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
             //}
+        } finally {
+            if (os != null) {
+                try {
+                    os.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+            if (bos != null) {
+                try {
+                    bos.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
         }
     }
 
@@ -777,38 +805,33 @@ class ExtAttrDynMapper implements IDBDynAttrMapper {
     public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
                                             Object obj, LDAPAttributeSet attrs)
             throws EBaseException {
+        if (obj == null) {
+            throw new EBaseException(CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name));
+        }
         @SuppressWarnings("unchecked")
         Hashtable<String, Object> ht = (Hashtable<String, Object>) obj;
         Enumeration<String> e = ht.keys();
 
-        try {
-            while (e.hasMoreElements()) {
-                String key = e.nextElement();
-                Object value = ht.get(key);
-                if (value instanceof String) {
-                    String stringValue = (String) value;
+        while (e.hasMoreElements()) {
+            String key = e.nextElement();
+            Object value = ht.get(key);
+            if (value instanceof String) {
+                String stringValue = (String) value;
+                attrs.add(new LDAPAttribute(
+                        extAttrPrefix + encodeKey(key),
+                        stringValue));
+            } else if (value instanceof Hashtable) {
+                @SuppressWarnings("unchecked")
+                Hashtable<String, String> innerHash = (Hashtable<String, String>) value;
+                Enumeration<String> innerHashEnum = innerHash.keys();
+                while (innerHashEnum.hasMoreElements()) {
+                    String innerKey = innerHashEnum.nextElement();
+                    String innerValue = innerHash.get(innerKey);
                     attrs.add(new LDAPAttribute(
-                            extAttrPrefix + encodeKey(key),
-                            stringValue));
-                } else if (value instanceof Hashtable) {
-                    @SuppressWarnings("unchecked")
-                    Hashtable<String, String> innerHash = (Hashtable<String, String>) value;
-                    Enumeration<String> innerHashEnum = innerHash.keys();
-                    while (innerHashEnum.hasMoreElements()) {
-                        String innerKey = innerHashEnum.nextElement();
-                        String innerValue = innerHash.get(innerKey);
-                        attrs.add(new LDAPAttribute(
-                                extAttrPrefix + encodeKey(key) + ";" + encodeKey(innerKey),
-                                innerValue));
-                    }
+                            extAttrPrefix + encodeKey(key) + ";" + encodeKey(innerKey),
+                            innerValue));
                 }
             }
-        } catch (Exception x) {
-            Debug.trace("Output Mapping Error in requeset ID " +
-                    ((IRequestRecord) parent).getRequestId().toString() + " : " + x);
-            //if (Debug.ON) {
-            Debug.printStackTrace(x);
-            //}
         }
     }
 
diff --git a/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java b/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
index 80ad36c2d4e90c2b1aa57b92f48b49d50fe868a3..210c042276b937a40bc206dce72f670834c1e8e0 100644
--- a/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
+++ b/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java
@@ -1052,7 +1052,7 @@ public class KeyCertUtil {
     }
 
     public static BigInteger getSerialNumber(LDAPConnection conn, String baseDN)
-            throws LDAPException {
+            throws LDAPException, EBaseException {
         String dn = "ou=certificateRepository,ou=ca," + baseDN;
         BigInteger serialno = null;
         LDAPEntry entry = conn.read(dn);
@@ -1077,7 +1077,7 @@ public class KeyCertUtil {
 
     public static void setSerialNumber(LDAPConnection conn,
             String baseDN, BigInteger serial)
-            throws LDAPException {
+            throws LDAPException, EBaseException {
         String dn = "ou=certificateRepository,ou=ca," + baseDN;
         LDAPAttribute attr = new LDAPAttribute("serialno");
 
diff --git a/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java b/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java
index c98fe219335a2c05ddc9e7fadea4aa71073195ae..49d9e1846ed98958c024df593f2802809a435b29 100644
--- a/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java
+++ b/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java
@@ -657,7 +657,7 @@ public class HTTPClient implements SSLCertificateApprovalCallback {
         } else {
             // This should never happen -- an empty response
             System.out.println("Unable to parse response header -- empty " +
-                              "header");
+                    "header");
             throw new Exception("Unable to create response. Empty header.");
         }
 
diff --git a/base/util/src/netscape/security/extensions/GenericASN1Extension.java b/base/util/src/netscape/security/extensions/GenericASN1Extension.java
index dfd34de2dbc42a90d613e6cd5d53d7bf63e32924..b682b4f65b5c6f169376d28de9ffa7674a44460d 100644
--- a/base/util/src/netscape/security/extensions/GenericASN1Extension.java
+++ b/base/util/src/netscape/security/extensions/GenericASN1Extension.java
@@ -434,6 +434,7 @@ public class GenericASN1Extension extends Extension
                 fis.close();
             }
         }
+
         for (i = 0, j = 0; j < s.length(); j++) {
             int ch = s.charAt(j);
             if (ch == 10 || ch == 13 || ch == 9)
-- 
1.7.10.2

