Page MenuHome GnuPG

preset passphrases expires after two hours
Closed, ResolvedPublic

Description

gpg-preset-passphrase(1) says:

       Passphrases set with this utility  don't  expire  unless
       the  --forget  option  is  used to explicitly clear them
       from the cache --- or gpg-agent is either  restarted  or
       reloaded  (by  sending a SIGHUP to it).

However, the passphrase seems to expire after two hours.

I think the code in housekeeping() in agent/cache.c is
to blame. The code under the following comment does not
check if the cache entry has infinite lifetime:

  /* Second, make sure that we also remove them based on the created stamp so
     that the user has to enter it from time to time. */

The enclosed untested patch might fix the problem.

(Another way to fix this problem is to document that
preset passphrases *do* adhere to the --max-cache-ttl
setting of gpg-agent.)

Tested with 2.0.17. Reading the source code, the
issue seems to be present on the master branch as well.

Details

Version
2.0.17

Related Objects