Imported Upstream version 4.6.0.150

Former-commit-id: 73e3bb1e96dd09dc931c1dfe559d2c7f7b8b02c7
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-23 13:20:38 +00:00
parent 02ac915603
commit b95516a3dd
239 changed files with 4096 additions and 1544 deletions

View File

@ -7,6 +7,7 @@ using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Xml;
using System.Threading;
namespace System.Runtime.CompilerServices
{
@ -22,9 +23,92 @@ namespace System.Runtime.CompilerServices
namespace System.ServiceModel
{
public class EndpointIdentity {}
public class InstanceContext
public class InstanceContext : CommunicationObject, IExtensibleObject<InstanceContext>
{
public InstanceContext (object dummy) {}
protected internal override TimeSpan DefaultCloseTimeout
{
get { throw new NotImplementedException (); }
}
protected internal override TimeSpan DefaultOpenTimeout
{
get { throw new NotImplementedException (); }
}
IExtensionCollection<InstanceContext> IExtensibleObject<InstanceContext>.Extensions
{
get { throw new NotImplementedException (); }
}
public SynchronizationContext SynchronizationContext {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public InstanceContext (object implementation)
{
throw new NotImplementedException ();
}
public object GetServiceInstance (Message message)
{
throw new NotImplementedException ();
}
protected override void OnAbort ()
{
throw new NotImplementedException ();
}
protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
{
throw new NotImplementedException ();
}
protected override IAsyncResult OnBeginOpen (TimeSpan timeout, AsyncCallback callback, object state)
{
throw new NotImplementedException ();
}
protected override void OnClose (TimeSpan timeout)
{
throw new NotImplementedException ();
}
protected override void OnClosed ()
{
throw new NotImplementedException ();
}
protected override void OnEndClose (IAsyncResult result)
{
throw new NotImplementedException ();
}
protected override void OnEndOpen (IAsyncResult result)
{
throw new NotImplementedException ();
}
protected override void OnFaulted ()
{
throw new NotImplementedException ();
}
protected override void OnOpen (TimeSpan timeout)
{
throw new NotImplementedException ();
}
protected override void OnOpened ()
{
throw new NotImplementedException ();
}
protected override void OnOpening ()
{
throw new NotImplementedException ();
}
}
// introduced for silverlight sdk compatibility
internal class OperationFormatStyleHelper

View File

@ -6,12 +6,96 @@ using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Xml;
using System.Threading;
namespace System.ServiceModel
{
public class InstanceContext
public class InstanceContext : CommunicationObject, IExtensibleObject<InstanceContext>
{
public InstanceContext (object dummy) {}
protected internal override TimeSpan DefaultCloseTimeout
{
get { throw new NotImplementedException (); }
}
protected internal override TimeSpan DefaultOpenTimeout
{
get { throw new NotImplementedException (); }
}
IExtensionCollection<InstanceContext> IExtensibleObject<InstanceContext>.Extensions
{
get { throw new NotImplementedException (); }
}
public SynchronizationContext SynchronizationContext {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public InstanceContext (object implementation)
{
throw new NotImplementedException ();
}
public object GetServiceInstance (Message message)
{
throw new NotImplementedException ();
}
protected override void OnAbort ()
{
throw new NotImplementedException ();
}
protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
{
throw new NotImplementedException ();
}
protected override IAsyncResult OnBeginOpen (TimeSpan timeout, AsyncCallback callback, object state)
{
throw new NotImplementedException ();
}
protected override void OnClose (TimeSpan timeout)
{
throw new NotImplementedException ();
}
protected override void OnClosed ()
{
throw new NotImplementedException ();
}
protected override void OnEndClose (IAsyncResult result)
{
throw new NotImplementedException ();
}
protected override void OnEndOpen (IAsyncResult result)
{
throw new NotImplementedException ();
}
protected override void OnFaulted ()
{
throw new NotImplementedException ();
}
protected override void OnOpen (TimeSpan timeout)
{
throw new NotImplementedException ();
}
protected override void OnOpened ()
{
throw new NotImplementedException ();
}
protected override void OnOpening ()
{
throw new NotImplementedException ();
}
}
}

View File

@ -8,7 +8,7 @@ RESOURCE_FILES = \
LIBRARY = System.ServiceModel.dll
LIB_REFS = System System.Xml System.Core System.Runtime.Serialization
LIB_REFS = System System.Xml System.Core System.Runtime.Serialization System.IdentityModel
LIB_MCS_FLAGS = \
/nowarn:414,169,67,3005,436,219,618 \
/unsafe \
@ -20,7 +20,7 @@ LIB_REFS += System.ServiceModel.Internals
endif
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration System.Data System.Security System.IdentityModel System.IdentityModel.Selectors System.Transactions System.Messaging System.Web.Services Mono.Security
LIB_REFS += System.Configuration System.Data System.Security System.IdentityModel.Selectors System.Transactions System.Messaging System.Web.Services Mono.Security
LIB_MCS_FLAGS += /d:NET_3_0
ifndef NO_SYSTEM_WEB_DEPENDENCY

View File

@ -34,8 +34,8 @@ using System.ServiceModel.Security;
using System.ServiceModel.Channels.Security;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using System.ServiceModel.Security.Tokens;
#endif
using System.ServiceModel.Security.Tokens;
using System.Text;
namespace System.ServiceModel.Channels
@ -44,11 +44,11 @@ namespace System.ServiceModel.Channels
{
internal SecurityBindingElement ()
{
MessageSecurityVersion = MessageSecurityVersion.Default;
endpoint = new SupportingTokenParameters ();
#if !NET_2_1 && !XAMMAC_4_5
DefaultAlgorithmSuite = SecurityAlgorithmSuite.Default;
MessageSecurityVersion = MessageSecurityVersion.Default;
KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy;
endpoint = new SupportingTokenParameters ();
operation = new Dictionary<string,SupportingTokenParameters> ();
opt_endpoint = new SupportingTokenParameters ();
opt_operation = new Dictionary<string,SupportingTokenParameters> ();
@ -60,12 +60,12 @@ namespace System.ServiceModel.Channels
internal SecurityBindingElement (SecurityBindingElement other)
{
#if !NET_2_1 && !XAMMAC_4_5
alg_suite = other.alg_suite;
key_entropy_mode = other.key_entropy_mode;
security_header_layout = other.security_header_layout;
msg_security_version = other.msg_security_version;
endpoint = other.endpoint.Clone ();
#if !NET_2_1 && !XAMMAC_4_5
alg_suite = other.alg_suite;
key_entropy_mode = other.key_entropy_mode;
opt_endpoint = other.opt_endpoint.Clone ();
operation = new Dictionary<string,SupportingTokenParameters> ();
foreach (KeyValuePair<string,SupportingTokenParameters> p in other.operation)
@ -79,12 +79,14 @@ namespace System.ServiceModel.Channels
LocalClientSettings = other.LocalClientSettings.Clone ();
}
SecurityHeaderLayout security_header_layout;
MessageSecurityVersion msg_security_version;
SupportingTokenParameters endpoint;
#if !NET_2_1 && !XAMMAC_4_5
SecurityAlgorithmSuite alg_suite;
SecurityKeyEntropyMode key_entropy_mode;
SecurityHeaderLayout security_header_layout;
MessageSecurityVersion msg_security_version;
SupportingTokenParameters endpoint, opt_endpoint;
SupportingTokenParameters opt_endpoint;
IDictionary<string,SupportingTokenParameters> operation, opt_operation;
LocalServiceSecuritySettings service_settings;
#endif
@ -93,6 +95,20 @@ namespace System.ServiceModel.Channels
public LocalClientSecuritySettings LocalClientSettings { get; private set; }
public SecurityHeaderLayout SecurityHeaderLayout {
get { return security_header_layout; }
set { security_header_layout = value; }
}
public MessageSecurityVersion MessageSecurityVersion {
get { return msg_security_version; }
set { msg_security_version = value; }
}
public SupportingTokenParameters EndpointSupportingTokenParameters {
get { return endpoint; }
}
#if !NET_2_1 && !XAMMAC_4_5
public SecurityAlgorithmSuite DefaultAlgorithmSuite {
get { return alg_suite; }
@ -108,20 +124,6 @@ namespace System.ServiceModel.Channels
get { return service_settings; }
}
public SecurityHeaderLayout SecurityHeaderLayout {
get { return security_header_layout; }
set { security_header_layout = value; }
}
public MessageSecurityVersion MessageSecurityVersion {
get { return msg_security_version; }
set { msg_security_version = value; }
}
public SupportingTokenParameters EndpointSupportingTokenParameters {
get { return endpoint; }
}
public IDictionary<string,SupportingTokenParameters> OperationSupportingTokenParameters {
get { return operation; }
}
@ -445,32 +447,6 @@ namespace System.ServiceModel.Channels
throw new NotImplementedException ();
}
public static SecurityBindingElement
CreateSecureConversationBindingElement (SecurityBindingElement binding)
{
return CreateSecureConversationBindingElement (binding, false);
}
public static SecurityBindingElement
CreateSecureConversationBindingElement (
SecurityBindingElement binding, bool requireCancellation)
{
return CreateSecureConversationBindingElement (binding, requireCancellation, null);
}
public static SecurityBindingElement
CreateSecureConversationBindingElement (
SecurityBindingElement binding, bool requireCancellation,
ChannelProtectionRequirements protectionRequirements)
{
SymmetricSecurityBindingElement be =
new SymmetricSecurityBindingElement ();
be.ProtectionTokenParameters =
new SecureConversationSecurityTokenParameters (
binding, requireCancellation, protectionRequirements);
return be;
}
public static SymmetricSecurityBindingElement
CreateSslNegotiationBindingElement (bool requireClientCertificate)
{
@ -554,6 +530,36 @@ namespace System.ServiceModel.Channels
}
#endif
public static SecurityBindingElement
CreateSecureConversationBindingElement (SecurityBindingElement binding)
{
return CreateSecureConversationBindingElement (binding, false);
}
public static SecurityBindingElement
CreateSecureConversationBindingElement (
SecurityBindingElement binding, bool requireCancellation)
{
return CreateSecureConversationBindingElement (binding, requireCancellation, null);
}
public static SecurityBindingElement
CreateSecureConversationBindingElement (
SecurityBindingElement binding, bool requireCancellation,
ChannelProtectionRequirements protectionRequirements)
{
#if !NET_2_1 && !XAMMAC_4_5
SymmetricSecurityBindingElement be =
new SymmetricSecurityBindingElement ();
be.ProtectionTokenParameters =
new SecureConversationSecurityTokenParameters (
binding, requireCancellation, protectionRequirements);
return be;
#else
throw new NotImplementedException ();
#endif
}
[MonoTODO]
public static TransportSecurityBindingElement
CreateUserNameOverTransportBindingElement ()

View File

@ -29,6 +29,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Net.Security;
using System.Security.Authentication;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
@ -64,6 +65,12 @@ namespace System.ServiceModel.Channels
set { require_client_certificate = value; }
}
[MonoTODO]
public SslProtocols SslProtocols {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
private SslStreamSecurityBindingElement (
SslStreamSecurityBindingElement other)
: base (other)

View File

@ -54,12 +54,12 @@ namespace System.ServiceModel.Description
protected ClientCredentials (ClientCredentials source)
{
userpass = source.userpass.Clone ();
#if !NET_2_1
issued_token = source.issued_token.Clone ();
digest = source.digest.Clone ();
initiator = source.initiator.Clone ();
recipient = source.recipient.Clone ();
windows = source.windows.Clone ();
#if !NET_2_1
issued_token = source.issued_token.Clone ();
peer = source.peer.Clone ();
support_interactive = source.support_interactive;
#endif
@ -67,9 +67,7 @@ namespace System.ServiceModel.Description
UserNamePasswordClientCredential userpass =
new UserNamePasswordClientCredential ();
#if !NET_2_1
IssuedTokenClientCredential issued_token =
new IssuedTokenClientCredential ();
HttpDigestClientCredential digest =
new HttpDigestClientCredential ();
X509CertificateInitiatorClientCredential initiator =
@ -78,8 +76,6 @@ namespace System.ServiceModel.Description
new X509CertificateRecipientClientCredential ();
WindowsClientCredential windows =
new WindowsClientCredential ();
PeerCredential peer = new PeerCredential ();
bool support_interactive = true;
public X509CertificateInitiatorClientCredential ClientCertificate {
get { return initiator; }
@ -89,6 +85,20 @@ namespace System.ServiceModel.Description
get { return digest; }
}
public X509CertificateRecipientClientCredential ServiceCertificate {
get { return recipient; }
}
public WindowsClientCredential Windows {
get { return windows; }
}
#if !NET_2_1
IssuedTokenClientCredential issued_token =
new IssuedTokenClientCredential ();
PeerCredential peer = new PeerCredential ();
bool support_interactive = true;
public IssuedTokenClientCredential IssuedToken {
get { return issued_token; }
}
@ -97,18 +107,10 @@ namespace System.ServiceModel.Description
get { return peer; }
}
public X509CertificateRecipientClientCredential ServiceCertificate {
get { return recipient; }
}
public bool SupportInteractive {
get { return support_interactive; }
set { support_interactive = value; }
}
public WindowsClientCredential Windows {
get { return windows; }
}
#endif
public UserNamePasswordClientCredential UserName {

View File

@ -31,7 +31,7 @@ using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Security.Tokens;
using System.ServiceModel.Security.Tokens;
namespace System.ServiceModel.Security
{
@ -57,14 +57,22 @@ namespace System.ServiceModel.Security
StoreName storeName, X509FindType findType,
object findValue)
{
#if !NET_2_1
certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
#endif
}
public void SetCertificate (
string subjectName, StoreLocation storeLocation,
StoreName storeName)
{
#if !NET_2_1
certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
#else
throw new NotImplementedException ();
#endif
}
}
}

View File

@ -27,7 +27,9 @@
//
using System;
using System.Collections.Generic;
#if !NET_2_1
using System.IdentityModel.Selectors;
#endif
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
@ -47,7 +49,9 @@ namespace System.ServiceModel.Security
X509Certificate2 certificate;
Dictionary<Uri,X509Certificate2> scoped =
new Dictionary<Uri,X509Certificate2> ();
#if !NET_2_1
X509CertificateValidator validator;
#endif
X509RevocationMode revocation_mode;
StoreLocation store_loc;
@ -72,6 +76,13 @@ namespace System.ServiceModel.Security
get { return scoped; }
}
[MonoTODO]
public X509ServiceCertificateAuthentication SslCertificateAuthentication
{
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public void SetDefaultCertificate (string subjectName,
StoreLocation storeLocation, StoreName storeName)
{
@ -81,7 +92,11 @@ namespace System.ServiceModel.Security
public void SetDefaultCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType, Object findValue)
{
#if !NET_2_1
DefaultCertificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
#endif
}
public void SetScopedCertificate (string subjectName,
@ -95,7 +110,11 @@ namespace System.ServiceModel.Security
StoreName storeName, X509FindType findType,
Object findValue, Uri targetService)
{
#if !NET_2_1
ScopedCertificates [targetService] = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
#endif
}
}
}

View File

@ -37,7 +37,7 @@ namespace System.ServiceModel.Security
[MonoTODO]
public class X509ServiceCertificateAuthentication
{
internal X509ServiceCertificateAuthentication ()
public X509ServiceCertificateAuthentication ()
{
}

View File

@ -62,12 +62,12 @@ namespace System.ServiceModel
set { uri = value; }
}
#if !NET_2_1
public EndpointIdentity Identity {
get { return identity; }
set { identity = value; }
}
#if !NET_2_1
public XmlDictionaryReader GetReaderAtExtensions ()
{
if (extension == null)

View File

@ -36,7 +36,7 @@ namespace System.ServiceModel
#endif
MessageCredentialType client_credential_type;
internal MessageSecurityOverTcp ()
public MessageSecurityOverTcp ()
{
#if !MOBILE && !XAMMAC_4_5
alg_suite = SecurityAlgorithmSuite.Default;

View File

@ -27,6 +27,7 @@
//
using System;
using System.Net.Security;
using System.Security.Authentication;
using System.ServiceModel.Security;
namespace System.ServiceModel
@ -44,5 +45,12 @@ namespace System.ServiceModel
public TcpClientCredentialType ClientCredentialType { get; set; }
public ProtectionLevel ProtectionLevel { get; set; }
[MonoTODO]
public SslProtocols SslProtocols
{
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
}
}

View File

@ -179,6 +179,9 @@ System.ServiceModel.Security/MessageSecurityException.cs
System.ServiceModel.Security/SecurityAccessDeniedException.cs
System.ServiceModel.Security/UserNamePasswordClientCredential.cs
System.ServiceModel.Security/WindowsClientCredential.cs
System.ServiceModel.Security/X509CertificateInitiatorClientCredential.cs
System.ServiceModel.Security/X509CertificateRecipientClientCredential.cs
System.ServiceModel.Security/X509ServiceCertificateAuthentication.cs
System.ServiceModel/ActionNotSupportedException.cs
System.ServiceModel/AllEnums.cs
System.ServiceModel/HttpBindingBase.cs
@ -277,8 +280,11 @@ System.ServiceModel/UpnEndpointIdentity.cs
System.ServiceModel/MessageSecurityVersion.cs
System.ServiceModel.Security/BasicSecurityProfileVersion.cs
System.ServiceModel.Security/ChannelProtectionRequirements.cs
System.ServiceModel.Security/SecurityVersion.cs
System.ServiceModel.Security/TrustVersion.cs
System.ServiceModel.Security/MessagePartSpecification.cs
System.ServiceModel.Security/ScopedMessagePartSpecification.cs
System.ServiceModel.Security/SecureConversationVersion.cs
System.ServiceModel.Security/SecurityPolicyVersion.cs

View File

@ -32,6 +32,7 @@ System.ServiceModel.Dispatcher/SeekableXPathNavigator.cs
System.ServiceModel.Dispatcher/XPathMessageFilter.cs
System.ServiceModel.Security.Tokens/SecurityContextSecurityToken.cs
System.ServiceModel.Security.Tokens/SslnegoCookieResolver.cs
System.ServiceModel.Security.Tokens/SupportingTokenParameters.cs
System.ServiceModel.Security/ChannelProtectionRequirements.cs
System.ServiceModel.Security/IdentityVerifier.cs
System.ServiceModel.Security/IssuedTokenClientCredential.cs