-
Notifications
You must be signed in to change notification settings - Fork 424
print additional information when verifying GPG key using DNS #1726
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
Conversation
dnf/crypto.py
Outdated
| if dns_result == dnf.dnssec.Validity.VALID: | ||
| logger.critical(_('Verified using DNS record with DNSSEC signature.')) | ||
| elif dns_result == dnf.dnssec.Validity.PROVEN_NONEXISTENCE: | ||
| logger.critical(_('Verified using DNS record. But NOT signed using DNSSEC.')) |
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.
This comment feels misleading to me. The state of "proven nonexistence" means that the GPG key is not in DNS system and DNSSEC verified the fact that it is not present. My suggestion would be either: "The domain supports DNSSEC, but does not contain DNS record for this key." But that might be too complicated, so simplified version could be to also use "NOT verified using DNS record". (any suggestions @pemensik? )
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.
This sentence should user help whether they should allow or deny the import of the key. It is not important to explain all technical details to the user.
If it is not helpful to the user, then we can even skip it (not print). But I have to admit, that I am puzzled here - because in "-y" mode we automatically import the gpg key when result is PROVEN_NONEXISTENCE.
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.
My idea might have been to preserve current behavior because in the default settings, dnf accepts the GPG key when running with -y and proven nonexistence means that we are sure the domain is not supposed to contain the key which is the case for most of the domains running RPM repos except for the official Fedora.
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.
Sure, after quick glance on dnf.dnssec code, it seems to me elif log would match dnf.dnssec.Validity.RESULT_NOT_SECURE. PROVEN_NONEXISTENCE means we have cryptographic proof no such key exists. I think the only outcome for user is to verify it manually (some other way). Do we even have to handle unsigned keys? They may lead to false assurance this is the correct key, when anyone may easily forge it. Just not provide any hints unless VALID.
dnf/crypto.py
Outdated
| if dns_result == dnf.dnssec.Validity.VALID: | ||
| logger.critical(_('Verified using DNS record with DNSSEC signature.')) | ||
| elif dns_result == dnf.dnssec.Validity.PROVEN_NONEXISTENCE: | ||
| logger.critical(_('Verified using DNS record. But NOT signed using DNSSEC.')) |
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.
Sure, after quick glance on dnf.dnssec code, it seems to me elif log would match dnf.dnssec.Validity.RESULT_NOT_SECURE. PROVEN_NONEXISTENCE means we have cryptographic proof no such key exists. I think the only outcome for user is to verify it manually (some other way). Do we even have to handle unsigned keys? They may lead to false assurance this is the correct key, when anyone may easily forge it. Just not provide any hints unless VALID.
dnf/crypto.py
Outdated
| if dns_result == dnf.dnssec.Validity.VALID: | ||
| logger.critical(_('Verified using DNS record with DNSSEC signature.')) | ||
| elif dns_result == dnf.dnssec.Validity.PROVEN_NONEXISTENCE: | ||
| logger.critical(_('Verified using DNS record. But NOT signed using DNSSEC.')) |
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 remove the elif: please. Unsigned key is not proof for anything, just say not verified in else.
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.
I agree after reading the explanation. Thank you.
|
Updated according to the comments. |
msehnout
left a comment
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.
Looks good to me!
|
Thanks guys for the patch and review! |
|
bors try |
pemensik
left a comment
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.
Much better, thanks!
tryBuild succeeded: |
No description provided.