Skip to content
Draft
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.
#pragma warning disable CA5350 // Do Not Use Weak Cryptographic Algorithms
ChecksumType.Sha1 => SHA1.Create (),
#pragma warning restore CA5350
_ => throw new NotSupportedException ($"Unsupported checksum type: '{checksumType}'."),
};

Expand Down