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

@@ -50,8 +50,8 @@ namespace MonoTests.System.ServiceModel.Security
[TestFixture]
public class SecurityMessagePropertyTest
{
static X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
static X509Certificate2 cert2 = new X509Certificate2 ("Test/Resources/test2.pfx", "mono");
static X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
static X509Certificate2 cert2 = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test2.pfx"), "mono");
[ServiceContract]
public interface ICalc

View File

@@ -41,6 +41,8 @@ using NUnit.Framework;
using ReqType = System.ServiceModel.Security.Tokens.ServiceModelSecurityTokenRequirement;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Security
{
[TestFixture]
@@ -253,7 +255,7 @@ namespace MonoTests.System.ServiceModel.Security
SecurityTokenRequirement r =
new RecipientServiceModelSecurityTokenRequirement ();
r.TokenType = SecurityTokenTypes.X509Certificate;
X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.cer");
X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
def_c.ServiceCredentials.ServiceCertificate.Certificate = cert;
def_c.CreateSecurityTokenProvider (r);
}
@@ -265,7 +267,7 @@ namespace MonoTests.System.ServiceModel.Security
new RecipientServiceModelSecurityTokenRequirement ();
r.TokenType = SecurityTokenTypes.X509Certificate;
def_c.ServiceCredentials.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
X509SecurityTokenProvider p =
def_c.CreateSecurityTokenProvider (r)
as X509SecurityTokenProvider;
@@ -282,7 +284,7 @@ namespace MonoTests.System.ServiceModel.Security
r.KeyUsage = SecurityKeyUsage.Exchange;
// ClientCredential is somehow required ...
def_c.ServiceCredentials.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
X509SecurityTokenProvider p =
def_c.CreateSecurityTokenProvider (r)

View File

@@ -42,6 +42,8 @@ using System.IdentityModel.Tokens;
using System.Xml;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Security
{
[TestFixture]
@@ -50,7 +52,7 @@ namespace MonoTests.System.ServiceModel.Security
const string wssNS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
const string wsuNS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
static X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
static X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
const string derived_key_token1 = @"<c:DerivedKeyToken u:Id='_1' xmlns:u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' xmlns:c='http://schemas.xmlsoap.org/ws/2005/02/sc'>
<o:SecurityTokenReference xmlns:o='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>
@@ -168,7 +170,7 @@ namespace MonoTests.System.ServiceModel.Security
StringWriter sw = new StringWriter ();
XmlElement xml = new XmlDocument ().CreateElement ("foo");
SecurityToken token = new X509SecurityToken (new X509Certificate2 ("Test/Resources/test.pfx", "mono"));
SecurityToken token = new X509SecurityToken (new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono"));
SecurityKeyIdentifierClause intref =
token.CreateKeyIdentifierClause<X509IssuerSerialKeyIdentifierClause> ();
SecurityKeyIdentifierClause extref =