Description of problem: I have several certificates with secret keys in my GPG2 key database. In a GNOME environment, they are not listed: $ echo $GPG_AGENT_INFO /run/user/1004/keyring-juuMm6/gpg:0:1 $ gpgsm --list-secret-keys /home/martin/.gnupg/pubring.kbx ------------------------------- Unsetting GPG_AGENT_INFO solves the problem: $ unset GPG_AGENT_INFO $ gpgsm --list-secret-keys /home/martin/.gnupg/pubring.kbx ------------------------------- ID: 0xFFFFFFFFE07D817C S/N: 125FB3690000000087C2 Issuer: /CN=Fujitsu Siemens Computers User CA/DC=fujitsu-siemens/DC=com Subject: /CN=Wilck Martin/OU=FSC IS IT SBC/O=Fujitsu Siemens Computers/EMail=Martin.Wilck [...] Version-Release number of selected component (if applicable): libgnome-keyring-3.8.0-1.fc19.x86_64 gnome-keyring-3.8.2-1.fc19.x86_64 gnupg2-2.0.22-1.fc19.x86_64 gnupg2-smime-2.0.22-1.fc19.x86_64 How reproducible: always Steps to Reproduce: 1. log in under GNOME 2. import or generate at least one sercret key with gpgsm 3. run gpgsm --list-secret-keys, or try to sign a message Actual results: No keys found Expected results: Keys found Additional info: excerpt from strace (failure case) socket(PF_LOCAL, SOCK_STREAM, 0) = 4 connect(4, {sa_family=AF_LOCAL, sun_path="/run/user/1004/keyring-juuMm6/gpg"}, 35) = 0 read(4, "OK your orders please\n", 1002) = 22 [...] write(4, "HAVEKEY 39C0563884B2C101B20C59ED"..., 48) = 48 write(4, "\n", 1) = 1 read(4, "ERR 103 unknown command\n", 1002) = 24 So the HAVEKEY command seems to be unsupported by gnome-keyring-daemon.
Similar bug: https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/884856
It is possible to workaround the problem as individual user by running "gnome-session-properties" and deselecting the GPG component of the GNOME keyring tool. System-wide, it should be possible to set X-GNOME-Autostart-enabled=false in /etc/xdg/autostart/gnome-keyring-gpg.desktop. This should be the system default. However the problem is in gnome-keyring-daemon itself, which pretends to replace gpg-agent without offering its full functionality. Btw, someone offered $100 for a solution to this problem on the ubuntu bug.
At the time that gnome-keyring's GPG agent was written it had all basically all features of the GPG 1.x gpg-agent. Then the GPG 2.x gpg-agent has grown lots of capabilities. The best solution would be to integrate the gpg2 agent with: * gnome-shell: So it puts up proper shell based dialogs. The API here would be helpful for that: https://developer.gnome.org/gcr/stable/prompts.html * libsecret: So people can optionally store their GPG password. See API and examples here: https://developer.gnome.org/libsecret/0.18/ Once this is done we can remove the gnome-keyring GPG agent.
This must be developed with cooperation with upstream. Unfortunately we do not have spare capacity to work on this currently.
In the meantime, I reckon it would be reasonable to disable the GPG agent in gnome-keyring by default.
Well, just disabling the PKCS#11 component of gnome-keyring is unforunately not sufficient. It's actually the GPG component that needs to be disabled, because it is the one that sets GPG_AGENT_INFO in the environment. This causes pain because gnome-keyring works well with GPG, but if S/MIME is supposed to work, too, both need to be disabled.
Here is a short HOWTO for people like me who would like to have both GPG and S/MIME agent functionality working in the GNOME desktop. The idea is to use gpg-agent instead of gnome-keyring-daemon for serving PGP and S/MIME pass phrases. It's kind of complex because setting an environment variable in the GNOME session requires a dbus call. But it works for me. 1. Create a shell script as follows: cat >$HOME/bin/gpg-agent-gnome <<\EOF #! /bin/bash [ -z "$GPG_AGENT_INFO" ] || { echo $0: GPG_AGENT_INFO is already set >&2 exit 0 } eval $(/usr/bin/gpg-agent --daemon) [ -z "$GPG_AGENT_INFO" ] && { echo $0: gpg-agent failed to start exit 1 } echo setting GPG_AGENT_INFO=$GPG_AGENT_INFO in dbus environment >&2 dbus-send --print-reply --session \ --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Setenv \ string:GPG_AGENT_INFO string:"$GPG_AGENT_INFO" >&2 EOF 2. Disable the "GPG Password Agent" autostart component using gnome-session-properties or gnome-tweak-tool. 3. Still in gnome-session-properties or gnome-tweak-tool, add a new autostart component that runs the shell script $HOME/bin/gpg-agent-gnome which you created in step 1. 4. Look for the just created .desktop file in $HOME/.config/autostart, probably called $HOME/.config/autostart/gpg-agent-gnome. Open it in an editor and insert the line X-GNOME-Autostart-Phase=Initialization 5. Log out and re-login. Check that gpg-agent is running and that you see GPG_AGENT_INFO in your environment.
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Judging from comment #4, this hasn't been solved in F21.
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Judging from comment #4, this hasn't been solved in F23.
Moving to rawhide so it does not get autoclosed. However I am not sure it is worth it to keep this bug open forever here as I do not have capacity to work on proper integration of gnupg2's gpg-agent to Gnome. It really needs to be implemented by someone who has the interest and capacity in the GnuPG upstream.
GNOME 3.18 has removed the incomplete GPG component from gnome-keyring-daemon, and pinentry now has a pinentry-gnome3 component that provides the look and feel of the older gnome-keyring-daemon gpg-agent. I used to use the script in comment 7. Right now it shows "GPG_AGENT_INFO is already set", but I'm not sure who is starting the agent. In any case, I think this bug can be closed.
OK, thanks for the update