Commit Graph
58 Commits
Author SHA1 Message Date
Rodrigo Kumpera b96d05dac3 Kill the MOONLIGHT define in corlib. 2013-02-11 16:03:28 -05:00
Sebastien Pouliot 7de2d7b467 Ensure the linker can eliminate most CAS-related types in the MOBILE-based profiles 2011-07-20 08:28:42 -04:00
Sebastien Pouliot fd7b7a2b89 Add NIE stubs for new 4.0 methods to ease running IronPython test suite
* SecurityManager.cs: Add new stubs for 4.0 methods. Add [Obsolete]
attributes on most methods (new in 4.0)
2011-01-09 10:57:45 -05:00
Miguel de Icaza d2a367e0a2 [GetFolderPath] Handful of .NET 4 changes
* Actually use the SpecialFolderPathOptions where we need them
  -> Create is acknowledged
  -> DoNotVerify is ignored, as Mono historically did not throw an
     exception on missing directories.
* Rename InternalGetFolderPath to UnixGetFolderPath as this is what it is.
* Fix existing references to the code
* Fix indentation in routine that was never properly formatted (ReadXdgUserDir)
2011-01-03 08:37:31 -05:00
Sebastien Pouliot ad2944d893 2010-04-16 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Add stub for new methods (so code compiles
	correctly under other profiles)
	* SecurityManager_2_1.cs: Implement [Check|Ensure]ElevatedPermissions
	for Moonlight Elevated Trust


svn path=/trunk/mcs/; revision=155633
2010-04-16 14:41:34 +00:00
Jb Evain aaf3676777 use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153670
2010-03-16 12:25:17 +00:00
Miguel de Icaza 4baa1d2bc2 More removal of old defines
svn path=/trunk/mcs/; revision=145609
2009-11-06 21:25:38 +00:00
Jb Evain 288e614ea4 bring Mono Security to monotouch
svn path=/trunk/mcs/; revision=141615
2009-09-09 15:34:58 +00:00
Sebastien Pouliot 04ec436d09 2009-09-09 Sebastien Pouliot <[email protected]>
* SecurityManager.cs, SecurityManager_2_1.cs: Replace existing
	throw methods (for coreclr) with a single one.


svn path=/trunk/mcs/; revision=141608
2009-09-09 14:10:10 +00:00
Sebastien Pouliot 1957b68645 In System.Security:
2009-04-27  Sebastien Pouliot  <[email protected]>

	* SecurityException.cs: Remove CAS-specific stuff from ToString
	* SecurityManager.cs: Do not include for NET_2_1 build
	* SecurityManager_2_1.cs: Alternate implementation for NET_2_1

In .:
2009-04-27  Sebastien Pouliot  <[email protected]>

	* corlib.dll.sources: Add new specific to 2.1 version of some 
	classes.

In System.Security.Policy:
2009-04-27  Sebastien Pouliot  <[email protected]>

	* Evidence.cs: Custom GetDefaultHostEvidence for NET_2_1
	* Hash.cs: Do not include for NET_2_1 build
	* HashMembershipCondition.cs: Do not include for NET_2_1 build
	* PolicyLevel.cs: Do not include for NET_2_1 build
	* PolicyLevel_2_1.cs: Alternate implementation for NET_2_1
	* Zone.cs: Do not include for NET_2_1 build
	* ZoneMembershipCondition.cs: Do not include for NET_2_1 build


svn path=/trunk/mcs/; revision=132774
2009-04-27 19:07:56 +00:00
Sebastien Pouliot bdf2e3d53c 2009-03-19 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Remove VerificationException (not used from
	the runtime anymore) and add FieldAccessException (which is now, 
	or soon will be, required/used by the runtime).


svn path=/trunk/mcs/; revision=129771
2009-03-19 12:05:13 +00:00
Rodrigo Kumpera d9e84fc8f8 2009-02-19 Rodrigo Kumpera <[email protected]>
* SecurityManager.cs: Make core-clr work under non 2.1 profiles.

svn path=/trunk/mcs/; revision=127442
2009-02-19 19:18:56 +00:00
Marek Safar cc9c53a109 Warnings cleanup
svn path=/trunk/mcs/; revision=111713
2008-08-27 15:40:13 +00:00
Sebastien Pouliot 5e9229bed6 2008-05-30 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs,
	* PermissionSet.cs,
	* SecurityManager.cs: Provide better MonoTODO messages for the 
	next version of MoMA.


svn path=/trunk/mcs/; revision=104578
2008-05-31 02:00:56 +00:00
Mark Probst f3237d228b 2007-08-28 Mark Probst <[email protected]>
* SecurityManager.cs: Changed method argument of
	LinkDemandSecurityException to IntPtr and removed the assembly
	argument (which can be gotten to via the method), to avoid having
	to embed reference object values in the native code.

svn path=/trunk/mcs/; revision=84932
2007-08-28 09:42:00 +00:00
Mark Probst 5bd2d47a69 2007-08-20 Mark Probst <[email protected]>
* SecurityManager.cs: Changed arguments of MethodAccessException
	to IntPtr, to avoid having to embed reference object values in the
	native code.

svn path=/trunk/mcs/; revision=84456
2007-08-20 12:59:59 +00:00
Mark Probst 0c4f293fdf 2007-08-20 Mark Probst <[email protected]>
* SecurityManager.cs: Added two methods needed for CoreCLR
	security.

svn path=/trunk/mcs/; revision=84452
2007-08-20 12:10:31 +00:00
Sebastien Pouliot 4070fc94a7 2005-09-22 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Added [Obsolete] on SecurityEnabled for 2.0 (as 
	it cannot be turned off on MS runtime anymore). Removed dependecies
	on PermissionSetCollection as this class (related to *Choice actions)
	didn't make it to 2.0 RC.


svn path=/trunk/mcs/; revision=50498
2005-09-22 15:34:47 +00:00
Sebastien Pouliot 2e3ad4bde0 2005-09-02 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Added AppDomain support in InheritanceDemand. 
	Fixed some another small difference between 1.x and 2.0 (wrt 
	unrestricted permissions). Fixed error reporting for InheritanceDemand
	(was LinkDemand).

svn path=/trunk/mcs/; revision=49347
2005-09-02 14:04:30 +00:00
Sebastien Pouliot f57eff923c 2005-06-30 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Fixed inheritance demands for 1.x.


svn path=/trunk/mcs/; revision=46771
2005-06-30 16:42:30 +00:00
Sebastien Pouliot 16a79daec3 2005-06-22 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fix Unrestricted PermitOnly (which is like
	a no-op). Speed up Assert if Unrestricted.
	* HostSecurityManager.cs: Updated FIXME description.
	* PermissionSet.cs: Remove Copy() of the permission set when non-CAS
	permissions are used (replaced by an array of bools). Completed Assert
	support by re-using the array of bools. Updated TODO descriptions.
	* SecurityException.cs: Added evidence (if available) in the ToString
	description of the exception.
	* SecurityManager.cs: Reworked CheckExecutionRights to get the correct
	behavior.


svn path=/trunk/mcs/; revision=46378
2005-06-22 18:35:41 +00:00
Sebastien Pouliot 42062cff2d 2005-06-20 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Removed redundant and unrequired TODO.
	* PermissionSet.cs: Some 2.0 optimizations (because sets are simpler
	without the special case for identity permissions).
	* SecurityManager.cs: Shortcut for ResolveIdentityPermissions (in 2.0)
	and some more declarative security syntax updates.


svn path=/trunk/mcs/; revision=46249
2005-06-20 16:50:56 +00:00
Sebastien Pouliot 930001d8f6 * PermissionSet.cs: Added support for non-CAS permissions in the
IsSubsetOf method.
	* SecurityManager.cs: Simplified IsGranted and added support for 2.0
	(where all permissions support unrestricted). Changed desclarative 
	security syntax not to use flags (like the rest of the source code).

2005-06-16  Sebastien Pouliot  <[email protected]> 

svn path=/trunk/mcs/; revision=46102
2005-06-16 19:29:19 +00:00
Sebastien Pouliot b7c5fd4362 2005-06-16 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Simplified LinkDemandFullTrust as FullTrust is
	immutable.


svn path=/trunk/mcs/; revision=46086
2005-06-16 12:16:51 +00:00
Sebastien Pouliot e2add1f8b8 2005-06-14 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Added ResolvingPolicyLevel property to enable
	support for FullTrustAssemblies during policy resolution. Reworked
	(simplified) locking. Moved check for CheckExecutionRights to the 
	"right" place.
	* PermissionSet.cs: Added shortcut in GetPermission(Type).


svn path=/trunk/mcs/; revision=45967
2005-06-14 14:14:23 +00:00
Sebastien Pouliot 7657b23dcb 2005-06-01 Sebastien Pouliot <[email protected]>
* PermissionBuilder.cs: Removed unification stuff. This is done at a 
	lower level.
	* SecurityManager.cs: Split loading PolicyLevel in two phases. The
	PolicyHierarchy is now available after phase 1 which ensures we can
	load permission from outside corlib.


svn path=/trunk/mcs/; revision=45305
2005-06-01 18:52:56 +00:00
Sebastien Pouliot bc6f1e1ba3 2005-05-16 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: Add support for "hidden" read-only mode (as used
	by PolicyStatement).
	* SecurityFrame.cs: Add some debugging code in the ToString method.
	* SecurityManager.cs: Changed internal API so we can display the 
	permission that failed in a PermissionSet (e.g. assembly or appdomain).


svn path=/trunk/mcs/; revision=44585
2005-05-16 19:44:29 +00:00
Sebastien Pouliot 4887f17840 2005-05-11 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: GetZoneAndOrigin is present in 1.1 too (but is 
	hidden from mono-api-info because of the LinkDemand for ECMA key).


svn path=/trunk/mcs/; revision=44390
2005-05-11 14:56:36 +00:00
Sebastien Pouliot 6e58169922 2005-05-09 Sebastien Pouliot <[email protected]>
* SecurityContext.cs: Capture the CompressedStack when the current 
	context one is empty.
	* SecurityManager.cs: Class is now static (2.0).
	* SecurityTreatAsSafeAttribute.cs: Fixed AttributeTargets.


svn path=/trunk/mcs/; revision=44265
2005-05-09 10:59:34 +00:00
Sebastien Pouliot 0edd74fe56 2005-05-06 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Reworked frames check to check only for
	the stack modifiers. Throwing a SecurityException now calls Assembly.
	UnprotectedGetName () to avoid throwing (recursively) other 
	SecurityExceptions.
	* PermissionSet.cs: Reworked frames check to include Assembly (moved) 
	and AppDomain (new) transitions.
	* SecurityFrame.cs: Added Domain member to match the runtime structure
	definition. Removed debugging code (will be moved into the runtime 
	later) as it can cause SecurityException is some cases.
	* SecurityManager.cs: Added a method to check if a PermissionSet is
	granted by an AppDomain.


svn path=/trunk/mcs/; revision=44124
2005-05-06 11:40:40 +00:00
Sebastien Pouliot 1001781a45 2005-03-14 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Fix CodeAccessPermissionTest.CustomCAS unit test
	when --security is enabled (code was over-optimized ;-).


svn path=/trunk/mcs/; revision=41794
2005-03-14 14:00:59 +00:00
Sebastien Pouliot 05da8c662b 2005-03-11 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Added methods to support reflection query and 
	invoke for LinkDemand and InheritanceDemand. Added method to do a
	stack walk (demand) when a p/invoking (called by JIT generated code).


svn path=/trunk/mcs/; revision=41690
2005-03-11 13:06:15 +00:00
Sebastien Pouliot 4e207b1532 2005-02-25 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Implement Equals for NET_2_0 profile.
	* PermissionSet.cs: Added code to decode the metadata format used for
	declarative security in 2.0 (except enums and arrays now).
	* PermissionSetCollection.cs: Added code to decode from the new metadata
	format used for declarative security in 2.0.
	* SecurityManager.cs: Added support for LinkDemandChoice, Inheritance
	DemandChoice and DemandChoice (2.0). Added support for reflected 
	LinkDemand (promotes the demand to a full Demand).


svn path=/trunk/mcs/; revision=41204
2005-02-25 15:03:53 +00:00
Sebastien Pouliot 0dd3240137 2005-02-15 Sebastien Pouliot <[email protected]>
* SecurityException.cs: Show the method informations when displaying a
	SecurityException.
	* SecurityManager.cs: Reworked InheritanceDemand implementation. Added
	a new method to throw a SecurityException for an InheritanceDemand.


svn path=/trunk/mcs/; revision=40698
2005-02-15 13:31:19 +00:00
Sebastien Pouliot 8e7a7800d8 2005-02-10 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Reduced the number of parameters for LinkDemand.
	Removed a (forgotten) debugging message.


svn path=/trunk/mcs/; revision=40396
2005-02-10 13:55:18 +00:00
Sebastien Pouliot 556928c517 2005-02-10 Sebastien Pouliot <[email protected]>
* SecurityException.cs: Show more information when a SecurityException
	occurs to help debugging.
	* SecurityManager.cs: Reworked LinkDemand implementation. Supply more
	informations when throwing a SecurityException for LinkDemand.
	* PermissionSet.cs: Remove (now) unused code for LinkDemand.


svn path=/trunk/mcs/; revision=40392
2005-02-10 12:36:48 +00:00
Sebastien Pouliot 04ac33c566 2005-02-08 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Updated code for LinkDemand (and it's special
	cases).


svn path=/trunk/mcs/; revision=40301
2005-02-08 14:24:04 +00:00
Sebastien Pouliot b3bda2812f 2005-01-27 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Process Deny for empty PermissionSet (e.g.
	an unrestricted permission set must deny all permissions).
	* SecurityException.cs: Added missing HResult to NET_2_0 constructors.
	Added securiy permissions for GrantedSet, RefusedSet and 
	PermissionState properties (to avoid leaking policy informations). 
	Make sure that ToString() always works.
	* SecurityManager.cs: Remove outdated comments (now that the 
	declarative attributes are in place).


svn path=/trunk/mcs/; revision=39655
2005-01-27 17:54:57 +00:00
Sebastien Pouliot 7031432a96 2005-01-25 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Now use Environment.InternalGetFolderPath to
	avoid recursion when initializing security policies.


svn path=/trunk/mcs/; revision=39500
2005-01-25 13:59:31 +00:00
Sebastien Pouliot a8a012d399 2005-01-24 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Made ThrowSecurityException static so it 
	can be reused from PermissionSet.
	* SecurityManager.cs: Use the new icalls for SecurityEnabled and
	CheckExecutionRights properties. Fix IsGranted for unrestricted 
	permissions. Set type correctly when loading policy files.
	* PermissionSet.cs: Now supports unrestricted permission set when
	evaluating demands.


svn path=/trunk/mcs/; revision=39458
2005-01-25 02:31:58 +00:00
Sebastien Pouliot 6f7997ee4c 2005-01-19 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Fix the regressions on NET_1_1 introduced by my
	refactoring 10 days ago.


svn path=/trunk/mcs/; revision=39187
2005-01-19 16:42:19 +00:00
Sebastien Pouliot 24f1097b09 2005-01-09 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: CheckAssert, CheckDemand, CheckDeny and
	CheckPermitOnly are no more publicly avaiable in Fx 2.0 and have been
	changed to internal for all profiles. Updated comments to reflect the
	(better) documentation available with 2.0.
	* HostSecurityManager.cs: Updated to Dec CTP specs. There is missing
	documentation (and/or classes) to implement completly the 
	DetermineApplicationTrust method at this point.
	* PermissionSetCollection.cs: Completed implementation.
	* PermissionSet.cs: Fix the case where Assert, Deny and PermitOnly 
	must be ignored for non-CAS permissions.
	* SecurityManager.cs: Refactored resolve methods to implements 
	ResolveSystemPolicy (a resolve without the AppDomain policy level).
	Added a default implementation for GetZoneAndOrigin (empty ArrayList) 
	which seems to be right (at least) for FullTrust. 


svn path=/trunk/mcs/; revision=38571
2005-01-09 23:06:21 +00:00
Sebastien Pouliot 2ee233cb81 2004-12-20 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Refactored to play more nicely with 
	PermissionSet and the new functionalities in the runtime.
	* PermissionSet.cs: Modified to use the new functionalities in the
	runtime. This allows the declarative stack modifiers to work in a 
	stack walk.
	* SecurityFrame.cs: New. This is the managed representation of the
	security informations associated with a stack frame. This current
	version only support declarative stack modifiers.
	* SecurityManager.cs: Modified to use the new functionalities in the
	runtime.


svn path=/trunk/mcs/; revision=37973
2004-12-20 15:28:38 +00:00
Sebastien Pouliot 69bdae744a 2004-10-19 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Changed private static methods to use a single
	parameter (as method permissions overrides class permissions for
	demand, assert, deny and permitonly).

svn path=/trunk/mcs/; revision=35143
2004-10-19 21:22:04 +00:00
Sebastien Pouliot 746f3b762a 2004-10-15 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Implemented stubs (soon to be icalls) to
	get/set/clear the current security frame on the stack. Implemented
	Assert, Deny and PermitOnly with the new methods. Changed Demand to
	use the CheckAssert, CheckDeny, CheckPermitOnly and CheckDemand
	introduced in 2.0.
	* PermissionSet.cs: Fixed IsEmpty using documentation from 2.0 beta 1.
	Implemented immediate (i.e. no stack walk) caller demand (CAS and
	non-CAS) required for LinkDemand and InheritanceDemand. Implemented
	Assert, Deny and PermitOnly using CodeAccessPermission new methods.
	Re-implement Demand to separate CAS and non-CAS permissions.
	* SecurityManager.cs: Added new private static methods that will
	either be called by the JIT (linkdemand), runtime (inheritancedemand)
	or by code emitted by the JIT (demand, assert, deny and permitonly).

svn path=/trunk/mcs/; revision=35042
2004-10-15 17:25:39 +00:00
Martin Baulig d9d18b9c4a Fixme, hope this is right.
svn path=/trunk/mcs/; revision=33161
2004-09-01 15:30:33 +00:00
Sebastien Pouliot 198a381ea6 2004-09-01 Sebastien Pouliot <[email protected]>
* NamedPermissionSet.cs: FromXml now calls base class instead of an
	internal method of PermissionSet. This should allow class to inherit
	from NamedPermissionSet properly.
	* PermissionSet.cs: Added an internal PolicyLevel property to allow
	policy file class name resolution. Fixed IsEmpty to return true if
	the list contains "empty" permissions. Fixed Copy to copy permissions
	even for unrestricted sets (again because of IUnrestrictedPermission).
	* SecurityManager.cs: Fixed Resolve(Evidence) because permission
	classes	Intersect methods can either return null or an empty
	PermissionSet.  Fixed ResolvePolicy(Evidence[]) for null (NET_2_0).

svn path=/trunk/mcs/; revision=33151
2004-09-01 12:25:44 +00:00
Sebastien Pouliot a8a8fd41cb 2004-08-26 Sebastien Pouliot <[email protected]>
* SecurityElement.cs: Fixed the new Copy() in Fx 2.0 as it isn't a
	deep copy. Throw proper exceptions in FromString (Fx 2.0).
	* SecurityManager.cs: Throw a NullReference exception in
	SavePolicyLevel as MS won't fix it (FDBK13121).

svn path=/trunk/mcs/; revision=32884
2004-08-26 14:40:19 +00:00
Sebastien Pouliot dae063fd0c 2004-08-12 Sebastien Pouliot <[email protected]>
* SecurityManager.cs: Change ResolvePolicy to only care about host
	provided evidence to create identity permissions.

svn path=/trunk/mcs/; revision=32291
2004-08-12 23:06:00 +00:00
Sebastien Pouliot a6cdac22f8 2004-08-11 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Basic implementation for Demand (without
	full stack trace, i.e. Assert, Deny and PermitOnly aren't considered).
	Added TODO to unimplemented NET_2_0 methods.
	* HostSecurityManager.cs: Added comments (as it looked not implemented
	even to myself).
	* PermissionSet.cs: Fixed Unrestricted when copied. Changed exception
	ordering in Copy (ArgumentNullException couldn't work). Made IsEmpty
	more robust.
	* SecurityManager.cs: Implemented IsGranted using Assembly.Demand.
	Basic implementation for policy resolution.

svn path=/trunk/mcs/; revision=32223
2004-08-11 16:54:45 +00:00