From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.help Subject: Re: Stop emacs caching gpg keys Date: Sat, 30 Jan 2021 18:14:18 +0100 Message-ID: <20210130171418.GF8430@no.workgroup> References: <87y2gasafq.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6386"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 30 18:15:03 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5tpv-0001Yf-Pd for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 18:15:03 +0100 Original-Received: from localhost ([::1]:40726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5tpu-0003gL-RK for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 12:15:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5tpN-0003dx-5h for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 12:14:29 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:60001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5tpK-0000g8-M8 for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 12:14:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612026863; bh=+2Jz5dAPevhz3cGsm2CX/ZKiMNBzMymWnjn4YbfYtVE=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=ZieJ7gExtju2EfuoV77Qn9k9RmnRx5Uu0TzPtEXLoC5H7CFnow1vBooY00ZiZ1PZv zLVnfedVTvSCk3kY4cfwFKzCbwLDZDiuSdwQJKuCepzow23fFxWMr8IPEdaw8qSMKH pvpOcl82ufAXde+m3jeM/Uhm+2AYd0pDa27+kCBs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from no.workgroup ([84.185.97.253]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MkHQh-1lpj1S1pOL-00kdD3 for ; Sat, 30 Jan 2021 18:14:23 +0100 Mail-Followup-To: help-gnu-emacs Content-Disposition: inline In-Reply-To: <87y2gasafq.fsf@yandex.com> X-Provags-ID: V03:K1:AXHiNgnWuub8S3ls4FoML0mEvyLU1hp1RU/wjVMQjLSvykmbxUm XTaoTdwFMAq0dbXGnZrTewOdup6qdydKkIvt4JfyDqJwu++uWBFbqUYrKuB0Y1gXGUFr+Nz Ou9IPUunqDLHReBCXXIaimH6sXcnEG0OVMIEGjo4TU2KSvDfAOk9K3cx/M4HshSVuMboZXR NfAIFKxndoTlnUUPHTeBg== X-UI-Out-Filterresults: notjunk:1;V03:K0:VsQNRI2Z/TY=:AQpmB1aa52A6H5LU0u0PmR cJ4nlu6TdErxzELdLe62ugkG22Ro9hTMQJ6r5frAXb4BoXYekEL+AcQ4FsJ+DpoRLWFbTSWut +Sb4kunfJJFN6cTSCESOaY0MijXDYUXVxiXb3rq0BSMaTGByENgLeAkw70mdHbjcvy88m5gW4 JVii81nVju485DplRxUOC/JUC4g6J4pEYBCtU3IXDTtKmlWoX+gCOacA4RruwFYbHFpeqqIqj MXId/uLIz8oZ6KiTxuLelBb9nkQLL2JSdh0Kmu4rgy2m1anbX+shYqVkAKMadCYxrtq+wQ5DH E1S2T0KHh+ywGkmuQlPKTS154iIYt4jFgodjredQNd/p+LU6+1E87FMkfHT9zLjx7dyQwEyDF 29TbqrDAz2y94mwU6ZkCWL4MvAVJLHVVddhl5Ub01TEa61IjiXk5Vwb54rvL6ASEcHwREddWi JdtbRbKgkTocDyRMwjXDoRuMJ+o2G4L75c8hAgRadqhmBdTYbLTsaK+0mk/+0TyhgjDwXwoPX ViF15f+v+vYGkAOOFhKj6y14NDMcOCQSWCIvqMLEBh4zWieSlTQXyxgEQcox/On+TJ/ehY9tH uvkU/1gQ+b/ZAy+fyD3pg+W42vwavsby9zh5c3UKY3zcEdGS1yvFB6+9NcRx+KhwoK0Xtz6IE lOHilfL8QCmyYCEEKjtLkHWkmgPjQNlQQCSEEfW6RTX9BhDlyn3IlF7/wH+Ew4FJXnv0ZrlGP 4a92U164zibj4grY68UuissysCiqYMAstfqqBL5ZZEcFjMeGy3I3WCYZ+luOdVSPbbQZnx5k Received-SPF: pass client-ip=212.227.15.15; envelope-from=telegraph@gmx.net; helo=mout.gmx.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127457 Archived-At: Hi Colin, * Colin Baxter [30. Jan. 2021]: > I have GnuPG (gpg) version 2.1.18. As is well known, this version of gpg > has the utterly annoying habit of storing gpg keys in the cache for some > time (1 hour default, I think). > > To stop this happening I run 'gpgconf --kill gpg-agent'. This works fine > in bash scripts that control the encryption, where I can put that > command in the script. wouldn't it be easyier to configure gpg-agent: =2D-default-cache-ttl n Set the time a cache entry is valid to n seconds. The default is 600 seconds. Each time a cache entry is accessed, the en=E2=80=90 try's timer is reset. To set an entry's maximum lifetime, use max-cache-ttl. Note that a cached passphrase may not evicted immediately from memory if no client requests a cache opera=E2=80=90 tion. This is due to an internal housekeeping function which is only run every few seconds. =2D-max-cache-ttl n Set the maximum time a cache entry is valid to n seconds. Af=E2=80=90 ter this time a cache entry will be expired even if it has been accessed recently or has been set using gpg-preset- passphrase. The default is 2 hours (7200 seconds). Therefore I have this configuration: ~/.gnupg$ cat gpg-agent.conf default-cache-ttl 300 max-cache-ttl 1200 Ciao, Gregor =2D- -... --- .-. . -.. ..--.. ...-.-