This commit is contained in:
Werner Koch 2006-10-19 14:22:06 +00:00
parent 0f49adb44e
commit df52700f5c
41 changed files with 6137 additions and 6033 deletions

View File

@ -1,3 +1,8 @@
2006-10-18 Werner Koch <wk@g10code.com>
* configure.ac: svn revison magic fixes for old bashs. Suggested
by Alain Guibert.
2006-10-18 Werner Koch <wk@g10code.com>
Released 1.9.93.

4
NEWS
View File

@ -1,3 +1,7 @@
Noteworthy changes in version 1.9.94
-------------------------------------------------
Noteworthy changes in version 1.9.93 (2006-10-18)
-------------------------------------------------

2
THANKS
View File

@ -5,6 +5,7 @@ complete and free of errors.
Adam Mitchell adam at cafe21.org
Alain Guibert alguibert+gpd at free.fr
Albert Chin china at thewrittenword.com
Alec Habig habig at budoe2.bu.edu
Alexander Belopolsky belopolsky at mac.com
@ -15,6 +16,7 @@ Andrew J. Schorr aschorr at telemetry-investments.com
Anthony Carrico acarrico at memebeam.org
Anthony Mulcahy anthony at kcn.ne.jp
Ariel T Glenn ariel at columbia.edu
ARIGA Seiji ariga at os.rim.or.jp
Bernhard Herzog bh at intevation.de
Bernhard Reiter bernhard de intevation.de
Bob Dunlop bob at xyzzy.org.uk

View File

@ -1,3 +1,9 @@
2006-10-19 Werner Koch <wk@g10code.com>
* findkey.c (unprotect): Use it to avoid unnecessary calls to
agent_askpin.
* call-pinentry.c (pinentry_active_p): New.
2006-10-17 Werner Koch <wk@g10code.com>
* Makefile.am (gpg_agent_LDADD): Link to libcommonpth.

View File

@ -205,6 +205,7 @@ int agent_key_available (const unsigned char *grip);
void initialize_module_query (void);
void agent_query_dump_state (void);
void agent_reset_query (ctrl_t ctrl);
int pinentry_active_p (ctrl_t ctrl, int waitseconds);
int agent_askpin (ctrl_t ctrl,
const char *desc_text, const char *prompt_text,
const char *inital_errtext,

View File

@ -300,6 +300,40 @@ start_pinentry (ctrl_t ctrl)
return 0;
}
/* Returns True is the pinentry is currently active. If WAITSECONDS is
greater than zero the function will wait for this many seconds
before returning. */
int
pinentry_active_p (ctrl_t ctrl, int waitseconds)
{
if (waitseconds > 0)
{
pth_event_t evt;
int rc;
evt = pth_event (PTH_EVENT_TIME, pth_timeout (waitseconds, 0));
if (!pth_mutex_acquire (&entry_lock, 0, evt))
{
if (pth_event_occurred (evt))
rc = gpg_error (GPG_ERR_TIMEOUT);
else
rc = gpg_error (GPG_ERR_INTERNAL);
pth_event_free (evt, PTH_FREE_THIS);
return rc;
}
pth_event_free (evt, PTH_FREE_THIS);
}
else
{
if (!pth_mutex_acquire (&entry_lock, 1, NULL))
return gpg_error (GPG_ERR_LOCKED);
}
if (!pth_mutex_release (&entry_lock))
log_error ("failed to release the entry lock at %d\n", __LINE__);
return 0;
}
static int
getpin_cb (void *opaque, const void *buffer, size_t length)

View File

@ -30,6 +30,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <assert.h>
#include <pth.h> /* (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_text,
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_text,
}
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);

View File

@ -26,12 +26,12 @@ min_automake_version="1.9.3"
# Remember to change the version number immediately *after* a release.
# Set my_issvn to "yes" for non-released code. Remember to run an
# "svn up" and "autogen.sh" right before creating a distribution.
m4_define([my_version], [1.9.93])
m4_define([my_issvn], [no])
m4_define([my_version], [1.9.94])
m4_define([my_issvn], [yes])
m4_define([svn_revision], m4_esyscmd([echo -n $((svn info 2>/dev/null \
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q}')]))
m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
AC_INIT([gnupg], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
[bug-gnupg@gnupg.org])
# Set development_version to yes if the minor number is odd or you
@ -934,21 +934,21 @@ AC_CHECK_DECLS(getpagesize)
AC_FUNC_FSEEKO
AC_FUNC_VPRINTF
AC_FUNC_FORK
AC_CHECK_FUNCS([strerror stpcpy strlwr tcgetattr strtoul mmap])
AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
AC_CHECK_FUNCS([unsetenv getpwnam getpwuid fcntl ftruncate])
AC_CHECK_FUNCS([memmove gettimeofday getrusage setrlimit clock_gettime])
AC_CHECK_FUNCS([gettimeofday getrusage setrlimit clock_gettime])
AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
AC_CHECK_FUNCS([ttyname isascii memrchr rand ftello])
AC_CHECK_FUNCS([ttyname rand ftello])
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
#
# These are needed by libjnlib - fixme: we should have macros for them
# These are needed by libjnlib - fixme: we should a jnlib.m4
#
AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol])
AC_CHECK_FUNCS([timegm getrusage setrlimit stat setlocale])
AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale])
AC_CHECK_FUNCS([flockfile funlockfile fopencookie funopen])
#

