Author: spouliot
Date: 2006-10-08 12:06:08 -0400 (Sun, 08 Oct 2006)
New Revision: 66412
Modified:
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
Log:
2006-10-08 Sebastien Pouliot <[EMAIL PROTECTED]>
* X509Certificate.cs: Ensure we can load certificates from read-only
files (fix bug #79616). Refactored to avoid code duplication.
Modified:
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
===================================================================
---
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
2006-10-08 15:54:08 UTC (rev 66411)
+++
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
2006-10-08 16:06:08 UTC (rev 66412)
@@ -1,3 +1,8 @@
+2006-10-08 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * X509Certificate.cs: Ensure we can load certificates from read-only
+ files (fix bug #79616). Refactored to avoid code duplication.
+
2006-08-08 Sebastien Pouliot <[EMAIL PROTECTED]>
* X509Certificate.cs: A unrequired password can be supplied to the
Modified:
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
===================================================================
---
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
2006-10-08 15:54:08 UTC (rev 66411)
+++
trunk/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
2006-10-08 16:06:08 UTC (rev 66412)
@@ -1,5 +1,5 @@
//
-// X509Certificates.cs: Handles X.509 certificates.
+// X509Certificate.cs: Handles X.509 certificates.
//
// Author:
// Sebastien Pouliot <[EMAIL PROTECTED]>
@@ -97,12 +97,7 @@
public static X509Certificate CreateFromCertFile (string
filename)
{
- byte[] data = null;
- using (FileStream fs = File.OpenRead (filename)) {
- data = new byte [fs.Length];
- fs.Read (data, 0, data.Length);
- fs.Close ();
- }
+ byte[] data = Load (filename);
return new X509Certificate (data);
}
@@ -581,17 +576,6 @@
Import (rawData, (string)null, keyStorageFlags);
}
- private byte[] Load (string fileName)
- {
- byte[] data = null;
- using (FileStream fs = new FileStream (fileName,
FileMode.Open)) {
- data = new byte [fs.Length];
- fs.Read (data, 0, data.Length);
- fs.Close ();
- }
- return data;
- }
-
[MonoTODO]
void ISerializable.GetObjectData (SerializationInfo info,
StreamingContext context)
{
@@ -610,5 +594,15 @@
get { return (IntPtr) 0; }
}
#endif
+ private static byte[] Load (string fileName)
+ {
+ byte[] data = null;
+ using (FileStream fs = File.OpenRead (fileName)) {
+ data = new byte [fs.Length];
+ fs.Read (data, 0, data.Length);
+ fs.Close ();
+ }
+ return data;
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches