Commit Graph
31 Commits
Author SHA1 Message Date
Sebastien Pouliot 087ea6e264 2005-09-02 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fix Deny for permissions that do not return
	null for empty intersection (common on flags-based permissions).
	* PermissionBuilder.cs: Add an helper call to create an empty 
	(PermissionState.None) permission from a type.


svn path=/trunk/mcs/; revision=49339
2005-09-02 11:33:03 +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 ecc6699591 2005-05-27 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Allow unrestricted identity permissions in
	2.0.
	* PermissionBuilder.cs: New. Internal class to help create permission
	instances from XML or with a fully qualified name. This class also 
	deals with unification.
	* PermissionSet.cs: Use PermissionBuilder to create permissions in 
	FromXml method. Many 2.0 fixes (mostly to support unrestricted 
	identity permissions)


svn path=/trunk/mcs/; revision=45117
2005-05-27 17:55:55 +00:00
Sebastien Pouliot cbe2286cc8 2005-05-26 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fix typo for PermitOnly. Added ComVisible 
	attribute for NET_2_0 profile.
	* PermissionSet.cs: Changed static string to const. Added ComVisible 
	attribute for NET_2_0 profile.
	* SecurityContext.cs: Capture the identity token but don't create a 
	WindowsIdentity instance unless required (e.g. Run). This requires 
	less privileges (so it runs better that way under CAS).


svn path=/trunk/mcs/; revision=45039
2005-05-26 12:34:41 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)


svn path=/trunk/mcs/; revision=44558
2005-05-16 12:23:26 +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 e6db9936b8 2005-03-24 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fixed PermitOnly when used in a set. Added
	an InheritanceDemand for ControlEvidence and ControlPolicy on the 
	class.
	* PermissionSet.cs: Added an InheritanceDemand for MS public key on 
	class.
	* SecurityException.cs: Moved PermissionType up in ToString as this
	property isn't restricted (i.e. will be part of the output even if
	the other properties can't make it).


svn path=/trunk/mcs/; revision=42219
2005-03-24 15:11:54 +00:00
Sebastien Pouliot 69158eed22 2005-03-15 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fixed depth for starting the stack walk
	(imperative) and fixed assert condition.
	* PermissionSet.cs: Fixed depth for starting the stack walk.
	* SecurityFrame.cs: Reversed stack. Added optional debugging code.


svn path=/trunk/mcs/; revision=41834
2005-03-15 13:03:49 +00:00
Sebastien Pouliot ff33076cef 2005-03-02 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs,
	* PermissionSet.cs: Don't throw NotSupportedException if the security 
	manager (SecurityManager.SecurityEnabled) is off.


svn path=/trunk/mcs/; revision=41358
2005-03-02 13:51:18 +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 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 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 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 5f34fb5ec4 Oops - missing using
svn path=/trunk/mcs/; revision=36873
2004-12-01 00:13:00 +00:00
Sebastien Pouliot 2e00f333b7 2004-11-30 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs:
	* NamedPermissionSet.cs:
	* PermissionSet.cs:
	* SecurityElement.cs:
	* SecurityException.cs:
		Added ComVisible attributes to match 2.0 October Preview.
	* SecureString.cs: Added an internal method to get the unencrypted 
	string (required to use the string inside mscorlib).


svn path=/trunk/mcs/; revision=36870
2004-11-30 23:56:18 +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
Atsushi Eno 239df017a1 2004-08-19 Atsushi Enomoto <[email protected]>
* CodeAccessPermission.cs : csc build fix. Currently mcs has bugs on
	  CS0136 error detection (variable identifiers in switch cases share
	  the scope).

svn path=/trunk/mcs/; revision=32513
2004-08-19 04:20:26 +00:00
Sebastien Pouliot 8b4da0830b 2004-08-17 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Added common methods to help building all
	Permissions classes in corlib. Most are declared static as they can
	also help non CodeAccessPermission-derived permissions.

svn path=/trunk/mcs/; revision=32424
2004-08-17 11:35:32 +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
Sebastien Pouliot 488ecc889f 2004-07-14 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Added CheckAssert, CheckDemand, CheckDeny,
	CheckPermitOnly, Equals and GetHashCode to NET_2_0 profile. Actualized
	TODOs. Removed duplicate license.
	* NamedPermissionSet.cs: Added Equals/GetHashCode to NET_2_0 profile.
	Removed duplicate license.
	* PermissionSet.cs: Added Equals/GetHashCode to NET_2_0 profile.
	Removed duplicate license.
	* SecurityElement.cs: Added Copy and FromString methods to NET_2_0
	profile. Removed duplicate license.
	* SecurityException.cs: Added new constructors and properties to
	NET_2_0 profile. Removed duplicate license.
	* SecurityManager.cs: Added GetZoneAndOrigin and ResolvePolicy to
	NET_2_0 profile. Removed duplicate license.
	* VerificationException.cs: Implements _Exception for NET_2_0 profile.
	Removed duplicate license.
	* XmlSyntaxException.cs: Implements _Exception for NET_2_0 profile.
	Removed duplicate license.

svn path=/trunk/mcs/; revision=31128
2004-07-14 12:06:25 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Sebastien Pouliot bcb408cc6c 2004-01-06 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fixed Demand for custom permissions
	(permissions that do not implement, the internal, IBuiltInPermission).
	Ref. http://bugzilla.ximian.com/show_bug.cgi?id=52626
	* SecurityException.cs: Fixed ToString() which could, when no
	PermissionType where specified, throws a NullReferenceException.
	Ref. http://bugzilla.ximian.com/show_bug.cgi?id=52626

svn path=/trunk/mcs/; revision=21774
2004-01-07 04:15:39 +00:00
Sebastien Pouliot ca11b26fba 2004-01-05 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Fixed Union to match 1.1/1.2 documentation.
	Simplified ToString to match MS implementation. Added LAMESPEC to
	Assert, Demand, Deny and PermitOnly as they aren't virtual.
	* NamedPermissionSet.cs: Added internal constructor for PolicyLevel.
	* PermissionSet.cs: Added internal constructor for PolicyLevel.
	* SecurityManager.cs: Moved some stuff to PolicyLevel class (e.g. Load).

svn path=/trunk/mcs/; revision=21732
2004-01-06 03:15:33 +00:00
Sebastien Pouliot d905e04183 2003-06-28 Sebastien Pouliot <[email protected]>
* CodeAccessPermission.cs: Added missing methods. Removed old XML
	documentation (present in monodoc). Added missing MonoTODO attrs.
	* NamedPermissionSet.cs : Changed some code from result of unit
	tests. Updated MonoTODO attributes.
	* PermissionSet.cs: Added missing methods. Removed old XML
	documentation (present in monodoc). Added missing MonoTODO attrs.
	Added code to some methods.
	* SecurityManager.cs: Added missing MonoTODO attributes.

svn path=/trunk/mcs/; revision=15710
2003-06-28 23:47:35 +00:00
Lawrence Pit eed54e475f Socket permission stuff, not yet used by Socket itself.
svn path=/trunk/mcs/; revision=4101
2002-04-28 09:12:58 +00:00
Piers Haken 610d7923ac added missing [Serializable] attribute
svn path=/trunk/mcs/; revision=3540
2002-04-01 20:22:40 +00:00
Nick Drochak c387f3e670 2002-01-02 Nick Drochak <[email protected]>
* corlib.build: Removed "exclude CodeAccessPermission.cs"
	* CodeAccessPermission.cs: Fix syntax error hidden by exclusion in .build file

svn path=/trunk/mcs/; revision=1766
2002-01-01 12:10:24 +00:00
Nick Drochak 0c6aa47bd1 2001-12-30 Nick Drochak <[email protected]>
* PermissionSet.cs SecurityManager.cs: New Files
	* CodeAccessPermission.cs: Add Skeleton code
	* IPermission.cs: Make public and inherit from ISecurityEncodable
	* ISecurityEncodable.cs: Make interface public
	* ISecurityPolicyEncodable.cs: Ditto
	* IStackWalk.cs: Ditto

svn path=/trunk/mcs/; revision=1754
2001-12-30 10:54:46 +00:00
Miguel de Icaza b5615e0cd8 2001-12-21 Miguel de Icaza <[email protected]>
* SecurityElement.cs, CodeAccessPermission.cs IPermission.cs
	IStackWalk.cs SecurityElement.cs ISecurityEncodable.cs: New files.

svn path=/trunk/mcs/; revision=1682
2001-12-22 04:28:02 +00:00