Imported Upstream version 4.4.2.4

Former-commit-id: 92904c9c5915c37244316e42ba99e7b934ed7ee2
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-07-21 09:40:10 +00:00
parent 589d484eee
commit 0b4a830db1
343 changed files with 9849 additions and 688 deletions

View File

@ -79,6 +79,7 @@ namespace System.ServiceModel
public BasicHttpsSecurity Security {
get { return security; }
set { security = value; }
}
public override BindingElementCollection

View File

@ -64,6 +64,7 @@ namespace System.ServiceModel
public HttpTransportSecurity Transport {
get { return transport; }
set { transport = value; }
}
}
}

View File

@ -29,7 +29,9 @@ using System;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
#if !MOBILE && !XAMMAC_4_5
using System.Transactions;
#endif
namespace System.ServiceModel
{
@ -45,7 +47,9 @@ namespace System.ServiceModel
MaxItemsInObjectGraph = 0x10000;
UseSynchronizationContext = true;
ValidateMustUnderstand = true;
#if !MOBILE && !XAMMAC_4_5
TransactionIsolationLevel = IsolationLevel.Unspecified;
#endif
}
[MonoTODO]
@ -63,8 +67,10 @@ namespace System.ServiceModel
[MonoTODO]
public int MaxItemsInObjectGraph { get; set; }
#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
public IsolationLevel TransactionIsolationLevel { get; set; }
#endif
[MonoTODO]
public string TransactionTimeout { get; set; }

View File

@ -27,7 +27,9 @@
//
using System;
using System.Collections.Generic;
#if !MOBILE && !XAMMAC_4_5
using System.IdentityModel.Claims;
#endif
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
@ -37,6 +39,7 @@ namespace System.ServiceModel
{
public class DnsEndpointIdentity : EndpointIdentity
{
#if !MOBILE && !XAMMAC_4_5
public DnsEndpointIdentity (Claim identity)
{
Initialize (identity);
@ -46,5 +49,11 @@ namespace System.ServiceModel
: this (Claim.CreateDnsClaim (dns))
{
}
#else
public DnsEndpointIdentity (string dns)
{
throw new NotImplementedException ();
}
#endif
}
}

View File

@ -217,8 +217,11 @@ namespace System.ServiceModel
// no special magic), we have to use different approach
// that should work either.
object proxy = Activator.CreateInstance (type, new object [] {Endpoint, this, address, via});
#else
#elif !MOBILE && !XAMMAC_4_5
object proxy = new ClientRealProxy (typeof (TChannel), new DuplexClientRuntimeChannel (Endpoint, this, address, via), true).GetTransparentProxy ();
#else
object proxy;
throw new NotImplementedException ();
#endif
((IDuplexContextChannel) proxy).CallbackInstance = callbackInstance;

View File

@ -110,7 +110,7 @@ namespace System.ServiceModel
set { reader_quotas = value; }
}
public override abstract string Scheme {
public override string Scheme {
get;
}

View File

@ -31,22 +31,28 @@ namespace System.ServiceModel
{
public sealed class MessageSecurityOverTcp
{
#if !MOBILE && !XAMMAC_4_5
SecurityAlgorithmSuite alg_suite;
#endif
MessageCredentialType client_credential_type;
internal MessageSecurityOverTcp ()
{
#if !MOBILE && !XAMMAC_4_5
alg_suite = SecurityAlgorithmSuite.Default;
#endif
// This default value is *silly* but anyways
// such code that does not change this ClientCredentialType
// won't work on Mono.
client_credential_type = MessageCredentialType.Windows;
}
#if !MOBILE && !XAMMAC_4_5
public SecurityAlgorithmSuite AlgorithmSuite {
get { return alg_suite; }
set { alg_suite = value; }
}
#endif
public MessageCredentialType ClientCredentialType {
get { return client_credential_type; }

View File

@ -27,8 +27,10 @@
//
using System.Collections.Generic;
using System.Collections.ObjectModel;
#if !MOBILE && !XAMMAC_4_5
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
#endif
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.ServiceModel.Security;
@ -38,6 +40,7 @@ namespace System.ServiceModel
{
public abstract class MessageSecurityVersion
{
#if !MOBILE && !XAMMAC_4_5
// Types
class MessageSecurityTokenVersion : SecurityTokenVersion
{
@ -112,6 +115,7 @@ namespace System.ServiceModel
SecureConversationVersion = SecureConversationVersion.WSSecureConversationFeb2005;
TrustVersion = TrustVersion.WSTrustFeb2005;
}
this.SecurityVersion = wss11 ? SecurityVersion.WSSecurity11 : SecurityVersion.WSSecurity10;
}
public override BasicSecurityProfileVersion BasicSecurityProfileVersion {
@ -122,14 +126,11 @@ namespace System.ServiceModel
get { return MessageSecurityTokenVersion.GetVersion (wss11, basic_profile); }
}
public override SecurityVersion SecurityVersion {
get { return wss11 ? SecurityVersion.WSSecurity11 : SecurityVersion.WSSecurity10; }
}
public override SecurityPolicyVersion SecurityPolicyVersion {
get { return use2007 ? SecurityPolicyVersion.WSSecurityPolicy12 : SecurityPolicyVersion.WSSecurityPolicy11; }
}
}
#endif
// Static members
@ -137,12 +138,16 @@ namespace System.ServiceModel
static MessageSecurityVersion ()
{
#if !MOBILE && !XAMMAC_4_5
wss10_basic = new MessageSecurityVersionImpl (false, true, false);
wss11 = new MessageSecurityVersionImpl (true, false, false);
wss11_basic = new MessageSecurityVersionImpl (true, true, false);
wss10_2007_basic = new MessageSecurityVersionImpl (false, true, true);
wss11_2007_basic = new MessageSecurityVersionImpl (true, true, true);
wss11_2007 = new MessageSecurityVersionImpl (true, false, true);
#else
throw new NotImplementedException ();
#endif
}
public static MessageSecurityVersion Default {
@ -183,9 +188,11 @@ namespace System.ServiceModel
public abstract BasicSecurityProfileVersion BasicSecurityProfileVersion { get; }
#if !MOBILE && !XAMMAC_4_5
public abstract SecurityTokenVersion SecurityTokenVersion { get; }
#endif
public abstract SecurityVersion SecurityVersion { get; }
public SecurityVersion SecurityVersion { get; internal set; }
public SecureConversationVersion SecureConversationVersion { get; internal set; }

View File

@ -0,0 +1,83 @@
// Authors:
// Martin Baulig (martin.baulig@xamarin.com)
//
// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ServiceModel.Channels;
namespace System.ServiceModel {
[MonoTODO]
public class NetHttpsBinding : HttpBindingBase {
public NetHttpsBinding ()
{
throw new NotImplementedException ();
}
public NetHttpsBinding (BasicHttpsSecurityMode securityMode)
{
throw new NotImplementedException ();
}
public NetHttpsBinding (string configurationName)
{
throw new NotImplementedException ();
}
public NetHttpsBinding (
BasicHttpsSecurityMode securityMode, bool reliableSessionEnabled)
{
throw new NotImplementedException ();
}
public NetHttpMessageEncoding MessageEncoding { get; set; }
public OptionalReliableSession ReliableSession { get; set; }
public BasicHttpsSecurity Security { get; set; }
public WebSocketTransportSettings WebSocketSettings {
get { throw new NotImplementedException (); }
}
public override string Scheme {
get { throw new NotImplementedException (); }
}
public override BindingElementCollection CreateBindingElements ()
{
throw new NotImplementedException ();
}
public bool ShouldSerializeReliableSession ()
{
throw new NotImplementedException ();
}
public bool ShouldSerializeSecurity ()
{
throw new NotImplementedException ();
}
}
}

View File

@ -46,7 +46,9 @@ namespace System.ServiceModel
XmlDictionaryReaderQuotas reader_quotas
= new XmlDictionaryReaderQuotas ();
bool transaction_flow;
#if !MOBILE && !XAMMAC_4_5
TransactionProtocol transaction_protocol;
#endif
TcpTransportBindingElement transport;
public NetTcpBinding ()
@ -69,9 +71,13 @@ namespace System.ServiceModel
public NetTcpBinding (string configurationName)
: this ()
{
#if !MOBILE && !XAMMAC_4_5
var bindingsSection = ConfigUtil.BindingsSection;
var el = bindingsSection.NetTcpBinding.Bindings [configurationName];
el.ApplyConfiguration (this);
#else
throw new NotImplementedException ();
#endif
}
internal NetTcpBinding (TcpTransportBindingElement transport,
@ -147,10 +153,12 @@ namespace System.ServiceModel
set { transaction_flow = value; }
}
#if !MOBILE && !XAMMAC_4_5
public TransactionProtocol TransactionProtocol {
get { return transaction_protocol; }
set { transaction_protocol = value; }
}
#endif
// overrides
@ -160,18 +168,22 @@ namespace System.ServiceModel
public override BindingElementCollection CreateBindingElements ()
{
#if !MOBILE && !XAMMAC_4_5
BindingElement tx = new TransactionFlowBindingElement (TransactionProtocol.WSAtomicTransactionOctober2004);
SecurityBindingElement sec = CreateMessageSecurity ();
#endif
var msg = new BinaryMessageEncodingBindingElement ();
if (ReaderQuotas != null)
ReaderQuotas.CopyTo (msg.ReaderQuotas);
var trsec = CreateTransportSecurity ();
BindingElement tr = GetTransport ();
List<BindingElement> list = new List<BindingElement> ();
#if !MOBILE && !XAMMAC_4_5
if (tx != null)
list.Add (tx);
if (sec != null)
list.Add (sec);
#endif
list.Add (msg);
if (trsec != null)
list.Add (trsec);
@ -184,6 +196,7 @@ namespace System.ServiceModel
return transport.Clone ();
}
#if !MOBILE && !XAMMAC_4_5
// It is problematic, but there is no option to disable establishing security context in this binding unlike WSHttpBinding...
SecurityBindingElement CreateMessageSecurity ()
{
@ -239,6 +252,7 @@ namespace System.ServiceModel
// FIXME: requireCancellation
element, true, reqs);
}
#endif
BindingElement CreateTransportSecurity ()
{

View File

@ -27,7 +27,9 @@
//
using System;
using System.Collections.Generic;
#if !MOBILE && !XAMMAC_4_5
using System.IdentityModel.Claims;
#endif
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
@ -37,6 +39,7 @@ namespace System.ServiceModel
{
public class SpnEndpointIdentity : EndpointIdentity
{
#if !MOBILE && !XAMMAC_4_5
public SpnEndpointIdentity (Claim identity)
{
Initialize (identity);
@ -46,6 +49,12 @@ namespace System.ServiceModel
: this (Claim.CreateSpnClaim (spn))
{
}
#else
public SpnEndpointIdentity (string spn)
{
throw new NotImplementedException ();
}
#endif
[MonoTODO]
public static TimeSpan SpnLookupTime {

View File

@ -27,7 +27,9 @@
//
using System;
using System.Collections.Generic;
#if !MOBILE && !XAMMAC_4_5
using System.IdentityModel.Claims;
#endif
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
@ -37,6 +39,7 @@ namespace System.ServiceModel
{
public class UpnEndpointIdentity : EndpointIdentity
{
#if !MOBILE && !XAMMAC_4_5
public UpnEndpointIdentity (Claim identity)
{
Initialize (identity);
@ -46,5 +49,11 @@ namespace System.ServiceModel
: this (Claim.CreateUpnClaim (upn))
{
}
#else
public UpnEndpointIdentity (string upn)
{
throw new NotImplementedException ();
}
#endif
}
}