Repository navigation
[Xamarin.Installer.Build.Tasks] Validate OpenJDK downloads - #13172
simonrozsival merged 3 commits into
Conversation
Add signature verification to the InstallAndroidDependencies target before it extracts and installs a downloaded Microsoft OpenJDK archive. Report XA5305 and stop installation if verification fails. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1896be77-dcc1-40d0-90eb-217cb8142081
There was a problem hiding this comment.
🟡 Changes recommended
Verification timeouts bypass XA5305, and production-path rejection needs regression coverage.
2 open findings
What changed in this PR
Adds signature verification before the Android dependency installer extracts downloaded Microsoft OpenJDK archives.
Changes:
- Verifies signatures against a pinned signing-key hash.
- Reports verification failures through
XA5305. - Adds verification tests and maintenance documentation.
| File | Description |
|---|---|
| src/Xamarin.Installer.Build.Tasks/Xamarin.Installer.Common.targets | Forwards verification settings. |
| src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs | Gates installation on verification. |
| src/Xamarin.Installer.Build.Tasks/README.md | Documents testing and key maintenance. |
| src/Xamarin.Installer.Build.Tasks/Properties/Resources.resx | Adds the XA5305 message. |
| src/Xamarin.Installer.Build.Tasks/Properties/Resources.Designer.cs | Exposes the diagnostic resource. |
| src/Xamarin.Installer.Build.Tasks/Properties/AssemblyInfo.cs | Enables internal access for tests. |
| src/Xamarin.Installer.Build.Tasks/OpenJdkSignatureVerifier.cs | Implements OpenPGP signature verification. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj | References installer tasks. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/OpenJdkSignatureTests.cs | Adds verification and installation tests. |
| Documentation/docs-mobile/TOC.yml | Links XA5305 documentation. |
| Documentation/docs-mobile/messages/xa5305.md | Explains verification failures and recovery. |
| Documentation/docs-mobile/messages/index.md | Indexes XA5305. |
| Documentation/docs-mobile/building-apps/build-targets.md | Documents installation verification. |
Files not reviewed (1)
- src/Xamarin.Installer.Build.Tasks/Properties/Resources.Designer.cs: Generated file
🧠 Review effort: Balanced
Distinguish HTTP request timeouts from caller cancellation so that verification timeouts report XA5305 instead of suggesting a change to the installation timeout. Preserve caller cancellation handling. Test HTTP timeouts and caller cancellation during both signature and public-key requests. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1896be77-dcc1-40d0-90eb-217cb8142081
|
/review |
|
✅ Android PR Reviewer completed successfully! Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "azcliprod.blob.core.windows.net"See Network Configuration for more information.
|
There was a problem hiding this comment.
The verifier is narrowly scoped, pins the decoded key ring, rejects weak/unsupported signature forms, preserves cancellation, bounds verification downloads, and has strong focused coverage. The remaining concern is that _SkipSignCheck suppresses authenticity verification without a warning visible in normal builds.
CI is currently red: Azure build 1638734 has one failed MSBuild Emulator Tests macOS > Tests > MSBuild+Emulator 7 shard; all build lanes and the other listed shards passed. The environment lacked Azure DevOps authentication needed to retrieve the failed job logs, so that failure could not be classified as a PR regression or flake.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
azcliprod.blob.core.windows.net
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "azcliprod.blob.core.windows.net"See Network Configuration for more information.
Generated by Android PR Reviewer for #13172 · copilot · gpt56 · 134.9 AIC · ⌖ 11.2 AIC · ⊞ 26.4K
Comment /review to run again
Log the internal signature-check bypass at high importance so it appears at minimal build verbosity. Keep it informational rather than a warning. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1896be77-dcc1-40d0-90eb-217cb8142081
|
/backport to release/11.0.1xx |
|
Started backporting to |
|
@simonrozsival backporting to git am output$ git cherry-pick 11e7609efd999eb5e9a1019b452e441ad1e7207c
Auto-merging Documentation/docs-mobile/TOC.yml
Auto-merging Documentation/docs-mobile/building-apps/build-targets.md
Auto-merging Documentation/docs-mobile/messages/index.md
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj
Auto-merging src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs
CONFLICT (content): Merge conflict in src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs
error: could not apply 11e7609ef... [Xamarin.Installer.Build.Tasks] Validate OpenJDK downloads (#13172)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [Xamarin.Installer.Build.Tasks] Validate OpenJDK downloads
Using index info to reconstruct a base tree...
M Documentation/docs-mobile/TOC.yml
M Documentation/docs-mobile/building-apps/build-targets.md
M Documentation/docs-mobile/messages/index.md
M src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj
M src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs
Falling back to patching base and 3-way merge...
Auto-merging Documentation/docs-mobile/TOC.yml
Auto-merging Documentation/docs-mobile/building-apps/build-targets.md
Auto-merging Documentation/docs-mobile/messages/index.md
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj
Auto-merging src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs
CONFLICT (content): Merge conflict in src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [Xamarin.Installer.Build.Tasks] Validate OpenJDK downloads
Error: The process '/usr/bin/git' failed with exit code 128 |
…13212) Add signature verification to the `InstallAndroidDependencies` target before it extracts and installs a downloaded Microsoft OpenJDK archive. Report `XA5305` and stop installation if verification fails. (cherry picked from commit 11e7609) Co-authored-by: Jonathan Peppers <[email protected]>

Add signature verification to the
InstallAndroidDependenciestarget before it extracts and installs a downloaded Microsoft OpenJDK archive. ReportXA5305and stop installation if verification fails.Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include:Validation
dotnet-local.cmd build src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\Xamarin.Android.Build.Tests.csproj --no-restore -nodeReuse:false -v quiet— passed, 0 warnings and 0 errors.dotnet-local.cmd test bin\TestDebug\net10.0\Xamarin.Android.Build.Tests.dll --filter FullyQualifiedName~OpenJdkSignatureTests— passed, 51 focused tests.dotnet-local.cmd test bin\TestDebug\net10.0\Xamarin.Android.Build.Tests.dll --filter "FullyQualifiedName~OpenJdkSignatureTests.PublishedMicrosoftArchive|FullyQualifiedName~OpenJdkSignatureTests.InstallMicrosoftJdk"— passed, 2 live tests.