Bug 575984 - Untrustworthy Certificate dialog

Parsing of the name requires special handling for , and + and therefore
uses \ to escape those characters.  The result of the parsing should
remove/interpret the \ escape to present the value in a more
human-readable way based on the original intended text value.

Change-Id: Ibfb887a610b131fd06eef83f2e7b1b4bcf3fdf31
Signed-off-by: Ed Merks <ed.merks@gmail.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.bundles/+/189670
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
diff --git a/bundles/org.eclipse.equinox.security.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.security.ui/META-INF/MANIFEST.MF
index 9907cde..11308c6 100644
--- a/bundles/org.eclipse.equinox.security.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.security.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.equinox.security.ui;singleton:=true
-Bundle-Version: 1.3.100.qualifier
+Bundle-Version: 1.3.200.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Import-Package: javax.crypto.spec,
diff --git a/bundles/org.eclipse.equinox.security.ui/pom.xml b/bundles/org.eclipse.equinox.security.ui/pom.xml
index 975fd05..4a99d3f 100644
--- a/bundles/org.eclipse.equinox.security.ui/pom.xml
+++ b/bundles/org.eclipse.equinox.security.ui/pom.xml
@@ -21,7 +21,7 @@
 
   <groupId>org.eclipse.equinox</groupId>
   <artifactId>org.eclipse.equinox.security.ui</artifactId>
-  <version>1.3.100-SNAPSHOT</version>
+  <version>1.3.200-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
 </project>
diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java
index 6fd82dd..53f217f 100644
--- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java
+++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java
@@ -196,19 +196,22 @@
 
 		while (startIndex < dn.length()) {
 			int endIndex;
+			StringBuilder value = new StringBuilder();
 			for (endIndex = startIndex; endIndex < dn.length(); endIndex++) {
 				c = dn.charAt(endIndex);
 				if (c == ',' || c == '+')
 					break;
 				if (c == '\\') {
 					endIndex++; // skip the escaped char
+				} else {
+					value.append(c);
 				}
 			}
 
 			if (endIndex > dn.length())
 				throw new IllegalArgumentException("unterminated escape " + dn); //$NON-NLS-1$
 
-			nameValues.add(dn.substring(startIndex, endIndex));
+			nameValues.add(value.toString());
 
 			if (c != '+') {
 				rdnNameArray.add(nameValues);