From 995a02825947cf6f11b67998d850c748d320c8cd Mon Sep 17 00:00:00 2001 From: JinWang An Date: Wed, 1 Dec 2021 16:54:34 +0900 Subject: Imported Upstream version 1.5.0 --- ChangeLog | 226 +++++++- Makefile.am | 4 +- Makefile.in | 16 +- NEWS | 53 +- README | 19 +- VERSION | 2 +- aclocal.m4 | 57 ++ autogen.rc | 20 + autogen.sh | 266 +++++++--- config.h.in | 37 +- configure | 1238 +++++++++----------------------------------- configure.ac | 534 ++----------------- doc/Makefile.in | 12 +- doc/gpgme.info | 230 ++++---- doc/gpgme.info-1 | 249 +++++++-- doc/gpgme.info-2 | 60 ++- doc/gpgme.texi | 226 ++++++-- doc/stamp-vti | 8 +- doc/version.texi | 8 +- gpgme.spec | 2 +- lang/Makefile.in | 12 +- lang/cl/Makefile.in | 12 +- lang/cl/gpgme.asd | 2 +- src/Makefile.am | 31 +- src/Makefile.in | 251 ++++----- src/assuan-support.c | 3 +- src/conversion.c | 21 + src/decrypt.c | 6 +- src/dirinfo.c | 107 +++- src/engine-assuan.c | 3 +- src/engine-backend.h | 29 +- src/engine-g13.c | 19 +- src/engine-gpg.c | 49 +- src/engine-gpgconf.c | 11 +- src/engine-gpgsm.c | 24 +- src/engine-spawn.c | 475 +++++++++++++++++ src/engine-uiserver.c | 5 +- src/engine.c | 82 +-- src/engine.h | 7 + src/gpgconf.c | 33 +- src/gpgme-tool.c | 70 ++- src/gpgme.c | 41 +- src/gpgme.def | 4 + src/gpgme.h.in | 62 ++- src/key.c | 2 + src/keylist.c | 26 +- src/libgpgme.vers | 5 + src/posix-io.c | 53 +- src/posix-util.c | 113 +++- src/priv-io.h | 6 +- src/sign.c | 7 +- src/spawn.c | 106 ++++ src/status-table.c | 25 +- src/sys-util.h | 9 +- src/util.h | 19 +- src/verify.c | 14 +- src/version.c | 3 +- src/w32-glib-io.c | 3 +- src/w32-io.c | 3 +- src/w32-qt-io.cpp | 47 +- src/w32-util.c | 154 ++++-- tests/Makefile.in | 74 +-- tests/gpg/Makefile.am | 4 +- tests/gpg/Makefile.in | 105 ++-- tests/gpg/t-keylist-sig.c | 21 +- tests/gpgsm/Makefile.am | 16 +- tests/gpgsm/Makefile.in | 93 ++-- tests/gpgsm/t-verify.c | 4 +- tests/opassuan/Makefile.in | 60 ++- tests/t-engine-info.c | 112 ++-- 70 files changed, 3143 insertions(+), 2567 deletions(-) create mode 100644 autogen.rc create mode 100644 src/engine-spawn.c create mode 100644 src/spawn.c diff --git a/ChangeLog b/ChangeLog index 41ae08d..0cff5d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,55 @@ -2014-07-30 Werner Koch +2014-05-21 Werner Koch - Release 1.4.4. - * configure.ac: Change LT version to C22/A11/R1. + Release 1.5.0. + * configure.ac: Change LT version to C22/A11/R0. + +2014-05-13 Werner Koch + + Add 6 new GPGME_STATUS_ codes. + * src/status-table.c: Also add missing DECRYPTION_INFO entry. + +2014-05-08 Werner Koch + + Add field CURVE to the key info. + * src/gpgme.h.in (struct _gpgme_subkey): Add field CURVE. + * src/key.c (gpgme_key_unref): Free CURVE. + * src/keylist.c (keylist_colon_handler): Set CURVE. + + * src/gpgme.c (gpgme_release): For failsafe reasons reset engine and + engine info after freeing. + + Fix a memory access and a double slash bug. + * src/engine-spawn.c (engspawn_start): Allocate space for list + terminator. + * src/posix-util.c (walk_path): Fix trailing slash detection. + + Map public key algos returned by gpg to gpgme values. + * src/conversion.c (_gpgme_map_pk_algo): New. + * src/decrypt.c (parse_enc_to): Add arg PROTOCOL and map pubkey algo. + (_gpgme_decrypt_status_handler): Map pubkey algo. + * src/keylist.c (keylist_colon_handler): Map pubkey algo. + * src/sign.c (parse_sig_created): Add arg PROTOCOL and map pubkey + algo. + * src/verify.c (parse_new_sig): Ditto. + (parse_valid_sig): Ditto. + + * src/gpgme.h.in (GPGME_PK_ECC): New. + (GPGME_MD_SHA224): New. + * src/gpgme.c (gpgme_pubkey_algo_name): Add GPGME_PK_ECC case. + (gpgme_hash_algo_name): Add GPGME_MD_SHA224. + + Add GPGME_ENCRYPT_NO_COMPRESS flag. + * src/gpgme.h.in (GPGME_ENCRYPT_NO_COMPRESS): New. + * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign): Implement it. + * src/gpgme-tool.c (_cmd_sign_encrypt): Add option --no-compress. - Fix possible realloc overflow for gpgsm and uiserver engines. - * src/engine-gpgsm.c (status_handler): - * src/engine-uiserver.c (status_handler): +2014-04-16 Werner Koch w32: Fix another memleak on error. * src/w32-io.c (create_reader): free CTX. +2014-04-15 Werner Koch + w32: Fix memleak in an error code paths. * src/w32-io.c (create_writer): Free CTX in cased of bad FD. * src/w32-util.c (_gpgme_mkstemp): Free TMPNAME in case of a failed @@ -20,6 +60,61 @@ (_gpgme_io_dup): Likewise. (_gpgme_io_connect): Likewise. +2014-04-10 Werner Koch + + Actually implement flags for gpgme_op_spawn. + * src/spawn.c (gpgme_op_spawn_start, gpgme_op_spawn): Pass FLAGS dow + to spawn_start and add FLAGS args along the call path. + * src/engine-spawn.c (engspawn_start): Hack to automagically provide + argv[0]. + + Add GPGME_PROTOCOL_SPAWN and gpgme_op_spawn. + * src/gpgme.h.in (GPGME_PROTOCOL_SPAWN): New. + (GPGME_SPAWN_DETACHED, GPGME_SPAWN_ALLOW_SET_FG): New. + * src/gpgme.c (gpgme_set_protocol): Add new protocol. + (gpgme_get_protocol_name): Ditto. + * src/spawn.c: New. + * src/libgpgme.vers, src/gpgme.def: Add new public functions. + * src/engine-spawn.c: New. + * src/Makefile.am: Add new files. + * src/engine-backend.h (struct engine_ops): Add OPSPAWN. + * src/engine.c (engine_ops): Add _gpgme_engine_ops_spawn. + (gpgme_get_engine_info): Add Spawn to the list of protocols. + (_gpgme_engine_op_spawn): New. + + * src/gpgme-tool.c (gt_protocol_from_name): Add new protocol. + (gt_spawn, cmd_spawn): New. + + Add gpgme_get_dirinfo. + * src/dirinfo.c (gpgme_get_dirinfo): New. + * tests/t-engine-info.c (main): Print results from that function. + + Make use of internal iospawn flags more flexible. + * src/priv-io.h (IOSPAWN_FLAG_DETACHED): New. Renumber the others. + * src/w32-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS process only if + IOSPAWN_FLAG_DETACHED is given. + * src/w32-qt-io.cpp (_gpgme_io_spawn): Ditto. + * src/w32-glib-io.c (_gpgme_io_spawn): Ditto. + * src/assuan-support.c (my_spawn): Pass IOSPAWN_FLAG_DETACHED flags. + * src/dirinfo.c (read_gpgconf_dirs): Ditto. + * src/engine-gpg.c (start): Ditto. + * src/engine-gpgconf.c (gpgconf_read, gpgconf_write): Ditto. + * src/version.c (_gpgme_get_program_version): Ditto. + + Make sure a spawned process has all standard fds connected. + * src/posix-io.c (_gpgme_io_spawn): dup /dev/null also to unsued + stdout. + +2014-03-13 Werner Koch + + Add configure option --enable-fixed-path. + * configure.ac: Add option --enable-fixed-path. + (FIXED_SEARCH_PATH): New ac_define. + * src/posix-util.c (walk_path): Make use of the option. Remove + current directory from fallback PATH. + +2014-03-11 Werner Koch + Avoid pointer arithmetic on void pointer. * src/gpgme.c (gpgme_io_writen): Use new var buffer. @@ -27,13 +122,132 @@ * src/gpgme.c (gpgme_get_sub_protocol): Change return type to gpgme_protocol_t. +2014-03-05 Daiki Ueno + + doc: Fix documentation of struct data types. + * gpgme.texi (Key Management): Document is_cardkey and card_number + members of gpgme_subkey_t. + (Decrypt): Remove description of the non-existent wrong_key_usage + member of gpgme_recipient_t. + (Verify): Document pka_address member of gpgme_signature_t. + (Creating a Signature): Add missing member names in + gpgme_new_signature_t. + (Registering I/O Callbacks): Fix reference of gpgme_io_cbs struct. + +2014-02-21 Werner Koch + + Always pass correct name to argv[0]. Ignore GPG_AGENT_INFO for gpg2. + * src/dirinfo.c (WANT_GPG_ONE_MODE): New. + (struct dirinfo): Add field "gpg_one_mode". + (get_gpgconf_item): Set that field and return it if requested. + (_gpgme_in_gpg_one_mode): New. + * src/engine-gpg.c (build_argv): Check GPG_AGENT_INFO only in gpg-1 + mode. + + * src/dirinfo.c (_gpgme_get_basename): New. + * src/engine-g13.c (g13_new): Take argv[0] from the pgmname. + * src/engine-gpgsm.c (gpgsm_new): Ditto. + * src/engine-gpg.c (build_argv): Ditto. Add arg PGMNAME. + (start): Pass PGMNAME to buildargv. + +2014-02-12 Werner Koch + Fix type inconsistency between gpgme.h and gpgme.c. * src/gpgme.c (gpgme_set_pinentry_mode): Fix type of MODE. +2014-01-10 Werner Koch + + Use the generic autogen.sh script. + * autogen.rc: New. + * Makefile.am (EXTRA_DIST): Add it. + * autogen.sh: Update from GnuPG. + + * configure.ac (AM_SILENT_RULES): New. + +2014-01-07 Werner Koch + + Make gpgconf engine work again - fixes 02ba35c1. + * src/gpgconf.c: Remove ENABLE_GPGCONF and move prototypes to ... + * src/engine-backend.h: ... here. + + Make gpgme_new return a proper error if no engines are installed. + * src/engine.c (gpgme_get_engine_info): Improve error handling. + (_gpgme_engine_info_copy): Ditto. + * src/gpgme.c (gpgme_new): Return error GPG_ERR_NO_ENGINE. + + Print the full PATH in the log if gpg was not found. + * src/posix-util.c (walk_path): Keep a copy of PATH. + +2014-01-06 Werner Koch + + Add global flags disable-gpgconf, gpgconf-name, and gpg-name. + * src/gpgme.c (gpgme_set_global_flag): Add names "disable-gpgconf", + "gpgconf-name", and "gpg-name". + * src/dirinfo.c (_gpgme_dirinfo_disable_gpgconf): New. + (get_gpgconf_item): Minor debug info change. + * src/posix-util.c (default_gpg_name, default_gpgconf_name): Add vars. + (_gpgme_set_default_gpg_name): New. + (_gpgme_set_default_gpgconf_name): New. + (_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Use new vars. + (walk_path): Add debug output on failure. + * src/w32-util.c (default_gpg_name, default_gpgconf_name): Add vars. + (replace_slashes): New. + (get_basename): New. + (_gpgme_set_default_gpg_name): New. + (_gpgme_set_default_gpgconf_name): New. + (_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Use new vars. + + * tests/t-engine-info.c (main): Add --verbose and --set-global-flag + options. + +2013-12-27 Werner Koch + + Locate engine names only at runtime and prefer GnuPG-2. + * configure.ac (NEED_GPG_VERSION, NEED_GPGSM_VERSION) + (NEED_G13_VERSION, NEED_GPGCONF_VERSION): Remove vars and all related + checks. Do not check for any engine version. + (HAVE_ASSUAN): Remove AM conditional. + * src/Makefile.am: Remove separate component vars and always build all + engines but uiserver. + * src/dirinfo.c (WANT_GPGCONF_NAME): New. + (struct dirinfo): Add field gpgconf_name. + (_gpgme_get_default_gpgconf_name): Use WANT_GPGCONF_NAME. + (get_gpgconf_item): Set gpgconf name and adjust for _gpgme_get_*_path + now returning a malloced string. + * src/engine.c (engine_ops): Always init all engines except for + uiserver. + * src/posix-util.c (_gpgme_get_gpgsm_path, _gpgme_get_g13_path): + Remove unused functions. + (walk_path): New. + (_gpgme_get_gpg_path, _gpgme_get_gpgconf_path ): Re-implement using + walk_path. + * src/w32-util.c (_gpgme_get_gpgsm_path, _gpgme_get_g13_path): Remove + unused functions. + (_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Return a malloced + string. + * src/engine-g13.c (g13_get_req_version): Use a hardwired string with + the required version. This info belongs into this file. + * src/engine-gpg.c (gpg_get_req_version): Ditto. + * src/engine-gpgconf.c (gpgconf_get_req_version): Ditto. + * src/engine-gpgsm.c (gpgsm_get_req_version): Ditto. + * tests/t-engine-info.c: Replace now useless test by an info output. + * tests/gpg/Makefile.am (GPG, GPG_AGENT): Hardwire gpg and gpg-agent. + * tests/gpgsm/Makefile.am (GPGSM): Hardwire gpgsm. + +2013-08-19 Werner Koch + + Document API change for GPGME_EVENT_DONE from 2009. + * doc/gpgme.texi (I/O Callback Interface): Fix description for the + event arg. + Fix possible segv in the gpgme_op_card_edit. * src/edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start): Do not deref a NULL KEY in TRACE_BEG. + tests: Fix NULL ptr deref in gpgsm/t-verify. + * tests/gpgsm/t-verify.c (check_result): Do not dereference a sig or + sig->fpr if NULL. + 2013-08-12 Werner Koch Release 1.4.3. diff --git a/Makefile.am b/Makefile.am index 18a8e38..28f9eca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,9 +22,9 @@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 -DISTCHECK_CONFIGURE_FLAGS = --with-gpg="@GPG@" +DISTCHECK_CONFIGURE_FLAGS = -EXTRA_DIST = gpgme.spec.in autogen.sh \ +EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in \ ChangeLog-2011 m4/ChangeLog-2011 contrib/ChangeLog-2011 diff --git a/Makefile.in b/Makefile.in index 4106235..4d860ca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -94,6 +94,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -158,6 +164,7 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -188,7 +195,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -196,17 +202,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -315,8 +317,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 -DISTCHECK_CONFIGURE_FLAGS = --with-gpg="@GPG@" -EXTRA_DIST = gpgme.spec.in autogen.sh \ +DISTCHECK_CONFIGURE_FLAGS = +EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in \ ChangeLog-2011 m4/ChangeLog-2011 contrib/ChangeLog-2011 @RUN_GPG_TESTS_FALSE@tests = diff --git a/NEWS b/NEWS index d1adc24..82d4914 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,43 @@ -Noteworthy changes in version 1.4.4 (2014-07-30) [C22/A11/R1] +Noteworthy changes in version 1.5.0 (2014-05-21) [C23/A12/R0] ------------------------------------------------------------- - Backported from 1.5.1: + * On Unices the engine file names are not not anymore hardwired but + located via the envvar PATH. All options to set the name of the + engines for the configure run are removed. - * Fixed possible overflow in gpgsm and uiserver engines. - [CVE-2014-3564] + * If GPGME finds the gpgconf binary it defaults to using gpg2 or + whatever gpgconf tells as name for the OpenPGP engine. If gpgconf + is not found, GPGME looks for an engine named "gpg". - * Fixed possibled segv in gpgme_op_card_edit. + * New feature to use the gpgme I/O subsystem to run arbitrary + commands. - * Fixed minor memleaks and possible zombie processes. + * New flag to use encryption without the default compression step. - * Fixed prototype inconsistencies and void pointer arithmetic. + * New function to access "gpg-conf --list-dirs" + + * New configure option --enable-fixed-path for use by Android. + + * Support ECC algorithms. + + * Interface changes relative to the 1.4.3 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gpgme_get_dirinfo NEW. + gpgme_op_spawn_start NEW. + gpgme_op_spawn NEW. + GPGME_PROTOCOL_SPAWN NEW. + GPGME_SPAWN_DETACHED NEW. + GPGME_SPAWN_ALLOW_SET_FG NEW. + GPGME_ENCRYPT_NO_COMPRESS NEW. + GPGME_PK_ECC NEW. + GPGME_MD_SHA224 NEW. + gpgme_subkey_t EXTENDED: New field curve. + GPGME_STATUS_PLAINTEXT_LENGTH NEW. + GPGME_STATUS_MOUNTPOINT NEW. + GPGME_STATUS_PINENTRY_LAUNCHED NEW. + GPGME_STATUS_ATTRIBUTE NEW. + GPGME_STATUS_BEGIN_SIGNING NEW. + GPGME_STATUS_KEY_NOT_CREATED NEW. Noteworthy changes in version 1.4.3 (2013-08-12) [C22/A11/R0] @@ -31,8 +58,8 @@ Noteworthy changes in version 1.4.3 (2013-08-12) [C22/A11/R0] gpgme_data_identify NEW. -Noteworthy changes in version 1.4.2 (2013-05-28) ------------------------------------------------- +Noteworthy changes in version 1.4.2 (2013-05-28) [C21/A10/R0] +------------------------------------------------------------- * Allow symmetric encryption with gpgme_op_encrypt_sign. @@ -45,8 +72,8 @@ Noteworthy changes in version 1.4.2 (2013-05-28) GPGME_PROTOCOL_OPENPGP NEW alias. -Noteworthy changes in version 1.4.1 (2013-05-01) ------------------------------------------------- +Noteworthy changes in version 1.4.1 (2013-05-01) [C20/A9/R1] +------------------------------------------------------------ * Fixed reading of gpg.conf files with excessive use of the group option. @@ -56,8 +83,8 @@ Noteworthy changes in version 1.4.1 (2013-05-01) * Disabled FD passing by default for Apple. -Noteworthy changes in version 1.4.0 (2013-02-26) ------------------------------------------------- +Noteworthy changes in version 1.4.0 (2013-02-26) [C20/A9/R0] +------------------------------------------------------------ * New function gpgme_set_global_flag to help debugging on Android. diff --git a/README b/README index e886647..a16a066 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ GPGME - GnuPG Made Easy --------------------------- - Copyright 2004, 2006, 2010, 2012, 2013 g10 Code GmbH + Copyright 2004, 2006, 2010, 2012, 2013, 2014 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 @@ -41,26 +41,15 @@ See the file INSTALL for generic installation instructions. Check that you have unmodified sources. See below on how to do this. Don't skip it - this is an important step! -To build GPGME, you need to install libgpg-error (>= 1.8) and +To build GPGME, you need to install libgpg-error (>= 1.11) and Libassuan (>= 2.0.2). For support of the OpenPGP protocol (default), you should use the latest version of GnuPG (>= 1.4) , available at: -ftp://ftp.gnupg.org/gcrypt/gnupg/ -For support of the CMS (Cryptographic Message Syntax) protocol, you +ftp://ftp.gnupg.org/gcrypt/gnupg/. For support of the CMS +(Cryptographic Message Syntax) protocol and lot of other features, you need a GnuPG version >= 2.0. -If configure can't find the `gpg' binary in your path, you can specify -the location with the --with-gpg=/path/to/gpg argument to configure. - -If configure can't find the `gpgsm' binary in your path, you can -specify the location with the --with-gpgsm=/path/to/gpgsm argument to -configure. - -On some platforms GPGME based applications might hang at certain -operations when using GPGME_PROTOCOL_CMS. A workaround for this -problem is to build with the configure option --disable-fd-passing. - For building the GIT version of GPGME please see the file README.GIT for more information. diff --git a/VERSION b/VERSION index 1c99cf0..bc80560 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.4 +1.5.0 diff --git a/aclocal.m4 b/aclocal.m4 index 362690a..58cabf4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -863,6 +863,63 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff --git a/autogen.rc b/autogen.rc new file mode 100644 index 0000000..d0ade53 --- /dev/null +++ b/autogen.rc @@ -0,0 +1,20 @@ +# autogen.sh configuration for GPGME -*- sh -*- + +case "$myhost" in + w32) + configure_opts=" + --with-gpg-error-prefix=@SYSROOT@ + --with-libassuan-prefix=@SYSROOT@ + " + ;; + + amd64) + configure_opts=" + --with-gpg-error-prefix=@SYSROOT@ + --with-libassuan-prefix=@SYSROOT@ + " + ;; +esac + + +final_info="./configure --enable-maintainer-mode && make" diff --git a/autogen.sh b/autogen.sh index 067870a..471193c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,6 @@ #! /bin/sh -# Run this to generate all the initial makefiles, etc. -# -# Copyright (C) 2003 g10 Code GmbH +# autogen.sh +# Copyright (C) 2003, 2014 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 @@ -10,6 +9,13 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# This is a generic script to create the configure script and handle cross +# build environments. It requires the presence of a autogen.rc file to +# configure it for the respective package. It is maintained as part of +# GnuPG and source copied by other packages. +# +# Version: 2014-01-10 configure_ac="configure.ac" @@ -18,7 +24,7 @@ cvtver () { } check_version () { - if [ `("$1" --version || echo "0") | cvtver` -ge "$2" ]; then + if [ $(( `("$1" --version || echo "0") | cvtver` >= $2 )) = 1 ]; then return 0 fi echo "**Error**: "\`$1\'" not installed or too old." >&2 @@ -28,67 +34,150 @@ check_version () { return 1 } +fatal () { + echo "autogen.sh:" "$*" >&2 + DIE=yes +} + +info () { + if [ -z "${SILENT}" ]; then + echo "autogen.sh:" "$*" + fi +} + +die_p () { + if [ "$DIE" = "yes" ]; then + echo "autogen.sh: Stop." >&2 + exit 1 + fi +} + +replace_sysroot () { + configure_opts=$(echo $configure_opts | sed "s#@SYSROOT@#${w32root}#g") + extraoptions=$(echo $extraoptions | sed "s#@SYSROOT@#${w32root}#g") +} + +# Allow to override the default tool names +AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX} +AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX} + +AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX} +ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX} + +GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX} +MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} DIE=no FORCE= +SILENT= +tmp=$(dirname "$0") +tsdir=$(cd "${tmp}"; pwd) + +if [ -n "${AUTOGEN_SH_SILENT}" ]; then + SILENT=" --silent" +fi +if test x"$1" = x"--help"; then + echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]" + exit 0 +fi +if test x"$1" = x"--silent"; then + SILENT=" --silent" + shift +fi if test x"$1" = x"--force"; then FORCE=" --force" shift fi -# Begin list of optional variables sourced from ~/.gnupg-autogen.rc + +# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces +# as unsafe because it is too easy to get scripts wrong in this regard. +am_lf=' +' +case `pwd` in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe working directory name" ;; +esac +case $tsdir in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe source directory: \`$tsdir'" ;; +esac +case $HOME in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe home directory: \`$HOME'" ;; +esac +die_p + + +# List of variables sourced from autogen.rc. The strings '@SYSROOT@' in +# these variables are replaced by the actual system root. +configure_opts= +extraoptions= +# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc w32_toolprefixes= w32_extraoptions= w32ce_toolprefixes= w32ce_extraoptions= +w64_toolprefixes= +w64_extraoptions= amd64_toolprefixes= # End list of optional variables sourced from ~/.gnupg-autogen.rc # What follows are variables which are sourced but default to # environment variables or lacking them hardcoded values. #w32root= #w32ce_root= +#w64root= #amd64root= -if [ -f "$HOME/.gnupg-autogen.rc" ]; then - echo "sourcing extra definitions from $HOME/.gnupg-autogen.rc" - . "$HOME/.gnupg-autogen.rc" -fi - # Convenience option to use certain configure options for some hosts. myhost="" myhostsub="" case "$1" in --build-w32) myhost="w32" + shift ;; --build-w32ce) myhost="w32" myhostsub="ce" + shift ;; --build-w64) myhost="w32" myhostsub="64" + shift ;; --build-amd64) myhost="amd64" + shift ;; --build*) - echo "**Error**: invalid build option $1" >&2 - exit 1 + fatal "**Error**: invalid build option $1" + shift ;; *) ;; esac +die_p + + +# Source our configuration +if [ -f "${tsdir}/autogen.rc" ]; then + . "${tsdir}/autogen.rc" +fi +# Source optional site specific configuration +if [ -f "$HOME/.gnupg-autogen.rc" ]; then + info "sourcing extra definitions from $HOME/.gnupg-autogen.rc" + . "$HOME/.gnupg-autogen.rc" +fi -# ***** W32 build script ******* -# Used to cross-compile for Windows. +# ****************** +# W32 build script +# ****************** if [ "$myhost" = "w32" ]; then - tmp=`dirname $0` - tsdir=`cd "$tmp"; pwd` - shift - if [ ! -f $tsdir/build-aux/config.guess ]; then - echo "$tsdir/build-aux/config.guess not found" >&2 + if [ ! -f "$tsdir/build-aux/config.guess" ]; then + fatal "$tsdir/build-aux/config.guess not found" exit 1 fi build=`$tsdir/build-aux/config.guess` @@ -97,21 +186,26 @@ if [ "$myhost" = "w32" ]; then ce) w32root="$w32ce_root" [ -z "$w32root" ] && w32root="$HOME/w32ce_root" - toolprefixes="arm-mingw32ce" + toolprefixes="$w32ce_toolprefixes arm-mingw32ce" + extraoptions="$extraoptions $w32ce_extraoptions" ;; 64) w32root="$w64root" [ -z "$w32root" ] && w32root="$HOME/w64root" - toolprefixes="$amd64_toolprefixes amd64-mingw32msvc" + toolprefixes="$w64_toolprefixes x86_64-w64-mingw32" + extraoptions="$extraoptions $w64_extraoptions" ;; *) [ -z "$w32root" ] && w32root="$HOME/w32root" toolprefixes="$w32_toolprefixes i686-w64-mingw32 i586-mingw32msvc" toolprefixes="$toolprefixes i386-mingw32msvc mingw32" + extraoptions="$extraoptions $w32_extraoptions" ;; esac - echo "Using $w32root as standard install directory" >&2 + info "Using $w32root as standard install directory" + replace_sysroot + # Locate the cross compiler crossbindir= for host in $toolprefixes; do if ${host}-gcc --version >/dev/null 2>&1 ; then @@ -121,37 +215,33 @@ if [ "$myhost" = "w32" ]; then fi done if [ -z "$crossbindir" ]; then - echo "Cross compiler kit not installed" >&2 + fatal "cross compiler kit not installed" if [ -z "$myhostsub" ]; then - echo "Under Debian GNU/Linux, you may install it using" >&2 - echo " apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2 + info "Under Debian GNU/Linux, you may install it using" + info " apt-get install mingw32 mingw32-runtime mingw32-binutils" fi - echo "Stop." >&2 - exit 1 + die_p fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then - echo "Pease run a 'make distclean' first" >&2 - exit 1 + fatal "Please run a 'make distclean' first" + die_p fi fi - $tsdir/configure --enable-maintainer-mode --prefix=${w32root} \ - --host=${host} --build=${build} \ - --with-gpg-error-prefix=${w32root} \ - --with-libassuan-prefix=${w32root} "$@" - - exit $? + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=${w32root} \ + --host=${host} --build=${build} \ + ${configure_opts} ${extraoptions} "$@" + rc=$? + exit $rc fi # ***** end W32 build script ******* - # ***** AMD64 cross build script ******* # Used to cross-compile for AMD64 (for testing) if [ "$myhost" = "amd64" ]; then - tmp=`dirname $0` - tsdir=`cd "$tmp"; pwd` shift if [ ! -f $tsdir/build-aux/config.guess ]; then echo "$tsdir/build-aux/config.guess not found" >&2 @@ -160,11 +250,14 @@ if [ "$myhost" = "amd64" ]; then build=`$tsdir/build-aux/config.guess` [ -z "$amd64root" ] && amd64root="$HOME/amd64root" - echo "Using $amd64root as standard install directory" >&2 + info "Using $amd64root as standard install directory" + replace_sysroot + + toolprefixes="$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu" # Locate the cross compiler crossbindir= - for host in x86_64-linux-gnu amd64-linux-gnu; do + for host in $toolprefixes ; do if ${host}-gcc --version >/dev/null 2>&1 ; then crossbindir=/usr/${host}/bin conf_CC="CC=${host}-gcc" @@ -184,15 +277,16 @@ if [ "$myhost" = "amd64" ]; then fi fi - $tsdir/configure --enable-maintainer-mode --prefix=${amd64root} \ - --host=${host} --build=${build} + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=${amd64root} \ + --host=${host} --build=${build} \ + ${configure_opts} ${extraoptions} "$@" 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 @@ -206,29 +300,22 @@ q }' ${configure_ac}` automake_vers_num=`echo "$automake_vers" | cvtver` -#gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ { -#s/^.*(\(.*\))/\1/p -#q -#}' ${configure_ac}` -#gettext_vers_num=`echo "$gettext_vers" | cvtver` - +if [ -d "${tsdir}/po" ]; then + gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ { +s/^.*\[\(.*\)])/\1/p +q +}' ${configure_ac}` + gettext_vers_num=`echo "$gettext_vers" | cvtver` +else + gettext_vers="n/a" +fi -if [ -z "$autoconf_vers" -o -z "$automake_vers" ] +if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ] then echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2 exit 1 fi -# Allow to override the default tool names -AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX} -AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX} - -AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX} -ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX} - -#GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX} -#MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} - if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf @@ -236,54 +323,71 @@ fi if check_version $AUTOMAKE $automake_vers_num $automake_vers; then check_version $ACLOCAL $automake_vers_num $autoconf_vers automake fi -#if check_version $GETTEXT $gettext_vers_num $gettext_vers; then -# check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext -#fi +if [ "$gettext_vers" != "n/a" ]; then + if check_version $GETTEXT $gettext_vers_num $gettext_vers; then + check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext + fi +fi -if test "$DIE" = "yes"; then +if [ "$DIE" = "yes" ]; then cat <&2 + [ -z "${SILENT}" ] && cat <&2 + [ -z "${SILENT}" ] && cat <. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gpgme' PACKAGE_TARNAME='gpgme' -PACKAGE_VERSION='1.4.4' -PACKAGE_STRING='gpgme 1.4.4' +PACKAGE_VERSION='1.5.0' +PACKAGE_STRING='gpgme 1.5.0' PACKAGE_BUGREPORT='http://bugs.gnupg.org' PACKAGE_URL='' @@ -647,27 +647,6 @@ HAVE_UISERVER_FALSE HAVE_UISERVER_TRUE USE_DESCRIPTOR_PASSING_FALSE USE_DESCRIPTOR_PASSING_TRUE -RUN_G13_TESTS_FALSE -RUN_G13_TESTS_TRUE -HAVE_G13_FALSE -HAVE_G13_TRUE -G13 -RUN_GPGSM_TESTS_FALSE -RUN_GPGSM_TESTS_TRUE -HAVE_GPGSM_FALSE -HAVE_GPGSM_TRUE -GPGSM -GPG_PATH -RUN_GPG_TESTS_FALSE -RUN_GPG_TESTS_TRUE -GPG -RUN_GPGCONF_TESTS_FALSE -RUN_GPGCONF_TESTS_TRUE -HAVE_GPGCONF_FALSE -HAVE_GPGCONF_TRUE -GPGCONF -HAVE_ASSUAN_FALSE -HAVE_ASSUAN_TRUE LIBASSUAN_LIBS LIBASSUAN_CFLAGS LIBASSUAN_CONFIG @@ -680,6 +659,14 @@ API__SSIZE_T API__OFF_T INSERT__TYPEDEFS_FOR_GPGME_H NEED__FILE_OFFSET_BITS +RUN_G13_TESTS_FALSE +RUN_G13_TESTS_TRUE +RUN_GPGSM_TESTS_FALSE +RUN_GPGSM_TESTS_TRUE +RUN_GPG_TESTS_FALSE +RUN_GPG_TESTS_TRUE +RUN_GPGCONF_TESTS_FALSE +RUN_GPGCONF_TESTS_TRUE BUILD_TIMESTAMP BUILD_FILEVERSION BUILD_REVISION @@ -762,6 +749,10 @@ CPPFLAGS LDFLAGS CFLAGS CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V host_os host_vendor host_cpu @@ -838,6 +829,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode +enable_silent_rules enable_dependency_tracking enable_static enable_shared @@ -849,22 +841,15 @@ enable_libtool_lock enable_glibtest enable_w32_glib enable_w32_qt -enable_largefile -with_libgpg_error_prefix -with_gpg_error_prefix -with_libassuan_prefix -with_gpg_version -with_gpgsm_version -with_gpgconf_version -with_g13_version -with_gpgconf +enable_fixed_path enable_gpgconf_test -with_gpg enable_gpg_test -with_gpgsm enable_gpgsm_test -with_g13 enable_g13_test +enable_largefile +with_libgpg_error_prefix +with_gpg_error_prefix +with_libassuan_prefix enable_fd_passing ' ac_precious_vars='build_alias @@ -1420,7 +1405,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gpgme 1.4.4 to adapt to many kinds of systems. +\`configure' configures gpgme 1.5.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1490,7 +1475,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gpgme 1.4.4:";; + short | recursive ) echo "Configuration of gpgme 1.5.0:";; esac cat <<\_ACEOF @@ -1500,6 +1485,8 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-static[=PKGS] build static libraries [default=no] @@ -1510,11 +1497,13 @@ Optional Features: --disable-glibtest do not try to compile and run a test GLIB program --enable-w32-glib build GPGME Glib for W32 --enable-w32-qt build GPGME Qt for W32 + --enable-fixed-path=PATH + locate binaries only via this PATH + --disable-gpgconf-test disable GPGCONF regression test + --disable-gpg-test disable GPG regression test + --disable-gpgsm-test disable GPGSM regression test + --disable-g13-test disable G13 regression test --disable-largefile omit support for large files - --disable-gpgconf-test disable GPGCONF run test - --disable-gpg-test disable GPG run test - --disable-gpgsm-test disable GPGSM run test - --disable-g13-test disable G13 run test --disable-fd-passing do not use FD passing Optional Packages: @@ -1530,16 +1519,6 @@ Optional Packages: --with-libassuan-prefix=PFX prefix where LIBASSUAN is installed (optional) - --with-gpg-version=VER require GnuPG version VER - --with-gpgsm-version=VER - require GPGSM version VER - --with-gpgconf-version=VER - require GPGCONF version VER - --with-g13-version=VER require G13 version VER - --with-gpgconf=PATH use gpgconf binary at PATH - --with-gpg=PATH use GnuPG binary at PATH - --with-gpgsm=PATH use GpgSM binary at PATH - --with-g13=PATH use g13 binary at PATH Some influential environment variables: CC C compiler command @@ -1620,7 +1599,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gpgme configure 1.4.4 +gpgme configure 1.5.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2450,7 +2429,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gpgme $as_me 1.4.4, which was +It was created by gpgme $as_me 1.5.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2813,17 +2792,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # (Interfaces added: AGE++) # (Interfaces removed/changed: AGE=0) # -LIBGPGME_LT_CURRENT=22 +LIBGPGME_LT_CURRENT=23 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] -LIBGPGME_LT_AGE=11 -LIBGPGME_LT_REVISION=1 +LIBGPGME_LT_AGE=12 +LIBGPGME_LT_REVISION=0 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 ############################################## -NEED_GPG_ERROR_VERSION=1.8 +NEED_GPG_ERROR_VERSION=1.11 NEED_LIBASSUAN_API=2 NEED_LIBASSUAN_VERSION=2.0.2 @@ -3304,7 +3283,7 @@ fi # Define the identity of the package. PACKAGE='gpgme' - VERSION='1.4.4' + VERSION='1.5.0' cat >>confdefs.h <<_ACEOF @@ -3438,6 +3417,45 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + # Enable GNU extensions on systems that have them. DEPDIR="${am__leading_dot}deps" @@ -5997,7 +6015,7 @@ cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF -VERSION_NUMBER=0x010404 +VERSION_NUMBER=0x010500 # Don't default to build static libs. @@ -17322,10 +17340,26 @@ fi +# Check whether --enable-fixed-path was given. +if test "${enable_fixed_path+set}" = set; then : + enableval=$enable_fixed_path; fixed_search_path="$enableval" +else + fixed_search_path="" +fi + +if test x$fixed_search_path != x ; then + +cat >>confdefs.h <<_ACEOF +#define FIXED_SEARCH_PATH "$fixed_search_path" +_ACEOF + +fi + + # # Provide information about the build. # -BUILD_REVISION="998e454" +BUILD_REVISION="0eca211" cat >>confdefs.h <<_ACEOF @@ -17334,7 +17368,7 @@ _ACEOF BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` -BUILD_FILEVERSION="${BUILD_FILEVERSION}39310" +BUILD_FILEVERSION="${BUILD_FILEVERSION}3786" BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` @@ -17345,6 +17379,67 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# +# Options to disable some regression tests +# +run_gpgconf_test="yes" +# Check whether --enable-gpgconf-test was given. +if test "${enable_gpgconf_test+set}" = set; then : + enableval=$enable_gpgconf_test; run_gpgconf_test=$enableval +fi + + if test "$run_gpgconf_test" = "yes"; then + RUN_GPGCONF_TESTS_TRUE= + RUN_GPGCONF_TESTS_FALSE='#' +else + RUN_GPGCONF_TESTS_TRUE='#' + RUN_GPGCONF_TESTS_FALSE= +fi + + +run_gpg_test="yes" +# Check whether --enable-gpg-test was given. +if test "${enable_gpg_test+set}" = set; then : + enableval=$enable_gpg_test; run_gpg_test=$enableval +fi + + if test "$run_gpg_test" = "yes"; then + RUN_GPG_TESTS_TRUE= + RUN_GPG_TESTS_FALSE='#' +else + RUN_GPG_TESTS_TRUE='#' + RUN_GPG_TESTS_FALSE= +fi + + +run_gpgsm_test="yes" +# Check whether --enable-gpgsm-test was given. +if test "${enable_gpgsm_test+set}" = set; then : + enableval=$enable_gpgsm_test; run_gpgsm_test=$enableval +fi + + if test "$run_gpgsm_test" = "yes"; then + RUN_GPGSM_TESTS_TRUE= + RUN_GPGSM_TESTS_FALSE='#' +else + RUN_GPGSM_TESTS_TRUE='#' + RUN_GPGSM_TESTS_FALSE= +fi + + +run_g13_test="yes" +# Check whether --enable-g13-test was given. +if test "${enable_g13_test+set}" = set; then : + enableval=$enable_g13_test; run_g13_test=$enableval +fi + + if test "$run_g13_test" = "yes"; then + RUN_G13_TESTS_TRUE= + RUN_G13_TESTS_FALSE='#' +else + RUN_G13_TESTS_TRUE='#' + RUN_G13_TESTS_FALSE= +fi @@ -18665,930 +18760,136 @@ cat >>confdefs.h <<_ACEOF _ACEOF fi - if test "$have_libassuan" = "yes"; then - HAVE_ASSUAN_TRUE= - HAVE_ASSUAN_FALSE='#' -else - HAVE_ASSUAN_TRUE='#' - HAVE_ASSUAN_FALSE= -fi - -if test "$have_libassuan" = "yes"; then -$as_echo "#define ENABLE_ASSUAN 1" >>confdefs.h -fi +# +# Other checks +# -# Checks for system services -NEED_GPG_VERSION_DEFAULT=1.4.0 -NEED_GPGSM_VERSION_DEFAULT=1.9.6 -NEED_GPGCONF_VERSION_DEFAULT=2.0.4 -NEED_G13_VERSION_DEFAULT=2.1.0 -NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT" -NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT" -NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT" -NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT" +# Check for funopen +for ac_func in funopen +do : + ac_fn_c_check_func "$LINENO" "funopen" "ac_cv_func_funopen" +if test "x$ac_cv_func_funopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FUNOPEN 1 +_ACEOF -# Check whether --with-gpg-version was given. -if test "${with_gpg_version+set}" = set; then : - withval=$with_gpg_version; NEED_GPG_VERSION=$withval fi +done -if test "$NEED_GPG_VERSION" = "yes"; then - NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT" -fi -if test "$NEED_GPG_VERSION" = "no"; then - NEED_GPG_VERSION=0.0.0 -fi +if test $ac_cv_func_funopen != yes; then + # No funopen but we can implement that in terms of fopencookie. + for ac_func in fopencookie +do : + ac_fn_c_check_func "$LINENO" "fopencookie" "ac_cv_func_fopencookie" +if test "x$ac_cv_func_fopencookie" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FOPENCOOKIE 1 +_ACEOF -# Check whether --with-gpgsm-version was given. -if test "${with_gpgsm_version+set}" = set; then : - withval=$with_gpgsm_version; NEED_GPGSM_VERSION=$withval fi +done -if test "$NEED_GPGSM_VERSION" = "yes"; then - NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT" -fi -if test "$NEED_GPGSM_VERSION" = "no"; then - NEED_GPGSM_VERSION=0.0.0 -fi + if test $ac_cv_func_fopencookie = yes; then + ac_fn_c_check_func "$LINENO" "funopen" "ac_cv_func_funopen" +if test "x$ac_cv_func_funopen" = xyes; then : + $as_echo "#define HAVE_FUNOPEN 1" >>confdefs.h -# Check whether --with-gpgconf-version was given. -if test "${with_gpgconf_version+set}" = set; then : - withval=$with_gpgconf_version; NEED_GPGCONF_VERSION=$withval -fi +else + case " $LIBOBJS " in + *" funopen.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS funopen.$ac_objext" + ;; +esac -if test "$NEED_GPGCONF_VERSION" = "yes"; then - NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT" -fi -if test "$NEED_GPGCONF_VERSION" = "no"; then - NEED_GPGCONF_VERSION=0.0.0 fi -# Check whether --with-g13-version was given. -if test "${with_g13_version+set}" = set; then : - withval=$with_g13_version; NEED_G13_VERSION=$withval -fi -if test "$NEED_G13_VERSION" = "yes"; then - NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT" -fi -if test "$NEED_G13_VERSION" = "no"; then - NEED_G13_VERSION=0.0.0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +*** +*** No implementation of fopencookie or funopen available +***" >&5 +$as_echo "$as_me: WARNING: +*** +*** No implementation of fopencookie or funopen available +***" >&2;} + fi fi - -cat >>confdefs.h <<_ACEOF -#define NEED_GPGCONF_VERSION "$NEED_GPGCONF_VERSION" +# Check for getgid etc +for ac_func in getgid getegid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +fi +done -cat >>confdefs.h <<_ACEOF -#define NEED_GPG_VERSION "$NEED_GPG_VERSION" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define NEED_GPGSM_VERSION "$NEED_GPGSM_VERSION" -_ACEOF +# Replacement functions. +ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" +if test "x$ac_cv_func_stpcpy" = xyes; then : + $as_echo "#define HAVE_STPCPY 1" >>confdefs.h +else + case " $LIBOBJS " in + *" stpcpy.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stpcpy.$ac_objext" + ;; +esac -cat >>confdefs.h <<_ACEOF -#define NEED_G13_VERSION "$NEED_G13_VERSION" -_ACEOF +fi -# -# Check for GPGCONF -# -gpgconf_usable_for_test=no -NO_OVERRIDE=no +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = xyes; then : + $as_echo "#define HAVE_SETENV 1" >>confdefs.h -# Check whether --with-gpgconf was given. -if test "${with_gpgconf+set}" = set; then : - withval=$with_gpgconf; GPGCONF=$withval else - NO_OVERRIDE=yes + case " $LIBOBJS " in + *" setenv.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS setenv.$ac_objext" + ;; +esac + fi -if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then - GPGCONF= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - # Extract the first word of "gpgconf", so it can be a program name with args. -set dummy gpgconf; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GPGCONF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GPGCONF in - [\\/]* | ?:[\\/]*) - ac_cv_path_GPGCONF="$GPGCONF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GPGCONF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -GPGCONF=$ac_cv_path_GPGCONF -if test -n "$GPGCONF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGCONF" >&5 -$as_echo "$GPGCONF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +# Assuan check for descriptor passing. +ac_fn_c_check_member "$LINENO" "struct cmsghdr" "cmsg_len" "ac_cv_member_struct_cmsghdr_cmsg_len" " +#include +#include +#include +#include +#include +#include +#if HAVE_SYS_UIO_H +#include +#endif +#include - fi - if test -z "$GPGCONF"; then - GPGCONF="$GPGCONF_DEFAULT" - fi -fi -if test "$GPGCONF" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +" +if test "x$ac_cv_member_struct_cmsghdr_cmsg_len" = xyes; then : + supports_descriptor_passing=yes +else + supports_descriptor_passing=no + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** -*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it +*** Data structure for sending ancillary data missing. +*** Descriptor passing won't work. ***" >&5 $as_echo "$as_me: WARNING: *** -*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it -***" >&2;} - else - as_fn_error $? " -*** -*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH -***" "$LINENO" 5 - fi - fi -else - -cat >>confdefs.h <<_ACEOF -#define GPGCONF_PATH "$GPGCONF" -_ACEOF - - -$as_echo "#define ENABLE_GPGCONF 1" >>confdefs.h - -fi - if test "$GPGCONF" != "no"; then - HAVE_GPGCONF_TRUE= - HAVE_GPGCONF_FALSE='#' -else - HAVE_GPGCONF_TRUE='#' - HAVE_GPGCONF_FALSE= -fi - - -GPGCONF_VERSION=unknown -ok=maybe -if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF version can not be checked when cross compiling" >&5 -$as_echo "$as_me: WARNING: GPGCONF version can not be checked when cross compiling" >&2;} - ok=no - else - if test ! -x "$GPGCONF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF not executable, version check disabled" >&5 -$as_echo "$as_me: WARNING: GPGCONF not executable, version check disabled" >&2;} - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGCONF >= $NEED_GPGCONF_VERSION" >&5 -$as_echo_n "checking for GPGCONF >= $NEED_GPGCONF_VERSION... " >&6; } - req_major=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - req_minor=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - req_micro=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[^0-9]*\(.*\)/\1/p'` - major=`echo $GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` - minor=`echo $GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` - micro=`echo $GPGCONF_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "$cross_compiling" != "yes"; then - gpgconf_usable_for_test=yes - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&5 -$as_echo "$as_me: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&2;} - fi -fi -run_gpgconf_test="$ok" -# Check whether --enable-gpgconf-test was given. -if test "${enable_gpgconf_test+set}" = set; then : - enableval=$enable_gpgconf_test; run_gpgconf_test=$enableval -fi - - if test "$run_gpgconf_test" = "yes"; then - RUN_GPGCONF_TESTS_TRUE= - RUN_GPGCONF_TESTS_FALSE='#' -else - RUN_GPGCONF_TESTS_TRUE='#' - RUN_GPGCONF_TESTS_FALSE= -fi - - - -# -# Check for GPG -# -NO_OVERRIDE=no - -# Check whether --with-gpg was given. -if test "${with_gpg+set}" = set; then : - withval=$with_gpg; GPG=$withval -else - NO_OVERRIDE=yes -fi - -if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then - GPG= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - GPG="`$GPGCONF --list-components | grep ^gpg: | cut -d: -f 3`" - else - # Extract the first word of "gpg", so it can be a program name with args. -set dummy gpg; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GPG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GPG in - [\\/]* | ?:[\\/]*) - ac_cv_path_GPG="$GPG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GPG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GPG=$ac_cv_path_GPG -if test -n "$GPG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG" >&5 -$as_echo "$GPG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - if test -z "$GPG"; then - GPG="$GPG_DEFAULT" - fi -fi -if test "$GPG" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it -***" >&2;} - else - as_fn_error $? " -*** -*** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH -***" "$LINENO" 5 - fi - fi -else - -cat >>confdefs.h <<_ACEOF -#define GPG_PATH "$GPG" -_ACEOF - - -fi -GPG_VERSION=unknown -ok=maybe -if test -z "$GPG" -o "x$GPG" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GnuPG version can not be checked when cross compiling" >&5 -$as_echo "$as_me: WARNING: GnuPG version can not be checked when cross compiling" >&2;} - ok=no - else - if test ! -x "$GPG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GnuPG not executable, version check disabled" >&5 -$as_echo "$as_me: WARNING: GnuPG not executable, version check disabled" >&2;} - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPG >= $NEED_GPG_VERSION" >&5 -$as_echo_n "checking for GPG >= $NEED_GPG_VERSION... " >&6; } - req_major=`echo $NEED_GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - req_minor=`echo $NEED_GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - req_micro=`echo $NEED_GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - GPG_VERSION=`$GPG --version | sed -n '1 s/[^0-9]*\(.*\)/\1/p'` - major=`echo $GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` - minor=`echo $GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` - micro=`echo $GPG_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&5 -$as_echo "$as_me: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&2;} - fi -fi -run_gpg_test="$ok" -# Check whether --enable-gpg-test was given. -if test "${enable_gpg_test+set}" = set; then : - enableval=$enable_gpg_test; run_gpg_test=$enableval -fi - - if test "$run_gpg_test" = "yes"; then - RUN_GPG_TESTS_TRUE= - RUN_GPG_TESTS_FALSE='#' -else - RUN_GPG_TESTS_TRUE='#' - RUN_GPG_TESTS_FALSE= -fi - - - - -# -# Check for GPGSM -# -NO_OVERRIDE=no - -# Check whether --with-gpgsm was given. -if test "${with_gpgsm+set}" = set; then : - withval=$with_gpgsm; GPGSM=$withval -else - NO_OVERRIDE=yes -fi - -if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then - GPGSM= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - GPGSM="`$GPGCONF --list-components | grep ^gpgsm: | cut -d: -f 3`" - else - # Extract the first word of "gpgsm", so it can be a program name with args. -set dummy gpgsm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GPGSM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GPGSM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GPGSM="$GPGSM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GPGSM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GPGSM=$ac_cv_path_GPGSM -if test -n "$GPGSM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGSM" >&5 -$as_echo "$GPGSM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - if test -z "$GPGSM"; then - GPGSM="$GPGSM_DEFAULT" - fi -fi -if test "$GPGSM" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it -***" >&2;} - else - as_fn_error $? " -*** -*** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH -***" "$LINENO" 5 - fi - fi -else - -cat >>confdefs.h <<_ACEOF -#define GPGSM_PATH "$GPGSM" -_ACEOF - - -$as_echo "#define ENABLE_GPGSM 1" >>confdefs.h - -fi - if test "$GPGSM" != "no"; then - HAVE_GPGSM_TRUE= - HAVE_GPGSM_FALSE='#' -else - HAVE_GPGSM_TRUE='#' - HAVE_GPGSM_FALSE= -fi - - - -GPGSM_VERSION=unknown -ok=maybe -if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGSM version can not be checked when cross compiling" >&5 -$as_echo "$as_me: WARNING: GPGSM version can not be checked when cross compiling" >&2;} - ok=no - else - if test ! -x "$GPGSM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGSM not executable, version check disabled" >&5 -$as_echo "$as_me: WARNING: GPGSM not executable, version check disabled" >&2;} - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGSM >= $NEED_GPGSM_VERSION" >&5 -$as_echo_n "checking for GPGSM >= $NEED_GPGSM_VERSION... " >&6; } - req_major=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - req_minor=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - req_micro=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[^0-9]*\(.*\)/\1/p'` - major=`echo $GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` - minor=`echo $GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` - micro=`echo $GPGSM_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&5 -$as_echo "$as_me: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&2;} - fi -fi -run_gpgsm_test="$ok" -# Check whether --enable-gpgsm-test was given. -if test "${enable_gpgsm_test+set}" = set; then : - enableval=$enable_gpgsm_test; run_gpgsm_test=$enableval -fi - - if test "$run_gpgsm_test" = "yes"; then - RUN_GPGSM_TESTS_TRUE= - RUN_GPGSM_TESTS_FALSE='#' -else - RUN_GPGSM_TESTS_TRUE='#' - RUN_GPGSM_TESTS_FALSE= -fi - - - -# -# Check for G13 -# -NO_OVERRIDE=no - -# Check whether --with-g13 was given. -if test "${with_g13+set}" = set; then : - withval=$with_g13; G13=$withval -else - NO_OVERRIDE=yes -fi - -if test "$NO_OVERRIDE" = "yes" || test "$G13" = "yes"; then - G13= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - G13="`$GPGCONF --list-components | grep ^g13: | cut -d: -f 3`" - if test -z "$G13"; then - # Use a hack if gpgconf has no support for g13. - G13="`$GPGCONF --list-dirs | grep ^bindir: | cut -d: -f 2`/g13" - fi - else - # Extract the first word of "g13", so it can be a program name with args. -set dummy g13; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_G13+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $G13 in - [\\/]* | ?:[\\/]*) - ac_cv_path_G13="$G13" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_G13="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -G13=$ac_cv_path_G13 -if test -n "$G13"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $G13" >&5 -$as_echo "$G13" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - if test -z "$G13"; then - G13="$G13_DEFAULT" - fi -fi -if test "$G13" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** Could not find g13, install g13 or use --with-g13=PATH to enable it -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** Could not find g13, install g13 or use --with-g13=PATH to enable it -***" >&2;} - else - as_fn_error $? " -*** -*** Can not determine path to g13 when cross-compiling, use --with-g13=PATH -***" "$LINENO" 5 - fi - fi -else - -cat >>confdefs.h <<_ACEOF -#define G13_PATH "$G13" -_ACEOF - - -$as_echo "#define ENABLE_G13 1" >>confdefs.h - -fi - if test "$G13" != "no"; then - HAVE_G13_TRUE= - HAVE_G13_FALSE='#' -else - HAVE_G13_TRUE='#' - HAVE_G13_FALSE= -fi - - -G13_VERSION=unknown -ok=maybe -if test -z "$G13" -o "x$G13" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: G13 version can not be checked when cross compiling" >&5 -$as_echo "$as_me: WARNING: G13 version can not be checked when cross compiling" >&2;} - ok=no - else - if test ! -x "$G13"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: G13 not executable, version check disabled" >&5 -$as_echo "$as_me: WARNING: G13 not executable, version check disabled" >&2;} - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G13 >= $NEED_G13_VERSION" >&5 -$as_echo_n "checking for G13 >= $NEED_G13_VERSION... " >&6; } - req_major=`echo $NEED_G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - req_minor=`echo $NEED_G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - req_micro=`echo $NEED_G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - G13_VERSION=`$G13 --version | sed -n '1 s/.*\ \([0-9].*\)/\1/p'` - major=`echo $G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` - minor=`echo $G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` - micro=`echo $G13_VERSION | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: G13 must be at least version $NEED_G13_VERSION" >&5 -$as_echo "$as_me: WARNING: G13 must be at least version $NEED_G13_VERSION" >&2;} - fi -fi -run_g13_test="$ok" -# Check whether --enable-g13-test was given. -if test "${enable_g13_test+set}" = set; then : - enableval=$enable_g13_test; run_g13_test=$enableval -fi - - if test "$run_g13_test" = "yes"; then - RUN_G13_TESTS_TRUE= - RUN_G13_TESTS_FALSE='#' -else - RUN_G13_TESTS_TRUE='#' - RUN_G13_TESTS_FALSE= -fi - - - -# -# Other checks -# - -# Check for funopen -for ac_func in funopen -do : - ac_fn_c_check_func "$LINENO" "funopen" "ac_cv_func_funopen" -if test "x$ac_cv_func_funopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FUNOPEN 1 -_ACEOF - -fi -done - -if test $ac_cv_func_funopen != yes; then - # No funopen but we can implement that in terms of fopencookie. - for ac_func in fopencookie -do : - ac_fn_c_check_func "$LINENO" "fopencookie" "ac_cv_func_fopencookie" -if test "x$ac_cv_func_fopencookie" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FOPENCOOKIE 1 -_ACEOF - -fi -done - - if test $ac_cv_func_fopencookie = yes; then - ac_fn_c_check_func "$LINENO" "funopen" "ac_cv_func_funopen" -if test "x$ac_cv_func_funopen" = xyes; then : - $as_echo "#define HAVE_FUNOPEN 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" funopen.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS funopen.$ac_objext" - ;; -esac - -fi - - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** No implementation of fopencookie or funopen available -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** No implementation of fopencookie or funopen available -***" >&2;} - fi -fi - -# Check for getgid etc -for ac_func in getgid getegid -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -# Replacement functions. -ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" -if test "x$ac_cv_func_stpcpy" = xyes; then : - $as_echo "#define HAVE_STPCPY 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" stpcpy.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS stpcpy.$ac_objext" - ;; -esac - -fi - - -ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" -if test "x$ac_cv_func_setenv" = xyes; then : - $as_echo "#define HAVE_SETENV 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" setenv.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS setenv.$ac_objext" - ;; -esac - -fi - - - -# Assuan check for descriptor passing. -ac_fn_c_check_member "$LINENO" "struct cmsghdr" "cmsg_len" "ac_cv_member_struct_cmsghdr_cmsg_len" " -#include -#include -#include -#include -#include -#include -#if HAVE_SYS_UIO_H -#include -#endif -#include - -" -if test "x$ac_cv_member_struct_cmsghdr_cmsg_len" = xyes; then : - supports_descriptor_passing=yes -else - supports_descriptor_passing=no - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** Data structure for sending ancillary data missing. -*** Descriptor passing won't work. -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** Data structure for sending ancillary data missing. -*** Descriptor passing won't work. +*** Data structure for sending ancillary data missing. +*** Descriptor passing won't work. ***" >&2;} fi @@ -19718,14 +19019,14 @@ if test "$have_libassuan" = "no"; then die=yes { $as_echo "$as_me:${as_lineno-$LINENO}: *** -*** You need libassuan to build this program with GPGSM support. +*** You need libassuan to build this program. *** This library is for example available at *** ftp://ftp.gnupg.org/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). ***" >&5 $as_echo "$as_me: *** -*** You need libassuan to build this program with GPGSM support. +*** You need libassuan to build this program. *** This library is for example available at *** ftp://ftp.gnupg.org/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). @@ -19923,14 +19224,6 @@ if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then as_fn_error $? "conditional \"HAVE_PTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_ASSUAN_TRUE}" && test -z "${HAVE_ASSUAN_FALSE}"; then - as_fn_error $? "conditional \"HAVE_ASSUAN\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_GPGCONF_TRUE}" && test -z "${HAVE_GPGCONF_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GPGCONF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${RUN_GPGCONF_TESTS_TRUE}" && test -z "${RUN_GPGCONF_TESTS_FALSE}"; then as_fn_error $? "conditional \"RUN_GPGCONF_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -19939,18 +19232,10 @@ if test -z "${RUN_GPG_TESTS_TRUE}" && test -z "${RUN_GPG_TESTS_FALSE}"; then as_fn_error $? "conditional \"RUN_GPG_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_GPGSM_TRUE}" && test -z "${HAVE_GPGSM_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GPGSM\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${RUN_GPGSM_TESTS_TRUE}" && test -z "${RUN_GPGSM_TESTS_FALSE}"; then as_fn_error $? "conditional \"RUN_GPGSM_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_G13_TRUE}" && test -z "${HAVE_G13_FALSE}"; then - as_fn_error $? "conditional \"HAVE_G13\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${RUN_G13_TESTS_TRUE}" && test -z "${RUN_G13_TESTS_FALSE}"; then as_fn_error $? "conditional \"RUN_G13_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20360,7 +19645,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gpgme $as_me 1.4.4, which was +This file was extended by gpgme $as_me 1.5.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20426,7 +19711,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gpgme config.status 1.4.4 +gpgme config.status 1.5.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -22720,20 +22005,9 @@ fi echo " GPGME v${VERSION} has been configured as follows: - Revision: 998e454 (39310) + Revision: 0eca211 (3786) Platform: $host - Gpgconf at: $GPGCONF - Gpgconf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION - GPG at: $GPG - GPG version: $GPG_VERSION, min. $NEED_GPG_VERSION - Gpgsm at: $GPGSM - Gpgsm version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION - G13 at: $G13 - G13 version: $G13_VERSION, min. $NEED_G13_VERSION - - Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION - UI Server: $uiserver FD Passing: $use_descriptor_passing GPGME Pthread: $have_pthread diff --git a/configure.ac b/configure.ac index 36bd035..f3d3195 100644 --- a/configure.ac +++ b/configure.ac @@ -28,8 +28,8 @@ min_automake_version="1.11" # commit and push so that the git magic is able to work. See below # for the LT versions. m4_define(mym4_version_major, [1]) -m4_define(mym4_version_minor, [4]) -m4_define(mym4_version_micro, [4]) +m4_define(mym4_version_minor, [5]) +m4_define(mym4_version_micro, [0]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag @@ -55,17 +55,17 @@ AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org]) # (Interfaces added: AGE++) # (Interfaces removed/changed: AGE=0) # -LIBGPGME_LT_CURRENT=22 +LIBGPGME_LT_CURRENT=23 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] -LIBGPGME_LT_AGE=11 -LIBGPGME_LT_REVISION=1 +LIBGPGME_LT_AGE=12 +LIBGPGME_LT_REVISION=0 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 ############################################## -NEED_GPG_ERROR_VERSION=1.8 +NEED_GPG_ERROR_VERSION=1.11 NEED_LIBASSUAN_API=2 NEED_LIBASSUAN_VERSION=2.0.2 @@ -82,6 +82,7 @@ AC_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE AC_CANONICAL_HOST +AM_SILENT_RULES # Enable GNU extensions on systems that have them. AC_GNU_SOURCE @@ -235,6 +236,17 @@ AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes) AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes") +AC_ARG_ENABLE([fixed-path], + AC_HELP_STRING([--enable-fixed-path=PATH], + [locate binaries only via this PATH]), + [fixed_search_path="$enableval"], + [fixed_search_path=""]) +if test x$fixed_search_path != x ; then + AC_DEFINE_UNQUOTED(FIXED_SEARCH_PATH, "$fixed_search_path", + [Locate binaries only via this PATH]) +fi + + # # Provide information about the build. # @@ -254,7 +266,32 @@ AC_SUBST(BUILD_TIMESTAMP) AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP", [The time this package was configured for a build]) +# +# Options to disable some regression tests +# +run_gpgconf_test="yes" +AC_ARG_ENABLE(gpgconf-test, + AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF regression test]), + run_gpgconf_test=$enableval) +AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes") + +run_gpg_test="yes" +AC_ARG_ENABLE(gpg-test, + AC_HELP_STRING([--disable-gpg-test], [disable GPG regression test]), + run_gpg_test=$enableval) +AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes") + +run_gpgsm_test="yes" +AC_ARG_ENABLE(gpgsm-test, + AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM regression test]), + run_gpgsm_test=$enableval) +AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes") +run_g13_test="yes" +AC_ARG_ENABLE(g13-test, + AC_HELP_STRING([--disable-g13-test], [disable G13 regression test]), + run_g13_test=$enableval) +AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes") # Checks for header files. @@ -394,478 +431,6 @@ if test "$have_libassuan" = "yes"; then AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version", [version of the libassuan library]) fi -AM_CONDITIONAL(HAVE_ASSUAN, test "$have_libassuan" = "yes") -if test "$have_libassuan" = "yes"; then - AC_DEFINE(ENABLE_ASSUAN,1,[Whether Assuan support is enabled]) -fi - -# Checks for system services -NEED_GPG_VERSION_DEFAULT=1.4.0 -NEED_GPGSM_VERSION_DEFAULT=1.9.6 -NEED_GPGCONF_VERSION_DEFAULT=2.0.4 -NEED_G13_VERSION_DEFAULT=2.1.0 -NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT" -NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT" -NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT" -NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT" -AC_ARG_WITH(gpg-version, - AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]), - NEED_GPG_VERSION=$withval) -if test "$NEED_GPG_VERSION" = "yes"; then - NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT" -fi -if test "$NEED_GPG_VERSION" = "no"; then - NEED_GPG_VERSION=0.0.0 -fi -AC_ARG_WITH(gpgsm-version, - AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]), - NEED_GPGSM_VERSION=$withval) -if test "$NEED_GPGSM_VERSION" = "yes"; then - NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT" -fi -if test "$NEED_GPGSM_VERSION" = "no"; then - NEED_GPGSM_VERSION=0.0.0 -fi -AC_ARG_WITH(gpgconf-version, - AC_HELP_STRING([--with-gpgconf-version=VER], [require GPGCONF version VER]), - NEED_GPGCONF_VERSION=$withval) -if test "$NEED_GPGCONF_VERSION" = "yes"; then - NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT" -fi -if test "$NEED_GPGCONF_VERSION" = "no"; then - NEED_GPGCONF_VERSION=0.0.0 -fi -AC_ARG_WITH(g13-version, - AC_HELP_STRING([--with-g13-version=VER], [require G13 version VER]), - NEED_G13_VERSION=$withval) -if test "$NEED_G13_VERSION" = "yes"; then - NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT" -fi -if test "$NEED_G13_VERSION" = "no"; then - NEED_G13_VERSION=0.0.0 -fi - -AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION", - [Min. needed GPGCONF version.]) -AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION", - [Min. needed GnuPG version.]) -AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION", - [Min. needed GPGSM version.]) -AC_DEFINE_UNQUOTED(NEED_G13_VERSION, "$NEED_G13_VERSION", - [Min. needed G13 version.]) - -# -# Check for GPGCONF -# -gpgconf_usable_for_test=no -NO_OVERRIDE=no -AC_ARG_WITH(gpgconf, - AC_HELP_STRING([--with-gpgconf=PATH], - [use gpgconf binary at PATH]), - GPGCONF=$withval, NO_OVERRIDE=yes) -if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then - GPGCONF= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - AC_PATH_PROG(GPGCONF, gpgconf) - fi - if test -z "$GPGCONF"; then - GPGCONF="$GPGCONF_DEFAULT" - fi -fi -if test "$GPGCONF" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([ -*** -*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it -***]) - else - AC_MSG_ERROR([ -*** -*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH -***]) - fi - fi -else - AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.]) - AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled]) -fi -AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no") - -dnl Check for GPGCONF version requirement. -GPGCONF_VERSION=unknown -ok=maybe -if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - AC_MSG_WARN([GPGCONF version can not be checked when cross compiling]) - ok=no - else - if test ! -x "$GPGCONF"; then - AC_MSG_WARN([GPGCONF not executable, version check disabled]) - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION) - req_major=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - req_minor=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - req_micro=`echo $NEED_GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'` - major=`echo $GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` - minor=`echo $GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` - micro=`echo $GPGCONF_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - AC_MSG_RESULT(yes) - if test "$cross_compiling" != "yes"; then - gpgconf_usable_for_test=yes - fi - else - AC_MSG_RESULT(no) - AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION]) - fi -fi -run_gpgconf_test="$ok" -AC_ARG_ENABLE(gpgconf-test, - AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]), - run_gpgconf_test=$enableval) -AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes") - - -# -# Check for GPG -# -NO_OVERRIDE=no -AC_ARG_WITH(gpg, - AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]), - GPG=$withval, NO_OVERRIDE=yes) -if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then - GPG= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - GPG="`$GPGCONF --list-components | grep ^gpg: | cut -d: -f 3`" - else - AC_PATH_PROG(GPG, gpg) - fi - fi - if test -z "$GPG"; then - GPG="$GPG_DEFAULT" - fi -fi -if test "$GPG" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([ -*** -*** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it -***]) - else - AC_MSG_ERROR([ -*** -*** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH -***]) - fi - fi -else - AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.]) - AC_SUBST(GPG) -fi -dnl Check for GnuPG version requirement. -GPG_VERSION=unknown -ok=maybe -if test -z "$GPG" -o "x$GPG" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - AC_MSG_WARN([GnuPG version can not be checked when cross compiling]) - ok=no - else - if test ! -x "$GPG"; then - AC_MSG_WARN([GnuPG not executable, version check disabled]) - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION) - req_major=`echo $NEED_GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - req_minor=`echo $NEED_GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - req_micro=`echo $NEED_GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'` - major=`echo $GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` - minor=`echo $GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` - micro=`echo $GPG_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION]) - fi -fi -run_gpg_test="$ok" -AC_ARG_ENABLE(gpg-test, - AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]), - run_gpg_test=$enableval) -AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes") -AC_SUBST(GPG_PATH) - - -# -# Check for GPGSM -# -NO_OVERRIDE=no -AC_ARG_WITH(gpgsm, - AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]), - GPGSM=$withval, NO_OVERRIDE=yes) -if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then - GPGSM= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - GPGSM="`$GPGCONF --list-components | grep ^gpgsm: | cut -d: -f 3`" - else - AC_PATH_PROG(GPGSM, gpgsm) - fi - fi - if test -z "$GPGSM"; then - GPGSM="$GPGSM_DEFAULT" - fi -fi -if test "$GPGSM" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([ -*** -*** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it -***]) - else - AC_MSG_ERROR([ -*** -*** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH -***]) - fi - fi -else - AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.]) - AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled]) -fi -AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no") - - -dnl Check for GPGSM version requirement. -GPGSM_VERSION=unknown -ok=maybe -if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - AC_MSG_WARN([GPGSM version can not be checked when cross compiling]) - ok=no - else - if test ! -x "$GPGSM"; then - AC_MSG_WARN([GPGSM not executable, version check disabled]) - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION) - req_major=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - req_minor=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - req_micro=`echo $NEED_GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'` - major=`echo $GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` - minor=`echo $GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` - micro=`echo $GPGSM_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION]) - fi -fi -run_gpgsm_test="$ok" -AC_ARG_ENABLE(gpgsm-test, - AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]), - run_gpgsm_test=$enableval) -AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes") - - -# -# Check for G13 -# -NO_OVERRIDE=no -AC_ARG_WITH(g13, - AC_HELP_STRING([--with-g13=PATH], - [use g13 binary at PATH]), - G13=$withval, NO_OVERRIDE=yes) -if test "$NO_OVERRIDE" = "yes" || test "$G13" = "yes"; then - G13= - NO_OVERRIDE=yes - if test "$cross_compiling" != "yes"; then - if test "$gpgconf_usable_for_test" = "yes"; then - G13="`$GPGCONF --list-components | grep ^g13: | cut -d: -f 3`" - if test -z "$G13"; then - # Use a hack if gpgconf has no support for g13. - G13="`$GPGCONF --list-dirs | grep ^bindir: | cut -d: -f 2`/g13" - fi - else - AC_PATH_PROG(G13, g13) - fi - fi - if test -z "$G13"; then - G13="$G13_DEFAULT" - fi -fi -if test "$G13" = no; then - if test "$NO_OVERRIDE" = "yes"; then - if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([ -*** -*** Could not find g13, install g13 or use --with-g13=PATH to enable it -***]) - else - AC_MSG_ERROR([ -*** -*** Can not determine path to g13 when cross-compiling, use --with-g13=PATH -***]) - fi - fi -else - AC_DEFINE_UNQUOTED(G13_PATH, "$G13", [Path to the G13 binary.]) - AC_DEFINE(ENABLE_G13,1,[Whether G13 support is enabled]) -fi -AM_CONDITIONAL(HAVE_G13, test "$G13" != "no") - -dnl Check for G13 version requirement. -G13_VERSION=unknown -ok=maybe -if test -z "$G13" -o "x$G13" = "xno"; then - ok=no -else - if test "$cross_compiling" = "yes"; then - AC_MSG_WARN([G13 version can not be checked when cross compiling]) - ok=no - else - if test ! -x "$G13"; then - AC_MSG_WARN([G13 not executable, version check disabled]) - ok=no - fi - fi -fi -if test "$ok" = "maybe"; then - AC_MSG_CHECKING(for G13 >= $NEED_G13_VERSION) - req_major=`echo $NEED_G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - req_minor=`echo $NEED_G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - req_micro=`echo $NEED_G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - G13_VERSION=`$G13 --version | sed -n '1 s/.*\ \([[0-9]].*\)/\1/p'` - major=`echo $G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` - minor=`echo $G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` - micro=`echo $G13_VERSION | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` - - if test "$major" -gt "$req_major"; then - ok=yes - else - if test "$major" -eq "$req_major"; then - if test "$minor" -gt "$req_minor"; then - ok=yes - else - if test "$minor" -eq "$req_minor"; then - if test "$micro" -ge "$req_micro"; then - ok=yes - fi - fi - fi - fi - fi - if test "$ok" = "yes"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_MSG_WARN([G13 must be at least version $NEED_G13_VERSION]) - fi -fi -run_g13_test="$ok" -AC_ARG_ENABLE(g13-test, - AC_HELP_STRING([--disable-g13-test], [disable G13 run test]), - run_g13_test=$enableval) -AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes") # @@ -1030,7 +595,7 @@ if test "$have_libassuan" = "no"; then die=yes AC_MSG_NOTICE([[ *** -*** You need libassuan to build this program with GPGSM support. +*** You need libassuan to build this program. *** This library is for example available at *** ftp://ftp.gnupg.org/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). @@ -1067,17 +632,6 @@ echo " Revision: mym4_revision (mym4_revision_dec) Platform: $host - Gpgconf at: $GPGCONF - Gpgconf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION - GPG at: $GPG - GPG version: $GPG_VERSION, min. $NEED_GPG_VERSION - Gpgsm at: $GPGSM - Gpgsm version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION - G13 at: $G13 - G13 version: $G13_VERSION, min. $NEED_G13_VERSION - - Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION - UI Server: $uiserver FD Passing: $use_descriptor_passing GPGME Pthread: $have_pthread diff --git a/doc/Makefile.in b/doc/Makefile.in index 58181f6..211a9b4 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -87,6 +87,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/gpgme.info @@ -138,6 +144,7 @@ am__uninstall_files_from_dir = { \ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -168,7 +175,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -176,17 +182,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/doc/gpgme.info b/doc/gpgme.info index 02df049..3465aa6 100644 --- a/doc/gpgme.info +++ b/doc/gpgme.info @@ -7,7 +7,7 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -22,11 +22,11 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.4. + This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made +Easy' Reference Manual', for Version 1.5.0. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -41,118 +41,120 @@ General Public License for more details.  Indirect: -gpgme.info-1: 1757 -gpgme.info-2: 283466 +gpgme.info-1: 1767 +gpgme.info-2: 289212  Tag Table: (Indirect) -Node: Top1757 -Node: Introduction8597 -Node: Getting Started9384 -Node: Features10509 -Node: Overview11659 -Node: Preparation12768 -Node: Header13765 -Node: Building the Source14464 -Node: Largefile Support (LFS)16573 -Node: Using Automake21884 -Node: Using Libtool23520 -Node: Library Version Check23870 -Node: Signal Handling27825 -Node: Multi Threading29041 -Ref: Multi Threading-Footnote-131223 -Node: Protocols and Engines31637 -Node: Engine Version Check33986 -Node: Engine Information34563 -Node: Engine Configuration38263 -Node: OpenPGP39525 -Node: Cryptographic Message Syntax39861 -Node: Algorithms40155 -Ref: Algorithms-Footnote-140634 -Node: Public Key Algorithms40762 -Node: Hash Algorithms42693 -Node: Error Handling43791 -Node: Error Values45653 -Node: Error Sources50731 -Node: Error Codes53058 -Node: Error Strings57697 -Node: Exchanging Data59476 -Node: Creating Data Buffers61305 -Node: Memory Based Data Buffers61821 -Node: File Based Data Buffers65175 -Node: Callback Based Data Buffers67346 -Node: Destroying Data Buffers72902 -Node: Manipulating Data Buffers74261 -Node: Data Buffer I/O Operations74753 -Node: Data Buffer Meta-Data77456 -Node: Data Buffer Convenience80838 -Node: Contexts82774 -Node: Creating Contexts83897 -Node: Destroying Contexts84708 -Node: Result Management85043 -Node: Context Attributes86449 -Node: Protocol Selection87227 -Node: Crypto Engine88239 -Node: ASCII Armor90060 -Node: Text Mode90672 -Node: Included Certificates91603 -Node: Key Listing Mode92978 -Node: Passphrase Callback96335 -Node: Progress Meter Callback99473 -Node: Locale101397 -Node: Key Management102936 -Node: Listing Keys112861 -Node: Information About Keys120123 -Node: Key Signatures128121 -Node: Manipulating Keys132133 -Node: Generating Keys132975 -Node: Exporting Keys137582 -Node: Importing Keys143481 -Ref: Importing Keys-Footnote-1150644 -Node: Deleting Keys150772 -Node: Changing Passphrases152169 -Node: Advanced Key Editing153430 -Node: Trust Item Management156534 -Node: Listing Trust Items157604 -Node: Information About Trust Items159902 -Node: Manipulating Trust Items161784 -Node: Crypto Operations162745 -Node: Decrypt163989 -Node: Verify167847 -Node: Decrypt and Verify185703 -Node: Sign187707 -Node: Selecting Signers188271 -Node: Creating a Signature189423 -Node: Signature Notation Data194012 -Node: Encrypt196196 -Node: Encrypting a Plaintext196552 -Node: Run Control202398 -Node: Waiting For Completion203145 -Node: Using External Event Loops205191 -Node: I/O Callback Interface207158 -Node: Registering I/O Callbacks212252 -Node: I/O Callback Example214243 -Node: I/O Callback Example GTK+220462 -Node: I/O Callback Example GDK222251 -Node: I/O Callback Example Qt223893 -Node: Cancellation226181 -Node: UI Server Protocol228434 -Ref: UI Server Protocol-Footnote-1229865 -Node: UI Server Encrypt229984 -Node: UI Server Sign235244 -Node: UI Server Decrypt237552 -Node: UI Server Verify238990 -Node: UI Server Set Input Files242492 -Node: UI Server Sign/Encrypt Files243292 -Node: UI Server Verify/Decrypt Files245061 -Node: UI Server Import/Export Keys246907 -Node: UI Server Checksum Files247940 -Node: Miscellaneous UI Server Commands250106 -Ref: command SENDER252018 -Node: Debugging253694 -Node: Library Copying255349 -Node: Copying283466 -Node: Function and Data Index321097 -Node: Concept Index346849 +Node: Top1767 +Node: Introduction8876 +Node: Getting Started9663 +Node: Features10788 +Node: Overview11938 +Node: Preparation13047 +Node: Header14044 +Node: Building the Source14743 +Node: Largefile Support (LFS)16852 +Node: Using Automake22163 +Node: Using Libtool23799 +Node: Library Version Check24149 +Node: Signal Handling29167 +Node: Multi Threading30383 +Ref: Multi Threading-Footnote-132565 +Node: Protocols and Engines32979 +Node: Engine Version Check35414 +Node: Engine Information36981 +Node: Engine Configuration40753 +Node: OpenPGP42015 +Node: Cryptographic Message Syntax42351 +Node: Algorithms42645 +Ref: Algorithms-Footnote-143124 +Node: Public Key Algorithms43252 +Node: Hash Algorithms45173 +Node: Error Handling46294 +Node: Error Values48156 +Node: Error Sources53234 +Node: Error Codes55561 +Node: Error Strings60200 +Node: Exchanging Data61979 +Node: Creating Data Buffers63808 +Node: Memory Based Data Buffers64324 +Node: File Based Data Buffers67678 +Node: Callback Based Data Buffers69849 +Node: Destroying Data Buffers75405 +Node: Manipulating Data Buffers76764 +Node: Data Buffer I/O Operations77256 +Node: Data Buffer Meta-Data79959 +Node: Data Buffer Convenience83341 +Node: Contexts85277 +Node: Creating Contexts86459 +Node: Destroying Contexts87270 +Node: Result Management87605 +Node: Context Attributes89011 +Node: Protocol Selection89791 +Node: Crypto Engine90803 +Node: ASCII Armor92624 +Node: Text Mode93236 +Node: Included Certificates94167 +Node: Key Listing Mode95542 +Node: Passphrase Callback98899 +Node: Progress Meter Callback102037 +Node: Locale103961 +Node: Key Management105500 +Node: Listing Keys115688 +Node: Information About Keys122950 +Node: Key Signatures130948 +Node: Manipulating Keys134960 +Node: Generating Keys135802 +Node: Exporting Keys140409 +Node: Importing Keys146308 +Ref: Importing Keys-Footnote-1153471 +Node: Deleting Keys153599 +Node: Changing Passphrases154996 +Node: Advanced Key Editing156257 +Node: Trust Item Management159361 +Node: Listing Trust Items160431 +Node: Information About Trust Items162729 +Node: Manipulating Trust Items164611 +Node: Crypto Operations165572 +Node: Decrypt166818 +Node: Verify170564 +Node: Decrypt and Verify188503 +Node: Sign190507 +Node: Selecting Signers191071 +Node: Creating a Signature192223 +Node: Signature Notation Data196834 +Node: Encrypt199018 +Node: Encrypting a Plaintext199374 +Node: Miscellaneous205873 +Node: Running other Programs206161 +Node: Run Control208138 +Node: Waiting For Completion208881 +Node: Using External Event Loops210927 +Node: I/O Callback Interface212894 +Node: Registering I/O Callbacks218006 +Node: I/O Callback Example219991 +Node: I/O Callback Example GTK+226208 +Node: I/O Callback Example GDK227997 +Node: I/O Callback Example Qt229639 +Node: Cancellation231927 +Node: UI Server Protocol234180 +Ref: UI Server Protocol-Footnote-1235611 +Node: UI Server Encrypt235730 +Node: UI Server Sign240990 +Node: UI Server Decrypt243298 +Node: UI Server Verify244736 +Node: UI Server Set Input Files248238 +Node: UI Server Sign/Encrypt Files249038 +Node: UI Server Verify/Decrypt Files250807 +Node: UI Server Import/Export Keys252653 +Node: UI Server Checksum Files253686 +Node: Miscellaneous UI Server Commands255852 +Ref: command SENDER257764 +Node: Debugging259440 +Node: Library Copying261095 +Node: Copying289212 +Node: Function and Data Index326843 +Node: Concept Index353007  End Tag Table diff --git a/doc/gpgme.info-1 b/doc/gpgme.info-1 index 3e55574..9ce1bc9 100644 --- a/doc/gpgme.info-1 +++ b/doc/gpgme.info-1 @@ -7,7 +7,7 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -22,11 +22,11 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.4. + This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made +Easy' Reference Manual', for Version 1.5.0. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -45,8 +45,8 @@ File: gpgme.info, Node: Top, Next: Introduction, Up: (dir) Main Menu ********* -This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG Made -Easy' Reference Manual', for Version 1.4.4 of the GPGME library. +This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made +Easy' Reference Manual', for Version 1.5.0 of the GPGME library. * Menu: @@ -73,7 +73,6 @@ Indices * Concept Index:: Index of concepts and programs. * Function and Data Index:: Index of functions, variables and data types. - --- The Detailed Node Listing --- Introduction @@ -129,6 +128,7 @@ Manipulating Data Buffers * Data Buffer I/O Operations:: I/O operations on data buffers. * Data Buffer Meta-Data:: Meta-data manipulation of data buffers. +* Data Buffer Convenience:: Convenience function for data buffers. Contexts @@ -139,6 +139,7 @@ Contexts * Key Management:: Managing keys with GPGME. * Trust Item Management:: Managing trust items with GPGME. * Crypto Operations:: Using a context for cryptography. +* Miscellaneous:: Miscellaneous operations. * Run Control:: Controlling how operations are run. Context Attributes @@ -163,6 +164,7 @@ Key Management * Exporting Keys:: Retrieving key data from the key ring. * Importing Keys:: Adding keys to the key ring. * Deleting Keys:: Removing keys from the key ring. +* Changing Passphrases:: Change the passphrase of a key. * Advanced Key Editing:: Advanced key edit operation. Trust Item Management @@ -189,6 +191,10 @@ Encrypt * Encrypting a Plaintext:: How to encrypt a plaintext. +Miscellaneous + +* Running other Programs:: Running other Programs + Run Control * Waiting For Completion:: Waiting until an operation is completed. @@ -587,14 +593,38 @@ File: gpgme.info, Node: Library Version Check, Next: Signal Handling, Prev: U On some systems it is not easy to set environment variables and thus hard to use GPGME's internal trace facility for debugging. This function has been introduced as an alternative way to enable - debugging. It is important to assure that only one thread accesses - GPGME functions between a call to this function and after the - return from the call to `gpgme_check_version'. + debugging and for a couple of other rarely used tweaks. It is + important to assure that only one thread accesses GPGME functions + between a call to this function and after the return from the call + to `gpgme_check_version'. + + All currently supported features require that this function is + called as early as possible -- even before `gpgme_check_version'. + The features are identified by the following values for NAME: + + `"debug"' + To enable debugging use the string "debug" for NAME and VALUE + identical to the value used with the environment variable + `GPGME_DEBUG'. + + `"disable-gpgconf"' + Using this feature with any VALUE disables the detection of + the gpgconf program and thus forces GPGME to fallback into + the simple OpenPGP only mode. It may be used to force the + use of GnuPG-1 on systems which have both GPG versions + installed. Note that in general the use of + `gpgme_set_engine_info' is a better way to select a specific + engine version. + + `"gpgconf-name"' + `"gpg-name"' + Set the name of the gpgconf respective gpg binary. The + defaults are `GNU/GnuPG/gpgconf' and `GNU/GnuPG/gpg'. Under + Unix the leading directory part is ignored. Under Windows + the leading directory part is used as the default + installation directory; the `.exe' suffix is added by GPGME. + Use forward slashed even under Windows. - To enable debugging, you need to call this function as early as - possible -- even before `gpgme_check_version' -- with the string - "debug" for NAME and VALUE identical to the value used with the - environment variable `GPGME_DEBUG'. This function returns `0' on success. In contrast to other functions the non-zero return value on failure does not convey any @@ -746,6 +776,9 @@ hooks and further interfaces. Under development. Please ask on for help. + `GPGME_PROTOCOL_SPAWN' + Special protocol for use with `gpgme_op_spawn'. + `GPGME_PROTOCOL_UNKNOWN' Reserved for future extension. You may use this to indicate that the used protocol is not known to the application. @@ -772,6 +805,37 @@ File: gpgme.info, Node: Engine Version Check, Next: Engine Information, Up: P 3.1 Engine Version Check ======================== + -- Function: const char * gpgme_get_dirinfo (cons char *WHAT) + The function `gpgme_get_dirinfo' returns a statically allocated + string with the value associated to WHAT. The returned values are + the defaults and won't change even after `gpgme_set_engine_info' + has been used to configure a different engine. `NULL' is returned + if no value is available. Commonly supported values for WHAT are: + + `homedir' + Return the default home directory. + + `agent-socket' + Return the name of the socket to connect to the gpg-agent. + + `uiserver-socket' + Return the name of the socket to connect to the user + interface server. + + `gpgconf-name' + Return the file name of the engine configuration tool. + + `gpg-name' + Return the file name of the OpenPGP engine. + + `gpgsm-name' + Return the file name of the CMS engine. + + `g13-name' + Return the name of the file container encryption engine. + + + -- Function: gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t PROTOCOL) The function `gpgme_engine_check_version' verifies that the engine @@ -810,7 +874,8 @@ File: gpgme.info, Node: Engine Information, Next: Engine Configuration, Prev: `const char *home_dir' This is a string holding the directory name of the crypto engine's configuration directory. If it is `NULL', then the - default directory is used. + default directory is used. See `gpgme_get_dirinfo' on how to + get the default directory. `const char *version' This is a string containing the version number of the crypto @@ -979,17 +1044,17 @@ verification of signatures. This value also indicates ElGamal and is used specifically in GnuPG. - `GPGME_PK_ELG_E' - This value also indicates ElGamal and is used specifically in - GnuPG. + `GPGME_PK_ECC' + This value is a generic indicator for ellipic curve + algorithms. `GPGME_PK_ECDSA' This value indicates ECDSA, the Elliptic Curve Digital - Signature Algorithm as defined by FIPS 186-2. + Signature Algorithm as defined by FIPS 186-2 and RFC-6637. `GPGME_PK_ECDH' This value indicates ECDH, the Eliptic Curve Diffie-Hellmann - encryption algorithm as defined by the ECC in OpenPGP draft. + encryption algorithm as defined by RFC-6637. -- Function: const char * gpgme_pubkey_algo_name @@ -1032,6 +1097,8 @@ make it suitable for public key cryptography. `GPGME_MD_SHA512' + `GPGME_MD_SHA224' + `GPGME_MD_MD4' `GPGME_MD_CRC32' @@ -1783,7 +1850,7 @@ be used to manipulate both. * Data Buffer I/O Operations:: I/O operations on data buffers. * Data Buffer Meta-Data:: Meta-data manipulation of data buffers. -* Data Buffer Convenience:: Convenience fucntion for data buffers. +* Data Buffer Convenience:: Convenience function for data buffers.  File: gpgme.info, Node: Data Buffer I/O Operations, Next: Data Buffer Meta-Data, Up: Manipulating Data Buffers @@ -2011,6 +2078,7 @@ configuration. * Key Management:: Managing keys with GPGME. * Trust Item Management:: Managing trust items with GPGME. * Crypto Operations:: Using a context for cryptography. +* Miscellaneous:: Miscellaneous operations * Run Control:: Controlling how operations are run.  @@ -2085,7 +2153,7 @@ File: gpgme.info, Node: Context Attributes, Next: Key Management, Prev: Resul * Crypto Engine:: Configuring the crypto engine. * ASCII Armor:: Requesting ASCII armored output. * Text Mode:: Choosing canonical text mode. -* Included Certificates:: Including a number of certificates. +* Included Certificates:: Including a number of certificates. * Key Listing Mode:: Selecting key listing mode. * Passphrase Callback:: Getting the passphrase from the user. * Progress Meter Callback:: Being informed about the progress. @@ -2540,6 +2608,16 @@ how such keys can be selected and manipulated. This is the expiration timestamp of the subkey, or 0 if the subkey does not expire. + `unsigned int is_cardkey : 1' + True if the secret key is stored on a smart card. + + `char *card_number' + The serial number of a smart card holding this key or `NULL'. + + `char *curve' + For ECC algoritms the name of the curve. + + -- Data type: gpgme_key_sig_t The `gpgme_key_sig_t' type is a pointer to a key signature structure. Key signatures are one component of a `gpgme_key_t' @@ -3930,7 +4008,7 @@ of GPGME. `gpgme_trust_item_unref'.  -File: gpgme.info, Node: Crypto Operations, Next: Run Control, Prev: Trust Item Management, Up: Contexts +File: gpgme.info, Node: Crypto Operations, Next: Miscellaneous, Prev: Trust Item Management, Up: Contexts 7.7 Crypto Operations ===================== @@ -4008,9 +4086,6 @@ File: gpgme.info, Node: Decrypt, Next: Verify, Up: Crypto Operations `gpgme_pubkey_algo_t' The public key algorithm used in the encryption. - `unsigned int wrong_key_usage : 1' - This is true if the key was not used according to its policy. - `char *keyid' This is the key ID of the key (in hexadecimal digits) used as recipient. @@ -4296,6 +4371,9 @@ File: gpgme.info, Node: Verify, Next: Decrypt and Verify, Prev: Decrypt, Up: `gpgme_hash_algo_t' The hash algorithm used to create this signature. + `char *pka_address' + The mailbox from the PKA information or `NULL'. + -- Data type: gpgme_verify_result_t This is a pointer to a structure used to store the result of a `gpgme_op_verify' operation. After verifying a signature, you can @@ -4707,10 +4785,10 @@ File: gpgme.info, Node: Creating a Signature, Next: Signature Notation Data, `gpgme_sig_mode_t type' The type of this signature. - `gpgme_pubkey_algo_t' + `gpgme_pubkey_algo_t pubkey_algo' The public key algorithm used to create this signature. - `gpgme_hash_algo_t' + `gpgme_hash_algo_t hash_algo' The hash algorithm used to create this signature. `unsigned int sig_class' @@ -4848,6 +4926,21 @@ File: gpgme.info, Node: Encrypting a Plaintext, Up: Encrypt crypto backend should be included. This can be useful for managing different user profiles. + `GPGME_ENCRYPT_NO_COMPRESS' + The `GPGME_ENCRYPT_NO_COMPRESS' symbol specifies that the + plaintext shall not be compressed before it is encrypted. + This is in some cases useful if the length of the encrypted + message may reveal information about the plaintext. + + `GPGME_ENCRYPT_PREPARE' + `GPGME_ENCRYPT_EXPECT_SIGN' + The `GPGME_ENCRYPT_PREPARE' symbol is used with the UI Server + protocol to prepare an encryption (i.e. sending the + `PREP_ENCRYPT' command). With the + `GPGME_ENCRYPT_EXPECT_SIGN' symbol the UI Server is advised to + also expect a sign command. + + If `GPG_ERR_UNUSABLE_PUBKEY' is returned, some recipients in RECP are invalid, but not all. In this case the plaintext might be encrypted for all valid recipients and returned in CIPHER (if this @@ -4931,9 +5024,69 @@ File: gpgme.info, Node: Encrypting a Plaintext, Up: Encrypt if CTX, RSET, PLAIN or CIPHER is not a valid pointer.  -File: gpgme.info, Node: Run Control, Prev: Crypto Operations, Up: Contexts +File: gpgme.info, Node: Miscellaneous, Next: Run Control, Prev: Crypto Operations, Up: Contexts + +7.8 Miscellaneous operations +============================ + +Here are some support functions which are sometimes useful. + +* Menu: + +* Running other Programs:: Running other Programs + + +File: gpgme.info, Node: Running other Programs, Up: Miscellaneous + +7.8.1 Running other Programs +---------------------------- + +GPGME features an internal subsystem to run the actual backend engines. +Along with data abstraction object this subsystem can be used to run +arbitrary simple programs which even need not be related to +cryptographic features. It may for example be used to run tools which +are part of the GnuPG system but are not directly accessible with the +GPGME API. + + -- Function: gpgme_error_t gpgme_op_spawn + (gpgme_ctx_t CTX, const char *FILE, + const char *ARGV[], gpgme_data_t DATAIN, + gpgme_data_t DATAOUT, gpgme_data_t DATAERR, + unsigned int FLAGS) + + The function `gpgme_op_spawn' runs the program FILE with the + arguments taken from the NULL terminated array ARGV. If no + arguments are required ARGV may be given as `NULL'. In the latter + case or if `argv[0]' is the empty string, GPGME uses the basename + of FILE for `argv[0]'. The file descriptors `stdin', `stdout', + and `stderr' are connected to the data objects DATAIN, DATAOUT, + and DATAERR. If NULL is passed for one of these data objects the + corresponding file descriptor is connected to `/dev/null'. + + The value in FLAGS is a bitwise-or combination of one or multiple + of the following bit values: + + `GPGME_SPAWN_DETACHED' + Under Windows this flag inhibits the allocation of a new + console for the program. This is useful for a GUI + application which needs to call a command line helper tool. + + `GPGME_SPAWN_ALLOW_SET_FG' + Under Windows this flag allows the called program to put + itself into the foreground. + + -- Function: gpgme_error_t gpgme_op_spawn_start + (gpgme_ctx_t CTX, const char *FILE, + const char *ARGV[], gpgme_data_t DATAIN, + gpgme_data_t DATAOUT, gpgme_data_t DATAERR, + unsigned int FLAGS) + + This is the asynchronous variant of `gpgme_op_spawn'. + + +File: gpgme.info, Node: Run Control, Prev: Miscellaneous, Up: Contexts -7.8 Run Control +7.9 Run Control =============== GPGME supports running operations synchronously and asynchronously. @@ -4953,7 +5106,7 @@ also prevents it from blocking for a long time.  File: gpgme.info, Node: Waiting For Completion, Next: Using External Event Loops, Up: Run Control -7.8.1 Waiting For Completion +7.9.1 Waiting For Completion ---------------------------- -- Function: gpgme_ctx_t gpgme_wait (gpgme_ctx_t CTX, @@ -4996,7 +5149,7 @@ File: gpgme.info, Node: Waiting For Completion, Next: Using External Event Loo  File: gpgme.info, Node: Using External Event Loops, Next: Cancellation, Prev: Waiting For Completion, Up: Run Control -7.8.2 Using External Event Loops +7.9.2 Using External Event Loops -------------------------------- GPGME hides the complexity of the communication between the library and @@ -5034,7 +5187,7 @@ into GUI toolkits like GTK+ even for single-threaded programs.  File: gpgme.info, Node: I/O Callback Interface, Next: Registering I/O Callbacks, Up: Using External Event Loops -7.8.2.1 I/O Callback Interface +7.9.2.1 I/O Callback Interface .............................. -- Data type: gpgme_error_t (*gpgme_io_cb_t) (void *DATA, int FD) @@ -5102,9 +5255,9 @@ int FD, int DIR, gpgme_io_cb_t FNC, void *FNC_DATA, void **TAG) `GPGME_EVENT_DONE' The operation is finished, the last I/O callback for this operation was removed. The accompanying TYPE_DATA points to a - `gpgme_error_t' variable that contains the status of the - operation that finished. This event is signalled after the - last I/O callback has been removed. + `struct gpgme_io_event_done_data' variable that contains the + status of the operation that finished. This event is + signalled after the last I/O callback has been removed. `GPGME_EVENT_NEXT_KEY' In a `gpgme_op_keylist_start' operation, the next key was @@ -5139,10 +5292,10 @@ gpgme_event_io_t TYPE, void *TYPE_DATA)  File: gpgme.info, Node: Registering I/O Callbacks, Next: I/O Callback Example, Prev: I/O Callback Interface, Up: Using External Event Loops -7.8.2.2 Registering I/O Callbacks +7.9.2.2 Registering I/O Callbacks ................................. - -- Data type: struct gpgme_io_cb_ts + -- Data type: struct gpgme_io_cbs This structure is used to store the I/O callback interface functions described in the previous section. It has the following members: @@ -5151,7 +5304,7 @@ File: gpgme.info, Node: Registering I/O Callbacks, Next: I/O Callback Example, This is the function called by GPGME to register an I/O callback handler. It must be specified. - `void *add_data' + `void *add_priv' This is passed as the first argument to the `add' function when it is called by GPGME. For example, it can be used to determine the event loop to which the file descriptor should @@ -5166,13 +5319,13 @@ File: gpgme.info, Node: Registering I/O Callbacks, Next: I/O Callback Example, an operation. It must be specified, because at least the start event must be processed. - `void *event_data' + `void *event_priv' This is passed as the first argument to the `event' function when it is called by GPGME. For example, it can be used to determine the context in which the event has occured. -- Function: void gpgme_set_io_cbs (gpgme_ctx_t CTX, - struct gpgme_io_cb_ts *IO_CBS) + struct gpgme_io_cbs *IO_CBS) The function `gpgme_set_io_cbs' enables the I/O callback interface for the context CTX. The I/O callback functions are specified by IO_CBS. @@ -5181,14 +5334,14 @@ File: gpgme.info, Node: Registering I/O Callbacks, Next: I/O Callback Example, for the context, and normal operation is restored. -- Function: void gpgme_get_io_cbs (gpgme_ctx_t CTX, - struct gpgme_io_cb_ts *IO_CBS) + struct gpgme_io_cbs *IO_CBS) The function `gpgme_get_io_cbs' returns the I/O callback functions set with `gpgme_set_io_cbs' in IO_CBS.  File: gpgme.info, Node: I/O Callback Example, Next: I/O Callback Example GTK+, Prev: Registering I/O Callbacks, Up: Using External Event Loops -7.8.2.3 I/O Callback Example +7.9.2.3 I/O Callback Example ............................ To actually use an external event loop, you have to implement the I/O @@ -5364,7 +5517,7 @@ next. We only support waiting for the success of a single operation. gpgme_error_t err; gpgme_data_t sig, text; int i; - struct gpgme_io_cb_ts io_cbs = + struct gpgme_io_cbs io_cbs = { add_io_cb, &loop, @@ -5420,7 +5573,7 @@ next. We only support waiting for the success of a single operation.  File: gpgme.info, Node: I/O Callback Example GTK+, Next: I/O Callback Example GDK, Prev: I/O Callback Example, Up: Using External Event Loops -7.8.2.4 I/O Callback Example GTK+ +7.9.2.4 I/O Callback Example GTK+ ................................. The I/O callback interface can be used to integrate GPGME with the GTK+ @@ -5472,7 +5625,7 @@ any GTK+ specific setup.  File: gpgme.info, Node: I/O Callback Example GDK, Next: I/O Callback Example Qt, Prev: I/O Callback Example GTK+, Up: Using External Event Loops -7.8.2.5 I/O Callback Example GDK +7.9.2.5 I/O Callback Example GDK ................................ The I/O callback interface can also be used to integrate GPGME with the @@ -5523,7 +5676,7 @@ any GDK specific setup.  File: gpgme.info, Node: I/O Callback Example Qt, Prev: I/O Callback Example GDK, Up: Using External Event Loops -7.8.2.6 I/O Callback Example Qt +7.9.2.6 I/O Callback Example Qt ............................... The I/O callback interface can also be used to integrate GPGME with the @@ -5590,7 +5743,7 @@ any Qt specific setup.  File: gpgme.info, Node: Cancellation, Prev: Using External Event Loops, Up: Run Control -7.8.3 Cancellation +7.9.3 Cancellation ------------------ Sometimes you do not want to wait for an operation to finish. GPGME diff --git a/doc/gpgme.info-2 b/doc/gpgme.info-2 index 68865f6..bb166e3 100644 --- a/doc/gpgme.info-2 +++ b/doc/gpgme.info-2 @@ -7,7 +7,7 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -22,11 +22,11 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.4. + This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made +Easy' Reference Manual', for Version 1.5.0. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, -2013 g10 Code GmbH. +2013, 2014 g10 Code GmbH. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -796,7 +796,7 @@ Function and Data Index (line 10) * enum gpgme_sig_mode_t: Creating a Signature. (line 7) -* enum gpgme_sig_stat_t: Verify. (line 277) +* enum gpgme_sig_stat_t: Verify. (line 280) * FILE: UI Server Set Input Files. (line 10) * GETINFO: Miscellaneous UI Server Commands. @@ -862,13 +862,13 @@ Function and Data Index (line 18) * gpgme_data_write_cb_t: Callback Based Data Buffers. (line 28) -* gpgme_decrypt_result_t: Decrypt. (line 58) +* gpgme_decrypt_result_t: Decrypt. (line 55) * gpgme_edit_cb_t: Advanced Key Editing. (line 8) * gpgme_encrypt_result_t: Encrypting a Plaintext. - (line 76) + (line 91) * gpgme_engine_check_version: Engine Version Check. - (line 8) + (line 39) * gpgme_engine_info_t: Engine Information. (line 7) * gpgme_err_code: Error Values. (line 44) * gpgme_err_code_from_errno: Error Values. (line 101) @@ -897,7 +897,9 @@ Function and Data Index (line 26) * gpgme_genkey_result_t: Generating Keys. (line 75) * gpgme_get_armor: ASCII Armor. (line 14) -* gpgme_get_engine_info: Engine Information. (line 47) +* gpgme_get_dirinfo: Engine Version Check. + (line 7) +* gpgme_get_engine_info: Engine Information. (line 48) * gpgme_get_include_certs: Included Certificates. (line 40) * gpgme_get_io_cbs: Registering I/O Callbacks. @@ -909,13 +911,13 @@ Function and Data Index (line 33) * gpgme_get_protocol: Protocol Selection. (line 22) * gpgme_get_protocol_name: Protocols and Engines. - (line 47) -* gpgme_get_sig_key: Verify. (line 477) -* gpgme_get_sig_status: Verify. (line 326) -* gpgme_get_sig_string_attr: Verify. (line 381) -* gpgme_get_sig_ulong_attr: Verify. (line 415) + (line 50) +* gpgme_get_sig_key: Verify. (line 480) +* gpgme_get_sig_status: Verify. (line 329) +* gpgme_get_sig_string_attr: Verify. (line 384) +* gpgme_get_sig_ulong_attr: Verify. (line 418) * gpgme_get_textmode: Text Mode. (line 21) -* gpgme_hash_algo_name: Hash Algorithms. (line 40) +* gpgme_hash_algo_name: Hash Algorithms. (line 42) * gpgme_hash_algo_t: Hash Algorithms. (line 10) * gpgme_import_result_t: Importing Keys. (line 111) * gpgme_import_status_t: Importing Keys. (line 73) @@ -930,8 +932,8 @@ Function and Data Index * gpgme_key_release: Manipulating Keys. (line 20) * gpgme_key_sig_get_string_attr: Key Signatures. (line 78) * gpgme_key_sig_get_ulong_attr: Key Signatures. (line 92) -* gpgme_key_sig_t: Key Management. (line 82) -* gpgme_key_t: Key Management. (line 190) +* gpgme_key_sig_t: Key Management. (line 92) +* gpgme_key_t: Key Management. (line 200) * gpgme_key_unref: Manipulating Keys. (line 11) * gpgme_keylist_result_t: Listing Keys. (line 125) * gpgme_new: Creating Contexts. (line 7) @@ -943,7 +945,7 @@ Function and Data Index * gpgme_op_card_edit_start: Advanced Key Editing. (line 57) * gpgme_op_decrypt: Decrypt. (line 8) -* gpgme_op_decrypt_result: Decrypt. (line 81) +* gpgme_op_decrypt_result: Decrypt. (line 78) * gpgme_op_decrypt_start: Decrypt. (line 22) * gpgme_op_decrypt_verify: Decrypt and Verify. (line 8) * gpgme_op_delete: Deleting Keys. (line 8) @@ -955,13 +957,13 @@ Function and Data Index * gpgme_op_encrypt: Encrypting a Plaintext. (line 9) * gpgme_op_encrypt_result: Encrypting a Plaintext. - (line 88) + (line 103) * gpgme_op_encrypt_sign: Encrypting a Plaintext. - (line 100) + (line 115) * gpgme_op_encrypt_sign_start: Encrypting a Plaintext. - (line 111) + (line 126) * gpgme_op_encrypt_start: Encrypting a Plaintext. - (line 61) + (line 76) * gpgme_op_export: Exporting Keys. (line 27) * gpgme_op_export_ext: Exporting Keys. (line 58) * gpgme_op_export_ext_start: Exporting Keys. (line 79) @@ -992,11 +994,15 @@ Function and Data Index (line 100) * gpgme_op_sign_start: Creating a Signature. (line 49) +* gpgme_op_spawn: Running other Programs. + (line 14) +* gpgme_op_spawn_start: Running other Programs. + (line 41) * gpgme_op_trustlist_end: Listing Trust Items. (line 45) * gpgme_op_trustlist_next: Listing Trust Items. (line 29) * gpgme_op_trustlist_start: Listing Trust Items. (line 8) * gpgme_op_verify: Verify. (line 9) -* gpgme_op_verify_result: Verify. (line 261) +* gpgme_op_verify_result: Verify. (line 264) * gpgme_op_verify_start: Verify. (line 29) * gpgme_passphrase_cb_t: Passphrase Callback. (line 8) * gpgme_progress_cb_t: Progress Meter Callback. @@ -1039,7 +1045,7 @@ Function and Data Index * gpgme_sig_notation_get: Signature Notation Data. (line 43) * gpgme_sig_notation_t: Verify. (line 39) -* gpgme_sig_stat_t: Verify. (line 277) +* gpgme_sig_stat_t: Verify. (line 280) * gpgme_sign_result_t: Creating a Signature. (line 86) * gpgme_signature_t: Verify. (line 92) @@ -1064,10 +1070,10 @@ Function and Data Index (line 9) * gpgme_trust_item_unref: Manipulating Trust Items. (line 11) -* gpgme_user_id_t: Key Management. (line 155) +* gpgme_user_id_t: Key Management. (line 165) * gpgme_validity_t: Information About Keys. (line 10) -* gpgme_verify_result_t: Verify. (line 245) +* gpgme_verify_result_t: Verify. (line 248) * gpgme_wait: Waiting For Completion. (line 8) * IMPORT_FILES: UI Server Import/Export Keys. @@ -1105,7 +1111,7 @@ Function and Data Index (line 32) * struct gpgme_data_cbs: Callback Based Data Buffers. (line 58) -* struct gpgme_io_cb_ts: Registering I/O Callbacks. +* struct gpgme_io_cbs: Registering I/O Callbacks. (line 7) * VERIFY: UI Server Verify. (line 32) * VERIFY_FILES: UI Server Verify/Decrypt Files. diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 4ec0bfe..e326574 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -1,5 +1,5 @@ -\input texinfo @c -*- mode: texinfo; coding: latin-1; -*- -@documentencoding ISO-8859-1 +\input texinfo @c -*- mode: texinfo; coding: utf-8; -*- +@documentencoding UTF-8 @setfilename gpgme.info @settitle The `GnuPG Made Easy' Reference Manual @@ -14,7 +14,7 @@ @copying Copyright @copyright{} 2002, 2003, 2004, 2005, 2006, 2007, -2008, 2010, 2012, 2013 g10 Code GmbH. +2008, 2010, 2012, 2013, 2014 g10 Code GmbH. @quotation Permission is granted to copy, distribute and/or modify this document @@ -72,7 +72,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED}, of @center for version @value{VERSION} @page @vskip 0pt plus 1filll -Published by g10 Code GmbH@* Hüttenstr. 61@* 40699 Erkrath, Germany +Published by g10 Code GmbH@* Hüttenstr. 61@* 40699 Erkrath, Germany @insertcopying @end titlepage @@ -113,7 +113,6 @@ Indices * Concept Index:: Index of concepts and programs. * Function and Data Index:: Index of functions, variables and data types. - @detailmenu --- The Detailed Node Listing --- @@ -170,6 +169,7 @@ Manipulating Data Buffers * Data Buffer I/O Operations:: I/O operations on data buffers. * Data Buffer Meta-Data:: Meta-data manipulation of data buffers. +* Data Buffer Convenience:: Convenience function for data buffers. Contexts @@ -180,6 +180,7 @@ Contexts * Key Management:: Managing keys with @acronym{GPGME}. * Trust Item Management:: Managing trust items with @acronym{GPGME}. * Crypto Operations:: Using a context for cryptography. +* Miscellaneous:: Miscellaneous operations. * Run Control:: Controlling how operations are run. Context Attributes @@ -204,6 +205,7 @@ Key Management * Exporting Keys:: Retrieving key data from the key ring. * Importing Keys:: Adding keys to the key ring. * Deleting Keys:: Removing keys from the key ring. +* Changing Passphrases:: Change the passphrase of a key. * Advanced Key Editing:: Advanced key edit operation. Trust Item Management @@ -230,6 +232,10 @@ Encrypt * Encrypting a Plaintext:: How to encrypt a plaintext. +Miscellaneous + +* Running other Programs:: Running other Programs + Run Control * Waiting For Completion:: Waiting until an operation is completed. @@ -648,14 +654,39 @@ does not return a detailed error code). On some systems it is not easy to set environment variables and thus hard to use @acronym{GPGME}'s internal trace facility for debugging. This function has been introduced as an alternative way to enable -debugging. It is important to assure that only one thread accesses -@acronym{GPGME} functions between a call to this function and after -the return from the call to @code{gpgme_check_version}. +debugging and for a couple of other rarely used tweaks. It is +important to assure that only one thread accesses @acronym{GPGME} +functions between a call to this function and after the return from +the call to @code{gpgme_check_version}. -To enable debugging, you need to call this function as early as -possible --- even before @code{gpgme_check_version} --- with the -string ``debug'' for @var{name} and @var{value} identical to the value -used with the environment variable @code{GPGME_DEBUG}. +All currently supported features require that this function is called +as early as possible --- even before @code{gpgme_check_version}. The +features are identified by the following values for @var{name}: + +@table @code +@item "debug" +To enable debugging use the string ``debug'' for @var{name} and +@var{value} identical to the value used with the environment variable +@code{GPGME_DEBUG}. + +@item "disable-gpgconf" +Using this feature with any @var{value} disables the detection of the +gpgconf program and thus forces GPGME to fallback into the simple +OpenPGP only mode. It may be used to force the use of GnuPG-1 on +systems which have both GPG versions installed. Note that in general +the use of @code{gpgme_set_engine_info} is a better way to select a +specific engine version. + +@item "gpgconf-name" +@itemx "gpg-name" +Set the name of the gpgconf respective gpg binary. The defaults are +@code{GNU/GnuPG/gpgconf} and @code{GNU/GnuPG/gpg}. Under Unix the +leading directory part is ignored. Under Windows the leading +directory part is used as the default installation directory; the +@code{.exe} suffix is added by GPGME. Use forward slashed even under +Windows. + +@end table This function returns @code{0} on success. In contrast to other functions the non-zero return value on failure does not convey any @@ -825,6 +856,9 @@ Under development. Please ask on @email{gnupg-devel@@gnupg.org} for help. @item GPGME_PROTOCOL_UISERVER Under development. Please ask on @email{gnupg-devel@@gnupg.org} for help. +@item GPGME_PROTOCOL_SPAWN +Special protocol for use with @code{gpgme_op_spawn}. + @item GPGME_PROTOCOL_UNKNOWN Reserved for future extension. You may use this to indicate that the used protocol is not known to the application. Currently, @@ -853,6 +887,41 @@ allocated string describing the protocol @var{protocol}, or @section Engine Version Check @cindex version check, of the engines +@deftypefun @w{const char *} gpgme_get_dirinfo (@w{cons char *@var{what}}) +The function @code{gpgme_get_dirinfo} returns a statically allocated +string with the value associated to @var{what}. The returned values +are the defaults and won't change even after +@code{gpgme_set_engine_info} has been used to configure a different +engine. @code{NULL} is returned if no value is available. Commonly +supported values for @var{what} are: + +@table @code +@item homedir +Return the default home directory. + +@item agent-socket +Return the name of the socket to connect to the gpg-agent. + +@item uiserver-socket +Return the name of the socket to connect to the user interface server. + +@item gpgconf-name +Return the file name of the engine configuration tool. + +@item gpg-name +Return the file name of the OpenPGP engine. + +@item gpgsm-name +Return the file name of the CMS engine. + +@item g13-name +Return the name of the file container encryption engine. + +@end table + +@end deftypefun + + @deftypefun gpgme_error_t gpgme_engine_check_version (@w{gpgme_protocol_t @var{protocol}}) The function @code{gpgme_engine_check_version} verifies that the engine implementing the protocol @var{PROTOCOL} is installed in the @@ -891,7 +960,8 @@ reserved for future use, so always check before you use it. @item const char *home_dir This is a string holding the directory name of the crypto engine's configuration directory. If it is @code{NULL}, then the default -directory is used. +directory is used. See @code{gpgme_get_dirinfo} on how to get the +default directory. @item const char *version This is a string containing the version number of the crypto engine. @@ -1065,16 +1135,16 @@ This value indicates ElGamal. @item GPGME_PK_ELG_E This value also indicates ElGamal and is used specifically in GnuPG. -@item GPGME_PK_ELG_E -This value also indicates ElGamal and is used specifically in GnuPG. +@item GPGME_PK_ECC +This value is a generic indicator for ellipic curve algorithms. @item GPGME_PK_ECDSA This value indicates ECDSA, the Elliptic Curve Digital Signature -Algorithm as defined by FIPS 186-2. +Algorithm as defined by FIPS 186-2 and RFC-6637. @item GPGME_PK_ECDH -This value indicates ECDH, the Eliptic Curve Diffie-Hellmann encryption -algorithm as defined by the ECC in OpenPGP draft. +This value indicates ECDH, the Eliptic Curve Diffie-Hellmann +encryption algorithm as defined by RFC-6637. @end table @end deftp @@ -1115,6 +1185,7 @@ that are supported by @acronym{GPGME}. Possible values are: @item GPGME_MD_SHA256 @item GPGME_MD_SHA384 @item GPGME_MD_SHA512 +@item GPGME_MD_SHA224 @item GPGME_MD_MD4 @item GPGME_MD_CRC32 @item GPGME_MD_CRC32_RFC1510 @@ -1885,7 +1956,7 @@ be used to manipulate both. @menu * Data Buffer I/O Operations:: I/O operations on data buffers. * Data Buffer Meta-Data:: Meta-data manipulation of data buffers. -* Data Buffer Convenience:: Convenience fucntion for data buffers. +* Data Buffer Convenience:: Convenience function for data buffers. @end menu @@ -2126,6 +2197,7 @@ cryptographic operations. * Key Management:: Managing keys with @acronym{GPGME}. * Trust Item Management:: Managing trust items with @acronym{GPGME}. * Crypto Operations:: Using a context for cryptography. +* Miscellaneous:: Miscellaneous operations * Run Control:: Controlling how operations are run. @end menu @@ -2200,7 +2272,7 @@ started. In fact, these references are accessed through the * Crypto Engine:: Configuring the crypto engine. * ASCII Armor:: Requesting @acronym{ASCII} armored output. * Text Mode:: Choosing canonical text mode. -* Included Certificates:: Including a number of certificates. +* Included Certificates:: Including a number of certificates. * Key Listing Mode:: Selecting key listing mode. * Passphrase Callback:: Getting the passphrase from the user. * Progress Meter Callback:: Being informed about the progress. @@ -2664,6 +2736,16 @@ timestamp is invalid, and 0 if it is not available. @item long int expires This is the expiration timestamp of the subkey, or 0 if the subkey does not expire. + +@item unsigned int is_cardkey : 1 +True if the secret key is stored on a smart card. + +@item char *card_number +The serial number of a smart card holding this key or @code{NULL}. + +@item char *curve +For ECC algoritms the name of the curve. + @end table @end deftp @@ -4188,9 +4270,6 @@ or @code{NULL} if this is the last element. @item gpgme_pubkey_algo_t The public key algorithm used in the encryption. -@item unsigned int wrong_key_usage : 1 -This is true if the key was not used according to its policy. - @item char *keyid This is the key ID of the key (in hexadecimal digits) used as recipient. @@ -4484,6 +4563,9 @@ The public key algorithm used to create this signature. @item gpgme_hash_algo_t The hash algorithm used to create this signature. + +@item char *pka_address +The mailbox from the PKA information or @code{NULL}. @end table @end deftp @@ -4920,10 +5002,10 @@ list, or @code{NULL} if this is the last element. @item gpgme_sig_mode_t type The type of this signature. -@item gpgme_pubkey_algo_t +@item gpgme_pubkey_algo_t pubkey_algo The public key algorithm used to create this signature. -@item gpgme_hash_algo_t +@item gpgme_hash_algo_t hash_algo The hash algorithm used to create this signature. @item unsigned int sig_class @@ -5064,6 +5146,21 @@ The @code{GPGME_ENCRYPT_NO_ENCRYPT_TO} symbol specifies that no default or hidden default recipients as configured in the crypto backend should be included. This can be useful for managing different user profiles. + +@item GPGME_ENCRYPT_NO_COMPRESS +The @code{GPGME_ENCRYPT_NO_COMPRESS} symbol specifies that the +plaintext shall not be compressed before it is encrypted. This is +in some cases useful if the length of the encrypted message +may reveal information about the plaintext. + +@item GPGME_ENCRYPT_PREPARE +@itemx GPGME_ENCRYPT_EXPECT_SIGN +The @code{GPGME_ENCRYPT_PREPARE} symbol is used with the UI Server +protocol to prepare an encryption (i.e. sending the +@code{PREP_ENCRYPT} command). With the +@code{GPGME_ENCRYPT_EXPECT_SIGN} symbol the UI Server is advised to +also expect a sign command. + @end table If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in @@ -5155,6 +5252,67 @@ pointer. @end deftypefun +@node Miscellaneous +@section Miscellaneous operations + +Here are some support functions which are sometimes useful. + +@menu +* Running other Programs:: Running other Programs +@end menu + + +@node Running other Programs +@subsection Running other Programs + +GPGME features an internal subsystem to run the actual backend +engines. Along with data abstraction object this subsystem can be +used to run arbitrary simple programs which even need not be related +to cryptographic features. It may for example be used to run tools +which are part of the GnuPG system but are not directly accessible +with the GPGME API. + + +@deftypefun gpgme_error_t gpgme_op_spawn + (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{file}}, @ + @w{const char *@var{argv}[]}, @w{gpgme_data_t @var{datain}}, @ + @w{gpgme_data_t @var{dataout}}, @w{gpgme_data_t @var{dataerr}}, @ + @w{unsigned int @var{flags}}) + +The function @code{gpgme_op_spawn} runs the program @var{file} with +the arguments taken from the NULL terminated array @var{argv}. If no +arguments are required @var{argv} may be given as @code{NULL}. In the +latter case or if @code{argv[0]} is the empty string, GPGME uses the +basename of @var{file} for @code{argv[0]}. The file descriptors +@code{stdin}, @code{stdout}, and @code{stderr} are connected to the +data objects @var{datain}, @var{dataout}, and @var{dataerr}. If NULL +is passed for one of these data objects the corresponding file +descriptor is connected to @file{/dev/null}. + +The value in @var{flags} is a bitwise-or combination of one or +multiple of the following bit values: + +@table @code +@item GPGME_SPAWN_DETACHED +Under Windows this flag inhibits the allocation of a new console for +the program. This is useful for a GUI application which needs to call +a command line helper tool. +@item GPGME_SPAWN_ALLOW_SET_FG +Under Windows this flag allows the called program to put itself into +the foreground. +@end table +@end deftypefun + +@deftypefun gpgme_error_t gpgme_op_spawn_start + (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{file}}, @ + @w{const char *@var{argv}[]}, @w{gpgme_data_t @var{datain}}, @ + @w{gpgme_data_t @var{dataout}}, @w{gpgme_data_t @var{dataerr}}, @ + @w{unsigned int @var{flags}}) + +This is the asynchronous variant of @code{gpgme_op_spawn}. +@end deftypefun + + @node Run Control @section Run Control @cindex run control @@ -5335,9 +5493,9 @@ callback handlers must not be run before this event is signalled. @item GPGME_EVENT_DONE The operation is finished, the last I/O callback for this operation was removed. The accompanying @var{type_data} points to a -@code{gpgme_error_t} variable that contains the status of the operation -that finished. This event is signalled after the last I/O callback -has been removed. +@code{struct gpgme_io_event_done_data} variable that contains the +status of the operation that finished. This event is signalled after +the last I/O callback has been removed. @item GPGME_EVENT_NEXT_KEY In a @code{gpgme_op_keylist_start} operation, the next key was @@ -5375,7 +5533,7 @@ list of possible @code{gpgme_event_io_t} types. @node Registering I/O Callbacks @subsubsection Registering I/O Callbacks -@deftp {Data type} {struct gpgme_io_cb_ts} +@deftp {Data type} {struct gpgme_io_cbs} @tindex gpgme_event_io_t This structure is used to store the I/O callback interface functions described in the previous section. It has the following members: @@ -5385,7 +5543,7 @@ described in the previous section. It has the following members: This is the function called by @acronym{GPGME} to register an I/O callback handler. It must be specified. -@item void *add_data +@item void *add_priv This is passed as the first argument to the @code{add} function when it is called by @acronym{GPGME}. For example, it can be used to determine the event loop to which the file descriptor should be added. @@ -5399,14 +5557,14 @@ This is the function called by @acronym{GPGME} to signal an event for an operation. It must be specified, because at least the start event must be processed. -@item void *event_data +@item void *event_priv This is passed as the first argument to the @code{event} function when it is called by @acronym{GPGME}. For example, it can be used to determine the context in which the event has occured. @end table @end deftp -@deftypefun void gpgme_set_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cb_ts *@var{io_cbs}}) +@deftypefun void gpgme_set_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cbs *@var{io_cbs}}) The function @code{gpgme_set_io_cbs} enables the I/O callback interface for the context @var{ctx}. The I/O callback functions are specified by @var{io_cbs}. @@ -5415,7 +5573,7 @@ If @var{io_cbs}->@code{add} is @code{NULL}, the I/O callback interface is disabled for the context, and normal operation is restored. @end deftypefun -@deftypefun void gpgme_get_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cb_ts *@var{io_cbs}}) +@deftypefun void gpgme_get_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cbs *@var{io_cbs}}) The function @code{gpgme_get_io_cbs} returns the I/O callback functions set with @code{gpgme_set_io_cbs} in @var{io_cbs}. @end deftypefun @@ -5605,7 +5763,7 @@ main (int argc, char *argv[]) gpgme_error_t err; gpgme_data_t sig, text; int i; - struct gpgme_io_cb_ts io_cbs = + struct gpgme_io_cbs io_cbs = @{ add_io_cb, &loop, diff --git a/doc/stamp-vti b/doc/stamp-vti index ad6475e..66f8204 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 30 July 2014 -@set UPDATED-MONTH July 2014 -@set EDITION 1.4.4 -@set VERSION 1.4.4 +@set UPDATED 8 May 2014 +@set UPDATED-MONTH May 2014 +@set EDITION 1.5.0 +@set VERSION 1.5.0 diff --git a/doc/version.texi b/doc/version.texi index ad6475e..66f8204 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 30 July 2014 -@set UPDATED-MONTH July 2014 -@set EDITION 1.4.4 -@set VERSION 1.4.4 +@set UPDATED 8 May 2014 +@set UPDATED-MONTH May 2014 +@set EDITION 1.5.0 +@set VERSION 1.5.0 diff --git a/gpgme.spec b/gpgme.spec index 4c3cff0..335ba14 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,7 +1,7 @@ # This is a template. The dist target uses it to create the real file. Summary: GPGME - GnuPG Made Easy Name: gpgme -Version: 1.4.4 +Version: 1.5.0 Release: 1 URL: http://www.gnupg.org/gpgme.html Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz diff --git a/lang/Makefile.in b/lang/Makefile.in index e7eec0b..e231395 100644 --- a/lang/Makefile.in +++ b/lang/Makefile.in @@ -85,6 +85,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -135,6 +141,7 @@ am__relativize = \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -165,7 +172,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -173,17 +179,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/lang/cl/Makefile.in b/lang/cl/Makefile.in index ba5b891..91b0ea7 100644 --- a/lang/cl/Makefile.in +++ b/lang/cl/Makefile.in @@ -88,6 +88,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = gpgme.asd CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -127,6 +133,7 @@ DATA = $(dist_clfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -157,7 +164,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -165,17 +171,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/lang/cl/gpgme.asd b/lang/cl/gpgme.asd index c6c2079..53bd37b 100644 --- a/lang/cl/gpgme.asd +++ b/lang/cl/gpgme.asd @@ -27,7 +27,7 @@ (defsystem gpgme :description "GnuPG Made Easy." :author "g10 Code GmbH" - :version "1.4.4" + :version "1.5.0" :licence "GPL" :depends-on ("cffi" "gpg-error") :components ((:file "gpgme-package") diff --git a/src/Makefile.am b/src/Makefile.am index 1f95103..82f5327 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,30 +66,6 @@ if HAVE_W32CE_SYSTEM system_components += w32-ce.h w32-ce.c endif -if HAVE_GPGSM -gpgsm_components = engine-gpgsm.c -else -gpgsm_components = -endif - -if HAVE_ASSUAN -assuan_components = assuan-support.c engine-assuan.c -else -assuan_components = -endif - -if HAVE_GPGCONF -gpgconf_components = engine-gpgconf.c -else -gpgconf_components = -endif - -if HAVE_G13 -g13_components = engine-g13.c -else -g13_components = -endif - if HAVE_UISERVER uiserver_components = engine-uiserver.c else @@ -113,11 +89,12 @@ main_sources = \ sign.c passphrase.c progress.c \ key.c keylist.c trust-item.c trustlist.c \ import.c export.c genkey.c delete.c edit.c getauditlog.c \ - opassuan.c passwd.c \ + opassuan.c passwd.c spawn.c assuan-support.c \ engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ - $(gpgsm_components) $(assuan_components) $(gpgconf_components) \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ $(uiserver_components) \ - $(g13_components) vfs-mount.c vfs-create.c \ + engine-g13.c vfs-mount.c vfs-create.c \ + engine-spawn.c \ gpgconf.c \ sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \ debug.c debug.h gpgme.c version.c error.c diff --git a/src/Makefile.in b/src/Makefile.in index 145e234..cd55a3f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -135,25 +135,21 @@ am__libgpgme_glib_la_SOURCES_DIST = util.h conversion.c get-env.c \ encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \ passphrase.c progress.c key.c keylist.c trust-item.c \ trustlist.c import.c export.c genkey.c delete.c edit.c \ - getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \ - engine.c engine-gpg.c status-table.c engine-gpgsm.c \ - assuan-support.c engine-assuan.c engine-gpgconf.c \ + getauditlog.c opassuan.c passwd.c spawn.c assuan-support.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \ - gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \ - posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \ - dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \ - w32-glib-io.c -@HAVE_GPGSM_TRUE@am__objects_1 = engine-gpgsm.lo -@HAVE_ASSUAN_TRUE@am__objects_2 = assuan-support.lo engine-assuan.lo -@HAVE_GPGCONF_TRUE@am__objects_3 = engine-gpgconf.lo -@HAVE_UISERVER_TRUE@am__objects_4 = engine-uiserver.lo -@HAVE_G13_TRUE@am__objects_5 = engine-g13.lo -@HAVE_W32CE_SYSTEM_TRUE@am__objects_6 = w32-ce.lo -@HAVE_DOSISH_SYSTEM_FALSE@am__objects_7 = posix-util.lo posix-sema.lo \ -@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo $(am__objects_6) -@HAVE_DOSISH_SYSTEM_TRUE@am__objects_7 = w32-util.lo w32-sema.lo \ -@HAVE_DOSISH_SYSTEM_TRUE@ $(am__objects_6) -am__objects_8 = conversion.lo get-env.lo parsetlv.lo data.lo \ + engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ + posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \ + w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath.c w32-glib-io.c +@HAVE_UISERVER_TRUE@am__objects_1 = engine-uiserver.lo +@HAVE_W32CE_SYSTEM_TRUE@am__objects_2 = w32-ce.lo +@HAVE_DOSISH_SYSTEM_FALSE@am__objects_3 = posix-util.lo posix-sema.lo \ +@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo $(am__objects_2) +@HAVE_DOSISH_SYSTEM_TRUE@am__objects_3 = w32-util.lo w32-sema.lo \ +@HAVE_DOSISH_SYSTEM_TRUE@ $(am__objects_2) +am__objects_4 = conversion.lo get-env.lo parsetlv.lo data.lo \ data-fd.lo data-stream.lo data-mem.lo data-user.lo \ data-compat.lo data-identify.lo signers.lo sig-notation.lo \ wait.lo wait-global.lo wait-private.lo wait-user.lo \ @@ -161,17 +157,21 @@ am__objects_8 = conversion.lo get-env.lo parsetlv.lo data.lo \ decrypt-verify.lo verify.lo sign.lo passphrase.lo progress.lo \ key.lo keylist.lo trust-item.lo trustlist.lo import.lo \ export.lo genkey.lo delete.lo edit.lo getauditlog.lo \ - opassuan.lo passwd.lo engine.lo engine-gpg.lo status-table.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) \ - $(am__objects_4) $(am__objects_5) vfs-mount.lo vfs-create.lo \ - gpgconf.lo $(am__objects_7) dirinfo.lo debug.lo gpgme.lo \ - version.lo error.lo -@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_8) \ + opassuan.lo passwd.lo spawn.lo assuan-support.lo engine.lo \ + engine-gpg.lo status-table.lo engine-gpgsm.lo engine-assuan.lo \ + engine-gpgconf.lo $(am__objects_1) engine-g13.lo vfs-mount.lo \ + vfs-create.lo engine-spawn.lo gpgconf.lo $(am__objects_3) \ + dirinfo.lo debug.lo gpgme.lo version.lo error.lo +@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_4) \ @BUILD_W32_GLIB_TRUE@ ath.lo w32-glib-io.lo libgpgme_glib_la_OBJECTS = $(am_libgpgme_glib_la_OBJECTS) -libgpgme_glib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +libgpgme_glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) \ + -o $@ @BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_rpath = -rpath $(libdir) am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c get-env.c \ context.h ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \ @@ -181,21 +181,22 @@ am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c get-env.c \ encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \ passphrase.c progress.c key.c keylist.c trust-item.c \ trustlist.c import.c export.c genkey.c delete.c edit.c \ - getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \ - engine.c engine-gpg.c status-table.c engine-gpgsm.c \ - assuan-support.c engine-assuan.c engine-gpgconf.c \ + getauditlog.c opassuan.c passwd.c spawn.c assuan-support.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \ - gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \ - posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \ - dirinfo.c debug.c debug.h gpgme.c version.c error.c \ - ath-pthread.c w32-io.c -@HAVE_DOSISH_SYSTEM_TRUE@am__objects_9 = w32-io.lo -am_libgpgme_pthread_la_OBJECTS = $(am__objects_8) ath-pthread.lo \ - $(am__objects_9) + engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ + posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \ + w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath-pthread.c w32-io.c +@HAVE_DOSISH_SYSTEM_TRUE@am__objects_5 = w32-io.lo +am_libgpgme_pthread_la_OBJECTS = $(am__objects_4) ath-pthread.lo \ + $(am__objects_5) libgpgme_pthread_la_OBJECTS = $(am_libgpgme_pthread_la_OBJECTS) -libgpgme_pthread_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libgpgme_pthread_la_LDFLAGS) $(LDFLAGS) -o $@ +libgpgme_pthread_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgpgme_pthread_la_LDFLAGS) \ + $(LDFLAGS) -o $@ @HAVE_PTHREAD_TRUE@am_libgpgme_pthread_la_rpath = -rpath $(libdir) am__libgpgme_qt_la_SOURCES_DIST = util.h conversion.c get-env.c \ context.h ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \ @@ -205,21 +206,22 @@ am__libgpgme_qt_la_SOURCES_DIST = util.h conversion.c get-env.c \ encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \ passphrase.c progress.c key.c keylist.c trust-item.c \ trustlist.c import.c export.c genkey.c delete.c edit.c \ - getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \ - engine.c engine-gpg.c status-table.c engine-gpgsm.c \ - assuan-support.c engine-assuan.c engine-gpgconf.c \ + getauditlog.c opassuan.c passwd.c spawn.c assuan-support.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \ - gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \ - posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \ - dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \ - w32-qt-io.cpp kdpipeiodevice.h kdpipeiodevice.cpp \ - kdpipeiodevice.moc -@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_OBJECTS = $(am__objects_8) ath.lo \ + engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ + posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \ + w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath.c w32-qt-io.cpp kdpipeiodevice.h \ + kdpipeiodevice.cpp kdpipeiodevice.moc +@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_OBJECTS = $(am__objects_4) ath.lo \ @BUILD_W32_QT_TRUE@ w32-qt-io.lo kdpipeiodevice.lo libgpgme_qt_la_OBJECTS = $(am_libgpgme_qt_la_OBJECTS) -libgpgme_qt_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(libgpgme_qt_la_LDFLAGS) $(LDFLAGS) -o $@ +libgpgme_qt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(libgpgme_qt_la_LDFLAGS) \ + $(LDFLAGS) -o $@ @BUILD_W32_QT_TRUE@am_libgpgme_qt_la_rpath = -rpath $(libdir) am__libgpgme_la_SOURCES_DIST = util.h conversion.c get-env.c context.h \ ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \ @@ -229,17 +231,17 @@ am__libgpgme_la_SOURCES_DIST = util.h conversion.c get-env.c context.h \ encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \ passphrase.c progress.c key.c keylist.c trust-item.c \ trustlist.c import.c export.c genkey.c delete.c edit.c \ - getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \ - engine.c engine-gpg.c status-table.c engine-gpgsm.c \ - assuan-support.c engine-assuan.c engine-gpgconf.c \ + getauditlog.c opassuan.c passwd.c spawn.c assuan-support.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \ - gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \ - posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \ - dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \ - w32-io.c -am_libgpgme_la_OBJECTS = $(am__objects_8) ath.lo $(am__objects_9) + engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ + posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \ + w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath.c w32-io.c +am_libgpgme_la_OBJECTS = $(am__objects_4) ath.lo $(am__objects_5) libgpgme_la_OBJECTS = $(am_libgpgme_la_OBJECTS) -libgpgme_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +libgpgme_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgpgme_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) @@ -256,22 +258,42 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libgpgme_glib_la_SOURCES) $(libgpgme_pthread_la_SOURCES) \ $(libgpgme_qt_la_SOURCES) $(libgpgme_la_SOURCES) gpgme-tool.c \ gpgme-w32spawn.c @@ -291,6 +313,7 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -321,7 +344,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -329,17 +351,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -473,14 +491,6 @@ lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \ @HAVE_DOSISH_SYSTEM_TRUE@ $(am__append_1) @HAVE_DOSISH_SYSTEM_FALSE@system_components_not_extra = @HAVE_DOSISH_SYSTEM_TRUE@system_components_not_extra = w32-io.c -@HAVE_GPGSM_FALSE@gpgsm_components = -@HAVE_GPGSM_TRUE@gpgsm_components = engine-gpgsm.c -@HAVE_ASSUAN_FALSE@assuan_components = -@HAVE_ASSUAN_TRUE@assuan_components = assuan-support.c engine-assuan.c -@HAVE_GPGCONF_FALSE@gpgconf_components = -@HAVE_GPGCONF_TRUE@gpgconf_components = engine-gpgconf.c -@HAVE_G13_FALSE@g13_components = -@HAVE_G13_TRUE@g13_components = engine-g13.c @HAVE_UISERVER_FALSE@uiserver_components = @HAVE_UISERVER_TRUE@uiserver_components = engine-uiserver.c @@ -501,11 +511,12 @@ main_sources = \ sign.c passphrase.c progress.c \ key.c keylist.c trust-item.c trustlist.c \ import.c export.c genkey.c delete.c edit.c getauditlog.c \ - opassuan.c passwd.c \ + opassuan.c passwd.c spawn.c assuan-support.c \ engine.h engine-backend.h engine.c engine-gpg.c status-table.c \ - $(gpgsm_components) $(assuan_components) $(gpgconf_components) \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c \ $(uiserver_components) \ - $(g13_components) vfs-mount.c vfs-create.c \ + engine-g13.c vfs-mount.c vfs-create.c \ + engine-spawn.c \ gpgconf.c \ sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \ debug.c debug.h gpgme.c version.c error.c @@ -652,13 +663,13 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libgpgme-glib.la: $(libgpgme_glib_la_OBJECTS) $(libgpgme_glib_la_DEPENDENCIES) $(EXTRA_libgpgme_glib_la_DEPENDENCIES) - $(libgpgme_glib_la_LINK) $(am_libgpgme_glib_la_rpath) $(libgpgme_glib_la_OBJECTS) $(libgpgme_glib_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libgpgme_glib_la_LINK) $(am_libgpgme_glib_la_rpath) $(libgpgme_glib_la_OBJECTS) $(libgpgme_glib_la_LIBADD) $(LIBS) libgpgme-pthread.la: $(libgpgme_pthread_la_OBJECTS) $(libgpgme_pthread_la_DEPENDENCIES) $(EXTRA_libgpgme_pthread_la_DEPENDENCIES) - $(libgpgme_pthread_la_LINK) $(am_libgpgme_pthread_la_rpath) $(libgpgme_pthread_la_OBJECTS) $(libgpgme_pthread_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libgpgme_pthread_la_LINK) $(am_libgpgme_pthread_la_rpath) $(libgpgme_pthread_la_OBJECTS) $(libgpgme_pthread_la_LIBADD) $(LIBS) libgpgme-qt.la: $(libgpgme_qt_la_OBJECTS) $(libgpgme_qt_la_DEPENDENCIES) $(EXTRA_libgpgme_qt_la_DEPENDENCIES) - $(libgpgme_qt_la_LINK) $(am_libgpgme_qt_la_rpath) $(libgpgme_qt_la_OBJECTS) $(libgpgme_qt_la_LIBADD) $(LIBS) + $(AM_V_CXXLD)$(libgpgme_qt_la_LINK) $(am_libgpgme_qt_la_rpath) $(libgpgme_qt_la_OBJECTS) $(libgpgme_qt_la_LIBADD) $(LIBS) libgpgme.la: $(libgpgme_la_OBJECTS) $(libgpgme_la_DEPENDENCIES) $(EXTRA_libgpgme_la_DEPENDENCIES) - $(libgpgme_la_LINK) -rpath $(libdir) $(libgpgme_la_OBJECTS) $(libgpgme_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libgpgme_la_LINK) -rpath $(libdir) $(libgpgme_la_OBJECTS) $(libgpgme_la_LIBADD) $(LIBS) install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ @@ -716,10 +727,10 @@ clean-noinstPROGRAMS: rm -f $$list gpgme-tool$(EXEEXT): $(gpgme_tool_OBJECTS) $(gpgme_tool_DEPENDENCIES) $(EXTRA_gpgme_tool_DEPENDENCIES) @rm -f gpgme-tool$(EXEEXT) - $(LINK) $(gpgme_tool_OBJECTS) $(gpgme_tool_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(gpgme_tool_OBJECTS) $(gpgme_tool_LDADD) $(LIBS) gpgme-w32spawn$(EXEEXT): $(gpgme_w32spawn_OBJECTS) $(gpgme_w32spawn_DEPENDENCIES) $(EXTRA_gpgme_w32spawn_DEPENDENCIES) @rm -f gpgme-w32spawn$(EXEEXT) - $(LINK) $(gpgme_w32spawn_OBJECTS) $(gpgme_w32spawn_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(gpgme_w32spawn_OBJECTS) $(gpgme_w32spawn_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ @@ -791,6 +802,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpgconf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpgsm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-spawn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-uiserver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @@ -818,6 +830,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-notation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status-table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-item.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trustlist.Plo@am__quote@ @@ -837,46 +850,46 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/src/assuan-support.c b/src/assuan-support.c index d06518a..0a11d9f 100644 --- a/src/assuan-support.c +++ b/src/assuan-support.c @@ -168,7 +168,8 @@ my_spawn (assuan_context_t ctx, pid_t *r_pid, const char *name, fd_items[i].fd = -1; fd_items[i].dup_to = -1; - err = _gpgme_io_spawn (name, (char*const*)argv, IOSPAWN_FLAG_NOCLOSE, + err = _gpgme_io_spawn (name, (char*const*)argv, + (IOSPAWN_FLAG_NOCLOSE | IOSPAWN_FLAG_DETACHED), fd_items, atfork, atforkvalue, r_pid); if (! err) { diff --git a/src/conversion.c b/src/conversion.c index b47d6de..d04a6be 100644 --- a/src/conversion.c +++ b/src/conversion.c @@ -412,3 +412,24 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp) else return (time_t)strtoul (timestamp, endp, 10); } + + +/* The GPG backend uses OpenPGP algorithm numbers which we need to map + to our algorithm numbers. This function MUST not change ERRNO. */ +int +_gpgme_map_pk_algo (int algo, gpgme_protocol_t protocol) +{ + if (protocol == GPGME_PROTOCOL_OPENPGP) + { + switch (algo) + { + case 1: case 2: case 3: case 16: case 17: break; + case 18: algo = GPGME_PK_ECDH; break; + case 19: algo = GPGME_PK_ECDSA; break; + case 20: break; + default: algo = 0; break; /* Unknown. */ + } + } + + return algo; +} diff --git a/src/decrypt.c b/src/decrypt.c index 63787c7..4742060 100644 --- a/src/decrypt.c +++ b/src/decrypt.c @@ -119,7 +119,7 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) static gpgme_error_t -parse_enc_to (char *args, gpgme_recipient_t *recp) +parse_enc_to (char *args, gpgme_recipient_t *recp, gpgme_protocol_t protocol) { gpgme_recipient_t rec; char *tail; @@ -155,7 +155,7 @@ parse_enc_to (char *args, gpgme_recipient_t *recp) if (*args) { gpg_err_set_errno (0); - rec->pubkey_algo = strtol (args, &tail, 0); + rec->pubkey_algo = _gpgme_map_pk_algo (strtol (args, &tail, 0), protocol); if (errno || args == tail || *tail != ' ') { /* The crypto backend does not behave. */ @@ -261,7 +261,7 @@ _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code, break; case GPGME_STATUS_ENC_TO: - err = parse_enc_to (args, opd->last_recipient_p); + err = parse_enc_to (args, opd->last_recipient_p, ctx->protocol); if (err) return err; diff --git a/src/dirinfo.c b/src/dirinfo.c index 27c0dd7..8824c9a 100644 --- a/src/dirinfo.c +++ b/src/dirinfo.c @@ -38,24 +38,38 @@ enum { WANT_HOMEDIR, WANT_AGENT_SOCKET, + WANT_GPGCONF_NAME, WANT_GPG_NAME, WANT_GPGSM_NAME, WANT_G13_NAME, - WANT_UISRV_SOCKET + WANT_UISRV_SOCKET, + WANT_GPG_ONE_MODE }; /* Values retrieved via gpgconf and cached here. */ static struct { int valid; /* Cached information is valid. */ + int disable_gpgconf; char *homedir; char *agent_socket; + char *gpgconf_name; char *gpg_name; char *gpgsm_name; char *g13_name; char *uisrv_socket; + int gpg_one_mode; /* System is in gpg1 mode. */ } dirinfo; + +/* Helper function to be used only by gpgme_set_global_flag. */ +void +_gpgme_dirinfo_disable_gpgconf (void) +{ + dirinfo.disable_gpgconf = 1; +} + + /* Parse the output of "gpgconf --list-dirs". This function expects that DIRINFO_LOCK is held by the caller. If COMPONENTS is set, the output of --list-components is expected. */ @@ -142,7 +156,8 @@ read_gpgconf_dirs (const char *pgmname, int components) cfd[0].fd = rp[1]; - status = _gpgme_io_spawn (pgmname, argv, 0, cfd, NULL, NULL, NULL); + status = _gpgme_io_spawn (pgmname, argv, IOSPAWN_FLAG_DETACHED, + cfd, NULL, NULL, NULL); if (status < 0) { _gpgme_io_close (rp[0]); @@ -194,30 +209,34 @@ get_gpgconf_item (int what) LOCK (dirinfo_lock); if (!dirinfo.valid) { - const char *pgmname; + char *pgmname; - pgmname = _gpgme_get_gpgconf_path (); + pgmname = dirinfo.disable_gpgconf? NULL : _gpgme_get_gpgconf_path (); if (pgmname && access (pgmname, F_OK)) { _gpgme_debug (DEBUG_INIT, - "gpgme_dinfo: gpgconf='%s' [not installed]\n", pgmname); + "gpgme-dinfo: gpgconf='%s' [not installed]\n", pgmname); + free (pgmname); pgmname = NULL; /* Not available. */ } else - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpgconf='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: gpgconf='%s'\n", pgmname? pgmname : "[null]"); if (!pgmname) { /* Probably gpgconf is not installed. Assume we are using GnuPG-1. */ + dirinfo.gpg_one_mode = 1; pgmname = _gpgme_get_gpg_path (); if (pgmname) - dirinfo.gpg_name = strdup (pgmname); + dirinfo.gpg_name = pgmname; } else { + dirinfo.gpg_one_mode = 0; read_gpgconf_dirs (pgmname, 0); read_gpgconf_dirs (pgmname, 1); + dirinfo.gpgconf_name = pgmname; } /* Even if the reading of the directories failed (e.g. due to an too old version gpgconf or no gpgconf at all), we need to @@ -227,32 +246,34 @@ get_gpgconf_item (int what) allocated. */ dirinfo.valid = 1; if (dirinfo.gpg_name) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpg='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: gpg='%s'\n", dirinfo.gpg_name); if (dirinfo.g13_name) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: g13='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: g13='%s'\n", dirinfo.g13_name); if (dirinfo.gpgsm_name) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpgsm='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: gpgsm='%s'\n", dirinfo.gpgsm_name); if (dirinfo.homedir) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: homedir='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: homedir='%s'\n", dirinfo.homedir); if (dirinfo.agent_socket) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: agent='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: agent='%s'\n", dirinfo.agent_socket); if (dirinfo.uisrv_socket) - _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: uisrv='%s'\n", + _gpgme_debug (DEBUG_INIT, "gpgme-dinfo: uisrv='%s'\n", dirinfo.uisrv_socket); } switch (what) { case WANT_HOMEDIR: result = dirinfo.homedir; break; case WANT_AGENT_SOCKET: result = dirinfo.agent_socket; break; + case WANT_GPGCONF_NAME: result = dirinfo.gpgconf_name; break; case WANT_GPG_NAME: result = dirinfo.gpg_name; break; case WANT_GPGSM_NAME: result = dirinfo.gpgsm_name; break; case WANT_G13_NAME: result = dirinfo.g13_name; break; case WANT_UISRV_SOCKET: result = dirinfo.uisrv_socket; break; + case WANT_GPG_ONE_MODE: result = dirinfo.gpg_one_mode? "1":NULL; break; } UNLOCK (dirinfo_lock); return result; @@ -294,14 +315,11 @@ _gpgme_get_default_g13_name (void) return get_gpgconf_item (WANT_G13_NAME); } -/* Return the default gpgconf file name. Returns NULL if not known. - Because gpgconf is the binary used to retrieved all these default - names, this function is merely a simple wrapper around the function - used to locate this binary. */ +/* Return the default gpgconf file name. Returns NULL if not known. */ const char * _gpgme_get_default_gpgconf_name (void) { - return _gpgme_get_gpgconf_path (); + return get_gpgconf_item (WANT_GPGCONF_NAME); } /* Return the default UI-server socket name. Returns NULL if not @@ -311,3 +329,56 @@ _gpgme_get_default_uisrv_socket (void) { return get_gpgconf_item (WANT_UISRV_SOCKET); } + +/* Return true if we are in GnuPG-1 mode - ie. no gpgconf and agent + being optional. */ +int +_gpgme_in_gpg_one_mode (void) +{ + return !!get_gpgconf_item (WANT_GPG_ONE_MODE); +} + + + +/* Helper function to return the basename of the passed filename. */ +const char * +_gpgme_get_basename (const char *name) +{ + const char *s; + + if (!name || !*name) + return name; + for (s = name + strlen (name) -1; s >= name; s--) + if (*s == '/' +#ifdef HAVE_W32_SYSTEM + || *s == '\\' || *s == ':' +#endif + ) + return s+1; + return name; +} + + +/* Return default values for various directories and file names. */ +const char * +gpgme_get_dirinfo (const char *what) +{ + if (!what) + return NULL; + else if (!strcmp (what, "homedir")) + return get_gpgconf_item (WANT_HOMEDIR); + else if (!strcmp (what, "agent-socket")) + return get_gpgconf_item (WANT_AGENT_SOCKET); + else if (!strcmp (what, "uiserver-socket")) + return get_gpgconf_item (WANT_UISRV_SOCKET); + else if (!strcmp (what, "gpgconf-name")) + return get_gpgconf_item (WANT_GPGCONF_NAME); + else if (!strcmp (what, "gpg-name")) + return get_gpgconf_item (WANT_GPG_NAME); + else if (!strcmp (what, "gpgsm-name")) + return get_gpgconf_item (WANT_GPGSM_NAME); + else if (!strcmp (what, "g13-name")) + return get_gpgconf_item (WANT_G13_NAME); + else + return NULL; +} diff --git a/src/engine-assuan.c b/src/engine-assuan.c index 5ef3047..663b2ea 100644 --- a/src/engine-assuan.c +++ b/src/engine-assuan.c @@ -783,5 +783,6 @@ struct engine_ops _gpgme_engine_ops_assuan = llass_cancel, llass_cancel_op, NULL, /* passwd */ - NULL /* set_pinentry_mode */ + NULL, /* set_pinentry_mode */ + NULL /* opspawn */ }; diff --git a/src/engine-backend.h b/src/engine-backend.h index a4c0eb2..b3cc412 100644 --- a/src/engine-backend.h +++ b/src/engine-backend.h @@ -124,24 +124,37 @@ struct engine_ops /* Set the pinentry mode. */ gpgme_error_t (*set_pinentry_mode) (void *engine, gpgme_pinentry_mode_t mode); + + /* The spawn command. */ + gpgme_error_t (*opspawn) (void * engine, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, + gpgme_data_t dataerr, unsigned int flags); + }; extern struct engine_ops _gpgme_engine_ops_gpg; /* OpenPGP. */ -#ifdef ENABLE_GPGSM extern struct engine_ops _gpgme_engine_ops_gpgsm; /* CMS. */ -#endif -#ifdef ENABLE_GPGCONF extern struct engine_ops _gpgme_engine_ops_gpgconf; /* gpg-conf. */ -#endif -#ifdef ENABLE_ASSUAN extern struct engine_ops _gpgme_engine_ops_assuan; /* Low-level Assuan. */ -#endif -#ifdef ENABLE_G13 extern struct engine_ops _gpgme_engine_ops_g13; /* Crypto VFS. */ -#endif #ifdef ENABLE_UISERVER extern struct engine_ops _gpgme_engine_ops_uiserver; #endif +extern struct engine_ops _gpgme_engine_ops_spawn; /* Spawn engine. */ + + +/* Prototypes for extra functions in engine-gpgconf.c */ +gpgme_error_t _gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p, + gpgme_conf_type_t type, const void *value); +void _gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type); +gpgme_error_t _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, + gpgme_conf_arg_t arg); +void _gpgme_conf_release (gpgme_conf_comp_t conf); +gpgme_error_t _gpgme_conf_load (void *engine, gpgme_conf_comp_t *conf_p); + + #endif /* ENGINE_BACKEND_H */ diff --git a/src/engine-g13.c b/src/engine-g13.c index b97e0b4..a9717ee 100644 --- a/src/engine-g13.c +++ b/src/engine-g13.c @@ -107,7 +107,7 @@ g13_get_version (const char *file_name) static const char * g13_get_req_version (void) { - return NEED_G13_VERSION; + return "2.1.0"; } @@ -216,6 +216,7 @@ g13_new (void **engine, const char *file_name, const char *home_dir) { gpgme_error_t err = 0; engine_g13_t g13; + const char *pgmname; int argc; const char *argv[5]; char *dft_display = NULL; @@ -232,8 +233,9 @@ g13_new (void **engine, const char *file_name, const char *home_dir) g13->status_cb.tag = 0; g13->status_cb.data = g13; + pgmname = file_name ? file_name : _gpgme_get_default_g13_name (); argc = 0; - argv[argc++] = "g13"; + argv[argc++] = _gpgme_get_basename (pgmname); if (home_dir) { argv[argc++] = "--homedir"; @@ -250,13 +252,11 @@ g13_new (void **engine, const char *file_name, const char *home_dir) assuan_ctx_set_system_hooks (g13->assuan_ctx, &_gpgme_assuan_system_hooks); #if USE_DESCRIPTOR_PASSING - err = assuan_pipe_connect - (g13->assuan_ctx, file_name ? file_name : _gpgme_get_default_g13_name (), - argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING); + err = assuan_pipe_connect (g13->assuan_ctx, pgmname, argv, + NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING); #else - err = assuan_pipe_connect - (g13->assuan_ctx, file_name ? file_name : _gpgme_get_default_g13_name (), - argv, NULL, NULL, NULL, 0); + err = assuan_pipe_connect (g13->assuan_ctx, pgmname, argv, + NULL, NULL, NULL, 0); #endif if (err) goto leave; @@ -799,5 +799,6 @@ struct engine_ops _gpgme_engine_ops_g13 = g13_cancel, g13_cancel_op, NULL, /* passwd */ - NULL /* set_pinentry_mode */ + NULL, /* set_pinentry_mode */ + NULL /* opspawn */ }; diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 36f035a..ede098e 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -1,7 +1,7 @@ /* engine-gpg.c - Gpg Engine. Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2009, 2010, 2012 g10 Code GmbH + 2009, 2010, 2012, 2013 g10 Code GmbH This file is part of GPGME. @@ -303,7 +303,7 @@ gpg_get_version (const char *file_name) static const char * gpg_get_req_version (void) { - return NEED_GPG_VERSION; + return "1.4.0"; } @@ -718,7 +718,7 @@ gpg_set_command_handler (void *engine, engine_command_handler_t fnc, static gpgme_error_t -build_argv (engine_gpg_t gpg) +build_argv (engine_gpg_t gpg, const char *pgmname) { gpgme_error_t err; struct arg_and_data_s *a; @@ -729,15 +729,20 @@ build_argv (engine_gpg_t gpg) int use_agent = 0; char *p; - /* We don't want to use the agent with a malformed environment - variable. This is only a very basic test but sufficient to make - our life in the regression tests easier. */ - err = _gpgme_getenv ("GPG_AGENT_INFO", &p); - if (err) - return err; - use_agent = (p && strchr (p, ':')); - if (p) - free (p); + if (_gpgme_in_gpg_one_mode ()) + { + /* In GnuPG-1 mode we don't want to use the agent with a + malformed environment variable. This is only a very basic + test but sufficient to make our life in the regression tests + easier. With GnuPG-2 the agent is anyway required and on + modern installations GPG_AGENT_INFO is optional. */ + err = _gpgme_getenv ("GPG_AGENT_INFO", &p); + if (err) + return err; + use_agent = (p && strchr (p, ':')); + if (p) + free (p); + } if (gpg->argv) { @@ -788,7 +793,7 @@ build_argv (engine_gpg_t gpg) } argc = datac = 0; - argv[argc] = strdup ("gpg"); /* argv[0] */ + argv[argc] = strdup (_gpgme_get_basename (pgmname)); /* argv[0] */ if (!argv[argc]) { int saved_err = gpg_error_from_syserror (); @@ -1296,6 +1301,7 @@ start (engine_gpg_t gpg) int status; struct spawn_fd_item_s *fd_list; pid_t pid; + const char *pgmname; if (!gpg) return gpg_error (GPG_ERR_INV_VALUE); @@ -1321,7 +1327,8 @@ start (engine_gpg_t gpg) return rc; } - rc = build_argv (gpg); + pgmname = gpg->file_name ? gpg->file_name : _gpgme_get_default_gpg_name (); + rc = build_argv (gpg, pgmname); if (rc) return rc; @@ -1355,9 +1362,8 @@ start (engine_gpg_t gpg) fd_list[n].fd = -1; fd_list[n].dup_to = -1; - status = _gpgme_io_spawn (gpg->file_name ? gpg->file_name : - _gpgme_get_default_gpg_name (), gpg->argv, - IOSPAWN_FLAG_ALLOW_SET_FG, + status = _gpgme_io_spawn (pgmname, gpg->argv, + (IOSPAWN_FLAG_DETACHED |IOSPAWN_FLAG_ALLOW_SET_FG), fd_list, NULL, NULL, &pid); { int saved_err = gpg_error_from_syserror (); @@ -1656,6 +1662,9 @@ gpg_encrypt (void *engine, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, if (!err && use_armor) err = add_arg (gpg, "--armor"); + if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS)) + err = add_arg (gpg, "--compress-algo=none"); + if (!symmetric) { /* If we know that all recipients are valid (full or ultimate trust) @@ -1713,6 +1722,9 @@ gpg_encrypt_sign (void *engine, gpgme_key_t recp[], if (!err && use_armor) err = add_arg (gpg, "--armor"); + if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS)) + err = add_arg (gpg, "--compress-algo=none"); + if (!symmetric) { /* If we know that all recipients are valid (full or ultimate trust) @@ -2443,5 +2455,6 @@ struct engine_ops _gpgme_engine_ops_gpg = gpg_cancel, NULL, /* cancel_op */ gpg_passwd, - gpg_set_pinentry_mode + gpg_set_pinentry_mode, + NULL /* opspawn */ }; diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c index 1d457bb..a2407ac 100644 --- a/src/engine-gpgconf.c +++ b/src/engine-gpgconf.c @@ -68,7 +68,7 @@ gpgconf_get_version (const char *file_name) static const char * gpgconf_get_req_version (void) { - return NEED_GPGCONF_VERSION; + return "2.0.4"; } @@ -228,7 +228,8 @@ gpgconf_read (void *engine, char *arg1, char *arg2, cfd[0].fd = rp[1]; - status = _gpgme_io_spawn (gpgconf->file_name, argv, 0, cfd, NULL, NULL, NULL); + status = _gpgme_io_spawn (gpgconf->file_name, argv, + IOSPAWN_FLAG_DETACHED, cfd, NULL, NULL, NULL); if (status < 0) { _gpgme_io_close (rp[0]); @@ -697,7 +698,8 @@ gpgconf_write (void *engine, char *arg1, char *arg2, gpgme_data_t conf) cfd[0].fd = rp[0]; - status = _gpgme_io_spawn (gpgconf->file_name, argv, 0, cfd, NULL, NULL, NULL); + status = _gpgme_io_spawn (gpgconf->file_name, argv, + IOSPAWN_FLAG_DETACHED, cfd, NULL, NULL, NULL); if (status < 0) { _gpgme_io_close (rp[0]); @@ -961,5 +963,6 @@ struct engine_ops _gpgme_engine_ops_gpgconf = NULL, /* cancel */ NULL, /* cancel_op */ NULL, /* passwd */ - NULL /* set_pinentry_mode */ + NULL, /* set_pinentry_mode */ + NULL /* opspawn */ }; diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index a7888ca..710bf14 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -127,7 +127,7 @@ gpgsm_get_version (const char *file_name) static const char * gpgsm_get_req_version (void) { - return NEED_GPGSM_VERSION; + return "2.0.4"; } @@ -239,6 +239,7 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) { gpgme_error_t err = 0; engine_gpgsm_t gpgsm; + const char *pgmname; const char *argv[5]; int argc; #if !USE_DESCRIPTOR_PASSING @@ -321,8 +322,10 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) child_fds[3] = -1; #endif + pgmname = file_name ? file_name : _gpgme_get_default_gpgsm_name (); + argc = 0; - argv[argc++] = "gpgsm"; + argv[argc++] = _gpgme_get_basename (pgmname); if (home_dir) { argv[argc++] = "--homedir"; @@ -339,10 +342,8 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) assuan_ctx_set_system_hooks (gpgsm->assuan_ctx, &_gpgme_assuan_system_hooks); #if USE_DESCRIPTOR_PASSING - err = assuan_pipe_connect - (gpgsm->assuan_ctx, - file_name ? file_name : _gpgme_get_default_gpgsm_name (), - argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING); + err = assuan_pipe_connect (gpgsm->assuan_ctx, pgmname, argv, + NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING); #else { assuan_fd_t achild_fds[4]; @@ -352,10 +353,8 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) for (i = 0; i < 4; i++) achild_fds[i] = (assuan_fd_t) child_fds[i]; - err = assuan_pipe_connect - (gpgsm->assuan_ctx, - file_name ? file_name : _gpgme_get_default_gpgsm_name (), - argv, achild_fds, NULL, NULL, 0); + err = assuan_pipe_connect (gpgsm->assuan_ctx, pgmname, argv, + achild_fds, NULL, NULL, 0); /* For now... */ for (i = 0; i < 4; i++) @@ -837,7 +836,7 @@ status_handler (void *opaque, int fd) else { *aline = newline; - gpgsm->colon.attic.linesize = *alinelen + linelen + 1; + gpgsm->colon.attic.linesize += linelen + 1; } } if (!err) @@ -1989,5 +1988,6 @@ struct engine_ops _gpgme_engine_ops_gpgsm = gpgsm_cancel, NULL, /* cancel_op */ gpgsm_passwd, - NULL /* set_pinentry_mode */ + NULL, /* set_pinentry_mode */ + NULL /* opspawn */ }; diff --git a/src/engine-spawn.c b/src/engine-spawn.c new file mode 100644 index 0000000..8ffc628 --- /dev/null +++ b/src/engine-spawn.c @@ -0,0 +1,475 @@ +/* engine-spawn.c - Run an arbitrary program + Copyright (C) 2014 g10 Code GmbH + + This file is part of GPGME. + + GPGME 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. + + GPGME 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, see . +*/ + +#if HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_LOCALE_H +#include +#endif + +#include "gpgme.h" +#include "util.h" +#include "ops.h" +#include "wait.h" +#include "context.h" /*temp hack until we have GpmeData methods to do I/O */ +#include "priv-io.h" +#include "sema.h" +#include "debug.h" + +#include "engine-backend.h" + + +/* This type is used to build a list of data sources/sinks. */ +struct datalist_s +{ + struct datalist_s *next; + gpgme_data_t data; /* The data object. */ + int inbound; /* True if this is used for reading from the peer. */ + int dup_to; /* The fd used by the peer. */ +}; + + +struct fd_data_map_s +{ + gpgme_data_t data; + int inbound; /* True if this is used for reading from the peer. */ + int dup_to; /* Dup the fd to that one. */ + int fd; /* The fd to use. */ + int peer_fd; /* The other side of the pipe. */ + void *tag; /* Tag used by the I/O callback. */ +}; + + +struct engine_spawn +{ + struct datalist_s *arglist; + struct datalist_s **argtail; + + struct fd_data_map_s *fd_data_map; + + struct gpgme_io_cbs io_cbs; +}; +typedef struct engine_spawn *engine_spawn_t; + + +static void engspawn_io_event (void *engine, + gpgme_event_io_t type, void *type_data); +static gpgme_error_t engspawn_cancel (void *engine); + + + +static void +close_notify_handler (int fd, void *opaque) +{ + engine_spawn_t esp = opaque; + int i; + + assert (fd != -1); + + if (esp->fd_data_map) + { + for (i = 0; esp->fd_data_map[i].data; i++) + { + if (esp->fd_data_map[i].fd == fd) + { + if (esp->fd_data_map[i].tag) + (*esp->io_cbs.remove) (esp->fd_data_map[i].tag); + esp->fd_data_map[i].fd = -1; + break; + } + if (esp->fd_data_map[i].peer_fd == fd) + { + esp->fd_data_map[i].peer_fd = -1; + break; + } + } + } +} + + +static gpgme_error_t +add_data (engine_spawn_t esp, gpgme_data_t data, int dup_to, int inbound) +{ + struct datalist_s *a; + + assert (esp); + assert (data); + + a = malloc (sizeof *a - 1); + if (!a) + return gpg_error_from_syserror (); + a->next = NULL; + a->data = data; + a->inbound = inbound; + a->dup_to = dup_to; + *esp->argtail = a; + esp->argtail = &a->next; + return 0; +} + + +static void +free_fd_data_map (struct fd_data_map_s *fd_data_map) +{ + int i; + + if (!fd_data_map) + return; + + for (i = 0; fd_data_map[i].data; i++) + { + if (fd_data_map[i].fd != -1) + _gpgme_io_close (fd_data_map[i].fd); + if (fd_data_map[i].peer_fd != -1) + _gpgme_io_close (fd_data_map[i].peer_fd); + /* Don't release data because this is only a reference. */ + } + free (fd_data_map); +} + + +static gpgme_error_t +build_fd_data_map (engine_spawn_t esp) +{ + struct datalist_s *a; + size_t datac; + int fds[2]; + + for (datac = 0, a = esp->arglist; a; a = a->next) + if (a->data) + datac++; + + free_fd_data_map (esp->fd_data_map); + esp->fd_data_map = calloc (datac + 1, sizeof *esp->fd_data_map); + if (!esp->fd_data_map) + return gpg_error_from_syserror (); + + for (datac = 0, a = esp->arglist; a; a = a->next) + { + assert (a->data); + + if (_gpgme_io_pipe (fds, a->inbound ? 1 : 0) == -1) + { + free (esp->fd_data_map); + esp->fd_data_map = NULL; + return gpg_error_from_syserror (); + } + if (_gpgme_io_set_close_notify (fds[0], close_notify_handler, esp) + || _gpgme_io_set_close_notify (fds[1], close_notify_handler, esp)) + { + /* FIXME: Need error cleanup. */ + return gpg_error (GPG_ERR_GENERAL); + } + + esp->fd_data_map[datac].inbound = a->inbound; + if (a->inbound) + { + esp->fd_data_map[datac].fd = fds[0]; + esp->fd_data_map[datac].peer_fd = fds[1]; + } + else + { + esp->fd_data_map[datac].fd = fds[1]; + esp->fd_data_map[datac].peer_fd = fds[0]; + } + esp->fd_data_map[datac].data = a->data; + esp->fd_data_map[datac].dup_to = a->dup_to; + datac++; + } + + return 0; +} + + +static gpgme_error_t +add_io_cb (engine_spawn_t esp, int fd, int dir, gpgme_io_cb_t handler, + void *data, void **tag) +{ + gpgme_error_t err; + + err = (*esp->io_cbs.add) (esp->io_cbs.add_priv, fd, dir, handler, data, tag); + if (err) + return err; + if (!dir) /* Fixme: Kludge around poll() problem. */ + err = _gpgme_io_set_nonblocking (fd); + return err; +} + + +static gpgme_error_t +engspawn_start (engine_spawn_t esp, const char *file, const char *argv[], + unsigned int flags) +{ + gpgme_error_t err; + int i, n; + int status; + struct spawn_fd_item_s *fd_list; + pid_t pid; + unsigned int spflags; + const char *save_argv0 = NULL; + + if (!esp || !file || !argv || !argv[0]) + return gpg_error (GPG_ERR_INV_VALUE); + + spflags = 0; + if ((flags & GPGME_SPAWN_DETACHED)) + spflags |= IOSPAWN_FLAG_DETACHED; + if ((flags & GPGME_SPAWN_ALLOW_SET_FG)) + spflags |= IOSPAWN_FLAG_ALLOW_SET_FG; + + + err = build_fd_data_map (esp); + if (err) + return err; + + n = 0; + for (i = 0; esp->fd_data_map[i].data; i++) + n++; + fd_list = calloc (n+1, sizeof *fd_list); + if (!fd_list) + return gpg_error_from_syserror (); + + /* Build the fd list for the child. */ + n = 0; + for (i = 0; esp->fd_data_map[i].data; i++) + { + fd_list[n].fd = esp->fd_data_map[i].peer_fd; + fd_list[n].dup_to = esp->fd_data_map[i].dup_to; + n++; + } + fd_list[n].fd = -1; + fd_list[n].dup_to = -1; + + if (argv[0] && !*argv[0]) + { + save_argv0 = argv[0]; + argv[0] = _gpgme_get_basename (file); + } + status = _gpgme_io_spawn (file, (char * const *)argv, spflags, + fd_list, NULL, NULL, &pid); + if (save_argv0) + argv[0] = save_argv0; + free (fd_list); + if (status == -1) + return gpg_error_from_syserror (); + + for (i = 0; esp->fd_data_map[i].data; i++) + { + err = add_io_cb (esp, esp->fd_data_map[i].fd, + esp->fd_data_map[i].inbound, + esp->fd_data_map[i].inbound + ? _gpgme_data_inbound_handler + : _gpgme_data_outbound_handler, + esp->fd_data_map[i].data, &esp->fd_data_map[i].tag); + if (err) + return err; /* FIXME: kill the child */ + } + + engspawn_io_event (esp, GPGME_EVENT_START, NULL); + + return 0; +} + + + +/* + Public functions + */ + +static const char * +engspawn_get_file_name (void) +{ + return "/nonexistent"; +} + + +static char * +engspawn_get_version (const char *file_name) +{ + (void)file_name; + return strdup ("1.0"); +} + + +static const char * +engspawn_get_req_version (void) +{ + return "1.0"; +} + + +static gpgme_error_t +engspawn_new (void **engine, const char *file_name, const char *home_dir) +{ + engine_spawn_t esp; + + (void)file_name; + (void)home_dir; + + esp = calloc (1, sizeof *esp); + if (!esp) + return gpg_error_from_syserror (); + + esp->argtail = &esp->arglist; + *engine = esp; + return 0; +} + + +static void +engspawn_release (void *engine) +{ + engine_spawn_t esp = engine; + + if (!esp) + return; + + engspawn_cancel (engine); + + while (esp->arglist) + { + struct datalist_s *next = esp->arglist->next; + + if (esp->arglist) + free (esp->arglist); + esp->arglist = next; + } + + free (esp); +} + + +static void +engspawn_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) +{ + engine_spawn_t esp = engine; + + esp->io_cbs = *io_cbs; +} + + +static void +engspawn_io_event (void *engine, gpgme_event_io_t type, void *type_data) +{ + engine_spawn_t esp = engine; + + TRACE3 (DEBUG_ENGINE, "gpgme:engspawn_io_event", esp, + "event %p, type %d, type_data %p", + esp->io_cbs.event, type, type_data); + if (esp->io_cbs.event) + (*esp->io_cbs.event) (esp->io_cbs.event_priv, type, type_data); +} + + +static gpgme_error_t +engspawn_cancel (void *engine) +{ + engine_spawn_t esp = engine; + + if (!esp) + return gpg_error (GPG_ERR_INV_VALUE); + + if (esp->fd_data_map) + { + free_fd_data_map (esp->fd_data_map); + esp->fd_data_map = NULL; + } + + return 0; +} + + +static gpgme_error_t +engspawn_op_spawn (void *engine, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags) +{ + engine_spawn_t esp = engine; + gpgme_error_t err = 0; + + if (datain) + err = add_data (esp, datain, 0, 0); + if (!err && dataout) + err = add_data (esp, dataout, 1, 1); + if (!err && dataerr) + err = add_data (esp, dataerr, 2, 1); + + if (!err) + err = engspawn_start (esp, file, argv, flags); + + return err; +} + + + +struct engine_ops _gpgme_engine_ops_spawn = + { + /* Static functions. */ + engspawn_get_file_name, + NULL, /* get_home_dir */ + engspawn_get_version, + engspawn_get_req_version, + engspawn_new, + + /* Member functions. */ + engspawn_release, + NULL, /* reset */ + NULL, /* set_status_handler */ + NULL, /* set_command_handler */ + NULL, /* set_colon_line_handler */ + NULL, /* set_locale */ + NULL, /* set_protocol */ + NULL, /* decrypt */ + NULL, /* decrypt_verify */ + NULL, /* delete */ + NULL, /* edit */ + NULL, /* encrypt */ + NULL, /* encrypt_sign */ + NULL, /* export */ + NULL, /* export_ext */ + NULL, /* genkey */ + NULL, /* import */ + NULL, /* keylist */ + NULL, /* keylist_ext */ + NULL, /* sign */ + NULL, /* trustlist */ + NULL, /* verify */ + NULL, /* getauditlog */ + NULL, /* opassuan_transact */ + NULL, /* conf_load */ + NULL, /* conf_save */ + engspawn_set_io_cbs, + engspawn_io_event, /* io_event */ + engspawn_cancel, /* cancel */ + NULL, /* cancel_op */ + NULL, /* passwd */ + NULL, /* set_pinentry_mode */ + engspawn_op_spawn /* opspawn */ + }; diff --git a/src/engine-uiserver.c b/src/engine-uiserver.c index 350b609..2738c36 100644 --- a/src/engine-uiserver.c +++ b/src/engine-uiserver.c @@ -698,7 +698,7 @@ status_handler (void *opaque, int fd) else { *aline = newline; - uiserver->colon.attic.linesize = *alinelen + linelen + 1; + uiserver->colon.attic.linesize += linelen + 1; } } if (!err) @@ -1340,5 +1340,6 @@ struct engine_ops _gpgme_engine_ops_uiserver = uiserver_cancel, NULL, /* cancel_op */ NULL, /* passwd */ - NULL /* set_pinentry_mode */ + NULL, /* set_pinentry_mode */ + NULL /* opspawn */ }; diff --git a/src/engine.c b/src/engine.c index 09f379c..ff015c0 100644 --- a/src/engine.c +++ b/src/engine.c @@ -46,31 +46,16 @@ struct engine static struct engine_ops *engine_ops[] = { &_gpgme_engine_ops_gpg, /* OpenPGP. */ -#ifdef ENABLE_GPGSM &_gpgme_engine_ops_gpgsm, /* CMS. */ -#else - NULL, -#endif -#ifdef ENABLE_GPGCONF &_gpgme_engine_ops_gpgconf, /* gpg-conf. */ -#else - NULL, -#endif -#ifdef ENABLE_ASSUAN &_gpgme_engine_ops_assuan, /* Low-Level Assuan. */ -#else - NULL, -#endif -#ifdef ENABLE_G13 &_gpgme_engine_ops_g13, /* Crypto VFS. */ -#else - NULL, -#endif #ifdef ENABLE_UISERVER - &_gpgme_engine_ops_uiserver /* UI-Server. */ + &_gpgme_engine_ops_uiserver, /* UI-Server. */ #else - NULL + NULL, #endif + &_gpgme_engine_ops_spawn }; @@ -198,6 +183,8 @@ _gpgme_engine_info_release (gpgme_engine_info_t info) gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *info) { + gpgme_error_t err; + LOCK (engine_info_lock); if (!engine_info) { @@ -207,9 +194,11 @@ gpgme_get_engine_info (gpgme_engine_info_t *info) GPGME_PROTOCOL_GPGCONF, GPGME_PROTOCOL_ASSUAN, GPGME_PROTOCOL_G13, - GPGME_PROTOCOL_UISERVER }; + GPGME_PROTOCOL_UISERVER, + GPGME_PROTOCOL_SPAWN }; unsigned int proto; + err = 0; for (proto = 0; proto < DIM (proto_list); proto++) { const char *ofile_name = engine_get_file_name (proto_list[proto]); @@ -221,13 +210,24 @@ gpgme_get_engine_info (gpgme_engine_info_t *info) continue; file_name = strdup (ofile_name); - home_dir = ohome_dir? strdup (ohome_dir): NULL; + if (!file_name) + err = gpg_error_from_syserror (); + + if (ohome_dir) + { + home_dir = strdup (ohome_dir); + if (!home_dir && !err) + err = gpg_error_from_syserror (); + } + else + home_dir = NULL; *lastp = malloc (sizeof (*engine_info)); - if (!*lastp || !file_name) - { - int saved_err = gpg_error_from_syserror (); + if (!*lastp && !err) + err = gpg_error_from_syserror (); + if (err) + { _gpgme_engine_info_release (engine_info); engine_info = NULL; @@ -237,7 +237,7 @@ gpgme_get_engine_info (gpgme_engine_info_t *info) free (home_dir); UNLOCK (engine_info_lock); - return saved_err; + return err; } (*lastp)->protocol = proto_list[proto]; @@ -289,11 +289,13 @@ _gpgme_engine_info_copy (gpgme_engine_info_t *r_info) assert (info->file_name); file_name = strdup (info->file_name); + if (!file_name) + err = gpg_error_from_syserror (); if (info->home_dir) { home_dir = strdup (info->home_dir); - if (!home_dir) + if (!home_dir && !err) err = gpg_error_from_syserror (); } else @@ -302,19 +304,19 @@ _gpgme_engine_info_copy (gpgme_engine_info_t *r_info) if (info->version) { version = strdup (info->version); - if (!version) + if (!version && !err) err = gpg_error_from_syserror (); } else version = NULL; *lastp = malloc (sizeof (*engine_info)); - if (!*lastp || !file_name || err) - { - int saved_err = gpg_error_from_syserror (); + if (!*lastp && !err) + err = gpg_error_from_syserror (); + if (err) + { _gpgme_engine_info_release (new_info); - if (file_name) free (file_name); if (home_dir) @@ -323,7 +325,7 @@ _gpgme_engine_info_copy (gpgme_engine_info_t *r_info) free (version); UNLOCK (engine_info_lock); - return saved_err; + return err; } (*lastp)->protocol = info->protocol; @@ -936,3 +938,21 @@ _gpgme_engine_set_pinentry_mode (engine_t engine, gpgme_pinentry_mode_t mode) return (*engine->ops->set_pinentry_mode) (engine->engine, mode); } + + +gpgme_error_t +_gpgme_engine_op_spawn (engine_t engine, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags) +{ + if (!engine) + return gpg_error (GPG_ERR_INV_VALUE); + + if (!engine->ops->opspawn) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + + return (*engine->ops->opspawn) (engine->engine, file, argv, + datain, dataout, dataerr, flags); +} diff --git a/src/engine.h b/src/engine.h index a0287ad..bbf009d 100644 --- a/src/engine.h +++ b/src/engine.h @@ -163,5 +163,12 @@ gpgme_error_t _gpgme_engine_op_passwd (engine_t engine, gpgme_key_t key, gpgme_error_t _gpgme_engine_set_pinentry_mode (engine_t engine, gpgme_pinentry_mode_t mode); +gpgme_error_t _gpgme_engine_op_spawn (engine_t engine, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, + gpgme_data_t dataerr, + unsigned int flags); + #endif /* ENGINE_H */ diff --git a/src/gpgconf.c b/src/gpgconf.c index 47ef47a..6591452 100644 --- a/src/gpgconf.c +++ b/src/gpgconf.c @@ -28,18 +28,7 @@ #include "engine.h" #include "debug.h" -#ifdef ENABLE_GPGCONF -/* engine-gpgconf.c. */ -gpgme_error_t _gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p, - gpgme_conf_type_t type, const void *value); -void _gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type); -gpgme_error_t _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, - gpgme_conf_arg_t arg); -void _gpgme_conf_release (gpgme_conf_comp_t conf); -gpgme_error_t _gpgme_conf_load (void *engine, gpgme_conf_comp_t *conf_p); -gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp); - -#endif +#include "engine-backend.h" /* Allocate a new gpgme_conf_arg_t. */ @@ -47,11 +36,7 @@ gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p, gpgme_conf_type_t type, const void *value) { -#ifdef ENABLE_GPGCONF return _gpgme_conf_arg_new (arg_p, type, value); -#else - return gpg_error (GPG_ERR_NOT_IMPLEMENTED); -#endif } @@ -59,9 +44,7 @@ gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p, void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type) { -#ifdef ENABLE_GPGCONF _gpgme_conf_arg_release (arg, type); -#endif } @@ -69,11 +52,7 @@ gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type) gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg) { -#ifdef ENABLE_GPGCONF return _gpgme_conf_opt_change (opt, reset, arg); -#else - return gpg_error (GPG_ERR_NOT_IMPLEMENTED); -#endif } @@ -82,9 +61,7 @@ gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg) void gpgme_conf_release (gpgme_conf_comp_t conf) { -#ifdef ENABLE_GPGCONF _gpgme_conf_release (conf); -#endif } @@ -93,7 +70,6 @@ gpgme_conf_release (gpgme_conf_comp_t conf) gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p) { -#ifdef ENABLE_GPGCONF gpgme_error_t err; gpgme_protocol_t proto; @@ -109,9 +85,6 @@ gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p) err = _gpgme_engine_op_conf_load (ctx->engine, conf_p); ctx->protocol = proto; return err; -#else - return gpg_error (GPG_ERR_NOT_IMPLEMENTED); -#endif } @@ -119,7 +92,6 @@ gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p) gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp) { -#ifdef ENABLE_GPGCONF gpgme_error_t err; gpgme_protocol_t proto; @@ -135,9 +107,6 @@ gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp) err = _gpgme_engine_op_conf_save (ctx->engine, comp); ctx->protocol = proto; return err; -#else - return gpg_error (GPG_ERR_NOT_IMPLEMENTED); -#endif } diff --git a/src/gpgme-tool.c b/src/gpgme-tool.c index 2bf7654..be8ed07 100644 --- a/src/gpgme-tool.c +++ b/src/gpgme-tool.c @@ -1742,6 +1742,8 @@ gt_protocol_from_name (const char *name) return GPGME_PROTOCOL_G13; if (! strcasecmp (name, gpgme_get_protocol_name (GPGME_PROTOCOL_UISERVER))) return GPGME_PROTOCOL_UISERVER; + if (! strcasecmp (name, gpgme_get_protocol_name (GPGME_PROTOCOL_SPAWN))) + return GPGME_PROTOCOL_SPAWN; if (! strcasecmp (name, gpgme_get_protocol_name (GPGME_PROTOCOL_DEFAULT))) return GPGME_PROTOCOL_DEFAULT; return GPGME_PROTOCOL_UNKNOWN; @@ -2106,6 +2108,18 @@ gt_identify (gpgme_tool_t gt, gpgme_data_t data) } +gpg_error_t +gt_spawn (gpgme_tool_t gt, const char *pgm, + gpgme_data_t inp, gpgme_data_t outp) +{ + gpg_error_t err; + + err = gpgme_op_spawn (gt->ctx, pgm, NULL, inp, outp, outp, 0); + + return err; +} + + #define GT_RESULT_ENCRYPT 0x1 #define GT_RESULT_DECRYPT 0x2 #define GT_RESULT_SIGN 0x4 @@ -2792,6 +2806,8 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign) flags |= GPGME_ENCRYPT_PREPARE; if (strstr (line, "--expect-sign")) flags |= GPGME_ENCRYPT_EXPECT_SIGN; + if (strstr (line, "--no-compress")) + flags |= GPGME_ENCRYPT_NO_COMPRESS; inp_fd = server->input_fd; inp_fn = server->input_filename; @@ -2828,7 +2844,7 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign) static const char hlp_encrypt[] = "ENCRYPT [--always-trust] [--no-encrypt-to]\n" - " [--prepare] [--expect-sign]\n" + " [--no-compress] [--prepare] [--expect-sign]\n" "\n" "Encrypt the object set by the last INPUT command to\n" "the keys specified by previous RECIPIENT commands. \n" @@ -2843,7 +2859,7 @@ cmd_encrypt (assuan_context_t ctx, char *line) static const char hlp_sign_encrypt[] = "SIGN_ENCRYPT [--always-trust] [--no-encrypt-to]\n" - " [--prepare] [--expect-sign]\n" + " [--no-compress] [--prepare] [--expect-sign]\n" "\n" "Sign the object set by the last INPUT command with the\n" "keys specified by previous SIGNER commands and encrypt\n" @@ -3487,6 +3503,55 @@ cmd_identify (assuan_context_t ctx, char *line) } +static const char hlp_spawn[] = + "SPAWN PGM [args]\n" + "\n" + "Run program PGM with stdin connected to the INPUT source;\n" + "stdout and stderr to the OUTPUT source."; +static gpg_error_t +cmd_spawn (assuan_context_t ctx, char *line) +{ + struct server *server = assuan_get_pointer (ctx); + gpg_error_t err; + assuan_fd_t inp_fd; + char *inp_fn; + assuan_fd_t out_fd; + char *out_fn; + gpgme_data_t inp_data = NULL; + gpgme_data_t out_data = NULL; + + inp_fd = server->input_fd; + inp_fn = server->input_filename; + out_fd = server->output_fd; + out_fn = server->output_filename; + if (inp_fd != ASSUAN_INVALID_FD || inp_fn) + { + err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data, + &server->input_stream); + if (err) + return err; + } + if (out_fd != ASSUAN_INVALID_FD || out_fn) + { + err = server_data_obj (out_fd, out_fn, 1, server->output_enc, &out_data, + &server->output_stream); + if (err) + { + gpgme_data_release (inp_data); + return err; + } + } + + err = gt_spawn (server->gt, line, inp_data, out_data); + + gpgme_data_release (inp_data); + gpgme_data_release (out_data); + + server_reset_fds (server); + + return err; +} + /* Tell the assuan library about our commands. */ static gpg_error_t @@ -3547,6 +3612,7 @@ register_commands (assuan_context_t ctx) { "HASH_ALGO_NAME", cmd_hash_algo_name }, { "PASSWD", cmd_passwd, hlp_passwd }, { "IDENTIFY", cmd_identify, hlp_identify }, + { "SPAWN", cmd_spawn, hlp_spawn }, { NULL } }; int idx; diff --git a/src/gpgme.c b/src/gpgme.c index 51b68a5..628cdae 100644 --- a/src/gpgme.c +++ b/src/gpgme.c @@ -1,6 +1,7 @@ /* gpgme.c - GnuPG Made Easy. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2012 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2012, + 2014 g10 Code GmbH This file is part of GPGME. @@ -15,9 +16,8 @@ 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., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program; if not, see . + */ #if HAVE_CONFIG_H #include @@ -37,6 +37,7 @@ #include "wait.h" #include "debug.h" #include "priv-io.h" +#include "sys-util.h" /* The default locale. */ @@ -65,6 +66,15 @@ gpgme_set_global_flag (const char *name, const char *value) return -1; else if (!strcmp (name, "debug")) return _gpgme_debug_set_debug_envvar (value); + else if (!strcmp (name, "disable-gpgconf")) + { + _gpgme_dirinfo_disable_gpgconf (); + return 0; + } + else if (!strcmp (name, "gpgconf-name")) + return _gpgme_set_default_gpgconf_name (value); + else if (!strcmp (name, "gpg-name")) + return _gpgme_set_default_gpg_name (value); else return -1; } @@ -76,6 +86,7 @@ gpgme_set_global_flag (const char *name, const char *value) gpgme_error_t gpgme_new (gpgme_ctx_t *r_ctx) { + gpgme_error_t err; gpgme_ctx_t ctx; TRACE_BEG (DEBUG_CTX, "gpgme_new", r_ctx); @@ -91,11 +102,13 @@ gpgme_new (gpgme_ctx_t *r_ctx) INIT_LOCK (ctx->lock); - _gpgme_engine_info_copy (&ctx->engine_info); - if (!ctx->engine_info) + err = _gpgme_engine_info_copy (&ctx->engine_info); + if (!err && !ctx->engine_info) + err = gpg_error (GPG_ERR_NO_ENGINE); + if (err) { free (ctx); - return TRACE_ERR (gpg_error_from_syserror ()); + return TRACE_ERR (err); } ctx->keylist_mode = GPGME_KEYLIST_MODE_LOCAL; @@ -220,6 +233,7 @@ gpgme_release (gpgme_ctx_t ctx) return; _gpgme_engine_release (ctx->engine); + ctx->engine = NULL; _gpgme_fd_table_deinit (&ctx->fdt); _gpgme_release_result (ctx); _gpgme_signers_clear (ctx); @@ -231,6 +245,7 @@ gpgme_release (gpgme_ctx_t ctx) if (ctx->lc_messages) free (ctx->lc_messages); _gpgme_engine_info_release (ctx->engine_info); + ctx->engine_info = NULL; DESTROY_LOCK (ctx->lock); free (ctx); } @@ -308,7 +323,8 @@ gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol) && protocol != GPGME_PROTOCOL_GPGCONF && protocol != GPGME_PROTOCOL_ASSUAN && protocol != GPGME_PROTOCOL_G13 - && protocol != GPGME_PROTOCOL_UISERVER) + && protocol != GPGME_PROTOCOL_UISERVER + && protocol != GPGME_PROTOCOL_SPAWN) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); if (!ctx) @@ -392,6 +408,9 @@ gpgme_get_protocol_name (gpgme_protocol_t protocol) case GPGME_PROTOCOL_UISERVER: return "UIServer"; + case GPGME_PROTOCOL_SPAWN: + return "Spawn"; + case GPGME_PROTOCOL_DEFAULT: return "default"; @@ -931,6 +950,9 @@ gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo) case GPGME_PK_DSA: return "DSA"; + case GPGME_PK_ECC: + return "ECC"; + case GPGME_PK_ELG: return "ELG"; @@ -978,6 +1000,9 @@ gpgme_hash_algo_name (gpgme_hash_algo_t algo) case GPGME_MD_SHA512: return "SHA512"; + case GPGME_MD_SHA224: + return "SHA224"; + case GPGME_MD_MD4: return "MD4"; diff --git a/src/gpgme.def b/src/gpgme.def index 0478cb6..dc18948 100644 --- a/src/gpgme.def +++ b/src/gpgme.def @@ -213,5 +213,9 @@ EXPORTS gpgme_data_identify @161 + gpgme_get_dirinfo @162 + + gpgme_op_spawn_start @163 + gpgme_op_spawn @164 ; END diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 5c4de6b..d47f4ba 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1,7 +1,7 @@ /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 - 2010, 2011, 2012, 2013 g10 Code GmbH + 2010, 2011, 2012, 2013, 2014 g10 Code GmbH This file is part of GPGME. @@ -227,7 +227,7 @@ typedef enum gpgme_data_type_t; -/* Public key algorithms from libgcrypt. */ +/* Public key algorithms. */ typedef enum { GPGME_PK_RSA = 1, @@ -235,6 +235,7 @@ typedef enum GPGME_PK_RSA_S = 3, GPGME_PK_ELG_E = 16, GPGME_PK_DSA = 17, + GPGME_PK_ECC = 18, GPGME_PK_ELG = 20, GPGME_PK_ECDSA = 301, GPGME_PK_ECDH = 302 @@ -242,7 +243,7 @@ typedef enum gpgme_pubkey_algo_t; -/* Hash algorithms from libgcrypt. */ +/* Hash algorithms (the values match those from libgcrypt). */ typedef enum { GPGME_MD_NONE = 0, @@ -255,6 +256,7 @@ typedef enum GPGME_MD_SHA256 = 8, GPGME_MD_SHA384 = 9, GPGME_MD_SHA512 = 10, + GPGME_MD_SHA224 = 11, GPGME_MD_MD4 = 301, GPGME_MD_CRC32 = 302, GPGME_MD_CRC32_RFC1510 = 303, @@ -354,6 +356,7 @@ typedef enum GPGME_PROTOCOL_ASSUAN = 3, /* Low-level access to an Assuan server. */ GPGME_PROTOCOL_G13 = 4, GPGME_PROTOCOL_UISERVER= 5, + GPGME_PROTOCOL_SPAWN = 6, /* Direct access to any program. */ GPGME_PROTOCOL_DEFAULT = 254, GPGME_PROTOCOL_UNKNOWN = 255 } @@ -452,7 +455,7 @@ typedef enum GPGME_STATUS_BADARMOR = 7, - GPGME_STATUS_RSA_OR_IDEA = 8, + GPGME_STATUS_RSA_OR_IDEA = 8, /* (legacy) */ GPGME_STATUS_KEYEXPIRED = 9, GPGME_STATUS_KEYREVOKED = 10, @@ -462,10 +465,10 @@ typedef enum GPGME_STATUS_TRUST_FULLY = 14, GPGME_STATUS_TRUST_ULTIMATE = 15, - GPGME_STATUS_SHM_INFO = 16, - GPGME_STATUS_SHM_GET = 17, - GPGME_STATUS_SHM_GET_BOOL = 18, - GPGME_STATUS_SHM_GET_HIDDEN = 19, + GPGME_STATUS_SHM_INFO = 16, /* (legacy) */ + GPGME_STATUS_SHM_GET = 17, /* (legacy) */ + GPGME_STATUS_SHM_GET_BOOL = 18, /* (legacy) */ + GPGME_STATUS_SHM_GET_HIDDEN = 19, /* (legacy) */ GPGME_STATUS_NEED_PASSPHRASE = 20, GPGME_STATUS_VALIDSIG = 21, @@ -507,15 +510,15 @@ typedef enum GPGME_STATUS_NOTATION_NAME = 55, GPGME_STATUS_NOTATION_DATA = 56, GPGME_STATUS_POLICY_URL = 57, - GPGME_STATUS_BEGIN_STREAM = 58, - GPGME_STATUS_END_STREAM = 59, + GPGME_STATUS_BEGIN_STREAM = 58, /* (legacy) */ + GPGME_STATUS_END_STREAM = 59, /* (legacy) */ GPGME_STATUS_KEY_CREATED = 60, GPGME_STATUS_USERID_HINT = 61, GPGME_STATUS_UNEXPECTED = 62, GPGME_STATUS_INV_RECP = 63, GPGME_STATUS_NO_RECP = 64, GPGME_STATUS_ALREADY_SIGNED = 65, - GPGME_STATUS_SIGEXPIRED = 66, + GPGME_STATUS_SIGEXPIRED = 66, /* (legacy) */ GPGME_STATUS_EXPSIG = 67, GPGME_STATUS_EXPKEYSIG = 68, GPGME_STATUS_TRUNCATED = 69, @@ -534,7 +537,13 @@ typedef enum GPGME_STATUS_INV_SGNR = 82, GPGME_STATUS_NO_SGNR = 83, GPGME_STATUS_SUCCESS = 84, - GPGME_STATUS_DECRYPTION_INFO = 85 + GPGME_STATUS_DECRYPTION_INFO = 85, + GPGME_STATUS_PLAINTEXT_LENGTH = 86, + GPGME_STATUS_MOUNTPOINT = 87, + GPGME_STATUS_PINENTRY_LAUNCHED = 88, + GPGME_STATUS_ATTRIBUTE = 89, + GPGME_STATUS_BEGIN_SIGNING = 90, + GPGME_STATUS_KEY_NOT_CREATED = 91 } gpgme_status_code_t; @@ -626,6 +635,9 @@ struct _gpgme_subkey /* The serial number of a smart card holding this key or NULL. */ char *card_number; + + /* The name of the curve for ECC algorithms or NULL. */ + char *curve; }; typedef struct _gpgme_subkey *gpgme_subkey_t; @@ -1282,7 +1294,8 @@ typedef enum GPGME_ENCRYPT_ALWAYS_TRUST = 1, GPGME_ENCRYPT_NO_ENCRYPT_TO = 2, GPGME_ENCRYPT_PREPARE = 4, - GPGME_ENCRYPT_EXPECT_SIGN = 8 + GPGME_ENCRYPT_EXPECT_SIGN = 8, + GPGME_ENCRYPT_NO_COMPRESS = 16 } gpgme_encrypt_flags_t; @@ -1694,6 +1707,26 @@ gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key, gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out); + +/* Flags for the spawn operations. */ +#define GPGME_SPAWN_DETACHED 1 +#define GPGME_SPAWN_ALLOW_SET_FG 2 + + +/* Run the command FILE with the arguments in ARGV. Connect stdin to + DATAIN, stdout to DATAOUT, and STDERR to DATAERR. If one the data + streams is NULL, connect to /dev/null instead. */ +gpgme_error_t gpgme_op_spawn_start (gpgme_ctx_t ctx, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags); +gpgme_error_t gpgme_op_spawn (gpgme_ctx_t ctx, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags); + /* Key management functions. */ struct _gpgme_op_keylist_result @@ -2090,6 +2123,9 @@ const char *gpgme_check_version_internal (const char *req_version, gpgme_check_version_internal (req_version, \ offsetof (struct _gpgme_signature, validity)) +/* Return the default values for various directories. */ +const char *gpgme_get_dirinfo (const char *what); + /* Get the information about the configured and installed engines. A pointer to the first engine in the statically allocated linked list is returned in *INFO. If an error occurs, it is returned. The diff --git a/src/key.c b/src/key.c index 59d4908..1a68966 100644 --- a/src/key.c +++ b/src/key.c @@ -331,6 +331,8 @@ gpgme_key_unref (gpgme_key_t key) gpgme_subkey_t next = subkey->next; if (subkey->fpr) free (subkey->fpr); + if (subkey->curve) + free (subkey->curve); if (subkey->card_number) free (subkey->card_number); free (subkey); diff --git a/src/keylist.c b/src/keylist.c index 465b472..582b241 100644 --- a/src/keylist.c +++ b/src/keylist.c @@ -422,7 +422,7 @@ keylist_colon_handler (void *priv, char *line) RT_SSB, RT_SEC, RT_CRT, RT_CRS, RT_REV, RT_SPK } rectype = RT_NONE; -#define NR_FIELDS 16 +#define NR_FIELDS 17 char *field[NR_FIELDS]; int fields = 0; void *hook; @@ -537,7 +537,7 @@ keylist_colon_handler (void *priv, char *line) { int i = atoi (field[3]); if (i >= 1 && i < 128) - subkey->pubkey_algo = i; + subkey->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol); } /* Field 5 has the long keyid. Allow short key IDs for the @@ -584,6 +584,15 @@ keylist_colon_handler (void *priv, char *line) if (err) return err; } + + /* Field 17 has the curve name for ECC. */ + if (fields >= 17 && *field[16]) + { + subkey->curve = strdup (field[16]); + if (!subkey->curve) + return gpg_error_from_syserror (); + } + break; case RT_SUB: @@ -614,7 +623,7 @@ keylist_colon_handler (void *priv, char *line) { int i = atoi (field[3]); if (i >= 1 && i < 128) - subkey->pubkey_algo = i; + subkey->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol); } /* Field 5 has the long keyid. */ @@ -646,6 +655,15 @@ keylist_colon_handler (void *priv, char *line) if (err) return err; } + + /* Field 17 has the curve name for ECC. */ + if (fields >= 17 && *field[16]) + { + subkey->curve = strdup (field[16]); + if (!subkey->curve) + return gpg_error_from_syserror (); + } + break; case RT_UID: @@ -728,7 +746,7 @@ keylist_colon_handler (void *priv, char *line) { int i = atoi (field[3]); if (i >= 1 && i < 128) - keysig->pubkey_algo = i; + keysig->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol); } /* Field 5 has the long keyid. */ diff --git a/src/libgpgme.vers b/src/libgpgme.vers index fe18e6a..39663c1 100644 --- a/src/libgpgme.vers +++ b/src/libgpgme.vers @@ -87,6 +87,11 @@ GPGME_1.1 { gpgme_set_pinentry_mode; gpgme_get_pinentry_mode; + + gpgme_get_dirinfo; + + gpgme_op_spawn_start; + gpgme_op_spawn; }; diff --git a/src/posix-io.c b/src/posix-io.c index c315539..ac823fc 100644 --- a/src/posix-io.c +++ b/src/posix-io.c @@ -377,8 +377,6 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, int status; int signo; - (void)flags; - TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_spawn", path, "path=%s", path); i = 0; @@ -407,6 +405,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, /* Child. */ int seen_stdin = 0; + int seen_stdout = 0; int seen_stderr = 0; if (atfork) @@ -435,6 +434,8 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, if (child_fd == 0) seen_stdin = 1; + else if (child_fd == 1) + seen_stdout = 1; else if (child_fd == 2) seen_stderr = 1; @@ -456,56 +457,38 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, close (fd_list[i].fd); } - if (! seen_stdin || ! seen_stderr) + if (! seen_stdin || ! seen_stdout || !seen_stderr) { fd = open ("/dev/null", O_RDWR); if (fd == -1) { -#if 0 - /* FIXME: The debug file descriptor is not dup'ed - anyway, so we can't see this. */ - TRACE_LOG1 ("can't open `/dev/null': %s\n", - strerror (errno)); -#endif + /* The debug file descriptor is not dup'ed, so we + can't do a trace output. */ _exit (8); } - /* Make sure that the process has a connected stdin. */ + /* Make sure that the process has connected stdin. */ if (! seen_stdin && fd != 0) { if (dup2 (fd, 0) == -1) - { -#if 0 - /* FIXME: The debug file descriptor is not dup'ed - anyway, so we can't see this. */ - TRACE_LOG1 ("dup2(/dev/null, 0) failed: %s\n", - strerror (errno)); -#endif - _exit (8); - } + _exit (8); } + if (! seen_stdout && fd != 1) + { + if (dup2 (fd, 1) == -1) + _exit (8); + } if (! seen_stderr && fd != 2) - if (dup2 (fd, 2) == -1) - { -#if 0 - /* FIXME: The debug file descriptor is not dup'ed - anyway, so we can't see this. */ - TRACE_LOG1 ("dup2(dev/null, 2) failed: %s\n", - strerror (errno)); -#endif - _exit (8); - } - if (fd != 0 && fd != 2) + { + if (dup2 (fd, 2) == -1) + _exit (8); + } + if (fd != 0 && fd != 1 && fd != 2) close (fd); } execv (path, (char *const *) argv); /* Hmm: in that case we could write a special status code to the status-pipe. */ -#if 0 - /* FIXME: The debug file descriptor is not dup'ed anyway, so - we can't see this. */ - TRACE_LOG1 ("exec of `%s' failed\n", path); -#endif _exit (8); /* End child. */ } diff --git a/src/posix-util.c b/src/posix-util.c index fd44507..f7e0a17 100644 --- a/src/posix-util.c +++ b/src/posix-util.c @@ -29,48 +29,109 @@ #include "util.h" #include "sys-util.h" +#include "debug.h" -const char * -_gpgme_get_gpg_path (void) +/* These variables store the malloced name of alternative default + binaries. The are set only once by gpgme_set_global_flag. */ +static char *default_gpg_name; +static char *default_gpgconf_name; + +/* Set the default name for the gpg binary. This function may only be + called by gpgme_set_global_flag. Returns 0 on success. Leading + directories are removed from NAME. */ +int +_gpgme_set_default_gpg_name (const char *name) { -#ifdef GPG_PATH - return GPG_PATH; -#else - return NULL; -#endif + const char *s; + + s = strrchr (name, '/'); + if (s) + name = s + 1; + + if (!default_gpg_name) + default_gpg_name = strdup (name); + return !default_gpg_name; } -const char * -_gpgme_get_gpgsm_path (void) +/* Set the default name for the gpgconf binary. This function may + only be called by gpgme_set_global_flag. Returns 0 on success. + Leading directories are removed from NAME. */ +int +_gpgme_set_default_gpgconf_name (const char *name) { -#ifdef GPGSM_PATH - return GPGSM_PATH; -#else - return NULL; -#endif + const char *s; + + s = strrchr (name, '/'); + if (s) + name = s + 1; + + if (!default_gpgconf_name) + default_gpgconf_name = strdup (name); + return !default_gpgconf_name; } -const char * -_gpgme_get_gpgconf_path (void) + +/* Find an executable program PGM along the envvar PATH. */ +static char * +walk_path (const char *pgm) { -#ifdef GPGCONF_PATH - return GPGCONF_PATH; + const char *orig_path, *path, *s; + char *fname, *p; + +#ifdef FIXED_SEARCH_PATH + orig_path = FIXED_SEARCH_PATH; #else - return NULL; + orig_path = getenv ("PATH"); + if (!orig_path) + orig_path = "/bin:/usr/bin"; #endif + + fname = malloc (strlen (orig_path) + 1 + strlen (pgm) + 1); + if (!fname) + return NULL; + + path = orig_path; + for (;;) + { + for (s=path, p=fname; *s && *s != ':'; s++, p++) + *p = *s; + if (p != fname && p[-1] != '/') + *p++ = '/'; + strcpy (p, pgm); + if (!access (fname, X_OK)) + return fname; + if (!*s) + break; + path = s + 1; + } + + _gpgme_debug (DEBUG_ENGINE, "gpgme-walk_path: '%s' not found in '%s'", + pgm, orig_path); + + free (fname); + return NULL; } -const char * -_gpgme_get_g13_path (void) + +/* Return the full file name of the GPG binary. This function is used + if gpgconf was not found and thus it can be assumed that gpg2 is + not installed. This function is only called by get_gpgconf_item + and may not be called concurrently. */ +char * +_gpgme_get_gpg_path (void) { -#ifdef G13_PATH - return G13_PATH; -#else - return NULL; -#endif + return walk_path (default_gpg_name? default_gpg_name : "gpg"); } +/* This function is only called by get_gpgconf_item and may not be + called concurrently. */ +char * +_gpgme_get_gpgconf_path (void) +{ + return walk_path (default_gpgconf_name? default_gpgconf_name : "gpgconf"); +} + /* See w32-util.c */ int _gpgme_get_conf_int (const char *key, int *value) diff --git a/src/priv-io.h b/src/priv-io.h index 4058b3b..583f06a 100644 --- a/src/priv-io.h +++ b/src/priv-io.h @@ -75,11 +75,13 @@ int _gpgme_io_set_close_notify (int fd, _gpgme_close_notify_handler_t handler, void *value); int _gpgme_io_set_nonblocking (int fd); +/* Under Windows do not allocate a console. */ +#define IOSPAWN_FLAG_DETACHED 1 /* A flag to tell the spawn function to allow the child process to set the foreground window. */ -#define IOSPAWN_FLAG_ALLOW_SET_FG 1 +#define IOSPAWN_FLAG_ALLOW_SET_FG 2 /* Don't close any child FDs. */ -#define IOSPAWN_FLAG_NOCLOSE 2 +#define IOSPAWN_FLAG_NOCLOSE 4 /* Spawn the executable PATH with ARGV as arguments. After forking close all fds except for those in FD_LIST in the child, then diff --git a/src/sign.c b/src/sign.c index e910799..c55441d 100644 --- a/src/sign.c +++ b/src/sign.c @@ -142,7 +142,8 @@ gpgme_op_sign_result (gpgme_ctx_t ctx) static gpgme_error_t -parse_sig_created (char *args, gpgme_new_signature_t *sigp) +parse_sig_created (char *args, gpgme_new_signature_t *sigp, + gpgme_protocol_t protocol) { gpgme_new_signature_t sig; char *tail; @@ -180,7 +181,7 @@ parse_sig_created (char *args, gpgme_new_signature_t *sigp) } gpg_err_set_errno (0); - sig->pubkey_algo = strtol (args, &tail, 0); + sig->pubkey_algo = _gpgme_map_pk_algo (strtol (args, &tail, 0), protocol); if (errno || args == tail || *tail != ' ') { /* The crypto backend does not behave. */ @@ -263,7 +264,7 @@ _gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args) { case GPGME_STATUS_SIG_CREATED: opd->sig_created_seen = 1; - err = parse_sig_created (args, opd->last_sig_p); + err = parse_sig_created (args, opd->last_sig_p, ctx->protocol); if (err) return err; diff --git a/src/spawn.c b/src/spawn.c new file mode 100644 index 0000000..7b3b447 --- /dev/null +++ b/src/spawn.c @@ -0,0 +1,106 @@ +/* spawn.c - Run an arbitrary command with callbacks. + Copyright (C) 2014 Code GmbH + + This file is part of GPGME. + + GPGME 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. + + GPGME 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., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if HAVE_CONFIG_H +#include +#endif +#include + +#include "gpgme.h" +#include "debug.h" +#include "context.h" +#include "util.h" +#include "ops.h" + + +static gpgme_error_t +spawn_start (gpgme_ctx_t ctx, int synchronous, + const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags) +{ + gpgme_error_t err; + const char *tmp_argv[2]; + + if (ctx->protocol != GPGME_PROTOCOL_SPAWN) + return gpg_error (GPG_ERR_UNSUPPORTED_PROTOCOL); + + err = _gpgme_op_reset (ctx, synchronous); + if (err) + return err; + + if (!argv) + { + tmp_argv[0] = _gpgme_get_basename (file); + tmp_argv[1] = NULL; + argv = tmp_argv; + } + + return _gpgme_engine_op_spawn (ctx->engine, file, argv, + datain, dataout, dataerr, flags); +} + + +/* Run the command FILE with the arguments in ARGV. Connect stdin to + DATAIN, stdout to DATAOUT, and STDERR to DATAERR. If one the data + streams is NULL, connect to /dev/null instead. */ +gpgme_error_t +gpgme_op_spawn_start (gpgme_ctx_t ctx, const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags) +{ + gpgme_error_t err; + + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_spawn_start", ctx, "file=(%s) flaggs=%x", + file, flags); + + if (!ctx) + return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); + + err = spawn_start (ctx, 0, file, argv, datain, dataout, dataerr, flags); + return err; +} + + +/* Run the command FILE with the arguments in ARGV. Connect stdin to + DATAIN, stdout to DATAOUT, and STDERR to DATAERR. If one the data + streams is NULL, connect to /dev/null instead. Synchronous + variant. */ +gpgme_error_t +gpgme_op_spawn (gpgme_ctx_t ctx, const char *file, const char *argv[], + gpgme_data_t datain, + gpgme_data_t dataout, gpgme_data_t dataerr, + unsigned int flags) +{ + gpgme_error_t err; + + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_spawn", ctx, "file=(%s) flags=%x", + file, flags); + if (!ctx) + return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); + + err = spawn_start (ctx, 1, file, argv, datain, dataout, dataerr, flags); + + if (!err) + err = _gpgme_wait_one (ctx); + return TRACE_ERR (err); +} diff --git a/src/status-table.c b/src/status-table.c index 8060bdb..b936997 100644 --- a/src/status-table.c +++ b/src/status-table.c @@ -39,17 +39,21 @@ struct status_table_s { sorted at start up, too. */ static struct status_table_s status_table[] = { + { "ABORT", GPGME_STATUS_ABORT }, { "ALREADY_SIGNED", GPGME_STATUS_ALREADY_SIGNED }, + { "ATTRIBUTE", GPGME_STATUS_ATTRIBUTE }, { "BACKUP_KEY_CREATED", GPGME_STATUS_BACKUP_KEY_CREATED }, + { "BAD_PASSPHRASE", GPGME_STATUS_BAD_PASSPHRASE }, { "BADARMOR", GPGME_STATUS_BADARMOR }, { "BADMDC", GPGME_STATUS_BADMDC }, { "BADSIG", GPGME_STATUS_BADSIG }, - { "BAD_PASSPHRASE", GPGME_STATUS_BAD_PASSPHRASE }, { "BEGIN_DECRYPTION", GPGME_STATUS_BEGIN_DECRYPTION }, { "BEGIN_ENCRYPTION", GPGME_STATUS_BEGIN_ENCRYPTION }, + { "BEGIN_SIGNING", GPGME_STATUS_BEGIN_SIGNING }, { "BEGIN_STREAM", GPGME_STATUS_BEGIN_STREAM }, { "CARDCTRL", GPGME_STATUS_CARDCTRL }, { "DECRYPTION_FAILED", GPGME_STATUS_DECRYPTION_FAILED }, + { "DECRYPTION_INFO", GPGME_STATUS_DECRYPTION_INFO }, { "DECRYPTION_OKAY", GPGME_STATUS_DECRYPTION_OKAY }, { "DELETE_PROBLEM", GPGME_STATUS_DELETE_PROBLEM }, { "ENC_TO", GPGME_STATUS_ENC_TO }, @@ -68,35 +72,39 @@ static struct status_table_s status_table[] = { "GET_BOOL", GPGME_STATUS_GET_BOOL }, { "GET_HIDDEN", GPGME_STATUS_GET_HIDDEN }, { "GET_LINE", GPGME_STATUS_GET_LINE }, + { "GOOD_PASSPHRASE", GPGME_STATUS_GOOD_PASSPHRASE }, { "GOODMDC", GPGME_STATUS_GOODMDC }, { "GOODSIG", GPGME_STATUS_GOODSIG }, - { "GOOD_PASSPHRASE", GPGME_STATUS_GOOD_PASSPHRASE }, { "GOT_IT", GPGME_STATUS_GOT_IT }, - { "IMPORTED", GPGME_STATUS_IMPORTED }, { "IMPORT_OK", GPGME_STATUS_IMPORT_OK }, { "IMPORT_PROBLEM", GPGME_STATUS_IMPORT_PROBLEM }, { "IMPORT_RES", GPGME_STATUS_IMPORT_RES }, + { "IMPORTED", GPGME_STATUS_IMPORTED }, { "INV_RECP", GPGME_STATUS_INV_RECP }, { "INV_SGNR", GPGME_STATUS_INV_SGNR }, + { "KEY_CREATED", GPGME_STATUS_KEY_CREATED }, + { "KEY_NOT_CREATED", GPGME_STATUS_KEY_NOT_CREATED }, { "KEYEXPIRED", GPGME_STATUS_KEYEXPIRED }, { "KEYREVOKED", GPGME_STATUS_KEYREVOKED }, - { "KEY_CREATED", GPGME_STATUS_KEY_CREATED }, { "LEAVE", GPGME_STATUS_LEAVE }, { "MISSING_PASSPHRASE", GPGME_STATUS_MISSING_PASSPHRASE }, + { "MOUNTPOINT", GPGME_STATUS_MOUNTPOINT }, { "NEED_PASSPHRASE", GPGME_STATUS_NEED_PASSPHRASE }, { "NEED_PASSPHRASE_PIN", GPGME_STATUS_NEED_PASSPHRASE_PIN }, { "NEED_PASSPHRASE_SYM", GPGME_STATUS_NEED_PASSPHRASE_SYM }, { "NEWSIG", GPGME_STATUS_NEWSIG }, - { "NODATA", GPGME_STATUS_NODATA }, - { "NOTATION_DATA", GPGME_STATUS_NOTATION_DATA }, - { "NOTATION_NAME", GPGME_STATUS_NOTATION_NAME }, { "NO_PUBKEY", GPGME_STATUS_NO_PUBKEY }, { "NO_RECP", GPGME_STATUS_NO_RECP }, { "NO_SECKEY", GPGME_STATUS_NO_SECKEY }, { "NO_SGNR", GPGME_STATUS_NO_SGNR }, + { "NODATA", GPGME_STATUS_NODATA }, + { "NOTATION_DATA", GPGME_STATUS_NOTATION_DATA }, + { "NOTATION_NAME", GPGME_STATUS_NOTATION_NAME }, + { "PINENTRY_LAUNCHED", GPGME_STATUS_PINENTRY_LAUNCHED}, { "PKA_TRUST_BAD", GPGME_STATUS_PKA_TRUST_BAD }, { "PKA_TRUST_GOOD", GPGME_STATUS_PKA_TRUST_GOOD }, { "PLAINTEXT", GPGME_STATUS_PLAINTEXT }, + { "PLAINTEXT_LENGTH", GPGME_STATUS_PLAINTEXT_LENGTH }, { "POLICY_URL", GPGME_STATUS_POLICY_URL }, { "PROGRESS", GPGME_STATUS_PROGRESS }, { "REVKEYSIG", GPGME_STATUS_REVKEYSIG }, @@ -108,10 +116,10 @@ static struct status_table_s status_table[] = { "SHM_GET_BOOL", GPGME_STATUS_SHM_GET_BOOL }, { "SHM_GET_HIDDEN", GPGME_STATUS_SHM_GET_HIDDEN }, { "SHM_INFO", GPGME_STATUS_SHM_INFO }, - { "SIGEXPIRED", GPGME_STATUS_SIGEXPIRED }, { "SIG_CREATED", GPGME_STATUS_SIG_CREATED }, { "SIG_ID", GPGME_STATUS_SIG_ID }, { "SIG_SUBPACKET", GPGME_STATUS_SIG_SUBPACKET }, + { "SIGEXPIRED", GPGME_STATUS_SIGEXPIRED }, { "SUCCESS", GPGME_STATUS_SUCCESS }, { "TRUNCATED", GPGME_STATUS_TRUNCATED }, { "TRUST_FULLY", GPGME_STATUS_TRUST_FULLY }, @@ -122,7 +130,6 @@ static struct status_table_s status_table[] = { "UNEXPECTED", GPGME_STATUS_UNEXPECTED }, { "USERID_HINT", GPGME_STATUS_USERID_HINT }, { "VALIDSIG", GPGME_STATUS_VALIDSIG }, - { "ABORT", GPGME_STATUS_ABORT }, {NULL, 0} }; diff --git a/src/sys-util.h b/src/sys-util.h index f6506d3..7180fca 100644 --- a/src/sys-util.h +++ b/src/sys-util.h @@ -21,9 +21,10 @@ #define SYS_UTIL_H /*-- {posix,w32}-util.c --*/ -const char *_gpgme_get_gpg_path (void); -const char *_gpgme_get_gpgsm_path (void); -const char *_gpgme_get_gpgconf_path (void); -const char *_gpgme_get_g13_path (void); +int _gpgme_set_default_gpg_name (const char *name); +int _gpgme_set_default_gpgconf_name (const char *name); + +char *_gpgme_get_gpg_path (void); +char *_gpgme_get_gpgconf_path (void); #endif /* SYS_UTIL_H */ diff --git a/src/util.h b/src/util.h index c432980..365f1d8 100644 --- a/src/util.h +++ b/src/util.h @@ -51,6 +51,8 @@ int _gpgme_get_conf_int (const char *key, int *value); void _gpgme_allow_set_foreground_window (pid_t pid); /*-- dirinfo.c --*/ +void _gpgme_dirinfo_disable_gpgconf (void); + const char *_gpgme_get_default_homedir (void); const char *_gpgme_get_default_agent_socket (void); const char *_gpgme_get_default_gpg_name (void); @@ -58,6 +60,9 @@ const char *_gpgme_get_default_gpgsm_name (void); const char *_gpgme_get_default_g13_name (void); const char *_gpgme_get_default_gpgconf_name (void); const char *_gpgme_get_default_uisrv_socket (void); +int _gpgme_in_gpg_one_mode (void); + +const char *_gpgme_get_basename (const char *name); @@ -130,6 +135,8 @@ time_t _gpgme_parse_timestamp (const char *timestamp, char **endp); gpgme_error_t _gpgme_map_gnupg_error (char *err); +int _gpgme_map_pk_algo (int algo, gpgme_protocol_t protocol); + /* Retrieve the environment variable NAME and return a copy of it in a malloc()'ed buffer in *VALUE. If the environment variable is not @@ -151,25 +158,13 @@ const char *_gpgme_get_w32spawn_path (void); char *_gpgme_w32ce_get_debug_envvar (void); #endif /*HAVE_W32CE_SYSTEM*/ -/*-- Error codes not yet available in current gpg-error.h. --*/ -#ifndef GPG_ERR_UNFINISHED -#define GPG_ERR_UNFINISHED 199 -#endif -#ifndef GPG_ERR_NOT_OPERATIONAL -#define GPG_ERR_NOT_OPERATIONAL 176 -#endif -#ifndef GPG_ERR_MISSING_ISSUER_CERT -#define GPG_ERR_MISSING_ISSUER_CERT 185 -#endif -#ifdef ENABLE_ASSUAN #include /* System hooks for assuan integration. */ extern struct assuan_system_hooks _gpgme_assuan_system_hooks; extern struct assuan_malloc_hooks _gpgme_assuan_malloc_hooks; int _gpgme_assuan_log_cb (assuan_context_t ctx, void *hook, unsigned int cat, const char *msg); -#endif #endif /* UTIL_H */ diff --git a/src/verify.c b/src/verify.c index c32241a..37b2bd4 100644 --- a/src/verify.c +++ b/src/verify.c @@ -264,7 +264,8 @@ prepare_new_sig (op_data_t opd) } static gpgme_error_t -parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args) +parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args, + gpgme_protocol_t protocol) { gpgme_signature_t sig; char *end = strchr (args, ' '); @@ -318,7 +319,7 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args) if (!end) goto parse_err_sig_fail; gpg_err_set_errno (0); - sig->pubkey_algo = strtol (end, &tail, 0); + sig->pubkey_algo = _gpgme_map_pk_algo (strtol (end, &tail, 0), protocol); if (errno || end == tail || *tail != ' ') goto parse_err_sig_fail; end = tail; @@ -393,7 +394,7 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args) static gpgme_error_t -parse_valid_sig (gpgme_signature_t sig, char *args) +parse_valid_sig (gpgme_signature_t sig, char *args, gpgme_protocol_t protocol) { char *end = strchr (args, ' '); if (end) @@ -443,7 +444,8 @@ parse_valid_sig (gpgme_signature_t sig, char *args) { /* Parse the pubkey algo. */ gpg_err_set_errno (0); - sig->pubkey_algo = strtol (end, &tail, 0); + sig->pubkey_algo = _gpgme_map_pk_algo (strtol (end, &tail, 0), + protocol); if (errno || end == tail || *tail != ' ') return trace_gpg_error (GPG_ERR_INV_ENGINE); end = tail; @@ -703,11 +705,11 @@ _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) if (sig && !opd->did_prepare_new_sig) calc_sig_summary (sig); opd->only_newsig_seen = 0; - return parse_new_sig (opd, code, args); + return parse_new_sig (opd, code, args, ctx->protocol); case GPGME_STATUS_VALIDSIG: opd->only_newsig_seen = 0; - return sig ? parse_valid_sig (sig, args) + return sig ? parse_valid_sig (sig, args, ctx->protocol) : trace_gpg_error (GPG_ERR_INV_ENGINE); case GPGME_STATUS_NODATA: diff --git a/src/version.c b/src/version.c index 18825f8..15e5aee 100644 --- a/src/version.c +++ b/src/version.c @@ -321,7 +321,8 @@ _gpgme_get_program_version (const char *const file_name) cfd[0].fd = rp[1]; - status = _gpgme_io_spawn (file_name, argv, 0, cfd, NULL, NULL, NULL); + status = _gpgme_io_spawn (file_name, argv, + IOSPAWN_FLAG_DETACHED, cfd, NULL, NULL, NULL); if (status < 0) { _gpgme_io_close (rp[0]); diff --git a/src/w32-glib-io.c b/src/w32-glib-io.c index cb1bb3c..a5af4e6 100644 --- a/src/w32-glib-io.c +++ b/src/w32-glib-io.c @@ -662,7 +662,8 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, si.hStdError = INVALID_HANDLE_VALUE; cr_flags |= CREATE_SUSPENDED; - cr_flags |= DETACHED_PROCESS; + if ((flags & IOSPAWN_FLAG_DETACHED)) + cr_flags |= DETACHED_PROCESS; if (!CreateProcessA (_gpgme_get_w32spawn_path (), arg_string, &sec_attr, /* process security attributes */ diff --git a/src/w32-io.c b/src/w32-io.c index f9e4313..42961e3 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -1600,7 +1600,8 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, si.hStdError = INVALID_HANDLE_VALUE; cr_flags |= CREATE_SUSPENDED; - cr_flags |= DETACHED_PROCESS; + if ((flags & IOSPAWN_FLAG_DETACHED)) + cr_flags |= DETACHED_PROCESS; cr_flags |= GetPriorityClass (GetCurrentProcess ()); if (!CreateProcessA (_gpgme_get_w32spawn_path (), arg_string, diff --git a/src/w32-qt-io.cpp b/src/w32-qt-io.cpp index 358ff75..44655ec 100644 --- a/src/w32-qt-io.cpp +++ b/src/w32-qt-io.cpp @@ -3,17 +3,17 @@ Copyright (C) 2001, 2002, 2004, 2005, 2007 g10 Code GmbH This file is part of GPGME. - + GPGME 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. - + GPGME 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., 59 Temple Place - Suite 330, Boston, MA @@ -107,7 +107,7 @@ find_channel (int fd, int create) DeviceEntry* entry = new DeviceEntry; entry->iodev = new KDPipeIODevice (fd, QIODevice::ReadWrite|QIODevice::Unbuffered); - iodevice_table[fd] = entry; + iodevice_table[fd] = entry; } return iodevice_table[fd] ? iodevice_table[fd]->iodev : 0; } @@ -156,7 +156,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count) errno = EAGAIN; return TRACE_SYSRES( -1 ); } - + nread = chan->read ((char *) buffer, count); if (nread < 0) { @@ -289,8 +289,8 @@ _gpgme_io_close (int fd) notify_table[fd].value = NULL; } - /* Then do the close. */ - + /* Then do the close. */ + DeviceEntry* const entry = iodevice_table[fd]; if ( entry ) { if ( entry->unref() == 0 ) { @@ -303,7 +303,7 @@ _gpgme_io_close (int fd) _close( fd ); } - + return 0; } @@ -334,7 +334,7 @@ _gpgme_io_set_nonblocking (int fd) { DeviceEntry* const entry = iodevice_table[fd]; assert( entry ); - entry->blocking = false; + entry->blocking = false; TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_set_nonblocking", fd); return TRACE_SYSRES (0); } @@ -347,7 +347,7 @@ build_commandline (char **argv) int n = 0; char *buf; char *p; - + /* We have to quote some things because under Windows the program parses the commandline and does some unquoting. We enclose the whole argument in double-quotes, and escape literal double-quotes @@ -428,7 +428,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, TRACE_LOG2 ("argv[%2i] = %s", i, argv[i]); i++; } - + /* We do not inherit any handles by default, and just insert those handles we want the child to have afterwards. But some handle values occur on the command line, and we need to move @@ -450,7 +450,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, memset (&sec_attr, 0, sizeof sec_attr); sec_attr.nLength = sizeof sec_attr; sec_attr.bInheritHandle = FALSE; - + arg_string = build_commandline (args); free (args); if (!arg_string) @@ -459,7 +459,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, DeleteFile (tmp_name); return TRACE_SYSRES (-1); } - + memset (&si, 0, sizeof si); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; @@ -469,7 +469,8 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, si.hStdError = INVALID_HANDLE_VALUE; cr_flags |= CREATE_SUSPENDED; - cr_flags |= DETACHED_PROCESS; + if ((flags & IOSPAWN_FLAG_DETACHED)) + cr_flags |= DETACHED_PROCESS; if (!CreateProcessA (_gpgme_get_w32spawn_path (), arg_string, &sec_attr, /* process security attributes */ @@ -523,7 +524,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, /* Return the child name of this handle. */ fd_list[i].peer_name = (int) hd; } - + /* Write the handle translation information to the temporary file. */ { @@ -545,7 +546,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, { /* Strip the newline. */ len = strlen (line) - 1; - + /* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */ snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n", fd_list[i].fd, fd_list[i].dup_to, @@ -567,18 +568,18 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, close (tmp_fd); /* The temporary file is deleted by the gpgme-w32spawn process (hopefully). */ - + TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, " "dwProcessID=%d, dwThreadId=%d", - pi.hProcess, pi.hThread, + pi.hProcess, pi.hThread, (int) pi.dwProcessId, (int) pi.dwThreadId); if (r_pid) *r_pid = (pid_t)pi.dwProcessId; - + if (ResumeThread (pi.hThread) < 0) TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ()); - + if (!CloseHandle (pi.hThread)) TRACE_LOG1 ("CloseHandle of thread failed: ec=%d", (int) GetLastError ()); @@ -635,7 +636,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock) else fds[i].signaled = chan->waitForReadyRead( 1000 ) ? 1 : 0; TRACE_ADD1 (dbg_help, "w0x%x ", fds[i].fd); - if ( fds[i].signaled ) + if ( fds[i].signaled ) count++; } else if (fds[i].for_write) @@ -644,11 +645,11 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock) assert (chan); fds[i].signaled = nonblock ? ( chan->writeWouldBlock() ? 0 : 1 ) : 1; TRACE_ADD1 (dbg_help, "w0x%x ", fds[i].fd); - if ( fds[i].signaled ) + if ( fds[i].signaled ) count++; } } - TRACE_END (dbg_help, "]"); + TRACE_END (dbg_help, "]"); return TRACE_SYSRES (count); } diff --git a/src/w32-util.c b/src/w32-util.c index 2dc7655..daf3bd2 100644 --- a/src/w32-util.c +++ b/src/w32-util.c @@ -81,6 +81,11 @@ DEFINE_STATIC_LOCK (get_path_lock); file name of the DLL or executable which contains the gpgme code. */ static HMODULE my_hmodule; +/* These variables store the malloced name of alternative default + binaries. The are set only once by gpgme_set_global_flag. */ +static char *default_gpg_name; +static char *default_gpgconf_name; + #ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW @@ -151,6 +156,32 @@ wchar_to_utf8 (const wchar_t *string) } +/* Replace all forward slashes by backslashes. */ +static void +replace_slashes (char *string) +{ + for (; *string; string++) + if (*string == '/') + *string = '\\'; +} + + +/* Get the base name of NAME. Returns a pointer into NAME right after + the last slash or backslash or to NAME if no slash or backslash + exists. */ +static const char * +get_basename (const char *name) +{ + const char *mark, *s; + + for (mark=NULL, s=name; *s; s++) + if (*s == '/' || *s == '\\') + mark = s; + + return mark? mark+1 : name; +} + + void _gpgme_allow_set_foreground_window (pid_t pid) { @@ -373,8 +404,8 @@ find_program_in_inst_dir (const char *inst_dir, const char *name) char *dir; /* If an installation directory has been passed, this overrides a - location given bu the registry. The idea here is that we prefer - a a program installed alongside with gpgme. We don't want the + location given by the registry. The idea here is that we prefer + a program installed alongside with gpgme. We don't want the registry to override this to have a better isolation of an gpgme aware applications for other effects. Note that the "Install Directory" registry item has been used for ages in Gpg4win and @@ -424,72 +455,91 @@ find_program_at_standard_place (const char *name) } -const char * -_gpgme_get_gpg_path (void) +/* Set the default name for the gpg binary. This function may only be + called by gpgme_set_global_flag. Returns 0 on success. */ +int +_gpgme_set_default_gpg_name (const char *name) { - static char *gpg_program; - const char *inst_dir; - - inst_dir = _gpgme_get_inst_dir (); - LOCK (get_path_lock); - if (!gpg_program) - gpg_program = find_program_in_inst_dir (inst_dir, "gpg.exe"); - if (!gpg_program) - gpg_program = find_program_at_standard_place ("GNU\\GnuPG\\gpg.exe"); - UNLOCK (get_path_lock); - return gpg_program; + if (!default_gpg_name) + { + default_gpg_name = malloc (strlen (name) + 5); + if (default_gpg_name) + { + strcpy (stpcpy (default_gpg_name, name), ".exe"); + replace_slashes (default_gpg_name); + } + } + return !default_gpg_name; } - -const char * -_gpgme_get_gpgsm_path (void) +/* Set the default name for the gpgconf binary. This function may only be + called by gpgme_set_global_flag. Returns 0 on success. */ +int +_gpgme_set_default_gpgconf_name (const char *name) { - static char *gpgsm_program; - const char *inst_dir; - - inst_dir = _gpgme_get_inst_dir (); - LOCK (get_path_lock); - if (!gpgsm_program) - gpgsm_program = find_program_in_inst_dir (inst_dir, "gpgsm.exe"); - if (!gpgsm_program) - gpgsm_program = find_program_at_standard_place ("GNU\\GnuPG\\gpgsm.exe"); - UNLOCK (get_path_lock); - return gpgsm_program; + if (!default_gpgconf_name) + { + default_gpgconf_name = malloc (strlen (name) + 5); + if (default_gpgconf_name) + { + strcpy (stpcpy (default_gpgconf_name, name), ".exe"); + replace_slashes (default_gpgconf_name); + } + } + return !default_gpgconf_name; } -const char * -_gpgme_get_gpgconf_path (void) +/* Return the full file name of the GPG binary. This function is used + if gpgconf was not found and thus it can be assumed that gpg2 is + not installed. This function is only called by get_gpgconf_item + and may not be called concurrently. */ +char * +_gpgme_get_gpg_path (void) { - static char *gpgconf_program; - const char *inst_dir; + char *gpg; + const char *inst_dir, *name; inst_dir = _gpgme_get_inst_dir (); - LOCK (get_path_lock); - if (!gpgconf_program) - gpgconf_program = find_program_in_inst_dir (inst_dir, "gpgconf.exe"); - if (!gpgconf_program) - gpgconf_program - = find_program_at_standard_place ("GNU\\GnuPG\\gpgconf.exe"); - UNLOCK (get_path_lock); - return gpgconf_program; + gpg = find_program_in_inst_dir + (inst_dir, + default_gpg_name? get_basename (default_gpg_name) : "gpg.exe"); + if (!gpg) + { + name = (default_gpg_name? default_gpg_name + /* */ : "GNU\\GnuPG\\gpg.exe"); + gpg = find_program_at_standard_place (name); + if (!gpg) + _gpgme_debug (DEBUG_ENGINE, "_gpgme_get_gpg_path: '%s' not found", + name); + } + + return gpg; } -const char * -_gpgme_get_g13_path (void) +/* This function is only called by get_gpgconf_item and may not be + called concurrently. */ +char * +_gpgme_get_gpgconf_path (void) { - static char *g13_program; - const char *inst_dir; + char *gpgconf; + const char *inst_dir, *name; inst_dir = _gpgme_get_inst_dir (); - LOCK (get_path_lock); - if (!g13_program) - g13_program = find_program_in_inst_dir (inst_dir, "g13.exe"); - if (!g13_program) - g13_program = find_program_at_standard_place ("GNU\\GnuPG\\g13.exe"); - UNLOCK (get_path_lock); - return g13_program; + gpgconf = find_program_in_inst_dir + (inst_dir, + default_gpgconf_name? get_basename (default_gpgconf_name) : "gpgconf.exe"); + if (!gpgconf) + { + name = (default_gpgconf_name? default_gpgconf_name + /* */ : "GNU\\GnuPG\\gpgconf.exe"); + gpgconf = find_program_at_standard_place (name); + if (!gpgconf) + _gpgme_debug (DEBUG_ENGINE, "_gpgme_get_gpgconf_path: '%s' not found", + name); + } + return gpgconf; } diff --git a/tests/Makefile.in b/tests/Makefile.in index ff022db..90fcb02 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -99,6 +99,9 @@ run_export_SOURCES = run-export.c run_export_OBJECTS = run-export.$(OBJEXT) run_export_LDADD = $(LDADD) run_export_DEPENDENCIES = ../src/libgpgme.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent run_import_SOURCES = run-import.c run_import_OBJECTS = run-import.$(OBJEXT) run_import_LDADD = $(LDADD) @@ -133,13 +136,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = run-export.c run-import.c run-keylist.c run-sign.c \ run-verify.c t-data.c t-engine-info.c t-version.c DIST_SOURCES = run-export.c run-import.c run-keylist.c run-sign.c \ @@ -195,6 +211,7 @@ am__relativize = \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -225,7 +242,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -233,17 +249,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -406,28 +418,28 @@ clean-noinstPROGRAMS: rm -f $$list run-export$(EXEEXT): $(run_export_OBJECTS) $(run_export_DEPENDENCIES) $(EXTRA_run_export_DEPENDENCIES) @rm -f run-export$(EXEEXT) - $(LINK) $(run_export_OBJECTS) $(run_export_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(run_export_OBJECTS) $(run_export_LDADD) $(LIBS) run-import$(EXEEXT): $(run_import_OBJECTS) $(run_import_DEPENDENCIES) $(EXTRA_run_import_DEPENDENCIES) @rm -f run-import$(EXEEXT) - $(LINK) $(run_import_OBJECTS) $(run_import_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(run_import_OBJECTS) $(run_import_LDADD) $(LIBS) run-keylist$(EXEEXT): $(run_keylist_OBJECTS) $(run_keylist_DEPENDENCIES) $(EXTRA_run_keylist_DEPENDENCIES) @rm -f run-keylist$(EXEEXT) - $(LINK) $(run_keylist_OBJECTS) $(run_keylist_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(run_keylist_OBJECTS) $(run_keylist_LDADD) $(LIBS) run-sign$(EXEEXT): $(run_sign_OBJECTS) $(run_sign_DEPENDENCIES) $(EXTRA_run_sign_DEPENDENCIES) @rm -f run-sign$(EXEEXT) - $(LINK) $(run_sign_OBJECTS) $(run_sign_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(run_sign_OBJECTS) $(run_sign_LDADD) $(LIBS) run-verify$(EXEEXT): $(run_verify_OBJECTS) $(run_verify_DEPENDENCIES) $(EXTRA_run_verify_DEPENDENCIES) @rm -f run-verify$(EXEEXT) - $(LINK) $(run_verify_OBJECTS) $(run_verify_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(run_verify_OBJECTS) $(run_verify_LDADD) $(LIBS) t-data$(EXEEXT): $(t_data_OBJECTS) $(t_data_DEPENDENCIES) $(EXTRA_t_data_DEPENDENCIES) @rm -f t-data$(EXEEXT) - $(LINK) $(t_data_OBJECTS) $(t_data_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_data_OBJECTS) $(t_data_LDADD) $(LIBS) t-engine-info$(EXEEXT): $(t_engine_info_OBJECTS) $(t_engine_info_DEPENDENCIES) $(EXTRA_t_engine_info_DEPENDENCIES) @rm -f t-engine-info$(EXEEXT) - $(LINK) $(t_engine_info_OBJECTS) $(t_engine_info_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_engine_info_OBJECTS) $(t_engine_info_LDADD) $(LIBS) t-version$(EXEEXT): $(t_version_OBJECTS) $(t_version_DEPENDENCIES) $(EXTRA_t_version_DEPENDENCIES) @rm -f t-version$(EXEEXT) - $(LINK) $(t_version_OBJECTS) $(t_version_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_version_OBJECTS) $(t_version_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -445,25 +457,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-version.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index c9000c9..e72bd49 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -19,8 +19,8 @@ ## Process this file with automake to produce Makefile.in -GPG = @GPG@ -GPG_AGENT = @GPG_AGENT@ +GPG = gpg +GPG_AGENT = gpg-agent TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= diff --git a/tests/gpg/Makefile.in b/tests/gpg/Makefile.in index d15503b..8513d08 100644 --- a/tests/gpg/Makefile.in +++ b/tests/gpg/Makefile.in @@ -105,6 +105,9 @@ t_decrypt_SOURCES = t-decrypt.c t_decrypt_OBJECTS = t-decrypt.$(OBJEXT) t_decrypt_LDADD = $(LDADD) t_decrypt_DEPENDENCIES = ../../src/libgpgme.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent t_decrypt_verify_SOURCES = t-decrypt-verify.c t_decrypt_verify_OBJECTS = t-decrypt-verify.$(OBJEXT) t_decrypt_verify_LDADD = $(LDADD) @@ -194,13 +197,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = t-decrypt.c t-decrypt-verify.c t-edit.c t-encrypt.c \ t-encrypt-large.c t-encrypt-sign.c t-encrypt-sym.c \ t-eventloop.c t-export.c t-file-name.c t-genkey.c t-gpgconf.c \ @@ -226,6 +242,7 @@ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -256,7 +273,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -264,17 +280,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -381,7 +393,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -GPG_AGENT = @GPG_AGENT@ +GPG = gpg +GPG_AGENT = gpg-agent TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= # The keylist tests must come after the import and the edit test. @@ -458,70 +471,70 @@ clean-noinstPROGRAMS: rm -f $$list t-decrypt$(EXEEXT): $(t_decrypt_OBJECTS) $(t_decrypt_DEPENDENCIES) $(EXTRA_t_decrypt_DEPENDENCIES) @rm -f t-decrypt$(EXEEXT) - $(LINK) $(t_decrypt_OBJECTS) $(t_decrypt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_decrypt_OBJECTS) $(t_decrypt_LDADD) $(LIBS) t-decrypt-verify$(EXEEXT): $(t_decrypt_verify_OBJECTS) $(t_decrypt_verify_DEPENDENCIES) $(EXTRA_t_decrypt_verify_DEPENDENCIES) @rm -f t-decrypt-verify$(EXEEXT) - $(LINK) $(t_decrypt_verify_OBJECTS) $(t_decrypt_verify_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_decrypt_verify_OBJECTS) $(t_decrypt_verify_LDADD) $(LIBS) t-edit$(EXEEXT): $(t_edit_OBJECTS) $(t_edit_DEPENDENCIES) $(EXTRA_t_edit_DEPENDENCIES) @rm -f t-edit$(EXEEXT) - $(LINK) $(t_edit_OBJECTS) $(t_edit_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_edit_OBJECTS) $(t_edit_LDADD) $(LIBS) t-encrypt$(EXEEXT): $(t_encrypt_OBJECTS) $(t_encrypt_DEPENDENCIES) $(EXTRA_t_encrypt_DEPENDENCIES) @rm -f t-encrypt$(EXEEXT) - $(LINK) $(t_encrypt_OBJECTS) $(t_encrypt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_encrypt_OBJECTS) $(t_encrypt_LDADD) $(LIBS) t-encrypt-large$(EXEEXT): $(t_encrypt_large_OBJECTS) $(t_encrypt_large_DEPENDENCIES) $(EXTRA_t_encrypt_large_DEPENDENCIES) @rm -f t-encrypt-large$(EXEEXT) - $(LINK) $(t_encrypt_large_OBJECTS) $(t_encrypt_large_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_encrypt_large_OBJECTS) $(t_encrypt_large_LDADD) $(LIBS) t-encrypt-sign$(EXEEXT): $(t_encrypt_sign_OBJECTS) $(t_encrypt_sign_DEPENDENCIES) $(EXTRA_t_encrypt_sign_DEPENDENCIES) @rm -f t-encrypt-sign$(EXEEXT) - $(LINK) $(t_encrypt_sign_OBJECTS) $(t_encrypt_sign_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_encrypt_sign_OBJECTS) $(t_encrypt_sign_LDADD) $(LIBS) t-encrypt-sym$(EXEEXT): $(t_encrypt_sym_OBJECTS) $(t_encrypt_sym_DEPENDENCIES) $(EXTRA_t_encrypt_sym_DEPENDENCIES) @rm -f t-encrypt-sym$(EXEEXT) - $(LINK) $(t_encrypt_sym_OBJECTS) $(t_encrypt_sym_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_encrypt_sym_OBJECTS) $(t_encrypt_sym_LDADD) $(LIBS) t-eventloop$(EXEEXT): $(t_eventloop_OBJECTS) $(t_eventloop_DEPENDENCIES) $(EXTRA_t_eventloop_DEPENDENCIES) @rm -f t-eventloop$(EXEEXT) - $(LINK) $(t_eventloop_OBJECTS) $(t_eventloop_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_eventloop_OBJECTS) $(t_eventloop_LDADD) $(LIBS) t-export$(EXEEXT): $(t_export_OBJECTS) $(t_export_DEPENDENCIES) $(EXTRA_t_export_DEPENDENCIES) @rm -f t-export$(EXEEXT) - $(LINK) $(t_export_OBJECTS) $(t_export_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_export_OBJECTS) $(t_export_LDADD) $(LIBS) t-file-name$(EXEEXT): $(t_file_name_OBJECTS) $(t_file_name_DEPENDENCIES) $(EXTRA_t_file_name_DEPENDENCIES) @rm -f t-file-name$(EXEEXT) - $(LINK) $(t_file_name_OBJECTS) $(t_file_name_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_file_name_OBJECTS) $(t_file_name_LDADD) $(LIBS) t-genkey$(EXEEXT): $(t_genkey_OBJECTS) $(t_genkey_DEPENDENCIES) $(EXTRA_t_genkey_DEPENDENCIES) @rm -f t-genkey$(EXEEXT) - $(LINK) $(t_genkey_OBJECTS) $(t_genkey_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_genkey_OBJECTS) $(t_genkey_LDADD) $(LIBS) t-gpgconf$(EXEEXT): $(t_gpgconf_OBJECTS) $(t_gpgconf_DEPENDENCIES) $(EXTRA_t_gpgconf_DEPENDENCIES) @rm -f t-gpgconf$(EXEEXT) - $(LINK) $(t_gpgconf_OBJECTS) $(t_gpgconf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_gpgconf_OBJECTS) $(t_gpgconf_LDADD) $(LIBS) t-import$(EXEEXT): $(t_import_OBJECTS) $(t_import_DEPENDENCIES) $(EXTRA_t_import_DEPENDENCIES) @rm -f t-import$(EXEEXT) - $(LINK) $(t_import_OBJECTS) $(t_import_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_import_OBJECTS) $(t_import_LDADD) $(LIBS) t-keylist$(EXEEXT): $(t_keylist_OBJECTS) $(t_keylist_DEPENDENCIES) $(EXTRA_t_keylist_DEPENDENCIES) @rm -f t-keylist$(EXEEXT) - $(LINK) $(t_keylist_OBJECTS) $(t_keylist_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_keylist_OBJECTS) $(t_keylist_LDADD) $(LIBS) t-keylist-sig$(EXEEXT): $(t_keylist_sig_OBJECTS) $(t_keylist_sig_DEPENDENCIES) $(EXTRA_t_keylist_sig_DEPENDENCIES) @rm -f t-keylist-sig$(EXEEXT) - $(LINK) $(t_keylist_sig_OBJECTS) $(t_keylist_sig_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_keylist_sig_OBJECTS) $(t_keylist_sig_LDADD) $(LIBS) t-sig-notation$(EXEEXT): $(t_sig_notation_OBJECTS) $(t_sig_notation_DEPENDENCIES) $(EXTRA_t_sig_notation_DEPENDENCIES) @rm -f t-sig-notation$(EXEEXT) - $(LINK) $(t_sig_notation_OBJECTS) $(t_sig_notation_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_sig_notation_OBJECTS) $(t_sig_notation_LDADD) $(LIBS) t-sign$(EXEEXT): $(t_sign_OBJECTS) $(t_sign_DEPENDENCIES) $(EXTRA_t_sign_DEPENDENCIES) @rm -f t-sign$(EXEEXT) - $(LINK) $(t_sign_OBJECTS) $(t_sign_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_sign_OBJECTS) $(t_sign_LDADD) $(LIBS) t-signers$(EXEEXT): $(t_signers_OBJECTS) $(t_signers_DEPENDENCIES) $(EXTRA_t_signers_DEPENDENCIES) @rm -f t-signers$(EXEEXT) - $(LINK) $(t_signers_OBJECTS) $(t_signers_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_signers_OBJECTS) $(t_signers_LDADD) $(LIBS) t-thread1$(EXEEXT): $(t_thread1_OBJECTS) $(t_thread1_DEPENDENCIES) $(EXTRA_t_thread1_DEPENDENCIES) @rm -f t-thread1$(EXEEXT) - $(LINK) $(t_thread1_OBJECTS) $(t_thread1_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_thread1_OBJECTS) $(t_thread1_LDADD) $(LIBS) t-trustlist$(EXEEXT): $(t_trustlist_OBJECTS) $(t_trustlist_DEPENDENCIES) $(EXTRA_t_trustlist_DEPENDENCIES) @rm -f t-trustlist$(EXEEXT) - $(LINK) $(t_trustlist_OBJECTS) $(t_trustlist_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_trustlist_OBJECTS) $(t_trustlist_LDADD) $(LIBS) t-verify$(EXEEXT): $(t_verify_OBJECTS) $(t_verify_DEPENDENCIES) $(EXTRA_t_verify_DEPENDENCIES) @rm -f t-verify$(EXEEXT) - $(LINK) $(t_verify_OBJECTS) $(t_verify_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_verify_OBJECTS) $(t_verify_LDADD) $(LIBS) t-wait$(EXEEXT): $(t_wait_OBJECTS) $(t_wait_DEPENDENCIES) $(EXTRA_t_wait_DEPENDENCIES) @rm -f t-wait$(EXEEXT) - $(LINK) $(t_wait_OBJECTS) $(t_wait_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_wait_OBJECTS) $(t_wait_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -553,25 +566,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-wait.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/tests/gpg/t-keylist-sig.c b/tests/gpg/t-keylist-sig.c index 9482c74..ec30624 100644 --- a/tests/gpg/t-keylist-sig.c +++ b/tests/gpg/t-keylist-sig.c @@ -3,17 +3,17 @@ Copyright (C) 2001, 2003, 2004 g10 Code GmbH This file is part of GPGME. - + GPGME 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. - + GPGME 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., 59 Temple Place - Suite 330, Boston, MA @@ -53,7 +53,7 @@ struct unsigned int sig_class; int exportable; } sig; - } uid[3]; + } uid[3]; } keys[] = { @@ -71,7 +71,7 @@ keys[] = }; -int +int main (int argc, char **argv) { gpgme_error_t err; @@ -93,7 +93,7 @@ main (int argc, char **argv) err = gpgme_op_keylist_start (ctx, "Alpha", 0); fail_if_err (err); - + while (!(err = gpgme_op_keylist_next (ctx, &key))) { if (!keys[i].fpr) @@ -462,12 +462,9 @@ main (int argc, char **argv) key->uids->next->email); exit (1); } - /*FIXME: There is a bug in gpg 1.3.4 which duplicates a signaure - after importing the secret key. We disable this test for - now. */ -#ifdef __GNUC__ -#warning test disabled due to problems with gpg 1.3.4 generated key -#endif + /* Note: There is a bug in gpg 1.3.4 which duplicates a + signature after importing the secret key. Thus we disable + the second part of the check. */ if (key->uids && (!key->uids->next->signatures /*|| key->uids->next->signatures->next*/)) { fprintf (stderr, "Second user ID unexpected number of signatures\n"); diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am index 9086134..45b3b50 100644 --- a/tests/gpgsm/Makefile.am +++ b/tests/gpgsm/Makefile.am @@ -1,27 +1,27 @@ # Copyright (C) 2000 Werner Koch (dd9jn) # Copyright (C) 2001 g10 Code GmbH -# +# # This file is part of GPGME. -# +# # GPGME 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. -# +# # GPGME 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in -GPGSM = @GPGSM@ +GPGSM = gpgsm -TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= noinst_HEADERS = t-support.h TESTS = t-import t-keylist t-encrypt t-verify t-decrypt t-sign t-export @@ -41,7 +41,7 @@ noinst_PROGRAMS = $(TESTS) t-genkey cms-keylist cms-decrypt key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939 CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \ - random_seed S.gpg-agent + random_seed S.gpg-agent clean-local: -gpg-connect-agent KILLAGENT /bye @@ -51,7 +51,7 @@ all-local: ./pubring.kbx ./gpgsm.conf ./private-keys-v1.d/$(key_id).key ./trustl export GNUPGHOME := $(abs_builddir) -export GPG_AGENT_INFO := +export GPG_AGENT_INFO := ./pubring.kbx: $(srcdir)/cert_g10code_test1.der $(GPGSM) --import $(srcdir)/cert_g10code_test1.der diff --git a/tests/gpgsm/Makefile.in b/tests/gpgsm/Makefile.in index c5522f0..2aba85f 100644 --- a/tests/gpgsm/Makefile.in +++ b/tests/gpgsm/Makefile.in @@ -17,19 +17,19 @@ # Copyright (C) 2000 Werner Koch (dd9jn) # Copyright (C) 2001 g10 Code GmbH -# +# # This file is part of GPGME. -# +# # GPGME 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. -# +# # GPGME 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -101,6 +101,9 @@ cms_decrypt_SOURCES = cms-decrypt.c cms_decrypt_OBJECTS = cms-decrypt.$(OBJEXT) cms_decrypt_LDADD = $(LDADD) cms_decrypt_DEPENDENCIES = ../../src/libgpgme.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent cms_keylist_SOURCES = cms-keylist.c cms_keylist_OBJECTS = cms-keylist.$(OBJEXT) cms_keylist_LDADD = $(LDADD) @@ -143,13 +146,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = cms-decrypt.c cms-keylist.c t-decrypt.c t-encrypt.c \ t-export.c t-genkey.c t-import.c t-keylist.c t-sign.c \ t-verify.c @@ -169,6 +185,7 @@ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -199,7 +216,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -207,17 +223,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -324,7 +336,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= +GPGSM = gpgsm +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= noinst_HEADERS = t-support.h EXTRA_DIST = cert_dfn_pca01.der cert_dfn_pca15.der cert_g10code_test1.der \ $(key_id) @@ -334,7 +347,7 @@ AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ LDADD = ../../src/libgpgme.la key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939 CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \ - random_seed S.gpg-agent + random_seed S.gpg-agent all: all-am @@ -381,34 +394,34 @@ clean-noinstPROGRAMS: rm -f $$list cms-decrypt$(EXEEXT): $(cms_decrypt_OBJECTS) $(cms_decrypt_DEPENDENCIES) $(EXTRA_cms_decrypt_DEPENDENCIES) @rm -f cms-decrypt$(EXEEXT) - $(LINK) $(cms_decrypt_OBJECTS) $(cms_decrypt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cms_decrypt_OBJECTS) $(cms_decrypt_LDADD) $(LIBS) cms-keylist$(EXEEXT): $(cms_keylist_OBJECTS) $(cms_keylist_DEPENDENCIES) $(EXTRA_cms_keylist_DEPENDENCIES) @rm -f cms-keylist$(EXEEXT) - $(LINK) $(cms_keylist_OBJECTS) $(cms_keylist_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cms_keylist_OBJECTS) $(cms_keylist_LDADD) $(LIBS) t-decrypt$(EXEEXT): $(t_decrypt_OBJECTS) $(t_decrypt_DEPENDENCIES) $(EXTRA_t_decrypt_DEPENDENCIES) @rm -f t-decrypt$(EXEEXT) - $(LINK) $(t_decrypt_OBJECTS) $(t_decrypt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_decrypt_OBJECTS) $(t_decrypt_LDADD) $(LIBS) t-encrypt$(EXEEXT): $(t_encrypt_OBJECTS) $(t_encrypt_DEPENDENCIES) $(EXTRA_t_encrypt_DEPENDENCIES) @rm -f t-encrypt$(EXEEXT) - $(LINK) $(t_encrypt_OBJECTS) $(t_encrypt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_encrypt_OBJECTS) $(t_encrypt_LDADD) $(LIBS) t-export$(EXEEXT): $(t_export_OBJECTS) $(t_export_DEPENDENCIES) $(EXTRA_t_export_DEPENDENCIES) @rm -f t-export$(EXEEXT) - $(LINK) $(t_export_OBJECTS) $(t_export_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_export_OBJECTS) $(t_export_LDADD) $(LIBS) t-genkey$(EXEEXT): $(t_genkey_OBJECTS) $(t_genkey_DEPENDENCIES) $(EXTRA_t_genkey_DEPENDENCIES) @rm -f t-genkey$(EXEEXT) - $(LINK) $(t_genkey_OBJECTS) $(t_genkey_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_genkey_OBJECTS) $(t_genkey_LDADD) $(LIBS) t-import$(EXEEXT): $(t_import_OBJECTS) $(t_import_DEPENDENCIES) $(EXTRA_t_import_DEPENDENCIES) @rm -f t-import$(EXEEXT) - $(LINK) $(t_import_OBJECTS) $(t_import_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_import_OBJECTS) $(t_import_LDADD) $(LIBS) t-keylist$(EXEEXT): $(t_keylist_OBJECTS) $(t_keylist_DEPENDENCIES) $(EXTRA_t_keylist_DEPENDENCIES) @rm -f t-keylist$(EXEEXT) - $(LINK) $(t_keylist_OBJECTS) $(t_keylist_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_keylist_OBJECTS) $(t_keylist_LDADD) $(LIBS) t-sign$(EXEEXT): $(t_sign_OBJECTS) $(t_sign_DEPENDENCIES) $(EXTRA_t_sign_DEPENDENCIES) @rm -f t-sign$(EXEEXT) - $(LINK) $(t_sign_OBJECTS) $(t_sign_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_sign_OBJECTS) $(t_sign_LDADD) $(LIBS) t-verify$(EXEEXT): $(t_verify_OBJECTS) $(t_verify_DEPENDENCIES) $(EXTRA_t_verify_DEPENDENCIES) @rm -f t-verify$(EXEEXT) - $(LINK) $(t_verify_OBJECTS) $(t_verify_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_verify_OBJECTS) $(t_verify_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -428,25 +441,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-verify.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -761,7 +774,7 @@ all-local: ./pubring.kbx ./gpgsm.conf ./private-keys-v1.d/$(key_id).key ./trustl export GNUPGHOME := $(abs_builddir) -export GPG_AGENT_INFO := +export GPG_AGENT_INFO := ./pubring.kbx: $(srcdir)/cert_g10code_test1.der $(GPGSM) --import $(srcdir)/cert_g10code_test1.der diff --git a/tests/gpgsm/t-verify.c b/tests/gpgsm/t-verify.c index a26617e..901b46f 100644 --- a/tests/gpgsm/t-verify.c +++ b/tests/gpgsm/t-verify.c @@ -63,6 +63,8 @@ check_result (gpgme_verify_result_t result, int summary, char *fpr, fprintf (stderr, "%s:%i: Unexpected number of signatures\n", __FILE__, __LINE__); got_errors = 1; + if (!sig) + return; } if (sig->summary != summary) { @@ -71,7 +73,7 @@ check_result (gpgme_verify_result_t result, int summary, char *fpr, __FILE__, __LINE__, summary, sig->summary); got_errors = 1; } - if (strcmp (sig->fpr, fpr)) + if (sig->fpr && strcmp (sig->fpr, fpr)) { fprintf (stderr, "%s:%i: Unexpected fingerprint: %s\n", __FILE__, __LINE__, sig->fpr); diff --git a/tests/opassuan/Makefile.in b/tests/opassuan/Makefile.in index 8f9f2fb..bc45cbf 100644 --- a/tests/opassuan/Makefile.in +++ b/tests/opassuan/Makefile.in @@ -94,19 +94,35 @@ t_command_SOURCES = t-command.c t_command_OBJECTS = t-command.$(OBJEXT) t_command_LDADD = $(LDADD) t_command_DEPENDENCIES = ../../src/libgpgme.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = t-command.c DIST_SOURCES = t-command.c am__can_run_installinfo = \ @@ -122,6 +138,7 @@ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -152,7 +169,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -G13 = @G13@ GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -160,17 +176,13 @@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ -GPG = @GPG@ -GPGCONF = @GPGCONF@ GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGSM = @GPGSM@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GPG_PATH = @GPG_PATH@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -329,7 +341,7 @@ clean-noinstPROGRAMS: rm -f $$list t-command$(EXEEXT): $(t_command_OBJECTS) $(t_command_DEPENDENCIES) $(EXTRA_t_command_DEPENDENCIES) @rm -f t-command$(EXEEXT) - $(LINK) $(t_command_OBJECTS) $(t_command_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(t_command_OBJECTS) $(t_command_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -340,25 +352,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-command.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/tests/t-engine-info.c b/tests/t-engine-info.c index ec2e1e8..53f5b2f 100644 --- a/tests/t-engine-info.c +++ b/tests/t-engine-info.c @@ -28,6 +28,12 @@ #include +#define PGM "t-engine-info" + +static int verbose; + + + #define fail_if_err(err) \ do \ @@ -41,54 +47,88 @@ } \ while (0) - -void -check_engine_info (gpgme_engine_info_t info, gpgme_protocol_t protocol, - const char *file_name, const char *req_version) -{ - if (info->protocol != protocol) - { - fprintf (stderr, "Unexpected protocol %i (expected %i instead)\n", - info->protocol, protocol); - exit (1); - } - if (strcmp (info->file_name, file_name)) - { - fprintf (stderr, "Unexpected file name to executable %s (expected %s instead)\n", - info->file_name, file_name); - exit (1); - } - if (strcmp (info->req_version, req_version)) - { - fprintf (stderr, "Unexpected required version %s (expected %s instead)\n", - info->req_version, req_version); - exit (1); - } -} - int main (int argc, char **argv ) { + int last_argc = -1; gpgme_engine_info_t info; gpgme_error_t err; - gpgme_check_version (NULL); - err = gpgme_get_engine_info (&info); - fail_if_err (err); + if (argc) + { argc--; argv++; } - check_engine_info (info, GPGME_PROTOCOL_OpenPGP, GPG_PATH, NEED_GPG_VERSION); + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + { + fputs ("usage: " PGM " [options]\n" + "Options:\n" + " --set-global-flag KEY VALUE\n", + stdout); + exit (0); + } + else if (!strcmp (*argv, "--verbose")) + { + verbose++; + argc--; argv++; + } + else if (!strcmp (*argv, "--set-global-flag")) + { + argc--; argv++; + if (argc < 2) + { + fprintf (stderr, PGM ": not enough arguments for option\n"); + exit (1); + } + if (gpgme_set_global_flag (argv[0], argv[1])) + { + fprintf (stderr, PGM ": gpgme_set_global_flag failed\n"); + exit (1); + } + argc--; argv++; + argc--; argv++; + } + else if (!strncmp (*argv, "--", 2)) + { + fprintf (stderr, PGM ": unknown option '%s'\n", *argv); + exit (1); + } + } - info = info->next; -#ifdef GPGSM_PATH - check_engine_info (info, GPGME_PROTOCOL_CMS, GPGSM_PATH, NEED_GPGSM_VERSION); -#else - if (info) + if (argc) { - fprintf (stderr, "Unexpected engine info.\n"); + fprintf (stderr, PGM ": unexpected arguments\n"); exit (1); } -#endif + + gpgme_check_version (NULL); + + { + const char *keys[] = {"homedir", "agent-socket", "uiserver-socket", + "gpgconf-name", "gpg-name", "gpgsm-name", + "g13-name", NULL }; + const char *s; + int i; + + for (i=0; keys[i]; i++) + if ((s = gpgme_get_dirinfo (keys[i]))) + fprintf (stderr, "dirinfo: %s='%s'\n", keys[i], s); + } + + err = gpgme_get_engine_info (&info); + fail_if_err (err); + + for (; info; info = info->next) + fprintf (stdout, "protocol=%d engine='%s' v='%s' (min='%s') home='%s'\n", + info->protocol, info->file_name, info->version, info->req_version, + info->home_dir? info->home_dir : "[default]"); return 0; } -- cgit v1.2.3