summaryrefslogtreecommitdiffstats
path: root/pki/base/migrate/TxtTo80/src/Main.java
diff options
context:
space:
mode:
authormharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-10 16:15:54 +0000
committermharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-10 16:15:54 +0000
commit896d10e3af28ac280684f802eb192c1ab25d8d02 (patch)
treeb2270868e405f13f5bc26c164a3ef1b056b3e6d0 /pki/base/migrate/TxtTo80/src/Main.java
parent7433e539c115c641849ddb3c8cda507e3042a579 (diff)
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/migrate/TxtTo80/src/Main.java')
-rw-r--r--pki/base/migrate/TxtTo80/src/Main.java140
1 files changed, 90 insertions, 50 deletions
diff --git a/pki/base/migrate/TxtTo80/src/Main.java b/pki/base/migrate/TxtTo80/src/Main.java
index 786245fb7..b5855ca8b 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 );
}