Skip to content

Commit

Permalink
Use the official pub key to always verify binary (minio#16857)
Browse files Browse the repository at this point in the history
  • Loading branch information
donatello committed Mar 20, 2023
1 parent b3c54ec commit 05444a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ func downloadBinary(u *url.URL, mode string) (readerReturn []byte, err error) {
return binaryFile, nil
}

const (
// Update this whenever the official minisign pubkey is rotated.
defaultMinisignPubkey = "RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav"
)

func verifyBinary(u *url.URL, sha256Sum []byte, releaseInfo string, mode string, reader []byte) (err error) {
if !atomic.CompareAndSwapUint32(&updateInProgress, 0, 1) {
return errors.New("update already in progress")
Expand All @@ -538,7 +543,7 @@ func verifyBinary(u *url.URL, sha256Sum []byte, releaseInfo string, mode string,
}
}

minisignPubkey := env.Get(envMinisignPubKey, "")
minisignPubkey := env.Get(envMinisignPubKey, defaultMinisignPubkey)
if minisignPubkey != "" {
v := selfupdate.NewVerifier()
u.Path = path.Dir(u.Path) + slashSeparator + releaseInfo + ".minisig"
Expand Down

0 comments on commit 05444a0

Please sign in to comment.