Bug 1231229

Summary: gpg --gen-key fails if pinentry GUI is not installed.
Product: Red Hat Enterprise Linux 7 Reporter: Martin Žember <mzember>
Component: pinentryAssignee: Boris Ranto <branto>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: ebenes, lmiksik, rsawhill, tmraz
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pinentry-0.8.1-15.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 662770 Environment:
Last Closed: 2016-11-04 01:04:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203710, 1289025, 1295829, 1313485    

Description Martin Žember 2015-06-12 13:09:07 UTC
+++ 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    
Comment:                      
You selected this USER-ID:    
    "foobar <foo>"    
                              
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.

Comment 1 Boris Ranto 2015-07-01 12:20:56 UTC
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

Comment 3 Boris Ranto 2015-08-27 15:31:28 UTC
Aiming at 7.3 together with bz1058972 , fasttrack should be ok, here, too.

Comment 4 Ryan Sawhill 2016-01-19 21:19:55 UTC
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.

Comment 10 errata-xmlrpc 2016-11-04 01:04:56 UTC
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