private static IEnumerable <MetadataReference> GetAdditionalReferences() => MetadataReferenceFacade.GetSystemSecurityCryptography();
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());
private static IEnumerable <MetadataReference> GetAdditionalReferences() => MetadataReferenceFacade.GetSystemNetHttp() .Concat(MetadataReferenceFacade.GetSystemSecurityCryptography()) .Concat(NetStandardMetadataReference.Netstandard);
private static IEnumerable <MetadataReference> GetAdditionalReferences() => MetadataReferenceFacade.GetSystemSecurityCryptography() .Concat(NuGetMetadataReference.BouncyCastle());
public void InitializationVectorShouldBeRandom() => Verifier.VerifyAnalyzer(@"TestCases\InitializationVectorShouldBeRandom.cs", GetAnalyzer(), ParseOptionsHelper.FromCSharp8, additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
public void InitializationVectorShouldBeRandom_CSharp9() => Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\InitializationVectorShouldBeRandom.CSharp9.cs", GetAnalyzer(), MetadataReferenceFacade.GetSystemSecurityCryptography());
public void HashesShouldHaveUnpredictableSalt_CSharp9() => Verifier.VerifyAnalyzerFromCSharp9Console(@"TestCases\HashesShouldHaveUnpredictableSalt.CSharp9.cs", GetAnalyzer(), MetadataReferenceFacade.GetSystemSecurityCryptography());
private static IEnumerable <MetadataReference> GetAdditionalReferences() => MetadataReferenceFacade.GetMicrosoftWin32Primitives() .Union(MetadataReferenceFacade.GetSystemSecurityCryptography());
public void DoNotUseRandom_Not_Enabled() => Verifier.VerifyNoIssueReported(@"TestCases\DoNotUseRandom.cs", new DoNotUseRandom(), additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
public void HashesShouldHaveUnpredictableSalt() => Verifier.VerifyAnalyzer(@"TestCases\HashesShouldHaveUnpredictableSalt.cs", GetAnalyzer(), ParseOptionsHelper.FromCSharp8, additionalReferences: MetadataReferenceFacade.GetSystemSecurityCryptography());
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());