2006-12-14 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 15 Dec 2006 00:33:51 +0000 (00:33 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 15 Dec 2006 00:33:51 +0000 (00:33 -0000)
* X501Name.cs: Added support for (some cases of) T.61 strings, like
the latin-1 encoded accentued characters founds in some DN. Fix bug
#77295.

svn path=/trunk/mcs/; revision=69516

mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs

index f593de7b8cdb10de4aff22ba6e324af72a50f3e6..49261cb9f58b392981b7a20e11dc4ac5d03eeb85 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-14  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * X501Name.cs: Added support for (some cases of) T.61 strings, like
+       the latin-1 encoded accentued characters founds in some DN. Fix bug 
+       #77295.
+
 2006-12-11  Sebastien Pouliot  <sebastien@ximian.com>
 
        * PKCS12.cs: Fix DSA certificates (with parameters) and don't throw
index 1d98a00e684023fe1d4c4d773483266b9b7c3352..8343e5fb557eab20797796e54a31cb5159cddae4 100644 (file)
@@ -176,7 +176,10 @@ namespace Mono.Security.X509 {
                                                sb2.Append ((char)s.Value[j]);
                                        sValue = sb2.ToString ();
                                } else {
-                                       sValue = Encoding.UTF8.GetString (s.Value);
+                                       if (s.Tag == 0x14)
+                                               sValue = Encoding.UTF7.GetString (s.Value);
+                                       else
+                                               sValue = Encoding.UTF8.GetString (s.Value);
                                        // in some cases we must quote (") the value
                                        // Note: this doesn't seems to conform to RFC2253
                                        char[] specials = { ',', '+', '"', '\\', '<', '>', ';' };