Esempio n. 1
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemSecurityCryptography();
Esempio n. 2
0
 public void InsecureHashAlgorithm() =>
 Verifier.VerifyAnalyzerFromCSharp9Library(@"TestCases\InsecureHashAlgorithm.cs", new InsecureHashAlgorithm(), MetadataReferenceFacade.GetSystemSecurityCryptography());
 public void AesManagedShouldBeWithSecureMode() =>
 Verifier.VerifyAnalyzer(@"TestCases\AesManagedShouldBeWithSecureMode.cs",
                         new AesManagedShouldBeWithSecureMode(),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 4
0
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemNetHttp()
 .Concat(MetadataReferenceFacade.GetSystemSecurityCryptography())
 .Concat(NetStandardMetadataReference.Netstandard);
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetSystemSecurityCryptography()
 .Concat(NuGetMetadataReference.BouncyCastle());
Esempio n. 6
0
 public void InitializationVectorShouldBeRandom() =>
 Verifier.VerifyAnalyzer(@"TestCases\InitializationVectorShouldBeRandom.cs",
                         GetAnalyzer(),
                         ParseOptionsHelper.FromCSharp8,
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 7
0
 public void InitializationVectorShouldBeRandom_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\InitializationVectorShouldBeRandom.CSharp9.cs",
                                           GetAnalyzer(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 8
0
 public void HashesShouldHaveUnpredictableSalt_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\HashesShouldHaveUnpredictableSalt.CSharp9.cs",
                                           GetAnalyzer(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
 private static IEnumerable <MetadataReference> GetAdditionalReferences() =>
 MetadataReferenceFacade.GetMicrosoftWin32Primitives()
 .Union(MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 10
0
 public void DoNotUseRandom_Not_Enabled() =>
 Verifier.VerifyNoIssueReported(@"TestCases\DoNotUseRandom.cs",
                                new DoNotUseRandom(),
                                additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 11
0
 public void HashesShouldHaveUnpredictableSalt() =>
 Verifier.VerifyAnalyzer(@"TestCases\HashesShouldHaveUnpredictableSalt.cs",
                         GetAnalyzer(),
                         ParseOptionsHelper.FromCSharp8,
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
Esempio n. 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());
 public void AesManagedShouldBeWithSecureMode_CSharp9() =>
 Verifier.VerifyAnalyzerFromCSharp9Library(@"TestCases\AesManagedShouldBeWithSecureMode.CSharp9.cs",
                                           new AesManagedShouldBeWithSecureMode(),
                                           MetadataReferenceFacade.GetSystemSecurityCryptography());
 public void InsecureEncryptionAlgorithm() =>
 Verifier.VerifyAnalyzer(@"TestCases\InsecureEncryptionAlgorithm.cs",
                         new InsecureEncryptionAlgorithm(),
                         additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());