コード例 #1
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemSecurityCryptography();
コード例 #2
0
 public void InsecureHashAlgorithm() =>
 Verifier.VerifyAnalyzerFromCSharp9Library(@"TestCases\InsecureHashAlgorithm.cs", new InsecureHashAlgorithm(), MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #3
0
 public void AesManagedShouldBeWithSecureMode() =>
 Verifier.VerifyAnalyzer(@"TestCases\AesManagedShouldBeWithSecureMode.cs",
                         new AesManagedShouldBeWithSecureMode(),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #4
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemNetHttp()
 .Concat(MetadataReferenceFacade.GetSystemSecurityCryptography())
 .Concat(NetStandardMetadataReference.Netstandard);
コード例 #5
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemSecurityCryptography()
 .Concat(NuGetMetadataReference.BouncyCastle());
コード例 #6
0
 public void InitializationVectorShouldBeRandom() =>
 Verifier.VerifyAnalyzer(@"TestCases\InitializationVectorShouldBeRandom.cs",
                         GetAnalyzer(),
                         ParseOptionsHelper.FromCSharp8,
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #7
0
 public void InitializationVectorShouldBeRandom_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\InitializationVectorShouldBeRandom.CSharp9.cs",
                                           GetAnalyzer(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #8
0
 public void HashesShouldHaveUnpredictableSalt_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\HashesShouldHaveUnpredictableSalt.CSharp9.cs",
                                           GetAnalyzer(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #9
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetMicrosoftWin32Primitives()
 .Union(MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #10
0
 public void DoNotUseRandom_Not_Enabled() =>
 Verifier.VerifyNoIssueReported(@"TestCases\DoNotUseRandom.cs",
                                new DoNotUseRandom(),
                                additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #11
0
 public void HashesShouldHaveUnpredictableSalt() =>
 Verifier.VerifyAnalyzer(@"TestCases\HashesShouldHaveUnpredictableSalt.cs",
                         GetAnalyzer(),
                         ParseOptionsHelper.FromCSharp8,
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #12
0
 public void DoNotUseRandom() =>
 Verifier.VerifyAnalyzer(@"TestCases\DoNotUseRandom.cs",
                         new DoNotUseRandom(AnalyzerConfiguration.AlwaysEnabled),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
 public void NonStandardCryptographicAlgorithmsShouldNotBeUsed_VB_Disabled() =>
 Verifier.VerifyNoIssueReported(@"TestCases\NonStandardCryptographicAlgorithmsShouldNotBeUsed.vb",
                                new VisualBasic.NonStandardCryptographicAlgorithmsShouldNotBeUsed(),
                                additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
 public void NonStandardCryptographicAlgorithmsShouldNotBeUsed_VB() =>
 Verifier.VerifyAnalyzer(@"TestCases\NonStandardCryptographicAlgorithmsShouldNotBeUsed.vb",
                         new VisualBasic.NonStandardCryptographicAlgorithmsShouldNotBeUsed(AnalyzerConfiguration.AlwaysEnabled),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #15
0
 public void AesManagedShouldBeWithSecureMode_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Library(@"TestCases\AesManagedShouldBeWithSecureMode.CSharp9.cs",
                                           new AesManagedShouldBeWithSecureMode(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
コード例 #16
0
 public void InsecureEncryptionAlgorithm() =>
 Verifier.VerifyAnalyzer(@"TestCases\InsecureEncryptionAlgorithm.cs",
                         new InsecureEncryptionAlgorithm(),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());