Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeQL suppressions #75003

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Compilers/Core/Portable/CryptographicHashProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ internal static HashAlgorithmName GetAlgorithmName(SourceHashAlgorithm algorithm
return SHA512.Create();

case AssemblyHashAlgorithm.MD5:
// CodeQL [SM02196] This is supported by the underlying ECMA-335 APIs (System.Reflection.Metadata) and as consumers we must also support it.
return MD5.Create();

default:
Expand Down
2 changes: 2 additions & 0 deletions src/Compilers/Test/Core/Metadata/ILValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public static bool IsStreamFullSigned(Stream moduleContents)
// signing implementation.
Array.Reverse(reversedSignature);

// CodeQL [SM02196] ECMA-335 requires us to support SHA-1 and this is testing that support
if (!rsa.VerifyHash(hash, reversedSignature, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1))
{
return false;
Expand Down Expand Up @@ -145,6 +146,7 @@ private static byte[] ComputeSigningHash(
buffer[authenticodeOffset + i] = 0;
}

// CodeQL [SM02196] ECMA-335 requires us to support SHA-1 and this is testing that support
using (var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1))
{
// First hash the DOS header and PE headers
Expand Down
1 change: 1 addition & 0 deletions src/Workspaces/CoreTest/SolutionTests/SolutionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ public async Task WithProjectChecksumAlgorithm_DocumentUpdates()
fileD.WriteAllBytes(bytes);

var sha256 = SHA256.Create();
// CodeQL [SM02196] This is not enabled by default but exists as a compat option for existing builds.
var sha1 = SHA1.Create();
var checksumSHA1 = sha1.ComputeHash(bytes);
var checksumSHA256 = sha256.ComputeHash(bytes);
Expand Down