Author: spouliot
Date: 2005-04-23 10:15:49 -0400 (Sat, 23 Apr 2005)
New Revision: 43481
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/ChangeLog
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtensionTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ChainPolicyTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtensionTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ExtensionTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509KeyUsageExtensionTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509StoreTest.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtensionTest.cs
Log:
2005-04-23 Sebastien Pouliot <[EMAIL PROTECTED]>
* X509BasicConstraintsExtensionTest.cs, X509ChainPolicyTest.cs,
X509EnhancedKeyUsageExtensionTest.cs, X509ExtensionTest.cs,
X509KeyUsageExtensionTest.cs, X509StoreTest.cs,
X509SubjectKeyIdentifierExtensionTest.cs: Changed X509CertificateEx to
X509Certificate2 and re-activated some tests on Windows that were
fixed in beta2.
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/ChangeLog
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/ChangeLog
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/ChangeLog
2005-04-23 14:15:49 UTC (rev 43481)
@@ -1,3 +1,12 @@
+2005-04-23 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * X509BasicConstraintsExtensionTest.cs, X509ChainPolicyTest.cs,
+ X509EnhancedKeyUsageExtensionTest.cs, X509ExtensionTest.cs,
+ X509KeyUsageExtensionTest.cs, X509StoreTest.cs,
+ X509SubjectKeyIdentifierExtensionTest.cs: Changed X509CertificateEx to
+ X509Certificate2 and re-activated some tests on Windows that were
+ fixed in beta2.
+
2005-01-17 Sebastien Pouliot <[EMAIL PROTECTED]>
* X509BasicConstraintsExtensionTest.cs: New. Unit tests.
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtensionTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtensionTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtensionTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -56,7 +56,6 @@
}
[Test]
- [Category ("NotDotNet")] // MS bug reported as
http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=34cdc5e9-c7f9-4f55-b390-288bfef6e44e
public void ConstructorEmpty_CertificateAuthority ()
{
X509BasicConstraintsExtension bc = new
X509BasicConstraintsExtension ();
@@ -64,7 +63,6 @@
}
[Test]
- [Category ("NotDotNet")] // MS bug reported as
http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=34cdc5e9-c7f9-4f55-b390-288bfef6e44e
public void ConstructorEmpty_HasPathLengthConstraint ()
{
X509BasicConstraintsExtension bc = new
X509BasicConstraintsExtension ();
@@ -72,7 +70,6 @@
}
[Test]
- [Category ("NotDotNet")] // MS bug reported as
http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=34cdc5e9-c7f9-4f55-b390-288bfef6e44e
public void ConstructorEmpty_PathLengthConstraint ()
{
X509BasicConstraintsExtension bc = new
X509BasicConstraintsExtension ();
@@ -239,7 +236,7 @@
[Test]
[ExpectedException (typeof (CryptographicException))]
- public void WrongExtension_X509Extension_KeyUsages ()
+ public void WrongExtension_X509Extension_CertificateAuthority ()
{
X509Extension ex = new X509Extension ("1.2.3", new
byte[0], true);
X509BasicConstraintsExtension bc = new
X509BasicConstraintsExtension ();
@@ -257,8 +254,7 @@
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- // [ExpectedException (typeof (ArgumentNullException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void CopyFrom_Null ()
{
X509BasicConstraintsExtension bc = new
X509BasicConstraintsExtension ();
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ChainPolicyTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ChainPolicyTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ChainPolicyTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -65,7 +65,7 @@
public void ExtraStore ()
{
X509ChainPolicy cp = GetPolicy ();
- cp.ExtraStore.Add (new X509CertificateEx ());
+ cp.ExtraStore.Add (new X509Certificate2 ());
AssertEquals ("ExtraStore", 1, cp.ExtraStore.Count);
}
@@ -143,7 +143,7 @@
X509ChainPolicy cp = GetPolicy ();
cp.ApplicationPolicy.Add (new Oid (signingTimeOid));
cp.CertificatePolicy.Add (new Oid (signingTimeOid));
- cp.ExtraStore.Add (new X509CertificateEx ());
+ cp.ExtraStore.Add (new X509Certificate2 ());
cp.RevocationFlag =
X509RevocationFlag.EndCertificateOnly;
cp.RevocationMode = X509RevocationMode.NoCheck;
cp.UrlRetrievalTimeout = new TimeSpan (100);
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtensionTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtensionTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtensionTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -56,8 +56,6 @@
}
[Test]
- [ExpectedException (typeof (NullReferenceException))]
- [Category ("NotWorking")] // MS bug reported as
http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=34cdc5e9-c7f9-4f55-b390-288bfef6e44e
public void ConstructorEmpty_EnhancedKeyUsages ()
{
X509EnhancedKeyUsageExtension eku = new
X509EnhancedKeyUsageExtension ();
@@ -194,8 +192,7 @@
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- // [ExpectedException (typeof (ArgumentNullException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void CopyFrom_Null ()
{
X509EnhancedKeyUsageExtension eku = new
X509EnhancedKeyUsageExtension ();
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ExtensionTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ExtensionTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509ExtensionTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -1,5 +1,6 @@
//
-// X509ExtensionTest.cs - NUnit tests for X509Extension
+// X509ExtensionTest.cs
+// - NUnit tests for X509Extension
//
// Author:
// Sebastien Pouliot <[EMAIL PROTECTED]>
@@ -154,8 +155,7 @@
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- // [ExpectedException (typeof (ArgumentNullException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void CopyFrom_Null ()
{
X509Ex ex = new X509Ex ();
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509KeyUsageExtensionTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509KeyUsageExtensionTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509KeyUsageExtensionTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -73,6 +73,7 @@
Assert.AreEqual (fname, ku.Oid.FriendlyName,
"Oid.FriendlyName");
Assert.AreEqual ("Information Not Available", ku.Format
(true), "Format(true)");
Assert.AreEqual ("Information Not Available", ku.Format
(false), "Format(false)");
+ Assert.AreEqual (0, (int)ku.KeyUsages, "KeyUsages");
}
[Test]
@@ -141,7 +142,7 @@
[Test]
public void ConstructorKeyUsage_CRLSign ()
{
- X509KeyUsageExtension ku = ValidateKeyUsage
(X509KeyUsageFlags.CRLSign, "03-02-01-02");
+ X509KeyUsageExtension ku = ValidateKeyUsage
(X509KeyUsageFlags.CrlSign, "03-02-01-02");
Assert.AreEqual ("Off-line CRL Signing, CRL Signing
(02)", ku.Format (false), "CRLSign");
ku = ValidateKeyUsage
(X509KeyUsageFlags.DataEncipherment, "03-02-04-10");
@@ -173,7 +174,7 @@
ValidateKeyUsage (X509KeyUsageFlags.EncipherOnly |
X509KeyUsageFlags.DecipherOnly, "03-03-07-01-80");
ValidateKeyUsage (X509KeyUsageFlags.NonRepudiation |
X509KeyUsageFlags.DataEncipherment, "03-02-04-50");
- ku = ValidateKeyUsage (X509KeyUsageFlags.CRLSign |
X509KeyUsageFlags.DataEncipherment | X509KeyUsageFlags.DecipherOnly |
+ ku = ValidateKeyUsage (X509KeyUsageFlags.CrlSign |
X509KeyUsageFlags.DataEncipherment | X509KeyUsageFlags.DecipherOnly |
X509KeyUsageFlags.DigitalSignature |
X509KeyUsageFlags.EncipherOnly | X509KeyUsageFlags.KeyAgreement |
X509KeyUsageFlags.KeyCertSign |
X509KeyUsageFlags.KeyEncipherment | X509KeyUsageFlags.NonRepudiation,
"03-03-07-FF-80");
Assert.AreEqual ("Digital Signature, Non-Repudiation,
Key Encipherment, Data Encipherment, Key Agreement, Certificate Signing,
Off-line CRL Signing, CRL Signing, Encipher Only, Decipher Only (ff 80)" +
Environment.NewLine,
@@ -193,7 +194,7 @@
public void WrongExtension_X509Extension ()
{
X509Extension ex = new X509Extension ("1.2.3", new byte
[0], true);
- X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CRLSign, true);
+ X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CrlSign, true);
ku.CopyFrom (ex);
Assert.IsTrue (ku.Critical, "Critical");
Assert.AreEqual (String.Empty, BitConverter.ToString
(ku.RawData), "RawData");
@@ -216,13 +217,12 @@
public void WrongAsnEncodedData ()
{
AsnEncodedData aed = new AsnEncodedData (new byte[0]);
- X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CRLSign, true);
+ X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CrlSign, true);
ku.CopyFrom (aed); // note: not the same behaviour than
using the constructor!
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- // [ExpectedException (typeof (ArgumentNullException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void CopyFrom_Null ()
{
X509KeyUsageExtension eku = new X509KeyUsageExtension
();
@@ -232,7 +232,7 @@
[Test]
public void CopyFrom_Self ()
{
- X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CRLSign, true);
+ X509KeyUsageExtension ku = new X509KeyUsageExtension
(X509KeyUsageFlags.CrlSign, true);
Assert.IsTrue (ku.Critical, "Critical");
byte[] raw = ku.RawData;
Assert.AreEqual ("03-02-01-02", BitConverter.ToString
(raw), "RawData");
@@ -243,7 +243,7 @@
Assert.AreEqual (4, copy.RawData.Length, "RawData");
// original Oid ignored
Assert.AreEqual (oid, copy.Oid.Value, "Oid.Value");
Assert.AreEqual (fname, copy.Oid.FriendlyName,
"Oid.FriendlyName");
- Assert.AreEqual (X509KeyUsageFlags.CRLSign,
copy.KeyUsages, "KeyUsages");
+ Assert.AreEqual (X509KeyUsageFlags.CrlSign,
copy.KeyUsages, "KeyUsages");
}
}
}
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509StoreTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509StoreTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509StoreTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -235,7 +235,7 @@
AssertEquals ("Name", "NonExistingStore", xs.Name);
AssertNotNull ("Certificates", xs.Certificates);
xs.Open (OpenFlags.ReadOnly);
- xs.Add (new X509CertificateEx ());
+ xs.Add (new X509Certificate2 ());
xs.Close ();
}
@@ -250,7 +250,7 @@
AssertEquals ("Name", "NonExistingStore", xs.Name);
AssertNotNull ("Certificates", xs.Certificates);
xs.Open (OpenFlags.ReadWrite);
- xs.Add (new X509CertificateEx ());
+ xs.Add (new X509Certificate2 ());
xs.Close ();
}
}
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtensionTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtensionTest.cs
2005-04-23 14:09:12 UTC (rev 43480)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtensionTest.cs
2005-04-23 14:15:49 UTC (rev 43481)
@@ -56,11 +56,10 @@
}
[Test]
- [Category ("NotDotNet")] // MS bug reported as
http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=34cdc5e9-c7f9-4f55-b390-288bfef6e44e
public void ConstructorEmpty_SubjectKeyIdentifier ()
{
X509SubjectKeyIdentifierExtension ski = new
X509SubjectKeyIdentifierExtension ();
- Assert.AreEqual (String.Empty,
ski.SubjectKeyIdentifier, "SubjectKeyIdentifier");
+ Assert.IsNull (ski.SubjectKeyIdentifier,
"SubjectKeyIdentifier");
}
[Test]
@@ -264,8 +263,7 @@
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- // [ExpectedException (typeof (ArgumentNullException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void CopyFrom_Null ()
{
X509SubjectKeyIdentifierExtension ski = new
X509SubjectKeyIdentifierExtension ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches