diff options
Diffstat (limited to 'src/mscorlib/src/System/Security/PermissionListSet.cs')
-rw-r--r-- | src/mscorlib/src/System/Security/PermissionListSet.cs | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/mscorlib/src/System/Security/PermissionListSet.cs b/src/mscorlib/src/System/Security/PermissionListSet.cs index 7eb13a72cf..093542ad4e 100644 --- a/src/mscorlib/src/System/Security/PermissionListSet.cs +++ b/src/mscorlib/src/System/Security/PermissionListSet.cs @@ -23,6 +23,7 @@ namespace System.Security using System.Threading; using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Diagnostics.Contracts; [Serializable] @@ -53,15 +54,13 @@ namespace System.Security } #if FEATURE_PLS - [System.Security.SecurityCritical] // auto-generated internal void UpdateDomainPLS (PermissionListSet adPLS) { if (adPLS != null && adPLS.m_firstPermSetTriple != null) UpdateDomainPLS(adPLS.m_firstPermSetTriple.GrantSet, adPLS.m_firstPermSetTriple.RefusedSet); } - [System.Security.SecurityCritical] // auto-generated internal void UpdateDomainPLS (PermissionSet grantSet, PermissionSet deniedSet) { - Contract.Assert(m_permSetTriples == null, "m_permSetTriples != null"); + Debug.Assert(m_permSetTriples == null, "m_permSetTriples != null"); if (m_firstPermSetTriple == null) m_firstPermSetTriple = new PermissionSetTriple(); @@ -76,7 +75,6 @@ namespace System.Security UpdateTripleListAndCreateNewTriple(currentTriple, null); } - [System.Security.SecurityCritical] // auto-generated private void Terminate(PermissionSetTriple currentTriple, PermissionListSet pls) { #if FEATURE_COMPRESSEDSTACK @@ -86,7 +84,6 @@ namespace System.Security this.UpdateTripleListAndCreateNewTriple(currentTriple, null); } - [System.Security.SecurityCritical] // auto-generated private bool Update(PermissionSetTriple currentTriple, PermissionListSet pls) { #if FEATURE_COMPRESSEDSTACK @@ -95,7 +92,6 @@ namespace System.Security return this.UpdatePermissions(currentTriple, pls); } - [System.Security.SecurityCritical] // auto-generated private bool Update(PermissionSetTriple currentTriple, FrameSecurityDescriptor fsd) { #if FEATURE_COMPRESSEDSTACK @@ -117,7 +113,6 @@ namespace System.Security } #if FEATURE_COMPRESSEDSTACK - [System.Security.SecurityCritical] private bool Update2(PermissionSetTriple currentTriple, FrameSecurityDescriptorWithResolver fsdWithResolver) { System.Reflection.Emit.DynamicResolver resolver = fsdWithResolver.Resolver; @@ -127,7 +122,6 @@ namespace System.Security } #endif // FEATURE_COMPRESSEDSTACK - [System.Security.SecurityCritical] // auto-generated private bool Update2(PermissionSetTriple currentTriple, FrameSecurityDescriptor fsd, bool fDeclarative) { // Deny @@ -187,7 +181,6 @@ namespace System.Security return false; } - [System.Security.SecurityCritical] // auto-generated private void Update(PermissionSetTriple currentTriple, PermissionSet in_g, PermissionSet in_r) { #if FEATURE_COMPRESSEDSTACK @@ -203,7 +196,6 @@ namespace System.Security } // Called from the VM for HG CS construction - [System.Security.SecurityCritical] // auto-generated private void Update(PermissionSet in_g) { if (m_firstPermSetTriple == null) @@ -226,7 +218,6 @@ namespace System.Security } #endif // FEATURE_COMPRESSEDSTACK - [System.Security.SecurityCritical] // auto-generated private bool UpdatePermissions(PermissionSetTriple currentTriple, PermissionListSet pls) { if (pls != null) @@ -322,7 +313,6 @@ namespace System.Security } } -[System.Security.SecurityCritical] // auto-generated [System.Runtime.InteropServices.ComVisible(true)] // public(internal) interface begins... // Creation functions @@ -370,7 +360,6 @@ namespace System.Security return pls; } - [System.Security.SecurityCritical] // auto-generated static internal PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction) { PermissionListSet pls = new PermissionListSet(); @@ -411,7 +400,6 @@ namespace System.Security return pls; } - [System.Security.SecurityCritical] // auto-generated static internal PermissionListSet CreateCompressedState_HG() { PermissionListSet pls = new PermissionListSet(); @@ -420,11 +408,10 @@ namespace System.Security } #endif // #if FEATURE_COMPRESSEDSTACK // Private Demand evaluation functions - only called from the VM - [System.Security.SecurityCritical] // auto-generated internal bool CheckDemandNoThrow(CodeAccessPermission demand) { // AppDomain permissions - no asserts. So there should only be one triple to work with - Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); + Debug.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); @@ -436,18 +423,16 @@ namespace System.Security } - [System.Security.SecurityCritical] // auto-generated internal bool CheckSetDemandNoThrow(PermissionSet pSet) { // AppDomain permissions - no asserts. So there should only be one triple to work with - Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); + Debug.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); return m_firstPermSetTriple.CheckSetDemandNoThrow(pSet); } // Demand evauation functions - [System.Security.SecurityCritical] // auto-generated internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh) { bool bRet = SecurityRuntime.StackContinue; @@ -467,7 +452,6 @@ namespace System.Security return bRet; } - [System.Security.SecurityCritical] // auto-generated internal bool CheckSetDemand(PermissionSet pset , RuntimeMethodHandleInternal rmh) { PermissionSet unused; @@ -475,7 +459,6 @@ namespace System.Security return SecurityRuntime.StackHalt; // CS demand check always terminates the stackwalk } - [System.Security.SecurityCritical] internal bool CheckSetDemandWithModification(PermissionSet pset, out PermissionSet alteredDemandSet, RuntimeMethodHandleInternal rmh) { bool bRet = SecurityRuntime.StackContinue; @@ -503,10 +486,9 @@ namespace System.Security /// Check to see if the PLS satisfies a demand for the special permissions encoded in flags /// </summary> /// <param name="flags">set of flags to check (See PermissionType)</param> - [System.Security.SecurityCritical] // auto-generated private bool CheckFlags(int flags) { - Contract.Assert(flags != 0, "Invalid permission flag demand"); + Debug.Assert(flags != 0, "Invalid permission flag demand"); bool check = true; @@ -531,7 +513,6 @@ namespace System.Security /// </summary> /// <param name="flags">set of flags to check (See PermissionType)</param> /// <param name="grantSet">alternate permission set to check</param> - [System.Security.SecurityCritical] // auto-generated internal void DemandFlagsOrGrantSet(int flags, PermissionSet grantSet) { if (CheckFlags(flags)) |