head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.30 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.28 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.26 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.24 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.22 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.20 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.18 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.16 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.14 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.12 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.10 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.8 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.6 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.4 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.2 pkgsrc-2006Q4-base:1.2; locks; strict; comment @# @; 1.2 date 2006.11.17.15.19.39; author shannonjr; state dead; branches; next 1.1; 1.1 date 2006.10.20.15.23.58; author shannonjr; state Exp; branches; next ; desc @@ 1.2 log @Removing gnupg-devel. It has been replaced by gnupg2. @ text @$NetBSD: patch-ae,v 1.1 2006/10/20 15:23:58 shannonjr Exp $ --- agent/findkey.c.orig 2006-10-20 05:29:57.000000000 -0600 +++ agent/findkey.c @@@@ -30,6 +30,7 @@@@ #include #include #include +#include /* (we use pth_sleep) */ #include "agent.h" @@@@ -41,7 +42,7 @@@@ struct try_unprotect_arg_s { /* Write an S-expression formatted key to our key storage. With FORCE - pased as true an existsing key with the given GRIP will get + pased as true an existing key with the given GRIP will get overwritten. */ int agent_write_private_key (const unsigned char *grip, @@@@ -253,6 +254,7 @@@@ unprotect (ctrl_t ctrl, const char *desc void *cache_marker; const char *pw; + retry: pw = agent_get_cache (hexgrip, cache_mode, &cache_marker); if (pw) { @@@@ -266,6 +268,29 @@@@ unprotect (ctrl_t ctrl, const char *desc } rc = 0; } + + /* If the pinentry is currently in use, we wait up to 60 seconds + for it close and check the cache again. This solves a common + situation where several requests for unprotecting a key have + been made but the user is still entering the passphrase for + the first request. Because all requests to agent_askpin are + serialized they would then pop up one after the other to + request the passphrase - despite that the user has already + entered it and is then available in the cache. This + implementation is not race free but in the worst case the + user has to enter the passphrase only once more. */ + if (pinentry_active_p (ctrl, 0)) + { + /* Active - wait */ + if (!pinentry_active_p (ctrl, 60)) + { + /* We need to give the other thread a chance to actually put + it into the cache. */ + pth_sleep (1); + goto retry; + } + /* Timeout - better call pinentry now the plain way. */ + } } pi = gcry_calloc_secure (1, sizeof (*pi) + 100); @ 1.1 log @Re: pkg/34856: upgrade to GnuPG 1.9.93 This release is mainly to fix bugs found in 1.9.92. @ text @d1 1 a1 1 $NetBSD$ @