2006-01-24 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Wed, 25 Jan 2006 01:44:00 +0000 (01:44 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Wed, 25 Jan 2006 01:44:00 +0000 (01:44 -0000)
* PKCS12.cs: Consider String.Empty as a null password (e.g. don't
throw an IndexOutOfRangeException). Fix part of bug #77342.

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

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

index c85aaabe4d7d686a7c5dc24234b7a3da6ddc78d6..a2b1b9227eb272ae03dc50a02926c7ccd0564a93 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-24  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * PKCS12.cs: Consider String.Empty as a null password (e.g. don't
+       throw an IndexOutOfRangeException). Fix part of bug #77342.
+
 2006-01-05  Sebastien Pouliot  <sebastien@ximian.com>
 
        * X509Extension.cs: Extension data may be encapsulated (i.e. ASN.1
index 7fcbf87a6523c335af553e99e1af5fc8e745f585..06050faf7b8ce359e3a5c0886616b4c769ee13b6 100644 (file)
@@ -5,7 +5,7 @@
 //     Sebastien Pouliot <sebastien@ximian.com>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+// Copyright (C) 2004,2005,2006 Novell Inc. (http://www.novell.com)
 //
 // Key derivation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
 // See bouncycastle.txt for license.
@@ -425,7 +425,7 @@ namespace Mono.Security.X509 {
 
                public string Password {
                        set {
-                               if (value != null) {
+                               if ((value != null) && (value.Length > 0)) {
                                        int size = value.Length;
                                        int nul = 0;
                                        if (size < MaximumPasswordLength) {