ROSA Linux Bugzilla – Bug 5908
KWallet GPG don't work
Last modified: 2015-08-22 13:15:40 MSD
Created attachment 4176 [details]
KWallet GPG don't work
If I use kgpg and create GPG key, it don't work
Created attachment 4220 [details]
file from https://fedorahosted.org/kde-settings/browser/trunk/etc/kde/env/gpg-agent-startup.sh
1) Install attached file gpg-agent-startup.sh to ~/.kde/env
2) Install kgpg and pinentry-gtk2 (-qt4 too ugly)
4) run kgpg (or "gpg —gen-key" in terminal) and create key (wait.....)
If use systemd method for gpg-agent run, gpg-agent don't export variables.
for new gpg 2.1 used another method
I'm genuinely hoping this does not sound like word salad.
Gpg-agent creates a socket, that socket's location changes at every startup. Gpg-agent stores that sockets info in an env var called $GPG_AGENT_INFO. optionally gpg-agent can write that info to a file.
When gpg-agent creates the env var, it only does so for the current shell. Any other shell does not get updated.
If you launch gpg-agent as part of KDE or bash_profile, it works because it creates the env var in KDE or bash's shell respectively. Thus program can find the socket's location.
It's dependant on the timing of network manager's connection attempt and it's not fault tolerant. I.e. if gpg-agent crashes then it must be reloaded but no child shell will get the updated env var for the new socket location, (because it changes every time gpg-agent starts up), so for the child shells it stops working.
There is also no support for a TTY as if its part of bash profile, then new instance of gpg-agent will be created, and thus a new socket, for each console window you open in a window manager or for each news TTY session you open.
On the other hand, if you start gpg-agent via systemd in user mode, then all of the above is corrected but a new issue appears.
I.e. systemd spawns processes in a unique shell for that process. So the env var that gpg-agent creates never gets used because it only exists in the shell that systemd created for gpg-agent not the users active shell. Also that env var is destroyed shortly after it is created because gpg-agent is a forking process that will terminate its parent process after using it to create the env var, and systemd will terminate the shell it spawned when the gpg-agent parent process terminates as its no longer needed.
As a result the only way to get that info to other programs when using systemd is the env file option for gpg-agent. But that also has an issue.
New gpg-agent (2.1) use updated scheme for run, without GPG_AGENT_INFO.
We assemble this version in the near future.