Skip to content

Make authenticity verification for downloaded binaries more configurable - support skipping it and using alternative signature#769

Draft
valco1994 wants to merge 13 commits intobazelbuild:masterfrom
valco1994:authenticity-verification
Draft

Make authenticity verification for downloaded binaries more configurable - support skipping it and using alternative signature#769
valco1994 wants to merge 13 commits intobazelbuild:masterfrom
valco1994:authenticity-verification

Conversation

@valco1994
Copy link
Contributor

@valco1994 valco1994 commented Jan 26, 2026

I supported additional features, so it's possible to skip verification or provide an alternative verification key now.

I also switched from golang.org/x/crypto to github.com/ProtonMail/gopenpgp/v3, because golang.org/x/crypto/openpgp is deprecated and unmaintained (see https://pkg.go.dev/golang.org/x/crypto/openpgp for details).

PiotrSikora and others added 11 commits January 27, 2026 00:12
Fixes bazelbuild#15.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* refactor `httputil.DownloadBinary` to download and store signature file
* extract authenticity verification logic into a separate `VerifyBinary` function
* perform authenticity verification in `downloadBazelIfNecessary`, after integrity check
  * it allows us to keep verification logic in one place
  * failure of authenticity check is clearly handled in the same way as failure of integrity check: downloaded Bazel left in CAS, but the mapping file is not created in metadata
…itly using an alternative verification key.

It can be useful if
* the embedded verification key expired, but it's impossible to update bazelisk for some reason
* Bazel is downloaded from the fork which uses an alternative PGP key
… because golang.org/x/crypto is deprecated and unmaintained

See https://pkg.go.dev/golang.org/x/crypto/openpgp for details
@valco1994 valco1994 force-pushed the authenticity-verification branch 2 times, most recently from 0117588 to 989125c Compare January 27, 2026 14:20
…o:embed to make it available in the source code
@valco1994 valco1994 force-pushed the authenticity-verification branch from 989125c to bb6e9ad Compare January 27, 2026 14:25
@valco1994
Copy link
Contributor Author

@philwo, @meteorcloudy, @fweikert, please, take a look at it.

@meteorcloudy meteorcloudy requested a review from fweikert January 28, 2026 16:27
@valco1994
Copy link
Contributor Author

It would be ok, if this PR is reviewed deeply after #192, because it's initially based on #192.
But among other things, it introduces a possibility to skip authenticity verification and to use an alternative verification key. I think that these features are critically important, and should be supported before releasing the authenticity verification feature.

@valco1994 valco1994 marked this pull request as draft February 25, 2026 11:01
@valco1994 valco1994 changed the title Support authenticity verification for downloaded binaries Make authenticity verification for downloaded binaries more configurable - support skipping it and using alternative signature Mar 1, 2026
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.

2 participants