Commit Graph
19 Commits
Author SHA1 Message Date
Sebastien Pouliot 48fd0e1b2e Fix non-element in XML flash policy (same as #681699 was for silverlight policies)
* FlashCrossDomainPolicyParser.cs: Skip, not throw, if we find a non-
element node type in a flash policy file.
2011-04-15 15:19:12 -04:00
Sebastien Pouliot 95482a1aba Do not allow extra elements in policy
* ClientAccessPolicyParser.cs: Fix regression (from a023b07a) found by
DRT #666. More test cases to be added into moonlight WebPolicies test
application
2011-03-25 10:15:44 -04:00
Sebastien Pouliot 0a23b07aea Relax policy parser to accept text elements - fix 681699
* ClientAccessPolicyParser.cs: Allow non-element between the expected
XML elements. Fix text, like '-', being present inside policies.
2011-03-23 13:57:23 -04:00
Sebastien Pouliot 0cf8705abf Fix access policy when more than one scheme is present #659791
* ClientAccessPolicy.cs: Remove special case for scheme
* ClientAccessPolicyParser.cs: Add scheme-only entries like full URI
2010-12-16 16:29:56 -05:00
Sebastien Pouliot 383a5e711e Use same socket family as the endpoint when retrieving the policy
* System.Net.Policy/CrossDomainPolicyManager.cs: Use same socket family
as the endpoint when retrieving the policy. Also do not try to create a
policy out of an empty stream (avoid misleading exceptions in logs)
2010-09-27 20:20:24 -04:00
Sebastien Pouliot 016a04eb84 [moonlight] Fully honor WebResponse.SupportsHeaders
* System.Net.Policy/CrossDomainPolicyManager.cs: Use InternalHeaders,
instead of Headers, since we always use the browser stack to download
the security policies.

* System.Net/WebClient_2_1.cs: Throw a NotImplementedException from
ResponseHeaders if the response does not support them.
* System.Net/WebResponse_2_1.cs: Make Headers property smart to throw a
NotImplementedException if SupportsHeaders return false. Add a new
InternalHeaders property since the response headers are needed,
internally (e.g. policies), even if not exposed to the outside world.
2010-09-23 17:10:04 -04:00
Sebastien Pouliot 56a925b467 Do not set the exception to NotSupportedException for denied headers
* mcs/class/System.Net/System.Net.Policy/ClientAccessPolicy.cs: Do not
throw a NotSupportedException here since it regress some DRT (like 656).
The (hopefully) correct fix (for DRT3001) will be committed inside moon
2010-09-02 11:13:38 -04:00
Sebastien Pouliot 6e6d592880 Fix check order and throw NSE on invalid headers 2010-07-23 14:01:39 -04:00
Sebastien Pouliot e1a5014726 2010-07-20 Sebastien Pouliot <[email protected]>
* NoAccessPolicy.cs: Set default to SecurityException each time
	IsAllowed is called since we share a single instance of this type


svn path=/trunk/mcs/; revision=160611
2010-07-20 14:39:59 +00:00
Sebastien Pouliot eeeaf44f44 2010-07-19 Sebastien Pouliot <[email protected]>
* BaseDomainPolicy.cs:
	* ICrossDomainPolicy.cs:
	* NoAccessPolicy.cs:
	* PolicyDownloadPolicy.cs:
	* SiteOfOriginPolicy.cs:
		Allow throwing something else than a SecurityException
		which is pretty rare but we got a DRT for it


svn path=/trunk/mcs/; revision=160586
2010-07-19 20:30:10 +00:00
Sebastien Pouliot aa659717f7 2010-05-14 Sebastien Pouliot <[email protected]>
* FlashCrossDomainPolicy.cs: Reverse conditions order on secure=true
	since we're currently too severe. Fix DRT668


svn path=/trunk/mcs/; revision=157359
2010-05-14 13:12:28 +00:00
Sebastien Pouliot 240f7e8f1d update System.Net.dll for SL4 API
svn path=/trunk/mcs/; revision=155874
2010-04-21 14:03:45 +00:00
Sebastien Pouliot 9f7ad37b2b 2010-04-13 Sebastien Pouliot <[email protected]>
* CrossDomainPolicyManager.cs: Fix previous change since it 
	breaks several valid cases (e.g. text/*, text/xml; charset=utf-8)
	and does not completely covers the application/xml case.
	Avoid possible ArgumentException while adding policies since it 
	confuse	the logs.


svn path=/trunk/mcs/; revision=155309
2010-04-13 13:16:03 +00:00
Andreia Gaita bb3ab70c3e 2010-04-13 Andreia Gaita <[email protected]>
* CrossDomainPolicyManager.cs: make the contentType detection
	look for /xml at the end, it's more reliable
	(fixes olympics for moonlight)

svn path=/trunk/mcs/; revision=155283
2010-04-13 05:06:15 +00:00
Sebastien Pouliot 7ab35a9063 2010-04-07 Sebastien Pouliot <[email protected]>
* ClientAccessPolicy.cs: Fake a "GET" method when applying a 
	policy to sockets


svn path=/trunk/mcs/; revision=154959
2010-04-07 14:11:27 +00:00
Sebastien Pouliot 82f9bc99cd 2010-04-07 Sebastien Pouliot <[email protected]>
* BaseDomainPolicy.cs: Abstract-fy IsAllowed(WebRequest) and 
	remove abstract IsAllowed(Uri,string[]) since it cannot provide
	enough information for the client access policy.
	* ClientAccessPolicy.cs: Replace IsAllowed(Uri,string[]) with
	IsAllowed(WebRequest) and add logic for AllowAnyMethod
	* ClientAccessPolicyParser.cs: Read "http-methods" attribute (new
	in SL3) and set the new AllowAnyMethod property if the value is
	"*" (the only legal value if the attribute is present).
	* FlashCrossDomainPolicy.cs: Add IsAllowed(WebRequest) since it's
	not part of BaseDomainPolicy anymore.


svn path=/trunk/mcs/; revision=154949
2010-04-07 13:15:44 +00:00
Sebastien Pouliot b61b5703ba 2010-04-06 Sebastien Pouliot <[email protected]>
* ClientAccessPolicyParser.cs: Don't forget "http-request-headers"
	as a valid attribute


svn path=/trunk/mcs/; revision=154876
2010-04-06 17:45:06 +00:00
Sebastien Pouliot 9317031d00 2010-04-06 Sebastien Pouliot <[email protected]>
* ClientAccessPolicyParser.cs: Catch extra attributes that
	leads to an invalid (no-access) policy. Fix parts of DRT#666
	* CrossDomainPolicyManager.cs: Ignore policies sent with a 
	Content-Type different than "text/*". Fix DRT#667
	* FlashCrossDomainPolicyParser.cs: Catch extra attributes and
	the case where a second policy is present (invalid xml). Fix 
	parts of DRT#666


svn path=/trunk/mcs/; revision=154862
2010-04-06 15:57:19 +00:00
Sebastien Pouliot c54a75466f In System/System.Net.Sockets:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Remove the use of reflection to check
	xdomain poilicy on sockets (since the policy code now resides in
	System.Net.dll)

In System.Net:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_System.Net.dll.sources: Add types from (new internal)
	System.Net.Policy (moved from System.Windows.Browser.dll)
	* Makefile: Add reference to System.Xml.dll to parse policies

In System.Net/System.Net.Policy:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* BaseDomainPolicy.cs, ClientAccessPolicy[Parser].cs, 
	CrossDomainPolicyManager.cs, FlashCrossDomainPolicy[Parser].cs,
	ICrossDomainPolicy.cs, NoAccessPolicy.cs, PolicyDownloadPolicy.cs,
	SiteOfOriginPolicy.cs: Moved from System.Net.dll with namespace 
	and minor build adjustments.


svn path=/trunk/mcs/; revision=153396
2010-03-10 13:19:46 +00:00