Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1058372 - gnome-keyring-daemon breaks gpg2 signing
gnome-keyring-daemon breaks gpg2 signing
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gnupg2 (Show other bugs)
rawhide
All Linux
unspecified Severity high
: ---
: ---
Assigned To: Tomas Mraz
Fedora Extras Quality Assurance
: FutureFeature, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-27 11:34 EST by Martin Wilck
Modified: 2016-03-23 07:42 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-23 07:42:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Wilck 2014-01-27 11:34:14 EST
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@fujitsu-siemens.com
[...] 

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.
Comment 1 Martin Wilck 2014-01-27 11:41:19 EST
Similar bug: https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/884856
Comment 2 Martin Wilck 2014-01-27 11:55:00 EST
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.
Comment 3 Stef Walter 2014-08-05 01:33:51 EDT
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.
Comment 4 Tomas Mraz 2014-08-05 05:40:54 EDT
This must be developed with cooperation with upstream. Unfortunately we do not have spare capacity to work on this currently.
Comment 5 Martin Wilck 2014-08-05 05:42:52 EDT
In the meantime, I reckon it would be reasonable to disable the GPG agent in gnome-keyring by default.
Comment 6 Martin Wilck 2014-10-14 04:58:05 EDT
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.
Comment 7 Martin Wilck 2014-10-14 05:16:33 EDT
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.
Comment 8 Fedora End Of Life 2015-01-09 16:08:55 EST
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.
Comment 9 Martin Wilck 2015-01-12 05:59:40 EST
Judging from comment #4, this hasn't been solved in F21.
Comment 10 Fedora End Of Life 2015-11-04 05:26:27 EST
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.
Comment 11 Fedora End Of Life 2015-12-01 22:07:36 EST
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.
Comment 12 Martin Wilck 2015-12-02 07:42:40 EST
Judging from comment #4, this hasn't been solved in F23.
Comment 13 Tomas Mraz 2015-12-02 08:05:33 EST
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.
Comment 14 Paolo Bonzini 2016-03-23 06:33:10 EDT
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.
Comment 15 Rex Dieter 2016-03-23 07:42:17 EDT
OK, thanks for the update

Note You need to log in before you can comment on or make changes to this bug.