-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathApproveAssembly.cs
More file actions
37 lines (34 loc) · 990 Bytes
/
ApproveAssembly.cs
File metadata and controls
37 lines (34 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Reflection;
namespace Waher.Security.CallStack
{
/// <summary>
/// Checks for an approved assembly in the call stack.
/// </summary>
public class ApproveAssembly : CallStackCheck
{
private readonly Assembly assembly;
/// <summary>
/// Checks for an approved assembly in the call stack.
/// </summary>
public ApproveAssembly(Assembly Assembly)
{
this.assembly = Assembly;
}
/// <summary>
/// Performs a check of a stack frame.
/// </summary>
/// <param name="Frame">Stack frame.</param>
/// <returns>
/// true, if frame represents a valid frame, and the check can conclude positively.
/// false, if frame represents a prohibited frame, and the check can conclude negatively.
/// null, if the frame is not conclusive, and the check should continue with the next frame.
/// </returns>
public override bool? Check(FrameInformation Frame)
{
if (Frame.Assembly == this.assembly)
return true;
else
return null;
}
}
}