summaryrefslogtreecommitdiffstats
path: root/pki/base/migrate/TxtTo80/src/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/migrate/TxtTo80/src/Main.java')
-rw-r--r--pki/base/migrate/TxtTo80/src/Main.java40
1 files changed, 36 insertions, 4 deletions
diff --git a/pki/base/migrate/TxtTo80/src/Main.java b/pki/base/migrate/TxtTo80/src/Main.java
index 890a92ad..ad9eb6b1 100644
--- a/pki/base/migrate/TxtTo80/src/Main.java
+++ b/pki/base/migrate/TxtTo80/src/Main.java
@@ -418,8 +418,22 @@ class CS80LdifParser
// 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 ) );
+
+ // Bugzilla Bug #737217 - adding proper "ext-data" array format
+ int secondEqual = data.indexOf('=');
+ if (secondEqual == -1) {
+ if( mErrorPrintWriter != null ) {
+ if( dn != null ) {
+ mErrorPrintWriter.println( dn );
+ }
+ mErrorPrintWriter.println( "Skipped " + attr );
+ }
+ return;
+ }
+ String subKey = data.substring( 0, secondEqual );
+ String subKeyData = data.substring( secondEqual + 1 );
+ System.out.println( extAttrPrefix + encodeKey( key ) + ";" +
+ subKey + ": " + formatData( subKeyData ) );
} else if( type.startsWith( "com.netscape.certsrv.authentication.AuthToken" ) ) {
// Processes 'java.math.BigInteger[]':
//
@@ -430,8 +444,26 @@ class CS80LdifParser
// Bugzilla Bug #224763 (a.k.a - Raidzilla Bug #57949)
// Bugzilla Bug #252240
//
- System.out.println( extAttrPrefix + encodeKey( key ) + ": " +
- formatData( data ) );
+
+ // Bugzilla Bug #737217 - adding proper "ext-data" array format
+ int secondColon = data.indexOf(':');
+ int secondEqual = data.indexOf('=');
+ if (secondEqual == -1 || secondColon >= secondEqual) {
+ if( mErrorPrintWriter != null ) {
+ if( dn != null ) {
+ mErrorPrintWriter.println( dn );
+ }
+ mErrorPrintWriter.println( "Skipped " + attr );
+ }
+ return;
+ }
+ if (secondColon == -1) {
+ secondColon = secondEqual;
+ }
+ String subKey = data.substring( 0, secondColon );
+ String subKeyData = data.substring( secondEqual + 1 );
+ System.out.println( extAttrPrefix + encodeKey( key ) + ";" +
+ subKey + ": " + formatData( subKeyData ) );
} else if( type.startsWith( "java.math.BigInteger[" ) ) {
// Bugzilla Bug #238779
System.out.println( extAttrPrefix + encodeKey( key ) + ": " +