Skip to content
Open
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
5 changes: 5 additions & 0 deletions src/Xamarin.Android.Tools.AndroidSdk/DownloadUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ internal static string ComputeHashString (ChecksumType checksumType, byte[] data

static HashAlgorithm CreateHashAlgorithm (ChecksumType checksumType) => checksumType switch {
ChecksumType.Sha256 => (HashAlgorithm) SHA256.Create (),
// SHA1 is used only to verify externally-published file-integrity checksums (Android SDK
// repository manifests publish SHA1 checksums) and to match Google's on-disk license hashes,
// not as a security or authentication boundary. See ChecksumType / SdkManager.Manifest.cs.
Comment on lines +101 to +103
#pragma warning disable CA5350 // Do Not Use Weak Cryptographic Algorithms
ChecksumType.Sha1 => SHA1.Create (),
#pragma warning restore CA5350
Comment on lines 99 to +106

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check if the NoWarn is really there and we wouldn't need this?

_ => throw new NotSupportedException ($"Unsupported checksum type: '{checksumType}'."),
};

Expand Down
Loading