Skip to content

Conversation

@xsuchy
Copy link
Member

@xsuchy xsuchy commented Feb 11, 2021

No description provided.

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.'))
Copy link
Contributor

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? )

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.'))
Copy link
Contributor

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.'))
Copy link
Contributor

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.

Copy link
Member Author

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.

@xsuchy
Copy link
Member Author

xsuchy commented Feb 12, 2021

Updated according to the comments.

Copy link
Contributor

@msehnout msehnout left a 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!

@m-blaha
Copy link
Member

m-blaha commented Feb 15, 2021

Thanks guys for the patch and review!

@m-blaha
Copy link
Member

m-blaha commented Feb 15, 2021

bors try

bors bot added a commit that referenced this pull request Feb 15, 2021
Copy link
Contributor

@pemensik pemensik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thanks!

@bors
Copy link
Contributor

bors bot commented Feb 15, 2021

try

Build succeeded:

@m-blaha m-blaha merged commit 6272527 into rpm-software-management:master Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants