Author: atsushi
Date: 2007-01-11 02:17:21 -0500 (Thu, 11 Jan 2007)
New Revision: 70834
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/MessageSecurityBindingSupport.cs
Log:
2007-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
* MessageSecurityBindingSupport.cs :
Fixed incorrect TrgGetValue() use.
Added CollectRecipientSupportingTokens().
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
===================================================================
---
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
2007-01-11 06:10:38 UTC (rev 70833)
+++
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
2007-01-11 07:17:21 UTC (rev 70834)
@@ -1,5 +1,11 @@
2007-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * MessageSecurityBindingSupport.cs :
+ Fixed incorrect TrgGetValue() use.
+ Added CollectRecipientSupportingTokens().
+
+2007-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* MessageSecurityUtility.cs: acctually ReferenceList was inside
EncryptedKey. So, when a key itself is used to encrypt data,
ReferenceList is contained by itself.
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/MessageSecurityBindingSupport.cs
===================================================================
---
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/MessageSecurityBindingSupport.cs
2007-01-11 06:10:38 UTC (rev 70833)
+++
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/MessageSecurityBindingSupport.cs
2007-01-11 07:17:21 UTC (rev 70834)
@@ -270,10 +270,10 @@
SupportingTokenParameters supp;
CollectInitiatorSupportingTokensCore (tokens,
Element.EndpointSupportingTokenParameters, to, true);
- if
(!Element.OperationSupportingTokenParameters.TryGetValue (action, out supp))
+ if
(Element.OperationSupportingTokenParameters.TryGetValue (action, out supp))
CollectInitiatorSupportingTokensCore (tokens,
supp, to, true);
CollectInitiatorSupportingTokensCore (tokens,
Element.OptionalEndpointSupportingTokenParameters, to, false);
- if
(!Element.OptionalOperationSupportingTokenParameters.TryGetValue (action, out
supp))
+ if
(Element.OptionalOperationSupportingTokenParameters.TryGetValue (action, out
supp))
CollectInitiatorSupportingTokensCore (tokens,
supp, to, false);
return tokens;
@@ -295,6 +295,41 @@
l.Add (new SupportingTokenInfo
(GetEncryptionToken (to, p), SecurityTokenAttachmentMode.SignedEncrypted,
required));
}
+ public SupportingTokenInfoCollection
CollectRecipientSupportingTokens (
+ string action,
+ Uri listenUri)
+ {
+ SupportingTokenInfoCollection tokens =
+ new SupportingTokenInfoCollection ();
+
+ SupportingTokenParameters supp;
+
+ CollectRecipientSupportingTokensCore (tokens,
Element.EndpointSupportingTokenParameters, listenUri, true);
+ if
(Element.OperationSupportingTokenParameters.TryGetValue (action, out supp))
+ CollectRecipientSupportingTokensCore (tokens,
supp, listenUri, true);
+ CollectRecipientSupportingTokensCore (tokens,
Element.OptionalEndpointSupportingTokenParameters, listenUri, false);
+ if
(Element.OptionalOperationSupportingTokenParameters.TryGetValue (action, out
supp))
+ CollectRecipientSupportingTokensCore (tokens,
supp, listenUri, false);
+
+ return tokens;
+ }
+
+ void CollectRecipientSupportingTokensCore (
+ SupportingTokenInfoCollection l,
+ SupportingTokenParameters s,
+ Uri listenUri,
+ bool required)
+ {
+ foreach (SecurityTokenParameters p in s.Signed)
+ l.Add (new SupportingTokenInfo
(GetEncryptionToken (listenUri, p), SecurityTokenAttachmentMode.Signed,
required));
+ foreach (SecurityTokenParameters p in s.Endorsing)
+ l.Add (new SupportingTokenInfo
(GetEncryptionToken (listenUri, p), SecurityTokenAttachmentMode.Endorsing,
required));
+ foreach (SecurityTokenParameters p in s.SignedEndorsing)
+ l.Add (new SupportingTokenInfo
(GetEncryptionToken (listenUri, p),
SecurityTokenAttachmentMode.SignedEndorsing, required));
+ foreach (SecurityTokenParameters p in s.SignedEncrypted)
+ l.Add (new SupportingTokenInfo
(GetEncryptionToken (listenUri, p),
SecurityTokenAttachmentMode.SignedEncrypted, required));
+ }
+
SecurityToken GetSigningToken (Uri listenUri,
SecurityTokenParameters targetParams)
{
SecurityTokenRequirement requirement =
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches