Page MenuHome GnuPG

gpg-agent not caching the passphrase
Open, LowPublic

Description

In the following testcase the gpg-agent asks for the passphrase multiple times.
I would expect to enter the passphrase only once on key generation (plus the passphrase confirmation)

export GNUPGHOME=/tmp/bla

rm -rf $GNUPGHOME && mkdir -p $GNUPGHOME && chmod 700 $GNUPGHOME
pkill -f gpg-agent
echo $GPG_TTY

MAIN=$(gpg --quick-gen-key --status-fd=1 \
  "foo@gmail.com" \
  rsa4096 cert,sign never \
  | awk '$1=="[GNUPG:]" && $2=="KEY_CREATED" { print $4 }')

gpg --quick-add-uid $MAIN "bla@gmail.com"
gpg --quick-add-uid $MAIN "blub@gmail.com"
gpg --quick-add-key $MAIN rsa4096 sign 2y
gpg --quick-add-key $MAIN rsa4096 encrypt 2y

Which gives

/dev/ttys001
gpg: keybox '/tmp/bla/pubring.kbx' created
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: /tmp/bla/trustdb.gpg: trustdb created
gpg: key 0E621B1AB2961B09 marked as ultimately trusted
gpg: directory '/tmp/bla/openpgp-revocs.d' created
gpg: revocation certificate stored as '/tmp/bla/openpgp-revocs.d/E48BA20F112326257DDAE6090E621B1AB2961B09.rev'
public and secret key created and signed.

Note that this key cannot be used for encryption.  You may want to use
the command "--edit-key" to generate a subkey for this purpose.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

I am pretty sure this will be just a user error - but for the love of it I could not figure it out by reading the man pages. So in the end this might be just a request to improve the documentation.

Details

Version
2.2.9

Event Timeline

werner added a project: Documentation.

@werner Given you filed it as low priority and documentation - could you give feedback on whether that is expected behaviour or not?