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

keyContainFix #23

wants to merge 1 commit into from

Conversation

shemeshg
Copy link

@shemeshg shemeshg commented Jun 4, 2023

it makes the function names very confusing because now

fn fingerprints_equal means contain
fn fingerprints_contain means search store with...

solves #22

Anyway, doing the search ourselves not using the gpg search c++ api is probably right

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

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.

2 participants