Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Enigmail/GnuPG doesn't work #4

Closed
andrevmatos opened this issue Apr 1, 2018 · 25 comments
Closed

Enigmail/GnuPG doesn't work #4

andrevmatos opened this issue Apr 1, 2018 · 25 comments
Labels
enhancement New feature or request flatpak An issue caused by flatpak

Comments

@andrevmatos
Copy link

Enigmail complains that ~/.gnupg isn't writable, and that gpg isn't found in the path. Are there any flatpak interfaces to interact with the sockets directly (avoiding exposing private key, for example)? In my case, I use ~/.gnupg/trezor as GNUPGHOME, can we support custom sockets/paths like that?

@AdrianKoshka AdrianKoshka added the enhancement New feature or request label Apr 1, 2018
@TingPing
Copy link
Member

TingPing commented Apr 1, 2018

In the long term it probably needs to be a portal so all of the decrypting/encrypting happens outside of the sandbox. Probably best discussing here: https://github.com/flatpak/xdg-desktop-portal/issues

@AdrianKoshka AdrianKoshka added the flatpak An issue caused by flatpak label Apr 2, 2018
@AdrianKoshka
Copy link
Collaborator

What would you suggest as an issue name?

@TingPing
Copy link
Member

TingPing commented Apr 3, 2018

Portal for GPG encryption/decryption

Mention that you don't want to expose the entire gpg directory, keys and all, to applications for it.

@AdrianKoshka
Copy link
Collaborator

Made an issue now

@rmader
Copy link

rmader commented Jul 12, 2018

This is the by far most import issue to solve to make thunderbird on flatpak useful IMO. Many (security concerned) people I know use thunderbird mostly for Enigmail.

@AdrianKoshka
Copy link
Collaborator

