Skip to content
This repository has been archived by the owner on Dec 25, 2021. It is now read-only.

Bufgix for multi-adress keys #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

StephanRichter
Copy link

@StephanRichter StephanRichter commented Jul 16, 2018

commit 3fd9b5f contains a bugfix for public keys with multiple adresses. See commit description

Stephan Richter added 3 commits July 16, 2018 15:51
Keys with several emails did not work properly:

A key with email addresses [email protected] and [email protected] might give the following fingerprints with gpg --list-keys:
AAAAAA <[email protected]>
       <[email protected]>

The GnuPG script included in the former versions constructed the following dictionary when public_keys was called:
[ 'AAAAAA':'[email protected]', '':'[email protected]' ].

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 <[email protected]>
       <[email protected]>

the public_keys function would overwrite the entry with the empty key resulting in the following dictionary:

[ 'AAAAAA':'[email protected]', 'CCCCCC':'[email protected]', '':'[email protected]' ].

As you can see, [email protected] 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:

[ '[email protected]':'AAAAAA', '[email protected]':'AAAAAA', '[email protected]':'CCCCCC', '[email protected]':'DDDDDD' ]
added myself to authors
Stephan Richter and others added 3 commits July 16, 2018 16:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant