This repository was archived by the owner on Dec 25, 2021. It is now read-only.
Bufgix for multi-adress keys#4
Open
StephanRichter wants to merge 6 commits intoLunaBytesBack:masterfrom
Open
Conversation
added 3 commits
July 16, 2018 15:51
Keys with several emails did not work properly:
A key with email addresses a@example.com and b@example.com might give the following fingerprints with gpg --list-keys:
AAAAAA <a@example.com>
<b@example.com>
The GnuPG script included in the former versions constructed the following dictionary when public_keys was called:
[ 'AAAAAA':'a@example.com', '':'b@example.com' ].
This was ok, since the encrypt method only used the dictionary's values, i.e. email addresses.
However, when there was a second key, that might cause problems:
CCCCCC <c@example.com>
<d@example.com>
the public_keys function would overwrite the entry with the empty key resulting in the following dictionary:
[ 'AAAAAA':'a@example.com', 'CCCCCC':'c@example.com', '':'d@example.com' ].
As you can see, b@example.com is no longer a value in the dictionary. Mails to this address will not be encrypted, although there is a matching public key.
This commit fixes this bug by introducing the method mails_public_keys, which retuns an inverted dictionary:
[ 'a@example.com':'AAAAAA', 'b@example.com':'AAAAAA', 'c@example.com':'CCCCCC', 'd@example.com':'DDDDDD' ]
added myself to authors
not using empty fingerprints in mails_public_keys
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
commit 3fd9b5f contains a bugfix for public keys with multiple adresses. See commit description