From 896d10e3af28ac280684f802eb192c1ab25d8d02 Mon Sep 17 00:00:00 2001 From: mharmsen Date: Wed, 10 Jun 2009 16:15:54 +0000 Subject: 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 --- pki/base/migrate/42SP2ToTxt/src/Main.java | 38 ++++++++++++++++++++++++++++++ pki/base/migrate/42SP2ToTxt/src/compile.sh | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) (limited to 'pki/base/migrate/42SP2ToTxt/src') diff --git a/pki/base/migrate/42SP2ToTxt/src/Main.java b/pki/base/migrate/42SP2ToTxt/src/Main.java index 9f648aef2..1a324d8ee 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 a6f9c8165..26aa6140b 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 used to compile 42SP2ToTxt ### -#SERVER_ROOT=/export/home/migrate/cms43 +#SERVER_ROOT=/export/home/migrate/cms42sp2 #export SERVER_ROOT -- cgit