Bug 303779

Summary: GPG Agent: "expire cached PINs after N seconds" doesn't efficient
Product: [Applications] kmail2 Reporter: Pal Körössy <korossy>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: montel, winter
Priority: NOR    
Version: 4.8.4   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Pal Körössy 2012-07-19 09:06:54 UTC
I want the outgoing messages to be signed automatically, so 'Sign messages automatically' option is enabled in KMail's Settings/Configure_Kmail/Security/Composing section.
In Settings/Configure_Kmail/Security/GnuPG_settings/GPG_Agent/Expire_Cached_Pins_after_N_second option is set to 260000 (over 3 days) and it is not honoured, after a few hours (in less then one day) I'm prompted again to type the GPG PIN, even if the machine is not rebooted or restrarted.


Reproducible: Always

Steps to Reproduce:
1. Set 'Expire_Cached_Pins_after_N_second' option large enough in KMails settings
2. Activate 'Sign messages automatically' option in KMails settings
3. 
Actual Results:  
GPG PIN is re-requested to type before the 'Expire_Cached_Pins_after_N_second' time elapses.

Expected Results:  
No PIN re-request before the 'Expire_Cached_Pins_after_N_second' time elapses.
Comment 1 Allen Winter 2012-07-19 15:48:54 UTC
Look in ~/.gnupg/gpg-agent.conf

do you see a line with default-cache-ttl 260000
Comment 2 Allen Winter 2012-07-20 00:26:53 UTC
I read that if you want to set a timeout larger than 2 hrs (7200) then you must also set max-cache-ttl

so to test that, could you please edit .gnupg/gpg-agent.conf by hand and make sure you have the 2 lines:
default-cache-ttl 260000
max-cache-ttl 260000

hopefully the default-cache-ttl line is already there.

you may have to restart gpg after you edit that file, I don't recall.
at worst, just logout and back in again.
Comment 3 Laurent Montel 2012-07-21 07:37:19 UTC
Wait for infos
Comment 4 Pal Körössy 2012-07-24 09:40:16 UTC
There was no 'default-cache-ttl' line in .gnupg/gpg-agent.conf by default.
After adding the parameter, it seems to work, thanks.