Skip to content

Commit 7389d7d

Browse files
authored
Supress CodeQL Warning in SPDX parsing (#1444)
1 parent 24b8b1b commit 7389d7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.ComponentDetection.Detectors/spdx/Spdx22ComponentDetector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private SpdxComponent ConvertJObjectToSbomComponent(ProcessRequest processReques
121121
private string GetSHA1HashFromStream(Stream stream)
122122
{
123123
#pragma warning disable CA5350 // Suppress Do Not Use Weak Cryptographic Algorithms because we use SHA1 intentionally in SPDX format
124-
return BitConverter.ToString(SHA1.Create().ComputeHash(stream)).Replace("-", string.Empty).ToLower();
124+
return BitConverter.ToString(SHA1.Create().ComputeHash(stream)).Replace("-", string.Empty).ToLower(); // CodeQL [SM02196] Sha1 is used in SPDX 2.2 format this file is parsing (https://spdx.github.io/spdx-spec/v2.2.2/file-information/).
125125
#pragma warning restore CA5350
126126
}
127127
}

0 commit comments

Comments
 (0)