-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify default bundles downloaded from mirror.openshift.com #3605
Conversation
a156222
to
a0ffa1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but looks good. Nice to be able to remove all these hashes we have to update for every releases!!
return "", fmt.Errorf("Invalid signature: %w", err) | ||
} | ||
logging.Debugf("Got valid signature from key id: %s", id.PrimaryKey.KeyIdString()) | ||
return trimEachLine(string(clearTextMsg)), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return canonicalizedMsgText, nil
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canonicalizedMsgText
will have \r\n
line endings
it feels a bit easier to deal with lines ending in \n
especially in the unit test
it adds GetVerifiedClearsignedMsgV3() which returns clear text msg and no error if the signature is valid for the supplied pubkey this uses the golang.org/x/crypto/openpgp library as the maintained fork of it that is previously used doesn't support the old v3 signs the other fork of x/crypto at github.com/keybase/go-crypto has less active contributions
this adds getVerifiedDefaultBundleHash() which downloads the signed sha256sum.txt file from mirror.openshift.com and verifies that it's signed with the redhat release key2, then from the verified hashes it returns the hash for the default bundle
this removes the hardcoded hashes for each bundle and instead directly gets the bundle hash from the sha256sum.txt.sig file at mirror.openshift.com by using the helper from the previous commit which returns gpg verified hash for the default bundle
/test e2e-crc |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: praveenkumar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #3493