Updated keyScan to ignore trailing spaces in KEYINFO attributes#10
Open
dovys wants to merge 6 commits intoprep:masterfrom
Open
Updated keyScan to ignore trailing spaces in KEYINFO attributes#10dovys wants to merge 6 commits intoprep:masterfrom
dovys wants to merge 6 commits intoprep:masterfrom
Conversation
I've recently ran into a rather odd issue where some keys have a trailing space at the end of the card ID: > keyinfo --show-fpr --list --ssh-fpr S KEYINFO 61D048F46EE1DCE... T D2760001240102010006064000390000 OPENPGP.3 - - MD5:9b:c8:3c:7b:44:... - - This breaks key scanning as the scanner thinks there are 11 parts to it instead of 10. This change should be safe as gpg-agent returns a dash when the value is actually empty.
Owner
|
That's odd. However, looking at your code, wouldn't it be simpler to change this line parts := strings.Split(line, " ")to this? parts := strings.Split(strings.TrimSpace(line), " ") |
…lely querying the yubikey, thus ignoring any cached keys.
Keygrips function for finding all keys on card
Trim leading signature zeros if needed
Newer versions of GPG can add an extra field to the KEYPAIRINFO lines, for example: S KEYPAIRINFO F877E5110AE0878B14C75747397DA0755EC51613 OPENPGP.3 sa vs S KEYPAIRINFO A6D4D888546D31DA593F65246BB13DB2F98DB42E OPENPGP.3 This change makes our parser tolerate this format. It adds extra validation on the card ID and keygrip fields, ignoring ones that are invalid. I could not run the tests and gave up after five minutes. 🙈
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey,
I've recently ran into a rather odd issue where some keys have a trailing space at the end of the card ID:
This breaks key scanning as the scanner thinks there are 11 parts to it instead of 10. This change should be safe as gpg-agent returns a dash (-) when the value is actually empty.