-
Notifications
You must be signed in to change notification settings - Fork 480
Closed
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzersBugThe product is not behaving according to its current intended designThe product is not behaving according to its current intended designCategory-Security
Description
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
v2.9.5-beta1.final (Latest)
Diagnostic ID
- CA5392
- CA5393
Repro steps
CA5392:
[DllImport("System.Security.Cryptography.Native.OpenSsl")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern unsafe bool CryptoNative_GetRandomBytes(byte* buffer, int length);CA5393:
[DllImport("System.Security.Cryptography.Native.OpenSsl")]
[DefaultDllImportSearchPaths(DllImportSearchPath.LegacyBehavior)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern unsafe bool CryptoNative_GetRandomBytes(byte* buffer, int length);Expected behavior
DefaultDllImportSearchPathsAttribute appears to be ignored on platforms other than Windows, and LegacyBehavior is the only available option. Warnings that are unavoidable on platforms other than Windows should be disabled by default.
Actual behavior
CA5392 and CA5393 are enabled by default.
Metadata
Metadata
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzersBugThe product is not behaving according to its current intended designThe product is not behaving according to its current intended designCategory-Security