View File

@ -1,3 +1,8 @@
2006-10-19 Werner Koch <wk@g10code.com>
* keygen.c (get_parameter_algo): Add special case for ELG_E which
is not supported by libgcrypt's mapping function.
2006-10-18 Werner Koch <wk@g10code.com>
* keyid.c (v3_keyid): Don't use mempcy as we need to hold the

View File

@ -1907,8 +1907,8 @@ main (int argc, char **argv )
#endif
/* Initialize the secure memory. */
gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0);
got_secmem = 1; /* FIXME: gcry_control should return an indicator. */
if (!gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0))
got_secmem = 1;
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
/* There should be no way to get to this spot while still carrying
setuid privs. Just in case, bomb out if we are. */

View File

@ -2176,6 +2176,8 @@ get_parameter_algo( struct para_data_s *para, enum para_name key )
return -1;
if( digitp( r->u.value ) )
i = atoi( r->u.value );
else if ( !strcmp ( r->u.value, "ELG-E") )
i = GCRY_PK_ELG_E;
else
i = gcry_pk_map_name (r->u.value);
if (i == PUBKEY_ALGO_RSA_E || i == PUBKEY_ALGO_RSA_S)

View File

@ -1,3 +1,7 @@
2006-10-19 Werner Koch <wk@g10code.com>
* stringhelp.c (memrchr) [!HAVE_MEMRCHR]: Provide a replacement.
2006-09-27 Werner Koch <wk@g10code.com>
* mischelp.c: New.

View File

@ -796,3 +796,15 @@ memicmp( const char *a, const char *b, size_t n )
#endif
#ifndef HAVE_MEMRCHR
void *
memrchr (const void *buffer, int c, size_t n)
{
const unsigned char *p = buffer;
for (p += n; n ; n--)
if (*--p == c)
return p;
return NULL;
}
#endif /*HAVE_MEMRCHR*/

View File

@ -95,6 +95,10 @@ char *strlwr(char *a);
#ifndef HAVE_STRICMP
# define stricmp(a,b) strcasecmp( (a), (b) )
#endif
#ifndef HAVE_MEMRCHR
void *memrchr (const void *buffer, int c, size_t n);
#endif
#ifndef HAVE_ISASCII
static inline int

446
po/be.po

File diff suppressed because it is too large Load Diff

446
po/ca.po

File diff suppressed because it is too large Load Diff

446
po/cs.po

File diff suppressed because it is too large Load Diff

446
po/da.po

File diff suppressed because it is too large Load Diff

446
po/de.po

File diff suppressed because it is too large Load Diff

446
po/el.po

File diff suppressed because it is too large Load Diff

446
po/eo.po

File diff suppressed because it is too large Load Diff

446
po/es.po

File diff suppressed because it is too large Load Diff

446
po/et.po

File diff suppressed because it is too large Load Diff

446
po/fi.po

File diff suppressed because it is too large Load Diff

446
po/fr.po

File diff suppressed because it is too large Load Diff

446
po/gl.po

File diff suppressed because it is too large Load Diff

446
po/hu.po

File diff suppressed because it is too large Load Diff

446
po/id.po

File diff suppressed because it is too large Load Diff

446
po/it.po

File diff suppressed because it is too large Load Diff

446
po/ja.po

File diff suppressed because it is too large Load Diff

446
po/nb.po

File diff suppressed because it is too large Load Diff

446
po/pl.po

File diff suppressed because it is too large Load Diff

446
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

446
po/ro.po

File diff suppressed because it is too large Load Diff

446
po/ru.po

File diff suppressed because it is too large Load Diff

446
po/sk.po

File diff suppressed because it is too large Load Diff

446
po/sv.po

File diff suppressed because it is too large Load Diff

446
po/tr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff