Commit Graph
113 Commits
Author SHA1 Message Date
Sebastien Pouliot 21d4b14f6f 2008-01-02 Sebastien Pouliot <[email protected]>
* SecureString.cs: Fix InsertAt buffer calculation. Fix #350820


svn path=/trunk/mcs/; revision=92107
2008-01-02 15:14:10 +00:00
Sebastien Pouliot 9851f87e59 2008-01-02 Sebastien Pouliot <[email protected]>
* SecureString.cs: Don't forget length in Copy. Fix #350840


svn path=/trunk/mcs/; revision=92104
2008-01-02 14:44:00 +00:00
Atsushi Eno daa70f997b 2007-11-07 Atsushi Enomoto <[email protected]>
* SecurityElement.cs :
	  set_Text() should unescape the input string. get_Text() should
	  return unescaped string. It also applies to attribute value.
	  ToString() should return valid (escaped) XML.

	* SecurityElementTest.cs : enabled test for #333699 and added
	  couple more.


svn path=/trunk/mcs/; revision=89135
2007-11-07 18:07:29 +00:00
Gert Driesen 98c4e1fa83 * SecurityElement.cs: In ctors, do not assign to Tag property to
ensure exception message match that of MS. In Tag property, set name 
of parameter in ArgumentNullException and do not filter out
namespace prefixes. Modified Text property to allow null values
after change to IsValidText that no longer considers null value as
valid. Avoid NRE in Escape.
* SecurityElementTest.cs: No longer derive from Assertion. Added and
improved ctor tests. Improved AddAttribute and AddChild tests.
Added comment to mono's Attributes test and added test that passes
on MS (to track fix for MS bug). Improved IsValid* tests. Added tests
for Tag and Text. Improved FromString test to verify behavior wrt
namespace prefixes. Added test for bug #333699.

