Skip to content

[android-tools] Suppress Google SDK SHA-1 checksum alert - #12526

Merged
jonathanpeppers merged 3 commits into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers-suppress-sdk-sha1-alert
Aug 26, 2026
Merged

jonathanpeppers merged 3 commits into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers-suppress-sdk-sha1-alert

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Google's current repository2-3.xml has 854 checksum nodes, all type="sha1"; the pinned cmdline-tools;19.0 values match our feed. Google's repo-common-02.xsd defines one required checksum per archive and no parallel stronger field.

This adds a finding-specific CodeQL [SM02196] suppression to the single SHA-1 construction used to compare SDK archives with Google's manifest. It is not used for authentication, signing, passwords, or authorization; SHA-256 remains the default. Review this suppression when Google provides stronger checksums.

Validation: 55 focused DownloadUtilsTests/SdkManagerTests passed; git diff --check passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 19:06
jonathanpeppers and others added 2 commits August 26, 2026 14:07
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a targeted CodeQL suppression for the single SHA1.Create() usage in DownloadUtils, preserving compatibility with upstream Android SDK repository metadata that only provides SHA-1 checksums, and adds a unit test covering SHA-1 verification.

Changes:

  • Add an inline CodeQL [SM02196] suppression at SHA1.Create() to avoid global rule suppression while keeping SHA-1 manifest compatibility.
  • Add a unit test ensuring VerifyChecksum succeeds when using a SHA-1 checksum type with a matching hash.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/Xamarin.Android.Tools.AndroidSdk-Tests/DownloadUtilsTests.cs Adds a SHA-1 VerifyChecksum test case intended to mirror Google manifest SHA-1 usage.
src/Xamarin.Android.Tools.AndroidSdk/DownloadUtils.cs Adds an inline CodeQL suppression and explanatory comment for SHA-1 compatibility in hash algorithm creation.

@jonathanpeppers
jonathanpeppers merged commit adbd358 into dotnet:main Aug 26, 2026
17 of 44 checks passed
simonrozsival pushed a commit that referenced this pull request Aug 27, 2026
Google's current [`repository2-3.xml`](https://dl.google.com/android/repository/repository2-3.xml) has 854 checksum nodes, all `type="sha1"`; the pinned `cmdline-tools;19.0` values match our feed. Google's [`repo-common-02.xsd`](https://android.googlesource.com/platform/tools/base/+/refs/heads/mirror-goog-studio-main/repository/src/main/resources/xsd/repo-common-02.xsd#257) defines one required checksum per archive and no parallel stronger field.

This adds a finding-specific `CodeQL [SM02196]` suppression to the single SHA-1 construction used to compare SDK archives with Google's manifest. It is not used for authentication, signing, passwords, or authorization; SHA-256 remains the default. Review this suppression when Google provides stronger checksums.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants