Skip to content
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

keyContainFix #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/crypto/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn format_fingerprint<S: AsRef<str>>(fingerprint: S) -> String {
/// Check whether two fingerprints match.
pub fn fingerprints_equal<S: AsRef<str>, T: AsRef<str>>(a: S, b: T) -> bool {
!a.as_ref().trim().is_empty()
&& a.as_ref().trim().to_uppercase() == b.as_ref().trim().to_uppercase()
&& a.as_ref().trim().to_uppercase().contains(&b.as_ref().trim().to_uppercase())
Copy link
Owner

Choose a reason for hiding this comment

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

What do you think, would starts_with work as well?

Because then I expect A0B1C2 # comment to still match A0B1C2.

I'd prefer it to be as strict as possible when we can.

Sorry for my late reply on this.

Copy link
Author

@shemeshg shemeshg Nov 9, 2024

Choose a reason for hiding this comment

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

wouldn't startwith fail the new gnupg format that start with 0x<ID>.....(also default in gopass?

}

/// Check whether a list of keys contains the given fingerprint.
Expand Down