Merge lp:~noskcaj/ubuntu/trusty/gpgme1.0/1.4.3 into lp:ubuntu/trusty/gpgme1.0

Proposed by Jackson Doak
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/trusty/gpgme1.0/1.4.3
Merge into: lp:ubuntu/trusty/gpgme1.0
Diff against target: 4204 lines (+1933/-793)
43 files modified
ChangeLog (+92/-0)
NEWS (+18/-0)
VERSION (+1/-1)
config.h.in (+5/-1)
configure (+257/-219)
configure.ac (+155/-113)
debian/changelog (+25/-3)
debian/control (+2/-2)
debian/libgpgme11.symbols (+4/-0)
doc/gpgme.info (+112/-111)
doc/gpgme.info-1 (+76/-14)
doc/gpgme.info-2 (+21/-8)
doc/gpgme.texi (+57/-1)
doc/stamp-vti (+4/-4)
doc/uiserver.texi (+20/-18)
doc/version.texi (+4/-4)
gpgme.spec (+1/-1)
lang/cl/gpgme.asd (+1/-1)
src/Makefile.am (+3/-2)
src/Makefile.in (+71/-62)
src/data-identify.c (+247/-0)
src/dirinfo.c (+147/-23)
src/engine-g13.c (+4/-4)
src/engine-gpg.c (+4/-4)
src/engine-gpgconf.c (+3/-3)
src/engine-gpgsm.c (+6/-4)
src/engine-uiserver.c (+2/-2)
src/gpgme-tool.c (+66/-7)
src/gpgme.def (+4/-0)
src/gpgme.h.in (+22/-0)
src/libgpgme.vers (+2/-0)
src/parsetlv.c (+103/-0)
src/parsetlv.h (+48/-0)
src/posix-util.c (+1/-23)
src/signers.c (+8/-0)
src/sys-util.h (+29/-0)
src/util.h (+5/-6)
src/w32-util.c (+179/-118)
tests/gpg/Makefile.am (+35/-14)
tests/gpg/Makefile.in (+36/-20)
tests/gpg/final.test (+4/-0)
tests/gpg/initial.test (+4/-0)
tests/gpg/start-stop-agent (+45/-0)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/gpgme1.0/1.4.3
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+192293@code.launchpad.net

Description of the change

Merge from debian

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

"This was missing in the previous upload" is confusing for the copy&pasted merge changelog, I dropped this bit. Uploaded, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2013-05-29 18:33:42 +0000
+++ ChangeLog 2013-10-23 07:14:02 +0000
@@ -1,3 +1,95 @@
12013-08-12 Werner Koch <wk@gnupg.org>
2
3 Release 1.4.3.
4 * configure.ac: Change LT version to C22/A11/R0.
5
6 Make test suite workable with GnuPG 2.1.
7 * tests/gpg/start-stop-agent: New.
8 * tests/gpg/initial.test: New.
9 * tests/gpg/final.test: New.
10 * tests/gpg/Makefile.am (c_tests): New.
11 (TESTS): Move all to c_tests. Add initial.test, final.test, and
12 c_tests.
13 (TESTS_ENVIRONMENT): Add C_ALL=C
14 (private_keys): New.
15 (EXTRA_DIST): Add new files.
16 (./private-keys-v1.d/gpg-sample.stamp): Copy private keys.
17 (all-local): Depend on gpg-sample.stamp.
18 * tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F: New.
19 * tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD: New.
20 * tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66: New.
21 * tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C: New.
22 * tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD: New.
23
24 Improve detection of default gpg by configure.
25 * configure.ac: Move test for gpgconf before test for gpg.
26 (GPG, GPGSM, G13): Use gpgconf instead of AC_PATH_PROG if possible.
27
282013-08-09 Werner Koch <wk@gnupg.org>
29
30 Add function gpgme_data_identify.
31 * src/gpgme.h.in (gpgme_data_type_t): New.
32 (gpgme_data_identify): New prototype.
33 * src/data-identify.c: New.
34 * src/parsetlv.c, src/parsetlv.h: New. Take from gpa.
35 * src/libgpgme.vers, src/gpgme.def: Add gpgme_data_identify.
36 * src/gpgme-tool.c (status): Add STATUS_IDENTIFY_RESULT.
37 (gt_identify): New.
38 (cmd_identify): New.
39
40 (hlp_passwd): Move close to cmd_passwd.
41
422013-08-02 Werner Koch <wk@gnupg.org>
43
44 Prefer GnuPG-2 engines over GnuPG-1.
45 * src/util.h: Move some prototypes to ...
46 * src/sys-util.h: New.
47 * src/Makefile.am (main_sources): Add sys-util.h.
48 * configure.ac (AH_VERBATIM): Add DIRSEP_C and DIRSEP_S.
49 * src/dirinfo.c: Include sys-util.h.
50 (WANT_GPG_NAME, WANT_GPGSM_NAME, WANT_G13_NAME)
51 (WANT_UISRV_SOCKET): New.
52 (dirinfo): Add corresponding fields.
53 (parse_output): Add arg COMPONENTS and set new fields.
54 (read_gpgconf_dirs): Add arg components and act upon it.
55 (get_gpgconf_item): Call read_gpgconf_dirs two times. Add debug
56 output.
57 (_gpgme_get_default_gpg_name): New.
58 (_gpgme_get_default_gpgsm_name): New.
59 (_gpgme_get_default_g13_name): New.
60 (_gpgme_get_default_gpgconf_name): New.
61 (_gpgme_get_default_uisrv_socket): New.
62 * src/engine-gpg.c, src/engine-g13.c, src/engine-gpgconf.c
63 * src/engine-gpgsm.c, src/engine-uiserver.c: Change to use
64 _gpgme_get_default_ instead of those from sys-util.h.
65 * src/posix-util.c (_gpgme_get_gpg_path): Include sys-util.h.
66 (_gpgme_get_uiserver_socket_path): Remove.
67 * src/w32-util.c (_gpgme_get_gpg_path): Include sys-util.h.
68 (_gpgme_get_uiserver_socket_path): Remove.
69
70 w32: Try to locate gpg in the gpgme installation dir.
71 * src/w32-util.c (my_hmodule): New.
72 (wchar_to_utf8): New.
73 (DllMain): New.
74 (_gpgme_get_inst_dir): New.
75 (find_program_in_dir): New.
76 (find_program_in_inst_dir): Add arg INST_DIR.
77 (_gpgme_get_gpg_path): Get inst_dir before acquiring the lock.
78 (_gpgme_get_gpgconf_path): Ditto.
79 (_gpgme_get_g13_path): Ditto.
80 (_gpgme_get_w32spawn_path): Ditto.
81
822013-07-31 Werner Koch <wk@gnupg.org>
83
84 doc: Add --binary option for the OUTPUT command of an uiserver.
85
862013-06-18 Werner Koch <wk@gnupg.org>
87
88 Add function gpgme_signers_count.
89 * src/signers.c (gpgme_signers_count): New.
90 * src/libgpgme.vers, src/gpgme.def: Add as external symbol.
91 * src/gpgme.h.in: Add prototype.
92
12013-05-28 Werner Koch <wk@gnupg.org>932013-05-28 Werner Koch <wk@gnupg.org>
294
3 Release 1.4.2.95 Release 1.4.2.
496
=== modified file 'NEWS'
--- NEWS 2013-05-29 18:33:42 +0000
+++ NEWS 2013-10-23 07:14:02 +0000
@@ -1,3 +1,21 @@
1Noteworthy changes in version 1.4.3 (2013-08-12)
2------------------------------------------------
3
4 * The default engine names are now taken from the output of gpgconf.
5 If gpgconf is not found the use of gpg 1 is assumed.
6
7 * Under Windows the default engines names are first searched in the
8 installation directory of the gpgme DLL.
9
10 * New function gpgme_data_identify to detect the type of a message.
11
12 * Interface changes relative to the 1.4.2 release:
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 gpgme_signers_count NEW.
15 gpgme_data_type_t NEW.
16 gpgme_data_identify NEW.
17
18
1Noteworthy changes in version 1.4.2 (2013-05-28)19Noteworthy changes in version 1.4.2 (2013-05-28)
2------------------------------------------------20------------------------------------------------
321
422
=== modified file 'VERSION'
--- VERSION 2013-05-29 18:33:42 +0000
+++ VERSION 2013-10-23 07:14:02 +0000
@@ -1,1 +1,1 @@
11.4.211.4.3
22
=== modified file 'config.h.in'
--- config.h.in 2013-05-14 20:29:20 +0000
+++ config.h.in 2013-10-23 07:14:02 +0000
@@ -205,11 +205,15 @@
205#undef REPLACE_TTYNAME_R205#undef REPLACE_TTYNAME_R
206206
207207
208/* Separators as used in $PATH. */208/* Separators as used in $PATH and file name. */
209#ifdef HAVE_DOSISH_SYSTEM209#ifdef HAVE_DOSISH_SYSTEM
210#define PATHSEP_C ';'210#define PATHSEP_C ';'
211#define DIRSEP_C '\\'
212#define DIRSEP_S "\\"
211#else213#else
212#define PATHSEP_C ':'214#define PATHSEP_C ':'
215#define DIRSEP_C '/'
216#define DIRSEP_S "/"
213#endif217#endif
214218
215219
216220
=== modified file 'configure'
--- configure 2013-05-29 18:33:42 +0000
+++ configure 2013-10-23 07:14:02 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for gpgme 1.4.2.3# Generated by GNU Autoconf 2.69 for gpgme 1.4.3.
4#4#
5# Report bugs to <http://bugs.gnupg.org>.5# Report bugs to <http://bugs.gnupg.org>.
6#6#
@@ -590,8 +590,8 @@
590# Identity of this package.590# Identity of this package.
591PACKAGE_NAME='gpgme'591PACKAGE_NAME='gpgme'
592PACKAGE_TARNAME='gpgme'592PACKAGE_TARNAME='gpgme'
593PACKAGE_VERSION='1.4.2'593PACKAGE_VERSION='1.4.3'
594PACKAGE_STRING='gpgme 1.4.2'594PACKAGE_STRING='gpgme 1.4.3'
595PACKAGE_BUGREPORT='http://bugs.gnupg.org'595PACKAGE_BUGREPORT='http://bugs.gnupg.org'
596PACKAGE_URL=''596PACKAGE_URL=''
597597
@@ -652,11 +652,6 @@
652HAVE_G13_FALSE652HAVE_G13_FALSE
653HAVE_G13_TRUE653HAVE_G13_TRUE
654G13654G13
655RUN_GPGCONF_TESTS_FALSE
656RUN_GPGCONF_TESTS_TRUE
657HAVE_GPGCONF_FALSE
658HAVE_GPGCONF_TRUE
659GPGCONF
660RUN_GPGSM_TESTS_FALSE655RUN_GPGSM_TESTS_FALSE
661RUN_GPGSM_TESTS_TRUE656RUN_GPGSM_TESTS_TRUE
662HAVE_GPGSM_FALSE657HAVE_GPGSM_FALSE
@@ -666,6 +661,11 @@
666RUN_GPG_TESTS_FALSE661RUN_GPG_TESTS_FALSE
667RUN_GPG_TESTS_TRUE662RUN_GPG_TESTS_TRUE
668GPG663GPG
664RUN_GPGCONF_TESTS_FALSE
665RUN_GPGCONF_TESTS_TRUE
666HAVE_GPGCONF_FALSE
667HAVE_GPGCONF_TRUE
668GPGCONF
669HAVE_ASSUAN_FALSE669HAVE_ASSUAN_FALSE
670HAVE_ASSUAN_TRUE670HAVE_ASSUAN_TRUE
671LIBASSUAN_LIBS671LIBASSUAN_LIBS
@@ -857,12 +857,12 @@
857with_gpgsm_version857with_gpgsm_version
858with_gpgconf_version858with_gpgconf_version
859with_g13_version859with_g13_version
860with_gpgconf
861enable_gpgconf_test
860with_gpg862with_gpg
861enable_gpg_test863enable_gpg_test
862with_gpgsm864with_gpgsm
863enable_gpgsm_test865enable_gpgsm_test
864with_gpgconf
865enable_gpgconf_test
866with_g13866with_g13
867enable_g13_test867enable_g13_test
868enable_fd_passing868enable_fd_passing
@@ -1420,7 +1420,7 @@
1420 # Omit some internal or obsolete options to make the list less imposing.1420 # Omit some internal or obsolete options to make the list less imposing.
1421 # This message is too long to be a string in the A/UX 3.1 sh.1421 # This message is too long to be a string in the A/UX 3.1 sh.
1422 cat <<_ACEOF1422 cat <<_ACEOF
1423\`configure' configures gpgme 1.4.2 to adapt to many kinds of systems.1423\`configure' configures gpgme 1.4.3 to adapt to many kinds of systems.
14241424
1425Usage: $0 [OPTION]... [VAR=VALUE]...1425Usage: $0 [OPTION]... [VAR=VALUE]...
14261426
@@ -1490,7 +1490,7 @@
14901490
1491if test -n "$ac_init_help"; then1491if test -n "$ac_init_help"; then
1492 case $ac_init_help in1492 case $ac_init_help in
1493 short | recursive ) echo "Configuration of gpgme 1.4.2:";;1493 short | recursive ) echo "Configuration of gpgme 1.4.3:";;
1494 esac1494 esac
1495 cat <<\_ACEOF1495 cat <<\_ACEOF
14961496
@@ -1511,9 +1511,9 @@
1511 --enable-w32-glib build GPGME Glib for W321511 --enable-w32-glib build GPGME Glib for W32
1512 --enable-w32-qt build GPGME Qt for W321512 --enable-w32-qt build GPGME Qt for W32
1513 --disable-largefile omit support for large files1513 --disable-largefile omit support for large files
1514 --disable-gpgconf-test disable GPGCONF run test
1514 --disable-gpg-test disable GPG run test1515 --disable-gpg-test disable GPG run test
1515 --disable-gpgsm-test disable GPGSM run test1516 --disable-gpgsm-test disable GPGSM run test
1516 --disable-gpgconf-test disable GPGCONF run test
1517 --disable-g13-test disable G13 run test1517 --disable-g13-test disable G13 run test
1518 --disable-fd-passing do not use FD passing1518 --disable-fd-passing do not use FD passing
15191519
@@ -1536,9 +1536,9 @@
1536 --with-gpgconf-version=VER1536 --with-gpgconf-version=VER
1537 require GPGCONF version VER1537 require GPGCONF version VER
1538 --with-g13-version=VER require G13 version VER1538 --with-g13-version=VER require G13 version VER
1539 --with-gpgconf=PATH use gpgconf binary at PATH
1539 --with-gpg=PATH use GnuPG binary at PATH1540 --with-gpg=PATH use GnuPG binary at PATH
1540 --with-gpgsm=PATH use GpgSM binary at PATH1541 --with-gpgsm=PATH use GpgSM binary at PATH
1541 --with-gpgconf=PATH use gpgconf binary at PATH
1542 --with-g13=PATH use g13 binary at PATH1542 --with-g13=PATH use g13 binary at PATH
15431543
1544Some influential environment variables:1544Some influential environment variables:
@@ -1620,7 +1620,7 @@
1620test -n "$ac_init_help" && exit $ac_status1620test -n "$ac_init_help" && exit $ac_status
1621if $ac_init_version; then1621if $ac_init_version; then
1622 cat <<\_ACEOF1622 cat <<\_ACEOF
1623gpgme configure 1.4.21623gpgme configure 1.4.3
1624generated by GNU Autoconf 2.691624generated by GNU Autoconf 2.69
16251625
1626Copyright (C) 2012 Free Software Foundation, Inc.1626Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2450,7 +2450,7 @@
2450This file contains any messages produced by compilers while2450This file contains any messages produced by compilers while
2451running configure, to aid debugging if configure makes a mistake.2451running configure, to aid debugging if configure makes a mistake.
24522452
2453It was created by gpgme $as_me 1.4.2, which was2453It was created by gpgme $as_me 1.4.3, which was
2454generated by GNU Autoconf 2.69. Invocation command line was2454generated by GNU Autoconf 2.69. Invocation command line was
24552455
2456 $ $0 $@2456 $ $0 $@
@@ -2813,10 +2813,10 @@
2813# (Interfaces added: AGE++)2813# (Interfaces added: AGE++)
2814# (Interfaces removed/changed: AGE=0)2814# (Interfaces removed/changed: AGE=0)
2815#2815#
2816LIBGPGME_LT_CURRENT=212816LIBGPGME_LT_CURRENT=22
2817# Subtract 2 from this value if you want to make the LFS transition an2817# Subtract 2 from this value if you want to make the LFS transition an
2818# ABI break. [Note to self: Remove this comment with the next regular break.]2818# ABI break. [Note to self: Remove this comment with the next regular break.]
2819LIBGPGME_LT_AGE=102819LIBGPGME_LT_AGE=11
2820LIBGPGME_LT_REVISION=02820LIBGPGME_LT_REVISION=0
28212821
2822# If the API is changed in an incompatible way: increment the next counter.2822# If the API is changed in an incompatible way: increment the next counter.
@@ -2864,6 +2864,8 @@
28642864
2865ac_config_headers="$ac_config_headers config.h"2865ac_config_headers="$ac_config_headers config.h"
28662866
2867# Note: For automake 1.13 add the option
2868# serial-tests
2867am__api_version='1.11'2869am__api_version='1.11'
28682870
2869# Find a good install program. We prefer a C program (faster),2871# Find a good install program. We prefer a C program (faster),
@@ -3302,7 +3304,7 @@
33023304
3303# Define the identity of the package.3305# Define the identity of the package.
3304 PACKAGE='gpgme'3306 PACKAGE='gpgme'
3305 VERSION='1.4.2'3307 VERSION='1.4.3'
33063308
33073309
3308cat >>confdefs.h <<_ACEOF3310cat >>confdefs.h <<_ACEOF
@@ -5995,7 +5997,7 @@
5995#define VERSION "$VERSION"5997#define VERSION "$VERSION"
5996_ACEOF5998_ACEOF
59975999
5998VERSION_NUMBER=0x0104026000VERSION_NUMBER=0x010403
59996001
60006002
6001# Don't default to build static libs.6003# Don't default to build static libs.
@@ -17323,7 +17325,7 @@
17323#17325#
17324# Provide information about the build.17326# Provide information about the build.
17325#17327#
17326BUILD_REVISION="009e26a"17328BUILD_REVISION="d788c35"
1732717329
1732817330
17329cat >>confdefs.h <<_ACEOF17331cat >>confdefs.h <<_ACEOF
@@ -17332,7 +17334,7 @@
1733217334
1733317335
17334BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`17336BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
17335BUILD_FILEVERSION="${BUILD_FILEVERSION}158"17337BUILD_FILEVERSION="${BUILD_FILEVERSION}55176"
1733617338
1733717339
17338BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`17340BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
@@ -18737,6 +18739,11 @@
1873718739
1873818740
18739cat >>confdefs.h <<_ACEOF18741cat >>confdefs.h <<_ACEOF
18742#define NEED_GPGCONF_VERSION "$NEED_GPGCONF_VERSION"
18743_ACEOF
18744
18745
18746cat >>confdefs.h <<_ACEOF
18740#define NEED_GPG_VERSION "$NEED_GPG_VERSION"18747#define NEED_GPG_VERSION "$NEED_GPG_VERSION"
18741_ACEOF18748_ACEOF
1874218749
@@ -18747,16 +18754,190 @@
1874718754
1874818755
18749cat >>confdefs.h <<_ACEOF18756cat >>confdefs.h <<_ACEOF
18750#define NEED_GPGCONF_VERSION "$NEED_GPGCONF_VERSION"
18751_ACEOF
18752
18753
18754cat >>confdefs.h <<_ACEOF
18755#define NEED_G13_VERSION "$NEED_G13_VERSION"18757#define NEED_G13_VERSION "$NEED_G13_VERSION"
18756_ACEOF18758_ACEOF
1875718759
1875818760
1875918761#
18762# Check for GPGCONF
18763#
18764gpgconf_usable_for_test=no
18765NO_OVERRIDE=no
18766
18767# Check whether --with-gpgconf was given.
18768if test "${with_gpgconf+set}" = set; then :
18769 withval=$with_gpgconf; GPGCONF=$withval
18770else
18771 NO_OVERRIDE=yes
18772fi
18773
18774if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
18775 GPGCONF=
18776 NO_OVERRIDE=yes
18777 if test "$cross_compiling" != "yes"; then
18778 # Extract the first word of "gpgconf", so it can be a program name with args.
18779set dummy gpgconf; ac_word=$2
18780{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18781$as_echo_n "checking for $ac_word... " >&6; }
18782if ${ac_cv_path_GPGCONF+:} false; then :
18783 $as_echo_n "(cached) " >&6
18784else
18785 case $GPGCONF in
18786 [\\/]* | ?:[\\/]*)
18787 ac_cv_path_GPGCONF="$GPGCONF" # Let the user override the test with a path.
18788 ;;
18789 *)
18790 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18791for as_dir in $PATH
18792do
18793 IFS=$as_save_IFS
18794 test -z "$as_dir" && as_dir=.
18795 for ac_exec_ext in '' $ac_executable_extensions; do
18796 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18797 ac_cv_path_GPGCONF="$as_dir/$ac_word$ac_exec_ext"
18798 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18799 break 2
18800 fi
18801done
18802 done
18803IFS=$as_save_IFS
18804
18805 ;;
18806esac
18807fi
18808GPGCONF=$ac_cv_path_GPGCONF
18809if test -n "$GPGCONF"; then
18810 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGCONF" >&5
18811$as_echo "$GPGCONF" >&6; }
18812else
18813 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18814$as_echo "no" >&6; }
18815fi
18816
18817
18818 fi
18819 if test -z "$GPGCONF"; then
18820 GPGCONF="$GPGCONF_DEFAULT"
18821 fi
18822fi
18823if test "$GPGCONF" = no; then
18824 if test "$NO_OVERRIDE" = "yes"; then
18825 if test "$cross_compiling" != "yes"; then
18826 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
18827***
18828*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
18829***" >&5
18830$as_echo "$as_me: WARNING:
18831***
18832*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
18833***" >&2;}
18834 else
18835 as_fn_error $? "
18836***
18837*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
18838***" "$LINENO" 5
18839 fi
18840 fi
18841else
18842
18843cat >>confdefs.h <<_ACEOF
18844#define GPGCONF_PATH "$GPGCONF"
18845_ACEOF
18846
18847
18848$as_echo "#define ENABLE_GPGCONF 1" >>confdefs.h
18849
18850fi
18851 if test "$GPGCONF" != "no"; then
18852 HAVE_GPGCONF_TRUE=
18853 HAVE_GPGCONF_FALSE='#'
18854else
18855 HAVE_GPGCONF_TRUE='#'
18856 HAVE_GPGCONF_FALSE=
18857fi
18858
18859
18860GPGCONF_VERSION=unknown
18861ok=maybe
18862if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
18863 ok=no
18864else
18865 if test "$cross_compiling" = "yes"; then
18866 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF version can not be checked when cross compiling" >&5
18867$as_echo "$as_me: WARNING: GPGCONF version can not be checked when cross compiling" >&2;}
18868 ok=no
18869 else
18870 if test ! -x "$GPGCONF"; then
18871 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF not executable, version check disabled" >&5
18872$as_echo "$as_me: WARNING: GPGCONF not executable, version check disabled" >&2;}
18873 ok=no
18874 fi
18875 fi
18876fi
18877if test "$ok" = "maybe"; then
18878 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGCONF >= $NEED_GPGCONF_VERSION" >&5
18879$as_echo_n "checking for GPGCONF >= $NEED_GPGCONF_VERSION... " >&6; }
18880 req_major=`echo $NEED_GPGCONF_VERSION | \
18881 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
18882 req_minor=`echo $NEED_GPGCONF_VERSION | \
18883 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
18884 req_micro=`echo $NEED_GPGCONF_VERSION | \
18885 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
18886 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[^0-9]*\(.*\)/\1/p'`
18887 major=`echo $GPGCONF_VERSION | \
18888 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
18889 minor=`echo $GPGCONF_VERSION | \
18890 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
18891 micro=`echo $GPGCONF_VERSION | \
18892 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
18893
18894 if test "$major" -gt "$req_major"; then
18895 ok=yes
18896 else
18897 if test "$major" -eq "$req_major"; then
18898 if test "$minor" -gt "$req_minor"; then
18899 ok=yes
18900 else
18901 if test "$minor" -eq "$req_minor"; then
18902 if test "$micro" -ge "$req_micro"; then
18903 ok=yes
18904 fi
18905 fi
18906 fi
18907 fi
18908 fi
18909 if test "$ok" = "yes"; then
18910 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
18911$as_echo "yes" >&6; }
18912 if test "$cross_compiling" != "yes"; then
18913 gpgconf_usable_for_test=yes
18914 fi
18915 else
18916 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18917$as_echo "no" >&6; }
18918 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&5
18919$as_echo "$as_me: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&2;}
18920 fi
18921fi
18922run_gpgconf_test="$ok"
18923# Check whether --enable-gpgconf-test was given.
18924if test "${enable_gpgconf_test+set}" = set; then :
18925 enableval=$enable_gpgconf_test; run_gpgconf_test=$enableval
18926fi
18927
18928 if test "$run_gpgconf_test" = "yes"; then
18929 RUN_GPGCONF_TESTS_TRUE=
18930 RUN_GPGCONF_TESTS_FALSE='#'
18931else
18932 RUN_GPGCONF_TESTS_TRUE='#'
18933 RUN_GPGCONF_TESTS_FALSE=
18934fi
18935
18936
18937
18938#
18939# Check for GPG
18940#
18760NO_OVERRIDE=no18941NO_OVERRIDE=no
1876118942
18762# Check whether --with-gpg was given.18943# Check whether --with-gpg was given.
@@ -18770,7 +18951,10 @@
18770 GPG=18951 GPG=
18771 NO_OVERRIDE=yes18952 NO_OVERRIDE=yes
18772 if test "$cross_compiling" != "yes"; then18953 if test "$cross_compiling" != "yes"; then
18773 # Extract the first word of "gpg", so it can be a program name with args.18954 if test "$gpgconf_usable_for_test" = "yes"; then
18955 GPG="`$GPGCONF --list-components | grep ^gpg: | cut -d: -f 3`"
18956 else
18957 # Extract the first word of "gpg", so it can be a program name with args.
18774set dummy gpg; ac_word=$218958set dummy gpg; ac_word=$2
18775{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&518959{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18776$as_echo_n "checking for $ac_word... " >&6; }18960$as_echo_n "checking for $ac_word... " >&6; }
@@ -18810,6 +18994,7 @@
18810fi18994fi
1881118995
1881218996
18997 fi
18813 fi18998 fi
18814 if test -z "$GPG"; then18999 if test -z "$GPG"; then
18815 GPG="$GPG_DEFAULT"19000 GPG="$GPG_DEFAULT"
@@ -18916,6 +19101,10 @@
1891619101
1891719102
1891819103
19104
19105#
19106# Check for GPGSM
19107#
18919NO_OVERRIDE=no19108NO_OVERRIDE=no
1892019109
18921# Check whether --with-gpgsm was given.19110# Check whether --with-gpgsm was given.
@@ -18929,7 +19118,10 @@
18929 GPGSM=19118 GPGSM=
18930 NO_OVERRIDE=yes19119 NO_OVERRIDE=yes
18931 if test "$cross_compiling" != "yes"; then19120 if test "$cross_compiling" != "yes"; then
18932 # Extract the first word of "gpgsm", so it can be a program name with args.19121 if test "$gpgconf_usable_for_test" = "yes"; then
19122 GPGSM="`$GPGCONF --list-components | grep ^gpgsm: | cut -d: -f 3`"
19123 else
19124 # Extract the first word of "gpgsm", so it can be a program name with args.
18933set dummy gpgsm; ac_word=$219125set dummy gpgsm; ac_word=$2
18934{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&519126{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18935$as_echo_n "checking for $ac_word... " >&6; }19127$as_echo_n "checking for $ac_word... " >&6; }
@@ -18969,6 +19161,7 @@
18969fi19161fi
1897019162
1897119163
19164 fi
18972 fi19165 fi
18973 if test -z "$GPGSM"; then19166 if test -z "$GPGSM"; then
18974 GPGSM="$GPGSM_DEFAULT"19167 GPGSM="$GPGSM_DEFAULT"
@@ -19087,176 +19280,9 @@
1908719280
1908819281
1908919282
19090NO_OVERRIDE=no19283#
1909119284# Check for G13
19092# Check whether --with-gpgconf was given.19285#
19093if test "${with_gpgconf+set}" = set; then :
19094 withval=$with_gpgconf; GPGCONF=$withval
19095else
19096 NO_OVERRIDE=yes
19097fi
19098
19099if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
19100 GPGCONF=
19101 NO_OVERRIDE=yes
19102 if test "$cross_compiling" != "yes"; then
19103 # Extract the first word of "gpgconf", so it can be a program name with args.
19104set dummy gpgconf; ac_word=$2
19105{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19106$as_echo_n "checking for $ac_word... " >&6; }
19107if ${ac_cv_path_GPGCONF+:} false; then :
19108 $as_echo_n "(cached) " >&6
19109else
19110 case $GPGCONF in
19111 [\\/]* | ?:[\\/]*)
19112 ac_cv_path_GPGCONF="$GPGCONF" # Let the user override the test with a path.
19113 ;;
19114 *)
19115 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19116for as_dir in $PATH
19117do
19118 IFS=$as_save_IFS
19119 test -z "$as_dir" && as_dir=.
19120 for ac_exec_ext in '' $ac_executable_extensions; do
19121 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19122 ac_cv_path_GPGCONF="$as_dir/$ac_word$ac_exec_ext"
19123 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19124 break 2
19125 fi
19126done
19127 done
19128IFS=$as_save_IFS
19129
19130 ;;
19131esac
19132fi
19133GPGCONF=$ac_cv_path_GPGCONF
19134if test -n "$GPGCONF"; then
19135 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGCONF" >&5
19136$as_echo "$GPGCONF" >&6; }
19137else
19138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19139$as_echo "no" >&6; }
19140fi
19141
19142
19143 fi
19144 if test -z "$GPGCONF"; then
19145 GPGCONF="$GPGCONF_DEFAULT"
19146 fi
19147fi
19148if test "$GPGCONF" = no; then
19149 if test "$NO_OVERRIDE" = "yes"; then
19150 if test "$cross_compiling" != "yes"; then
19151 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
19152***
19153*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
19154***" >&5
19155$as_echo "$as_me: WARNING:
19156***
19157*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
19158***" >&2;}
19159 else
19160 as_fn_error $? "
19161***
19162*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
19163***" "$LINENO" 5
19164 fi
19165 fi
19166else
19167
19168cat >>confdefs.h <<_ACEOF
19169#define GPGCONF_PATH "$GPGCONF"
19170_ACEOF
19171
19172
19173$as_echo "#define ENABLE_GPGCONF 1" >>confdefs.h
19174
19175fi
19176 if test "$GPGCONF" != "no"; then
19177 HAVE_GPGCONF_TRUE=
19178 HAVE_GPGCONF_FALSE='#'
19179else
19180 HAVE_GPGCONF_TRUE='#'
19181 HAVE_GPGCONF_FALSE=
19182fi
19183
19184
19185GPGCONF_VERSION=unknown
19186ok=maybe
19187if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
19188 ok=no
19189else
19190 if test "$cross_compiling" = "yes"; then
19191 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF version can not be checked when cross compiling" >&5
19192$as_echo "$as_me: WARNING: GPGCONF version can not be checked when cross compiling" >&2;}
19193 ok=no
19194 else
19195 if test ! -x "$GPGCONF"; then
19196 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF not executable, version check disabled" >&5
19197$as_echo "$as_me: WARNING: GPGCONF not executable, version check disabled" >&2;}
19198 ok=no
19199 fi
19200 fi
19201fi
19202if test "$ok" = "maybe"; then
19203 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGCONF >= $NEED_GPGCONF_VERSION" >&5
19204$as_echo_n "checking for GPGCONF >= $NEED_GPGCONF_VERSION... " >&6; }
19205 req_major=`echo $NEED_GPGCONF_VERSION | \
19206 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
19207 req_minor=`echo $NEED_GPGCONF_VERSION | \
19208 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
19209 req_micro=`echo $NEED_GPGCONF_VERSION | \
19210 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
19211 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[^0-9]*\(.*\)/\1/p'`
19212 major=`echo $GPGCONF_VERSION | \
19213 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
19214 minor=`echo $GPGCONF_VERSION | \
19215 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
19216 micro=`echo $GPGCONF_VERSION | \
19217 sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
19218
19219 if test "$major" -gt "$req_major"; then
19220 ok=yes
19221 else
19222 if test "$major" -eq "$req_major"; then
19223 if test "$minor" -gt "$req_minor"; then
19224 ok=yes
19225 else
19226 if test "$minor" -eq "$req_minor"; then
19227 if test "$micro" -ge "$req_micro"; then
19228 ok=yes
19229 fi
19230 fi
19231 fi
19232 fi
19233 fi
19234 if test "$ok" = "yes"; then
19235 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19236$as_echo "yes" >&6; }
19237 else
19238 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19239$as_echo "no" >&6; }
19240 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&5
19241$as_echo "$as_me: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&2;}
19242 fi
19243fi
19244run_gpgconf_test="$ok"
19245# Check whether --enable-gpgconf-test was given.
19246if test "${enable_gpgconf_test+set}" = set; then :
19247 enableval=$enable_gpgconf_test; run_gpgconf_test=$enableval
19248fi
19249
19250 if test "$run_gpgconf_test" = "yes"; then
19251 RUN_GPGCONF_TESTS_TRUE=
19252 RUN_GPGCONF_TESTS_FALSE='#'
19253else
19254 RUN_GPGCONF_TESTS_TRUE='#'
19255 RUN_GPGCONF_TESTS_FALSE=
19256fi
19257
19258
19259
19260NO_OVERRIDE=no19286NO_OVERRIDE=no
1926119287
19262# Check whether --with-g13 was given.19288# Check whether --with-g13 was given.
@@ -19270,7 +19296,14 @@
19270 G13=19296 G13=
19271 NO_OVERRIDE=yes19297 NO_OVERRIDE=yes
19272 if test "$cross_compiling" != "yes"; then19298 if test "$cross_compiling" != "yes"; then
19273 # Extract the first word of "g13", so it can be a program name with args.19299 if test "$gpgconf_usable_for_test" = "yes"; then
19300 G13="`$GPGCONF --list-components | grep ^g13: | cut -d: -f 3`"
19301 if test -z "$G13"; then
19302 # Use a hack if gpgconf has no support for g13.
19303 G13="`$GPGCONF --list-dirs | grep ^bindir: | cut -d: -f 2`/g13"
19304 fi
19305 else
19306 # Extract the first word of "g13", so it can be a program name with args.
19274set dummy g13; ac_word=$219307set dummy g13; ac_word=$2
19275{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&519308{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19276$as_echo_n "checking for $ac_word... " >&6; }19309$as_echo_n "checking for $ac_word... " >&6; }
@@ -19310,6 +19343,7 @@
19310fi19343fi
1931119344
1931219345
19346 fi
19313 fi19347 fi
19314 if test -z "$G13"; then19348 if test -z "$G13"; then
19315 G13="$G13_DEFAULT"19349 G13="$G13_DEFAULT"
@@ -19427,6 +19461,10 @@
1942719461
1942819462
1942919463
19464#
19465# Other checks
19466#
19467
19430# Check for funopen19468# Check for funopen
19431for ac_func in funopen19469for ac_func in funopen
19432do :19470do :
@@ -19889,6 +19927,14 @@
19889 as_fn_error $? "conditional \"HAVE_ASSUAN\" was never defined.19927 as_fn_error $? "conditional \"HAVE_ASSUAN\" was never defined.
19890Usually this means the macro was only invoked conditionally." "$LINENO" 519928Usually this means the macro was only invoked conditionally." "$LINENO" 5
19891fi19929fi
19930if test -z "${HAVE_GPGCONF_TRUE}" && test -z "${HAVE_GPGCONF_FALSE}"; then
19931 as_fn_error $? "conditional \"HAVE_GPGCONF\" was never defined.
19932Usually this means the macro was only invoked conditionally." "$LINENO" 5
19933fi
19934if test -z "${RUN_GPGCONF_TESTS_TRUE}" && test -z "${RUN_GPGCONF_TESTS_FALSE}"; then
19935 as_fn_error $? "conditional \"RUN_GPGCONF_TESTS\" was never defined.
19936Usually this means the macro was only invoked conditionally." "$LINENO" 5
19937fi
19892if test -z "${RUN_GPG_TESTS_TRUE}" && test -z "${RUN_GPG_TESTS_FALSE}"; then19938if test -z "${RUN_GPG_TESTS_TRUE}" && test -z "${RUN_GPG_TESTS_FALSE}"; then
19893 as_fn_error $? "conditional \"RUN_GPG_TESTS\" was never defined.19939 as_fn_error $? "conditional \"RUN_GPG_TESTS\" was never defined.
19894Usually this means the macro was only invoked conditionally." "$LINENO" 519940Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -19901,14 +19947,6 @@
19901 as_fn_error $? "conditional \"RUN_GPGSM_TESTS\" was never defined.19947 as_fn_error $? "conditional \"RUN_GPGSM_TESTS\" was never defined.
19902Usually this means the macro was only invoked conditionally." "$LINENO" 519948Usually this means the macro was only invoked conditionally." "$LINENO" 5
19903fi19949fi
19904if test -z "${HAVE_GPGCONF_TRUE}" && test -z "${HAVE_GPGCONF_FALSE}"; then
19905 as_fn_error $? "conditional \"HAVE_GPGCONF\" was never defined.
19906Usually this means the macro was only invoked conditionally." "$LINENO" 5
19907fi
19908if test -z "${RUN_GPGCONF_TESTS_TRUE}" && test -z "${RUN_GPGCONF_TESTS_FALSE}"; then
19909 as_fn_error $? "conditional \"RUN_GPGCONF_TESTS\" was never defined.
19910Usually this means the macro was only invoked conditionally." "$LINENO" 5
19911fi
19912if test -z "${HAVE_G13_TRUE}" && test -z "${HAVE_G13_FALSE}"; then19950if test -z "${HAVE_G13_TRUE}" && test -z "${HAVE_G13_FALSE}"; then
19913 as_fn_error $? "conditional \"HAVE_G13\" was never defined.19951 as_fn_error $? "conditional \"HAVE_G13\" was never defined.
19914Usually this means the macro was only invoked conditionally." "$LINENO" 519952Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -20322,7 +20360,7 @@
20322# report actual input values of CONFIG_FILES etc. instead of their20360# report actual input values of CONFIG_FILES etc. instead of their
20323# values after options handling.20361# values after options handling.
20324ac_log="20362ac_log="
20325This file was extended by gpgme $as_me 1.4.2, which was20363This file was extended by gpgme $as_me 1.4.3, which was
20326generated by GNU Autoconf 2.69. Invocation command line was20364generated by GNU Autoconf 2.69. Invocation command line was
2032720365
20328 CONFIG_FILES = $CONFIG_FILES20366 CONFIG_FILES = $CONFIG_FILES
@@ -20388,7 +20426,7 @@
20388cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=120426cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20389ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"20427ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
20390ac_cs_version="\\20428ac_cs_version="\\
20391gpgme config.status 1.4.220429gpgme config.status 1.4.3
20392configured by $0, generated by GNU Autoconf 2.69,20430configured by $0, generated by GNU Autoconf 2.69,
20393 with options \\"\$ac_cs_config\\"20431 with options \\"\$ac_cs_config\\"
2039420432
@@ -22682,16 +22720,16 @@
22682echo "22720echo "
22683 GPGME v${VERSION} has been configured as follows:22721 GPGME v${VERSION} has been configured as follows:
2268422722
22685 Revision: 009e26a (158)22723 Revision: d788c35 (55176)
22686 Platform: $host22724 Platform: $host
2268722725
22688 GnuPG path: $GPG22726 Gpgconf at: $GPGCONF
22689 GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION22727 Gpgconf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
22690 GpgSM path: $GPGSM22728 GPG at: $GPG
22691 GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION22729 GPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
22692 GpgConf path: $GPGCONF22730 Gpgsm at: $GPGSM
22693 GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION22731 Gpgsm version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
22694 G13 path: $G1322732 G13 at: $G13
22695 G13 version: $G13_VERSION, min. $NEED_G13_VERSION22733 G13 version: $G13_VERSION, min. $NEED_G13_VERSION
2269622734
22697 Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION22735 Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION
2269822736
=== modified file 'configure.ac'
--- configure.ac 2013-05-29 18:33:42 +0000
+++ configure.ac 2013-10-23 07:14:02 +0000
@@ -29,7 +29,7 @@
29# for the LT versions.29# for the LT versions.
30m4_define(mym4_version_major, [1])30m4_define(mym4_version_major, [1])
31m4_define(mym4_version_minor, [4])31m4_define(mym4_version_minor, [4])
32m4_define(mym4_version_micro, [2])32m4_define(mym4_version_micro, [3])
3333
34# Below is m4 magic to extract and compute the revision number, the34# Below is m4 magic to extract and compute the revision number, the
35# decimalized short revision number, a beta version string, and a flag35# decimalized short revision number, a beta version string, and a flag
@@ -55,10 +55,10 @@
55# (Interfaces added: AGE++)55# (Interfaces added: AGE++)
56# (Interfaces removed/changed: AGE=0)56# (Interfaces removed/changed: AGE=0)
57#57#
58LIBGPGME_LT_CURRENT=2158LIBGPGME_LT_CURRENT=22
59# Subtract 2 from this value if you want to make the LFS transition an59# Subtract 2 from this value if you want to make the LFS transition an
60# ABI break. [Note to self: Remove this comment with the next regular break.]60# ABI break. [Note to self: Remove this comment with the next regular break.]
61LIBGPGME_LT_AGE=1061LIBGPGME_LT_AGE=11
62LIBGPGME_LT_REVISION=062LIBGPGME_LT_REVISION=0
6363
64# If the API is changed in an incompatible way: increment the next counter.64# If the API is changed in an incompatible way: increment the next counter.
@@ -77,6 +77,8 @@
77AC_CONFIG_MACRO_DIR([m4])77AC_CONFIG_MACRO_DIR([m4])
78AC_CONFIG_SRCDIR(src/gpgme.h.in)78AC_CONFIG_SRCDIR(src/gpgme.h.in)
79AC_CONFIG_HEADER(config.h)79AC_CONFIG_HEADER(config.h)
80# Note: For automake 1.13 add the option
81# serial-tests
80AM_INIT_AUTOMAKE82AM_INIT_AUTOMAKE
81AM_MAINTAINER_MODE83AM_MAINTAINER_MODE
82AC_CANONICAL_HOST84AC_CANONICAL_HOST
@@ -443,16 +445,121 @@
443 NEED_G13_VERSION=0.0.0445 NEED_G13_VERSION=0.0.0
444fi446fi
445447
448AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION",
449 [Min. needed GPGCONF version.])
446AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",450AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
447 [Min. needed GnuPG version.])451 [Min. needed GnuPG version.])
448AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",452AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
449 [Min. needed GPGSM version.])453 [Min. needed GPGSM version.])
450AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION",
451 [Min. needed GPGCONF version.])
452AC_DEFINE_UNQUOTED(NEED_G13_VERSION, "$NEED_G13_VERSION",454AC_DEFINE_UNQUOTED(NEED_G13_VERSION, "$NEED_G13_VERSION",
453 [Min. needed G13 version.])455 [Min. needed G13 version.])
454456
455457#
458# Check for GPGCONF
459#
460gpgconf_usable_for_test=no
461NO_OVERRIDE=no
462AC_ARG_WITH(gpgconf,
463 AC_HELP_STRING([--with-gpgconf=PATH],
464 [use gpgconf binary at PATH]),
465 GPGCONF=$withval, NO_OVERRIDE=yes)
466if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
467 GPGCONF=
468 NO_OVERRIDE=yes
469 if test "$cross_compiling" != "yes"; then
470 AC_PATH_PROG(GPGCONF, gpgconf)
471 fi
472 if test -z "$GPGCONF"; then
473 GPGCONF="$GPGCONF_DEFAULT"
474 fi
475fi
476if test "$GPGCONF" = no; then
477 if test "$NO_OVERRIDE" = "yes"; then
478 if test "$cross_compiling" != "yes"; then
479 AC_MSG_WARN([
480***
481*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
482***])
483 else
484 AC_MSG_ERROR([
485***
486*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
487***])
488 fi
489 fi
490else
491 AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.])
492 AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled])
493fi
494AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no")
495
496dnl Check for GPGCONF version requirement.
497GPGCONF_VERSION=unknown
498ok=maybe
499if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
500 ok=no
501else
502 if test "$cross_compiling" = "yes"; then
503 AC_MSG_WARN([GPGCONF version can not be checked when cross compiling])
504 ok=no
505 else
506 if test ! -x "$GPGCONF"; then
507 AC_MSG_WARN([GPGCONF not executable, version check disabled])
508 ok=no
509 fi
510 fi
511fi
512if test "$ok" = "maybe"; then
513 AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION)
514 req_major=`echo $NEED_GPGCONF_VERSION | \
515 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
516 req_minor=`echo $NEED_GPGCONF_VERSION | \
517 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
518 req_micro=`echo $NEED_GPGCONF_VERSION | \
519 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
520 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
521 major=`echo $GPGCONF_VERSION | \
522 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
523 minor=`echo $GPGCONF_VERSION | \
524 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
525 micro=`echo $GPGCONF_VERSION | \
526 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
527
528 if test "$major" -gt "$req_major"; then
529 ok=yes
530 else
531 if test "$major" -eq "$req_major"; then
532 if test "$minor" -gt "$req_minor"; then
533 ok=yes
534 else
535 if test "$minor" -eq "$req_minor"; then
536 if test "$micro" -ge "$req_micro"; then
537 ok=yes
538 fi
539 fi
540 fi
541 fi
542 fi
543 if test "$ok" = "yes"; then
544 AC_MSG_RESULT(yes)
545 if test "$cross_compiling" != "yes"; then
546 gpgconf_usable_for_test=yes
547 fi
548 else
549 AC_MSG_RESULT(no)
550 AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION])
551 fi
552fi
553run_gpgconf_test="$ok"
554AC_ARG_ENABLE(gpgconf-test,
555 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]),
556 run_gpgconf_test=$enableval)
557AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
558
559
560#
561# Check for GPG
562#
456NO_OVERRIDE=no563NO_OVERRIDE=no
457AC_ARG_WITH(gpg,564AC_ARG_WITH(gpg,
458 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),565 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
@@ -461,7 +568,11 @@
461 GPG=568 GPG=
462 NO_OVERRIDE=yes569 NO_OVERRIDE=yes
463 if test "$cross_compiling" != "yes"; then570 if test "$cross_compiling" != "yes"; then
464 AC_PATH_PROG(GPG, gpg)571 if test "$gpgconf_usable_for_test" = "yes"; then
572 GPG="`$GPGCONF --list-components | grep ^gpg: | cut -d: -f 3`"
573 else
574 AC_PATH_PROG(GPG, gpg)
575 fi
465 fi576 fi
466 if test -z "$GPG"; then577 if test -z "$GPG"; then
467 GPG="$GPG_DEFAULT"578 GPG="$GPG_DEFAULT"
@@ -546,6 +657,10 @@
546AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")657AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
547AC_SUBST(GPG_PATH)658AC_SUBST(GPG_PATH)
548659
660
661#
662# Check for GPGSM
663#
549NO_OVERRIDE=no664NO_OVERRIDE=no
550AC_ARG_WITH(gpgsm,665AC_ARG_WITH(gpgsm,
551 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),666 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
@@ -554,7 +669,11 @@
554 GPGSM=669 GPGSM=
555 NO_OVERRIDE=yes670 NO_OVERRIDE=yes
556 if test "$cross_compiling" != "yes"; then671 if test "$cross_compiling" != "yes"; then
557 AC_PATH_PROG(GPGSM, gpgsm)672 if test "$gpgconf_usable_for_test" = "yes"; then
673 GPGSM="`$GPGCONF --list-components | grep ^gpgsm: | cut -d: -f 3`"
674 else
675 AC_PATH_PROG(GPGSM, gpgsm)
676 fi
558 fi677 fi
559 if test -z "$GPGSM"; then678 if test -z "$GPGSM"; then
560 GPGSM="$GPGSM_DEFAULT"679 GPGSM="$GPGSM_DEFAULT"
@@ -642,102 +761,9 @@
642AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")761AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
643762
644763
645NO_OVERRIDE=no764#
646AC_ARG_WITH(gpgconf,765# Check for G13
647 AC_HELP_STRING([--with-gpgconf=PATH],766#
648 [use gpgconf binary at PATH]),
649 GPGCONF=$withval, NO_OVERRIDE=yes)
650if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
651 GPGCONF=
652 NO_OVERRIDE=yes
653 if test "$cross_compiling" != "yes"; then
654 AC_PATH_PROG(GPGCONF, gpgconf)
655 fi
656 if test -z "$GPGCONF"; then
657 GPGCONF="$GPGCONF_DEFAULT"
658 fi
659fi
660if test "$GPGCONF" = no; then
661 if test "$NO_OVERRIDE" = "yes"; then
662 if test "$cross_compiling" != "yes"; then
663 AC_MSG_WARN([
664***
665*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
666***])
667 else
668 AC_MSG_ERROR([
669***
670*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
671***])
672 fi
673 fi
674else
675 AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.])
676 AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled])
677fi
678AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no")
679
680dnl Check for GPGCONF version requirement.
681GPGCONF_VERSION=unknown
682ok=maybe
683if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
684 ok=no
685else
686 if test "$cross_compiling" = "yes"; then
687 AC_MSG_WARN([GPGCONF version can not be checked when cross compiling])
688 ok=no
689 else
690 if test ! -x "$GPGCONF"; then
691 AC_MSG_WARN([GPGCONF not executable, version check disabled])
692 ok=no
693 fi
694 fi
695fi
696if test "$ok" = "maybe"; then
697 AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION)
698 req_major=`echo $NEED_GPGCONF_VERSION | \
699 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
700 req_minor=`echo $NEED_GPGCONF_VERSION | \
701 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
702 req_micro=`echo $NEED_GPGCONF_VERSION | \
703 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
704 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
705 major=`echo $GPGCONF_VERSION | \
706 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
707 minor=`echo $GPGCONF_VERSION | \
708 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
709 micro=`echo $GPGCONF_VERSION | \
710 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
711
712 if test "$major" -gt "$req_major"; then
713 ok=yes
714 else
715 if test "$major" -eq "$req_major"; then
716 if test "$minor" -gt "$req_minor"; then
717 ok=yes
718 else
719 if test "$minor" -eq "$req_minor"; then
720 if test "$micro" -ge "$req_micro"; then
721 ok=yes
722 fi
723 fi
724 fi
725 fi
726 fi
727 if test "$ok" = "yes"; then
728 AC_MSG_RESULT(yes)
729 else
730 AC_MSG_RESULT(no)
731 AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION])
732 fi
733fi
734run_gpgconf_test="$ok"
735AC_ARG_ENABLE(gpgconf-test,
736 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]),
737 run_gpgconf_test=$enableval)
738AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
739
740
741NO_OVERRIDE=no767NO_OVERRIDE=no
742AC_ARG_WITH(g13,768AC_ARG_WITH(g13,
743 AC_HELP_STRING([--with-g13=PATH],769 AC_HELP_STRING([--with-g13=PATH],
@@ -747,7 +773,15 @@
747 G13=773 G13=
748 NO_OVERRIDE=yes774 NO_OVERRIDE=yes
749 if test "$cross_compiling" != "yes"; then775 if test "$cross_compiling" != "yes"; then
750 AC_PATH_PROG(G13, g13)776 if test "$gpgconf_usable_for_test" = "yes"; then
777 G13="`$GPGCONF --list-components | grep ^g13: | cut -d: -f 3`"
778 if test -z "$G13"; then
779 # Use a hack if gpgconf has no support for g13.
780 G13="`$GPGCONF --list-dirs | grep ^bindir: | cut -d: -f 2`/g13"
781 fi
782 else
783 AC_PATH_PROG(G13, g13)
784 fi
751 fi785 fi
752 if test -z "$G13"; then786 if test -z "$G13"; then
753 G13="$G13_DEFAULT"787 G13="$G13_DEFAULT"
@@ -834,6 +868,10 @@
834AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")868AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
835869
836870
871#
872# Other checks
873#
874
837# Check for funopen875# Check for funopen
838AC_CHECK_FUNCS(funopen)876AC_CHECK_FUNCS(funopen)
839if test $ac_cv_func_funopen != yes; then877if test $ac_cv_func_funopen != yes; then
@@ -920,11 +958,15 @@
920# Add a few constants to help porting to W32958# Add a few constants to help porting to W32
921AH_VERBATIM([SEPCONSTANTS],959AH_VERBATIM([SEPCONSTANTS],
922[960[
923/* Separators as used in $PATH. */961/* Separators as used in $PATH and file name. */
924#ifdef HAVE_DOSISH_SYSTEM962#ifdef HAVE_DOSISH_SYSTEM
925#define PATHSEP_C ';'963#define PATHSEP_C ';'
964#define DIRSEP_C '\\'
965#define DIRSEP_S "\\"
926#else966#else
927#define PATHSEP_C ':'967#define PATHSEP_C ':'
968#define DIRSEP_C '/'
969#define DIRSEP_S "/"
928#endif970#endif
929])971])
930972
@@ -1025,13 +1067,13 @@
1025 Revision: mym4_revision (mym4_revision_dec)1067 Revision: mym4_revision (mym4_revision_dec)
1026 Platform: $host1068 Platform: $host
10271069
1028 GnuPG path: $GPG1070 Gpgconf at: $GPGCONF
1029 GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION1071 Gpgconf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
1030 GpgSM path: $GPGSM1072 GPG at: $GPG
1031 GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION1073 GPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
1032 GpgConf path: $GPGCONF1074 Gpgsm at: $GPGSM
1033 GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION1075 Gpgsm version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
1034 G13 path: $G131076 G13 at: $G13
1035 G13 version: $G13_VERSION, min. $NEED_G13_VERSION1077 G13 version: $G13_VERSION, min. $NEED_G13_VERSION
10361078
1037 Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION1079 Assuan version: $libassuan_config_version, min. $NEED_LIBASSUAN_VERSION
10381080
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-30 10:34:24 +0000
+++ debian/changelog 2013-10-23 07:14:02 +0000
@@ -1,3 +1,28 @@
1gpgme1.0 (1.4.3-0.1ubuntu1) trusty; urgency=low
2
3 * Merge from debian unstable. Remaining changes:
4 - debian/rules: Switch back to using /usr/bin/gpg and add back gnupg build
5 dependency, as we don't install gnupg2 by default. This was missing in the
6 previous upload, and unbreaks nautilus-dropbox, seahorse, bzr, and other
7 libgpgme consumers.
8 - debian/control: Depends on "gnupg | gnupg2" rather than gnupg2,
9 default to the old version since the new one depends on gpg-agent,
10 pinentry-gtk2, and a bunch of other packages we don't need/want in the
11 default installation
12
13 -- Jackson Doak <noskcaj@ubuntu.com> Wed, 23 Oct 2013 18:01:04 +1100
14
15gpgme1.0 (1.4.3-0.1) unstable; urgency=low
16
17 * NMU
18 * New upstream release.
19 * debian/control (Build-Depends): Dropped dirmngr (closes: #712813). It is
20 not necessary for the build.
21 (Vcs-Browser, Vcs-Svn): Fixed vcs-field-not-canonical.
22 * debian/libgpgme11.symbols: Updated symbols file.
23
24 -- Daniel Leidert <dleidert@debian.org> Mon, 12 Aug 2013 22:33:16 +0200
25
1gpgme1.0 (1.4.2-0.1ubuntu3) saucy; urgency=low26gpgme1.0 (1.4.2-0.1ubuntu3) saucy; urgency=low
227
3 * debian/rules: Switch back to using /usr/bin/gpg and add back gnupg build28 * debian/rules: Switch back to using /usr/bin/gpg and add back gnupg build
@@ -536,6 +561,3 @@
536561
537 -- Jose Carlos Garcia Sogo <jose@jaimedelamo.eu.org> Mon, 30 Apr 2001 19:34:26 +0200562 -- Jose Carlos Garcia Sogo <jose@jaimedelamo.eu.org> Mon, 30 Apr 2001 19:34:26 +0200
538563
539Local variables:
540mode: debian-changelog
541End:
542564
=== modified file 'debian/control'
--- debian/control 2013-07-30 10:34:24 +0000
+++ debian/control 2013-10-23 07:14:02 +0000
@@ -14,8 +14,8 @@
14 scdaemon14 scdaemon
15Standards-Version: 3.9.415Standards-Version: 3.9.4
16Homepage: http://www.gnupg.org/gpgme.html16Homepage: http://www.gnupg.org/gpgme.html
17Vcs-Browser: http://svn.debian.org/wsvn/pkg-gnupg/gpgme/trunk/17Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-gnupg/gpgme/trunk/
18Vcs-Svn: svn://svn.debian.org/svn/pkg-gnupg/gpgme/trunk/18Vcs-Svn: svn://anonscm.debian.org/pkg-gnupg/gpgme/trunk/
1919
20Package: libgpgme11-dev20Package: libgpgme11-dev
21Section: libdevel21Section: libdevel
2222
=== modified file 'debian/libgpgme11.symbols'
--- debian/libgpgme11.symbols 2013-05-14 20:29:20 +0000
+++ debian/libgpgme11.symbols 2013-10-23 07:14:02 +0000
@@ -14,6 +14,7 @@
14 gpgme_ctx_set_engine_info@GPGME_1.1 1.1.614 gpgme_ctx_set_engine_info@GPGME_1.1 1.1.6
15 gpgme_data_get_encoding@GPGME_1.0 1.1.215 gpgme_data_get_encoding@GPGME_1.0 1.1.2
16 gpgme_data_get_file_name@GPGME_1.1 1.1.216 gpgme_data_get_file_name@GPGME_1.1 1.1.2
17 gpgme_data_identify@GPGME_1.1 1.4.3
17 gpgme_data_new@GPGME_1.0 1.1.218 gpgme_data_new@GPGME_1.0 1.1.2
18 gpgme_data_new_from_cbs@GPGME_1.0 1.1.219 gpgme_data_new_from_cbs@GPGME_1.0 1.1.2
19 gpgme_data_new_from_fd@GPGME_1.0 1.1.220 gpgme_data_new_from_fd@GPGME_1.0 1.1.2
@@ -148,6 +149,7 @@
148 gpgme_sig_notation_get@GPGME_1.1 1.1.2149 gpgme_sig_notation_get@GPGME_1.1 1.1.2
149 gpgme_signers_add@GPGME_1.0 1.1.2150 gpgme_signers_add@GPGME_1.0 1.1.2
150 gpgme_signers_clear@GPGME_1.0 1.1.2151 gpgme_signers_clear@GPGME_1.0 1.1.2
152 gpgme_signers_count@GPGME_1.0 1.4.3
151 gpgme_signers_enum@GPGME_1.0 1.1.2153 gpgme_signers_enum@GPGME_1.0 1.1.2
152 gpgme_strerror@GPGME_1.0 1.1.2154 gpgme_strerror@GPGME_1.0 1.1.2
153 gpgme_strerror_r@GPGME_1.0 1.1.2155 gpgme_strerror_r@GPGME_1.0 1.1.2
@@ -174,6 +176,7 @@
174 gpgme_ctx_set_engine_info@GPGME_1.1 1.1.6176 gpgme_ctx_set_engine_info@GPGME_1.1 1.1.6
175 gpgme_data_get_encoding@GPGME_1.0 1.1.2177 gpgme_data_get_encoding@GPGME_1.0 1.1.2
176 gpgme_data_get_file_name@GPGME_1.1 1.1.2178 gpgme_data_get_file_name@GPGME_1.1 1.1.2
179 gpgme_data_identify@GPGME_1.1 1.4.3
177 gpgme_data_new@GPGME_1.0 1.1.2180 gpgme_data_new@GPGME_1.0 1.1.2
178 gpgme_data_new_from_cbs@GPGME_1.0 1.1.2181 gpgme_data_new_from_cbs@GPGME_1.0 1.1.2
179 gpgme_data_new_from_fd@GPGME_1.0 1.1.2182 gpgme_data_new_from_fd@GPGME_1.0 1.1.2
@@ -308,6 +311,7 @@
308 gpgme_sig_notation_get@GPGME_1.1 1.1.2311 gpgme_sig_notation_get@GPGME_1.1 1.1.2
309 gpgme_signers_add@GPGME_1.0 1.1.2312 gpgme_signers_add@GPGME_1.0 1.1.2
310 gpgme_signers_clear@GPGME_1.0 1.1.2313 gpgme_signers_clear@GPGME_1.0 1.1.2
314 gpgme_signers_count@GPGME_1.0 1.4.3
311 gpgme_signers_enum@GPGME_1.0 1.1.2315 gpgme_signers_enum@GPGME_1.0 1.1.2
312 gpgme_strerror@GPGME_1.0 1.1.2316 gpgme_strerror@GPGME_1.0 1.1.2
313 gpgme_strerror_r@GPGME_1.0 1.1.2317 gpgme_strerror_r@GPGME_1.0 1.1.2
314318
=== modified file 'doc/gpgme.info'
--- doc/gpgme.info 2013-05-29 18:33:42 +0000
+++ doc/gpgme.info 2013-10-23 07:14:02 +0000
@@ -22,8 +22,8 @@
2222
23 This file documents the GPGME library.23 This file documents the GPGME library.
2424
25 This is Edition 1.4.2, last updated 28 May 2013, of `The `GnuPG Made25 This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG
26Easy' Reference Manual', for Version 1.4.2.26Made Easy' Reference Manual', for Version 1.4.3.
2727
28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
292013 g10 Code GmbH.292013 g10 Code GmbH.
@@ -41,117 +41,118 @@
4141
4242
43Indirect:43Indirect:
44gpgme.info-1: 175644gpgme.info-1: 1758
45gpgme.info-2: 28109345gpgme.info-2: 283468
4646
47Tag Table:47Tag Table:
48(Indirect)48(Indirect)
49Node: Top175649Node: Top1758
50Node: Introduction859550Node: Introduction8599
51Node: Getting Started938251Node: Getting Started9386
52Node: Features1050752Node: Features10511
53Node: Overview1165753Node: Overview11661
54Node: Preparation1276654Node: Preparation12770
55Node: Header1376355Node: Header13767
56Node: Building the Source1446256Node: Building the Source14466
57Node: Largefile Support (LFS)1657157Node: Largefile Support (LFS)16575
58Node: Using Automake2188258Node: Using Automake21886
59Node: Using Libtool2351859Node: Using Libtool23522
60Node: Library Version Check2386860Node: Library Version Check23872
61Node: Signal Handling2782361Node: Signal Handling27827
62Node: Multi Threading2903962Node: Multi Threading29043
63Ref: Multi Threading-Footnote-13122163Ref: Multi Threading-Footnote-131225
64Node: Protocols and Engines3163564Node: Protocols and Engines31639
65Node: Engine Version Check3398465Node: Engine Version Check33988
66Node: Engine Information3456166Node: Engine Information34565
67Node: Engine Configuration3826167Node: Engine Configuration38265
68Node: OpenPGP3952368Node: OpenPGP39527
69Node: Cryptographic Message Syntax3985969Node: Cryptographic Message Syntax39863
70Node: Algorithms4015370Node: Algorithms40157
71Ref: Algorithms-Footnote-14063271Ref: Algorithms-Footnote-140636
72Node: Public Key Algorithms4076072Node: Public Key Algorithms40764
73Node: Hash Algorithms4269173Node: Hash Algorithms42695
74Node: Error Handling4378974Node: Error Handling43793
75Node: Error Values4565175Node: Error Values45655
76Node: Error Sources5072976Node: Error Sources50733
77Node: Error Codes5305677Node: Error Codes53060
78Node: Error Strings5769578Node: Error Strings57699
79Node: Exchanging Data5947479Node: Exchanging Data59478
80Node: Creating Data Buffers6130380Node: Creating Data Buffers61307
81Node: Memory Based Data Buffers6181981Node: Memory Based Data Buffers61823
82Node: File Based Data Buffers6517382Node: File Based Data Buffers65177
83Node: Callback Based Data Buffers6734483Node: Callback Based Data Buffers67348
84Node: Destroying Data Buffers7290084Node: Destroying Data Buffers72904
85Node: Manipulating Data Buffers7425985Node: Manipulating Data Buffers74263
86Node: Data Buffer I/O Operations7467886Node: Data Buffer I/O Operations74755
87Node: Data Buffer Meta-Data7738187Node: Data Buffer Meta-Data77458
88Node: Contexts8073188Node: Data Buffer Convenience80840
89Node: Creating Contexts8185489Node: Contexts82776
90Node: Destroying Contexts8266590Node: Creating Contexts83899
91Node: Result Management8300091Node: Destroying Contexts84710
92Node: Context Attributes8440692Node: Result Management85045
93Node: Protocol Selection8518493Node: Context Attributes86451
94Node: Crypto Engine8619694Node: Protocol Selection87229
95Node: ASCII Armor8801795Node: Crypto Engine88241
96Node: Text Mode8862996Node: ASCII Armor90062
97Node: Included Certificates8956097Node: Text Mode90674
98Node: Key Listing Mode9093598Node: Included Certificates91605
99Node: Passphrase Callback9429299Node: Key Listing Mode92980
100Node: Progress Meter Callback97430100Node: Passphrase Callback96337
101Node: Locale99354101Node: Progress Meter Callback99475
102Node: Key Management100893102Node: Locale101399
103Node: Listing Keys110818103Node: Key Management102938
104Node: Information About Keys118080104Node: Listing Keys112863
105Node: Key Signatures126078105Node: Information About Keys120125
106Node: Manipulating Keys130090106Node: Key Signatures128123
107Node: Generating Keys130932107Node: Manipulating Keys132135
108Node: Exporting Keys135539108Node: Generating Keys132977
109Node: Importing Keys141438109Node: Exporting Keys137584
110Ref: Importing Keys-Footnote-1148601110Node: Importing Keys143483
111Node: Deleting Keys148729111Ref: Importing Keys-Footnote-1150646
112Node: Changing Passphrases150126112Node: Deleting Keys150774
113Node: Advanced Key Editing151387113Node: Changing Passphrases152171
114Node: Trust Item Management154491114Node: Advanced Key Editing153432
115Node: Listing Trust Items155561115Node: Trust Item Management156536
116Node: Information About Trust Items157859116Node: Listing Trust Items157606
117Node: Manipulating Trust Items159741117Node: Information About Trust Items159904
118Node: Crypto Operations160702118Node: Manipulating Trust Items161786
119Node: Decrypt161946119Node: Crypto Operations162747
120Node: Verify165804120Node: Decrypt163991
121Node: Decrypt and Verify183660121Node: Verify167849
122Node: Sign185664122Node: Decrypt and Verify185705
123Node: Selecting Signers186228123Node: Sign187709
124Node: Creating a Signature187209124Node: Selecting Signers188273
125Node: Signature Notation Data191798125Node: Creating a Signature189425
126Node: Encrypt193982126Node: Signature Notation Data194014
127Node: Encrypting a Plaintext194338127Node: Encrypt196198
128Node: Run Control200183128Node: Encrypting a Plaintext196554
129Node: Waiting For Completion200930129Node: Run Control202400
130Node: Using External Event Loops202976130Node: Waiting For Completion203147
131Node: I/O Callback Interface204943131Node: Using External Event Loops205193
132Node: Registering I/O Callbacks210037132Node: I/O Callback Interface207160
133Node: I/O Callback Example212028133Node: Registering I/O Callbacks212254
134Node: I/O Callback Example GTK+218247134Node: I/O Callback Example214245
135Node: I/O Callback Example GDK220036135Node: I/O Callback Example GTK+220464
136Node: I/O Callback Example Qt221678136Node: I/O Callback Example GDK222253
137Node: Cancellation223966137Node: I/O Callback Example Qt223895
138Node: UI Server Protocol226219138Node: Cancellation226183
139Ref: UI Server Protocol-Footnote-1227650139Node: UI Server Protocol228436
140Node: UI Server Encrypt227769140Ref: UI Server Protocol-Footnote-1229867
141Node: UI Server Sign232950141Node: UI Server Encrypt229986
142Node: UI Server Decrypt235179142Node: UI Server Sign235246
143Node: UI Server Verify236617143Node: UI Server Decrypt237554
144Node: UI Server Set Input Files240119144Node: UI Server Verify238992
145Node: UI Server Sign/Encrypt Files240919145Node: UI Server Set Input Files242494
146Node: UI Server Verify/Decrypt Files242688146Node: UI Server Sign/Encrypt Files243294
147Node: UI Server Import/Export Keys244534147Node: UI Server Verify/Decrypt Files245063
148Node: UI Server Checksum Files245567148Node: UI Server Import/Export Keys246909
149Node: Miscellaneous UI Server Commands247733149Node: UI Server Checksum Files247942
150Ref: command SENDER249645150Node: Miscellaneous UI Server Commands250108
151Node: Debugging251321151Ref: command SENDER252020
152Node: Library Copying252976152Node: Debugging253696
153Node: Copying281093153Node: Library Copying255351
154Node: Function and Data Index318724154Node: Copying283468
155Node: Concept Index343986155Node: Function and Data Index321099
156Node: Concept Index346851
156157
157End Tag Table158End Tag Table
158159
=== modified file 'doc/gpgme.info-1'
--- doc/gpgme.info-1 2013-05-29 18:33:42 +0000
+++ doc/gpgme.info-1 2013-10-23 07:14:02 +0000
@@ -22,8 +22,8 @@
2222
23 This file documents the GPGME library.23 This file documents the GPGME library.
2424
25 This is Edition 1.4.2, last updated 28 May 2013, of `The `GnuPG Made25 This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG
26Easy' Reference Manual', for Version 1.4.2.26Made Easy' Reference Manual', for Version 1.4.3.
2727
28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
292013 g10 Code GmbH.292013 g10 Code GmbH.
@@ -45,8 +45,8 @@
45Main Menu45Main Menu
46*********46*********
4747
48This is Edition 1.4.2, last updated 28 May 2013, of `The `GnuPG Made48This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG Made
49Easy' Reference Manual', for Version 1.4.2 of the GPGME library.49Easy' Reference Manual', for Version 1.4.3 of the GPGME library.
5050
51* Menu:51* Menu:
5252
@@ -1783,6 +1783,7 @@
17831783
1784* Data Buffer I/O Operations:: I/O operations on data buffers.1784* Data Buffer I/O Operations:: I/O operations on data buffers.
1785* Data Buffer Meta-Data:: Meta-data manipulation of data buffers.1785* Data Buffer Meta-Data:: Meta-data manipulation of data buffers.
1786* Data Buffer Convenience:: Convenience fucntion for data buffers.
17861787
17871788
1788File: gpgme.info, Node: Data Buffer I/O Operations, Next: Data Buffer Meta-Data, Up: Manipulating Data Buffers1789File: gpgme.info, Node: Data Buffer I/O Operations, Next: Data Buffer Meta-Data, Up: Manipulating Data Buffers
@@ -1852,7 +1853,7 @@
1852 ? gpgme_error_from_errno (errno) : 0;1853 ? gpgme_error_from_errno (errno) : 0;
18531854
18541855
1855File: gpgme.info, Node: Data Buffer Meta-Data, Prev: Data Buffer I/O Operations, Up: Manipulating Data Buffers1856File: gpgme.info, Node: Data Buffer Meta-Data, Next: Data Buffer Convenience, Prev: Data Buffer I/O Operations, Up: Manipulating Data Buffers
18561857
18576.3.2 Data Buffer Meta-Data18586.3.2 Data Buffer Meta-Data
1858---------------------------1859---------------------------
@@ -1930,6 +1931,61 @@
1930 data object with the handle DH to ENC.1931 data object with the handle DH to ENC.
19311932
19321933
1934File: gpgme.info, Node: Data Buffer Convenience, Prev: Data Buffer Meta-Data, Up: Manipulating Data Buffers
1935
19366.3.3 Data Buffer Convenience Functions
1937---------------------------------------
1938
1939 -- Data type: enum gpgme_data_type_t
1940 The `gpgme_data_type_t' type is used to return the detected type
1941 of the content of a data buffer.
1942
1943`GPGME_DATA_TYPE_INVALID'
1944 This is returned by `gpgme_data_identify' if it was not possible
1945 to identify the data. Reasons for this might be a non-seekable
1946 stream or a memory problem. The value is 0.
1947
1948`GPGME_DATA_TYPE_UNKNOWN'
1949 The type of the data is not known.
1950
1951`GPGME_DATA_TYPE_PGP_SIGNED'
1952 The data is an OpenPGP signed message. This may be a binary
1953 signature, a detached one or a cleartext signature.
1954
1955`GPGME_DATA_TYPE_PGP_OTHER'
1956 This is a generic OpenPGP message. In most cases this will be
1957 encrypted data.
1958
1959`GPGME_DATA_TYPE_PGP_KEY'
1960 This is an OpenPGP key (private or public).
1961
1962`GPGME_DATA_TYPE_CMS_SIGNED'
1963 This is a CMS signed message.
1964
1965`GPGME_DATA_TYPE_CMS_ENCRYPTED'
1966 This is a CMS encrypted (enveloped data) message.
1967
1968`GPGME_DATA_TYPE_CMS_OTHER'
1969 This is used for other CMS message types.
1970
1971`GPGME_DATA_TYPE_X509_CERT'
1972 The data is a X.509 certificate
1973
1974`GPGME_DATA_TYPE_PKCS12'
1975 The data is a PKCS#12 message. This is commonly used to exchange
1976 private keys for X.509.
1977
1978 -- Function: gpgme_data_type_t gpgme_data_identify (gpgme_data_t DH)
1979 The function `gpgme_data_identify' returns the type of the data
1980 with the handle DH. If it is not possible to perform the
1981 identification, the function returns zero
1982 (`GPGME_DATA_TYPE_INVALID'). Note that depending on how the data
1983 object has been created the identification may not be possible or
1984 the data object may change its internal state (file pointer
1985 moved). For file or memory based data object, the state should
1986 not change.
1987
1988
1933File: gpgme.info, Node: Contexts, Next: UI Server Protocol, Prev: Exchanging Data, Up: Top1989File: gpgme.info, Node: Contexts, Next: UI Server Protocol, Prev: Exchanging Data, Up: Top
19341990
19357 Contexts19917 Contexts
@@ -4570,6 +4626,10 @@
45704626
4571 Calling this function acquires an additional reference for the key.4627 Calling this function acquires an additional reference for the key.
45724628
4629 -- Function: unsigned int gpgme_signers_count (const gpgme_ctx_t CTX)
4630 The function `gpgme_signers_count' returns the number of signer
4631 keys in the context CTX.
4632
4573 -- Function: gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t CTX,4633 -- Function: gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t CTX,
4574 int SEQ)4634 int SEQ)
4575 The function `gpgme_signers_enum' returns the SEQth key in the4635 The function `gpgme_signers_enum' returns the SEQth key in the
@@ -4767,9 +4827,9 @@
4767 encoding specified for CIPHER) and the text mode attributes set4827 encoding specified for CIPHER) and the text mode attributes set
4768 for the context CTX.4828 for the context CTX.
47694829
4770 KEY must be a `NULL'-terminated array of keys. The user must keep4830 RECP must be a `NULL'-terminated array of keys. The user must
4771 references for all keys during the whole duration of the call (but4831 keep references for all keys during the whole duration of the call
4772 see `gpgme_op_encrypt_start' for the requirements with the4832 (but see `gpgme_op_encrypt_start' for the requirements with the
4773 asynchronous variant).4833 asynchronous variant).
47744834
4775 The value in FLAGS is a bitwise-or combination of one or multiple4835 The value in FLAGS is a bitwise-or combination of one or multiple
@@ -5644,10 +5704,11 @@
5644 implement the `GETINFO pid' command. Sending this command a second5704 implement the `GETINFO pid' command. Sending this command a second
5645 time replaces the file descriptor set by the last one.5705 time replaces the file descriptor set by the last one.
56465706
5647 -- Command: OUTPUT FD=N5707 -- Command: OUTPUT FD=N [-binary]
5648 Set the file descriptor to be used for the output (i.e. the5708 Set the file descriptor to be used for the output (i.e. the
5649 encrypted message) to N. For OpenPGP, the output needs to be5709 encrypted message) to N. If the option `--binary' is given the
5650 ASCII armored; for CMS, the output needs to be Base-64 encoded.5710 output shall be in binary format; if not given, the output for
5711 OpenPGP needs to be ASCII armored and for CMS Base-64 encoded.
5651 For details on the file descriptor, see the `INPUT' command.5712 For details on the file descriptor, see the `INPUT' command.
56525713
5653The setting of the recipients, the data source and destination may5714The setting of the recipients, the data source and destination may
@@ -5748,11 +5809,12 @@
5748 file descriptor, see the description of `INPUT' in the `ENCRYPT'5809 file descriptor, see the description of `INPUT' in the `ENCRYPT'
5749 section.5810 section.
57505811
5751 -- Command: OUTPUT FD=N5812 -- Command: OUTPUT FD=N [-binary]
5752 Set the file descriptor to be used for the output. The output is5813 Set the file descriptor to be used for the output. The output is
5753 either the complete signed message or in case of a detached5814 either the complete signed message or in case of a detached
5754 signature just that detached signature. For OpenPGP, the output5815 signature just that detached signature. If the option `--binary'
5755 needs to be ASCII armored; for CMS, the output needs to be Base-645816 is given the output shall be in binary format; if not given, the
5817 output for OpenPGP needs to be ASCII armored and for CMS Base-64
5756 encoded. For details on the file descriptor, see the `INPUT'5818 encoded. For details on the file descriptor, see the `INPUT'
5757 command.5819 command.
57585820
57595821
=== modified file 'doc/gpgme.info-2'
--- doc/gpgme.info-2 2013-05-29 18:33:42 +0000
+++ doc/gpgme.info-2 2013-10-23 07:14:02 +0000
@@ -22,8 +22,8 @@
2222
23 This file documents the GPGME library.23 This file documents the GPGME library.
2424
25 This is Edition 1.4.2, last updated 28 May 2013, of `The `GnuPG Made25 This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG
26Easy' Reference Manual', for Version 1.4.2.26Made Easy' Reference Manual', for Version 1.4.3.
2727
28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,28 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
292013 g10 Code GmbH.292013 g10 Code GmbH.
@@ -778,13 +778,15 @@
778 (line 10)778 (line 10)
779* DECRYPT_VERIFY_FILES: UI Server Verify/Decrypt Files.779* DECRYPT_VERIFY_FILES: UI Server Verify/Decrypt Files.
780 (line 12)780 (line 12)
781* ENCRYPT: UI Server Encrypt. (line 46)781* ENCRYPT: UI Server Encrypt. (line 47)
782* ENCRYPT_FILES: UI Server Sign/Encrypt Files.782* ENCRYPT_FILES: UI Server Sign/Encrypt Files.
783 (line 10)783 (line 10)
784* ENCRYPT_SIGN_FILES: UI Server Sign/Encrypt Files.784* ENCRYPT_SIGN_FILES: UI Server Sign/Encrypt Files.
785 (line 12)785 (line 12)
786* enum gpgme_data_encoding_t: Data Buffer Meta-Data.786* enum gpgme_data_encoding_t: Data Buffer Meta-Data.
787 (line 28)787 (line 28)
788* enum gpgme_data_type_t: Data Buffer Convenience.
789 (line 7)
788* enum gpgme_event_io_t: I/O Callback Interface.790* enum gpgme_event_io_t: I/O Callback Interface.
789 (line 57)791 (line 57)
790* enum gpgme_hash_algo_t: Hash Algorithms. (line 10)792* enum gpgme_hash_algo_t: Hash Algorithms. (line 10)
@@ -815,6 +817,8 @@
815 (line 69)817 (line 69)
816* gpgme_data_get_file_name: Data Buffer Meta-Data.818* gpgme_data_get_file_name: Data Buffer Meta-Data.
817 (line 7)819 (line 7)
820* gpgme_data_identify: Data Buffer Convenience.
821 (line 46)
818* gpgme_data_new: Memory Based Data Buffers.822* gpgme_data_new: Memory Based Data Buffers.
819 (line 13)823 (line 13)
820* gpgme_data_new_from_cbs: Callback Based Data Buffers.824* gpgme_data_new_from_cbs: Callback Based Data Buffers.
@@ -852,6 +856,8 @@
852* gpgme_data_set_file_name: Data Buffer Meta-Data.856* gpgme_data_set_file_name: Data Buffer Meta-Data.
853 (line 18)857 (line 18)
854* gpgme_data_t: Exchanging Data. (line 14)858* gpgme_data_t: Exchanging Data. (line 14)
859* gpgme_data_type_t: Data Buffer Convenience.
860 (line 7)
855* gpgme_data_write: Data Buffer I/O Operations.861* gpgme_data_write: Data Buffer I/O Operations.
856 (line 18)862 (line 18)
857* gpgme_data_write_cb_t: Callback Based Data Buffers.863* gpgme_data_write_cb_t: Callback Based Data Buffers.
@@ -1039,7 +1045,8 @@
1039* gpgme_signature_t: Verify. (line 92)1045* gpgme_signature_t: Verify. (line 92)
1040* gpgme_signers_add: Selecting Signers. (line 15)1046* gpgme_signers_add: Selecting Signers. (line 15)
1041* gpgme_signers_clear: Selecting Signers. (line 7)1047* gpgme_signers_clear: Selecting Signers. (line 7)
1042* gpgme_signers_enum: Selecting Signers. (line 22)1048* gpgme_signers_count: Selecting Signers. (line 21)
1049* gpgme_signers_enum: Selecting Signers. (line 26)
1043* gpgme_ssize_t: Exchanging Data. (line 31)1050* gpgme_ssize_t: Exchanging Data. (line 31)
1044* gpgme_strerror: Error Strings. (line 7)1051* gpgme_strerror: Error Strings. (line 7)
1045* gpgme_strerror_r: Error Strings. (line 17)1052* gpgme_strerror_r: Error Strings. (line 17)
@@ -1070,21 +1077,21 @@
1070* INPUT <3>: UI Server Sign. (line 13)1077* INPUT <3>: UI Server Sign. (line 13)
1071* INPUT: UI Server Encrypt. (line 23)1078* INPUT: UI Server Encrypt. (line 23)
1072* MESSAGE: UI Server Verify. (line 11)1079* MESSAGE: UI Server Verify. (line 11)
1073* MICALG: UI Server Sign. (line 43)1080* MICALG: UI Server Sign. (line 44)
1074* off_t (*gpgme_data_seek_cb_t) (void *HANDLE, off_t OFFSET, int WHENCE): Callback Based Data Buffers.1081* off_t (*gpgme_data_seek_cb_t) (void *HANDLE, off_t OFFSET, int WHENCE): Callback Based Data Buffers.
1075 (line 44)1082 (line 44)
1076* OUTPUT <1>: UI Server Verify. (line 24)1083* OUTPUT <1>: UI Server Verify. (line 24)
1077* OUTPUT <2>: UI Server Decrypt. (line 20)1084* OUTPUT <2>: UI Server Decrypt. (line 20)
1078* OUTPUT <3>: UI Server Sign. (line 19)1085* OUTPUT <3>: UI Server Sign. (line 19)
1079* OUTPUT: UI Server Encrypt. (line 36)1086* OUTPUT: UI Server Encrypt. (line 36)
1080* PREP_ENCRYPT: UI Server Encrypt. (line 72)1087* PREP_ENCRYPT: UI Server Encrypt. (line 73)
1081* PROTOCOL: UI Server Encrypt. (line 97)1088* PROTOCOL: UI Server Encrypt. (line 98)
1082* RECIPIENT: UI Server Encrypt. (line 10)1089* RECIPIENT: UI Server Encrypt. (line 10)
1083* SENDER: Miscellaneous UI Server Commands.1090* SENDER: Miscellaneous UI Server Commands.
1084 (line 51)1091 (line 51)
1085* SESSION: Miscellaneous UI Server Commands.1092* SESSION: Miscellaneous UI Server Commands.
1086 (line 70)1093 (line 70)
1087* SIGN: UI Server Sign. (line 33)1094* SIGN: UI Server Sign. (line 34)
1088* SIGN_FILES: UI Server Sign/Encrypt Files.1095* SIGN_FILES: UI Server Sign/Encrypt Files.
1089 (line 11)1096 (line 11)
1090* SIGSTATUS: UI Server Verify. (line 59)1097* SIGSTATUS: UI Server Verify. (line 59)
@@ -1174,6 +1181,8 @@
1174* cryptographic operation, verification: Verify. (line 6)1181* cryptographic operation, verification: Verify. (line 6)
1175* cryptographic operation, wait for: Waiting For Completion.1182* cryptographic operation, wait for: Waiting For Completion.
1176 (line 6)1183 (line 6)
1184* data buffer, convenience: Data Buffer Convenience.
1185 (line 6)
1177* data buffer, creation: Creating Data Buffers. (line 6)1186* data buffer, creation: Creating Data Buffers. (line 6)
1178* data buffer, destruction: Destroying Data Buffers.1187* data buffer, destruction: Destroying Data Buffers.
1179 (line 6)1188 (line 6)
@@ -1224,6 +1233,8 @@
1224 (line 6)1233 (line 6)
1225* hash algorithms: Hash Algorithms. (line 6)1234* hash algorithms: Hash Algorithms. (line 6)
1226* header file: Header. (line 6)1235* header file: Header. (line 6)
1236* identify: Data Buffer Convenience.
1237 (line 6)
1227* include file: Header. (line 6)1238* include file: Header. (line 6)
1228* key listing: Listing Keys. (line 6)1239* key listing: Listing Keys. (line 6)
1229* key listing mode: Key Listing Mode. (line 6)1240* key listing mode: Key Listing Mode. (line 6)
@@ -1303,6 +1314,8 @@
1303 (line 6)1314 (line 6)
1304* trust item, manipulation: Manipulating Trust Items.1315* trust item, manipulation: Manipulating Trust Items.
1305 (line 6)1316 (line 6)
1317* type of data: Data Buffer Convenience.
1318 (line 6)
1306* UI server: UI Server Protocol. (line 6)1319* UI server: UI Server Protocol. (line 6)
1307* user interface server: UI Server Protocol. (line 6)1320* user interface server: UI Server Protocol. (line 6)
1308* verification: Verify. (line 6)1321* verification: Verify. (line 6)
13091322
=== modified file 'doc/gpgme.texi'
--- doc/gpgme.texi 2013-05-29 18:33:42 +0000
+++ doc/gpgme.texi 2013-10-23 07:14:02 +0000
@@ -1885,6 +1885,7 @@
1885@menu1885@menu
1886* Data Buffer I/O Operations:: I/O operations on data buffers.1886* Data Buffer I/O Operations:: I/O operations on data buffers.
1887* Data Buffer Meta-Data:: Meta-data manipulation of data buffers.1887* Data Buffer Meta-Data:: Meta-data manipulation of data buffers.
1888* Data Buffer Convenience:: Convenience fucntion for data buffers.
1888@end menu1889@end menu
18891890
18901891
@@ -2047,6 +2048,56 @@
2047the data object with the handle @var{dh} to @var{enc}.2048the data object with the handle @var{dh} to @var{enc}.
2048@end deftypefun2049@end deftypefun
20492050
2051@node Data Buffer Convenience
2052@subsection Data Buffer Convenience Functions
2053@cindex data buffer, convenience
2054@cindex type of data
2055@cindex identify
2056
2057@deftp {Data type} {enum gpgme_data_type_t}
2058@tindex gpgme_data_type_t
2059The @code{gpgme_data_type_t} type is used to return the detected type
2060of the content of a data buffer.
2061@end deftp
2062
2063@table @code
2064@item GPGME_DATA_TYPE_INVALID
2065This is returned by @code{gpgme_data_identify} if it was not possible
2066to identify the data. Reasons for this might be a non-seekable stream
2067or a memory problem. The value is 0.
2068@item GPGME_DATA_TYPE_UNKNOWN
2069The type of the data is not known.
2070@item GPGME_DATA_TYPE_PGP_SIGNED
2071The data is an OpenPGP signed message. This may be a binary
2072signature, a detached one or a cleartext signature.
2073@item GPGME_DATA_TYPE_PGP_OTHER
2074This is a generic OpenPGP message. In most cases this will be
2075encrypted data.
2076@item GPGME_DATA_TYPE_PGP_KEY
2077This is an OpenPGP key (private or public).
2078@item GPGME_DATA_TYPE_CMS_SIGNED
2079This is a CMS signed message.
2080@item GPGME_DATA_TYPE_CMS_ENCRYPTED
2081This is a CMS encrypted (enveloped data) message.
2082@item GPGME_DATA_TYPE_CMS_OTHER
2083This is used for other CMS message types.
2084@item GPGME_DATA_TYPE_X509_CERT
2085The data is a X.509 certificate
2086@item GPGME_DATA_TYPE_PKCS12
2087The data is a PKCS#12 message. This is commonly used to exchange
2088private keys for X.509.
2089@end table
2090
2091@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}})
2092The function @code{gpgme_data_identify} returns the type of the data
2093with the handle @var{dh}. If it is not possible to perform the
2094identification, the function returns zero
2095(@code{GPGME_DATA_TYPE_INVALID}). Note that depending on how the data
2096object has been created the identification may not be possible or the
2097data object may change its internal state (file pointer moved). For
2098file or memory based data object, the state should not change.
2099@end deftypefun
2100
20502101
2051@c2102@c
2052@c Chapter Contexts2103@c Chapter Contexts
@@ -4785,6 +4836,11 @@
4785Calling this function acquires an additional reference for the key.4836Calling this function acquires an additional reference for the key.
4786@end deftypefun4837@end deftypefun
47874838
4839@deftypefun @w{unsigned int} gpgme_signers_count (@w{const gpgme_ctx_t @var{ctx}})
4840The function @code{gpgme_signers_count} returns the number of signer keys in
4841the context @var{ctx}.
4842@end deftypefun
4843
4788@deftypefun gpgme_key_t gpgme_signers_enum (@w{const gpgme_ctx_t @var{ctx}}, @w{int @var{seq}})4844@deftypefun gpgme_key_t gpgme_signers_enum (@w{const gpgme_ctx_t @var{ctx}}, @w{int @var{seq}})
4789The function @code{gpgme_signers_enum} returns the @var{seq}th key in4845The function @code{gpgme_signers_enum} returns the @var{seq}th key in
4790the list of signers in the context @var{ctx}. An additional reference4846the list of signers in the context @var{ctx}. An additional reference
@@ -4988,7 +5044,7 @@
4988that is not set, by the encoding specified for @var{cipher}) and the5044that is not set, by the encoding specified for @var{cipher}) and the
4989text mode attributes set for the context @var{ctx}.5045text mode attributes set for the context @var{ctx}.
49905046
4991@var{key} must be a @code{NULL}-terminated array of keys. The user5047@var{recp} must be a @code{NULL}-terminated array of keys. The user
4992must keep references for all keys during the whole duration of the5048must keep references for all keys during the whole duration of the
4993call (but see @code{gpgme_op_encrypt_start} for the requirements with5049call (but see @code{gpgme_op_encrypt_start} for the requirements with
4994the asynchronous variant).5050the asynchronous variant).
49955051
=== modified file 'doc/stamp-vti'
--- doc/stamp-vti 2013-05-29 18:33:42 +0000
+++ doc/stamp-vti 2013-10-23 07:14:02 +0000
@@ -1,4 +1,4 @@
1@set UPDATED 28 May 20131@set UPDATED 9 August 2013
2@set UPDATED-MONTH May 20132@set UPDATED-MONTH August 2013
3@set EDITION 1.4.23@set EDITION 1.4.3
4@set VERSION 1.4.24@set VERSION 1.4.3
55
=== modified file 'doc/uiserver.texi'
--- doc/uiserver.texi 2013-05-14 20:29:20 +0000
+++ doc/uiserver.texi 2013-10-23 07:14:02 +0000
@@ -61,7 +61,7 @@
6161
62@deffn Command INPUT FD=@var{n}62@deffn Command INPUT FD=@var{n}
63Set the file descriptor for the message to be encrypted to @var{n}. The63Set the file descriptor for the message to be encrypted to @var{n}. The
64message send to the server is binary encoded. 64message send to the server is binary encoded.
6565
66GpgOL is a Windows only program, thus @var{n} is not a libc file66GpgOL is a Windows only program, thus @var{n} is not a libc file
67descriptor but a regular system handle. Given that the Assuan67descriptor but a regular system handle. Given that the Assuan
@@ -77,14 +77,15 @@
77@c %Libassuan manual}, on how to do descriptor passing.77@c %Libassuan manual}, on how to do descriptor passing.
78@end deffn78@end deffn
7979
80@deffn Command OUTPUT FD=@var{n}80@deffn Command OUTPUT FD=@var{n} [--binary]
81Set the file descriptor to be used for the output (i.e. the encrypted81Set the file descriptor to be used for the output (i.e. the encrypted
82message) to @var{n}. For OpenPGP, the output needs to be ASCII armored;82message) to @var{n}. If the option @code{--binary} is given the
83for CMS, the output needs to be Base-64 encoded. For details on the83output shall be in binary format; if not given, the output for OpenPGP
84file descriptor, see the @code{INPUT} command.84needs to be ASCII armored and for CMS Base-64 encoded. For details on
85the file descriptor, see the @code{INPUT} command.
85@end deffn86@end deffn
8687
87@noindent 88@noindent
88The setting of the recipients, the data source and destination may89The setting of the recipients, the data source and destination may
89happen in any order, even intermixed. If this has been done the actual90happen in any order, even intermixed. If this has been done the actual
90encryption operation is called using:91encryption operation is called using:
@@ -193,12 +194,13 @@
193section.194section.
194@end deffn195@end deffn
195196
196@deffn Command OUTPUT FD=@var{n}197@deffn Command OUTPUT FD=@var{n} [--binary]
197Set the file descriptor to be used for the output. The output is either198Set the file descriptor to be used for the output. The output is
198the complete signed message or in case of a detached signature just that199either the complete signed message or in case of a detached signature
199detached signature. For OpenPGP, the output needs to be ASCII armored;200just that detached signature. If the option @code{--binary} is given
200for CMS, the output needs to be Base-64 encoded. For details on the201the output shall be in binary format; if not given, the output for
201file descriptor, see the @code{INPUT} command.202OpenPGP needs to be ASCII armored and for CMS Base-64 encoded. For
203details on the file descriptor, see the @code{INPUT} command.
202@end deffn204@end deffn
203205
204@noindent206@noindent
@@ -209,7 +211,7 @@
209@noindent211@noindent
210The signing operation is then initiated by:212The signing operation is then initiated by:
211213
212@deffn Command SIGN -@w{}-protocol=@var{name} [-@w{}-detached] 214@deffn Command SIGN -@w{}-protocol=@var{name} [-@w{}-detached]
213Sign the data set with the @code{INPUT} command and write it to the sink215Sign the data set with the @code{INPUT} command and write it to the sink
214set by OUTPUT. @var{name} is the signing protocol used for the216set by OUTPUT. @var{name} is the signing protocol used for the
215message. For a description of the allowed protocols see the217message. For a description of the allowed protocols see the
@@ -272,7 +274,7 @@
272274
273The server needs to support the verification of opaque signatures as275The server needs to support the verification of opaque signatures as
274well as detached signatures. The kind of input sources controls what276well as detached signatures. The kind of input sources controls what
275kind message is to be verified. 277kind message is to be verified.
276278
277@deffn Command MESSAGE FD=@var{n}279@deffn Command MESSAGE FD=@var{n}
278This command is used with detached signatures to set the file descriptor280This command is used with detached signatures to set the file descriptor
@@ -309,7 +311,7 @@
309@table @asis311@table @asis
310@item MESSAGE and INPUT312@item MESSAGE and INPUT
311This indicates a detached signature. Output data is not applicable.313This indicates a detached signature. Output data is not applicable.
312@item INPUT 314@item INPUT
313This indicates an opaque signature. As no output command has been given,315This indicates an opaque signature. As no output command has been given,
314the server is only required to check the signature.316the server is only required to check the signature.
315@item INPUT and OUTPUT317@item INPUT and OUTPUT
@@ -338,7 +340,7 @@
338The signature is valid but additional information was shown regarding the340The signature is valid but additional information was shown regarding the
339validity of the key.341validity of the key.
340@item red342@item red
341The signature is not valid. 343The signature is not valid.
342@end table344@end table
343345
344@var{displaystring} is a percent-and-plus-encoded string with a short346@var{displaystring} is a percent-and-plus-encoded string with a short
@@ -539,7 +541,7 @@
539To allow the server to pop up the windows in the correct relation to the541To allow the server to pop up the windows in the correct relation to the
540client, the client is advised to tell the server by sending the option:542client, the client is advised to tell the server by sending the option:
541543
542@deffn {Command option} window-id @var{number} 544@deffn {Command option} window-id @var{number}
543The @var{number} represents the native window ID of the clients current545The @var{number} represents the native window ID of the clients current
544window. On Windows systems this is a windows handle (@code{HWND}) and546window. On Windows systems this is a windows handle (@code{HWND}) and
545on X11 systems it is the @code{X Window ID}. The number needs to be547on X11 systems it is the @code{X Window ID}. The number needs to be
@@ -592,7 +594,7 @@
592which signing protocol should be preferred.594which signing protocol should be preferred.
593@end deffn595@end deffn
594596
595@noindent 597@noindent
596To allow the UI-server to visually identify a running operation or to598To allow the UI-server to visually identify a running operation or to
597associate operations the server MAY support the command:599associate operations the server MAY support the command:
598600
599601
=== modified file 'doc/version.texi'
--- doc/version.texi 2013-05-29 18:33:42 +0000
+++ doc/version.texi 2013-10-23 07:14:02 +0000
@@ -1,4 +1,4 @@
1@set UPDATED 28 May 20131@set UPDATED 9 August 2013
2@set UPDATED-MONTH May 20132@set UPDATED-MONTH August 2013
3@set EDITION 1.4.23@set EDITION 1.4.3
4@set VERSION 1.4.24@set VERSION 1.4.3
55
=== modified file 'gpgme.spec'
--- gpgme.spec 2013-05-29 18:33:42 +0000
+++ gpgme.spec 2013-10-23 07:14:02 +0000
@@ -1,7 +1,7 @@
1# This is a template. The dist target uses it to create the real file.1# This is a template. The dist target uses it to create the real file.
2Summary: GPGME - GnuPG Made Easy2Summary: GPGME - GnuPG Made Easy
3Name: gpgme3Name: gpgme
4Version: 1.4.24Version: 1.4.3
5Release: 15Release: 1
6URL: http://www.gnupg.org/gpgme.html6URL: http://www.gnupg.org/gpgme.html
7Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz7Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
88
=== modified file 'lang/cl/gpgme.asd'
--- lang/cl/gpgme.asd 2013-05-29 18:33:42 +0000
+++ lang/cl/gpgme.asd 2013-10-23 07:14:02 +0000
@@ -27,7 +27,7 @@
27(defsystem gpgme27(defsystem gpgme
28 :description "GnuPG Made Easy."28 :description "GnuPG Made Easy."
29 :author "g10 Code GmbH"29 :author "g10 Code GmbH"
30 :version "1.4.2"30 :version "1.4.3"
31 :licence "GPL"31 :licence "GPL"
32 :depends-on ("cffi" "gpg-error")32 :depends-on ("cffi" "gpg-error")
33 :components ((:file "gpgme-package")33 :components ((:file "gpgme-package")
3434
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2013-05-29 18:33:42 +0000
+++ src/Makefile.am 2013-10-23 07:14:02 +0000
@@ -103,8 +103,9 @@
103# unresolved symbols to the thread module.103# unresolved symbols to the thread module.
104main_sources = \104main_sources = \
105 util.h conversion.c get-env.c context.h ops.h \105 util.h conversion.c get-env.c context.h ops.h \
106 parsetlv.c parsetlv.h \
106 data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \107 data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \
107 data-compat.c \108 data-compat.c data-identify.c \
108 signers.c sig-notation.c \109 signers.c sig-notation.c \
109 wait.c wait-global.c wait-private.c wait-user.c wait.h \110 wait.c wait-global.c wait-private.c wait-user.c wait.h \
110 op-support.c \111 op-support.c \
@@ -118,7 +119,7 @@
118 $(uiserver_components) \119 $(uiserver_components) \
119 $(g13_components) vfs-mount.c vfs-create.c \120 $(g13_components) vfs-mount.c vfs-create.c \
120 gpgconf.c \121 gpgconf.c \
121 sema.h priv-io.h $(system_components) dirinfo.c \122 sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \
122 debug.c debug.h gpgme.c version.c error.c123 debug.c debug.h gpgme.c version.c error.c
123124
124libgpgme_la_SOURCES = $(main_sources) \125libgpgme_la_SOURCES = $(main_sources) \
125126
=== modified file 'src/Makefile.in'
--- src/Makefile.in 2013-05-29 18:33:42 +0000
+++ src/Makefile.in 2013-10-23 07:14:02 +0000
@@ -128,20 +128,21 @@
128LTLIBRARIES = $(lib_LTLIBRARIES)128LTLIBRARIES = $(lib_LTLIBRARIES)
129@HAVE_W32_SYSTEM_TRUE@am__DEPENDENCIES_1 = versioninfo.lo129@HAVE_W32_SYSTEM_TRUE@am__DEPENDENCIES_1 = versioninfo.lo
130am__libgpgme_glib_la_SOURCES_DIST = util.h conversion.c get-env.c \130am__libgpgme_glib_la_SOURCES_DIST = util.h conversion.c get-env.c \
131 context.h ops.h data.h data.c data-fd.c data-stream.c \131 context.h ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \
132 data-mem.c data-user.c data-compat.c signers.c sig-notation.c \132 data-stream.c data-mem.c data-user.c data-compat.c \
133 wait.c wait-global.c wait-private.c wait-user.c wait.h \133 data-identify.c signers.c sig-notation.c wait.c wait-global.c \
134 op-support.c encrypt.c encrypt-sign.c decrypt.c \134 wait-private.c wait-user.c wait.h op-support.c encrypt.c \
135 decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \135 encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \
136 keylist.c trust-item.c trustlist.c import.c export.c genkey.c \136 passphrase.c progress.c key.c keylist.c trust-item.c \
137 delete.c edit.c getauditlog.c opassuan.c passwd.c engine.h \137 trustlist.c import.c export.c genkey.c delete.c edit.c \
138 engine-backend.h engine.c engine-gpg.c status-table.c \138 getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \
139 engine-gpgsm.c assuan-support.c engine-assuan.c \139 engine.c engine-gpg.c status-table.c engine-gpgsm.c \
140 engine-gpgconf.c engine-uiserver.c engine-g13.c vfs-mount.c \140 assuan-support.c engine-assuan.c engine-gpgconf.c \
141 vfs-create.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \141 engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
142 posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \142 gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \
143 w32-sema.c dirinfo.c debug.c debug.h gpgme.c version.c error.c \143 posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \
144 ath.c w32-glib-io.c144 dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \
145 w32-glib-io.c
145@HAVE_GPGSM_TRUE@am__objects_1 = engine-gpgsm.lo146@HAVE_GPGSM_TRUE@am__objects_1 = engine-gpgsm.lo
146@HAVE_ASSUAN_TRUE@am__objects_2 = assuan-support.lo engine-assuan.lo147@HAVE_ASSUAN_TRUE@am__objects_2 = assuan-support.lo engine-assuan.lo
147@HAVE_GPGCONF_TRUE@am__objects_3 = engine-gpgconf.lo148@HAVE_GPGCONF_TRUE@am__objects_3 = engine-gpgconf.lo
@@ -152,18 +153,19 @@
152@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo $(am__objects_6)153@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo $(am__objects_6)
153@HAVE_DOSISH_SYSTEM_TRUE@am__objects_7 = w32-util.lo w32-sema.lo \154@HAVE_DOSISH_SYSTEM_TRUE@am__objects_7 = w32-util.lo w32-sema.lo \
154@HAVE_DOSISH_SYSTEM_TRUE@ $(am__objects_6)155@HAVE_DOSISH_SYSTEM_TRUE@ $(am__objects_6)
155am__objects_8 = conversion.lo get-env.lo data.lo data-fd.lo \156am__objects_8 = conversion.lo get-env.lo parsetlv.lo data.lo \
156 data-stream.lo data-mem.lo data-user.lo data-compat.lo \157 data-fd.lo data-stream.lo data-mem.lo data-user.lo \
157 signers.lo sig-notation.lo wait.lo wait-global.lo \158 data-compat.lo data-identify.lo signers.lo sig-notation.lo \
158 wait-private.lo wait-user.lo op-support.lo encrypt.lo \159 wait.lo wait-global.lo wait-private.lo wait-user.lo \
159 encrypt-sign.lo decrypt.lo decrypt-verify.lo verify.lo sign.lo \160 op-support.lo encrypt.lo encrypt-sign.lo decrypt.lo \
160 passphrase.lo progress.lo key.lo keylist.lo trust-item.lo \161 decrypt-verify.lo verify.lo sign.lo passphrase.lo progress.lo \
161 trustlist.lo import.lo export.lo genkey.lo delete.lo edit.lo \162 key.lo keylist.lo trust-item.lo trustlist.lo import.lo \
162 getauditlog.lo opassuan.lo passwd.lo engine.lo engine-gpg.lo \163 export.lo genkey.lo delete.lo edit.lo getauditlog.lo \
163 status-table.lo $(am__objects_1) $(am__objects_2) \164 opassuan.lo passwd.lo engine.lo engine-gpg.lo status-table.lo \
164 $(am__objects_3) $(am__objects_4) $(am__objects_5) \165 $(am__objects_1) $(am__objects_2) $(am__objects_3) \
165 vfs-mount.lo vfs-create.lo gpgconf.lo $(am__objects_7) \166 $(am__objects_4) $(am__objects_5) vfs-mount.lo vfs-create.lo \
166 dirinfo.lo debug.lo gpgme.lo version.lo error.lo167 gpgconf.lo $(am__objects_7) dirinfo.lo debug.lo gpgme.lo \
168 version.lo error.lo
167@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_8) \169@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_8) \
168@BUILD_W32_GLIB_TRUE@ ath.lo w32-glib-io.lo170@BUILD_W32_GLIB_TRUE@ ath.lo w32-glib-io.lo
169libgpgme_glib_la_OBJECTS = $(am_libgpgme_glib_la_OBJECTS)171libgpgme_glib_la_OBJECTS = $(am_libgpgme_glib_la_OBJECTS)
@@ -172,19 +174,20 @@
172 $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) -o $@174 $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) -o $@
173@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_rpath = -rpath $(libdir)175@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_rpath = -rpath $(libdir)
174am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c get-env.c \176am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c get-env.c \
175 context.h ops.h data.h data.c data-fd.c data-stream.c \177 context.h ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \
176 data-mem.c data-user.c data-compat.c signers.c sig-notation.c \178 data-stream.c data-mem.c data-user.c data-compat.c \
177 wait.c wait-global.c wait-private.c wait-user.c wait.h \179 data-identify.c signers.c sig-notation.c wait.c wait-global.c \
178 op-support.c encrypt.c encrypt-sign.c decrypt.c \180 wait-private.c wait-user.c wait.h op-support.c encrypt.c \
179 decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \181 encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \
180 keylist.c trust-item.c trustlist.c import.c export.c genkey.c \182 passphrase.c progress.c key.c keylist.c trust-item.c \
181 delete.c edit.c getauditlog.c opassuan.c passwd.c engine.h \183 trustlist.c import.c export.c genkey.c delete.c edit.c \
182 engine-backend.h engine.c engine-gpg.c status-table.c \184 getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \
183 engine-gpgsm.c assuan-support.c engine-assuan.c \185 engine.c engine-gpg.c status-table.c engine-gpgsm.c \
184 engine-gpgconf.c engine-uiserver.c engine-g13.c vfs-mount.c \186 assuan-support.c engine-assuan.c engine-gpgconf.c \
185 vfs-create.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \187 engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
186 posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \188 gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \
187 w32-sema.c dirinfo.c debug.c debug.h gpgme.c version.c error.c \189 posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \
190 dirinfo.c debug.c debug.h gpgme.c version.c error.c \
188 ath-pthread.c w32-io.c191 ath-pthread.c w32-io.c
189@HAVE_DOSISH_SYSTEM_TRUE@am__objects_9 = w32-io.lo192@HAVE_DOSISH_SYSTEM_TRUE@am__objects_9 = w32-io.lo
190am_libgpgme_pthread_la_OBJECTS = $(am__objects_8) ath-pthread.lo \193am_libgpgme_pthread_la_OBJECTS = $(am__objects_8) ath-pthread.lo \
@@ -195,20 +198,21 @@
195 $(libgpgme_pthread_la_LDFLAGS) $(LDFLAGS) -o $@198 $(libgpgme_pthread_la_LDFLAGS) $(LDFLAGS) -o $@
196@HAVE_PTHREAD_TRUE@am_libgpgme_pthread_la_rpath = -rpath $(libdir)199@HAVE_PTHREAD_TRUE@am_libgpgme_pthread_la_rpath = -rpath $(libdir)
197am__libgpgme_qt_la_SOURCES_DIST = util.h conversion.c get-env.c \200am__libgpgme_qt_la_SOURCES_DIST = util.h conversion.c get-env.c \
198 context.h ops.h data.h data.c data-fd.c data-stream.c \201 context.h ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \
199 data-mem.c data-user.c data-compat.c signers.c sig-notation.c \202 data-stream.c data-mem.c data-user.c data-compat.c \
200 wait.c wait-global.c wait-private.c wait-user.c wait.h \203 data-identify.c signers.c sig-notation.c wait.c wait-global.c \
201 op-support.c encrypt.c encrypt-sign.c decrypt.c \204 wait-private.c wait-user.c wait.h op-support.c encrypt.c \
202 decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \205 encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \
203 keylist.c trust-item.c trustlist.c import.c export.c genkey.c \206 passphrase.c progress.c key.c keylist.c trust-item.c \
204 delete.c edit.c getauditlog.c opassuan.c passwd.c engine.h \207 trustlist.c import.c export.c genkey.c delete.c edit.c \
205 engine-backend.h engine.c engine-gpg.c status-table.c \208 getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \
206 engine-gpgsm.c assuan-support.c engine-assuan.c \209 engine.c engine-gpg.c status-table.c engine-gpgsm.c \
207 engine-gpgconf.c engine-uiserver.c engine-g13.c vfs-mount.c \210 assuan-support.c engine-assuan.c engine-gpgconf.c \
208 vfs-create.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \211 engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
209 posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \212 gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \
210 w32-sema.c dirinfo.c debug.c debug.h gpgme.c version.c error.c \213 posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \
211 ath.c w32-qt-io.cpp kdpipeiodevice.h kdpipeiodevice.cpp \214 dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \
215 w32-qt-io.cpp kdpipeiodevice.h kdpipeiodevice.cpp \
212 kdpipeiodevice.moc216 kdpipeiodevice.moc
213@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_OBJECTS = $(am__objects_8) ath.lo \217@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_OBJECTS = $(am__objects_8) ath.lo \
214@BUILD_W32_QT_TRUE@ w32-qt-io.lo kdpipeiodevice.lo218@BUILD_W32_QT_TRUE@ w32-qt-io.lo kdpipeiodevice.lo
@@ -218,19 +222,21 @@
218 $(CXXFLAGS) $(libgpgme_qt_la_LDFLAGS) $(LDFLAGS) -o $@222 $(CXXFLAGS) $(libgpgme_qt_la_LDFLAGS) $(LDFLAGS) -o $@
219@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_rpath = -rpath $(libdir)223@BUILD_W32_QT_TRUE@am_libgpgme_qt_la_rpath = -rpath $(libdir)
220am__libgpgme_la_SOURCES_DIST = util.h conversion.c get-env.c context.h \224am__libgpgme_la_SOURCES_DIST = util.h conversion.c get-env.c context.h \
221 ops.h data.h data.c data-fd.c data-stream.c data-mem.c \225 ops.h parsetlv.c parsetlv.h data.h data.c data-fd.c \
222 data-user.c data-compat.c signers.c sig-notation.c wait.c \226 data-stream.c data-mem.c data-user.c data-compat.c \
223 wait-global.c wait-private.c wait-user.c wait.h op-support.c \227 data-identify.c signers.c sig-notation.c wait.c wait-global.c \
224 encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c \228 wait-private.c wait-user.c wait.h op-support.c encrypt.c \
225 sign.c passphrase.c progress.c key.c keylist.c trust-item.c \229 encrypt-sign.c decrypt.c decrypt-verify.c verify.c sign.c \
230 passphrase.c progress.c key.c keylist.c trust-item.c \
226 trustlist.c import.c export.c genkey.c delete.c edit.c \231 trustlist.c import.c export.c genkey.c delete.c edit.c \
227 getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \232 getauditlog.c opassuan.c passwd.c engine.h engine-backend.h \
228 engine.c engine-gpg.c status-table.c engine-gpgsm.c \233 engine.c engine-gpg.c status-table.c engine-gpgsm.c \
229 assuan-support.c engine-assuan.c engine-gpgconf.c \234 assuan-support.c engine-assuan.c engine-gpgconf.c \
230 engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \235 engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
231 gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \236 gpgconf.c sema.h priv-io.h ath.h posix-util.c posix-sema.c \
232 posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c dirinfo.c \237 posix-io.c w32-ce.h w32-ce.c w32-util.c w32-sema.c sys-util.h \
233 debug.c debug.h gpgme.c version.c error.c ath.c w32-io.c238 dirinfo.c debug.c debug.h gpgme.c version.c error.c ath.c \
239 w32-io.c
234am_libgpgme_la_OBJECTS = $(am__objects_8) ath.lo $(am__objects_9)240am_libgpgme_la_OBJECTS = $(am__objects_8) ath.lo $(am__objects_9)
235libgpgme_la_OBJECTS = $(am_libgpgme_la_OBJECTS)241libgpgme_la_OBJECTS = $(am_libgpgme_la_OBJECTS)
236libgpgme_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \242libgpgme_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -485,8 +491,9 @@
485# unresolved symbols to the thread module.491# unresolved symbols to the thread module.
486main_sources = \492main_sources = \
487 util.h conversion.c get-env.c context.h ops.h \493 util.h conversion.c get-env.c context.h ops.h \
494 parsetlv.c parsetlv.h \
488 data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \495 data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \
489 data-compat.c \496 data-compat.c data-identify.c \
490 signers.c sig-notation.c \497 signers.c sig-notation.c \
491 wait.c wait-global.c wait-private.c wait-user.c wait.h \498 wait.c wait-global.c wait-private.c wait-user.c wait.h \
492 op-support.c \499 op-support.c \
@@ -500,7 +507,7 @@
500 $(uiserver_components) \507 $(uiserver_components) \
501 $(g13_components) vfs-mount.c vfs-create.c \508 $(g13_components) vfs-mount.c vfs-create.c \
502 gpgconf.c \509 gpgconf.c \
503 sema.h priv-io.h $(system_components) dirinfo.c \510 sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \
504 debug.c debug.h gpgme.c version.c error.c511 debug.c debug.h gpgme.c version.c error.c
505512
506libgpgme_la_SOURCES = $(main_sources) \513libgpgme_la_SOURCES = $(main_sources) \
@@ -766,6 +773,7 @@
766@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversion.Plo@am__quote@773@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversion.Plo@am__quote@
767@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-compat.Plo@am__quote@774@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-compat.Plo@am__quote@
768@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-fd.Plo@am__quote@775@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-fd.Plo@am__quote@
776@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-identify.Plo@am__quote@
769@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-mem.Plo@am__quote@777@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-mem.Plo@am__quote@
770@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-stream.Plo@am__quote@778@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-stream.Plo@am__quote@
771@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-user.Plo@am__quote@779@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-user.Plo@am__quote@
@@ -800,6 +808,7 @@
800@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keylist.Plo@am__quote@808@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keylist.Plo@am__quote@
801@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op-support.Plo@am__quote@809@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op-support.Plo@am__quote@
802@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opassuan.Plo@am__quote@810@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opassuan.Plo@am__quote@
811@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsetlv.Plo@am__quote@
803@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passphrase.Plo@am__quote@812@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passphrase.Plo@am__quote@
804@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Plo@am__quote@813@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Plo@am__quote@
805@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-io.Plo@am__quote@814@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-io.Plo@am__quote@
806815
=== added file 'src/data-identify.c'
--- src/data-identify.c 1970-01-01 00:00:00 +0000
+++ src/data-identify.c 2013-10-23 07:14:02 +0000
@@ -0,0 +1,247 @@
1/* data-identify.c - Try to identify the data
2 Copyright (C) 2013 g10 Code GmbH
3
4 This file is part of GPGME.
5
6 GPGME is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of
9 the License, or (at your option) any later version.
10
11 GPGME is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20#if HAVE_CONFIG_H
21# include <config.h>
22#endif
23
24#include <stdlib.h>
25#include <string.h>
26
27#include "gpgme.h"
28#include "data.h"
29#include "util.h"
30#include "parsetlv.h"
31
32/* The size of the sample data we take for detection. */
33#define SAMPLE_SIZE 2048
34
35
36
37/* Note that DATA may be binary but a final nul is required so that
38 string operations will find a terminator.
39
40 Returns: GPGME_DATA_TYPE_xxxx */
41static gpgme_data_type_t
42basic_detection (const char *data, size_t datalen)
43{
44 tlvinfo_t ti;
45 const char *s;
46 size_t n;
47 int maybe_p12 = 0;
48
49 if (datalen < 24) /* Object is probably too short for detection. */
50 return GPGME_DATA_TYPE_UNKNOWN;
51
52 /* This is a common example of a CMS object - it is obvious that we
53 only need to read a few bytes to get to the OID:
54 30 82 0B 59 06 09 2A 86 48 86 F7 0D 01 07 02 A0 82 0B 4A 30 82 0B 46 02
55 ----------- ++++++++++++++++++++++++++++++++
56 SEQUENCE OID (signedData)
57 (2 byte len)
58
59 A PKCS#12 message is:
60
61 30 82 08 59 02 01 03 30 82 08 1F 06 09 2A 86 48 86 F7 0D 01 07 01 A0 82
62 ----------- ++++++++ ----------- ++++++++++++++++++++++++++++++++
63 SEQUENCE INTEGER SEQUENCE OID (data)
64
65 A X.509 certificate is:
66
67 30 82 05 B8 30 82 04 A0 A0 03 02 01 02 02 07 15 46 A0 BF 30 07 39 30 0D
68 ----------- +++++++++++ ----- ++++++++ --------------------------
69 SEQUENCE SEQUENCE [0] INTEGER INTEGER SEQU
70 (tbs) (version) (s/n) (Algo)
71
72 Thus we need to read at least 22 bytes, we add 2 bytes to cope with
73 length headers stored with 4 bytes.
74 */
75
76
77 s = data;
78 n = datalen;
79
80 if (parse_tlv (&s, &n, &ti))
81 goto try_pgp; /* Not properly BER encoded. */
82 if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_SEQUENCE
83 && ti.is_cons))
84 goto try_pgp; /* A CMS object always starts with a sequence. */
85
86 if (parse_tlv (&s, &n, &ti))
87 goto try_pgp; /* Not properly BER encoded. */
88 if (ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_SEQUENCE
89 && ti.is_cons && n >= ti.length)
90 {
91 if (parse_tlv (&s, &n, &ti))
92 goto try_pgp;
93 if (!(ti.cls == ASN1_CLASS_CONTEXT && ti.tag == 0
94 && ti.is_cons && ti.length == 3 && n >= ti.length))
95 goto try_pgp;
96
97 if (parse_tlv (&s, &n, &ti))
98 goto try_pgp;
99 if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER
100 && !ti.is_cons && ti.length == 1 && n && (*s == 1 || *s == 2)))
101 goto try_pgp;
102 s++;
103 n--;
104 if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER
105 && !ti.is_cons))
106 goto try_pgp;
107 /* Because the now following S/N may be larger than the sample
108 data we have, we stop parsing here and don't check for the
109 algorithm ID. */
110 return GPGME_DATA_TYPE_X509_CERT;
111 }
112 if (ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER
113 && !ti.is_cons && ti.length == 1 && n && *s == 3)
114 {
115 maybe_p12 = 1;
116 s++;
117 n--;
118 if (parse_tlv (&s, &n, &ti))
119 goto try_pgp;
120 if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_SEQUENCE
121 && ti.is_cons))
122 goto try_pgp;
123 if (parse_tlv (&s, &n, &ti))
124 goto try_pgp;
125 }
126 if (ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_OBJECT_ID
127 && !ti.is_cons && ti.length && n >= ti.length)
128 {
129 if (ti.length == 9)
130 {
131 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x07\x01", 9))
132 {
133 /* Data. */
134 return (maybe_p12 ? GPGME_DATA_TYPE_PKCS12
135 /* */ : GPGME_DATA_TYPE_CMS_OTHER);
136 }
137 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x07\x02", 9))
138 {
139 /* Signed Data. */
140 return (maybe_p12 ? GPGME_DATA_TYPE_PKCS12
141 /* */ : GPGME_DATA_TYPE_CMS_SIGNED);
142 }
143 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x07\x03", 9))
144 return GPGME_DATA_TYPE_CMS_ENCRYPTED; /* Enveloped Data. */
145 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x07\x05", 9))
146 return GPGME_DATA_TYPE_CMS_OTHER; /* Digested Data. */
147 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x07\x06", 9))
148 return GPGME_DATA_TYPE_CMS_OTHER; /* Encrypted Data. */
149 }
150 else if (ti.length == 11)
151 {
152 if (!memcmp (s, "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x01\x02", 11))
153 return GPGME_DATA_TYPE_CMS_OTHER; /* Auth Data. */
154 }
155 }
156
157
158 try_pgp:
159 /* Check whether this might be a non-armored PGP message. We need
160 to do this before checking for armor lines, so that we don't get
161 fooled by armored messages inside a signed binary PGP message. */
162 if ((data[0] & 0x80))
163 {
164 /* That might be a binary PGP message. At least it is not plain
165 ASCII. Of course this might be certain lead-in text of
166 armored CMS messages. However, I am not sure whether this is
167 at all defined and in any case it is uncommon. Thus we don't
168 do any further plausibility checks but stupidly assume no CMS
169 armored data will follow. */
170 return GPGME_DATA_TYPE_UNKNOWN;
171 }
172
173 /* Now check whether there are armor lines. */
174 for (s = data; s && *s; s = (*s=='\n')?(s+1):((s=strchr (s,'\n'))?(s+1):s))
175 {
176 if (!strncmp (s, "-----BEGIN ", 11))
177 {
178 if (!strncmp (s+11, "SIGNED ", 7))
179 return GPGME_DATA_TYPE_CMS_SIGNED;
180 if (!strncmp (s+11, "ENCRYPTED ", 10))
181 return GPGME_DATA_TYPE_CMS_ENCRYPTED;
182 if (!strncmp (s+11, "PGP ", 4))
183 {
184 if (!strncmp (s+15, "SIGNATURE", 9))
185 return GPGME_DATA_TYPE_PGP_SIGNED;
186 if (!strncmp (s+15, "SIGNED MESSAGE", 14))
187 return GPGME_DATA_TYPE_PGP_SIGNED;
188 if (!strncmp (s+15, "PUBLIC KEY BLOCK", 16))
189 return GPGME_DATA_TYPE_PGP_KEY;
190 if (!strncmp (s+15, "PRIVATE KEY BLOCK", 17))
191 return GPGME_DATA_TYPE_PGP_KEY;
192 if (!strncmp (s+15, "SECRET KEY BLOCK", 16))
193 return GPGME_DATA_TYPE_PGP_KEY;
194 if (!strncmp (s+15, "ARMORED FILE", 12))
195 return GPGME_DATA_TYPE_UNKNOWN;
196 return GPGME_DATA_TYPE_PGP_OTHER; /* PGP MESSAGE */
197 }
198 if (!strncmp (s+11, "CERTIFICATE", 11))
199 return GPGME_DATA_TYPE_X509_CERT;
200 if (!strncmp (s+11, "PKCS12", 6))
201 return GPGME_DATA_TYPE_PKCS12;
202 return GPGME_DATA_TYPE_CMS_OTHER; /* Not PGP, thus we assume CMS. */
203 }
204 }
205
206 return GPGME_DATA_TYPE_UNKNOWN;
207}
208
209
210/* Try to detect the type of the data. Note that this function works
211 only on seekable data objects. The function tries to reset the
212 file pointer but there is no guarantee that it will work.
213
214 FIXME: We may want to add internal buffering so that this function
215 can be implemented for allmost all kind of data objects.
216 */
217gpgme_data_type_t
218gpgme_data_identify (gpgme_data_t dh, int reserved)
219{
220 gpgme_data_type_t result;
221 char *sample;
222 int n;
223 gpgme_off_t off;
224
225 /* Check whether we can seek the data object. */
226 off = gpgme_data_seek (dh, 0, SEEK_CUR);
227 if (off == (gpgme_off_t)(-1))
228 return GPGME_DATA_TYPE_INVALID;
229
230 /* Allocate a buffer and read the data. */
231 sample = malloc (SAMPLE_SIZE);
232 if (!sample)
233 return GPGME_DATA_TYPE_INVALID; /* Ooops. */
234 n = gpgme_data_read (dh, sample, SAMPLE_SIZE - 1);
235 if (n < 0)
236 {
237 free (sample);
238 return GPGME_DATA_TYPE_INVALID; /* Ooops. */
239 }
240 sample[n] = 0; /* (Required for our string functions.) */
241
242 result = basic_detection (sample, n);
243 free (sample);
244 gpgme_data_seek (dh, off, SEEK_SET);
245
246 return result;
247}
0248
=== modified file 'src/dirinfo.c'
--- src/dirinfo.c 2013-05-14 20:29:20 +0000
+++ src/dirinfo.c 2013-10-23 07:14:02 +0000
@@ -1,5 +1,5 @@
1/* dirinfo.c - Get directory information1/* dirinfo.c - Get directory information
2 * Copyright (C) 2009 g10 Code GmbH2 * Copyright (C) 2009, 2013 g10 Code GmbH
3 *3 *
4 * This file is part of GPGME.4 * This file is part of GPGME.
5 *5 *
@@ -29,6 +29,7 @@
29#include "priv-io.h"29#include "priv-io.h"
30#include "debug.h"30#include "debug.h"
31#include "sema.h"31#include "sema.h"
32#include "sys-util.h"
3233
33DEFINE_STATIC_LOCK (dirinfo_lock);34DEFINE_STATIC_LOCK (dirinfo_lock);
3435
@@ -36,7 +37,11 @@
36enum37enum
37 {38 {
38 WANT_HOMEDIR,39 WANT_HOMEDIR,
39 WANT_AGENT_SOCKET40 WANT_AGENT_SOCKET,
41 WANT_GPG_NAME,
42 WANT_GPGSM_NAME,
43 WANT_G13_NAME,
44 WANT_UISRV_SOCKET
40 };45 };
4146
42/* Values retrieved via gpgconf and cached here. */47/* Values retrieved via gpgconf and cached here. */
@@ -44,13 +49,18 @@
44 int valid; /* Cached information is valid. */49 int valid; /* Cached information is valid. */
45 char *homedir;50 char *homedir;
46 char *agent_socket;51 char *agent_socket;
52 char *gpg_name;
53 char *gpgsm_name;
54 char *g13_name;
55 char *uisrv_socket;
47} dirinfo;56} dirinfo;
4857
4958
50/* Parse the output of "gpgconf --list-dirs". This function expects59/* Parse the output of "gpgconf --list-dirs". This function expects
51 that DIRINFO_LOCK is held by the caller. */60 that DIRINFO_LOCK is held by the caller. If COMPONENTS is set, the
61 output of --list-components is expected. */
52static void62static void
53parse_output (char *line)63parse_output (char *line, int components)
54{64{
55 char *value, *p;65 char *value, *p;
5666
@@ -58,6 +68,14 @@
58 if (!value)68 if (!value)
59 return;69 return;
60 *value++ = 0;70 *value++ = 0;
71 if (components)
72 {
73 /* Skip the second field. */
74 value = strchr (value, ':');
75 if (!value)
76 return;
77 *value++ = 0;
78 }
61 p = strchr (value, ':');79 p = strchr (value, ':');
62 if (p)80 if (p)
63 *p = 0;81 *p = 0;
@@ -66,19 +84,45 @@
66 if (!*value)84 if (!*value)
67 return;85 return;
6886
69 if (!strcmp (line, "homedir") && !dirinfo.homedir)87 if (components)
70 dirinfo.homedir = strdup (value);88 {
71 else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket)89 if (!strcmp (line, "gpg") && !dirinfo.gpg_name)
72 dirinfo.agent_socket = strdup (value);90 dirinfo.gpg_name = strdup (value);
91 else if (!strcmp (line, "gpgsm") && !dirinfo.gpgsm_name)
92 dirinfo.gpgsm_name = strdup (value);
93 else if (!strcmp (line, "g13") && !dirinfo.g13_name)
94 dirinfo.g13_name = strdup (value);
95 }
96 else
97 {
98 if (!strcmp (line, "homedir") && !dirinfo.homedir)
99 {
100 const char name[] = "S.uiserver";
101
102 dirinfo.homedir = strdup (value);
103 if (dirinfo.homedir)
104 {
105 dirinfo.uisrv_socket = malloc (strlen (dirinfo
106 .homedir)
107 + 1 + strlen (name) + 1);
108 if (dirinfo.uisrv_socket)
109 strcpy (stpcpy (stpcpy (dirinfo.uisrv_socket, dirinfo.homedir),
110 DIRSEP_S), name);
111 }
112 }
113 else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket)
114 dirinfo.agent_socket = strdup (value);
115 }
73}116}
74117
75118
76/* Read the directory information from gpgconf. This function expects119/* Read the directory information from gpgconf. This function expects
77 that DIRINFO_LOCK is held by the caller. */120 that DIRINFO_LOCK is held by the caller. PGNAME is the name of the
121 gpgconf binary. If COMPONENTS is set, not the directories bit the
122 name of the componeNts are read. */
78static void123static void
79read_gpgconf_dirs (void)124read_gpgconf_dirs (const char *pgmname, int components)
80{125{
81 const char *pgmname;
82 char linebuf[1024] = {0};126 char linebuf[1024] = {0};
83 int linelen = 0;127 int linelen = 0;
84 char * argv[3];128 char * argv[3];
@@ -89,12 +133,8 @@
89 int nread;133 int nread;
90 char *mark = NULL;134 char *mark = NULL;
91135
92 pgmname = _gpgme_get_gpgconf_path ();
93 if (!pgmname)
94 return; /* No way. */
95
96 argv[0] = (char *)pgmname;136 argv[0] = (char *)pgmname;
97 argv[1] = "--list-dirs";137 argv[1] = components? "--list-components" : "--list-dirs";
98 argv[2] = NULL;138 argv[2] = NULL;
99139
100 if (_gpgme_io_pipe (rp, 1) < 0)140 if (_gpgme_io_pipe (rp, 1) < 0)
@@ -132,7 +172,7 @@
132 else172 else
133 mark[0] = '\0';173 mark[0] = '\0';
134174
135 parse_output (line);175 parse_output (line, components);
136 }176 }
137177
138 nused = lastmark? (lastmark + 1 - linebuf) : 0;178 nused = lastmark? (lastmark + 1 - linebuf) : 0;
@@ -147,14 +187,38 @@
147187
148188
149static const char *189static const char *
150get_gpgconf_dir (int what)190get_gpgconf_item (int what)
151{191{
152 const char *result = NULL;192 const char *result = NULL;
153193
154 LOCK (dirinfo_lock);194 LOCK (dirinfo_lock);
155 if (!dirinfo.valid)195 if (!dirinfo.valid)
156 {196 {
157 read_gpgconf_dirs ();197 const char *pgmname;
198
199 pgmname = _gpgme_get_gpgconf_path ();
200 if (pgmname && access (pgmname, F_OK))
201 {
202 _gpgme_debug (DEBUG_INIT,
203 "gpgme_dinfo: gpgconf='%s' [not installed]\n", pgmname);
204 pgmname = NULL; /* Not available. */
205 }
206 else
207 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpgconf='%s'\n",
208 pgmname? pgmname : "[null]");
209 if (!pgmname)
210 {
211 /* Probably gpgconf is not installed. Assume we are using
212 GnuPG-1. */
213 pgmname = _gpgme_get_gpg_path ();
214 if (pgmname)
215 dirinfo.gpg_name = strdup (pgmname);
216 }
217 else
218 {
219 read_gpgconf_dirs (pgmname, 0);
220 read_gpgconf_dirs (pgmname, 1);
221 }
158 /* Even if the reading of the directories failed (e.g. due to an222 /* Even if the reading of the directories failed (e.g. due to an
159 too old version gpgconf or no gpgconf at all), we need to223 too old version gpgconf or no gpgconf at all), we need to
160 mark the entries as valid so that we won't try over and over224 mark the entries as valid so that we won't try over and over
@@ -162,11 +226,33 @@
162 the read values later because they are practically statically226 the read values later because they are practically statically
163 allocated. */227 allocated. */
164 dirinfo.valid = 1;228 dirinfo.valid = 1;
229 if (dirinfo.gpg_name)
230 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpg='%s'\n",
231 dirinfo.gpg_name);
232 if (dirinfo.g13_name)
233 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: g13='%s'\n",
234 dirinfo.g13_name);
235 if (dirinfo.gpgsm_name)
236 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: gpgsm='%s'\n",
237 dirinfo.gpgsm_name);
238 if (dirinfo.homedir)
239 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: homedir='%s'\n",
240 dirinfo.homedir);
241 if (dirinfo.agent_socket)
242 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: agent='%s'\n",
243 dirinfo.agent_socket);
244 if (dirinfo.uisrv_socket)
245 _gpgme_debug (DEBUG_INIT, "gpgme_dinfo: uisrv='%s'\n",
246 dirinfo.uisrv_socket);
165 }247 }
166 switch (what)248 switch (what)
167 {249 {
168 case WANT_HOMEDIR: result = dirinfo.homedir; break;250 case WANT_HOMEDIR: result = dirinfo.homedir; break;
169 case WANT_AGENT_SOCKET: result = dirinfo.agent_socket; break;251 case WANT_AGENT_SOCKET: result = dirinfo.agent_socket; break;
252 case WANT_GPG_NAME: result = dirinfo.gpg_name; break;
253 case WANT_GPGSM_NAME: result = dirinfo.gpgsm_name; break;
254 case WANT_G13_NAME: result = dirinfo.g13_name; break;
255 case WANT_UISRV_SOCKET: result = dirinfo.uisrv_socket; break;
170 }256 }
171 UNLOCK (dirinfo_lock);257 UNLOCK (dirinfo_lock);
172 return result;258 return result;
@@ -177,13 +263,51 @@
177const char *263const char *
178_gpgme_get_default_homedir (void)264_gpgme_get_default_homedir (void)
179{265{
180 return get_gpgconf_dir (WANT_HOMEDIR);266 return get_gpgconf_item (WANT_HOMEDIR);
181}267}
182268
183/* Return the default gpg-agent socket name. Returns NULL if not known. */269/* Return the default gpg-agent socket name. Returns NULL if not known. */
184const char *270const char *
185_gpgme_get_default_agent_socket (void)271_gpgme_get_default_agent_socket (void)
186{272{
187 return get_gpgconf_dir (WANT_AGENT_SOCKET);273 return get_gpgconf_item (WANT_AGENT_SOCKET);
188}274}
189275
276/* Return the default gpg file name. Returns NULL if not known. */
277const char *
278_gpgme_get_default_gpg_name (void)
279{
280 return get_gpgconf_item (WANT_GPG_NAME);
281}
282
283/* Return the default gpgsm file name. Returns NULL if not known. */
284const char *
285_gpgme_get_default_gpgsm_name (void)
286{
287 return get_gpgconf_item (WANT_GPGSM_NAME);
288}
289
290/* Return the default g13 file name. Returns NULL if not known. */
291const char *
292_gpgme_get_default_g13_name (void)
293{
294 return get_gpgconf_item (WANT_G13_NAME);
295}
296
297/* Return the default gpgconf file name. Returns NULL if not known.
298 Because gpgconf is the binary used to retrieved all these default
299 names, this function is merely a simple wrapper around the function
300 used to locate this binary. */
301const char *
302_gpgme_get_default_gpgconf_name (void)
303{
304 return _gpgme_get_gpgconf_path ();
305}
306
307/* Return the default UI-server socket name. Returns NULL if not
308 known. */
309const char *
310_gpgme_get_default_uisrv_socket (void)
311{
312 return get_gpgconf_item (WANT_UISRV_SOCKET);
313}
190314
=== modified file 'src/engine-g13.c'
--- src/engine-g13.c 2013-05-14 20:29:20 +0000
+++ src/engine-g13.c 2013-10-23 07:14:02 +0000
@@ -100,7 +100,7 @@
100g13_get_version (const char *file_name)100g13_get_version (const char *file_name)
101{101{
102 return _gpgme_get_program_version (file_name ? file_name102 return _gpgme_get_program_version (file_name ? file_name
103 : _gpgme_get_g13_path ());103 : _gpgme_get_default_g13_name ());
104}104}
105105
106106
@@ -251,11 +251,11 @@
251251
252#if USE_DESCRIPTOR_PASSING252#if USE_DESCRIPTOR_PASSING
253 err = assuan_pipe_connect253 err = assuan_pipe_connect
254 (g13->assuan_ctx, file_name ? file_name : _gpgme_get_g13_path (),254 (g13->assuan_ctx, file_name ? file_name : _gpgme_get_default_g13_name (),
255 argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING);255 argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING);
256#else256#else
257 err = assuan_pipe_connect257 err = assuan_pipe_connect
258 (g13->assuan_ctx, file_name ? file_name : _gpgme_get_g13_path (),258 (g13->assuan_ctx, file_name ? file_name : _gpgme_get_default_g13_name (),
259 argv, NULL, NULL, NULL, 0);259 argv, NULL, NULL, NULL, 0);
260#endif260#endif
261 if (err)261 if (err)
@@ -757,7 +757,7 @@
757struct engine_ops _gpgme_engine_ops_g13 =757struct engine_ops _gpgme_engine_ops_g13 =
758 {758 {
759 /* Static functions. */759 /* Static functions. */
760 _gpgme_get_g13_path,760 _gpgme_get_default_g13_name,
761 NULL,761 NULL,
762 g13_get_version,762 g13_get_version,
763 g13_get_req_version,763 g13_get_req_version,
764764
=== modified file 'src/engine-gpg.c'
--- src/engine-gpg.c 2013-05-29 18:33:42 +0000
+++ src/engine-gpg.c 2013-10-23 07:14:02 +0000
@@ -296,7 +296,7 @@
296gpg_get_version (const char *file_name)296gpg_get_version (const char *file_name)
297{297{
298 return _gpgme_get_program_version (file_name ? file_name298 return _gpgme_get_program_version (file_name ? file_name
299 : _gpgme_get_gpg_path ());299 : _gpgme_get_default_gpg_name ());
300}300}
301301
302302
@@ -1296,7 +1296,7 @@
1296 if (!gpg)1296 if (!gpg)
1297 return gpg_error (GPG_ERR_INV_VALUE);1297 return gpg_error (GPG_ERR_INV_VALUE);
12981298
1299 if (!gpg->file_name && !_gpgme_get_gpg_path ())1299 if (!gpg->file_name && !_gpgme_get_default_gpg_name ())
1300 return trace_gpg_error (GPG_ERR_INV_ENGINE);1300 return trace_gpg_error (GPG_ERR_INV_ENGINE);
13011301
1302 if (gpg->lc_ctype)1302 if (gpg->lc_ctype)
@@ -1352,7 +1352,7 @@
1352 fd_list[n].dup_to = -1;1352 fd_list[n].dup_to = -1;
13531353
1354 status = _gpgme_io_spawn (gpg->file_name ? gpg->file_name :1354 status = _gpgme_io_spawn (gpg->file_name ? gpg->file_name :
1355 _gpgme_get_gpg_path (), gpg->argv,1355 _gpgme_get_default_gpg_name (), gpg->argv,
1356 IOSPAWN_FLAG_ALLOW_SET_FG,1356 IOSPAWN_FLAG_ALLOW_SET_FG,
1357 fd_list, NULL, NULL, &pid);1357 fd_list, NULL, NULL, &pid);
1358 {1358 {
@@ -2401,7 +2401,7 @@
2401struct engine_ops _gpgme_engine_ops_gpg =2401struct engine_ops _gpgme_engine_ops_gpg =
2402 {2402 {
2403 /* Static functions. */2403 /* Static functions. */
2404 _gpgme_get_gpg_path,2404 _gpgme_get_default_gpg_name,
2405 NULL,2405 NULL,
2406 gpg_get_version,2406 gpg_get_version,
2407 gpg_get_req_version,2407 gpg_get_req_version,
24082408
=== modified file 'src/engine-gpgconf.c'
--- src/engine-gpgconf.c 2013-05-14 20:29:20 +0000
+++ src/engine-gpgconf.c 2013-10-23 07:14:02 +0000
@@ -61,7 +61,7 @@
61gpgconf_get_version (const char *file_name)61gpgconf_get_version (const char *file_name)
62{62{
63 return _gpgme_get_program_version (file_name ? file_name63 return _gpgme_get_program_version (file_name ? file_name
64 : _gpgme_get_gpgconf_path ());64 : _gpgme_get_default_gpgconf_name ());
65}65}
6666
6767
@@ -100,7 +100,7 @@
100 return gpg_error_from_syserror ();100 return gpg_error_from_syserror ();
101101
102 gpgconf->file_name = strdup (file_name ? file_name102 gpgconf->file_name = strdup (file_name ? file_name
103 : _gpgme_get_gpgconf_path ());103 : _gpgme_get_default_gpgconf_name ());
104 if (!gpgconf->file_name)104 if (!gpgconf->file_name)
105 err = gpg_error_from_syserror ();105 err = gpg_error_from_syserror ();
106106
@@ -923,7 +923,7 @@
923struct engine_ops _gpgme_engine_ops_gpgconf =923struct engine_ops _gpgme_engine_ops_gpgconf =
924 {924 {
925 /* Static functions. */925 /* Static functions. */
926 _gpgme_get_gpgconf_path,926 _gpgme_get_default_gpgconf_name,
927 NULL,927 NULL,
928 gpgconf_get_version,928 gpgconf_get_version,
929 gpgconf_get_req_version,929 gpgconf_get_req_version,
930930
=== modified file 'src/engine-gpgsm.c'
--- src/engine-gpgsm.c 2013-05-29 18:33:42 +0000
+++ src/engine-gpgsm.c 2013-10-23 07:14:02 +0000
@@ -120,7 +120,7 @@
120gpgsm_get_version (const char *file_name)120gpgsm_get_version (const char *file_name)
121{121{
122 return _gpgme_get_program_version (file_name ? file_name122 return _gpgme_get_program_version (file_name ? file_name
123 : _gpgme_get_gpgsm_path ());123 : _gpgme_get_default_gpgsm_name ());
124}124}
125125
126126
@@ -340,7 +340,8 @@
340340
341#if USE_DESCRIPTOR_PASSING341#if USE_DESCRIPTOR_PASSING
342 err = assuan_pipe_connect342 err = assuan_pipe_connect
343 (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (),343 (gpgsm->assuan_ctx,
344 file_name ? file_name : _gpgme_get_default_gpgsm_name (),
344 argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING);345 argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING);
345#else346#else
346 {347 {
@@ -352,7 +353,8 @@
352 achild_fds[i] = (assuan_fd_t) child_fds[i];353 achild_fds[i] = (assuan_fd_t) child_fds[i];
353354
354 err = assuan_pipe_connect355 err = assuan_pipe_connect
355 (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (),356 (gpgsm->assuan_ctx,
357 file_name ? file_name : _gpgme_get_default_gpgsm_name (),
356 argv, achild_fds, NULL, NULL, 0);358 argv, achild_fds, NULL, NULL, 0);
357359
358 /* For now... */360 /* For now... */
@@ -1945,7 +1947,7 @@
1945struct engine_ops _gpgme_engine_ops_gpgsm =1947struct engine_ops _gpgme_engine_ops_gpgsm =
1946 {1948 {
1947 /* Static functions. */1949 /* Static functions. */
1948 _gpgme_get_gpgsm_path,1950 _gpgme_get_default_gpgsm_name,
1949 NULL,1951 NULL,
1950 gpgsm_get_version,1952 gpgsm_get_version,
1951 gpgsm_get_req_version,1953 gpgsm_get_req_version,
19521954
=== modified file 'src/engine-uiserver.c'
--- src/engine-uiserver.c 2013-05-29 18:33:42 +0000
+++ src/engine-uiserver.c 2013-10-23 07:14:02 +0000
@@ -296,7 +296,7 @@
296296
297 err = assuan_socket_connect (uiserver->assuan_ctx,297 err = assuan_socket_connect (uiserver->assuan_ctx,
298 file_name ?298 file_name ?
299 file_name : _gpgme_get_uiserver_socket_path (),299 file_name : _gpgme_get_default_uisrv_socket (),
300 0, ASSUAN_SOCKET_SERVER_FDPASSING);300 0, ASSUAN_SOCKET_SERVER_FDPASSING);
301 if (err)301 if (err)
302 goto leave;302 goto leave;
@@ -1302,7 +1302,7 @@
1302struct engine_ops _gpgme_engine_ops_uiserver =1302struct engine_ops _gpgme_engine_ops_uiserver =
1303 {1303 {
1304 /* Static functions. */1304 /* Static functions. */
1305 _gpgme_get_uiserver_socket_path,1305 _gpgme_get_default_uisrv_socket,
1306 NULL,1306 NULL,
1307 uiserver_get_version,1307 uiserver_get_version,
1308 uiserver_get_req_version,1308 uiserver_get_req_version,
13091309
=== modified file 'src/gpgme-tool.c'
--- src/gpgme-tool.c 2013-05-29 18:33:42 +0000
+++ src/gpgme-tool.c 2013-10-23 07:14:02 +0000
@@ -1435,7 +1435,8 @@
1435 STATUS_INCLUDE_CERTS,1435 STATUS_INCLUDE_CERTS,
1436 STATUS_KEYLIST_MODE,1436 STATUS_KEYLIST_MODE,
1437 STATUS_RECIPIENT,1437 STATUS_RECIPIENT,
1438 STATUS_ENCRYPT_RESULT1438 STATUS_ENCRYPT_RESULT,
1439 STATUS_IDENTIFY_RESULT
1439 } status_t;1440 } status_t;
14401441
1441const char *status_string[] =1442const char *status_string[] =
@@ -1448,7 +1449,8 @@
1448 "INCLUDE_CERTS",1449 "INCLUDE_CERTS",
1449 "KEYLIST_MODE",1450 "KEYLIST_MODE",
1450 "RECIPIENT",1451 "RECIPIENT",
1451 "ENCRYPT_RESULT"1452 "ENCRYPT_RESULT",
1453 "IDENTIFY_RESULT"
1452 };1454 };
14531455
1454struct gpgme_tool1456struct gpgme_tool
@@ -2065,11 +2067,6 @@
2065}2067}
20662068
20672069
2068static const char hlp_passwd[] =
2069 "PASSWD <user-id>\n"
2070 "\n"
2071 "Ask the backend to change the passphrase for the key\n"
2072 "specified by USER-ID.";
2073gpg_error_t2070gpg_error_t
2074gt_passwd (gpgme_tool_t gt, char *fpr)2071gt_passwd (gpgme_tool_t gt, char *fpr)
2075{2072{
@@ -2086,6 +2083,29 @@
2086}2083}
20872084
20882085
2086gpg_error_t
2087gt_identify (gpgme_tool_t gt, gpgme_data_t data)
2088{
2089 const char *s = "?";
2090
2091 switch (gpgme_data_identify (data, 0))
2092 {
2093 case GPGME_DATA_TYPE_INVALID: return gpg_error (GPG_ERR_GENERAL);
2094 case GPGME_DATA_TYPE_UNKNOWN : s = "unknown"; break;
2095 case GPGME_DATA_TYPE_PGP_SIGNED : s = "PGP-signed"; break;
2096 case GPGME_DATA_TYPE_PGP_OTHER : s = "PGP"; break;
2097 case GPGME_DATA_TYPE_PGP_KEY : s = "PGP-key"; break;
2098 case GPGME_DATA_TYPE_CMS_SIGNED : s = "CMS-signed"; break;
2099 case GPGME_DATA_TYPE_CMS_ENCRYPTED: s = "CMS-encrypted"; break;
2100 case GPGME_DATA_TYPE_CMS_OTHER : s = "CMS"; break;
2101 case GPGME_DATA_TYPE_X509_CERT : s = "X.509"; break;
2102 case GPGME_DATA_TYPE_PKCS12 : s = "PKCS12"; break;
2103 }
2104 gt_write_status (gt, STATUS_IDENTIFY_RESULT, s, NULL);
2105 return 0;
2106}
2107
2108
2089#define GT_RESULT_ENCRYPT 0x12109#define GT_RESULT_ENCRYPT 0x1
2090#define GT_RESULT_DECRYPT 0x22110#define GT_RESULT_DECRYPT 0x2
2091#define GT_RESULT_SIGN 0x42111#define GT_RESULT_SIGN 0x4
@@ -3374,6 +3394,11 @@
3374}3394}
33753395
33763396
3397static const char hlp_passwd[] =
3398 "PASSWD <user-id>\n"
3399 "\n"
3400 "Ask the backend to change the passphrase for the key\n"
3401 "specified by USER-ID.";
3377static gpg_error_t3402static gpg_error_t
3378cmd_passwd (assuan_context_t ctx, char *line)3403cmd_passwd (assuan_context_t ctx, char *line)
3379{3404{
@@ -3430,6 +3455,39 @@
3430}3455}
34313456
34323457
3458static const char hlp_identify[] =
3459 "IDENTIY\n"
3460 "\n"
3461 "Identify the type of data set with the INPUT command.";
3462static gpg_error_t
3463cmd_identify (assuan_context_t ctx, char *line)
3464{
3465 struct server *server = assuan_get_pointer (ctx);
3466 gpg_error_t err;
3467 assuan_fd_t inp_fd;
3468 char *inp_fn;
3469 gpgme_data_t inp_data;
3470
3471 inp_fd = server->input_fd;
3472 inp_fn = server->input_filename;
3473 if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
3474 return GPG_ERR_ASS_NO_INPUT;
3475
3476 err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
3477 &server->input_stream);
3478 if (err)
3479 return err;
3480
3481 err = gt_identify (server->gt, inp_data);
3482
3483 gpgme_data_release (inp_data);
3484 server_reset_fds (server);
3485
3486 return err;
3487}
3488
3489
3490
3433/* Tell the assuan library about our commands. */3491/* Tell the assuan library about our commands. */
3434static gpg_error_t3492static gpg_error_t
3435register_commands (assuan_context_t ctx)3493register_commands (assuan_context_t ctx)
@@ -3488,6 +3546,7 @@
3488 { "PUBKEY_ALGO_NAME", cmd_pubkey_algo_name },3546 { "PUBKEY_ALGO_NAME", cmd_pubkey_algo_name },
3489 { "HASH_ALGO_NAME", cmd_hash_algo_name },3547 { "HASH_ALGO_NAME", cmd_hash_algo_name },
3490 { "PASSWD", cmd_passwd, hlp_passwd },3548 { "PASSWD", cmd_passwd, hlp_passwd },
3549 { "IDENTIFY", cmd_identify, hlp_identify },
3491 { NULL }3550 { NULL }
3492 };3551 };
3493 int idx;3552 int idx;
34943553
=== modified file 'src/gpgme.def'
--- src/gpgme.def 2013-05-14 20:29:20 +0000
+++ src/gpgme.def 2013-10-23 07:14:02 +0000
@@ -209,5 +209,9 @@
209 gpgme_set_pinentry_mode @158209 gpgme_set_pinentry_mode @158
210 gpgme_get_pinentry_mode @159210 gpgme_get_pinentry_mode @159
211211
212 gpgme_signers_count @160
213
214 gpgme_data_identify @161
215
212; END216; END
213217
214218
=== modified file 'src/gpgme.h.in'
--- src/gpgme.h.in 2013-05-29 18:33:42 +0000
+++ src/gpgme.h.in 2013-10-23 07:14:02 +0000
@@ -210,6 +210,22 @@
210 }210 }
211gpgme_data_encoding_t;211gpgme_data_encoding_t;
212212
213/* Known data types. */
214typedef enum
215 {
216 GPGME_DATA_TYPE_INVALID = 0, /* Not detected. */
217 GPGME_DATA_TYPE_UNKNOWN = 1,
218 GPGME_DATA_TYPE_PGP_SIGNED = 0x10,
219 GPGME_DATA_TYPE_PGP_OTHER = 0x12,
220 GPGME_DATA_TYPE_PGP_KEY = 0x13,
221 GPGME_DATA_TYPE_CMS_SIGNED = 0x20,
222 GPGME_DATA_TYPE_CMS_ENCRYPTED= 0x21,
223 GPGME_DATA_TYPE_CMS_OTHER = 0x22,
224 GPGME_DATA_TYPE_X509_CERT = 0x23,
225 GPGME_DATA_TYPE_PKCS12 = 0x24,
226 }
227gpgme_data_type_t;
228
213229
214230
215/* Public key algorithms from libgcrypt. */231/* Public key algorithms from libgcrypt. */
216typedef enum232typedef enum
@@ -934,6 +950,9 @@
934/* Add KEY to list of signers in CTX. */950/* Add KEY to list of signers in CTX. */
935gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key);951gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key);
936952
953/* Return the number of signers in CTX. */
954unsigned int gpgme_signers_count (const gpgme_ctx_t ctx);
955
937/* Return the SEQth signer's key in CTX. */956/* Return the SEQth signer's key in CTX. */
938gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);957gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);
939958
@@ -1146,6 +1165,9 @@
1146gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh,1165gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh,
1147 const char *file_name);1166 const char *file_name);
11481167
1168/* Try to identify the type of the data in DH. */
1169gpgme_data_type_t gpgme_data_identify (gpgme_data_t dh, int reserved);
1170
11491171
1150/* Create a new data buffer which retrieves the data from the callback1172/* Create a new data buffer which retrieves the data from the callback
1151 function READ_CB. Deprecated, please use gpgme_data_new_from_cbs1173 function READ_CB. Deprecated, please use gpgme_data_new_from_cbs
11521174
=== modified file 'src/libgpgme.vers'
--- src/libgpgme.vers 2013-05-14 20:29:20 +0000
+++ src/libgpgme.vers 2013-10-23 07:14:02 +0000
@@ -29,6 +29,7 @@
2929
30 gpgme_data_set_file_name;30 gpgme_data_set_file_name;
31 gpgme_data_get_file_name;31 gpgme_data_get_file_name;
32 gpgme_data_identify;
3233
33 gpgme_sig_notation_clear;34 gpgme_sig_notation_clear;
34 gpgme_sig_notation_add;35 gpgme_sig_notation_add;
@@ -143,6 +144,7 @@
143 gpgme_set_textmode;144 gpgme_set_textmode;
144 gpgme_signers_add;145 gpgme_signers_add;
145 gpgme_signers_clear;146 gpgme_signers_clear;
147 gpgme_signers_count;
146 gpgme_signers_enum;148 gpgme_signers_enum;
147149
148 gpgme_key_ref;150 gpgme_key_ref;
149151
=== added file 'src/parsetlv.c'
--- src/parsetlv.c 1970-01-01 00:00:00 +0000
+++ src/parsetlv.c 2013-10-23 07:14:02 +0000
@@ -0,0 +1,103 @@
1/* parsetlv.c - ASN.1 TLV functions
2 * Copyright (C) 2005, 2007, 2008, 2012 g10 Code GmbH
3 *
4 * This file is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
8 *
9 * This file is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifdef HAVE_CONFIG_H
19# include <config.h>
20#endif
21#include <stdio.h>
22#include <stdlib.h>
23#include <string.h>
24
25#include "parsetlv.h"
26
27
28/* Simple but pretty complete ASN.1 BER parser. Parse the data at the
29 address of BUFFER with a length given at the address of SIZE. On
30 success return 0 and update BUFFER and SIZE to point to the value.
31 Do not update them on error. The information about the object are
32 stored in the caller allocated TI structure. */
33int
34_gpgme_parse_tlv (char const **buffer, size_t *size, tlvinfo_t *ti)
35{
36 int c;
37 unsigned long tag;
38 const unsigned char *buf = (const unsigned char *)(*buffer);
39 size_t length = *size;
40
41 ti->cls = 0;
42 ti->tag = 0;
43 ti->is_cons = 0;
44 ti->is_ndef = 0;
45 ti->length = 0;
46 ti->nhdr = 0;
47
48 if (!length)
49 return -1;
50 c = *buf++; length--; ++ti->nhdr;
51
52 ti->cls = (c & 0xc0) >> 6;
53 ti->is_cons = !!(c & 0x20);
54 tag = c & 0x1f;
55
56 if (tag == 0x1f)
57 {
58 tag = 0;
59 do
60 {
61 tag <<= 7;
62 if (!length)
63 return -1;
64 c = *buf++; length--; ++ti->nhdr;
65 tag |= c & 0x7f;
66 }
67 while (c & 0x80);
68 }
69 ti->tag = tag;
70
71 if (!length)
72 return -1;
73 c = *buf++; length--; ++ti->nhdr;
74
75 if ( !(c & 0x80) )
76 ti->length = c;
77 else if (c == 0x80)
78 ti->is_ndef = 1;
79 else if (c == 0xff)
80 return -1;
81 else
82 {
83 unsigned long len = 0;
84 int count = (c & 0x7f);
85
86 if (count > sizeof (len) || count > sizeof (size_t))
87 return -1;
88
89 for (; count; count--)
90 {
91 len <<= 8;
92 if (!length)
93 return -1;
94 c = *buf++; length--; ++ti->nhdr;
95 len |= c & 0xff;
96 }
97 ti->length = len;
98 }
99
100 *buffer = (void*)buf;
101 *size = length;
102 return 0;
103}
0104
=== added file 'src/parsetlv.h'
--- src/parsetlv.h 1970-01-01 00:00:00 +0000
+++ src/parsetlv.h 2013-10-23 07:14:02 +0000
@@ -0,0 +1,48 @@
1/* parsetlv.h - TLV functions defintions
2 * Copyright (C) 2012 g10 Code GmbH
3 *
4 * This file is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
8 *
9 * This file is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef PARSETLV_H
19#define PARSETLV_H
20
21/* ASN.1 constants. */
22#define ASN1_CLASS_UNIVERSAL 0
23#define ASN1_CLASS_APPLICATION 1
24#define ASN1_CLASS_CONTEXT 2
25#define ASN1_CLASS_PRIVATE 3
26#define ASN1_TAG_INTEGER 2
27#define ASN1_TAG_OBJECT_ID 6
28#define ASN1_TAG_SEQUENCE 16
29
30
31/* Object used with parse_tlv. */
32struct tlvinfo_s
33{
34 int cls; /* The class of the tag. */
35 int tag; /* The tag. */
36 int is_cons; /* True if it is a constructed object. */
37 int is_ndef; /* True if the object has an indefinite length. */
38 size_t length; /* The length of the value. */
39 size_t nhdr; /* The number of octets in the header (tag,length). */
40};
41typedef struct tlvinfo_s tlvinfo_t;
42
43/*-- parsetlv.c --*/
44int _gpgme_parse_tlv (char const **buffer, size_t *size, tlvinfo_t *ti);
45#define parse_tlv(a,b,c) _gpgme_parse_tlv ((a), (b), (c))
46
47
48#endif /*PARSETLV_H*/
049
=== modified file 'src/posix-util.c'
--- src/posix-util.c 2013-05-14 20:29:20 +0000
+++ src/posix-util.c 2013-10-23 07:14:02 +0000
@@ -28,6 +28,7 @@
28#include <assert.h>28#include <assert.h>
2929
30#include "util.h"30#include "util.h"
31#include "sys-util.h"
3132
32const char *33const char *
33_gpgme_get_gpg_path (void)34_gpgme_get_gpg_path (void)
@@ -70,29 +71,6 @@
70}71}
7172
7273
73const char *
74_gpgme_get_uiserver_socket_path (void)
75{
76 static char *socket_path;
77 const char *homedir;
78 const char name[] = "S.uiserver";
79
80 if (socket_path)
81 return socket_path;
82
83 homedir = _gpgme_get_default_homedir ();
84 if (! homedir)
85 return NULL;
86
87 socket_path = malloc (strlen (homedir) + 1 + strlen (name) + 1);
88 if (! socket_path)
89 return NULL;
90
91 strcpy (stpcpy (stpcpy (socket_path, homedir), "/"), name);
92 return socket_path;
93}
94
95
96/* See w32-util.c */74/* See w32-util.c */
97int75int
98_gpgme_get_conf_int (const char *key, int *value)76_gpgme_get_conf_int (const char *key, int *value)
9977
=== modified file 'src/signers.c'
--- src/signers.c 2013-05-14 20:29:20 +0000
+++ src/signers.c 2013-10-23 07:14:02 +0000
@@ -93,6 +93,14 @@
93}93}
9494
9595
96/* Return the number of signers in CTX. */
97unsigned int
98gpgme_signers_count (const gpgme_ctx_t ctx)
99{
100 return ctx? ctx->signers_len : 0;
101}
102
103
96/* Return the SEQth signer's key in CTX with one reference. */104/* Return the SEQth signer's key in CTX with one reference. */
97gpgme_key_t105gpgme_key_t
98gpgme_signers_enum (const gpgme_ctx_t ctx, int seq)106gpgme_signers_enum (const gpgme_ctx_t ctx, int seq)
99107
=== added file 'src/sys-util.h'
--- src/sys-util.h 1970-01-01 00:00:00 +0000
+++ src/sys-util.h 2013-10-23 07:14:02 +0000
@@ -0,0 +1,29 @@
1/* sys-util.h - System utilities not generally used.
2 * Copyright (C) 2013 g10 Code GmbH
3 *
4 * This file is part of GPGME.
5 *
6 * GPGME is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * GPGME is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef SYS_UTIL_H
21#define SYS_UTIL_H
22
23/*-- {posix,w32}-util.c --*/
24const char *_gpgme_get_gpg_path (void);
25const char *_gpgme_get_gpgsm_path (void);
26const char *_gpgme_get_gpgconf_path (void);
27const char *_gpgme_get_g13_path (void);
28
29#endif /* SYS_UTIL_H */
030
=== modified file 'src/util.h'
--- src/util.h 2013-05-14 20:29:20 +0000
+++ src/util.h 2013-10-23 07:14:02 +0000
@@ -47,18 +47,17 @@
4747
4848
4949
50/*-- {posix,w32}-util.c --*/50/*-- {posix,w32}-util.c --*/
51const char *_gpgme_get_gpg_path (void);
52const char *_gpgme_get_gpgsm_path (void);
53const char *_gpgme_get_gpgconf_path (void);
54const char *_gpgme_get_g13_path (void);
55const char *_gpgme_get_uiserver_socket_path (void);
56
57int _gpgme_get_conf_int (const char *key, int *value);51int _gpgme_get_conf_int (const char *key, int *value);
58void _gpgme_allow_set_foreground_window (pid_t pid);52void _gpgme_allow_set_foreground_window (pid_t pid);
5953
60/*-- dirinfo.c --*/54/*-- dirinfo.c --*/
61const char *_gpgme_get_default_homedir (void);55const char *_gpgme_get_default_homedir (void);
62const char *_gpgme_get_default_agent_socket (void);56const char *_gpgme_get_default_agent_socket (void);
57const char *_gpgme_get_default_gpg_name (void);
58const char *_gpgme_get_default_gpgsm_name (void);
59const char *_gpgme_get_default_g13_name (void);
60const char *_gpgme_get_default_gpgconf_name (void);
61const char *_gpgme_get_default_uisrv_socket (void);
6362
6463
6564
6665
6766
=== modified file 'src/w32-util.c'
--- src/w32-util.c 2013-05-14 20:29:20 +0000
+++ src/w32-util.c 2013-10-23 07:14:02 +0000
@@ -1,24 +1,23 @@
1/* w32-util.c - Utility functions for the W32 API1/* w32-util.c - Utility functions for the W32 API
2 Copyright (C) 1999 Free Software Foundation, Inc2 * Copyright (C) 1999 Free Software Foundation, Inc
3 Copyright (C) 2001 Werner Koch (dd9jn)3 * Copyright (C) 2001 Werner Koch (dd9jn)
4 Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH4 * Copyright (C) 2001, 2002, 2003, 2004, 2007, 2013 g10 Code GmbH
55 *
6 This file is part of GPGME.6 * This file is part of GPGME.
77 *
8 GPGME is free software; you can redistribute it and/or modify it8 * GPGME is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as9 * under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation; either version 2.1 of10 * published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.11 * the License, or (at your option) any later version.
1212 *
13 GPGME is distributed in the hope that it will be useful, but13 * GPGME is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.16 * Lesser General Public License for more details.
1717 *
18 You should have received a copy of the GNU Lesser General Public18 * You should have received a copy of the GNU Lesser General Public
19 License along with this program; if not, write to the Free Software19 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA20 **/
21 02111-1307, USA. */
2221
23#ifdef HAVE_CONFIG_H22#ifdef HAVE_CONFIG_H
24#include <config.h>23#include <config.h>
@@ -63,6 +62,7 @@
63#include "ath.h"62#include "ath.h"
64#include "sema.h"63#include "sema.h"
65#include "debug.h"64#include "debug.h"
65#include "sys-util.h"
6666
6767
68#ifndef HAVE_W32CE_SYSTEM68#ifndef HAVE_W32CE_SYSTEM
@@ -75,6 +75,12 @@
7575
76DEFINE_STATIC_LOCK (get_path_lock);76DEFINE_STATIC_LOCK (get_path_lock);
7777
78/* The module handle of this DLL. If we are linked statically,
79 dllmain does not exists and thus the value of my_hmodule will be
80 NULL. The effect is that a GetModuleFileName always returns the
81 file name of the DLL or executable which contains the gpgme code. */
82static HMODULE my_hmodule;
83
7884
79#ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW85#ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW
8086
@@ -112,6 +118,39 @@
112}118}
113#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */119#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */
114120
121
122/* Return a malloced string encoded in UTF-8 from the wide char input
123 string STRING. Caller must free this value. Returns NULL and sets
124 ERRNO on failure. Calling this function with STRING set to NULL is
125 not defined. */
126static char *
127wchar_to_utf8 (const wchar_t *string)
128{
129 int n;
130 char *result;
131
132 n = WideCharToMultiByte (CP_UTF8, 0, string, -1, NULL, 0, NULL, NULL);
133 if (n < 0)
134 {
135 gpg_err_set_errno (EINVAL);
136 return NULL;
137 }
138
139 result = malloc (n+1);
140 if (!result)
141 return NULL;
142
143 n = WideCharToMultiByte (CP_UTF8, 0, string, -1, result, n, NULL, NULL);
144 if (n < 0)
145 {
146 free (result);
147 gpg_err_set_errno (EINVAL);
148 result = NULL;
149 }
150 return result;
151}
152
153
115void154void
116_gpgme_allow_set_foreground_window (pid_t pid)155_gpgme_allow_set_foreground_window (pid_t pid)
117{156{
@@ -270,58 +309,94 @@
270}309}
271310
272311
273#if 0312/* Return the name of the directory with the gpgme DLL or the EXE (if
274static char *313 statically linked). May return NULL on severe errors. */
275find_program_in_registry (const char *name)314const char *
276{315_gpgme_get_inst_dir (void)
277 char *program = NULL;316{
278317 static char *inst_dir;
279 program = read_w32_registry_string (NULL, "Software\\GNU\\GnuPG", name);318
280 if (program)319 LOCK (get_path_lock);
281 {320 if (!inst_dir)
282 int i;321 {
283322 wchar_t *moddir;
284 TRACE2 (DEBUG_CTX, "gpgme:find_program_in_registry", 0,323
285 "found %s in registry: `%s'", name, program);324 moddir = malloc ((MAX_PATH+5) * sizeof *moddir);
286 for (i = 0; program[i]; i++)325 if (moddir)
287 {326 {
288 if (program[i] == '/')327 if (!GetModuleFileNameW (my_hmodule, moddir, MAX_PATH))
289 program[i] = '\\';328 *moddir = 0;
290 }329 if (!*moddir)
291 }330 gpg_err_set_errno (ENOENT);
292 return program;331 else
293}332 {
294#endif333 inst_dir = wchar_to_utf8 (moddir);
295334 if (inst_dir)
296335 {
297static char *336 char *p = strrchr (inst_dir, '\\');
298find_program_in_inst_dir (const char *name)337 if (p)
299{338 *p = 0;
300 char *result = NULL;339 }
301 char *tmp;340 }
302341 free (moddir);
303 tmp = read_w32_registry_string ("HKEY_LOCAL_MACHINE",342 }
343 }
344 UNLOCK (get_path_lock);
345 return inst_dir;
346}
347
348
349static char *
350find_program_in_dir (const char *dir, const char *name)
351{
352 char *result;
353
354 result = malloc (strlen (dir) + 1 + strlen (name) + 1);
355 if (!result)
356 return NULL;
357
358 strcpy (stpcpy (stpcpy (result, dir), "\\"), name);
359 if (access (result, F_OK))
360 {
361 free (result);
362 return NULL;
363 }
364
365 return result;
366}
367
368
369static char *
370find_program_in_inst_dir (const char *inst_dir, const char *name)
371{
372 char *result;
373 char *dir;
374
375 /* If an installation directory has been passed, this overrides a
376 location given bu the registry. The idea here is that we prefer
377 a a program installed alongside with gpgme. We don't want the
378 registry to override this to have a better isolation of an gpgme
379 aware applications for other effects. Note that the "Install
380 Directory" registry item has been used for ages in Gpg4win and
381 earlier GnuPG windows installers. It is technically not anymore
382 required. */
383 if (inst_dir)
384 {
385 result = find_program_in_dir (inst_dir, name);
386 if (result)
387 return result;
388 }
389
390 dir = read_w32_registry_string ("HKEY_LOCAL_MACHINE",
304 "Software\\GNU\\GnuPG",391 "Software\\GNU\\GnuPG",
305 "Install Directory");392 "Install Directory");
306 if (!tmp)393 if (dir)
307 return NULL;394 {
308395 result = find_program_in_dir (dir, name);
309 result = malloc (strlen (tmp) + 1 + strlen (name) + 1);396 free (dir);
310 if (!result)397 return result;
311 {398 }
312 free (tmp);399 return NULL;
313 return NULL;
314 }
315
316 strcpy (stpcpy (stpcpy (result, tmp), "\\"), name);
317 free (tmp);
318 if (access (result, F_OK))
319 {
320 free (result);
321 return NULL;
322 }
323
324 return result;
325}400}
326401
327402
@@ -353,14 +428,12 @@
353_gpgme_get_gpg_path (void)428_gpgme_get_gpg_path (void)
354{429{
355 static char *gpg_program;430 static char *gpg_program;
431 const char *inst_dir;
356432
433 inst_dir = _gpgme_get_inst_dir ();
357 LOCK (get_path_lock);434 LOCK (get_path_lock);
358#if 0435 if (!gpg_program)
359 if (!gpg_program)436 gpg_program = find_program_in_inst_dir (inst_dir, "gpg.exe");
360 gpg_program = find_program_in_registry ("gpgProgram");
361#endif
362 if (!gpg_program)
363 gpg_program = find_program_in_inst_dir ("gpg.exe");
364 if (!gpg_program)437 if (!gpg_program)
365 gpg_program = find_program_at_standard_place ("GNU\\GnuPG\\gpg.exe");438 gpg_program = find_program_at_standard_place ("GNU\\GnuPG\\gpg.exe");
366 UNLOCK (get_path_lock);439 UNLOCK (get_path_lock);
@@ -372,14 +445,12 @@
372_gpgme_get_gpgsm_path (void)445_gpgme_get_gpgsm_path (void)
373{446{
374 static char *gpgsm_program;447 static char *gpgsm_program;
448 const char *inst_dir;
375449
450 inst_dir = _gpgme_get_inst_dir ();
376 LOCK (get_path_lock);451 LOCK (get_path_lock);
377#if 0452 if (!gpgsm_program)
378 if (!gpgsm_program)453 gpgsm_program = find_program_in_inst_dir (inst_dir, "gpgsm.exe");
379 gpgsm_program = find_program_in_registry ("gpgsmProgram");
380#endif
381 if (!gpgsm_program)
382 gpgsm_program = find_program_in_inst_dir ("gpgsm.exe");
383 if (!gpgsm_program)454 if (!gpgsm_program)
384 gpgsm_program = find_program_at_standard_place ("GNU\\GnuPG\\gpgsm.exe");455 gpgsm_program = find_program_at_standard_place ("GNU\\GnuPG\\gpgsm.exe");
385 UNLOCK (get_path_lock);456 UNLOCK (get_path_lock);
@@ -391,14 +462,12 @@
391_gpgme_get_gpgconf_path (void)462_gpgme_get_gpgconf_path (void)
392{463{
393 static char *gpgconf_program;464 static char *gpgconf_program;
465 const char *inst_dir;
394466
467 inst_dir = _gpgme_get_inst_dir ();
395 LOCK (get_path_lock);468 LOCK (get_path_lock);
396#if 0469 if (!gpgconf_program)
397 if (!gpgconf_program)470 gpgconf_program = find_program_in_inst_dir (inst_dir, "gpgconf.exe");
398 gpgconf_program = find_program_in_registry ("gpgconfProgram");
399#endif
400 if (!gpgconf_program)
401 gpgconf_program = find_program_in_inst_dir ("gpgconf.exe");
402 if (!gpgconf_program)471 if (!gpgconf_program)
403 gpgconf_program472 gpgconf_program
404 = find_program_at_standard_place ("GNU\\GnuPG\\gpgconf.exe");473 = find_program_at_standard_place ("GNU\\GnuPG\\gpgconf.exe");
@@ -411,14 +480,12 @@
411_gpgme_get_g13_path (void)480_gpgme_get_g13_path (void)
412{481{
413 static char *g13_program;482 static char *g13_program;
483 const char *inst_dir;
414484
485 inst_dir = _gpgme_get_inst_dir ();
415 LOCK (get_path_lock);486 LOCK (get_path_lock);
416#if 0487 if (!g13_program)
417 if (!g13_program)488 g13_program = find_program_in_inst_dir (inst_dir, "g13.exe");
418 g13_program = find_program_in_registry ("g13Program");
419#endif
420 if (!g13_program)
421 g13_program = find_program_in_inst_dir ("g13.exe");
422 if (!g13_program)489 if (!g13_program)
423 g13_program = find_program_at_standard_place ("GNU\\GnuPG\\g13.exe");490 g13_program = find_program_at_standard_place ("GNU\\GnuPG\\g13.exe");
424 UNLOCK (get_path_lock);491 UNLOCK (get_path_lock);
@@ -427,36 +494,15 @@
427494
428495
429const char *496const char *
430_gpgme_get_uiserver_socket_path (void)
431{
432 static char *socket_path;
433 const char *homedir;
434 const char name[] = "S.uiserver";
435
436 if (socket_path)
437 return socket_path;
438
439 homedir = _gpgme_get_default_homedir ();
440 if (! homedir)
441 return NULL;
442
443 socket_path = malloc (strlen (homedir) + 1 + strlen (name) + 1);
444 if (! socket_path)
445 return NULL;
446
447 strcpy (stpcpy (stpcpy (socket_path, homedir), "\\"), name);
448 return socket_path;
449}
450
451
452const char *
453_gpgme_get_w32spawn_path (void)497_gpgme_get_w32spawn_path (void)
454{498{
455 static char *w32spawn_program;499 static char *w32spawn_program;
500 const char *inst_dir;
456501
502 inst_dir = _gpgme_get_inst_dir ();
457 LOCK (get_path_lock);503 LOCK (get_path_lock);
458 if (!w32spawn_program)504 if (!w32spawn_program)
459 w32spawn_program = find_program_in_inst_dir ("gpgme-w32spawn.exe");505 w32spawn_program = find_program_in_inst_dir (inst_dir,"gpgme-w32spawn.exe");
460 if (!w32spawn_program)506 if (!w32spawn_program)
461 w32spawn_program507 w32spawn_program
462 = find_program_at_standard_place ("GNU\\GnuPG\\gpgme-w32spawn.exe");508 = find_program_at_standard_place ("GNU\\GnuPG\\gpgme-w32spawn.exe");
@@ -641,3 +687,18 @@
641 return tmp;687 return tmp;
642}688}
643#endif /*HAVE_W32CE_SYSTEM*/689#endif /*HAVE_W32CE_SYSTEM*/
690
691
692/* Entry point called by the DLL loader. */
693#ifdef DLL_EXPORT
694int WINAPI
695DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
696{
697 (void)reserved;
698
699 if (reason == DLL_PROCESS_ATTACH)
700 my_hmodule = hinst;
701
702 return TRUE;
703}
704#endif /*DLL_EXPORT*/
644705
=== added file 'tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F'
645Binary files tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F 1970-01-01 00:00:00 +0000 and tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F 2013-10-23 07:14:02 +0000 differ706Binary files tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F 1970-01-01 00:00:00 +0000 and tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F 2013-10-23 07:14:02 +0000 differ
=== added file 'tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD'
646Binary files tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD 1970-01-01 00:00:00 +0000 and tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD 2013-10-23 07:14:02 +0000 differ707Binary files tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD 1970-01-01 00:00:00 +0000 and tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD 2013-10-23 07:14:02 +0000 differ
=== added file 'tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66'
647Binary files tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66 1970-01-01 00:00:00 +0000 and tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66 2013-10-23 07:14:02 +0000 differ708Binary files tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66 1970-01-01 00:00:00 +0000 and tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66 2013-10-23 07:14:02 +0000 differ
=== added file 'tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C'
648Binary files tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C 1970-01-01 00:00:00 +0000 and tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C 2013-10-23 07:14:02 +0000 differ709Binary files tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C 1970-01-01 00:00:00 +0000 and tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C 2013-10-23 07:14:02 +0000 differ
=== added file 'tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD'
649Binary files tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD 1970-01-01 00:00:00 +0000 and tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD 2013-10-23 07:14:02 +0000 differ710Binary files tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD 1970-01-01 00:00:00 +0000 and tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD 2013-10-23 07:14:02 +0000 differ
=== modified file 'tests/gpg/Makefile.am'
--- tests/gpg/Makefile.am 2013-05-14 20:29:20 +0000
+++ tests/gpg/Makefile.am 2013-10-23 07:14:02 +0000
@@ -1,18 +1,18 @@
1# Copyright (C) 2000 Werner Koch (dd9jn)1# Copyright (C) 2000 Werner Koch (dd9jn)
2# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH2# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH
3# 3#
4# This file is part of GPGME.4# This file is part of GPGME.
5# 5#
6# GPGME is free software; you can redistribute it and/or modify it6# GPGME is free software; you can redistribute it and/or modify it
7# under the terms of the GNU Lesser General Public License as7# under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of the8# published by the Free Software Foundation; either version 2.1 of the
9# License, or (at your option) any later version.9# License, or (at your option) any later version.
10# 10#
11# GPGME is distributed in the hope that it will be useful, but WITHOUT11# GPGME is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14# Public License for more details.14# Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -20,8 +20,9 @@
20## Process this file with automake to produce Makefile.in20## Process this file with automake to produce Makefile.in
2121
22GPG = @GPG@22GPG = @GPG@
23GPG_AGENT = @GPG_AGENT@
2324
24TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO=25TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO=
2526
26# The keylist tests must come after the import and the edit test.27# The keylist tests must come after the import and the edit test.
27noinst_HEADERS = t-support.h28noinst_HEADERS = t-support.h
@@ -32,17 +33,29 @@
32tests_unix = t-eventloop t-thread133tests_unix = t-eventloop t-thread1
33endif34endif
3435
35TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \36c_tests = \
37 t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \
36 t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \38 t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \
37 t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait \39 t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait \
38 t-encrypt-large t-file-name t-gpgconf $(tests_unix)40 t-encrypt-large t-file-name t-gpgconf $(tests_unix)
3941
42TESTS = initial.test $(c_tests) final.test
43
40CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \44CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
41 gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \45 gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
42 random_seed46 random_seed S.gpg-agent
4347
44EXTRA_DIST = pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \48private_keys = \
45 geheim.txt pubkey-1.asc seckey-1.asc pinentry49 13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
50 76F7E2B35832976B50A27A282D9B87E44577EB66 \
51 A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
52 13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
53 7A030357C0F253A5BBCD282FFC4E521B37558F5C
54
55
56EXTRA_DIST = start-stop-agent initial.test final.test \
57 pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \
58 geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys)
4659
47INCLUDES = -I$(top_builddir)/src60INCLUDES = -I$(top_builddir)/src
4861
@@ -51,17 +64,25 @@
51t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread64t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread
5265
53# We don't run t-genkey in the test suite, because it takes too long66# We don't run t-genkey in the test suite, because it takes too long
54noinst_PROGRAMS = $(TESTS) t-genkey67noinst_PROGRAMS = $(c_tests) t-genkey
5568
56clean-local:69clean-local:
57 -gpg-connect-agent KILLAGENT /bye70 -$(srcdir)/start-stop-agent --stop
58 -rm -fR private-keys-v1.d71 -rm -fR private-keys-v1.d
5972
60all-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg 73all-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg \
74 ./private-keys-v1.d/gpg-sample.stamp
6175
62export GNUPGHOME := $(abs_builddir)76export GNUPGHOME := $(abs_builddir)
6377
64export GPG_AGENT_INFO := 78export GPG_AGENT_INFO :=
79
80./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
81 test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
82 for k in $(private_keys); do \
83 cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
84 done
85 echo x > ./private-keys-v1.d/gpg-sample.stamp
6586
66./pubring.gpg: $(srcdir)/pubdemo.asc87./pubring.gpg: $(srcdir)/pubdemo.asc
67 -$(GPG) --no-permission-warning \88 -$(GPG) --no-permission-warning \
6889
=== modified file 'tests/gpg/Makefile.in'
--- tests/gpg/Makefile.in 2013-05-14 20:29:20 +0000
+++ tests/gpg/Makefile.in 2013-10-23 07:14:02 +0000
@@ -17,19 +17,19 @@
1717
18# Copyright (C) 2000 Werner Koch (dd9jn)18# Copyright (C) 2000 Werner Koch (dd9jn)
19# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH19# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH
20# 20#
21# This file is part of GPGME.21# This file is part of GPGME.
22# 22#
23# GPGME is free software; you can redistribute it and/or modify it23# GPGME is free software; you can redistribute it and/or modify it
24# under the terms of the GNU Lesser General Public License as24# under the terms of the GNU Lesser General Public License as
25# published by the Free Software Foundation; either version 2.1 of the25# published by the Free Software Foundation; either version 2.1 of the
26# License, or (at your option) any later version.26# License, or (at your option) any later version.
27# 27#
28# GPGME is distributed in the hope that it will be useful, but WITHOUT28# GPGME is distributed in the hope that it will be useful, but WITHOUT
29# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY29# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
30# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General30# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
31# Public License for more details.31# Public License for more details.
32# 32#
33# You should have received a copy of the GNU Lesser General Public33# You should have received a copy of the GNU Lesser General Public
34# License along with this program; if not, write to the Free Software34# License along with this program; if not, write to the Free Software
35# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA35# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -71,14 +71,7 @@
71POST_UNINSTALL = :71POST_UNINSTALL = :
72build_triplet = @build@72build_triplet = @build@
73host_triplet = @host@73host_triplet = @host@
74TESTS = t-encrypt$(EXEEXT) t-encrypt-sym$(EXEEXT) \74TESTS = initial.test $(am__EXEEXT_2) final.test
75 t-encrypt-sign$(EXEEXT) t-sign$(EXEEXT) t-signers$(EXEEXT) \
76 t-decrypt$(EXEEXT) t-verify$(EXEEXT) t-decrypt-verify$(EXEEXT) \
77 t-sig-notation$(EXEEXT) t-export$(EXEEXT) t-import$(EXEEXT) \
78 t-trustlist$(EXEEXT) t-edit$(EXEEXT) t-keylist$(EXEEXT) \
79 t-keylist-sig$(EXEEXT) t-wait$(EXEEXT) \
80 t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \
81 t-gpgconf$(EXEEXT) $(am__EXEEXT_1)
82noinst_PROGRAMS = $(am__EXEEXT_2) t-genkey$(EXEEXT)75noinst_PROGRAMS = $(am__EXEEXT_2) t-genkey$(EXEEXT)
83subdir = tests/gpg76subdir = tests/gpg
84DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \77DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
@@ -388,18 +381,33 @@
388top_build_prefix = @top_build_prefix@381top_build_prefix = @top_build_prefix@
389top_builddir = @top_builddir@382top_builddir = @top_builddir@
390top_srcdir = @top_srcdir@383top_srcdir = @top_srcdir@
391TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO=384GPG_AGENT = @GPG_AGENT@
385TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO=
392386
393# The keylist tests must come after the import and the edit test.387# The keylist tests must come after the import and the edit test.
394noinst_HEADERS = t-support.h388noinst_HEADERS = t-support.h
395@HAVE_W32_SYSTEM_FALSE@tests_unix = t-eventloop t-thread1389@HAVE_W32_SYSTEM_FALSE@tests_unix = t-eventloop t-thread1
396@HAVE_W32_SYSTEM_TRUE@tests_unix = 390@HAVE_W32_SYSTEM_TRUE@tests_unix =
391c_tests = \
392 t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \
393 t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \
394 t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait \
395 t-encrypt-large t-file-name t-gpgconf $(tests_unix)
396
397CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \397CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
398 gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \398 gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
399 random_seed399 random_seed S.gpg-agent
400400
401EXTRA_DIST = pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \401private_keys = \
402 geheim.txt pubkey-1.asc seckey-1.asc pinentry402 13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
403 76F7E2B35832976B50A27A282D9B87E44577EB66 \
404 A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
405 13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
406 7A030357C0F253A5BBCD282FFC4E521B37558F5C
407
408EXTRA_DIST = start-stop-agent initial.test final.test \
409 pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \
410 geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys)
403411
404INCLUDES = -I$(top_builddir)/src412INCLUDES = -I$(top_builddir)/src
405AM_CPPFLAGS = @GPG_ERROR_CFLAGS@413AM_CPPFLAGS = @GPG_ERROR_CFLAGS@
@@ -871,14 +879,22 @@
871879
872880
873clean-local:881clean-local:
874 -gpg-connect-agent KILLAGENT /bye882 -$(srcdir)/start-stop-agent --stop
875 -rm -fR private-keys-v1.d883 -rm -fR private-keys-v1.d
876884
877all-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg 885all-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg \
886 ./private-keys-v1.d/gpg-sample.stamp
878887
879export GNUPGHOME := $(abs_builddir)888export GNUPGHOME := $(abs_builddir)
880889
881export GPG_AGENT_INFO := 890export GPG_AGENT_INFO :=
891
892./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
893 test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
894 for k in $(private_keys); do \
895 cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
896 done
897 echo x > ./private-keys-v1.d/gpg-sample.stamp
882898
883./pubring.gpg: $(srcdir)/pubdemo.asc899./pubring.gpg: $(srcdir)/pubdemo.asc
884 -$(GPG) --no-permission-warning \900 -$(GPG) --no-permission-warning \
885901
=== added file 'tests/gpg/final.test'
--- tests/gpg/final.test 1970-01-01 00:00:00 +0000
+++ tests/gpg/final.test 2013-10-23 07:14:02 +0000
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3${srcdir}/start-stop-agent --stop
4exit 0
05
=== added file 'tests/gpg/initial.test'
--- tests/gpg/initial.test 1970-01-01 00:00:00 +0000
+++ tests/gpg/initial.test 2013-10-23 07:14:02 +0000
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3${srcdir}/start-stop-agent --start
4exit 0
05
=== added file 'tests/gpg/start-stop-agent'
--- tests/gpg/start-stop-agent 1970-01-01 00:00:00 +0000
+++ tests/gpg/start-stop-agent 2013-10-23 07:14:02 +0000
@@ -0,0 +1,45 @@
1#!/bin/sh
2# Copyright (C) 2013 g10 Code GmbH
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved. This file is
7# distributed in the hope that it will be useful, but WITHOUT ANY
8# WARRANTY, to the extent permitted by law; without even the implied
9# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
11if [ -z "$(command -v gpg-connect-agent)" ]; then
12 echo "gpg-agent not installed and thus not started" >&2
13 exit 0;
14fi
15
16GPG_AGENT_INFO=
17export GPG_AGENT_INFO
18
19token=$(echo "gpgme-$(pwd)" | tr ' ' '_')
20
21if [ "$1" = "--stop" ]; then
22 if [ "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
23 != "D set" ]; then
24 echo "gpg-agent not running" >&2
25 exit 0
26 fi
27 echo "stopping gpg-agent " >&2
28 gpg-connect-agent KILLAGENT /bye >/dev/null 2>&1
29 exit 0
30fi
31
32if [ "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
33 = "D set" ]; then
34 echo "gpg-agent already running" >&2
35 exit 0
36fi
37
38echo "starting gpg-agent " >&2
39gpg-connect-agent putval\ $token\ set /bye >/dev/null 2>&1
40if [ "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
41 != "D set" ]; then
42 echo "error starting gpg-agent" >&2
43 exit 1
44fi
45exit 0

Subscribers

People subscribed via source and target branches

to all changes: