From cvs at cvs.gnupg.org Wed Nov 1 11:02:13 2006 From: cvs at cvs.gnupg.org (svn author mo) Date: Wed Nov 1 10:29:25 2006 Subject: [svn] gpgme - r1186 - trunk/doc Message-ID: Author: mo Date: 2006-11-01 11:02:12 +0100 (Wed, 01 Nov 2006) New Revision: 1186 Modified: trunk/doc/ChangeLog trunk/doc/gpgme.texi Log: 2006-11-01 Moritz Schulte * gpgme.texi (Data Buffer I/O Operations): Fixed entry for gpgme_data_seek: OFFSET is not a pointer; some s/whence/offset/. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2006-10-24 09:22:33 UTC (rev 1185) +++ trunk/doc/ChangeLog 2006-11-01 10:02:12 UTC (rev 1186) @@ -1,3 +1,8 @@ +2006-11-01 Moritz Schulte + + * gpgme.texi (Data Buffer I/O Operations): Fixed entry for + gpgme_data_seek: OFFSET is not a pointer; some s/whence/offset/. + 2006-09-25 Marcus Brinkmann * gpgme.texi (Destroying Data Buffers): Clarify that Modified: trunk/doc/gpgme.texi =================================================================== --- trunk/doc/gpgme.texi 2006-10-24 09:22:33 UTC (rev 1185) +++ trunk/doc/gpgme.texi 2006-11-01 10:02:12 UTC (rev 1186) @@ -1773,7 +1773,7 @@ error occurs. If an error occurs, @var{errno} is set. @end deftypefun -@deftypefun off_t gpgme_data_seek (@w{gpgme_data_t @var{dh}}, @w{off_t *@var{offset}}, @w{int @var{whence}}) +@deftypefun off_t gpgme_data_seek (@w{gpgme_data_t @var{dh}}, @w{off_t @var{offset}}, @w{int @var{whence}}) The function @code{gpgme_data_seek} changes the current read/write position. @@ -1782,15 +1782,15 @@ @table @code @item SEEK_SET -Specifies that @var{whence} is a count of characters from the +Specifies that @var{offset} is a count of characters from the beginning of the data object. @item SEEK_CUR -Specifies that @var{whence} is a count of characters from the current +Specifies that @var{offset} is a count of characters from the current file position. This count may be positive or negative. @item SEEK_END -Specifies that @var{whence} is a count of characters from the end of +Specifies that @var{offset} is a count of characters from the end of the data object. A negative count specifies a position within the current extent of the data object; a positive count specifies a position past the current end. If you set the position past the From cvs at cvs.gnupg.org Sun Nov 5 16:09:01 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Sun Nov 5 15:35:47 2006 Subject: [svn] GnuPG - r4323 - in trunk: . common doc g10 tests tools Message-ID: Author: wk Date: 2006-11-05 16:08:58 +0100 (Sun, 05 Nov 2006) New Revision: 4323 Modified: trunk/AUTHORS trunk/ChangeLog trunk/common/ChangeLog trunk/common/Makefile.am trunk/configure.ac trunk/doc/ChangeLog trunk/doc/faq.raw trunk/g10/ChangeLog trunk/g10/encode.c trunk/g10/gpg.c trunk/g10/keydb.h trunk/g10/options.skel trunk/g10/pkclist.c trunk/tests/ChangeLog trunk/tests/asschk.c trunk/tools/ChangeLog trunk/tools/symcryptrun.c Log: Collected fixes. Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/AUTHORS 2006-11-05 15:08:58 UTC (rev 4323) @@ -11,7 +11,7 @@ Birger Langkjer Translations [da] -Maxim Britov Translations [ru] +Maxim Britov Translations [ru] Daniel Resare Translations [sv] Per Tunedal Translations [sv] @@ -81,7 +81,7 @@ Paul Eggert (configuration macros for LFS) -Pavel I. Shajdo Translations [ru] +Pavel I. Shajdo Translations [ru] (man pages) Pedro Morais Translations [pt_PT] Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,7 @@ +2006-11-03 Werner Koch + + * configure.ac: Test for pty.h. From Gentoo. + 2006-10-24 Werner Koch Released 1.9.94. Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/common/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,8 @@ +2006-11-03 Werner Koch + + * Makefile.am (t_convert_DEPENDENCIES): Add libcommon. From + Gentoo. + 2006-10-24 Marcus Brinkmann * Makefile.am (libcommon_a_CFLAGS): Add $(LIBASSUAN_CFLAGS). Modified: trunk/common/Makefile.am =================================================================== --- trunk/common/Makefile.am 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/common/Makefile.am 2006-11-05 15:08:58 UTC (rev 4323) @@ -81,6 +81,6 @@ t_common_ldadd = ../jnlib/libjnlib.a ../common/libcommon.a ../gl/libgnu.a \ $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) -t_convert_DEPENDENCIES = convert.c +t_convert_DEPENDENCIES = convert.c libcommon.a t_convert_LDADD = $(t_common_ldadd) Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/configure.ac 2006-11-05 15:08:58 UTC (rev 4323) @@ -876,7 +876,7 @@ # AC_HEADER_STDC AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h]) -AC_CHECK_HEADERS([pwd.h inttypes.h]) +AC_CHECK_HEADERS([pty.h pwd.h inttypes.h]) # @@ -1245,7 +1245,7 @@ *** *** You need libassuan with Pth support to build this program. *** This library is for example available at -*** ftp://ftp.gnupg.org/gcrypt/alpha/libassuan/ +*** ftp://ftp.gnupg.org/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). ***]]) fi Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/doc/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,7 @@ +2006-10-30 Werner Koch + + * faq.raw: Minor corrections. + 2006-10-12 Werner Koch * Makefile.am (man_MANS): Do not install gnupg.7 due to a conflict Modified: trunk/doc/faq.raw =================================================================== --- trunk/doc/faq.raw 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/doc/faq.raw 2006-11-05 15:08:58 UTC (rev 4323) @@ -583,7 +583,9 @@ GnuPG keeps several files in a special homedir directory. These include the options file, pubring.gpg, secring.gpg, trustdb.gpg, and others. GnuPG will always create and use these files. On unices, - the homedir is usually ~/.gnupg; on Windows "C:\gnupg\". + the homedir is usually ~/.gnupg; on Windows it is name "gnupg" and + found below the user's application directory. Run the gpg and + pass the option --version to see the name of that directory. If you want to put your keyrings somewhere else, use the option: @@ -978,7 +980,7 @@ You are most likely using GnuPG 1.0.2 or older on Windows. That's feature isn't yet implemented, but it's a bug not to say it. Newer - versions issue a warning. Upgrade to 1.0.4 or newer. + versions issue a warning. Upgrade to 1.4.5 or newer. I get "gpg: waiting for lock ..." Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,18 @@ +2006-11-05 Werner Koch + + * gpg.c (main): Remove the default --require-cross-certification. + * options.skel: Enable require-cross-certification. + +2006-10-31 Werner Koch + + * pkclist.c (warn_missing_aes_from_pklist): New. + * encode.c (encrypt_filter, encode_crypt): Use it here. + +2006-10-27 Werner Koch + + * pkclist.c (warn_missing_mdc_from_pklist): New. + * encode.c (use_mdc): Use it here. + 2006-10-24 Marcus Brinkmann * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). Modified: trunk/g10/encode.c =================================================================== --- trunk/g10/encode.c 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/encode.c 2006-11-05 15:08:58 UTC (rev 4323) @@ -147,6 +147,9 @@ if (gcry_cipher_get_algo_blklen (algo) != 8) return 1; + if (opt.verbose) + warn_missing_mdc_from_pklist (pk_list); + return 0; /* No MDC */ } @@ -521,6 +524,14 @@ compliance_failure(); } } + + /* In case 3DES has been selected, print a warning if + any key does not have a preference for AES. This + should help to indentify why encrypting to several + recipients falls back to 3DES. */ + if (opt.verbose + && cfx.dek->algo == CIPHER_ALGO_3DES) + warn_missing_aes_from_pklist (pk_list); } else { if(!opt.expert && @@ -533,7 +544,7 @@ cfx.dek->algo = opt.def_cipher_algo; } - + cfx.dek->use_mdc=use_mdc(pk_list,cfx.dek->algo); /* Only do the is-file-already-compressed check if we are using a @@ -716,6 +727,14 @@ * happen if we do not have any public keys in the list */ efx->cfx.dek->algo = DEFAULT_CIPHER_ALGO; } + + /* In case 3DES has been selected, print a warning if + any key does not have a preference for AES. This + should help to indentify why encrypting to several + recipients falls back to 3DES. */ + if (opt.verbose + && efx->cfx.dek->algo == CIPHER_ALGO_3DES) + warn_missing_aes_from_pklist (efx->pk_list); } else { if(!opt.expert && Modified: trunk/g10/gpg.c =================================================================== --- trunk/g10/gpg.c 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/gpg.c 2006-11-05 15:08:58 UTC (rev 4323) @@ -1857,7 +1857,6 @@ opt.rfc2440_text=1; opt.def_sig_expire="0"; opt.def_cert_expire="0"; - opt.flags.require_cross_cert = 1; set_homedir ( default_homedir () ); /* Check whether we have a config file on the command line. */ Modified: trunk/g10/keydb.h =================================================================== --- trunk/g10/keydb.h 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/keydb.h 2006-11-05 15:08:58 UTC (rev 4323) @@ -188,6 +188,8 @@ int select_algo_from_prefs( PK_LIST pk_list, int preftype, int request, const union pref_hint *hint); int select_mdc_from_pklist (PK_LIST pk_list); +void warn_missing_mdc_from_pklist (PK_LIST pk_list); +void warn_missing_aes_from_pklist (PK_LIST pk_list); /*-- skclist.c --*/ int random_is_faked (void); Modified: trunk/g10/options.skel =================================================================== --- trunk/g10/options.skel 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/options.skel 2006-11-05 15:08:58 UTC (rev 4323) @@ -53,6 +53,15 @@ #no-escape-from-lines +# When verifying a signature made from a subkey, ensure that the cross +# certification "back signature" on the subkey is present and valid. +# This protects against a subtle attack against subkeys that can sign. +# Defaults to --no-require-cross-certification. However for new +# installations it should be enabled. + +require-cross-certification + + # If you do not use the Latin-1 (ISO-8859-1) charset, you should tell # GnuPG which is the native character set. Please check the man page # for supported character sets. This character set is only used for @@ -191,22 +200,3 @@ # Use your MIME handler to view photos: # photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG" -# Passphrase agent -# -# We support the old experimental passphrase agent protocol as well as -# the new Assuan based one (currently available in the "newpg" package -# at ftp.gnupg.org/gcrypt/alpha/aegypten/). To make use of the agent, -# you have to run an agent as daemon and use the option -# -# use-agent -# -# which tries to use the agent but will fallback to the regular mode -# if there is a problem connecting to the agent. The normal way to -# locate the agent is by looking at the environment variable -# GPG_AGENT_INFO which should have been set during gpg-agent startup. -# In certain situations the use of this variable is not possible, thus -# the option -# -# --gpg-agent-info=::1 -# -# may be used to override it. Modified: trunk/g10/pkclist.c =================================================================== --- trunk/g10/pkclist.c 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/g10/pkclist.c 2006-11-05 15:08:58 UTC (rev 4323) @@ -1328,9 +1328,10 @@ } #if 0 - log_debug("pref mask=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX\n", + log_debug("pref mask=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX (%s)\n", (ulong)mask[7], (ulong)mask[6], (ulong)mask[5], (ulong)mask[4], - (ulong)mask[3], (ulong)mask[2], (ulong)mask[1], (ulong)mask[0]); + (ulong)mask[3], (ulong)mask[2], (ulong)mask[1], (ulong)mask[0], + keystr_from_pk (pkr->pk)); #endif for(i=0; i < 8; i++ ) bits[i] &= mask[i]; @@ -1423,26 +1424,73 @@ } /* - * Select the MDC flag from the pk_list. We can only use MDC if all recipients - * support this feature + * Select the MDC flag from the pk_list. We can only use MDC if all + * recipients support this feature. */ int select_mdc_from_pklist (PK_LIST pk_list) { - PK_LIST pkr; + PK_LIST pkr; - if( !pk_list ) - return 0; + if ( !pk_list ) + return 0; + + for (pkr = pk_list; pkr; pkr = pkr->next) + { + int mdc; + + if (pkr->pk->user_id) /* selected by user ID */ + mdc = pkr->pk->user_id->flags.mdc; + else + mdc = pkr->pk->mdc_feature; + if (!mdc) + return 0; /* At least one recipient does not support it. */ + } + return 1; /* Can be used. */ +} - for (pkr = pk_list; pkr; pkr = pkr->next) { - int mdc; - if (pkr->pk->user_id) /* selected by user ID */ - mdc = pkr->pk->user_id->flags.mdc; - else - mdc = pkr->pk->mdc_feature; - if (!mdc) - return 0; /* at least one recipient does not support it */ +/* Print a warning for all keys in PK_LIST missing the MDC feature. */ +void +warn_missing_mdc_from_pklist (PK_LIST pk_list) +{ + PK_LIST pkr; + + for (pkr = pk_list; pkr; pkr = pkr->next) + { + int mdc; + + if (pkr->pk->user_id) /* selected by user ID */ + mdc = pkr->pk->user_id->flags.mdc; + else + mdc = pkr->pk->mdc_feature; + if (!mdc) + log_info (_("Note: key %s has no %s feature\n"), + keystr_from_pk (pkr->pk), "MDC"); } - return 1; /* can be used */ } + +void +warn_missing_aes_from_pklist (PK_LIST pk_list) +{ + PK_LIST pkr; + + for (pkr = pk_list; pkr; pkr = pkr->next) + { + const prefitem_t *prefs; + int i; + int gotit = 0; + + prefs = pkr->pk->user_id? pkr->pk->user_id->prefs : pkr->pk->prefs; + if (prefs) + { + for (i=0; !gotit && prefs[i].type; i++ ) + if (prefs[i].type == PREFTYPE_SYM + && prefs[i].value == CIPHER_ALGO_AES) + gotit++; + } + if (!gotit) + log_info (_("Note: key %s has no preference for %s\n"), + keystr_from_pk (pkr->pk), "AES"); + } +} Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/tests/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,7 @@ +2006-11-05 Werner Koch + + * asschk.c (read_assuan): Minor cleanups. + 2006-09-06 Marcus Brinkmann * Makefile.am (openpgp): New variable. Modified: trunk/tests/asschk.c =================================================================== --- trunk/tests/asschk.c 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/tests/asschk.c 2006-11-05 15:08:58 UTC (rev 4323) @@ -273,10 +273,12 @@ type and store that in recv_type. The function terminates on a communication error. Returns a pointer into the inputline to the first byte of the arguments. The parsing is very strict to match - excalty what we want to send. */ + exaclty what we want to send. */ static char * read_assuan (int fd) { + /* FIXME: For general robustness, the pending stuff needs to be + associated with FD. */ static char pending[MAX_LINELEN]; static size_t pending_len; size_t nleft = sizeof recv_line; @@ -296,11 +298,18 @@ pending_len = 0; } else - n = read (fd, buf, nleft); - - if (opt_verbose) + { + do + { + n = read (fd, buf, nleft); + } + while (n < 0 && errno == EINTR); + } + + if (opt_verbose && n >= 0 ) { int i; + printf ("%s: read \"", __FUNCTION__); for (i = 0; i < n; i ++) putc (buf[i], stdout); @@ -308,11 +317,7 @@ } if (n < 0) - { - if (errno == EINTR) - continue; - die ("reading fd %d failed: %s", fd, strerror (errno)); - } + die ("reading fd %d failed: %s", fd, strerror (errno)); else if (!n) die ("received incomplete line on fd %d", fd); p = buf; Modified: trunk/tools/ChangeLog =================================================================== --- trunk/tools/ChangeLog 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/tools/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) @@ -1,3 +1,8 @@ +2006-11-03 Werner Koch + + * symcryptrun.c: Include signal.h and include pth.h only if test + asserts that it exists. + 2006-10-23 Werner Koch * gpgconf-comp.c : Add --cipher-algo. Modified: trunk/tools/symcryptrun.c =================================================================== --- trunk/tools/symcryptrun.c 2006-10-24 15:01:23 UTC (rev 4322) +++ trunk/tools/symcryptrun.c 2006-11-05 15:08:58 UTC (rev 4323) @@ -69,10 +69,13 @@ #include #include #include +#include #include #include #include +#ifdef HAVE_PTY_H #include +#endif #include #include #ifdef HAVE_LOCALE_H From cvs at cvs.gnupg.org Sun Nov 5 18:56:41 2006 From: cvs at cvs.gnupg.org (svn author mo) Date: Sun Nov 5 18:23:28 2006 Subject: [svn] gcry - r1190 - in trunk: doc tests Message-ID: Author: mo Date: 2006-11-05 18:56:41 +0100 (Sun, 05 Nov 2006) New Revision: 1190 Modified: trunk/doc/ChangeLog trunk/doc/gcrypt.texi trunk/tests/Makefile.am Log: 2006-11-05 Moritz Schulte * gcrypt.texi (General public-key related Functions): Typo. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2006-10-25 18:28:49 UTC (rev 1189) +++ trunk/doc/ChangeLog 2006-11-05 17:56:41 UTC (rev 1190) @@ -1,3 +1,7 @@ +2006-11-05 Moritz Schulte + + * gcrypt.texi (General public-key related Functions): Typo. + 2006-09-19 Werner Koch * Makefile.am (online): New target. Modified: trunk/doc/gcrypt.texi =================================================================== --- trunk/doc/gcrypt.texi 2006-10-25 18:28:49 UTC (rev 1189) +++ trunk/doc/gcrypt.texi 2006-11-05 17:56:41 UTC (rev 1190) @@ -2577,11 +2577,11 @@ Return the so called "keygrip" which is the SHA-1 hash of the public key parameters expressed in a way depended on the algorithm. @var{array} -must either provide space for 20 bytes or @code{NULL;}. In the latter +must either provide space for 20 bytes or be @code{NULL}. In the latter case a newly allocated array of that size is returned. On success a pointer to the newly allocated space or to @var{array} is returned. -@code{NULL} is returned to indicate an error which is most likely an unknown -algorithm or one where a "keygrip" has not yet been defined. +@code{NULL} is returned to indicate an error which is most likely an +unknown algorithm or one where a "keygrip" has not yet been defined. The function accepts public or secret keys in @var{key}. @end deftypefun Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2006-10-25 18:28:49 UTC (rev 1189) +++ trunk/tests/Makefile.am 2006-11-05 17:56:41 UTC (rev 1190) @@ -19,8 +19,14 @@ ## Process this file with automake to produce Makefile.in TESTS = t-mpi-bit prime register ac ac-schemes ac-data basic \ - tsexp keygen pubkey benchmark pkbench hmac keygrip + tsexp keygen pubkey benchmark pkbench hmac keygrip \ + gcryctl-m-guard gcryctl-secure-prng gcryctl-thread-cbs \ + random-daemon +# full + +XFAIL_TESTS = gryctl-m-guard + INCLUDES = -I$(top_srcdir)/src LDADD = ../src/libgcrypt.la From cvs at cvs.gnupg.org Sun Nov 5 19:08:44 2006 From: cvs at cvs.gnupg.org (svn author mo) Date: Sun Nov 5 18:35:29 2006 Subject: [svn] gcry - r1191 - trunk/tests Message-ID: Author: mo Date: 2006-11-05 19:08:44 +0100 (Sun, 05 Nov 2006) New Revision: 1191 Modified: trunk/tests/Makefile.am Log: Undo last change, which was non-intentionally commited Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2006-11-05 17:56:41 UTC (rev 1190) +++ trunk/tests/Makefile.am 2006-11-05 18:08:44 UTC (rev 1191) @@ -19,14 +19,8 @@ ## Process this file with automake to produce Makefile.in TESTS = t-mpi-bit prime register ac ac-schemes ac-data basic \ - tsexp keygen pubkey benchmark pkbench hmac keygrip \ - gcryctl-m-guard gcryctl-secure-prng gcryctl-thread-cbs \ - random-daemon + tsexp keygen pubkey benchmark pkbench hmac keygrip -# full - -XFAIL_TESTS = gryctl-m-guard - INCLUDES = -I$(top_srcdir)/src LDADD = ../src/libgcrypt.la From cvs at cvs.gnupg.org Sun Nov 5 21:52:09 2006 From: cvs at cvs.gnupg.org (svn author mo) Date: Sun Nov 5 21:19:05 2006 Subject: [svn] gcry - r1192 - in trunk: cipher mpi tests Message-ID: Author: mo Date: 2006-11-05 21:52:09 +0100 (Sun, 05 Nov 2006) New Revision: 1192 Modified: trunk/cipher/ChangeLog trunk/cipher/Makefile.am trunk/mpi/ChangeLog trunk/mpi/Makefile.am trunk/tests/ChangeLog trunk/tests/Makefile.am Log: 2006-11-05 Moritz Schulte * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the new gcrypt.h is used, not the one installed in the system. 2006-11-05 Moritz Schulte * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the new gcrypt.h is used, not the one installed in the system. 2006-11-05 Moritz Schulte * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the new gcrypt.h is used, not the one installed in the system. Modified: trunk/cipher/ChangeLog =================================================================== --- trunk/cipher/ChangeLog 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/cipher/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) @@ -1,3 +1,8 @@ +2006-11-05 Moritz Schulte + + * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the + new gcrypt.h is used, not the one installed in the system. + 2006-10-25 Werner Koch * primegen.c (prime_generate_internal): Tweaked use of secure Modified: trunk/cipher/Makefile.am =================================================================== --- trunk/cipher/Makefile.am 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/cipher/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) @@ -30,7 +30,7 @@ libcipher_la_DEPENDENCIES = $(GCRYPT_MODULES) libcipher_la_LIBADD = $(GCRYPT_MODULES) -AM_CFLAGS = @GPG_ERROR_CFLAGS@ +AM_CFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ libcipher_la_SOURCES = \ cipher.c pubkey.c ac.c md.c \ Modified: trunk/mpi/ChangeLog =================================================================== --- trunk/mpi/ChangeLog 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/mpi/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) @@ -1,3 +1,8 @@ +2006-11-05 Moritz Schulte + + * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the + new gcrypt.h is used, not the one installed in the system. + 2006-10-23 Werner Koch * config.links (mpi_optional_modules): Make sure that powerpc64 is Modified: trunk/mpi/Makefile.am =================================================================== --- trunk/mpi/Makefile.am 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/mpi/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) @@ -151,7 +151,7 @@ noinst_LTLIBRARIES = libmpi.la -AM_CFLAGS = @GPG_ERROR_CFLAGS@ +AM_CFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ libmpi_la_LDFLAGS = libmpi_la_SOURCES = longlong.h \ mpi-add.c \ Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/tests/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) @@ -1,3 +1,8 @@ +2006-11-05 Moritz Schulte + + * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the + new gcrypt.h is used, not the one installed in the system. + 2006-10-17 Werner Koch * keygen.c (check_rsa_keys): Also create an 1536 bit DSA key. Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2006-11-05 18:08:44 UTC (rev 1191) +++ trunk/tests/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) @@ -27,4 +27,4 @@ EXTRA_PROGRAMS = testapi noinst_PROGRAMS = $(TESTS) -AM_CFLAGS = @GPG_ERROR_CFLAGS@ +AM_CFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ From cvs at cvs.gnupg.org Mon Nov 6 04:22:13 2006 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon Nov 6 03:48:55 2006 Subject: [svn] GnuPG - r4324 - trunk/doc Message-ID: Author: dshaw Date: 2006-11-06 04:22:13 +0100 (Mon, 06 Nov 2006) New Revision: 4324 Modified: trunk/doc/ChangeLog trunk/doc/gpg.texi Log: * gpg.texi: Reference to --s2k-count in --s2k-mode. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2006-11-05 15:08:58 UTC (rev 4323) +++ trunk/doc/ChangeLog 2006-11-06 03:22:13 UTC (rev 4324) @@ -1,3 +1,7 @@ +2006-11-05 David Shaw + + * gpg.texi: Reference to --s2k-count in --s2k-mode. + 2006-10-30 Werner Koch * faq.raw: Minor corrections. Modified: trunk/doc/gpg.texi =================================================================== --- trunk/doc/gpg.texi 2006-11-05 15:08:58 UTC (rev 4323) +++ trunk/doc/gpg.texi 2006-11-06 03:22:13 UTC (rev 4324) @@ -1864,8 +1864,8 @@ Selects how passphrases are mangled. If @code{n} is 0 a plain passphrase (which is not recommended) will be used, a 1 adds a salt to the passphrase and a 3 (the default) iterates the whole process a -couple of times. Unless @option{--rfc1991} is used, this mode is also used for -conventional encryption. +number of times (see --s2k-count). Unless @option{--rfc1991} is used, +this mode is also used for conventional encryption. @item --s2k-count @code{n} Specify how many times the passphrase mangling is repeated. This From cvs at cvs.gnupg.org Mon Nov 6 04:37:09 2006 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon Nov 6 04:03:50 2006 Subject: [svn] GnuPG - r4325 - branches/STABLE-BRANCH-1-4/keyserver Message-ID: Author: dshaw Date: 2006-11-06 04:37:08 +0100 (Mon, 06 Nov 2006) New Revision: 4325 Modified: branches/STABLE-BRANCH-1-4/keyserver/ChangeLog branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c Log: * gpgkeys_hkp.c (curl_mrindex_writer): Revert previous change. Key-not-found still has a HTML response. Modified: branches/STABLE-BRANCH-1-4/keyserver/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/keyserver/ChangeLog 2006-11-06 03:22:13 UTC (rev 4324) +++ branches/STABLE-BRANCH-1-4/keyserver/ChangeLog 2006-11-06 03:37:08 UTC (rev 4325) @@ -1,3 +1,8 @@ +2006-11-05 David Shaw + + * gpgkeys_hkp.c (curl_mrindex_writer): Revert previous change. + Key-not-found still has a HTML response. + 2006-10-19 David Shaw * gpgkeys_hkp.c (curl_mrindex_writer): Print a warning if we see Modified: branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c =================================================================== --- branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c 2006-11-06 03:22:13 UTC (rev 4324) +++ branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c 2006-11-06 03:37:08 UTC (rev 4325) @@ -1,5 +1,6 @@ /* gpgkeys_hkp.c - talk to an HKP keyserver - * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2004, 2005 + * 2006 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -68,10 +69,7 @@ with it on this side of the pipe. */ const char *buf=ptr; if(buf[0]=='<') - { - fprintf(console,"gpgkeys: unsupported response from keyserver\n"); - swallow=1; - } + swallow=1; checked=1; } From cvs at cvs.gnupg.org Mon Nov 6 04:59:02 2006 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon Nov 6 04:25:43 2006 Subject: [svn] GnuPG - r4326 - branches/STABLE-BRANCH-1-4 Message-ID: Author: dshaw Date: 2006-11-06 04:59:02 +0100 (Mon, 06 Nov 2006) New Revision: 4326 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/configure.ac Log: * configure.ac: --enable-minimal leaves out gettext and all resolver functions (SRV, PKA, & CERT). Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2006-11-06 03:37:08 UTC (rev 4325) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2006-11-06 03:59:02 UTC (rev 4326) @@ -1,3 +1,8 @@ +2006-11-05 David Shaw + + * configure.ac: --enable-minimal leaves out gettext and all + resolver functions (SRV, PKA, & CERT). + 2006-10-02 Werner Koch * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Add case for mingw32 Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2006-11-06 03:37:08 UTC (rev 4325) +++ branches/STABLE-BRANCH-1-4/configure.ac 2006-11-06 03:59:02 UTC (rev 4326) @@ -132,6 +132,8 @@ try_extensions=no +try_gettext=yes +try_dns=yes use_rsa=yes use_idea=yes use_cast5=yes @@ -148,6 +150,8 @@ AC_ARG_ENABLE(minimal, AC_HELP_STRING([--enable-minimal],[build the smallest gpg binary possible]), + try_gettext=no + try_dns=no use_rsa=no use_idea=no use_cast5=no @@ -464,7 +468,6 @@ MPI_OPT_FLAGS="" -try_gettext=yes have_dosish_system=no need_dlopen=yes case "${host}" in @@ -578,22 +581,24 @@ dnl Now try for the resolver functions so we can use DNS for SRV, PKA, dnl and CERT. -if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then - AC_ARG_ENABLE(dns-srv, - AC_HELP_STRING([--disable-dns-srv], - [disable the use of DNS SRV in HKP and HTTP]), - use_dns_srv=$enableval,use_dns_srv=yes) -fi +if test x"$try_dns" = xyes ; then + if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then + AC_ARG_ENABLE(dns-srv, + AC_HELP_STRING([--disable-dns-srv], + [disable the use of DNS SRV in HKP and HTTP]), + use_dns_srv=$enableval,use_dns_srv=yes) + fi -AC_ARG_ENABLE(dns-pka, - AC_HELP_STRING([--disable-dns-pka], - [disable the use of PKA records in DNS]), - use_dns_pka=$enableval,use_dns_pka=yes) + AC_ARG_ENABLE(dns-pka, + AC_HELP_STRING([--disable-dns-pka], + [disable the use of PKA records in DNS]), + use_dns_pka=$enableval,use_dns_pka=yes) -AC_ARG_ENABLE(dns-cert, - AC_HELP_STRING([--disable-dns-cert], - [disable the use of CERT records in DNS]), - use_dns_cert=$enableval,use_dns_cert=yes) + AC_ARG_ENABLE(dns-cert, + AC_HELP_STRING([--disable-dns-cert], + [disable the use of CERT records in DNS]), + use_dns_cert=$enableval,use_dns_cert=yes) +fi if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes || test x"$use_dns_cert" = xyes; then _dns_save_libs=$LIBS From cvs at cvs.gnupg.org Mon Nov 6 05:03:45 2006 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon Nov 6 04:30:26 2006 Subject: [svn] GnuPG - r4327 - trunk/keyserver Message-ID: Author: dshaw Date: 2006-11-06 05:03:44 +0100 (Mon, 06 Nov 2006) New Revision: 4327 Modified: trunk/keyserver/ChangeLog trunk/keyserver/gpgkeys_hkp.c Log: * gpgkeys_hkp.c (curl_mrindex_writer): Revert previous change. Key-not-found still has a HTML response. Modified: trunk/keyserver/ChangeLog =================================================================== --- trunk/keyserver/ChangeLog 2006-11-06 03:59:02 UTC (rev 4326) +++ trunk/keyserver/ChangeLog 2006-11-06 04:03:44 UTC (rev 4327) @@ -1,3 +1,8 @@ +2006-11-05 David Shaw + + * gpgkeys_hkp.c (curl_mrindex_writer): Revert previous change. + Key-not-found still has a HTML response. + 2006-10-24 Marcus Brinkmann * Makefile.am (gpg2keys_ldap_CPPFLAGS): Rename second instance to ... Modified: trunk/keyserver/gpgkeys_hkp.c =================================================================== --- trunk/keyserver/gpgkeys_hkp.c 2006-11-06 03:59:02 UTC (rev 4326) +++ trunk/keyserver/gpgkeys_hkp.c 2006-11-06 04:03:44 UTC (rev 4327) @@ -1,5 +1,6 @@ /* gpgkeys_hkp.c - talk to an HKP keyserver - * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2004, 2005 + * 2006 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -68,10 +69,7 @@ with it on this side of the pipe. */ const char *buf=ptr; if(buf[0]=='<') - { - fprintf(console,"gpgkeys: unsupported response from keyserver\n"); - swallow=1; - } + swallow=1; checked=1; } From cvs at cvs.gnupg.org Mon Nov 6 05:07:34 2006 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon Nov 6 04:34:14 2006 Subject: [svn] GnuPG - r4328 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: dshaw Date: 2006-11-06 05:07:33 +0100 (Mon, 06 Nov 2006) New Revision: 4328 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog Log: Missing changelog entry Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2006-11-06 04:03:44 UTC (rev 4327) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2006-11-06 04:07:33 UTC (rev 4328) @@ -2,6 +2,15 @@ * gpg.c (main): New command --gpgconf-list. +2006-10-12 David Shaw + + * parse-packet.c (parse_symkeyenc): Show the unpacked as well as + the packed s2k iteration count. + + * main.h, options.h, gpg.c (encode_s2k_iterations, main), + passphrase.c (hash_passphrase): Add --s2k-count option to specify + the number of s2k hash iterations. + 2006-10-06 David Shaw * keyserver.c (keyserver_spawn): Write the 16-digit keyid rather From cvs at cvs.gnupg.org Mon Nov 6 11:13:13 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon Nov 6 10:40:04 2006 Subject: [svn] GnuPG - r4330 - tags Message-ID: Author: wk Date: 2006-11-06 11:13:13 +0100 (Mon, 06 Nov 2006) New Revision: 4330 Added: tags/gnupg-1.9.95/ Log: From cvs at cvs.gnupg.org Mon Nov 6 11:26:56 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon Nov 6 10:53:37 2006 Subject: [svn] GnuPG - r4331 - trunk Message-ID: Author: wk Date: 2006-11-06 11:26:55 +0100 (Mon, 06 Nov 2006) New Revision: 4331 Modified: trunk/NEWS trunk/README trunk/configure.ac Log: post release updates Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-06 10:13:13 UTC (rev 4330) +++ trunk/NEWS 2006-11-06 10:26:55 UTC (rev 4331) @@ -1,3 +1,9 @@ +Noteworthy changes in version 2.0.0 +------------------------------------------------- + + * First stable version of a GnuPG integrating OpenPGP and S/MIME. + + Noteworthy changes in version 1.9.95 (2006-11-06) ------------------------------------------------- Modified: trunk/README =================================================================== --- trunk/README 2006-11-06 10:13:13 UTC (rev 4330) +++ trunk/README 2006-11-06 10:26:55 UTC (rev 4331) @@ -1,28 +1,22 @@ - The GNU Privacy Guard 2 - ========================= - Version 1.9.x + The GNU Privacy Guard 2 + ========================= + Version 2.0 -GnuPG 1.9 is the future version of GnuPG; it is based on the gnupg-1.4 -code and the previous newpg package. It will very soon lead to a -GnuPG 2.0 release. +GnuPG 2.0 is the stable version of GnupG integrating support for +OpenPGP and S/MIME. It does not conflict with an installed 1.4 +OpenPGP-only version. -You should use this GnuPG version if you want to use the gpg-agent or -gpgsm (the S/MIME variant of gpg). Note that the gpg-agent is also -helpful when using the standard gpg version (1.4.x). There are no -problems installing 1.4 and 1.9 alongside; in fact we suggest to do -this. - BUILD INSTRUCTIONS ================== -GnuPG 1.9 depends on the following packages: +GnuPG 2.0 depends on the following packages: libgpg-error (ftp://ftp.gnupg.org/gcrypt/libgpg-error/) libgcrypt (ftp://ftp.gnupg.org/gcrypt/libgcrypt/) libksba (ftp://ftp.gnupg.org/gcrypt/libksba/) - libassuan (ftp://ftp.gnupg.org/gcrypt/alpha/libassuan/) + libassuan (ftp://ftp.gnupg.org/gcrypt/libassuan/) You also need the pinentry package for most function of GnuPG; however it is not a build requirement. pinentry is available at Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-06 10:13:13 UTC (rev 4330) +++ trunk/configure.ac 2006-11-06 10:26:55 UTC (rev 4331) @@ -26,8 +26,8 @@ # 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.95]) -m4_define([my_issvn], [no]) +m4_define([my_version], [2.0.0]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ From cvs at cvs.gnupg.org Thu Nov 9 17:09:47 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 9 16:36:14 2006 Subject: [svn] GnuPG - r4332 - trunk/agent Message-ID: Author: wk Date: 2006-11-09 17:09:46 +0100 (Thu, 09 Nov 2006) New Revision: 4332 Modified: trunk/agent/ChangeLog trunk/agent/gpg-agent.c trunk/agent/protect-tool.c trunk/agent/trustlist.c Log: gpg-agent.c (main): In detached mode connect standard descriptors to /dev/null. Other minor fixes Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2006-11-06 10:26:55 UTC (rev 4331) +++ trunk/agent/ChangeLog 2006-11-09 16:09:46 UTC (rev 4332) @@ -1,3 +1,15 @@ +2006-11-09 Werner Koch + + * gpg-agent.c (main): In detached mode connect standard + descriptors to /dev/null. + + * trustlist.c (read_trustfiles): Make sure not to pass a zero size + to realloc as the C standards says that this behaves like free. + +2006-11-06 Werner Koch + + * protect-tool.c (my_strusage): Fixed typo. + 2006-10-23 Werner Koch * gpg-agent.c (main): New command --gpgconf-test. Modified: trunk/agent/gpg-agent.c =================================================================== --- trunk/agent/gpg-agent.c 2006-11-06 10:26:55 UTC (rev 4331) +++ trunk/agent/gpg-agent.c 2006-11-09 16:09:46 UTC (rev 4332) @@ -1007,7 +1007,16 @@ for (i=0; i <= 2; i++) { if (!log_test_fd (i) && i != fd ) - close (i); + { + if ( ! close (i) + && open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1) + { + log_error ("failed to open `%s': %s\n", + "/dev/null", strerror (errno)); + cleanup (); + exit (1); + } + } } if (setsid() == -1) { Modified: trunk/agent/protect-tool.c =================================================================== --- trunk/agent/protect-tool.c 2006-11-06 10:26:55 UTC (rev 4331) +++ trunk/agent/protect-tool.c 2006-11-09 16:09:46 UTC (rev 4332) @@ -145,7 +145,7 @@ case 1: case 40: p = _("Usage: gpg-protect-tool [options] (-h for help)\n"); break; - case 41: p = _("Syntax: gpg-protect-tool [options] [args]]\n" + case 41: p = _("Syntax: gpg-protect-tool [options] [args]\n" "Secret key maintenance tool\n"); break; Modified: trunk/agent/trustlist.c =================================================================== --- trunk/agent/trustlist.c 2006-11-06 10:26:55 UTC (rev 4331) +++ trunk/agent/trustlist.c 2006-11-09 16:09:46 UTC (rev 4332) @@ -317,8 +317,7 @@ } /* Fixme: we should drop duplicates and sort the table. */ - - ti = xtryrealloc (table, tableidx * sizeof *table); + ti = xtryrealloc (table, (tableidx?tableidx:1) * sizeof *table); if (!ti) { xfree (table); From cvs at cvs.gnupg.org Fri Nov 10 12:32:02 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri Nov 10 11:58:31 2006 Subject: [svn] GnuPG - r4333 - trunk/g10 Message-ID: Author: wk Date: 2006-11-10 12:32:00 +0100 (Fri, 10 Nov 2006) New Revision: 4333 Modified: trunk/g10/ChangeLog trunk/g10/parse-packet.c Log: Fixed that nasty 64 bit but. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2006-11-09 16:09:46 UTC (rev 4332) +++ trunk/g10/ChangeLog 2006-11-10 11:32:00 UTC (rev 4333) @@ -1,3 +1,10 @@ +2006-11-10 Werner Koch + + * parse-packet.c (mpi_read): Changed NREAD to size_t to match the + gcry_mpi-scan prototype. + (mpi_read): Fixed double increment of bytes read to correctly + detect overlong MPIs. + 2006-11-05 Werner Koch * gpg.c (main): Remove the default --require-cross-certification. Modified: trunk/g10/parse-packet.c =================================================================== --- trunk/g10/parse-packet.c 2006-11-09 16:09:46 UTC (rev 4332) +++ trunk/g10/parse-packet.c 2006-11-10 11:32:00 UTC (rev 4333) @@ -112,41 +112,41 @@ /*FIXME: Needs to be synced with gnupg14/mpi/mpicoder.c*/ int c, c1, c2, i; - unsigned int nbits, nbytes, nread=0; + unsigned int nbits, nbytes; + size_t nread; gcry_mpi_t a = NULL; byte *buf = NULL; byte *p; - if( (c = c1 = iobuf_get(inp)) == -1 ) + if ( (c = c1 = iobuf_get (inp)) == -1 ) goto leave; nbits = c << 8; - if( (c = c2 = iobuf_get(inp)) == -1 ) + if ( (c = c2 = iobuf_get (inp)) == -1 ) goto leave; nbits |= c; - if( nbits > MAX_EXTERN_MPI_BITS ) + if ( nbits > MAX_EXTERN_MPI_BITS ) { log_error("mpi too large (%u bits)\n", nbits); goto leave; } nread = 2; nbytes = (nbits+7) / 8; - buf = secure? gcry_xmalloc_secure( nbytes+2 ) : gcry_xmalloc( nbytes+2 ); + buf = secure ? gcry_xmalloc_secure (nbytes + 2) : gcry_xmalloc (nbytes + 2); p = buf; p[0] = c1; p[1] = c2; - for( i=0 ; i < nbytes; i++ ) + for ( i=0 ; i < nbytes; i++ ) { p[i+2] = iobuf_get(inp) & 0xff; nread++; } - nread += nbytes; - if( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) ) + if ( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) ) a = NULL; leave: gcry_free(buf); - if( nread > *ret_nread ) - log_bug("mpi larger than packet"); + if ( nread > *ret_nread ) + log_bug ("mpi larger than packet"); else *ret_nread = nread; return a; From cvs at cvs.gnupg.org Sat Nov 11 15:17:22 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Sat Nov 11 14:43:32 2006 Subject: [svn] GnuPG - r4334 - in trunk: . doc po tools Message-ID: Author: wk Date: 2006-11-11 15:17:09 +0100 (Sat, 11 Nov 2006) New Revision: 4334 Modified: trunk/ChangeLog trunk/NEWS trunk/README trunk/configure.ac trunk/doc/ChangeLog trunk/doc/DETAILS trunk/doc/gnupg.texi trunk/doc/instguide.texi trunk/po/ChangeLog trunk/po/be.po trunk/po/ca.po trunk/po/cs.po trunk/po/da.po trunk/po/de.po trunk/po/el.po trunk/po/eo.po trunk/po/es.po trunk/po/et.po trunk/po/fi.po trunk/po/fr.po trunk/po/gl.po trunk/po/hu.po trunk/po/id.po trunk/po/it.po trunk/po/ja.po trunk/po/nb.po trunk/po/pl.po trunk/po/pt.po trunk/po/pt_BR.po trunk/po/ro.po trunk/po/ru.po trunk/po/sk.po trunk/po/sv.po trunk/po/tr.po trunk/po/zh_CN.po trunk/po/zh_TW.po trunk/tools/mail-signed-keys Log: From cvs at cvs.gnupg.org Sat Nov 11 15:37:55 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Sat Nov 11 15:04:03 2006 Subject: [svn] GnuPG - r4335 - tags Message-ID: Author: wk Date: 2006-11-11 15:37:55 +0100 (Sat, 11 Nov 2006) New Revision: 4335 Added: tags/gnupg-2.0.0/ Log: Released. Copied: tags/gnupg-2.0.0 (from rev 4334, trunk) From cvs at cvs.gnupg.org Sat Nov 11 15:41:22 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Sat Nov 11 15:07:29 2006 Subject: [svn] GnuPG - r4336 - trunk Message-ID: Author: wk Date: 2006-11-11 15:41:22 +0100 (Sat, 11 Nov 2006) New Revision: 4336 Modified: trunk/NEWS trunk/configure.ac Log: Post release update Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-11 14:37:55 UTC (rev 4335) +++ trunk/NEWS 2006-11-11 14:41:22 UTC (rev 4336) @@ -1,3 +1,7 @@ +Noteworthy changes in version 2.0.1 +------------------------------------------------- + + Noteworthy changes in version 2.0.0 (2006-11-11) ------------------------------------------------- Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-11 14:37:55 UTC (rev 4335) +++ trunk/configure.ac 2006-11-11 14:41:22 UTC (rev 4336) @@ -26,8 +26,8 @@ # 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], [2.0.0]) -m4_define([my_issvn], [no]) +m4_define([my_version], [2.0.1]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ From cvs at cvs.gnupg.org Tue Nov 14 15:53:43 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 14 15:19:37 2006 Subject: [svn] GnuPG - r4338 - in trunk: . agent doc Message-ID: Author: wk Date: 2006-11-14 15:53:42 +0100 (Tue, 14 Nov 2006) New Revision: 4338 Modified: trunk/TODO trunk/agent/ChangeLog trunk/agent/agent.h trunk/agent/command.c trunk/agent/findkey.c trunk/agent/gpg-agent.c trunk/agent/trustlist.c trunk/doc/gpg-agent.texi Log: New command GETEVENTCOUNTER. * command.c (bump_key_eventcounter): New. (bump_card_eventcounter): New. (cmd_geteventcounter): New command. * gpg-agent.c (handle_signal): Call bump_card_eventcounter. * findkey.c (agent_write_private_key): Call bump_key_eventcounter. * trustlist.c (agent_reload_trustlist): Ditto. Modified: trunk/TODO =================================================================== --- trunk/TODO 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/TODO 2006-11-14 14:53:42 UTC (rev 4338) @@ -35,6 +35,10 @@ ** Remove the inter-module dependencies between gpgsm and keybox ** Add an source_of_key field +* agent/ +** If we detect that a private key has been deleted + Bump the key event counter. + * agent/command.c ** Make sure that secure memory is used where appropriate Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/ChangeLog 2006-11-14 14:53:42 UTC (rev 4338) @@ -1,3 +1,12 @@ +2006-11-14 Werner Koch + + * command.c (bump_key_eventcounter): New. + (bump_card_eventcounter): New. + (cmd_geteventcounter): New command. + * gpg-agent.c (handle_signal): Call bump_card_eventcounter. + * findkey.c (agent_write_private_key): Call bump_key_eventcounter. + * trustlist.c (agent_reload_trustlist): Ditto. + 2006-11-09 Werner Koch * gpg-agent.c (main): In detached mode connect standard Modified: trunk/agent/agent.h =================================================================== --- trunk/agent/agent.h 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/agent.h 2006-11-14 14:53:42 UTC (rev 4338) @@ -182,6 +182,8 @@ /*-- command.c --*/ gpg_error_t agent_write_status (ctrl_t ctrl, const char *keyword, ...); +void bump_key_eventcounter (void); +void bump_card_eventcounter (void); void start_command_handler (int, int); /*-- command-ssh.c --*/ Modified: trunk/agent/command.c =================================================================== --- trunk/agent/command.c 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/command.c 2006-11-14 14:53:42 UTC (rev 4338) @@ -73,8 +73,30 @@ static struct putval_item_s *putval_list; + +/* To help polling clients, we keep tarck of the number of certain + events. This structure keeps those counters. The counters are + integers and there should be no problem if they are overflowing as + callers need to check only whether a counter changed. The actual + values are not meaningful. */ +struct +{ + /* Incremented if any of the other counters below changed. */ + unsigned int any; + /* Incremented if a key is added or removed from the internal privat + key database. */ + unsigned int key; + /* Incremented if a change of the card readers stati has been + detected. */ + unsigned int card; + +} eventcounter; + + + + /* Release the memory buffer MB but first wipe out the used memory. */ static void @@ -293,6 +315,62 @@ +/* GETEVENTCOUNTER + + Return a a status line named EVENTCOUNTER with the current values + of all event counters. The values are decimal numbers in the range + 0 to UINT_MAX and wrapping around to 0. The actual values should + not be relied upon, they shall only be used to detect a change. + + The currently defined counters are: + + ANY - Incremented with any change of any of the other counters. + KEY - Incremented for added or removed private keys. + CARD - Incremented for changes of the card readers stati. +*/ +static int +cmd_geteventcounter (assuan_context_t ctx, char *line) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + char any_counter[25]; + char key_counter[25]; + char card_counter[25]; + + snprintf (any_counter, sizeof any_counter, "%u", eventcounter.any); + snprintf (key_counter, sizeof key_counter, "%u", eventcounter.key); + snprintf (card_counter, sizeof card_counter, "%u", eventcounter.card); + + return agent_write_status (ctrl, "EVENTCOUNTER", + any_counter, + key_counter, + card_counter, + NULL); +} + + +/* This function should be called once for all key removals or + additions. Thus function is assured not to do any context + switches. */ +void +bump_key_eventcounter (void) +{ + eventcounter.key++; + eventcounter.any++; +} + +/* This function should be called for all card reader status + changes. Thus function is assured not to do any context + switches. */ +void +bump_card_eventcounter (void) +{ + eventcounter.card++; + eventcounter.any++; +} + + + + /* ISTRUSTED Return OK when we have an entry with this fingerprint in our @@ -1281,6 +1359,7 @@ const char *name; int (*handler)(assuan_context_t, char *line); } table[] = { + { "GETEVENTCOUNTER",cmd_geteventcounter }, { "ISTRUSTED", cmd_istrusted }, { "HAVEKEY", cmd_havekey }, { "SIGKEY", cmd_sigkey }, Modified: trunk/agent/findkey.c =================================================================== --- trunk/agent/findkey.c 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/findkey.c 2006-11-14 14:53:42 UTC (rev 4338) @@ -117,7 +117,7 @@ xfree (fname); return tmperr; } - + bump_key_eventcounter (); xfree (fname); return 0; } Modified: trunk/agent/gpg-agent.c =================================================================== --- trunk/agent/gpg-agent.c 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/gpg-agent.c 2006-11-14 14:53:42 UTC (rev 4338) @@ -1400,6 +1400,8 @@ case SIGUSR2: if (opt.verbose) log_info ("SIGUSR2 received - checking smartcard status\n"); + /* Nothing to check right now. We only increment a counter. */ + bump_card_eventcounter (); break; case SIGTERM: Modified: trunk/agent/trustlist.c =================================================================== --- trunk/agent/trustlist.c 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/agent/trustlist.c 2006-11-14 14:53:42 UTC (rev 4338) @@ -574,4 +574,5 @@ trusttable = NULL; trusttablesize = 0; unlock_trusttable (); + bump_key_eventcounter (); } Modified: trunk/doc/gpg-agent.texi =================================================================== --- trunk/doc/gpg-agent.texi 2006-11-14 10:23:21 UTC (rev 4337) +++ trunk/doc/gpg-agent.texi 2006-11-14 14:53:42 UTC (rev 4338) @@ -657,6 +657,7 @@ * Agent LEARN:: Register a smartcard * Agent PASSWD:: Change a Passphrase * Agent UPDATESTARTUPTTY:: Change the Standard Display +* Agent GETEVENTCOUNTER:: Get the Event Counters @end menu @node Agent PKDECRYPT @@ -1076,6 +1077,31 @@ ssh-agent protocol to convey this information. +@node Agent GETEVENTCOUNTER +@subsection Get the Event Counters + +@example + GETEVENTCOUNTER +@end example + +This function return one status line with the current values of the +event counters. The event counters are useful to avoid polling by +delaying a poll until something has changed. The values are decimal +numbers in the range @code{0} to @code{UINT_MAX} and wrapping around to +0. The actual values should not be relied upon; they shall only be used +to detect a change. + +The currently defined counters are are: +@table @code +@item ANY +Incremented with any change of any of the other counters. +@item KEY +Incremented for added or removed private keys. +@item CARD +Incremented for changes of the card readers stati. +@end table + + @mansect see also @ifset isman @command{gpg2}(1), From cvs at cvs.gnupg.org Tue Nov 14 17:40:45 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 14 17:06:38 2006 Subject: [svn] GnuPG - r4339 - in trunk: . agent m4 Message-ID: Author: wk Date: 2006-11-14 17:40:44 +0100 (Tue, 14 Nov 2006) New Revision: 4339 Modified: trunk/ChangeLog trunk/agent/ChangeLog trunk/agent/command.c trunk/configure.ac trunk/m4/ChangeLog trunk/m4/libassuan.m4 Log: Silent GETEVENT command. Requires latest libassuan. agent/ * command.c (post_cmd_notify, io_monitor): New. (register_commands, start_command_handler): Register them. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/ChangeLog 2006-11-14 16:40:44 UTC (rev 4339) @@ -1,3 +1,7 @@ +2006-11-14 Werner Koch + + * configure.ac (HAVE_ASSUAN_SET_IO_MONITOR): Test for it. + 2006-11-11 Werner Koch Released 2.0.0. Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/agent/ChangeLog 2006-11-14 16:40:44 UTC (rev 4339) @@ -7,6 +7,9 @@ * findkey.c (agent_write_private_key): Call bump_key_eventcounter. * trustlist.c (agent_reload_trustlist): Ditto. + * command.c (post_cmd_notify, io_monitor): New. + (register_commands, start_command_handler): Register them. + 2006-11-09 Werner Koch * gpg-agent.c (main): In detached mode connect standard Modified: trunk/agent/command.c =================================================================== --- trunk/agent/command.c 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/agent/command.c 2006-11-14 16:40:44 UTC (rev 4339) @@ -56,6 +56,7 @@ int use_cache_for_signing; char *keydesc; /* Allocated description for the next key operation. */ + int pause_io_logging; /* Used to suppress I/O logging during a command */ }; @@ -1351,6 +1352,43 @@ +/* Called by libassuan after all commands. ERR is the error from the + last assuan operation and not the one returned from the command. */ +static void +post_cmd_notify (assuan_context_t ctx, int err) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + + /* Switch off any I/O monitor controlled logging pausing. */ + ctrl->server_local->pause_io_logging = 0; +} + + +/* This function is called by libassuan for all I/O. We use it here + to disable logging for the GETEVENTCOUNTER commands. This is so + that the debug output won't get cluttered by this primitive + command. */ +static unsigned int +io_monitor (assuan_context_t ctx, int direction, + const char *line, size_t linelen) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + + /* Note that we only check for the uppercase name. This allows to + see the logging for debugging if using a non-upercase command + name. */ + if (ctx && !direction + && linelen >= 15 + && !strncmp (line, "GETEVENTCOUNTER", 15) + && (linelen == 15 || spacep (line+15))) + { + ctrl->server_local->pause_io_logging = 1; + } + + return ctrl->server_local->pause_io_logging? 1:0; +} + + /* Tell the assuan library about our commands */ static int register_commands (assuan_context_t ctx) @@ -1394,6 +1432,9 @@ if (rc) return rc; } +#ifdef HAVE_ASSUAN_SET_IO_MONITOR + assuan_register_post_cmd_notify (ctx, post_cmd_notify); +#endif assuan_register_reset_notify (ctx, reset_notify); assuan_register_option_handler (ctx, option_handler); return 0; @@ -1453,6 +1494,10 @@ if (DBG_ASSUAN) assuan_set_log_stream (ctx, log_get_stream ()); +#ifdef HAVE_ASSUAN_SET_IO_MONITOR + assuan_set_io_monitor (ctx, io_monitor); +#endif + for (;;) { rc = assuan_accept (ctx); Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/configure.ac 2006-11-14 16:40:44 UTC (rev 4339) @@ -585,9 +585,13 @@ have_libassuan=no AM_PATH_LIBASSUAN_PTH("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION", have_libassuan=yes,have_libassuan=no) + AM_CHECK_LIBASSUAN("$NEED_LIBASSUAN_API:1.0.1", + [AC_DEFINE(HAVE_ASSUAN_SET_IO_MONITOR, 1, + [Define to 1 if you have the `assuan_set_io_monitor' function.])],) fi + # # libksba is our X.509 support library # @@ -945,7 +949,7 @@ AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include ]) # -# These are needed by libjnlib - fixme: we should a jnlib.m4 +# These are needed by libjnlib - fixme: we should use a jnlib.m4 # AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol]) AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale]) Modified: trunk/m4/ChangeLog =================================================================== --- trunk/m4/ChangeLog 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/m4/ChangeLog 2006-11-14 16:40:44 UTC (rev 4339) @@ -1,3 +1,7 @@ +2006-11-14 Werner Koch + + * libassuan.m4: Updated from libassuan SVN. + 2006-10-09 Werner Koch * gnupg-pth.m4: New. Taken from ../acinclude.m4. Modified: trunk/m4/libassuan.m4 =================================================================== --- trunk/m4/libassuan.m4 2006-11-14 14:53:42 UTC (rev 4338) +++ trunk/m4/libassuan.m4 2006-11-14 16:40:44 UTC (rev 4339) @@ -96,8 +96,23 @@ ]) +dnl AM_CHECK_LIBASSUAN([MINIMUM-VERSION, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) +dnl Test whether libassuan has at least MINIMUM-VERSION. This is +dnl used to test for features only available in newer versions. +dnl +AC_DEFUN([AM_CHECK_LIBASSUAN], +[ _AM_PATH_LIBASSUAN_COMMON($1) + if test $ok = yes; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi +]) + + dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS @@ -120,7 +135,7 @@ dnl AM_PATH_LIBASSUAN_PTH([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) -dnl Test for libassuan and define LIBASSUAN_PTH_CFLAGSand LIBASSUAN_PTH_LIBS +dnl Test for libassuan and define LIBASSUAN_PTH_CFLAGS and LIBASSUAN_PTH_LIBS dnl AC_DEFUN([AM_PATH_LIBASSUAN_PTH], [ _AM_PATH_LIBASSUAN_COMMON($1,pth) @@ -144,7 +159,7 @@ dnl and LIBASSUAN_PTHREAD_LIBS dnl AC_DEFUN([AM_PATH_LIBASSUAN_PTHREAD], -[ _AM_PATH_LIBASSUAN_COMMON($1,pth) +[ _AM_PATH_LIBASSUAN_COMMON($1,pthread) if test $ok = yes; then LIBASSUAN_PTHREAD_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --thread=pthread --cflags` LIBASSUAN_PTHREAD_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --thread=pthread --libs` From cvs at cvs.gnupg.org Tue Nov 14 17:56:09 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 14 17:21:58 2006 Subject: [svn] assuan - r225 - in trunk: . doc src Message-ID: Author: wk Date: 2006-11-14 17:56:07 +0100 (Tue, 14 Nov 2006) New Revision: 225 Modified: trunk/NEWS trunk/doc/assuan.texi trunk/src/ChangeLog trunk/src/assuan-buffer.c trunk/src/assuan-defs.h trunk/src/assuan-handler.c trunk/src/assuan-util.c trunk/src/assuan.h trunk/src/libassuan.m4 Log: New functions assuan_set_io_monitor and assuan_register_post_cmd_notify Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/NEWS 2006-11-14 16:56:07 UTC (rev 225) @@ -1,7 +1,11 @@ Noteworthy changes in version 1.0.1 ------------------------------------------------ + * New function: assuan_set_io_monitor. + * New function: assuan_register_post_cmd_notify. + + Noteworthy changes in version 1.0.0 (2006-10-31) ------------------------------------------------ Modified: trunk/doc/assuan.texi =================================================================== --- trunk/doc/assuan.texi 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/doc/assuan.texi 2006-11-14 16:56:07 UTC (rev 225) @@ -943,6 +943,14 @@ these commands. @end deftypefun +@deftypefun assuan_error_t assuan_register_post_cmd_notify (@w{assuan_context_t @var{ctx}}, @w{void (*@var{fnc})(assuan_context_t)}, @w{int @var{err}}) + +Register a function to be called right after a command has been +processed. @var{err} is the result code from the last internal assuan +operation and not the one returned by the handler. It may be used to +command related cleanup. +@end deftypefun + @deftypefun assuan_error_t assuan_register_bye_notify (@w{assuan_context_t @var{ctx}}, @w{void (*@var{fnc})(assuan_context_t)}) Register function @var{fnc} with context @var{ctx} to be called right @@ -1320,7 +1328,17 @@ I/O. @end deftypefun +@deftypefun void assuan_set_io_monitor (@w{assuan_context_t @var{ctx}}, @w{unsigned int} (*@var{monitor})(@w{assuan_context_t @var{ctx}}, @w{int @var{direction}}, @w{const char *@var{line}}, @w{size_t @var{linelen}})) +This function registers an I/O monitor for the context @var{ctx}. Such +a monitor function is called right after a line has been received or +just before it is send. With @var{direction} set to 1 the monitor has +been called for an output operation; 0 obviosuly means it has been +called for an input operation. If the monitor sets bit 0 in the return +value, any active logging of the line will be suppressed. With bit 1 +set, the entire line will be ignored. +@end deftypefun + @deftypefun void assuan_begin_confidential (@w{assuan_context_t @var{ctx}}) Put the logging feature into confidential mode. This is to avoid Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/ChangeLog 2006-11-14 16:56:07 UTC (rev 225) @@ -1,3 +1,15 @@ +2006-11-14 Werner Koch + + * libassuan.m4 (AM_CHECK_LIBASSUAN): New. + + * assuan-handler.c (assuan_register_post_cmd_notify) + (assuan_register_post_cmd_notify): New. + * assuan-util.c (assuan_set_io_monitor): New. + * assuan-buffer.c (_assuan_read_line): Use it. + (_assuan_write_line): Ditto. + (_assuan_cookie_write_data): Ditto. + (_assuan_cookie_write_flush): Ditto. + 2006-10-18 Werner Koch * libassuan.m4: Pass "pthread" to the common macro. Reported by Modified: trunk/src/assuan-buffer.c =================================================================== --- trunk/src/assuan-buffer.c 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/assuan-buffer.c 2006-11-14 16:56:07 UTC (rev 225) @@ -1,5 +1,5 @@ /* assuan-buffer.c - read and send data - * Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -159,7 +159,9 @@ if (endp) { + unsigned monitor_result; int n = endp - line + 1; + if (n < nread) /* LINE contains more than one line. We copy it to the attic now as handlers are allowed to modify the passed @@ -176,7 +178,16 @@ *endp = 0; ctx->inbound.linelen = endp - line; - if (ctx->log_fp) + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 0, + ctx->inbound.line, + ctx->inbound.linelen) + : 0); + if ( (monitor_result & 2) ) + ctx->inbound.linelen = 0; + + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- ", assuan_get_assuan_log_prefix (), @@ -245,6 +256,7 @@ { assuan_error_t rc = 0; size_t prefixlen = prefix? strlen (prefix):0; + unsigned int monitor_result; /* Make sure that the line is short enough. */ if (len + prefixlen + 2 > ASSUAN_LINELENGTH) @@ -260,8 +272,12 @@ len = ASSUAN_LINELENGTH - prefixlen - 2 - 1; } + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, line, len) + : 0); + /* Fixme: we should do some kind of line buffering. */ - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -277,13 +293,13 @@ putc ('\n', ctx->log_fp); } - if (prefixlen) + if (prefixlen && !(monitor_result & 2)) { rc = writen (ctx, prefix, prefixlen); if (rc) rc = _assuan_error (ASSUAN_Write_Error); } - if (!rc) + if (!rc && !(monitor_result & 2)) { rc = writen (ctx, line, len); if (rc) @@ -325,7 +341,7 @@ /* Write out the data in buffer as datalines with line wrapping and - percent escaping. This function is used for GNU's custom streams */ + percent escaping. This function is used for GNU's custom streams. */ int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t orig_size) { @@ -342,7 +358,9 @@ line += linelen; while (size) { - /* insert data line header */ + unsigned int monitor_result; + + /* Insert data line header. */ if (!linelen) { *line++ = 'D'; @@ -350,7 +368,7 @@ linelen += 2; } - /* copy data, keep some space for the CRLF and to escape one character */ + /* Copy data, keep space for the CRLF and to escape one character. */ while (size && linelen < LINELENGTH-2-2) { if (*buffer == '%' || *buffer == '\r' || *buffer == '\n') @@ -368,9 +386,15 @@ size--; } + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, + ctx->outbound.data.line, linelen) + : 0); + if (linelen >= LINELENGTH-2-2) { - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -386,7 +410,8 @@ } *line++ = '\n'; linelen++; - if (writen (ctx, ctx->outbound.data.line, linelen)) + if ( !(monitor_result & 2) + && writen (ctx, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error); return 0; @@ -409,6 +434,7 @@ assuan_context_t ctx = cookie; char *line; size_t linelen; + unsigned int monitor_result; if (ctx->outbound.data.error) return 0; @@ -416,9 +442,15 @@ line = ctx->outbound.data.line; linelen = ctx->outbound.data.linelen; line += linelen; + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, + ctx->outbound.data.line, linelen) + : 0); + if (linelen) { - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -432,7 +464,8 @@ } *line++ = '\n'; linelen++; - if (writen (ctx, ctx->outbound.data.line, linelen)) + if ( !(monitor_result & 2) + && writen (ctx, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error); return 0; Modified: trunk/src/assuan-defs.h =================================================================== --- trunk/src/assuan-defs.h 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/assuan-defs.h 2006-11-14 16:56:07 UTC (rev 225) @@ -179,6 +179,20 @@ void (*input_notify_fnc)(assuan_context_t, const char *); void (*output_notify_fnc)(assuan_context_t, const char *); + /* This function is called right after a command has been processed. + It may be used to command related cleanup. */ + void (*post_cmd_notify_fnc)(assuan_context_t, int); + + /* If set, this is called right before logging an I/O line. With + DIRECTION set to 1 it is called for an output oeration; 0 means + an input operation. If bit 0 is set in the return value, the + logging of the will be suppressed. With bit 1 set, the entire + line will be ignored. */ + unsigned int (*io_monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen); + int input_fd; /* set by INPUT command */ int output_fd; /* set by OUTPUT command */ Modified: trunk/src/assuan-handler.c =================================================================== --- trunk/src/assuan-handler.c 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/assuan-handler.c 2006-11-14 16:56:07 UTC (rev 225) @@ -292,6 +292,16 @@ } int +assuan_register_post_cmd_notify (assuan_context_t ctx, + void (*fnc)(assuan_context_t, int)) +{ + if (!ctx) + return _assuan_error (ASSUAN_Invalid_Value); + ctx->post_cmd_notify_fnc = fnc; + return 0; +} + +int assuan_register_bye_notify (assuan_context_t ctx, void (*fnc)(assuan_context_t)) { @@ -543,6 +553,9 @@ rc = assuan_write_line (ctx, errline); } + if (ctx->post_cmd_notify_fnc) + ctx->post_cmd_notify_fnc (ctx, rc); + ctx->confidential = 0; if (ctx->okay_line) { Modified: trunk/src/assuan-util.c =================================================================== --- trunk/src/assuan-util.c 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/assuan-util.c 2006-11-14 16:56:07 UTC (rev 225) @@ -125,7 +125,22 @@ } +void +assuan_set_io_monitor (assuan_context_t ctx, + unsigned int (*monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen)) +{ + if (ctx) + { + ctx->io_monitor = monitor; + } +} + + + /* For context CTX, set the flag FLAG to VALUE. Values for flags are usually 1 or 0 but certain flags might allow for other values; see the description of the type assuan_flag_t for details. */ Modified: trunk/src/assuan.h =================================================================== --- trunk/src/assuan.h 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/assuan.h 2006-11-14 16:56:07 UTC (rev 225) @@ -62,6 +62,8 @@ #define _ASSUAN_PREFIX(x) _ASSUAN_PREFIX2(_ASSUAN_EXT_SYM_PREFIX,x) #define assuan_ _ASSUAN_PREFIX(assuan_) #define assuan_register_command _ASSUAN_PREFIX(assuan_register_command) +#define assuan_register_post_cmd_notify \ + _ASSUAN_PREFIX(assuan_register_post_cmd_notify) #define assuan_register_bye_notify _ASSUAN_PREFIX(assuan_register_bye_notify) #define assuan_register_reset_notify \ _ASSUAN_PREFIX(assuan_register_reset_notify) @@ -113,6 +115,7 @@ #define assuan_set_error _ASSUAN_PREFIX(assuan_set_error) #define assuan_set_pointer _ASSUAN_PREFIX(assuan_set_pointer) #define assuan_get_pointer _ASSUAN_PREFIX(assuan_get_pointer) +#define assuan_set_io_monitor _ASSUAN_PREFIX(assuan_set_io_monitor) #define assuan_begin_confidential _ASSUAN_PREFIX(assuan_begin_confidential) #define assuan_end_confidential _ASSUAN_PREFIX(assuan_end_confidential) #define assuan_strerror _ASSUAN_PREFIX(assuan_strerror) @@ -336,6 +339,8 @@ int assuan_register_command (assuan_context_t ctx, const char *cmd_string, int (*handler)(assuan_context_t, char *)); +int assuan_register_post_cmd_notify (assuan_context_t ctx, + void (*fnc)(assuan_context_t, int)); int assuan_register_bye_notify (assuan_context_t ctx, void (*fnc)(assuan_context_t)); int assuan_register_reset_notify (assuan_context_t ctx, @@ -466,6 +471,12 @@ void assuan_begin_confidential (assuan_context_t ctx); void assuan_end_confidential (assuan_context_t ctx); +void assuan_set_io_monitor (assuan_context_t ctx, + unsigned int (*monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen)); + /* For context CTX, set the flag FLAG to VALUE. Values for flags are usually 1 or 0 but certain flags might allow for other values; see the description of the type assuan_flag_t for details. */ Modified: trunk/src/libassuan.m4 =================================================================== --- trunk/src/libassuan.m4 2006-10-31 20:10:36 UTC (rev 224) +++ trunk/src/libassuan.m4 2006-11-14 16:56:07 UTC (rev 225) @@ -96,8 +96,23 @@ ]) +dnl AM_CHECK_LIBASSUAN([MINIMUM-VERSION, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) +dnl Test whether libassuan has at least MINIMUM-VERSION. This is +dnl used to test for features only available in newer versions. +dnl +AC_DEFUN([AM_CHECK_LIBASSUAN], +[ _AM_PATH_LIBASSUAN_COMMON($1) + if test $ok = yes; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi +]) + + dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS From cvs at cvs.gnupg.org Wed Nov 15 21:33:48 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 15 20:59:36 2006 Subject: [svn] GnuPG - r4340 - trunk Message-ID: Author: wk Date: 2006-11-15 21:33:48 +0100 (Wed, 15 Nov 2006) New Revision: 4340 Removed: trunk/build-w32.sh Log: No need for thsi script. Use ./autogen.sh --build-w32 instead. Deleted: trunk/build-w32.sh From cvs at cvs.gnupg.org Fri Nov 17 11:40:48 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri Nov 17 11:06:22 2006 Subject: [svn] dirmngr - r240 - trunk/po Message-ID: Author: wk Date: 2006-11-17 11:40:47 +0100 (Fri, 17 Nov 2006) New Revision: 240 Removed: trunk/po/de.gmo Log: Removed accidently added file Deleted: trunk/po/de.gmo From cvs at cvs.gnupg.org Fri Nov 17 11:48:28 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri Nov 17 11:14:00 2006 Subject: [svn] dirmngr - r241 - tags Message-ID: Author: wk Date: 2006-11-17 11:48:27 +0100 (Fri, 17 Nov 2006) New Revision: 241 Added: tags/dirmngr-0.9.7/ Log: Released. Copied: tags/dirmngr-0.9.7 (from rev 240, trunk) From cvs at cvs.gnupg.org Sat Nov 18 20:55:37 2006 From: cvs at cvs.gnupg.org (svn author mo) Date: Sat Nov 18 20:21:16 2006 Subject: [svn] GnuPG - r4341 - tags/gnupg-2.0.0/tests/openpgp Message-ID: Author: mo Date: 2006-11-18 20:55:37 +0100 (Sat, 18 Nov 2006) New Revision: 4341 Modified: tags/gnupg-2.0.0/tests/openpgp/ChangeLog tags/gnupg-2.0.0/tests/openpgp/Makefile.am Log: 2006-11-18 Moritz Schulte * Makefile.am (plain-large): Adjust to use faq.raw instead of FAQ, since that is created during build. Modified: tags/gnupg-2.0.0/tests/openpgp/ChangeLog =================================================================== --- tags/gnupg-2.0.0/tests/openpgp/ChangeLog 2006-11-15 20:33:48 UTC (rev 4340) +++ tags/gnupg-2.0.0/tests/openpgp/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) @@ -1,3 +1,8 @@ +2006-11-18 Moritz Schulte + + * Makefile.am (plain-large): Adjust to use faq.raw instead of FAQ, + since that is created during build. + 2006-10-04 Werner Koch * signencrypt.test: Need to prepend srcdir to the file name Modified: tags/gnupg-2.0.0/tests/openpgp/Makefile.am =================================================================== --- tags/gnupg-2.0.0/tests/openpgp/Makefile.am 2006-11-15 20:33:48 UTC (rev 4340) +++ tags/gnupg-2.0.0/tests/openpgp/Makefile.am 2006-11-18 19:55:37 UTC (rev 4341) @@ -100,7 +100,7 @@ plain-large: cat $(srcdir)/../../doc/HACKING \ $(srcdir)/../../doc/DETAILS \ - $(srcdir)/../../doc/FAQ >plain-large + $(srcdir)/../../doc/faq.raw > plain-large # To speed up key generation we create a dummy random seed file random_seed: From cvs at cvs.gnupg.org Mon Nov 20 17:49:46 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon Nov 20 17:15:14 2006 Subject: [svn] GnuPG - r4342 - in trunk: . agent common jnlib kbx m4 scd tests/openpgp tools Message-ID: Author: wk Date: 2006-11-20 17:49:41 +0100 (Mon, 20 Nov 2006) New Revision: 4342 Modified: trunk/ChangeLog trunk/Makefile.am trunk/NEWS trunk/THANKS trunk/agent/ChangeLog trunk/agent/agent.h trunk/agent/call-pinentry.c trunk/agent/call-scd.c trunk/agent/command-ssh.c trunk/agent/command.c trunk/agent/gpg-agent.c trunk/agent/minip12.c trunk/agent/protect.c trunk/autogen.sh trunk/common/ChangeLog trunk/common/estream.c trunk/common/iobuf.c trunk/jnlib/ChangeLog trunk/jnlib/logging.c trunk/kbx/ChangeLog trunk/kbx/kbxutil.c trunk/m4/ChangeLog trunk/m4/gnupg-pth.m4 trunk/scd/ChangeLog trunk/scd/apdu.c trunk/scd/app-openpgp.c trunk/scd/app-p15.c trunk/scd/ccid-driver.c trunk/scd/command.c trunk/scd/iso7816.c trunk/scd/scdaemon.c trunk/scd/scdaemon.h trunk/tests/openpgp/ChangeLog trunk/tests/openpgp/Makefile.am trunk/tools/ChangeLog trunk/tools/gpgconf-comp.c Log: Made some PIN pads work. Some cleanups for 64 bit CPUs. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,7 @@ +2006-11-15 Werner Koch + + * autogen.sh: Add convenience option --build-amd64. + 2006-11-14 Werner Koch * configure.ac (HAVE_ASSUAN_SET_IO_MONITOR): Test for it. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/Makefile.am 2006-11-20 16:49:41 UTC (rev 4342) @@ -22,7 +22,7 @@ ACLOCAL_AMFLAGS = -I m4 -I gl/m4 AUTOMAKE_OPTIONS = dist-bzip2 -DISTCHECK_CONFIGURE_FLAGS = --enable-gpg +DISTCHECK_CONFIGURE_FLAGS = --enable-symcryptrun EXTRA_DIST = scripts/config.rpath autogen.sh README.SVN DISTCLEANFILES = g10defs.h Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/NEWS 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,7 +1,12 @@ Noteworthy changes in version 2.0.1 ------------------------------------------------- + * Experimental support for the PIN pads of the SPR 532 and the Kaan + Advanced card readers. Add "disable-keypad" scdaemon.conf if you + don't want it. Does currently only work for the OpenPGP card and + the authentication and decrypt keys. + Noteworthy changes in version 2.0.0 (2006-11-11) ------------------------------------------------- Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/THANKS 2006-11-20 16:49:41 UTC (rev 4342) @@ -90,6 +90,7 @@ Gregory Steuck steuck at iname.com Harald Denker harry at hal.westfalen.de Holger Baust Holger.Baust at freenet-ag.de +Henrik Nordstrom henrik at henriknordstrom.net Hendrik Buschkamp buschkamp at rheumanet.org Holger Schurig holger at d.om.org Holger Smolinski smolinsk at de.ibm.com Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,27 @@ +2006-11-20 Werner Koch + + * call-pinentry.c (agent_popup_message_stop): Use SIGKILL. + * call-scd.c (inq_needpin): Implement POPUPKEYPADPROMPT and + DISMISSKEYPADPROMPT. + +2006-11-15 Werner Koch + + * protect.c (make_shadow_info): Cast printf arg to unsigned int. + * minip12.c (parse_bag_encrypted_data): Ditto. + (parse_bag_data, p12_parse): Ditto. + * command-ssh.c (ssh_identity_register): Changed buffer_n to + size_t. + + * agent.h (struct server_control_s): New field thread_startup. + * command.c (start_command_handler): Moved CTRL init code to .. + * gpg-agent.c (start_connection_thread): .. here. + (agent_deinit_default_ctrl): New. + (agent_init_default_ctrl): Made static. + (handle_connections): Allocate CTRL and pass it pth_spawn. + * command-ssh.c (start_command_handler_ssh): Moved CTRL init code + to .. + * gpg-agent.c (start_connection_thread_ssh): .. here. + 2006-11-14 Werner Koch * command.c (bump_key_eventcounter): New. Modified: trunk/agent/agent.h =================================================================== --- trunk/agent/agent.h 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/agent.h 2006-11-20 16:49:41 UTC (rev 4342) @@ -112,6 +112,12 @@ /* Collection of data per session (aka connection). */ struct server_control_s { + /* Private data used to fire up the connection thread. We use this + structure do avoid an extra allocation for just a few bytes. */ + struct { + int fd; + } thread_startup; + /* Private data of the server (command.c). */ struct server_local_s *server_local; @@ -178,16 +184,15 @@ /*-- gpg-agent.c --*/ void agent_exit (int rc) JNLIB_GCC_A_NR; /* Also implemented in other tools */ -void agent_init_default_ctrl (struct server_control_s *ctrl); /*-- command.c --*/ gpg_error_t agent_write_status (ctrl_t ctrl, const char *keyword, ...); void bump_key_eventcounter (void); void bump_card_eventcounter (void); -void start_command_handler (int, int); +void start_command_handler (ctrl_t, int, int); /*-- command-ssh.c --*/ -void start_command_handler_ssh (int); +void start_command_handler_ssh (ctrl_t, int); /*-- findkey.c --*/ int agent_write_private_key (const unsigned char *grip, Modified: trunk/agent/call-pinentry.c =================================================================== --- trunk/agent/call-pinentry.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/call-pinentry.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -636,7 +636,7 @@ /* Pop up a message window similar to the confirm one but keep it open until agent_popup_message_stop has been called. It is crucial for the caller to make sure that the stop function gets called as soon - as the message is not anymore required becuase the message is + as the message is not anymore required because the message is system modal and all other attempts to use the pinentry will fail (after a timeout). */ int @@ -723,8 +723,9 @@ if (rc == pid) assuan_set_flag (entry_ctx, ASSUAN_NO_WAITPID, 1); } - else - kill (pid, SIGINT); + else if (pid > 0) + kill (pid, SIGKILL); /* Need to use SIGKILL due to bad + interaction of SIGINT with Pth. */ /* Now wait for the thread to terminate. */ rc = pth_join (popup_tid, NULL); Modified: trunk/agent/call-scd.c =================================================================== --- trunk/agent/call-scd.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/call-scd.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -711,18 +711,20 @@ rc = assuan_send_data (parm->ctx, pin, pinlen); xfree (pin); } - else if (!strncmp (line, "KEYPADINFO", 10) && (line[10] == ' ' || !line[10])) + else if (!strncmp (line, "POPUPKEYPADPROMPT", 17) + && (line[17] == ' ' || !line[17])) { - size_t code; - char *endp; - - code = strtoul (line+10, &endp, 10); - line = endp; + line += 17; while (*line == ' ') line++; - rc = parm->getpin_cb (parm->getpin_cb_arg, line, NULL, code); + rc = parm->getpin_cb (parm->getpin_cb_arg, line, NULL, 1); } + else if (!strncmp (line, "DISMISSKEYPADPROMPT", 19) + && (line[19] == ' ' || !line[19])) + { + rc = parm->getpin_cb (parm->getpin_cb_arg, "", NULL, 0); + } else { log_error ("unsupported inquiry `%s'\n", line); Modified: trunk/agent/command-ssh.c =================================================================== --- trunk/agent/command-ssh.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/command-ssh.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -2329,7 +2329,7 @@ unsigned char key_grip_raw[20]; char key_grip[41]; unsigned char *buffer = NULL; - unsigned int buffer_n; + size_t buffer_n; char *description = NULL; char *comment = NULL; unsigned int i; @@ -2821,32 +2821,28 @@ /* Start serving client on SOCK_CLIENT. */ void -start_command_handler_ssh (int sock_client) +start_command_handler_ssh (ctrl_t ctrl, int sock_client) { - struct server_control_s ctrl; estream_t stream_sock; gpg_error_t err; int ret; /* Setup control structure. */ + ctrl->connection_fd = sock_client; - memset (&ctrl, 0, sizeof (ctrl)); - agent_init_default_ctrl (&ctrl); - ctrl.connection_fd = sock_client; - /* Because the ssh protocol does not send us information about the the current TTY setting, we resort here to use those from startup or those explictly set. */ - if (!ctrl.display && opt.startup_display) - ctrl.display = strdup (opt.startup_display); - if (!ctrl.ttyname && opt.startup_ttyname) - ctrl.ttyname = strdup (opt.startup_ttyname); - if (!ctrl.ttytype && opt.startup_ttytype) - ctrl.ttytype = strdup (opt.startup_ttytype); - if (!ctrl.lc_ctype && opt.startup_lc_ctype) - ctrl.lc_ctype = strdup (opt.startup_lc_ctype); - if (!ctrl.lc_messages && opt.startup_lc_messages) - ctrl.lc_messages = strdup (opt.startup_lc_messages); + if (!ctrl->display && opt.startup_display) + ctrl->display = strdup (opt.startup_display); + if (!ctrl->ttyname && opt.startup_ttyname) + ctrl->ttyname = strdup (opt.startup_ttyname); + if (!ctrl->ttytype && opt.startup_ttytype) + ctrl->ttytype = strdup (opt.startup_ttytype); + if (!ctrl->lc_ctype && opt.startup_lc_ctype) + ctrl->lc_ctype = strdup (opt.startup_lc_ctype); + if (!ctrl->lc_messages && opt.startup_lc_messages) + ctrl->lc_messages = strdup (opt.startup_lc_messages); /* Create stream from socket. */ @@ -2870,20 +2866,14 @@ } /* Main processing loop. */ - while ( !ssh_request_process (&ctrl, stream_sock) ) + while ( !ssh_request_process (ctrl, stream_sock) ) ; /* Reset the SCD in case it has been used. */ - agent_reset_scd (&ctrl); + agent_reset_scd (ctrl); out: if (stream_sock) es_fclose (stream_sock); - - free (ctrl.display); - free (ctrl.ttyname); - free (ctrl.ttytype); - free (ctrl.lc_ctype); - free (ctrl.lc_messages); } Modified: trunk/agent/command.c =================================================================== --- trunk/agent/command.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/command.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -1441,18 +1441,16 @@ } -/* Startup the server. If LISTEN_FD and FD is given as -1, this is a simple - piper server, otherwise it is a regular server */ +/* Startup the server. If LISTEN_FD and FD is given as -1, this is a + simple piper server, otherwise it is a regular server. CTRL is the + control structure for this connection; it has only the basic + intialization. */ void -start_command_handler (int listen_fd, int fd) +start_command_handler (ctrl_t ctrl, int listen_fd, int fd) { int rc; assuan_context_t ctx; - struct server_control_s ctrl; - memset (&ctrl, 0, sizeof ctrl); - agent_init_default_ctrl (&ctrl); - if (listen_fd == -1 && fd == -1) { int filedes[2]; @@ -1468,7 +1466,7 @@ else { rc = assuan_init_socket_server_ext (&ctx, fd, 2); - ctrl.connection_fd = fd; + ctrl->connection_fd = fd; } if (rc) { @@ -1484,12 +1482,12 @@ agent_exit (2); } - assuan_set_pointer (ctx, &ctrl); - ctrl.server_local = xcalloc (1, sizeof *ctrl.server_local); - ctrl.server_local->assuan_ctx = ctx; - ctrl.server_local->message_fd = -1; - ctrl.server_local->use_cache_for_signing = 1; - ctrl.digest.raw_value = 0; + assuan_set_pointer (ctx, ctrl); + ctrl->server_local = xcalloc (1, sizeof *ctrl->server_local); + ctrl->server_local->assuan_ctx = ctx; + ctrl->server_local->message_fd = -1; + ctrl->server_local->use_cache_for_signing = 1; + ctrl->digest.raw_value = 0; if (DBG_ASSUAN) assuan_set_log_stream (ctx, log_get_stream ()); @@ -1520,22 +1518,14 @@ } /* Reset the SCD if needed. */ - agent_reset_scd (&ctrl); + agent_reset_scd (ctrl); /* Reset the pinentry (in case of popup messages). */ - agent_reset_query (&ctrl); + agent_reset_query (ctrl); + /* Cleanup. */ assuan_deinit_server (ctx); - if (ctrl.display) - free (ctrl.display); - if (ctrl.ttyname) - free (ctrl.ttyname); - if (ctrl.ttytype) - free (ctrl.ttytype); - if (ctrl.lc_ctype) - free (ctrl.lc_ctype); - if (ctrl.lc_messages) - free (ctrl.lc_messages); - xfree (ctrl.server_local); + xfree (ctrl->server_local); + ctrl->server_local = NULL; } Modified: trunk/agent/gpg-agent.c =================================================================== --- trunk/agent/gpg-agent.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/gpg-agent.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -211,6 +211,9 @@ static int create_server_socket (int is_standard_name, const char *name); static void create_directories (void); +static void agent_init_default_ctrl (ctrl_t ctrl); +static void agent_deinit_default_ctrl (ctrl_t ctrl); + static void handle_connections (int listen_fd, int listen_fd_ssh); static int check_for_running_agent (int); @@ -813,8 +816,21 @@ if (pipe_server) - { /* this is the simple pipe based server */ - start_command_handler (-1, -1); + { + /* This is the simple pipe based server */ + ctrl_t ctrl; + + ctrl = xtrycalloc (1, sizeof *ctrl); + if (!ctrl) + { + log_error ("error allocating connection control data: %s\n", + strerror (errno) ); + agent_exit (1); + } + agent_init_default_ctrl (ctrl); + start_command_handler (ctrl, -1, -1); + agent_deinit_default_ctrl (ctrl); + xfree (ctrl); } else if (!is_daemon) ; /* NOTREACHED */ @@ -1073,8 +1089,8 @@ } -void -agent_init_default_ctrl (struct server_control_s *ctrl) +static void +agent_init_default_ctrl (ctrl_t ctrl) { ctrl->connection_fd = -1; @@ -1103,6 +1119,21 @@ } +static void +agent_deinit_default_ctrl (ctrl_t ctrl) +{ + if (ctrl->display) + free (ctrl->display); + if (ctrl->ttyname) + free (ctrl->ttyname); + if (ctrl->ttytype) + free (ctrl->ttytype); + if (ctrl->lc_ctype) + free (ctrl->lc_ctype); + if (ctrl->lc_messages) + free (ctrl->lc_messages); +} + /* Reread parts of the configuration. Note, that this function is obviously not thread-safe and should only be called from the PTH signal handler. @@ -1437,17 +1468,20 @@ static void * start_connection_thread (void *arg) { - int fd = (int)arg; + ctrl_t ctrl = arg; + agent_init_default_ctrl (ctrl); if (opt.verbose) log_info (_("handler 0x%lx for fd %d started\n"), - (long)pth_self (), fd); + (long)pth_self (), ctrl->thread_startup.fd); - start_command_handler (-1, fd); + start_command_handler (ctrl, -1, ctrl->thread_startup.fd); if (opt.verbose) log_info (_("handler 0x%lx for fd %d terminated\n"), - (long)pth_self (), fd); + (long)pth_self (), ctrl->thread_startup.fd); + agent_deinit_default_ctrl (ctrl); + xfree (ctrl); return NULL; } @@ -1456,17 +1490,20 @@ static void * start_connection_thread_ssh (void *arg) { - int fd = (int)arg; + ctrl_t ctrl = arg; + agent_init_default_ctrl (ctrl); if (opt.verbose) log_info (_("ssh handler 0x%lx for fd %d started\n"), - (long)pth_self (), fd); + (long)pth_self (), ctrl->thread_startup.fd); - start_command_handler_ssh (fd); + start_command_handler_ssh (ctrl, ctrl->thread_startup.fd); if (opt.verbose) log_info (_("ssh handler 0x%lx for fd %d terminated\n"), - (long)pth_self (), fd); + (long)pth_self (), ctrl->thread_startup.fd); + agent_deinit_default_ctrl (ctrl); + xfree (ctrl); return NULL; } @@ -1584,24 +1621,35 @@ if (FD_ISSET (listen_fd, &read_fdset)) { + ctrl_t ctrl; + plen = sizeof paddr; fd = pth_accept (listen_fd, (struct sockaddr *)&paddr, &plen); if (fd == -1) { log_error ("accept failed: %s\n", strerror (errno)); } + else if ( !(ctrl = xtrycalloc (1, sizeof *ctrl)) ) + { + log_error ("error allocating connection control data: %s\n", + strerror (errno) ); + close (fd); + } else { char threadname[50]; + snprintf (threadname, sizeof threadname-1, "conn fd=%d (gpg)", fd); threadname[sizeof threadname -1] = 0; pth_attr_set (tattr, PTH_ATTR_NAME, threadname); - if (!pth_spawn (tattr, start_connection_thread, (void*)fd)) + ctrl->thread_startup.fd = fd; + if (!pth_spawn (tattr, start_connection_thread, ctrl)) { log_error ("error spawning connection handler: %s\n", strerror (errno) ); close (fd); + xfree (ctrl); } } fd = -1; @@ -1609,25 +1657,36 @@ if (listen_fd_ssh != -1 && FD_ISSET (listen_fd_ssh, &read_fdset)) { + ctrl_t ctrl; + plen = sizeof paddr; fd = pth_accept (listen_fd_ssh, (struct sockaddr *)&paddr, &plen); if (fd == -1) { log_error ("accept failed for ssh: %s\n", strerror (errno)); } + else if ( !(ctrl = xtrycalloc (1, sizeof *ctrl)) ) + { + log_error ("error allocating connection control data: %s\n", + strerror (errno) ); + close (fd); + } else { char threadname[50]; + + agent_init_default_ctrl (ctrl); snprintf (threadname, sizeof threadname-1, "conn fd=%d (ssh)", fd); threadname[sizeof threadname -1] = 0; pth_attr_set (tattr, PTH_ATTR_NAME, threadname); - - if (!pth_spawn (tattr, start_connection_thread_ssh, (void*)fd)) + ctrl->thread_startup.fd = fd; + if (!pth_spawn (tattr, start_connection_thread_ssh, ctrl) ) { log_error ("error spawning ssh connection handler: %s\n", strerror (errno) ); close (fd); + xfree (ctrl); } } fd = -1; Modified: trunk/agent/minip12.c =================================================================== --- trunk/agent/minip12.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/minip12.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -888,7 +888,7 @@ gcry_free (plain); gcry_free (cram_buffer); log_error ("encryptedData error at \"%s\", offset %u\n", - where, (p - p_start)+startoffset); + where, (unsigned int)((p - p_start)+startoffset)); if (bad_pass) { /* Note, that the following string might be used by other programs @@ -1133,7 +1133,7 @@ } gcry_free (cram_buffer); log_error ( "data error at \"%s\", offset %u\n", - where, (p - buffer) + startoffset); + where, (unsigned int)((p - buffer) + startoffset)); if (r_consumed) *r_consumed = consumed; return NULL; @@ -1309,7 +1309,8 @@ gcry_free (cram_buffer); return result; bailout: - log_error ("error at \"%s\", offset %u\n", where, (p - p_start)); + log_error ("error at \"%s\", offset %u\n", + where, (unsigned int)(p - p_start)); if (result) { int i; Modified: trunk/agent/protect.c =================================================================== --- trunk/agent/protect.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/agent/protect.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -861,7 +861,7 @@ p = stpcpy (p, numbuf); for (s=serialno; *s && s[1]; s += 2) *(unsigned char *)p++ = xtoi_2 (s); - sprintf (numbuf, "%d:", strlen (idstring)); + sprintf (numbuf, "%u:", (unsigned int)strlen (idstring)); p = stpcpy (p, numbuf); p = stpcpy (p, idstring); *p++ = ')'; Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/autogen.sh 2006-11-20 16:49:41 UTC (rev 4342) @@ -93,9 +93,57 @@ fi # ***** end W32 build script ******* +# ***** AMD64 cross build script ******* +# Used to cross-compile for AMD64 (for testing) +if test "$1" = "--build-amd64"; then + tmp=`dirname $0` + tsdir=`cd "$tmp"; pwd` + shift + if [ ! -f $tsdir/scripts/config.guess ]; then + echo "$tsdir/scripts/config.guess not found" >&2 + exit 1 + fi + build=`$tsdir/scripts/config.guess` + [ -z "$amd64root" ] && amd64root="$HOME/amd64root" + echo "Using $amd64root as standard install directory" >&2 + + # Locate the cross compiler + crossbindir= + for host in x86_64-linux-gnu amd64-linux-gnu; do + if ${host}-gcc --version >/dev/null 2>&1 ; then + crossbindir=/usr/${host}/bin + conf_CC="CC=${host}-gcc" + break; + fi + done + if [ -z "$crossbindir" ]; then + echo "Cross compiler kit not installed" >&2 + echo "Stop." >&2 + exit 1 + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Please run a 'make distclean' first" >&2 + exit 1 + fi + fi + $tsdir/configure --enable-maintainer-mode --prefix=${amd64root} \ + --host=${host} --build=${build} \ + --with-gpg-error-prefix=${amd64root} \ + --with-ksba-prefix=${amd64root} \ + --with-libgcrypt-prefix=${amd64root} \ + --with-libassuan-prefix=${amd64root} \ + --with-zlib=/usr/x86_64-linux-gnu/usr \ + --with-pth-prefix=/usr/x86_64-linux-gnu/usr + rc=$? + exit $rc +fi +# ***** end AMD64 cross build script ******* + # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { s/^.*(\(.*\))/\1/p Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/common/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,11 @@ +2006-11-15 Werner Koch + + * estream.c: Disabled Pth soft mapping. + (my_funopen_hook_ret_t): New. + (print_fun_writer): Use it here. + + * iobuf.c (fd_cache_close): Use %d instead of %p for debug output. + 2006-11-03 Werner Koch * Makefile.am (t_convert_DEPENDENCIES): Add libcommon. From Modified: trunk/common/estream.c =================================================================== --- trunk/common/estream.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/common/estream.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -46,6 +46,9 @@ #endif #ifdef HAVE_PTH + /* We explicitly need to disable soft mapping as Debian currently + enables it for no reason. */ +# define PTH_SYSCALL_SOFT 0 # include #endif @@ -59,6 +62,7 @@ #include + /* Generally used types. */ @@ -66,6 +70,13 @@ typedef void *(*func_realloc_t) (void *mem, size_t size); typedef void (*func_free_t) (void *mem); +#ifdef HAVE_FOPENCOOKIE +typedef ssize_t my_funopen_hook_ret_t; +#else +typedef int my_funopen_hook_ret_t; +#endif + + /* Buffer management layer. */ @@ -1651,7 +1662,7 @@ /* Helper for esprint. */ #if defined(HAVE_FOPENCOOKIE) || defined(HAVE_FUNOPEN) -static int +static my_funopen_hook_ret_t print_fun_writer (void *cookie_arg, const char *buffer, size_t size) { estream_t stream = cookie_arg; Modified: trunk/common/iobuf.c =================================================================== --- trunk/common/iobuf.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/common/iobuf.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -271,7 +271,7 @@ close (fp); #endif if (DBG_IOBUF) - log_debug ("fd_cache_close (%p) real\n", (void *) fp); + log_debug ("fd_cache_close (%d) real\n", fp); return; } /* try to reuse a slot */ Modified: trunk/jnlib/ChangeLog =================================================================== --- trunk/jnlib/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/jnlib/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,8 @@ +2006-11-15 Werner Koch + + * logging.c (my_funopen_hook_ret_t): New. + (fun_writer): Use it. + 2006-10-19 Werner Koch * stringhelp.c (memrchr) [!HAVE_MEMRCHR]: Provide a replacement. @@ -5,7 +10,7 @@ 2006-09-27 Werner Koch * mischelp.c: New. - (timegm): Copied from gnupg 1.4, Changed from LGPL to GPL. Fixed + (timegm): Copied from gnupg 1.4, changed from GPL to LGPL. Fixed a memory leak. * stringhelp.h (isascii): New. Modified: trunk/jnlib/logging.c =================================================================== --- trunk/jnlib/logging.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/jnlib/logging.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -48,6 +48,13 @@ #define USE_FUNWRITER 1 #endif +#ifdef HAVE_FOPENCOOKIE +typedef ssize_t my_funopen_hook_ret_t; +#else +typedef int my_funopen_hook_ret_t; +#endif + + static FILE *logstream; static int log_socket = -1; static char prefix_buffer[80]; @@ -111,7 +118,7 @@ } -static int +static my_funopen_hook_ret_t fun_writer (void *cookie_arg, const char *buffer, size_t size) { struct fun_cookie_s *cookie = cookie_arg; Modified: trunk/kbx/ChangeLog =================================================================== --- trunk/kbx/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/kbx/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,7 @@ +2006-11-15 Werner Koch + + * kbxutil.c (dump_openpgp_key): Cast printf argument. + 2006-10-20 Werner Koch * keybox-search.c (blob_x509_has_grip, has_keygrip): New. Modified: trunk/kbx/kbxutil.c =================================================================== --- trunk/kbx/kbxutil.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/kbx/kbxutil.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -367,7 +367,7 @@ u = &info->uids; do { - printf ("uid\t\t%.*s\n", u->len, image + u->off); + printf ("uid\t\t%.*s\n", (int)u->len, image + u->off); u = u->next; } while (u); Modified: trunk/m4/ChangeLog =================================================================== --- trunk/m4/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/m4/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,8 @@ +2006-11-17 Werner Koch + + * gnupg-pth.m4: Make sure that have_w32_system is set to no by + default. + 2006-11-14 Werner Koch * libassuan.m4: Updated from libassuan SVN. Modified: trunk/m4/gnupg-pth.m4 =================================================================== --- trunk/m4/gnupg-pth.m4 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/m4/gnupg-pth.m4 2006-11-20 16:49:41 UTC (rev 4342) @@ -91,6 +91,7 @@ fi AC_PATH_PROG(PTH_CONFIG, pth-config, no) tmp=ifelse([$1], ,1.3.7,$1) + test -z "$have_w32_system" && have_w32_system="no" if test "$have_w32_system" = no; then if test "$PTH_CONFIG" != "no"; then GNUPG_PTH_VERSION_CHECK($tmp) Modified: trunk/scd/ChangeLog =================================================================== --- trunk/scd/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,37 @@ +2006-11-20 Werner Koch + + * app-openpgp.c (verify_chv2): Support for keypads (only CHV2). + + * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan + and SCM. + +2006-11-17 Werner Koch + + * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of + log_debug. Removed few other log_debug. + + * iso7816.c (iso7816_check_keypad): Allow for a SW of 0. + + * command.c (pin_cb): New mode to prompt for a keypad entry. + + * scdaemon.c (main) : Add disable-keypad. + +2006-11-15 Werner Koch + + * app-p15.c (read_ef_odf): Cast one printf arg. + + * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP. + * command.c (scd_command_handler): Add new arg CTRL. + * scdaemon.c (scd_init_default_ctrl): Made static. + (scd_deinit_default_ctrl): New. + (start_connection_thread): Call init/deinit of ctrl. + (handle_connections): Allocate CTRL. + + * apdu.c (PCSC_ERR_MASK): New. + (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu) + (close_pcsc_reader, open_pcsc_reader): Use it after shifting error + values. Reported by Henrik Nordstrom. Fixes bug #724. + 2006-10-24 Werner Koch * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New. Modified: trunk/scd/apdu.c =================================================================== --- trunk/scd/apdu.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/apdu.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -222,7 +222,12 @@ #define PCSC_E_READER_UNAVAILABLE 0x80100017 #define PCSC_W_REMOVED_CARD 0x80100069 +/* The PC/SC error is defined as a long as per specs. Due to left + shifts bit 31 will get sign extended. We use this mask to fix + it. */ +#define PCSC_ERR_MASK(a) ((a) & 0xffffffff) + struct pcsc_io_request_s { unsigned long protocol; @@ -739,7 +744,7 @@ { int rc; - switch (ec) + switch ( PCSC_ERR_MASK (ec) ) { case 0: rc = 0; break; @@ -834,7 +839,8 @@ sw = SW_HOST_GENERAL_ERROR; goto command_failed; } - err = (msgbuf[5] << 24) | (msgbuf[6] << 16) | (msgbuf[7] << 8 ) | msgbuf[8]; + err = PCSC_ERR_MASK ((msgbuf[5] << 24) | (msgbuf[6] << 16) + | (msgbuf[7] << 8 ) | msgbuf[8]); if (err) { log_error ("PC/SC RESET failed: %s (0x%lx)\n", @@ -981,7 +987,8 @@ goto command_failed; } len -= 4; /* Already read the error code. */ - err = (msgbuf[5] << 24) | (msgbuf[6] << 16) | (msgbuf[7] << 8 ) | msgbuf[8]; + err = PCSC_ERR_MASK ((msgbuf[5] << 24) | (msgbuf[6] << 16) + | (msgbuf[7] << 8 ) | msgbuf[8]); if (err) { log_error ("pcsc_status failed: %s (0x%lx)\n", @@ -1151,7 +1158,8 @@ goto command_failed; } len -= 4; /* Already read the error code. */ - err = (msgbuf[5] << 24) | (msgbuf[6] << 16) | (msgbuf[7] << 8 ) | msgbuf[8]; + err = PCSC_ERR_MASK ((msgbuf[5] << 24) | (msgbuf[6] << 16) + | (msgbuf[7] << 8 ) | msgbuf[8]); if (err) { log_error ("pcsc_transmit failed: %s (0x%lx)\n", @@ -1283,7 +1291,8 @@ goto command_failed; } len -= 4; /* Already read the error code. */ - err = (msgbuf[5] << 24) | (msgbuf[6] << 16) | (msgbuf[7] << 8 ) | msgbuf[8]; + err = PCSC_ERR_MASK ((msgbuf[5] << 24) | (msgbuf[6] << 16) + | (msgbuf[7] << 8 ) | msgbuf[8]); if (err) log_error ("pcsc_close failed: %s (0x%lx)\n", pcsc_error_string (err), err); @@ -1470,7 +1479,8 @@ (unsigned long)len); goto command_failed; } - err = (msgbuf[5] << 24) | (msgbuf[6] << 16) | (msgbuf[7] << 8 ) | msgbuf[8]; + err = PCSC_ERR_MASK ((msgbuf[5] << 24) | (msgbuf[6] << 16) + | (msgbuf[7] << 8 ) | msgbuf[8]); if (err) { log_error ("PC/SC OPEN failed: %s\n", pcsc_error_string (err)); Modified: trunk/scd/app-openpgp.c =================================================================== --- trunk/scd/app-openpgp.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/app-openpgp.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -1291,27 +1291,52 @@ { char *pinvalue; iso7816_pininfo_t pininfo; + int did_keypad = 0; memset (&pininfo, 0, sizeof pininfo); pininfo.mode = 1; pininfo.minlen = 6; - rc = pincb (pincb_arg, "PIN", &pinvalue); - if (rc) + if (!opt.disable_keypad + && !iso7816_check_keypad (app->slot, ISO7816_VERIFY, &pininfo) ) { - log_info (_("PIN callback returned error: %s\n"), gpg_strerror (rc)); - return rc; + /* The reader supports the verify command through the keypad. */ + did_keypad = 1; + rc = pincb (pincb_arg, + _("||Please enter your PIN at the reader's keypad"), + NULL); + if (rc) + { + log_info (_("PIN callback returned error: %s\n"), + gpg_strerror (rc)); + return rc; + } + rc = iso7816_verify_kp (app->slot, 0x82, "", 0, &pininfo); + /* Dismiss the prompt. */ + pincb (pincb_arg, NULL, NULL); } + else + { + /* The reader has no keypad or we don't want to use it. */ + rc = pincb (pincb_arg, "PIN", &pinvalue); + if (rc) + { + log_info (_("PIN callback returned error: %s\n"), + gpg_strerror (rc)); + return rc; + } + + if (strlen (pinvalue) < 6) + { + log_error (_("PIN for CHV%d is too short;" + " minimum length is %d\n"), 2, 6); + xfree (pinvalue); + return gpg_error (GPG_ERR_BAD_PIN); + } - if (strlen (pinvalue) < 6) - { - log_error (_("PIN for CHV%d is too short;" - " minimum length is %d\n"), 2, 6); - xfree (pinvalue); - return gpg_error (GPG_ERR_BAD_PIN); + rc = iso7816_verify (app->slot, 0x82, pinvalue, strlen (pinvalue)); } - rc = iso7816_verify (app->slot, 0x82, pinvalue, strlen (pinvalue)); if (rc) { log_error (_("verify CHV%d failed: %s\n"), 2, gpg_strerror (rc)); @@ -1321,7 +1346,7 @@ } app->did_chv2 = 1; - if (!app->did_chv1 && !app->force_chv1) + if (!app->did_chv1 && !app->force_chv1 && !did_keypad) { rc = iso7816_verify (app->slot, 0x81, pinvalue, strlen (pinvalue)); if (gpg_err_code (rc) == GPG_ERR_BAD_PIN) Modified: trunk/scd/app-p15.c =================================================================== --- trunk/scd/app-p15.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/app-p15.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -692,7 +692,8 @@ } if (buflen) - log_info ("warning: %u bytes of garbage detected at end of ODF\n", buflen); + log_info ("warning: %u bytes of garbage detected at end of ODF\n", + (unsigned int)buflen); xfree (buffer); return 0; Modified: trunk/scd/ccid-driver.c =================================================================== --- trunk/scd/ccid-driver.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/ccid-driver.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -200,7 +200,8 @@ VENDOR_CHERRY = 0x046a, VENDOR_SCM = 0x04e6, VENDOR_OMNIKEY= 0x076b, - VENDOR_GEMPC = 0x08e6 + VENDOR_GEMPC = 0x08e6, + VENDOR_KAAN = 0x0d46 }; /* A list and a table with special transport descriptions. */ @@ -990,11 +991,10 @@ fd = open (transports[i].name, O_RDWR); if (fd == -1) { - log_debug ("failed to open `%s': %s\n", + DEBUGOUT_2 ("failed to open `%s': %s\n", transports[i].name, strerror (errno)); continue; } - log_debug ("opened `%s': fd=%d\n", transports[i].name, fd); rid = malloc (strlen (transports[i].name) + 30 + 10); if (!rid) @@ -1047,7 +1047,6 @@ } free (rid); close (fd); - log_debug ("closed fd %d\n", fd); } if (scan_mode) @@ -1208,10 +1207,7 @@ if (idev) usb_close (idev); if (dev_fd != -1) - { - close (dev_fd); - log_debug ("closed fd %d\n", dev_fd); - } + close (dev_fd); free (*handle); *handle = NULL; } @@ -1254,7 +1250,6 @@ if (handle->dev_fd != -1) { close (handle->dev_fd); - log_debug ("closed fd %d\n", handle->dev_fd); handle->dev_fd = -1; } } @@ -1324,10 +1319,7 @@ usb_close (handle->idev); handle->idev = NULL; if (handle->dev_fd != -1) - { - close (handle->dev_fd); - log_debug ("closed fd %d\n", handle->dev_fd); - } + close (handle->dev_fd); handle->dev_fd = -1; } @@ -2369,10 +2361,24 @@ || pinlen_min > pinlen_max) return CCID_DRIVER_ERR_INV_VALUE; - /* We have only tested this with an SCM reader so better don't risk - anything and do not allow the use with other readers. */ - if (handle->id_vendor != VENDOR_SCM) - return CCID_DRIVER_ERR_NOT_SUPPORTED; + /* We have only tested a few readers so better don't risk anything + and do not allow the use with other readers. */ + switch (handle->id_vendor) + { + case VENDOR_SCM: /* Tested with SPR 532. */ + case VENDOR_KAAN: /* Tested with KAAN Advanced (1.02). */ + break; + /* The CHERRY XX44 does not yet work. I have not investigated it + closer because there is another problem: It echos a "*" for + each entered character and we somehow need to arrange that it + doesn't get to the tty at all. Given thate are running + without a control terminal there is not much we can do about. + A weird hack using pinentry comes in mind but I doubnt that + this is a clean solution. Need to contact Cherry. + */ + default: + return CCID_DRIVER_ERR_NOT_SUPPORTED; + } if (testmode) return 0; /* Success */ @@ -2390,7 +2396,7 @@ msg[0] = PC_to_RDR_Secure; msg[5] = 0; /* slot */ msg[6] = seqno = handle->seqno++; - msg[7] = 4; /* bBWI */ + msg[7] = 0; /* bBWI */ msg[8] = 0; /* RFU */ msg[9] = 0; /* RFU */ msg[10] = 0; /* Perform PIN verification. */ @@ -2411,8 +2417,8 @@ msg[14] = 0x00; /* bmPINLengthFormat: Units are bytes, position is 0. */ } - msg[15] = pinlen_min; /* wPINMaxExtraDigit-Minimum. */ - msg[16] = pinlen_max; /* wPINMaxExtraDigit-Maximum. */ + msg[15] = pinlen_max; /* wPINMaxExtraDigit-Maximum. */ + msg[16] = pinlen_min; /* wPINMaxExtraDigit-Minimum. */ msg[17] = 0x02; /* bEntryValidationCondition: Validation key pressed */ if (pinlen_min && pinlen_max && pinlen_min == pinlen_max) @@ -2424,13 +2430,14 @@ /* bTeoProlog follows: */ msg[22] = handle->nonnull_nad? ((1 << 4) | 0): 0; msg[23] = ((handle->t1_ns & 1) << 6); /* I-block */ - msg[24] = 4; /* apdulen. */ + msg[24] = 0; /* The apdulen will be filled in by the reader. */ /* APDU follows: */ msg[25] = apdu_buf[0]; /* CLA */ msg[26] = apdu_buf[1]; /* INS */ msg[27] = apdu_buf[2]; /* P1 */ msg[28] = apdu_buf[3]; /* P2 */ msglen = 29; + /* An EDC is not required. */ set_msg_len (msg, msglen - 10); DEBUGOUT ("sending"); @@ -2444,12 +2451,30 @@ msg = recv_buffer; rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, - RDR_to_PC_DataBlock, seqno, 5000, 0); + RDR_to_PC_DataBlock, seqno, 30000, 0); if (rc) return rc; tpdu = msg + 10; tpdulen = msglen - 10; + + if (handle->apdu_level) + { + if (resp) + { + if (tpdulen > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)tpdulen, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, tpdu, tpdulen); + *nresp = tpdulen; + } + return 0; + } if (tpdulen < 4) { @@ -2595,7 +2620,7 @@ { int rc; ccid_driver_t ccid; - unsigned int slotstat; + int slotstat; unsigned char result[512]; size_t resultlen; int no_pinpad = 0; @@ -2623,7 +2648,7 @@ } else if ( !strcmp (*argv, "--debug")) { - ccid_set_debug_level (1); + ccid_set_debug_level (ccid_set_debug_level (-1)+1); argc--; argv++; } else if ( !strcmp (*argv, "--no-poll")) Modified: trunk/scd/command.c =================================================================== --- trunk/scd/command.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/command.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -721,6 +721,31 @@ unsigned char *value; size_t valuelen; + if (!retstr) + { + /* We prompt for keypad entry. To make sure that the popup has + been show we use an inquire and not just a status message. + We ignore any value returned. */ + if (info) + { + log_debug ("prompting for keypad entry '%s'\n", info); + rc = asprintf (&command, "POPUPKEYPADPROMPT %s", info); + if (rc < 0) + return gpg_error (gpg_err_code_from_errno (errno)); + rc = assuan_inquire (ctx, command, &value, &valuelen, MAXLEN_PIN); + free (command); + } + else + { + log_debug ("dismiss keypad entry prompt\n"); + rc = assuan_inquire (ctx, "DISMISSKEYPADPROMPT", + &value, &valuelen, MAXLEN_PIN); + } + if (!rc) + xfree (value); + return rc; + } + *retstr = NULL; log_debug ("asking for PIN '%s'\n", info); @@ -1584,14 +1609,10 @@ /* Startup the server. If FD is given as -1 this is simple pipe server, otherwise it is a regular server. */ void -scd_command_handler (int fd) +scd_command_handler (ctrl_t ctrl, int fd) { int rc; assuan_context_t ctx; - struct server_control_s ctrl; - - memset (&ctrl, 0, sizeof ctrl); - scd_init_default_ctrl (&ctrl); if (fd == -1) { @@ -1622,20 +1643,20 @@ /* Allocate and initialize the server object. Put it into the list of active sessions. */ - ctrl.server_local = xcalloc (1, sizeof *ctrl.server_local); - ctrl.server_local->next_session = session_list; - session_list = ctrl.server_local; - ctrl.server_local->ctrl_backlink = &ctrl; - ctrl.server_local->assuan_ctx = ctx; + ctrl->server_local = xcalloc (1, sizeof *ctrl->server_local); + ctrl->server_local->next_session = session_list; + session_list = ctrl->server_local; + ctrl->server_local->ctrl_backlink = ctrl; + ctrl->server_local->assuan_ctx = ctx; if (DBG_ASSUAN) assuan_set_log_stream (ctx, log_get_stream ()); /* We open the reader right at startup so that the ticker is able to update the status file. */ - if (ctrl.reader_slot == -1) + if (ctrl->reader_slot == -1) { - ctrl.reader_slot = get_reader_slot (); + ctrl->reader_slot = get_reader_slot (); } /* Command processing loop. */ @@ -1661,23 +1682,24 @@ } /* Cleanup. */ - do_reset (&ctrl, 0); + do_reset (ctrl, 0); /* Release the server object. */ - if (session_list == ctrl.server_local) - session_list = ctrl.server_local->next_session; + if (session_list == ctrl->server_local) + session_list = ctrl->server_local->next_session; else { struct server_local_s *sl; for (sl=session_list; sl->next_session; sl = sl->next_session) - if (sl->next_session == ctrl.server_local) + if (sl->next_session == ctrl->server_local) break; if (!sl->next_session) BUG (); - sl->next_session = ctrl.server_local->next_session; + sl->next_session = ctrl->server_local->next_session; } - xfree (ctrl.server_local); + xfree (ctrl->server_local); + ctrl->server_local = NULL; /* Release the Assuan context. */ assuan_deinit_server (ctx); Modified: trunk/scd/iso7816.c =================================================================== --- trunk/scd/iso7816.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/iso7816.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -235,7 +235,7 @@ sw = apdu_check_keypad (slot, command, pininfo->mode, pininfo->minlen, pininfo->maxlen, pininfo->padlen); - return map_sw (sw); + return iso7816_map_sw (sw); } Modified: trunk/scd/scdaemon.c =================================================================== --- trunk/scd/scdaemon.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/scdaemon.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -600,8 +600,8 @@ printf ("disable-ccid:%lu:\n", GC_OPT_FLAG_NONE ); #endif printf ("allow-admin:%lu:\n", GC_OPT_FLAG_NONE ); + printf ("disable-keypad:%lu:\n", GC_OPT_FLAG_NONE ); - scd_exit (0); } @@ -615,6 +615,7 @@ if (pipe_server) { /* This is the simple pipe based server */ + ctrl_t ctrl; pth_attr_t tattr; int fd = -1; @@ -656,10 +657,19 @@ pth_attr_set (tattr, PTH_ATTR_STACK_SIZE, 512*1024); pth_attr_set (tattr, PTH_ATTR_NAME, "pipe-connection"); - if (!pth_spawn (tattr, start_connection_thread, (void*)(-1))) + ctrl = xtrycalloc (1, sizeof *ctrl); + if ( !ctrl ) { + log_error ("error allocating connection control data: %s\n", + strerror (errno) ); + scd_exit (2); + } + ctrl->thread_startup.fd = -1; + if ( !pth_spawn (tattr, start_connection_thread, ctrl) ) + { log_error ("error spawning pipe connection handler: %s\n", strerror (errno) ); + xfree (ctrl); scd_exit (2); } @@ -810,13 +820,19 @@ } -void +static void scd_init_default_ctrl (ctrl_t ctrl) { ctrl->reader_slot = -1; } +static void +scd_deinit_default_ctrl (ctrl_t ctrl) +{ +} + + /* Return the name of the socket to be used to connect to this process. If no socket is available, return NULL. */ const char * @@ -1007,23 +1023,26 @@ static void * start_connection_thread (void *arg) { - int fd = (int)arg; + ctrl_t ctrl = arg; + scd_init_default_ctrl (ctrl); if (opt.verbose) - log_info (_("handler for fd %d started\n"), fd); + log_info (_("handler for fd %d started\n"), ctrl->thread_startup.fd); - scd_command_handler (fd); + scd_command_handler (ctrl, ctrl->thread_startup.fd); if (opt.verbose) - log_info (_("handler for fd %d terminated\n"), fd); + log_info (_("handler for fd %d terminated\n"), ctrl->thread_startup.fd); /* If this thread is the pipe connection thread, flag that a shutdown is required. With the next ticker event and given that no other connections are running the shutdown will then happen. */ - if (fd == -1) + if (ctrl->thread_startup.fd == -1) shutdown_pending = 1; + scd_deinit_default_ctrl (ctrl); + xfree (ctrl); return NULL; } @@ -1137,23 +1156,33 @@ if (listen_fd != -1 && FD_ISSET (listen_fd, &read_fdset)) { + ctrl_t ctrl; + plen = sizeof paddr; fd = pth_accept (listen_fd, (struct sockaddr *)&paddr, &plen); if (fd == -1) { log_error ("accept failed: %s\n", strerror (errno)); } + else if ( !(ctrl = xtrycalloc (1, sizeof *ctrl)) ) + { + log_error ("error allocating connection control data: %s\n", + strerror (errno) ); + close (fd); + } else { char threadname[50]; + snprintf (threadname, sizeof threadname-1, "conn fd=%d", fd); threadname[sizeof threadname -1] = 0; pth_attr_set (tattr, PTH_ATTR_NAME, threadname); - - if (!pth_spawn (tattr, start_connection_thread, (void*)fd)) + ctrl->thread_startup.fd = fd; + if (!pth_spawn (tattr, start_connection_thread, ctrl)) { log_error ("error spawning connection handler: %s\n", strerror (errno) ); + xfree (ctrl); close (fd); } } Modified: trunk/scd/scdaemon.h =================================================================== --- trunk/scd/scdaemon.h 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/scd/scdaemon.h 2006-11-20 16:49:41 UTC (rev 4342) @@ -90,6 +90,12 @@ struct server_control_s { + /* Private data used to fire up the connection thread. We use this + structure do avoid an extra allocation for just a few bytes. */ + struct { + int fd; + } thread_startup; + /* Local data of the server; used only in command.c. */ struct server_local_s *server_local; @@ -115,11 +121,10 @@ /*-- scdaemon.c --*/ void scd_exit (int rc); -void scd_init_default_ctrl (ctrl_t ctrl); const char *scd_get_socket_name (void); /*-- command.c --*/ -void scd_command_handler (int); +void scd_command_handler (ctrl_t, int); void send_status_info (ctrl_t ctrl, const char *keyword, ...) GNUPG_GCC_A_SENTINEL(1); void scd_update_reader_status_file (void); Modified: trunk/tests/openpgp/ChangeLog =================================================================== --- trunk/tests/openpgp/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/tests/openpgp/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,8 @@ +2006-11-16 Werner Koch + + * Makefile.am (plain-large): Use gpg.texi instead of FAQ which + won't be found as it is not a source file. Pointed out by Moritz. + 2006-10-04 Werner Koch * signencrypt.test: Need to prepend srcdir to the file name Modified: trunk/tests/openpgp/Makefile.am =================================================================== --- trunk/tests/openpgp/Makefile.am 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/tests/openpgp/Makefile.am 2006-11-20 16:49:41 UTC (rev 4342) @@ -100,7 +100,7 @@ plain-large: cat $(srcdir)/../../doc/HACKING \ $(srcdir)/../../doc/DETAILS \ - $(srcdir)/../../doc/FAQ >plain-large + $(srcdir)/../../doc/gpg.texi >plain-large # To speed up key generation we create a dummy random seed file random_seed: Modified: trunk/tools/ChangeLog =================================================================== --- trunk/tools/ChangeLog 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/tools/ChangeLog 2006-11-20 16:49:41 UTC (rev 4342) @@ -1,3 +1,7 @@ +2006-11-17 Werner Koch + + * gpgconf-comp.c: Made disable-keypad a basic option. + 2006-11-03 Werner Koch * symcryptrun.c: Include signal.h and include pth.h only if test Modified: trunk/tools/gpgconf-comp.c =================================================================== --- trunk/tools/gpgconf-comp.c 2006-11-18 19:55:37 UTC (rev 4341) +++ trunk/tools/gpgconf-comp.c 2006-11-20 16:49:41 UTC (rev 4342) @@ -530,7 +530,7 @@ { "disable-ccid", GC_OPT_FLAG_NONE, GC_LEVEL_EXPERT, "gnupg", "do not use the internal CCID driver", GC_ARG_TYPE_NONE, GC_BACKEND_SCDAEMON }, - { "disable-keypad", GC_OPT_FLAG_NONE, GC_LEVEL_ADVANCED, + { "disable-keypad", GC_OPT_FLAG_NONE, GC_LEVEL_BASIC, "gnupg", "do not use a reader's keypad", GC_ARG_TYPE_NONE, GC_BACKEND_SCDAEMON }, From cvs at cvs.gnupg.org Tue Nov 21 16:29:53 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 21 15:55:04 2006 Subject: [svn] GnuPG - r4344 - in trunk: . g10 Message-ID: Author: wk Date: 2006-11-21 16:29:52 +0100 (Tue, 21 Nov 2006) New Revision: 4344 Modified: trunk/configure.ac trunk/g10/ChangeLog trunk/g10/Makefile.am Log: Changed order of libs Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-21 11:00:14 UTC (rev 4343) +++ trunk/configure.ac 2006-11-21 15:29:52 UTC (rev 4344) @@ -20,7 +20,7 @@ # USA. # Process this file with autoconf to produce a configure script. -AC_PREREQ(2.52) +AC_PREREQ(2.59) min_automake_version="1.9.3" # Remember to change the version number immediately *after* a release. @@ -978,9 +978,9 @@ # # gnulib checks # -gl_SOURCE_BASE(gl) -gl_M4_BASE(gl/m4) -gl_MODULES(setenv mkdtemp vasprintf xsize) +gl_SOURCE_BASE([gl]) +gl_M4_BASE([gl/m4]) +gl_MODULES([setenv mkdtemp vasprintf xsize]) gl_INIT Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2006-11-21 11:00:14 UTC (rev 4343) +++ trunk/g10/ChangeLog 2006-11-21 15:29:52 UTC (rev 4344) @@ -1,5 +1,7 @@ 2006-11-21 Werner Koch + * Makefile.am (needed_libs): libgnu needs to come after libcommon. + * keygen.c (ask_expire_interval): Print y2038 warning only for 32 bit time_t. (save_unprotected_key_to_card): Made RSA_N_LEN et al a size_t. Modified: trunk/g10/Makefile.am =================================================================== --- trunk/g10/Makefile.am 2006-11-21 11:00:14 UTC (rev 4343) +++ trunk/g10/Makefile.am 2006-11-21 15:29:52 UTC (rev 4344) @@ -29,7 +29,7 @@ AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS) -needed_libs = ../gl/libgnu.a ../common/libcommon.a ../jnlib/libjnlib.a +needed_libs = ../common/libcommon.a ../jnlib/libjnlib.a ../gl/libgnu.a bin_PROGRAMS = gpg2 gpgv2 From cvs at cvs.gnupg.org Tue Nov 21 19:42:07 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 21 19:07:19 2006 Subject: [svn] assuan - r226 - in trunk: . doc m4 src Message-ID: Author: wk Date: 2006-11-21 19:42:07 +0100 (Tue, 21 Nov 2006) New Revision: 226 Modified: trunk/ChangeLog trunk/autogen.sh trunk/configure.ac trunk/doc/assuan.texi trunk/m4/gnupg-pth.m4 trunk/src/ChangeLog trunk/src/assuan-pipe-server.c Log: Fix for newer Pth versions. Fix memory leak. Add convenience option for cross build to amd64 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/ChangeLog 2006-11-21 18:42:07 UTC (rev 226) @@ -1,3 +1,15 @@ +2006-11-21 Werner Koch + + * configure.ac (AH_BOTTOM): Define PTH_SYSCALL_SOFT to 0. + (AC_INIT): Use the SVN magic. + + * m4/gnupg-pth.m4 (GNUPG_PTH_VERSION_CHECK): Use --all with + pth-config. + +2006-11-15 Werner Koch + + * autogen.sh: Add convenience option --build-amd64. + 2006-10-31 Werner Koch Released 1.0.0. Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/autogen.sh 2006-11-21 18:42:07 UTC (rev 226) @@ -84,8 +84,52 @@ # ***** end W32 build script ******* +# ***** AMD64 cross build script ******* +# Used to cross-compile for AMD64 (for testing) +if test "$1" = "--build-amd64"; then + tmp=`dirname $0` + tsdir=`cd "$tmp"; pwd` + shift + if [ ! -f $tsdir/config.guess ]; then + echo "$tsdir/config.guess not found" >&2 + exit 1 + fi + build=`$tsdir/config.guess` + [ -z "$amd64root" ] && amd64root="$HOME/amd64root" + echo "Using $amd64root as standard install directory" >&2 + + # Locate the cross compiler + crossbindir= + for host in x86_64-linux-gnu amd64-linux-gnu; do + if ${host}-gcc --version >/dev/null 2>&1 ; then + crossbindir=/usr/${host}/bin + conf_CC="CC=${host}-gcc" + break; + fi + done + if [ -z "$crossbindir" ]; then + echo "Cross compiler kit not installed" >&2 + echo "Stop." >&2 + exit 1 + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Please run a 'make distclean' first" >&2 + exit 1 + fi + fi + $tsdir/configure --enable-maintainer-mode --prefix=${amd64root} \ + --host=${host} --build=${build} + rc=$? + exit $rc +fi +# ***** end AMD64 cross build script ******* + + + # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { s/^.*(\(.*\))/\1/p Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/configure.ac 2006-11-21 18:42:07 UTC (rev 226) @@ -23,9 +23,16 @@ AC_PREREQ(2.59) min_automake_version="1.9.3" -# Version number: Remember to change it immediately *after* a release. -# Add a "-cvs" prefix for non-released code. -AC_INIT(libassuan, 1.0.1-cvs, bug-libassuan@gnupg.org) +# 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.0.1]) +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'|head -1)])) +AC_INIT([libassuan], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), + [bug-libassuan@gnupg.org]) # Note, that this is not yet available as a shared library. PACKAGE=$PACKAGE_NAME @@ -73,6 +80,11 @@ AH_BOTTOM([ #define _ASSUAN_IN_LIBASSUAN 1 + +/* We explicitly need to disable PTH's soft mapping as Debian + currently enables it by default for no reason. */ +#define PTH_SYSCALL_SOFT 0 + ]) Modified: trunk/doc/assuan.texi =================================================================== --- trunk/doc/assuan.texi 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/doc/assuan.texi 2006-11-21 18:42:07 UTC (rev 226) @@ -886,7 +886,7 @@ @end deftypefun @noindent -If a file descriptor has been passed a the assuan context gets initialized +If a file descriptor has been passed, the assuan context gets initialized by @deftypefun assuan_error_t assuan_init_socket_server_ext (@w{assuan_context_t *@var{r_ctx}}, @w{int @var{fd}}, @w{unsigned int @var{flags}}) Modified: trunk/m4/gnupg-pth.m4 =================================================================== --- trunk/m4/gnupg-pth.m4 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/m4/gnupg-pth.m4 2006-11-21 18:42:07 UTC (rev 226) @@ -53,7 +53,7 @@ _gnupg_pth_save_libs=$LIBS CFLAGS="$CFLAGS `$PTH_CONFIG --cflags`" LDFLAGS="$LDFLAGS `$PTH_CONFIG --ldflags`" - LIBS="$LIBS `$PTH_CONFIG --libs`" + LIBS="$LIBS `$PTH_CONFIG --libs --all`" AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [[ pth_init ();]])], Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/src/ChangeLog 2006-11-21 18:42:07 UTC (rev 226) @@ -1,3 +1,7 @@ +2006-11-21 Werner Koch + + * assuan-pipe-server.c (_assuan_release_context): Free CMDTBL. + 2006-11-14 Werner Koch * libassuan.m4 (AM_CHECK_LIBASSUAN): New. Modified: trunk/src/assuan-pipe-server.c =================================================================== --- trunk/src/assuan-pipe-server.c 2006-11-14 16:56:07 UTC (rev 225) +++ trunk/src/assuan-pipe-server.c 2006-11-21 18:42:07 UTC (rev 226) @@ -168,6 +168,7 @@ { xfree (ctx->hello_line); xfree (ctx->okay_line); + xfree (ctx->cmdtbl); xfree (ctx); } } From cvs at cvs.gnupg.org Tue Nov 21 19:57:07 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 21 19:22:14 2006 Subject: [svn] assuan - r227 - in trunk: . src Message-ID: Author: wk Date: 2006-11-21 19:57:07 +0100 (Tue, 21 Nov 2006) New Revision: 227 Added: trunk/compile Modified: trunk/configure.ac trunk/src/ChangeLog trunk/src/Makefile.am Log: Makefile fixes. Added: trunk/compile =================================================================== --- trunk/compile 2006-11-21 18:42:07 UTC (rev 226) +++ trunk/compile 2006-11-21 18:57:07 UTC (rev 227) @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: trunk/compile ___________________________________________________________________ Name: svn:executable + * Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-21 18:42:07 UTC (rev 226) +++ trunk/configure.ac 2006-11-21 18:57:07 UTC (rev 227) @@ -30,7 +30,7 @@ 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'|head -1)])) + || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) AC_INIT([libassuan], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), [bug-libassuan@gnupg.org]) # Note, that this is not yet available as a shared library. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-11-21 18:42:07 UTC (rev 226) +++ trunk/src/ChangeLog 2006-11-21 18:57:07 UTC (rev 227) @@ -1,5 +1,7 @@ 2006-11-21 Werner Koch + * Makefile.am (libassuan_pth_a_CFLAGS): New. + * assuan-pipe-server.c (_assuan_release_context): Free CMDTBL. 2006-11-14 Werner Koch Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-11-21 18:42:07 UTC (rev 226) +++ trunk/src/Makefile.am 2006-11-21 18:57:07 UTC (rev 227) @@ -60,6 +60,7 @@ if HAVE_PTH libassuan_pth_a_SOURCES = $(common_sources) assuan-io-pth.c +libassuan_pth_a_CFLAGS = $(AM_CFLAGS) $(PTH_CFLAGS) libassuan_pth_a_LIBADD = @LIBOBJS@ endif From cvs at cvs.gnupg.org Tue Nov 21 20:33:05 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 21 19:58:13 2006 Subject: [svn] GnuPG - r4345 - trunk/g10 Message-ID: Author: wk Date: 2006-11-21 20:33:04 +0100 (Tue, 21 Nov 2006) New Revision: 4345 Modified: trunk/g10/ChangeLog trunk/g10/keygen.c Log: Final fix which should now pass all tests. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2006-11-21 15:29:52 UTC (rev 4344) +++ trunk/g10/ChangeLog 2006-11-21 19:33:04 UTC (rev 4345) @@ -6,6 +6,7 @@ bit time_t. (save_unprotected_key_to_card): Made RSA_N_LEN et al a size_t. Cast printf args. + (get_parameter_algo): Allow "ELG" as alias for "ELG-E". * seckey-cert.c (do_check): Made NBYTES a size_t. (do_check): Made NDATA a size_t. Modified: trunk/g10/keygen.c =================================================================== --- trunk/g10/keygen.c 2006-11-21 15:29:52 UTC (rev 4344) +++ trunk/g10/keygen.c 2006-11-21 19:33:04 UTC (rev 4345) @@ -2176,7 +2176,8 @@ return -1; if( digitp( r->u.value ) ) i = atoi( r->u.value ); - else if ( !strcmp ( r->u.value, "ELG-E") ) + else if ( !strcmp ( r->u.value, "ELG-E") + || !strcmp ( r->u.value, "ELG") ) i = GCRY_PK_ELG_E; else i = gcry_pk_map_name (r->u.value); From cvs at cvs.gnupg.org Wed Nov 22 14:03:20 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 22 13:28:24 2006 Subject: [svn] assuan - r228 - in trunk: . src Message-ID: Author: wk Date: 2006-11-22 14:03:20 +0100 (Wed, 22 Nov 2006) New Revision: 228 Modified: trunk/ChangeLog trunk/NEWS trunk/README trunk/configure.ac trunk/src/ChangeLog trunk/src/assuan-handler.c Log: Preparing a release Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/ChangeLog 2006-11-22 13:03:20 UTC (rev 228) @@ -1,3 +1,7 @@ +2006-11-22 Werner Koch + + Released 1.0.1. + 2006-11-21 Werner Koch * configure.ac (AH_BOTTOM): Define PTH_SYSCALL_SOFT to 0. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/NEWS 2006-11-22 13:03:20 UTC (rev 228) @@ -1,11 +1,13 @@ -Noteworthy changes in version 1.0.1 +Noteworthy changes in version 1.0.1 (2006-11-22) ------------------------------------------------ * New function: assuan_set_io_monitor. * New function: assuan_register_post_cmd_notify. + * Fixed a memory leak. + Noteworthy changes in version 1.0.0 (2006-10-31) ------------------------------------------------ Modified: trunk/README =================================================================== --- trunk/README 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/README 2006-11-22 13:03:20 UTC (rev 228) @@ -1,7 +1,7 @@ Libassuan =========== -This is the IPC library used by GnuPG 1.9, GPGME and a few other +This is the IPC library used by GnuPG 2, GPGME and a few other packages. It used to be included with the latter packages but we decided to make your life not too easy and separated it out to a stand alone library. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/configure.ac 2006-11-22 13:03:20 UTC (rev 228) @@ -27,7 +27,7 @@ # 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.0.1]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/src/ChangeLog 2006-11-22 13:03:20 UTC (rev 228) @@ -1,3 +1,8 @@ +2006-11-22 Werner Koch + + * assuan-handler.c (fun_cookie_write): New. + (assuan_get_data_fp) [HAVE_FUNOPEN]: Use it. + 2006-11-21 Werner Koch * Makefile.am (libassuan_pth_a_CFLAGS): New. Modified: trunk/src/assuan-handler.c =================================================================== --- trunk/src/assuan-handler.c 2006-11-21 18:57:07 UTC (rev 227) +++ trunk/src/assuan-handler.c 2006-11-22 13:03:20 UTC (rev 228) @@ -652,6 +652,17 @@ return n; } + +/* funopen uses a different prototype for the write fucntions. We use + this wrapper here to fix it. */ +#ifdef HAVE_FUNOPEN +static int +fun_cookie_write (void *cookie, const char *buffer, int orig_size) +{ + return _assuan_cookie_write_data (cookie, buffer, orig_size); +} +#endif /*HAVE_FUNOPEN*/ + /* Return a FP to be used for data output. The FILE pointer is valid until the end of a handler. So a close is not needed. Assuan does all the buffering needed to insert the status line as well as the @@ -669,7 +680,11 @@ ctx->outbound.data.fp = funopen (ctx, 0, +#ifdef HAVE_FUNOPEN + fun_cookie_write, +#else _assuan_cookie_write_data, +#endif 0, _assuan_cookie_write_flush); ctx->outbound.data.error = 0; return ctx->outbound.data.fp; From cvs at cvs.gnupg.org Wed Nov 22 14:13:04 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 22 13:38:06 2006 Subject: [svn] assuan - r229 - trunk/src Message-ID: Author: wk Date: 2006-11-22 14:13:04 +0100 (Wed, 22 Nov 2006) New Revision: 229 Modified: trunk/src/assuan-handler.c Log: Final fix. Modified: trunk/src/assuan-handler.c =================================================================== --- trunk/src/assuan-handler.c 2006-11-22 13:03:20 UTC (rev 228) +++ trunk/src/assuan-handler.c 2006-11-22 13:13:04 UTC (rev 229) @@ -678,14 +678,14 @@ if (ctx->outbound.data.fp) return ctx->outbound.data.fp; - - ctx->outbound.data.fp = funopen (ctx, 0, #ifdef HAVE_FUNOPEN - fun_cookie_write, + ctx->outbound.data.fp = funopen (ctx, 0, fun_cookie_write, + 0, _assuan_cookie_write_flush); #else - _assuan_cookie_write_data, + ctx->outbound.data.fp = funopen (ctx, 0, _assuan_cookie_write_data, + 0, _assuan_cookie_write_flush); #endif - 0, _assuan_cookie_write_flush); + ctx->outbound.data.error = 0; return ctx->outbound.data.fp; #else From cvs at cvs.gnupg.org Wed Nov 22 14:29:48 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 22 13:54:52 2006 Subject: [svn] assuan - r230 - trunk/src Message-ID: Author: wk Date: 2006-11-22 14:29:47 +0100 (Wed, 22 Nov 2006) New Revision: 230 Modified: trunk/src/ChangeLog trunk/src/assuan-handler.c Log: Again one of these last commits Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-11-22 13:13:04 UTC (rev 229) +++ trunk/src/ChangeLog 2006-11-22 13:29:47 UTC (rev 230) @@ -1,6 +1,6 @@ 2006-11-22 Werner Koch - * assuan-handler.c (fun_cookie_write): New. + * assuan-handler.c (fun1_cookie_write, fun2_cookie_write): New. (assuan_get_data_fp) [HAVE_FUNOPEN]: Use it. 2006-11-21 Werner Koch Modified: trunk/src/assuan-handler.c =================================================================== --- trunk/src/assuan-handler.c 2006-11-22 13:13:04 UTC (rev 229) +++ trunk/src/assuan-handler.c 2006-11-22 13:29:47 UTC (rev 230) @@ -653,15 +653,21 @@ } -/* funopen uses a different prototype for the write fucntions. We use - this wrapper here to fix it. */ +/* Two simple wrappers to make the expected function types match. */ #ifdef HAVE_FUNOPEN static int -fun_cookie_write (void *cookie, const char *buffer, int orig_size) +fun1_cookie_write (void *cookie, const char *buffer, int orig_size) { return _assuan_cookie_write_data (cookie, buffer, orig_size); } #endif /*HAVE_FUNOPEN*/ +#ifdef HAVE_FOPENCOOKIE +static ssize_t +fun2_cookie_write (void *cookie, const char *buffer, size_t orig_size) +{ + return _assuan_cookie_write_data (cookie, buffer, orig_size); +} +#endif /*HAVE_FOPENCOOKIE*/ /* Return a FP to be used for data output. The FILE pointer is valid until the end of a handler. So a close is not needed. Assuan does @@ -679,10 +685,10 @@ return ctx->outbound.data.fp; #ifdef HAVE_FUNOPEN - ctx->outbound.data.fp = funopen (ctx, 0, fun_cookie_write, + ctx->outbound.data.fp = funopen (ctx, 0, fun1_cookie_write, 0, _assuan_cookie_write_flush); #else - ctx->outbound.data.fp = funopen (ctx, 0, _assuan_cookie_write_data, + ctx->outbound.data.fp = funopen (ctx, 0, fun2_cookie_write, 0, _assuan_cookie_write_flush); #endif From cvs at cvs.gnupg.org Wed Nov 22 14:36:43 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 22 14:01:45 2006 Subject: [svn] assuan - r231 - tags Message-ID: Author: wk Date: 2006-11-22 14:36:43 +0100 (Wed, 22 Nov 2006) New Revision: 231 Added: tags/libassuan-1.0.1/ Log: Released 1.0.1 Copied: tags/libassuan-1.0.1 (from rev 230, trunk) From cvs at cvs.gnupg.org Thu Nov 23 11:35:32 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 23 11:00:32 2006 Subject: [svn] GnuPG - r4347 - trunk/scd Message-ID: Author: wk Date: 2006-11-23 11:35:31 +0100 (Thu, 23 Nov 2006) New Revision: 4347 Modified: trunk/scd/ChangeLog trunk/scd/command.c Log: Final fix for rc1 Modified: trunk/scd/ChangeLog =================================================================== --- trunk/scd/ChangeLog 2006-11-23 09:53:17 UTC (rev 4346) +++ trunk/scd/ChangeLog 2006-11-23 10:35:31 UTC (rev 4347) @@ -1,3 +1,7 @@ +2006-11-23 Werner Koch + + * command.c (scd_command_handler): Fixed use of CTRL. + 2006-11-21 Werner Koch * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec. Modified: trunk/scd/command.c =================================================================== --- trunk/scd/command.c 2006-11-23 09:53:17 UTC (rev 4346) +++ trunk/scd/command.c 2006-11-23 10:35:31 UTC (rev 4347) @@ -1639,7 +1639,7 @@ gpg_strerror(rc)); scd_exit (2); } - assuan_set_pointer (ctx, &ctrl); + assuan_set_pointer (ctx, ctrl); /* Allocate and initialize the server object. Put it into the list of active sessions. */ From cvs at cvs.gnupg.org Thu Nov 23 11:47:36 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 23 11:12:34 2006 Subject: [svn] GnuPG - r4348 - tags Message-ID: Author: wk Date: 2006-11-23 11:47:36 +0100 (Thu, 23 Nov 2006) New Revision: 4348 Added: tags/gnupg-2.0.1rc1/ Log: Released a release candidate Copied: tags/gnupg-2.0.1rc1 (from rev 4347, trunk) From cvs at cvs.gnupg.org Mon Nov 27 17:40:20 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon Nov 27 17:05:40 2006 Subject: [svn] GnuPG - r4349 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: wk Date: 2006-11-27 17:40:14 +0100 (Mon, 27 Nov 2006) New Revision: 4349 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/openfile.c Log: * openfile.c (ask_outfile_name): Fixed buffer overflow occurring if make_printable_string returns a longer string. Fixes bug 728. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2006-11-23 10:47:36 UTC (rev 4348) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2006-11-27 16:40:14 UTC (rev 4349) @@ -1,3 +1,8 @@ +2006-11-27 Werner Koch + + * openfile.c (ask_outfile_name): Fixed buffer overflow occurring + if make_printable_string returns a longer string. Fixes bug 728. + 2006-10-23 Werner Koch * gpg.c (main): New command --gpgconf-list. Modified: branches/STABLE-BRANCH-1-4/g10/openfile.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/openfile.c 2006-11-23 10:47:36 UTC (rev 4348) +++ branches/STABLE-BRANCH-1-4/g10/openfile.c 2006-11-27 16:40:14 UTC (rev 4349) @@ -144,8 +144,8 @@ s = _("Enter new filename"); - n = strlen(s) + namelen + 10; defname = name && namelen? make_printable_string( name, namelen, 0): NULL; + n = strlen(s) + (defname?strlen (defname):0) + 10; prompt = xmalloc(n); if( defname ) sprintf(prompt, "%s [%s]: ", s, defname ); From cvs at cvs.gnupg.org Mon Nov 27 17:41:33 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon Nov 27 17:06:41 2006 Subject: [svn] GnuPG - r4350 - trunk/g10 Message-ID: Author: wk Date: 2006-11-27 17:41:32 +0100 (Mon, 27 Nov 2006) New Revision: 4350 Modified: trunk/g10/ChangeLog trunk/g10/openfile.c Log: * openfile.c (ask_outfile_name): Fixed buffer overflow occurring if make_printable_string returns a longer string. Fixes bug 728. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2006-11-27 16:40:14 UTC (rev 4349) +++ trunk/g10/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) @@ -1,3 +1,8 @@ +2006-11-27 Werner Koch + + * openfile.c (ask_outfile_name): Fixed buffer overflow occurring + if make_printable_string returns a longer string. Fixes bug 728. + 2006-11-21 Werner Koch * Makefile.am (needed_libs): libgnu needs to come after libcommon. Modified: trunk/g10/openfile.c =================================================================== --- trunk/g10/openfile.c 2006-11-27 16:40:14 UTC (rev 4349) +++ trunk/g10/openfile.c 2006-11-27 16:41:32 UTC (rev 4350) @@ -95,7 +95,7 @@ /**************** - * Strip know extensions from iname and return a newly allocated + * Strip known extensions from iname and return a newly allocated * filename. Return NULL if we can't do that. */ char * @@ -126,45 +126,47 @@ } -/**************** - * Ask for a outputfilename and use the given one as default. - * Return NULL if no file has been given or it is not possible to - * ask the user. +/* Ask for an output filename; use the given one as default. Return + NULL if no file has been given or if it is not possible to ask the + user. NAME is the template len which might conatin enbedded Nuls. + NAMELEN is its actual length. */ char * ask_outfile_name( const char *name, size_t namelen ) { - size_t n; - const char *s; - char *prompt; - char *fname; - char *defname; + size_t n; + const char *s; + char *prompt; + char *fname; + char *defname; - if( opt.batch ) - return NULL; + if ( opt.batch ) + return NULL; + + defname = name && namelen? make_printable_string (name, namelen, 0) : NULL; - s = _("Enter new filename"); - - n = strlen(s) + namelen + 10; - defname = name && namelen? make_printable_string( name, namelen, 0): NULL; - prompt = xmalloc(n); - if( defname ) - sprintf(prompt, "%s [%s]: ", s, defname ); - else - sprintf(prompt, "%s: ", s ); - tty_enable_completion(NULL); - fname = cpr_get("openfile.askoutname", prompt ); - cpr_kill_prompt(); - tty_disable_completion(); - xfree(prompt); - if( !*fname ) { - xfree( fname ); fname = NULL; - fname = defname; defname = NULL; + s = _("Enter new filename"); + n = strlen(s) + (defname?strlen (defname):0) + 10; + prompt = xmalloc (n); + if (defname) + snprintf (prompt, n-1, "%s [%s]: ", s, defname ); + else + snprintf (prompt, n-1, "%s: ", s ); + tty_enable_completion(NULL); + fname = cpr_get ("openfile.askoutname", prompt ); + cpr_kill_prompt (); + tty_disable_completion (); + xfree (prompt); + if ( !*fname ) + { + xfree (fname); + fname = defname; + defname = NULL; } - xfree(defname); - if (fname) - trim_spaces (fname); - return fname; + xfree (defname); + if (fname) + trim_spaces (fname); + return fname; } From cvs at cvs.gnupg.org Tue Nov 28 17:36:05 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 28 17:01:13 2006 Subject: [svn] GnuPG - r4351 - in trunk: . common scd sm tools Message-ID: Author: wk Date: 2006-11-28 17:36:02 +0100 (Tue, 28 Nov 2006) New Revision: 4351 Modified: trunk/ChangeLog trunk/NEWS trunk/THANKS trunk/common/ChangeLog trunk/common/http.c trunk/common/util.h trunk/configure.ac trunk/scd/ChangeLog trunk/scd/apdu.c trunk/sm/ChangeLog trunk/sm/certdump.c trunk/tools/ChangeLog trunk/tools/Makefile.am Log: Preparing 2.0.1 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/ChangeLog 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,3 +1,7 @@ +2006-11-28 Werner Koch + + Released 2.0.1. + 2006-11-23 Werner Koch Released 2.0.1rc1. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/NEWS 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,16 +1,18 @@ -Noteworthy changes in version 2.0.1 (not released) -------------------------------------------------- +Noteworthy changes in version 2.0.1 (2006-11-28) +------------------------------------------------ * Experimental support for the PIN pads of the SPR 532 and the Kaan Advanced card readers. Add "disable-keypad" scdaemon.conf if you don't want it. Does currently only work for the OpenPGP card and - the authentication and decrypt keys. + its authentication and decrypt keys. * Fixed build problems on some some platforms and crashes on amd64. + * Fixed a buffer overflow in gpg2. [bug#728] + Noteworthy changes in version 2.0.0 (2006-11-11) -------------------------------------------------- +------------------------------------------------ * First stable version of a GnuPG integrating OpenPGP and S/MIME. Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/THANKS 2006-11-28 16:36:02 UTC (rev 4351) @@ -219,6 +219,7 @@ Steffen Zahn zahn at berlin.snafu.de Steven Bakker steven at icoe.att.com Steven Murdoch sjmurdoch at bigfoot.com +Stoyan Angelov s_angelov at filibeto.org Susanne Schultz schultz at hsp.de Tavis Ormandy taviso at gentoo.org Ted Cabeen secabeen at pobox.com Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/common/ChangeLog 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,3 +1,7 @@ +2006-11-23 Werner Koch + + * http.c: Include i18n.h + 2006-11-21 Werner Koch * estream.c: Remove explicit Pth soft mapping diabling becuase it Modified: trunk/common/http.c =================================================================== --- trunk/common/http.c 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/common/http.c 2006-11-28 16:36:02 UTC (rev 4351) @@ -70,6 +70,7 @@ #endif #include "util.h" +#include "i18n.h" #include "http.h" #ifdef USE_DNS_SRV #include "srv.h" Modified: trunk/common/util.h =================================================================== --- trunk/common/util.h 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/common/util.h 2006-11-28 16:36:02 UTC (rev 4351) @@ -34,7 +34,7 @@ /* Hash function used with libksba. */ #define HASH_FNC ((void (*)(void *, const void*,size_t))gcry_md_write) -/* get all the stuff from jnlib */ +/* Get all the stuff from jnlib. */ #include "../jnlib/logging.h" #include "../jnlib/argparse.h" #include "../jnlib/stringhelp.h" @@ -43,6 +43,7 @@ #include "../jnlib/dotlock.h" #include "../jnlib/utf8conv.h" + #if __GNUC__ >= 4 # define GNUPG_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a))) #else Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/configure.ac 2006-11-28 16:36:02 UTC (rev 4351) @@ -26,7 +26,7 @@ # 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], [2.0.1rc1]) +m4_define([my_version], [2.0.1]) m4_define([my_issvn], [no]) Modified: trunk/scd/ChangeLog =================================================================== --- trunk/scd/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/scd/ChangeLog 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,3 +1,10 @@ +2006-11-28 Werner Koch + + * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to + allow for full 256 byte and the status word. This might break + some old PC/SC drivers or cards, but we will see. Suggested by + Kenneth Wang. + 2006-11-23 Werner Koch * command.c (scd_command_handler): Fixed use of CTRL. Modified: trunk/scd/apdu.c =================================================================== --- trunk/scd/apdu.c 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/scd/apdu.c 2006-11-28 16:36:02 UTC (rev 4351) @@ -2603,7 +2603,7 @@ unsigned char **retbuf, size_t *retbuflen, struct pininfo_s *pininfo) { -#define RESULTLEN 256 +#define RESULTLEN 258 unsigned char result[RESULTLEN+10]; /* 10 extra in case of bugs in the driver. */ size_t resultlen; @@ -2866,7 +2866,7 @@ int handle_more, unsigned char **retbuf, size_t *retbuflen) { -#define RESULTLEN 256 +#define RESULTLEN 258 unsigned char apdu[5+256+1]; size_t apdulen; unsigned char result[RESULTLEN+10]; /* 10 extra in case of bugs in Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/sm/ChangeLog 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,3 +1,8 @@ +2006-11-24 Werner Koch + + * certdump.c (parse_dn_part): Take '#' as a special character only + at the beginning of a string. + 2006-11-21 Werner Koch * certdump.c (my_funopen_hook_ret_t): New. Modified: trunk/sm/certdump.c =================================================================== --- trunk/sm/certdump.c 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/sm/certdump.c 2006-11-28 16:36:02 UTC (rev 4351) @@ -376,7 +376,7 @@ else if (*s == '\"') return NULL; /* invalid encoding */ else if (*s == ',' || *s == '=' || *s == '+' - || *s == '<' || *s == '>' || *s == '#' || *s == ';' ) + || *s == '<' || *s == '>' || *s == ';' ) break; else n++; Modified: trunk/tools/ChangeLog =================================================================== --- trunk/tools/ChangeLog 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/tools/ChangeLog 2006-11-28 16:36:02 UTC (rev 4351) @@ -1,3 +1,7 @@ +2006-11-23 Werner Koch + + * Makefile.am (gpg_connect_agent_LDADD): Add NETLIBS. + 2006-11-21 Werner Koch * gpgconf-comp.c (list_one_option): Cast print size_t arg. Modified: trunk/tools/Makefile.am =================================================================== --- trunk/tools/Makefile.am 2006-11-27 16:41:32 UTC (rev 4350) +++ trunk/tools/Makefile.am 2006-11-28 16:36:02 UTC (rev 4351) @@ -73,8 +73,8 @@ watchgnupg_LDADD = $(NETLIBS) gpg_connect_agent_SOURCES = gpg-connect-agent.c no-libgcrypt.c -gpg_connect_agent_LDADD = $(common_libs) \ - $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) +gpg_connect_agent_LDADD = $(common_libs) $(LIBASSUAN_LIBS) \ + $(GPG_ERROR_LIBS) $(LIBINTL) $(NETLIBS) gpgkey2ssh_SOURCES = gpgkey2ssh.c gpgkey2ssh_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) From cvs at cvs.gnupg.org Tue Nov 28 18:00:51 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue Nov 28 17:25:18 2006 Subject: [svn] GnuPG - r4353 - tags Message-ID: Author: wk Date: 2006-11-28 18:00:51 +0100 (Tue, 28 Nov 2006) New Revision: 4353 Added: tags/gnupg-2.0.1/ Log: Released 2.0.1 Copied: tags/gnupg-2.0.1 (from rev 4352, trunk) From cvs at cvs.gnupg.org Wed Nov 29 14:47:18 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 14:11:40 2006 Subject: [svn] dirmngr - r242 - in trunk: . jnlib m4 po src Message-ID: Author: wk Date: 2006-11-29 14:47:15 +0100 (Wed, 29 Nov 2006) New Revision: 242 Removed: trunk/intl/ trunk/jnlib/utf8conv.c trunk/jnlib/utf8conv.h Modified: trunk/AUTHORS trunk/ChangeLog trunk/Makefile.am trunk/NEWS trunk/README trunk/TODO trunk/configure.ac trunk/jnlib/ChangeLog trunk/jnlib/Makefile.am trunk/jnlib/argparse.c trunk/jnlib/libjnlib-config.h trunk/jnlib/stringhelp.c trunk/m4/Makefile trunk/m4/Makefile.in trunk/po/de.po trunk/po/dirmngr.pot trunk/src/ChangeLog trunk/src/Makefile.am trunk/src/dirmngr-client.c trunk/src/dirmngr.c trunk/src/dirmngr_ldap.c Log: Prepared the 1.0.0 release. Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/AUTHORS 2006-11-29 13:47:15 UTC (rev 242) @@ -24,7 +24,7 @@ src/cdblib.h which are in the public domain. - Copyright 2003, 2004 g10 Code GmbH + Copyright 2003, 2004, 2006 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/ChangeLog 2006-11-29 13:47:15 UTC (rev 242) @@ -1,3 +1,13 @@ +2006-11-29 Werner Koch + + Released 1.0.0. + + * configure.ac: Use SVN magic for version numbers. + (AM_GNU_GETTEXT): Use external flag. + (COPYRIGHT_YEAR_NAME): New. + * intl/: Removed directory + * Makefile.am (SUBDIRS): Removed intl. + 2006-11-17 Werner Koch Released 0.9.7. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/Makefile.am 2006-11-29 13:47:15 UTC (rev 242) @@ -24,5 +24,5 @@ EXTRA_DIST = config.rpath autogen.sh -SUBDIRS = m4 intl jnlib src po doc tests +SUBDIRS = m4 jnlib src po doc tests Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/NEWS 2006-11-29 13:47:15 UTC (rev 242) @@ -1,3 +1,12 @@ +Noteworthy changes in version 1.0 0 (2006-11-29) +------------------------------------------------ + + * Bumbed the version number. + + * Removed included gettext. We now require the system to provide a + suitable installation. + + Noteworthy changes in version 0.9.7 (2006-11-17) ------------------------------------------------ Modified: trunk/README =================================================================== --- trunk/README 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/README 2006-11-29 13:47:15 UTC (rev 242) @@ -1,7 +1,7 @@ Dirmngr - X.509 Directory Manager ------------------------------------- - Version 0.9.x + Version 1.0.0 Intro @@ -23,7 +23,7 @@ Please read the file INSTALL. Here is a quick summary: 1) Unpack the tarball. With GNU tar you can do it this way: - "tar xzvf dirmngr-x.y.z.tar.gz" + "tar xjvf dirmngr-x.y.z.tar.bz2" 2) "cd dirmngr-x.y.z" @@ -40,9 +40,11 @@ /usr/local/bin. Some other files are also installed for internal use. - If you are using dirmngr as part of gnupg 1.9 you are done now. + If you are using dirmngr as part of gnupg 2.0 you are done now. If you want to install it as a system daemon, please see the manual by running the command "info dirmngr" + + Modified: trunk/TODO =================================================================== --- trunk/TODO 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/TODO 2006-11-29 13:47:15 UTC (rev 242) @@ -29,5 +29,5 @@ Needs more investigation. * Test OCSP responder redirection. - We need to figure out an OCSP responder actually using rediection. + We need to figure out an OCSP responder actually using redirection. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/configure.ac 2006-11-29 13:47:15 UTC (rev 242) @@ -23,8 +23,17 @@ AC_PREREQ(2.59) min_automake_version="1.9.3" -AC_INIT(dirmngr, 0.9.7, gpa-dev@gnupg.org) +# 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.0.0]) +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;}')])) +AC_INIT([dirmngr], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), + [bug-dirmngr@gnupg.org]) + NEED_GPG_ERROR_VERSION=1.4 NEED_LIBGCRYPT_API=1 @@ -36,9 +45,12 @@ NEED_KSBA_API=1 NEED_KSBA_VERSION=1.0.0 +COPYRIGHT_YEAR_NAME="2006 g10 Code GmbH" + PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION + AC_CONFIG_SRCDIR(src/dirmngr.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE($PACKAGE, $VERSION) @@ -62,6 +74,8 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT", [Bug report address]) +AC_DEFINE_UNQUOTED(COPYRIGHT_YEAR_NAME, "$COPYRIGHT_YEAR_NAME", + [Used by --version]) AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION", [Required version of Libgcrypt]) AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION", @@ -151,7 +165,7 @@ AM_GNU_GETTEXT_VERSION([0.15]) -AM_GNU_GETTEXT(,[need-ngettext]) +AM_GNU_GETTEXT([external],[need-ngettext]) # # Checks for libraries. @@ -366,6 +380,7 @@ *** This library is for example available at *** ftp://ftp.gnupg.org/pub/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION is required). +*** Note, that libassuan must have been build with Pth support. ***]]) fi if test "$have_ksba" = "no"; then @@ -409,7 +424,7 @@ -AC_CONFIG_FILES([ po/Makefile.in intl/Makefile +AC_CONFIG_FILES([ po/Makefile.in Makefile m4/Makefile jnlib/Makefile Modified: trunk/jnlib/ChangeLog =================================================================== --- trunk/jnlib/ChangeLog 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/jnlib/ChangeLog 2006-11-29 13:47:15 UTC (rev 242) @@ -1,3 +1,14 @@ +2006-11-29 Werner Koch + + * argparse.c (strusage): Define 49 as error reporting address. + (show_help): Include error reporting address is not empty. + + * libjnlib-config.h: Do not require utf8 conversion. + * Makefile.am (libjnlib_a_SOURCES): Do not build utf8conv. + * stringhelp.c (print_sanitized_utf8_buffer) + (print_sanitized_utf8_string): Build only if utf8 support has been + requested. + 2006-11-16 Werner Koch Updated to current jnlib version of GnuPG SVN revision 4334. Modified: trunk/jnlib/Makefile.am =================================================================== --- trunk/jnlib/Makefile.am 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/jnlib/Makefile.am 2006-11-29 13:47:15 UTC (rev 242) @@ -33,12 +33,12 @@ libjnlib-config.h \ stringhelp.c stringhelp.h \ strlist.c strlist.h \ - utf8conv.c utf8conv.h \ argparse.c argparse.h \ logging.c logging.h \ dotlock.c dotlock.h \ types.h mischelp.h +# utf8conv.c utf8conv.h \ # w32-pth.c w32-pth.h \ # w32-afunix.c w32-afunix.h # xmalloc.c xmalloc.h Modified: trunk/jnlib/argparse.c =================================================================== --- trunk/jnlib/argparse.c 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/jnlib/argparse.c 2006-11-29 13:47:15 UTC (rev 242) @@ -820,8 +820,20 @@ puts("\n(A single dash may be used instead of the double ones)"); } if( (s=strusage(19)) ) { /* bug reports to ... */ + /* To allow changing the bug reporting address without + * touching an i18n string, we replace a placeholder @EMAIL@ + * while printing by a string given with strusage(49). */ + const char *email, *point; putchar('\n'); - fputs(s, stdout); + email = strusage (49); + if (email && *email && (point = strstr (s, "@EMAIL@")) ) { + for (; s < point; s++) + putchar (*s); + fputs (email, stdout); + s = point + 7; + } + fputs(s, stdout); + } fflush(stdout); exit(0); @@ -888,11 +900,13 @@ * 16: Long copying conditions (with LFs) * 17: Optional printable OS name * 18: Optional thanks list (with LFs) - * 19: Bug report info + * 19: Bug report info (see also 190). *20..29: Additional lib version strings. *30..39: Additional program info (with LFs) * 40: short usage note (with LF) * 41: long usage note (with LF) + * 49: bug reporting address: If not empty, insert this string + * into the string returned by 19 at @EMAIL@ */ const char * strusage( int level ) Modified: trunk/jnlib/libjnlib-config.h =================================================================== --- trunk/jnlib/libjnlib-config.h 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/jnlib/libjnlib-config.h 2006-11-29 13:47:15 UTC (rev 242) @@ -30,8 +30,8 @@ #include /* gcry_malloc & Cie. */ #include "logging.h" -/* We require support for utf-8 conversion. */ -#define JNLIB_NEED_UTF8CONV 1 +/* We do not require support for utf-8 conversion. */ +/* #define JNLIB_NEED_UTF8CONV 1*/ #ifdef USE_SIMPLE_GETTEXT Modified: trunk/jnlib/stringhelp.c =================================================================== --- trunk/jnlib/stringhelp.c 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/jnlib/stringhelp.c 2006-11-29 13:47:15 UTC (rev 242) @@ -30,7 +30,9 @@ #endif #include "libjnlib-config.h" +#ifdef JNLIB_NEED_UTF8CONV #include "utf8conv.h" +#endif #include "stringhelp.h" @@ -442,6 +444,7 @@ } +#ifdef JNLIB_NEED_UTF8CONV size_t print_sanitized_utf8_buffer (FILE *fp, const void *buffer, size_t length, int delim) @@ -467,8 +470,10 @@ else return print_sanitized_buffer (fp, p, length, delim); } +#endif /*JNLIB_NEED_UTF8CONV*/ + size_t print_sanitized_string2 (FILE *fp, const char *string, int delim, int delim2) { @@ -482,6 +487,7 @@ return string? print_sanitized_buffer (fp, string, strlen (string), delim):0; } +#ifdef JNLIB_NEED_UTF8CONV size_t print_sanitized_utf8_string (FILE *fp, const char *string, int delim) { @@ -489,6 +495,7 @@ string, strlen (string), delim) : 0; } +#endif /*JNLIB_NEED_UTF8CONV*/ /* Create a string from the buffer P_ARG of length N which is suitable for printing. Caller must release the created string using xfree. */ Deleted: trunk/jnlib/utf8conv.c Deleted: trunk/jnlib/utf8conv.h Modified: trunk/m4/Makefile =================================================================== --- trunk/m4/Makefile 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/m4/Makefile 2006-11-29 13:47:15 UTC (rev 242) @@ -39,25 +39,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/glibc2.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnupg-pth.m4 $(top_srcdir)/m4/gpg-error.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ - $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-h.m4 \ - $(top_srcdir)/m4/inttypes-pri.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ksba.m4 \ - $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-pth.m4 \ + $(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/ksba.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/libgcrypt.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ - $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ - $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -67,7 +56,6 @@ DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /home/wk/w/dirmngr/missing --run aclocal-1.9 -ALLOCA = AMDEP_FALSE = # AMDEP_TRUE = AMTAR = ${SHELL} /home/wk/w/dirmngr/missing --run tar @@ -75,16 +63,12 @@ AUTOHEADER = ${SHELL} /home/wk/w/dirmngr/missing --run autoheader AUTOMAKE = ${SHELL} /home/wk/w/dirmngr/missing --run automake-1.9 AWK = gawk -BUILD_INCLUDED_LIBINTL = no -CATOBJEXT = .gmo CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wformat-nonliteral -Wno-pointer-sign -CFLAG_VISIBILITY = -fvisibility=hidden CPP = gcc -E CPPFLAGS = CYGPATH_W = echo -DATADIRNAME = share DEFS = -DHAVE_CONFIG_H DEPDIR = .deps ECHO_C = @@ -92,29 +76,17 @@ ECHO_T = EGREP = /bin/grep -E EXEEXT = -GENCAT = gencat -GLIBC2 = yes -GLIBC21 = yes GMSGFMT = /usr/bin/msgfmt GMSGFMT_015 = /usr/bin/msgfmt GPG_ERROR_CFLAGS = -I/usr/local/include GPG_ERROR_CONFIG = /usr/local/bin/gpg-error-config GPG_ERROR_LIBS = -L/usr/local/lib -lgpg-error GREP = /bin/grep -HAVE_ASPRINTF = 1 -HAVE_POSIX_PRINTF = 1 -HAVE_SNPRINTF = 1 -HAVE_VISIBILITY = 1 -HAVE_WPRINTF = 0 INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -INSTOBJEXT = .mo -INTLBISON = bison INTLLIBS = -INTLOBJS = -INTL_LIBTOOL_SUFFIX_PREFIX = INTL_MACOSX_LIBS = KSBA_CFLAGS = -I/usr/local/include KSBA_CONFIG = /usr/local/bin/ksba-config @@ -129,20 +101,14 @@ LIBGCRYPT_CFLAGS = -I/usr/local/include -I/usr/local/include LIBGCRYPT_CONFIG = /usr/local/bin/libgcrypt-config LIBGCRYPT_LIBS = -L/usr/local/lib -lgcrypt -L/usr/local/lib -lgpg-error -LIBICONV = +LIBICONV = -liconv LIBINTL = -LIBMULTITHREAD = -lpthread LIBOBJS = ${LIBOBJDIR}funopen$U.o -LIBPTH = LIBS = -LIBTHREAD = LN_S = ln -s -LTLIBICONV = +LTLIBICONV = -liconv LTLIBINTL = -LTLIBMULTITHREAD = -lpthread LTLIBOBJS = ${LIBOBJDIR}funopen$U.lo -LTLIBPTH = -LTLIBTHREAD = MAINT = MAINTAINER_MODE_FALSE = # MAINTAINER_MODE_TRUE = @@ -152,11 +118,11 @@ MSGMERGE = /usr/bin/msgmerge OBJEXT = o PACKAGE = dirmngr -PACKAGE_BUGREPORT = gpa-dev@gnupg.org +PACKAGE_BUGREPORT = bug-dirmngr@gnupg.org PACKAGE_NAME = dirmngr -PACKAGE_STRING = dirmngr 0.9.7 +PACKAGE_STRING = dirmngr 1.0.0-svn241 PACKAGE_TARNAME = dirmngr -PACKAGE_VERSION = 0.9.7 +PACKAGE_VERSION = 1.0.0-svn241 PATH_SEPARATOR = : POSUB = po PTH_CFLAGS = -I/usr/include @@ -166,10 +132,8 @@ SET_MAKE = SHELL = /bin/sh STRIP = -USE_INCLUDED_LIBINTL = no USE_NLS = yes -VERSION = 0.9.7 -WOE32DLL = no +VERSION = 1.0.0-svn241 XGETTEXT = /usr/bin/xgettext XGETTEXT_015 = /usr/bin/xgettext ac_ct_CC = gcc Modified: trunk/m4/Makefile.in =================================================================== --- trunk/m4/Makefile.in 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/m4/Makefile.in 2006-11-29 13:47:15 UTC (rev 242) @@ -39,25 +39,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/glibc2.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnupg-pth.m4 $(top_srcdir)/m4/gpg-error.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ - $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-h.m4 \ - $(top_srcdir)/m4/inttypes-pri.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ksba.m4 \ - $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-pth.m4 \ + $(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/ksba.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/libgcrypt.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ - $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ - $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -67,7 +56,6 @@ DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ @@ -75,16 +63,12 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ -DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ @@ -92,29 +76,17 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -GENCAT = @GENCAT@ -GLIBC2 = @GLIBC2@ -GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ GREP = @GREP@ -HAVE_ASPRINTF = @HAVE_ASPRINTF@ -HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ -HAVE_SNPRINTF = @HAVE_SNPRINTF@ -HAVE_VISIBILITY = @HAVE_VISIBILITY@ -HAVE_WPRINTF = @HAVE_WPRINTF@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KSBA_CFLAGS = @KSBA_CFLAGS@ KSBA_CONFIG = @KSBA_CONFIG@ @@ -131,18 +103,12 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ @@ -166,10 +132,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -WOE32DLL = @WOE32DLL@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ ac_ct_CC = @ac_ct_CC@ Modified: trunk/po/de.po =================================================================== --- trunk/po/de.po 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/po/de.po 2006-11-29 13:47:15 UTC (rev 242) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: dirmngr 0.9.2\n" "Report-Msgid-Bugs-To: gpa-dev@gnupg.org\n" -"POT-Creation-Date: 2006-11-17 10:59+0100\n" -"PO-Revision-Date: 2006-11-17 11:02+0100\n" +"POT-Creation-Date: 2006-11-29 14:06+0100\n" +"PO-Revision-Date: 2006-11-29 14:07+0100\n" "Last-Translator: Werner Koch \n" "Language-Team: de\n" "MIME-Version: 1.0\n" @@ -103,7 +103,7 @@ msgid " runtime cached certificates: %u\n" msgstr "zur Laufzeit zwischengespeicherte Zertifikate: %u\n" -#: src/certcache.c:480 src/dirmngr-client.c:366 +#: src/certcache.c:480 src/dirmngr-client.c:365 msgid "certificate already cached\n" msgstr "Zertifikat ist bereits im Zwischenspeicher\n" @@ -111,7 +111,7 @@ msgid "certificate cached\n" msgstr "Zertifikat wurde zwischengespeichert\n" -#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:370 +#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:369 #, c-format msgid "error caching certificate: %s\n" msgstr "Fehler beim Zwischenspeichern des Zertifikats: %s\n" @@ -243,7 +243,7 @@ msgid "unsupported record type in `%s' line %u skipped\n" msgstr "Nicht unterst?tzter Datensatztyp in `%s', Zeile %u ?bergangen\n" -#: src/crlcache.c:593 src/crlcache.c:829 src/dirmngr.c:1234 +#: src/crlcache.c:593 src/crlcache.c:829 src/dirmngr.c:1236 #, c-format msgid "error reading `%s': %s\n" msgstr "Fehler beim Lesen von `%s': %s\n" @@ -690,7 +690,7 @@ msgid "certificate search not possible due to disabled %s\n" msgstr "Zertifikatsuche ist nicht m?glich da %s abgeschaltet ist\n" -#: src/dirmngr.c:109 +#: src/dirmngr.c:111 msgid "" "@Commands:\n" " " @@ -698,35 +698,35 @@ "@Kommandos:\n" " " -#: src/dirmngr.c:111 +#: src/dirmngr.c:113 msgid "run in server mode (foreground)" msgstr "Im Servermodus ausf?hren (Vordergrund)" -#: src/dirmngr.c:112 +#: src/dirmngr.c:114 msgid "run in daemon mode (background)" msgstr "Im Daemonmodus ausf?hren (Hintergrund)" -#: src/dirmngr.c:113 +#: src/dirmngr.c:115 msgid "list the contents of the CRL cache" msgstr "Den Inhalt des CRL Zwischenspeichers anzeigen" -#: src/dirmngr.c:114 +#: src/dirmngr.c:116 msgid "|FILE|load CRL from FILE into cache" msgstr "|DATEI|Lade die CRL aus der DATEI in den Zwischenspeicher" -#: src/dirmngr.c:115 +#: src/dirmngr.c:117 msgid "|URL|fetch a CRL from URL" msgstr "|URL|Hole eine CRL von dieser URL" -#: src/dirmngr.c:116 +#: src/dirmngr.c:118 msgid "shutdown the dirmngr" msgstr "Den Dirmngr herunterfahren" -#: src/dirmngr.c:117 +#: src/dirmngr.c:119 msgid "flush the cache" msgstr "Den Zwischenspeicher l?schen" -#: src/dirmngr.c:121 +#: src/dirmngr.c:123 msgid "" "@\n" "Options:\n" @@ -736,111 +736,111 @@ "Optionen:\n" " " -#: src/dirmngr.c:123 src/dirmngr-client.c:67 src/dirmngr_ldap.c:76 +#: src/dirmngr.c:125 src/dirmngr-client.c:67 src/dirmngr_ldap.c:76 msgid "verbose" msgstr "ausf?hrlich" -#: src/dirmngr.c:124 src/dirmngr-client.c:68 src/dirmngr_ldap.c:77 +#: src/dirmngr.c:126 src/dirmngr-client.c:68 src/dirmngr_ldap.c:77 msgid "be somewhat more quiet" msgstr "etwas weniger Ausgaben erzeugen" -#: src/dirmngr.c:125 +#: src/dirmngr.c:127 msgid "sh-style command output" msgstr "Kommandausgabe f?r /bin/sh" -#: src/dirmngr.c:126 +#: src/dirmngr.c:128 msgid "csh-style command output" msgstr "Kommandausgabe f?r /bin/csh" -#: src/dirmngr.c:127 +#: src/dirmngr.c:129 msgid "|FILE|read options from FILE" msgstr "|DATEI|Lese Optionen aus DATEI" -#: src/dirmngr.c:129 +#: src/dirmngr.c:131 msgid "|LEVEL|set the debugging level to LEVEL" msgstr "|NAME|Setze die Debugebene auf NAME" -#: src/dirmngr.c:130 +#: src/dirmngr.c:132 msgid "do not detach from the console" msgstr "Nicht von der Konsole losl?sen" -#: src/dirmngr.c:131 +#: src/dirmngr.c:133 msgid "|FILE|write server mode logs to FILE" msgstr "|DATEI|Schreibe im Servermodus Logs auf DATEI" -#: src/dirmngr.c:132 +#: src/dirmngr.c:134 msgid "run without asking a user" msgstr "Ausf?hrung ohne Benutzernachfrage" -#: src/dirmngr.c:133 +#: src/dirmngr.c:135 msgid "force loading of outdated CRLs" msgstr "Laden von abgelaufenen CRLs erzwingen" -#: src/dirmngr.c:134 +#: src/dirmngr.c:136 msgid "allow sending OCSP requests" msgstr "OCSP Anfragen erlauben" -#: src/dirmngr.c:135 +#: src/dirmngr.c:137 msgid "inhibit the use of HTTP" msgstr "Sperre die Benutzung von HTTP" -#: src/dirmngr.c:136 +#: src/dirmngr.c:138 msgid "inhibit the use of LDAP" msgstr "Sperre die Benutzung von LDAP" -#: src/dirmngr.c:138 +#: src/dirmngr.c:140 msgid "ignore HTTP CRL distribution points" msgstr "?bergehe HTTP CRL Distribution Points" -#: src/dirmngr.c:140 +#: src/dirmngr.c:142 msgid "ignore LDAP CRL distribution points" msgstr "?bergehe LDAP CRL Distribution Points" -#: src/dirmngr.c:142 +#: src/dirmngr.c:144 msgid "ignore certificate contained OCSP service URLs" msgstr "?bergehe im Zertifikat enthaltene OCSP Service URLs" -#: src/dirmngr.c:148 +#: src/dirmngr.c:150 msgid "|URL|redirect all HTTP requests to URL" msgstr "|URL|Leite alle HTTP Anfragen ?ber URL" -#: src/dirmngr.c:150 +#: src/dirmngr.c:152 msgid "|HOST|use HOST for LDAP queries" msgstr "|HOST|Benutze HOST f?r LDAP Anfragen" -#: src/dirmngr.c:152 +#: src/dirmngr.c:154 msgid "do not use fallback hosts with --ldap-proxy" msgstr "Keine Benutzung der R?ckgriffshosts mit --ldap-proxy" -#: src/dirmngr.c:155 +#: src/dirmngr.c:157 msgid "|FILE|read LDAP server list from FILE" msgstr "|DATEI|Lese die LDAP Serverliste aus DATEI" -#: src/dirmngr.c:157 +#: src/dirmngr.c:159 msgid "add new servers discovered in CRL distribution points to serverlist" msgstr "F?ge neue Server aus den CRL Distribution Points der Serverliste hinzu" -#: src/dirmngr.c:159 src/dirmngr_ldap.c:78 +#: src/dirmngr.c:161 src/dirmngr_ldap.c:78 msgid "|N|set LDAP timeout to N seconds" msgstr "|N|Setze das LDAP Timeout auf N Sekunden" -#: src/dirmngr.c:161 +#: src/dirmngr.c:163 msgid "|URL|use OCSP responder at URL" msgstr "|URL|Benutze den OCSP Reponder mit dieser URL" -#: src/dirmngr.c:162 +#: src/dirmngr.c:164 msgid "|FPR|OCSP response signed by FPR" msgstr "|FPR|OCSP Antwort ist durch FPR signiert" -#: src/dirmngr.c:167 +#: src/dirmngr.c:169 msgid "|N|do not return more than N items in one query" msgstr "|N|Nicht mehr als N Angaben in einer Anfrage zur?ckgeben" -#: src/dirmngr.c:169 +#: src/dirmngr.c:171 msgid "|FILE|listen on socket FILE" msgstr "|DATEI|Anfragen auf Socket DATEI annehmen" -#: src/dirmngr.c:182 +#: src/dirmngr.c:184 msgid "" "@\n" "(See the \"info\" manual for a complete listing of all commands and " @@ -850,15 +850,17 @@ "(Im \"info\"-Handbuch findet sich eine vollst?ndige Liste aller Kommandos " "und Optionen)\n" -#: src/dirmngr.c:227 src/dirmngr-client.c:143 src/dirmngr_ldap.c:140 -msgid "Please report bugs to .\n" -msgstr "Berichte ?ber Bugs (Programmfehler) bitte an .\n" +#. TRANSLATORS: @EMAIL will get replaced by the actual bug +#. reporting address. +#: src/dirmngr.c:231 src/dirmngr-client.c:142 src/dirmngr_ldap.c:139 +msgid "Please report bugs to <@EMAIL@>.\n" +msgstr "Berichte ?ber Bugs (Programmfehler) bitte an <@EMAIL@>.\n" -#: src/dirmngr.c:231 +#: src/dirmngr.c:234 msgid "Usage: dirmngr [options] (-h for help)" msgstr "Gebrauch: dirmnr [Optionen] [Kommando [Argumente]]" -#: src/dirmngr.c:234 +#: src/dirmngr.c:236 msgid "" "Syntax: dirmngr [options] [command [args]]\n" "LDAP and OCSP access for GnuPG\n" @@ -866,180 +868,180 @@ "Syntax: dirmngr [Optionen] [Kommando [Argumente]]\n" "LDAP und OCSP Zugriff f?r GnuPG\n" -#: src/dirmngr.c:305 +#: src/dirmngr.c:307 #, c-format msgid "invalid debug-level `%s' given\n" msgstr "Ung?ltige Debugebene '%s' angegeben\n" -#: src/dirmngr.c:306 +#: src/dirmngr.c:308 #, c-format msgid "valid debug levels are: %s\n" msgstr "G?ltige Debugebenen sind: %s\n" -#: src/dirmngr.c:344 +#: src/dirmngr.c:346 msgid "usage: dirmngr [options] " msgstr "Gebrauch: dirmngr [Optionen] " -#: src/dirmngr.c:369 +#: src/dirmngr.c:371 #, c-format msgid "error spawning ldap wrapper reaper thread: %s\n" msgstr "Fehler beim Starten des LDAP Wrapper Kontrollthreads: %s\n" -#: src/dirmngr.c:508 src/dirmngr.c:518 +#: src/dirmngr.c:510 src/dirmngr.c:520 #, c-format msgid "%s is too old (need %s, have %s)\n" msgstr "%s ist zu alt (ben?tige %s, habe %s)\n" -#: src/dirmngr.c:616 +#: src/dirmngr.c:618 #, c-format msgid "NOTE: no default option file `%s'\n" msgstr "Hinweis: Voreingestellte Optionendatei `%s' nicht vorhanden\n" -#: src/dirmngr.c:621 src/dirmngr.c:1291 +#: src/dirmngr.c:623 src/dirmngr.c:1293 #, c-format msgid "option file `%s': %s\n" msgstr "Optionendatei `%s': %s\n" -#: src/dirmngr.c:629 +#: src/dirmngr.c:631 #, c-format msgid "reading options from `%s'\n" msgstr "Optionen werden von `%s' gelesen\n" -#: src/dirmngr.c:730 +#: src/dirmngr.c:732 #, c-format msgid "WARNING: running with faked system time %s\n" msgstr "WARNUNG: Prozess l?uft mit get?rkter Systemzeit %s\n" -#: src/dirmngr.c:807 +#: src/dirmngr.c:809 msgid "colons are not allowed in the socket name\n" msgstr "Doppelpunkte sind im Namen des Sockets nicht erlaubt\n" -#: src/dirmngr.c:812 +#: src/dirmngr.c:814 msgid "name of socket too long\n" msgstr "Name des Sockets ist zu lang\n" -#: src/dirmngr.c:819 +#: src/dirmngr.c:821 #, c-format msgid "can't create socket: %s\n" msgstr "Fehler beim Erzeugen des Sockets: %s\n" -#: src/dirmngr.c:838 +#: src/dirmngr.c:840 #, c-format msgid "error binding socket to `%s': %s\n" msgstr "Fehler beim Binden des Sockets an `%s': %s\n" -#: src/dirmngr.c:847 +#: src/dirmngr.c:849 #, c-format msgid "listen() failed: %s\n" msgstr "listen() fehlgeschlagen: %s\n" -#: src/dirmngr.c:853 +#: src/dirmngr.c:855 #, c-format msgid "listening on socket `%s'\n" msgstr "Anfragen werden auf Socket `%s' engegengenommen\n" -#: src/dirmngr.c:859 +#: src/dirmngr.c:861 #, c-format msgid "fork failed: %s\n" msgstr "fork() fehlgeschlagen: %s\n" -#: src/dirmngr.c:877 +#: src/dirmngr.c:879 msgid "out of core\n" msgstr "Nicht gen?gend Hauptspeicher vorhanden\n" -#: src/dirmngr.c:916 +#: src/dirmngr.c:918 #, c-format msgid "setsid() failed: %s\n" msgstr "setsid() fehlgeschlagen: %s\n" -#: src/dirmngr.c:926 +#: src/dirmngr.c:928 #, c-format msgid "chdir to / failed: %s\n" msgstr "chdir nach / fehlgeschlagen: %s\n" -#: src/dirmngr.c:981 +#: src/dirmngr.c:983 #, c-format msgid "fetching CRL from `%s' failed: %s\n" msgstr "Holen der CRL von `%s' fehlgeschlagen: %s\n" -#: src/dirmngr.c:987 +#: src/dirmngr.c:989 #, c-format msgid "processing CRL from `%s' failed: %s\n" msgstr "Verarbeitung der CRL von `%s' fehlgeschlagen: %s\n" -#: src/dirmngr.c:1138 +#: src/dirmngr.c:1140 #, c-format msgid "error opening `%s': %s\n" msgstr "Fehler beim ?ffnen von `%s': %s\n" -#: src/dirmngr.c:1155 +#: src/dirmngr.c:1157 #, c-format msgid "%s:%u: line too long - skipped\n" msgstr "%s:%u: Zeile ist zu lang - ?bergangen\n" -#: src/dirmngr.c:1183 +#: src/dirmngr.c:1185 #, c-format msgid "%s:%u: no hostname given\n" msgstr "%s:%u: Kein Hostname angegeben\n" -#: src/dirmngr.c:1202 +#: src/dirmngr.c:1204 #, c-format msgid "%s:%u: password given without user\n" msgstr "%s:%u: Passwort angegeben ohne Username\n" -#: src/dirmngr.c:1223 +#: src/dirmngr.c:1225 #, c-format msgid "%s:%u: skipping this line\n" msgstr "%s:%u: Diese Zeile wird ?bersprungen\n" -#: src/dirmngr.c:1323 +#: src/dirmngr.c:1325 msgid "SIGHUP received - re-reading configuration and flushing caches\n" msgstr "" "SIGHUP empfangen - lese die Konfiguration erneut und l?sche die " "Zwischenspeicher\n" -#: src/dirmngr.c:1337 +#: src/dirmngr.c:1339 msgid "SIGUSR2 received - no action defined\n" msgstr "SIGUSR2 empfangen - keine Aktion definiert\n" -#: src/dirmngr.c:1342 +#: src/dirmngr.c:1344 msgid "SIGTERM received - shutting down ...\n" msgstr "SIGTERM empfangen - wird heruntergefahren ...\n" -#: src/dirmngr.c:1344 +#: src/dirmngr.c:1346 #, c-format msgid "SIGTERM received - still %d active connections\n" msgstr "SIGTERM empfangen - immer noch %d Verbindungen aktiv\n" -#: src/dirmngr.c:1349 +#: src/dirmngr.c:1351 msgid "shutdown forced\n" msgstr "Herunterfahren wurde erzwungen\n" -#: src/dirmngr.c:1357 +#: src/dirmngr.c:1359 msgid "SIGINT received - immediate shutdown\n" msgstr "SIGINT empfangen - wird sofort heruntergefahren\n" -#: src/dirmngr.c:1364 +#: src/dirmngr.c:1366 #, c-format msgid "signal %d received - no action defined\n" msgstr "Signal %d empfangen - keine Aktion definiert\n" -#: src/dirmngr.c:1378 +#: src/dirmngr.c:1380 #, c-format msgid "handler for fd %d started\n" msgstr "Routine f?r fd %d gestartet\n" -#: src/dirmngr.c:1383 +#: src/dirmngr.c:1385 #, c-format msgid "handler for fd %d terminated\n" msgstr "Routine f?r fd %d beendet\n" -#: src/dirmngr.c:1439 +#: src/dirmngr.c:1441 #, c-format msgid "accept failed: %s - waiting 1s\n" msgstr "accept() fehlgeschlagen: %s - warte 1s\n" -#: src/dirmngr.c:1446 +#: src/dirmngr.c:1448 #, c-format msgid "error spawning connection handler: %s\n" msgstr "Fehler beim Starten des Verbindungshandler: %s\n" @@ -1583,12 +1585,12 @@ msgid "certificates are expected in PEM format" msgstr "Zertifikate werden im PEM Format erwartet" -#: src/dirmngr-client.c:147 +#: src/dirmngr-client.c:146 msgid "Usage: dirmngr-client [options] [certfile|pattern] (-h for help)\n" msgstr "" "Gebrauch: dirmngr-client [Optionen] [Zertdatei|Muster] (-h f?r Hilfe)\n" -#: src/dirmngr-client.c:151 +#: src/dirmngr-client.c:150 msgid "" "Syntax: dirmngr-client [options] [certfile|pattern]\n" "Test an X.509 certificate against a CRL or do an OCSP check\n" @@ -1601,98 +1603,98 @@ "The Prozess gibt 0 zur?ck wenn das Zertifikat g?ltig ist, 1 wenn es nicht\n" "g?ltig ist und weitere Werte bei anderen Fehlern.\n" -#: src/dirmngr-client.c:266 src/dirmngr-client.c:970 +#: src/dirmngr-client.c:265 src/dirmngr-client.c:969 #, c-format msgid "error reading certificate from stdin: %s\n" msgstr "Fehler beim Lesen des Zertifikats von der Standardeingabe: %s\n" -#: src/dirmngr-client.c:273 +#: src/dirmngr-client.c:272 #, c-format msgid "error reading certificate from `%s': %s\n" msgstr "Fehler beim Lesen des Zertifikats von `%s': %s\n" -#: src/dirmngr-client.c:287 +#: src/dirmngr-client.c:286 msgid "certificate too large to make any sense\n" msgstr "Zertifikat ist zu gro? um Sinnvoll zu sein\n" -#: src/dirmngr-client.c:313 +#: src/dirmngr-client.c:312 #, c-format msgid "lookup failed: %s\n" msgstr "Aufsuchen fehlgeschlagen: %s\n" -#: src/dirmngr-client.c:328 +#: src/dirmngr-client.c:327 #, c-format msgid "loading CRL `%s' failed: %s\n" msgstr "Laden der CRL von `%s' fehlgeschlagen: %s\n" -#: src/dirmngr-client.c:356 +#: src/dirmngr-client.c:355 msgid "a dirmngr daemon is up and running\n" msgstr "Ein dirmngr ist vorhanden und aktiv\n" -#: src/dirmngr-client.c:378 +#: src/dirmngr-client.c:377 #, c-format msgid "validation of certificate failed: %s\n" msgstr "Pr?fung des Zertifikats fehlgeschlagen: %s\n" -#: src/dirmngr-client.c:385 src/dirmngr-client.c:981 +#: src/dirmngr-client.c:384 src/dirmngr-client.c:980 msgid "certificate is valid\n" msgstr "Zertifikat ist g?ltig\n" -#: src/dirmngr-client.c:391 src/dirmngr-client.c:989 +#: src/dirmngr-client.c:390 src/dirmngr-client.c:988 msgid "certificate has been revoked\n" msgstr "Zertifikat wurde widerrufen\n" -#: src/dirmngr-client.c:396 src/dirmngr-client.c:991 +#: src/dirmngr-client.c:395 src/dirmngr-client.c:990 #, c-format msgid "certificate check failed: %s\n" msgstr "Zertifikatpr?fung fehlgeschlagen: %s\n" -#: src/dirmngr-client.c:407 +#: src/dirmngr-client.c:406 #, c-format msgid "got status: `%s'\n" msgstr "Erhielt Status: `%s'\n" -#: src/dirmngr-client.c:422 +#: src/dirmngr-client.c:421 #, c-format msgid "error writing base64 encoding: %s\n" msgstr "Fehler beim Schreiben der Base-64 Darstellung: %s\n" -#: src/dirmngr-client.c:454 +#: src/dirmngr-client.c:453 msgid "apparently no running dirmngr\n" msgstr "Offensichtlich ist kein Dirmngr vorhanden\n" -#: src/dirmngr-client.c:459 +#: src/dirmngr-client.c:458 msgid "no running dirmngr - starting one\n" msgstr "Dirmngr l?uft nicht - ein neuer wird gestartet\n" -#: src/dirmngr-client.c:492 +#: src/dirmngr-client.c:491 msgid "malformed DIRMNGR_INFO environment variable\n" msgstr "Fehlerhafte DIRMNGR_INFO Variable\n" -#: src/dirmngr-client.c:507 +#: src/dirmngr-client.c:506 #, c-format msgid "dirmngr protocol version %d is not supported\n" msgstr "Dirmngr Protocol Version %d wird nicht unterst?tzt\n" -#: src/dirmngr-client.c:523 +#: src/dirmngr-client.c:522 msgid "can't connect to the dirmngr - trying fall back\n" msgstr "Verbindung zum Dirmngr nicht m?glich - R?ckfallmethode wird versucht\n" -#: src/dirmngr-client.c:531 +#: src/dirmngr-client.c:530 #, c-format msgid "can't connect to the dirmngr: %s\n" msgstr "Verbindung zum Dirmngr nicht m?glich: %s\n" -#: src/dirmngr-client.c:780 +#: src/dirmngr-client.c:779 #, c-format msgid "unsupported inquiry `%s'\n" msgstr "Nicht unterst?tzte INQUIRY `%s'\n" -#: src/dirmngr-client.c:876 +#: src/dirmngr-client.c:875 msgid "absolute file name expected\n" msgstr "Absoluter Dateiname erwartet\n" -#: src/dirmngr-client.c:918 +#: src/dirmngr-client.c:917 #, c-format msgid "looking up `%s'\n" msgstr "Auffinden von `%s'\n" @@ -1742,11 +1744,11 @@ msgid "|STRING|return the attribute STRING" msgstr "|STRING|Gib das Attribut STRING zur?ck" -#: src/dirmngr_ldap.c:144 +#: src/dirmngr_ldap.c:143 msgid "Usage: dirmngr_ldap [options] [URL] (-h for help)\n" msgstr "Gebrauch: dirmngr_ldap [Optionen] [URL] (-h f?r Hilfe)\n" -#: src/dirmngr_ldap.c:147 +#: src/dirmngr_ldap.c:146 msgid "" "Syntax: dirmngr_ldap [options] [URL]\n" "Internal LDAP helper for Dirmngr.\n" @@ -1756,116 +1758,119 @@ "Internes LDAP-Hilfsprogramm f?r Dirmngr.\n" "Interface und Optionen k?nnen sich mit jedem Release ?ndern.\n" -#: src/dirmngr_ldap.c:249 +#: src/dirmngr_ldap.c:248 #, c-format msgid "invalid port number %d\n" msgstr "Ung?ltige Portnummer %d\n" -#: src/dirmngr_ldap.c:310 +#: src/dirmngr_ldap.c:309 #, c-format msgid "scanning result for attribute `%s'\n" msgstr "Absuchen des Ergebnisses nach Attribut `%s'\n" -#: src/dirmngr_ldap.c:317 src/dirmngr_ldap.c:379 src/dirmngr_ldap.c:403 -#: src/dirmngr_ldap.c:414 src/dirmngr_ldap.c:526 +#: src/dirmngr_ldap.c:316 src/dirmngr_ldap.c:378 src/dirmngr_ldap.c:402 +#: src/dirmngr_ldap.c:413 src/dirmngr_ldap.c:525 #, c-format msgid "error writing to stdout: %s\n" msgstr "Fehler beim Schreiben auf Standardausgabe: %s\n" -#: src/dirmngr_ldap.c:331 +#: src/dirmngr_ldap.c:330 #, c-format msgid " available attribute `%s'\n" msgstr " verf?gbare Attribute `%s'\n" -#: src/dirmngr_ldap.c:358 +#: src/dirmngr_ldap.c:357 #, c-format msgid "attribute `%s' not found\n" msgstr "Attribut `%s' nicht gefunden\n" -#: src/dirmngr_ldap.c:364 +#: src/dirmngr_ldap.c:363 #, c-format msgid "found attribute `%s'\n" msgstr "Attribut `%s' gefunden\n" -#: src/dirmngr_ldap.c:461 +#: src/dirmngr_ldap.c:460 #, c-format msgid "processing url `%s'\n" msgstr "Verarbeiten der URL `%s'\n" -#: src/dirmngr_ldap.c:463 +#: src/dirmngr_ldap.c:462 #, c-format msgid " user `%s'\n" msgstr " Benutzer `%s'\n" -#: src/dirmngr_ldap.c:465 +#: src/dirmngr_ldap.c:464 #, c-format msgid " pass `%s'\n" msgstr " Passwort `%s'\n" -#: src/dirmngr_ldap.c:467 +#: src/dirmngr_ldap.c:466 #, c-format msgid " host `%s'\n" msgstr " Host `%s'\n" -#: src/dirmngr_ldap.c:468 +#: src/dirmngr_ldap.c:467 #, c-format msgid " port %d\n" msgstr " Port %d\n" -#: src/dirmngr_ldap.c:470 +#: src/dirmngr_ldap.c:469 #, c-format msgid " DN `%s'\n" msgstr " DN `%s'\n" -#: src/dirmngr_ldap.c:472 +#: src/dirmngr_ldap.c:471 #, c-format msgid " filter `%s'\n" msgstr " Filter `%s'\n" -#: src/dirmngr_ldap.c:477 src/dirmngr_ldap.c:480 +#: src/dirmngr_ldap.c:476 src/dirmngr_ldap.c:479 #, c-format msgid " attr `%s'\n" msgstr " Attribut `%s'\n" -#: src/dirmngr_ldap.c:486 +#: src/dirmngr_ldap.c:485 #, c-format msgid "no host name in `%s'\n" msgstr "Kein Hostname in `%s'\n" -#: src/dirmngr_ldap.c:491 +#: src/dirmngr_ldap.c:490 #, c-format msgid "no attribute given for query `%s'\n" msgstr "Kein Attribut f?r Abfrage `%s' angegeben\n" -#: src/dirmngr_ldap.c:497 +#: src/dirmngr_ldap.c:496 msgid "WARNING: using first attribute only\n" msgstr "WARNUNG: Es wird nur das erste Attribut benutzt\n" -#: src/dirmngr_ldap.c:504 +#: src/dirmngr_ldap.c:503 #, c-format msgid "LDAP init to `%s:%d' failed: %s\n" msgstr "LDAP Initialisierung von `%s:%d' fehlgeschlagen: %s\n" -#: src/dirmngr_ldap.c:510 +#: src/dirmngr_ldap.c:509 #, c-format msgid "binding to `%s:%d' failed: %s\n" msgstr "Anbindung an `%s:%d' fehlgeschlagen: %s\n" -#: src/dirmngr_ldap.c:533 +#: src/dirmngr_ldap.c:532 #, c-format msgid "searching `%s' failed: %s\n" msgstr "Suche mit `%s' fehlgeschlagen: %s\n" -#: src/dirmngr_ldap.c:564 +#: src/dirmngr_ldap.c:563 #, c-format msgid "`%s' is not an LDAP URL\n" msgstr "`%s' ist kein LDAP URL\n" -#: src/dirmngr_ldap.c:570 +#: src/dirmngr_ldap.c:569 #, c-format msgid "`%s' is an invalid LDAP URL\n" msgstr "`%s' ist ein ung?ltiger LDAP URL\n" +#~ msgid "Please report bugs to .\n" +#~ msgstr "Berichte ?ber Bugs (Programmfehler) bitte an .\n" + #~ msgid "invalid HTTP proxy (%s): %s\n" #~ msgstr "Ung?ltiger HTTP Proxy (%s): %s\n" @@ -1887,9 +1892,6 @@ #~ msgid "failed to find issuer certificate: %s\n" #~ msgstr "Herausgeberzertifikat nicht gefunden: %s\n" -#~ msgid "Please report bugs to " -#~ msgstr "Berichte ?ber Bugs (Programmfehler) bitte an " - #~ msgid "no issuer found in certificate" #~ msgstr "Im Zertifikat ist kein Herausgeber enthalten" Modified: trunk/po/dirmngr.pot =================================================================== --- trunk/po/dirmngr.pot 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/po/dirmngr.pot 2006-11-29 13:47:15 UTC (rev 242) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: gpa-dev@gnupg.org\n" -"POT-Creation-Date: 2006-11-17 10:59+0100\n" +"POT-Creation-Date: 2006-11-29 14:06+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -100,7 +100,7 @@ msgid " runtime cached certificates: %u\n" msgstr "" -#: src/certcache.c:480 src/dirmngr-client.c:366 +#: src/certcache.c:480 src/dirmngr-client.c:365 msgid "certificate already cached\n" msgstr "" @@ -108,7 +108,7 @@ msgid "certificate cached\n" msgstr "" -#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:370 +#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:369 #, c-format msgid "error caching certificate: %s\n" msgstr "" @@ -235,7 +235,7 @@ msgid "unsupported record type in `%s' line %u skipped\n" msgstr "" -#: src/crlcache.c:593 src/crlcache.c:829 src/dirmngr.c:1234 +#: src/crlcache.c:593 src/crlcache.c:829 src/dirmngr.c:1236 #, c-format msgid "error reading `%s': %s\n" msgstr "" @@ -654,344 +654,346 @@ msgid "certificate search not possible due to disabled %s\n" msgstr "" -#: src/dirmngr.c:109 +#: src/dirmngr.c:111 msgid "" "@Commands:\n" " " msgstr "" -#: src/dirmngr.c:111 +#: src/dirmngr.c:113 msgid "run in server mode (foreground)" msgstr "" -#: src/dirmngr.c:112 +#: src/dirmngr.c:114 msgid "run in daemon mode (background)" msgstr "" -#: src/dirmngr.c:113 +#: src/dirmngr.c:115 msgid "list the contents of the CRL cache" msgstr "" -#: src/dirmngr.c:114 +#: src/dirmngr.c:116 msgid "|FILE|load CRL from FILE into cache" msgstr "" -#: src/dirmngr.c:115 +#: src/dirmngr.c:117 msgid "|URL|fetch a CRL from URL" msgstr "" -#: src/dirmngr.c:116 +#: src/dirmngr.c:118 msgid "shutdown the dirmngr" msgstr "" -#: src/dirmngr.c:117 +#: src/dirmngr.c:119 msgid "flush the cache" msgstr "" -#: src/dirmngr.c:121 +#: src/dirmngr.c:123 msgid "" "@\n" "Options:\n" " " msgstr "" -#: src/dirmngr.c:123 src/dirmngr-client.c:67 src/dirmngr_ldap.c:76 +#: src/dirmngr.c:125 src/dirmngr-client.c:67 src/dirmngr_ldap.c:76 msgid "verbose" msgstr "" -#: src/dirmngr.c:124 src/dirmngr-client.c:68 src/dirmngr_ldap.c:77 +#: src/dirmngr.c:126 src/dirmngr-client.c:68 src/dirmngr_ldap.c:77 msgid "be somewhat more quiet" msgstr "" -#: src/dirmngr.c:125 +#: src/dirmngr.c:127 msgid "sh-style command output" msgstr "" -#: src/dirmngr.c:126 +#: src/dirmngr.c:128 msgid "csh-style command output" msgstr "" -#: src/dirmngr.c:127 +#: src/dirmngr.c:129 msgid "|FILE|read options from FILE" msgstr "" -#: src/dirmngr.c:129 +#: src/dirmngr.c:131 msgid "|LEVEL|set the debugging level to LEVEL" msgstr "" -#: src/dirmngr.c:130 +#: src/dirmngr.c:132 msgid "do not detach from the console" msgstr "" -#: src/dirmngr.c:131 +#: src/dirmngr.c:133 msgid "|FILE|write server mode logs to FILE" msgstr "" -#: src/dirmngr.c:132 +#: src/dirmngr.c:134 msgid "run without asking a user" msgstr "" -#: src/dirmngr.c:133 +#: src/dirmngr.c:135 msgid "force loading of outdated CRLs" msgstr "" -#: src/dirmngr.c:134 +#: src/dirmngr.c:136 msgid "allow sending OCSP requests" msgstr "" -#: src/dirmngr.c:135 +#: src/dirmngr.c:137 msgid "inhibit the use of HTTP" msgstr "" -#: src/dirmngr.c:136 +#: src/dirmngr.c:138 msgid "inhibit the use of LDAP" msgstr "" -#: src/dirmngr.c:138 +#: src/dirmngr.c:140 msgid "ignore HTTP CRL distribution points" msgstr "" -#: src/dirmngr.c:140 +#: src/dirmngr.c:142 msgid "ignore LDAP CRL distribution points" msgstr "" -#: src/dirmngr.c:142 +#: src/dirmngr.c:144 msgid "ignore certificate contained OCSP service URLs" msgstr "" -#: src/dirmngr.c:148 +#: src/dirmngr.c:150 msgid "|URL|redirect all HTTP requests to URL" msgstr "" -#: src/dirmngr.c:150 +#: src/dirmngr.c:152 msgid "|HOST|use HOST for LDAP queries" msgstr "" -#: src/dirmngr.c:152 +#: src/dirmngr.c:154 msgid "do not use fallback hosts with --ldap-proxy" msgstr "" -#: src/dirmngr.c:155 +#: src/dirmngr.c:157 msgid "|FILE|read LDAP server list from FILE" msgstr "" -#: src/dirmngr.c:157 +#: src/dirmngr.c:159 msgid "add new servers discovered in CRL distribution points to serverlist" msgstr "" -#: src/dirmngr.c:159 src/dirmngr_ldap.c:78 +#: src/dirmngr.c:161 src/dirmngr_ldap.c:78 msgid "|N|set LDAP timeout to N seconds" msgstr "" -#: src/dirmngr.c:161 +#: src/dirmngr.c:163 msgid "|URL|use OCSP responder at URL" msgstr "" -#: src/dirmngr.c:162 +#: src/dirmngr.c:164 msgid "|FPR|OCSP response signed by FPR" msgstr "" -#: src/dirmngr.c:167 +#: src/dirmngr.c:169 msgid "|N|do not return more than N items in one query" msgstr "" -#: src/dirmngr.c:169 +#: src/dirmngr.c:171 msgid "|FILE|listen on socket FILE" msgstr "" -#: src/dirmngr.c:182 +#: src/dirmngr.c:184 msgid "" "@\n" "(See the \"info\" manual for a complete listing of all commands and " "options)\n" msgstr "" -#: src/dirmngr.c:227 src/dirmngr-client.c:143 src/dirmngr_ldap.c:140 -msgid "Please report bugs to .\n" +#. TRANSLATORS: @EMAIL will get replaced by the actual bug +#. reporting address. +#: src/dirmngr.c:231 src/dirmngr-client.c:142 src/dirmngr_ldap.c:139 +msgid "Please report bugs to <@EMAIL@>.\n" msgstr "" -#: src/dirmngr.c:231 +#: src/dirmngr.c:234 msgid "Usage: dirmngr [options] (-h for help)" msgstr "" -#: src/dirmngr.c:234 +#: src/dirmngr.c:236 msgid "" "Syntax: dirmngr [options] [command [args]]\n" "LDAP and OCSP access for GnuPG\n" msgstr "" -#: src/dirmngr.c:305 +#: src/dirmngr.c:307 #, c-format msgid "invalid debug-level `%s' given\n" msgstr "" -#: src/dirmngr.c:306 +#: src/dirmngr.c:308 #, c-format msgid "valid debug levels are: %s\n" msgstr "" -#: src/dirmngr.c:344 +#: src/dirmngr.c:346 msgid "usage: dirmngr [options] " msgstr "" -#: src/dirmngr.c:369 +#: src/dirmngr.c:371 #, c-format msgid "error spawning ldap wrapper reaper thread: %s\n" msgstr "" -#: src/dirmngr.c:508 src/dirmngr.c:518 +#: src/dirmngr.c:510 src/dirmngr.c:520 #, c-format msgid "%s is too old (need %s, have %s)\n" msgstr "" -#: src/dirmngr.c:616 +#: src/dirmngr.c:618 #, c-format msgid "NOTE: no default option file `%s'\n" msgstr "" -#: src/dirmngr.c:621 src/dirmngr.c:1291 +#: src/dirmngr.c:623 src/dirmngr.c:1293 #, c-format msgid "option file `%s': %s\n" msgstr "" -#: src/dirmngr.c:629 +#: src/dirmngr.c:631 #, c-format msgid "reading options from `%s'\n" msgstr "" -#: src/dirmngr.c:730 +#: src/dirmngr.c:732 #, c-format msgid "WARNING: running with faked system time %s\n" msgstr "" -#: src/dirmngr.c:807 +#: src/dirmngr.c:809 msgid "colons are not allowed in the socket name\n" msgstr "" -#: src/dirmngr.c:812 +#: src/dirmngr.c:814 msgid "name of socket too long\n" msgstr "" -#: src/dirmngr.c:819 +#: src/dirmngr.c:821 #, c-format msgid "can't create socket: %s\n" msgstr "" -#: src/dirmngr.c:838 +#: src/dirmngr.c:840 #, c-format msgid "error binding socket to `%s': %s\n" msgstr "" -#: src/dirmngr.c:847 +#: src/dirmngr.c:849 #, c-format msgid "listen() failed: %s\n" msgstr "" -#: src/dirmngr.c:853 +#: src/dirmngr.c:855 #, c-format msgid "listening on socket `%s'\n" msgstr "" -#: src/dirmngr.c:859 +#: src/dirmngr.c:861 #, c-format msgid "fork failed: %s\n" msgstr "" -#: src/dirmngr.c:877 +#: src/dirmngr.c:879 msgid "out of core\n" msgstr "" -#: src/dirmngr.c:916 +#: src/dirmngr.c:918 #, c-format msgid "setsid() failed: %s\n" msgstr "" -#: src/dirmngr.c:926 +#: src/dirmngr.c:928 #, c-format msgid "chdir to / failed: %s\n" msgstr "" -#: src/dirmngr.c:981 +#: src/dirmngr.c:983 #, c-format msgid "fetching CRL from `%s' failed: %s\n" msgstr "" -#: src/dirmngr.c:987 +#: src/dirmngr.c:989 #, c-format msgid "processing CRL from `%s' failed: %s\n" msgstr "" -#: src/dirmngr.c:1138 +#: src/dirmngr.c:1140 #, c-format msgid "error opening `%s': %s\n" msgstr "" -#: src/dirmngr.c:1155 +#: src/dirmngr.c:1157 #, c-format msgid "%s:%u: line too long - skipped\n" msgstr "" -#: src/dirmngr.c:1183 +#: src/dirmngr.c:1185 #, c-format msgid "%s:%u: no hostname given\n" msgstr "" -#: src/dirmngr.c:1202 +#: src/dirmngr.c:1204 #, c-format msgid "%s:%u: password given without user\n" msgstr "" -#: src/dirmngr.c:1223 +#: src/dirmngr.c:1225 #, c-format msgid "%s:%u: skipping this line\n" msgstr "" -#: src/dirmngr.c:1323 +#: src/dirmngr.c:1325 msgid "SIGHUP received - re-reading configuration and flushing caches\n" msgstr "" -#: src/dirmngr.c:1337 +#: src/dirmngr.c:1339 msgid "SIGUSR2 received - no action defined\n" msgstr "" -#: src/dirmngr.c:1342 +#: src/dirmngr.c:1344 msgid "SIGTERM received - shutting down ...\n" msgstr "" -#: src/dirmngr.c:1344 +#: src/dirmngr.c:1346 #, c-format msgid "SIGTERM received - still %d active connections\n" msgstr "" -#: src/dirmngr.c:1349 +#: src/dirmngr.c:1351 msgid "shutdown forced\n" msgstr "" -#: src/dirmngr.c:1357 +#: src/dirmngr.c:1359 msgid "SIGINT received - immediate shutdown\n" msgstr "" -#: src/dirmngr.c:1364 +#: src/dirmngr.c:1366 #, c-format msgid "signal %d received - no action defined\n" msgstr "" -#: src/dirmngr.c:1378 +#: src/dirmngr.c:1380 #, c-format msgid "handler for fd %d started\n" msgstr "" -#: src/dirmngr.c:1383 +#: src/dirmngr.c:1385 #, c-format msgid "handler for fd %d terminated\n" msgstr "" -#: src/dirmngr.c:1439 +#: src/dirmngr.c:1441 #, c-format msgid "accept failed: %s - waiting 1s\n" msgstr "" -#: src/dirmngr.c:1446 +#: src/dirmngr.c:1448 #, c-format msgid "error spawning connection handler: %s\n" msgstr "" @@ -1526,11 +1528,11 @@ msgid "certificates are expected in PEM format" msgstr "" -#: src/dirmngr-client.c:147 +#: src/dirmngr-client.c:146 msgid "Usage: dirmngr-client [options] [certfile|pattern] (-h for help)\n" msgstr "" -#: src/dirmngr-client.c:151 +#: src/dirmngr-client.c:150 msgid "" "Syntax: dirmngr-client [options] [certfile|pattern]\n" "Test an X.509 certificate against a CRL or do an OCSP check\n" @@ -1538,98 +1540,98 @@ "not valid and other error codes for general failures\n" msgstr "" -#: src/dirmngr-client.c:266 src/dirmngr-client.c:970 +#: src/dirmngr-client.c:265 src/dirmngr-client.c:969 #, c-format msgid "error reading certificate from stdin: %s\n" msgstr "" -#: src/dirmngr-client.c:273 +#: src/dirmngr-client.c:272 #, c-format msgid "error reading certificate from `%s': %s\n" msgstr "" -#: src/dirmngr-client.c:287 +#: src/dirmngr-client.c:286 msgid "certificate too large to make any sense\n" msgstr "" -#: src/dirmngr-client.c:313 +#: src/dirmngr-client.c:312 #, c-format msgid "lookup failed: %s\n" msgstr "" -#: src/dirmngr-client.c:328 +#: src/dirmngr-client.c:327 #, c-format msgid "loading CRL `%s' failed: %s\n" msgstr "" -#: src/dirmngr-client.c:356 +#: src/dirmngr-client.c:355 msgid "a dirmngr daemon is up and running\n" msgstr "" -#: src/dirmngr-client.c:378 +#: src/dirmngr-client.c:377 #, c-format msgid "validation of certificate failed: %s\n" msgstr "" -#: src/dirmngr-client.c:385 src/dirmngr-client.c:981 +#: src/dirmngr-client.c:384 src/dirmngr-client.c:980 msgid "certificate is valid\n" msgstr "" -#: src/dirmngr-client.c:391 src/dirmngr-client.c:989 +#: src/dirmngr-client.c:390 src/dirmngr-client.c:988 msgid "certificate has been revoked\n" msgstr "" -#: src/dirmngr-client.c:396 src/dirmngr-client.c:991 +#: src/dirmngr-client.c:395 src/dirmngr-client.c:990 #, c-format msgid "certificate check failed: %s\n" msgstr "" -#: src/dirmngr-client.c:407 +#: src/dirmngr-client.c:406 #, c-format msgid "got status: `%s'\n" msgstr "" -#: src/dirmngr-client.c:422 +#: src/dirmngr-client.c:421 #, c-format msgid "error writing base64 encoding: %s\n" msgstr "" -#: src/dirmngr-client.c:454 +#: src/dirmngr-client.c:453 msgid "apparently no running dirmngr\n" msgstr "" -#: src/dirmngr-client.c:459 +#: src/dirmngr-client.c:458 msgid "no running dirmngr - starting one\n" msgstr "" -#: src/dirmngr-client.c:492 +#: src/dirmngr-client.c:491 msgid "malformed DIRMNGR_INFO environment variable\n" msgstr "" -#: src/dirmngr-client.c:507 +#: src/dirmngr-client.c:506 #, c-format msgid "dirmngr protocol version %d is not supported\n" msgstr "" -#: src/dirmngr-client.c:523 +#: src/dirmngr-client.c:522 msgid "can't connect to the dirmngr - trying fall back\n" msgstr "" -#: src/dirmngr-client.c:531 +#: src/dirmngr-client.c:530 #, c-format msgid "can't connect to the dirmngr: %s\n" msgstr "" -#: src/dirmngr-client.c:780 +#: src/dirmngr-client.c:779 #, c-format msgid "unsupported inquiry `%s'\n" msgstr "" -#: src/dirmngr-client.c:876 +#: src/dirmngr-client.c:875 msgid "absolute file name expected\n" msgstr "" -#: src/dirmngr-client.c:918 +#: src/dirmngr-client.c:917 #, c-format msgid "looking up `%s'\n" msgstr "" @@ -1679,123 +1681,123 @@ msgid "|STRING|return the attribute STRING" msgstr "" -#: src/dirmngr_ldap.c:144 +#: src/dirmngr_ldap.c:143 msgid "Usage: dirmngr_ldap [options] [URL] (-h for help)\n" msgstr "" -#: src/dirmngr_ldap.c:147 +#: src/dirmngr_ldap.c:146 msgid "" "Syntax: dirmngr_ldap [options] [URL]\n" "Internal LDAP helper for Dirmngr.\n" "Interface and options may change without notice.\n" msgstr "" -#: src/dirmngr_ldap.c:249 +#: src/dirmngr_ldap.c:248 #, c-format msgid "invalid port number %d\n" msgstr "" -#: src/dirmngr_ldap.c:310 +#: src/dirmngr_ldap.c:309 #, c-format msgid "scanning result for attribute `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:317 src/dirmngr_ldap.c:379 src/dirmngr_ldap.c:403 -#: src/dirmngr_ldap.c:414 src/dirmngr_ldap.c:526 +#: src/dirmngr_ldap.c:316 src/dirmngr_ldap.c:378 src/dirmngr_ldap.c:402 +#: src/dirmngr_ldap.c:413 src/dirmngr_ldap.c:525 #, c-format msgid "error writing to stdout: %s\n" msgstr "" -#: src/dirmngr_ldap.c:331 +#: src/dirmngr_ldap.c:330 #, c-format msgid " available attribute `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:358 +#: src/dirmngr_ldap.c:357 #, c-format msgid "attribute `%s' not found\n" msgstr "" -#: src/dirmngr_ldap.c:364 +#: src/dirmngr_ldap.c:363 #, c-format msgid "found attribute `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:461 +#: src/dirmngr_ldap.c:460 #, c-format msgid "processing url `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:463 +#: src/dirmngr_ldap.c:462 #, c-format msgid " user `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:465 +#: src/dirmngr_ldap.c:464 #, c-format msgid " pass `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:467 +#: src/dirmngr_ldap.c:466 #, c-format msgid " host `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:468 +#: src/dirmngr_ldap.c:467 #, c-format msgid " port %d\n" msgstr "" -#: src/dirmngr_ldap.c:470 +#: src/dirmngr_ldap.c:469 #, c-format msgid " DN `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:472 +#: src/dirmngr_ldap.c:471 #, c-format msgid " filter `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:477 src/dirmngr_ldap.c:480 +#: src/dirmngr_ldap.c:476 src/dirmngr_ldap.c:479 #, c-format msgid " attr `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:486 +#: src/dirmngr_ldap.c:485 #, c-format msgid "no host name in `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:491 +#: src/dirmngr_ldap.c:490 #, c-format msgid "no attribute given for query `%s'\n" msgstr "" -#: src/dirmngr_ldap.c:497 +#: src/dirmngr_ldap.c:496 msgid "WARNING: using first attribute only\n" msgstr "" -#: src/dirmngr_ldap.c:504 +#: src/dirmngr_ldap.c:503 #, c-format msgid "LDAP init to `%s:%d' failed: %s\n" msgstr "" -#: src/dirmngr_ldap.c:510 +#: src/dirmngr_ldap.c:509 #, c-format msgid "binding to `%s:%d' failed: %s\n" msgstr "" -#: src/dirmngr_ldap.c:533 +#: src/dirmngr_ldap.c:532 #, c-format msgid "searching `%s' failed: %s\n" msgstr "" -#: src/dirmngr_ldap.c:564 +#: src/dirmngr_ldap.c:563 #, c-format msgid "`%s' is not an LDAP URL\n" msgstr "" -#: src/dirmngr_ldap.c:570 +#: src/dirmngr_ldap.c:569 #, c-format msgid "`%s' is an invalid LDAP URL\n" msgstr "" Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/src/ChangeLog 2006-11-29 13:47:15 UTC (rev 242) @@ -1,3 +1,16 @@ +2006-11-29 Werner Koch + + * dirmngr.c (my_strusage): Use macro for the bug report address + and the copyright line. + * dirmngr-client.c (my_strusage): Ditto. + * dirmngr_ldap.c (my_strusage): Ditto. + + * Makefile.am: Do not link against LIBICONV. + +2006-11-19 Werner Koch + + * dirmngr.c: Include i18n.h. + 2006-11-17 Werner Koch * Makefile.am (dirmngr_LDADD): Use LIBASSUAN_PTH_LIBS. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/src/Makefile.am 2006-11-29 13:47:15 UTC (rev 242) @@ -46,18 +46,18 @@ dirmngr_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(LIBASSUAN_PTH_LIBS) \ - $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(PTH_LIBS) $(LIBINTL) $(LIBICONV) + $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(PTH_LIBS) $(LIBINTL) dirmngr_ldap_SOURCES = dirmngr_ldap.c i18n.h util.h \ no-libgcrypt.c no-libgcrypt.h dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS) dirmngr_ldap_LDFLAGS = dirmngr_ldap_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(GPG_ERROR_LIBS) \ - $(LDAPLIBS) $(LIBINTL) $(LIBICONV) + $(LDAPLIBS) $(LIBINTL) dirmngr_client_SOURCES = dirmngr-client.c i18n.h util.h b64enc.c \ no-libgcrypt.c no-libgcrypt.h dirmngr_client_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(LIBASSUAN_LIBS) \ - $(GPG_ERROR_LIBS) $(LIBINTL) $(LIBICONV) + $(GPG_ERROR_LIBS) $(LIBINTL) Modified: trunk/src/dirmngr-client.c =================================================================== --- trunk/src/dirmngr-client.c 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/src/dirmngr-client.c 2006-11-29 13:47:15 UTC (rev 242) @@ -137,11 +137,10 @@ case 11: p = "dirmngr-client (dirmngr)"; break; case 13: p = VERSION; break; - case 14: p = "Copyright (C) 2004 g10 Code GmbH"; break; + case 14: p = "Copyright (C) " COPYRIGHT_YEAR_NAME; break; case 17: p = PRINTABLE_OS_NAME; break; - case 19: p = - _("Please report bugs to .\n"); - break; + case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break; + case 49: p = PACKAGE_BUGREPORT; break; case 1: case 40: p = _("Usage: dirmngr-client [options] " Modified: trunk/src/dirmngr.c =================================================================== --- trunk/src/dirmngr.c 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/src/dirmngr.c 2006-11-29 13:47:15 UTC (rev 242) @@ -47,7 +47,9 @@ #include "crlcache.h" #include "crlfetch.h" #include "misc.h" +#include "i18n.h" + enum cmd_and_opt_values { aNull = 0, oCsh = 'c', @@ -216,28 +218,28 @@ static const char * my_strusage( int level ) { - const char *p; - switch( level ) { - case 11: p = "dirmngr"; - break; - case 13: p = VERSION; break; - case 14: p = "Copyright (C) 2006 g10 Code GmbH"; break; - case 17: p = PRINTABLE_OS_NAME; break; - case 19: p = - _("Please report bugs to .\n"); - break; - case 1: - case 40: p = - _("Usage: dirmngr [options] (-h for help)"); - break; - case 41: p = - _("Syntax: dirmngr [options] [command [args]]\n" - "LDAP and OCSP access for GnuPG\n"); - break; - - default: p = NULL; + const char *p; + switch ( level ) + { + case 11: p = "dirmngr"; + break; + case 13: p = VERSION; break; + case 14: p = "Copyright (C) " COPYRIGHT_YEAR_NAME; break; + case 17: p = PRINTABLE_OS_NAME; break; + /* TRANSLATORS: @EMAIL will get replaced by the actual bug + reporting address. */ + case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break; + case 49: p = PACKAGE_BUGREPORT; break; + case 1: + case 40: p = _("Usage: dirmngr [options] (-h for help)"); + break; + case 41: p = _("Syntax: dirmngr [options] [command [args]]\n" + "LDAP and OCSP access for GnuPG\n"); + break; + + default: p = NULL; } - return p; + return p; } Modified: trunk/src/dirmngr_ldap.c =================================================================== --- trunk/src/dirmngr_ldap.c 2006-11-17 10:48:27 UTC (rev 241) +++ trunk/src/dirmngr_ldap.c 2006-11-29 13:47:15 UTC (rev 242) @@ -134,11 +134,10 @@ case 11: p = "dirmngr_ldap (dirmngr)"; break; case 13: p = VERSION; break; - case 14: p = "Copyright (C) 2004 g10 Code GmbH"; break; + case 14: p = "Copyright (C) " COPYRIGHT_YEAR_NAME; break; case 17: p = PRINTABLE_OS_NAME; break; - case 19: p = - _("Please report bugs to .\n"); - break; + case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break; + case 49: p = PACKAGE_BUGREPORT; break; case 1: case 40: p = _("Usage: dirmngr_ldap [options] [URL] (-h for help)\n"); From cvs at cvs.gnupg.org Wed Nov 29 14:48:57 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 14:13:17 2006 Subject: [svn] dirmngr - r243 - trunk Message-ID: Author: wk Date: 2006-11-29 14:48:57 +0100 (Wed, 29 Nov 2006) New Revision: 243 Modified: trunk/configure.ac Log: Well, need to change the version number of course Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-29 13:47:15 UTC (rev 242) +++ trunk/configure.ac 2006-11-29 13:48:57 UTC (rev 243) @@ -27,7 +27,7 @@ # 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.0.0]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) From cvs at cvs.gnupg.org Wed Nov 29 14:58:23 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 14:22:43 2006 Subject: [svn] dirmngr - r244 - tags Message-ID: Author: wk Date: 2006-11-29 14:58:23 +0100 (Wed, 29 Nov 2006) New Revision: 244 Added: tags/dirmngr-1.0.0/ Log: Released 1.0.0 Copied: tags/dirmngr-1.0.0 (from rev 243, trunk) From cvs at cvs.gnupg.org Wed Nov 29 16:44:31 2006 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed Nov 29 16:08:58 2006 Subject: [svn] gpgme - r1187 - trunk/gpgme Message-ID: Author: marcus Date: 2006-11-29 16:44:29 +0100 (Wed, 29 Nov 2006) New Revision: 1187 Modified: trunk/gpgme/ChangeLog trunk/gpgme/rungpg.c Log: 2006-11-29 Marcus Brinkmann * rungpg.c: Include . (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and --lc-messages. Fixes issue 734. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2006-11-01 10:02:12 UTC (rev 1186) +++ trunk/gpgme/ChangeLog 2006-11-29 15:44:29 UTC (rev 1187) @@ -1,3 +1,9 @@ +2006-11-29 Marcus Brinkmann + + * rungpg.c: Include . + (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and + --lc-messages. Fixes issue 734. + 2006-10-24 Marcus Brinkmann * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is Modified: trunk/gpgme/rungpg.c =================================================================== --- trunk/gpgme/rungpg.c 2006-11-01 10:02:12 UTC (rev 1186) +++ trunk/gpgme/rungpg.c 2006-11-29 15:44:29 UTC (rev 1187) @@ -27,6 +27,7 @@ #include #include #include +#include #include "gpgme.h" #include "util.h" @@ -344,6 +345,9 @@ { engine_gpg_t gpg; gpgme_error_t rc = 0; + char *dft_display = NULL; + char dft_ttyname[64]; + char *dft_ttytype = NULL; gpg = calloc (1, sizeof *gpg); if (!gpg) @@ -423,7 +427,65 @@ rc = add_arg (gpg, "utf8"); if (!rc) rc = add_arg (gpg, "--enable-progress-filter"); + if (rc) + goto leave; + rc = _gpgme_getenv ("DISPLAY", &dft_display); + if (dft_display) + { + rc = add_arg (gpg, "--display"); + if (!rc) + rc = add_arg (gpg, dft_display); + + free (dft_display); + } + if (rc) + goto leave; + + if (isatty (1)) + { + if (ttyname_r (1, dft_ttyname, sizeof (dft_ttyname))) + rc = gpg_error_from_errno (errno); + else + { + rc = add_arg (gpg, "--ttyname"); + if (!rc) + rc = add_arg (gpg, dft_ttyname); + if (!rc) + { + rc = _gpgme_getenv ("TERM", &dft_ttytype); + if (!rc) + goto leave; + + rc = add_arg (gpg, "--ttytype"); + if (!rc) + rc = add_arg (gpg, dft_ttytype); + + free (dft_ttytype); + } + } + if (rc) + goto leave; + } + + if (lc_ctype) + { + rc = add_arg (gpg, "--lc-ctype"); + if (!rc) + rc = add_arg (gpg, lc_ctype); + if (rc) + goto leave; + } + + if (lc_messages) + { + rc = add_arg (gpg, "--lc-messages"); + if (!rc) + rc = add_arg (gpg, lc_messages); + if (rc) + goto leave; + } + leave: if (rc) gpg_release (gpg); From cvs at cvs.gnupg.org Wed Nov 29 16:47:00 2006 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed Nov 29 16:11:19 2006 Subject: [svn] gpgme - r1188 - trunk Message-ID: Author: marcus Date: 2006-11-29 16:47:00 +0100 (Wed, 29 Nov 2006) New Revision: 1188 Modified: trunk/ChangeLog trunk/configure.ac Log: 2006-11-29 Marcus Brinkmann * configure.ac (NEED_GPG_VERSION): Bump to 1.3.0. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-29 15:44:29 UTC (rev 1187) +++ trunk/ChangeLog 2006-11-29 15:47:00 UTC (rev 1188) @@ -1,3 +1,7 @@ +2006-11-29 Marcus Brinkmann + + * configure.ac (NEED_GPG_VERSION): Bump to 1.3.0. + 2006-09-19 Marcus Brinkmann * configure.ac: Turn stpcpy into a replacement function. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-29 15:44:29 UTC (rev 1187) +++ trunk/configure.ac 2006-11-29 15:47:00 UTC (rev 1188) @@ -57,7 +57,7 @@ # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 -NEED_GPG_VERSION=1.2.2 +NEED_GPG_VERSION=1.3.0 NEED_GPGSM_VERSION=1.9.6 ############################################## From cvs at cvs.gnupg.org Wed Nov 29 17:25:47 2006 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed Nov 29 16:50:07 2006 Subject: [svn] gpgme - r1189 - trunk/assuan Message-ID: Author: marcus Date: 2006-11-29 17:25:46 +0100 (Wed, 29 Nov 2006) New Revision: 1189 Removed: trunk/assuan/assuan-domain-connect.c trunk/assuan/assuan-domain-server.c Modified: trunk/assuan/ChangeLog trunk/assuan/assuan-buffer.c trunk/assuan/assuan-client.c trunk/assuan/assuan-defs.h trunk/assuan/assuan-handler.c trunk/assuan/assuan-io.c trunk/assuan/assuan-pipe-server.c trunk/assuan/assuan-uds.c trunk/assuan/assuan-util.c trunk/assuan/assuan.h trunk/assuan/mkerrors Log: Update to rev 231 of libassuan. Modified: trunk/assuan/ChangeLog =================================================================== --- trunk/assuan/ChangeLog 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/ChangeLog 2006-11-29 16:25:46 UTC (rev 1189) @@ -1,3 +1,70 @@ +2006-11-22 Werner Koch + + * assuan-handler.c (fun1_cookie_write, fun2_cookie_write): New. + (assuan_get_data_fp) [HAVE_FUNOPEN]: Use it. + +2006-11-21 Werner Koch + + * Makefile.am (libassuan_pth_a_CFLAGS): New. + + * assuan-pipe-server.c (_assuan_release_context): Free CMDTBL. + +2006-11-14 Werner Koch + + * libassuan.m4 (AM_CHECK_LIBASSUAN): New. + + * assuan-handler.c (assuan_register_post_cmd_notify) + (assuan_register_post_cmd_notify): New. + * assuan-util.c (assuan_set_io_monitor): New. + * assuan-buffer.c (_assuan_read_line): Use it. + (_assuan_write_line): Ditto. + (_assuan_cookie_write_data): Ditto. + (_assuan_cookie_write_flush): Ditto. + +2006-10-18 Werner Koch + + * libassuan.m4: Pass "pthread" to the common macro. Reported by + Rex Dieter. + +2006-10-16 Werner Koch + + * mkerrors: Map ASSUAN_Not_Confirmed. + +2006-10-10 Werner Koch + + * libassuan.m4 (AM_PATH_LIBASSUAN_PTH) + (AM_PATH_LIBASSUAN_PTHREAD): Fixed. + + * assuan-buffer.c (assuan_sendfd): Implement a runtime detection + of implemented descripotr passing. + + * assuan-uds.c: Take care of USE_DESCRIPTOR_PASSING. + + * assuan-defs.h: Add missing semicolon. + +2006-10-09 Werner Koch + + * assuan-handler.c (process_request): Use weak pragma for the sake + of old gcc's. Reported by Alain Guibert. + + * assuan-io.c: Removed Pth support. + * assuan-io-pth.c: New. Based on assuan-io.c + +2006-10-06 Werner Koch + + * libassuan-config.in: New options --api-version and --thread. + +2006-10-04 Werner Koch + + * assuan-client.c (assuan_transact): Need to map old assuan status + codes so that for example CANCELED is correctly mapped. + +2006-09-28 Marcus Brinkmann + + * assuan-client.c (assuan_transact): Do not convert error on + status line, it is already a gpg-error. Do convert + ASSUAN_Server_Fault. + 2006-09-19 Marcus Brinkmann * assuan.h (assuan_init_socket_server_ext) Modified: trunk/assuan/assuan-buffer.c =================================================================== --- trunk/assuan/assuan-buffer.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-buffer.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -1,5 +1,5 @@ /* assuan-buffer.c - read and send data - * Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -159,7 +159,9 @@ if (endp) { + unsigned monitor_result; int n = endp - line + 1; + if (n < nread) /* LINE contains more than one line. We copy it to the attic now as handlers are allowed to modify the passed @@ -176,7 +178,16 @@ *endp = 0; ctx->inbound.linelen = endp - line; - if (ctx->log_fp) + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 0, + ctx->inbound.line, + ctx->inbound.linelen) + : 0); + if ( (monitor_result & 2) ) + ctx->inbound.linelen = 0; + + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- ", assuan_get_assuan_log_prefix (), @@ -245,6 +256,7 @@ { assuan_error_t rc = 0; size_t prefixlen = prefix? strlen (prefix):0; + unsigned int monitor_result; /* Make sure that the line is short enough. */ if (len + prefixlen + 2 > ASSUAN_LINELENGTH) @@ -260,8 +272,12 @@ len = ASSUAN_LINELENGTH - prefixlen - 2 - 1; } + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, line, len) + : 0); + /* Fixme: we should do some kind of line buffering. */ - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -277,13 +293,13 @@ putc ('\n', ctx->log_fp); } - if (prefixlen) + if (prefixlen && !(monitor_result & 2)) { rc = writen (ctx, prefix, prefixlen); if (rc) rc = _assuan_error (ASSUAN_Write_Error); } - if (!rc) + if (!rc && !(monitor_result & 2)) { rc = writen (ctx, line, len); if (rc) @@ -325,7 +341,7 @@ /* Write out the data in buffer as datalines with line wrapping and - percent escaping. This function is used for GNU's custom streams */ + percent escaping. This function is used for GNU's custom streams. */ int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t orig_size) { @@ -342,7 +358,9 @@ line += linelen; while (size) { - /* insert data line header */ + unsigned int monitor_result; + + /* Insert data line header. */ if (!linelen) { *line++ = 'D'; @@ -350,7 +368,7 @@ linelen += 2; } - /* copy data, keep some space for the CRLF and to escape one character */ + /* Copy data, keep space for the CRLF and to escape one character. */ while (size && linelen < LINELENGTH-2-2) { if (*buffer == '%' || *buffer == '\r' || *buffer == '\n') @@ -368,9 +386,15 @@ size--; } + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, + ctx->outbound.data.line, linelen) + : 0); + if (linelen >= LINELENGTH-2-2) { - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -386,7 +410,8 @@ } *line++ = '\n'; linelen++; - if (writen (ctx, ctx->outbound.data.line, linelen)) + if ( !(monitor_result & 2) + && writen (ctx, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error); return 0; @@ -409,6 +434,7 @@ assuan_context_t ctx = cookie; char *line; size_t linelen; + unsigned int monitor_result; if (ctx->outbound.data.error) return 0; @@ -416,9 +442,15 @@ line = ctx->outbound.data.line; linelen = ctx->outbound.data.linelen; line += linelen; + + monitor_result = (ctx->io_monitor + ? ctx->io_monitor (ctx, 1, + ctx->outbound.data.line, linelen) + : 0); + if (linelen) { - if (ctx->log_fp) + if (ctx->log_fp && !(monitor_result & 1)) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), @@ -432,7 +464,8 @@ } *line++ = '\n'; linelen++; - if (writen (ctx, ctx->outbound.data.line, linelen)) + if ( !(monitor_result & 2) + && writen (ctx, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error); return 0; @@ -490,6 +523,15 @@ assuan_error_t assuan_sendfd (assuan_context_t ctx, int fd) { + /* It is explicitly allowed to use (NULL, -1) as a runtime test to + check whether descriptor passing is available. */ + if (!ctx && fd == -1) +#ifdef USE_DESCRIPTOR_PASSING + return 0; +#else + return _assuan_error (ASSUAN_Not_Implemented); +#endif + if (! ctx->io->sendfd) return set_error (ctx, Not_Implemented, "server does not support sending and receiving " Modified: trunk/assuan/assuan-client.c =================================================================== --- trunk/assuan/assuan-client.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-client.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -161,9 +161,11 @@ if (!okay) { - rc = _assuan_error (atoi (line)); - if (rc < 100) - rc = ASSUAN_Server_Fault; + rc = atoi (line); + if (rc > 0 && rc < 100) + rc = _assuan_error (ASSUAN_Server_Fault); + else if (rc > 0 && rc <= 128) + rc = _assuan_error (rc); } else if (okay == 2) { Modified: trunk/assuan/assuan-defs.h =================================================================== --- trunk/assuan/assuan-defs.h 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-defs.h 2006-11-29 16:25:46 UTC (rev 1189) @@ -179,6 +179,20 @@ void (*input_notify_fnc)(assuan_context_t, const char *); void (*output_notify_fnc)(assuan_context_t, const char *); + /* This function is called right after a command has been processed. + It may be used to command related cleanup. */ + void (*post_cmd_notify_fnc)(assuan_context_t, int); + + /* If set, this is called right before logging an I/O line. With + DIRECTION set to 1 it is called for an output oeration; 0 means + an input operation. If bit 0 is set in the return value, the + logging of the will be suppressed. With bit 1 set, the entire + line will be ignored. */ + unsigned int (*io_monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen); + int input_fd; /* set by INPUT command */ int output_fd; /* set by OUTPUT command */ @@ -299,7 +313,7 @@ int setenv (const char *name, const char *value, int replace); #endif #ifndef HAVE_PUTC_UNLOCKED -int putc_unlocked (int c, FILE *stream) +int putc_unlocked (int c, FILE *stream); #endif #define DIM(v) (sizeof(v)/sizeof((v)[0])) Deleted: trunk/assuan/assuan-domain-connect.c Deleted: trunk/assuan/assuan-domain-server.c Modified: trunk/assuan/assuan-handler.c =================================================================== --- trunk/assuan/assuan-handler.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-handler.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -292,6 +292,16 @@ } int +assuan_register_post_cmd_notify (assuan_context_t ctx, + void (*fnc)(assuan_context_t, int)) +{ + if (!ctx) + return _assuan_error (ASSUAN_Invalid_Value); + ctx->post_cmd_notify_fnc = fnc; + return 0; +} + +int assuan_register_bye_notify (assuan_context_t ctx, void (*fnc)(assuan_context_t)) { @@ -506,14 +516,20 @@ problem if they are not available. We need to make sure that we are using ELF because only this guarantees that weak symbol support is available in case GNU ld is not - used. */ + used. It seems that old gcc versions don't implement the + weak attribute properly but it works with the weak + pragma. */ + unsigned int source, code; int gpg_strerror_r (unsigned int err, char *buf, size_t buflen) __attribute__ ((weak)); - const char *gpg_strsource (unsigned int err) __attribute__ ((weak)); +#if !defined(HAVE_W32_SYSTEM) && __GNUC__ < 3 +#pragma weak gpg_strerror_r +#pragma weak gpg_strsource +#endif source = ((rc >> 24) & 0xff); code = (rc & 0x00ffffff); @@ -537,6 +553,9 @@ rc = assuan_write_line (ctx, errline); } + if (ctx->post_cmd_notify_fnc) + ctx->post_cmd_notify_fnc (ctx, rc); + ctx->confidential = 0; if (ctx->okay_line) { @@ -633,6 +652,23 @@ return n; } + +/* Two simple wrappers to make the expected function types match. */ +#ifdef HAVE_FUNOPEN +static int +fun1_cookie_write (void *cookie, const char *buffer, int orig_size) +{ + return _assuan_cookie_write_data (cookie, buffer, orig_size); +} +#endif /*HAVE_FUNOPEN*/ +#ifdef HAVE_FOPENCOOKIE +static ssize_t +fun2_cookie_write (void *cookie, const char *buffer, size_t orig_size) +{ + return _assuan_cookie_write_data (cookie, buffer, orig_size); +} +#endif /*HAVE_FOPENCOOKIE*/ + /* Return a FP to be used for data output. The FILE pointer is valid until the end of a handler. So a close is not needed. Assuan does all the buffering needed to insert the status line as well as the @@ -648,10 +684,14 @@ if (ctx->outbound.data.fp) return ctx->outbound.data.fp; +#ifdef HAVE_FUNOPEN + ctx->outbound.data.fp = funopen (ctx, 0, fun1_cookie_write, + 0, _assuan_cookie_write_flush); +#else + ctx->outbound.data.fp = funopen (ctx, 0, fun2_cookie_write, + 0, _assuan_cookie_write_flush); +#endif - ctx->outbound.data.fp = funopen (ctx, 0, - _assuan_cookie_write_data, - 0, _assuan_cookie_write_flush); ctx->outbound.data.error = 0; return ctx->outbound.data.fp; #else Modified: trunk/assuan/assuan-io.c =================================================================== --- trunk/assuan/assuan-io.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-io.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -23,12 +23,9 @@ #include #endif +#include #include #include -#include -#if HAVE_SYS_UIO_H -# include -#endif #include #include #ifdef HAVE_W32_SYSTEM @@ -39,65 +36,12 @@ #include "assuan-defs.h" -/* We can't include pth.h and we are not sure whether other headers - already included it. This we define macros with the same - values. */ -#define MY_PTH_FDMODE_ERROR (-1) -#define MY_PTH_FDMODE_POLL 0 -#define MY_PTH_FDMODE_BLOCK 1 -#define MY_PTH_FDMODE_NONBLOCK 2 - -#ifndef _ASSUAN_NO_PTH -extern pid_t pth_waitpid (pid_t pid, int *status, int options); -extern ssize_t pth_read (int fd, void *buffer, size_t size); -extern ssize_t pth_write (int fd, const void *buffer, size_t size); -extern int pth_fdmode (int, int); -extern int pth_select(int, fd_set*, fd_set*, fd_set*, struct timeval*); - #ifndef HAVE_W32_SYSTEM -#pragma weak pth_waitpid -#pragma weak pth_read -#pragma weak pth_write -#pragma weak pth_fdmode -#pragma weak pth_select -#endif -#endif /*!_ASSUAN_NO_PTH*/ - -#ifndef _ASSUAN_NO_PTH -/* Wrapper around pth_fdmode. */ -static int -my_pth_fdmode (int fd, int mode) -{ - if (pth_fdmode) - return pth_fdmode (fd, mode); - else - return MY_PTH_FDMODE_NONBLOCK; /* This is okay, given the way we use it. */ -} -#endif /*_ASSUAN_NO_PTH*/ - -#ifndef _ASSUAN_NO_PTH -/* Wrapper around pth_select. */ -static int -my_pth_select (int nfd, fd_set *rfds, fd_set *wfds, fd_set *efds, - struct timeval *timeout) -{ - if (pth_select) - return pth_select (nfd, rfds, wfds, efds, timeout); - else - return 1; /* Fake one fd ready; this is okay, given the way we use it. */ -} -#endif /*_ASSUAN_NO_PTH*/ - -#ifndef HAVE_W32_SYSTEM pid_t _assuan_waitpid (pid_t pid, int *status, int options) { -#ifdef _ASSUAN_NO_PTH return waitpid (pid, status, options); -#else - return (pth_waitpid ? pth_waitpid : waitpid) (pid, status, options); -#endif } #endif @@ -105,72 +49,26 @@ ssize_t _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size) { -#ifdef _ASSUAN_NO_PTH return read (ctx->inbound.fd, buffer, size); -#else -# ifndef HAVE_W32_SYSTEM - return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size); -# else - return pth_read ? pth_read (ctx->inbound.fd, buffer, size) - : recv (ctx->inbound.fd, buffer, size, 0); -# endif -#endif } ssize_t _assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size) { -#ifdef _ASSUAN_NO_PTH return write (ctx->outbound.fd, buffer, size); -#else -# ifndef HAVE_W32_SYSTEM - return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size); -# else - return pth_write ? pth_write (ctx->outbound.fd, buffer, size) - : send (ctx->outbound.fd, buffer, size, 0); -# endif -#endif } ssize_t _assuan_simple_sendmsg (assuan_context_t ctx, struct msghdr *msg) { -#if defined(HAVE_W32_SYSTEM) +#ifdef HAVE_W32_SYSTEM return _assuan_error (ASSUAN_Not_Implemented); -#elif defined(_ASSUAN_NO_PTH) +#else int ret; while ( (ret = sendmsg (ctx->outbound.fd, msg, 0)) == -1 && errno == EINTR) ; return ret; -#else - /* Pth does not provide a sendmsg function. Thus we implement it here. */ - int ret; - int fd = ctx->outbound.fd; - int fdmode; - - fdmode = my_pth_fdmode (fd, MY_PTH_FDMODE_POLL); - if (fdmode == MY_PTH_FDMODE_ERROR) - { - errno = EBADF; - return -1; - } - if (fdmode == MY_PTH_FDMODE_BLOCK) - { - fd_set fds; - - FD_ZERO (&fds); - FD_SET (fd, &fds); - while ( (ret = my_pth_select (fd+1, NULL, &fds, NULL, NULL)) < 0 - && errno == EINTR) - ; - if (ret < 0) - return -1; - } - - while ((ret = sendmsg (fd, msg, 0)) == -1 && errno == EINTR) - ; - return ret; #endif } @@ -178,40 +76,12 @@ ssize_t _assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg) { -#if defined(HAVE_W32_SYSTEM) +#ifdef HAVE_W32_SYSTEM return _assuan_error (ASSUAN_Not_Implemented); -#elif defined(_ASSUAN_NO_PTH) +#else int ret; while ( (ret = recvmsg (ctx->inbound.fd, msg, 0)) == -1 && errno == EINTR) ; return ret; -#else - /* Pth does not provide a recvmsg function. Thus we implement it here. */ - int ret; - int fd = ctx->inbound.fd; - int fdmode; - - fdmode = my_pth_fdmode (fd, MY_PTH_FDMODE_POLL); - if (fdmode == MY_PTH_FDMODE_ERROR) - { - errno = EBADF; - return -1; - } - if (fdmode == MY_PTH_FDMODE_BLOCK) - { - fd_set fds; - - FD_ZERO (&fds); - FD_SET (fd, &fds); - while ( (ret = my_pth_select (fd+1, &fds, NULL, NULL, NULL)) < 0 - && errno == EINTR) - ; - if (ret < 0) - return -1; - } - - while ((ret = recvmsg (fd, msg, 0)) == -1 && errno == EINTR) - ; - return ret; #endif } Modified: trunk/assuan/assuan-pipe-server.c =================================================================== --- trunk/assuan/assuan-pipe-server.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-pipe-server.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -168,6 +168,7 @@ { xfree (ctx->hello_line); xfree (ctx->okay_line); + xfree (ctx->cmdtbl); xfree (ctx); } } Modified: trunk/assuan/assuan-uds.c =================================================================== --- trunk/assuan/assuan-uds.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-uds.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -44,7 +44,27 @@ #include "assuan-defs.h" +#ifdef USE_DESCRIPTOR_PASSING +/* Provide replacement for missing CMSG maccros. We assume that + size_t matches the alignment requirement. */ +#define MY_ALIGN(n) ((((n))+ sizeof(size_t)-1) & (size_t)~(sizeof(size_t)-1)) +#ifndef CMSG_SPACE +#define CMSG_SPACE(n) (MY_ALIGN(sizeof(struct cmsghdr)) + MY_ALIGN((n))) +#endif +#ifndef CMSG_LEN +#define CMSG_LEN(n) (MY_ALIGN(sizeof(struct cmsghdr)) + (n)) +#endif +#ifndef CMSG_FIRSTHDR +#define CMSG_FIRSTHDR(mhdr) \ + ((size_t)(mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ + ? (struct cmsghdr*) (mhdr)->msg_control : (struct cmsghdr*)NULL) +#endif +#ifndef CMSG_DATA +#define CMSG_DATA(cmsg) ((unsigned char*)((struct cmsghdr*)(cmsg)+1)) +#endif +#endif /*USE_DESCRIPTOR_PASSING*/ + /* Read from a unix domain socket using sendmsg. FIXME: We don't need the buffering. It is a leftover from the time @@ -55,7 +75,6 @@ int len = ctx->uds.buffersize; #ifndef HAVE_W32_SYSTEM - if (!ctx->uds.bufferallocated) { ctx->uds.buffer = xtrymalloc (2048); @@ -68,11 +87,13 @@ { struct msghdr msg; struct iovec iovec; +#ifdef USE_DESCRIPTOR_PASSING union { struct cmsghdr cm; char control[CMSG_SPACE(sizeof (int))]; } control_u; struct cmsghdr *cmptr; +#endif /*USE_DESCRIPTOR_PASSING*/ memset (&msg, 0, sizeof (msg)); @@ -82,8 +103,10 @@ msg.msg_iovlen = 1; iovec.iov_base = ctx->uds.buffer; iovec.iov_len = ctx->uds.bufferallocated; +#ifdef USE_DESCRIPTOR_PASSING msg.msg_control = control_u.control; msg.msg_controllen = sizeof (control_u.control); +#endif len = _assuan_simple_recvmsg (ctx, &msg); if (len < 0) @@ -92,6 +115,7 @@ ctx->uds.buffersize = len; ctx->uds.bufferoffset = 0; +#ifdef USE_DESCRIPTOR_PASSING cmptr = CMSG_FIRSTHDR (&msg); if (cmptr && cmptr->cmsg_len == CMSG_LEN (sizeof(int))) { @@ -112,9 +136,13 @@ ctx->uds.pendingfds[ctx->uds.pendingfdscount++] = fd; } } +#endif /*USE_DESCRIPTOR_PASSING*/ } + #else /*HAVE_W32_SYSTEM*/ + len = recvfrom (ctx->inbound.fd, buf, buflen, 0, NULL, NULL); + #endif /*HAVE_W32_SYSTEM*/ /* Return some data to the user. */ @@ -149,8 +177,6 @@ msg.msg_iov = &iovec; iovec.iov_base = (void*)buf; iovec.iov_len = buflen; - msg.msg_control = 0; - msg.msg_controllen = 0; len = _assuan_simple_sendmsg (ctx, &msg); #else /*HAVE_W32_SYSTEM*/ @@ -167,7 +193,7 @@ static assuan_error_t uds_sendfd (assuan_context_t ctx, int fd) { -#ifndef HAVE_W32_SYSTEM +#ifdef USE_DESCRIPTOR_PASSING struct msghdr msg; struct iovec iovec; union { @@ -217,7 +243,7 @@ static assuan_error_t uds_receivefd (assuan_context_t ctx, int *fd) { -#ifndef HAVE_W32_SYSTEM +#ifdef USE_DESCRIPTOR_PASSING int i; if (!ctx->uds.pendingfdscount) Modified: trunk/assuan/assuan-util.c =================================================================== --- trunk/assuan/assuan-util.c 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan-util.c 2006-11-29 16:25:46 UTC (rev 1189) @@ -125,7 +125,22 @@ } +void +assuan_set_io_monitor (assuan_context_t ctx, + unsigned int (*monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen)) +{ + if (ctx) + { + ctx->io_monitor = monitor; + } +} + + + /* For context CTX, set the flag FLAG to VALUE. Values for flags are usually 1 or 0 but certain flags might allow for other values; see the description of the type assuan_flag_t for details. */ Modified: trunk/assuan/assuan.h =================================================================== --- trunk/assuan/assuan.h 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/assuan.h 2006-11-29 16:25:46 UTC (rev 1189) @@ -95,6 +95,8 @@ #define _ASSUAN_PREFIX(x) _ASSUAN_PREFIX2(_ASSUAN_EXT_SYM_PREFIX,x) #define assuan_ _ASSUAN_PREFIX(assuan_) #define assuan_register_command _ASSUAN_PREFIX(assuan_register_command) +#define assuan_register_post_cmd_notify \ + _ASSUAN_PREFIX(assuan_register_post_cmd_notify) #define assuan_register_bye_notify _ASSUAN_PREFIX(assuan_register_bye_notify) #define assuan_register_reset_notify \ _ASSUAN_PREFIX(assuan_register_reset_notify) @@ -146,6 +148,7 @@ #define assuan_set_error _ASSUAN_PREFIX(assuan_set_error) #define assuan_set_pointer _ASSUAN_PREFIX(assuan_set_pointer) #define assuan_get_pointer _ASSUAN_PREFIX(assuan_get_pointer) +#define assuan_set_io_monitor _ASSUAN_PREFIX(assuan_set_io_monitor) #define assuan_begin_confidential _ASSUAN_PREFIX(assuan_begin_confidential) #define assuan_end_confidential _ASSUAN_PREFIX(assuan_end_confidential) #define assuan_strerror _ASSUAN_PREFIX(assuan_strerror) @@ -282,9 +285,11 @@ #define ASSUAN_Unexpected_Data 125 #define ASSUAN_Invalid_Status 126 #define ASSUAN_Locale_Problem 127 +#endif #define ASSUAN_Not_Confirmed 128 /* Warning: Don't use the Error codes, below they are deprecated. */ +#ifndef _ASSUAN_IN_LIBASSUAN #define ASSUAN_Bad_Certificate 201 #define ASSUAN_Bad_Certificate_Chain 202 #define ASSUAN_Missing_Certificate 203 @@ -367,6 +372,8 @@ int assuan_register_command (assuan_context_t ctx, const char *cmd_string, int (*handler)(assuan_context_t, char *)); +int assuan_register_post_cmd_notify (assuan_context_t ctx, + void (*fnc)(assuan_context_t, int)); int assuan_register_bye_notify (assuan_context_t ctx, void (*fnc)(assuan_context_t)); int assuan_register_reset_notify (assuan_context_t ctx, @@ -497,6 +504,12 @@ void assuan_begin_confidential (assuan_context_t ctx); void assuan_end_confidential (assuan_context_t ctx); +void assuan_set_io_monitor (assuan_context_t ctx, + unsigned int (*monitor)(assuan_context_t ctx, + int direction, + const char *line, + size_t linelen)); + /* For context CTX, set the flag FLAG to VALUE. Values for flags are usually 1 or 0 but certain flags might allow for other values; see the description of the type assuan_flag_t for details. */ Modified: trunk/assuan/mkerrors =================================================================== --- trunk/assuan/mkerrors 2006-11-29 15:47:00 UTC (rev 1188) +++ trunk/assuan/mkerrors 2006-11-29 16:25:46 UTC (rev 1189) @@ -84,6 +84,7 @@ case ASSUAN_Unknown_Command: n = 275; break; case ASSUAN_Canceled: n = 277; break; case ASSUAN_No_Secret_Key: n = 17; break; + case ASSUAN_Not_Confirmed: n = 114; break; case ASSUAN_Read_Error: switch (errno) @@ -200,6 +201,7 @@ case 274: n = ASSUAN_Unexpected_Command ; break; case 275: n = ASSUAN_Unknown_Command ; break; case 277: n = ASSUAN_Canceled ; break; + case 114: n = ASSUAN_Not_Confirmed ; break; case ((1<<15)|86): n = ASSUAN_Out_Of_Core ; break; default: n = 0; break; } From cvs at cvs.gnupg.org Wed Nov 29 20:17:02 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 19:41:27 2006 Subject: [svn] ksba - r258 - in trunk: . doc gl src Message-ID: Author: wk Date: 2006-11-29 20:17:00 +0100 (Wed, 29 Nov 2006) New Revision: 258 Added: trunk/gl/dummyobj.c Removed: trunk/debian/ Modified: trunk/ChangeLog trunk/Makefile.am trunk/THANKS trunk/TODO trunk/autogen.sh trunk/configure.ac trunk/doc/ChangeLog trunk/doc/Makefile.am trunk/doc/ksba.texi trunk/gl/Makefile.am trunk/src/ChangeLog trunk/src/cert.c Log: Removed Debian stuff. A few fixes. Add a dummyobj to help with broken ar(1) on OS X Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/ChangeLog 2006-11-29 19:17:00 UTC (rev 258) @@ -1,3 +1,15 @@ +2006-11-29 Werner Koch + + * gl/dummyobj.c: New. + +2006-11-15 Werner Koch + + * autogen.sh: Add convenience option --build-amd64. + +2006-10-20 Werner Koch + + * Makefile.am (stowinstall): New convenience target. + 2006-08-31 Werner Koch Released 1.0.0. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/Makefile.am 2006-11-29 19:17:00 UTC (rev 258) @@ -38,5 +38,7 @@ dist-hook: @set -e; echo "$(VERSION)" > $(distdir)/VERSION +stowinstall: + $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libksba Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/THANKS 2006-11-29 19:17:00 UTC (rev 258) @@ -2,6 +2,7 @@ Bernhard Herzog bh@intevation.de +Brad Hards bradh@frogmouth.net Daiki Ueno ueno@unixuser.org Stéphane Corthésy stephane@sente.ch Thomas Koester tkoester@intevation.de Modified: trunk/TODO =================================================================== --- trunk/TODO 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/TODO 2006-11-29 19:17:00 UTC (rev 258) @@ -51,3 +51,16 @@ ** The ASN.1 parse tree is not released in all places ** Some memory is not released in case of errors. +* src/crl.c +** certificateIssuer not supported + To support this we need to have an extended ksba_crl_get_item + function to either return the issuer or at least set a flag to + indicate that such an extension is available. If this new API is + used we will move detection of the critical certificateIssuer + extension into the old ksba_crl_get_item and bail out only there. + If the new version of that function is used there won't be a need to + bail out. Example of a CRL using this extension: + http://pks.telesec.de/telesec/servlet/download_cr (2006-09-04). + +** Allow fetching of all entry extensions. + Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/autogen.sh 2006-11-29 19:17:00 UTC (rev 258) @@ -84,8 +84,55 @@ # ***** end W32 build script ******* +# ***** AMD64 cross build script ******* +# Used to cross-compile for AMD64 (for testing) +if test "$1" = "--build-amd64"; then + tmp=`dirname $0` + tsdir=`cd "$tmp"; pwd` + shift + if [ ! -f $tsdir/config.guess ]; then + echo "$tsdir/config.guess not found" >&2 + exit 1 + fi + build=`$tsdir/config.guess` + [ -z "$amd64root" ] && amd64root="$HOME/amd64root" + echo "Using $amd64root as standard install directory" >&2 + + # Locate the cross compiler + crossbindir= + for host in x86_64-linux-gnu amd64-linux-gnu; do + if ${host}-gcc --version >/dev/null 2>&1 ; then + crossbindir=/usr/${host}/bin + conf_CC="CC=${host}-gcc" + break; + fi + done + if [ -z "$crossbindir" ]; then + echo "Cross compiler kit not installed" >&2 + echo "Stop." >&2 + exit 1 + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Please run a 'make distclean' first" >&2 + exit 1 + fi + fi + $tsdir/configure --enable-maintainer-mode --prefix=${amd64root} \ + --host=${host} --build=${build} \ + --with-gpg-error-prefix=${amd64root} + + rc=$? + exit $rc +fi +# ***** end AMD64 cross build script ******* + + + + # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { s/^.*(\(.*\))/\1/p Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/configure.ac 2006-11-29 19:17:00 UTC (rev 258) @@ -29,7 +29,7 @@ m4_define([my_version], [1.0.1]) m4_define([my_issvn], [yes]) -m4_define([svn_revision], m4_esyscmd([echo -n $((svn info 2>/dev/null \ +m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)])) AC_INIT([libksba], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), [gpa-dev@gnupg.org]) Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/doc/ChangeLog 2006-11-29 19:17:00 UTC (rev 258) @@ -1,3 +1,9 @@ +2006-11-03 Werner Koch + + * ksba.texi (ksba_cert_get_key_usage): Add list of attributes. + Provided by Brad Hards. + (ksba_cert_get_key_ext_usage): New. + 2006-07-03 Werner Koch * ksba.texi (DNs): New section Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/doc/Makefile.am 2006-11-29 19:17:00 UTC (rev 258) @@ -25,3 +25,12 @@ info_TEXINFOS = ksba.texi ksba_TEXINFOS = gpl.texi +online: ksba.html ksba.pdf + set -e; \ + echo "Uploading current manuals to www.gnupg.org ..."; \ + user=werner ; \ + (cd ksba.html && rsync -vr --exclude='.svn' . \ + $${user}@cvs.gnupg.org:webspace/manuals/ksba/ ); \ + rsync -v ksba.pdf $${user}@cvs.gnupg.org:webspace/manuals/ + + Modified: trunk/doc/ksba.texi =================================================================== --- trunk/doc/ksba.texi 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/doc/ksba.texi 2006-11-29 19:17:00 UTC (rev 258) @@ -568,8 +568,41 @@ @deftypefun gpg_error_t ksba_cert_get_key_usage (@w{ksba_cert_t @var{cert}, unsigned int *@var{r_flags}}) Get the key usage flags. The function returns @code{GPG_ERR_NO_DATA} if no -key usage is specified. +key usage is specified. The usage flags are as shown in RFC3280, section +4.2.1.3. The key usage flags are represented by a bitmask, and you can +test each bit using symbolic constants, which tells you if that usage +is set on the certificate. The constants are + +@table @code +@item KSBA_KEYUSAGE_DIGITAL_SIGNATURE +Usable for digitalSignature. +@item KSBA_KEYUSAGE_NON_REPUDIATION +Usable for nonRepudiation. +@item KSBA_KEYUSAGE_KEY_ENCIPHERMENT +Usable for keyEncipherment. +@item KSBA_KEYUSAGE_DATA_ENCIPHERMENT +Usable for dataEncipherment. +@item KSBA_KEYUSAGE_KEY_AGREEMENT +Usable for for keyAgreement. +@item KSBA_KEYUSAGE_KEY_CERT_SIGN +Usable for keyCertSign. +@item KSBA_KEYUSAGE_CRL_SIGN +Usable for cRLSign. +@item KSBA_KEYUSAGE_ENCIPHER_ONLY +Usable for encipherOnly. +@item KSBA_KEYUSAGE_DECIPHER_ONLY +Usable for decipherOnly. +@end table + +These are the basic constraints on usage of a certificate. If you need +to get additional constraints, see @code{ksba_cert_get_ext_key_usages}. @end deftypefun + +@deftypefun gpg_error_t ksba_cert_get_ext_key_usages (@w{ksba_cert_t @var{cert}, char **@var{result}}) + +Return a string containing the extended usages for the certificate, +delimited by linefeeds. +@end deftypefun @deftypefun gpg_error_t ksba_cert_get_cert_policies (@w{ksba_cert_t @var{cert}, char **@var{r_policies}}) Modified: trunk/gl/Makefile.am =================================================================== --- trunk/gl/Makefile.am 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/gl/Makefile.am 2006-11-29 19:17:00 UTC (rev 258) @@ -15,8 +15,8 @@ noinst_LTLIBRARIES = libgnu.la -libgnu_la_SOURCES = -libgnu_la_LIBADD = @LTLIBOBJS@ +libgnu_la_SOURCES = dummyobj.c +libgnu_la_LIBADD = @LTLIBOBJS@ EXTRA_DIST = BUILT_SOURCES = SUFFIXES = Added: trunk/gl/dummyobj.c =================================================================== --- trunk/gl/dummyobj.c 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/gl/dummyobj.c 2006-11-29 19:17:00 UTC (rev 258) @@ -0,0 +1,9 @@ +/* dummyobj.c -- Dummy to help libtool with a broken ar(1) */ + +int +_ksba_dummyobj_for_broken_ar (int foo) +{ + return foo; +} + + Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/src/ChangeLog 2006-11-29 19:17:00 UTC (rev 258) @@ -1,3 +1,17 @@ +2006-11-29 Werner Koch + + * ocsp.c (parse_single_response): Fixed skipping of the NULL. + + * cert.c (ksba_cert_get_image): Cast an arg for printf. + +2006-10-18 Werner Koch + + * cert.c (ksba_cert_get_key_usage): Map GPG_ERR_NO_VALUE to + GPG_ERR_NO_DATA. This is required in case no extensions at all + are available. + (ksba_cert_get_cert_policies, ksba_cert_get_ext_key_usages) + (ksba_cert_get_auth_key_id, get_simple_octet_string_ext): Ditto. + 2006-08-31 Werner Koch * ocsp.h (struct ocsp_extension_s): New. Modified: trunk/src/cert.c =================================================================== --- trunk/src/cert.c 2006-08-31 16:03:56 UTC (rev 257) +++ trunk/src/cert.c 2006-11-29 19:17:00 UTC (rev 258) @@ -1127,7 +1127,8 @@ if (!strcmp (oid, oidstr_keyUsage)) break; } - if (gpg_err_code (err) == GPG_ERR_EOF) + if (gpg_err_code (err) == GPG_ERR_EOF + || gpg_err_code (err) == GPG_ERR_NO_VALUE) return gpg_error (GPG_ERR_NO_DATA); /* no key usage */ if (err) return err; @@ -1355,7 +1356,7 @@ if (gpg_err_code (err) == GPG_ERR_EOF) err = 0; - if (!*r_policies) + if (!*r_policies || gpg_err_code (err) == GPG_ERR_NO_VALUE) err = gpg_error (GPG_ERR_NO_DATA); leave: @@ -1446,7 +1447,7 @@ if (gpg_err_code (err) == GPG_ERR_EOF) err = 0; - if (!*result) + if (!*result || gpg_err_code (err) == GPG_ERR_NO_VALUE) err = gpg_error (GPG_ERR_NO_DATA); leave: @@ -1750,7 +1751,8 @@ if (!strcmp (oid, oidstr_authorityKeyIdentifier)) break; } - if (gpg_err_code (err) == GPG_ERR_EOF) + if (gpg_err_code (err) == GPG_ERR_EOF + || gpg_err_code (err) == GPG_ERR_NO_VALUE) return gpg_error (GPG_ERR_NO_DATA); /* not available */ if (err) return err; @@ -1893,7 +1895,8 @@ } if (err) { - if (gpg_err_code (err) == GPG_ERR_EOF) + if (gpg_err_code (err) == GPG_ERR_EOF + || gpg_err_code (err) == GPG_ERR_NO_VALUE) return gpg_error (GPG_ERR_NO_DATA); return err; } From cvs at cvs.gnupg.org Wed Nov 29 20:21:18 2006 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed Nov 29 19:45:39 2006 Subject: [svn] gpgme - r1190 - trunk/gpgme Message-ID: Author: marcus Date: 2006-11-29 20:21:18 +0100 (Wed, 29 Nov 2006) New Revision: 1190 Modified: trunk/gpgme/ChangeLog trunk/gpgme/engine-gpgsm.c trunk/gpgme/gpgme.h Log: 2006-11-29 Marcus Brinkmann * engine-gpgsm.c (gpgsm_new): Check return value of assuan_pipe_connect. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2006-11-29 16:25:46 UTC (rev 1189) +++ trunk/gpgme/ChangeLog 2006-11-29 19:21:18 UTC (rev 1190) @@ -1,5 +1,8 @@ 2006-11-29 Marcus Brinkmann + * engine-gpgsm.c (gpgsm_new): Check return value of + assuan_pipe_connect. + * rungpg.c: Include . (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and --lc-messages. Fixes issue 734. Modified: trunk/gpgme/engine-gpgsm.c =================================================================== --- trunk/gpgme/engine-gpgsm.c 2006-11-29 16:25:46 UTC (rev 1189) +++ trunk/gpgme/engine-gpgsm.c 2006-11-29 19:21:18 UTC (rev 1190) @@ -406,7 +406,8 @@ err = assuan_pipe_connect (&gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (), argv, child_fds); - /* FIXME: Check error. */ + if (err) + goto leave; /* We need to know the fd used by assuan for reads. We do this by using the assumption that the first returned fd from Modified: trunk/gpgme/gpgme.h =================================================================== --- trunk/gpgme/gpgme.h 2006-11-29 16:25:46 UTC (rev 1189) +++ trunk/gpgme/gpgme.h 2006-11-29 19:21:18 UTC (rev 1190) @@ -72,7 +72,7 @@ AM_PATH_GPGME macro) check that this header matches the installed library. Warning: Do not edit the next line. configure will do that for you! */ -#define GPGME_VERSION "1.1.3-cvs1179" +#define GPGME_VERSION "1.1.3-cvs1188" From cvs at cvs.gnupg.org Wed Nov 29 20:24:50 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 19:49:09 2006 Subject: [svn] ksba - r259 - trunk Message-ID: Author: wk Date: 2006-11-29 20:24:50 +0100 (Wed, 29 Nov 2006) New Revision: 259 Modified: trunk/ChangeLog trunk/NEWS trunk/configure.ac Log: Preparing a release Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-29 19:17:00 UTC (rev 258) +++ trunk/ChangeLog 2006-11-29 19:24:50 UTC (rev 259) @@ -1,5 +1,9 @@ 2006-11-29 Werner Koch + Released 1.0.1. + + * configure.ac: Bumped LT version to C17/A9/R1. + * gl/dummyobj.c: New. 2006-11-15 Werner Koch Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-29 19:17:00 UTC (rev 258) +++ trunk/NEWS 2006-11-29 19:24:50 UTC (rev 259) @@ -1,9 +1,13 @@ -Noteworthy changes in version 1.0.1 -------------------------------------------------- +Noteworthy changes in version 1.0.1 (2006-11-29) +------------------------------------------------ + * Fixes for certificates lacking certain objects. + * Fixes to allow building on systems with a broken ar. + + Noteworthy changes in version 1.0.0 (2006-08-31) -------------------------------------------------- +------------------------------------------------ * OCSP nonces are now checked to detect replay attacks. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-29 19:17:00 UTC (rev 258) +++ trunk/configure.ac 2006-11-29 19:24:50 UTC (rev 259) @@ -27,7 +27,7 @@ # 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.0.1]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)])) @@ -41,7 +41,7 @@ # Please remember to document interface changes in the NEWS file. LIBKSBA_LT_CURRENT=17 LIBKSBA_LT_AGE=9 -LIBKSBA_LT_REVISION=0 +LIBKSBA_LT_REVISION=1 #------------------- # If the API is changed in an incompatible way: increment the next counter. KSBA_CONFIG_API_VERSION=1 From cvs at cvs.gnupg.org Wed Nov 29 21:04:27 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed Nov 29 20:28:47 2006 Subject: [svn] ksba - r260 - tags Message-ID: Author: wk Date: 2006-11-29 21:04:27 +0100 (Wed, 29 Nov 2006) New Revision: 260 Added: tags/libksba-1.0.1/ Log: Tagged 1.0.1 release Copied: tags/libksba-1.0.1 (from rev 259, trunk) From cvs at cvs.gnupg.org Thu Nov 30 16:36:40 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 30 16:01:35 2006 Subject: [svn] gpg-error - r184 - in trunk: . po src Message-ID: Author: wk Date: 2006-11-30 16:36:39 +0100 (Thu, 30 Nov 2006) New Revision: 184 Added: trunk/README.SVN Removed: trunk/README.CVS Modified: trunk/ChangeLog trunk/NEWS trunk/README trunk/autogen.sh trunk/configure.ac trunk/po/de.po trunk/po/fr.po trunk/po/libgpg-error.pot trunk/po/pl.po trunk/po/ro.po trunk/po/vi.po trunk/src/gpg-error.c Log: * configure.ac: Set LT version to C3/A3/R1. * README: Switch to tar.bz2 and sha1sum. * src/gpg-error.c (main): Add option --version. * autogen.sh (FORCE): Add option --force. * intl/: Removed. * Makefile.am (SUBDIRS): Removed intl. * configure.ac (AM_GNU_GETTEXT): Use external flag * src/Makefile.am: Removed -I../intl. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/ChangeLog 2006-11-30 15:36:39 UTC (rev 184) @@ -1,5 +1,15 @@ 2006-11-30 Werner Koch + Released 1.5. + + * configure.ac: Set LT version to C3/A3/R1. + + * README: Switch to tar.bz2 and sha1sum. + + * src/gpg-error.c (main): Add option --version. + + * autogen.sh (FORCE): Add option --force. + * intl/: Removed. * Makefile.am (SUBDIRS): Removed intl. * configure.ac (AM_GNU_GETTEXT): Use external flag Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/NEWS 2006-11-30 15:36:39 UTC (rev 184) @@ -1,11 +1,13 @@ -Noteworthy changes in version 1.5 +Noteworthy changes in version 1.5 (2006-11-30) ---------------------------------------------- * Minor build system fixes. * Updated gettext. Removed included gettext copy. + * gpg-error has a new option --version. + Noteworthy changes in version 1.4 (2006-09-14) ---------------------------------------------- Modified: trunk/README =================================================================== --- trunk/README 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/README 2006-11-30 15:36:39 UTC (rev 184) @@ -32,7 +32,7 @@ important step! 2) Unpack the archive. With GNU tar you can do it this way: - "tar xzvf libgpg-error-x.y.tar.gz" + "tar xjvf libgpg-error-x.y.tar.bz2" 3) "cd libgpg-error-x.y" @@ -53,24 +53,24 @@ a) If you already have a trusted version of GnuPG installed, you can simply check the supplied signature: - $ gpg --verify libgpg-error-x.y.tar.gz.sig + $ gpg --verify libgpg-error-x.y.tar.bz2.sig - This checks that the detached signature libgpg-error-x.y.tar.gz.sig - is indeed a a signature of libgpg-error-x.y.tar.gz. + This checks that the detached signature libgpg-error-x.y.tar.bz2.sig + is indeed a a signature of libgpg-error-x.y.tar.bz2. Please note that you have to use an old version of GnuPG to do all this stuff. *Never* use the version which was built using the library you are trying to verify! b) If you don't have any a trusted version of GnuPG, you can attempt - to verify the MD5 checksum, using a trusted version of the md5sum + to verify the SHA1 checksum, using a trusted version of the sha1sum program: - $ md5sum libgpg-error-x.y.tar.gz + $ sha1sum libgpg-error-x.y.tar.bz2 This should yield an output _similar_ to this: - fd9351b26b3189c1d577f0970f9dcadc libgpg-error-x.y.tar.gz + 610064e5b77700f5771c8fde2691c4365e1ca100 libgpg-error-x.y.tar.bz2 Now check that this checksum is _exactly_ the same as the one published via the announcement list and probably via Usenet. Deleted: trunk/README.CVS Copied: trunk/README.SVN (from rev 183, trunk/README.CVS) =================================================================== --- trunk/README.CVS 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/README.SVN 2006-11-30 15:36:39 UTC (rev 184) @@ -0,0 +1,51 @@ +If you are building from Subversion, run the script + +./autogen.sh + +first, to make sure that you have all the necessary maintainer tools +are installed and to build the actual configuration files. If you +have just updated from SVN, you should add the option "--force" to +autogen.sh so that meta data from SVN is noticed. Then run + +./configure --enable-maintainer-mode + +followed by the usual make. + +If autogen.sh complains about insufficient versions of the required +tools, or the tools are not installed, you may use environment +variables to override the default tool names: + + AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake + package. For example + AUTOMAKE_SUFFIX="-1.7" ./autogen.sh + uses "automake-1.7" and "aclocal-1.7. + AUTOMAKE_PREFIX is used as a prefix for all tools from the automake + page and may be combined with AUTOMAKE_SUFFIX. e.g.: + AUTOMAKE_PREFIX=/usr/foo/bin ./autogen.sh + uses "automake" and "aclocal" in the /usr/foo/bin + directory. + AUTOCONF_SUFFIX is used as a suffix for all tools from the automake + package + AUTOCONF_PREFIX is used as a prefix for all tools from the automake + package + GETTEXT_SUFFIX is used as a suffix for all tools from the gettext + package + GETTEXT_PREFIX is used as a prefix for all tools from the gettext + package + +It is also possible to use the variable name AUTOMAKE, AUTOCONF, +ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name +of the programs to run. It is however better to use the suffix and +prefix forms as described above because that does not require +knowledge about the actual tools used by autgen.sh. + + +Please don't use autopoint, libtoolize or autoreconf unless you are +the current maintainer and want to update the standard configuration +files. All those files should be in the SVN and only updated manually +if the maintainer decides that newer versions are required. The +maintainer should also make sure that the required version of automake +et al. are properly indicated at the top of configure.ac and take care +to copy the files and not merely use symlinks. + + Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/autogen.sh 2006-11-30 15:36:39 UTC (rev 184) @@ -29,6 +29,11 @@ } DIE=no +FORCE= +if test "$1" == "--force"; then + FORCE=" --force" + shift +fi # ***** W32 build script ******* # Used to cross-compile for Windows. @@ -186,7 +191,7 @@ $AUTOHEADER echo "Running automake --gnu ..." $AUTOMAKE --gnu; -echo "Running autoconf..." -$AUTOCONF +echo "Running autoconf${FORCE} ..." +$AUTOCONF${FORCE} echo "You may now run \"./configure --enable-maintainer-mode && make\"." Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/configure.ac 2006-11-30 15:36:39 UTC (rev 184) @@ -26,7 +26,7 @@ # 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.5]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) @@ -40,7 +40,7 @@ # Note that added error codes don't constitute an interface change. LIBGPG_ERROR_LT_CURRENT=3 LIBGPG_ERROR_LT_AGE=3 -LIBGPG_ERROR_LT_REVISION=0 +LIBGPG_ERROR_LT_REVISION=1 AC_SUBST(LIBGPG_ERROR_LT_CURRENT) AC_SUBST(LIBGPG_ERROR_LT_AGE) AC_SUBST(LIBGPG_ERROR_LT_REVISION) Modified: trunk/po/de.po =================================================================== --- trunk/po/de.po 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/de.po 2006-11-30 15:36:39 UTC (rev 184) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: libgpg-error-1.4\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: 2006-09-14 15:11+0200\n" "Last-Translator: Werner Koch \n" "Language-Team: none\n" @@ -1023,12 +1023,12 @@ msgid "Unknown error code" msgstr "Unbekannter Fehlercode" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "Aufruf: %s GPG-FEHLER [...]\n" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "%s: Warnung: %s konnte nicht erkannt werden\n" Modified: trunk/po/fr.po =================================================================== --- trunk/po/fr.po 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/fr.po 2006-11-30 15:36:39 UTC (rev 184) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: libgpg-error 1.0\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: 2005-08-18 16:48+0100\n" "Last-Translator: Stephane Roy \n" "Language-Team: French \n" @@ -1040,12 +1040,12 @@ msgid "Unknown error code" msgstr "Code d'erreur inconnu" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "Usage : %s GPG-ERROR [...]\n" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "%s : attention : pourrait ne pas reconnaître %s\n" Modified: trunk/po/libgpg-error.pot =================================================================== --- trunk/po/libgpg-error.pot 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/libgpg-error.pot 2006-11-30 15:36:39 UTC (rev 184) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1024,12 +1024,12 @@ msgid "Unknown error code" msgstr "" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "" Modified: trunk/po/pl.po =================================================================== --- trunk/po/pl.po 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/pl.po 2006-11-30 15:36:39 UTC (rev 184) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: libgpg-error 1.1\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: 2005-07-04 17:42+0200\n" "Last-Translator: Jakub Bogusz \n" "Language-Team: Polish \n" @@ -1043,12 +1043,12 @@ msgid "Unknown error code" msgstr "Nieznany kod b³êdu" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "Sk³adnia: %s B£¡D-GPG [...]\n" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "%s: uwaga: nie rozpoznano %s\n" Modified: trunk/po/ro.po =================================================================== --- trunk/po/ro.po 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/ro.po 2006-11-30 15:36:39 UTC (rev 184) @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: libgpg-error 1.1\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: 2005-06-30 12:00-0500\n" "Last-Translator: Laurentiu Buzdugan \n" "Language-Team: Romanian \n" @@ -1046,12 +1046,12 @@ msgid "Unknown error code" msgstr "Cod de eroare necunoscut" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "Folosire: %s EROARE-GPG [...]\n" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "%s: avertisment: nu am putut recunoaºte %s\n" Modified: trunk/po/vi.po =================================================================== --- trunk/po/vi.po 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/po/vi.po 2006-11-30 15:36:39 UTC (rev 184) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: libgpg-error-1.1\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"POT-Creation-Date: 2006-09-14 14:58+0200\n" +"POT-Creation-Date: 2006-11-30 15:57+0100\n" "PO-Revision-Date: 2006-01-08 16:33+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" @@ -1050,12 +1050,12 @@ msgid "Unknown error code" msgstr "Mã lá»—i lạ" -#: src/gpg-error.c:456 +#: src/gpg-error.c:457 #, c-format msgid "Usage: %s GPG-ERROR [...]\n" msgstr "Cách sá»­ dụng: %s GPG-ERROR [...]\n" -#: src/gpg-error.c:477 +#: src/gpg-error.c:485 #, c-format msgid "%s: warning: could not recognize %s\n" msgstr "%s: cảnh báo : không thể nhận ra %s\n" Modified: trunk/src/gpg-error.c =================================================================== --- trunk/src/gpg-error.c 2006-11-30 14:24:45 UTC (rev 183) +++ trunk/src/gpg-error.c 2006-11-30 15:36:39 UTC (rev 184) @@ -451,12 +451,20 @@ i18n_init (); + if (argc == 1) { - fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"), argv[0]); + fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"), + strrchr (argv[0],'/')? (strrchr (argv[0], '/')+1): argv[0]); exit (1); } + else if (argc == 2 && !strcmp (argv[1], "--version")) + { + fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout); + exit (0); + } + while (i < argc) { gpg_error_t err; From cvs at cvs.gnupg.org Thu Nov 30 16:49:56 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 30 16:14:09 2006 Subject: [svn] gpg-error - r185 - tags Message-ID: Author: wk Date: 2006-11-30 16:49:56 +0100 (Thu, 30 Nov 2006) New Revision: 185 Added: tags/libgpg-error-1.5/ Log: Tagged 1.5 Copied: tags/libgpg-error-1.5 (from rev 184, trunk) From cvs at cvs.gnupg.org Thu Nov 30 16:50:46 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 30 16:14:59 2006 Subject: [svn] gpg-error - r186 - trunk Message-ID: Author: wk Date: 2006-11-30 16:50:46 +0100 (Thu, 30 Nov 2006) New Revision: 186 Modified: trunk/NEWS trunk/configure.ac Log: Post release version number bump Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2006-11-30 15:49:56 UTC (rev 185) +++ trunk/NEWS 2006-11-30 15:50:46 UTC (rev 186) @@ -1,3 +1,7 @@ +Noteworthy changes in version 1.6 +---------------------------------------------- + + Noteworthy changes in version 1.5 (2006-11-30) ---------------------------------------------- Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-11-30 15:49:56 UTC (rev 185) +++ trunk/configure.ac 2006-11-30 15:50:46 UTC (rev 186) @@ -25,8 +25,8 @@ # 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.5]) -m4_define([my_issvn], [no]) +m4_define([my_version], [1.6]) +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;}')])) From cvs at cvs.gnupg.org Thu Nov 30 17:42:49 2006 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu Nov 30 17:07:04 2006 Subject: [svn] gcry - r1193 - in branches/LIBGCRYPT-1-2-BRANCH: . doc m4 src Message-ID: Author: wk Date: 2006-11-30 17:42:47 +0100 (Thu, 30 Nov 2006) New Revision: 1193 Added: branches/LIBGCRYPT-1-2-BRANCH/m4/Makefile.am branches/LIBGCRYPT-1-2-BRANCH/m4/onceonly.m4 branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 branches/LIBGCRYPT-1-2-BRANCH/m4/sys_socket_h.m4 branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h.in Removed: branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h Modified: branches/LIBGCRYPT-1-2-BRANCH/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/Makefile.am branches/LIBGCRYPT-1-2-BRANCH/TODO branches/LIBGCRYPT-1-2-BRANCH/autogen.sh branches/LIBGCRYPT-1-2-BRANCH/configure.ac branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi branches/LIBGCRYPT-1-2-BRANCH/m4/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/src/Makefile.am Log: Ported the socklent_t fallback logic from 1.3 Minor build system changes Modified: branches/LIBGCRYPT-1-2-BRANCH/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193) @@ -1,3 +1,16 @@ +2006-11-30 Werner Koch + + * autogen.sh: New option --force. + * configure.ac: Add SVN revision magic + + * configure.ac (FALLBACK_SOCKLEN_T): Define gcry_socklen_t, to + avoid conflicts with socklen_t definitions by autoconf. + * configure.ac: Do not call GNUPG_FIX_HDR_VERSION. + * configure.ac: Invoke AC_CHECK_SOCKLEN_TYPE. + (AC_CONFIG_FILES): Add src/gcrypt.h and m4/Makefile + (AC_CONFIG_SRCDIR): Change to src/libgcrypt.vers. + * Makefile.am (SUBDIRS): Add m4/ + 2006-08-28 Werner Koch Released 1.2.3. Modified: branches/LIBGCRYPT-1-2-BRANCH/Makefile.am =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/Makefile.am 2006-11-30 16:42:47 UTC (rev 1193) @@ -21,7 +21,7 @@ AUTOMAKE_OPTIONS = dist-bzip2 DIST_SUBDIRS = mpi cipher src doc tests w32-dll -SUBDIRS = mpi cipher src doc tests +SUBDIRS = m4 mpi cipher src doc tests EXTRA_DIST = BUGS autogen.sh README.apichanges README.SVN DISTCLEANFILES = Modified: branches/LIBGCRYPT-1-2-BRANCH/TODO =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/TODO 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/TODO 2006-11-30 16:42:47 UTC (rev 1193) @@ -34,7 +34,5 @@ * cipher/pubkey.c and pubkey implementaions. Don't rely on the secure memory based wiping function but add an extra wiping. - -* We need to figure out at comile time whether socklen_t is defined. - On IRIX 6.5 it seems not to be defined and thus gcrypt.h fails. + Modified: branches/LIBGCRYPT-1-2-BRANCH/autogen.sh =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/autogen.sh 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/autogen.sh 2006-11-30 16:42:47 UTC (rev 1193) @@ -29,8 +29,12 @@ } DIE=no +FORCE= +if test "$1" == "--force"; then + FORCE=" --force" + shift +fi - # Used to cross-compile for Windows. if test "$1" = "--build-w32"; then tmp=`dirname $0` @@ -147,7 +151,7 @@ $AUTOHEADER echo "Running automake --gnu ..." $AUTOMAKE --gnu; -echo "Running autoconf..." -$AUTOCONF +echo "Running autoconf${FORCE} ..." +$AUTOCONF${FORCE} echo "You may now run \"./configure --enable-maintainer-mode && make\"." Modified: branches/LIBGCRYPT-1-2-BRANCH/configure.ac =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/configure.ac 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/configure.ac 2006-11-30 16:42:47 UTC (rev 1193) @@ -1,6 +1,6 @@ # Configure.ac script for Libgcrypt -# Copyright (C) 1998, 1999, 2000, 2001, 2002 -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 +# 2004, 2006 Free Software Foundation, Inc. # # This file is part of Libgcrypt. # @@ -16,20 +16,26 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # # (Process this file with autoconf to produce a configure script.) AC_REVISION($Revision$) AC_PREREQ(2.59) min_automake_version="1.9.3" -# Version number: Remember to change it immediately *after* a release -# but remove a "-cvs" prefix right *before* a release and append it -# soon later. +# 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.2.4]) +m4_define([my_issvn], [yes]) -AC_INIT(libgcrypt, 1.2.4-cvs, bug-libgcrypt@gnupg.org) - +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([libgcrypt], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), + [bug-libgcrypt@gnupg.org]) # LT Version numbers, remember to change them just *before* a release. +# NOTE: API changes must be coordinated with the development branch # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) @@ -46,7 +52,7 @@ PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION -AC_CONFIG_SRCDIR([src/gcrypt.h]) +AC_CONFIG_SRCDIR([src/libgcrypt.vers]) AC_CANONICAL_TARGET() AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_CONFIG_HEADER(config.h) @@ -267,7 +273,7 @@ AC_ARG_ENABLE(ciphers, AC_HELP_STRING([--enable-ciphers=ciphers], [select the symmetric ciphers to include]), - [enabled_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')], + [enabled_ciphers=`echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]'`], [enabled_ciphers=""]) if test "x$enabled_ciphers" = "x" \ -o "$enabled_ciphers" = "yes" \ @@ -287,7 +293,7 @@ AC_ARG_ENABLE(pubkey-ciphers, AC_HELP_STRING([--enable-pubkey-ciphers=ciphers], [select the public-key ciphers to include]), - [enabled_pubkey_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')], + [enabled_pubkey_ciphers=`echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]'`], [enabled_pubkey_ciphers=""]) if test "x$enabled_pubkey_ciphers" = "x" \ -o "$enabled_pubkey_ciphers" = "yes" \ @@ -307,7 +313,7 @@ AC_ARG_ENABLE(digests, AC_HELP_STRING([--enable-digests=digests], [select the message digests to include]), - [enabled_digests=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')], + [enabled_digests=`echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]'`], [enabled_digests=""]) if test "x$enabled_digests" = "x" \ -o "$enabled_digests" = "yes" \ @@ -327,7 +333,7 @@ AC_ARG_ENABLE(random, AC_HELP_STRING([--enable-random=name], [select which random number generator to use]), - [random=$(echo $enableval | tr '[A-Z]' '[a-z]')], + [random=`echo $enableval | tr '[A-Z]' '[a-z]'`], []) if test "x$random" = "x" -o "$random" = "yes" -o "$random" = "no"; then random=default @@ -473,15 +479,15 @@ GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF) GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF) -AC_CHECK_TYPE(socklen_t,, - [AC_DEFINE_UNQUOTED([socklen_t], - [int], - [Define to `int' if unavailable.])], - [ -#include -#include - ]) +gl_TYPE_SOCKLEN_T +if test ".$gl_cv_socklen_t_equiv" = "."; then + FALLBACK_SOCKLEN_T="typedef socklen_t gcry_socklen_t;" +else + FALLBACK_SOCKLEN_T="typedef ${gl_cv_socklen_t_equiv} gcry_socklen_t;" +fi +AC_SUBST(FALLBACK_SOCKLEN_T) + ####################################### #### Checks for library functions. #### ####################################### @@ -646,11 +652,6 @@ fi AC_SUBST(NOEXECSTACK_FLAGS) -# -# Make the version number in src/gcrypt.h the same as the one here. -# (this is easier than to have a *.in file just for one substitution) -# -GNUPG_FIX_HDR_VERSION([src/gcrypt.h], GCRYPT_VERSION) AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION) AC_SUBST(LIBGCRYPT_CONFIG_LIBS) @@ -800,10 +801,12 @@ AC_CONFIG_FILES([ Makefile +m4/Makefile mpi/Makefile cipher/Makefile doc/Makefile src/Makefile +src/gcrypt.h src/libgcrypt-config tests/Makefile w32-dll/Makefile Modified: branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193) @@ -1,3 +1,7 @@ +2006-11-03 Werner Koch + + * gcrypt.texi (Available ciphers): Fixed typo. + 2005-06-16 Werner Koch * gcrypt.texi: Adjusted function prototypes. Modified: branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi 2006-11-30 16:42:47 UTC (rev 1193) @@ -1082,7 +1082,7 @@ AES (Rijndael) with a 128 bit key. @item GCRY_CIPHER_AES192 -@itemx GCRY_CIPHER_RIJNDAEL128 +@itemx GCRY_CIPHER_RIJNDAEL192 AES (Rijndael) with a 192 bit key. @item GCRY_CIPHER_AES256 Modified: branches/LIBGCRYPT-1-2-BRANCH/m4/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/m4/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/m4/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193) @@ -1,3 +1,9 @@ +2006-11-30 Werner Koch + + * Makefile.am: New. + + * sys_socket_h.m4, socklen.m4, onceonly.m4: New files from gnulib. + 2004-04-06 Werner Koch * libtool.m4: Updated from 1.5.4 Added: branches/LIBGCRYPT-1-2-BRANCH/m4/Makefile.am =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/m4/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/m4/Makefile.am 2006-11-30 16:42:47 UTC (rev 1193) @@ -0,0 +1 @@ +EXTRA_DIST = libtool.m4 onceonly.m4 socklen.m4 sys_socket_h.m4 Copied: branches/LIBGCRYPT-1-2-BRANCH/m4/onceonly.m4 (from rev 1184, trunk/m4/onceonly.m4) Copied: branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 (from rev 1184, trunk/m4/socklen.m4) Copied: branches/LIBGCRYPT-1-2-BRANCH/m4/sys_socket_h.m4 (from rev 1184, trunk/m4/sys_socket_h.m4) Modified: branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193) @@ -1,3 +1,12 @@ +2006-11-30 Werner Koch + + * gcrypt.h.in: Replace socklen_t with gcry_socklen_t. + * gcrypt.h.in: Replace version by @VERSION@. + + * gcrypt.h: Add fallback type for socklen_t. Move to ... + * gcrypt.h.in: ... this file. + * Makefile.am (EXTRA_DIST): Add gcrypt.h.in. + 2006-10-19 Werner Koch * global.c (gcry_control) : Return an error Modified: branches/LIBGCRYPT-1-2-BRANCH/src/Makefile.am =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/src/Makefile.am 2006-11-05 20:52:09 UTC (rev 1192) +++ branches/LIBGCRYPT-1-2-BRANCH/src/Makefile.am 2006-11-30 16:42:47 UTC (rev 1193) @@ -18,7 +18,8 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = Manifest libgcrypt-config.in libgcrypt.m4 libgcrypt.vers +EXTRA_DIST = Manifest libgcrypt-config.in libgcrypt.m4 libgcrypt.vers \ + gcrypt.h.in bin_SCRIPTS = libgcrypt-config m4datadir = $(datadir)/aclocal m4data_DATA = libgcrypt.m4 Deleted: branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h Copied: branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h.in (from rev 1177, branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h) =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h 2006-08-28 12:45:47 UTC (rev 1177) +++ branches/LIBGCRYPT-1-2-BRANCH/src/gcrypt.h.in 2006-11-30 16:42:47 UTC (rev 1193) @@ -0,0 +1,1529 @@ +/* gcrypt.h - GNU cryptographic library interface -*- c -*- + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + * 2004, 2006 Free Software Foundation, Inc. + * + * This file is part of Libgcrypt. + * + * Libgcrypt is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * Libgcrypt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + +#ifndef _GCRYPT_H +#define _GCRYPT_H + +#include +#include + +#include + +#include +#ifndef _WIN32 +#include +#endif /*!_WIN32*/ + +@FALLBACK_SOCKLEN_T@ + +#include + +/* This is required for error code compatibility. */ +#define _GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GCRYPT + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + +/* The version of this header should match the one of the library. It + should not be used by a program because gcry_check_version() should + return the same version. The purpose of this macro is to let + autoconf (using the AM_PATH_GCRYPT macro) check that this header + matches the installed library. */ +#define GCRYPT_VERSION "@VERSION@" + +/* Internal: We can't use the convenience macros for the multi + precision integer functions when building this library. */ +#ifdef _GCRYPT_IN_LIBGCRYPT +#ifndef GCRYPT_NO_MPI_MACROS +#define GCRYPT_NO_MPI_MACROS 1 +#endif +#endif + +/* We want to use gcc attributes when possible. Warning: Don't use + these macros in your programs: As indicated by the leading + underscore they are subject to change without notice. */ +#ifdef __GNUC__ + +#define _GCRY_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + +#if _GCRY_GCC_VERSION >= 30100 +#define _GCRY_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#if _GCRY_GCC_VERSION >= 29600 +#define _GCRY_GCC_ATTR_PURE __attribute__ ((__pure__)) +#endif + +#if _GCRY_GCC_VERSION >= 300200 +#define _GCRY_GCC_ATTR_MALLOC __attribute__ ((__malloc__)) +#endif + +#endif /*__GNUC__*/ + +#ifndef _GCRY_GCC_ATTR_DEPRECATED +#define _GCRY_GCC_ATTR_DEPRECATED +#endif +#ifndef _GCRY_GCC_ATTR_PURE +#define _GCRY_GCC_ATTR_PURE +#endif +#ifndef _GCRY_GCC_ATTR_MALLOC +#define _GCRY_GCC_ATTR_MALLOC +#endif + +/* Wrappers for the libgpg-error library. */ + +typedef gpg_error_t gcry_error_t; +typedef gpg_err_code_t gcry_err_code_t; +typedef gpg_err_source_t gcry_err_source_t; + +static GPG_ERR_INLINE gcry_error_t +gcry_err_make (gcry_err_source_t source, gcry_err_code_t code) +{ + return gpg_err_make (source, code); +} + +/* The user can define GPG_ERR_SOURCE_DEFAULT before including this + file to specify a default source for gpg_error. */ +#ifndef GCRY_ERR_SOURCE_DEFAULT +#define GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1 +#endif + +static GPG_ERR_INLINE gcry_error_t +gcry_error (gcry_err_code_t code) +{ + return gcry_err_make (GCRY_ERR_SOURCE_DEFAULT, code); +} + +static GPG_ERR_INLINE gcry_err_code_t +gcry_err_code (gcry_error_t err) +{ + return gpg_err_code (err); +} + + +static GPG_ERR_INLINE gcry_err_source_t +gcry_err_source (gcry_error_t err) +{ + return gpg_err_source (err); +} + +/* Return a pointer to a string containing a description of the error + code in the error value ERR. */ +const char *gcry_strerror (gcry_error_t err); + +/* Return a pointer to a string containing a description of the error + source in the error value ERR. */ +const char *gcry_strsource (gcry_error_t err); + +/* Retrieve the error code for the system error ERR. This returns + GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report + this). */ +gcry_err_code_t gcry_err_code_from_errno (int err); + +/* Retrieve the system error for the error code CODE. This returns 0 + if CODE is not a system error code. */ +int gcry_err_code_to_errno (gcry_err_code_t code); + +/* Return an error value with the error source SOURCE and the system + error ERR. */ +gcry_error_t gcry_err_make_from_errno (gcry_err_source_t source, int err); + +/* Return an error value with the system error ERR. */ +gcry_err_code_t gcry_error_from_errno (int err); + + +enum gcry_thread_option + { + GCRY_THREAD_OPTION_DEFAULT = 0, + GCRY_THREAD_OPTION_USER = 1, + GCRY_THREAD_OPTION_PTH = 2, + GCRY_THREAD_OPTION_PTHREAD = 3 + }; + +/* Do avoid inclusing of too much W32 stuff, we redefine some types. */ +#ifdef _WIN32 +#define _GCRY_PTH_FD_SET void +#define _GCRY_PTH_SOCKADDR void +#define _GCRY_PTH_SOCKLEN_T int +#define _GCRY_PTH_MSGHDR void +#else +#define _GCRY_PTH_FD_SET fd_set +#define _GCRY_PTH_SOCKADDR struct sockaddr +#define _GCRY_PTH_SOCKLEN_T gcry_socklen_t +#define _GCRY_PTH_MSGHDR struct msghdr +#endif + +/* Wrapper for struct ath_ops. */ +struct gcry_thread_cbs +{ + enum gcry_thread_option option; + int (*init) (void); + int (*mutex_init) (void **priv); + int (*mutex_destroy) (void **priv); + int (*mutex_lock) (void **priv); + int (*mutex_unlock) (void **priv); + ssize_t (*read) (int fd, void *buf, size_t nbytes); + ssize_t (*write) (int fd, const void *buf, size_t nbytes); + ssize_t (*select) (int nfd, _GCRY_PTH_FD_SET *rset, _GCRY_PTH_FD_SET *wset, + _GCRY_PTH_FD_SET *eset, struct timeval *timeout); + ssize_t (*waitpid) (pid_t pid, int *status, int options); + int (*accept) (int s, _GCRY_PTH_SOCKADDR *addr, gcry_socklen_t *length_ptr); + int (*connect) (int s, _GCRY_PTH_SOCKADDR *addr, gcry_socklen_t length); + int (*sendmsg) (int s, const _GCRY_PTH_MSGHDR *msg, int flags); + int (*recvmsg) (int s, _GCRY_PTH_MSGHDR *msg, int flags); +}; + +#define GCRY_THREAD_OPTION_PTH_IMPL \ +static int gcry_pth_init (void) \ +{ return (pth_init () == FALSE) ? errno : 0; } \ +static int gcry_pth_mutex_init (void **priv) \ +{ \ + int err = 0; \ + pth_mutex_t *lock = malloc (sizeof (pth_mutex_t)); \ + \ + if (!lock) \ + err = ENOMEM; \ + if (!err) \ + { \ + err = pth_mutex_init (lock); \ + if (err == FALSE) \ + err = errno; \ + else \ + err = 0; \ + if (err) \ + free (lock); \ + else \ + *priv = lock; \ + } \ + return err; \ +} \ +static int gcry_pth_mutex_destroy (void **lock) \ + { /* GNU Pth has no destructor function. */ free (*lock); return 0; } \ +static int gcry_pth_mutex_lock (void **lock) \ + { return ((pth_mutex_acquire (*lock, 0, NULL)) == FALSE) \ + ? errno : 0; } \ +static int gcry_pth_mutex_unlock (void **lock) \ + { return ((pth_mutex_release (*lock)) == FALSE) \ + ? errno : 0; } \ +static ssize_t gcry_pth_read (int fd, void *buf, size_t nbytes) \ + { return pth_read (fd, buf, nbytes); } \ +static ssize_t gcry_pth_write (int fd, const void *buf, size_t nbytes) \ + { return pth_write (fd, buf, nbytes); } \ +static ssize_t gcry_pth_select (int nfd, _GCRY_PTH_FD_SET *rset, \ + _GCRY_PTH_FD_SET *wset, \ + _GCRY_PTH_FD_SET *eset, \ + struct timeval *timeout) \ + { return pth_select (nfd, rset, wset, eset, timeout); } \ +static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options) \ + { return pth_waitpid (pid, status, options); } \ +static int gcry_pth_accept (int s, _GCRY_PTH_SOCKADDR *addr, \ + gcry_socklen_t *length_ptr) \ + { return pth_accept (s, addr, length_ptr); } \ +static int gcry_pth_connect (int s, _GCRY_PTH_SOCKADDR *addr, \ + gcry_socklen_t length) \ + { return pth_connect (s, addr, length); } \ + \ +/* FIXME: GNU Pth is missing pth_sendmsg and pth_recvmsg. */ \ +static struct gcry_thread_cbs gcry_threads_pth = { GCRY_THREAD_OPTION_PTH, \ + gcry_pth_init, gcry_pth_mutex_init, gcry_pth_mutex_destroy, \ + gcry_pth_mutex_lock, gcry_pth_mutex_unlock, gcry_pth_read, gcry_pth_write, \ + gcry_pth_select, gcry_pth_waitpid, gcry_pth_accept, gcry_pth_connect } + +#define GCRY_THREAD_OPTION_PTHREAD_IMPL \ +static int gcry_pthread_mutex_init (void **priv) \ +{ \ + int err = 0; \ + pthread_mutex_t *lock = malloc (sizeof (pthread_mutex_t)); \ + \ + if (!lock) \ + err = ENOMEM; \ + if (!err) \ + { \ + err = pthread_mutex_init (lock, NULL); \ + if (err) \ + free (lock); \ + else \ + *priv = lock; \ + } \ + return err; \ +} \ +static int gcry_pthread_mutex_destroy (void **lock) \ + { int err = pthread_mutex_destroy (*lock); free (*lock); return err; } \ +static int gcry_pthread_mutex_lock (void **lock) \ + { return pthread_mutex_lock (*lock); } \ +static int gcry_pthread_mutex_unlock (void **lock) \ + { return pthread_mutex_unlock (*lock); } \ + \ +static struct gcry_thread_cbs gcry_threads_pthread = \ +{ GCRY_THREAD_OPTION_PTHREAD, NULL, \ + gcry_pthread_mutex_init, gcry_pthread_mutex_destroy, \ + gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock } + + +/* The data object used to hold a multi precision integer. */ +struct gcry_mpi; +typedef struct gcry_mpi *gcry_mpi_t; + +typedef struct gcry_mpi *GCRY_MPI _GCRY_GCC_ATTR_DEPRECATED; +typedef struct gcry_mpi *GcryMPI _GCRY_GCC_ATTR_DEPRECATED; + + + +/* Check that the library fulfills the version requirement. */ +const char *gcry_check_version (const char *req_version); + +/* Codes for function dispatchers. */ + +/* Codes used with the gcry_control function. */ +enum gcry_ctl_cmds + { + GCRYCTL_SET_KEY = 1, + GCRYCTL_SET_IV = 2, + GCRYCTL_CFB_SYNC = 3, + GCRYCTL_RESET = 4, /* e.g. for MDs */ + GCRYCTL_FINALIZE = 5, + GCRYCTL_GET_KEYLEN = 6, + GCRYCTL_GET_BLKLEN = 7, + GCRYCTL_TEST_ALGO = 8, + GCRYCTL_IS_SECURE = 9, + GCRYCTL_GET_ASNOID = 10, + GCRYCTL_ENABLE_ALGO = 11, + GCRYCTL_DISABLE_ALGO = 12, + GCRYCTL_DUMP_RANDOM_STATS = 13, + GCRYCTL_DUMP_SECMEM_STATS = 14, + GCRYCTL_GET_ALGO_NPKEY = 15, + GCRYCTL_GET_ALGO_NSKEY = 16, + GCRYCTL_GET_ALGO_NSIGN = 17, + GCRYCTL_GET_ALGO_NENCR = 18, + GCRYCTL_SET_VERBOSITY = 19, + GCRYCTL_SET_DEBUG_FLAGS = 20, + GCRYCTL_CLEAR_DEBUG_FLAGS = 21, + GCRYCTL_USE_SECURE_RNDPOOL= 22, + GCRYCTL_DUMP_MEMORY_STATS = 23, + GCRYCTL_INIT_SECMEM = 24, + GCRYCTL_TERM_SECMEM = 25, + GCRYCTL_DISABLE_SECMEM_WARN = 27, + GCRYCTL_SUSPEND_SECMEM_WARN = 28, + GCRYCTL_RESUME_SECMEM_WARN = 29, + GCRYCTL_DROP_PRIVS = 30, + GCRYCTL_ENABLE_M_GUARD = 31, + GCRYCTL_START_DUMP = 32, + GCRYCTL_STOP_DUMP = 33, + GCRYCTL_GET_ALGO_USAGE = 34, + GCRYCTL_IS_ALGO_ENABLED = 35, + GCRYCTL_DISABLE_INTERNAL_LOCKING = 36, + GCRYCTL_DISABLE_SECMEM = 37, + GCRYCTL_INITIALIZATION_FINISHED = 38, + GCRYCTL_INITIALIZATION_FINISHED_P = 39, + GCRYCTL_ANY_INITIALIZATION_P = 40, + GCRYCTL_SET_CBC_CTS = 41, + GCRYCTL_SET_CBC_MAC = 42, + GCRYCTL_SET_CTR = 43, + GCRYCTL_ENABLE_QUICK_RANDOM = 44, + GCRYCTL_SET_RANDOM_SEED_FILE = 45, + GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46, + GCRYCTL_SET_THREAD_CBS = 47, + GCRYCTL_FAST_POLL = 48 + }; + +/* Perform various operations defined by CMD. */ +gcry_error_t gcry_control (enum gcry_ctl_cmds CMD, ...); + + +/* S-expression management. */ + +/* The object to represent an S-expression as used with the public key + functions. */ +struct gcry_sexp; +typedef struct gcry_sexp *gcry_sexp_t; + +typedef struct gcry_sexp *GCRY_SEXP _GCRY_GCC_ATTR_DEPRECATED; +typedef struct gcry_sexp *GcrySexp _GCRY_GCC_ATTR_DEPRECATED; + +/* The possible values for the S-expression format. */ +enum gcry_sexp_format + { + GCRYSEXP_FMT_DEFAULT = 0, + GCRYSEXP_FMT_CANON = 1, + GCRYSEXP_FMT_BASE64 = 2, + GCRYSEXP_FMT_ADVANCED = 3 + }; + +/* Create an new S-expression object from BUFFER of size LENGTH and + return it in RETSEXP. With AUTODETECT set to 0 the data in BUFFER + is expected to be in canonized format. */ +gcry_error_t gcry_sexp_new (gcry_sexp_t *retsexp, + const void *buffer, size_t length, + int autodetect); + + /* Same as gcry_sexp_new but allows to pass a FREEFNC which has the + effect to transfer ownership of BUFFER to the created object. */ +gcry_error_t gcry_sexp_create (gcry_sexp_t *retsexp, + void *buffer, size_t length, + int autodetect, void (*freefnc) (void *)); + +/* Scan BUFFER and return a new S-expression object in RETSEXP. This + function expects a printf like string in BUFFER. */ +gcry_error_t gcry_sexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, + const char *buffer, size_t length); + +/* Same as gcry_sexp_sscan but expects a string in FORMAT and can thus + only be used for certain encodings. */ +gcry_error_t gcry_sexp_build (gcry_sexp_t *retsexp, size_t *erroff, + const char *format, ...); + +/* Like gcry_sexp_build, but uses an array instead of variable + function arguments. */ +gcry_error_t gcry_sexp_build_array (gcry_sexp_t *retsexp, size_t *erroff, + const char *format, void **arg_list); + +/* Release the S-expression object SEXP */ +void gcry_sexp_release (gcry_sexp_t sexp); + +/* Calculate the length of an canonized S-expresion in BUFFER and + check for a valid encoding. */ +size_t gcry_sexp_canon_len (const unsigned char *buffer, size_t length, + size_t *erroff, gcry_error_t *errcode); + +/* Copies the S-expression object SEXP into BUFFER using the format + specified in MODE. */ +size_t gcry_sexp_sprint (gcry_sexp_t sexp, int mode, void *buffer, + size_t maxlength); + +/* Dumps the S-expression object A in a aformat suitable for debugging + to Libgcrypt's logging stream. */ +void gcry_sexp_dump (const gcry_sexp_t a); + +gcry_sexp_t gcry_sexp_cons (const gcry_sexp_t a, const gcry_sexp_t b); +gcry_sexp_t gcry_sexp_alist (const gcry_sexp_t *array); +gcry_sexp_t gcry_sexp_vlist (const gcry_sexp_t a, ...); +gcry_sexp_t gcry_sexp_append (const gcry_sexp_t a, const gcry_sexp_t n); +gcry_sexp_t gcry_sexp_prepend (const gcry_sexp_t a, const gcry_sexp_t n); + +/* Scan the S-expression for a sublist with a type (the car of the + list) matching the string TOKEN. If TOKLEN is not 0, the token is + assumed to be raw memory of this length. The function returns a + newly allocated S-expression consisting of the found sublist or + `NULL' when not found. */ +gcry_sexp_t gcry_sexp_find_token (gcry_sexp_t list, + const char *tok, size_t toklen); +/* Return the length of the LIST. For a valid S-expression this + should be at least 1. */ +int gcry_sexp_length (const gcry_sexp_t list); + +/* Create and return a new S-expression from the element with index + NUMBER in LIST. Note that the first element has the index 0. If + there is no such element, `NULL' is returned. */ +gcry_sexp_t gcry_sexp_nth (const gcry_sexp_t list, int number); + +/* Create and return a new S-expression from the first element in + LIST; this called the "type" and should always exist and be a + string. `NULL' is returned in case of a problem. */ +gcry_sexp_t gcry_sexp_car (const gcry_sexp_t list); + +/* Create and return a new list form all elements except for the first + one. Note, that this function may return an invalid S-expression + because it is not guaranteed, that the type exists and is a string. + However, for parsing a complex S-expression it might be useful for + intermediate lists. Returns `NULL' on error. */ +gcry_sexp_t gcry_sexp_cdr (const gcry_sexp_t list); + +gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list); + + +/* This function is used to get data from a LIST. A pointer to the + actual data with index NUMBER is returned and the length of this + data will be stored to DATALEN. If there is no data at the given + index or the index represents another list, `NULL' is returned. + *Note:* The returned pointer is valid as long as LIST is not + modified or released. */ +const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number, + size_t *datalen); + +/* This function is used to get and convert data from a LIST. This + data is assumed to be an MPI stored in the format described by + MPIFMT and returned as a standard Libgcrypt MPI. The caller must + release this returned value using `gcry_mpi_release'. If there is + no data at the given index, the index represents a list or the + value can't be converted to an MPI, `NULL' is returned. */ +gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt); + + + +/******************************************* + * * + * multi precision integer functions * + * * + *******************************************/ + +/* Different formats of external big integer representation. */ +enum gcry_mpi_format + { + GCRYMPI_FMT_NONE= 0, + GCRYMPI_FMT_STD = 1, /* twos complement stored without length */ + GCRYMPI_FMT_PGP = 2, /* As used by OpenPGP (only defined as unsigned)*/ + GCRYMPI_FMT_SSH = 3, /* As used by SSH (same as 1 but with length)*/ + GCRYMPI_FMT_HEX = 4, /* hex format */ + GCRYMPI_FMT_USG = 5 /* like STD but this is an unsigned one */ + }; + +/* Flags used for creating big integers. */ +enum gcry_mpi_flag + { + GCRYMPI_FLAG_SECURE = 1, /* Allocate the number in "secure" memory. */ + GCRYMPI_FLAG_OPAQUE = 2 /* The number is not a real one but just a + way to store some bytes. This is + useful for encrypted big integers. */ + }; + + +/* Allocate a new big integer object, initialize it with 0 and + initially allocate memory for a number of at least NBITS. */ +gcry_mpi_t gcry_mpi_new (unsigned int nbits); + +/* Same as gcry_mpi_new() but allocate in "secure" memory. */ +gcry_mpi_t gcry_mpi_snew (unsigned int nbits); + +/* Release the number A and free all associated resources. */ +void gcry_mpi_release (gcry_mpi_t a); + +/* Create a new number with the same value as A. */ +gcry_mpi_t gcry_mpi_copy (const gcry_mpi_t a); + +/* Store the big integer value U in W. */ +gcry_mpi_t gcry_mpi_set (gcry_mpi_t w, const gcry_mpi_t u); + +/* Store the unsigned integer value U in W. */ +gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u); + +/* Swap the values of A and B. */ +void gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b); + +/* Compare the big integer number U and V returning 0 for equality, a + positive value for U > V and a negative for U < V. */ +int gcry_mpi_cmp (const gcry_mpi_t u, const gcry_mpi_t v); + +/* Compare the big integer number U with the unsigned integer V + returning 0 for equality, a positive value for U > V and a negative + for U < V. */ +int gcry_mpi_cmp_ui (const gcry_mpi_t u, unsigned long v); + +/* Convert the external representation of an integer stored in BUFFER + with a length of BUFLEN into a newly create MPI returned in + RET_MPI. If NSCANNED is not NULL, it will receive the number of + bytes actually scanned after a successful operation. */ +gcry_error_t gcry_mpi_scan (gcry_mpi_t *ret_mpi, enum gcry_mpi_format format, + const void *buffer, size_t buflen, + size_t *nscanned); + +/* Convert the big integer A into the external representation + described by FORMAT and store it in the provided BUFFER which has + been allocated by the user with a size of BUFLEN bytes. NWRITTEN + receives the actual length of the external representation unless it + has been passed as NULL. */ +gcry_error_t gcry_mpi_print (enum gcry_mpi_format format, + unsigned char *buffer, size_t buflen, + size_t *nwritten, + const gcry_mpi_t a); + +/* Convert the big integer A int the external representation described + by FORMAT and store it in a newly allocated buffer which address + will be put into BUFFER. NWRITTEN receives the actual lengths of the + external representation. */ +gcry_error_t gcry_mpi_aprint (enum gcry_mpi_format format, + unsigned char **buffer, size_t *nwritten, + const gcry_mpi_t a); + +/* Dump the value of A in a format suitable for debugging to + Libgcrypt's logging stream. Note that one leading space but no + trailing space or linefeed will be printed. It is okay to pass + NULL for A. */ +void gcry_mpi_dump (const gcry_mpi_t a); + + +/* W = U + V. */ +void gcry_mpi_add (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); + +/* W = U + V. V is an unsigned integer. */ +void gcry_mpi_add_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v); + +/* W = U + V mod M. */ +void gcry_mpi_addm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); + +/* W = U - V. */ +void gcry_mpi_sub (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); + +/* W = U - V. V is an unsigned integer. */ +void gcry_mpi_sub_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v ); + +/* W = U - V mod M */ +void gcry_mpi_subm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); + +/* W = U * V. */ +void gcry_mpi_mul (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); + +/* W = U * V. V is an unsigned integer. */ +void gcry_mpi_mul_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v ); + +/* W = U * V mod M. */ +void gcry_mpi_mulm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); + +/* W = U * (2 ^ CNT). */ +void gcry_mpi_mul_2exp (gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt); + +/* Q = DIVIDEND / DIVISOR, R = DIVIDEND % DIVISOR, + Q or R may be passed as NULL. ROUND should be negative or 0. */ +void gcry_mpi_div (gcry_mpi_t q, gcry_mpi_t r, + gcry_mpi_t dividend, gcry_mpi_t divisor, int round); + +/* R = DIVIDEND % DIVISOR */ +void gcry_mpi_mod (gcry_mpi_t r, gcry_mpi_t dividend, gcry_mpi_t divisor); + +/* W = B ^ E mod M. */ +void gcry_mpi_powm (gcry_mpi_t w, + const gcry_mpi_t b, const gcry_mpi_t e, + const gcry_mpi_t m); + +/* Set G to the greatest common divisor of A and B. + Return true if the G is 1. */ +int gcry_mpi_gcd (gcry_mpi_t g, gcry_mpi_t a, gcry_mpi_t b); + +/* Set X to the multiplicative inverse of A mod M. + Return true if the value exists. */ +int gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t m); + + +/* Return the number of bits required to represent A. */ +unsigned int gcry_mpi_get_nbits (gcry_mpi_t a); + +/* Return true when bit number N (counting from 0) is set in A. */ +int gcry_mpi_test_bit (gcry_mpi_t a, unsigned int n); + +/* Set bit number N in A. */ +void gcry_mpi_set_bit (gcry_mpi_t a, unsigned int n); + +/* Clear bit number N in A. */ +void gcry_mpi_clear_bit (gcry_mpi_t a, unsigned int n); + +/* Set bit number N in A and clear all bits greater than N. */ +void gcry_mpi_set_highbit (gcry_mpi_t a, unsigned int n); + +/* Clear bit number N in A and all bits greater than N. */ +void gcry_mpi_clear_highbit (gcry_mpi_t a, unsigned int n); + +/* Shift the value of A by N bits to the right and store the result in X. */ +void gcry_mpi_rshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n); + +/* Store NBITS of the value P points to in A and mark A as an opaque + value. WARNING: Never use an opaque MPI for anything thing else then + gcry_mpi_release, gcry_mpi_get_opaque. */ +gcry_mpi_t gcry_mpi_set_opaque (gcry_mpi_t a, void *p, unsigned int nbits); + +/* Return a pointer to an opaque value stored in A and return its size + in NBITS. Note that the returned pointer is still owned by A and + that the function should never be used for an non-opaque MPI. */ +void *gcry_mpi_get_opaque (gcry_mpi_t a, unsigned int *nbits); + +/* Set the FLAG for the big integer A. Currently only the flag + GCRYMPI_FLAG_SECURE is allowed to convert A into an big intger + stored in "secure" memory. */ +void gcry_mpi_set_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); + +/* Clear FLAG for the big integer A. Note that this function is + currently useless as no flags are allowed. */ +void gcry_mpi_clear_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); + +/* Return true when the FLAG is set for A. */ +int gcry_mpi_get_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); + +/* Unless the GCRYPT_NO_MPI_MACROS is used, provide a couple of + convenience macors for the big integer functions. */ +#ifndef GCRYPT_NO_MPI_MACROS +#define mpi_new(n) gcry_mpi_new( (n) ) +#define mpi_secure_new( n ) gcry_mpi_snew( (n) ) +#define mpi_release(a) \ + do \ + { \ + gcry_mpi_release ((a)); \ + (a) = NULL; \ + } \ + while (0) + +#define mpi_copy( a ) gcry_mpi_copy( (a) ) +#define mpi_set( w, u) gcry_mpi_set( (w), (u) ) +#define mpi_set_ui( w, u) gcry_mpi_set_ui( (w), (u) ) +#define mpi_cmp( u, v ) gcry_mpi_cmp( (u), (v) ) +#define mpi_cmp_ui( u, v ) gcry_mpi_cmp_ui( (u), (v) ) + +#define mpi_add_ui(w,u,v) gcry_mpi_add_ui((w),(u),(v)) +#define mpi_add(w,u,v) gcry_mpi_add ((w),(u),(v)) +#define mpi_addm(w,u,v,m) gcry_mpi_addm ((w),(u),(v),(m)) +#define mpi_sub_ui(w,u,v) gcry_mpi_sub_ui ((w),(u),(v)) +#define mpi_sub(w,u,v) gcry_mpi_sub ((w),(u),(v)) +#define mpi_subm(w,u,v,m) gcry_mpi_subm ((w),(u),(v),(m)) +#define mpi_mul_ui(w,u,v) gcry_mpi_mul_ui ((w),(u),(v)) +#define mpi_mul_2exp(w,u,v) gcry_mpi_mul_2exp ((w),(u),(v)) +#define mpi_mul(w,u,v) gcry_mpi_mul ((w),(u),(v)) +#define mpi_mulm(w,u,v,m) gcry_mpi_mulm ((w),(u),(v),(m)) +#define mpi_powm(w,b,e,m) gcry_mpi_powm ( (w), (b), (e), (m) ) +#define mpi_tdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), 0) +#define mpi_fdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), -1) +#define mpi_mod(r,a,m) gcry_mpi_mod ((r), (a), (m)) +#define mpi_gcd(g,a,b) gcry_mpi_gcd ( (g), (a), (b) ) +#define mpi_invm(g,a,b) gcry_mpi_invm ( (g), (a), (b) ) + +#define mpi_get_nbits(a) gcry_mpi_get_nbits ((a)) +#define mpi_test_bit(a,b) gcry_mpi_test_bit ((a),(b)) +#define mpi_set_bit(a,b) gcry_mpi_set_bit ((a),(b)) +#define mpi_set_highbit(a,b) gcry_mpi_set_highbit ((a),(b)) +#define mpi_clear_bit(a,b) gcry_mpi_clear_bit ((a),(b)) +#define mpi_clear_highbit(a,b) gcry_mpi_clear_highbit ((a),(b)) +#define mpi_rshift(a,b,c) gcry_mpi_rshift ((a),(b),(c)) + +#define mpi_set_opaque(a,b,c) gcry_mpi_set_opaque( (a), (b), (c) ) +#define mpi_get_opaque(a,b) gcry_mpi_get_opaque( (a), (b) ) +#endif /* GCRYPT_NO_MPI_MACROS */ + + + +/************************************ + * * + * symmetric cipher functions * + * * + ************************************/ + +/* The data object used to hold a handle to an encryption object. */ +struct gcry_cipher_handle; +typedef struct gcry_cipher_handle *gcry_cipher_hd_t; + +typedef struct gcry_cipher_handle *GCRY_CIPHER_HD _GCRY_GCC_ATTR_DEPRECATED; +typedef struct gcry_cipher_handle *GcryCipherHd _GCRY_GCC_ATTR_DEPRECATED; + +/* All symmetric encryption algorithms are identified by their IDs. + More IDs may be registered at runtime. */ +enum gcry_cipher_algos + { + GCRY_CIPHER_NONE = 0, + GCRY_CIPHER_IDEA = 1, + GCRY_CIPHER_3DES = 2, + GCRY_CIPHER_CAST5 = 3, + GCRY_CIPHER_BLOWFISH = 4, + GCRY_CIPHER_SAFER_SK128 = 5, + GCRY_CIPHER_DES_SK = 6, + GCRY_CIPHER_AES = 7, + GCRY_CIPHER_AES192 = 8, + GCRY_CIPHER_AES256 = 9, + GCRY_CIPHER_TWOFISH = 10, + + /* Other cipher numbers are above 300 for OpenPGP reasons. */ + GCRY_CIPHER_ARCFOUR = 301, /* Fully compatible with RSA's RC4 (tm). */ + GCRY_CIPHER_DES = 302, /* Yes, this is single key 56 bit DES. */ + GCRY_CIPHER_TWOFISH128 = 303, + GCRY_CIPHER_SERPENT128 = 304, + GCRY_CIPHER_SERPENT192 = 305, + GCRY_CIPHER_SERPENT256 = 306, + GCRY_CIPHER_RFC2268_40 = 307, /* Ron's Cipher 2 (40 bit). */ + GCRY_CIPHER_RFC2268_128 = 308 /* Ron's Cipher 2 (128 bit). */ + }; + +/* The Rijndael algorithm is basically AES, so provide some macros. */ +#define GCRY_CIPHER_AES128 GCRY_CIPHER_AES +#define GCRY_CIPHER_RIJNDAEL GCRY_CIPHER_AES +#define GCRY_CIPHER_RIJNDAEL128 GCRY_CIPHER_AES128 +#define GCRY_CIPHER_RIJNDAEL192 GCRY_CIPHER_AES192 +#define GCRY_CIPHER_RIJNDAEL256 GCRY_CIPHER_AES256 + +/* The supported encryption modes. Note that not all of them are + supported for each algorithm. */ +enum gcry_cipher_modes + { + GCRY_CIPHER_MODE_NONE = 0, /* Not yet specified. */ + GCRY_CIPHER_MODE_ECB = 1, /* Electronic codebook. */ + GCRY_CIPHER_MODE_CFB = 2, /* Cipher feedback. */ + GCRY_CIPHER_MODE_CBC = 3, /* Cipher block chaining. */ + GCRY_CIPHER_MODE_STREAM = 4, /* Used with stream ciphers. */ + GCRY_CIPHER_MODE_OFB = 5, /* Outer feedback. */ + GCRY_CIPHER_MODE_CTR = 6 /* Counter. */ + }; + +/* Flags used with the open function. */ +enum gcry_cipher_flags + { + GCRY_CIPHER_SECURE = 1, /* Allocate in secure memory. */ + GCRY_CIPHER_ENABLE_SYNC = 2, /* Enable CFB sync mode. */ + GCRY_CIPHER_CBC_CTS = 4, /* Enable CBC cipher text stealing (CTS). */ + GCRY_CIPHER_CBC_MAC = 8 /* Enable CBC message auth. code (MAC). */ + }; + + +/* Create a handle for algorithm ALGO to be used in MODE. FLAGS may + be given as an bitwise OR of the gcry_cipher_flags values. */ +gcry_error_t gcry_cipher_open (gcry_cipher_hd_t *handle, + int algo, int mode, unsigned int flags); + +/* Close the cioher handle H and release all resource. */ +void gcry_cipher_close (gcry_cipher_hd_t h); + +/* Perform various operations on the cipher object H. */ +gcry_error_t gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer, + size_t buflen); + +/* Retrieve various information about the cipher object H. */ +gcry_error_t gcry_cipher_info (gcry_cipher_hd_t h, int what, void *buffer, + size_t *nbytes); + +/* Retrieve various information about the cipher algorithm ALGO. */ +gcry_error_t gcry_cipher_algo_info (int algo, int what, void *buffer, + size_t *nbytes); + +/* Map the cipher algorithm id ALGO to a string representation of that + algorithm name. For unknown algorithms this functions returns an + empty string. */ +const char *gcry_cipher_algo_name (int algo) _GCRY_GCC_ATTR_PURE; + +/* Map the algorithm name NAME to an cipher algorithm ID. Return 0 if + the algorithm name is not known. */ +int gcry_cipher_map_name (const char *name) _GCRY_GCC_ATTR_PURE; + +/* Given an ASN.1 object identifier in standard IETF dotted decimal + format in STRING, return the encryption mode associated with that + OID or 0 if not known or applicable. */ +int gcry_cipher_mode_from_oid (const char *string) _GCRY_GCC_ATTR_PURE; + +/* Encrypt the plaintext of size INLEN in IN using the cipher handle H + into the buffer OUT which has an allocated length of OUTSIZE. For + most algorithms it is possible to pass NULL for in and 0 for INLEN + and do a in-place decryption of the data provided in OUT. */ +gcry_error_t gcry_cipher_encrypt (gcry_cipher_hd_t h, + void *out, size_t outsize, + const void *in, size_t inlen); + +/* The counterpart to gcry_cipher_encrypt. */ +gcry_error_t gcry_cipher_decrypt (gcry_cipher_hd_t h, + void *out, size_t outsize, + const void *in, size_t inlen); + +/* Set key K of length L for the cipher handle H. (We have to cast + away a const char* here - this catch-all ctl function was probably + not the best choice) */ +#define gcry_cipher_setkey(h,k,l) gcry_cipher_ctl( (h), GCRYCTL_SET_KEY, \ + (char*)(k), (l) ) + +/* Set initialization vector K of length L for the cipher handle H. */ +#define gcry_cipher_setiv(h,k,l) gcry_cipher_ctl( (h), GCRYCTL_SET_IV, \ + (char*)(k), (l) ) + +/* Reset the handle to the state after open. */ +#define gcry_cipher_reset(h) gcry_cipher_ctl ((h), GCRYCTL_RESET, NULL, 0) + +/* Perform the the OpenPGP sync operation if this is enabled for the + cipher handle H. */ +#define gcry_cipher_sync(h) gcry_cipher_ctl( (h), GCRYCTL_CFB_SYNC, \ + NULL, 0 ) + +/* Enable or disable CTS in future calls to gcry_encrypt(). CBC mode only. */ +#define gcry_cipher_cts(h,on) gcry_cipher_ctl( (h), GCRYCTL_SET_CBC_CTS, \ + NULL, on ) + +/* Set counter for CTR mode. (K,L) must denote a buffer of block size + length, or (NULL,0) to set the CTR to the all-zero block. */ +#define gcry_cipher_setctr(h,k,l) gcry_cipher_ctl( (h), GCRYCTL_SET_CTR, \ + (char*)(k), (l) ) + +/* Retrieved the key length used with algorithm A. */ +size_t gcry_cipher_get_algo_keylen (int algo); + +/* Retrieve the block length used with algorithm A. */ +size_t gcry_cipher_get_algo_blklen (int algo); + +/* Return 0 if the algorithm A is available for use. */ +#define gcry_cipher_test_algo(a) \ + gcry_cipher_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) + +/* Get a list consisting of the IDs of the loaded cipher modules. If + LIST is zero, write the number of loaded cipher modules to + LIST_LENGTH and return. If LIST is non-zero, the first + *LIST_LENGTH algorithm IDs are stored in LIST, which must be of + according size. In case there are less cipher modules than + *LIST_LENGTH, *LIST_LENGTH is updated to the correct number. */ +gcry_error_t gcry_cipher_list (int *list, int *list_length); + + +/************************************ + * * + * asymmetric cipher functions * + * * + ************************************/ + +/* The algorithms and their IDs we support. */ +enum gcry_pk_algos + { + GCRY_PK_RSA = 1, + GCRY_PK_RSA_E = 2, /* deprecated */ + GCRY_PK_RSA_S = 3, /* deprecated */ + GCRY_PK_ELG_E = 16, /* use only for OpenPGP */ + GCRY_PK_DSA = 17, + GCRY_PK_ELG = 20 + }; + +/* Flags describing usage capabilities of a PK algorithm. */ +#define GCRY_PK_USAGE_SIGN 1 /* Good for signatures. */ +#define GCRY_PK_USAGE_ENCR 2 /* Good for encryption. */ +#define GCRY_PK_USAGE_CERT 4 /* Good to certify other keys. */ +#define GCRY_PK_USAGE_AUTH 8 /* Good for authentication. */ +#define GCRY_PK_USAGE_UNKN 128 /* Unknown usage flag. */ + +/* Encrypt the DATA using the public key PKEY and store the result as + a newly created S-expression at RESULT. */ +gcry_error_t gcry_pk_encrypt (gcry_sexp_t *result, + gcry_sexp_t data, gcry_sexp_t pkey); + +/* Decrypt the DATA using the private key SKEY and store the result as + a newly created S-expression at RESULT. */ +gcry_error_t gcry_pk_decrypt (gcry_sexp_t *result, + gcry_sexp_t data, gcry_sexp_t skey); + +/* Sign the DATA using the private key SKEY and store the result as + a newly created S-expression at RESULT. */ +gcry_error_t gcry_pk_sign (gcry_sexp_t *result, + gcry_sexp_t data, gcry_sexp_t skey); + +/* Check the signature SIGVAL on DATA using the public key PKEY. */ +gcry_error_t gcry_pk_verify (gcry_sexp_t sigval, + gcry_sexp_t data, gcry_sexp_t pkey); + +/* Check that private KEY is sane. */ +gcry_error_t gcry_pk_testkey (gcry_sexp_t key); + +/* Generate a new key pair according to the parameters given in + S_PARMS. The new key pair is returned in as an S-expression in + R_KEY. */ +gcry_error_t gcry_pk_genkey (gcry_sexp_t *r_key, gcry_sexp_t s_parms); + +/* Catch all function for miscellaneous operations. */ +gcry_error_t gcry_pk_ctl (int cmd, void *buffer, size_t buflen); + +/* Retrieve information about the public key algorithm ALGO. */ +gcry_error_t gcry_pk_algo_info (int algo, int what, + void *buffer, size_t *nbytes); + +/* Map the public key algorithm id ALGO to a string representation of the + algorithm name. For unknown algorithms this functions returns an + empty string. */ +const char *gcry_pk_algo_name (int algo) _GCRY_GCC_ATTR_PURE; + +/* Map the algorithm NAME to a public key algorithm Id. Return 0 if + the algorithm name is not known. */ +int gcry_pk_map_name (const char* name) _GCRY_GCC_ATTR_PURE; + +/* Return what is commonly referred as the key length for the given + public or private KEY. */ +unsigned int gcry_pk_get_nbits (gcry_sexp_t key) _GCRY_GCC_ATTR_PURE; + +/* Please note that keygrip is still experimental and should not be + used without contacting the author. */ +unsigned char *gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array); + +/* Return 0 if the public key algorithm A is available for use. */ +#define gcry_pk_test_algo(a) \ + gcry_pk_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) + +/* Get a list consisting of the IDs of the loaded pubkey modules. If + LIST is zero, write the number of loaded pubkey modules to + LIST_LENGTH and return. If LIST is non-zero, the first + *LIST_LENGTH algorithm IDs are stored in LIST, which must be of + according size. In case there are less pubkey modules than + *LIST_LENGTH, *LIST_LENGTH is updated to the correct number. */ +gcry_error_t gcry_pk_list (int *list, int *list_length); + +/* Alternative interface for asymetric cryptography. */ + +/* The algorithm IDs. */ +typedef enum gcry_ac_id + { + GCRY_AC_RSA = 1, + GCRY_AC_DSA = 17, + GCRY_AC_ELG = 20, + GCRY_AC_ELG_E = 16 + } +gcry_ac_id_t; + +/* Key types. */ +typedef enum gcry_ac_key_type + { + GCRY_AC_KEY_SECRET, + GCRY_AC_KEY_PUBLIC + } +gcry_ac_key_type_t; + +/* AC data. */ +#define GCRY_AC_FLAG_DEALLOC (1 << 0) +#define GCRY_AC_FLAG_COPY (1 << 1) +#define GCRY_AC_FLAG_NO_BLINDING (1 << 2) + +/* This type represents a `data set'. */ +typedef struct gcry_ac_data *gcry_ac_data_t; + +/* This type represents a single `key', either a secret one or a + public one. */ +typedef struct gcry_ac_key *gcry_ac_key_t; + +/* This type represents a `key pair' containing a secret and a public + key. */ +typedef struct gcry_ac_key_pair *gcry_ac_key_pair_t; + +/* This type represents a `handle' that is needed by functions + performing cryptographic operations. */ +typedef struct gcry_ac_handle *gcry_ac_handle_t; + +/* The caller of gcry_ac_key_pair_generate can provide one of these + structures in order to influence the key generation process in an + algorithm-specific way. */ +typedef struct gcry_ac_key_spec_rsa +{ + gcry_mpi_t e; /* E to use. */ +} gcry_ac_key_spec_rsa_t; + +/* Returns a new, empty data set in DATA. */ +gcry_error_t gcry_ac_data_new (gcry_ac_data_t *data); + +/* Destroy the data set DATA. */ +void gcry_ac_data_destroy (gcry_ac_data_t data); + +/* Create a copy of the data set DATA and store it in DATA_CP. */ +gcry_error_t gcry_ac_data_copy (gcry_ac_data_t *data_cp, + gcry_ac_data_t data); + +/* Return the number of named MPI values inside of the data set + DATA. */ +unsigned int gcry_ac_data_length (gcry_ac_data_t data); + +/* Destroy any values contained in the data set DATA. */ +void gcry_ac_data_clear (gcry_ac_data_t data); + +/* Add the value MPI to DATA with the label NAME. If FLAGS contains + GCRY_AC_FLAG_DATA_COPY, the data set will contain copies of NAME + and MPI. If FLAGS contains GCRY_AC_FLAG_DATA_DEALLOC or + GCRY_AC_FLAG_DATA_COPY, the values contained in the data set will + be deallocated when they are to be removed from the data set. */ +gcry_error_t gcry_ac_data_set (gcry_ac_data_t data, unsigned int flags, + const char *name, gcry_mpi_t mpi); + +/* Store the value labelled with NAME found in DATA in MPI. If FLAGS + contains GCRY_AC_FLAG_COPY, store a copy of the MPI value contained + in the data set. MPI may be NULL. */ +gcry_error_t gcry_ac_data_get_name (gcry_ac_data_t data, unsigned int flags, + const char *name, gcry_mpi_t *mpi); + +/* Stores in NAME and MPI the named MPI value contained in the data + set DATA with the index IDX. If FLAGS contains GCRY_AC_FLAG_COPY, + store copies of the values contained in the data set. NAME or MPI + may be NULL. */ +gcry_error_t gcry_ac_data_get_index (gcry_ac_data_t data, unsigned int flags, + unsigned int idx, + const char **name, gcry_mpi_t *mpi); + +/* Create a new ac handle. */ +gcry_error_t gcry_ac_open (gcry_ac_handle_t *handle, + gcry_ac_id_t algorithm, unsigned int flags); + +/* Destroy an ac handle. */ +void gcry_ac_close (gcry_ac_handle_t handle); + +/* Initialize a key from a given data set. */ +gcry_error_t gcry_ac_key_init (gcry_ac_key_t *key, gcry_ac_handle_t handle, + gcry_ac_key_type_t type, gcry_ac_data_t data); + +/* Generates a new key pair via the handle HANDLE of NBITS bits and + stores it in KEY_PAIR. In case non-standard settings are wanted, a + pointer to a structure of type gcry_ac_key_spec__t, + matching the selected algorithm, can be given as KEY_SPEC. + MISC_DATA is not used yet. */ +gcry_error_t gcry_ac_key_pair_generate (gcry_ac_handle_t handle, + unsigned int nbits, void *spec, + gcry_ac_key_pair_t *key_pair, + gcry_mpi_t **misc_data); + +/* Returns the key of type WHICH out of the key pair KEY_PAIR. */ +gcry_ac_key_t gcry_ac_key_pair_extract (gcry_ac_key_pair_t key_pair, + gcry_ac_key_type_t which); + +/* Returns the data set contained in the key KEY. */ +gcry_ac_data_t gcry_ac_key_data_get (gcry_ac_key_t key); + +/* Verifies that the key KEY is sane via HANDLE. */ +gcry_error_t gcry_ac_key_test (gcry_ac_handle_t handle, gcry_ac_key_t key); + +/* Stores the number of bits of the key KEY in NBITS via HANDLE. */ +gcry_error_t gcry_ac_key_get_nbits (gcry_ac_handle_t handle, + gcry_ac_key_t key, unsigned int *nbits); + +/* Writes the 20 byte long key grip of the key KEY to KEY_GRIP via + HANDLE. */ +gcry_error_t gcry_ac_key_get_grip (gcry_ac_handle_t handle, gcry_ac_key_t key, + unsigned char *key_grip); + +/* Destroy a key. */ +void gcry_ac_key_destroy (gcry_ac_key_t key); + +/* Destroy a key pair. */ +void gcry_ac_key_pair_destroy (gcry_ac_key_pair_t key_pair); + +/* Encrypt the plain text MPI value DATA_PLAIN with the key KEY under + the control of the flags FLAGS and store the resulting data set + into DATA_ENCRYPTED. */ +gcry_error_t gcry_ac_data_encrypt (gcry_ac_handle_t handle, + unsigned int flags, + gcry_ac_key_t key, + gcry_mpi_t data_plain, + gcry_ac_data_t *data_encrypted); + +/* Decrypt the decrypted data contained in the data set DATA_ENCRYPTED + with the key KEY under the control of the flags FLAGS and store the + resulting plain text MPI value in DATA_PLAIN. */ +gcry_error_t gcry_ac_data_decrypt (gcry_ac_handle_t handle, + unsigned int flags, + gcry_ac_key_t key, + gcry_mpi_t *data_plain, + gcry_ac_data_t data_encrypted); + +/* Sign the data contained in DATA with the key KEY and store the + resulting signature in the data set DATA_SIGNATURE. */ +gcry_error_t gcry_ac_data_sign (gcry_ac_handle_t handle, + gcry_ac_key_t key, + gcry_mpi_t data, + gcry_ac_data_t *data_signature); + +/* Verify that the signature contained in the data set DATA_SIGNATURE + is indeed the result of signing the data contained in DATA with the + secret key belonging to the public key KEY. */ +gcry_error_t gcry_ac_data_verify (gcry_ac_handle_t handle, + gcry_ac_key_t key, + gcry_mpi_t data, + gcry_ac_data_t data_signature); + +/* Store the textual representation of the algorithm whose id is given + in ALGORITHM in NAME. */ +gcry_error_t gcry_ac_id_to_name (gcry_ac_id_t algorithm, + const char **name); + +/* Store the numeric ID of the algorithm whose textual representation + is contained in NAME in ALGORITHM. */ +gcry_error_t gcry_ac_name_to_id (const char *name, + gcry_ac_id_t *algorithm); + + + +/************************************ + * * + * cryptograhic hash functions * + * * + ************************************/ + +/* Algorithm IDs for the hash functions we know about. Not all of them + are implemnted. */ +enum gcry_md_algos + { + GCRY_MD_NONE = 0, + GCRY_MD_MD5 = 1, + GCRY_MD_SHA1 = 2, + GCRY_MD_RMD160 = 3, + GCRY_MD_MD2 = 5, + GCRY_MD_TIGER = 6, /* TIGER/192. */ + GCRY_MD_HAVAL = 7, /* HAVAL, 5 pass, 160 bit. */ + GCRY_MD_SHA256 = 8, + GCRY_MD_SHA384 = 9, + GCRY_MD_SHA512 = 10, + GCRY_MD_MD4 = 301, + GCRY_MD_CRC32 = 302, + GCRY_MD_CRC32_RFC1510 = 303, + GCRY_MD_CRC24_RFC2440 = 304 + }; + +/* Flags used with the open function. */ +enum gcry_md_flags + { + GCRY_MD_FLAG_SECURE = 1, /* Allocate all buffers in "secure" + memory. */ + GCRY_MD_FLAG_HMAC = 2 /* Make an HMAC out of this + algorithm. */ + }; + +/* Forward declaration. */ +struct gcry_md_context; + +/* This object is used to hold a handle to a message digest object. + This structure is private - only to be used by the public gcry_md_* + macros. */ +typedef struct gcry_md_handle +{ + /* Actual context. */ + struct gcry_md_context *ctx; + + /* Buffer management. */ + int bufpos; + int bufsize; + unsigned char buf[1]; +} *gcry_md_hd_t; + +/* Compatibility types, do not use them. */ +typedef struct gcry_md_handle *GCRY_MD_HD _GCRY_GCC_ATTR_DEPRECATED; +typedef struct gcry_md_handle *GcryMDHd _GCRY_GCC_ATTR_DEPRECATED; + +/* Create a message digest object for algorithm ALGO. FLAGS may be + given as an bitwise OR of the gcry_md_flags values. ALGO may be + given as 0 if the algorithms to be used are later set using + gcry_md_enable. */ +gcry_error_t gcry_md_open (gcry_md_hd_t *h, int algo, unsigned int flags); + +/* Release the message digest object HD. */ +void gcry_md_close (gcry_md_hd_t hd); + +/* Add the message digest algorithm ALGO to the digest object HD. */ +gcry_error_t gcry_md_enable (gcry_md_hd_t hd, int algo); + +/* Create a new digest object as an exact copy of the object HD. */ +gcry_error_t gcry_md_copy (gcry_md_hd_t *bhd, gcry_md_hd_t ahd); + +/* Reset the digest object HD to its initial state. */ +void gcry_md_reset (gcry_md_hd_t hd); + +/* Perform various operations on the digets object HD. */ +gcry_error_t gcry_md_ctl (gcry_md_hd_t hd, int cmd, + void *buffer, size_t buflen); + +/* Pass LENGTH bytes of data in BUFFER to the digest object HD so that + it can update the digest values. This is the actual hash + function. */ +void gcry_md_write (gcry_md_hd_t hd, const void *buffer, size_t length); + +/* Read out the final digest from HD return the digest value for + algorithm ALGO. */ +unsigned char *gcry_md_read (gcry_md_hd_t hd, int algo); + +/* Convenience function to calculate the hash from the data in BUFFER + of size LENGTH using the algorithm ALGO avoiding the creating of a + hash object. The hash is returned in the caller provided buffer + DIGEST which must be large enough to hold the digest of the given + algorithm. */ +void gcry_md_hash_buffer (int algo, void *digest, + const void *buffer, size_t length); + +/* Retrieve the algorithm used with HD. This does not work reliable + if more than one algorithm is enabled in HD. */ +int gcry_md_get_algo (gcry_md_hd_t hd); + +/* Retrieve the length in bytes of the digest yielded by algorithm + ALGO. */ +unsigned int gcry_md_get_algo_dlen (int algo); + +/* Return true if the the algorithm ALGO is enabled in the digest + object A. */ +int gcry_md_is_enabled (gcry_md_hd_t a, int algo); + +/* Return true if the digest object A is allocated in "secure" memory. */ +int gcry_md_is_secure (gcry_md_hd_t a); + +/* Retrieve various information about the object H. */ +gcry_error_t gcry_md_info (gcry_md_hd_t h, int what, void *buffer, + size_t *nbytes); + +/* Retrieve various information about the algorithm ALGO. */ +gcry_error_t gcry_md_algo_info (int algo, int what, void *buffer, + size_t *nbytes); + +/* Map the digest algorithm id ALGO to a string representation of the + algorithm name. For unknown algorithms this functions returns an + empty string. */ +const char *gcry_md_algo_name (int algo) _GCRY_GCC_ATTR_PURE; + +/* Map the algorithm NAME to a digest algorithm Id. Return 0 if + the algorithm name is not known. */ +int gcry_md_map_name (const char* name) _GCRY_GCC_ATTR_PURE; + +/* For use with the HMAC feature, the set MAC key to the KEY of + KEYLEN. */ +gcry_error_t gcry_md_setkey (gcry_md_hd_t hd, const void *key, size_t keylen); + +/* Update the hash(s) of H with the character C. This is a buffered + version of the gcry_md_write function. */ +#define gcry_md_putc(h,c) \ + do { \ + gcry_md_hd_t h__ = (h); \ + if( (h__)->bufpos == (h__)->bufsize ) \ + gcry_md_write( (h__), NULL, 0 ); \ + (h__)->buf[(h__)->bufpos++] = (c) & 0xff; \ + } while(0) + +/* Finalize the digest calculation. This is not really needed because + gcry_md_read() does this implicitly. */ +#define gcry_md_final(a) \ + gcry_md_ctl ((a), GCRYCTL_FINALIZE, NULL, 0) + +/* Return 0 if the algorithm A is available for use. */ +#define gcry_md_test_algo(a) \ + gcry_md_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) + +/* Return an DER encoded ASN.1 OID for the algorithm A in buffer B. N + must point to size_t variable with the available size of buffer B. + After return it will receive the actual size of the returned + OID. */ +#define gcry_md_get_asnoid(a,b,n) \ + gcry_md_algo_info((a), GCRYCTL_GET_ASNOID, (b), (n)) + +/* Enable debugging for digets object A; i.e. create files named + dbgmd-. while hashing. B is a string used as the suffix + for the filename. */ +#define gcry_md_start_debug(a,b) \ + gcry_md_ctl( (a), GCRYCTL_START_DUMP, (b), 0 ) + +/* Disable the debugging of A. */ +#define gcry_md_stop_debug(a,b) \ + gcry_md_ctl( (a), GCRYCTL_STOP_DUMP, (b), 0 ) + +/* Get a list consisting of the IDs of the loaded message digest + modules. If LIST is zero, write the number of loaded message + digest modules to LIST_LENGTH and return. If LIST is non-zero, the + first *LIST_LENGTH algorithm IDs are stored in LIST, which must be + of according size. In case there are less message digest modules + than *LIST_LENGTH, *LIST_LENGTH is updated to the correct + number. */ +gcry_error_t gcry_md_list (int *list, int *list_length); + + +/************************************ + * * + * random generating functions * + * * + ************************************/ + +/* The possible values for the random quality. The rule of thumb is + to use STRONG for session keys and VERY_STRONG for key material. + WEAK is currently an alias for STRONG and should not be used + anymore - use gcry_create_nonce instead. */ +typedef enum gcry_random_level + { + GCRY_WEAK_RANDOM = 0, + GCRY_STRONG_RANDOM = 1, + GCRY_VERY_STRONG_RANDOM = 2 + } +gcry_random_level_t; + +/* Fill BUFFER with LENGTH bytes of random, using random numbers of + quality LEVEL. */ +void gcry_randomize (void *buffer, size_t length, + enum gcry_random_level level); + +/* Add the external random from BUFFER with LENGTH bytes into the + pool. QUALITY should either be -1 for unknown or in the range of 0 + to 100 */ +gcry_error_t gcry_random_add_bytes (const void *buffer, size_t length, + int quality); + +/* If random numbers are used in an application, this macro should be + called from time to time so that new stuff gets added to the + internal pool of the RNG. */ +#define gcry_fast_random_poll() gcry_control (GCRYCTL_FAST_POLL, NULL) + + +/* Return NBYTES of allocated random using a random numbers of quality + LEVEL. */ +void *gcry_random_bytes (size_t nbytes, enum gcry_random_level level) + _GCRY_GCC_ATTR_MALLOC; + +/* Return NBYTES of allocated random using a random numbers of quality + LEVEL. The random numbers are created returned in "secure" + memory. */ +void *gcry_random_bytes_secure (size_t nbytes, enum gcry_random_level level) + _GCRY_GCC_ATTR_MALLOC; + + +/* Set the big integer W to a random value of NBITS using a random + generator with quality LEVEL. */ +void gcry_mpi_randomize (gcry_mpi_t w, + unsigned int nbits, enum gcry_random_level level); + + +/* Create an unpredicable nonce of LENGTH bytes in BUFFER. */ +void gcry_create_nonce (void *buffer, size_t length); + + + +/* Prime interface. */ + +/* Mode values passed to a gcry_prime_check_func_t. */ +#define GCRY_PRIME_CHECK_AT_FINISH 0 +#define GCRY_PRIME_CHECK_AT_GOT_PRIME 1 +#define GCRY_PRIME_CHECK_AT_MAYBE_PRIME 2 + +/* The function should return 1 if the operation shall continue, 0 to + reject the prime candidate. */ +typedef int (*gcry_prime_check_func_t) (void *arg, int mode, + gcry_mpi_t candidate); + +/* Flags for gcry_prime_generate(): */ + +/* Allocate prime numbers and factors in secure memory. */ +#define GCRY_PRIME_FLAG_SECRET (1 << 0) + +/* Make sure that at least one prime factor is of size + `FACTOR_BITS'. */ +#define GCRY_PRIME_FLAG_SPECIAL_FACTOR (1 << 1) + +/* Generate a new prime number of PRIME_BITS bits and store it in + PRIME. If FACTOR_BITS is non-zero, one of the prime factors of + (prime - 1) / 2 must be FACTOR_BITS bits long. If FACTORS is + non-zero, allocate a new, NULL-terminated array holding the prime + factors and store it in FACTORS. FLAGS might be used to influence + the prime number generation process. */ +gcry_error_t gcry_prime_generate (gcry_mpi_t *prime, + unsigned int prime_bits, + unsigned int factor_bits, + gcry_mpi_t **factors, + gcry_prime_check_func_t cb_func, + void *cb_arg, + gcry_random_level_t random_level, + unsigned int flags); + +/* Find a generator for PRIME where the factorization of (prime-1) is + in the NULL terminated array FACTORS. Return the generator as a + newly allocated MPI in R_G. If START_G is not NULL, use this as + teh start for the search. */ +gcry_error_t gcry_prime_group_generator (gcry_mpi_t *r_g, + gcry_mpi_t prime, gcry_mpi_t *factors, + gcry_mpi_t start_g); + + +/* Convenience function to release the FACTORS array. */ +void gcry_prime_release_factors (gcry_mpi_t *factors); + + +/* Check wether the number X is prime. */ +gcry_error_t gcry_prime_check (gcry_mpi_t x, unsigned int flags); + + + +/************************************ + * * + * miscellaneous stuff * + * * + ************************************/ + +/* Log levels used by the internal logging facility. */ +enum gcry_log_levels + { + GCRY_LOG_CONT = 0, /* continue the last log line */ + GCRY_LOG_INFO = 10, + GCRY_LOG_WARN = 20, + GCRY_LOG_ERROR = 30, + GCRY_LOG_FATAL = 40, + GCRY_LOG_BUG = 50, + GCRY_LOG_DEBUG = 100 + }; + +/* Type for progress handlers. */ +typedef void (*gcry_handler_progress_t) (void *, const char *, int, int, int); + +/* Type for memory allocation handlers. */ +typedef void *(*gcry_handler_alloc_t) (size_t n); + +/* Type for secure memory check handlers. */ +typedef int (*gcry_handler_secure_check_t) (const void *); + +/* Type for memory reallocation handlers. */ +typedef void *(*gcry_handler_realloc_t) (void *p, size_t n); + +/* Type for memory free handlers. */ +typedef void (*gcry_handler_free_t) (void *); + +/* Type for out-of-memory handlers. */ +typedef int (*gcry_handler_no_mem_t) (void *, size_t, unsigned int); + +/* Type for fatal error handlers. */ +typedef void (*gcry_handler_error_t) (void *, int, const char *); + +/* Type for logging handlers. */ +typedef void (*gcry_handler_log_t) (void *, int, const char *, va_list); + +/* Certain operations can provide progress information. This function + is used to register a handler for retrieving these information. */ +void gcry_set_progress_handler (gcry_handler_progress_t cb, void *cb_data); + + +/* Register a custom memory allocation functions. */ +void gcry_set_allocation_handler ( + gcry_handler_alloc_t func_alloc, + gcry_handler_alloc_t func_alloc_secure, + gcry_handler_secure_check_t func_secure_check, + gcry_handler_realloc_t func_realloc, + gcry_handler_free_t func_free); + +/* Register a function used instead of the internal out of memory + handler. */ +void gcry_set_outofcore_handler (gcry_handler_no_mem_t h, void *opaque); + +/* Register a function used instead of the internal fatal error + handler. */ +void gcry_set_fatalerror_handler (gcry_handler_error_t fnc, void *opaque); + +/* Register a function used instead of the internal logging + facility. */ +void gcry_set_log_handler (gcry_handler_log_t f, void *opaque); + +/* Reserved for future use. */ +void gcry_set_gettext_handler (const char *(*f)(const char*)); + +/* Libgcrypt uses its own memory allocation. It is important to use + gcry_free () to release memory allocated by libgcrypt. */ +void *gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *gcry_calloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *gcry_malloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *gcry_calloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *gcry_realloc (void *a, size_t n); +char *gcry_strdup (const char *string) _GCRY_GCC_ATTR_MALLOC; +void *gcry_xmalloc (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *gcry_xcalloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *gcry_xmalloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *gcry_xcalloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *gcry_xrealloc (void *a, size_t n); +char *gcry_xstrdup (const char * a) _GCRY_GCC_ATTR_MALLOC; +void gcry_free (void *a); + +/* Return true if A is allocated in "secure" memory. */ +int gcry_is_secure (const void *a) _GCRY_GCC_ATTR_PURE; + +/* Include support for Libgcrypt modules. */ +#include + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif +#endif /* _GCRYPT_H */ From cvs at cvs.gnupg.org Thu Nov 30 21:45:34 2006 From: cvs at cvs.gnupg.org (svn author marcus) Date: Thu Nov 30 21:09:52 2006 Subject: [svn] gpgme - r1191 - trunk/gpgme Message-ID: Author: marcus Date: 2006-11-30 21:45:33 +0100 (Thu, 30 Nov 2006) New Revision: 1191 Modified: trunk/gpgme/ChangeLog trunk/gpgme/engine-gpgsm.c Log: 2006-11-30 Marcus Brinkmann * engine-gpgsm.c: Replace AssuanError with gpg_error_t and ASSUAN_CONTEXT with assuan_context_t. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2006-11-29 19:21:18 UTC (rev 1190) +++ trunk/gpgme/ChangeLog 2006-11-30 20:45:33 UTC (rev 1191) @@ -1,3 +1,8 @@ +2006-11-30 Marcus Brinkmann + + * engine-gpgsm.c: Replace AssuanError with gpg_error_t and + ASSUAN_CONTEXT with assuan_context_t. + 2006-11-29 Marcus Brinkmann * engine-gpgsm.c (gpgsm_new): Check return value of Modified: trunk/gpgme/engine-gpgsm.c =================================================================== --- trunk/gpgme/engine-gpgsm.c 2006-11-29 19:21:18 UTC (rev 1190) +++ trunk/gpgme/engine-gpgsm.c 2006-11-30 20:45:33 UTC (rev 1191) @@ -59,7 +59,7 @@ struct engine_gpgsm { - ASSUAN_CONTEXT assuan_ctx; + assuan_context_t assuan_ctx; iocb_data_t status_cb; @@ -147,7 +147,7 @@ static gpgme_error_t -map_assuan_error (AssuanError err) +map_assuan_error (gpg_error_t err) { if (!err) return 0; @@ -573,11 +573,11 @@ static gpgme_status_code_t parse_status (const char *name); static gpgme_error_t -gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, +gpgsm_assuan_simple_command (assuan_context_t ctx, char *cmd, engine_status_handler_t status_fnc, void *status_fnc_value) { - AssuanError err; + gpg_error_t err; char *line; size_t linelen; @@ -632,7 +632,7 @@ #define COMMANDLINELEN 40 static gpgme_error_t -gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt) +gpgsm_set_fd (assuan_context_t ctx, const char *which, int fd, const char *opt) { char line[COMMANDLINELEN]; @@ -689,7 +689,7 @@ static gpgme_error_t status_handler (void *opaque, int fd) { - AssuanError assuan_err; + gpg_error_t assuan_err; gpgme_error_t err = 0; engine_gpgsm_t gpgsm = opaque; char *line; @@ -980,7 +980,7 @@ set_recipients (engine_gpgsm_t gpgsm, gpgme_key_t recp[]) { gpgme_error_t err = 0; - ASSUAN_CONTEXT ctx = gpgsm->assuan_ctx; + assuan_context_t ctx = gpgsm->assuan_ctx; char *line; int linelen; int invalid_recipients = 0;