I know an ssh agent portal was added recently (it works, probably isn't the most secure, but it works). Hopefully a gpg agent portal will be implemented.

@t2d
Copy link

t2d commented Oct 31, 2019

The README says to run

 flatpak override --filesystem=~/.gnupg org.mozilla.Thunderbird

I also had to run

sudo flatpak override --filesystem=/run/user/1000/gnupg/ org.mozilla.Thunderbird

to give access to gpg-agent. Can you (dis-)confirm?

@AdrianKoshka
Copy link
Collaborator

I can't confirm, but this sounds like it should work. The worrying thign being, you're giving the sandbox access to your GPG keys directly.

@Erick555
Copy link
Collaborator

@t2d thx, I updated README and commit it alongside 68.2.1 soon.

@pjreed
Copy link

pjreed commented Nov 22, 2019

I've tried setting the overrides as described in the README, but it doesn't work for me. The Key Management dialog lists all of my keys, but when I try to sign a message, I get a popup error that says:

GnuPG cannot query your passphrase via pinentry.

This is a system setup or configuration error that prevents Enigmail from working properly and cannot be fixed automatically.

We strongly recommend that you consult our support web site at https://enigmail.net/faq.

Any ideas what might be wrong? This is with Thunderbird 68.2.2, Enigmail 2.1.3, and gpg 2.2.4.

@Erick555
Copy link
Collaborator

Erick555 commented Nov 23, 2019

@pjreed for unlocking keys protected by pin pinentry would need to be bundled in this flatpak. Currently it's not.

@micahflee
Copy link

FYI I got a permission denied when I ran this:

$ flatpak override --filesystem=~/.gnupg org.mozilla.Thunderbird
error: Permission denied

But it worked with sudo:

$ sudo  flatpak override --filesystem=~/.gnupg org.mozilla.Thunderbird

@Erick555
Copy link
Collaborator

@micahflee yes, it's noted in readme that it may require sudo.

Specifically, this command require sudo when flatpak is installed system-wide in /var/lib/flatpak. If it's installed only for local user in ~/.local/share/flatpak then it doesn't require sudo.

@Erick555
Copy link
Collaborator

@pjreed could you try installing from #97 (comment) and check if pinentry works?

@pjreed
Copy link

pjreed commented Dec 2, 2019

@Erick555 I've tried running that build, and I still get the same error about pinentry as before. Here's what my overrides look like:

$ flatpak override --user --show org.mozilla.Thunderbird
[Context]
filesystems=xdg-run/gnupg:ro;~/.gnupg;

Should I need to adjust anything else?

@Erick555
Copy link
Collaborator

Erick555 commented Dec 2, 2019

For some reason pinentry doesn't seem working:

$ flatpak run --command=sh --filesystem=~/.gnupg --filesystem=xdg-run/gnupg:ro org.mozilla.Thunderbird 
[📦 org.mozilla.Thunderbird ~]$ pinentry
OK Pleased to meet you
getpin
couldn't create prompt for gnupg passphrase: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
S ERROR gnome3.gcr_system_prompt_open 83886195 2: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
ERR 83886195 Configuration error <Pinentry>

You may check this yourself by running above flatpak command then executing pinentry in terminal and typing getpin then hitting enter.

I don't know what to do next.

@Erick555 Erick555 added the help wanted Extra attention is needed label Dec 2, 2019
@Erick555
Copy link
Collaborator

Erick555 commented Dec 3, 2019

@pjreed I think i got it. You need additionally set:
flatpak override --talk-name=org.gnome.keyring.SystemPrompter org.mozilla.Thunderbird
After that executing pinentry & getpin shows PIN prompt for me. Please try if it works for you.

@pjreed
Copy link

pjreed commented Dec 3, 2019

That looks good, thanks!

@Erick555 Erick555 removed the help wanted Extra attention is needed label Dec 4, 2019
@Erick555
Copy link
Collaborator

Erick555 commented Dec 4, 2019

@pjreed I merged pinentry branch. TB update will be published in flathub in few hours, thx for testing.

@corecontingency
Copy link
Contributor

First time trying flatpak'd Thunderbird. This bug seems to be happening for me. The Key Management dialog lists all of my keys, but when I try to sign a message, I get a popup error that says:

Your GnuPG installation is configured to use the console for pinentry. However, when using Enigmail you need a graphical version of pinentry.

This is a system setup or configuration error that prevents Enigmail from working properly and cannot be fixed automatically.

We strongly recommend that you consult our support web site at https://enigmail.net/faq.

Found this while testing my pull request #106 , but I am also having the same problem with the stable version. I even deleted my test build in case it was causing any interference.

As you can see, I am using the stable version from flathub installed with system:

[user@mycomputer ~]$ flatpak list
Thunderbird           org.mozilla.Thunderbird           68.6.0          stable          flathub        system

Here are my overrides:

[user@mycomputer ~]$ flatpak override --show org.mozilla.Thunderbird
[Context]
filesystems=xdg-run/gnupg:ro;~/.gnupg;/run/user/1000/gnupg/;

[Session Bus Policy]
org.gnome.keyring.SystemPrompter=talk
[michael@linuxlaptop ~]$ flatpak run --command=sh org.mozilla.Thunderbird
[📦 org.mozilla.Thunderbird ~]$ pinentry
OK Pleased to meet you
getpin
D ihbjbobnkn
OK

pinentry works fine, it opens a popup and I can type whatever. As you can see, it gets echoed properly.

Using Arch Linux with GNOME on Xorg. Also have a btrfs root filesystem with subvolumes.

Can anyone confirm this behavior? Any ideas?

@rmader
Copy link

rmader commented Mar 20, 2020

Do you have a btrfs subvolume mounted as root? Because apparently there are other programs dealing with flatpak that get confused by that, thinking it must be within a flatpak sandbox and therefore "translate" the path. See e.g. https://gitlab.gnome.org/GNOME/sysprof/issues/34

@corecontingency
Copy link
Contributor

corecontingency commented Mar 21, 2020

Yes. Here is my fstab, and here is my root btrfs subvolume (subvolid=5).

EDIT: Anyone encountering this issue on a non-btrfs filesystem? I want to make sure it is not something else before we chalk it up to btrfs funkiness.

@Erick555
Copy link
Collaborator

openpgp should work be default in TB 78.3.1 (but not enigmail).

@fourstepper
Copy link

fourstepper commented Feb 16, 2021

I also have my root on a btrfs subvolume, running flatpak run --command=sh org.mozilla.Thunderbird and gpg --list-keys works fine and gives me my key on the CLI, but in the GUI, I don't see any keys.

I am not sure if the keys have to be imported somehow or discovered...

image

I can see that I can import them from a file, but I would expect it to use my keys in .gnupg right away

@Erick555
Copy link
Collaborator

Erick555 commented Feb 24, 2021

@fourstepper thunderbird doesn't use gnupg by default. If you had enigmail installed then there should be some migration tool otherwise you have to import your keys manually.

https://wiki.mozilla.org/Thunderbird:OpenPGP:Migration-From-Enigmail

https://wiki.mozilla.org/Thunderbird:OpenPGP:Smartcards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request flatpak An issue caused by flatpak
Projects
None yet
Development

No branches or pull requests

10 participants