Description of problem:
As a part of building of custom rpm package as described here:
I was trying to generate a gpg key for signing the package.
However the command `gpg --gen-key` keeps failing at the point of passphrase request: it says "gpg: cancelled by user".
Version-Release number of selected component (if applicable):
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 Beta (Maipo)
$ rpm -q --whatprovides `which gpg`
Steps to Reproduce:
1. gpg --gen-key
$ gpg --gen-key
gpg (GnuPG) 2.0.22; Copyright (C) 2013 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? 2
DSA keys may be between 1024 and 3072 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) 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: Oleg Fayans
Email address: email@example.com
You selected this USER-ID:
"Oleg Fayans <firstname.lastname@example.org>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
gpg: cancelled by user
gpg: Key generation canceled.
Key generation should succeed
What's the output of rpm -qa | grep pinentry ?
Do you run this command in GUI session or from ssh?
And - yes, I'm running it in a ssh session.
If you do:
OK Your orders please
Does it display pin entry dialog?
Also is gpg-agent running? If you kill it, does it start when gpg2 is invoked to create the key?
1. The pin entry dialog is presented as expected.
2. gpg-agent is running. When I kill it, it automatically starts at the last step of gpg --gen-key
I tried to reproduce the problem but was unable to. GPG always generates the key for me after I enter the passphrase into the pinentry dialog twice.
I can reproduce the behaviour you reported only if I press cancel on the pinentry dialog.
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.