Skip to content

goinstallscript: verify archive signatures with GnuPG - #693

Open
Quim Muntal (qmuntal) wants to merge 4 commits into
mainfrom
dev/qmuntal/goinstallscript-signatures
Open

Quim Muntal (qmuntal) wants to merge 4 commits into
mainfrom
dev/qmuntal/goinstallscript-signatures

Conversation

@qmuntal

Copy link
Copy Markdown
Member

Summary

  • Verify archive signatures with GnuPG when it is on PATH, using the embedded Microsoft key and an isolated temporary keyring. SHA-256 verification remains mandatory.
  • Warn and continue with checksum-only verification when GnuPG is missing; add -RequireSignature to fail instead. Missing or invalid signatures and GnuPG errors never trigger fallback.
  • Preserve dry runs and reuse of already-installed versions, and correctly render switch parameters in repeatable commands.
  • Document the verification policy, including the effect on older unsigned releases, and test failures, cleanup, and keyring isolation.

Validation

  • Installer module tests passed in PowerShell 7 and Windows PowerShell 5.1.
  • Real Microsoft signatures were accepted and tampered archives rejected in both editions using GnuPG bundled with Git for Windows.
  • The latest Windows release installed successfully with -RequireSignature and real GnuPG.
  • git diff --check passed.

Use an embedded Microsoft key and an isolated keyring when GnuPG is available. Warn and retain SHA-256-only checks otherwise, with -RequireSignature for fail-closed installs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner November 13, 2026 15:04
Copilot AI balanced review requested due to automatic review settings November 13, 2026 15:04

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.

🟢 Approval recommended

No active review issues are reported for the installer signature-verification changes.

No open issues 🎉

What changed in this PR

Adds OpenPGP signature verification to the PowerShell Go installer using an embedded Microsoft public key, while retaining mandatory SHA-256 checks.

Changes:

  • Verify signatures with GnuPG in an isolated temporary keyring; warn when GnuPG is absent or fail with -RequireSignature.
  • Preserve dry runs and installed-version reuse, and correctly render switch parameters in repeatable commands.
  • Document verification policy and expand tests for failures, cleanup, keyring isolation, and published signatures.
File Description
goinstallscript/​README-InstallScript.md Documents verification requirements, fallback behavior, and unsigned-release limitations.
goinstallscript/​powershell/​powershell_test.go Extends installer tests for signature handling and required verification.
goinstallscript/​powershell/​gpg_test.go Adds key, GnuPG, isolation, cleanup, and tampering tests.
goinstallscript/​powershell/​go-install.ps1 Implements signature verification, temporary-file cleanup, and switch rendering.

Review effort: Balanced

@gdams George Adams (gdams) left a comment

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.

Looks sane but I'll let Davis Goodin (@dagood) confirm

@dagood Davis Goodin (dagood) left a comment

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.

Will need reconciling with #694, but the feature itself seems reasonable.

Comment thread goinstallscript/README-InstallScript.md Resolved
Merge main to reconcile #694. Keep signature verification documentation focused on -RequireSignature under Usage and make GnuPG optional for normal installs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qmuntal

Copy link
Copy Markdown
Member Author

Copilot remove this warning: #693 (comment).

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Copilot remove this warning: #693 (comment).

Removed the warning, updated the parameter help, and added a regression assertion. Tests pass. Commit: 088a382.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants