Page MenuHome GnuPG

gpg-preset-passphrase fails to work with gpg1
Closed, ResolvedPublic

Description

in https://bugs.debian.org/820676, David Bremner writes:

The attach test script seems to work OK with GPG=gpg2, but fails with
GPG=gpg; here fails means invokes pinentry.
It looks like the passphrase presetting fails with gpg1

Is it possible that passphrase presets only work for keys that are stored in
private-keys-v1.d/ ? if so, do we need to document this somehow?

Details

Version
1.4.20

Event Timeline

gpg1 does not known about keygrips. Instead of the keygrip, gpg1 uses the
fingerprint as cacheid for gpg-agent. The agent's command GET_PASSPHRAE, as
used by gpg1, uses a different cache mode from what gpg-preset-passphrases uses.
Thus even if you replace the keygrip with the fingerprint of the (sub)key, it
won't work.

I'll add

Note, that the tool @command{gpg-preset-passphrase}, which comes
with GnuPG-2, cannot be used to preset a passphrase for this
version of GnuPG.

to the gpg 1 man page.

Thanks for the explanation, Werner.

This note might also be worth adding to the gpg-preset-passphrase manpage.

marcus claimed this task.
marcus added a subscriber: marcus.

I added a note to gpg-preset-passphrase in 877a321d011deb3e8501aa9cc5e9f9cd0b19dddf.