From fc59d1efdca7b2886739948b88a1aa8cd4243146 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Wed, 1 Dec 2021 16:54:39 +0900 Subject: [PATCH] Imported Upstream version 1.15.1 --- AUTHORS | 2 +- ChangeLog | 101 +++++++ Makefile.am | 32 +- Makefile.in | 33 +- NEWS | 19 ++ README | 2 +- VERSION | 2 +- conf/config.h.in | 2 +- configure | 87 ++++-- configure.ac | 38 +-- gpgme.spec | 2 +- lang/cl/gpgme.asd | 2 +- lang/cpp/src/key.cpp | 6 + lang/cpp/src/key.h | 4 +- lang/python/src/core.py | 6 +- lang/qt/src/debug.cpp | 1 + lang/qt/src/encryptjob.h | 2 +- lang/qt/src/qgpgmesignkeyjob.cpp | 2 +- lang/qt/src/signjob.h | 2 +- m4/gpg-error.m4 | 6 +- m4/libassuan.m4 | 3 +- m4/libtool.m4 | 46 ++- src/engine-gpg.c | 6 + src/export.c | 4 + src/gpgme.m4 | 4 +- src/versioninfo.rc.in | 2 +- tests/gpg/Makefile.am | 2 +- tests/gpg/Makefile.in | 29 +- tests/gpg/t-keylist-secret-sig.c | 628 +++++++++++++++++++++++++++++++++++++++ 29 files changed, 977 insertions(+), 98 deletions(-) create mode 100644 tests/gpg/t-keylist-secret-sig.c diff --git a/AUTHORS b/AUTHORS index d680e48..59831ac 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,7 +19,7 @@ List of Copyright holders Copyright (C) 1991-2013 Free Software Foundation, Inc. Copyright (C) 2000-2001 Werner Koch - Copyright (C) 2001-2018 g10 Code GmbH + Copyright (C) 2001-2021 g10 Code GmbH Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2004-2008 Igor Belyi Copyright (C) 2002 John Goerzen diff --git a/ChangeLog b/ChangeLog index c41eb60..bd305c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,106 @@ +2021-01-08 Werner Koch + + Release 1.15.1. + + commit bb9880778fb16cdb6de83905e45bf6c965770013 + + + Make distcheck make target a bit more reliable. + + commit 133050b3fa28122a4b60dbbde698fb14379ccf95 + * Makefile.am (release): Do not pass --parallel + +2021-01-05 Ingo Klöcker + + core: Make listing of signatures work if only secret keys are listed. + + commit 5137d7fc214d0d9dcb947ccdc32fa87979f9a6d0 + * src/engine-gpg.c (gpg_keylist_build_options): Add "--with-sig-check" + argument if signatures shall be listed. + * tests/gpg/t-keylist-secret-sig.c: New. + * tests/gpg/Makefile.am (c_tests): Add new test. + +2021-01-04 Ingo Klöcker + + cpp: Add const-overload of UserID::Signature::operator< + + commit a6220adf3081c9c848f6d0a6fc3774cb168ccf9c + lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<): + Add const-overload. Deprecate non-const overload. + +2021-01-04 Andre Heinecke + + Qt: Undeprecate QByteArray based start functs. + + commit 543e2106386f00ebecf7653e7896fa12a6e828ff + * lang/qt/src/encryptjob.h, lang/qt/src/signjob.h (start): + Undeprecate QByteArray based functions. + +2020-12-03 NIIBE Yutaka + + python: Fix key_export*. + + commit 7a4fe82a017b751ad756c93d2b9e31d7be045275 + * lang/python/src/core.py (key_export): Just raise an error. + (key_export_minimal, key_export_secret): Ditto. + +2020-11-24 NIIBE Yutaka + + core: Call _gpgme_passphrase_status_handler when exporting keys. + + commit 53ac732bae46e1f883998e987fc84d4cababde12 + * src/export.c (export_status_handler): Call the handler. + +2020-11-20 Andre Heinecke + + Revert "cpp: Use portable off_t size_t" + + commit a5c4b030258714dd72a2e276114183309cad3ec3 + This reverts commit 88294023c196497cfa6737be262c8b0c09d2a3ce. + +2020-11-20 NIIBE Yutaka + + m4: Update with newer autoconf constructs. + + commit 4c6fd361593e22092770d120d68a18b4f70e0bb8 + * src/gpgme.m4: Replace AC_HELP_STRING to AS_HELP_STRING. + +2020-11-18 Andre Heinecke + + cpp: Use portable off_t size_t. + + commit 88294023c196497cfa6737be262c8b0c09d2a3ce + * configure.ac: Configure cpp data.h.in + * lang/cpp/src/Makefile.am: Generate data.h + * lang/cpp/src/data.cpp, lang/cpp/src/data.h: Use portable + types. + * lang/qt/src/Makefile.am: Include build dir. + * lang/qt/tests/makefile.am: Include build dir. + +2020-11-18 Ingo Klöcker + Daniel Kahn Gillmor + + qt: Avoid empty "rem@gnupg.org" signature notations. + + commit 3c185c2159cdcc23f44773fe1cfb624b27598c80 + * lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Check remark for being + an empty string instead of a null QString. + +2020-11-18 NIIBE Yutaka + + build: Update with newer autoconf constructs. + + commit 223779dfdeb7808809372587fa135a8cc2616ce8 + * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE. + Use AS_HELP_STRING instead of AC_HELP_STRING. + * m4/libtool.m4: Update from libgpg-error. + * m4/gpg-error.m4: Update from libgpg-error. + * m4/libassuan.m4: Update from libassuan. + +2020-11-12 Andre Heinecke + + qt: Fix export of qDebug GpgME::Error overload. + + commit df5a89e6929479dc1bf301974fe7d607d024bc1f + * lang/qt/src/debug.cpp: Include debug.h to get the export decl. + 2020-11-12 Werner Koch + build: Use ~/.gnupg-autogen.sh for the release targets. + + commit 27abdac25dcd4ba57e073a5de2f057830e623282 + * Makefile.am (sign-release): Use global config vars. + + Post release updates. + + commit 01a0d8ec1aa8543dca0986c6dcb5cabc535aae2c + + Release 1.15.0. + commit feea38c89d4ceb40334f884da9ab07cc4b73e757 * configure.ac: Bump LT versions to c=C35/A24/R0, cpp=C18/A13/R0, diff --git a/Makefile.am b/Makefile.am index 1772d69..7dcf2f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,14 +20,14 @@ ## Process this file with automake to produce Makefile.in -# Location of the released tarball archives. Note that this is an -# internal archive and before uploading this to the public server, -# manual tests should be run and the git release tat set and pushed. -# Adjust as needed. -RELEASE_ARCHIVE_DIR = wk@vigenere:tarballs/gpgme/ +# Location of the released tarball archives. This is prefixed by +# the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example: +# RELEASE_ARCHIVE=user@host:archive/tarballs +RELEASE_ARCHIVE_SUFFIX = gpgme +# The variable RELEASE_SIGNKEY in ~/.gnupg-autogen.rc is used +# to specify the key for signing. For example: +# RELEASE_SIGNKEY=D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 -# The key used to sign the released sources. Adjust as needed. -RELEASE_SIGNING_KEY = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 # Autoconf flags ACLOCAL_AMFLAGS = -I m4 @@ -97,7 +97,7 @@ release: cd $(abs_top_builddir); \ rm -rf dist; mkdir dist ; cd dist ; \ $(abs_top_srcdir)/configure --enable-maintainer-mode; \ - $(MAKE) distcheck TESTFLAGS=--parallel; \ + $(MAKE) distcheck; \ echo "/* Build finished at $$(date -uIseconds) */" ;\ echo "/*" ;\ echo " * Please run the final step interactively:" ;\ @@ -108,19 +108,31 @@ release: sign-release: +(set -e; \ cd dist; \ + x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\ + x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + mysignkey="$$x";\ files1="$(RELEASE_NAME).tar.bz2" ;\ files2="$(RELEASE_NAME).tar.bz2.sig \ $(RELEASE_NAME).swdb \ $(RELEASE_NAME).buildlog" ;\ echo "/* Signing the source tarball ..." ;\ - gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\ + gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\ cat $(RELEASE_NAME).swdb >swdb.snippet;\ echo >>swdb.snippet ;\ sha1sum $${files1} >>swdb.snippet ;\ cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ | gzip >$(RELEASE_NAME).buildlog ;\ echo "Copying to local archive ..." ;\ - scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\ + scp -p $${files1} $${files2} $$myarchive/ || true;\ echo "Uploading documentation ..." ;\ $(MAKE) -C doc online; \ echo '/*' ;\ diff --git a/Makefile.in b/Makefile.in index cd83421..a89eca4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -441,14 +441,13 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -# Location of the released tarball archives. Note that this is an -# internal archive and before uploading this to the public server, -# manual tests should be run and the git release tat set and pushed. -# Adjust as needed. -RELEASE_ARCHIVE_DIR = wk@vigenere:tarballs/gpgme/ - -# The key used to sign the released sources. Adjust as needed. -RELEASE_SIGNING_KEY = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 +# Location of the released tarball archives. This is prefixed by +# the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example: +# RELEASE_ARCHIVE=user@host:archive/tarballs +RELEASE_ARCHIVE_SUFFIX = gpgme +# The variable RELEASE_SIGNKEY in ~/.gnupg-autogen.rc is used +# to specify the key for signing. For example: +# RELEASE_SIGNKEY=D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 # Autoconf flags ACLOCAL_AMFLAGS = -I m4 @@ -996,7 +995,7 @@ release: cd $(abs_top_builddir); \ rm -rf dist; mkdir dist ; cd dist ; \ $(abs_top_srcdir)/configure --enable-maintainer-mode; \ - $(MAKE) distcheck TESTFLAGS=--parallel; \ + $(MAKE) distcheck; \ echo "/* Build finished at $$(date -uIseconds) */" ;\ echo "/*" ;\ echo " * Please run the final step interactively:" ;\ @@ -1007,19 +1006,31 @@ release: sign-release: +(set -e; \ cd dist; \ + x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\ + x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + mysignkey="$$x";\ files1="$(RELEASE_NAME).tar.bz2" ;\ files2="$(RELEASE_NAME).tar.bz2.sig \ $(RELEASE_NAME).swdb \ $(RELEASE_NAME).buildlog" ;\ echo "/* Signing the source tarball ..." ;\ - gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\ + gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\ cat $(RELEASE_NAME).swdb >swdb.snippet;\ echo >>swdb.snippet ;\ sha1sum $${files1} >>swdb.snippet ;\ cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ | gzip >$(RELEASE_NAME).buildlog ;\ echo "Copying to local archive ..." ;\ - scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\ + scp -p $${files1} $${files2} $$myarchive/ || true;\ echo "Uploading documentation ..." ;\ $(MAKE) -C doc online; \ echo '/*' ;\ diff --git a/NEWS b/NEWS index 31dbee7..f6c2b0d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +Noteworthy changes in version 1.15.1 (2021-01-08) +------------------------------------------------- + + * Fix another bug in the secret key export. [#5046] + + * Make listing of signatures work if only secret keys are listed. [#3580] + + * Fix build problem on FreeBSD. [a6220adf30] + + * qt: Avoid empty "rem@gnupg.org" signature notations. [#5142] + + * python: Fix key_export functions. [#5149] + + + [c=C35/A24/R1 cpp=C18/A12/R1 qt=C12/A5/R1] + + Release-info: https://dev.gnupg.org/T5225 + + Noteworthy changes in version 1.15.0 (2020-11-12) ------------------------------------------------- diff --git a/README b/README index d39e891..e87817d 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ GPGME - GnuPG Made Easy --------------------------- -Copyright 2001-2020 g10 Code GmbH +Copyright 2001-2021 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff --git a/VERSION b/VERSION index 141f2e8..ace4423 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.0 +1.15.1 diff --git a/conf/config.h.in b/conf/config.h.in index ab5f25b..b89676c 100644 --- a/conf/config.h.in +++ b/conf/config.h.in @@ -278,5 +278,5 @@ #define GPG_ERR_ENABLE_ERRNO_MACROS 1 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \ - "Copyright (C) 2001--2020 g10 Code GmbH\n" + "Copyright (C) 2001--2021 g10 Code GmbH\n" diff --git a/configure b/configure index eb75c05..2c2601b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gpgme 1.15.0. +# Generated by GNU Autoconf 2.69 for gpgme 1.15.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gpgme' PACKAGE_TARNAME='gpgme' -PACKAGE_VERSION='1.15.0' -PACKAGE_STRING='gpgme 1.15.0' +PACKAGE_VERSION='1.15.1' +PACKAGE_STRING='gpgme 1.15.1' PACKAGE_BUGREPORT='https://bugs.gnupg.org' PACKAGE_URL='' @@ -1469,7 +1469,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gpgme 1.15.0 to adapt to many kinds of systems. +\`configure' configures gpgme 1.15.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1540,7 +1540,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gpgme 1.15.0:";; + short | recursive ) echo "Configuration of gpgme 1.15.1:";; esac cat <<\_ACEOF @@ -1690,7 +1690,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gpgme configure 1.15.0 +gpgme configure 1.15.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2520,7 +2520,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gpgme $as_me 1.15.0, which was +It was created by gpgme $as_me 1.15.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2886,18 +2886,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # LIBGPGME_LT_CURRENT=35 LIBGPGME_LT_AGE=24 -LIBGPGME_LT_REVISION=0 +LIBGPGME_LT_REVISION=1 # If there is an ABI break in gpgmepp or qgpgme also bump the # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in LIBGPGMEPP_LT_CURRENT=18 LIBGPGMEPP_LT_AGE=12 -LIBGPGMEPP_LT_REVISION=0 +LIBGPGMEPP_LT_REVISION=1 LIBQGPGME_LT_CURRENT=12 LIBQGPGME_LT_AGE=5 -LIBQGPGME_LT_REVISION=0 +LIBQGPGME_LT_REVISION=1 ################################################ @@ -2923,7 +2923,7 @@ NEED_LIBASSUAN_VERSION=2.4.2 VERSION_MAJOR=1 VERSION_MINOR=15 -VERSION_MICRO=0 +VERSION_MICRO=1 ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do @@ -3444,7 +3444,7 @@ fi # Define the identity of the package. PACKAGE='gpgme' - VERSION='1.15.0' + VERSION='1.15.1' cat >>confdefs.h <<_ACEOF @@ -5172,7 +5172,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE case $host in *-*-linux*) @@ -6505,7 +6504,7 @@ test -n "$GITLOG_TO_CHANGELOG" || GITLOG_TO_CHANGELOG="gitlog-to-changelog" -VERSION_NUMBER=0x010f00 +VERSION_NUMBER=0x010f01 # We need to compile and run a program on the build machine. A @@ -8748,7 +8747,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -8767,7 +8769,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -12912,6 +12917,26 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor @@ -16758,6 +16783,26 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor @@ -24526,7 +24571,7 @@ ENABLED_LANGUAGES=$enabled_languages # # Provide information about the build. # -BUILD_REVISION="feea38c8" +BUILD_REVISION="bb988077" cat >>confdefs.h <<_ACEOF @@ -24535,7 +24580,7 @@ _ACEOF BUILD_VERSION=`echo "$PACKAGE_VERSION" | sed 's/\([0-9.]*\).*/\1./'` -BUILD_VERSION="${BUILD_VERSION}65258" +BUILD_VERSION="${BUILD_VERSION}48024" BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,` @@ -26910,7 +26955,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gpgme $as_me 1.15.0, which was +This file was extended by gpgme $as_me 1.15.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26976,7 +27021,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gpgme config.status 1.15.0 +gpgme config.status 1.15.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -29300,7 +29345,7 @@ fi echo " GPGME v${VERSION} has been configured as follows: - Revision: feea38c8 (65258) + Revision: bb988077 (48024) Platform: $host UI Server: $uiserver diff --git a/configure.ac b/configure.ac index 437ab15..628e5ff 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # configure.ac for GPGME # Copyright (C) 2000 Werner Koch (dd9jn) -# Copyright (C) 2001-2018 g10 Code GmbH +# Copyright (C) 2001-2021 g10 Code GmbH # # This file is part of GPGME. # @@ -19,7 +19,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later # (Process this file with autoconf to produce a configure script.) -AC_PREREQ(2.59) +AC_PREREQ([2.59]) min_automake_version="1.14" # To build a release you need to create a tag with the version number @@ -32,7 +32,7 @@ min_automake_version="1.14" m4_define([mym4_package],[gpgme]) m4_define([mym4_major], [1]) m4_define([mym4_minor], [15]) -m4_define([mym4_micro], [0]) +m4_define([mym4_micro], [1]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a @@ -45,7 +45,7 @@ m4_define([mym4_version], m4_argn(4, mym4_verslist)) m4_define([mym4_revision], m4_argn(7, mym4_verslist)) m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist)) m4_esyscmd([echo ]mym4_version[>VERSION]) -AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) +AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org]) # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) @@ -55,18 +55,18 @@ AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) # LIBGPGME_LT_CURRENT=35 LIBGPGME_LT_AGE=24 -LIBGPGME_LT_REVISION=0 +LIBGPGME_LT_REVISION=1 # If there is an ABI break in gpgmepp or qgpgme also bump the # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in LIBGPGMEPP_LT_CURRENT=18 LIBGPGMEPP_LT_AGE=12 -LIBGPGMEPP_LT_REVISION=0 +LIBGPGMEPP_LT_REVISION=1 LIBQGPGME_LT_CURRENT=12 LIBQGPGME_LT_AGE=5 -LIBQGPGME_LT_REVISION=0 +LIBQGPGME_LT_REVISION=1 ################################################ AC_SUBST(LIBGPGME_LT_CURRENT) @@ -105,7 +105,7 @@ AM_SILENT_RULES AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory]) # Enable GNU extensions on systems that have them. -AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH @@ -243,7 +243,7 @@ case "${host}" in AM_PATH_GLIB_2_0 AC_ARG_ENABLE(w32-glib, - AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]), + AS_HELP_STRING([--enable-w32-glib],[build GPGME Glib for W32]), build_w32_glib=$enableval) ;; *) @@ -291,7 +291,7 @@ AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes) AC_ARG_ENABLE([fixed-path], - AC_HELP_STRING([--enable-fixed-path=PATH], + AS_HELP_STRING([--enable-fixed-path=PATH], [locate binaries only via this PATH]), [fixed_search_path="$enableval"], [fixed_search_path=""]) @@ -304,7 +304,7 @@ fi # Note: You need to declare all possible languages also in # lang/Makefile.am's DIST_SUBDIRS. AC_ARG_ENABLE([languages], - AC_HELP_STRING([--enable-languages=languages], + AS_HELP_STRING([--enable-languages=languages], [enable only specific language bindings]), [enabled_languages=`echo $enableval | \ tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \ @@ -494,7 +494,7 @@ AC_SUBST(BUILD_VERSION) AC_SUBST(BUILD_FILEVERSION) AC_ARG_ENABLE([build-timestamp], - AC_HELP_STRING([--enable-build-timestamp], + AS_HELP_STRING([--enable-build-timestamp], [set an explicit build timestamp for reproducibility. (default is the current time in ISO-8601 format)]), [if test "$enableval" = "yes"; then @@ -513,25 +513,25 @@ AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP", # run_gpgconf_test="yes" AC_ARG_ENABLE(gpgconf-test, - AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF regression test]), + AS_HELP_STRING([--disable-gpgconf-test],[disable GPGCONF regression test]), run_gpgconf_test=$enableval) AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes") run_gpg_test="yes" AC_ARG_ENABLE(gpg-test, - AC_HELP_STRING([--disable-gpg-test], [disable GPG regression test]), + AS_HELP_STRING([--disable-gpg-test],[disable GPG regression test]), run_gpg_test=$enableval) AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes") run_gpgsm_test="yes" AC_ARG_ENABLE(gpgsm-test, - AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM regression test]), + AS_HELP_STRING([--disable-gpgsm-test],[disable GPGSM regression test]), run_gpgsm_test=$enableval) AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes") run_g13_test="yes" AC_ARG_ENABLE(g13-test, - AC_HELP_STRING([--disable-g13-test], [disable G13 regression test]), + AS_HELP_STRING([--disable-g13-test],[disable G13 regression test]), run_g13_test=$enableval) AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes") @@ -750,7 +750,7 @@ AC_CHECK_MEMBER(struct cmsghdr.cmsg_len, use_descriptor_passing=yes AC_ARG_ENABLE(fd-passing, - AC_HELP_STRING([--disable-fd-passing], [do not use FD passing]), + AS_HELP_STRING([--disable-fd-passing],[do not use FD passing]), use_descriptor_passing=$enableval) if test "$supports_descriptor_passing" != "yes"; then @@ -782,7 +782,7 @@ AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no") # before an exec. This option allows to switch this optimization off. use_linux_getdents=yes AC_ARG_ENABLE(linux-getdents, - AC_HELP_STRING([--disable-linux-getdents], + AS_HELP_STRING([--disable-linux-getdents], [do not use SYS_getdents on Linux]), use_linux_getdents=$enableval) if test "$use_linux_getdents" = "yes"; then @@ -824,7 +824,7 @@ AH_BOTTOM([ #define GPG_ERR_ENABLE_ERRNO_MACROS 1 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \ - "Copyright (C) 2001--2020 g10 Code GmbH\n" + "Copyright (C) 2001--2021 g10 Code GmbH\n" ]) diff --git a/gpgme.spec b/gpgme.spec index 5aa94c2..7912581 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,7 +1,7 @@ # This is a template. The dist target uses it to create the real file. Summary: GPGME - GnuPG Made Easy Name: gpgme -Version: 1.15.0 +Version: 1.15.1 Release: 1 URL: https://gnupg.org/gpgme.html Source: https://www.gnupg.org/ftp/gcrypt/gpgme/%{name}-%{version}.tar.gz diff --git a/lang/cl/gpgme.asd b/lang/cl/gpgme.asd index 494852c..c22940a 100644 --- a/lang/cl/gpgme.asd +++ b/lang/cl/gpgme.asd @@ -27,7 +27,7 @@ (defsystem gpgme :description "GnuPG Made Easy." :author "g10 Code GmbH" - :version "1.15.0" + :version "1.15.1" :licence "GPL" :defsystem-depends-on ("cffi-grovel") :depends-on ("cffi" "gpg-error" "trivial-garbage") diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index e536d08..f9cc2b6 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -867,6 +867,12 @@ UserID::Signature::Signature(const shared_gpgme_key_t &k, gpgme_user_id_t u, gpg bool UserID::Signature::operator<(const Signature &other) { + // kept for binary compatibility + return static_cast(this)->operator<(other); +} + +bool UserID::Signature::operator<(const Signature &other) const +{ // based on cmp_signodes() in g10/keylist.c // both signatures must belong to the same user ID diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index a793167..515bf18 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -468,7 +468,9 @@ public: } /*! Defines a canonical sort order for signatures of the same user ID. */ - bool operator<(const Signature &other); + bool operator<(const Signature &other) const; + + GPGMEPP_DEPRECATED bool operator<(const Signature &other); bool isNull() const { diff --git a/lang/python/src/core.py b/lang/python/src/core.py index 646bbc6..5e57e4a 100644 --- a/lang/python/src/core.py +++ b/lang/python/src/core.py @@ -637,7 +637,7 @@ class Context(GpgmeWrapper): data.seek(0, os.SEEK_SET) pk_result = data.read() except GPGMEError as e: - pk_result = e + raise e if len(pk_result) > 0: result = pk_result @@ -672,7 +672,7 @@ class Context(GpgmeWrapper): data.seek(0, os.SEEK_SET) pk_result = data.read() except GPGMEError as e: - pk_result = e + raise e if len(pk_result) > 0: result = pk_result @@ -713,7 +713,7 @@ class Context(GpgmeWrapper): data.seek(0, os.SEEK_SET) sk_result = data.read() except GPGMEError as e: - sk_result = e + raise e if len(sk_result) > 0: result = sk_result diff --git a/lang/qt/src/debug.cpp b/lang/qt/src/debug.cpp index e4974ad..b563ac0 100644 --- a/lang/qt/src/debug.cpp +++ b/lang/qt/src/debug.cpp @@ -36,6 +36,7 @@ #endif #include "error.h" +#include "debug.h" #include diff --git a/lang/qt/src/encryptjob.h b/lang/qt/src/encryptjob.h index 161a769..937ee8d 100644 --- a/lang/qt/src/encryptjob.h +++ b/lang/qt/src/encryptjob.h @@ -90,7 +90,7 @@ public: not be performed, but full validity assumed for all keys without further checks. */ - virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const std::vector &recipients, + virtual GpgME::Error start(const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust = false) = 0; /*! diff --git a/lang/qt/src/qgpgmesignkeyjob.cpp b/lang/qt/src/qgpgmesignkeyjob.cpp index 1d36d95..ee0c537 100644 --- a/lang/qt/src/qgpgmesignkeyjob.cpp +++ b/lang/qt/src/qgpgmesignkeyjob.cpp @@ -83,7 +83,7 @@ static QGpgMESignKeyJob::result_type sign_key(Context *ctx, const Key &key, cons skei->setDupeOk(true); } - if (!remark.isNull()) { + if (!remark.isEmpty()) { ctx->addSignatureNotation("rem@gnupg.org", remark.toUtf8().constData()); } diff --git a/lang/qt/src/signjob.h b/lang/qt/src/signjob.h index b5b5af6..57d2d17 100644 --- a/lang/qt/src/signjob.h +++ b/lang/qt/src/signjob.h @@ -85,7 +85,7 @@ public: Starts the signing operation. \a signers is the list of keys to sign \a plainText with. Empty (null) keys are ignored. */ - virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const std::vector &signers, + virtual GpgME::Error start(const std::vector &signers, const QByteArray &plainText, GpgME::SignatureMode mode) = 0; diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index a9d572f..c9b235f 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -1,5 +1,5 @@ # gpg-error.m4 - autoconf macro to detect libgpg-error. -# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-11-02 +# Last-changed: 2020-11-17 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -31,7 +31,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], dnl since that is consistent with how our three siblings use the directory/ dnl package name in --with-$dir_name-prefix=PFX. AC_ARG_WITH(libgpg-error-prefix, - AC_HELP_STRING([--with-libgpg-error-prefix=PFX], + AS_HELP_STRING([--with-libgpg-error-prefix=PFX], [prefix where GPG Error is installed (optional)]), [gpg_error_config_prefix="$withval"]) diff --git a/m4/libassuan.m4 b/m4/libassuan.m4 index 4af2d04..df50484 100644 --- a/m4/libassuan.m4 +++ b/m4/libassuan.m4 @@ -9,6 +9,7 @@ dnl This file is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl SPDX-License-Identifier: FSFULLR +# Last-changed: 2020-11-17 dnl dnl Common code used for libassuan detection [internal] @@ -17,7 +18,7 @@ dnl AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_WITH(libassuan-prefix, - AC_HELP_STRING([--with-libassuan-prefix=PFX], + AS_HELP_STRING([--with-libassuan-prefix=PFX], [prefix where LIBASSUAN is installed (optional)]), libassuan_config_prefix="$withval", libassuan_config_prefix="") if test x$libassuan_config_prefix != x ; then diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 0d340c7..8795701 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1326,7 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1345,7 +1348,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -2638,6 +2644,26 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor @@ -7448,7 +7474,7 @@ AC_LANG_POP # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE +AC_LANG_PUSH([Java]) # Source file extension for Java test sources. ac_ext=java @@ -7504,7 +7530,7 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi -AC_LANG_RESTORE +AC_LANG_POP GCC=$lt_save_GCC CC=$lt_save_CC @@ -7519,7 +7545,7 @@ CFLAGS=$lt_save_CFLAGS # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE +AC_LANG_PUSH([Go]) # Source file extension for Go test sources. ac_ext=go @@ -7575,7 +7601,7 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi -AC_LANG_RESTORE +AC_LANG_POP GCC=$lt_save_GCC CC=$lt_save_CC @@ -7590,7 +7616,9 @@ CFLAGS=$lt_save_CFLAGS # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE + +dnl Here, something like AC_LANG_PUSH([RC]) is expected. +dnl But Resource Compiler is not supported as a language by autoconf # Source file extension for RC test sources. ac_ext=rc @@ -7629,8 +7657,10 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi +dnl Here, AC_LANG_POP is expected. GCC=$lt_save_GCC -AC_LANG_RESTORE +dnl Back to C +AC_LANG([C]) CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 02a10ec..9a9a26e 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -3017,6 +3017,12 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only, err = add_arg (gpg, "--with-keygrip"); } + if (!err && (mode & GPGME_KEYLIST_MODE_SIGS) + && have_gpg_version (gpg, "2.0.10")) + { + err = add_arg (gpg, "--with-sig-check"); + } + if (!err && (mode & GPGME_KEYLIST_MODE_SIGS) && (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS)) diff --git a/src/export.c b/src/export.c index f827efa..879a54f 100644 --- a/src/export.c +++ b/src/export.c @@ -88,6 +88,10 @@ export_status_handler (void *priv, gpgme_status_code_t code, char *args) op_data_t opd; const char *loc; + err = _gpgme_passphrase_status_handler (priv, code, args); + if (err) + return err; + err = _gpgme_op_data_lookup (ctx, OPDATA_EXPORT, &hook, -1, NULL); opd = hook; if (err) diff --git a/src/gpgme.m4 b/src/gpgme.m4 index 2a72f18..c749a5d 100644 --- a/src/gpgme.m4 +++ b/src/gpgme.m4 @@ -9,12 +9,12 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-11-12 +# Last-changed: 2020-11-20 AC_DEFUN([_AM_PATH_GPGME_CONFIG], [ AC_ARG_WITH(gpgme-prefix, - AC_HELP_STRING([--with-gpgme-prefix=PFX], + AS_HELP_STRING([--with-gpgme-prefix=PFX], [prefix where GPGME is installed (optional)]), gpgme_config_prefix="$withval", gpgme_config_prefix="") if test x"${GPGME_CONFIG}" = x ; then diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in index 598d5c2..7800368 100644 --- a/src/versioninfo.rc.in +++ b/src/versioninfo.rc.in @@ -39,7 +39,7 @@ BEGIN VALUE "FileDescription", "GPGME - GnuPG Made Easy\0" VALUE "FileVersion", "@LIBGPGME_LT_CURRENT@.@LIBGPGME_LT_AGE@.@LIBGPGME_LT_REVISION@.@BUILD_REVISION@\0" VALUE "InternalName", "gpgme\0" - VALUE "LegalCopyright", "Copyright © 2001-2020 g10 Code GmbH\0" + VALUE "LegalCopyright", "Copyright © 2001-2021 g10 Code GmbH\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "gpgme.dll\0" VALUE "PrivateBuild", "\0" diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index f79465a..594a642 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -38,7 +38,7 @@ endif c_tests = \ t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \ t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \ - t-import t-edit t-keylist t-keylist-sig t-wait \ + t-import t-edit t-keylist t-keylist-sig t-keylist-secret-sig t-wait \ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed \ $(tests_unix) diff --git a/tests/gpg/Makefile.in b/tests/gpg/Makefile.in index bf8ad3a..edb021e 100644 --- a/tests/gpg/Makefile.in +++ b/tests/gpg/Makefile.in @@ -141,7 +141,8 @@ am__EXEEXT_2 = t-encrypt$(EXEEXT) t-encrypt-sym$(EXEEXT) \ t-decrypt$(EXEEXT) t-verify$(EXEEXT) t-decrypt-verify$(EXEEXT) \ t-sig-notation$(EXEEXT) t-export$(EXEEXT) t-import$(EXEEXT) \ t-edit$(EXEEXT) t-keylist$(EXEEXT) t-keylist-sig$(EXEEXT) \ - t-wait$(EXEEXT) t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \ + t-keylist-secret-sig$(EXEEXT) t-wait$(EXEEXT) \ + t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \ t-gpgconf$(EXEEXT) t-encrypt-mixed$(EXEEXT) $(am__EXEEXT_1) @HAVE_W32_SYSTEM_FALSE@am__EXEEXT_3 = t-cancel$(EXEEXT) am__EXEEXT_4 = t-genkey$(EXEEXT) $(am__EXEEXT_3) @@ -213,6 +214,10 @@ t_keylist_SOURCES = t-keylist.c t_keylist_OBJECTS = t-keylist.$(OBJEXT) t_keylist_LDADD = $(LDADD) t_keylist_DEPENDENCIES = ../../src/libgpgme.la +t_keylist_secret_sig_SOURCES = t-keylist-secret-sig.c +t_keylist_secret_sig_OBJECTS = t-keylist-secret-sig.$(OBJEXT) +t_keylist_secret_sig_LDADD = $(LDADD) +t_keylist_secret_sig_DEPENDENCIES = ../../src/libgpgme.la t_keylist_sig_SOURCES = t-keylist-sig.c t_keylist_sig_OBJECTS = t-keylist-sig.$(OBJEXT) t_keylist_sig_LDADD = $(LDADD) @@ -269,6 +274,7 @@ am__depfiles_remade = ./$(DEPDIR)/t-cancel.Po \ ./$(DEPDIR)/t-eventloop.Po ./$(DEPDIR)/t-export.Po \ ./$(DEPDIR)/t-file-name.Po ./$(DEPDIR)/t-genkey.Po \ ./$(DEPDIR)/t-gpgconf.Po ./$(DEPDIR)/t-import.Po \ + ./$(DEPDIR)/t-keylist-secret-sig.Po \ ./$(DEPDIR)/t-keylist-sig.Po ./$(DEPDIR)/t-keylist.Po \ ./$(DEPDIR)/t-sig-notation.Po ./$(DEPDIR)/t-sign.Po \ ./$(DEPDIR)/t-signers.Po \ @@ -298,16 +304,16 @@ SOURCES = t-cancel.c t-decrypt.c t-decrypt-verify.c t-edit.c \ t-encrypt.c t-encrypt-large.c t-encrypt-mixed.c \ t-encrypt-sign.c t-encrypt-sym.c t-eventloop.c t-export.c \ t-file-name.c t-genkey.c t-gpgconf.c t-import.c t-keylist.c \ - t-keylist-sig.c t-sig-notation.c t-sign.c t-signers.c \ - t-thread-keylist.c t-thread-keylist-verify.c t-thread1.c \ - t-verify.c t-wait.c + t-keylist-secret-sig.c t-keylist-sig.c t-sig-notation.c \ + t-sign.c t-signers.c t-thread-keylist.c \ + t-thread-keylist-verify.c t-thread1.c t-verify.c t-wait.c DIST_SOURCES = t-cancel.c t-decrypt.c t-decrypt-verify.c t-edit.c \ t-encrypt.c t-encrypt-large.c t-encrypt-mixed.c \ t-encrypt-sign.c t-encrypt-sym.c t-eventloop.c t-export.c \ t-file-name.c t-genkey.c t-gpgconf.c t-import.c t-keylist.c \ - t-keylist-sig.c t-sig-notation.c t-sign.c t-signers.c \ - t-thread-keylist.c t-thread-keylist-verify.c t-thread1.c \ - t-verify.c t-wait.c + t-keylist-secret-sig.c t-keylist-sig.c t-sig-notation.c \ + t-sign.c t-signers.c t-thread-keylist.c \ + t-thread-keylist-verify.c t-thread1.c t-verify.c t-wait.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -571,7 +577,7 @@ noinst_HEADERS = t-support.h c_tests = \ t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \ t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \ - t-import t-edit t-keylist t-keylist-sig t-wait \ + t-import t-edit t-keylist t-keylist-sig t-keylist-secret-sig t-wait \ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed \ $(tests_unix) @@ -714,6 +720,10 @@ t-keylist$(EXEEXT): $(t_keylist_OBJECTS) $(t_keylist_DEPENDENCIES) $(EXTRA_t_key @rm -f t-keylist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_keylist_OBJECTS) $(t_keylist_LDADD) $(LIBS) +t-keylist-secret-sig$(EXEEXT): $(t_keylist_secret_sig_OBJECTS) $(t_keylist_secret_sig_DEPENDENCIES) $(EXTRA_t_keylist_secret_sig_DEPENDENCIES) + @rm -f t-keylist-secret-sig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_keylist_secret_sig_OBJECTS) $(t_keylist_secret_sig_LDADD) $(LIBS) + t-keylist-sig$(EXEEXT): $(t_keylist_sig_OBJECTS) $(t_keylist_sig_DEPENDENCIES) $(EXTRA_t_keylist_sig_DEPENDENCIES) @rm -f t-keylist-sig$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_keylist_sig_OBJECTS) $(t_keylist_sig_LDADD) $(LIBS) @@ -771,6 +781,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-genkey.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-gpgconf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-import.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-keylist-secret-sig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-keylist-sig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-keylist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-sig-notation.Po@am__quote@ # am--include-marker @@ -1053,6 +1064,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/t-genkey.Po -rm -f ./$(DEPDIR)/t-gpgconf.Po -rm -f ./$(DEPDIR)/t-import.Po + -rm -f ./$(DEPDIR)/t-keylist-secret-sig.Po -rm -f ./$(DEPDIR)/t-keylist-sig.Po -rm -f ./$(DEPDIR)/t-keylist.Po -rm -f ./$(DEPDIR)/t-sig-notation.Po @@ -1123,6 +1135,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/t-genkey.Po -rm -f ./$(DEPDIR)/t-gpgconf.Po -rm -f ./$(DEPDIR)/t-import.Po + -rm -f ./$(DEPDIR)/t-keylist-secret-sig.Po -rm -f ./$(DEPDIR)/t-keylist-sig.Po -rm -f ./$(DEPDIR)/t-keylist.Po -rm -f ./$(DEPDIR)/t-sig-notation.Po diff --git a/tests/gpg/t-keylist-secret-sig.c b/tests/gpg/t-keylist-secret-sig.c new file mode 100644 index 0000000..c0ef5c0 --- /dev/null +++ b/tests/gpg/t-keylist-secret-sig.c @@ -0,0 +1,628 @@ +/* t-keylist-secret-sig.c - Regression test. + * Copyright (C) 2000 Werner Koch (dd9jn) + * Copyright (C) 2001, 2003, 2004 g10 Code GmbH + * + * This file is part of GPGME. + * + * GPGME is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * GPGME is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#include "t-support.h" + + +struct +{ + const char *fpr; + const char *sec_keyid; + struct + { + const char *name; + const char *comment; + const char *email; + struct + { + gpgme_pubkey_algo_t algo; + const char *keyid; + const char *name; + const char *comment; + const char *email; + unsigned int sig_class; + int exportable; + } sig; + } uid[3]; +} +keys[] = + { + { "A0FF4590BB6122EDEF6E3C542D727CC768697734", "6AE6D7EE46A871F8", + { { "Alfa Test", "demo key", "alfa@example.net", + { GPGME_PK_DSA, "2D727CC768697734", + "Alfa Test", "demo key", "alfa@example.net", 19, 1 } }, + { "Alpha Test", "demo key", "alpha@example.net", + { GPGME_PK_DSA, "2D727CC768697734", + "Alfa Test", "demo key", "alfa@example.net", 19, 1 } }, + { "Alice", "demo key", NULL, + { GPGME_PK_DSA, "2D727CC768697734", + "Alfa Test", "demo key", "alfa@example.net", 19, 1 } } } }, + { NULL } + }; + + +int +main (void) +{ + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_key_t key; + gpgme_keylist_result_t result; + int mode; + int i = 0; + + init_gpgme (GPGME_PROTOCOL_OpenPGP); + + err = gpgme_new (&ctx); + fail_if_err (err); + + mode = gpgme_get_keylist_mode (ctx); + mode |= GPGME_KEYLIST_MODE_SIGS; + err = gpgme_set_keylist_mode (ctx, mode); + fail_if_err (err); + + err = gpgme_op_keylist_start (ctx, "Alpha", 1); + fail_if_err (err); + + while (!(err = gpgme_op_keylist_next (ctx, &key))) + { + if (!keys[i].fpr) + { + fprintf (stderr, "More keys returned than expected\n"); + exit (1); + } + + /* Global key flags. */ + if (key->revoked) + { + fprintf (stderr, "Key unexpectedly revoked\n"); + exit (1); + } + if (key->expired) + { + fprintf (stderr, "Key unexpectedly expired\n"); + exit (1); + } + if (key->disabled) + { + fprintf (stderr, "Key unexpectedly disabled\n"); + exit (1); + } + if (key->invalid) + { + fprintf (stderr, "Key unexpectedly invalid\n"); + exit (1); + } + if (!key->can_encrypt) + { + fprintf (stderr, "Key unexpectedly unusable for encryption\n"); + exit (1); + } + if (!key->can_sign) + { + fprintf (stderr, "Key unexpectedly unusable for signing\n"); + exit (1); + } + if (!key->can_certify) + { + fprintf (stderr, "Key unexpectedly unusable for certifications\n"); + exit (1); + } + if (!key->secret) + { + fprintf (stderr, "Key unexpectedly not secret\n"); + exit (1); + } + if (key->protocol != GPGME_PROTOCOL_OpenPGP) + { + fprintf (stderr, "Key has unexpected protocol: %s\n", + gpgme_get_protocol_name (key->protocol)); + exit (1); + } + if (key->issuer_serial) + { + fprintf (stderr, "Key unexpectedly carries issuer serial: %s\n", + key->issuer_serial); + exit (1); + } + if (key->issuer_name) + { + fprintf (stderr, "Key unexpectedly carries issuer name: %s\n", + key->issuer_name); + exit (1); + } + if (key->chain_id) + { + fprintf (stderr, "Key unexpectedly carries chain ID: %s\n", + key->chain_id); + exit (1); + } + if (key->owner_trust != GPGME_VALIDITY_UNKNOWN) + { + fprintf (stderr, "Key has unexpected owner trust: %i\n", + key->owner_trust); + exit (1); + } + if (!key->subkeys || !key->subkeys->next || key->subkeys->next->next) + { + fprintf (stderr, "Key has unexpected number of subkeys\n"); + exit (1); + } + + /* Primary key. */ + if (key->subkeys->revoked) + { + fprintf (stderr, "Primary key unexpectedly revoked\n"); + exit (1); + } + if (key->subkeys->expired) + { + fprintf (stderr, "Primary key unexpectedly expired\n"); + exit (1); + } + if (key->subkeys->disabled) + { + fprintf (stderr, "Primary key unexpectedly disabled\n"); + exit (1); + } + if (key->subkeys->invalid) + { + fprintf (stderr, "Primary key unexpectedly invalid\n"); + exit (1); + } + if (key->subkeys->can_encrypt) + { + fprintf (stderr, "Primary key unexpectedly usable for encryption\n"); + exit (1); + } + if (!key->subkeys->can_sign) + { + fprintf (stderr, "Primary key unexpectedly unusable for signing\n"); + exit (1); + } + if (!key->subkeys->can_certify) + { + fprintf (stderr, "Primary key unexpectedly unusable for certifications\n"); + exit (1); + } + if (!key->subkeys->secret) + { + fprintf (stderr, "Primary key unexpectedly not secret\n"); + exit (1); + } + if (key->subkeys->pubkey_algo != GPGME_PK_DSA) + { + fprintf (stderr, "Primary key has unexpected public key algo: %s\n", + gpgme_pubkey_algo_name (key->subkeys->pubkey_algo)); + exit (1); + } + if (key->subkeys->length != 1024) + { + fprintf (stderr, "Primary key has unexpected length: %i\n", + key->subkeys->length); + exit (1); + } + if (strcmp (key->subkeys->keyid, &keys[i].fpr[40 - 16])) + { + fprintf (stderr, "Primary key has unexpected key ID: %s\n", + key->subkeys->keyid); + exit (1); + } + if (strcmp (key->subkeys->fpr, keys[i].fpr)) + { + fprintf (stderr, "Primary key has unexpected fingerprint: %s\n", + key->subkeys->fpr); + exit (1); + } + if (key->subkeys->expires) + { + fprintf (stderr, "Primary key unexpectedly expires: %lu\n", + key->subkeys->expires); + exit (1); + } + + /* Secondary key. */ + if (key->subkeys->next->revoked) + { + fprintf (stderr, "Secondary key unexpectedly revoked\n"); + exit (1); + } + if (key->subkeys->next->expired) + { + fprintf (stderr, "Secondary key unexpectedly expired\n"); + exit (1); + } + if (key->subkeys->next->disabled) + { + fprintf (stderr, "Secondary key unexpectedly disabled\n"); + exit (1); + } + if (key->subkeys->next->invalid) + { + fprintf (stderr, "Secondary key unexpectedly invalid\n"); + exit (1); + } + if (!key->subkeys->next->can_encrypt) + { + fprintf (stderr, "Secondary key unexpectedly unusable for encryption\n"); + exit (1); + } + if (key->subkeys->next->can_sign) + { + fprintf (stderr, "Secondary key unexpectedly usable for signing\n"); + exit (1); + } + if (key->subkeys->next->can_certify) + { + fprintf (stderr, "Secondary key unexpectedly usable for certifications\n"); + exit (1); + } + if (!key->subkeys->next->secret) + { + fprintf (stderr, "Secondary key unexpectedly not secret\n"); + exit (1); + } + if (key->subkeys->next->pubkey_algo != GPGME_PK_ELG_E) + { + fprintf (stderr, "Secondary key has unexpected public key algo: %s\n", + gpgme_pubkey_algo_name (key->subkeys->next->pubkey_algo)); + exit (1); + } + if (key->subkeys->next->length != 1024) + { + fprintf (stderr, "Secondary key has unexpected length: %i\n", + key->subkeys->next->length); + exit (1); + } + if (strcmp (key->subkeys->next->keyid, keys[i].sec_keyid)) + { + fprintf (stderr, "Secondary key has unexpected key ID: %s\n", + key->subkeys->next->keyid); + exit (1); + } + if (!key->subkeys->next->fpr) + { + fprintf (stderr, "Secondary key has unexpectedly no fingerprint\n"); + exit (1); + } + if (key->subkeys->next->expires) + { + fprintf (stderr, "Secondary key unexpectedly expires: %lu\n", + key->subkeys->next->expires); + exit (1); + } + + /* FIXME: The below test will crash if we want to check for a + name, comment or email that doesn't exist in the key's user + IDs. */ + if (!((!keys[i].uid[0].name && !key->uids) + || (keys[i].uid[0].name && !keys[i].uid[1].name + && key->uids && !key->uids->next) + || (keys[i].uid[0].name && keys[i].uid[1].name + && !keys[i].uid[2].name + && key->uids && key->uids->next && !key->uids->next->next) + || (keys[i].uid[0].name && keys[i].uid[1].name + && keys[i].uid[2].name + && key->uids && key->uids->next && key->uids->next->next + && !key->uids->next->next->next))) + { + fprintf (stderr, "Key has unexpected number of user IDs\n"); + exit (1); + } + if (key->uids && key->uids->revoked) + { + fprintf (stderr, "First user ID unexpectedly revoked\n"); + exit (1); + } + if (key->uids && key->uids->invalid) + { + fprintf (stderr, "First user ID unexpectedly invalid\n"); + exit (1); + } + if (key->uids && key->uids->validity != GPGME_VALIDITY_UNKNOWN) + { + fprintf (stderr, "First user ID has unexpectedly validity: %i\n", + key->uids->validity); + exit (1); + } + if (keys[i].uid[0].name + && strcmp (keys[i].uid[0].name, key->uids->name)) + { + fprintf (stderr, "Unexpected name in first user ID: %s\n", + key->uids->name); + exit (1); + } + if (keys[i].uid[0].comment + && strcmp (keys[i].uid[0].comment, key->uids->comment)) + { + fprintf (stderr, "Unexpected comment in first user ID: %s\n", + key->uids->comment); + exit (1); + } + if (keys[i].uid[0].email + && strcmp (keys[i].uid[0].email, key->uids->email)) + { + fprintf (stderr, "Unexpected email in first user ID: %s\n", + key->uids->email); + exit (1); + } + if (key->uids && (!key->uids->signatures || key->uids->signatures->next)) + { + fprintf (stderr, "First user ID unexpected number of signatures\n"); + exit (1); + } + if (keys[i].uid[0].sig.algo != key->uids->signatures->pubkey_algo) + { + fprintf (stderr, "Unexpected algorithm in first user ID sig: %s\n", + gpgme_pubkey_algo_name (key->uids->signatures->pubkey_algo)); + exit (1); + } + if (strcmp (keys[i].uid[0].sig.keyid, key->uids->signatures->keyid)) + { + fprintf (stderr, "Unexpected key ID in first user ID sig: %s\n", + key->uids->signatures->keyid); + exit (1); + } + if (strcmp (keys[i].uid[0].sig.name, key->uids->signatures->name)) + { + fprintf (stderr, "Unexpected name in first user ID sig: %s\n", + key->uids->signatures->name); + exit (1); + } + if (strcmp (keys[i].uid[0].sig.comment, key->uids->signatures->comment)) + { + fprintf (stderr, "Unexpected comment in first user ID sig: %s\n", + key->uids->signatures->comment); + exit (1); + } + if (strcmp (keys[i].uid[0].sig.email, key->uids->signatures->email)) + { + fprintf (stderr, "Unexpected email in first user ID sig: %s\n", + key->uids->signatures->email); + exit (1); + } + if (keys[i].uid[0].sig.sig_class != key->uids->signatures->sig_class) + { + fprintf (stderr, "Unexpected class in first user ID sig: %i\n", + key->uids->signatures->sig_class); + exit (1); + } + if (keys[i].uid[0].sig.exportable != key->uids->signatures->exportable) + { + fprintf (stderr, "Unexpected exportable stat in first user ID sig: %i\n", + key->uids->signatures->exportable); + exit (1); + } + + if (key->uids && key->uids->next && key->uids->next->revoked) + { + fprintf (stderr, "Second user ID unexpectedly revoked\n"); + exit (1); + } + if (key->uids && key->uids->next && key->uids->next->invalid) + { + fprintf (stderr, "Second user ID unexpectedly invalid\n"); + exit (1); + } + if (key->uids && key->uids->next + && key->uids->next->validity != GPGME_VALIDITY_UNKNOWN) + { + fprintf (stderr, "Second user ID has unexpectedly validity: %i\n", + key->uids->next->validity); + exit (1); + } + if (keys[i].uid[1].name + && strcmp (keys[i].uid[1].name, key->uids->next->name)) + { + fprintf (stderr, "Unexpected name in second user ID: %s\n", + key->uids->next->name); + exit (1); + } + if (keys[i].uid[1].comment + && strcmp (keys[i].uid[1].comment, key->uids->next->comment)) + { + fprintf (stderr, "Unexpected comment in second user ID: %s\n", + key->uids->next->comment); + exit (1); + } + if (keys[i].uid[1].email + && strcmp (keys[i].uid[1].email, key->uids->next->email)) + { + fprintf (stderr, "Unexpected email in second user ID: %s\n", + key->uids->next->email); + exit (1); + } + /* Note: There is a bug in gpg 1.3.4 which duplicates a + signature after importing the secret key. Thus we disable + the second part of the check. */ + if (key->uids && (!key->uids->next->signatures /*|| key->uids->next->signatures->next*/)) + { + fprintf (stderr, "Second user ID unexpected number of signatures\n"); + exit (1); + } + if (keys[i].uid[1].sig.algo != key->uids->next->signatures->pubkey_algo) + { + fprintf (stderr, "Unexpected algorithm in second user ID sig: %s\n", + gpgme_pubkey_algo_name (key->uids->next->signatures->pubkey_algo)); + exit (1); + } + if (strcmp (keys[i].uid[1].sig.keyid, key->uids->next->signatures->keyid)) + { + fprintf (stderr, "Unexpected key ID in second user ID sig: %s\n", + key->uids->next->signatures->keyid); + exit (1); + } + if (strcmp (keys[i].uid[1].sig.name, key->uids->next->signatures->name)) + { + fprintf (stderr, "Unexpected name in second user ID sig: %s\n", + key->uids->next->signatures->name); + exit (1); + } + if (strcmp (keys[i].uid[1].sig.comment, key->uids->next->signatures->comment)) + { + fprintf (stderr, "Unexpected comment in second user ID sig: %s\n", + key->uids->next->signatures->comment); + exit (1); + } + if (strcmp (keys[i].uid[1].sig.email, key->uids->next->signatures->email)) + { + fprintf (stderr, "Unexpected email in second user ID sig: %s\n", + key->uids->next->signatures->email); + exit (1); + } + if (keys[i].uid[1].sig.sig_class != key->uids->next->signatures->sig_class) + { + fprintf (stderr, "Unexpected class in second user ID sig: %i\n", + key->uids->next->signatures->sig_class); + exit (1); + } + if (keys[i].uid[1].sig.exportable != key->uids->next->signatures->exportable) + { + fprintf (stderr, "Unexpected exportable stat in second user ID sig: %i\n", + key->uids->next->signatures->exportable); + exit (1); + } + + if (key->uids && key->uids->next && key->uids->next->next + && key->uids->next->next->revoked) + { + fprintf (stderr, "Third user ID unexpectedly revoked\n"); + exit (1); + } + if (key->uids && key->uids->next && key->uids->next->next + && key->uids->next->next->invalid) + { + fprintf (stderr, "Third user ID unexpectedly invalid\n"); + exit (1); + } + if (key->uids && key->uids->next && key->uids->next->next + && key->uids->next->next->validity != GPGME_VALIDITY_UNKNOWN) + { + fprintf (stderr, "Third user ID has unexpectedly validity: %i\n", + key->uids->next->next->validity); + exit (1); + } + if (keys[i].uid[2].name + && strcmp (keys[i].uid[2].name, key->uids->next->next->name)) + { + fprintf (stderr, "Unexpected name in third user ID: %s\n", + key->uids->next->next->name); + exit (1); + } + if (keys[i].uid[2].comment + && strcmp (keys[i].uid[2].comment, key->uids->next->next->comment)) + { + fprintf (stderr, "Unexpected comment in third user ID: %s\n", + key->uids->next->next->comment); + exit (1); + } + if (keys[i].uid[2].email + && strcmp (keys[i].uid[2].email, key->uids->next->next->email)) + { + fprintf (stderr, "Unexpected email in third user ID: %s\n", + key->uids->next->next->email); + exit (1); + } + if (key->uids && (!key->uids->next->next->signatures + || key->uids->next->next->signatures->next)) + { + fprintf (stderr, "Third user ID unexpected number of signatures\n"); + exit (1); + } + if (keys[i].uid[2].sig.algo != key->uids->next->next->signatures->pubkey_algo) + { + fprintf (stderr, "Unexpected algorithm in third user ID sig: %s\n", + gpgme_pubkey_algo_name (key->uids->next->next->signatures->pubkey_algo)); + exit (1); + } + if (strcmp (keys[i].uid[2].sig.keyid, key->uids->next->next->signatures->keyid)) + { + fprintf (stderr, "Unexpected key ID in third user ID sig: %s\n", + key->uids->next->next->signatures->keyid); + exit (1); + } + if (strcmp (keys[i].uid[2].sig.name, key->uids->next->next->signatures->name)) + { + fprintf (stderr, "Unexpected name in third user ID sig: %s\n", + key->uids->next->next->signatures->name); + exit (1); + } + if (strcmp (keys[i].uid[2].sig.comment, key->uids->next->next->signatures->comment)) + { + fprintf (stderr, "Unexpected comment in third user ID sig: %s\n", + key->uids->next->next->signatures->comment); + exit (1); + } + if (strcmp (keys[i].uid[2].sig.email, key->uids->next->next->signatures->email)) + { + fprintf (stderr, "Unexpected email in third user ID sig: %s\n", + key->uids->next->next->signatures->email); + exit (1); + } + if (keys[i].uid[2].sig.sig_class != key->uids->next->next->signatures->sig_class) + { + fprintf (stderr, "Unexpected class in third user ID sig: %i\n", + key->uids->next->next->signatures->sig_class); + exit (1); + } + if (keys[i].uid[2].sig.exportable != key->uids->next->next->signatures->exportable) + { + fprintf (stderr, "Unexpected exportable stat in third user ID sig: %i\n", + key->uids->next->next->signatures->exportable); + exit (1); + } + + gpgme_key_unref (key); + i++; + } + if (gpgme_err_code (err) != GPG_ERR_EOF) + fail_if_err (err); + err = gpgme_op_keylist_end (ctx); + fail_if_err (err); + + result = gpgme_op_keylist_result (ctx); + if (result->truncated) + { + fprintf (stderr, "Key listing unexpectedly truncated\n"); + exit (1); + } + + if (keys[i].fpr) + { + fprintf (stderr, "Less keys returned than expected\n"); + exit (1); + } + + gpgme_release (ctx); + return 0; +} -- 2.7.4