svn path=/trunk/mcs/; revision=87459
2007-10-14 13:44:48 +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
Atsushi Eno d53125ab7a 2007-08-08 Atsushi Enomoto <[email protected]>
* SecureString.cs : commenting out internal call. It somehow seems
	  to cause timeout on the buildbots :(


svn path=/trunk/mcs/; revision=83662
2007-08-08 12:44:10 +00:00
Atsushi Eno a1fa272c48 2007-08-07 Atsushi Enomoto <[email protected]>
* SecureString.cs : adding notes that ProtectedMemory is not
	  implemented for non-windows environment.


svn path=/trunk/mcs/; revision=83583
2007-08-07 12:24:37 +00:00
Atsushi Eno a7a8824fc6 2007-08-07 Atsushi Enomoto <[email protected]>
* SecureString.cs : Decrypt() and Encrypt() now use icall wrapper
	  to ProtectedMemory in System.Security.dll.


svn path=/trunk/mcs/; revision=83576
2007-08-07 11:21:06 +00:00
Sebastien Pouliot 8ab55c4616 2007-02-23 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: Fix InvalidCastException on non-CAS permissions.
	Fix bug #80936.


svn path=/trunk/mcs/; revision=73365
2007-02-23 14:37:46 +00:00
Sebastien Pouliot e823667b5f 2006-06-16 Sebastien Pouliot <[email protected]>
* SecurityContext.cs: Don't skip the calling callBack if we don't call
	CompressedStack.Run (#78652).


svn path=/trunk/mcs/; revision=61796
2006-06-16 13:18:06 +00:00
Sebastien Pouliot f49f4becc9 2006-06-15 Sebastien Pouliot <[email protected]>
* SecurityContext.cs: Don't call CompressedStack.Run if we don't have
	a compressed stack in the context (which can now happen because of 
	#78652). This should fix MWF bug #78652 (BeginInvoke under 2.0).


svn path=/trunk/mcs/; revision=61755
2006-06-15 13:49:09 +00:00
Sebastien Pouliot f2c9a7f3c3 SecurityException.cs: Show Evidence correctly (it's a collection) but avoid showing the Hash evidence (it's way too big to be useful).
svn path=/trunk/mcs/; revision=59182
2006-04-07 15:45:53 +00:00
Sebastien Pouliot 04ecae7ba2 2005-11-11 Sebastien Pouliot <[email protected]>
* SecureString.cs: Completed InsertAt, fixed Alloc not to re-alloc a
	block of the same size. Fixed missing encryption for the char* ctor.
	Only missing is access to ProtectedMemory do to the [en|de]cryption.


svn path=/trunk/mcs/; revision=52910
2005-11-11 14:18:44 +00:00
Sebastien Pouliot 0d441b69b2 2005-10-30 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: Forgot to remove virtual from 2.0 IsSubsetOf.


svn path=/trunk/mcs/; revision=52392
2005-10-30 14:52:14 +00:00
Sebastien Pouliot a707d665a2 2005-10-29 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: Another update to corcompare shows that even more
	methods are not virtual in 2.0 final.


svn path=/trunk/mcs/; revision=52379
2005-10-29 14:14:31 +00:00
Sebastien Pouliot ea682b57ce 2005-10-28 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: Some methods are no more virtual in 2.0 final.


svn path=/trunk/mcs/; revision=52351
2005-10-28 19:12:30 +00:00
Sebastien Pouliot 3df0425e57 2005-10-28 Sebastien Pouliot <[email protected]>
* SecureString.cs: Changed the previous (and partial) managed 
	implementation to one (that will be) based on ProtectedMemory. Work in
	progress...


svn path=/trunk/mcs/; revision=52329
2005-10-28 15:44:41 +00:00
Sebastien Pouliot 47480dd484 2005-10-17 Sebastien Pouliot <[email protected]>
* PermissionSet.cs: If the current permission set is unrestricted then
	we must allow "permit only" for unrestricted (all other case are known
	to be too restrictive).


svn path=/trunk/mcs/; revision=51807
2005-10-17 16:53:43 +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 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 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
Ben Maurer a68aa2eda4 remove executable bit from changelogs
svn path=/trunk/mcs/; revision=46563
2005-06-27 15:53:16 +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 67fb555352 2005-06-16 Sebastien Pouliot <[email protected]>
* NamedPermissionSet.cs: A default NamedPermissionSet is Unrestricted.

svn path=/trunk/mcs/; revision=46091
2005-06-16 13:15:32 +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 fede5cfc65 2005-06-08 Sebastien Pouliot <[email protected]>
* AllowPartiallyTrustedCallersAttribute.cs, HostSecurityManagerFlags.cs
	IEvidenceFactory.cs, IPermission.cs, ISecurityEncodable.cs,
	ISecurityPolicyEncodable.cs, IStackWalk.cs, NamedPermissionSet.cs,
	PolicyLevelType.cs, SecureString.cs, SecurityElement.cs, 
	SecurityZone.cs, UnverifiableCodeAttribute.cs, VerificationException.cs
	XmlSyntaxException.cs: Fix 2.0 beta2 API changes (which is mostly 
	adding ComVisible attributes to classes).


svn path=/trunk/mcs/; revision=45630
2005-06-08 11:29:29 +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 6ca0e3d1ea 2005-05-28 Sebastien Pouliot <[email protected]>
* HostSecurityManager.cs: Added check for ActivationArguments in 
	application evidences.


svn path=/trunk/mcs/; revision=45136
2005-05-28 14:50:25 +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
Sebastien Pouliot 9f7380675a 2005-05-25 Sebastien Pouliot <[email protected]>
* SecurityException.cs: PermissionState isn't always serialized 
	(depending on the security policy) so it cannot always be deserialized
	too (and this must work without throwing exceptions).


svn path=/trunk/mcs/; revision=45006
2005-05-25 16:44:13 +00:00
Sebastien Pouliot b3c3d40516 2005-05-20 Sebastien Pouliot <[email protected]>
* SecurityContext.cs: Includes more methods in NET_1_1 to enable 
	ThreadPool.UnsafeQueueUserWorkItem to work properly (i.e. without
	stack propagation).


svn path=/trunk/mcs/; revision=44817
2005-05-20 14:10:58 +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 cf4ff8ba00 2005-05-09 Sebastien Pouliot <[email protected]>
* SecurityContext.cs: That was the wrong place to capture the stack.


svn path=/trunk/mcs/; revision=44271
2005-05-09 12:59:17 +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 3ed164a91a 2005-04-28 Sebastien Pouliot <[email protected]>
* PermissionSetCollection.cs: Updated wrt beta2. Seems this will be
	removed before 2.0 final.
	* HostProtectionException.cs: Updated wrt beta2. Added TODO as it 
	isn't support by the runtime.
	* SecurityContext.cs: Updated wrt beta2. Class is now internal in 
	NET_1_1 to allow the compressed stack propagation to other threads.
	* SecurityCriticalAttribute.cs: Added support for property Scope.
	* SecurityException.cs: Removed PermitOnlySetInstance property to 
	match beta2.
	* SecurityTransparentAttribute.cs: Fixed AttributeUsage. Added TODO
	as it isn't support by the runtime.
	* SuppressUnmanagedCodeSecurityAttribute.cs: Added delegates to usage
	in NET_2_0.


svn path=/trunk/mcs/; revision=43714
2005-04-28 12:09:31 +00:00
Sebastien Pouliot b29deca6a4 New attribute and enum introduced in 2.0 beta2
svn path=/trunk/mcs/; revision=43655
2005-04-27 14:41:52 +00:00
Sebastien Pouliot 616ae24869 Update HostSecurityManager and HostSecurityManagerOptions for beta2
svn path=/trunk/mcs/; revision=43551
2005-04-25 16:41:57 +00:00
Sebastien Pouliot 6c6cf1a64f * SecurityException.cs: Added try/catch in GetObjectData because the PermissionState property is serialized only if both ControlEvidence and ControlPolicy are granted.
svn path=/trunk/mcs/; revision=42450
2005-03-31 21:43:29 +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 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