Red Hat Bugzilla – Bug 1231229
gpg --gen-key fails if pinentry GUI is not installed.
Last modified: 2016-11-03 21:04:56 EDT
+++ This bug was initially created as a clone of Bug #662770 +++ This has been fixed in RHEL-6 and manifests in RHEL-7 with the version pinentry-0.8.1-14.el7. For QE: A testcase already exists that tests this. Description of problem: gpg --gen-key fails if pinentry GUI is not installed. Version-Release number of selected component (if applicable): RHEL 6 beta 2 gnupg2-2.0.14-3.el6.i686 pinentry-0.7.6-5.el6.i686 How reproducible: Always Steps to Reproduce: 1. yum erase pinentry-gtk 'pinentry-qt*' 2. gpg --gen-key Actual results: [jlaughlin@rtukickstart www]$ gpg --gen-key gpg (GnuPG) 2.0.14; Copyright (C) 2009 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y GnuPG needs to construct a user ID to identify your key. Real name: foobar Email address: foobar Not a valid email address Email address: foo@bar.com Comment: You selected this USER-ID: "foobar <foo@bar.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. can't connect to `/home/jlaughlin/.gnupg/S.gpg-agent': No such file or directory /usr/bin/pinentry: line 22: xprop: command not found Please install pinentry-gui gpg-agent[17004]: can't connect server: ec=4.16383 gpg-agent[17004]: can't connect to the PIN entry module: End of file gpg-agent[17004]: command get_passphrase failed: No pinentry gpg: problem with the agent: No pinentry gpg: Key generation canceled. [jlaughlin@rtukickstart www]$ Expected results: Key generation. Additional info: It does work if I install pinentry-gtk.
Hi Martin, this should already be partially fixed in rhel 7 but it would be nice to get the improved version of the pinentry script into rhel 7. Please qa_ack the bz (or propose it for fasttrack + qa_ack) if you want this fully fixed in rhel 7.2 and have the capacity to test the bz and errata. -Boris
Aiming at 7.3 together with bz1058972 , fasttrack should be ok, here, too.
It's mind-boggling to me that this issue has been known about for so long and yet remains unfixed. Note that it's not just gpg --gen-key that fails; AFAICT, any gpg command that requests a passphrase through gpg-agent (symmetric encryption, decryption, signing) also fails. That's a real bummer to run into on a minimal install.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2226.html