Skip to content

Commit 4751b2f

Browse files
authored
Merge pull request microsoft#1876 from microsoft/suppress-codeql-false-positive
Suppress false positives about Git's usage of SHA-1
2 parents 4bd1703 + 3c72233 commit 4751b2f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

GVFS/GVFS.Common/Git/HashingStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public HashingStream(Stream stream)
1717
{
1818
this.stream = stream;
1919

20-
this.hash = SHA1.Create();
20+
this.hash = SHA1.Create(); // CodeQL [SM02196] SHA-1 is acceptable here because this is Git's hashing algorithm, not used for cryptographic purposes
2121
this.hashResult = null;
2222
this.hash.Initialize();
2323
this.closed = false;

GVFS/GVFS.Common/SHA1Util.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static byte[] SHA1ForUTF8String(string s)
2121
{
2222
byte[] bytes = Encoding.UTF8.GetBytes(s);
2323

24-
using (SHA1 sha1 = SHA1.Create())
24+
using (SHA1 sha1 = SHA1.Create()) // CodeQL [SM02196] SHA-1 is acceptable here because this is Git's hashing algorithm, not used for cryptographic purposes
2525
{
2626
return sha1.ComputeHash(bytes);
2727
}

GVFS/GVFS.Virtualization/Projection/GitIndexProjection.FolderData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void Include()
5454

5555
public string HashedChildrenNamesSha()
5656
{
57-
using (HashAlgorithm hash = SHA1.Create())
57+
using (HashAlgorithm hash = SHA1.Create()) // CodeQL [SM02196] SHA-1 is acceptable here because this is Git's hashing algorithm, not used for cryptographic purposes
5858
{
5959
for (int i = 0; i < this.ChildEntries.Count; i++)
6060
{

0 commit comments

Comments
 (0)