gpg-agent ignores preset passphrase

Kiss Gabor (Bitman) kissg at ssg.ki.iif.hu
Fri Aug 22 15:49:32 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I tried to use "preset passphrase" feature but it does not work.
> Log shows that gpg-agent seemingly receives passphrase but later
> when agent should use the cached passphrase it ask for it again
> from pinentry.

> 2008-07-14 11:10:00 gpg-agent[30442] DBG: agent_get_cache `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'...
> 2008-07-14 11:10:00 gpg-agent[30442] DBG: ... miss
> 2008-07-14 11:10:00 gpg-agent[30442] starting a new PIN Entry
> 2008-07-14 11:10:00 gpg-agent[30442] DBG: connection to PIN entry established

(Full text in the archive
http://www.mail-archive.com/gnupg-users@gnupg.org/msg08722.html)

Now I started to debug gpg-agent.

I don't know why but now there is a minor difference in the log output:

gpg-agent[21153.7] DBG: <- PRESET_PASSPHRASE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -1 xxxxxxxxxxxxxxxxxxxxxxxxxx
2008-08-22 15:26:53 gpg-agent[21153] DBG: agent_put_cache `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' requested ttl=-1 mode=1
gpg-agent[21153.7] DBG: -> OK
gpg-agent[21153.7] DBG: <- [EOF]
...
2008-08-22 15:27:21 gpg-agent[21153] DBG: agent_get_cache `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'...
2008-08-22 15:27:21 gpg-agent[21153] DBG: ... hit
2008-08-22 15:27:21 gpg-agent[21153] starting a new PIN Entry

I.e. "miss" is changed to "hit". However a new pinentry popup window
appears yet.

Putting some additional log_debug() statements in the code I found that
the critical part is function findkey.c:unprotect().
It retrieves cached passphrase successfully but a few lines below
it calls agent_askpin() unconditionally.

Why does this happen? Could somebody explain me?
And how should I use gpg-preset-passphrase?

Thanks

Gabor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFIrsPzd2oiOrtquzgRAuTTAJ95WySkxvgUDrdpWRv+I3DjNFuLWwCfTFoI
rW/BQsteoObJ4Kh2Uk1NG2c=
=JJWU
-----END PGP SIGNATURE-----




More information about the Gnupg-users mailing list