Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gpg-agent's cache time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Wed Oct 27, 2004 4:48 pm    Post subject: gpg-agent's cache time Reply with quote

It seems no one has noticed that gpg-agent will only keep a valid password for up to one hour, regardless of how long you specify the default-cache-ttl in your .gnupg/gpg-agent.conf flle.

I did some investigating. The gpg-agent code is found in the older newpg package and the newer gnupg-1.9.10 package within the subdirectory agent. If you look in the file cache.c you will see a function called
Code:
static void
housekeeping (void)
{ .... }


Within the housekeeping function you will see
Code:
  /* 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.  We do this every hour */
  for (r=thecache; r; r = r->next)
    {
      if (!r->lockcount && r->pw && r->created + 60*60 < current)
        {
          if (DBG_CACHE)
            log_debug ("  expired `%s' (1h after creation)\n", r->key);
          release_data (r->pw);
          r->pw = NULL;
          r->accessed = current;
        }
    }


The purpose of this code is to expire your password after it is 1 hour old. This section of code is only executed when the housekeeping function is called, and then all it does is check the age of your password. If the age is greater than 1 hour, the password is removed, causing you to have to reenter it the next time it is needed. I have removed this section of code and setting default-cache-ttl above one hour works now. :)

What is the purpose of creating the user definable option default-cache-ttl if the max time limit is hard coded to 1 hour? Why should such a time limit be forced upon you? If it is such an unsafe practice to keep your password cached longer than one hour, then what about other applications like Kopete that cache your password indefinitely while they remain open?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum