diff options
author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-06-10 16:15:54 +0000 |
---|---|---|
committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-06-10 16:15:54 +0000 |
commit | 896d10e3af28ac280684f802eb192c1ab25d8d02 (patch) | |
tree | b2270868e405f13f5bc26c164a3ef1b056b3e6d0 /pki/base | |
parent | 7433e539c115c641849ddb3c8cda507e3042a579 (diff) | |
download | pki-896d10e3af28ac280684f802eb192c1ab25d8d02.tar.gz pki-896d10e3af28ac280684f802eb192c1ab25d8d02.tar.xz pki-896d10e3af28ac280684f802eb192c1ab25d8d02.zip |
Bugzilla Bug #504420 - Make certain that Array Types are processed prior to
non-Array types . . .
Bugzilla Bug #483519 - rhcs73 migration tool misses iplanet case ERROR type -
iplanet.security.x509.X509CertImpl[1,0]
Bugzilla Bug #483373 - rhpki-migrate-7.3.0-9.el4 - TxtTo73/run.sh CLASSPATH
uses TxtTo72 classes path
Bugzilla Bug #451304 - 42ToTxt - Need to add i18n.jar to classpath for KRA
LDIF conversion
Bugzilla Bug #225031 - migrate/47ToTxt/run.sh against this sample ldif gives
AuthToken=certSerialNo:[Ljava.math.BigInteger.... error.
Bugzilla Bug #224972 - Migration / Upgrade script problems....
Bugzilla Bug #224801 - Upgrade script needs to change to drop those cert
request which were created by old jars (iplanet) files
Bugzilla Bug #224800 - txt to cms 62 upgrade script fails on some of the
request.
Bugzilla Bug #224763 - Migration scripts do not currently handle array of
strings properly
Bugzilla Bug #223360 - Upgrade tools does not currently handle some of the
parameters.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@573 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base')
102 files changed, 2033 insertions, 885 deletions
diff --git a/pki/base/migrate/41ToTxt/classes/CMS41LdifParser.class b/pki/base/migrate/41ToTxt/classes/CMS41LdifParser.class Binary files differindex 9e8c2951..b787984a 100644 --- a/pki/base/migrate/41ToTxt/classes/CMS41LdifParser.class +++ b/pki/base/migrate/41ToTxt/classes/CMS41LdifParser.class diff --git a/pki/base/migrate/41ToTxt/classes/Main.class b/pki/base/migrate/41ToTxt/classes/Main.class Binary files differindex b534ce99..87854eb4 100644 --- a/pki/base/migrate/41ToTxt/classes/Main.class +++ b/pki/base/migrate/41ToTxt/classes/Main.class diff --git a/pki/base/migrate/41ToTxt/run.sh b/pki/base/migrate/41ToTxt/run.sh index 0e9a40e8..390195ea 100755 --- a/pki/base/migrate/41ToTxt/run.sh +++ b/pki/base/migrate/41ToTxt/run.sh @@ -187,5 +187,5 @@ export LD_LIBRARY_PATH ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/bin/jssjava -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss.jar:${SERVER_ROOT}/bin/cert/jars/jssjdk12.jar:${SERVER_ROOT}/bin/base/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/bin/jssjava -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss.jar:${SERVER_ROOT}/bin/cert/jars/jssjdk12.jar:${SERVER_ROOT}/bin/base/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/41ToTxt/src/Main.java b/pki/base/migrate/41ToTxt/src/Main.java index 39b3035a..758d725a 100644 --- a/pki/base/migrate/41ToTxt/src/Main.java +++ b/pki/base/migrate/41ToTxt/src/Main.java @@ -362,7 +362,23 @@ class CMS41LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -392,10 +408,17 @@ class CMS41LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -416,6 +439,21 @@ class CMS41LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/42SP2ToTxt/classes/CMS42SP2LdifParser.class b/pki/base/migrate/42SP2ToTxt/classes/CMS42SP2LdifParser.class Binary files differindex a6f2438e..dbf8a117 100644 --- a/pki/base/migrate/42SP2ToTxt/classes/CMS42SP2LdifParser.class +++ b/pki/base/migrate/42SP2ToTxt/classes/CMS42SP2LdifParser.class diff --git a/pki/base/migrate/42SP2ToTxt/classes/Main.class b/pki/base/migrate/42SP2ToTxt/classes/Main.class Binary files differindex 41d08aed..d881f356 100644 --- a/pki/base/migrate/42SP2ToTxt/classes/Main.class +++ b/pki/base/migrate/42SP2ToTxt/classes/Main.class diff --git a/pki/base/migrate/42SP2ToTxt/run.sh b/pki/base/migrate/42SP2ToTxt/run.sh index bbb056f0..79a20370 100755 --- a/pki/base/migrate/42SP2ToTxt/run.sh +++ b/pki/base/migrate/42SP2ToTxt/run.sh @@ -201,5 +201,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss21.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss21.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/42SP2ToTxt/src/Main.java b/pki/base/migrate/42SP2ToTxt/src/Main.java index 9f648aef..1a324d8e 100644 --- a/pki/base/migrate/42SP2ToTxt/src/Main.java +++ b/pki/base/migrate/42SP2ToTxt/src/Main.java @@ -365,7 +365,23 @@ class CMS42SP2LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -395,10 +411,17 @@ class CMS42SP2LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -419,6 +442,21 @@ class CMS42SP2LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/42SP2ToTxt/src/compile.sh b/pki/base/migrate/42SP2ToTxt/src/compile.sh index a6f9c816..26aa6140 100755 --- a/pki/base/migrate/42SP2ToTxt/src/compile.sh +++ b/pki/base/migrate/42SP2ToTxt/src/compile.sh @@ -16,7 +16,7 @@ ### Set SERVER_ROOT - identify the CMS <server_root> used to compile 42SP2ToTxt ### -#SERVER_ROOT=/export/home/migrate/cms43 +#SERVER_ROOT=/export/home/migrate/cms42sp2 #export SERVER_ROOT diff --git a/pki/base/migrate/42ToTxt/classes/CMS42LdifParser.class b/pki/base/migrate/42ToTxt/classes/CMS42LdifParser.class Binary files differindex cba47657..81c20523 100644 --- a/pki/base/migrate/42ToTxt/classes/CMS42LdifParser.class +++ b/pki/base/migrate/42ToTxt/classes/CMS42LdifParser.class diff --git a/pki/base/migrate/42ToTxt/classes/Main.class b/pki/base/migrate/42ToTxt/classes/Main.class Binary files differindex 8f1cccca..7a75e96c 100644 --- a/pki/base/migrate/42ToTxt/classes/Main.class +++ b/pki/base/migrate/42ToTxt/classes/Main.class diff --git a/pki/base/migrate/42ToTxt/run.sh b/pki/base/migrate/42ToTxt/run.sh index 2eedfb39..3172159f 100755 --- a/pki/base/migrate/42ToTxt/run.sh +++ b/pki/base/migrate/42ToTxt/run.sh @@ -201,5 +201,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/jre -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss.jar:${SERVER_ROOT}/bin/cert/jars/jssjdk12.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/jre -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss.jar:${SERVER_ROOT}/bin/cert/jars/jssjdk12.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/42ToTxt/src/Main.java b/pki/base/migrate/42ToTxt/src/Main.java index 041ea329..55e64df0 100644 --- a/pki/base/migrate/42ToTxt/src/Main.java +++ b/pki/base/migrate/42ToTxt/src/Main.java @@ -365,7 +365,23 @@ class CMS42LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -395,10 +411,17 @@ class CMS42LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -419,6 +442,21 @@ class CMS42LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/45ToTxt/classes/CMS45LdifParser.class b/pki/base/migrate/45ToTxt/classes/CMS45LdifParser.class Binary files differindex 89d8e48e..75d4ab47 100644 --- a/pki/base/migrate/45ToTxt/classes/CMS45LdifParser.class +++ b/pki/base/migrate/45ToTxt/classes/CMS45LdifParser.class diff --git a/pki/base/migrate/45ToTxt/classes/Main.class b/pki/base/migrate/45ToTxt/classes/Main.class Binary files differindex f6feba04..a1f3e91c 100644 --- a/pki/base/migrate/45ToTxt/classes/Main.class +++ b/pki/base/migrate/45ToTxt/classes/Main.class diff --git a/pki/base/migrate/45ToTxt/run.sh b/pki/base/migrate/45ToTxt/run.sh index 18f9c9b6..f19a550d 100755 --- a/pki/base/migrate/45ToTxt/run.sh +++ b/pki/base/migrate/45ToTxt/run.sh @@ -192,5 +192,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/45ToTxt/src/Main.java b/pki/base/migrate/45ToTxt/src/Main.java index f93623d6..916ca9cd 100644 --- a/pki/base/migrate/45ToTxt/src/Main.java +++ b/pki/base/migrate/45ToTxt/src/Main.java @@ -367,7 +367,23 @@ class CMS45LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -397,10 +413,17 @@ class CMS45LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -421,6 +444,21 @@ class CMS45LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/45ToTxt/src/compile.sh b/pki/base/migrate/45ToTxt/src/compile.sh index 84df9b9c..a08eea1b 100755 --- a/pki/base/migrate/45ToTxt/src/compile.sh +++ b/pki/base/migrate/45ToTxt/src/compile.sh @@ -6,7 +6,7 @@ ##################################################################### ### ### ### This script creates the "45ToTxt/classes/Main.class" and ### -### "41ToTxt/classes/CMS45LdifParser.class" which are ### +### "45ToTxt/classes/CMS45LdifParser.class" which are ### ### used to create a normalized CMS 4.5 ldif text file. ### ### ### ##################################################################### diff --git a/pki/base/migrate/47ToTxt/classes/CMS47LdifParser.class b/pki/base/migrate/47ToTxt/classes/CMS47LdifParser.class Binary files differindex c94aaac2..79d1bc12 100644 --- a/pki/base/migrate/47ToTxt/classes/CMS47LdifParser.class +++ b/pki/base/migrate/47ToTxt/classes/CMS47LdifParser.class diff --git a/pki/base/migrate/47ToTxt/classes/Main.class b/pki/base/migrate/47ToTxt/classes/Main.class Binary files differindex c0d51a85..7ee99ee9 100644 --- a/pki/base/migrate/47ToTxt/classes/Main.class +++ b/pki/base/migrate/47ToTxt/classes/Main.class diff --git a/pki/base/migrate/47ToTxt/run.sh b/pki/base/migrate/47ToTxt/run.sh index 9fa77971..35a41bc9 100755 --- a/pki/base/migrate/47ToTxt/run.sh +++ b/pki/base/migrate/47ToTxt/run.sh @@ -201,5 +201,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/47ToTxt/src/Main.java b/pki/base/migrate/47ToTxt/src/Main.java index 671447ac..194c277f 100644 --- a/pki/base/migrate/47ToTxt/src/Main.java +++ b/pki/base/migrate/47ToTxt/src/Main.java @@ -197,9 +197,21 @@ class CMS47LdifParser public void output(String key, Object obj) throws Exception { + String data_type = null; + String translation = null; if (obj instanceof String) { + data_type = obj.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + - key + ":" + obj.getClass().getName() + "=" + + key + ":" + translation + "=" + obj); } else if (obj instanceof iplanet.security.x509.CertificateX509Key) { iplanet.security.x509.CertificateX509Key o = @@ -301,11 +313,21 @@ class CMS47LdifParser java.security.cert.Certificate o[] = (java.security.cert.Certificate[])obj; for (int i = 0; i < o.length; i++) { + data_type = o[i].getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } ByteArrayOutputStream bos = new ByteArrayOutputStream(); BASE64Encoder encoder = new BASE64Encoder(); System.out.println(" " + - key + ":" + o[i].getClass().getName() +"["+o.length+","+i+"]" + "=" + + key + ":" + translation +"["+o.length+","+i+"]" + "=" + encoder.encode(o[i].getEncoded())); } } else if (obj instanceof com.iplanet.certsrv.base.ArgBlock) { @@ -327,19 +349,49 @@ class CMS47LdifParser Object ob = o.get(k); if (ob != null) { if (ob instanceof java.util.Date) { + data_type = ob.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + key + ":" + "com.netscape.certsrv.dbs.keydb.KeyRecord" + "=" + - k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + k + ":" + translation + "=" + ((java.util.Date)ob).getTime()); } else if (ob instanceof byte[]) { + data_type = ob.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } BASE64Encoder encoder = new BASE64Encoder(); System.out.println(" " + key + ":" + "com.netscape.certsrv.dbs.keydb.KeyRecord" + "=" + - k + ":" + ob.getClass().getName() + "=" + encoder.encode((byte[])ob)); + k + ":" + translation + "=" + encoder.encode((byte[])ob)); } else { + data_type = ob.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + key + ":" + "com.netscape.certsrv.dbs.keydb.KeyRecord" + "=" + - k + ":" + ob.getClass().getName() + "=" + ob); + k + ":" + translation + "=" + ob); } } } @@ -371,10 +423,46 @@ class CMS47LdifParser String k = (String)e.nextElement(); Object ob = o.get(k); if (ob instanceof java.util.Date) { + data_type = ob.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + - k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + k + ":" + translation + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + data_type = o.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } String str[] = (String[])ob; String v = ""; if (str != null) { @@ -386,12 +474,22 @@ class CMS47LdifParser } } System.out.println(" " + - key + ":" + o.getClass().getName() + "=" + + key + ":" + translation + "=" + k + ":" + "java.lang.String" + "=" + v); } else { + data_type = ob.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + - k + ":" + ob.getClass().getName() + "=" + ob); + k + ":" + translation + "=" + ob); } } } else if (obj instanceof byte[]) { @@ -404,10 +502,17 @@ class CMS47LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof iplanet.security.x509.CertificateAlgorithmId) { iplanet.security.x509.CertificateAlgorithmId o = (iplanet.security.x509.CertificateAlgorithmId)obj; @@ -428,9 +533,44 @@ class CMS47LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + data_type = o.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + translation + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { + data_type = obj.getClass().getName(); + if( data_type.startsWith( "iplanet" ) ) { + translation = "netscape" + + data_type.substring( 7 ); + } else if( data_type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + data_type.substring( 11 ); + } else { + translation = data_type; + } System.out.println(" " + - key + ":" + obj.getClass().getName() + "=" + + key + ":" + translation + "=" + obj); } } diff --git a/pki/base/migrate/60ToTxt/classes/CMS60LdifParser.class b/pki/base/migrate/60ToTxt/classes/CMS60LdifParser.class Binary files differindex 73da94b5..f3ff4304 100644 --- a/pki/base/migrate/60ToTxt/classes/CMS60LdifParser.class +++ b/pki/base/migrate/60ToTxt/classes/CMS60LdifParser.class diff --git a/pki/base/migrate/60ToTxt/classes/Main.class b/pki/base/migrate/60ToTxt/classes/Main.class Binary files differindex 2027e509..6d0d3dcd 100644 --- a/pki/base/migrate/60ToTxt/classes/Main.class +++ b/pki/base/migrate/60ToTxt/classes/Main.class diff --git a/pki/base/migrate/60ToTxt/run.sh b/pki/base/migrate/60ToTxt/run.sh index a29e6e1f..d41d6529 100755 --- a/pki/base/migrate/60ToTxt/run.sh +++ b/pki/base/migrate/60ToTxt/run.sh @@ -195,5 +195,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/60ToTxt/src/Main.java b/pki/base/migrate/60ToTxt/src/Main.java index a5c67f0e..380baab9 100644 --- a/pki/base/migrate/60ToTxt/src/Main.java +++ b/pki/base/migrate/60ToTxt/src/Main.java @@ -373,7 +373,23 @@ class CMS60LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -403,10 +419,17 @@ class CMS60LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -427,6 +450,21 @@ class CMS60LdifParser System.out.println(" " + key + ":netscape.security.x509.CertificateValidity="+ encoder.encode(bos.toByteArray())); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/61ToTxt/classes/CMS61LdifParser.class b/pki/base/migrate/61ToTxt/classes/CMS61LdifParser.class Binary files differindex 9ec0e9e7..4c08a38a 100644 --- a/pki/base/migrate/61ToTxt/classes/CMS61LdifParser.class +++ b/pki/base/migrate/61ToTxt/classes/CMS61LdifParser.class diff --git a/pki/base/migrate/61ToTxt/classes/Main.class b/pki/base/migrate/61ToTxt/classes/Main.class Binary files differindex 0f65e98a..8f141215 100644 --- a/pki/base/migrate/61ToTxt/classes/Main.class +++ b/pki/base/migrate/61ToTxt/classes/Main.class diff --git a/pki/base/migrate/61ToTxt/run.sh b/pki/base/migrate/61ToTxt/run.sh index aacdcfce..9fa8ffe1 100755 --- a/pki/base/migrate/61ToTxt/run.sh +++ b/pki/base/migrate/61ToTxt/run.sh @@ -194,6 +194,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/61ToTxt/src/Main.java b/pki/base/migrate/61ToTxt/src/Main.java index 05088ea2..298ee027 100644 --- a/pki/base/migrate/61ToTxt/src/Main.java +++ b/pki/base/migrate/61ToTxt/src/Main.java @@ -374,7 +374,23 @@ class CMS61LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -404,10 +420,17 @@ class CMS61LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -435,6 +458,21 @@ class CMS61LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/62ToTxt/classes/CMS62LdifParser.class b/pki/base/migrate/62ToTxt/classes/CMS62LdifParser.class Binary files differindex 092f1934..8c413efe 100644 --- a/pki/base/migrate/62ToTxt/classes/CMS62LdifParser.class +++ b/pki/base/migrate/62ToTxt/classes/CMS62LdifParser.class diff --git a/pki/base/migrate/62ToTxt/classes/Main.class b/pki/base/migrate/62ToTxt/classes/Main.class Binary files differindex 1a4cf38f..a3b28db5 100644 --- a/pki/base/migrate/62ToTxt/classes/Main.class +++ b/pki/base/migrate/62ToTxt/classes/Main.class diff --git a/pki/base/migrate/62ToTxt/run.sh b/pki/base/migrate/62ToTxt/run.sh index 3715a485..a192df1c 100755 --- a/pki/base/migrate/62ToTxt/run.sh +++ b/pki/base/migrate/62ToTxt/run.sh @@ -194,6 +194,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/62ToTxt/src/Main.java b/pki/base/migrate/62ToTxt/src/Main.java index 502b3a81..95f8d56b 100644 --- a/pki/base/migrate/62ToTxt/src/Main.java +++ b/pki/base/migrate/62ToTxt/src/Main.java @@ -374,7 +374,23 @@ class CMS62LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -404,10 +420,17 @@ class CMS62LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -435,6 +458,21 @@ class CMS62LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/63ToTxt/classes/CMS63LdifParser.class b/pki/base/migrate/63ToTxt/classes/CMS63LdifParser.class Binary files differindex a3c055eb..39dde5f5 100644 --- a/pki/base/migrate/63ToTxt/classes/CMS63LdifParser.class +++ b/pki/base/migrate/63ToTxt/classes/CMS63LdifParser.class diff --git a/pki/base/migrate/63ToTxt/classes/Main.class b/pki/base/migrate/63ToTxt/classes/Main.class Binary files differindex 727f4054..d8885bc1 100644 --- a/pki/base/migrate/63ToTxt/classes/Main.class +++ b/pki/base/migrate/63ToTxt/classes/Main.class diff --git a/pki/base/migrate/63ToTxt/run.sh b/pki/base/migrate/63ToTxt/run.sh index def9d718..d4aa5d5a 100755 --- a/pki/base/migrate/63ToTxt/run.sh +++ b/pki/base/migrate/63ToTxt/run.sh @@ -194,6 +194,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/63ToTxt/src/Main.java b/pki/base/migrate/63ToTxt/src/Main.java index 32640464..1a13f833 100644 --- a/pki/base/migrate/63ToTxt/src/Main.java +++ b/pki/base/migrate/63ToTxt/src/Main.java @@ -374,7 +374,23 @@ class CMS63LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -404,10 +420,17 @@ class CMS63LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -435,6 +458,21 @@ class CMS63LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/70ToTxt/classes/CMS70LdifParser.class b/pki/base/migrate/70ToTxt/classes/CMS70LdifParser.class Binary files differindex 33628650..e6900f5a 100644 --- a/pki/base/migrate/70ToTxt/classes/CMS70LdifParser.class +++ b/pki/base/migrate/70ToTxt/classes/CMS70LdifParser.class diff --git a/pki/base/migrate/70ToTxt/classes/Main.class b/pki/base/migrate/70ToTxt/classes/Main.class Binary files differindex 67545d8c..0743af44 100644 --- a/pki/base/migrate/70ToTxt/classes/Main.class +++ b/pki/base/migrate/70ToTxt/classes/Main.class diff --git a/pki/base/migrate/70ToTxt/run.bat b/pki/base/migrate/70ToTxt/run.bat index 15434b34..3adeee6f 100755 --- a/pki/base/migrate/70ToTxt/run.bat +++ b/pki/base/migrate/70ToTxt/run.bat @@ -18,14 +18,14 @@ REM All rights reserved. REM --- END COPYRIGHT BLOCK --- REM -REM This script converts a pre-existing CMS 7.0/7.01 ldif data +REM This script converts a pre-existing CMS 7.0 ldif data REM file (e. g. - created via a utility such as db2ldif) -REM into a normalized CMS 7.0/7.01 ldif text file. +REM into a normalized CMS 7.0 ldif text file. REM -REM This subsequent normalized CMS 7.0/7.01 ldif text file -REM can be migrated into CMS 7.0/7.01 or later utilizing +REM This subsequent normalized CMS 7.0 ldif text file +REM can be migrated into CMS 7.0 or later utilizing REM the corresponding TxtTo<Target CMS Version> script which -REM converts this normalized CMS 7.0/7.01 ldif text file into +REM converts this normalized CMS 7.0 ldif text file into REM a <Target CMS Version> ldif data file. REM REM This <Target CMS Version> ldif data file can then be @@ -41,7 +41,7 @@ REM REM SERVER_ROOT - fully qualified path of the location of the server REM -REM SET SERVER_ROOT=C:\cms701 +REM SET SERVER_ROOT=C:\cms70 REM diff --git a/pki/base/migrate/70ToTxt/run.sh b/pki/base/migrate/70ToTxt/run.sh index 7cae41bd..294bb63c 100755 --- a/pki/base/migrate/70ToTxt/run.sh +++ b/pki/base/migrate/70ToTxt/run.sh @@ -194,6 +194,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/70ToTxt/src/Main.java b/pki/base/migrate/70ToTxt/src/Main.java index ba1edcf0..b406a576 100644 --- a/pki/base/migrate/70ToTxt/src/Main.java +++ b/pki/base/migrate/70ToTxt/src/Main.java @@ -374,7 +374,23 @@ class CMS70LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -404,10 +420,17 @@ class CMS70LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -435,6 +458,21 @@ class CMS70LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/70ToTxt/src/compile.sh b/pki/base/migrate/70ToTxt/src/compile.sh index 28960f8e..7c9de9b8 100755 --- a/pki/base/migrate/70ToTxt/src/compile.sh +++ b/pki/base/migrate/70ToTxt/src/compile.sh @@ -16,7 +16,7 @@ ### Set SERVER_ROOT - identify the CMS <server_root> used to compile 70ToTxt ### -#SERVER_ROOT=/export/home/migrate/cms701 +#SERVER_ROOT=/export/home/migrate/cms70 #export SERVER_ROOT @@ -35,12 +35,8 @@ ### "Linux" - 1.4.2 ### "SunOS" - 1.4.2 ### -### CMS 7.01 NOTE: "HP-UX" - 1.4.0.00 -### "Linux" - 1.4.2 -### "SunOS" - 1.4.2 -### -#JDK_VERSION=CMS_7.01 +#JDK_VERSION=CMS_7.0 #export JDK_VERSION diff --git a/pki/base/migrate/71ToTxt/classes/CMS71LdifParser.class b/pki/base/migrate/71ToTxt/classes/CMS71LdifParser.class Binary files differindex 58d1ff7e..b78e4462 100644 --- a/pki/base/migrate/71ToTxt/classes/CMS71LdifParser.class +++ b/pki/base/migrate/71ToTxt/classes/CMS71LdifParser.class diff --git a/pki/base/migrate/71ToTxt/classes/Main.class b/pki/base/migrate/71ToTxt/classes/Main.class Binary files differindex 7ca2b1ca..e37d5400 100644 --- a/pki/base/migrate/71ToTxt/classes/Main.class +++ b/pki/base/migrate/71ToTxt/classes/Main.class diff --git a/pki/base/migrate/71ToTxt/run.sh b/pki/base/migrate/71ToTxt/run.sh index f9659bab..e1a33a54 100755 --- a/pki/base/migrate/71ToTxt/run.sh +++ b/pki/base/migrate/71ToTxt/run.sh @@ -194,6 +194,9 @@ fi ### Convert the specified ${CS} ldif data file ### into a normalized ${CS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/71ToTxt/src/Main.java b/pki/base/migrate/71ToTxt/src/Main.java index 2ad7823a..3ff4930a 100644 --- a/pki/base/migrate/71ToTxt/src/Main.java +++ b/pki/base/migrate/71ToTxt/src/Main.java @@ -374,7 +374,23 @@ class CMS71LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -404,10 +420,17 @@ class CMS71LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -435,6 +458,21 @@ class CMS71LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/72ToTxt/classes/CMS72LdifParser.class b/pki/base/migrate/72ToTxt/classes/CMS72LdifParser.class Binary files differindex 98cda717..70765716 100644 --- a/pki/base/migrate/72ToTxt/classes/CMS72LdifParser.class +++ b/pki/base/migrate/72ToTxt/classes/CMS72LdifParser.class diff --git a/pki/base/migrate/72ToTxt/classes/Main.class b/pki/base/migrate/72ToTxt/classes/Main.class Binary files differindex 850ae710..470df979 100644 --- a/pki/base/migrate/72ToTxt/classes/Main.class +++ b/pki/base/migrate/72ToTxt/classes/Main.class diff --git a/pki/base/migrate/72ToTxt/run.sh b/pki/base/migrate/72ToTxt/run.sh index da356e1a..ccdd0063 100755 --- a/pki/base/migrate/72ToTxt/run.sh +++ b/pki/base/migrate/72ToTxt/run.sh @@ -125,6 +125,10 @@ fi ### Setup the appropriate library path environment variable ### based upon the platform ### +### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### CLASSPATH=/usr/share/rhpki/migrate/72ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH diff --git a/pki/base/migrate/72ToTxt/src/Main.java b/pki/base/migrate/72ToTxt/src/Main.java index 856e4209..3bd1a333 100644 --- a/pki/base/migrate/72ToTxt/src/Main.java +++ b/pki/base/migrate/72ToTxt/src/Main.java @@ -376,7 +376,23 @@ class CMS72LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -406,10 +422,17 @@ class CMS72LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -437,6 +460,21 @@ class CMS72LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/73ToTxt/classes/CMS73LdifParser.class b/pki/base/migrate/73ToTxt/classes/CMS73LdifParser.class Binary files differindex d59151df..9ca1fdfd 100644 --- a/pki/base/migrate/73ToTxt/classes/CMS73LdifParser.class +++ b/pki/base/migrate/73ToTxt/classes/CMS73LdifParser.class diff --git a/pki/base/migrate/73ToTxt/classes/Main.class b/pki/base/migrate/73ToTxt/classes/Main.class Binary files differindex 7fd850ae..30a21375 100644 --- a/pki/base/migrate/73ToTxt/classes/Main.class +++ b/pki/base/migrate/73ToTxt/classes/Main.class diff --git a/pki/base/migrate/73ToTxt/run.bat b/pki/base/migrate/73ToTxt/run.bat index 0896bf17..f360f44d 100755 --- a/pki/base/migrate/73ToTxt/run.bat +++ b/pki/base/migrate/73ToTxt/run.bat @@ -41,7 +41,7 @@ REM REM SERVER_ROOT - fully qualified path of the location of the server REM -REM SET SERVER_ROOT=C:\cs72 +REM SET SERVER_ROOT=C:\cs73 REM diff --git a/pki/base/migrate/73ToTxt/run.sh b/pki/base/migrate/73ToTxt/run.sh index 405d08b8..a35994fb 100755 --- a/pki/base/migrate/73ToTxt/run.sh +++ b/pki/base/migrate/73ToTxt/run.sh @@ -125,7 +125,10 @@ fi ### Setup the appropriate library path environment variable ### based upon the platform ### -CLASSPATH=/usr/share/rhpki/migrate/72ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### +CLASSPATH=/usr/share/rhpki/migrate/73ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH if [ ${OS_NAME} = "Linux" ] ; then @@ -135,13 +138,13 @@ if [ ${OS_NAME} = "Linux" ] ; then else # x86_64 LD_LIBRARY_PATH=/usr/lib64/dirsec:/usr/lib64:${JRE_ROOT}/lib:${JRE_ROOT}/lib/i386/native_threads export LD_LIBRARY_PATH - CLASSPATH=/usr/share/rhpki/migrate/72ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib64/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar + CLASSPATH=/usr/share/rhpki/migrate/73ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib64/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH fi else # SunOS 64-bits LD_LIBRARY_PATH=/usr/lib/sparcv9/dirsec:/usr/lib/sparcv9:${JRE_ROOT}/lib:${JRE_ROOT}/lib/sparc/native_threads export LD_LIBRARY_PATH - CLASSPATH=/usr/share/rhpki/migrate/72ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/sparcv9/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar + CLASSPATH=/usr/share/rhpki/migrate/73ToTxt/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/sparcv9/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH fi diff --git a/pki/base/migrate/73ToTxt/src/Main.java b/pki/base/migrate/73ToTxt/src/Main.java index 63e306ed..088ae441 100644 --- a/pki/base/migrate/73ToTxt/src/Main.java +++ b/pki/base/migrate/73ToTxt/src/Main.java @@ -376,7 +376,23 @@ class CMS73LdifParser System.out.println(" " + key + ":" + o.getClass().getName() + "=" + k + ":" + ob.getClass().getName() + "=" + ((java.util.Date)ob).getTime()); + } else if (ob instanceof java.math.BigInteger[]) { + // Bugzilla Bug #225031 (a.k.a. - Raidzilla Bug #58356) + java.math.BigInteger in[] = (java.math.BigInteger[])ob; + String numbers = ""; + for (int i = 0; i < in.length; i++) { + if (numbers.equals("")) { + numbers = in[i].toString(); + } else { + numbers = numbers + "," + in[i].toString(); + } + } + System.out.println(" " + + key + ":" + "com.netscape.certsrv.authentication.AuthToken" + "=" + + k + ":java.lang.String=" + numbers); } else if (ob instanceof String[]) { + // Bugzilla Bug #224763 (a.k.a. - Raidzilla Bug #57949) + // Bugzilla Bug #252240 String str[] = (String[])ob; String v = ""; if (str != null) { @@ -406,10 +422,17 @@ class CMS73LdifParser System.out.println(" " + key + ":Integer[" + in.length + "," + i + "]="+ in[i]); } } else if (obj instanceof BigInteger[]) { + // Bugzilla Bug #238779 BigInteger in[] = (BigInteger[])obj; for (int i = 0; i < in.length; i++) { System.out.println(" " + key + ":java.math.BigInteger[" + in.length + "," + i + "]="+ in[i]); } + } else if (obj instanceof String[]) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + String str[] = (String[])obj; + for (int i = 0; i < str.length; i++) { + System.out.println(" " + key + ":java.lang.String[" + str.length + "," + i + "]="+ str[i]); + } } else if (obj instanceof netscape.security.x509.CertificateAlgorithmId) { netscape.security.x509.CertificateAlgorithmId o = (netscape.security.x509.CertificateAlgorithmId)obj; @@ -437,6 +460,21 @@ class CMS73LdifParser System.out.println(" " + key + ":byte[]="+ encoder.encode((byte[])obj)); + } else if (obj instanceof java.util.Hashtable) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + // + // Example: fingerprints:java.util.Hashtable= + // {SHA1=[B@52513a, MD5=[B@52c4d9, MD2=[B@799ff5} + // + java.util.Hashtable o = (java.util.Hashtable)obj; + BASE64Encoder encoder = new BASE64Encoder(); + Enumeration e = o.elements(); + while (e.hasMoreElements()) { + String k = (String)e.nextElement(); + System.out.println(" " + + key + ":" + o.getClass().getName() + "=" + + k + "=" + encoder.encode((byte[])o.get(k))); + } } else { System.out.println(" " + key + ":" + obj.getClass().getName() + "=" + diff --git a/pki/base/migrate/TxtTo60/classes/CMS60LdifParser.class b/pki/base/migrate/TxtTo60/classes/CMS60LdifParser.class Binary files differindex 4c46bf63..e65aea96 100644 --- a/pki/base/migrate/TxtTo60/classes/CMS60LdifParser.class +++ b/pki/base/migrate/TxtTo60/classes/CMS60LdifParser.class diff --git a/pki/base/migrate/TxtTo60/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo60/classes/DummyAuthManager.class Binary files differindex 5f668cb9..c713d860 100644 --- a/pki/base/migrate/TxtTo60/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo60/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo60/classes/Main.class b/pki/base/migrate/TxtTo60/classes/Main.class Binary files differindex ab71fe2e..5fa0c203 100644 --- a/pki/base/migrate/TxtTo60/classes/Main.class +++ b/pki/base/migrate/TxtTo60/classes/Main.class diff --git a/pki/base/migrate/TxtTo60/run.sh b/pki/base/migrate/TxtTo60/run.sh index 0bbe99cd..80856e20 100755 --- a/pki/base/migrate/TxtTo60/run.sh +++ b/pki/base/migrate/TxtTo60/run.sh @@ -189,5 +189,5 @@ fi ### into a normalized ${CMS} ldif text file. ### -${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 +${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar:${SERVER_ROOT}/bin/cert/jre/lib/i18n.jar Main $1 $2 diff --git a/pki/base/migrate/TxtTo60/src/Main.java b/pki/base/migrate/TxtTo60/src/Main.java index c20fffe9..3c47d8ad 100644 --- a/pki/base/migrate/TxtTo60/src/Main.java +++ b/pki/base/migrate/TxtTo60/src/Main.java @@ -231,9 +231,22 @@ class CMS60LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -255,20 +268,32 @@ class CMS60LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); + obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock")) { com.netscape.certsrv.base.ArgBlock obj = (com.netscape.certsrv.base.ArgBlock)table.get(name); @@ -279,14 +304,6 @@ class CMS60LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -300,6 +317,15 @@ class CMS60LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -307,40 +333,36 @@ class CMS60LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo")) { - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -348,47 +370,60 @@ class CMS60LdifParser new netscape.security.x509.CertificateExtensions( new DerInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = new netscape.security.x509.CertificateSubjectName( new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -414,41 +449,80 @@ class CMS60LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.cmscore.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { + if (objs == null) { + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.lang.String objs[] = (java.lang.String[])table.get(name); + if (objs == null) { + objs = new java.lang.String[size]; + table.put(name, objs); + } + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.X509CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -457,7 +531,6 @@ class CMS60LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo61/classes/CMS61LdifParser.class b/pki/base/migrate/TxtTo61/classes/CMS61LdifParser.class Binary files differindex 70ef9f71..03f2d90a 100644 --- a/pki/base/migrate/TxtTo61/classes/CMS61LdifParser.class +++ b/pki/base/migrate/TxtTo61/classes/CMS61LdifParser.class diff --git a/pki/base/migrate/TxtTo61/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo61/classes/DummyAuthManager.class Binary files differindex bcd8be3b..8b2039e7 100644 --- a/pki/base/migrate/TxtTo61/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo61/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo61/classes/Main.class b/pki/base/migrate/TxtTo61/classes/Main.class Binary files differindex 69495b02..2f0c1663 100644 --- a/pki/base/migrate/TxtTo61/classes/Main.class +++ b/pki/base/migrate/TxtTo61/classes/Main.class diff --git a/pki/base/migrate/TxtTo61/run.sh b/pki/base/migrate/TxtTo61/run.sh index d219e921..6ef1cae4 100755 --- a/pki/base/migrate/TxtTo61/run.sh +++ b/pki/base/migrate/TxtTo61/run.sh @@ -188,6 +188,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/TxtTo61/src/Main.java b/pki/base/migrate/TxtTo61/src/Main.java index 4cc92892..8b95ccc9 100644 --- a/pki/base/migrate/TxtTo61/src/Main.java +++ b/pki/base/migrate/TxtTo61/src/Main.java @@ -235,9 +235,22 @@ class CMS61LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,24 +272,34 @@ class CMS61LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -292,14 +315,6 @@ class CMS61LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -313,6 +328,15 @@ class CMS61LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -320,43 +344,36 @@ class CMS61LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[")) { - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -364,47 +381,60 @@ class CMS61LdifParser new netscape.security.x509.CertificateExtensions( new DerInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = new netscape.security.x509.CertificateSubjectName( new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -430,41 +460,83 @@ class CMS61LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.cmscore.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { + if (objs == null) { + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.lang.String objs[] = (java.lang.String[])table.get(name); + if (objs == null) { + objs = new java.lang.String[size]; + table.put(name, objs); + } + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.X509CertInfo[")) { + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -473,7 +545,6 @@ class CMS61LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo62/classes/CMS62LdifParser.class b/pki/base/migrate/TxtTo62/classes/CMS62LdifParser.class Binary files differindex 114f08b7..ca25274a 100644 --- a/pki/base/migrate/TxtTo62/classes/CMS62LdifParser.class +++ b/pki/base/migrate/TxtTo62/classes/CMS62LdifParser.class diff --git a/pki/base/migrate/TxtTo62/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo62/classes/DummyAuthManager.class Binary files differindex 825b0c3e..387cde90 100644 --- a/pki/base/migrate/TxtTo62/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo62/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo62/classes/Main.class b/pki/base/migrate/TxtTo62/classes/Main.class Binary files differindex 0e538383..e2e92309 100644 --- a/pki/base/migrate/TxtTo62/classes/Main.class +++ b/pki/base/migrate/TxtTo62/classes/Main.class diff --git a/pki/base/migrate/TxtTo62/run.sh b/pki/base/migrate/TxtTo62/run.sh index f1be8974..fdd6b2ee 100755 --- a/pki/base/migrate/TxtTo62/run.sh +++ b/pki/base/migrate/TxtTo62/run.sh @@ -188,6 +188,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/TxtTo62/src/Main.java b/pki/base/migrate/TxtTo62/src/Main.java index 406448dd..da48981b 100644 --- a/pki/base/migrate/TxtTo62/src/Main.java +++ b/pki/base/migrate/TxtTo62/src/Main.java @@ -235,9 +235,22 @@ class CMS62LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,28 +272,34 @@ class CMS62LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Locale")) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" - table.put(name, Locale.getDefault()); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -296,14 +315,6 @@ class CMS62LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -317,6 +328,15 @@ class CMS62LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -324,46 +344,36 @@ class CMS62LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[") || type.startsWith("netscape.security.extensions.CertInfo[")) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -373,13 +383,6 @@ class CMS62LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateExtensions" table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = @@ -387,34 +390,54 @@ class CMS62LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateSubjectName" table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -440,41 +463,91 @@ class CMS62LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.cmscore.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { + if (objs == null) { + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.lang.String objs[] = (java.lang.String[])table.get(name); + if (objs == null) { + objs = new java.lang.String[size]; + table.put(name, objs); + } + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Locale")) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" + table.put(name, Locale.getDefault()); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.X509CertInfo[") + || type.startsWith("netscape.security.extensions.CertInfo[")) { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -483,7 +556,6 @@ class CMS62LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo70/classes/CMS70LdifParser.class b/pki/base/migrate/TxtTo70/classes/CMS70LdifParser.class Binary files differindex f903b58e..3f4ed9b5 100644 --- a/pki/base/migrate/TxtTo70/classes/CMS70LdifParser.class +++ b/pki/base/migrate/TxtTo70/classes/CMS70LdifParser.class diff --git a/pki/base/migrate/TxtTo70/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo70/classes/DummyAuthManager.class Binary files differindex 825b0c3e..387cde90 100644 --- a/pki/base/migrate/TxtTo70/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo70/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo70/classes/Main.class b/pki/base/migrate/TxtTo70/classes/Main.class Binary files differindex f5e2c248..09498213 100644 --- a/pki/base/migrate/TxtTo70/classes/Main.class +++ b/pki/base/migrate/TxtTo70/classes/Main.class diff --git a/pki/base/migrate/TxtTo70/run.bat b/pki/base/migrate/TxtTo70/run.bat index 7c99f67a..3e70ee8c 100755 --- a/pki/base/migrate/TxtTo70/run.bat +++ b/pki/base/migrate/TxtTo70/run.bat @@ -20,10 +20,10 @@ REM --- END COPYRIGHT BLOCK --- REM REM This script converts a normalized <Source CMS Version> ldif REM text file (e. g. - created via a <Source CMS Version>ToTxt -REM script) into a CMS 7.0/7.01 ldif data file. +REM script) into a CMS 7.0 ldif data file. REM -REM This CMS 7.0/7.01 ldif data file can then be imported into the -REM internal database of the desired CMS 7.0/7.01 server using a +REM This CMS 7.0 ldif data file can then be imported into the +REM internal database of the desired CMS 7.0 server using a REM utility such as ldif2db. REM @@ -35,7 +35,7 @@ REM REM SERVER_ROOT - fully qualified path of the location of the server REM -REM SET SERVER_ROOT=C:\cms701 +REM SET SERVER_ROOT=C:\cms70 REM diff --git a/pki/base/migrate/TxtTo70/run.sh b/pki/base/migrate/TxtTo70/run.sh index ac007d2d..c7e0a314 100755 --- a/pki/base/migrate/TxtTo70/run.sh +++ b/pki/base/migrate/TxtTo70/run.sh @@ -21,10 +21,10 @@ ### ### ### This script converts a normalized <Source CMS Version> ldif ### ### text file (e. g. - created via a <Source CMS Version>ToTxt ### -### script) into a CMS 7.0/7.01 ldif data file. ### +### script) into a CMS 7.0 ldif data file. ### ### ### -### This CMS 7.0/7.01 ldif data file can then be imported into ### -### the internal database of the desired CMS 7.0/7.01 server ### +### This CMS 7.0 ldif data file can then be imported into ### +### the internal database of the desired CMS 7.0 server ### ### using a utility such as ldif2db. ### ### ### ##################################################################### @@ -34,7 +34,7 @@ ### SERVER_ROOT - fully qualified path of the location of the server ### -#SERVER_ROOT=/export/home/migrate/cms701 +#SERVER_ROOT=/export/home/migrate/cms70 #export SERVER_ROOT @@ -188,6 +188,9 @@ fi ### Convert the specified ${CMS} ldif data file ### into a normalized ${CMS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/TxtTo70/src/Main.java b/pki/base/migrate/TxtTo70/src/Main.java index c51f32c8..bcb1b5a1 100644 --- a/pki/base/migrate/TxtTo70/src/Main.java +++ b/pki/base/migrate/TxtTo70/src/Main.java @@ -235,9 +235,22 @@ class CMS70LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,28 +272,34 @@ class CMS70LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Locale")) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" - table.put(name, Locale.getDefault()); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -296,14 +315,6 @@ class CMS70LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -317,6 +328,15 @@ class CMS70LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -324,46 +344,36 @@ class CMS70LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[") || type.startsWith("netscape.security.extensions.CertInfo[")) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -373,13 +383,6 @@ class CMS70LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateExtensions" table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = @@ -387,34 +390,54 @@ class CMS70LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateSubjectName" table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -440,41 +463,91 @@ class CMS70LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("java.util.Locale")) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" + table.put(name, Locale.getDefault()); + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.cmscore.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { + if (objs == null) { + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.lang.String objs[] = (java.lang.String[])table.get(name); + if (objs == null) { + objs = new java.lang.String[size]; + table.put(name, objs); + } + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.X509CertInfo[") + || type.startsWith("netscape.security.extensions.CertInfo[")) { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -483,7 +556,6 @@ class CMS70LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo70/src/compile.sh b/pki/base/migrate/TxtTo70/src/compile.sh index 819cbda9..11b1b6df 100755 --- a/pki/base/migrate/TxtTo70/src/compile.sh +++ b/pki/base/migrate/TxtTo70/src/compile.sh @@ -8,7 +8,7 @@ ### This script creates the "TxtTo70/classes/Main.class", ### ### "TxtTo70/classes/CMS70LdifParser.class", and ### ### "TxtTo70/classes/DummyAuthManager.class" which are ### -### used to create a CMS 7.0/7.01 ldif data file. ### +### used to create a CMS 7.0 ldif data file. ### ### ### ##################################################################### @@ -17,7 +17,7 @@ ### Set SERVER_ROOT - identify the CMS <server_root> used to compile TxtTo70 ### -#SERVER_ROOT=/export/home/migrate/cms701 +#SERVER_ROOT=/export/home/migrate/cms70 #export SERVER_ROOT @@ -36,12 +36,8 @@ ### "Linux" - 1.4.2 ### "SunOS" - 1.4.2 ### -### CMS 7.01 NOTE: "HP-UX" - 1.4.0.00 -### "Linux" - 1.4.2 -### "SunOS" - 1.4.2 -### -#JDK_VERSION=CMS_7.01 +#JDK_VERSION=CMS_7.0 #export JDK_VERSION diff --git a/pki/base/migrate/TxtTo71/classes/CMS71LdifParser.class b/pki/base/migrate/TxtTo71/classes/CMS71LdifParser.class Binary files differindex a05d09a0..fb449c41 100644 --- a/pki/base/migrate/TxtTo71/classes/CMS71LdifParser.class +++ b/pki/base/migrate/TxtTo71/classes/CMS71LdifParser.class diff --git a/pki/base/migrate/TxtTo71/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo71/classes/DummyAuthManager.class Binary files differindex 6b5f84ae..387cde90 100644 --- a/pki/base/migrate/TxtTo71/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo71/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo71/classes/Main.class b/pki/base/migrate/TxtTo71/classes/Main.class Binary files differindex d2472ff7..8f02b13d 100644 --- a/pki/base/migrate/TxtTo71/classes/Main.class +++ b/pki/base/migrate/TxtTo71/classes/Main.class diff --git a/pki/base/migrate/TxtTo71/run.sh b/pki/base/migrate/TxtTo71/run.sh index 46e3c348..04e8d458 100755 --- a/pki/base/migrate/TxtTo71/run.sh +++ b/pki/base/migrate/TxtTo71/run.sh @@ -188,6 +188,9 @@ fi ### Convert the specified ${CS} ldif data file ### into a normalized ${CS} ldif text file. ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### ${SERVER_ROOT}/bin/cert/jre/bin/java -classpath ./classes:${SERVER_ROOT}/cert-${INSTANCE}/classes:${SERVER_ROOT}/bin/cert/classes:${SERVER_ROOT}/bin/cert/jars/certsrv.jar:${SERVER_ROOT}/bin/cert/jars/cmscore.jar:${SERVER_ROOT}/bin/cert/jars/nsutil.jar:${SERVER_ROOT}/bin/cert/jars/jss3.jar:${SERVER_ROOT}/bin/cert/jre/lib/rt.jar Main $1 $2 diff --git a/pki/base/migrate/TxtTo71/src/Main.java b/pki/base/migrate/TxtTo71/src/Main.java index edaf2b53..7dcb1394 100644 --- a/pki/base/migrate/TxtTo71/src/Main.java +++ b/pki/base/migrate/TxtTo71/src/Main.java @@ -235,9 +235,22 @@ class CMS71LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,28 +272,34 @@ class CMS71LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Locale")) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" - table.put(name, Locale.getDefault()); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -296,14 +315,6 @@ class CMS71LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -317,6 +328,15 @@ class CMS71LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -324,46 +344,36 @@ class CMS71LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[") || type.startsWith("netscape.security.extensions.CertInfo[")) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -373,13 +383,6 @@ class CMS71LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateExtensions" table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = @@ -387,34 +390,54 @@ class CMS71LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateSubjectName" table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -440,50 +463,91 @@ class CMS71LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("java.util.Locale")) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" + table.put(name, Locale.getDefault()); + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.cmscore.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); - } else if (type.startsWith("Integer[")) { + if (objs == null) { + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.lang.String objs[] = (java.lang.String[])table.get(name); + if (objs == null) { + objs = new java.lang.String[size]; + table.put(name, objs); + } + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("java.math.BigInteger[")) { + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); + table.put(name, obj); + } else if (type.startsWith("netscape.security.x509.X509CertInfo[") + || type.startsWith("netscape.security.extensions.CertInfo[")) { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new java.math.BigInteger[size]; - table.put(name, objs); + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); } - objs[index] = new java.math.BigInteger(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -492,7 +556,6 @@ class CMS71LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo71/src/compile.sh b/pki/base/migrate/TxtTo71/src/compile.sh index 0fcdef73..397912a3 100755 --- a/pki/base/migrate/TxtTo71/src/compile.sh +++ b/pki/base/migrate/TxtTo71/src/compile.sh @@ -154,7 +154,7 @@ fi ### -### Compile TxtTo70 - create "CMS71LdifParser.class", "DummyAuthManager.class", +### Compile TxtTo71 - create "CMS71LdifParser.class", "DummyAuthManager.class", ### and "Main.class" ### diff --git a/pki/base/migrate/TxtTo72/classes/CMS72LdifParser.class b/pki/base/migrate/TxtTo72/classes/CMS72LdifParser.class Binary files differindex 51dd432c..c3b8d564 100644 --- a/pki/base/migrate/TxtTo72/classes/CMS72LdifParser.class +++ b/pki/base/migrate/TxtTo72/classes/CMS72LdifParser.class diff --git a/pki/base/migrate/TxtTo72/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo72/classes/DummyAuthManager.class Binary files differindex 7fa7e3aa..323081a3 100644 --- a/pki/base/migrate/TxtTo72/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo72/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo72/classes/Main.class b/pki/base/migrate/TxtTo72/classes/Main.class Binary files differindex a059f8a6..2512afa7 100644 --- a/pki/base/migrate/TxtTo72/classes/Main.class +++ b/pki/base/migrate/TxtTo72/classes/Main.class diff --git a/pki/base/migrate/TxtTo72/run.bat b/pki/base/migrate/TxtTo72/run.bat index 1682bacb..85215874 100755 --- a/pki/base/migrate/TxtTo72/run.bat +++ b/pki/base/migrate/TxtTo72/run.bat @@ -20,10 +20,10 @@ REM --- END COPYRIGHT BLOCK --- REM REM This script converts a normalized <Source CS Version> ldif REM text file (e. g. - created via a <Source CS Version>ToTxt -REM script) into a CS 7.1 ldif data file. +REM script) into a CS 7.2 ldif data file. REM -REM This CS 7.1 ldif data file can then be imported into the -REM internal database of the desired CS 7.1 server using a +REM This CS 7.2 ldif data file can then be imported into the +REM internal database of the desired CS 7.2 server using a REM utility such as ldif2db. REM @@ -35,7 +35,7 @@ REM REM SERVER_ROOT - fully qualified path of the location of the server REM -REM SET SERVER_ROOT=C:\cs71 +REM SET SERVER_ROOT=C:\cs72 REM @@ -60,7 +60,7 @@ REM REM Script-defined constants REM -SET CS="CS 7.1" +SET CS="CS 7.2" REM diff --git a/pki/base/migrate/TxtTo72/run.sh b/pki/base/migrate/TxtTo72/run.sh index ad64dbcd..972686e3 100755 --- a/pki/base/migrate/TxtTo72/run.sh +++ b/pki/base/migrate/TxtTo72/run.sh @@ -119,6 +119,9 @@ fi ### Setup the appropriate library path environment variable ### based upon the platform ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### CLASSPATH=/usr/share/rhpki/migrate/TxtTo72/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH diff --git a/pki/base/migrate/TxtTo72/src/Main.java b/pki/base/migrate/TxtTo72/src/Main.java index 197e487e..9b22cd84 100644 --- a/pki/base/migrate/TxtTo72/src/Main.java +++ b/pki/base/migrate/TxtTo72/src/Main.java @@ -235,9 +235,22 @@ class CMS72LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,32 +272,34 @@ class CMS72LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("org.mozilla.jss.asn1.INTEGER")) { - // CMS 7.1 stores bodyPartId as INTEGER - // CS 72. fixed the problem by storing it as String - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Locale")) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" - table.put(name, Locale.getDefault()); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -300,14 +315,6 @@ class CMS72LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -321,6 +328,15 @@ class CMS72LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -328,46 +344,36 @@ class CMS72LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[") || type.startsWith("netscape.security.extensions.CertInfo[")) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -377,13 +383,6 @@ class CMS72LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateExtensions" table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = @@ -391,34 +390,58 @@ class CMS72LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateSubjectName" table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("org.mozilla.jss.asn1.INTEGER")) { + // CMS 7.1 stores bodyPartId as INTEGER + // CS 72. fixed the problem by storing it as String + table.put(name, value); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -444,50 +467,91 @@ class CMS72LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("java.util.Locale")) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" + table.put(name, Locale.getDefault()); + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.certsrv.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("java.math.BigInteger[")) { + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + java.lang.String objs[] = (java.lang.String[])table.get(name); if (objs == null) { - objs = new java.math.BigInteger[size]; + objs = new java.lang.String[size]; table.put(name, objs); } - objs[index] = new java.math.BigInteger(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); + table.put(name, obj); + } else if (type.startsWith("netscape.security.x509.X509CertInfo[") + || type.startsWith("netscape.security.extensions.CertInfo[")) { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); + if (objs == null) { + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -496,7 +560,6 @@ class CMS72LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo72/src/compile.sh b/pki/base/migrate/TxtTo72/src/compile.sh index d08c7f47..ec0b466b 100755 --- a/pki/base/migrate/TxtTo72/src/compile.sh +++ b/pki/base/migrate/TxtTo72/src/compile.sh @@ -110,7 +110,7 @@ elif [ ${OS_NAME} = "Linux" ] ; then LD_LIBRARY_PATH=/usr/lib:/usr/lib/dirsec:${JAVA_HOME}/lib:${JAVA_HOME}/lib/i386/native_threads export LD_LIBRARY_PATH else # SunOS - LD_LIBRARY_PATH=/usr/lib:/usr/lib/dirsec:${JAVA_HOME}/lib:${JAVA_HOME}/lib/sparc/native_threads + LD_LIBRARY_PATH=/usr/lib:/usr/lib/dirsec:${JAVA_HOME}/lib:${JAVA_HOME}/lib/native_threads export LD_LIBRARY_PATH fi @@ -133,9 +133,9 @@ fi ### -### Compile TxtTo70 - create "CMS72LdifParser.class", "DummyAuthManager.class", +### Compile TxtTo72 - create "CMS72LdifParser.class", "DummyAuthManager.class", ### and "Main.class" ### -${JAVA_HOME}/bin/javac -d ${TARGET} -classpath ${JAVA_HOME}/jre/lib/rt.jar:/usr/share/java/rhpki/nsutil.jar:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/lib/java/dirsec/jss4.jar Main.java +${JAVA_HOME}/bin/javac -d ${TARGET} -classpath ${JAVA_HOME}/jre/lib/rt.jar:/usr/share/java/rhpki/nsutil.jar:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/lib/java/rhpki/ca/ca.jar:/usr/lib/java/rhpki/tks/tks.jar:/usr/lib/java/rhpki/ocsp/ocsp.jar:/usr/lib/java/rhpki/kra/kra.jar:/usr/lib/java/dirsec/jss4.jar Main.java diff --git a/pki/base/migrate/TxtTo73/classes/CMS73LdifParser.class b/pki/base/migrate/TxtTo73/classes/CMS73LdifParser.class Binary files differindex ccdae339..03a09612 100644 --- a/pki/base/migrate/TxtTo73/classes/CMS73LdifParser.class +++ b/pki/base/migrate/TxtTo73/classes/CMS73LdifParser.class diff --git a/pki/base/migrate/TxtTo73/classes/DummyAuthManager.class b/pki/base/migrate/TxtTo73/classes/DummyAuthManager.class Binary files differindex 7fa7e3aa..323081a3 100644 --- a/pki/base/migrate/TxtTo73/classes/DummyAuthManager.class +++ b/pki/base/migrate/TxtTo73/classes/DummyAuthManager.class diff --git a/pki/base/migrate/TxtTo73/classes/Main.class b/pki/base/migrate/TxtTo73/classes/Main.class Binary files differindex 79304773..6609674a 100644 --- a/pki/base/migrate/TxtTo73/classes/Main.class +++ b/pki/base/migrate/TxtTo73/classes/Main.class diff --git a/pki/base/migrate/TxtTo73/run.bat b/pki/base/migrate/TxtTo73/run.bat index 4787506f..9e3898a4 100755 --- a/pki/base/migrate/TxtTo73/run.bat +++ b/pki/base/migrate/TxtTo73/run.bat @@ -35,7 +35,7 @@ REM REM SERVER_ROOT - fully qualified path of the location of the server REM -REM SET SERVER_ROOT=C:\cs71 +REM SET SERVER_ROOT=C:\cs73 REM diff --git a/pki/base/migrate/TxtTo73/run.sh b/pki/base/migrate/TxtTo73/run.sh index 18085170..52469acc 100755 --- a/pki/base/migrate/TxtTo73/run.sh +++ b/pki/base/migrate/TxtTo73/run.sh @@ -119,8 +119,11 @@ fi ### Setup the appropriate library path environment variable ### based upon the platform ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### -CLASSPATH=/usr/share/rhpki/migrate/TxtTo72/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar +CLASSPATH=/usr/share/rhpki/migrate/TxtTo73/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH if [ ${OS_NAME} = "Linux" ] ; then @@ -130,13 +133,13 @@ if [ ${OS_NAME} = "Linux" ] ; then else # x86_64 LD_LIBRARY_PATH=/usr/lib64/dirsec:/usr/lib64:${JRE_ROOT}/lib:${JRE_ROOT}/lib/i386/native_threads export LD_LIBRARY_PATH - CLASSPATH=/usr/share/rhpki/migrate/TxtTo72/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib64/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar + CLASSPATH=/usr/share/rhpki/migrate/TxtTo73/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib64/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH fi else # SunOS 64-bits LD_LIBRARY_PATH=/usr/lib/sparcv9/dirsec:/usr/lib/sparcv9:${JRE_ROOT}/lib:${JRE_ROOT}/lib/sparc/native_threads export LD_LIBRARY_PATH - CLASSPATH=/usr/share/rhpki/migrate/TxtTo72/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/sparcv9/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar + CLASSPATH=/usr/share/rhpki/migrate/TxtTo73/classes:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/share/java/rhpki/nsutil.jar:/usr/lib/sparcv9/java/dirsec/jss4.jar:${JRE_ROOT}/lib/rt.jar export CLASSPATH fi diff --git a/pki/base/migrate/TxtTo73/src/Main.java b/pki/base/migrate/TxtTo73/src/Main.java index 9b7ae535..4ffe0c12 100644 --- a/pki/base/migrate/TxtTo73/src/Main.java +++ b/pki/base/migrate/TxtTo73/src/Main.java @@ -235,9 +235,22 @@ class CMS73LdifParser } return; } - String name = attr.substring(0, colon); - String type = attr.substring(colon+1, equal); - String value = attr.substring(equal+1); + String name = null; + String type = null; + String value = null; + try { + name = attr.substring(0, colon); + type = attr.substring(colon+1, equal); + value = attr.substring(equal+1); + } catch (Exception e) { + if (mErrorPrintWriter != null) { + if (dn != null) { + mErrorPrintWriter.println(dn); + } + mErrorPrintWriter.println("Skipped " + attr); + } + return; + } if (name.startsWith("serviceErrors")) { // #56953 - skip serviceErrors @@ -259,32 +272,34 @@ class CMS73LdifParser } return; } - if (type.startsWith("java.lang.String")) { - table.put(name, value); - } else if (type.startsWith("org.mozilla.jss.asn1.INTEGER")) { - // CMS 7.1 stores bodyPartId as INTEGER - // CS 72. fixed the problem by storing it as String - table.put(name, value); - } else if (type.startsWith("byte[]")) { - BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); - } else if (type.startsWith("java.lang.Integer")) { - table.put(name, new Integer(value)); - } else if (type.startsWith("java.math.BigInteger")) { - table.put(name, new java.math.BigInteger(value)); - } else if (type.startsWith("java.util.Locale")) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" - table.put(name, Locale.getDefault()); - } else if (type.startsWith("java.util.Vector")) { - Vector obj = - (Vector)table.get(name); + + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { + com.netscape.certsrv.request.AgentApprovals obj = + (com.netscape.certsrv.request.AgentApprovals)table.get(name); if (obj == null) { - obj = new Vector(); + obj = new com.netscape.certsrv.request.AgentApprovals(); table.put(name, obj); } - obj.addElement(value); - } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { + obj.addApproval(value.substring(0,value.indexOf(';'))); + } else if (type.startsWith("com.netscape.certsrv.base.ArgBlock") + || type.startsWith("com.netscape.cmscore.base.ArgBlock")) { // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and // moved old "com.netscape.certsrv.base.ArgBlock" // to "com.netscape.cmscore.base.ArgBlock" @@ -300,14 +315,6 @@ class CMS73LdifParser String valuekey = value.substring(0, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); obj.set(valuekey, valuevalue); - } else if (type.startsWith("com.netscape.certsrv.request.AgentApprovals")) { - com.netscape.certsrv.request.AgentApprovals obj = - (com.netscape.certsrv.request.AgentApprovals)table.get(name); - if (obj == null) { - obj = new com.netscape.certsrv.request.AgentApprovals(); - table.put(name, obj); - } - obj.addApproval(value.substring(0,value.indexOf(';'))); } else if (type.startsWith("com.netscape.certsrv.authentication.AuthToken")) { com.netscape.certsrv.authentication.AuthToken obj = (com.netscape.certsrv.authentication.AuthToken)table.get(name); @@ -321,6 +328,15 @@ class CMS73LdifParser String valuetype = value.substring(value.indexOf(':')+1, value.indexOf('=')); String valuevalue = value.substring(value.indexOf('=')+1); if (valuetype.equals("java.lang.String")) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // obj.set(valuekey, valuevalue); } else if (valuetype.equals("java.util.Date")) { obj.set(valuekey, new Date(Long.parseLong(valuevalue))); @@ -328,46 +344,36 @@ class CMS73LdifParser System.err.println("ERROR AuthToken type - " + attr); System.exit(0); } - } else if (type.startsWith("netscape.security.x509.X509CertInfo[") || type.startsWith("netscape.security.extensions.CertInfo[")) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.x509.X509CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.x509.X509CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { - // - int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); - int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); + } else if (type.startsWith("java.math.BigInteger[")) { + // Bugzilla Bug #238779 + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + if (objs == null) { + objs = new java.math.BigInteger[size]; + table.put(name, objs); + } + objs[index] = new java.math.BigInteger(value); + } else if (type.startsWith("java.math.BigInteger")) { + table.put(name, new java.math.BigInteger(value)); + } else if (type.startsWith("byte[]")) { + BASE64Decoder decoder = new BASE64Decoder(); + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("byte[")) { + // byte array BASE64Decoder decoder = new BASE64Decoder(); - if (objs == null) { - objs = new netscape.security.extensions.CertInfo[size]; - table.put(name, objs); - } - objs[index] = new netscape.security.extensions.CertInfo(); - objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); - } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + table.put(name, decoder.decodeBuffer(value)); + } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateX509Key obj = - new netscape.security.x509.CertificateX509Key( - new ByteArrayInputStream(decoder.decodeBuffer(value))); + netscape.security.x509.CertificateAlgorithmId obj = + new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertInfo")) { + } else if (type.equals("netscape.security.x509.CertificateChain")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertInfo obj = - new netscape.security.x509.X509CertInfo( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateChain obj = + new netscape.security.x509.CertificateChain(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateExtensions")) { BASE64Decoder decoder = new BASE64Decoder(); @@ -377,13 +383,6 @@ class CMS73LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateExtensions" table.put(name, obj); - } else if (type.equals("netscape.security.x509.CertificateChain")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateChain obj = - new netscape.security.x509.CertificateChain(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); } else if (type.equals("netscape.security.x509.CertificateSubjectName")) { BASE64Decoder decoder = new BASE64Decoder(); netscape.security.x509.CertificateSubjectName obj = @@ -391,34 +390,58 @@ class CMS73LdifParser // CMS 6.2: revised method of decoding objects of type // "netscape.security.x509.CertificateSubjectName" table.put(name, obj); - } else if (type.equals("netscape.security.x509.X509CertImpl")) { + } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.X509CertImpl obj = - new netscape.security.x509.X509CertImpl( - decoder.decodeBuffer(value)); + netscape.security.x509.CertificateValidity obj = + new netscape.security.x509.CertificateValidity(); + ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); + obj.decode(bis); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { - // + } else if (type.equals("netscape.security.x509.CertificateX509Key")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.CertificateX509Key obj = + new netscape.security.x509.CertificateX509Key( + new ByteArrayInputStream(decoder.decodeBuffer(value))); + table.put(name, obj); + } else if (type.startsWith("com.netscape.certsrv.cert.CertInfo")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); + netscape.security.extensions.CertInfo objs[] = (netscape.security.extensions.CertInfo[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new netscape.security.x509.X509CertImpl[size]; + objs = new netscape.security.extensions.CertInfo[size]; table.put(name, objs); } - objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { + objs[index] = new netscape.security.extensions.CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) + java.util.Hashtable obj = (java.util.Hashtable)table.get(name); + if (obj == null) { + obj = new java.util.Hashtable(); + table.put(name, obj); + } + BASE64Decoder decoder = new BASE64Decoder(); + String valuekey = value.substring(0, value.indexOf('=')); + String valuevalue = value.substring(value.indexOf('=')+1); + obj.put(valuekey, decoder.decodeBuffer(valuevalue)); + } else if (type.startsWith("Integer[")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); - BASE64Decoder decoder = new BASE64Decoder(); + Integer objs[] = (Integer[])table.get(name); if (objs == null) { - objs = new netscape.security.x509.RevokedCertImpl[size]; - table.put(name, objs); + objs = new Integer[size]; + table.put(name, objs); } - objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); - } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { + objs[index] = new Integer(value); + } else if (type.startsWith("java.lang.Integer")) { + table.put(name, new Integer(value)); + } else if (type.startsWith("org.mozilla.jss.asn1.INTEGER")) { + // CMS 7.1 stores bodyPartId as INTEGER + // CS 72. fixed the problem by storing it as String + table.put(name, value); + } else if (type.startsWith("com.netscape.certsrv.dbs.keydb.KeyRecord") + || type.startsWith("com.netscape.cmscore.dbs.KeyRecord")) { com.netscape.cmscore.dbs.KeyRecord obj = (com.netscape.cmscore.dbs.KeyRecord)table.get(name); if (obj == null) { @@ -444,50 +467,91 @@ class CMS73LdifParser BASE64Decoder decoder = new BASE64Decoder(); obj.set(valuekey, decoder.decodeBuffer(valuevalue)); } else { - System.err.println("ERROR AuthToken type - " + attr); + System.err.println("ERROR KeyRecord type - " + attr); System.exit(0); } - } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { + } else if (type.startsWith("java.util.Locale")) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" + table.put(name, Locale.getDefault()); + } else if (type.startsWith("com.netscape.certsrv.kra.ProofOfArchival") + || type.startsWith("com.netscape.cmscore.kra.ProofOfArchival")) { BASE64Decoder decoder = new BASE64Decoder(); ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); com.netscape.certsrv.kra.ProofOfArchival obj = buildPOA(decoder.decodeBuffer(value)); table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateAlgorithmId")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateAlgorithmId obj = - new netscape.security.x509.CertificateAlgorithmId(new ByteArrayInputStream(decoder.decodeBuffer(value))); - table.put(name, obj); - } else if (type.startsWith("netscape.security.x509.CertificateValidity")) { - BASE64Decoder decoder = new BASE64Decoder(); - netscape.security.x509.CertificateValidity obj = - new netscape.security.x509.CertificateValidity(); - ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(value)); - obj.decode(bis); - table.put(name, obj); - } else if (type.startsWith("Integer[")) { + } else if (type.startsWith("netscape.security.x509.RevokedCertImpl")) { int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - Integer objs[] = (Integer[])table.get(name); + netscape.security.x509.RevokedCertImpl objs[] = (netscape.security.x509.RevokedCertImpl[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); if (objs == null) { - objs = new Integer[size]; - table.put(name, objs); + objs = new netscape.security.x509.RevokedCertImpl[size]; + table.put(name, objs); } - objs[index] = new Integer(value); - } else if (type.startsWith("java.math.BigInteger[")) { + objs[index] = new netscape.security.x509.RevokedCertImpl(decoder.decodeBuffer(value)); + } else if (type.startsWith("java.lang.String[")) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); - java.math.BigInteger objs[] = (java.math.BigInteger[])table.get(name); + java.lang.String objs[] = (java.lang.String[])table.get(name); if (objs == null) { - objs = new java.math.BigInteger[size]; + objs = new java.lang.String[size]; table.put(name, objs); } - objs[index] = new java.math.BigInteger(value); - } else if (type.startsWith("byte[")) { - // byte array + objs[index] = new java.lang.String(value); + } else if (type.startsWith("java.lang.String")) { + table.put(name, value); + } else if (type.startsWith("java.util.Vector")) { + Vector obj = + (Vector)table.get(name); + if (obj == null) { + obj = new Vector(); + table.put(name, obj); + } + obj.addElement(value); + } else if (type.startsWith("netscape.security.x509.X509CertImpl[")) { + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertImpl objs[] = (netscape.security.x509.X509CertImpl[])table.get(name); BASE64Decoder decoder = new BASE64Decoder(); - table.put(name, decoder.decodeBuffer(value)); + if (objs == null) { + objs = new netscape.security.x509.X509CertImpl[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertImpl(decoder.decodeBuffer(value)); + } else if (type.equals("netscape.security.x509.X509CertImpl")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertImpl obj = + new netscape.security.x509.X509CertImpl( + decoder.decodeBuffer(value)); + table.put(name, obj); + } else if (type.startsWith("netscape.security.x509.X509CertInfo[") + || type.startsWith("netscape.security.extensions.CertInfo[")) { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" + int size = Integer.parseInt(type.substring(type.indexOf('[')+ 1, type.indexOf(','))); + int index = Integer.parseInt(type.substring(type.indexOf(',')+1, type.indexOf(']'))); + netscape.security.x509.X509CertInfo objs[] = (netscape.security.x509.X509CertInfo[])table.get(name); + BASE64Decoder decoder = new BASE64Decoder(); + if (objs == null) { + objs = new netscape.security.x509.X509CertInfo[size]; + table.put(name, objs); + } + objs[index] = new netscape.security.x509.X509CertInfo(); + objs[index].decode(new ByteArrayInputStream(decoder.decodeBuffer(value))); + } else if (type.equals("netscape.security.x509.X509CertInfo")) { + BASE64Decoder decoder = new BASE64Decoder(); + netscape.security.x509.X509CertInfo obj = + new netscape.security.x509.X509CertInfo( + decoder.decodeBuffer(value)); + table.put(name, obj); } else if( type.endsWith( "Exception" ) ) { Class[] argClass = { String.class }; // the argument's class Object[] argValue = { value }; // the argument's value @@ -496,7 +560,6 @@ class CMS73LdifParser Constructor ctr = x.getConstructor( argClass ); Exception e = ( Exception ) ctr.newInstance( argValue ); } else { - // System.err.println("ERROR type - " + type + " - "+ attr); System.exit(0); } diff --git a/pki/base/migrate/TxtTo73/src/compile.sh b/pki/base/migrate/TxtTo73/src/compile.sh index 05d512a5..a8230e67 100755 --- a/pki/base/migrate/TxtTo73/src/compile.sh +++ b/pki/base/migrate/TxtTo73/src/compile.sh @@ -133,9 +133,9 @@ fi ### -### Compile TxtTo70 - create "CMS73LdifParser.class", "DummyAuthManager.class", +### Compile TxtTo73 - create "CMS73LdifParser.class", "DummyAuthManager.class", ### and "Main.class" ### -${JAVA_HOME}/bin/javac -d ${TARGET} -classpath ${JAVA_HOME}/jre/lib/rt.jar:/usr/share/java/rhpki/nsutil.jar:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/lib/java/dirsec/jss4.jar Main.java +${JAVA_HOME}/bin/javac -d ${TARGET} -classpath ${JAVA_HOME}/jre/lib/rt.jar:/usr/share/java/rhpki/nsutil.jar:/usr/share/java/rhpki/certsrv.jar:/usr/share/java/rhpki/cmscore.jar:/usr/lib/java/rhpki/ca/ca.jar:/usr/lib/java/rhpki/tks/tks.jar:/usr/lib/java/rhpki/ocsp/ocsp.jar:/usr/lib/java/rhpki/kra/kra.jar:/usr/lib/java/dirsec/jss4.jar Main.java diff --git a/pki/base/migrate/TxtTo80/classes/CS80LdifParser.class b/pki/base/migrate/TxtTo80/classes/CS80LdifParser.class Binary files differindex 36a68aee..399c46fa 100644 --- a/pki/base/migrate/TxtTo80/classes/CS80LdifParser.class +++ b/pki/base/migrate/TxtTo80/classes/CS80LdifParser.class diff --git a/pki/base/migrate/TxtTo80/run.sh b/pki/base/migrate/TxtTo80/run.sh index d7744a30..6dde5575 100755 --- a/pki/base/migrate/TxtTo80/run.sh +++ b/pki/base/migrate/TxtTo80/run.sh @@ -309,6 +309,9 @@ fi ### Setup the appropriate CLASSPATH and LD_LIBRARY_PATH ### environment variables based upon the platform ### +### NOTE: As of SunOS JDK 1.4.0, the required "Unicode" classes +### have been moved from "i18n.jar" to "rt.jar". +### if [ ! -f "/usr/share/java/pki/cmscore.jar" ] && [ ! -f "/usr/share/java/pki/certsrv.jar" ]; then diff --git a/pki/base/migrate/TxtTo80/src/Main.java b/pki/base/migrate/TxtTo80/src/Main.java index 786245fb..b5855ca8 100644 --- a/pki/base/migrate/TxtTo80/src/Main.java +++ b/pki/base/migrate/TxtTo80/src/Main.java @@ -391,115 +391,155 @@ class CS80LdifParser return; } - if( type.startsWith( "java.lang.String" ) ) { - // Examples: - // - // key.equals( "publickey" ) - // key.equals( "cert_request" ) + // To account for '47ToTxt' data files that have previously + // been generated, ALWAYS convert 'iplanet' to 'netscape'. + // + // Bugzilla Bug #224801 (a.k.a - Raidzilla Bug #56981) + // Bugzilla Bug #483519 + // + String translation = null; + if( type.startsWith( "iplanet" ) ) { + translation = "netscape" + + type.substring( 7 ); + type = translation; + } else if( type.startsWith( "com.iplanet" ) ) { + translation = "com.netscape" + + type.substring( 11 ); + type = translation; + } + + if( type.startsWith( "com.netscape.certsrv.request.AgentApprovals" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + - formatData( data ) ); - } else if( type.startsWith( "org.mozilla.jss.asn1.INTEGER" ) ) { - // CS 7.1 stores bodyPartId as INTEGER - // CS 7.2 fixed the problem by storing it as String + formatData( data ) ); + } else if( type.startsWith( "com.netscape.certsrv.base.ArgBlock" ) + || type.startsWith( "com.netscape.cmscore.base.ArgBlock" ) ) { + // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and + // moved old "com.netscape.certsrv.base.ArgBlock" + // to "com.netscape.cmscore.base.ArgBlock" System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "byte[]" ) ) { + } else if( type.startsWith( "com.netscape.certsrv.authentication.AuthToken" ) ) { + // Processes 'java.math.BigInteger[]': + // + // Bugzilla Bug #225031 (a.k.a - Raidzilla Bug #58356) + // + // Processes 'java.lang.String[]': + // + // Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949) + // Bugzilla Bug #252240 + // System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "java.lang.Integer" ) ) { + } else if( type.startsWith( "java.math.BigInteger[" ) ) { + // Bugzilla Bug #238779 System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); } else if( type.startsWith( "java.math.BigInteger" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "java.util.Locale" ) ) { - // CMS 6.2: begin checking for new type - // "java.util.Locale" + } else if( type.startsWith( "byte[]" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "java.util.Vector" ) ) { + } else if( type.startsWith( "byte[" ) ) { + // byte array System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.base.ArgBlock" ) || type.startsWith( "com.netscape.cmscore.base.ArgBlock" ) ) { - // CMS 6.1: created new "com.netscape.certsrv.base.IArgBlock" and - // moved old "com.netscape.certsrv.base.ArgBlock" - // to "com.netscape.cmscore.base.ArgBlock" + } else if( type.startsWith( "netscape.security.x509.CertificateAlgorithmId" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.request.AgentApprovals" ) ) { + } else if( type.equals( "netscape.security.x509.CertificateChain" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.authentication.AuthToken" ) ) { + } else if( type.equals( "netscape.security.x509.CertificateExtensions" ) ) { + // XXX - "db2ldif" appears dumps these as ":" values, but they + // always appear as "::" base-64 encoded values? + // CMS 6.2: revised method of decoding objects of type + // "netscape.security.x509.CertificateExtensions" System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "netscape.security.x509.X509CertInfo[" ) || type.startsWith( "netscape.security.extensions.CertInfo[" ) ) { - // CMS 6.2: begin checking for additional new type - // "netscape.security.extensions.CertInfo[" - // - // CMS 6.1: "netscape.security.x509.X509CertInfo" - // now always utilizes arrays such as - // "netscape.security.x509.X509CertInfo[" + } else if( type.equals( "netscape.security.x509.CertificateSubjectName" ) ) { + // CMS 6.2: revised method of decoding objects of type + // "netscape.security.x509.CertificateSubjectName" System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.cert.CertInfo" ) ) { + } else if( type.startsWith( "netscape.security.x509.CertificateValidity" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); } else if( type.equals( "netscape.security.x509.CertificateX509Key" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.equals( "netscape.security.x509.X509CertInfo" ) ) { + } else if( type.startsWith( "com.netscape.certsrv.cert.CertInfo" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.equals( "netscape.security.x509.CertificateExtensions" ) ) { - // XXX - "db2ldif" appears dumps these as ":" values, but they - // always appear as "::" base-64 encoded values? - // CMS 6.2: revised method of decoding objects of type - // "netscape.security.x509.CertificateExtensions" + } else if (type.startsWith("java.util.Hashtable")) { + // Bugzilla Bug #224800 (a.k.a - Raidzilla Bug #56953) System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.equals( "netscape.security.x509.CertificateChain" ) ) { + } else if( type.startsWith( "Integer[" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.equals( "netscape.security.x509.CertificateSubjectName" ) ) { - // CMS 6.2: revised method of decoding objects of type - // "netscape.security.x509.CertificateSubjectName" + } else if( type.startsWith( "java.lang.Integer" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.equals( "netscape.security.x509.X509CertImpl" ) ) { + } else if( type.startsWith( "org.mozilla.jss.asn1.INTEGER" ) ) { + // CS 7.1 stores bodyPartId as INTEGER + // CS 7.2 fixed the problem by storing it as String System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "netscape.security.x509.X509CertImpl[" ) ) { + } else if( type.startsWith( "com.netscape.certsrv.dbs.keydb.KeyRecord" ) + || type.startsWith( "com.netscape.cmscore.dbs.KeyRecord" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "netscape.security.x509.RevokedCertImpl" ) ) { + } else if( type.startsWith( "java.util.Locale" ) ) { + // CMS 6.2: begin checking for new type + // "java.util.Locale" System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.dbs.keydb.KeyRecord" ) || type.startsWith( "com.netscape.cmscore.dbs.KeyRecord" ) ) { + } else if( type.startsWith( "com.netscape.certsrv.kra.ProofOfArchival" ) + || type.startsWith( "com.netscape.cmscore.kra.ProofOfArchival" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "com.netscape.certsrv.kra.ProofOfArchival" ) || type.startsWith( "com.netscape.cmscore.kra.ProofOfArchival" ) ) { + } else if( type.startsWith( "netscape.security.x509.RevokedCertImpl" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "netscape.security.x509.CertificateAlgorithmId" ) ) { + } else if( type.startsWith( "java.lang.String[" ) ) { + // Bugzilla Bug #223360 (a.k.a - Raidzilla Bug #58086) System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "netscape.security.x509.CertificateValidity" ) ) { + } else if (type.startsWith("java.lang.String")) { + // Examples: + // + // key.equals( "publickey" ) + // key.equals( "cert_request" ) + System.out.println( extAttrPrefix + encodeKey( key ) + ": " + + formatData( data ) ); + } else if( type.startsWith( "java.util.Vector" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "Integer[" ) ) { + } else if( type.startsWith( "netscape.security.x509.X509CertImpl[" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "java.math.BigInteger[" ) ) { + } else if( type.equals( "netscape.security.x509.X509CertImpl" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); - } else if( type.startsWith( "byte[" ) ) { + } else if( type.startsWith( "netscape.security.x509.X509CertInfo[" ) + || type.startsWith( "netscape.security.extensions.CertInfo[" ) ) + { + // CMS 6.2: begin checking for additional new type + // "netscape.security.extensions.CertInfo[" + // + // CMS 6.1: "netscape.security.x509.X509CertInfo" + // now always utilizes arrays such as + // "netscape.security.x509.X509CertInfo[" + System.out.println( extAttrPrefix + encodeKey( key ) + ": " + + formatData( data ) ); + } else if( type.equals( "netscape.security.x509.X509CertInfo" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); } else if( type.endsWith( "Exception" ) ) { System.out.println( extAttrPrefix + encodeKey( key ) + ": " + formatData( data ) ); } else { - // System.err.println( "ERROR type - " + type + " - "+ attr ); System.exit( 0 ); } |