summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs')
-rw-r--r--src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs b/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
index 8f25bda617..0ef5afd282 100644
--- a/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
+++ b/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
@@ -12,6 +12,7 @@ namespace System.Security {
using System.Globalization;
using System.Runtime.ConstrainedExecution;
using System.Runtime.Versioning;
+ using System.Diagnostics;
using System.Diagnostics.Contracts;
#if !FEATURE_PAL
using Microsoft.Win32.SafeHandles;
@@ -40,10 +41,8 @@ namespace System.Security {
// if this frame contains a call to any WindowsIdentity.Impersonate(),
// we save the previous SafeTokenHandles here (in the next two fields)
// Used during exceptionstackwalks to revert impersonation before calling filters
- [System.Security.SecurityCritical] // auto-generated
[NonSerialized]
private SafeAccessTokenHandle m_callerToken;
- [System.Security.SecurityCritical] // auto-generated
[NonSerialized]
private SafeAccessTokenHandle m_impToken;
#endif
@@ -56,16 +55,12 @@ namespace System.Security {
- [System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void IncrementOverridesCount();
- [System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void DecrementOverridesCount();
- [System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void IncrementAssertCount();
- [System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void DecrementAssertCount();
@@ -105,14 +100,12 @@ namespace System.Security {
// we store declarative actions in both fields, so check if they are different
return (m_restriction != null);
}
- [System.Security.SecurityCritical] // auto-generated
internal void SetAssert(IPermission perm)
{
m_assertions = CreateSingletonSet(perm);
IncrementAssertCount();
}
- [System.Security.SecurityCritical] // auto-generated
internal void SetAssert(PermissionSet permSet)
{
m_assertions = permSet.Copy();
@@ -125,7 +118,6 @@ namespace System.Security {
return (fDeclarative) ? m_DeclarativeAssertions : m_assertions;
}
- [System.Security.SecurityCritical] // auto-generated
internal void SetAssertAllPossible()
{
m_assertAllPossible = true;
@@ -141,19 +133,12 @@ namespace System.Security {
// D E N Y
//-----------------------------------------------------------+
- [System.Security.SecurityCritical] // auto-generated
internal void SetDeny(IPermission perm)
{
-#if FEATURE_CAS_POLICY
- BCLDebug.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled, "Deny is only valid in legacy CAS mode");
-#endif // FEATURE_CAS_POLICY
-
m_denials = CreateSingletonSet(perm);
IncrementOverridesCount();
-
}
- [System.Security.SecurityCritical] // auto-generated
internal void SetDeny(PermissionSet permSet)
{
m_denials = permSet.Copy();
@@ -169,14 +154,12 @@ namespace System.Security {
// R E S T R I C T
//-----------------------------------------------------------+
- [System.Security.SecurityCritical] // auto-generated
internal void SetPermitOnly(IPermission perm)
{
m_restriction = CreateSingletonSet(perm);
IncrementOverridesCount();
}
- [System.Security.SecurityCritical] // auto-generated
internal void SetPermitOnly(PermissionSet permSet)
{
// permSet must not be null
@@ -193,7 +176,6 @@ namespace System.Security {
//-----------------------------------------------------------+
// SafeAccessTokenHandle (Impersonation + EH purposes)
//-----------------------------------------------------------+
- [System.Security.SecurityCritical] // auto-generated
internal void SetTokenHandles (SafeAccessTokenHandle callerToken, SafeAccessTokenHandle impToken)
{
m_callerToken = callerToken;
@@ -204,7 +186,6 @@ namespace System.Security {
// R E V E R T
//-----------------------------------------------------------+
- [System.Security.SecurityCritical] // auto-generated
internal void RevertAssert()
{
if (m_assertions != null)
@@ -224,7 +205,6 @@ namespace System.Security {
}
}
- [System.Security.SecurityCritical] // auto-generated
internal void RevertAssertAllPossible()
{
if (m_assertAllPossible)
@@ -234,7 +214,6 @@ namespace System.Security {
}
}
- [System.Security.SecurityCritical] // auto-generated
internal void RevertDeny()
{
if (HasImperativeDenials())
@@ -244,7 +223,6 @@ namespace System.Security {
}
}
- [System.Security.SecurityCritical] // auto-generated
internal void RevertPermitOnly()
{
if (HasImperativeRestrictions())
@@ -254,7 +232,6 @@ namespace System.Security {
}
}
- [System.Security.SecurityCritical] // auto-generated
internal void RevertAll()
{
RevertAssert();
@@ -270,7 +247,6 @@ namespace System.Security {
// This will get called when we hit a FSD while evaluating a demand on the call stack or compressedstack
- [System.Security.SecurityCritical] // auto-generated
internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
{
// imperative security
@@ -283,13 +259,12 @@ namespace System.Security {
return fContinue;
}
- [System.Security.SecurityCritical] // auto-generated
internal bool CheckDemand2(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh, bool fDeclarative)
{
PermissionSet permSet;
// If the demand is null, there is no need to continue
- Contract.Assert(demand != null && !demand.CheckDemand(null), "Empty demands should have been filtered out by this point");
+ Debug.Assert(demand != null && !demand.CheckDemand(null), "Empty demands should have been filtered out by this point");
// decode imperative
if (GetPermitOnly(fDeclarative) != null)
@@ -397,7 +372,6 @@ namespace System.Security {
return SecurityRuntime.StackContinue;
}
- [System.Security.SecurityCritical] // auto-generated
internal bool CheckSetDemand(PermissionSet demandSet,
out PermissionSet alteredDemandSet,
RuntimeMethodHandleInternal rmh)
@@ -429,7 +403,6 @@ namespace System.Security {
return fContinue;
}
- [System.Security.SecurityCritical] // auto-generated
internal bool CheckSetDemand2(PermissionSet demandSet,
out PermissionSet alteredDemandSet,
RuntimeMethodHandleInternal rmh, bool fDeclarative)