Skip to content
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
srsoftware-de:master
Open

Bufgix for multi-adress keys#4
StephanRichter wants to merge 6 commits intoLunaBytesBack:masterfrom
srsoftware-de:master

Conversation

@StephanRichter
Copy link
Copy Markdown

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