-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add signed_by_[any|all]
parameters to gpg.verify
#63168
Conversation
Since missing pubkeys also cause the previous signature's fingerprint to be overwritten, this would have led to situations where the check could have passed when it should not have.
vsajip/python-gnupg@ee94a7e That was very fast.
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.
Just a question
Huh, I accidentally performed a squash merge from master, which blew something up on Github. In the meantime, I force-pushed a normal merge, but somehow the first one triggered another reviewer to be requested as well. Sorry! =/ The new commit only applies the workaround to versions |
@lkubb Just a quick question, are the two options |
@garethgreenaway They are able to be specified together: Edit: You're right, I did not include a test when both are specified. Would you prefer I add one? |
@lkubb if it's not a issue to include both I think it's fine. |
sig_info["fingerprint"] contains the actual signing key's fingerprint, which might be a subkey. The primary key's fingerprint is always found in sig_info["pubkey_fingerprint"]. In cases where a signing subkey was used, the intended behavior is still comparison with the primary key.
@garethgreenaway Sorry for dismissing the reviews, I had to push two slight modifications:
|
What does this PR do?
Allows
gpg.verify
to additionally verify that good signatures come from a set of predefined public keys.What issues does this PR fix or reference?
Fixes: #63166
Previous Behavior
Any key present in the keyring can provide a valid signature for anything.
New Behavior
It is possible to restrict the accepted signers to a predefined set of keys.
Notes
This is based off of #63152, so should be merged after that one.
Merge requirements satisfied?
Commits signed with GPG?
Yes