Allow importing of encrypted public keys
OpenPGP addon for Mozilla Thunderbird
Brought to you by:
pbrunschwig
Currently, a public key attachment that is encrypted using PGP/Inline, is not detected (encrypted attachments have mimetype application/octet-stream), and thus will not be imported when you use the import button in enigmail.
This patch changes:
- detection of public keys: .asc.pgp is now detected as a public key;
- public keys are decrypted (if necessary) before trying to import them;
- fixes a bug where encrypted attachments with an accompying .sig detached signature are detected as just signed attachments instead of signed and encrypted attachments;
- correctly removes the tempfile after importing a key.
Diff:
Thanks for the patch.
There are two issues in onShowAttachmentContextMenu() on line 992:
1.
currentAttachments[i]doesn't exist, I think that should beselectedAttachments[0]2. the property
.displayNamemay be undefined as you can see a little further down in the same method. This would lead to an exception. I have attached a sample mail that exhibits the error.Thanks for the feedback, fixed :-)!
Last edit: kluk 2018-03-20
Thanks, this looks a lot better :-)
Committed on master and 2.0-branch.