Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@ -95,14 +95,14 @@ namespace System.ServiceModel.Security
header_types = new ReadOnlyCollection<XmlQualifiedName> (header_types);
}
public void Union (MessagePartSpecification other)
public void Union (MessagePartSpecification specification)
{
if (other == null)
throw new ArgumentNullException ("other");
if (specification == null)
throw new ArgumentNullException ("specification");
if (header_types.IsReadOnly)
throw new InvalidOperationException ("This MessagePartSpecification is read-only.");
body |= other.body;
foreach (XmlQualifiedName q in other.header_types)
body |= specification.body;
foreach (XmlQualifiedName q in specification.header_types)
// Sigh. It could be much better here.
//if (!header_types.Contains (q))
header_types.Add (q);

View File

@ -1,4 +1,4 @@
//
//
// ServiceCredentialsSecurityTokenManager.cs
//
// Author:
@ -44,9 +44,9 @@ namespace System.ServiceModel.Security
ServiceCredentials credentials;
public ServiceCredentialsSecurityTokenManager (
ServiceCredentials credentials)
ServiceCredentials parent)
{
this.credentials = credentials;
this.credentials = parent;
}
public ServiceCredentials ServiceCredentials {
@ -55,35 +55,35 @@ namespace System.ServiceModel.Security
[MonoTODO]
public virtual EndpointIdentity GetIdentityOfSelf (
SecurityTokenRequirement requirement)
SecurityTokenRequirement tokenRequirement)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator (
SecurityTokenRequirement requirement,
SecurityTokenRequirement tokenRequirement,
out SecurityTokenResolver outOfBandTokenResolver)
{
outOfBandTokenResolver = null;
if (requirement.TokenType == SecurityTokenTypes.UserName)
return CreateUserNameAuthenticator (requirement);
if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
return CreateX509Authenticator (requirement);
if (requirement.TokenType == SecurityTokenTypes.Rsa)
if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
return CreateUserNameAuthenticator (tokenRequirement);
if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
return CreateX509Authenticator (tokenRequirement);
if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
SecurityBindingElement binding;
if (!requirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
if (!tokenRequirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
throw new ArgumentException ("SecurityBindingElement is required in the security token requirement");
SecureConversationSecurityTokenParameters issuedParams;
if (!requirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
if (!tokenRequirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
throw new ArgumentException ("IssuedSecurityTokenParameters are required in the security token requirement");
BindingContext issuerBC;
if (!requirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
if (!tokenRequirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
throw new ArgumentException ("IssuerBindingContext is required in the security token requirement");
SecurityTokenVersion secVer;
if (!requirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
if (!tokenRequirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
throw new ArgumentException ("MessageSecurityVersion property (of type SecurityTokenVersion) is required in the security token requirement");
// FIXME: get parameters from somewhere
@ -92,16 +92,16 @@ namespace System.ServiceModel.Security
outOfBandTokenResolver = resolver;
SecurityContextSecurityTokenAuthenticator sc =
new SecurityContextSecurityTokenAuthenticator ();
return new SecureConversationSecurityTokenAuthenticator (requirement, sc, resolver);
return new SecureConversationSecurityTokenAuthenticator (tokenRequirement, sc, resolver);
}
if (requirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
return CreateSslTokenAuthenticator (requirement);
if (requirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
return CreateSslTokenAuthenticator (requirement);
if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
return CreateSpnegoTokenAuthenticator (requirement);
if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
return CreateSslTokenAuthenticator (tokenRequirement);
if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
return CreateSslTokenAuthenticator (tokenRequirement);
if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
return CreateSpnegoTokenAuthenticator (tokenRequirement);
else
throw new NotImplementedException ("Not implemented token type: " + requirement.TokenType);
throw new NotImplementedException ("Not implemented token type: " + tokenRequirement.TokenType);
}
SpnegoSecurityTokenAuthenticator CreateSpnegoTokenAuthenticator (SecurityTokenRequirement requirement)

View File

@ -239,7 +239,7 @@ namespace System.ServiceModel.Security
[MonoTODO]
public virtual SecurityKeyIdentifierClause CreateKeyIdentifierClauseFromTokenXml (
XmlElement tokenXml, SecurityTokenReferenceStyle referenceStyle)
XmlElement element, SecurityTokenReferenceStyle tokenReferenceStyle)
{
throw new NotImplementedException ();
}