Skip to content

Commit e9a2b7e

Browse files
authored
Add explanation for CodeQL suppressions. (#2263)
1 parent bc9c1c6 commit e9a2b7e

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/TraceEvent/Symbols/NativeSymbolModule.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ private void TryInitializeCppChecksum(IDiaSourceFile sourceFile)
664664
// 3 checksum generated with the SHA256 hashing algorithm.
665665
if (sourceFile.checksumType == 1)
666666
{
667-
_hashAlgorithm = System.Security.Cryptography.MD5.Create(); // lgtm [cs/weak-crypto]
667+
_hashAlgorithm = System.Security.Cryptography.MD5.Create(); // lgtm [cs/weak-crypto] The PDB specifies the checksum algorithm. This is not controlled by TraceEvent.
668668
}
669669
else if (sourceFile.checksumType == 2)
670670
{
671-
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto]
671+
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto] The PDB specifies the checksum algorithm. This is not controlled by TraceEvent.
672672
}
673673
else if (sourceFile.checksumType == 3)
674674
{
@@ -725,11 +725,11 @@ private void TryInitializeManagedChecksum(NativeSymbolModule module)
725725

726726
if (srcFormat.Header.algorithmId == guidMD5)
727727
{
728-
_hashAlgorithm = System.Security.Cryptography.MD5.Create(); // lgtm [cs/weak-crypto]
728+
_hashAlgorithm = System.Security.Cryptography.MD5.Create(); // lgtm [cs/weak-crypto] The checksum algorithm is specified by the injected source. This is not controlled by TraceEvent.
729729
}
730730
else if (srcFormat.Header.algorithmId == guidSHA1)
731731
{
732-
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto]
732+
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto] The checksum algorithm is specified by the injected source. This is not controlled by TraceEvent.
733733
}
734734
else if (srcFormat.Header.algorithmId == guidSHA256)
735735
{

src/TraceEvent/Symbols/PortableSymbolModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ internal PortablePdbSourceFile(DocumentHandle documentHandle, PortableSymbolModu
119119
Guid hashAlgorithmGuid = metaData.GetGuid(sourceFileDocument.HashAlgorithm);
120120
if (hashAlgorithmGuid == HashAlgorithmSha1)
121121
{
122-
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto]
122+
_hashAlgorithm = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto] The PDB specifies the checksum algorithm. This is not controlled by TraceEvent.
123123
}
124124
else if (hashAlgorithmGuid == HashAlgorithmSha256)
125125
{

src/TraceEvent/TraceEventSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3053,7 +3053,7 @@ public static Guid GetEventSourceGuidFromName(string name)
30533053
}
30543054

30553055
// Compute the Sha1 hash
3056-
var sha1 = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto]
3056+
var sha1 = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto] The EventSource name to GUID protocol requires a SHA1 hash.
30573057
byte[] hash = sha1.ComputeHash(bytes);
30583058

30593059
// Create a GUID out of the first 16 bytes of the hash (SHA-1 create a 20 byte hash)

src/TraceParserGen/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ private static Guid GenerateGuidFromName(string name)
636636
}
637637

638638
// Compute the Sha1 hash
639-
var sha1 = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto]
639+
var sha1 = System.Security.Cryptography.SHA1.Create(); // lgtm [cs/weak-crypto] The EventSource name to GUID protocol requires a SHA1 hash.
640640
byte[] hash = sha1.ComputeHash(bytes);
641641

642642
// Create a GUID out of the first 16 bytes of the hash (SHA-1 create a 20 byte hash)

0 commit comments

Comments
 (0)