Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -14,11 +14,7 @@ LIB_MCS_FLAGS = -unsafe -nowarn:414,618 -d:SECURITY_DEP
LOCAL_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:168,169,183,219,414
XTEST_LIB_REFS = System.Core System Facades/System.Linq Facades/System.Threading.Tasks
EXTRA_DISTFILES = \
TEST_RESOURCE_FILES = \
Test/System.Security.Cryptography.Xml/sample.pfx \
Test/System.Security.Cryptography.Xml/EncryptedXmlSample1.xml \
Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml \
@@ -26,4 +22,10 @@ EXTRA_DISTFILES = \
Test/System.Security.Cryptography.Pkcs/detached.data \
Test/System.Security.Cryptography.Pkcs/detached.p7
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:168,169,183,219,414 $(foreach r, $(TEST_RESOURCE_FILES), -resource:$(r),$(r))
XTEST_LIB_REFS = System.Core System Facades/System.Linq Facades/System.Threading.Tasks
EXTRA_DISTFILES = $(TEST_RESOURCE_FILES)
include ../../build/library.make

View File

@@ -1,4 +1,5 @@
../../corlib/corefx/SR.cs
../../test-helpers/TestResourceHelper.cs
System.Security.Cryptography/CryptographicAttributeObjectCollectionTest.cs
System.Security.Cryptography/CryptographicAttributeObjectEnumeratorTest.cs
System.Security.Cryptography/CryptographicAttributeTest.cs

View File

@@ -38,6 +38,8 @@ using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
using MonoTests.Helpers;
namespace MonoTests.System.Security.Cryptography.Pkcs {
[TestFixture]
@@ -441,9 +443,8 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
[Test]
public void CheckSignatureDetachedSignedCms ()
{
string path = Path.Combine ("Test", "System.Security.Cryptography.Pkcs");
var signedBytes = File.ReadAllBytes (Path.Combine (path, "detached.data"));
var bytes = File.ReadAllBytes (Path.Combine (path, "detached.p7"));
var signedBytes = File.ReadAllBytes (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Pkcs/detached.data"));
var bytes = File.ReadAllBytes (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Pkcs/detached.p7"));
var oid = new Oid ("1.2.840.113549.1.7.2");
var contentInfo = new ContentInfo (oid, signedBytes);

View File

@@ -18,6 +18,8 @@ using System.Xml;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.Security.Cryptography.Xml
{
[TestFixture]
@@ -26,7 +28,7 @@ namespace MonoTests.System.Security.Cryptography.Xml
[Test]
public void Sample1 ()
{
AssertDecryption1 ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample1.xml");
AssertDecryption1 (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample1.xml"));
}
void AssertDecryption1 (string filename)
@@ -35,7 +37,7 @@ namespace MonoTests.System.Security.Cryptography.Xml
doc.PreserveWhitespace = true;
doc.Load (filename);
EncryptedXml encxml = new EncryptedXml (doc);
RSACryptoServiceProvider rsa = new X509Certificate2 ("Test/System.Security.Cryptography.Xml/sample.pfx", "mono").PrivateKey as RSACryptoServiceProvider;
RSACryptoServiceProvider rsa = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Xml/sample.pfx"), "mono").PrivateKey as RSACryptoServiceProvider;
XmlNamespaceManager nm = new XmlNamespaceManager (doc.NameTable);
nm.AddNamespace ("s", "http://www.w3.org/2003/05/soap-envelope");
nm.AddNamespace ("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
@@ -68,7 +70,7 @@ namespace MonoTests.System.Security.Cryptography.Xml
XmlDocument doc = new XmlDocument ();
doc.PreserveWhitespace = true;
doc.Load ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml");
doc.Load (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml"));
EncryptedXml encxml = new EncryptedXml (doc);
EncryptedData edata = new EncryptedData ();
edata.LoadXml (doc.DocumentElement);
@@ -78,7 +80,7 @@ namespace MonoTests.System.Security.Cryptography.Xml
[Test]
public void Sample3 ()
{
AssertDecryption1 ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample3.xml");
AssertDecryption1 (TestResourceHelper.GetFullPathOfResource ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample3.xml"));
}
[Test]

View File

@@ -0,0 +1 @@
#include monotouch_System.Security_test.dll.exclude.sources

View File

@@ -0,0 +1 @@
#include monotouch_System.Security_test.dll.exclude.sources

View File

@@ -0,0 +1 @@
#include win32_System.Security.dll.exclude.sources

View File

@@ -0,0 +1 @@
#include win32_System.Security.dll.sources