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
Conversation
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
…sabling of authenticity check
…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
60da2d9 to
9d67949
Compare
0117588 to
989125c
Compare
…o:embed to make it available in the source code
989125c to
bb6e9ad
Compare
Contributor
Author
|
@philwo, @meteorcloudy, @fweikert, please, take a look at it. |
Contributor
Author
|
It would be ok, if this PR is reviewed deeply after #192, because it's initially based on #192. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/cryptotogithub.com/ProtonMail/gopenpgp/v3, becausegolang.org/x/crypto/openpgpis deprecated and unmaintained (see https://pkg.go.dev/golang.org/x/crypto/openpgp for details).