Skip to content

Commit 43fbad7

Browse files
authored
CodeQL suppressions (#75003)
Another round of CodeQL suppressions
1 parent d662cde commit 43fbad7

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Compilers/Core/Portable/CryptographicHashProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ internal static HashAlgorithmName GetAlgorithmName(SourceHashAlgorithm algorithm
128128
return SHA512.Create();
129129

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

133134
default:

src/Compilers/Test/Core/Metadata/ILValidation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public static bool IsStreamFullSigned(Stream moduleContents)
106106
// signing implementation.
107107
Array.Reverse(reversedSignature);
108108

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

149+
// CodeQL [SM02196] ECMA-335 requires us to support SHA-1 and this is testing that support
148150
using (var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1))
149151
{
150152
// First hash the DOS header and PE headers

src/Workspaces/CoreTest/SolutionTests/SolutionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,7 @@ public async Task WithProjectChecksumAlgorithm_DocumentUpdates()
14821482
fileD.WriteAllBytes(bytes);
14831483

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

0 commit comments

Comments
 (0)