hlo*_*dal 7 .net c# security xamarin.android mvvmcross
我有一个类 - MobileLogging- 实现MvvmCross'IMvxTrace接口(来自参考Cirrious.MvvmCross.Droid packages\MvvmCross.HotTuna.CrossCore.3.5.0\lib\MonoAndroid\Cirrious.CrossCore.dll):
namespace Cirrious.CrossCore.Platform
{
public interface IMvxTrace
{
void Trace(MvxTraceLevel level, string tag, Func<string> message);
void Trace(MvxTraceLevel level, string tag, string message);
void Trace(MvxTraceLevel level, string tag, string message, params object[] args);
}
}
Run Code Online (Sandbox Code Playgroud)
从代码工作的角度来看,一切都很好.但是,当选择"运行代码分析解决方案"时,它会产生许多安全警告:
运行SecAnnotate.exe会生成包含其他内容的TransparencyAnnotations.xml
<type name="<...mynamespace...>.MobileLogging">
<annotations>
<critical>
<rule name="TypesMustBeAtLeastAsCriticalAsBaseTypes">
<reason pass="1">Transparent or safe-critical type 'MobileLogging' derives from
critical type 'IMvxTrace' in violation of the transparency inheritance rules.
'MobileLogging' must be critical to derive from a critical type or implement a
critical interface.</reason>
<reason pass="1">Transparent or safe-critical type 'MobileLogging' derives from
critical type 'IMobileLogging' in violation of the transparency inheritance
rules. 'MobileLogging' must be critical to derive from a critical type or
implement a critical interface.</reason>
</rule>
</critical>
</annotations>
Run Code Online (Sandbox Code Playgroud)
起初我只是假设没问题,日志功能可能在某些时候可能会调用一些本机(非托管)日志记录功能,所以它被标记为安全关键似乎并不太远.但现在我开始认为IMvxTrace被认为是安全关键的事实是错误的.
首先,因为在查看MvvmCross的代码库时,没有任何内容表明任何安全级别或任何规范,实际上搜索字符串"secur"只匹配两行
SecureTextEntry = isPassword,
using System.Security.Cryptography;
Run Code Online (Sandbox Code Playgroud)
在google上搜索"IMvxTrace critical"只返回5场比赛,其中没有一项与我相关.
因此,假设IMvxTrace被错误地标记为安全关键,可能的原因是什么,我该如何解决?