summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:36 +0900
committerJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:36 +0900
commit3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7 (patch)
treeb736cbf7c30b64e009a62666238787ae6881eb2c
parent10e16af58579b2e22154d944d8cb4144924a8406 (diff)
downloadgpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.tar.gz
gpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.tar.bz2
gpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.zip
Imported Upstream version 1.8.0upstream/1.8.0
-rw-r--r--ChangeLog450
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in11
-rw-r--r--NEWS41
-rw-r--r--README2
-rw-r--r--VERSION2
-rwxr-xr-xautogen.sh2
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure131
-rw-r--r--configure.ac42
-rw-r--r--doc/Makefile.in3
-rw-r--r--doc/defsincdate2
-rw-r--r--doc/gpgme.info244
-rw-r--r--doc/gpgme.info-1331
-rw-r--r--doc/gpgme.info-237
-rw-r--r--doc/gpgme.texi296
-rw-r--r--doc/gpl.texi8
-rw-r--r--doc/texinfo.tex124
-rw-r--r--doc/uiserver.texi40
-rw-r--r--gpgme.spec4
-rw-r--r--gpgme.spec.in2
-rw-r--r--lang/Makefile.in3
-rw-r--r--lang/README2
-rw-r--r--lang/cl/Makefile.in3
-rw-r--r--lang/cl/gpgme.asd2
-rw-r--r--lang/cpp/Makefile.in3
-rw-r--r--lang/cpp/src/GpgmeppConfig-w32.cmake.in.in103
-rw-r--r--lang/cpp/src/GpgmeppConfig.cmake.in.in2
-rw-r--r--lang/cpp/src/GpgmeppConfigVersion.cmake.in2
-rw-r--r--lang/cpp/src/Makefile.am24
-rw-r--r--lang/cpp/src/Makefile.in78
-rw-r--r--lang/cpp/src/context.cpp10
-rw-r--r--lang/cpp/src/context.h4
-rw-r--r--lang/cpp/src/engineinfo.h16
-rw-r--r--lang/cpp/src/gpgmefw.h6
-rw-r--r--lang/cpp/src/gpgmepp_version.h.in11
-rw-r--r--lang/cpp/src/swdbresult.cpp231
-rw-r--r--lang/cpp/src/swdbresult.h128
-rw-r--r--lang/cpp/src/tofuinfo.h2
-rw-r--r--lang/python/MANIFEST.in2
-rw-r--r--lang/python/Makefile.am44
-rw-r--r--lang/python/Makefile.in47
-rw-r--r--lang/python/README12
-rw-r--r--lang/python/examples/assuan.py4
-rw-r--r--lang/python/examples/decryption-filter.py6
-rwxr-xr-xlang/python/examples/delkey.py6
-rwxr-xr-xlang/python/examples/encrypt-to-all.py6
-rwxr-xr-xlang/python/examples/exportimport.py12
-rwxr-xr-xlang/python/examples/genkey.py8
-rw-r--r--lang/python/examples/inter-edit.py4
-rwxr-xr-xlang/python/examples/sign.py6
-rwxr-xr-xlang/python/examples/signverify.py10
-rwxr-xr-xlang/python/examples/simple.py4
-rw-r--r--lang/python/examples/testCMSgetkey.py4
-rwxr-xr-xlang/python/examples/verifydetails.py15
-rw-r--r--lang/python/gpg/__init__.py (renamed from lang/python/pyme/__init__.py)24
-rw-r--r--lang/python/gpg/callbacks.py (renamed from lang/python/pyme/callbacks.py)0
-rw-r--r--lang/python/gpg/constants/__init__.py (renamed from lang/python/pyme/constants/__init__.py)32
-rw-r--r--lang/python/gpg/constants/data/__init__.py (renamed from lang/python/pyme/constants/data/__init__.py)0
-rw-r--r--lang/python/gpg/constants/data/encoding.py (renamed from lang/python/pyme/constants/data/encoding.py)3
-rw-r--r--lang/python/gpg/constants/event.py (renamed from lang/python/pyme/constants/event.py)3
-rw-r--r--lang/python/gpg/constants/import.py (renamed from lang/python/pyme/constants/import.py)3
-rw-r--r--lang/python/gpg/constants/keylist/__init__.py (renamed from lang/python/pyme/constants/keylist/__init__.py)0
-rw-r--r--lang/python/gpg/constants/keylist/mode.py (renamed from lang/python/pyme/constants/keylist/mode.py)3
-rw-r--r--lang/python/gpg/constants/md.py (renamed from lang/python/pyme/constants/md.py)3
-rw-r--r--lang/python/gpg/constants/pk.py (renamed from lang/python/pyme/constants/pk.py)3
-rw-r--r--lang/python/gpg/constants/protocol.py (renamed from lang/python/pyme/constants/protocol.py)3
-rw-r--r--lang/python/gpg/constants/sig/__init__.py (renamed from lang/python/pyme/constants/sig/__init__.py)4
-rw-r--r--lang/python/gpg/constants/sig/mode.py (renamed from lang/python/pyme/constants/sig/mode.py)3
-rw-r--r--lang/python/gpg/constants/sig/notation.py25
-rw-r--r--lang/python/gpg/constants/sigsum.py (renamed from lang/python/pyme/constants/sigsum.py)3
-rw-r--r--lang/python/gpg/constants/status.py (renamed from lang/python/pyme/constants/status.py)2
-rw-r--r--lang/python/gpg/constants/validity.py (renamed from lang/python/pyme/constants/validity.py)3
-rw-r--r--lang/python/gpg/core.py (renamed from lang/python/pyme/core.py)30
-rw-r--r--lang/python/gpg/errors.py (renamed from lang/python/pyme/errors.py)13
-rw-r--r--lang/python/gpg/gpgme.py (renamed from lang/python/pyme/gpgme.py)1
-rw-r--r--lang/python/gpg/results.py (renamed from lang/python/pyme/results.py)0
-rw-r--r--lang/python/gpg/util.py (renamed from lang/python/pyme/util.py)0
-rw-r--r--lang/python/gpg/version.py (renamed from lang/python/pyme/version.py)6
-rw-r--r--lang/python/gpg/version.py.in (renamed from lang/python/pyme/version.py.in)4
-rw-r--r--lang/python/gpgme.i32
-rw-r--r--lang/python/helpers.c124
-rw-r--r--lang/python/helpers.h12
-rw-r--r--lang/python/private.h28
-rw-r--r--lang/python/pyme/__pycache__/__init__.cpython-34.pycbin4633 -> 0 bytes
-rw-r--r--lang/python/pyme/__pycache__/version.cpython-34.pycbin1997 -> 0 bytes
-rwxr-xr-xlang/python/setup.py.in18
-rw-r--r--lang/python/tests/Makefile.am2
-rw-r--r--lang/python/tests/Makefile.in5
-rwxr-xr-xlang/python/tests/initial.py6
-rw-r--r--lang/python/tests/support.py6
-rwxr-xr-xlang/python/tests/t-callbacks.py58
-rwxr-xr-xlang/python/tests/t-data.py30
-rwxr-xr-xlang/python/tests/t-decrypt-verify.py29
-rwxr-xr-xlang/python/tests/t-decrypt.py13
-rwxr-xr-xlang/python/tests/t-edit.py10
-rwxr-xr-xlang/python/tests/t-encrypt-large.py12
-rwxr-xr-xlang/python/tests/t-encrypt-sign.py25
-rwxr-xr-xlang/python/tests/t-encrypt-sym.py21
-rwxr-xr-xlang/python/tests/t-encrypt.py17
-rwxr-xr-xlang/python/tests/t-export.py10
-rwxr-xr-xlang/python/tests/t-file-name.py14
-rwxr-xr-xlang/python/tests/t-idiomatic.py18
-rwxr-xr-xlang/python/tests/t-import.py10
-rwxr-xr-xlang/python/tests/t-keylist.py25
-rwxr-xr-xlang/python/tests/t-protocol-assuan.py8
-rwxr-xr-xlang/python/tests/t-sig-notation.py26
-rwxr-xr-xlang/python/tests/t-sign.py41
-rwxr-xr-xlang/python/tests/t-signers.py31
-rwxr-xr-xlang/python/tests/t-trustlist.py6
-rwxr-xr-xlang/python/tests/t-verify.py75
-rwxr-xr-xlang/python/tests/t-wait.py12
-rwxr-xr-xlang/python/tests/t-wrapper.py6
-rw-r--r--lang/qt/Makefile.in3
-rw-r--r--lang/qt/doc/Makefile.in3
-rw-r--r--lang/qt/src/DN1
-rw-r--r--lang/qt/src/Makefile.am40
-rw-r--r--lang/qt/src/Makefile.in92
-rw-r--r--lang/qt/src/QGpgmeConfig-w32.cmake.in.in105
-rw-r--r--lang/qt/src/QGpgmeConfig.cmake.in.in5
-rw-r--r--lang/qt/src/QGpgmeConfigVersion.cmake.in2
-rw-r--r--lang/qt/src/defaultkeygenerationjob.cpp6
-rw-r--r--lang/qt/src/dn.cpp495
-rw-r--r--lang/qt/src/dn.h136
-rw-r--r--lang/qt/src/job.cpp10
-rw-r--r--lang/qt/src/job.h16
-rw-r--r--lang/qt/src/qgpgme_export.h40
-rw-r--r--lang/qt/src/qgpgme_version.h.in58
-rw-r--r--lang/qt/src/threadedjobmixin.h11
-rw-r--r--lang/qt/src/wkspublishjob.h17
-rw-r--r--lang/qt/tests/Makefile.in3
-rw-r--r--lang/qt/tests/t-tofuinfo.cpp4
-rw-r--r--m4/glib-2.0.m422
-rw-r--r--m4/libtool.m42
-rw-r--r--m4/pkg.m48
-rw-r--r--src/Makefile.am35
-rw-r--r--src/Makefile.in114
-rw-r--r--src/argparse.c4
-rw-r--r--src/argparse.h2
-rw-r--r--src/ath-pthread.c188
-rw-r--r--src/ath.c51
-rw-r--r--src/ath.h13
-rw-r--r--src/b64dec.c2
-rw-r--r--src/context.h19
-rw-r--r--src/data-identify.c2
-rw-r--r--src/decrypt-verify.c4
-rw-r--r--src/decrypt.c15
-rw-r--r--src/dirinfo.c2
-rw-r--r--src/engine-assuan.c3
-rw-r--r--src/engine-backend.h15
-rw-r--r--src/engine-g13.c1
-rw-r--r--src/engine-gpg.c73
-rw-r--r--src/engine-gpgconf.c273
-rw-r--r--src/engine-gpgsm.c13
-rw-r--r--src/engine-spawn.c3
-rw-r--r--src/engine-uiserver.c32
-rw-r--r--src/engine.c36
-rw-r--r--src/engine.h18
-rw-r--r--src/export.c2
-rw-r--r--src/genkey.c2
-rw-r--r--src/getauditlog.c2
-rw-r--r--src/gpgconf.c4
-rw-r--r--src/gpgme-config.in8
-rw-r--r--src/gpgme-tool.c2
-rw-r--r--src/gpgme-w32spawn.c2
-rw-r--r--src/gpgme.c168
-rw-r--r--src/gpgme.def7
-rw-r--r--src/gpgme.h.in74
-rw-r--r--src/keylist.c17
-rw-r--r--src/keysign.c2
-rw-r--r--src/libgpgme.vers7
-rw-r--r--src/mbox-util.c2
-rw-r--r--src/mbox-util.h2
-rw-r--r--src/op-support.c2
-rw-r--r--src/opassuan.c2
-rw-r--r--src/parsetlv.c2
-rw-r--r--src/parsetlv.h2
-rw-r--r--src/passwd.c2
-rw-r--r--src/posix-io.c6
-rw-r--r--src/posix-sema.c68
-rw-r--r--src/queryswdb.c121
-rw-r--r--src/sema.h43
-rw-r--r--src/sys-util.h2
-rw-r--r--src/tofupolicy.c2
-rw-r--r--src/ttyname_r.c2
-rw-r--r--src/util.h5
-rw-r--r--src/verify.c3
-rw-r--r--src/version.c1
-rw-r--r--src/w32-ce.c2
-rw-r--r--src/w32-io.c38
-rw-r--r--src/w32-sema.c117
-rw-r--r--src/w32-util.c15
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/Makefile.in24
-rw-r--r--tests/gpg/Makefile.am11
-rw-r--r--tests/gpg/Makefile.in43
-rw-r--r--tests/gpg/t-decrypt-verify.c2
-rw-r--r--tests/gpg/t-thread-keylist-verify.c142
-rw-r--r--tests/gpg/t-thread-keylist.c85
-rw-r--r--tests/gpg/t-verify.c49
-rw-r--r--tests/gpgsm/Makefile.am2
-rw-r--r--tests/gpgsm/Makefile.in5
-rw-r--r--tests/gpgsm/cms-decrypt.c2
-rw-r--r--tests/gpgsm/cms-keylist.c2
-rw-r--r--tests/opassuan/Makefile.in3
-rw-r--r--tests/opassuan/t-command.c2
-rw-r--r--tests/run-decrypt.c55
-rw-r--r--tests/run-encrypt.c2
-rw-r--r--tests/run-export.c2
-rw-r--r--tests/run-genkey.c2
-rw-r--r--tests/run-identify.c2
-rw-r--r--tests/run-import.c2
-rw-r--r--tests/run-keylist.c2
-rw-r--r--tests/run-keysign.c2
-rw-r--r--tests/run-sign.c18
-rw-r--r--tests/run-support.h2
-rw-r--r--tests/run-swdb.c151
-rw-r--r--tests/run-tofu.c24
-rw-r--r--tests/run-verify.c18
219 files changed, 4977 insertions, 1912 deletions
diff --git a/ChangeLog b/ChangeLog
index 1fefdbb..161b7b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,453 @@
+2016-11-16 Werner Koch <wk@gnupg.org>
+
+ Release 1.8.0.
+ * configure.ac: Set version to 1.8.0. Set LT version C28/A17/RO.
+ Set CPP LT version to C9/A3/R0. Set Qt LT version to C8/A1/R0.
+
+ core: Do not leak the override session key to ps(1).
+ * src/engine-gpg.c (struct engine_gpg): New field
+ override_session_key.
+ (gpg_release): Free that field.
+ (gpg_decrypt): With gnupg 2.1.16 use --override-session-key-fd.
+
+ * tests/run-decrypt.c (main): Fix setting over the override key.
+
+2016-11-16 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+ doc,tests: Require use of ctx_flag before use of session_key.
+ * doc/gpgme.texi: Document requirements of verifying that it is OK to
+ use session_key.
+ * tests/run-decrypt.c: Ensure that we fail if we're unable to access
+ the session key, so that we do not violate the guidance above.
+
+
+ Changed the description
+
+ -@code{gpgme_set_ctx_flag (ctx, "export-session-key")} returns
+ -@code{GPG_ERR_NO_ERROR} or @code{gpgme_get_ctx_flag (ctx,
+ -"export-session-key")} returns @code{"1"}.
+ +@code{gpgme_set_ctx_flag (ctx, "export-session-key")} returns success
+ +or @code{gpgme_get_ctx_flag (ctx, "export-session-key")} returns true
+ +(non-empty string).
+
+ to get gpgme_get_ctx_flag for boolean values in sync with its own
+ description.
+
+ Note that I don't agree with the above suggestion but it does not
+ really harm to have it in the man page.
+
+2016-11-15 Andre Heinecke <aheinecke@intevation.de>
+
+ qt, cpp: Add cmake config files for w32.
+ * lang/cpp/src/GpgmeppConfig-w32.cmake.in.in
+ lang/qt/src/QGpgmeConfig-w32.cmake.in.in: New.
+ * lang/cpp/src/GpgmeppConfig.cmake.in.in,
+ lang/qt/src/QGpgmeConfig.cmake.in.in: Remove libsuffix handling.
+ * lang/cpp/src/Makefile.am,
+ lang/qt/src/Makefile.am: Create / install w32 config files.
+ * configure.ac: Configure them.
+
+ qt: Use new style connect in th..mixin.
+ * lang/qt/src/threadedjobmixin.h
+ (ThreadedJobMixin::lateInitialization): Use new style connect.
+
+2016-11-15 Werner Koch <wk@gnupg.org>
+
+ core: Implement context flag "override-session-key".
+ * src/gpgme.c (gpgme_set_ctx_flag): Add flags "export-session-key" and
+ "override-session-key".
+ (gpgme_get_ctx_flag): Ditto.
+ (gpgme_set_export_session_keys): Remove.
+ (gpgme_get_export_session_keys): Remove.
+ * src/gpgme.def, src/libgpgme.vers: Remove them.
+ * src/context.h (struct gpgme_context): Add field
+ override_session_key.
+ * src/decrypt-verify.c (decrypt_verify_start): Pass
+ override_session_key value to the engine.
+ * src/decrypt.c (decrypt_start): Ditto.
+ * src/engine.c (_gpgme_engine_op_decrypt): Ditto.
+ (_gpgme_engine_op_decrypt_verify): Ditto.
+ * src/engine-backend.h (struct engine_ops): Extend DECRYPT and
+ DECRYPT_VERIFY_START with override_session_key.
+ * src/engine-uiserver.c (_uiserver_decrypt): Add stub arg
+ override_session_key.
+ (uiserver_decrypt): Ditto.
+ (uiserver_decrypt_verify): Ditto.
+ * src/engine-gpgsm.c (gpgsm_decrypt): Ditto.
+ * src/engine-gpg.c (gpg_decrypt): Add arg override_session_key and set
+ corresponding gpg option.
+
+ * tests/run-decrypt.c (print_result): Print the session key if
+ available.
+ (main): Add options --export-session-key and --override-session-key.
+
+ core: Add public function gpgme_get_ctx_flag.
+ * src/gpgme.h.in (gpgme_get_ctx_flag): New.
+ * src/gpgme.c (gpgme_set_ctx_flag): Move down the file and add a trace
+ statement.
+ (gpgme_get_ctx_flag): New.
+ * src/gpgme.def, src/libgpgme.vers: Add new interface.
+
+2016-11-15 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+ core: Enable extraction of session keys.
+ * src/gpgme.c (gpgme_set_export_session_keys): New function.
+ (gpgme_get_export_session_keys): New function.
+ * src/gpgme.h.in (struct _gpgme_op_decrypt_result): Add session_key
+ member.
+ (gpgme_{set,get}_export_session_keys): Declare new functions.
+ * src/libgpgme.vers, src/gpgme.def: Export new functions in shared
+ object.
+ * src/engine.h: (_gpgme_engine_op_decrypt) Add export_session_key
+ parameter.
+ (_gpgme_engine_op_decrypt_verify): Add export_session_key parameter.
+ * src/engine-backend.h: (struct engine_ops): Change function
+ pointer declarations to match.
+ * src/context.h (struct gpgme_context): Add export_session_keys member.
+ * src/decrypt.c (release_op_data): Free result.session_key.
+ (_gpgme_decrypt_status_handler): Store a copy of the exported session
+ key.
+ (decrypt_start): Pass export_session_keys from the context.
+ * src/decrypt-verify.c (decrypt_verify_start): Pass
+ export_session_keys from context.
+ * src/engine.c (_gpgme_engine_op_decrypt): Pass through
+ export_session_key flag.
+ (_gpgme_engine_op_decrypt_verify): Pass through export_session_key
+ flag.
+ * src/engine-gpg.c (gpg_decrypt): If export_session_key is set, add
+ --export-session-key to argument list.
+ * src/engine-gpgsm.c (gpgsm_decrypt): Ignore export_session_key for
+ now, since gpgsm offers no such mechanism.
+ * src/engine-uiserver.c (_uiserver_decrypt): If export_session_key is
+ set, add --export-session-key flag to cmd.
+ * doc/gpgme.texi: Document new functions and session_key member of
+ decrypt_result_t.
+ * doc/uiserver.texi: Add --export-session-key flag to DECRYPT command.
+
+2016-11-14 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Add API to get the context for a Job.
+ * lang/qt/src/job.cpp,
+ lang/qt/src/job.h (Job::context): New.
+ * lang/qt/src/threadedjobmixin.cpp
+ (ThreadedJobMixin::~ThreadedJobMixin): New. Unregister context.
+ (ThreadedJobMixin::lateInitialization): Register context.
+ * NEWS: Update for cpp and qt.
+
+ cpp: Add get / set Sender API.
+ * cpp/src/context.cpp, cpp/src/context.h (Context::setSender),
+ (Context::getSender): Add simple wrappers.
+
+ qt, cpp: Enable dll build for windows.
+ * lang/cpp/src/Makefile.am,
+ lang/qt/src/Makefile.am: Add -no-undefined to LDFLAGS.
+
+ w32: Fix build of w32-glib.
+ * src/Makefile.am (main_sources): Remove system_components_not_extra.
+ (libgpgme_la_SOURCES): Add system_components_not_extra.
+ (libgpgme_glib_la_SOURCES): Remove duplicated ath files.
+
+2016-11-11 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+ doc: Correct deftypefun for gpgme_op_decrypt_verify_start.
+ * doc/gpgme.texi: Documentationabout gpgme_op_decrypt_verify_start was
+ stored under the name gpgme_op_decrypt_verify instead.
+
+ doc: Correct text about gpgme_cancel_async.
+ * doc/gpgme.texi: Documentation about gpgme_cancel_async should refer
+ to the correct name.
+
+ core: Non-zero values should set _armor, _textmode, and _online.
+ * src/gpgme.c (gpgme_set_armor, gpgme_set_textmode,
+ gpgme_set_offline): Ensure that non-zero values actually set the
+ appropriate internal bit.
+
+2016-11-11 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ tests,python: Atomic directory creation.
+ * lang/python/tests/Makefile.am: Use MIDIR_P.
+ * tests/gpg/Makefile.am: Ditto.
+ * tests/gpgsm/Makefile.am: Ditto.
+
+2016-11-10 Werner Koch <wk@gnupg.org>
+
+ core: Use better error code when using select with a too high fd.
+ * src/posix-io.c (_gpgme_io_select): Return EMFILE instead of EBADF.
+
+2016-11-10 Andre Heinecke <aheinecke@intevation.de>
+
+ tests: Reduce thread count in new thread tests.
+ * gpg/t-thread-keylist-verify.c,
+ gpg/t-thread-keylist.c: Reduce threads to 100
+
+2016-11-10 Werner Koch <wk@gnupg.org>
+
+ core: Detect unreadable keyrings.
+ * src/keylist.c (op_data_t): Add field keydb_search_err.
+ (keylist_status_handler): Parse STATUS_ERROR into that var.
+ (gpgme_op_keylist_next): Use that err instead of GPG_ERR_EOF.
+
+2016-11-10 Andre Heinecke <aheinecke@intevation.de>
+
+ tests: Fix additional memleaks in thread tests.
+ * tests/gpg/t-thread-keylist-verify.c (start_verify): Release
+ data.
+ (start_keylist): Unref keys.
+ * tests/gpg/t-thread-keylist.c (start_keylist): Unref keys.
+
+ tests: Improve new thread tests.
+ * tests/gpg/t-thread-keylist-verify.c (start_keylist): Mark
+ arg as unused. Release context.
+ (start_verify): Ditto.
+ (main): Mark args as unused.
+ * tests/gpg/t-thread-keylist.c (start_keylist): Mark
+ arg as unused. Release context.
+ (main): Mark args as unused.
+
+ core: Use gpgrt locking for thread safeness.
+ * configure.ac: Require libgpg-error 1.17. No longer
+ check for pthread.
+ * doc/gpgme.texi: Document removed neccessity for thread
+ safe gpgme flavours.
+ * src/sema.h (DEFINE_GLOBAL_LOCK),
+ (DEFINE_STATIC_LOCK, INIT_LOCK, DECLARE_LOCK)
+ (DESTROY_LOCK, LOCK, UNLOCK): Change to gpgrt equivalents.
+ * src/posix-sema.c, src/w32-sema.c: Removed.
+ * src/Makefile.am: Remove libpthread and
+ Update accordingly.
+ * src/ath.c, src/ath.h (ath_mutex_init)
+ (ath_mutex_destroy, ath_mutex_lock, ath_mutex_unlock): Removed.
+ * src/ath.h (ATH_MUTEX_INITIALIZER): Removed.
+ * src/version.c (do_subsystem_inits): sema_subsystem_init is
+ no longer required.
+ * tests/gpg/Makefile.am: Add new threading tests.
+ (t_thread1_LDADD, t_cancel_LDADD):
+ Use just gpgme.
+ * tests/gpg/t-thread-keylist-verify.c,
+ tests/gpg/t-thread-keylist.c: New.
+ * src/gpgme-config.in: Use -lgpgme for thread-model pthread.
+
+2016-11-09 Justus Winter <justus@g10code.com>
+
+ python: Require at least GPGME 1.7 for out-of-tree builds.
+ * lang/python/setup.py.in: Bump required version to 1.7.
+
+2016-11-09 Werner Koch <wk@gnupg.org>
+
+ w32: Better protect the IO-system's fd_table.
+ * src/w32-io.c (fd_table_lock): New.
+ (new_fd): Lock allocation of a new slot.
+ (release_fd): Lock deallocation of a slot.
+
+2016-11-04 Andre Heinecke <aheinecke@intevation.de>
+
+ cpp: Add API for swdb queries.
+ * lang/cpp/src/swdbresult.cpp,
+ lang/cpp/src/swdbresult.h (SwdbResult): New.
+ * lang/cpp/src/Makefile.am: Update accordingly.
+
+ cpp: Add more EngineInfo::Version ctors.
+ * lang/cpp/src/engineinfo.h
+ (EngineInfo::Version::Version(const char*)),
+ (EngineInfo::Version::Version()): New.
+
+ cpp: Don't include gpgme.h in tofuinfo header.
+ * lang/cpp/src/tofuinfo.h: Don't include gpgme.h
+
+ cpp: Extend gpgmefw for tofuinfo and swdb query.
+ * lang/cpp/src/gpgmefw.h (gpgme_tofu_info_t)
+ (gpgme_query_swdb_result_t): New forwards.
+
+2016-11-04 Werner Koch <wk@gnupg.org>
+
+ w32: Fix locating gpgconf on 64 bit systems.
+ * src/w32-util.c (find_program_at_standard_place): Use access to check
+ whether the binary is at CSIDL_PROGRAM_FILES before testing
+ CSIDL_PROGRAM_FILESX86.
+
+2016-11-03 Werner Koch <wk@gnupg.org>
+
+ core: Add gpgme_op_query_swdb and helper.
+ * src/gpgme.h.in (gpgme_query_swdb_result_t): New.
+ (gpgme_op_query_swdb): New.
+ (gpgme_op_query_swdb_result): New.
+ * src/libgpgme.vers, src/gpgme.def: Add the two new functions.
+ * src/queryswdb.c: New.
+ * src/Makefile.am (main_sources): Add new file.
+ * src/context.h (OPDATA_QUERY_SWDB): New.
+ * src/engine-backend.h (struct engine_ops): Add field 'query_swdb'.
+ Adjust all initializer.
+ * src/engine.c (_gpgme_engine_op_query_swdb): New.
+ * src/engine-gpgconf.c (parse_swdb_line): New.
+ (gpgconf_query_swdb): New.
+ (_gpgme_engine_ops_gpgconf): Register that function.
+
+ * src/util.h (GPG_ERR_TOO_OLD): Define for older libgpg-error.
+ (GPG_ERR_ENGINE_TOO_OLD): Ditto.
+
+ * tests/run-swdb.c: New.
+ * tests/Makefile.am (noinst_PROGRAMS): Add new debug tool.
+
+2016-11-03 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Change license of export / version header.
+ * lang/qt/src/qgpgme_export.h,
+ lang/qt/src/qgpgme_version.h: Change license to GPLv2+
+
+2016-11-03 Werner Koch <wk@gnupg.org>
+
+ core: Make use of --homedir in gpgconf.
+ * src/engine-gpgconf.c (struct engine_gpgconf): Add field 'version'.
+ (have_gpgconf_version): New.
+ (gpgconf_release): Free VERSION.
+ (gpgconf_new): Set VERSION.
+ (gpgconf_read, gpgconf_write): Use --homedir with recent gnupg.
+
+2016-11-02 Andras Mantia <andras@kdab.com>
+
+ qt: Fix build with g++ 4.8.x.
+ * lang/qt/src/defaultkeygenerationjob.cpp
+ (DefaultKeyGenerationJob::start): Explicitly connect pointer
+ in the QPointer.
+
+2016-11-02 Andre Heinecke <aheinecke@intevation.de>
+
+ qt, cpp: Fix versioning in cmake config and header.
+ * configure.ac (VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO): New
+ subst variables for the version header.
+ * lang/cpp/src/GpgmeppConfigVersion.cmake.in,
+ lang/cpp/src/gpgmepp_version.h.in,
+ lang/qt/src/QGpgmeConfigVersion.cmake.in,
+ lang/qt/src/qgpgme_version.h.in: Use new variables.
+
+ qt: Install cmake config into qgpgme subdir.
+ * lang/qt/src/Makefile.am: Install cmake config file in qgpgme subdir.
+
+ qt: Require gpgmepp from cmake config script.
+ * lang/qt/src/QGpgmeConfig.cmake.in.in: Require cpp.
+
+ qt, cpp: Add all generated files to cleanfiles.
+ * cpp/src/Makefile.am (CLEANFILES),
+ qt/src/Makefile.am (CLEANFILES): Add all generated files
+ to cleanfiles.
+
+2016-11-01 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Add Distinguished Name parser from libkleo.
+ * lang/qt/src/dn.cpp (DN, DN::Attribute): New public API.
+ * lang/qt/src/dn.h: New.
+ * lang/qt/src/Makefile.am: Update accordingly.
+
+ qt, cpp: Install version headers in subdirs.
+ * lang/cpp/src/Makefile.am,
+ lang/qt/src/Makefile.am: Install version headers in include
+ subdirs.
+
+2016-10-31 Justus Winter <justus@g10code.com>
+
+ python: Use vanity modules for constants in tests and examples.
+ * lang/python/gpg/constants/sig/notation.py: New file.
+ * lang/python/gpg/constants/sig/__init__.py: Import new module.
+
+ * lang/python/examples/assuan.py: Use more specific module for
+ constants, e.g. 'protocol.ASSUAN' instead of 'PROTOCOL_ASSUAN'.
+ * lang/python/examples/testCMSgetkey.py: Likewise.
+ * lang/python/tests/initial.py: Likewise.
+ * lang/python/tests/t-callbacks.py: Likewise.
+ * lang/python/tests/t-decrypt-verify.py: Likewise.
+ * lang/python/tests/t-decrypt.py: Likewise.
+ * lang/python/tests/t-edit.py: Likewise.
+ * lang/python/tests/t-encrypt-large.py: Likewise.
+ * lang/python/tests/t-encrypt-sign.py: Likewise.
+ * lang/python/tests/t-encrypt-sym.py: Likewise.
+ * lang/python/tests/t-encrypt.py: Likewise.
+ * lang/python/tests/t-export.py: Likewise.
+ * lang/python/tests/t-file-name.py: Likewise.
+ * lang/python/tests/t-idiomatic.py: Likewise.
+ * lang/python/tests/t-import.py: Likewise.
+ * lang/python/tests/t-keylist.py: Likewise.
+ * lang/python/tests/t-protocol-assuan.py: Likewise.
+ * lang/python/tests/t-sig-notation.py: Likewise.
+ * lang/python/tests/t-sign.py: Likewise.
+ * lang/python/tests/t-signers.py: Likewise.
+ * lang/python/tests/t-trustlist.py: Likewise.
+ * lang/python/tests/t-verify.py: Likewise.
+ * lang/python/tests/t-wait.py: Likewise.
+
+ python: Import the topmost module in tests and examples.
+ * examples/verifydetails.py: Only import the topmost module 'gpg' and
+ update the code accordingly.
+ * tests/support.py: Likewise.
+ * tests/t-callbacks.py: Likewise.
+ * tests/t-data.py: Likewise.
+ * tests/t-decrypt-verify.py: Likewise.
+ * tests/t-decrypt.py: Likewise.
+ * tests/t-edit.py: Likewise.
+ * tests/t-encrypt-large.py: Likewise.
+ * tests/t-encrypt-sign.py: Likewise.
+ * tests/t-encrypt-sym.py: Likewise.
+ * tests/t-encrypt.py: Likewise.
+ * tests/t-export.py: Likewise.
+ * tests/t-file-name.py: Likewise.
+ * tests/t-import.py: Likewise.
+ * tests/t-keylist.py: Likewise.
+ * tests/t-sig-notation.py: Likewise.
+ * tests/t-sign.py: Likewise.
+ * tests/t-signers.py: Likewise.
+ * tests/t-trustlist.py: Likewise.
+ * tests/t-verify.py: Likewise.
+ * tests/t-wait.py: Likewise.
+ * tests/t-wrapper.py: Likewise.
+
+ python: Improve constants module.
+ * lang/python/gpg/constants/__init__.py: Import all modules below
+ 'constants/'. Interface hygiene: delete 'util'.
+ * lang/python/gpg/constants/data/encoding.py: Delete 'util'.
+ * lang/python/gpg/constants/event.py: Likewise.
+ * lang/python/gpg/constants/import.py: Likewise.
+ * lang/python/gpg/constants/keylist/mode.py: Likewise.
+ * lang/python/gpg/constants/md.py: Likewise.
+ * lang/python/gpg/constants/pk.py: Likewise.
+ * lang/python/gpg/constants/protocol.py: Likewise.
+ * lang/python/gpg/constants/sig/mode.py: Likewise.
+ * lang/python/gpg/constants/sigsum.py: Likewise.
+ * lang/python/gpg/constants/validity.py: Likewise.
+ * lang/python/gpg/errors.py: Likewise.
+
+2016-10-31 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+ python: Rename Python module from PyME to gpg.
+ This follows weeks of discussion on the gnupg-devel mailing list.
+ Hopefully it will make it easier for people using Python to use GnuPG
+ in the future.
+
+2016-10-25 Werner Koch <wk@gnupg.org>
+
+ core: New API functions gpgme_set_sender, gpgme_get_sender.
+ * src/context.h (struct gpgme_context): Add field 'sender'.
+ * src/gpgme.c: Include mbox-util.h.
+ (gpgme_release): Free SENDER.
+ (gpgme_set_sender): New.
+ (gpgme_get_sender): New.
+ * src/gpgme.def, src/libgpgme.vers: Add new functions.
+
+ * src/engine-gpg.c (append_args_from_sender): New.
+ (gpg_encrypt_sign, gpg_sign): Call append_args_from_sender.
+ (gpg_verify): Add arg CTX. Call append_args_from_sender/
+ * src/engine-gpgsm.c (gpgsm_verify): Add dummy arg CTX.
+ * src/engine-uiserver.c (uiserver_verify): Ditto.
+ * src/engine.c (_gpgme_engine_op_verify): Add arg CTX.
+ * src/verify.c (verify_start): Pass CTX to engine function.
+
+ * tests/gpg/t-verify.c (main): Add some checks for new functions.
+ * tests/run-sign.c (main): Add option --sender.
+ * tests/run-verify.c (main): Ditto.
+
+2016-10-19 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Improve WKSPublishJob apidoc.
+ * lang/qt/src/wkspublishjob.h: Improve doc.
+
2016-10-18 Werner Koch <wk@gnupg.org>
Release 1.7.1.
diff --git a/Makefile.am b/Makefile.am
index 72b8ee9..e47ace5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
## Process this file with automake to produce Makefile.in
diff --git a/Makefile.in b/Makefile.in
index 20f5005..0dd976e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,7 +31,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
@@ -101,7 +101,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(top_srcdir)/build-aux/mkinstalldirs \
- $(top_srcdir)/lang/python/pyme/version.py.in COPYING \
+ $(top_srcdir)/lang/python/gpg/version.py.in COPYING \
COPYING.LESSER THANKS TODO build-aux/compile \
build-aux/config.guess build-aux/config.sub build-aux/depcomp \
build-aux/install-sh build-aux/mdate-sh missing \
@@ -131,7 +131,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = lang/python/pyme/version.py
+CONFIG_CLEAN_FILES = lang/python/gpg/version.py
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -363,6 +363,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -486,7 +489,7 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
distclean-hdr:
-rm -f config.h stamp-h1
-lang/python/pyme/version.py: $(top_builddir)/config.status $(top_srcdir)/lang/python/pyme/version.py.in
+lang/python/gpg/version.py: $(top_builddir)/config.status $(top_srcdir)/lang/python/gpg/version.py.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
diff --git a/NEWS b/NEWS
index e726c77..bbafdeb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,44 @@
+Noteworthy changes in version 1.8.0 (2016-11-16)
+------------------------------------------------
+
+ * The module of the Python bindings has been renamed to 'gpg'.
+
+ * New interface to query current software versions.
+
+ * New feature to use gpg's --{show,override}session-key options.
+
+ * New interface to set the sender of a mail.
+
+ * qt: Added Distinguished Name parser from libkleo
+
+ * The --homedir option is now used with recent gpgconf versions.
+
+ * On 64 bit Windows systems gpgconf is now properly located.
+
+ * The internal locking functions have been replaced by libgpg-error
+ locking functions.
+
+ * Interface changes relative to the 1.7.1 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgme_set_sender NEW.
+ gpgme_get_sender NEW.
+ gpgme_op_query_swdb NEW.
+ gpgme_op_query_swdb_result NEW.
+ gpgme_query_swdb_result_t NEW.
+ gpgme_get_ctx_flag NEW.
+ gpgme_decrypt_result_t EXTENDED: New field session_key.
+ qt: DN NEW.
+ qt: DN::Attribute NEW.
+ qt: Job::context(Job*) NEW.
+ cpp: EngineInfo::Version::Version(const char*) NEW.
+ cpp: EngineInfo::Version::Version() NEW.
+ cpp: SwdbResult NEW.
+ cpp: Context::setSender(const char*) NEW.
+ cpp: Context::getSender() NEW.
+
+ [c=C28/A17/R0 cpp=C9/A3/R0 qt=C8/A1/R0]
+
+
Noteworthy changes in version 1.7.1 (2016-10-18)
------------------------------------------------
diff --git a/README b/README
index 90f2e39..b7483b2 100644
--- a/README
+++ b/README
@@ -64,7 +64,7 @@ following ways:
a) If you have a trusted Version of GnuPG installed, you can simply check
the supplied signature:
- $ gpg --verify gpgme-x.y.z.tar.gz.sig
+ $ gpg --verify gpgme-x.y.z.tar.gz.sig gpgme-x.y.z.tar.gz
This checks that the detached signature gpgme-x.y.z.tar.gz.sig is
indeed a a signature of gpgme-x.y.z.tar.gz. The key used to create
diff --git a/VERSION b/VERSION
index 943f9cb..27f9cd3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.7.1
+1.8.0
diff --git a/autogen.sh b/autogen.sh
index 24da40c..91f35a6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -347,7 +347,7 @@ if [ -d .git ]; then
[ -z "${SILENT}" ] && cat <<EOF
*** Activating trailing whitespace git pre-commit hook. ***
For more information see this thread:
- http://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
+ https://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
To deactivate this pre-commit hook again move .git/hooks/pre-commit
and .git/hooks/pre-commit.sample out of the way.
EOF
diff --git a/config.h.in b/config.h.in
index 505fe26..8df7cbe 100644
--- a/config.h.in
+++ b/config.h.in
@@ -74,9 +74,6 @@
/* Define if the ttyname_r function has a POSIX compliant declaration. */
#undef HAVE_POSIXDECL_TTYNAME_R
-/* Define if we have pthread. */
-#undef HAVE_PTHREAD
-
/* If available, contains the Python version number currently in use. */
#undef HAVE_PYTHON
diff --git a/configure b/configure
index c44a751..8eb189d 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.7.1.
+# Generated by GNU Autoconf 2.69 for gpgme 1.8.0.
#
# Report bugs to <http://bugs.gnupg.org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gpgme'
PACKAGE_TARNAME='gpgme'
-PACKAGE_VERSION='1.7.1'
-PACKAGE_STRING='gpgme 1.7.1'
+PACKAGE_VERSION='1.8.0'
+PACKAGE_STRING='gpgme 1.8.0'
PACKAGE_BUGREPORT='http://bugs.gnupg.org'
PACKAGE_URL=''
@@ -705,8 +705,6 @@ GPGME_QTTEST_CFLAGS
GPGME_QT_LIBS
GPGME_QT_CFLAGS
HAVE_CXX11
-HAVE_PTHREAD_FALSE
-HAVE_PTHREAD_TRUE
BUILD_W32_GLIB_FALSE
BUILD_W32_GLIB_TRUE
HAVE_ANDROID_SYSTEM_FALSE
@@ -751,6 +749,9 @@ DLLTOOL
AS
CC_FOR_BUILD
VERSION_NUMBER
+VERSION_MICRO
+VERSION_MINOR
+VERSION_MAJOR
LIBQGPGME_LT_REVISION
LIBQGPGME_LT_AGE
LIBQGPGME_LT_CURRENT
@@ -1454,7 +1455,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.7.1 to adapt to many kinds of systems.
+\`configure' configures gpgme 1.8.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1524,7 +1525,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gpgme 1.7.1:";;
+ short | recursive ) echo "Configuration of gpgme 1.8.0:";;
esac
cat <<\_ACEOF
@@ -1672,7 +1673,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gpgme configure 1.7.1
+gpgme configure 1.8.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2502,7 +2503,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.7.1, which was
+It was created by gpgme $as_me 1.8.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2865,23 +2866,26 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# (Interfaces added: AGE++)
# (Interfaces removed/changed: AGE=0)
#
-LIBGPGME_LT_CURRENT=27
-LIBGPGME_LT_AGE=16
+LIBGPGME_LT_CURRENT=28
+LIBGPGME_LT_AGE=17
LIBGPGME_LT_REVISION=0
-LIBGPGMEPP_LT_CURRENT=8
-LIBGPGMEPP_LT_AGE=2
+# 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=9
+LIBGPGMEPP_LT_AGE=3
LIBGPGMEPP_LT_REVISION=0
-LIBQGPGME_LT_CURRENT=7
-LIBQGPGME_LT_AGE=0
+LIBQGPGME_LT_CURRENT=8
+LIBQGPGME_LT_AGE=1
LIBQGPGME_LT_REVISION=0
# If the API is changed in an incompatible way: increment the next counter.
GPGME_CONFIG_API_VERSION=1
##############################################
-NEED_GPG_ERROR_VERSION=1.11
+NEED_GPG_ERROR_VERSION=1.17
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.0.2
@@ -2889,6 +2893,10 @@ NEED_LIBASSUAN_VERSION=2.0.2
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
+VERSION_MAJOR=1
+VERSION_MINOR=8
+VERSION_MICRO=0
+
ac_aux_dir=
for ac_dir in build-aux "$srcdir"/build-aux; do
if test -f "$ac_dir/install-sh"; then
@@ -3408,7 +3416,7 @@ fi
# Define the identity of the package.
PACKAGE='gpgme'
- VERSION='1.7.1'
+ VERSION='1.8.0'
cat >>confdefs.h <<_ACEOF
@@ -6309,6 +6317,9 @@ test -n "$GITLOG_TO_CHANGELOG" || GITLOG_TO_CHANGELOG="gitlog-to-changelog"
+
+
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
@@ -6318,7 +6329,7 @@ cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
-VERSION_NUMBER=0x010701
+VERSION_NUMBER=0x010800
# We need to compile and run a program on the build machine. A
@@ -17433,7 +17444,7 @@ $as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$gl
$as_echo "no" >&6; }
if test "$PKG_CONFIG" = "no" ; then
echo "*** A new enough version of pkg-config was not found."
- echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+ echo "*** See https://www.freedesktop.org/software/pkgconfig/"
else
if test -f conf.glibtest ; then
:
@@ -17499,52 +17510,6 @@ fi
;;
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_create ();
-int
-main ()
-{
-return pthread_create ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pthread_pthread_create=yes
-else
- ac_cv_lib_pthread_pthread_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
- have_pthread=yes
-fi
-
- if test "$have_pthread" = yes; then
-
-$as_echo "#define HAVE_PTHREAD /**/" >>confdefs.h
-
- fi
-
# XXX: Probably use exec-prefix here?
# GPG_DEFAULT='/usr/bin/gpg'
# GPGSM_DEFAULT='/usr/bin/gpgsm'
@@ -17632,15 +17597,6 @@ else
fi
- if test "$have_pthread" = "yes"; then
- HAVE_PTHREAD_TRUE=
- HAVE_PTHREAD_FALSE='#'
-else
- HAVE_PTHREAD_TRUE='#'
- HAVE_PTHREAD_FALSE=
-fi
-
-
# Check whether --enable-fixed-path was given.
if test "${enable_fixed_path+set}" = set; then :
@@ -20628,7 +20584,7 @@ ENABLED_LANGUAGES=$enabled_languages
#
# Provide information about the build.
#
-BUILD_REVISION="2c490cd"
+BUILD_REVISION="f06220b"
cat >>confdefs.h <<_ACEOF
@@ -20637,7 +20593,7 @@ _ACEOF
BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
-BUILD_FILEVERSION="${BUILD_FILEVERSION}11337"
+BUILD_FILEVERSION="${BUILD_FILEVERSION}61538"
# Check whether --enable-build-timestamp was given.
@@ -22362,6 +22318,8 @@ ac_config_files="$ac_config_files src/gpgme-config"
ac_config_files="$ac_config_files lang/cpp/Makefile lang/cpp/src/Makefile"
+ac_config_files="$ac_config_files lang/cpp/src/GpgmeppConfig-w32.cmake.in"
+
ac_config_files="$ac_config_files lang/cpp/src/GpgmeppConfig.cmake.in"
ac_config_files="$ac_config_files lang/cpp/src/GpgmeppConfigVersion.cmake"
@@ -22370,6 +22328,8 @@ ac_config_files="$ac_config_files lang/cpp/src/gpgmepp_version.h"
ac_config_files="$ac_config_files lang/qt/Makefile lang/qt/src/Makefile"
+ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig-w32.cmake.in"
+
ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig.cmake.in"
ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfigVersion.cmake"
@@ -22386,7 +22346,7 @@ if test -z "$HAVE_DOXYGEN_TRUE"; then :
fi
ac_config_files="$ac_config_files lang/qt/doc/Makefile"
-ac_config_files="$ac_config_files lang/python/Makefile lang/python/pyme/version.py lang/python/tests/Makefile"
+ac_config_files="$ac_config_files lang/python/Makefile lang/python/gpg/version.py lang/python/tests/Makefile"
ac_config_files="$ac_config_files lang/python/setup.py"
@@ -22563,10 +22523,6 @@ if test -z "${BUILD_W32_GLIB_TRUE}" && test -z "${BUILD_W32_GLIB_FALSE}"; then
as_fn_error $? "conditional \"BUILD_W32_GLIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_PTHREAD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then
as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22992,7 +22948,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.7.1, which was
+This file was extended by gpgme $as_me 1.8.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23058,7 +23014,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.7.1
+gpgme config.status 1.8.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -23665,11 +23621,13 @@ do
"src/gpgme-config") CONFIG_FILES="$CONFIG_FILES src/gpgme-config" ;;
"lang/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES lang/cpp/Makefile" ;;
"lang/cpp/src/Makefile") CONFIG_FILES="$CONFIG_FILES lang/cpp/src/Makefile" ;;
+ "lang/cpp/src/GpgmeppConfig-w32.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/cpp/src/GpgmeppConfig-w32.cmake.in" ;;
"lang/cpp/src/GpgmeppConfig.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/cpp/src/GpgmeppConfig.cmake.in" ;;
"lang/cpp/src/GpgmeppConfigVersion.cmake") CONFIG_FILES="$CONFIG_FILES lang/cpp/src/GpgmeppConfigVersion.cmake" ;;
"lang/cpp/src/gpgmepp_version.h") CONFIG_FILES="$CONFIG_FILES lang/cpp/src/gpgmepp_version.h" ;;
"lang/qt/Makefile") CONFIG_FILES="$CONFIG_FILES lang/qt/Makefile" ;;
"lang/qt/src/Makefile") CONFIG_FILES="$CONFIG_FILES lang/qt/src/Makefile" ;;
+ "lang/qt/src/QGpgmeConfig-w32.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfig-w32.cmake.in" ;;
"lang/qt/src/QGpgmeConfig.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfig.cmake.in" ;;
"lang/qt/src/QGpgmeConfigVersion.cmake") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfigVersion.cmake" ;;
"lang/qt/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lang/qt/tests/Makefile" ;;
@@ -23680,7 +23638,7 @@ do
"lang/qt/doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES lang/qt/doc/Doxyfile" ;;
"lang/qt/doc/Makefile") CONFIG_FILES="$CONFIG_FILES lang/qt/doc/Makefile" ;;
"lang/python/Makefile") CONFIG_FILES="$CONFIG_FILES lang/python/Makefile" ;;
- "lang/python/pyme/version.py") CONFIG_FILES="$CONFIG_FILES lang/python/pyme/version.py" ;;
+ "lang/python/gpg/version.py") CONFIG_FILES="$CONFIG_FILES lang/python/gpg/version.py" ;;
"lang/python/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lang/python/tests/Makefile" ;;
"lang/python/setup.py") CONFIG_FILES="$CONFIG_FILES lang/python/setup.py" ;;
@@ -24415,7 +24373,7 @@ $as_echo X"$file" |
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# can be downloaded from https://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25368,12 +25326,11 @@ fi
echo "
GPGME v${VERSION} has been configured as follows:
- Revision: 2c490cd (11337)
+ Revision: f06220b (61538)
Platform: $host
UI Server: $uiserver
FD Passing: $use_descriptor_passing
- GPGME Pthread: $have_pthread
Language bindings: ${enabled_languages_v:-$enabled_languages}
"
diff --git a/configure.ac b/configure.ac
index 6580b7c..0a67b48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
# (Process this file with autoconf to produce a configure script.)
AC_PREREQ(2.59)
@@ -28,8 +28,8 @@ min_automake_version="1.14"
# commit and push so that the git magic is able to work. See below
# for the LT versions.
m4_define(mym4_version_major, [1])
-m4_define(mym4_version_minor, [7])
-m4_define(mym4_version_micro, [1])
+m4_define(mym4_version_minor, [8])
+m4_define(mym4_version_micro, [0])
# Below is m4 magic to extract and compute the revision number, the
# decimalized short revision number, a beta version string, and a flag
@@ -55,23 +55,26 @@ AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org])
# (Interfaces added: AGE++)
# (Interfaces removed/changed: AGE=0)
#
-LIBGPGME_LT_CURRENT=27
-LIBGPGME_LT_AGE=16
+LIBGPGME_LT_CURRENT=28
+LIBGPGME_LT_AGE=17
LIBGPGME_LT_REVISION=0
-LIBGPGMEPP_LT_CURRENT=8
-LIBGPGMEPP_LT_AGE=2
+# 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=9
+LIBGPGMEPP_LT_AGE=3
LIBGPGMEPP_LT_REVISION=0
-LIBQGPGME_LT_CURRENT=7
-LIBQGPGME_LT_AGE=0
+LIBQGPGME_LT_CURRENT=8
+LIBQGPGME_LT_AGE=1
LIBQGPGME_LT_REVISION=0
# If the API is changed in an incompatible way: increment the next counter.
GPGME_CONFIG_API_VERSION=1
##############################################
-NEED_GPG_ERROR_VERSION=1.11
+NEED_GPG_ERROR_VERSION=1.17
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.0.2
@@ -79,6 +82,10 @@ NEED_LIBASSUAN_VERSION=2.0.2
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
+VERSION_MAJOR=mym4_version_major
+VERSION_MINOR=mym4_version_minor
+VERSION_MICRO=mym4_version_micro
+
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/gpgme.h.in)
@@ -119,6 +126,9 @@ AC_SUBST(LIBQGPGME_LT_REVISION)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
+AC_SUBST(VERSION_MAJOR)
+AC_SUBST(VERSION_MINOR)
+AC_SUBST(VERSION_MICRO)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
@@ -204,11 +214,6 @@ case "${host}" in
;;
*)
- AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
- if test "$have_pthread" = yes; then
- AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
- fi
-
# XXX: Probably use exec-prefix here?
# GPG_DEFAULT='/usr/bin/gpg'
# GPGSM_DEFAULT='/usr/bin/gpgsm'
@@ -250,8 +255,6 @@ AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
-AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
-
AC_ARG_ENABLE([fixed-path],
AC_HELP_STRING([--enable-fixed-path=PATH],
@@ -873,10 +876,12 @@ AC_CONFIG_FILES(Makefile src/Makefile
src/gpgme.h)
AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
+AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
+AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
AC_CONFIG_FILES(lang/qt/tests/Makefile)
@@ -885,7 +890,7 @@ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
AC_CONFIG_FILES(lang/qt/doc/Makefile)
AC_CONFIG_FILES([lang/python/Makefile
- lang/python/pyme/version.py
+ lang/python/gpg/version.py
lang/python/tests/Makefile])
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
AC_OUTPUT
@@ -898,7 +903,6 @@ echo "
UI Server: $uiserver
FD Passing: $use_descriptor_passing
- GPGME Pthread: $have_pthread
Language bindings: ${enabled_languages_v:-$enabled_languages}
"
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 90fa2b8..1fd44b6 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -339,6 +339,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/doc/defsincdate b/doc/defsincdate
index 0df13bf..33f93d6 100644
--- a/doc/defsincdate
+++ b/doc/defsincdate
@@ -1 +1 @@
-1440576360
+1479299220
diff --git a/doc/gpgme.info b/doc/gpgme.info
index 8df2a71..801e07a 100644
--- a/doc/gpgme.info
+++ b/doc/gpgme.info
@@ -19,8 +19,8 @@ END-INFO-DIR-ENTRY
This file documents the GPGME library.
- This is Edition 1.7.1, last updated 26 August 2015, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.7.1.
+ This is Edition 1.8.0-beta50, last updated 16 November 2016, of ‘The
+‘GnuPG Made Easy’ Reference Manual’, for Version 1.8.0-beta50.
Copyright © 2002–2008, 2010, 2012–2016 g10 Code GmbH.
@@ -37,128 +37,130 @@ Public License for more details.

Indirect:
-gpgme.info-1: 1670
-gpgme.info-2: 305786
+gpgme.info-1: 1686
+gpgme.info-2: 314031

Tag Table:
(Indirect)
-Node: Top1670
-Node: Introduction9061
-Node: Getting Started9851
-Node: Features11312
-Node: Overview12624
-Node: Preparation13733
-Node: Header14730
-Node: Building the Source15477
-Node: Largefile Support (LFS)17887
-Node: Using Automake23301
-Node: Using Libtool25747
-Node: Library Version Check26109
-Node: Signal Handling32121
-Node: Multi Threading33391
-Ref: Multi Threading-Footnote-135625
-Node: Protocols and Engines36048
-Node: Engine Version Check38693
-Node: Engine Information41110
-Node: Engine Configuration44970
-Node: OpenPGP46254
-Node: Cryptographic Message Syntax46594
-Node: Assuan46907
-Node: Algorithms47281
-Ref: Algorithms-Footnote-147760
-Node: Public Key Algorithms47888
-Node: Hash Algorithms50375
-Node: Error Handling51565
-Node: Error Values53439
-Node: Error Sources58642
-Node: Error Codes61082
-Node: Error Strings65873
-Node: Exchanging Data67680
-Node: Creating Data Buffers69546
-Node: Memory Based Data Buffers70062
-Node: File Based Data Buffers73495
-Node: Callback Based Data Buffers75697
-Node: Destroying Data Buffers79888
-Node: Manipulating Data Buffers81376
-Node: Data Buffer I/O Operations81868
-Node: Data Buffer Meta-Data84241
-Node: Data Buffer Convenience88607
-Node: Contexts90584
-Node: Creating Contexts91770
-Node: Destroying Contexts92617
-Node: Result Management92956
-Node: Context Attributes94385
-Node: Protocol Selection95353
-Node: Crypto Engine96385
-Node: ASCII Armor98228
-Node: Text Mode98852
-Node: Offline Mode99786
-Node: Pinentry Mode100858
-Node: Included Certificates102543
-Node: Key Listing Mode103965
-Node: Passphrase Callback108057
-Node: Progress Meter Callback111442
-Node: Status Message Callback113427
-Node: Locale116045
-Node: Key Management117604
-Node: Key objects118832
-Node: Listing Keys129832
-Node: Information About Keys137278
-Node: Manipulating Keys138586
-Node: Generating Keys139156
-Node: Signing Keys154630
-Node: Exporting Keys158228
-Node: Importing Keys164921
-Ref: Importing Keys-Footnote-1171826
-Node: Deleting Keys171954
-Node: Changing Passphrases173399
-Node: Changing TOFU Data174688
-Node: Advanced Key Editing176739
-Node: Trust Item Management179388
-Node: Listing Trust Items180424
-Node: Manipulating Trust Items182785
-Node: Crypto Operations183428
-Node: Decrypt184692
-Node: Verify188562
-Node: Decrypt and Verify200522
-Node: Sign203352
-Node: Selecting Signers203916
-Node: Creating a Signature205303
-Node: Signature Notation Data210073
-Node: Encrypt212301
-Node: Encrypting a Plaintext212657
-Node: Miscellaneous219620
-Node: Running other Programs219966
-Node: Using the Assuan protocol222042
-Node: Run Control224735
-Node: Waiting For Completion225479
-Node: Using External Event Loops227597
-Node: I/O Callback Interface229569
-Node: Registering I/O Callbacks234807
-Node: I/O Callback Example236845
-Node: I/O Callback Example GTK+243470
-Node: I/O Callback Example GDK245259
-Node: I/O Callback Example Qt246901
-Node: Cancellation249189
-Node: UI Server Protocol251453
-Ref: UI Server Protocol-Footnote-1252888
-Node: UI Server Encrypt253007
-Node: UI Server Sign258152
-Node: UI Server Decrypt260505
-Node: UI Server Verify261971
-Node: UI Server Set Input Files265543
-Node: UI Server Sign/Encrypt Files266613
-Node: UI Server Verify/Decrypt Files268421
-Node: UI Server Import/Export Keys270297
-Node: UI Server Checksum Files271359
-Node: Miscellaneous UI Server Commands273575
-Ref: command SENDER275506
-Node: Debugging277208
-Node: Deprecated Functions278957
-Node: Library Copying305786
-Node: Copying334002
-Node: Concept Index371748
-Node: Function and Data Index386308
+Node: Top1686
+Node: Introduction9293
+Node: Getting Started10083
+Node: Features11544
+Node: Overview12856
+Node: Preparation13965
+Node: Header14962
+Node: Building the Source15709
+Node: Largefile Support (LFS)17853
+Node: Using Automake23267
+Node: Using Libtool25820
+Node: Library Version Check26182
+Node: Signal Handling32194
+Node: Multi-Threading33464
+Ref: Multi-Threading-Footnote-134880
+Node: Protocols and Engines35303
+Node: Engine Version Check37948
+Node: Engine Information40365
+Node: Engine Configuration44225
+Node: OpenPGP45509
+Node: Cryptographic Message Syntax45849
+Node: Assuan46162
+Node: Algorithms46536
+Ref: Algorithms-Footnote-147015
+Node: Public Key Algorithms47143
+Node: Hash Algorithms49630
+Node: Error Handling50820
+Node: Error Values52694
+Node: Error Sources57897
+Node: Error Codes60337
+Node: Error Strings65128
+Node: Exchanging Data66935
+Node: Creating Data Buffers68801
+Node: Memory Based Data Buffers69317
+Node: File Based Data Buffers72750
+Node: Callback Based Data Buffers74952
+Node: Destroying Data Buffers79143
+Node: Manipulating Data Buffers80631
+Node: Data Buffer I/O Operations81123
+Node: Data Buffer Meta-Data83496
+Node: Data Buffer Convenience87862
+Node: Contexts89839
+Node: Creating Contexts91025
+Node: Destroying Contexts91872
+Node: Result Management92211
+Node: Context Attributes93754
+Node: Protocol Selection94791
+Node: Crypto Engine95823
+Node: Setting the Sender97673
+Node: ASCII Armor99148
+Node: Text Mode99777
+Node: Offline Mode100711
+Node: Pinentry Mode101783
+Node: Included Certificates103468
+Node: Key Listing Mode104890
+Node: Passphrase Callback108982
+Node: Progress Meter Callback112369
+Node: Status Message Callback114354
+Node: Locale118175
+Node: Key Management119734
+Node: Key objects120962
+Node: Listing Keys131962
+Node: Information About Keys139408
+Node: Manipulating Keys140716
+Node: Generating Keys141286
+Node: Signing Keys156760
+Node: Exporting Keys160358
+Node: Importing Keys167051
+Ref: Importing Keys-Footnote-1173956
+Node: Deleting Keys174084
+Node: Changing Passphrases175529
+Node: Changing TOFU Data176818
+Node: Advanced Key Editing178869
+Node: Trust Item Management181518
+Node: Listing Trust Items182554
+Node: Manipulating Trust Items184915
+Node: Crypto Operations185558
+Node: Decrypt186822
+Node: Verify191524
+Node: Decrypt and Verify203484
+Node: Sign206320
+Node: Selecting Signers206884
+Node: Creating a Signature208271
+Node: Signature Notation Data213041
+Node: Encrypt215269
+Node: Encrypting a Plaintext215625
+Node: Miscellaneous222588
+Node: Running other Programs223000
+Node: Using the Assuan protocol225076
+Node: Checking for updates227798
+Node: Run Control232556
+Node: Waiting For Completion233300
+Node: Using External Event Loops235418
+Node: I/O Callback Interface237390
+Node: Registering I/O Callbacks242628
+Node: I/O Callback Example244666
+Node: I/O Callback Example GTK+251291
+Node: I/O Callback Example GDK253080
+Node: I/O Callback Example Qt254722
+Node: Cancellation257010
+Node: UI Server Protocol259280
+Ref: UI Server Protocol-Footnote-1260715
+Node: UI Server Encrypt260834
+Node: UI Server Sign266192
+Node: UI Server Decrypt268545
+Node: UI Server Verify270200
+Node: UI Server Set Input Files273772
+Node: UI Server Sign/Encrypt Files274842
+Node: UI Server Verify/Decrypt Files276650
+Node: UI Server Import/Export Keys278526
+Node: UI Server Checksum Files279588
+Node: Miscellaneous UI Server Commands281804
+Ref: command SENDER283735
+Node: Debugging285437
+Node: Deprecated Functions287186
+Node: Library Copying314031
+Node: Copying342247
+Node: Concept Index379997
+Node: Function and Data Index394776

End Tag Table
diff --git a/doc/gpgme.info-1 b/doc/gpgme.info-1
index f7503b3..bc822a4 100644
--- a/doc/gpgme.info-1
+++ b/doc/gpgme.info-1
@@ -19,8 +19,8 @@ END-INFO-DIR-ENTRY
This file documents the GPGME library.
- This is Edition 1.7.1, last updated 26 August 2015, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.7.1.
+ This is Edition 1.8.0-beta50, last updated 16 November 2016, of ‘The
+‘GnuPG Made Easy’ Reference Manual’, for Version 1.8.0-beta50.
Copyright © 2002–2008, 2010, 2012–2016 g10 Code GmbH.
@@ -41,8 +41,9 @@ File: gpgme.info, Node: Top, Next: Introduction, Up: (dir)
Main Menu
*********
-This is Edition 1.7.1, last updated 26 August 2015, of ‘The ‘GnuPG Made
-Easy’ Reference Manual’, for Version 1.7.1 of the GPGME library.
+This is Edition 1.8.0-beta50, last updated 16 November 2016, of ‘The
+‘GnuPG Made Easy’ Reference Manual’, for Version 1.8.0-beta50 of the
+GPGME library.
* Menu:
@@ -87,7 +88,7 @@ Preparation
* Using Libtool:: Avoiding compiler options entirely.
* Library Version Check:: Getting and verifying the library version.
* Signal Handling:: How GPGME affects signal handling.
-* Multi Threading:: How GPGME can be used in an MT environment.
+* Multi-Threading:: How GPGME can be used in an MT environment.
Protocols and Engines
@@ -143,6 +144,7 @@ Context Attributes
* Protocol Selection:: Selecting the protocol used by a context.
* Crypto Engine:: Configuring the crypto engine.
+* Setting the Sender:: How to tell the engine the sender.
* ASCII Armor:: Requesting ASCII armored output.
* Text Mode:: Choosing canonical text mode.
* Offline Mode:: Choosing offline mode.
@@ -193,7 +195,9 @@ Encrypt
Miscellaneous
-* Running other Programs:: Running other Programs
+* Running other Programs:: Running other Programs.
+* Using the Assuan protocol:: Using the Assuan protocol.
+* Checking for updates:: How to check for software updates.
Run Control
@@ -342,7 +346,7 @@ verified.
* Using Libtool:: Avoiding compiler options entirely.
* Library Version Check:: Getting and verifying the library version.
* Signal Handling:: How GPGME affects signal handling.
-* Multi Threading:: How GPGME can be used in an MT environment.
+* Multi-Threading:: How GPGME can be used in an MT environment.

File: gpgme.info, Node: Header, Next: Building the Source, Up: Preparation
@@ -406,11 +410,6 @@ specifying both options to ‘gpgme-config’:
gcc -o foo foo.c `gpgme-config --cflags --libs`
- If you want to link to one of the thread-safe versions of GPGME, you
-must specify the ‘--thread’ option before any other option to select the
-thread package you want to link with. Supported thread packages are
-‘--thread=pth’ and ‘--thread=pthread’.
-
If you need to detect the installed language bindings you can use
list them using:
@@ -551,7 +550,9 @@ to Automake that does all the work for you.
‘AM_PATH_GPGME_PTHREAD’ checks for the version of GPGME that can be
used with the native pthread implementation, and defines
- ‘GPGME_PTHREAD_CFLAGS’ and ‘GPGME_PTHREAD_LIBS’.
+ ‘GPGME_PTHREAD_CFLAGS’ and ‘GPGME_PTHREAD_LIBS’. Since version
+ 1.8.0 this is no longer required to GPGME_PTHREAD as GPGME itself
+ is thread safe.
This macro searches for ‘gpgme-config’ along the PATH. If you are
cross-compiling, it is useful to set the environment variable
@@ -706,7 +707,7 @@ be thread safe. The conditional on LC_MESSAGES is only necessary for
portability to W32 systems.

-File: gpgme.info, Node: Signal Handling, Next: Multi Threading, Prev: Library Version Check, Up: Preparation
+File: gpgme.info, Node: Signal Handling, Next: Multi-Threading, Prev: Library Version Check, Up: Preparation
2.7 Signal Handling
===================
@@ -731,28 +732,14 @@ install a signal action for ‘SIGPIPE’, you must make sure you do this
either before ‘gpgme_check_version’ is called or afterwards.

-File: gpgme.info, Node: Multi Threading, Prev: Signal Handling, Up: Preparation
+File: gpgme.info, Node: Multi-Threading, Prev: Signal Handling, Up: Preparation
-2.8 Multi Threading
+2.8 Multi-Threading
===================
-The GPGME library is not entirely thread-safe, but it can still be used
-in a multi-threaded environment if some care is taken. If the following
-requirements are met, there should be no race conditions to worry about:
-
- • GPGME supports the thread libraries pthread and GNU Pth. The
- support for this has to be enabled at compile time. GPGME will
- automatically detect the location in which the thread libraries are
- installed and activate the support for them at build time.
-
- Support for other thread libraries is very easy to add. Please
- contact us if you have the need.
-
- • If you want to use GPGME with threads, you must link to the right
- version of the library. The name of the right library is
- ‘libgpgme-’ followed by the name of the thread package you use.
- For example, if you use GNU Pth, the right name is ‘libgpgme-pth’.
- Use the Automake macros or ‘gpgme-config’ program for simplicity.
+The GPGME library is mostly thread-safe, and can be used in a
+multi-threaded environment but there are some requirements for
+multi-threaded use:
• The function ‘gpgme_check_version’ must be called before any other
function in the library, because it initializes the thread support
@@ -2166,10 +2153,11 @@ File: gpgme.info, Node: Result Management, Next: Context Attributes, Prev: De
The detailed result of an operation is returned in operation-specific
structures such as ‘gpgme_decrypt_result_t’. The corresponding
retrieval functions such as ‘gpgme_op_decrypt_result’ provide static
-access to the results after an operation completes. The following
-interfaces make it possible to detach a result structure from its
-associated context and give it a lifetime beyond that of the current
-operation or context.
+access to the results after an operation completes. Those structures
+shall be considered read-only and an application must not allocate such
+a structure on its own. The following interfaces make it possible to
+detach a result structure from its associated context and give it a
+lifetime beyond that of the current operation or context.
-- Function: void gpgme_result_ref (void *RESULT)
The function ‘gpgme_result_ref’ acquires an additional reference
@@ -2198,6 +2186,7 @@ File: gpgme.info, Node: Context Attributes, Next: Key Management, Prev: Resul
* Protocol Selection:: Selecting the protocol used by a context.
* Crypto Engine:: Configuring the crypto engine.
+* Setting the Sender:: How to tell the engine the sender.
* ASCII Armor:: Requesting ASCII armored output.
* Text Mode:: Choosing canonical text mode.
* Offline Mode:: Choosing offline mode.
@@ -2235,7 +2224,7 @@ File: gpgme.info, Node: Protocol Selection, Next: Crypto Engine, Up: Context
use with the context CTX.

-File: gpgme.info, Node: Crypto Engine, Next: ASCII Armor, Prev: Protocol Selection, Up: Context Attributes
+File: gpgme.info, Node: Crypto Engine, Next: Setting the Sender, Prev: Protocol Selection, Up: Context Attributes
7.4.2 Crypto Engine
-------------------
@@ -2279,9 +2268,42 @@ Configuration::.
successful, or an eror code on failure.

-File: gpgme.info, Node: ASCII Armor, Next: Text Mode, Prev: Crypto Engine, Up: Context Attributes
+File: gpgme.info, Node: Setting the Sender, Next: ASCII Armor, Prev: Crypto Engine, Up: Context Attributes
+
+7.4.3 How to tell the engine the sender.
+----------------------------------------
+
+Some engines can make use of the sender’s address, for example to figure
+out the best user id in certain trust models. For verification and
+signing of mails, it is thus suggested to let the engine know the sender
+("From:") address. GPGME provides two functions to accomplish that.
+Note that the esoteric use of multiple "From:" addresses is not
+supported.
+
+ -- Function: gpgme_error_t gpgme_set_sender (gpgme_ctx_t CTX,
+ int ADDRESS)
+
+ The function ‘gpgme_set_sender’ specifies the sender address for
+ use in sign and verify operations. ADDRESS is expected to be the
+ “addr-spec” part of an address but my also be a complete mailbox
+ address, in which case this function extracts the “addr-spec” from
+ it. Using ‘NULL’ for ADDRESS clears the sender address.
+
+ The function returns 0 on success or an error code on failure. The
+ most likely failure is that no valid “addr-spec” was found in
+ ADDRESS.
+
+ -- Function: const char * gpgme_get_sender (gpgme_ctx_t CTX)
+
+ The function ‘gpgme_get_sender’ returns the current sender address
+ from the context, or NULL if none was set. The returned value is
+ valid as long as the CTX is valid and ‘gpgme_set_sender’ has not
+ been called again.
+
+
+File: gpgme.info, Node: ASCII Armor, Next: Text Mode, Prev: Setting the Sender, Up: Context Attributes
-7.4.3 ASCII Armor
+7.4.4 ASCII Armor
-----------------
-- Function: void gpgme_set_armor (gpgme_ctx_t CTX, int YES)
@@ -2298,7 +2320,7 @@ File: gpgme.info, Node: ASCII Armor, Next: Text Mode, Prev: Crypto Engine, U

File: gpgme.info, Node: Text Mode, Next: Offline Mode, Prev: ASCII Armor, Up: Context Attributes
-7.4.4 Text Mode
+7.4.5 Text Mode
---------------
-- Function: void gpgme_set_textmode (gpgme_ctx_t CTX, int YES)
@@ -2322,7 +2344,7 @@ File: gpgme.info, Node: Text Mode, Next: Offline Mode, Prev: ASCII Armor, Up

File: gpgme.info, Node: Offline Mode, Next: Pinentry Mode, Prev: Text Mode, Up: Context Attributes
-7.4.5 Offline Mode
+7.4.6 Offline Mode
------------------
-- Function: void gpgme_set_offline (gpgme_ctx_t CTX, int YES)
@@ -2349,7 +2371,7 @@ File: gpgme.info, Node: Offline Mode, Next: Pinentry Mode, Prev: Text Mode,

File: gpgme.info, Node: Pinentry Mode, Next: Included Certificates, Prev: Offline Mode, Up: Context Attributes
-7.4.6 Pinentry Mode
+7.4.7 Pinentry Mode
-------------------
-- Function: gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t CTX,
@@ -2394,7 +2416,7 @@ File: gpgme.info, Node: Pinentry Mode, Next: Included Certificates, Prev: Off

File: gpgme.info, Node: Included Certificates, Next: Key Listing Mode, Prev: Pinentry Mode, Up: Context Attributes
-7.4.7 Included Certificates
+7.4.8 Included Certificates
---------------------------
-- Function: void gpgme_set_include_certs (gpgme_ctx_t CTX,
@@ -2432,7 +2454,7 @@ File: gpgme.info, Node: Included Certificates, Next: Key Listing Mode, Prev:

File: gpgme.info, Node: Key Listing Mode, Next: Passphrase Callback, Prev: Included Certificates, Up: Context Attributes
-7.4.8 Key Listing Mode
+7.4.9 Key Listing Mode
----------------------
-- Function: gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t CTX,
@@ -2515,8 +2537,8 @@ File: gpgme.info, Node: Key Listing Mode, Next: Passphrase Callback, Prev: In

File: gpgme.info, Node: Passphrase Callback, Next: Progress Meter Callback, Prev: Key Listing Mode, Up: Context Attributes
-7.4.9 Passphrase Callback
--------------------------
+7.4.10 Passphrase Callback
+--------------------------
-- Data type: gpgme_error_t (*gpgme_passphrase_cb_t)(void *HOOK, const
char *UID_HINT, const char *PASSPHRASE_INFO, int PREV_WAS_BAD,
@@ -2584,7 +2606,7 @@ File: gpgme.info, Node: Passphrase Callback, Next: Progress Meter Callback, P

File: gpgme.info, Node: Progress Meter Callback, Next: Status Message Callback, Prev: Passphrase Callback, Up: Context Attributes
-7.4.10 Progress Meter Callback
+7.4.11 Progress Meter Callback
------------------------------
-- Data type: void (*gpgme_progress_cb_t)(void *HOOK, const char *WHAT,
@@ -2626,7 +2648,7 @@ File: gpgme.info, Node: Progress Meter Callback, Next: Status Message Callback

File: gpgme.info, Node: Status Message Callback, Next: Locale, Prev: Progress Meter Callback, Up: Context Attributes
-7.4.11 Status Message Callback
+7.4.12 Status Message Callback
------------------------------
-- Data type: gpgme_error_t (*gpgme_status_cb_t)(void *HOOK, const char
@@ -2679,12 +2701,36 @@ File: gpgme.info, Node: Status Message Callback, Next: Locale, Prev: Progress
("~") will not be removed from the ‘description’ field of the
‘gpgme_tofu_info_t’ object.
+ ‘"export-session-key"’
+ Using a VALUE of "1" specifies that the context should try to
+ export the symmetric session key when decrypting data. By
+ default, or when using an empty string or "0" for VALUE,
+ session keys are not exported.
+
+ ‘"override-session-key"’
+ The string given in VALUE is passed to the GnuPG engine to
+ override the session key for decryption. The format of that
+ session key is specific to GnuPG and can be retrieved during a
+ decrypt operation when the context flag "export-session-key"
+ is enabled. Please be aware that using this feature with
+ GnuPG < 2.1.16 will leak the session key on many platforms via
+ ps(1).
+
This function returns ‘0’ on success.
+ -- Function: const char * gpgme_get_ctx_flag (gpgme_ctx_t CTX,
+ const char *NAME)
+
+ The value of flags settable by ‘gpgme_set_ctx_flag’ can be
+ retrieved by this function. If NAME is unknown the function
+ returns ‘NULL’. For boolean flags an empty string is returned for
+ False and the string "1" is returned for True; either atoi(3) or a
+ test for an empty string can be used to get the boolean value.
+

File: gpgme.info, Node: Locale, Prev: Status Message Callback, Up: Context Attributes
-7.4.12 Locale
+7.4.13 Locale
-------------
A locale setting can be associated with a context. This locale is
@@ -4348,8 +4394,10 @@ File: gpgme.info, Node: Decrypt, Next: Verify, Up: Crypto Operations
This is a pointer to a structure used to store the result of a
‘gpgme_op_decrypt’ operation. After successfully decrypting data,
you can retrieve the pointer to the result with
- ‘gpgme_op_decrypt_result’. The structure contains the following
- members:
+ ‘gpgme_op_decrypt_result’. As with all result structures, it this
+ structure shall be considered read-only and an application must not
+ allocated such a strucure on its own. The structure contains the
+ following members:
‘char *unsupported_algorithm’
If an unsupported algorithm was encountered, this string
@@ -4366,6 +4414,19 @@ File: gpgme.info, Node: Decrypt, Next: Verify, Up: Crypto Operations
This is the filename of the original plaintext message file if
it is known, otherwise this is a null pointer.
+ ‘char *session_key’
+ A textual representation (nul-terminated string) of the
+ session key used in symmetric encryption of the message, if
+ the context has been set to export session keys (see
+ ‘gpgme_set_ctx_flag, "export-session-key"’), and a session key
+ was available for the most recent decryption operation.
+ Otherwise, this is a null pointer.
+
+ You must not try to access this member of the struct unless
+ ‘gpgme_set_ctx_flag (ctx, "export-session-key")’ returns
+ success or ‘gpgme_get_ctx_flag (ctx, "export-session-key")’
+ returns true (non-empty string).
+
-- Function: gpgme_decrypt_result_t gpgme_op_decrypt_result
(gpgme_ctx_t CTX)
The function ‘gpgme_op_decrypt_result’ returns a
@@ -4681,8 +4742,8 @@ File: gpgme.info, Node: Decrypt and Verify, Next: Sign, Prev: Verify, Up: Cr
not be retrieved, and passes through any errors that are reported
by the crypto engine support routines.
- -- Function: gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t CTX,
- gpgme_data_t CIPHER, gpgme_data_t PLAIN)
+ -- Function: gpgme_error_t gpgme_op_decrypt_verify_start
+ (gpgme_ctx_t CTX, gpgme_data_t CIPHER, gpgme_data_t PLAIN)
The function ‘gpgme_op_decrypt_verify_start’ initiates a
‘gpgme_op_decrypt_verify’ operation. It can be completed by
calling ‘gpgme_wait’ on the context. *Note Waiting For
@@ -5083,6 +5144,7 @@ Here are some support functions which are sometimes useful.
* Running other Programs:: Running other Programs
* Using the Assuan protocol:: Using the Assuan protocol
+* Checking for updates:: How to check for software updates

File: gpgme.info, Node: Running other Programs, Next: Using the Assuan protocol, Up: Miscellaneous
@@ -5130,7 +5192,7 @@ GPGME API.
This is the asynchronous variant of ‘gpgme_op_spawn’.

-File: gpgme.info, Node: Using the Assuan protocol, Prev: Running other Programs, Up: Miscellaneous
+File: gpgme.info, Node: Using the Assuan protocol, Next: Checking for updates, Prev: Running other Programs, Up: Miscellaneous
7.8.2 Using the Assuan protocol
-------------------------------
@@ -5194,6 +5256,134 @@ transfer data:
Synchronous variant.

+File: gpgme.info, Node: Checking for updates, Prev: Using the Assuan protocol, Up: Miscellaneous
+
+7.8.3 How to check for software updates
+---------------------------------------
+
+The GnuPG Project operates a server to query the current versions of
+software packages related to GnuPG. GPGME can be used to access this
+online database and check whether a new version of a software package is
+available.
+
+ -- Data type: gpgme_query_swdb_result_t
+ This is a pointer to a structure used to store the result of a
+ ‘gpgme_op_query_swdb’ operation. After success full call to that
+ function, you can retrieve the pointer to the result with
+ ‘gpgme_op_query_swdb_result’. The structure contains the following
+ member:
+
+ ‘name’
+ This is the name of the package.
+
+ ‘iversion’
+ The currently installed version or an empty string. This
+ value is either a copy of the argument given to
+ ‘gpgme_op_query_swdb’ or the version of the installed software
+ as figured out by GPGME or GnuPG.
+
+ ‘created’
+ This gives the date the file with the list of version numbers
+ has originally be created by the GnuPG project.
+
+ ‘retrieved’
+ This gives the date the file was downloaded.
+
+ ‘warning’
+ If this flag is set either an error has occurred or some of
+ the information in this structure are not properly set. For
+ example if the version number of the installed software could
+ not be figured out, the ‘update’ flag may not reflect a
+ required update status.
+
+ ‘update’
+ If this flag is set an update of the software is available.
+
+ ‘urgent’
+ If this flag is set an available update is important.
+
+ ‘noinfo’
+ If this flag is set, no valid information could be retrieved.
+
+ ‘unknown’
+ If this flag is set the given ‘name’ is not known.
+
+ ‘tooold’
+ If this flag is set the available information is not fresh
+ enough.
+
+ ‘error’
+ If this flag is set some other error has occured.
+
+ ‘version’
+ The version string of the latest released version.
+
+ ‘reldate’
+ The release date of the latest released version.
+
+ -- Function: gpgme_error_t gpgme_op_query_swdb (gpgme_ctx_t CTX,
+ const char *NAME, const char *IVERSION, gpgme_data_t RESERVED)
+
+ Query the software version database for software package NAME and
+ check against the installed version given by IVERSION. If IVERSION
+ is given as ‘NULL’ a check is only done if GPGME can figure out the
+ version by itself (for example when using "gpgme" or "gnupg"). If
+ ‘NULL’ is used for NAME the current gpgme version is checked.
+ RESERVED must be set to 0.
+
+ -- Function: gpgme_query_swdb_result_t gpgme_op_query_swdb_result
+ (gpgme_ctx_t CTX)
+
+ The function ‘gpgme_op_query_swdb_result’ returns a
+ ‘gpgme_query_swdb_result_t’ pointer to a structure holding the
+ result of a ‘gpgme_op_query_swdb’ operation. The pointer is only
+ valid if the last operation on the context was a sucessful call to
+ ‘gpgme_op_query_swdb’. If that call failed, the result might be a
+ ‘NULL’ pointer. The returned pointer is only valid until the next
+ operation is started on the context CTX.
+
+Here is an example on how to check whether GnuPG is current:
+
+ #include <gpgme.h>
+
+ int
+ main (void)
+ {
+ gpg_error_t err;
+ gpgme_ctx_t ctx;
+ gpgme_query_swdb_result_t result;
+
+ gpgme_check_version (NULL);
+ err = gpgme_new (&ctx);
+ if (err)
+ fprintf (stderr, "error creating context: %s\n", gpg_strerror (err));
+ else
+ {
+ gpgme_set_protocol (ctx, GPGME_PROTOCOL_GPGCONF);
+
+ err = gpgme_op_query_swdb (ctx, "gnupg", NULL, 0);
+ if (err)
+ fprintf (stderr, "error querying swdb: %s\n", gpg_strerror (err));
+ else
+ {
+ result = gpgme_op_query_swdb_result (ctx);
+ if (!result)
+ fprintf (stderr, "error querying swdb\n");
+ if (!result->warning && !result->update)
+ printf ("GnuPG version %s is current\n",
+ result->iversion);
+ else if (!result->warning && result->update)
+ printf ("GnuPG version %s can be updated to %s\n",
+ result->iversion, result->version);
+ else
+ fprintf (stderr, "error finding the update status\n");
+ }
+ gpgme_release (ctx);
+ }
+ return 0;
+ }
+
+
File: gpgme.info, Node: Run Control, Prev: Miscellaneous, Up: Contexts
7.9 Run Control
@@ -5900,11 +6090,11 @@ I/O occurs in the target context).
this case the state of CTX is not modified).
-- Function: gpgme_ctx_t gpgme_cancel_async (gpgme_ctx_t CTX)
- The function ‘gpgme_cancel’ attempts to cancel a pending operation
- in the context CTX. This can be called by any thread at any time
- after starting an operation on the context, but will not take
- effect immediately. The actual cancellation happens at the next
- time GPGME processes I/O in that context.
+ The function ‘gpgme_cancel_async’ attempts to cancel a pending
+ operation in the context CTX. This can be called by any thread at
+ any time after starting an operation on the context, but will not
+ take effect immediately. The actual cancellation happens at the
+ next time GPGME processes I/O in that context.
The function returns an error code if the cancellation failed (in
this case the state of CTX is not modified).
@@ -6051,7 +6241,21 @@ selected keys, the server MAY implement the command:
Here is an example of a complete encryption sequence; client lines are
indicated by a C:, server responses by C::
- C: S: C: S: C: S: C: S: S: C: S: C: S: C: S:
+ C: RESET
+ S: OK
+ C: RECIPIENT foo@example.net
+ S: OK
+ C: RECIPIENT bar@example.com
+ S: OK
+ C: PREP_ENCRYPT
+ S: S PROTOCOL OpenPGP
+ S: OK
+ C: INPUT FD=17
+ S: OK
+ C: OUTPUT FD=18
+ S: OK
+ C: ENCRYPT
+ S: OK

File: gpgme.info, Node: UI Server Sign, Next: UI Server Decrypt, Prev: UI Server Encrypt, Up: UI Server Protocol
@@ -6131,11 +6335,14 @@ and output file descriptors:
The decryption is started with the command:
-- Command: DECRYPT --protocol=NAME [--no-verify]
+ [--export-session-key]
NAME is the encryption protocol used for the message. For a
description of the allowed protocols see the ‘ENCRYPT’ command.
This argument is mandatory. If the option ‘--no-verify’ is given,
the server should not try to verify a signature, in case the input
- data is an OpenPGP combined message.
+ data is an OpenPGP combined message. If the option
+ ‘--export-session-key’ is given and the underlying engine knows how
+ to export the session key, it will appear on a status line

File: gpgme.info, Node: UI Server Verify, Next: UI Server Set Input Files, Prev: UI Server Decrypt, Up: UI Server Protocol
diff --git a/doc/gpgme.info-2 b/doc/gpgme.info-2
index 23f874c..7c32470 100644
--- a/doc/gpgme.info-2
+++ b/doc/gpgme.info-2
@@ -19,8 +19,8 @@ END-INFO-DIR-ENTRY
This file documents the GPGME library.
- This is Edition 1.7.1, last updated 26 August 2015, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.7.1.
+ This is Edition 1.8.0-beta50, last updated 16 November 2016, of ‘The
+‘GnuPG Made Easy’ Reference Manual’, for Version 1.8.0-beta50.
Copyright © 2002–2008, 2010, 2012–2016 g10 Code GmbH.
@@ -567,7 +567,7 @@ GNU General Public License
Version 3, 29 June 2007
- Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@@ -1243,7 +1243,7 @@ state the exclusion of warranty; and each file should have at least the
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@@ -1264,14 +1264,14 @@ use an “about box”.
You should also get your employer (if you work as a programmer) or
school, if any, to sign a “copyright disclaimer” for the program, if
necessary. For more information on this, and how to apply and follow
-the GNU GPL, see <http://www.gnu.org/licenses/>.
+the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the
GNU Lesser General Public License instead of this License. But first,
-please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
+please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.

File: gpgme.info, Node: Concept Index, Next: Function and Data Index, Prev: Copying, Up: Top
@@ -1318,6 +1318,7 @@ Concept Index
* context, pinentry mode: Pinentry Mode. (line 6)
* context, result of operation: Result Management. (line 6)
* context, selecting protocol: Protocol Selection. (line 6)
+* context, sender: Setting the Sender. (line 6)
* context, text mode: Text Mode. (line 6)
* crypto backend: Protocols and Engines. (line 6)
* crypto engine: Protocols and Engines. (line 6)
@@ -1380,6 +1381,7 @@ Concept Index
* error values, printing of: Error Strings. (line 6)
* event loop, external: Using External Event Loops.
(line 6)
+* From:: Setting the Sender. (line 6)
* GDK, using GPGME with: I/O Callback Example GDK.
(line 6)
* GnuPG: OpenPGP. (line 6)
@@ -1425,7 +1427,7 @@ Concept Index
* locale, default: Locale. (line 6)
* locale, of a context: Locale. (line 6)
* message digest algorithms: Hash Algorithms. (line 6)
-* multi-threading: Multi Threading. (line 6)
+* multi-threading: Multi-Threading. (line 6)
* notation data: Verify. (line 6)
* notation data <1>: Signature Notation Data.
(line 6)
@@ -1452,6 +1454,7 @@ Concept Index
* run control: Run Control. (line 6)
* S/MIME: Cryptographic Message Syntax.
(line 6)
+* sender: Setting the Sender. (line 6)
* sign: Sign. (line 6)
* signal handling: Signal Handling. (line 6)
* signals: Signal Handling. (line 6)
@@ -1466,7 +1469,7 @@ Concept Index
* status message callback: Status Message Callback.
(line 6)
* text mode: Text Mode. (line 6)
-* thread-safeness: Multi Threading. (line 6)
+* thread-safeness: Multi-Threading. (line 6)
* trust item: Trust Item Management. (line 6)
* trust item list: Listing Trust Items. (line 6)
* trust item, manipulation: Manipulating Trust Items.
@@ -1640,6 +1643,8 @@ Function and Data Index
(line 25)
* gpgme_genkey_result_t: Generating Keys. (line 295)
* gpgme_get_armor: ASCII Armor. (line 13)
+* gpgme_get_ctx_flag: Status Message Callback.
+ (line 73)
* gpgme_get_dirinfo: Engine Version Check.
(line 6)
* gpgme_get_engine_info: Engine Information. (line 46)
@@ -1657,6 +1662,7 @@ Function and Data Index
* gpgme_get_protocol: Protocol Selection. (line 21)
* gpgme_get_protocol_name: Protocols and Engines.
(line 51)
+* gpgme_get_sender: Setting the Sender. (line 26)
* gpgme_get_sig_key: Deprecated Functions.
(line 626)
* gpgme_get_sig_status: Deprecated Functions.
@@ -1711,10 +1717,10 @@ Function and Data Index
* gpgme_op_createsubkey: Generating Keys. (line 109)
* gpgme_op_createsubkey_start: Generating Keys. (line 151)
* gpgme_op_decrypt: Decrypt. (line 6)
-* gpgme_op_decrypt_result: Decrypt. (line 76)
+* gpgme_op_decrypt_result: Decrypt. (line 91)
* gpgme_op_decrypt_start: Decrypt. (line 20)
* gpgme_op_decrypt_verify: Decrypt and Verify. (line 6)
-* gpgme_op_decrypt_verify <1>: Decrypt and Verify. (line 30)
+* gpgme_op_decrypt_verify_start: Decrypt and Verify. (line 30)
* gpgme_op_delete: Deleting Keys. (line 6)
* gpgme_op_delete_start: Deleting Keys. (line 20)
* gpgme_op_edit: Deprecated Functions.
@@ -1762,6 +1768,10 @@ Function and Data Index
(line 6)
* gpgme_op_passwd_start: Changing Passphrases.
(line 19)
+* gpgme_op_query_swdb: Checking for updates.
+ (line 66)
+* gpgme_op_query_swdb_result: Checking for updates.
+ (line 76)
* gpgme_op_revuid: Generating Keys. (line 192)
* gpgme_op_revuid_start: Generating Keys. (line 218)
* gpgme_op_sign: Creating a Signature.
@@ -1795,12 +1805,14 @@ Function and Data Index
(line 59)
* gpgme_pubkey_algo_t: Public Key Algorithms.
(line 10)
+* gpgme_query_swdb_result_t: Checking for updates.
+ (line 11)
* gpgme_recipient_t: Decrypt. (line 30)
* gpgme_register_io_cb_t: I/O Callback Interface.
(line 23)
* gpgme_release: Destroying Contexts. (line 6)
-* gpgme_result_ref: Result Management. (line 14)
-* gpgme_result_unref: Result Management. (line 20)
+* gpgme_result_ref: Result Management. (line 15)
+* gpgme_result_unref: Result Management. (line 21)
* gpgme_set_armor: ASCII Armor. (line 6)
* gpgme_set_ctx_flag: Status Message Callback.
(line 37)
@@ -1820,6 +1832,7 @@ Function and Data Index
* gpgme_set_progress_cb: Progress Meter Callback.
(line 16)
* gpgme_set_protocol: Protocol Selection. (line 6)
+* gpgme_set_sender: Setting the Sender. (line 13)
* gpgme_set_status_cb: Status Message Callback.
(line 17)
* gpgme_set_textmode: Text Mode. (line 6)
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index cc59888..32e0861 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -31,11 +31,11 @@ General Public License for more details.
@end copying
@c Macros used by the description of the UI server protocol
-@macro clnt
- @sc{c:} @c
+@macro clnt{string}
+ @sc{c:} \string\
@end macro
-@macro srvr
- @sc{s:} @c
+@macro srvr{string}
+ @sc{s:} \string\
@end macro
@@ -130,7 +130,7 @@ Preparation
* Using Libtool:: Avoiding compiler options entirely.
* Library Version Check:: Getting and verifying the library version.
* Signal Handling:: How @acronym{GPGME} affects signal handling.
-* Multi Threading:: How @acronym{GPGME} can be used in an MT environment.
+* Multi-Threading:: How @acronym{GPGME} can be used in an MT environment.
Protocols and Engines
@@ -186,6 +186,7 @@ Context Attributes
* Protocol Selection:: Selecting the protocol used by a context.
* Crypto Engine:: Configuring the crypto engine.
+* Setting the Sender:: How to tell the engine the sender.
* ASCII Armor:: Requesting @acronym{ASCII} armored output.
* Text Mode:: Choosing canonical text mode.
* Offline Mode:: Choosing offline mode.
@@ -236,7 +237,9 @@ Encrypt
Miscellaneous
-* Running other Programs:: Running other Programs
+* Running other Programs:: Running other Programs.
+* Using the Assuan protocol:: Using the Assuan protocol.
+* Checking for updates:: How to check for software updates.
Run Control
@@ -379,7 +382,7 @@ of the library are verified.
* Using Libtool:: Avoiding compiler options entirely.
* Library Version Check:: Getting and verifying the library version.
* Signal Handling:: How @acronym{GPGME} affects signal handling.
-* Multi Threading:: How @acronym{GPGME} can be used in an MT environment.
+* Multi-Threading:: How @acronym{GPGME} can be used in an MT environment.
@end menu
@@ -455,12 +458,6 @@ specifying both options to @command{gpgme-config}:
gcc -o foo foo.c `gpgme-config --cflags --libs`
@end example
-If you want to link to one of the thread-safe versions of
-@acronym{GPGME}, you must specify the @option{--thread} option before
-any other option to select the thread package you want to link with.
-Supported thread packages are @option{--thread=pth} and
-@option{--thread=pthread}.
-
If you need to detect the installed language bindings you can use list
them using:
@@ -611,7 +608,9 @@ that can be used with GNU Pth, and defines @code{GPGME_PTH_CFLAGS} and
@code{AM_PATH_GPGME_PTHREAD} checks for the version of @acronym{GPGME}
that can be used with the native pthread implementation, and defines
-@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}.
+@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since
+version 1.8.0 this is no longer required to GPGME_PTHREAD as
+@acronym{GPGME} itself is thread safe.
This macro searches for @command{gpgme-config} along the PATH. If
you are cross-compiling, it is useful to set the environment variable
@@ -806,37 +805,17 @@ application is multi-threaded, and you install a signal action for
@code{gpgme_check_version} is called or afterwards.
-@node Multi Threading
-@section Multi Threading
+@node Multi-Threading
+@section Multi-Threading
@cindex thread-safeness
@cindex multi-threading
-The @acronym{GPGME} library is not entirely thread-safe, but it can
-still be used in a multi-threaded environment if some care is taken.
-If the following requirements are met, there should be no race
-conditions to worry about:
+The @acronym{GPGME} library is mostly thread-safe, and can be used
+in a multi-threaded environment but there are some requirements
+for multi-threaded use:
@itemize @bullet
@item
-@acronym{GPGME} supports the thread libraries pthread and GNU Pth.
-The support for this has to be enabled at compile time.
-@acronym{GPGME} will automatically detect the location in which the
-thread libraries are installed and activate the support for them at
-build time.
-
-Support for other thread libraries is very easy to add. Please
-contact us if you have the need.
-
-@item
-If you want to use @acronym{GPGME} with threads, you must link to the
-right version of the library. The name of the right library is
-@code{libgpgme-} followed by the name of the thread package you use.
-For example, if you use GNU Pth, the right name is
-@code{libgpgme-pth}. Use the Automake macros or
-@command{gpgme-config} program for simplicity.
-
-
-@item
The function @code{gpgme_check_version} must be called before any
other function in the library, because it initializes the thread
support subsystem in @acronym{GPGME}. To achieve this in
@@ -2334,10 +2313,12 @@ The function @code{gpgme_release} destroys the context with the handle
The detailed result of an operation is returned in operation-specific
structures such as @code{gpgme_decrypt_result_t}. The corresponding
retrieval functions such as @code{gpgme_op_decrypt_result} provide
-static access to the results after an operation completes. The
-following interfaces make it possible to detach a result structure
-from its associated context and give it a lifetime beyond that of the
-current operation or context.
+static access to the results after an operation completes. Those
+structures shall be considered read-only and an application must not
+allocate such a structure on its own. The following interfaces make
+it possible to detach a result structure from its associated context
+and give it a lifetime beyond that of the current operation or
+context.
@deftypefun void gpgme_result_ref (@w{void *@var{result}})
The function @code{gpgme_result_ref} acquires an additional reference
@@ -2366,6 +2347,7 @@ started. In fact, these references are accessed through the
@menu
* Protocol Selection:: Selecting the protocol used by a context.
* Crypto Engine:: Configuring the crypto engine.
+* Setting the Sender:: How to tell the engine the sender.
* ASCII Armor:: Requesting @acronym{ASCII} armored output.
* Text Mode:: Choosing canonical text mode.
* Offline Mode:: Choosing offline mode.
@@ -2448,6 +2430,47 @@ successful, or an eror code on failure.
@end deftypefun
+@node Setting the Sender
+@subsection How to tell the engine the sender.
+@cindex context, sender
+@cindex sender
+@cindex From:
+
+Some engines can make use of the sender’s address, for example to
+figure out the best user id in certain trust models. For verification
+and signing of mails, it is thus suggested to let the engine know the
+sender ("From:") address. @acronym{GPGME} provides two functions to
+accomplish that. Note that the esoteric use of multiple "From:"
+addresses is not supported.
+
+@deftypefun gpgme_error_t gpgme_set_sender @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{int @var{address}})
+
+The function @code{gpgme_set_sender} specifies the sender address for
+use in sign and verify operations. @var{address} is expected to be
+the ``addr-spec'' part of an address but my also be a complete mailbox
+address, in which case this function extracts the ``addr-spec'' from
+it. Using @code{NULL} for @var{address} clears the sender address.
+
+The function returns 0 on success or an error code on failure. The
+most likely failure is that no valid ``addr-spec'' was found in
+@var{address}.
+
+@end deftypefun
+
+@deftypefun @w{const char *} gpgme_get_sender @
+ (@w{gpgme_ctx_t @var{ctx}})
+
+The function @code{gpgme_get_sender} returns the current sender
+address from the context, or NULL if none was set. The returned
+value is valid as long as the @var{ctx} is valid and
+@code{gpgme_set_sender} has not been called again.
+
+@end deftypefun
+
+
+
@c FIXME: Unfortunately, using @acronym here breaks texi2dvi.
@node ASCII Armor
@subsection @acronym{ASCII} Armor
@@ -2877,12 +2900,39 @@ format. For example the non breaking space characters ("~") will not
be removed from the @code{description} field of the
@code{gpgme_tofu_info_t} object.
+@item "export-session-key"
+Using a @var{value} of "1" specifies that the context should try to
+export the symmetric session key when decrypting data. By default, or
+when using an empty string or "0" for @var{value}, session keys are
+not exported.
+
+@item "override-session-key"
+The string given in @var{value} is passed to the GnuPG engine to override
+the session key for decryption. The format of that session key is
+specific to GnuPG and can be retrieved during a decrypt operation when
+the context flag "export-session-key" is enabled. Please be aware that
+using this feature with GnuPG < 2.1.16 will leak the session key on
+many platforms via ps(1).
+
@end table
This function returns @code{0} on success.
@end deftypefun
+@deftypefun {const char *} gpgme_get_ctx_flag @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{const char *@var{name}})
+
+The value of flags settable by @code{gpgme_set_ctx_flag} can be
+retrieved by this function. If @var{name} is unknown the function
+returns @code{NULL}. For boolean flags an empty string is returned
+for False and the string "1" is returned for True; either atoi(3) or a
+test for an empty string can be used to get the boolean value.
+
+@end deftypefun
+
+
@node Locale
@subsection Locale
@cindex locale, default
@@ -4739,8 +4789,10 @@ secret key for this recipient is not available, and 0 otherwise.
This is a pointer to a structure used to store the result of a
@code{gpgme_op_decrypt} operation. After successfully decrypting
data, you can retrieve the pointer to the result with
-@code{gpgme_op_decrypt_result}. The structure contains the following
-members:
+@code{gpgme_op_decrypt_result}. As with all result structures, it
+this structure shall be considered read-only and an application must
+not allocated such a strucure on its own. The structure contains the
+following members:
@table @code
@item char *unsupported_algorithm
@@ -4756,6 +4808,19 @@ This is a linked list of recipients to which this message was encrypted.
@item char *file_name
This is the filename of the original plaintext message file if it is
known, otherwise this is a null pointer.
+
+@item char *session_key
+A textual representation (nul-terminated string) of the session key
+used in symmetric encryption of the message, if the context has been
+set to export session keys (see @code{gpgme_set_ctx_flag,
+"export-session-key"}), and a session key was available for the most
+recent decryption operation. Otherwise, this is a null pointer.
+
+You must not try to access this member of the struct unless
+@code{gpgme_set_ctx_flag (ctx, "export-session-key")} returns success
+or @code{gpgme_get_ctx_flag (ctx, "export-session-key")} returns true
+(non-empty string).
+
@end table
@end deftp
@@ -5096,7 +5161,7 @@ secret key could not be retrieved, and passes through any errors that
are reported by the crypto engine support routines.
@end deftypefun
-@deftypefun gpgme_error_t gpgme_op_decrypt_verify (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}})
+@deftypefun gpgme_error_t gpgme_op_decrypt_verify_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}})
The function @code{gpgme_op_decrypt_verify_start} initiates a
@code{gpgme_op_decrypt_verify} operation. It can be completed by
calling @code{gpgme_wait} on the context. @xref{Waiting For
@@ -5518,6 +5583,7 @@ Here are some support functions which are sometimes useful.
@menu
* Running other Programs:: Running other Programs
* Using the Assuan protocol:: Using the Assuan protocol
+* Checking for updates:: How to check for software updates
@end menu
@@ -5649,6 +5715,142 @@ Synchronous variant.
@end deftypefun
+@node Checking for updates
+@subsection How to check for software updates
+
+The GnuPG Project operates a server to query the current versions of
+software packages related to GnuPG. GPGME can be used to
+access this online database and check whether a new version of a
+software package is available.
+
+@deftp {Data type} {gpgme_query_swdb_result_t}
+This is a pointer to a structure used to store the result of a
+@code{gpgme_op_query_swdb} operation. After success full call to that
+function, you can retrieve the pointer to the result with
+@code{gpgme_op_query_swdb_result}. The structure contains the
+following member:
+
+@table @code
+@item name
+This is the name of the package.
+
+@item iversion
+The currently installed version or an empty string. This value is
+either a copy of the argument given to @code{gpgme_op_query_swdb} or
+the version of the installed software as figured out by GPGME or GnuPG.
+
+@item created
+This gives the date the file with the list of version numbers has
+originally be created by the GnuPG project.
+
+@item retrieved
+This gives the date the file was downloaded.
+
+@item warning
+If this flag is set either an error has occurred or some of the
+information in this structure are not properly set. For example if
+the version number of the installed software could not be figured out,
+the @code{update} flag may not reflect a required update status.
+
+@item update
+If this flag is set an update of the software is available.
+
+@item urgent
+If this flag is set an available update is important.
+
+@item noinfo
+If this flag is set, no valid information could be retrieved.
+
+@item unknown
+If this flag is set the given @code{name} is not known.
+
+@item tooold
+If this flag is set the available information is not fresh enough.
+
+@item error
+If this flag is set some other error has occured.
+
+@item version
+The version string of the latest released version.
+
+@item reldate
+The release date of the latest released version.
+
+@end table
+@end deftp
+
+@deftypefun gpgme_error_t gpgme_op_query_swdb @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{const char *@var{name}}, @
+ @w{const char *@var{iversion}}, @
+ @w{gpgme_data_t @var{reserved}})
+
+Query the software version database for software package @var{name}
+and check against the installed version given by @var{iversion}. If
+@var{iversion} is given as @code{NULL} a check is only done if GPGME
+can figure out the version by itself (for example when using
+"gpgme" or "gnupg"). If @code{NULL} is used for @var{name} the
+current gpgme version is checked. @var{reserved} must be set to 0.
+
+@end deftypefun
+
+@deftypefun gpgme_query_swdb_result_t gpgme_op_query_swdb_result @
+ (@w{gpgme_ctx_t @var{ctx}})
+
+The function @code{gpgme_op_query_swdb_result} returns a
+@code{gpgme_query_swdb_result_t} pointer to a structure holding the
+result of a @code{gpgme_op_query_swdb} operation. The pointer is only
+valid if the last operation on the context was a sucessful call to
+@code{gpgme_op_query_swdb}. If that call failed, the result might
+be a @code{NULL} pointer. The returned pointer is only valid until
+the next operation is started on the context @var{ctx}.
+@end deftypefun
+
+@noindent
+Here is an example on how to check whether GnuPG is current:
+
+@example
+#include <gpgme.h>
+
+int
+main (void)
+@{
+ gpg_error_t err;
+ gpgme_ctx_t ctx;
+ gpgme_query_swdb_result_t result;
+
+ gpgme_check_version (NULL);
+ err = gpgme_new (&ctx);
+ if (err)
+ fprintf (stderr, "error creating context: %s\n", gpg_strerror (err));
+ else
+ @{
+ gpgme_set_protocol (ctx, GPGME_PROTOCOL_GPGCONF);
+
+ err = gpgme_op_query_swdb (ctx, "gnupg", NULL, 0);
+ if (err)
+ fprintf (stderr, "error querying swdb: %s\n", gpg_strerror (err));
+ else
+ @{
+ result = gpgme_op_query_swdb_result (ctx);
+ if (!result)
+ fprintf (stderr, "error querying swdb\n");
+ if (!result->warning && !result->update)
+ printf ("GnuPG version %s is current\n",
+ result->iversion);
+ else if (!result->warning && result->update)
+ printf ("GnuPG version %s can be updated to %s\n",
+ result->iversion, result->version);
+ else
+ fprintf (stderr, "error finding the update status\n");
+ @}
+ gpgme_release (ctx);
+ @}
+ return 0;
+@}
+@end example
+
+
@node Run Control
@section Run Control
@cindex run control
@@ -6379,7 +6581,7 @@ case the state of @var{ctx} is not modified).
@deftypefun gpgme_ctx_t gpgme_cancel_async (@w{gpgme_ctx_t @var{ctx}})
-The function @code{gpgme_cancel} attempts to cancel a pending
+The function @code{gpgme_cancel_async} attempts to cancel a pending
operation in the context @var{ctx}. This can be called by any thread
at any time after starting an operation on the context, but will not
take effect immediately. The actual cancellation happens at the next
diff --git a/doc/gpl.texi b/doc/gpl.texi
index d13e9e4..931a93d 100644
--- a/doc/gpl.texi
+++ b/doc/gpl.texi
@@ -6,7 +6,7 @@
@c This file is intended to be included in another file.
@display
-Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
+Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@@ -696,7 +696,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program. If not, see @url{http://www.gnu.org/licenses/}.
+along with this program. If not, see @url{https://www.gnu.org/licenses/}.
@end example
@noindent
@@ -722,11 +722,11 @@ use an ``about box''.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a ``copyright disclaimer'' for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-@url{http://www.gnu.org/licenses/}.
+@url{https://www.gnu.org/licenses/}.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use
the GNU Lesser General Public License instead of this License. But
-first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
+first, please read @url{https://www.gnu.org/philosophy/why-not-lgpl.html}.
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index d2b264d..2c274a2 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -20,7 +20,7 @@
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License
-% along with this program. If not, see <http://www.gnu.org/licenses/>.
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
@@ -28,7 +28,7 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
+% https://www.gnu.org/software/texinfo/ (the Texinfo home page), or
% ftp://tug.org/tex/texinfo.tex
% (and all CTAN mirrors, see http://www.ctan.org).
% The texinfo.tex in any given distribution could well be out
@@ -54,7 +54,7 @@
% extent. You can get the existing language-specific files from the
% full Texinfo distribution.
%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
\message{Loading texinfo [version \texinfoversion]:}
@@ -354,7 +354,7 @@
% We don't want .vr (or whatever) entries like this:
% \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
% "\acronym" won't work when it's read back in;
- % it needs to be
+ % it needs to be
% {\code {{\tt \backslashcurfont }acronym}
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
@@ -705,7 +705,7 @@
\def\?{?\spacefactor=\endofsentencespacefactor\space}
% @frenchspacing on|off says whether to put extra space after punctuation.
-%
+%
\def\onword{on}
\def\offword{off}
%
@@ -1260,7 +1260,7 @@ where each line of input produces a line of output.}
% that's what we do).
% double active backslashes.
-%
+%
{\catcode`\@=0 \catcode`\\=\active
@gdef@activebackslashdouble{%
@catcode`@\=@active
@@ -1272,11 +1272,11 @@ where each line of input produces a line of output.}
% us) handles it with this amazing macro to replace tokens, with minor
% changes for Texinfo. It is included here under the GPL by permission
% from the author, Heiko Oberdiek.
-%
+%
% #1 is the tokens to replace.
% #2 is the replacement.
% #3 is the control sequence with the string.
-%
+%
\def\HyPsdSubst#1#2#3{%
\def\HyPsdReplace##1#1##2\END{%
##1%
@@ -1542,7 +1542,7 @@ output) for that.)}
% tried to figure out what each command should do in the context
% of @url. for now, just make @/ a no-op, that's the only one
% people have actually reported a problem with.
- %
+ %
\normalturnoffactive
\def\@{@}%
\let\/=\empty
@@ -1941,7 +1941,7 @@ end
% Definitions for a main text size of 11pt. This is the default in
% Texinfo.
-%
+%
\def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1).
\def\textnominalsize{11pt}
@@ -2074,7 +2074,7 @@ end
% section, chapter, etc., sizes following suit. This is for the GNU
% Press printing of the Emacs 22 manual. Maybe other manuals in the
% future. Used with @smallbook, which sets the leading to 12pt.
-%
+%
\def\definetextfontsizex{%
% Text fonts (10pt).
\def\textnominalsize{10pt}
@@ -2165,7 +2165,7 @@ end
\setfont\secsf\sfbshape{12}{1000}{OT1}
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
-\font\seci=cmmi12
+\font\seci=cmmi12
\font\secsy=cmsy10 scaled \magstep1
\def\sececsize{1200}
@@ -2209,7 +2209,7 @@ end
% We provide the user-level command
% @fonttextsize 10
% (or 11) to redefine the text font size. pt is assumed.
-%
+%
\def\xword{10}
\def\xiword{11}
%
@@ -2219,7 +2219,7 @@ end
%
% Set \globaldefs so that documents can use this inside @tex, since
% makeinfo 4.8 does not support it, but we need it nonetheless.
- %
+ %
\begingroup \globaldefs=1
\ifx\textsizearg\xword \definetextfontsizex
\else \ifx\textsizearg\xiword \definetextfontsizexi
@@ -2505,7 +2505,7 @@ end
% each of the four underscores in __typeof__. This is undesirable in
% some manuals, especially if they don't have long identifiers in
% general. @allowcodebreaks provides a way to control this.
-%
+%
\newif\ifallowcodebreaks \allowcodebreakstrue
\def\keywordtrue{true}
@@ -2636,7 +2636,7 @@ end
% @acronym for "FBI", "NATO", and the like.
% We print this one point size smaller, since it's intended for
% all-uppercase.
-%
+%
\def\acronym#1{\doacronym #1,,\finish}
\def\doacronym#1,#2,#3\finish{%
{\selectfonts\lsize #1}%
@@ -2648,7 +2648,7 @@ end
% @abbr for "Comput. J." and the like.
% No font change, but don't do end-of-sentence spacing.
-%
+%
\def\abbr#1{\doabbr #1,,\finish}
\def\doabbr#1,#2,#3\finish{%
{\plainfrenchspacing #1}%
@@ -2667,43 +2667,43 @@ end
% Theiling, which support regular, slanted, bold and bold slanted (and
% "outlined" (blackboard board, sort of) versions, which we don't need).
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
-%
+%
% Although only regular is the truly official Euro symbol, we ignore
% that. The Euro is designed to be slightly taller than the regular
% font height.
-%
+%
% feymr - regular
% feymo - slanted
% feybr - bold
% feybo - bold slanted
-%
+%
% There is no good (free) typewriter version, to my knowledge.
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
% Hmm.
-%
+%
% Also doesn't work in math. Do we need to do math with euro symbols?
% Hope not.
-%
-%
+%
+%
\def\euro{{\eurofont e}}
\def\eurofont{%
% We set the font at each command, rather than predefining it in
% \textfonts and the other font-switching commands, so that
% installations which never need the symbol don't have to have the
% font installed.
- %
+ %
% There is only one designed size (nominal 10pt), so we always scale
% that to the current nominal size.
- %
+ %
% By the way, simply using "at 1em" works for cmr10 and the like, but
% does not work for cmbx10 and other extended/shrunken fonts.
- %
+ %
\def\eurosize{\csname\curfontsize nominalsize\endcsname}%
%
- \ifx\curfontstyle\bfstylename
+ \ifx\curfontstyle\bfstylename
% bold:
\font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
- \else
+ \else
% regular:
\font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
\fi
@@ -2756,7 +2756,7 @@ end
% Laurent Siebenmann reports \Orb undefined with:
% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
% so we'll define it if necessary.
-%
+%
\ifx\Orb\undefined
\def\Orb{\mathhexbox20D}
\fi
@@ -3105,7 +3105,7 @@ end
% cause the example and the item to crash together. So we use this
% bizarre value of 10001 as a signal to \aboveenvbreak to insert
% \parskip glue after all. Section titles are handled this way also.
- %
+ %
\penalty 10001
\endgroup
\itemxneedsnegativevskipfalse
@@ -3901,7 +3901,7 @@ end
% processing continues to some further point. On the other hand, it
% seems \endinput does not hurt in the printed index arg, since that
% is still getting written without apparent harm.
- %
+ %
% Sample source (mac-idx3.tex, reported by Graham Percival to
% help-texinfo, 22may06):
% @macro funindex {WORD}
@@ -3909,12 +3909,12 @@ end
% @end macro
% ...
% @funindex commtest
- %
+ %
% The above is not enough to reproduce the bug, but it gives the flavor.
- %
+ %
% Sample whatsit resulting:
% .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
- %
+ %
% So:
\let\endinput = \empty
%
@@ -4170,11 +4170,11 @@ end
% makeinfo does not expand macros in the argument to @deffn, which ends up
% writing an index entry, and texindex isn't prepared for an index sort entry
% that starts with \.
- %
+ %
% Since macro invocations are followed by braces, we can just redefine them
% to take a single TeX argument. The case of a macro invocation that
% goes to end-of-line is not handled.
- %
+ %
\macrolist
}
@@ -4302,7 +4302,7 @@ end
% to re-insert the same penalty (values >10000 are used for various
% signals); since we just inserted a non-discardable item, any
% following glue (such as a \parskip) would be a breakpoint. For example:
- %
+ %
% @deffn deffn-whatever
% @vindex index-whatever
% Description.
@@ -5368,11 +5368,11 @@ end
% glue accumulate. (Not a breakpoint because it's preceded by a
% discardable item.)
\vskip-\parskip
- %
+ %
% This is purely so the last item on the list is a known \penalty >
% 10000. This is so \startdefun can avoid allowing breakpoints after
% section headings. Otherwise, it would insert a valid breakpoint between:
- %
+ %
% @section sec-whatever
% @deffn def-whatever
\penalty 10001
@@ -5430,7 +5430,7 @@ end
% These characters do not print properly in the Computer Modern roman
% fonts, so we must take special care. This is more or less redundant
% with the Texinfo input format setup at the end of this file.
-%
+%
\def\activecatcodes{%
\catcode`\"=\active
\catcode`\$=\active
@@ -5480,7 +5480,7 @@ end
% redefined for the two-volume lispref. We always output on
% \jobname.toc even if this is redefined.
-%
+%
\def\tocreadfilename{\jobname.toc}
% Normal (long) toc.
@@ -6035,8 +6035,8 @@ end
% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
% the default, but it works for pasting with more pdf viewers (at least
% evince), the lilypond developers report. xpdf does work with the
-% regular 0x27.
-%
+% regular 0x27.
+%
\def\codequoteright{%
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
\expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
@@ -6048,7 +6048,7 @@ end
% and a similar option for the left quote char vs. a grave accent.
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
% the code environments to do likewise.
-%
+%
\def\codequoteleft{%
\expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
\expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
@@ -6579,7 +6579,7 @@ end
% This does \let #1 = #2, with \csnames; that is,
% \let \csname#1\endcsname = \csname#2\endcsname
% (except of course we have to play expansion games).
-%
+%
\def\cslet#1#2{%
\expandafter\let
\csname#1\expandafter\endcsname
@@ -7737,7 +7737,7 @@ end
%
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% try txi-de.tex.
-%
+%
\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
\openin 1 txi-#1.tex
\ifeof 1
@@ -7793,7 +7793,7 @@ should work if nowhere else does.}
\setnonasciicharscatcode\active
\lattwochardefs
%
- \else \ifx \declaredencoding \latone
+ \else \ifx \declaredencoding \latone
\setnonasciicharscatcode\active
\latonechardefs
%
@@ -7805,7 +7805,7 @@ should work if nowhere else does.}
\setnonasciicharscatcode\active
\utfeightchardefs
%
- \else
+ \else
\message{Unknown document encoding #1, ignoring.}%
%
\fi % utfeight
@@ -7817,7 +7817,7 @@ should work if nowhere else does.}
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
-%
+%
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
% Take account of \c (plain) vs. \, (Texinfo) difference.
@@ -7830,21 +7830,21 @@ should work if nowhere else does.}
%
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
- \gdef^^a0{~}
+ \gdef^^a0{~}
\gdef^^a1{\exclamdown}
- \gdef^^a2{\missingcharmsg{CENT SIGN}}
+ \gdef^^a2{\missingcharmsg{CENT SIGN}}
\gdef^^a3{{\pounds}}
\gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
\gdef^^a5{\missingcharmsg{YEN SIGN}}
- \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+ \gdef^^a6{\missingcharmsg{BROKEN BAR}}
\gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\copyright}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\copyright}
\gdef^^aa{\ordf}
- \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
+ \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
\gdef^^ac{$\lnot$}
- \gdef^^ad{\-}
- \gdef^^ae{\registeredsymbol}
+ \gdef^^ad{\-}
+ \gdef^^ae{\registeredsymbol}
\gdef^^af{\={}}
%
\gdef^^b0{\textdegree}
@@ -7871,7 +7871,7 @@ should work if nowhere else does.}
\gdef^^c2{\^A}
\gdef^^c3{\~A}
\gdef^^c4{\"A}
- \gdef^^c5{\ringaccent A}
+ \gdef^^c5{\ringaccent A}
\gdef^^c6{\AE}
\gdef^^c7{\cedilla C}
\gdef^^c8{\`E}
@@ -8012,7 +8012,7 @@ should work if nowhere else does.}
\gdef^^d6{\"O}
\gdef^^d7{$\times$}
\gdef^^d8{\v R}
- \gdef^^d9{\ringaccent U}
+ \gdef^^d9{\ringaccent U}
\gdef^^da{\'U}
\gdef^^db{\H U}
\gdef^^dc{\"U}
@@ -8056,11 +8056,11 @@ should work if nowhere else does.}
}
% UTF-8 character definitions.
-%
+%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
% changes for Texinfo conventions. It is included here under the GPL by
% permission from Frank Mittelbach and the LaTeX team.
-%
+%
\newcount\countUTFx
\newcount\countUTFy
\newcount\countUTFz
@@ -8900,7 +8900,7 @@ should work if nowhere else does.}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'.
-%
+%
@def@normalturnoffactive{%
@let\=@normalbackslash
@let"=@normaldoublequote
diff --git a/doc/uiserver.texi b/doc/uiserver.texi
index 16e8f85..f10db01 100644
--- a/doc/uiserver.texi
+++ b/doc/uiserver.texi
@@ -158,21 +158,21 @@ indicated by a @sc{c:}, server responses by @sc{c:}:
@smallexample
@group
- @clnt RESET
- @srvr OK
- @clnt RECIPIENT foo@@example.net
- @srvr OK
- @clnt RECIPIENT bar@@example.com
- @srvr OK
- @clnt PREP_ENCRYPT
- @srvr S PROTOCOL OpenPGP
- @srvr OK
- @clnt INPUT FD=17
- @srvr OK
- @clnt OUTPUT FD=18
- @srvr OK
- @clnt ENCRYPT
- @srvr OK
+ @clnt{RESET}
+ @srvr{OK}
+ @clnt{RECIPIENT foo@@example.net}
+ @srvr{OK}
+ @clnt{RECIPIENT bar@@example.com}
+ @srvr{OK}
+ @clnt{PREP_ENCRYPT}
+ @srvr{S PROTOCOL OpenPGP}
+ @srvr{OK}
+ @clnt{INPUT FD=17}
+ @srvr{OK}
+ @clnt{OUTPUT FD=18}
+ @srvr{OK}
+ @clnt{ENCRYPT}
+ @srvr{OK}
@end group
@end smallexample
@@ -260,12 +260,14 @@ encoded. For details on the file descriptor, see the description of
@noindent
The decryption is started with the command:
-@deffn Command DECRYPT -@w{}-protocol=@var{name} [-@w{}-no-verify]
+@deffn Command DECRYPT -@w{}-protocol=@var{name} [-@w{}-no-verify] [-@w{}-export-session-key]
@var{name} is the encryption protocol used for the message. For a
description of the allowed protocols see the @code{ENCRYPT} command.
-This argument is mandatory. If the option @option{--no-verify} is given,
-the server should not try to verify a signature, in case the input data
-is an OpenPGP combined message.
+This argument is mandatory. If the option @option{--no-verify} is
+given, the server should not try to verify a signature, in case the
+input data is an OpenPGP combined message. If the option
+@option{--export-session-key} is given and the underlying engine knows
+how to export the session key, it will appear on a status line
@end deffn
diff --git a/gpgme.spec b/gpgme.spec
index e9e8c5f..afba50f 100644
--- a/gpgme.spec
+++ b/gpgme.spec
@@ -1,9 +1,9 @@
# This is a template. The dist target uses it to create the real file.
Summary: GPGME - GnuPG Made Easy
Name: gpgme
-Version: 1.7.1
+Version: 1.8.0
Release: 1
-URL: http://www.gnupg.org/gpgme.html
+URL: https://gnupg.org/gpgme.html
Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
Group: Development/Libraries
Copyright: GPL
diff --git a/gpgme.spec.in b/gpgme.spec.in
index a5c6996..ddc0de3 100644
--- a/gpgme.spec.in
+++ b/gpgme.spec.in
@@ -3,7 +3,7 @@ Summary: GPGME - GnuPG Made Easy
Name: gpgme
Version: @pkg_version@
Release: 1
-URL: http://www.gnupg.org/gpgme.html
+URL: https://gnupg.org/gpgme.html
Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
Group: Development/Libraries
Copyright: GPL
diff --git a/lang/Makefile.in b/lang/Makefile.in
index 5c96b8f..647734a 100644
--- a/lang/Makefile.in
+++ b/lang/Makefile.in
@@ -328,6 +328,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/README b/lang/README
index f7a1595..0c5bbd9 100644
--- a/lang/README
+++ b/lang/README
@@ -12,4 +12,4 @@ Directory Language
cl Common Lisp
cpp C++
qt Qt-Framework API
-python Python 2 and 3 (port of PyME 0.9.0)
+python Python 2 and 3 (module name: gpg)
diff --git a/lang/cl/Makefile.in b/lang/cl/Makefile.in
index 7a79757..31d9325 100644
--- a/lang/cl/Makefile.in
+++ b/lang/cl/Makefile.in
@@ -301,6 +301,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/cl/gpgme.asd b/lang/cl/gpgme.asd
index bd195e5..5410fad 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.7.1"
+ :version "1.8.0"
:licence "GPL"
:depends-on ("cffi" "gpg-error")
:components ((:file "gpgme-package")
diff --git a/lang/cpp/Makefile.in b/lang/cpp/Makefile.in
index f042f77..30aef31 100644
--- a/lang/cpp/Makefile.in
+++ b/lang/cpp/Makefile.in
@@ -330,6 +330,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/cpp/src/GpgmeppConfig-w32.cmake.in.in b/lang/cpp/src/GpgmeppConfig-w32.cmake.in.in
new file mode 100644
index 0000000..1282676
--- /dev/null
+++ b/lang/cpp/src/GpgmeppConfig-w32.cmake.in.in
@@ -0,0 +1,103 @@
+# CMake Config file for GPGMEPP.
+# Copyright (C) 2016 Intevation GmbH
+#
+# This file is part of GPGMEPP.
+#
+# GPGME-CL is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# GPGME-CL 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 General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA
+
+# based on a generated file from cmake.
+# Generated by CMake 3.0.2
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+ message(FATAL_ERROR "CMake >= 2.6.0 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.6)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget Gpgmepp)
+ list(APPEND _expectedTargets ${_expectedTarget})
+ if(NOT TARGET ${_expectedTarget})
+ list(APPEND _targetsNotDefined ${_expectedTarget})
+ endif()
+ if(TARGET ${_expectedTarget})
+ list(APPEND _targetsDefined ${_expectedTarget})
+ endif()
+endforeach()
+if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
+ set(CMAKE_IMPORT_FILE_VERSION)
+ cmake_policy(POP)
+ return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+ message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+# Create imported target Gpgmepp
+add_library(Gpgmepp SHARED IMPORTED)
+
+set_target_properties(Gpgmepp PROPERTIES
+ IMPORTED_IMPLIB "@resolved_libdir@/libgpgmepp.dll.a"
+ INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
+ INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme.dll.a;@LIBASSUAN_LIBS@"
+ IMPORTED_LOCATION "@resolved_bindir@/libgpgmepp-6.dll"
+)
+list(APPEND _IMPORT_CHECK_TARGETS Gpgmepp )
+list(APPEND _IMPORT_CHECK_FILES_FOR_Gpgmepp "@resolved_libdir@/libgpgmepp.dll.a" "@resolved_bindir@/libgpgmepp-6.dll" )
+
+
+if(CMAKE_VERSION VERSION_LESS 2.8.12)
+ message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
+endif()
+
+# Loop over all imported files and verify that they actually exist
+foreach(target ${_IMPORT_CHECK_TARGETS} )
+ foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
+ if(NOT EXISTS "${file}" )
+ message(FATAL_ERROR "The imported target \"${target}\" references the file
+ \"${file}\"
+but this file does not exist. Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+ \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+ endif()
+ endforeach()
+ unset(_IMPORT_CHECK_FILES_FOR_${target})
+endforeach()
+unset(_IMPORT_CHECK_TARGETS)
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)
+
+get_filename_component(QGpgme_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+# Pull in QGpgme for compatibility with KF5 variant.
+find_package(QGpgme CONFIG)
diff --git a/lang/cpp/src/GpgmeppConfig.cmake.in.in b/lang/cpp/src/GpgmeppConfig.cmake.in.in
index 73f5eaa..928d19f 100644
--- a/lang/cpp/src/GpgmeppConfig.cmake.in.in
+++ b/lang/cpp/src/GpgmeppConfig.cmake.in.in
@@ -64,7 +64,7 @@ add_library(Gpgmepp SHARED IMPORTED)
set_target_properties(Gpgmepp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
- IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
+ IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp.so"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
diff --git a/lang/cpp/src/GpgmeppConfigVersion.cmake.in b/lang/cpp/src/GpgmeppConfigVersion.cmake.in
index 43d6512..259bddd 100644
--- a/lang/cpp/src/GpgmeppConfigVersion.cmake.in
+++ b/lang/cpp/src/GpgmeppConfigVersion.cmake.in
@@ -19,7 +19,7 @@
# 02111-1307, USA
# based on a generated file from cmake.
-set(PACKAGE_VERSION "@LIBGPGMEPP_LT_CURRENT@.@LIBGPGMEPP_LT_AGE@.@LIBGPGMEPP_LT_REVISION@.@BUILD_REVISION@")
+set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE)
diff --git a/lang/cpp/src/Makefile.am b/lang/cpp/src/Makefile.am
index 342bdf8..92ed784 100644
--- a/lang/cpp/src/Makefile.am
+++ b/lang/cpp/src/Makefile.am
@@ -19,7 +19,7 @@
# 02111-1307, USA
EXTRA_DIST = GpgmeppConfig.cmake.in.in GpgmeppConfigVersion.cmake.in \
- gpgmepp_version.h.in
+ gpgmepp_version.h.in GpgmeppConfig-w32.cmake.in.in
lib_LTLIBRARIES = libgpgmepp.la
@@ -33,7 +33,7 @@ main_sources = \
gpgsetownertrusteditinteractor.cpp gpgsignkeyeditinteractor.cpp \
gpgadduserideditinteractor.cpp defaultassuantransaction.cpp \
scdgetinfoassuantransaction.cpp gpgagentgetinfoassuantransaction.cpp \
- vfsmountresult.cpp configuration.cpp tofuinfo.cpp
+ vfsmountresult.cpp configuration.cpp tofuinfo.cpp swdbresult.cpp
gpgmepp_headers = \
configuration.h context.h data.h decryptionresult.h \
@@ -45,7 +45,7 @@ gpgmepp_headers = \
importresult.h keygenerationresult.h key.h keylistresult.h \
notation.h result.h scdgetinfoassuantransaction.h signingresult.h \
trustitem.h verificationresult.h vfsmountresult.h gpgmepp_export.h \
- tofuinfo.h
+ tofuinfo.h swdbresult.h
private_gpgmepp_headers = \
result_p.h context_p.h util.h callbacks.h data_p.h
@@ -57,7 +57,7 @@ interface_headers= \
gpgmeppincludedir = $(includedir)/gpgme++
gpgmeppinclude_HEADERS = $(gpgmepp_headers)
nobase_gpgmeppinclude_HEADERS = $(interface_headers)
-nodist_include_HEADERS = gpgmepp_version.h
+nodist_gpgmeppinclude_HEADERS = gpgmepp_version.h
libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \
$(interface_headers) $(private_gpgmepp_headers)
@@ -66,20 +66,19 @@ AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
-DBUILDING_GPGMEPP
libgpgmepp_la_LIBADD = ../../../src/libgpgme.la @LIBASSUAN_LIBS@
-libgpgmepp_la_LDFLAGS = -version-info \
+libgpgmepp_la_LDFLAGS = -no-undefined -version-info \
@LIBGPGMEPP_LT_CURRENT@:@LIBGPGMEPP_LT_REVISION@:@LIBGPGMEPP_LT_AGE@
if HAVE_W32_SYSTEM
-libsuffix=.dll.a
+GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
+ sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
+ sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
+ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
else
-libsuffix=.so
-endif
-
GpgmeppConfig.cmake: GpgmeppConfig.cmake.in
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
- sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
-
+endif
install-cmake-files: GpgmeppConfig.cmake GpgmeppConfigVersion.cmake
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/Gpgmepp
$(INSTALL) -m 644 GpgmeppConfig.cmake \
@@ -96,4 +95,5 @@ install-data-local: install-cmake-files
uninstall-local: uninstall-cmake-files
-CLEANFILES = GpgmeppConfig.cmake
+CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
+ gpgmepp_version.h GpgmeppConfig.cmake.in
diff --git a/lang/cpp/src/Makefile.in b/lang/cpp/src/Makefile.in
index 6be45d1..45f6219 100644
--- a/lang/cpp/src/Makefile.in
+++ b/lang/cpp/src/Makefile.in
@@ -102,6 +102,7 @@ host_triplet = @host@
subdir = lang/cpp/src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/mkinstalldirs \
+ $(srcdir)/GpgmeppConfig-w32.cmake.in.in \
$(srcdir)/GpgmeppConfig.cmake.in.in \
$(srcdir)/GpgmeppConfigVersion.cmake.in \
$(srcdir)/gpgmepp_version.h.in $(top_srcdir)/build-aux/depcomp \
@@ -122,8 +123,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = GpgmeppConfig.cmake.in GpgmeppConfigVersion.cmake \
- gpgmepp_version.h
+CONFIG_CLEAN_FILES = GpgmeppConfig-w32.cmake.in GpgmeppConfig.cmake.in \
+ GpgmeppConfigVersion.cmake gpgmepp_version.h
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -154,7 +155,8 @@ am__uninstall_files_from_dir = { \
}
am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(gpgmeppincludedir)" \
- "$(DESTDIR)$(gpgmeppincludedir)" "$(DESTDIR)$(includedir)"
+ "$(DESTDIR)$(gpgmeppincludedir)" \
+ "$(DESTDIR)$(gpgmeppincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libgpgmepp_la_DEPENDENCIES = ../../../src/libgpgme.la
am__objects_1 = exception.lo context.lo key.lo trustitem.lo data.lo \
@@ -167,7 +169,7 @@ am__objects_1 = exception.lo context.lo key.lo trustitem.lo data.lo \
gpgadduserideditinteractor.lo defaultassuantransaction.lo \
scdgetinfoassuantransaction.lo \
gpgagentgetinfoassuantransaction.lo vfsmountresult.lo \
- configuration.lo tofuinfo.lo
+ configuration.lo tofuinfo.lo swdbresult.lo
am__objects_2 =
am_libgpgmepp_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
context_vanilla.lo $(am__objects_2) $(am__objects_2)
@@ -240,7 +242,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(gpgmeppinclude_HEADERS) $(nobase_gpgmeppinclude_HEADERS) \
- $(nodist_include_HEADERS)
+ $(nodist_gpgmeppinclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -392,6 +394,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -454,7 +459,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = GpgmeppConfig.cmake.in.in GpgmeppConfigVersion.cmake.in \
- gpgmepp_version.h.in
+ gpgmepp_version.h.in GpgmeppConfig-w32.cmake.in.in
lib_LTLIBRARIES = libgpgmepp.la
main_sources = \
@@ -467,7 +472,7 @@ main_sources = \
gpgsetownertrusteditinteractor.cpp gpgsignkeyeditinteractor.cpp \
gpgadduserideditinteractor.cpp defaultassuantransaction.cpp \
scdgetinfoassuantransaction.cpp gpgagentgetinfoassuantransaction.cpp \
- vfsmountresult.cpp configuration.cpp tofuinfo.cpp
+ vfsmountresult.cpp configuration.cpp tofuinfo.cpp swdbresult.cpp
gpgmepp_headers = \
configuration.h context.h data.h decryptionresult.h \
@@ -479,7 +484,7 @@ gpgmepp_headers = \
importresult.h keygenerationresult.h key.h keylistresult.h \
notation.h result.h scdgetinfoassuantransaction.h signingresult.h \
trustitem.h verificationresult.h vfsmountresult.h gpgmepp_export.h \
- tofuinfo.h
+ tofuinfo.h swdbresult.h
private_gpgmepp_headers = \
result_p.h context_p.h util.h callbacks.h data_p.h
@@ -491,7 +496,7 @@ interface_headers = \
gpgmeppincludedir = $(includedir)/gpgme++
gpgmeppinclude_HEADERS = $(gpgmepp_headers)
nobase_gpgmeppinclude_HEADERS = $(interface_headers)
-nodist_include_HEADERS = gpgmepp_version.h
+nodist_gpgmeppinclude_HEADERS = gpgmepp_version.h
libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \
$(interface_headers) $(private_gpgmepp_headers)
@@ -499,12 +504,12 @@ AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
-DBUILDING_GPGMEPP
libgpgmepp_la_LIBADD = ../../../src/libgpgme.la @LIBASSUAN_LIBS@
-libgpgmepp_la_LDFLAGS = -version-info \
+libgpgmepp_la_LDFLAGS = -no-undefined -version-info \
@LIBGPGMEPP_LT_CURRENT@:@LIBGPGMEPP_LT_REVISION@:@LIBGPGMEPP_LT_AGE@
-@HAVE_W32_SYSTEM_FALSE@libsuffix = .so
-@HAVE_W32_SYSTEM_TRUE@libsuffix = .dll.a
-CLEANFILES = GpgmeppConfig.cmake
+CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
+ gpgmepp_version.h GpgmeppConfig.cmake.in
+
all: all-am
.SUFFIXES:
@@ -539,6 +544,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+GpgmeppConfig-w32.cmake.in: $(top_builddir)/config.status $(srcdir)/GpgmeppConfig-w32.cmake.in.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
GpgmeppConfig.cmake.in: $(top_builddir)/config.status $(srcdir)/GpgmeppConfig.cmake.in.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
GpgmeppConfigVersion.cmake: $(top_builddir)/config.status $(srcdir)/GpgmeppConfigVersion.cmake.in
@@ -613,6 +620,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keylistresult.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scdgetinfoassuantransaction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signingresult.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swdbresult.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tofuinfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trustitem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verificationresult.Plo@am__quote@
@@ -689,27 +697,27 @@ uninstall-nobase_gpgmeppincludeHEADERS:
@list='$(nobase_gpgmeppinclude_HEADERS)'; test -n "$(gpgmeppincludedir)" || list=; \
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(gpgmeppincludedir)'; $(am__uninstall_files_from_dir)
-install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+install-nodist_gpgmeppincludeHEADERS: $(nodist_gpgmeppinclude_HEADERS)
@$(NORMAL_INSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_gpgmeppinclude_HEADERS)'; test -n "$(gpgmeppincludedir)" || list=; \
if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(gpgmeppincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(gpgmeppincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gpgmeppincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(gpgmeppincludedir)" || exit $$?; \
done
-uninstall-nodist_includeHEADERS:
+uninstall-nodist_gpgmeppincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_gpgmeppinclude_HEADERS)'; test -n "$(gpgmeppincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+ dir='$(DESTDIR)$(gpgmeppincludedir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -797,7 +805,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(gpgmeppincludedir)" "$(DESTDIR)$(gpgmeppincludedir)" "$(DESTDIR)$(includedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(gpgmeppincludedir)" "$(DESTDIR)$(gpgmeppincludedir)" "$(DESTDIR)$(gpgmeppincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -856,7 +864,7 @@ info-am:
install-data-am: install-data-local install-gpgmeppincludeHEADERS \
install-nobase_gpgmeppincludeHEADERS \
- install-nodist_includeHEADERS
+ install-nodist_gpgmeppincludeHEADERS
install-dvi: install-dvi-am
@@ -904,7 +912,7 @@ ps-am:
uninstall-am: uninstall-gpgmeppincludeHEADERS uninstall-libLTLIBRARIES \
uninstall-local uninstall-nobase_gpgmeppincludeHEADERS \
- uninstall-nodist_includeHEADERS
+ uninstall-nodist_gpgmeppincludeHEADERS
.MAKE: install-am install-strip
@@ -918,22 +926,24 @@ uninstall-am: uninstall-gpgmeppincludeHEADERS uninstall-libLTLIBRARIES \
install-html install-html-am install-info install-info-am \
install-libLTLIBRARIES install-man \
install-nobase_gpgmeppincludeHEADERS \
- install-nodist_includeHEADERS install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+ install-nodist_gpgmeppincludeHEADERS install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am \
uninstall-gpgmeppincludeHEADERS uninstall-libLTLIBRARIES \
uninstall-local uninstall-nobase_gpgmeppincludeHEADERS \
- uninstall-nodist_includeHEADERS
-
+ uninstall-nodist_gpgmeppincludeHEADERS
-GpgmeppConfig.cmake: GpgmeppConfig.cmake.in
- sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
- sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
- sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
+@HAVE_W32_SYSTEM_TRUE@GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
+@HAVE_W32_SYSTEM_FALSE@GpgmeppConfig.cmake: GpgmeppConfig.cmake.in
+@HAVE_W32_SYSTEM_FALSE@ sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
+@HAVE_W32_SYSTEM_FALSE@ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
install-cmake-files: GpgmeppConfig.cmake GpgmeppConfigVersion.cmake
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/Gpgmepp
$(INSTALL) -m 644 GpgmeppConfig.cmake \
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index 1121104..ada7bea 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -466,6 +466,16 @@ Error Context::setEngineHomeDirectory(const char *home_dir)
return Error(gpgme_ctx_set_engine_info(d->ctx, gpgme_get_protocol(d->ctx), filename, home_dir));
}
+Error Context::setSender (const char *sender)
+{
+ return Error(gpgme_set_sender(d->ctx, sender));
+}
+
+const char *Context::getSender ()
+{
+ return gpgme_get_sender(d->ctx);
+}
+
//
//
// Key Management
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index ab15a21..2c205b0 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -304,6 +304,10 @@ public:
GpgME::Error startSigning(const Data &plainText, Data &signature, SignatureMode mode);
SigningResult signingResult() const;
+ // wrapper for gpgme_set_sender
+ const char *getSender();
+ GpgME::Error setSender(const char *sender);
+
//
// Encryption
//
diff --git a/lang/cpp/src/engineinfo.h b/lang/cpp/src/engineinfo.h
index 72e125c..aa6fcca 100644
--- a/lang/cpp/src/engineinfo.h
+++ b/lang/cpp/src/engineinfo.h
@@ -40,6 +40,12 @@ public:
struct Version
{
int major, minor, patch;
+ Version()
+ {
+ major = 0;
+ minor = 0;
+ patch = 0;
+ }
Version(const std::string& version)
{
@@ -51,6 +57,16 @@ public:
}
}
+ Version(const char *version)
+ {
+ if (!version ||
+ std::sscanf(version, "%d.%d.%d", &major, &minor, &patch) != 3) {
+ major = 0;
+ minor = 0;
+ patch = 0;
+ }
+ }
+
bool operator < (const Version& other)
{
if (major < other.major)
diff --git a/lang/cpp/src/gpgmefw.h b/lang/cpp/src/gpgmefw.h
index cbdd444..e3c9b18 100644
--- a/lang/cpp/src/gpgmefw.h
+++ b/lang/cpp/src/gpgmefw.h
@@ -67,4 +67,10 @@ typedef struct gpgme_conf_comp *gpgme_conf_comp_t;
struct gpgme_conf_arg;
typedef struct gpgme_conf_arg *gpgme_conf_arg_t;
+struct _gpgme_tofu_info;
+typedef struct _gpgme_tofu_info *gpgme_tofu_info_t;
+
+struct _gpgme_op_query_swdb_result;
+typedef struct _gpgme_op_query_swdb_result *gpgme_query_swdb_result_t;
+
#endif // __GPGMEPP_GPGMEFW_H__
diff --git a/lang/cpp/src/gpgmepp_version.h.in b/lang/cpp/src/gpgmepp_version.h.in
index 3c33a30..9cf6aeb 100644
--- a/lang/cpp/src/gpgmepp_version.h.in
+++ b/lang/cpp/src/gpgmepp_version.h.in
@@ -23,10 +23,9 @@
#ifndef GPGMEPP_VERSION_H
#define GPGMEPP_VERSION_H
-#define GPGMEPP_VERSION_STRING "@LIBGPGMEPP_LT_CURRENT@.@LIBGPGMEPP_LT_AGE@.@LIBGPGMEPP_LT_REVISION@"
-#define GPGMEPP_VERSION_MAJOR @LIBGPGMEPP_LT_CURRENT@
-#define GPGMEPP_VERSION_MINOR @LIBGPGMEPP_LT_AGE@
-#define GPGMEPP_VERSION_PATCH @LIBGPGMEPP_LT_REVISION@
-#define GPGMEPP_VERSION ((@LIBGPGMEPP_LT_CURRENT@<<16)|(@LIBGPGMEPP_LT_AGE@<<8)|(@LIBGPGMEPP_LT_REVISION@))
-
+#define GPGMEPP_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
+#define GPGMEPP_VERSION_MAJOR @VERSION_MAJOR@
+#define GPGMEPP_VERSION_MINOR @VERSION_MINOR@
+#define GPGMEPP_VERSION_PATCH @VERSION_MICRO@
+#define GPGMEPP_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
#endif
diff --git a/lang/cpp/src/swdbresult.cpp b/lang/cpp/src/swdbresult.cpp
new file mode 100644
index 0000000..3afa8b5
--- /dev/null
+++ b/lang/cpp/src/swdbresult.cpp
@@ -0,0 +1,231 @@
+/* swdbresult.cpp - wraps gpgme swdb result / query
+ Copyright (C) 2016 Intevation 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 Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 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 Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with GPGME++; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include "swdbresult.h"
+
+#include <istream>
+
+#include "error.h"
+
+#include "gpgme.h"
+
+class GpgME::SwdbResult::Private
+{
+public:
+ Private() {}
+ Private(gpgme_query_swdb_result_t result)
+ : mResult(result ? new _gpgme_op_query_swdb_result (*result) : nullptr)
+ {
+ if (!result) {
+ mResult->name = nullptr;
+ return;
+ }
+ if (result->name) {
+ mResult->name = strdup(result->name);
+ }
+ if (result->version) {
+ mVersion = result->version;
+ }
+ if (result->iversion) {
+ mIVersion = result->iversion;
+ }
+ }
+
+ Private(const Private &other)
+ : mResult(other.mResult)
+ {
+ if (mResult && mResult->name) {
+ mResult->name = strdup(mResult->name);
+ }
+ mVersion = other.mVersion;
+ mIVersion = other.mIVersion;
+ }
+
+ ~Private()
+ {
+ if (mResult) {
+ std::free(mResult->name);
+ delete mResult;
+ }
+ }
+
+ GpgME::EngineInfo::Version mVersion;
+ GpgME::EngineInfo::Version mIVersion;
+ gpgme_query_swdb_result_t mResult;
+};
+
+GpgME::SwdbResult::SwdbResult(gpgme_query_swdb_result_t result)
+ : d(new Private(result))
+{
+}
+
+GpgME::SwdbResult::SwdbResult() : d()
+{
+}
+
+bool GpgME::SwdbResult::isNull() const
+{
+ return !d || !d->mResult;
+}
+
+std::string GpgME::SwdbResult::name() const
+{
+ if (isNull() || !d->mResult->name) {
+ return std::string();
+ }
+ return d->mResult->name;
+}
+
+GpgME::EngineInfo::Version GpgME::SwdbResult::version() const
+{
+ if (isNull()) {
+ return GpgME::EngineInfo::Version();
+ }
+ return d->mVersion;
+}
+
+GpgME::EngineInfo::Version GpgME::SwdbResult::installedVersion() const
+{
+ if (isNull()) {
+ return GpgME::EngineInfo::Version();
+ }
+ return d->mIVersion;
+}
+
+unsigned long GpgME::SwdbResult::created() const
+{
+ return isNull() ? 0 : d->mResult->created;
+}
+
+unsigned long GpgME::SwdbResult::retrieved() const
+{
+ return isNull() ? 0 : d->mResult->retrieved;
+}
+
+unsigned long GpgME::SwdbResult::releaseDate() const
+{
+ return isNull() ? 0 : d->mResult->reldate;
+}
+
+bool GpgME::SwdbResult::warning() const
+{
+ return isNull() ? 0 : d->mResult->warning;
+}
+
+bool GpgME::SwdbResult::update() const
+{
+ return isNull() ? 0 : d->mResult->update;
+}
+
+bool GpgME::SwdbResult::noinfo() const
+{
+ return isNull() ? 0 : d->mResult->noinfo;
+}
+
+bool GpgME::SwdbResult::unknown() const
+{
+ return isNull() ? 0 : d->mResult->unknown;
+}
+
+bool GpgME::SwdbResult::error() const
+{
+ return isNull() ? 0 : d->mResult->error;
+}
+
+bool GpgME::SwdbResult::tooOld() const
+{
+ return isNull() ? 0 : d->mResult->tooold;
+}
+
+bool GpgME::SwdbResult::urgent() const
+{
+ return isNull() ? 0 : d->mResult->urgent;
+}
+
+std::vector<GpgME::SwdbResult> GpgME::SwdbResult::query(const char *name,
+ const char *iversion,
+ Error *err)
+{
+ std::vector <GpgME::SwdbResult> ret;
+ gpgme_ctx_t ctx;
+ gpgme_error_t gpgerr = gpgme_new(&ctx);
+
+ if (gpgerr) {
+ if (err) {
+ *err = Error (gpgerr);
+ }
+ return ret;
+ }
+
+ gpgerr = gpgme_set_protocol(ctx, GPGME_PROTOCOL_GPGCONF);
+
+ if (gpgerr) {
+ if (err) {
+ *err = Error(gpgerr);
+ }
+ gpgme_release(ctx);
+ return ret;
+ }
+
+ gpgerr = gpgme_op_query_swdb(ctx, name, iversion, 0);
+
+ if (gpgerr) {
+ if (err) {
+ *err = Error(gpgerr);
+ }
+ gpgme_release(ctx);
+ return ret;
+ }
+ gpgme_query_swdb_result_t result = gpgme_op_query_swdb_result(ctx);
+ while (result) {
+ ret.push_back(SwdbResult(result));
+ result = result->next;
+ }
+
+ gpgme_release(ctx);
+ return ret;
+}
+
+std::ostream &GpgME::operator<<(std::ostream &os, const GpgME::SwdbResult &result)
+{
+ os << "GpgME::SwdbResult(";
+ if (!result.isNull()) {
+ os << "\n name: " << result.name()
+ << "\n version: " << result.version()
+ << "\n installed: "<< result.installedVersion()
+ << "\n created: " << result.created()
+ << "\n retrieved: "<< result.retrieved()
+ << "\n warning: " << result.warning()
+ << "\n update: " << result.update()
+ << "\n urgent: " << result.urgent()
+ << "\n noinfo: " << result.noinfo()
+ << "\n unknown: " << result.unknown()
+ << "\n tooOld: " << result.tooOld()
+ << "\n error: " << result.error()
+ << "\n reldate: " << result.releaseDate()
+ << '\n';
+ }
+ return os << ")\n";
+}
diff --git a/lang/cpp/src/swdbresult.h b/lang/cpp/src/swdbresult.h
new file mode 100644
index 0000000..e15954d
--- /dev/null
+++ b/lang/cpp/src/swdbresult.h
@@ -0,0 +1,128 @@
+/*
+ swdbresult.h - wraps a gpgme swdb query / rsult
+ Copyright (C) 2016 Intevation 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 Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 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 Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with GPGME++; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef __GPGMEPP_SWDB_H__
+#define __GPGMEPP_SWDB_H__
+
+#include "gpgmepp_export.h"
+
+#include "global.h"
+#include "engineinfo.h"
+
+#include <vector>
+#include <string>
+#include <iostream>
+#include <ostream>
+
+namespace GpgME
+{
+
+class GPGMEPP_EXPORT SwdbResult
+{
+public:
+ /* Obtain swdb results through query() */
+ SwdbResult();
+ explicit SwdbResult(gpgme_query_swdb_result_t result);
+
+ /** Query the swdb to get information about updates.
+ *
+ * Runs gpgconf --query-swdb through gpgme and
+ * returns a list of results.
+ * If iversion is given as NULL a check is only done if GPGME
+ * can figure out the version by itself (for example when using
+ * "gpgme" or "gnupg").
+ *
+ * If NULL is used for name the current gpgme version is
+ * checked.
+ *
+ * @param name: Name of the component to query.
+ * @param iversion: Optionally the installed version.
+ * @param err: Optional error.
+ */
+ static std::vector<SwdbResult> query(const char *name,
+ const char *iversion = NULL,
+ Error *err = NULL);
+
+ const SwdbResult &operator=(SwdbResult other)
+ {
+ swap(other);
+ return *this;
+ }
+
+ void swap(SwdbResult &other)
+ {
+ using std::swap;
+ swap(this->d, other.d);
+ }
+ bool isNull() const;
+
+ /* The name of the package (e.g. "gpgme", "gnupg") */
+ std::string name() const;
+
+ /* The version of the installed version. */
+ EngineInfo::Version installedVersion() const;
+
+ /* The time the online info was created. */
+ unsigned long created() const;
+
+ /* The time the online info was retrieved. */
+ unsigned long retrieved() const;
+
+ /* This bit is set if an error occured or some of the information
+ * in this structure may not be set. */
+ bool warning() const;
+
+ /* An update is available. */
+ bool update() const;
+
+ /* The update is important. */
+ bool urgent() const;
+
+ /* No information at all available. */
+ bool noinfo() const;
+
+ /* The package name is not known. */
+ bool unknown() const;
+
+ /* The information here is too old. */
+ bool tooOld() const;
+
+ /* Other error. */
+ bool error() const;
+
+ /* The version of the latest released version. */
+ EngineInfo::Version version() const;
+
+ /* The release date of that version. */
+ unsigned long releaseDate() const;
+
+private:
+ class Private;
+ std::shared_ptr<Private> d;
+};
+
+GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const SwdbResult &info);
+
+} // namespace GpgME
+
+GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(SwdbResult)
+
+#endif
diff --git a/lang/cpp/src/tofuinfo.h b/lang/cpp/src/tofuinfo.h
index c09c82a..7165d05 100644
--- a/lang/cpp/src/tofuinfo.h
+++ b/lang/cpp/src/tofuinfo.h
@@ -25,8 +25,6 @@
#include "gpgmepp_export.h"
-#include "gpgme.h"
-
#include "global.h"
#include <memory>
diff --git a/lang/python/MANIFEST.in b/lang/python/MANIFEST.in
index eefdb83..8f63640 100644
--- a/lang/python/MANIFEST.in
+++ b/lang/python/MANIFEST.in
@@ -1,4 +1,4 @@
recursive-include examples *.py
include gpgme-h-clean.py gpgme.i
include helpers.c helpers.h private.h
-recursive-include pyme *.py
+recursive-include gpg *.py
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index 224a91a..e32fd12 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
helpers.c helpers.h private.h \
gpgme-h-clean.py \
examples \
- pyme
+ gpg
SUBDIRS = . tests
@@ -35,21 +35,21 @@ COPY_FILES = \
$(srcdir)/examples \
$(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
-COPY_FILES_PYME = \
- $(srcdir)/pyme/callbacks.py \
- $(srcdir)/pyme/constants \
- $(srcdir)/pyme/core.py \
- $(srcdir)/pyme/errors.py \
- $(srcdir)/pyme/__init__.py \
- $(srcdir)/pyme/results.py \
- $(srcdir)/pyme/util.py
+COPY_FILES_GPG = \
+ $(srcdir)/gpg/callbacks.py \
+ $(srcdir)/gpg/constants \
+ $(srcdir)/gpg/core.py \
+ $(srcdir)/gpg/errors.py \
+ $(srcdir)/gpg/__init__.py \
+ $(srcdir)/gpg/results.py \
+ $(srcdir)/gpg/util.py
# For VPATH builds we need to copy some files because Python's
# distutils are not VPATH-aware.
-copystamp: $(COPY_FILES) $(COPY_FILES_PYME) data.h config.h
+copystamp: $(COPY_FILES) $(COPY_FILES_GPG) data.h config.h
if test "$(srcdir)" != "$(builddir)" ; then \
cp -R $(COPY_FILES) . ; \
- cp -R $(COPY_FILES_PYME) pyme ; \
+ cp -R $(COPY_FILES_GPG) gpg ; \
fi
touch $@
@@ -65,22 +65,22 @@ all-local: copystamp
$$PYTHON setup.py build --verbose ; \
done
-dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc: copystamp
+dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc: copystamp
CFLAGS="$(CFLAGS)" \
$(PYTHON) setup.py sdist --verbose
- gpg2 --detach-sign --armor dist/pyme3-$(VERSION).tar.gz
+ gpg2 --detach-sign --armor dist/gpg-$(VERSION).tar.gz
.PHONY: prepare
prepare: copystamp
.PHONY: sdist
-sdist: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
+sdist: dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc
.PHONY: upload
-upload: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
+upload: dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc
twine upload $^
-CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/gpgme.py \
+CLEANFILES = gpgme.h errors.i gpgme_wrap.c gpg/gpgme.py \
data.h config.h copystamp
# Remove the rest.
@@ -92,8 +92,8 @@ clean-local:
if test "$(srcdir)" != "$(builddir)" ; then \
find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \
for F in $(COPY_FILES); do rm -rf -- `basename $$F` ; done ; \
- for F in $(COPY_FILES_PYME); do \
- rm -rf -- pyme/`basename $$F` ; \
+ for F in $(COPY_FILES_GPG); do \
+ rm -rf -- gpg/`basename $$F` ; \
done ; \
fi
@@ -107,9 +107,9 @@ install-exec-local:
cat files.txt >> install_files.txt ; \
rm files.txt ; \
done
- $(MKDIR_P) $(DESTDIR)$(pythondir)/pyme
- mv install_files.txt $(DESTDIR)$(pythondir)/pyme
+ $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
+ mv install_files.txt $(DESTDIR)$(pythondir)/gpg
uninstall-local:
- xargs <$(DESTDIR)$(pythondir)/pyme/install_files.txt -- rm -rf --
- rm -rf -- $(DESTDIR)$(pythondir)/pyme
+ xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
+ rm -rf -- $(DESTDIR)$(pythondir)/gpg
diff --git a/lang/python/Makefile.in b/lang/python/Makefile.in
index 08b26e0..4168708 100644
--- a/lang/python/Makefile.in
+++ b/lang/python/Makefile.in
@@ -329,6 +329,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -397,7 +400,7 @@ EXTRA_DIST = \
helpers.c helpers.h private.h \
gpgme-h-clean.py \
examples \
- pyme
+ gpg
SUBDIRS = . tests
COPY_FILES = \
@@ -408,16 +411,16 @@ COPY_FILES = \
$(srcdir)/examples \
$(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
-COPY_FILES_PYME = \
- $(srcdir)/pyme/callbacks.py \
- $(srcdir)/pyme/constants \
- $(srcdir)/pyme/core.py \
- $(srcdir)/pyme/errors.py \
- $(srcdir)/pyme/__init__.py \
- $(srcdir)/pyme/results.py \
- $(srcdir)/pyme/util.py
+COPY_FILES_GPG = \
+ $(srcdir)/gpg/callbacks.py \
+ $(srcdir)/gpg/constants \
+ $(srcdir)/gpg/core.py \
+ $(srcdir)/gpg/errors.py \
+ $(srcdir)/gpg/__init__.py \
+ $(srcdir)/gpg/results.py \
+ $(srcdir)/gpg/util.py
-CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/gpgme.py \
+CLEANFILES = gpgme.h errors.i gpgme_wrap.c gpg/gpgme.py \
data.h config.h copystamp
all: all-recursive
@@ -737,10 +740,10 @@ uninstall-am: uninstall-local
# For VPATH builds we need to copy some files because Python's
# distutils are not VPATH-aware.
-copystamp: $(COPY_FILES) $(COPY_FILES_PYME) data.h config.h
+copystamp: $(COPY_FILES) $(COPY_FILES_GPG) data.h config.h
if test "$(srcdir)" != "$(builddir)" ; then \
cp -R $(COPY_FILES) . ; \
- cp -R $(COPY_FILES_PYME) pyme ; \
+ cp -R $(COPY_FILES_GPG) gpg ; \
fi
touch $@
@@ -756,19 +759,19 @@ all-local: copystamp
$$PYTHON setup.py build --verbose ; \
done
-dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc: copystamp
+dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc: copystamp
CFLAGS="$(CFLAGS)" \
$(PYTHON) setup.py sdist --verbose
- gpg2 --detach-sign --armor dist/pyme3-$(VERSION).tar.gz
+ gpg2 --detach-sign --armor dist/gpg-$(VERSION).tar.gz
.PHONY: prepare
prepare: copystamp
.PHONY: sdist
-sdist: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
+sdist: dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc
.PHONY: upload
-upload: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
+upload: dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc
twine upload $^
# Remove the rest.
@@ -780,8 +783,8 @@ clean-local:
if test "$(srcdir)" != "$(builddir)" ; then \
find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \
for F in $(COPY_FILES); do rm -rf -- `basename $$F` ; done ; \
- for F in $(COPY_FILES_PYME); do \
- rm -rf -- pyme/`basename $$F` ; \
+ for F in $(COPY_FILES_GPG); do \
+ rm -rf -- gpg/`basename $$F` ; \
done ; \
fi
@@ -795,12 +798,12 @@ install-exec-local:
cat files.txt >> install_files.txt ; \
rm files.txt ; \
done
- $(MKDIR_P) $(DESTDIR)$(pythondir)/pyme
- mv install_files.txt $(DESTDIR)$(pythondir)/pyme
+ $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
+ mv install_files.txt $(DESTDIR)$(pythondir)/gpg
uninstall-local:
- xargs <$(DESTDIR)$(pythondir)/pyme/install_files.txt -- rm -rf --
- rm -rf -- $(DESTDIR)$(pythondir)/pyme
+ xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
+ rm -rf -- $(DESTDIR)$(pythondir)/gpg
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/lang/python/README b/lang/python/README
index 98c007e..6a2e8b8 100644
--- a/lang/python/README
+++ b/lang/python/README
@@ -1,10 +1,10 @@
-PyME - GPGME for Python -*- org -*-
+gpg - GPGME bindings for Python -*- org -*-
=======================
-PyME is a python interface to the GPGME library:
+The "gpg" module is a python interface to the GPGME library:
https://www.gnupg.org/related_software/gpgme/
-PyME offers two interfaces, one is a high-level, curated, and
+"gpg" offers two interfaces, one is a high-level, curated, and
idiomatic interface that is implemented as a shim on top of the
low-level interface automatically created using SWIG.
@@ -27,20 +27,22 @@ https://bugs.gnupg.org/gnupg/
* Authors
-PyME has been created by John Goerzen, and maintained, developed, and
+PyME was created by John Goerzen, and maintained, developed, and
cherished by Igor Belyi, Martin Albrecht, Ben McGinnes, and everyone
who contributed to it in any way.
In 2016 we merged a port of PyME to into the GPGME repository, and
development will continue there. Please see the VCS history for the
list of contributors, and if you do find bugs, or want to contribute,
-please get in touch and help maintain PyME.
+please get in touch and help maintain the python gpg bindings.
Please see the section 'History' further down this document for
references to previous versions.
* History
+ - The python bindings were renamed from PyME to "gpg" in 2016.
+
- The bindings have been merged into the GPGME repository in 2016.
- The latest version of PyME for Python 3.2 and above (as of
diff --git a/lang/python/examples/assuan.py b/lang/python/examples/assuan.py
index 22960d3..dd42ad4 100644
--- a/lang/python/examples/assuan.py
+++ b/lang/python/examples/assuan.py
@@ -20,9 +20,9 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
+import gpg
-with pyme.Context(protocol=pyme.constants.PROTOCOL_ASSUAN) as c:
+with gpg.Context(protocol=gpg.constants.protocol.ASSUAN) as c:
# Invoke the pinentry to get a confirmation.
err = c.assuan_transact(['GET_CONFIRMATION', 'Hello there'])
print("You chose {}.".format("cancel" if err else "ok"))
diff --git a/lang/python/examples/decryption-filter.py b/lang/python/examples/decryption-filter.py
index 3007c2b..987dfd1 100644
--- a/lang/python/examples/decryption-filter.py
+++ b/lang/python/examples/decryption-filter.py
@@ -17,7 +17,7 @@
"""A decryption filter
-This demonstrates decryption using pyme3 in three lines of code. To
+This demonstrates decryption using gpg3 in three lines of code. To
be used like this:
./decryption-filter.py <message.gpg >message.plain
@@ -28,5 +28,5 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
-pyme.Context().decrypt(sys.stdin, sink=sys.stdout)
+import gpg
+gpg.Context().decrypt(sys.stdin, sink=sys.stdout)
diff --git a/lang/python/examples/delkey.py b/lang/python/examples/delkey.py
index a02f412..12510f3 100755
--- a/lang/python/examples/delkey.py
+++ b/lang/python/examples/delkey.py
@@ -22,12 +22,12 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
+import gpg
-with pyme.Context() as c:
+with gpg.Context() as c:
# Note: We must not modify the key store during iteration,
# therefore, we explicitly make a list.
- keys = list(c.keylist("joe+pyme@example.org"))
+ keys = list(c.keylist("joe+gpg@example.org"))
for k in keys:
c.op_delete(k, True)
diff --git a/lang/python/examples/encrypt-to-all.py b/lang/python/examples/encrypt-to-all.py
index 35873bd..bad4220 100755
--- a/lang/python/examples/encrypt-to-all.py
+++ b/lang/python/examples/encrypt-to-all.py
@@ -26,9 +26,9 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
+import gpg
-with pyme.Context(armor=True) as c:
+with gpg.Context(armor=True) as c:
recipients = list()
for key in c.keylist():
valid = 0
@@ -42,7 +42,7 @@ with pyme.Context(armor=True) as c:
try:
ciphertext, _, _ = c.encrypt(b'This is my message.',
recipients=recipients)
- except pyme.errors.InvalidRecipients as e:
+ except gpg.errors.InvalidRecipients as e:
print("Encryption failed for these keys:\n{0!s}".format(e))
# filter out the bad keys
diff --git a/lang/python/examples/exportimport.py b/lang/python/examples/exportimport.py
index bc946bc..8ae87a8 100755
--- a/lang/python/examples/exportimport.py
+++ b/lang/python/examples/exportimport.py
@@ -17,18 +17,18 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
# Sample of export and import of keys
-# It uses keys for joe+pyme@example.org generated by genkey.py script
+# It uses keys for joe+gpg@example.org generated by genkey.py script
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
-import pyme
+import gpg
-user = "joe+pyme@example.org"
+user = "joe+gpg@example.org"
-with pyme.Context(armor=True) as c, pyme.Data() as expkey:
+with gpg.Context(armor=True) as c, gpg.Data() as expkey:
print(" - Export %s's public keys - " % user)
c.op_export(user, 0, expkey)
@@ -43,7 +43,7 @@ with pyme.Context(armor=True) as c, pyme.Data() as expkey:
# delete keys to ensure that they came from our imported data. Note
# that if joe's key has private part as well we can only delete both
# of them.
-with pyme.Context() as c:
+with gpg.Context() as c:
# Note: We must not modify the key store during iteration,
# therfore, we explicitly make a list.
keys = list(c.keylist(user))
@@ -51,7 +51,7 @@ with pyme.Context() as c:
for k in keys:
c.op_delete(k, True)
-with pyme.Context() as c:
+with gpg.Context() as c:
print(" - Import exported keys - ")
c.op_import(expstring)
result = c.op_import_result()
diff --git a/lang/python/examples/genkey.py b/lang/python/examples/genkey.py
index ee70303..a043500 100755
--- a/lang/python/examples/genkey.py
+++ b/lang/python/examples/genkey.py
@@ -20,7 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
+import gpg
# This is the example from the GPGME manual.
@@ -31,14 +31,14 @@ Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: Joe Tester
Name-Comment: with stupid passphrase
-Name-Email: joe+pyme@example.org
+Name-Email: joe+gpg@example.org
Passphrase: Crypt0R0cks
Expire-Date: 2020-12-31
</GnupgKeyParms>
"""
-with pyme.Context() as c:
- c.set_progress_cb(pyme.callbacks.progress_stdout)
+with gpg.Context() as c:
+ c.set_progress_cb(gpg.callbacks.progress_stdout)
c.op_genkey(parms, None, None)
print("Generated key with fingerprint {0}.".format(
c.op_genkey_result().fpr))
diff --git a/lang/python/examples/inter-edit.py b/lang/python/examples/inter-edit.py
index 3c0f29b..ed0d8c4 100644
--- a/lang/python/examples/inter-edit.py
+++ b/lang/python/examples/inter-edit.py
@@ -22,14 +22,14 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
+import gpg
if len(sys.argv) != 2:
sys.exit("Usage: %s <Gpg key pattern>\n" % sys.argv[0])
name = sys.argv[1]
-with pyme.Context() as c:
+with gpg.Context() as c:
keys = list(c.keylist(name))
if len(keys) == 0:
sys.exit("No key matching {}.".format(name))
diff --git a/lang/python/examples/sign.py b/lang/python/examples/sign.py
index 2f235ba..16c2256 100755
--- a/lang/python/examples/sign.py
+++ b/lang/python/examples/sign.py
@@ -20,9 +20,9 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
-from pyme.constants.sig import mode
+import gpg
+from gpg.constants.sig import mode
-with pyme.Context() as c:
+with gpg.Context() as c:
signed, _ = c.sign(b"Test message", mode=mode.CLEAR)
sys.stdout.buffer.write(signed)
diff --git a/lang/python/examples/signverify.py b/lang/python/examples/signverify.py
index 03bc0a6..5870ca9 100755
--- a/lang/python/examples/signverify.py
+++ b/lang/python/examples/signverify.py
@@ -17,18 +17,18 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
# Sample of unattended signing/verifying of a message.
-# It uses keys for joe+pyme@example.org generated by genkey.py script
+# It uses keys for joe+gpg@example.org generated by genkey.py script
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
-from pyme.constants.sig import mode
+import gpg
+from gpg.constants.sig import mode
-user = "joe+pyme"
+user = "joe+gpg"
-with pyme.Context(pinentry_mode=pyme.constants.PINENTRY_MODE_LOOPBACK) as c:
+with gpg.Context(pinentry_mode=gpg.constants.PINENTRY_MODE_LOOPBACK) as c:
keys = list(c.keylist(user))
if len(keys) == 0:
sys.exit("No key matching {}.".format(user))
diff --git a/lang/python/examples/simple.py b/lang/python/examples/simple.py
index 5598487..8f451d7 100755
--- a/lang/python/examples/simple.py
+++ b/lang/python/examples/simple.py
@@ -21,9 +21,9 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
+import gpg
-with pyme.Context(armor=True) as c:
+with gpg.Context(armor=True) as c:
recipients = []
print("Enter name of your recipient(s), end with a blank line.")
while True:
diff --git a/lang/python/examples/testCMSgetkey.py b/lang/python/examples/testCMSgetkey.py
index 62c35d2..d4c0884 100644
--- a/lang/python/examples/testCMSgetkey.py
+++ b/lang/python/examples/testCMSgetkey.py
@@ -22,12 +22,12 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
+import gpg
if len(sys.argv) != 2:
sys.exit("fingerprint or unique key ID for gpgme_get_key()")
-with pyme.Context(protocol=pyme.constants.PROTOCOL_CMS) as c:
+with gpg.Context(protocol=gpg.constants.protocol.CMS) as c:
key = c.get_key(sys.argv[1])
print("got key: ", key.subkeys[0].fpr)
diff --git a/lang/python/examples/verifydetails.py b/lang/python/examples/verifydetails.py
index 81f82e9..b3ca133 100755
--- a/lang/python/examples/verifydetails.py
+++ b/lang/python/examples/verifydetails.py
@@ -21,24 +21,23 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-from pyme import core
-from pyme.constants import protocol
+import gpg
def print_engine_infos():
- print("gpgme version:", core.check_version(None))
+ print("gpgme version:", gpg.core.check_version(None))
print("engines:")
- for engine in core.get_engine_info():
+ for engine in gpg.core.get_engine_info():
print(engine.file_name, engine.version)
- for proto in [protocol.OpenPGP, protocol.CMS]:
- print("Have {}? {}".format(core.get_protocol_name(proto),
- core.engine_check_version(proto)))
+ for proto in [gpg.constants.protocol.OpenPGP, gpg.constants.protocol.CMS]:
+ print("Have {}? {}".format(gpg.core.get_protocol_name(proto),
+ gpg.core.engine_check_version(proto)))
def verifyprintdetails(filename, detached_sig_filename=None):
"""Verify a signature, print a lot of details."""
- with core.Context() as c:
+ with gpg.Context() as c:
# Verify.
data, result = c.verify(open(filename),
diff --git a/lang/python/pyme/__init__.py b/lang/python/gpg/__init__.py
index 12c96c2..385b17e 100644
--- a/lang/python/pyme/__init__.py
+++ b/lang/python/gpg/__init__.py
@@ -16,17 +16,13 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Pyme: GPGME Interface for Python
+"""gpg: GnuPG Interface for Python (GPGME bindings)
-Welcome to PyME, the GPGME Interface for Python. "Pyme", when prounced,
-rhymes with "Pine".
+Welcome to gpg, the GnuPG Interface for Python.
The latest release of this package may be obtained from
https://www.gnupg.org
-Previous releases of this package for Python 2 can be obtained from
-http://pyme.sourceforge.net
-
FEATURES
--------
@@ -43,23 +39,23 @@ FEATURES
QUICK EXAMPLE
-------------
- >>> import pyme
- >>> with pyme.Context() as c:
- >>> with pyme.Context() as c:
+ >>> import gpg
+ >>> with gpg.Context() as c:
+ >>> with gpg.Context() as c:
... cipher, _, _ = c.encrypt("Hello world :)".encode(),
... passphrase="abc")
... c.decrypt(cipher, passphrase="abc")
...
(b'Hello world :)',
- <pyme.results.DecryptResult object at 0x7f5ab8121080>,
- <pyme.results.VerifyResult object at 0x7f5ab81219b0>)
+ <gpg.results.DecryptResult object at 0x7f5ab8121080>,
+ <gpg.results.VerifyResult object at 0x7f5ab81219b0>)
GENERAL OVERVIEW
----------------
For those of you familiar with GPGME, you will be right at home here.
-Pyme is, for the most part, a direct interface to the C GPGME
+The python gpg module is, for the most part, a direct interface to the C GPGME
library. However, it is re-packaged in a more Pythonic way --
object-oriented with classes and modules. Take a look at the classes
defined here -- they correspond directly to certain object types in GPGME
@@ -77,7 +73,7 @@ context = core.Context()
context.op_encrypt(recp, 1, plain, cipher)
The Python module automatically does error-checking and raises Python
-exception pyme.errors.GPGMEError when GPGME signals an error. getcode()
+exception gpg.errors.GPGMEError when GPGME signals an error. getcode()
and getsource() of this exception return code and source of the error.
IMPORTANT NOTE
@@ -94,7 +90,7 @@ be found only in GPGME documentation.
FOR MORE INFORMATION
--------------------
-PYME3 homepage: https://www.gnupg.org/
+GnuPG homepage: https://www.gnupg.org/
GPGME documentation: https://www.gnupg.org/documentation/manuals/gpgme/
"""
diff --git a/lang/python/pyme/callbacks.py b/lang/python/gpg/callbacks.py
index b25a9a7..b25a9a7 100644
--- a/lang/python/pyme/callbacks.py
+++ b/lang/python/gpg/callbacks.py
diff --git a/lang/python/pyme/constants/__init__.py b/lang/python/gpg/constants/__init__.py
index 96d89e4..4fb3d6f 100644
--- a/lang/python/pyme/constants/__init__.py
+++ b/lang/python/gpg/constants/__init__.py
@@ -1,15 +1,43 @@
+# Constants.
+#
+# Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_', globals())
+del util
+
+# For convenience, we import the modules here.
+from . import data, event, keylist, md, pk
+from . import protocol, sig, sigsum, status, validity
+
+# A complication arises because 'import' is a reserved keyword.
+# Import it as 'Import' instead.
+globals()['Import'] = getattr(__import__('', globals(), locals(),
+ [str('import')], 1), "import")
__all__ = ['data', 'event', 'import', 'keylist', 'md', 'pk',
'protocol', 'sig', 'sigsum', 'status', 'validity']
# GPGME 1.7 replaced gpgme_op_edit with gpgme_op_interact. We
-# implement pyme.Context.op_edit using gpgme_op_interact, so the
+# implement gpg.Context.op_edit using gpgme_op_interact, so the
# callbacks will be called with string keywords instead of numeric
# status messages. Code that is using these constants will continue
# to work.
diff --git a/lang/python/pyme/constants/data/__init__.py b/lang/python/gpg/constants/data/__init__.py
index 8274ab9..8274ab9 100644
--- a/lang/python/pyme/constants/data/__init__.py
+++ b/lang/python/gpg/constants/data/__init__.py
diff --git a/lang/python/pyme/constants/data/encoding.py b/lang/python/gpg/constants/data/encoding.py
index a05dbb4..e76a22e 100644
--- a/lang/python/pyme/constants/data/encoding.py
+++ b/lang/python/gpg/constants/data/encoding.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_DATA_ENCODING_', globals())
+del util
diff --git a/lang/python/pyme/constants/event.py b/lang/python/gpg/constants/event.py
index 2e30c5e..1b14d1d 100644
--- a/lang/python/pyme/constants/event.py
+++ b/lang/python/gpg/constants/event.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_EVENT_', globals())
+del util
diff --git a/lang/python/pyme/constants/import.py b/lang/python/gpg/constants/import.py
index 10e7d3c..47c296c 100644
--- a/lang/python/pyme/constants/import.py
+++ b/lang/python/gpg/constants/import.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_IMPORT_', globals())
+del util
diff --git a/lang/python/pyme/constants/keylist/__init__.py b/lang/python/gpg/constants/keylist/__init__.py
index 2ce0edf..2ce0edf 100644
--- a/lang/python/pyme/constants/keylist/__init__.py
+++ b/lang/python/gpg/constants/keylist/__init__.py
diff --git a/lang/python/pyme/constants/keylist/mode.py b/lang/python/gpg/constants/keylist/mode.py
index 000dd79..39e1819 100644
--- a/lang/python/pyme/constants/keylist/mode.py
+++ b/lang/python/gpg/constants/keylist/mode.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_KEYLIST_MODE_', globals())
+del util
diff --git a/lang/python/pyme/constants/md.py b/lang/python/gpg/constants/md.py
index dbd762c..f3e8bbd 100644
--- a/lang/python/pyme/constants/md.py
+++ b/lang/python/gpg/constants/md.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_MD_', globals())
+del util
diff --git a/lang/python/pyme/constants/pk.py b/lang/python/gpg/constants/pk.py
index cfc5309..6bf2a21 100644
--- a/lang/python/pyme/constants/pk.py
+++ b/lang/python/gpg/constants/pk.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_PK_', globals())
+del util
diff --git a/lang/python/pyme/constants/protocol.py b/lang/python/gpg/constants/protocol.py
index a4b6583..d086bbd 100644
--- a/lang/python/pyme/constants/protocol.py
+++ b/lang/python/gpg/constants/protocol.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_PROTOCOL_', globals())
+del util
diff --git a/lang/python/pyme/constants/sig/__init__.py b/lang/python/gpg/constants/sig/__init__.py
index 2ce0edf..39d4e6e 100644
--- a/lang/python/pyme/constants/sig/__init__.py
+++ b/lang/python/gpg/constants/sig/__init__.py
@@ -2,5 +2,5 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from . import mode
-__all__ = ['mode']
+from . import mode, notation
+__all__ = ['mode', 'notation']
diff --git a/lang/python/pyme/constants/sig/mode.py b/lang/python/gpg/constants/sig/mode.py
index fb534bc..0f4f0ef 100644
--- a/lang/python/pyme/constants/sig/mode.py
+++ b/lang/python/gpg/constants/sig/mode.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_SIG_MODE_', globals())
+del util
diff --git a/lang/python/gpg/constants/sig/notation.py b/lang/python/gpg/constants/sig/notation.py
new file mode 100644
index 0000000..9a79e01
--- /dev/null
+++ b/lang/python/gpg/constants/sig/notation.py
@@ -0,0 +1,25 @@
+# Constants for signature notation data.
+#
+# Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
+
+from __future__ import absolute_import, print_function, unicode_literals
+del absolute_import, print_function, unicode_literals
+
+from gpg import util
+util.process_constants('GPGME_SIG_NOTATION_', globals())
+del util
diff --git a/lang/python/pyme/constants/sigsum.py b/lang/python/gpg/constants/sigsum.py
index 3d94745..09ef9d7 100644
--- a/lang/python/pyme/constants/sigsum.py
+++ b/lang/python/gpg/constants/sigsum.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_SIGSUM_', globals())
+del util
diff --git a/lang/python/pyme/constants/status.py b/lang/python/gpg/constants/status.py
index a04d9aa..a0ad073 100644
--- a/lang/python/pyme/constants/status.py
+++ b/lang/python/gpg/constants/status.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
# GPGME 1.7 replaced gpgme_op_edit with gpgme_op_interact. We
-# implement pyme.Context.op_edit using gpgme_op_interact, so the
+# implement gpg.Context.op_edit using gpgme_op_interact, so the
# callbacks will be called with string keywords instead of numeric
# status messages. Code that is using these constants will continue
# to work.
diff --git a/lang/python/pyme/constants/validity.py b/lang/python/gpg/constants/validity.py
index 4ecd4d3..d3c5345 100644
--- a/lang/python/pyme/constants/validity.py
+++ b/lang/python/gpg/constants/validity.py
@@ -18,5 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import util
+from gpg import util
util.process_constants('GPGME_VALIDITY_', globals())
+del util
diff --git a/lang/python/pyme/core.py b/lang/python/gpg/core.py
index f0eab43..748bcbb 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/gpg/core.py
@@ -131,13 +131,13 @@ class GpgmeWrapper(object):
def _funcwrap(slf, *args):
result = func(slf.wrapped, *args)
if slf._callback_excinfo:
- gpgme.pyme_raise_callback_exception(slf)
+ gpgme.gpg_raise_callback_exception(slf)
return errorcheck(result, "Invocation of " + name)
else:
def _funcwrap(slf, *args):
result = func(slf.wrapped, *args)
if slf._callback_excinfo:
- gpgme.pyme_raise_callback_exception(slf)
+ gpgme.gpg_raise_callback_exception(slf)
return result
doc = self._munge_docstring.sub(r'\2.\1(\3', getattr(func, "__doc__"))
@@ -528,7 +528,7 @@ class Context(GpgmeWrapper):
errptr)
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
errorcheck(err)
@@ -567,7 +567,7 @@ class Context(GpgmeWrapper):
result = gpgme.gpgme_op_interact(self.wrapped, key, flags,
opaquedata, sink)
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
errorcheck(result)
@property
@@ -743,10 +743,10 @@ class Context(GpgmeWrapper):
hookdata = (weakref.ref(self), func)
else:
hookdata = (weakref.ref(self), func, hook)
- gpgme.pyme_set_passphrase_cb(self, hookdata)
+ gpgme.gpg_set_passphrase_cb(self, hookdata)
def _free_passcb(self):
- if gpgme.pyme_set_passphrase_cb:
+ if gpgme.gpg_set_passphrase_cb:
self.set_passphrase_cb(None)
def set_progress_cb(self, func, hook=None):
@@ -768,10 +768,10 @@ class Context(GpgmeWrapper):
hookdata = (weakref.ref(self), func)
else:
hookdata = (weakref.ref(self), func, hook)
- gpgme.pyme_set_progress_cb(self, hookdata)
+ gpgme.gpg_set_progress_cb(self, hookdata)
def _free_progresscb(self):
- if gpgme.pyme_set_progress_cb:
+ if gpgme.gpg_set_progress_cb:
self.set_progress_cb(None)
def set_status_cb(self, func, hook=None):
@@ -792,10 +792,10 @@ class Context(GpgmeWrapper):
hookdata = (weakref.ref(self), func)
else:
hookdata = (weakref.ref(self), func, hook)
- gpgme.pyme_set_status_cb(self, hookdata)
+ gpgme.gpg_set_status_cb(self, hookdata)
def _free_statuscb(self):
- if gpgme.pyme_set_status_cb:
+ if gpgme.gpg_set_status_cb:
self.set_status_cb(None)
@property
@@ -958,7 +958,7 @@ class Data(GpgmeWrapper):
if self.wrapped != None and gpgme.gpgme_data_release:
gpgme.gpgme_data_release(self.wrapped)
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
self.wrapped = None
self._free_datacbs()
@@ -1003,7 +1003,7 @@ class Data(GpgmeWrapper):
else:
hookdata = (weakref.ref(self),
read_cb, write_cb, seek_cb, release_cb)
- gpgme.pyme_data_new_from_cbs(self, hookdata, tmp)
+ gpgme.gpg_data_new_from_cbs(self, hookdata, tmp)
self.wrapped = gpgme.gpgme_data_t_p_value(tmp)
gpgme.delete_gpgme_data_t_p(tmp)
@@ -1057,7 +1057,7 @@ class Data(GpgmeWrapper):
written = gpgme.gpgme_data_write(self.wrapped, buffer)
if written < 0:
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
else:
raise GPGMEError.fromSyserror()
return written
@@ -1078,7 +1078,7 @@ class Data(GpgmeWrapper):
result = gpgme.gpgme_data_read(self.wrapped, size)
except:
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
else:
raise
return result
@@ -1089,7 +1089,7 @@ class Data(GpgmeWrapper):
result = gpgme.gpgme_data_read(self.wrapped, 4096)
except:
if self._callback_excinfo:
- gpgme.pyme_raise_callback_exception(self)
+ gpgme.gpg_raise_callback_exception(self)
else:
raise
if len(result) == 0:
diff --git a/lang/python/pyme/errors.py b/lang/python/gpg/errors.py
index 0fd85ef..1ce139e 100644
--- a/lang/python/pyme/errors.py
+++ b/lang/python/gpg/errors.py
@@ -27,11 +27,12 @@ NO_ERROR = None
EOF = None
util.process_constants('GPG_ERR_', globals())
+del util
-class PymeError(Exception):
+class GpgError(Exception):
pass
-class GPGMEError(PymeError):
+class GPGMEError(GpgError):
def __init__(self, error = None, message = None):
self.error = error
self.message = message
@@ -76,7 +77,7 @@ class KeyNotFound(GPGMEError, KeyError):
# These errors are raised in the idiomatic interface code.
-class EncryptionError(PymeError):
+class EncryptionError(GpgError):
pass
class InvalidRecipients(EncryptionError):
@@ -87,7 +88,7 @@ class InvalidRecipients(EncryptionError):
gpgme.gpgme_strerror(r.reason))
for r in self.recipients)
-class DeryptionError(PymeError):
+class DeryptionError(GpgError):
pass
class UnsupportedAlgorithm(DeryptionError):
@@ -96,7 +97,7 @@ class UnsupportedAlgorithm(DeryptionError):
def __str__(self):
return self.algorithm
-class SigningError(PymeError):
+class SigningError(GpgError):
pass
class InvalidSigners(SigningError):
@@ -107,7 +108,7 @@ class InvalidSigners(SigningError):
gpgme.gpgme_strerror(s.reason))
for s in self.signers)
-class VerificationError(PymeError):
+class VerificationError(GpgError):
pass
class BadSignatures(VerificationError):
diff --git a/lang/python/pyme/gpgme.py b/lang/python/gpg/gpgme.py
index ea4983d..238359d 100644
--- a/lang/python/pyme/gpgme.py
+++ b/lang/python/gpg/gpgme.py
@@ -120,6 +120,7 @@ except AttributeError:
+
# This file is compatible with both classic and new-style classes.
diff --git a/lang/python/pyme/results.py b/lang/python/gpg/results.py
index 3383896..3383896 100644
--- a/lang/python/pyme/results.py
+++ b/lang/python/gpg/results.py
diff --git a/lang/python/pyme/util.py b/lang/python/gpg/util.py
index e4fca4c..e4fca4c 100644
--- a/lang/python/pyme/util.py
+++ b/lang/python/gpg/util.py
diff --git a/lang/python/pyme/version.py b/lang/python/gpg/version.py
index 13c5129..9ec657d 100644
--- a/lang/python/pyme/version.py
+++ b/lang/python/gpg/version.py
@@ -21,10 +21,10 @@ del absolute_import, print_function
from . import gpgme
-productname = 'pyme'
-versionstr = "1.7.1"
+productname = 'gpg'
+versionstr = "1.8.0"
gpgme_versionstr = gpgme.GPGME_VERSION
-in_tree_build = bool(gpgme.cvar.pyme_in_tree_build)
+in_tree_build = bool(gpgme.cvar.gpg_in_tree_build)
versionlist = versionstr.split(".")
major = versionlist[0]
diff --git a/lang/python/pyme/version.py.in b/lang/python/gpg/version.py.in
index cfb9510..1a1baf0 100644
--- a/lang/python/pyme/version.py.in
+++ b/lang/python/gpg/version.py.in
@@ -21,10 +21,10 @@ del absolute_import, print_function
from . import gpgme
-productname = 'pyme'
+productname = 'gpg'
versionstr = "@VERSION@"
gpgme_versionstr = gpgme.GPGME_VERSION
-in_tree_build = bool(gpgme.cvar.pyme_in_tree_build)
+in_tree_build = bool(gpgme.cvar.gpg_in_tree_build)
versionlist = versionstr.split(".")
major = versionlist[0]
diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i
index 5d074aa..783531f 100644
--- a/lang/python/gpgme.i
+++ b/lang/python/gpgme.i
@@ -159,7 +159,7 @@
$1 = NULL;
else {
PyObject *pypointer;
- pypointer = _pyme_obj2gpgme_data_t($input, $argnum, &wrapper,
+ pypointer = _gpg_obj2gpgme_data_t($input, $argnum, &wrapper,
&bytesio, &view);
if (pypointer == NULL)
return NULL;
@@ -428,7 +428,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "EncryptResult");
+ $result = _gpg_wrap_result(fragile, "EncryptResult");
Py_DECREF(fragile);
}
@@ -436,7 +436,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "DecryptResult");
+ $result = _gpg_wrap_result(fragile, "DecryptResult");
Py_DECREF(fragile);
}
@@ -444,7 +444,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "SignResult");
+ $result = _gpg_wrap_result(fragile, "SignResult");
Py_DECREF(fragile);
}
@@ -452,7 +452,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "VerifyResult");
+ $result = _gpg_wrap_result(fragile, "VerifyResult");
Py_DECREF(fragile);
}
@@ -460,7 +460,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "ImportResult");
+ $result = _gpg_wrap_result(fragile, "ImportResult");
Py_DECREF(fragile);
}
@@ -468,7 +468,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "GenkeyResult");
+ $result = _gpg_wrap_result(fragile, "GenkeyResult");
Py_DECREF(fragile);
}
@@ -476,7 +476,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "KeylistResult");
+ $result = _gpg_wrap_result(fragile, "KeylistResult");
Py_DECREF(fragile);
}
@@ -484,7 +484,7 @@
PyObject *fragile;
fragile = SWIG_NewPointerObj(SWIG_as_voidptr($1), $1_descriptor,
%newpointer_flags);
- $result = _pyme_wrap_result(fragile, "VFSMountResult");
+ $result = _gpg_wrap_result(fragile, "VFSMountResult");
Py_DECREF(fragile);
}
@@ -507,7 +507,7 @@
Py_DECREF($result);
return NULL; /* raise */
}
- o = _pyme_wrap_result(fragile, "EngineInfo");
+ o = _gpg_wrap_result(fragile, "EngineInfo");
Py_DECREF(fragile);
if (o == NULL)
{
@@ -528,7 +528,7 @@
return PyErr_Format(PyExc_TypeError,
"interact callback must be a tuple of size 2 or 3");
- $1 = (gpgme_interact_cb_t) _pyme_interact_cb;
+ $1 = (gpgme_interact_cb_t) _gpg_interact_cb;
$2 = $input;
}
@@ -547,7 +547,7 @@
"callback must be a tuple of size 2");
if (! PyCallable_Check(PyTuple_GetItem($input, 1)))
return PyErr_Format(PyExc_TypeError, "second item must be callable");
- $1 = _pyme_assuan_data_cb;
+ $1 = _gpg_assuan_data_cb;
$2 = $input;
}
}
@@ -564,7 +564,7 @@
"callback must be a tuple of size 2");
if (! PyCallable_Check(PyTuple_GetItem($input, 1)))
return PyErr_Format(PyExc_TypeError, "second item must be callable");
- $1 = _pyme_assuan_inquire_cb;
+ $1 = _gpg_assuan_inquire_cb;
$2 = $input;
}
}
@@ -581,7 +581,7 @@
"callback must be a tuple of size 2");
if (! PyCallable_Check(PyTuple_GetItem($input, 1)))
return PyErr_Format(PyExc_TypeError, "second item must be callable");
- $1 = _pyme_assuan_status_cb;
+ $1 = _gpg_assuan_status_cb;
$2 = $input;
}
}
@@ -654,13 +654,13 @@ FILE *fdopen(int fildes, const char *mode);
/* SWIG runtime support for helpers.c */
PyObject *
-_pyme_wrap_gpgme_data_t(gpgme_data_t data)
+_gpg_wrap_gpgme_data_t(gpgme_data_t data)
{
return SWIG_Python_NewPointerObj(NULL, data, SWIGTYPE_p_gpgme_data, 0);
}
gpgme_ctx_t
-_pyme_unwrap_gpgme_ctx_t(PyObject *wrapped)
+_gpg_unwrap_gpgme_ctx_t(PyObject *wrapped)
{
gpgme_ctx_t result;
if (SWIG_ConvertPtr(wrapped,
diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 3724752..8f71a30 100644
--- a/lang/python/helpers.c
+++ b/lang/python/helpers.c
@@ -33,7 +33,7 @@
#include "private.h"
/* Flag specifying whether this is an in-tree build. */
-int pyme_in_tree_build =
+int gpg_in_tree_build =
#if IN_TREE_BUILD
1
#else
@@ -43,7 +43,7 @@ int pyme_in_tree_build =
static PyObject *GPGMEError = NULL;
-void _pyme_exception_init(void) {
+void _gpg_exception_init(void) {
if (GPGMEError == NULL) {
PyObject *errors;
PyObject *from_list = PyList_New(0);
@@ -58,11 +58,11 @@ void _pyme_exception_init(void) {
}
static PyObject *
-_pyme_raise_exception(gpgme_error_t err)
+_gpg_raise_exception(gpgme_error_t err)
{
PyObject *e;
- _pyme_exception_init();
+ _gpg_exception_init();
if (GPGMEError == NULL)
return PyErr_Format(PyExc_RuntimeError, "Got gpgme_error_t %d", err);
@@ -76,7 +76,7 @@ _pyme_raise_exception(gpgme_error_t err)
return NULL; /* raise */
}
-gpgme_error_t _pyme_exception2code(void) {
+gpgme_error_t _gpg_exception2code(void) {
gpgme_error_t err_status = gpg_error(GPG_ERR_GENERAL);
if (GPGMEError && PyErr_ExceptionMatches(GPGMEError)) {
PyObject *type = 0, *value = 0, *traceback = 0;
@@ -94,7 +94,7 @@ gpgme_error_t _pyme_exception2code(void) {
/* Exception support for callbacks. */
#define EXCINFO "_callback_excinfo"
-static void _pyme_stash_callback_exception(PyObject *weak_self)
+static void _gpg_stash_callback_exception(PyObject *weak_self)
{
PyObject *self, *ptype, *pvalue, *ptraceback, *excinfo;
@@ -136,7 +136,7 @@ static void _pyme_stash_callback_exception(PyObject *weak_self)
Py_DECREF(excinfo);
}
-PyObject *pyme_raise_callback_exception(PyObject *self)
+PyObject *gpg_raise_callback_exception(PyObject *self)
{
PyGILState_STATE state = PyGILState_Ensure();
PyObject *ptype, *pvalue, *ptraceback, *excinfo;
@@ -192,7 +192,7 @@ PyObject *pyme_raise_callback_exception(PyObject *self)
/* Convert object to a pointer to gpgme type, generic version. */
PyObject *
-_pyme_obj2gpgme_t(PyObject *input, const char *objtype, int argnum)
+_gpg_obj2gpgme_t(PyObject *input, const char *objtype, int argnum)
{
PyObject *pyname = NULL, *pypointer = NULL;
pyname = PyObject_GetAttrString(input, "_ctype");
@@ -229,7 +229,7 @@ _pyme_obj2gpgme_t(PyObject *input, const char *objtype, int argnum)
objects with a fileno method, returning it in WRAPPER. This object
must be de-referenced when no longer needed. */
PyObject *
-_pyme_obj2gpgme_data_t(PyObject *input, int argnum, gpgme_data_t *wrapper,
+_gpg_obj2gpgme_data_t(PyObject *input, int argnum, gpgme_data_t *wrapper,
PyObject **bytesio, Py_buffer *view)
{
gpgme_error_t err;
@@ -242,9 +242,9 @@ _pyme_obj2gpgme_data_t(PyObject *input, int argnum, gpgme_data_t *wrapper,
err = gpgme_data_new_from_fd(wrapper, (int) PyLong_AsLong(fd));
Py_DECREF(fd);
if (err)
- return _pyme_raise_exception (err);
+ return _gpg_raise_exception (err);
- return _pyme_wrap_gpgme_data_t(*wrapper);
+ return _gpg_wrap_gpgme_data_t(*wrapper);
}
else
PyErr_Clear();
@@ -283,17 +283,17 @@ _pyme_obj2gpgme_data_t(PyObject *input, int argnum, gpgme_data_t *wrapper,
err = gpgme_data_new_from_mem(wrapper, view->buf, (size_t) view->len, 0);
if (err)
- return _pyme_raise_exception (err);
+ return _gpg_raise_exception (err);
- return _pyme_wrap_gpgme_data_t(*wrapper);
+ return _gpg_wrap_gpgme_data_t(*wrapper);
}
/* As last resort we assume it is a wrapped data object. */
if (PyObject_HasAttrString(data, "_ctype"))
- return _pyme_obj2gpgme_t(data, "gpgme_data_t", argnum);
+ return _gpg_obj2gpgme_t(data, "gpgme_data_t", argnum);
return PyErr_Format(PyExc_TypeError,
- "arg %d: expected pyme.Data, file, or an object "
+ "arg %d: expected gpg.Data, file, or an object "
"implementing the buffer protocol, got %s",
argnum, data->ob_type->tp_name);
}
@@ -301,7 +301,7 @@ _pyme_obj2gpgme_data_t(PyObject *input, int argnum, gpgme_data_t *wrapper,
PyObject *
-_pyme_wrap_result(PyObject *fragile, const char *classname)
+_gpg_wrap_result(PyObject *fragile, const char *classname)
{
static PyObject *results;
PyObject *class;
@@ -348,7 +348,7 @@ static gpgme_error_t pyPassphraseCb(void *hook,
PyObject *encoded = NULL;
gpgme_error_t err_status = 0;
- _pyme_exception_init();
+ _gpg_exception_init();
assert (PyTuple_Check(pyhook));
assert (PyTuple_Size(pyhook) == 2 || PyTuple_Size(pyhook) == 3);
@@ -385,12 +385,12 @@ static gpgme_error_t pyPassphraseCb(void *hook,
retval = PyObject_CallObject(func, args);
Py_DECREF(args);
if (PyErr_Occurred()) {
- err_status = _pyme_exception2code();
+ err_status = _gpg_exception2code();
} else {
if (!retval) {
if (write(fd, "\n", 1) < 0) {
err_status = gpgme_error_from_syserror ();
- _pyme_raise_exception (err_status);
+ _gpg_raise_exception (err_status);
}
} else {
char *buf;
@@ -425,11 +425,11 @@ static gpgme_error_t pyPassphraseCb(void *hook,
if (write(fd, buf, len) < 0) {
err_status = gpgme_error_from_syserror ();
- _pyme_raise_exception (err_status);
+ _gpg_raise_exception (err_status);
}
if (! err_status && write(fd, "\n", 1) < 0) {
err_status = gpgme_error_from_syserror ();
- _pyme_raise_exception (err_status);
+ _gpg_raise_exception (err_status);
}
Py_DECREF(retval);
@@ -438,7 +438,7 @@ static gpgme_error_t pyPassphraseCb(void *hook,
leave:
if (err_status)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
Py_XDECREF(encoded);
PyGILState_Release(state);
@@ -446,7 +446,7 @@ static gpgme_error_t pyPassphraseCb(void *hook,
}
PyObject *
-pyme_set_passphrase_cb(PyObject *self, PyObject *cb) {
+gpg_set_passphrase_cb(PyObject *self, PyObject *cb) {
PyGILState_STATE state = PyGILState_Ensure();
PyObject *wrapped;
gpgme_ctx_t ctx;
@@ -459,7 +459,7 @@ pyme_set_passphrase_cb(PyObject *self, PyObject *cb) {
return NULL;
}
- ctx = _pyme_unwrap_gpgme_ctx_t(wrapped);
+ ctx = _gpg_unwrap_gpgme_ctx_t(wrapped);
Py_DECREF(wrapped);
if (ctx == NULL)
{
@@ -512,7 +512,7 @@ static void pyProgressCb(void *hook, const char *what, int type, int current,
PyTuple_SetItem(args, 0, PyUnicode_DecodeUTF8(what, strlen (what),
"strict"));
if (PyErr_Occurred()) {
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
Py_DECREF(args);
PyGILState_Release(state);
return;
@@ -527,14 +527,14 @@ static void pyProgressCb(void *hook, const char *what, int type, int current,
retval = PyObject_CallObject(func, args);
if (PyErr_Occurred())
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
Py_DECREF(args);
Py_XDECREF(retval);
PyGILState_Release(state);
}
PyObject *
-pyme_set_progress_cb(PyObject *self, PyObject *cb) {
+gpg_set_progress_cb(PyObject *self, PyObject *cb) {
PyGILState_STATE state = PyGILState_Ensure();
PyObject *wrapped;
gpgme_ctx_t ctx;
@@ -547,7 +547,7 @@ pyme_set_progress_cb(PyObject *self, PyObject *cb) {
return NULL;
}
- ctx = _pyme_unwrap_gpgme_ctx_t(wrapped);
+ ctx = _gpg_unwrap_gpgme_ctx_t(wrapped);
Py_DECREF(wrapped);
if (ctx == NULL)
{
@@ -624,19 +624,19 @@ static gpgme_error_t pyStatusCb(void *hook, const char *keyword,
retval = PyObject_CallObject(func, pyargs);
if (PyErr_Occurred())
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
Py_DECREF(pyargs);
Py_XDECREF(retval);
leave:
if (err)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
PyGILState_Release(state);
return err;
}
PyObject *
-pyme_set_status_cb(PyObject *self, PyObject *cb) {
+gpg_set_status_cb(PyObject *self, PyObject *cb) {
PyGILState_STATE state = PyGILState_Ensure();
PyObject *wrapped;
gpgme_ctx_t ctx;
@@ -649,7 +649,7 @@ pyme_set_status_cb(PyObject *self, PyObject *cb) {
return NULL;
}
- ctx = _pyme_unwrap_gpgme_ctx_t(wrapped);
+ ctx = _gpg_unwrap_gpgme_ctx_t(wrapped);
Py_DECREF(wrapped);
if (ctx == NULL)
{
@@ -684,7 +684,7 @@ pyme_set_status_cb(PyObject *self, PyObject *cb) {
/* Interact callbacks. */
gpgme_error_t
-_pyme_interact_cb(void *opaque, const char *keyword,
+_gpg_interact_cb(void *opaque, const char *keyword,
const char *args, int fd)
{
PyGILState_STATE state = PyGILState_Ensure();
@@ -694,7 +694,7 @@ _pyme_interact_cb(void *opaque, const char *keyword,
gpgme_error_t err_status = 0;
PyObject *self = NULL;
- _pyme_exception_init();
+ _gpg_exception_init();
assert (PyTuple_Check(pyopaque));
assert (PyTuple_Size(pyopaque) == 2 || PyTuple_Size(pyopaque) == 3);
@@ -725,7 +725,7 @@ _pyme_interact_cb(void *opaque, const char *keyword,
retval = PyObject_CallObject(func, pyargs);
Py_DECREF(pyargs);
if (PyErr_Occurred()) {
- err_status = _pyme_exception2code();
+ err_status = _gpg_exception2code();
} else {
if (fd>=0 && retval && PyUnicode_Check(retval)) {
PyObject *encoded = NULL;
@@ -747,18 +747,18 @@ _pyme_interact_cb(void *opaque, const char *keyword,
if (write(fd, buffer, size) < 0) {
err_status = gpgme_error_from_syserror ();
- _pyme_raise_exception (err_status);
+ _gpg_raise_exception (err_status);
}
if (! err_status && write(fd, "\n", 1) < 0) {
err_status = gpgme_error_from_syserror ();
- _pyme_raise_exception (err_status);
+ _gpg_raise_exception (err_status);
}
Py_DECREF(encoded);
}
}
leave:
if (err_status)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
Py_XDECREF(retval);
PyGILState_Release(state);
@@ -804,7 +804,7 @@ static ssize_t pyDataReadCb(void *hook, void *buffer, size_t size)
retval = PyObject_CallObject(func, pyargs);
Py_DECREF(pyargs);
if (PyErr_Occurred()) {
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
goto leave;
}
@@ -813,7 +813,7 @@ static ssize_t pyDataReadCb(void *hook, void *buffer, size_t size)
PyErr_Format(PyExc_TypeError,
"expected bytes from read callback, got %s",
retval->ob_type->tp_name);
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
goto leave;
}
@@ -822,7 +822,7 @@ static ssize_t pyDataReadCb(void *hook, void *buffer, size_t size)
PyErr_Format(PyExc_TypeError,
"expected %zu bytes from read callback, got %zu",
size, PyBytes_Size(retval));
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
goto leave;
}
@@ -871,7 +871,7 @@ static ssize_t pyDataWriteCb(void *hook, const void *buffer, size_t size)
retval = PyObject_CallObject(func, pyargs);
Py_DECREF(pyargs);
if (PyErr_Occurred()) {
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
goto leave;
}
@@ -887,7 +887,7 @@ static ssize_t pyDataWriteCb(void *hook, const void *buffer, size_t size)
PyErr_Format(PyExc_TypeError,
"expected int from write callback, got %s",
retval->ob_type->tp_name);
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
}
@@ -938,7 +938,7 @@ static off_t pyDataSeekCb(void *hook, off_t offset, int whence)
retval = PyObject_CallObject(func, pyargs);
Py_DECREF(pyargs);
if (PyErr_Occurred()) {
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
goto leave;
}
@@ -958,7 +958,7 @@ static off_t pyDataSeekCb(void *hook, off_t offset, int whence)
PyErr_Format(PyExc_TypeError,
"expected int from seek callback, got %s",
retval->ob_type->tp_name);
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
result = -1;
}
@@ -1000,12 +1000,12 @@ static void pyDataReleaseCb(void *hook)
Py_XDECREF(retval);
Py_DECREF(pyargs);
if (PyErr_Occurred())
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
PyGILState_Release(state);
}
PyObject *
-pyme_data_new_from_cbs(PyObject *self,
+gpg_data_new_from_cbs(PyObject *self,
PyObject *pycbs,
gpgme_data_t *r_data)
{
@@ -1026,7 +1026,7 @@ pyme_data_new_from_cbs(PyObject *self,
err = gpgme_data_new_from_cbs(r_data, &cbs, (void *) pycbs);
if (err)
- return _pyme_raise_exception(err);
+ return _gpg_raise_exception(err);
PyObject_SetAttrString(self, "_data_cbs", pycbs);
@@ -1040,7 +1040,7 @@ pyme_data_new_from_cbs(PyObject *self,
/* The assuan callbacks. */
gpgme_error_t
-_pyme_assuan_data_cb (void *hook, const void *data, size_t datalen)
+_gpg_assuan_data_cb (void *hook, const void *data, size_t datalen)
{
PyGILState_STATE state = PyGILState_Ensure();
gpgme_error_t err = 0;
@@ -1059,25 +1059,25 @@ _pyme_assuan_data_cb (void *hook, const void *data, size_t datalen)
py_data = PyBytes_FromStringAndSize(data, datalen);
if (py_data == NULL)
{
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
goto leave;
}
retval = PyObject_CallFunctionObjArgs(func, py_data, NULL);
if (PyErr_Occurred())
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
Py_DECREF(py_data);
Py_XDECREF(retval);
leave:
if (err)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
PyGILState_Release(state);
return err;
}
gpgme_error_t
-_pyme_assuan_inquire_cb (void *hook, const char *name, const char *args,
+_gpg_assuan_inquire_cb (void *hook, const char *name, const char *args,
gpgme_data_t *r_data)
{
PyGILState_STATE state = PyGILState_Ensure();
@@ -1098,20 +1098,20 @@ _pyme_assuan_inquire_cb (void *hook, const char *name, const char *args,
py_name = PyUnicode_FromString(name);
if (py_name == NULL)
{
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
goto leave;
}
py_args = PyUnicode_FromString(args);
if (py_args == NULL)
{
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
goto leave;
}
retval = PyObject_CallFunctionObjArgs(func, py_name, py_args, NULL);
if (PyErr_Occurred())
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
Py_XDECREF(retval);
/* FIXME: Returning data is not yet implemented. */
@@ -1121,13 +1121,13 @@ _pyme_assuan_inquire_cb (void *hook, const char *name, const char *args,
Py_XDECREF(py_name);
Py_XDECREF(py_args);
if (err)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
PyGILState_Release(state);
return err;
}
gpgme_error_t
-_pyme_assuan_status_cb (void *hook, const char *status, const char *args)
+_gpg_assuan_status_cb (void *hook, const char *status, const char *args)
{
PyGILState_STATE state = PyGILState_Ensure();
gpgme_error_t err = 0;
@@ -1147,27 +1147,27 @@ _pyme_assuan_status_cb (void *hook, const char *status, const char *args)
py_status = PyUnicode_FromString(status);
if (py_status == NULL)
{
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
goto leave;
}
py_args = PyUnicode_FromString(args);
if (py_args == NULL)
{
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
goto leave;
}
retval = PyObject_CallFunctionObjArgs(func, py_status, py_args, NULL);
if (PyErr_Occurred())
- err = _pyme_exception2code();
+ err = _gpg_exception2code();
Py_XDECREF(retval);
leave:
Py_XDECREF(py_status);
Py_XDECREF(py_args);
if (err)
- _pyme_stash_callback_exception(self);
+ _gpg_stash_callback_exception(self);
PyGILState_Release(state);
return err;
}
diff --git a/lang/python/helpers.h b/lang/python/helpers.h
index 67d23b2..61f538e 100644
--- a/lang/python/helpers.h
+++ b/lang/python/helpers.h
@@ -31,13 +31,13 @@
#endif
/* Flag specifying whether this is an in-tree build. */
-extern int pyme_in_tree_build;
+extern int gpg_in_tree_build;
-PyObject *pyme_raise_callback_exception(PyObject *self);
+PyObject *gpg_raise_callback_exception(PyObject *self);
-PyObject *pyme_set_passphrase_cb(PyObject *self, PyObject *cb);
-PyObject *pyme_set_progress_cb(PyObject *self, PyObject *cb);
-PyObject *pyme_set_status_cb(PyObject *self, PyObject *cb);
+PyObject *gpg_set_passphrase_cb(PyObject *self, PyObject *cb);
+PyObject *gpg_set_progress_cb(PyObject *self, PyObject *cb);
+PyObject *gpg_set_status_cb(PyObject *self, PyObject *cb);
-PyObject *pyme_data_new_from_cbs(PyObject *self, PyObject *pycbs,
+PyObject *gpg_data_new_from_cbs(PyObject *self, PyObject *pycbs,
gpgme_data_t *r_data);
diff --git a/lang/python/private.h b/lang/python/private.h
index 3a903c1..e7b371f 100644
--- a/lang/python/private.h
+++ b/lang/python/private.h
@@ -19,36 +19,36 @@
#include <gpgme.h>
-#ifndef _PYME_PRIVATE_H_
-#define _PYME_PRIVATE_H_
+#ifndef _GPG_PRIVATE_H_
+#define _GPG_PRIVATE_H_
/* GPGME glue. Implemented in helpers.c. */
-void _pyme_exception_init(void);
-gpgme_error_t _pyme_exception2code(void);
+void _gpg_exception_init(void);
+gpgme_error_t _gpg_exception2code(void);
-PyObject *_pyme_obj2gpgme_t(PyObject *input, const char *objtype, int argnum);
-PyObject *_pyme_obj2gpgme_data_t(PyObject *input, int argnum,
+PyObject *_gpg_obj2gpgme_t(PyObject *input, const char *objtype, int argnum);
+PyObject *_gpg_obj2gpgme_data_t(PyObject *input, int argnum,
gpgme_data_t *wrapper,
PyObject **bytesio, Py_buffer *view);
-PyObject *_pyme_wrap_result(PyObject *fragile, const char *classname);
+PyObject *_gpg_wrap_result(PyObject *fragile, const char *classname);
-gpgme_error_t _pyme_interact_cb(void *opaque, const char *keyword,
+gpgme_error_t _gpg_interact_cb(void *opaque, const char *keyword,
const char *args, int fd);
-gpgme_error_t _pyme_assuan_data_cb (void *hook,
+gpgme_error_t _gpg_assuan_data_cb (void *hook,
const void *data, size_t datalen);
-gpgme_error_t _pyme_assuan_inquire_cb (void *hook,
+gpgme_error_t _gpg_assuan_inquire_cb (void *hook,
const char *name, const char *args,
gpgme_data_t *r_data);
-gpgme_error_t _pyme_assuan_status_cb (void *hook,
+gpgme_error_t _gpg_assuan_status_cb (void *hook,
const char *status, const char *args);
/* SWIG runtime support. Implemented in gpgme.i. */
-PyObject *_pyme_wrap_gpgme_data_t(gpgme_data_t data);
-gpgme_ctx_t _pyme_unwrap_gpgme_ctx_t(PyObject *wrapped);
+PyObject *_gpg_wrap_gpgme_data_t(gpgme_data_t data);
+gpgme_ctx_t _gpg_unwrap_gpgme_ctx_t(PyObject *wrapped);
-#endif /* _PYME_PRIVATE_H_ */
+#endif /* _GPG_PRIVATE_H_ */
diff --git a/lang/python/pyme/__pycache__/__init__.cpython-34.pyc b/lang/python/pyme/__pycache__/__init__.cpython-34.pyc
deleted file mode 100644
index ba78937..0000000
--- a/lang/python/pyme/__pycache__/__init__.cpython-34.pyc
+++ /dev/null
Binary files differ
diff --git a/lang/python/pyme/__pycache__/version.cpython-34.pyc b/lang/python/pyme/__pycache__/version.cpython-34.pyc
deleted file mode 100644
index 658008a..0000000
--- a/lang/python/pyme/__pycache__/version.cpython-34.pyc
+++ /dev/null
Binary files differ
diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
index 4c41673..9669c28 100755
--- a/lang/python/setup.py.in
+++ b/lang/python/setup.py.in
@@ -23,7 +23,7 @@ import os, os.path, sys
import glob
import subprocess
-# Out-of-tree build of the pyme3 bindings.
+# Out-of-tree build of the gpg bindings.
gpg_error_config = ["gpg-error-config"]
gpgme_config_flags = ["--thread=pthread"]
gpgme_config = ["gpgme-config"] + gpgme_config_flags
@@ -75,8 +75,8 @@ if '-' in version:
version = version.split('-')[0]
major, minor, patch = map(int, version.split('.'))
-if not (major > 1 or (major == 1 and minor >= 6)):
- sys.exit('Need at least GPGME version 1.6, found {}.'.format(version_raw))
+if not (major > 1 or (major == 1 and minor >= 7)):
+ sys.exit('Need at least GPGME version 1.7, found {}.'.format(version_raw))
if not gpgme_h:
gpgme_h = os.path.join(getconfig("prefix")[0], "include", "gpgme.h")
@@ -88,7 +88,7 @@ if not os.path.exists(gpg_error_h):
glob.glob(os.path.join(gpg_error_prefix, "include",
"*", "gpg-error.h"))[0]
-print("Building pyme3 using {} and {}.".format(gpgme_h, gpg_error_h))
+print("Building python gpg module using {} and {}.".format(gpgme_h, gpg_error_h))
# Cleanup gpgme.h from deprecated functions and typedefs.
subprocess.check_call([sys.executable, "gpgme-h-clean.py", gpgme_h],
@@ -152,15 +152,15 @@ class BuildExtFirstHack(build):
self.run_command('build_ext')
build.run(self)
-swige = Extension("pyme._gpgme", ["gpgme.i", "helpers.c"],
+swige = Extension("gpg._gpgme", ["gpgme.i", "helpers.c"],
swig_opts = ['-py3', '-builtin', '-threads',
- '-outdir', 'pyme'] + extra_swig_opts,
+ '-outdir', 'gpg'] + extra_swig_opts,
include_dirs = include_dirs,
define_macros = define_macros,
library_dirs = library_dirs,
extra_link_args = libs)
-setup(name="pyme3",
+setup(name="gpg",
cmdclass={'build': BuildExtFirstHack},
version="@VERSION@",
description='Python bindings for GPGME GnuPG cryptography library',
@@ -170,8 +170,8 @@ setup(name="pyme3",
author_email='gnupg-devel@gnupg.org',
url='https://www.gnupg.org',
ext_modules=[swige],
- packages = ['pyme', 'pyme.constants', 'pyme.constants.data',
- 'pyme.constants.keylist', 'pyme.constants.sig'],
+ packages = ['gpg', 'gpg.constants', 'gpg.constants.data',
+ 'gpg.constants.keylist', 'gpg.constants.sig'],
license="LGPL2.1+ (the library), GPL2+ (tests and examples)",
classifiers=[
'Development Status :: 4 - Beta',
diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am
index aa88bdc..39f532c 100644
--- a/lang/python/tests/Makefile.am
+++ b/lang/python/tests/Makefile.am
@@ -89,7 +89,7 @@ clean-local:
./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
done
diff --git a/lang/python/tests/Makefile.in b/lang/python/tests/Makefile.in
index 3886bf4..ce60cd5 100644
--- a/lang/python/tests/Makefile.in
+++ b/lang/python/tests/Makefile.in
@@ -268,6 +268,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -591,7 +594,7 @@ clean-local:
-rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
done
diff --git a/lang/python/tests/initial.py b/lang/python/tests/initial.py
index 2d4827a..ebe7f8a 100755
--- a/lang/python/tests/initial.py
+++ b/lang/python/tests/initial.py
@@ -22,14 +22,14 @@ del absolute_import, print_function, unicode_literals
import os
import subprocess
-import pyme
+import gpg
import support
-support.init_gpgme(pyme.constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
"tests", "start-stop-agent"), "--start"])
-with pyme.Context() as c:
+with gpg.Context() as c:
alpha = c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False)
bob = c.get_key("D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", False)
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index f1ffdc3..f991c6d 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -20,7 +20,7 @@ del absolute_import, print_function, unicode_literals
import sys
import os
-from pyme import core
+import gpg
# known keys
alpha = "A0FF4590BB6122EDEF6E3C542D727CC768697734"
@@ -36,7 +36,7 @@ def in_srcdir(name):
return os.path.join(os.environ['srcdir'], name)
def init_gpgme(proto):
- core.engine_check_version(proto)
+ gpg.core.engine_check_version(proto)
verbose = int(os.environ.get('verbose', 0)) > 1
def print_data(data):
@@ -66,5 +66,5 @@ def mark_key_trusted(ctx, key):
else:
result = None
return result
- with core.Data() as sink:
+ with gpg.Data() as sink:
ctx.op_edit(key, Editor().edit, sink, sink)
diff --git a/lang/python/tests/t-callbacks.py b/lang/python/tests/t-callbacks.py
index b3b4349..eed50bc 100755
--- a/lang/python/tests/t-callbacks.py
+++ b/lang/python/tests/t-callbacks.py
@@ -21,16 +21,16 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
-c = core.Context()
-c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+c = gpg.Context()
+c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
-source = core.Data("Hallo Leute\n")
-sink = core.Data()
+source = gpg.Data("Hallo Leute\n")
+sink = gpg.Data()
# Valid passphrases, both as string and bytes.
for passphrase in ('foo', b'foo'):
@@ -87,7 +87,7 @@ Key-Type: RSA
Key-Length: 1024
Name-Real: Joe Tester
Name-Comment: with stupid passphrase
-Name-Email: joe+pyme@example.org
+Name-Email: joe+gpg@example.org
Passphrase: Crypt0R0cks
Expire-Date: 2020-12-31
</GnupgKeyParms>
@@ -100,7 +100,7 @@ def progress_cb(what, typ, current, total, hook=None):
"PROGRESS UPDATE: what = {}, type = {}, current = {}, total = {}"
.format(what, typ, current, total))
-c = core.Context()
+c = gpg.Context()
c.set_progress_cb(progress_cb, messages)
c.op_genkey(parms, None, None)
assert len(messages) > 0
@@ -109,7 +109,7 @@ assert len(messages) > 0
def progress_cb(what, typ, current, total, hook=None):
raise myException
-c = core.Context()
+c = gpg.Context()
c.set_progress_cb(progress_cb, None)
try:
c.op_genkey(parms, None, None)
@@ -120,10 +120,10 @@ else:
# Test the edit callback.
-c = core.Context()
-c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+c = gpg.Context()
+c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
c.set_passphrase_cb(lambda *args: "abc")
-sink = core.Data()
+sink = gpg.Data()
alpha = c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False)
cookie = object()
@@ -137,10 +137,10 @@ c.op_edit(alpha, edit_cb, cookie, sink)
assert edit_cb_called
# Test exceptions.
-c = core.Context()
-c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+c = gpg.Context()
+c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
c.set_passphrase_cb(lambda *args: "abc")
-sink = core.Data()
+sink = gpg.Data()
def edit_cb(status, args):
raise myException
@@ -154,8 +154,8 @@ else:
# Test the status callback.
-source = core.Data("Hallo Leute\n")
-sink = core.Data()
+source = gpg.Data("Hallo Leute\n")
+sink = gpg.Data()
status_cb_called = False
def status_cb(keyword, args, hook=None):
@@ -163,24 +163,24 @@ def status_cb(keyword, args, hook=None):
status_cb_called = True
assert hook == cookie
-c = core.Context()
+c = gpg.Context()
c.set_status_cb(status_cb, cookie)
c.set_ctx_flag("full-status", "1")
-c.op_encrypt([alpha], constants.ENCRYPT_ALWAYS_TRUST, source, sink)
+c.op_encrypt([alpha], gpg.constants.ENCRYPT_ALWAYS_TRUST, source, sink)
assert status_cb_called
# Test exceptions.
-source = core.Data("Hallo Leute\n")
-sink = core.Data()
+source = gpg.Data("Hallo Leute\n")
+sink = gpg.Data()
def status_cb(keyword, args):
raise myException
-c = core.Context()
+c = gpg.Context()
c.set_status_cb(status_cb, None)
c.set_ctx_flag("full-status", "1")
try:
- c.op_encrypt([alpha], constants.ENCRYPT_ALWAYS_TRUST, source, sink)
+ c.op_encrypt([alpha], gpg.constants.ENCRYPT_ALWAYS_TRUST, source, sink)
except Exception as e:
assert e == myException
else:
@@ -194,7 +194,7 @@ def read_cb(amount, hook=None):
return 0
def release_cb(hook=None):
assert hook == cookie
-data = core.Data(cbs=(read_cb, None, None, release_cb, cookie))
+data = gpg.Data(cbs=(read_cb, None, None, release_cb, cookie))
try:
data.read()
except Exception as e:
@@ -204,7 +204,7 @@ else:
def read_cb(amount):
raise myException
-data = core.Data(cbs=(read_cb, None, None, lambda: None))
+data = gpg.Data(cbs=(read_cb, None, None, lambda: None))
try:
data.read()
except Exception as e:
@@ -216,7 +216,7 @@ else:
def write_cb(what, hook=None):
assert hook == cookie
return "wrong type"
-data = core.Data(cbs=(None, write_cb, None, release_cb, cookie))
+data = gpg.Data(cbs=(None, write_cb, None, release_cb, cookie))
try:
data.write(b'stuff')
except Exception as e:
@@ -226,7 +226,7 @@ else:
def write_cb(what):
raise myException
-data = core.Data(cbs=(None, write_cb, None, lambda: None))
+data = gpg.Data(cbs=(None, write_cb, None, lambda: None))
try:
data.write(b'stuff')
except Exception as e:
@@ -238,7 +238,7 @@ else:
def seek_cb(offset, whence, hook=None):
assert hook == cookie
return "wrong type"
-data = core.Data(cbs=(None, None, seek_cb, release_cb, cookie))
+data = gpg.Data(cbs=(None, None, seek_cb, release_cb, cookie))
try:
data.seek(0, os.SEEK_SET)
except Exception as e:
@@ -248,7 +248,7 @@ else:
def seek_cb(offset, whence):
raise myException
-data = core.Data(cbs=(None, None, seek_cb, lambda: None))
+data = gpg.Data(cbs=(None, None, seek_cb, lambda: None))
try:
data.seek(0, os.SEEK_SET)
except Exception as e:
diff --git a/lang/python/tests/t-data.py b/lang/python/tests/t-data.py
index 4812a2e..d1facd4 100755
--- a/lang/python/tests/t-data.py
+++ b/lang/python/tests/t-data.py
@@ -23,9 +23,9 @@ del absolute_import, print_function, unicode_literals
import io
import os
import tempfile
-from pyme import core
+import gpg
-data = core.Data('Hello world!')
+data = gpg.Data('Hello world!')
assert data.read() == b'Hello world!'
assert data.read() == b''
@@ -33,29 +33,29 @@ data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
assert data.read() == b''
-data = core.Data(b'Hello world!')
+data = gpg.Data(b'Hello world!')
assert data.read() == b'Hello world!'
-data = core.Data(b'Hello world!', copy=False)
+data = gpg.Data(b'Hello world!', copy=False)
assert data.read() == b'Hello world!'
-data = core.Data()
+data = gpg.Data()
data.write('Hello world!')
data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
-data = core.Data()
+data = gpg.Data()
data.write(b'Hello world!')
data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
binjunk = bytes(range(256))
-data = core.Data()
+data = gpg.Data()
data.write(binjunk)
data.seek(0, os.SEEK_SET)
assert data.read() == binjunk
-data = core.Data()
+data = gpg.Data()
data.set_file_name("foobar")
assert data.get_file_name() == "foobar"
@@ -66,26 +66,26 @@ with tempfile.NamedTemporaryFile() as tmp:
tmp.seek(0)
# Open using name.
- data = core.Data(file=tmp.name)
+ data = gpg.Data(file=tmp.name)
assert data.read() == binjunk
# Open using name, without copying.
if False:
# delayed reads are not yet supported
- data = core.Data(file=tmp.name, copy=False)
+ data = gpg.Data(file=tmp.name, copy=False)
assert data.read() == binjunk
# Open using stream.
tmp.seek(0)
- data = core.Data(file=tmp)
+ data = gpg.Data(file=tmp)
assert data.read() == binjunk
# Open using stream, offset, and length.
- data = core.Data(file=tmp, offset=0, length=42)
+ data = gpg.Data(file=tmp, offset=0, length=42)
assert data.read() == binjunk[:42]
# Open using name, offset, and length.
- data = core.Data(file=tmp.name, offset=23, length=42)
+ data = gpg.Data(file=tmp.name, offset=23, length=42)
assert data.read() == binjunk[23:23+42]
# Test callbacks.
@@ -112,7 +112,7 @@ class DataObject(object):
do = DataObject()
cookie = object()
-data = core.Data(cbs=(do.read, do.write, do.seek, do.release, cookie))
+data = gpg.Data(cbs=(do.read, do.write, do.seek, do.release, cookie))
data.write('Hello world!')
data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
@@ -121,7 +121,7 @@ assert do.released
# Again, without the cookie.
do = DataObject()
-data = core.Data(cbs=(do.read, do.write, do.seek, do.release))
+data = gpg.Data(cbs=(do.read, do.write, do.seek, do.release))
data.write('Hello world!')
data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
diff --git a/lang/python/tests/t-decrypt-verify.py b/lang/python/tests/t-decrypt-verify.py
index a38a965..6243167 100755
--- a/lang/python/tests/t-decrypt-verify.py
+++ b/lang/python/tests/t-decrypt-verify.py
@@ -20,8 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
-from pyme import core, constants, errors
+import gpg
import support
def check_verify_result(result, summary, fpr, status):
@@ -29,17 +28,17 @@ def check_verify_result(result, summary, fpr, status):
sig = result.signatures[0]
assert sig.summary == summary, "Unexpected signature summary"
assert sig.fpr == fpr
- assert errors.GPGMEError(sig.status).getcode() == status
+ assert gpg.errors.GPGMEError(sig.status).getcode() == status
assert len(sig.notations) == 0
assert not sig.wrong_key_usage
- assert sig.validity == constants.VALIDITY_FULL
- assert errors.GPGMEError(sig.validity_reason).getcode() == errors.NO_ERROR
+ assert sig.validity == gpg.constants.validity.FULL
+ assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
-source = core.Data(file=support.make_filename("cipher-2.asc"))
-sink = core.Data()
+source = gpg.Data(file=support.make_filename("cipher-2.asc"))
+sink = gpg.Data()
c.op_decrypt_verify(source, sink)
result = c.op_decrypt_result()
@@ -50,12 +49,12 @@ support.print_data(sink)
verify_result = c.op_verify_result()
check_verify_result(verify_result,
- constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
+ gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR)
+ gpg.errors.NO_ERROR)
# Idiomatic interface.
-with pyme.Context() as c:
+with gpg.Context() as c:
alpha = c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False)
bob = c.get_key("D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", False)
plaintext, _, verify_result = \
@@ -63,14 +62,14 @@ with pyme.Context() as c:
assert plaintext.find(b'Wenn Sie dies lesen k') >= 0, \
'Plaintext not found'
check_verify_result(verify_result,
- constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
+ gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR)
+ gpg.errors.NO_ERROR)
try:
c.decrypt(open(support.make_filename("cipher-2.asc")),
verify=[alpha, bob])
- except errors.MissingSignatures as e:
+ except gpg.errors.MissingSignatures as e:
assert len(e.missing) == 1
assert e.missing[0] == bob
else:
diff --git a/lang/python/tests/t-decrypt.py b/lang/python/tests/t-decrypt.py
index 2d85bc2..1af0562 100755
--- a/lang/python/tests/t-decrypt.py
+++ b/lang/python/tests/t-decrypt.py
@@ -20,15 +20,14 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
-source = core.Data(file=support.make_filename("cipher-1.asc"))
-sink = core.Data()
+source = gpg.Data(file=support.make_filename("cipher-1.asc"))
+sink = gpg.Data()
c.op_decrypt(source, sink)
result = c.op_decrypt_result()
@@ -38,7 +37,7 @@ assert not result.unsupported_algorithm, \
support.print_data(sink)
# Idiomatic interface.
-with pyme.Context() as c:
+with gpg.Context() as c:
plaintext, _, _ = c.decrypt(open(support.make_filename("cipher-1.asc")))
assert len(plaintext) > 0
assert plaintext.find(b'Wenn Sie dies lesen k') >= 0, \
diff --git a/lang/python/tests/t-edit.py b/lang/python/tests/t-edit.py
index 18bcb94..bd70e7e 100755
--- a/lang/python/tests/t-edit.py
+++ b/lang/python/tests/t-edit.py
@@ -23,7 +23,7 @@ del absolute_import, print_function, unicode_literals
import sys
import os
-from pyme import core, constants
+import gpg
import support
class KeyEditor(object):
@@ -51,10 +51,10 @@ class KeyEditor(object):
return result
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
-c = core.Context()
-c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+c = gpg.Context()
+c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
c.set_passphrase_cb(lambda *args: "abc")
c.set_armor(True)
@@ -65,7 +65,7 @@ c.interact(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False),
assert editor.done
# The deprecated interface.
-sink = core.Data()
+sink = gpg.Data()
editor = KeyEditor()
c.op_edit(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False),
editor.edit_fnc, sink, sink)
diff --git a/lang/python/tests/t-encrypt-large.py b/lang/python/tests/t-encrypt-large.py
index b9cc3b5..cdb4a32 100755
--- a/lang/python/tests/t-encrypt-large.py
+++ b/lang/python/tests/t-encrypt-large.py
@@ -22,7 +22,7 @@ del absolute_import, print_function, unicode_literals
import sys
import random
-from pyme import core, constants
+import gpg
import support
if len(sys.argv) == 2:
@@ -30,8 +30,8 @@ if len(sys.argv) == 2:
else:
nbytes = 100000
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
ntoread = nbytes
def read_cb(amount):
@@ -48,14 +48,14 @@ def write_cb(data):
nwritten += len(data)
return len(data)
-source = core.Data(cbs=(read_cb, None, None, lambda: None))
-sink = core.Data(cbs=(None, write_cb, None, lambda: None))
+source = gpg.Data(cbs=(read_cb, None, None, lambda: None))
+sink = gpg.Data(cbs=(None, write_cb, None, lambda: None))
keys = []
keys.append(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False))
keys.append(c.get_key("D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", False))
-c.op_encrypt(keys, constants.ENCRYPT_ALWAYS_TRUST, source, sink)
+c.op_encrypt(keys, gpg.constants.ENCRYPT_ALWAYS_TRUST, source, sink)
result = c.op_encrypt_result()
assert not result.invalid_recipients, \
"Invalid recipient encountered: {}".format(result.invalid_recipients.fpr)
diff --git a/lang/python/tests/t-encrypt-sign.py b/lang/python/tests/t-encrypt-sign.py
index a453f79..094a2b0 100755
--- a/lang/python/tests/t-encrypt-sign.py
+++ b/lang/python/tests/t-encrypt-sign.py
@@ -21,12 +21,11 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
-import pyme
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
def check_result(r, typ):
@@ -40,11 +39,11 @@ def check_result(r, typ):
if signature.type != typ:
sys.exit("Wrong type of signature created")
- if signature.pubkey_algo != constants.PK_DSA:
+ if signature.pubkey_algo != gpg.constants.pk.DSA:
sys.exit("Wrong pubkey algorithm reported: {}".format(
signature.pubkey_algo))
- if signature.hash_algo not in (constants.MD_SHA1, constants.MD_RMD160):
+ if signature.hash_algo not in (gpg.constants.md.SHA1, gpg.constants.md.RMD160):
sys.exit("Wrong hash algorithm reported: {}".format(
signature.hash_algo))
@@ -60,30 +59,30 @@ keys.append(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False))
keys.append(c.get_key("D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", False))
for recipients in (keys, []):
- source = core.Data("Hallo Leute\n")
- sink = core.Data()
+ source = gpg.Data("Hallo Leute\n")
+ sink = gpg.Data()
- c.op_encrypt_sign(recipients, constants.ENCRYPT_ALWAYS_TRUST, source, sink)
+ c.op_encrypt_sign(recipients, gpg.constants.ENCRYPT_ALWAYS_TRUST, source, sink)
result = c.op_encrypt_result()
assert not result.invalid_recipients, \
"Invalid recipient encountered: {}".format(
result.invalid_recipients.fpr)
result = c.op_sign_result()
- check_result(result, constants.SIG_MODE_NORMAL)
+ check_result(result, gpg.constants.sig.mode.NORMAL)
support.print_data(sink)
# Idiomatic interface.
-with pyme.Context(armor=True) as c:
+with gpg.Context(armor=True) as c:
message = "Hallo Leute\n".encode()
ciphertext, _, sig_result = c.encrypt(message,
recipients=keys,
always_trust=True)
assert len(ciphertext) > 0
assert ciphertext.find(b'BEGIN PGP MESSAGE') > 0, 'Marker not found'
- check_result(sig_result, constants.SIG_MODE_NORMAL)
+ check_result(sig_result, gpg.constants.sig.mode.NORMAL)
c.signers = [c.get_key(support.sign_only, True)]
c.encrypt(message, recipients=keys, always_trust=True)
@@ -91,7 +90,7 @@ with pyme.Context(armor=True) as c:
c.signers = [c.get_key(support.encrypt_only, True)]
try:
c.encrypt(message, recipients=keys, always_trust=True)
- except pyme.errors.InvalidSigners as e:
+ except gpg.errors.InvalidSigners as e:
assert len(e.signers) == 1
assert support.encrypt_only.endswith(e.signers[0].fpr)
else:
diff --git a/lang/python/tests/t-encrypt-sym.py b/lang/python/tests/t-encrypt-sym.py
index d577184..07e6b62 100755
--- a/lang/python/tests/t-encrypt-sym.py
+++ b/lang/python/tests/t-encrypt-sym.py
@@ -21,19 +21,18 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
-import pyme
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
for passphrase in ("abc", b"abc"):
- c = core.Context()
+ c = gpg.Context()
c.set_armor(True)
- c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+ c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
- source = core.Data("Hallo Leute\n")
- cipher = core.Data()
+ source = gpg.Data("Hallo Leute\n")
+ cipher = gpg.Data()
passphrase_cb_called = 0
def passphrase_cb(hint, desc, prev_bad, hook=None):
@@ -48,11 +47,11 @@ for passphrase in ("abc", b"abc"):
"Callback called {} times".format(passphrase_cb_called)
support.print_data(cipher)
- c = core.Context()
+ c = gpg.Context()
c.set_armor(True)
- c.set_pinentry_mode(constants.PINENTRY_MODE_LOOPBACK)
+ c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
c.set_passphrase_cb(passphrase_cb, None)
- plain = core.Data()
+ plain = gpg.Data()
cipher.seek(0, os.SEEK_SET)
c.op_decrypt(cipher, plain)
@@ -68,7 +67,7 @@ for passphrase in ("abc", b"abc"):
# Idiomatic interface.
for passphrase in ("abc", b"abc"):
- with pyme.Context(armor=True) as c:
+ with gpg.Context(armor=True) as c:
# Check that the passphrase callback is not altered.
def f(*args):
assert False
diff --git a/lang/python/tests/t-encrypt.py b/lang/python/tests/t-encrypt.py
index 65e7d24..0c0ca35 100755
--- a/lang/python/tests/t-encrypt.py
+++ b/lang/python/tests/t-encrypt.py
@@ -20,29 +20,28 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
-source = core.Data("Hallo Leute\n")
-sink = core.Data()
+source = gpg.Data("Hallo Leute\n")
+sink = gpg.Data()
keys = []
keys.append(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False))
keys.append(c.get_key("D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", False))
-c.op_encrypt(keys, constants.ENCRYPT_ALWAYS_TRUST, source, sink)
+c.op_encrypt(keys, gpg.constants.ENCRYPT_ALWAYS_TRUST, source, sink)
result = c.op_encrypt_result()
assert not result.invalid_recipients, \
"Invalid recipients: {}".format(", ".join(r.fpr for r in result.recipients))
support.print_data(sink)
# Idiomatic interface.
-with pyme.Context(armor=True) as c:
+with gpg.Context(armor=True) as c:
ciphertext, _, _ = c.encrypt("Hallo Leute\n".encode(),
recipients=keys,
sign=False,
@@ -58,7 +57,7 @@ with pyme.Context(armor=True) as c:
c.encrypt("Hallo Leute\n".encode(),
recipients=[c.get_key(support.sign_only, False)],
sign=False, always_trust=True)
- except pyme.errors.InvalidRecipients as e:
+ except gpg.errors.InvalidRecipients as e:
assert len(e.recipients) == 1
assert support.sign_only.endswith(e.recipients[0].fpr)
else:
diff --git a/lang/python/tests/t-export.py b/lang/python/tests/t-export.py
index db36b98..4927beb 100755
--- a/lang/python/tests/t-export.py
+++ b/lang/python/tests/t-export.py
@@ -20,14 +20,14 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
-sink = core.Data()
+sink = gpg.Data()
c.op_export_ext(['Alpha', 'Bob'], 0, sink)
support.print_data(sink)
@@ -35,6 +35,6 @@ support.print_data(sink)
keys = []
keys.append(c.get_key("0x68697734", False)) # Alpha
keys.append(c.get_key("0xA9E3B0B2", False)) # Bob
-sink = core.Data()
+sink = gpg.Data()
c.op_export_keys(keys, 0, sink)
support.print_data(sink)
diff --git a/lang/python/tests/t-file-name.py b/lang/python/tests/t-file-name.py
index e93b120..d12afb8 100755
--- a/lang/python/tests/t-file-name.py
+++ b/lang/python/tests/t-file-name.py
@@ -21,24 +21,24 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
-from pyme import core, constants
+import gpg
import support
testname = "abcde12345"
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
-source = core.Data("Hallo Leute\n")
+source = gpg.Data("Hallo Leute\n")
source.set_file_name(testname)
-cipher = core.Data()
-plain = core.Data()
+cipher = gpg.Data()
+plain = gpg.Data()
keys = []
keys.append(c.get_key("A0FF4590BB6122EDEF6E3C542D727CC768697734", False))
-c.op_encrypt(keys, constants.ENCRYPT_ALWAYS_TRUST, source, cipher)
+c.op_encrypt(keys, gpg.constants.ENCRYPT_ALWAYS_TRUST, source, cipher)
cipher.seek(0, os.SEEK_SET)
c.op_decrypt(cipher, plain)
result = c.op_decrypt_result()
diff --git a/lang/python/tests/t-idiomatic.py b/lang/python/tests/t-idiomatic.py
index f063206..485f048 100755
--- a/lang/python/tests/t-idiomatic.py
+++ b/lang/python/tests/t-idiomatic.py
@@ -24,13 +24,13 @@ import sys
import io
import os
import tempfile
-import pyme
+import gpg
import support
-support.init_gpgme(pyme.constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
# Both Context and Data can be used as context manager:
-with pyme.Context() as c, pyme.Data() as d:
+with gpg.Context() as c, gpg.Data() as d:
c.get_engine_info()
d.write(b"Halloechen")
leak_c = c
@@ -39,17 +39,17 @@ assert leak_c.wrapped == None
assert leak_d.wrapped == None
def sign_and_verify(source, signed, sink):
- with pyme.Context() as c:
- c.op_sign(source, signed, pyme.constants.SIG_MODE_NORMAL)
+ with gpg.Context() as c:
+ c.op_sign(source, signed, gpg.constants.sig.mode.NORMAL)
signed.seek(0, os.SEEK_SET)
c.op_verify(signed, None, sink)
result = c.op_verify_result()
assert len(result.signatures) == 1, "Unexpected number of signatures"
sig = result.signatures[0]
- assert sig.summary == (pyme.constants.SIGSUM_VALID |
- pyme.constants.SIGSUM_GREEN)
- assert pyme.errors.GPGMEError(sig.status).getcode() == pyme.errors.NO_ERROR
+ assert sig.summary == (gpg.constants.sigsum.VALID |
+ gpg.constants.sigsum.GREEN)
+ assert gpg.errors.GPGMEError(sig.status).getcode() == gpg.errors.NO_ERROR
sink.seek(0, os.SEEK_SET)
assert sink.read() == b"Hallo Leute\n"
@@ -80,5 +80,5 @@ if sys.version_info[0] == 3:
# Demonstrate automatic wrapping of objects implementing the buffer
# interface, and the use of data objects with the 'with' statement.
- with io.BytesIO(preallocate) as signed, pyme.Data() as sink:
+ with io.BytesIO(preallocate) as signed, gpg.Data() as sink:
sign_and_verify(b"Hallo Leute\n", signed, sink)
diff --git a/lang/python/tests/t-import.py b/lang/python/tests/t-import.py
index 0b50d02..5b0576f 100755
--- a/lang/python/tests/t-import.py
+++ b/lang/python/tests/t-import.py
@@ -20,7 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import core, constants
+import gpg
import support
def check_result(result, fpr, secret):
@@ -67,13 +67,13 @@ def check_result(result, fpr, secret):
assert len(result.imports) == 1 or fpr == result.imports[1].fpr
assert result.imports[0].result == 0
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
-c.op_import(core.Data(file=support.make_filename("pubkey-1.asc")))
+c.op_import(gpg.Data(file=support.make_filename("pubkey-1.asc")))
result = c.op_import_result()
check_result(result, "ADAB7FCC1F4DE2616ECFA402AF82244F9CD9FD55", False)
-c.op_import(core.Data(file=support.make_filename("seckey-1.asc")))
+c.op_import(gpg.Data(file=support.make_filename("seckey-1.asc")))
result = c.op_import_result()
check_result(result, "ADAB7FCC1F4DE2616ECFA402AF82244F9CD9FD55", True)
diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index f7f6674..ea2a724 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -20,12 +20,11 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
# Check expration of keys. This test assumes three subkeys of which
# 2 are expired; it is used with the "Whisky" test key. It has
@@ -109,7 +108,7 @@ def check_global(key, uids, n_subkeys):
assert key.can_sign, "Key unexpectedly unusable for signing"
assert key.can_certify, "Key unexpectedly unusable for certifications"
assert not key.secret, "Key unexpectedly secret"
- assert not key.protocol != constants.PROTOCOL_OpenPGP, \
+ assert not key.protocol != gpg.constants.protocol.OpenPGP, \
"Key has unexpected protocol: {}".format(key.protocol)
assert not key.issuer_serial, \
"Key unexpectedly carries issuer serial: {}".format(key.issuer_serial)
@@ -120,10 +119,10 @@ def check_global(key, uids, n_subkeys):
# Only key Alfa is trusted
assert key.uids[0].name == 'Alfa Test' \
- or key.owner_trust == constants.VALIDITY_UNKNOWN, \
+ or key.owner_trust == gpg.constants.validity.UNKNOWN, \
"Key has unexpected owner trust: {}".format(key.owner_trust)
assert key.uids[0].name != 'Alfa Test' \
- or key.owner_trust == constants.VALIDITY_ULTIMATE, \
+ or key.owner_trust == gpg.constants.validity.ULTIMATE, \
"Key has unexpected owner trust: {}".format(key.owner_trust)
assert len(key.subkeys) - 1 == n_subkeys, \
@@ -154,8 +153,8 @@ def check_subkey(fpr, which, subkey):
assert not subkey.secret, which + " key unexpectedly secret"
assert not subkey.is_cardkey, "Public key marked as card key"
assert not subkey.card_number, "Public key with card number set"
- assert not subkey.pubkey_algo != (constants.PK_DSA if which == "Primary"
- else constants.PK_ELG_E), \
+ assert not subkey.pubkey_algo != (gpg.constants.pk.DSA if which == "Primary"
+ else gpg.constants.pk.ELG_E), \
which + " key has unexpected public key algo: {}".\
format(subkey.pubkey_algo)
assert subkey.length == 1024, \
@@ -170,10 +169,10 @@ def check_subkey(fpr, which, subkey):
def check_uid(which, ref, uid):
assert not uid.revoked, which + " user ID unexpectedly revoked"
assert not uid.invalid, which + " user ID unexpectedly invalid"
- assert uid.validity == (constants.VALIDITY_UNKNOWN
+ assert uid.validity == (gpg.constants.validity.UNKNOWN
if uid.name.split()[0]
not in {'Alfa', 'Alpha', 'Alice'} else
- constants.VALIDITY_ULTIMATE), \
+ gpg.constants.validity.ULTIMATE), \
which + " user ID has unexpectedly validity: {}".format(uid.validity)
assert not uid.signatures, which + " user ID unexpectedly signed"
assert uid.name == ref[0], \
@@ -248,7 +247,7 @@ for i, key in enumerate(c.keylist()):
# check get_key()
-with pyme.Context() as c:
+with gpg.Context() as c:
c.get_key(support.alpha)
c.get_key(support.alpha, secret=True)
@@ -263,7 +262,7 @@ with pyme.Context() as c:
# Legacy error
try:
c.get_key(support.no_such_key)
- except pyme.errors.GPGMEError:
+ except gpg.errors.GPGMEError:
pass
else:
assert False, "Expected GPGMEError"
diff --git a/lang/python/tests/t-protocol-assuan.py b/lang/python/tests/t-protocol-assuan.py
index 172c7d0..0084a6b 100755
--- a/lang/python/tests/t-protocol-assuan.py
+++ b/lang/python/tests/t-protocol-assuan.py
@@ -20,17 +20,17 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
+import gpg
-with pyme.Context(protocol=pyme.constants.PROTOCOL_ASSUAN) as c:
+with gpg.Context(protocol=gpg.constants.protocol.ASSUAN) as c:
# Do nothing.
c.assuan_transact('nop')
c.assuan_transact('NOP')
c.assuan_transact(['NOP'])
err = c.assuan_transact('idontexist')
- assert err.getsource() == pyme.errors.SOURCE_GPGAGENT
- assert err.getcode() == pyme.errors.ASS_UNKNOWN_CMD
+ assert err.getsource() == gpg.errors.SOURCE_GPGAGENT
+ assert err.getcode() == gpg.errors.ASS_UNKNOWN_CMD
# Invoke the pinentry to get a confirmation.
c.assuan_transact(['GET_CONFIRMATION', 'Hello there'])
diff --git a/lang/python/tests/t-sig-notation.py b/lang/python/tests/t-sig-notation.py
index eb5b111..f1342b1 100755
--- a/lang/python/tests/t-sig-notation.py
+++ b/lang/python/tests/t-sig-notation.py
@@ -21,19 +21,19 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
-from pyme import core, constants
+import gpg
import support
expected_notations = {
- "laughing@me": ("Just Squeeze Me", constants.SIG_NOTATION_HUMAN_READABLE),
+ "laughing@me": ("Just Squeeze Me", gpg.constants.sig.notation.HUMAN_READABLE),
"preferred-email-encoding@pgp.com": ("pgpmime",
- constants.SIG_NOTATION_HUMAN_READABLE
- | constants.SIG_NOTATION_CRITICAL),
+ gpg.constants.sig.notation.HUMAN_READABLE
+ | gpg.constants.sig.notation.CRITICAL),
None: ("http://www.gnu.org/policy/", 0),
}
# GnuPG prior to 2.1.13 did not report the critical flag correctly.
-with core.Context() as c:
+with gpg.Context() as c:
version = c.engine_info.version
have_correct_sig_data = not (version.startswith("1.")
or version.startswith("2.0.")
@@ -55,26 +55,26 @@ def check_result(result):
assert r.value == value, \
"Expected {!r}, got {!r}".format(value, r.value)
assert r.human_readable \
- == bool(flags&constants.SIG_NOTATION_HUMAN_READABLE)
+ == bool(flags & gpg.constants.sig.notation.HUMAN_READABLE)
assert r.critical \
- == (bool(flags&constants.SIG_NOTATION_CRITICAL)
+ == (bool(flags & gpg.constants.sig.notation.CRITICAL)
if have_correct_sig_data else False)
assert len(expected_notations) == 0
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
-source = core.Data("Hallo Leute\n")
-signed = core.Data()
+source = gpg.Data("Hallo Leute\n")
+signed = gpg.Data()
-c = core.Context()
+c = gpg.Context()
for name, (value, flags) in expected_notations.items():
c.sig_notation_add(name, value, flags)
-c.op_sign(source, signed, constants.SIG_MODE_NORMAL)
+c.op_sign(source, signed, gpg.constants.sig.mode.NORMAL)
signed.seek(0, os.SEEK_SET)
-sink = core.Data()
+sink = gpg.Data()
c.op_verify(signed, None, sink)
result = c.op_verify_result()
check_result(result)
diff --git a/lang/python/tests/t-sign.py b/lang/python/tests/t-sign.py
index b0e211a..9418ed8 100755
--- a/lang/python/tests/t-sign.py
+++ b/lang/python/tests/t-sign.py
@@ -21,8 +21,7 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
-import pyme
-from pyme import core, constants
+import gpg
import support
def fail(msg):
@@ -39,11 +38,11 @@ def check_result(r, typ):
if signature.type != typ:
fail("Wrong type of signature created")
- if signature.pubkey_algo != constants.PK_DSA:
+ if signature.pubkey_algo != gpg.constants.pk.DSA:
fail("Wrong pubkey algorithm reported: {}".format(
signature.pubkey_algo))
- if signature.hash_algo != constants.MD_SHA1:
+ if signature.hash_algo != gpg.constants.md.SHA1:
fail("Wrong hash algorithm reported: {}".format(
signature.hash_algo))
@@ -55,58 +54,58 @@ def check_result(r, typ):
fail("Wrong fingerprint reported: {}".format(signature.fpr))
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_textmode(True)
c.set_armor(True)
-source = core.Data("Hallo Leute\n")
-sink = core.Data()
+source = gpg.Data("Hallo Leute\n")
+sink = gpg.Data()
-c.op_sign(source, sink, constants.SIG_MODE_NORMAL)
+c.op_sign(source, sink, gpg.constants.sig.mode.NORMAL)
result = c.op_sign_result()
-check_result(result, constants.SIG_MODE_NORMAL)
+check_result(result, gpg.constants.sig.mode.NORMAL)
support.print_data(sink)
# Now a detached signature.
source.seek(0, os.SEEK_SET)
-sink = core.Data()
+sink = gpg.Data()
-c.op_sign(source, sink, constants.SIG_MODE_DETACH)
+c.op_sign(source, sink, gpg.constants.sig.mode.DETACH)
result = c.op_sign_result()
-check_result(result, constants.SIG_MODE_DETACH)
+check_result(result, gpg.constants.sig.mode.DETACH)
support.print_data(sink)
# And finally a cleartext signature. */
source.seek(0, os.SEEK_SET)
-sink = core.Data()
+sink = gpg.Data()
-c.op_sign(source, sink, constants.SIG_MODE_CLEAR)
+c.op_sign(source, sink, gpg.constants.sig.mode.CLEAR)
result = c.op_sign_result()
-check_result(result, constants.SIG_MODE_CLEAR)
+check_result(result, gpg.constants.sig.mode.CLEAR)
support.print_data(sink)
# Idiomatic interface.
-with pyme.Context(armor=True, textmode=True) as c:
+with gpg.Context(armor=True, textmode=True) as c:
message = "Hallo Leute\n".encode()
signed, _ = c.sign(message)
assert len(signed) > 0
assert signed.find(b'BEGIN PGP MESSAGE') > 0, 'Message not found'
- signed, _ = c.sign(message, mode=pyme.constants.SIG_MODE_DETACH)
+ signed, _ = c.sign(message, mode=gpg.constants.sig.mode.DETACH)
assert len(signed) > 0
assert signed.find(b'BEGIN PGP SIGNATURE') > 0, 'Signature not found'
- signed, _ = c.sign(message, mode=pyme.constants.SIG_MODE_CLEAR)
+ signed, _ = c.sign(message, mode=gpg.constants.sig.mode.CLEAR)
assert len(signed) > 0
assert signed.find(b'BEGIN PGP SIGNED MESSAGE') > 0, 'Message not found'
assert signed.find(message) > 0, 'Message content not found'
assert signed.find(b'BEGIN PGP SIGNATURE') > 0, 'Signature not found'
-with pyme.Context() as c:
+with gpg.Context() as c:
message = "Hallo Leute\n".encode()
c.signers = [c.get_key(support.sign_only, True)]
@@ -115,7 +114,7 @@ with pyme.Context() as c:
c.signers = [c.get_key(support.encrypt_only, True)]
try:
c.sign(message)
- except pyme.errors.InvalidSigners as e:
+ except gpg.errors.InvalidSigners as e:
assert len(e.signers) == 1
assert support.encrypt_only.endswith(e.signers[0].fpr)
else:
diff --git a/lang/python/tests/t-signers.py b/lang/python/tests/t-signers.py
index 11403af..80e797c 100755
--- a/lang/python/tests/t-signers.py
+++ b/lang/python/tests/t-signers.py
@@ -20,8 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import pyme
-from pyme import core, constants
+import gpg
import support
def fail(msg):
@@ -38,11 +37,11 @@ def check_result(r, typ):
if signature.type != typ:
fail("Wrong type of signature created")
- if signature.pubkey_algo != constants.PK_DSA:
+ if signature.pubkey_algo != gpg.constants.pk.DSA:
fail("Wrong pubkey algorithm reported: {}".format(
signature.pubkey_algo))
- if signature.hash_algo != constants.MD_SHA1:
+ if signature.hash_algo != gpg.constants.md.SHA1:
fail("Wrong hash algorithm reported: {}".format(
signature.hash_algo))
@@ -55,8 +54,8 @@ def check_result(r, typ):
fail("Wrong fingerprint reported: {}".format(signature.fpr))
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_textmode(True)
c.set_armor(True)
@@ -69,10 +68,10 @@ c.op_keylist_end()
c.signers_add(keys[0])
c.signers_add(keys[1])
-for mode in (constants.SIG_MODE_NORMAL, constants.SIG_MODE_DETACH,
- constants.SIG_MODE_CLEAR):
- source = core.Data("Hallo Leute\n")
- sink = core.Data()
+for mode in (gpg.constants.sig.mode.NORMAL, gpg.constants.sig.mode.DETACH,
+ gpg.constants.sig.mode.CLEAR):
+ source = gpg.Data("Hallo Leute\n")
+ sink = gpg.Data()
c.op_sign(source, sink, mode)
@@ -81,18 +80,18 @@ for mode in (constants.SIG_MODE_NORMAL, constants.SIG_MODE_DETACH,
support.print_data(sink)
# Idiomatic interface.
-with pyme.Context(armor=True, textmode=True, signers=keys) as c:
+with gpg.Context(armor=True, textmode=True, signers=keys) as c:
message = "Hallo Leute\n".encode()
signed, result = c.sign(message)
- check_result(result, constants.SIG_MODE_NORMAL)
+ check_result(result, gpg.constants.sig.mode.NORMAL)
assert signed.find(b'BEGIN PGP MESSAGE') > 0, 'Message not found'
- signed, result = c.sign(message, mode=constants.SIG_MODE_DETACH)
- check_result(result, constants.SIG_MODE_DETACH)
+ signed, result = c.sign(message, mode=gpg.constants.sig.mode.DETACH)
+ check_result(result, gpg.constants.sig.mode.DETACH)
assert signed.find(b'BEGIN PGP SIGNATURE') > 0, 'Signature not found'
- signed, result = c.sign(message, mode=constants.SIG_MODE_CLEAR)
- check_result(result, constants.SIG_MODE_CLEAR)
+ signed, result = c.sign(message, mode=gpg.constants.sig.mode.CLEAR)
+ check_result(result, gpg.constants.sig.mode.CLEAR)
assert signed.find(b'BEGIN PGP SIGNED MESSAGE') > 0, 'Message not found'
assert signed.find(message) > 0, 'Message content not found'
assert signed.find(b'BEGIN PGP SIGNATURE') > 0, 'Signature not found'
diff --git a/lang/python/tests/t-trustlist.py b/lang/python/tests/t-trustlist.py
index 4253bd7..8c5e214 100755
--- a/lang/python/tests/t-trustlist.py
+++ b/lang/python/tests/t-trustlist.py
@@ -20,11 +20,11 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-from pyme import core, constants
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
def dump_item(item):
print("l={} k={} t={} o={} v={} u={}".format(
diff --git a/lang/python/tests/t-verify.py b/lang/python/tests/t-verify.py
index 39f6176..f18e1dd 100755
--- a/lang/python/tests/t-verify.py
+++ b/lang/python/tests/t-verify.py
@@ -22,8 +22,7 @@ del absolute_import, print_function, unicode_literals
import sys
import os
-import pyme
-from pyme import core, constants, errors
+import gpg
import support
test_text1 = b"Just GNU it!\n"
@@ -67,7 +66,7 @@ def check_result(result, summary, validity, fpr, status, notation):
"Unexpected signature summary: {}, want: {}".format(sig.summary,
summary)
assert sig.fpr == fpr
- assert errors.GPGMEError(sig.status).getcode() == status
+ assert gpg.errors.GPGMEError(sig.status).getcode() == status
if notation:
expected_notations = {
@@ -96,87 +95,87 @@ def check_result(result, summary, validity, fpr, status, notation):
assert sig.validity == validity, \
"Unexpected signature validity: {}, want: {}".format(
sig.validity, validity)
- assert errors.GPGMEError(sig.validity_reason).getcode() == errors.NO_ERROR
+ assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
# Checking a valid message.
-text = core.Data(test_text1)
-sig = core.Data(test_sig1)
+text = gpg.Data(test_text1)
+sig = gpg.Data(test_sig1)
c.op_verify(sig, text, None)
result = c.op_verify_result()
-check_result(result, constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
- constants.VALIDITY_FULL,
+check_result(result, gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
+ gpg.constants.validity.FULL,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR, True)
+ gpg.errors.NO_ERROR, True)
# Checking a manipulated message.
-text = core.Data(test_text1f)
+text = gpg.Data(test_text1f)
sig.seek(0, os.SEEK_SET)
c.op_verify(sig, text, None)
result = c.op_verify_result()
-check_result(result, constants.SIGSUM_RED, constants.VALIDITY_UNKNOWN,
- "2D727CC768697734", errors.BAD_SIGNATURE, False)
+check_result(result, gpg.constants.sigsum.RED, gpg.constants.validity.UNKNOWN,
+ "2D727CC768697734", gpg.errors.BAD_SIGNATURE, False)
# Checking a normal signature.
-text = core.Data()
-sig = core.Data(test_sig2)
+text = gpg.Data()
+sig = gpg.Data(test_sig2)
c.op_verify(sig, None, text)
result = c.op_verify_result()
-check_result(result, constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
- constants.VALIDITY_FULL,
+check_result(result, gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
+ gpg.constants.validity.FULL,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR, False)
+ gpg.errors.NO_ERROR, False)
# Checking an invalid message.
-text = core.Data()
-sig = core.Data(double_plaintext_sig)
+text = gpg.Data()
+sig = gpg.Data(double_plaintext_sig)
try:
c.op_verify(sig, None, text)
except Exception as e:
- assert type(e) == errors.GPGMEError
- assert e.getcode() == errors.BAD_DATA
+ assert type(e) == gpg.errors.GPGMEError
+ assert e.getcode() == gpg.errors.BAD_DATA
else:
assert False, "Expected an error but got none."
# Idiomatic interface.
-with pyme.Context(armor=True) as c:
+with gpg.Context(armor=True) as c:
# Checking a valid message.
_, result = c.verify(test_text1, test_sig1)
- check_result(result, constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
- constants.VALIDITY_FULL,
+ check_result(result, gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
+ gpg.constants.validity.FULL,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR, True)
+ gpg.errors.NO_ERROR, True)
# Checking a manipulated message.
try:
c.verify(test_text1f, test_sig1)
- except errors.BadSignatures as e:
- check_result(e.result, constants.SIGSUM_RED,
- constants.VALIDITY_UNKNOWN,
- "2D727CC768697734", errors.BAD_SIGNATURE, False)
+ except gpg.errors.BadSignatures as e:
+ check_result(e.result, gpg.constants.sigsum.RED,
+ gpg.constants.validity.UNKNOWN,
+ "2D727CC768697734", gpg.errors.BAD_SIGNATURE, False)
else:
assert False, "Expected an error but got none."
# Checking a normal signature.
- sig = core.Data(test_sig2)
+ sig = gpg.Data(test_sig2)
data, result = c.verify(test_sig2)
- check_result(result, constants.SIGSUM_VALID | constants.SIGSUM_GREEN,
- constants.VALIDITY_FULL,
+ check_result(result, gpg.constants.sigsum.VALID | gpg.constants.sigsum.GREEN,
+ gpg.constants.validity.FULL,
"A0FF4590BB6122EDEF6E3C542D727CC768697734",
- errors.NO_ERROR, False)
+ gpg.errors.NO_ERROR, False)
assert data == test_text1
# Checking an invalid message.
try:
c.verify(double_plaintext_sig)
- except errors.GPGMEError as e:
- assert e.getcode() == errors.BAD_DATA
+ except gpg.errors.GPGMEError as e:
+ assert e.getcode() == gpg.errors.BAD_DATA
else:
assert False, "Expected an error but got none."
@@ -188,7 +187,7 @@ with pyme.Context(armor=True) as c:
try:
c.verify(test_text1, test_sig1, verify=[alpha, bob])
- except errors.MissingSignatures as e:
+ except gpg.errors.MissingSignatures as e:
assert len(e.missing) == 1
assert e.missing[0] == bob
else:
diff --git a/lang/python/tests/t-wait.py b/lang/python/tests/t-wait.py
index b7d9a34..b1f2043 100755
--- a/lang/python/tests/t-wait.py
+++ b/lang/python/tests/t-wait.py
@@ -21,16 +21,16 @@ from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import time
-from pyme import core, constants, errors
+import gpg
import support
-support.init_gpgme(constants.PROTOCOL_OpenPGP)
-c = core.Context()
+support.init_gpgme(gpg.constants.protocol.OpenPGP)
+c = gpg.Context()
c.set_armor(True)
# Checking a message without a signature.
-sig = core.Data("foo\n")
-text = core.Data()
+sig = gpg.Data("foo\n")
+text = gpg.Data()
c.op_verify_start(sig, None, text)
try:
@@ -40,6 +40,6 @@ try:
break
time.sleep(0.1)
except Exception as e:
- assert e.getcode() == errors.NO_DATA
+ assert e.getcode() == gpg.errors.NO_DATA
else:
assert False, "Expected an error, got none"
diff --git a/lang/python/tests/t-wrapper.py b/lang/python/tests/t-wrapper.py
index d260264..79f047f 100755
--- a/lang/python/tests/t-wrapper.py
+++ b/lang/python/tests/t-wrapper.py
@@ -17,9 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
-from pyme import core
+import gpg
-d0 = core.Data()
+d0 = gpg.Data()
d0.seek # trigger on-demand-wrapping
assert d0.seek == d0.seek, "Generated wrapper functions are not cached"
-assert hasattr(core.Data, 'seek'), "Generated wrapper functions are not shared"
+assert hasattr(gpg.Data, 'seek'), "Generated wrapper functions are not shared"
diff --git a/lang/qt/Makefile.in b/lang/qt/Makefile.in
index d8b48d2..5c32620 100644
--- a/lang/qt/Makefile.in
+++ b/lang/qt/Makefile.in
@@ -330,6 +330,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/qt/doc/Makefile.in b/lang/qt/doc/Makefile.in
index d6d9ef7..c4aff43 100644
--- a/lang/qt/doc/Makefile.in
+++ b/lang/qt/doc/Makefile.in
@@ -268,6 +268,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/qt/src/DN b/lang/qt/src/DN
new file mode 100644
index 0000000..2697bfb
--- /dev/null
+++ b/lang/qt/src/DN
@@ -0,0 +1 @@
+#include "qgpgme/dn.h"
diff --git a/lang/qt/src/Makefile.am b/lang/qt/src/Makefile.am
index 51fe314..87e2ec2 100644
--- a/lang/qt/src/Makefile.am
+++ b/lang/qt/src/Makefile.am
@@ -19,7 +19,8 @@
# 02111-1307, USA
lib_LTLIBRARIES = libqgpgme.la
EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
- gpgme_backend_debug.h qgpgme_version.h.in
+ gpgme_backend_debug.h qgpgme_version.h.in \
+ QGpgmeConfig.cmake.in.in
qgpgme_sources = \
dataprovider.cpp job.cpp multideletejob.cpp qgpgmeadduseridjob.cpp \
@@ -35,7 +36,8 @@ qgpgme_sources = \
qgpgmeverifyopaquejob.cpp threadedjobmixin.cpp \
qgpgmekeyformailboxjob.cpp gpgme_backend_debug.cpp \
qgpgmetofupolicyjob.cpp \
- defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp
+ defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \
+ dn.cpp
# If you add one here make sure that you also add one in camelcase
qgpgme_headers= \
@@ -73,7 +75,8 @@ qgpgme_headers= \
verifydetachedjob.h \
defaultkeygenerationjob.h \
tofupolicyjob.h \
- wkspublishjob.h
+ wkspublishjob.h \
+ dn.h
camelcase_headers= \
AddUserIDJob \
@@ -84,6 +87,7 @@ camelcase_headers= \
DataProvider \
DecryptJob \
DecryptVerifyJob \
+ DN \
DownloadJob \
EncryptJob \
ExportJob \
@@ -203,7 +207,7 @@ qgpgmeincludedir = $(includedir)/qgpgme
qgpgmeinclude_HEADERS = $(qgpgme_headers)
camelcaseincludedir = $(includedir)/QGpgME
camelcaseinclude_HEADERS = $(camelcase_headers)
-nodist_include_HEADERS = qgpgme_version.h
+nodist_qgpgmeinclude_HEADERS = qgpgme_version.h
libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
@@ -213,19 +217,19 @@ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
@LIBASSUAN_LIBS@ @GPGME_QT_LIBS@
-libqgpgme_la_LDFLAGS = -version-info \
+libqgpgme_la_LDFLAGS = -no-undefined -version-info \
@LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@
if HAVE_W32_SYSTEM
-libsuffix=.dll.a
+QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in
+ sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
+ sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
+ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
else
-libsuffix=.so
-endif
-
QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
- sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
+endif
$(camelcase_headers): Makefile.am
echo -n "#include \"qgpgme/" > "$@"
@@ -233,16 +237,16 @@ $(camelcase_headers): Makefile.am
echo ".h\"" >> "$@"
install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
- -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/Gpgmepp
+ -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme
$(INSTALL) -m 644 QGpgmeConfig.cmake \
- $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfig.cmake
+ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
$(INSTALL) -m 644 QGpgmeConfigVersion.cmake \
- $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfigVersion.cmake
+ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
uninstall-cmake-files:
- -rm $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfigVersion.cmake
- -rm $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfig.cmake
- -rmdir $(DESTDIR)$(libdir)/cmake/Gpgmepp/
+ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
+ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
+ -rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/
install-data-local: install-cmake-files
@@ -250,7 +254,9 @@ uninstall-local: uninstall-cmake-files
BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers)
-CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake
+CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \
+ qgpgme_version.h QGpgmeConfig.cmake.in \
+ QGpgmeConfigVersion.cmake
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources)
diff --git a/lang/qt/src/Makefile.in b/lang/qt/src/Makefile.in
index 0aa0590..5b87f6e 100644
--- a/lang/qt/src/Makefile.in
+++ b/lang/qt/src/Makefile.in
@@ -82,6 +82,7 @@ host_triplet = @host@
subdir = lang/qt/src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/mkinstalldirs \
+ $(srcdir)/QGpgmeConfig-w32.cmake.in.in \
$(srcdir)/QGpgmeConfig.cmake.in.in \
$(srcdir)/QGpgmeConfigVersion.cmake.in \
$(srcdir)/qgpgme_version.h.in $(top_srcdir)/build-aux/depcomp \
@@ -102,8 +103,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = QGpgmeConfig.cmake.in QGpgmeConfigVersion.cmake \
- qgpgme_version.h
+CONFIG_CLEAN_FILES = QGpgmeConfig-w32.cmake.in QGpgmeConfig.cmake.in \
+ QGpgmeConfigVersion.cmake qgpgme_version.h
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -133,7 +134,8 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" \
- "$(DESTDIR)$(camelcaseincludedir)" "$(DESTDIR)$(includedir)" \
+ "$(DESTDIR)$(camelcaseincludedir)" \
+ "$(DESTDIR)$(qgpgmeincludedir)" \
"$(DESTDIR)$(qgpgmeincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libqgpgme_la_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \
@@ -152,7 +154,7 @@ am__objects_1 = dataprovider.lo job.lo multideletejob.lo \
qgpgmeverifydetachedjob.lo qgpgmeverifyopaquejob.lo \
threadedjobmixin.lo qgpgmekeyformailboxjob.lo \
gpgme_backend_debug.lo qgpgmetofupolicyjob.lo \
- defaultkeygenerationjob.lo qgpgmewkspublishjob.lo
+ defaultkeygenerationjob.lo qgpgmewkspublishjob.lo dn.lo
am__objects_2 =
am_libqgpgme_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_2)
@@ -225,7 +227,7 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-HEADERS = $(camelcaseinclude_HEADERS) $(nodist_include_HEADERS) \
+HEADERS = $(camelcaseinclude_HEADERS) $(nodist_qgpgmeinclude_HEADERS) \
$(qgpgmeinclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
@@ -378,6 +380,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -461,7 +466,8 @@ top_srcdir = @top_srcdir@
# 02111-1307, USA
lib_LTLIBRARIES = libqgpgme.la
EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
- gpgme_backend_debug.h qgpgme_version.h.in
+ gpgme_backend_debug.h qgpgme_version.h.in \
+ QGpgmeConfig.cmake.in.in
qgpgme_sources = \
dataprovider.cpp job.cpp multideletejob.cpp qgpgmeadduseridjob.cpp \
@@ -477,7 +483,8 @@ qgpgme_sources = \
qgpgmeverifyopaquejob.cpp threadedjobmixin.cpp \
qgpgmekeyformailboxjob.cpp gpgme_backend_debug.cpp \
qgpgmetofupolicyjob.cpp \
- defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp
+ defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \
+ dn.cpp
# If you add one here make sure that you also add one in camelcase
@@ -516,7 +523,8 @@ qgpgme_headers = \
verifydetachedjob.h \
defaultkeygenerationjob.h \
tofupolicyjob.h \
- wkspublishjob.h
+ wkspublishjob.h \
+ dn.h
camelcase_headers = \
AddUserIDJob \
@@ -527,6 +535,7 @@ camelcase_headers = \
DataProvider \
DecryptJob \
DecryptVerifyJob \
+ DN \
DownloadJob \
EncryptJob \
ExportJob \
@@ -646,7 +655,7 @@ qgpgmeincludedir = $(includedir)/qgpgme
qgpgmeinclude_HEADERS = $(qgpgme_headers)
camelcaseincludedir = $(includedir)/QGpgME
camelcaseinclude_HEADERS = $(camelcase_headers)
-nodist_include_HEADERS = qgpgme_version.h
+nodist_qgpgmeinclude_HEADERS = qgpgme_version.h
libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
@GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
@@ -655,13 +664,14 @@ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
@LIBASSUAN_LIBS@ @GPGME_QT_LIBS@
-libqgpgme_la_LDFLAGS = -version-info \
+libqgpgme_la_LDFLAGS = -no-undefined -version-info \
@LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@
-@HAVE_W32_SYSTEM_FALSE@libsuffix = .so
-@HAVE_W32_SYSTEM_TRUE@libsuffix = .dll.a
BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers)
-CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake
+CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \
+ qgpgme_version.h QGpgmeConfig.cmake.in \
+ QGpgmeConfigVersion.cmake
+
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -698,6 +708,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+QGpgmeConfig-w32.cmake.in: $(top_builddir)/config.status $(srcdir)/QGpgmeConfig-w32.cmake.in.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
QGpgmeConfig.cmake.in: $(top_builddir)/config.status $(srcdir)/QGpgmeConfig.cmake.in.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
QGpgmeConfigVersion.cmake: $(top_builddir)/config.status $(srcdir)/QGpgmeConfigVersion.cmake.in
@@ -751,6 +763,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dataprovider.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defaultkeygenerationjob.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dn.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgme_backend_debug.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multideletejob.Plo@am__quote@
@@ -830,27 +843,27 @@ uninstall-camelcaseincludeHEADERS:
@list='$(camelcaseinclude_HEADERS)'; test -n "$(camelcaseincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(camelcaseincludedir)'; $(am__uninstall_files_from_dir)
-install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+install-nodist_qgpgmeincludeHEADERS: $(nodist_qgpgmeinclude_HEADERS)
@$(NORMAL_INSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_qgpgmeinclude_HEADERS)'; test -n "$(qgpgmeincludedir)" || list=; \
if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(qgpgmeincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(qgpgmeincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(qgpgmeincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(qgpgmeincludedir)" || exit $$?; \
done
-uninstall-nodist_includeHEADERS:
+uninstall-nodist_qgpgmeincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_qgpgmeinclude_HEADERS)'; test -n "$(qgpgmeincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+ dir='$(DESTDIR)$(qgpgmeincludedir)'; $(am__uninstall_files_from_dir)
install-qgpgmeincludeHEADERS: $(qgpgmeinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(qgpgmeinclude_HEADERS)'; test -n "$(qgpgmeincludedir)" || list=; \
@@ -960,7 +973,7 @@ check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(camelcaseincludedir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(qgpgmeincludedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(camelcaseincludedir)" "$(DESTDIR)$(qgpgmeincludedir)" "$(DESTDIR)$(qgpgmeincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -1020,7 +1033,8 @@ info: info-am
info-am:
install-data-am: install-camelcaseincludeHEADERS install-data-local \
- install-nodist_includeHEADERS install-qgpgmeincludeHEADERS
+ install-nodist_qgpgmeincludeHEADERS \
+ install-qgpgmeincludeHEADERS
install-dvi: install-dvi-am
@@ -1068,7 +1082,8 @@ ps-am:
uninstall-am: uninstall-camelcaseincludeHEADERS \
uninstall-libLTLIBRARIES uninstall-local \
- uninstall-nodist_includeHEADERS uninstall-qgpgmeincludeHEADERS
+ uninstall-nodist_qgpgmeincludeHEADERS \
+ uninstall-qgpgmeincludeHEADERS
.MAKE: all check install install-am install-strip
@@ -1081,21 +1096,24 @@ uninstall-am: uninstall-camelcaseincludeHEADERS \
install-data-local install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES install-man \
- install-nodist_includeHEADERS install-pdf install-pdf-am \
+ install-nodist_qgpgmeincludeHEADERS install-pdf install-pdf-am \
install-ps install-ps-am install-qgpgmeincludeHEADERS \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-camelcaseincludeHEADERS uninstall-libLTLIBRARIES \
- uninstall-local uninstall-nodist_includeHEADERS \
+ uninstall-local uninstall-nodist_qgpgmeincludeHEADERS \
uninstall-qgpgmeincludeHEADERS
-QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
- sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
- sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
- sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
+@HAVE_W32_SYSTEM_TRUE@QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
+@HAVE_W32_SYSTEM_TRUE@ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
+@HAVE_W32_SYSTEM_FALSE@QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
+@HAVE_W32_SYSTEM_FALSE@ sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
+@HAVE_W32_SYSTEM_FALSE@ sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
$(camelcase_headers): Makefile.am
echo -n "#include \"qgpgme/" > "$@"
@@ -1103,16 +1121,16 @@ $(camelcase_headers): Makefile.am
echo ".h\"" >> "$@"
install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
- -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/Gpgmepp
+ -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme
$(INSTALL) -m 644 QGpgmeConfig.cmake \
- $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfig.cmake
+ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
$(INSTALL) -m 644 QGpgmeConfigVersion.cmake \
- $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfigVersion.cmake
+ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
uninstall-cmake-files:
- -rm $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfigVersion.cmake
- -rm $(DESTDIR)$(libdir)/cmake/Gpgmepp/QGpgmeConfig.cmake
- -rmdir $(DESTDIR)$(libdir)/cmake/Gpgmepp/
+ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
+ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
+ -rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/
install-data-local: install-cmake-files
diff --git a/lang/qt/src/QGpgmeConfig-w32.cmake.in.in b/lang/qt/src/QGpgmeConfig-w32.cmake.in.in
new file mode 100644
index 0000000..b897805
--- /dev/null
+++ b/lang/qt/src/QGpgmeConfig-w32.cmake.in.in
@@ -0,0 +1,105 @@
+# CMake Config file for QGPGME.
+# Copyright (C) 2016 Intevation GmbH
+#
+# This file is part of GPGME.
+#
+# GPGME-CL is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# GPGME-CL 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 General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA
+
+# based on a generated file from cmake.
+# Generated by CMake 3.0.2
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+ message(FATAL_ERROR "CMake >= 2.6.0 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.6)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget QGpgme)
+ list(APPEND _expectedTargets ${_expectedTarget})
+ if(NOT TARGET ${_expectedTarget})
+ list(APPEND _targetsNotDefined ${_expectedTarget})
+ endif()
+ if(TARGET ${_expectedTarget})
+ list(APPEND _targetsDefined ${_expectedTarget})
+ endif()
+endforeach()
+if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
+ set(CMAKE_IMPORT_FILE_VERSION)
+ cmake_policy(POP)
+ return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+ message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+# Create imported target QGpgme
+add_library(QGpgme SHARED IMPORTED)
+
+set_target_properties(QGpgme PROPERTIES
+ IMPORTED_IMPLIB_RELEASE "@resolved_libdir@/libqgpgme.dll.a"
+ INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
+ INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
+ IMPORTED_LOCATION "@resolved_libdir@/libqgpgme-7.dll"
+)
+
+list(APPEND _IMPORT_CHECK_TARGETS QGgpme )
+list(APPEND _IMPORT_CHECK_FILES_FOR_Qgpgme "@resolved_libdir@/libqgpgme.dll.a" "@resolved_bindir@/libqgpgme-7.dll" )
+
+if(CMAKE_VERSION VERSION_LESS 2.8.12)
+ message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
+endif()
+
+# Loop over all imported files and verify that they actually exist
+foreach(target ${_IMPORT_CHECK_TARGETS} )
+ foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
+ if(NOT EXISTS "${file}" )
+ message(FATAL_ERROR "The imported target \"${target}\" references the file
+ \"${file}\"
+but this file does not exist. Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+ \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+ endif()
+ endforeach()
+ unset(_IMPORT_CHECK_FILES_FOR_${target})
+endforeach()
+unset(_IMPORT_CHECK_TARGETS)
+
+# This file does not depend on other imported targets which have
+# been exported from the same project but in a separate export set.
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)
+
+# Gpgmepp is a requirement for qgpgme
+find_package(Gpgmepp CONFIG REQUIRED)
diff --git a/lang/qt/src/QGpgmeConfig.cmake.in.in b/lang/qt/src/QGpgmeConfig.cmake.in.in
index 5b6c188..88ed242 100644
--- a/lang/qt/src/QGpgmeConfig.cmake.in.in
+++ b/lang/qt/src/QGpgmeConfig.cmake.in.in
@@ -64,7 +64,7 @@ add_library(QGpgme SHARED IMPORTED)
set_target_properties(QGpgme PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
- IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@"
+ IMPORTED_LOCATION "@resolved_libdir@/libqgpgme.so"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
@@ -96,3 +96,6 @@ unset(_IMPORT_CHECK_TARGETS)
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
+
+# Gpgmepp is a requirement for qgpgme
+find_package(Gpgmepp CONFIG REQUIRED)
diff --git a/lang/qt/src/QGpgmeConfigVersion.cmake.in b/lang/qt/src/QGpgmeConfigVersion.cmake.in
index 04a12cb..549a536 100644
--- a/lang/qt/src/QGpgmeConfigVersion.cmake.in
+++ b/lang/qt/src/QGpgmeConfigVersion.cmake.in
@@ -19,7 +19,7 @@
# 02111-1307, USA
# based on a generated file from cmake.
-set(PACKAGE_VERSION "@LIBQGPGME_LT_CURRENT@.@LIBQGPGME_LT_AGE@.@LIBQGPGME_LT_REVISION@.@BUILD_REVISION@")
+set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE)
diff --git a/lang/qt/src/defaultkeygenerationjob.cpp b/lang/qt/src/defaultkeygenerationjob.cpp
index d26e824..020f4d2 100644
--- a/lang/qt/src/defaultkeygenerationjob.cpp
+++ b/lang/qt/src/defaultkeygenerationjob.cpp
@@ -105,11 +105,11 @@ GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString
d->job = openpgp()->keyGenerationJob();
d->job->installEventFilter(this);
- connect(d->job, &KeyGenerationJob::result,
+ connect(d->job.data(), &KeyGenerationJob::result,
this, &DefaultKeyGenerationJob::result);
- connect(d->job, &KeyGenerationJob::done,
+ connect(d->job.data(), &KeyGenerationJob::done,
this, &DefaultKeyGenerationJob::done);
- connect(d->job, &KeyGenerationJob::done,
+ connect(d->job.data(), &KeyGenerationJob::done,
this, &QObject::deleteLater);
return d->job->start(args);
}
diff --git a/lang/qt/src/dn.cpp b/lang/qt/src/dn.cpp
new file mode 100644
index 0000000..0f81a4c
--- /dev/null
+++ b/lang/qt/src/dn.cpp
@@ -0,0 +1,495 @@
+/*
+ dn.cpp
+
+ This file is part of qgpgme, the Qt API binding for gpgme
+ Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ Copyright (c) 2016 Intevation GmbH
+
+ QGpgME is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ QGpgME is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include "dn.h"
+
+static const struct {
+ const char *name;
+ const char *oid;
+} oidmap[] = {
+ // keep them ordered by oid:
+ { "SP", "ST" }, // hack to show the Sphinx-required/desired SP for
+ // StateOrProvince, otherwise known as ST or even S
+ { "NameDistinguisher", "0.2.262.1.10.7.20" },
+ { "EMAIL", "1.2.840.113549.1.9.1" },
+ { "SN", "2.5.4.4" },
+ { "SerialNumber", "2.5.4.5" },
+ { "T", "2.5.4.12" },
+ { "D", "2.5.4.13" },
+ { "BC", "2.5.4.15" },
+ { "ADDR", "2.5.4.16" },
+ { "PC", "2.5.4.17" },
+ { "GN", "2.5.4.42" },
+ { "Pseudo", "2.5.4.65" },
+};
+static const unsigned int numOidMaps = sizeof oidmap / sizeof * oidmap;
+
+class QGpgME::DN::Private
+{
+public:
+ Private() : mRefCount(0) {}
+ Private(const Private &other)
+ : attributes(other.attributes),
+ reorderedAttributes(other.reorderedAttributes),
+ order{"CN", "L", "_X_", "OU", "O", "C"},
+ mRefCount(0)
+ {
+ }
+
+ int ref()
+ {
+ return ++mRefCount;
+ }
+
+ int unref()
+ {
+ if (--mRefCount <= 0) {
+ delete this;
+ return 0;
+ } else {
+ return mRefCount;
+ }
+ }
+
+ int refCount() const
+ {
+ return mRefCount;
+ }
+
+ DN::Attribute::List attributes;
+ DN::Attribute::List reorderedAttributes;
+ QStringList order;
+private:
+ int mRefCount;
+};
+
+namespace
+{
+struct DnPair {
+ char *key;
+ char *value;
+};
+}
+
+// copied from CryptPlug and adapted to work on DN::Attribute::List:
+
+#define digitp(p) (*(p) >= '0' && *(p) <= '9')
+#define hexdigitp(a) (digitp (a) \
+ || (*(a) >= 'A' && *(a) <= 'F') \
+ || (*(a) >= 'a' && *(a) <= 'f'))
+#define xtoi_1(p) (*(p) <= '9'? (*(p)- '0'): \
+ *(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
+#define xtoi_2(p) ((xtoi_1(p) * 16) + xtoi_1((p)+1))
+
+static char *
+trim_trailing_spaces(char *string)
+{
+ char *p, *mark;
+
+ for (mark = NULL, p = string; *p; p++) {
+ if (isspace(*p)) {
+ if (!mark) {
+ mark = p;
+ }
+ } else {
+ mark = NULL;
+ }
+ }
+ if (mark) {
+ *mark = '\0';
+ }
+
+ return string;
+}
+
+/* Parse a DN and return an array-ized one. This is not a validating
+ parser and it does not support any old-stylish syntax; gpgme is
+ expected to return only rfc2253 compatible strings. */
+static const unsigned char *
+parse_dn_part(DnPair *array, const unsigned char *string)
+{
+ const unsigned char *s, *s1;
+ size_t n;
+ char *p;
+
+ /* parse attributeType */
+ for (s = string + 1; *s && *s != '='; s++)
+ ;
+ if (!*s) {
+ return NULL; /* error */
+ }
+ n = s - string;
+ if (!n) {
+ return NULL; /* empty key */
+ }
+ p = (char *)malloc(n + 1);
+
+ memcpy(p, string, n);
+ p[n] = 0;
+ trim_trailing_spaces((char *)p);
+ // map OIDs to their names:
+ for (unsigned int i = 0; i < numOidMaps; ++i)
+ if (!strcasecmp((char *)p, oidmap[i].oid)) {
+ free(p);
+ p = strdup(oidmap[i].name);
+ break;
+ }
+ array->key = p;
+ string = s + 1;
+
+ if (*string == '#') {
+ /* hexstring */
+ string++;
+ for (s = string; hexdigitp(s); s++) {
+ s++;
+ }
+ n = s - string;
+ if (!n || (n & 1)) {
+ return NULL; /* empty or odd number of digits */
+ }
+ n /= 2;
+ array->value = p = (char *)malloc(n + 1);
+
+ for (s1 = string; n; s1 += 2, n--) {
+ *p++ = xtoi_2(s1);
+ }
+ *p = 0;
+ } else {
+ /* regular v3 quoted string */
+ for (n = 0, s = string; *s; s++) {
+ if (*s == '\\') {
+ /* pair */
+ s++;
+ if (*s == ',' || *s == '=' || *s == '+'
+ || *s == '<' || *s == '>' || *s == '#' || *s == ';'
+ || *s == '\\' || *s == '\"' || *s == ' ') {
+ n++;
+ } else if (hexdigitp(s) && hexdigitp(s + 1)) {
+ s++;
+ n++;
+ } else {
+ return NULL; /* invalid escape sequence */
+ }
+ } else if (*s == '\"') {
+ return NULL; /* invalid encoding */
+ } else if (*s == ',' || *s == '=' || *s == '+'
+ || *s == '<' || *s == '>' || *s == '#' || *s == ';') {
+ break;
+ } else {
+ n++;
+ }
+ }
+
+ array->value = p = (char *)malloc(n + 1);
+
+ for (s = string; n; s++, n--) {
+ if (*s == '\\') {
+ s++;
+ if (hexdigitp(s)) {
+ *p++ = xtoi_2(s);
+ s++;
+ } else {
+ *p++ = *s;
+ }
+ } else {
+ *p++ = *s;
+ }
+ }
+ *p = 0;
+ }
+ return s;
+}
+
+/* Parse a DN and return an array-ized one. This is not a validating
+ parser and it does not support any old-stylish syntax; gpgme is
+ expected to return only rfc2253 compatible strings. */
+static QGpgME::DN::Attribute::List
+parse_dn(const unsigned char *string)
+{
+ if (!string) {
+ return QVector<QGpgME::DN::Attribute>();
+ }
+
+ QVector<QGpgME::DN::Attribute> result;
+ while (*string) {
+ while (*string == ' ') {
+ string++;
+ }
+ if (!*string) {
+ break; /* ready */
+ }
+
+ DnPair pair = { 0, 0 };
+ string = parse_dn_part(&pair, string);
+ if (!string) {
+ goto failure;
+ }
+ if (pair.key && pair.value)
+ result.push_back(QGpgME::DN::Attribute(QString::fromUtf8(pair.key),
+ QString::fromUtf8(pair.value)));
+ free(pair.key);
+ free(pair.value);
+
+ while (*string == ' ') {
+ string++;
+ }
+ if (*string && *string != ',' && *string != ';' && *string != '+') {
+ goto failure; /* invalid delimiter */
+ }
+ if (*string) {
+ string++;
+ }
+ }
+ return result;
+
+failure:
+ return QVector<QGpgME::DN::Attribute>();
+}
+
+static QVector<QGpgME::DN::Attribute>
+parse_dn(const QString &dn)
+{
+ return parse_dn((const unsigned char *)dn.toUtf8().data());
+}
+
+static QString dn_escape(const QString &s)
+{
+ QString result;
+ for (unsigned int i = 0, end = s.length(); i != end; ++i) {
+ const QChar ch = s[i];
+ switch (ch.unicode()) {
+ case ',':
+ case '+':
+ case '"':
+ case '\\':
+ case '<':
+ case '>':
+ case ';':
+ result += QLatin1Char('\\');
+ // fall through
+ default:
+ result += ch;
+ }
+ }
+ return result;
+}
+
+static QString
+serialise(const QVector<QGpgME::DN::Attribute> &dn, const QString &sep)
+{
+ QStringList result;
+ for (QVector<QGpgME::DN::Attribute>::const_iterator it = dn.begin(); it != dn.end(); ++it)
+ if (!(*it).name().isEmpty() && !(*it).value().isEmpty()) {
+ result.push_back((*it).name().trimmed() + QLatin1Char('=') + dn_escape((*it).value().trimmed()));
+ }
+ return result.join(sep);
+}
+
+static QGpgME::DN::Attribute::List
+reorder_dn(const QGpgME::DN::Attribute::List &dn, const QStringList &attrOrder)
+{
+ QGpgME::DN::Attribute::List unknownEntries;
+ QGpgME::DN::Attribute::List result;
+ unknownEntries.reserve(dn.size());
+ result.reserve(dn.size());
+
+ // find all unknown entries in their order of appearance
+ for (QGpgME::DN::const_iterator it = dn.begin(); it != dn.end(); ++it)
+ if (!attrOrder.contains((*it).name())) {
+ unknownEntries.push_back(*it);
+ }
+
+ // process the known attrs in the desired order
+ for (QStringList::const_iterator oit = attrOrder.begin(); oit != attrOrder.end(); ++oit)
+ if (*oit == QLatin1String("_X_")) {
+ // insert the unknown attrs
+ std::copy(unknownEntries.begin(), unknownEntries.end(),
+ std::back_inserter(result));
+ unknownEntries.clear(); // don't produce dup's
+ } else {
+ for (QGpgME::DN::const_iterator dnit = dn.begin(); dnit != dn.end(); ++dnit)
+ if ((*dnit).name() == *oit) {
+ result.push_back(*dnit);
+ }
+ }
+
+ return result;
+}
+
+//
+//
+// class DN
+//
+//
+
+QGpgME::DN::DN()
+{
+ d = new Private();
+ d->ref();
+}
+
+QGpgME::DN::DN(const QString &dn)
+{
+ d = new Private();
+ d->ref();
+ d->attributes = parse_dn(dn);
+}
+
+QGpgME::DN::DN(const char *utf8DN)
+{
+ d = new Private();
+ d->ref();
+ if (utf8DN) {
+ d->attributes = parse_dn((const unsigned char *)utf8DN);
+ }
+}
+
+QGpgME::DN::DN(const DN &other)
+ : d(other.d)
+{
+ if (d) {
+ d->ref();
+ }
+}
+
+QGpgME::DN::~DN()
+{
+ if (d) {
+ d->unref();
+ }
+}
+
+const QGpgME::DN &QGpgME::DN::operator=(const DN &that)
+{
+ if (this->d == that.d) {
+ return *this;
+ }
+
+ if (that.d) {
+ that.d->ref();
+ }
+ if (this->d) {
+ this->d->unref();
+ }
+
+ this->d = that.d;
+
+ return *this;
+}
+
+QString QGpgME::DN::prettyDN() const
+{
+ if (!d) {
+ return QString();
+ }
+ if (d->reorderedAttributes.empty()) {
+ d->reorderedAttributes = reorder_dn(d->attributes, d->order);
+ }
+ return serialise(d->reorderedAttributes, QStringLiteral(","));
+}
+
+QString QGpgME::DN::dn() const
+{
+ return d ? serialise(d->attributes, QStringLiteral(",")) : QString();
+}
+
+QString QGpgME::DN::dn(const QString &sep) const
+{
+ return d ? serialise(d->attributes, sep) : QString();
+}
+
+// static
+QString QGpgME::DN::escape(const QString &value)
+{
+ return dn_escape(value);
+}
+
+void QGpgME::DN::detach()
+{
+ if (!d) {
+ d = new QGpgME::DN::Private();
+ d->ref();
+ } else if (d->refCount() > 1) {
+ QGpgME::DN::Private *d_save = d;
+ d = new QGpgME::DN::Private(*d);
+ d->ref();
+ d_save->unref();
+ }
+}
+
+void QGpgME::DN::append(const Attribute &attr)
+{
+ detach();
+ d->attributes.push_back(attr);
+ d->reorderedAttributes.clear();
+}
+
+QString QGpgME::DN::operator[](const QString &attr) const
+{
+ if (!d) {
+ return QString();
+ }
+ const QString attrUpper = attr.toUpper();
+ for (QVector<Attribute>::const_iterator it = d->attributes.constBegin();
+ it != d->attributes.constEnd(); ++it)
+ if ((*it).name() == attrUpper) {
+ return (*it).value();
+ }
+ return QString();
+}
+
+static QVector<QGpgME::DN::Attribute> empty;
+
+QGpgME::DN::const_iterator QGpgME::DN::begin() const
+{
+ return d ? d->attributes.constBegin() : empty.constBegin();
+}
+
+QGpgME::DN::const_iterator QGpgME::DN::end() const
+{
+ return d ? d->attributes.constEnd() : empty.constEnd();
+}
+
+void QGpgME::DN::setAttributeOrder (const QStringList &order) const
+{
+ d->order = order;
+}
+
+const QStringList & QGpgME::DN::attributeOrder () const
+{
+ return d->order;
+}
diff --git a/lang/qt/src/dn.h b/lang/qt/src/dn.h
new file mode 100644
index 0000000..17b1c30
--- /dev/null
+++ b/lang/qt/src/dn.h
@@ -0,0 +1,136 @@
+/*
+ dn.h
+
+ This file is part of qgpgme, the Qt API binding for gpgme
+ Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ Copyright (c) 2016 Intevation GmbH
+
+ QGpgME is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ QGpgME is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+#ifndef QGPGME_DN_H
+#define QGPGME_DN_H
+
+#include "qgpgme_export.h"
+
+#include <QString>
+#include <QStringList>
+
+#include <QVector>
+
+namespace QGpgME
+{
+
+/**
+ @short DN parser and reorderer
+*/
+class QGPGME_EXPORT DN
+{
+public:
+ class Attribute;
+ typedef QVector<Attribute> AttributeList;
+ typedef AttributeList::const_iterator const_iterator;
+
+ DN();
+ explicit DN(const QString &dn);
+ explicit DN(const char *utf8DN);
+ DN(const DN &other);
+ ~DN();
+
+ const DN &operator=(const DN &other);
+
+ /** @return the value in rfc-2253-escaped form */
+ static QString escape(const QString &value);
+
+ /** @return the DN in a reordered form, according to the settings in
+ the [DN] group of the application's config file */
+ QString prettyDN() const;
+ /** @return the DN in the original form */
+ QString dn() const;
+ /**
+ \overload
+ Uses \a sep as separator (default: ,)
+ */
+ QString dn(const QString &sep) const;
+
+ QString operator[](const QString &attr) const;
+
+ void append(const Attribute &attr);
+
+ const_iterator begin() const;
+ const_iterator end() const;
+
+ /** Set the order in which prettyDN will reorder the Attirbutes. */
+ void setAttributeOrder(const QStringList &order) const;
+
+ /** Get the used attribute order. */
+ const QStringList & attributeOrder() const;
+
+private:
+ void detach();
+private:
+ class Private;
+ Private *d;
+};
+
+class QGPGME_EXPORT DN::Attribute
+{
+public:
+ typedef DN::AttributeList List;
+
+ explicit Attribute(const QString &name = QString(), const QString &value = QString())
+ : mName(name.toUpper()), mValue(value) {}
+ Attribute(const Attribute &other)
+ : mName(other.name()), mValue(other.value()) {}
+
+ const Attribute &operator=(const Attribute &other)
+ {
+ if (this != &other) {
+ mName = other.name();
+ mValue = other.value();
+ }
+ return *this;
+ }
+
+ const QString &name() const
+ {
+ return mName;
+ }
+ const QString &value() const
+ {
+ return mValue;
+ }
+
+ void setValue(const QString &value)
+ {
+ mValue = value;
+ }
+
+private:
+ QString mName;
+ QString mValue;
+};
+} // namespace QGpgME
+#endif // QGPGME_DN_H
diff --git a/lang/qt/src/job.cpp b/lang/qt/src/job.cpp
index 38dbc99..9ae3f31 100644
--- a/lang/qt/src/job.cpp
+++ b/lang/qt/src/job.cpp
@@ -62,6 +62,7 @@
#include "keyformailboxjob.h"
#include "wkspublishjob.h"
#include "tofupolicyjob.h"
+#include "threadedjobmixin.h"
#include <QCoreApplication>
#include <QDebug>
@@ -78,7 +79,6 @@ QGpgME::Job::Job(QObject *parent)
QGpgME::Job::~Job()
{
-
}
QString QGpgME::Job::auditLogAsHtml() const
@@ -98,6 +98,14 @@ bool QGpgME::Job::isAuditLogSupported() const
return auditLogError().code() != GPG_ERR_NOT_IMPLEMENTED;
}
+QMap <QGpgME::Job *, GpgME::Context *> QGpgME::g_context_map;
+
+/* static */
+GpgME::Context *QGpgME::Job::context(QGpgME::Job *job)
+{
+ return QGpgME::g_context_map.value (job, nullptr);
+}
+
#define make_job_subclass_ext(x,y) \
QGpgME::x::x( QObject * parent ) : y( parent ) {} \
QGpgME::x::~x() {}
diff --git a/lang/qt/src/job.h b/lang/qt/src/job.h
index 5767729..a0c0285 100644
--- a/lang/qt/src/job.h
+++ b/lang/qt/src/job.h
@@ -38,6 +38,7 @@
#include <QObject>
#include <QString>
+#include <QMap>
#ifdef BUILDING_QGPGME
# include "error.h"
@@ -79,6 +80,20 @@ public:
virtual GpgME::Error auditLogError() const;
bool isAuditLogSupported() const;
+ /** Get the underlying context to set some additional options for a job.
+ *
+ * This is intended to provide more flexibility on configuring jobs before
+ * they are started.
+ * The context is still owned by the thread, do not delete it.
+ *
+ * This is a static method that takes the job as argument.
+ *
+ * This function may not be called for running jobs.
+ *
+ * @returns the context used by the job job or null.
+ */
+ static GpgME::Context *context(Job *job);
+
public Q_SLOTS:
virtual void slotCancel() = 0;
@@ -87,6 +102,7 @@ Q_SIGNALS:
void done();
};
+extern QMap <Job *, GpgME::Context *> g_context_map;
}
#endif // __KLEO_JOB_H__
diff --git a/lang/qt/src/qgpgme_export.h b/lang/qt/src/qgpgme_export.h
index ceb3888..48296f7 100644
--- a/lang/qt/src/qgpgme_export.h
+++ b/lang/qt/src/qgpgme_export.h
@@ -1,22 +1,32 @@
-/*qgpgme_export.h - Export macros for qgpgme
- Copyright (C) 2016, Intevation GmbH
+/* qgpgme_export.h - Export macros for qgpgme
- This file is part of GPGME++.
+ This file is part of qgpgme, the Qt API binding for gpgme
+ Copyright (c) 2016 Intevation GmbH
- GPGME++ is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+ QGpgME is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 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 Library General Public License for more details.
+ QGpgME is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
- You should have received a copy of the GNU Library General Public License
- along with GPGME++; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
*/
#ifndef QGPGME_EXPORT_H
diff --git a/lang/qt/src/qgpgme_version.h.in b/lang/qt/src/qgpgme_version.h.in
index 9fbe965..1bc5694 100644
--- a/lang/qt/src/qgpgme_version.h.in
+++ b/lang/qt/src/qgpgme_version.h.in
@@ -1,32 +1,42 @@
-/*qgpgme_version.h - Version macros for qgpgme
- Copyright (C) 2016, Intevation 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 Library General Public
- License as published by the Free Software Foundation; either
- version 2 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 Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with GPGME++; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+/* qgpgme_version.h - Version macros for qgpgme
+
+ This file is part of qgpgme, the Qt API binding for gpgme
+ Copyright (c) 2016 Intevation GmbH
+
+ QGpgME is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ QGpgME is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
*/
#ifndef QGPGME_VERSION_H
#define QGPGME_VERSION_H
-#define QGPGME_VERSION_STRING "@LIBQGPGME_LT_CURRENT@.@LIBQGPGME_LT_AGE@.@LIBQGPGME_LT_REVISION@"
-#define QGPGME_VERSION_MAJOR @LIBQGPGME_LT_CURRENT@
-#define QGPGME_VERSION_MINOR @LIBQGPGME_LT_AGE@
-#define QGPGME_VERSION_PATCH @LIBQGPGME_LT_REVISION@
-#define QGPGME_VERSION ((@LIBQGPGME_LT_CURRENT@<<16)|(@LIBQGPGME_LT_AGE@<<8)|(@LIBQGPGME_LT_REVISION@))
+#define QGPGME_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
+#define QGPGME_VERSION_MAJOR @VERSION_MAJOR@
+#define QGPGME_VERSION_MINOR @VERSION_MINOR@
+#define QGPGME_VERSION_PATCH @VERSION_MICRO@
+#define QGPGME_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
#endif
diff --git a/lang/qt/src/threadedjobmixin.h b/lang/qt/src/threadedjobmixin.h
index d1b1043..32b23db 100644
--- a/lang/qt/src/threadedjobmixin.h
+++ b/lang/qt/src/threadedjobmixin.h
@@ -48,6 +48,7 @@
# include <gpgme++/interfaces/progressprovider.h>
#endif
+#include "job.h"
#include <cassert>
@@ -147,14 +148,20 @@ protected:
explicit ThreadedJobMixin(GpgME::Context *ctx)
: T_base(0), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError()
{
-
}
void lateInitialization()
{
assert(m_ctx);
- QObject::connect(&m_thread, SIGNAL(finished()), this, SLOT(slotFinished()));
+ QObject::connect(&m_thread, &QThread::finished, this,
+ &mixin_type::slotFinished);
m_ctx->setProgressProvider(this);
+ QGpgME::g_context_map.insert(this, m_ctx.get());
+ }
+
+ ~ThreadedJobMixin()
+ {
+ QGpgME::g_context_map.remove(this);
}
template <typename T_binder>
diff --git a/lang/qt/src/wkspublishjob.h b/lang/qt/src/wkspublishjob.h
index 0cec630..b17cba4 100644
--- a/lang/qt/src/wkspublishjob.h
+++ b/lang/qt/src/wkspublishjob.h
@@ -47,6 +47,15 @@ namespace QGpgME {
*
* Remember that after a result is emitted the job is auto deleted
* so you can only use it for a single action.
+ *
+ * The workflow is to call startCreate, check for errors and then
+ * send the RFC822 mail returned in returnedData.
+ *
+ * When the response is received start a startRecieve with the
+ * RFC822 mail received as paramater response. Check for errors
+ * and then send again send the result from returnedData back to
+ * the server.
+ *
*/
class QGPGME_EXPORT WKSPublishJob: public Job
{
@@ -69,16 +78,16 @@ public:
virtual void startCheck(const QString &mailbox) = 0;
/** Create a publish request.
- * The returned Data from the result will contain
- * the full Mail as returned by gpg-wks-client --create
+ * The returnedData from the result signal will contain
+ * the full Request as returned by gpg-wks-client --create
*
* @param fpr the fingerprint of the key to create the request for.
* @param mailbox A simple mail address without a Name.
*/
virtual void startCreate(const char *fpr, const QString &mailbox) = 0;
- /** Handle a submisson response. The returned Data will contain
- * the full Mail as returned by gpg-wks-client --create
+ /** Handle a submisson response. The returnedData in the result singnal
+ * will contain the confirmation response as returned by gpg-wks-client --receive
*
* @param response The response of the server.
**/
diff --git a/lang/qt/tests/Makefile.in b/lang/qt/tests/Makefile.in
index 5149a08..e0ac22e 100644
--- a/lang/qt/tests/Makefile.in
+++ b/lang/qt/tests/Makefile.in
@@ -413,6 +413,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp
index 2c87e4a..f89e1c2 100644
--- a/lang/qt/tests/t-tofuinfo.cpp
+++ b/lang/qt/tests/t-tofuinfo.cpp
@@ -152,6 +152,10 @@ private Q_SLOTS:
const QByteArray data1(testMsg1);
QByteArray plaintext;
+ auto ctx = Job::context(job);
+ Q_ASSERT(ctx);
+ ctx->setSender("alfa@example.net");
+
auto result = job->exec(data1, plaintext);
delete job;
diff --git a/m4/glib-2.0.m4 b/m4/glib-2.0.m4
index d6413ff..a22e6e6 100644
--- a/m4/glib-2.0.m4
+++ b/m4/glib-2.0.m4
@@ -2,11 +2,11 @@
# Owen Taylor 1997-2001
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
dnl gthread is specified in MODULES, pass to pkg-config
dnl
AC_DEFUN([AM_PATH_GLIB_2_0],
-[dnl
+[dnl
dnl Get the cflags and libraries from pkg-config
dnl
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
@@ -16,16 +16,16 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
for module in . $4
do
case "$module" in
- gmodule)
+ gmodule)
pkg_config_args="$pkg_config_args gmodule-2.0"
;;
- gmodule-no-export)
+ gmodule-no-export)
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
;;
- gobject)
+ gobject)
pkg_config_args="$pkg_config_args gobject-2.0"
;;
- gthread)
+ gthread)
pkg_config_args="$pkg_config_args gthread-2.0"
;;
esac
@@ -92,7 +92,7 @@ dnl
#include <stdio.h>
#include <stdlib.h>
-int
+int
main ()
{
int major, minor, micro;
@@ -111,7 +111,7 @@ main ()
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
- printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+ printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
@@ -121,7 +121,7 @@ main ()
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
- }
+ }
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
@@ -165,12 +165,12 @@ main ()
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
- ifelse([$2], , :, [$2])
+ ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$PKG_CONFIG" = "no" ; then
echo "*** A new enough version of pkg-config was not found."
- echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+ echo "*** See https://www.freedesktop.org/software/pkgconfig/"
else
if test -f conf.glibtest ; then
:
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ff871a0..0d340c7 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -34,7 +34,7 @@ m4_define([_LT_COPYING], [dnl
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# can be downloaded from https://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index c29b6c0..5865daf 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -1,5 +1,5 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
+#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@ if test -n "$PKG_CONFIG"; then
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
-
+
fi[]dnl
])# PKG_PROG_PKG_CONFIG
@@ -120,7 +120,7 @@ if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
fi
# Put the nasty error message in config.log where it belongs
@@ -146,7 +146,7 @@ path to pkg-config.
_PKG_TEXT
-To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+To get pkg-config, see <https://www.freedesktop.org/software/pkgconfig>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
diff --git a/src/Makefile.am b/src/Makefile.am
index f166f3b..ce6f1d4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,7 +14,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
## Process this file with automake to produce Makefile.in
@@ -28,20 +28,13 @@ nodist_include_HEADERS = gpgme.h
bin_PROGRAMS = gpgme-tool
-if HAVE_PTHREAD
-ltlib_gpgme_pthread = libgpgme-pthread.la
-else
-ltlib_gpgme_pthread =
-endif
-
if BUILD_W32_GLIB
ltlib_gpgme_glib = libgpgme-glib.la
else
ltlib_gpgme_glib =
endif
-lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
- $(ltlib_gpgme_pthread)
+lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib)
if HAVE_LD_VERSION_SCRIPT
libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
@@ -50,10 +43,10 @@ libgpgme_version_script_cmd =
endif
if HAVE_DOSISH_SYSTEM
-system_components = w32-util.c w32-sema.c
+system_components = w32-util.c
system_components_not_extra = w32-io.c
else
-system_components = ath.h posix-util.c posix-sema.c posix-io.c
+system_components = ath.h posix-util.c posix-io.c
system_components_not_extra =
endif
@@ -91,17 +84,15 @@ main_sources = \
$(uiserver_components) \
engine-g13.c vfs-mount.c vfs-create.c \
engine-spawn.c \
- gpgconf.c \
+ gpgconf.c queryswdb.c \
sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \
- debug.c debug.h gpgme.c version.c error.c
+ debug.c debug.h gpgme.c version.c error.c \
+ ath.h ath.c
-libgpgme_la_SOURCES = $(main_sources) \
- ath.h ath.c $(system_components_not_extra)
-libgpgme_pthread_la_SOURCES = $(main_sources) \
- ath.h ath-pthread.c $(system_components_not_extra)
+libgpgme_la_SOURCES = $(main_sources) $(system_components_not_extra)
if BUILD_W32_GLIB
-libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
+libgpgme_glib_la_SOURCES = $(main_sources) w32-glib-io.c
endif
# We use a global CFLAGS setting for all library
@@ -163,14 +154,6 @@ libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
@GPG_ERROR_LIBS@
-libgpgme_pthread_la_LDFLAGS = \
- $(no_undefined) $(export_symbols) $(extra_ltoptions) \
- $(libgpgme_version_script_cmd) -version-info \
- @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
-libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
-libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
- -lpthread @GPG_ERROR_LIBS@
-
if BUILD_W32_GLIB
libgpgme_glib_la_LDFLAGS = \
$(no_undefined) $(export_symbols) $(extra_ltoptions) \
diff --git a/src/Makefile.in b/src/Makefile.in
index d70de3b..3f0da74 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -30,7 +30,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
@@ -107,8 +107,8 @@ subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/mkinstalldirs \
$(srcdir)/versioninfo.rc.in $(srcdir)/gpgme.h.in \
- $(srcdir)/gpgme-config.in vasprintf.c funopen.c stpcpy.c \
- setenv.c ttyname_r.c $(top_srcdir)/build-aux/depcomp
+ $(srcdir)/gpgme-config.in stpcpy.c funopen.c ttyname_r.c \
+ vasprintf.c setenv.c $(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -172,16 +172,15 @@ am__libgpgme_glib_la_SOURCES_DIST = util.h conversion.c b64dec.c \
engine-backend.h engine.c engine-gpg.c status-table.c \
engine-gpgsm.c engine-assuan.c engine-gpgconf.c \
engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
- engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \
- posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \
- w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \
- version.c error.c ath.c w32-glib-io.c
+ engine-spawn.c gpgconf.c queryswdb.c sema.h priv-io.h ath.h \
+ posix-util.c posix-io.c w32-ce.h w32-ce.c w32-util.c \
+ sys-util.h dirinfo.c debug.c debug.h gpgme.c version.c error.c \
+ ath.c w32-glib-io.c
@HAVE_UISERVER_TRUE@am__objects_1 = engine-uiserver.lo
@HAVE_W32CE_SYSTEM_TRUE@am__objects_2 = w32-ce.lo
-@HAVE_DOSISH_SYSTEM_FALSE@am__objects_3 = posix-util.lo posix-sema.lo \
-@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo $(am__objects_2)
-@HAVE_DOSISH_SYSTEM_TRUE@am__objects_3 = w32-util.lo w32-sema.lo \
-@HAVE_DOSISH_SYSTEM_TRUE@ $(am__objects_2)
+@HAVE_DOSISH_SYSTEM_FALSE@am__objects_3 = posix-util.lo posix-io.lo \
+@HAVE_DOSISH_SYSTEM_FALSE@ $(am__objects_2)
+@HAVE_DOSISH_SYSTEM_TRUE@am__objects_3 = w32-util.lo $(am__objects_2)
am__objects_4 = conversion.lo b64dec.lo get-env.lo parsetlv.lo \
mbox-util.lo data.lo data-fd.lo data-stream.lo data-mem.lo \
data-user.lo data-compat.lo data-identify.lo signers.lo \
@@ -194,10 +193,11 @@ am__objects_4 = conversion.lo b64dec.lo get-env.lo parsetlv.lo \
spawn.lo assuan-support.lo engine.lo engine-gpg.lo \
status-table.lo engine-gpgsm.lo engine-assuan.lo \
engine-gpgconf.lo $(am__objects_1) engine-g13.lo vfs-mount.lo \
- vfs-create.lo engine-spawn.lo gpgconf.lo $(am__objects_3) \
- dirinfo.lo debug.lo gpgme.lo version.lo error.lo
+ vfs-create.lo engine-spawn.lo gpgconf.lo queryswdb.lo \
+ $(am__objects_3) dirinfo.lo debug.lo gpgme.lo version.lo \
+ error.lo ath.lo
@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_4) \
-@BUILD_W32_GLIB_TRUE@ ath.lo w32-glib-io.lo
+@BUILD_W32_GLIB_TRUE@ w32-glib-io.lo
libgpgme_glib_la_OBJECTS = $(am_libgpgme_glib_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -208,32 +208,6 @@ libgpgme_glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_CFLAGS) $(CFLAGS) $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) \
-o $@
@BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_rpath = -rpath $(libdir)
-am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c b64dec.c \
- get-env.c context.h ops.h parsetlv.c parsetlv.h mbox-util.c \
- mbox-util.h data.h data.c data-fd.c data-stream.c data-mem.c \
- data-user.c data-compat.c data-identify.c signers.c \
- sig-notation.c wait.c wait-global.c wait-private.c wait-user.c \
- wait.h op-support.c encrypt.c encrypt-sign.c decrypt.c \
- decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \
- keylist.c keysign.c trust-item.c trustlist.c tofupolicy.c \
- import.c export.c genkey.c delete.c edit.c getauditlog.c \
- opassuan.c passwd.c spawn.c assuan-support.c engine.h \
- engine-backend.h engine.c engine-gpg.c status-table.c \
- engine-gpgsm.c engine-assuan.c engine-gpgconf.c \
- engine-uiserver.c engine-g13.c vfs-mount.c vfs-create.c \
- engine-spawn.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \
- posix-sema.c posix-io.c w32-ce.h w32-ce.c w32-util.c \
- w32-sema.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \
- version.c error.c ath-pthread.c w32-io.c
-@HAVE_DOSISH_SYSTEM_TRUE@am__objects_5 = w32-io.lo
-am_libgpgme_pthread_la_OBJECTS = $(am__objects_4) ath-pthread.lo \
- $(am__objects_5)
-libgpgme_pthread_la_OBJECTS = $(am_libgpgme_pthread_la_OBJECTS)
-libgpgme_pthread_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(libgpgme_pthread_la_LDFLAGS) \
- $(LDFLAGS) -o $@
-@HAVE_PTHREAD_TRUE@am_libgpgme_pthread_la_rpath = -rpath $(libdir)
am__libgpgme_la_SOURCES_DIST = util.h conversion.c b64dec.c get-env.c \
context.h ops.h parsetlv.c parsetlv.h mbox-util.c mbox-util.h \
data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \
@@ -246,11 +220,12 @@ am__libgpgme_la_SOURCES_DIST = util.h conversion.c b64dec.c get-env.c \
spawn.c assuan-support.c engine.h engine-backend.h engine.c \
engine-gpg.c status-table.c engine-gpgsm.c engine-assuan.c \
engine-gpgconf.c engine-uiserver.c engine-g13.c vfs-mount.c \
- vfs-create.c engine-spawn.c gpgconf.c sema.h priv-io.h ath.h \
- posix-util.c posix-sema.c posix-io.c w32-ce.h w32-ce.c \
- w32-util.c w32-sema.c sys-util.h dirinfo.c debug.c debug.h \
- gpgme.c version.c error.c ath.c w32-io.c
-am_libgpgme_la_OBJECTS = $(am__objects_4) ath.lo $(am__objects_5)
+ vfs-create.c engine-spawn.c gpgconf.c queryswdb.c sema.h \
+ priv-io.h ath.h posix-util.c posix-io.c w32-ce.h w32-ce.c \
+ w32-util.c sys-util.h dirinfo.c debug.c debug.h gpgme.c \
+ version.c error.c ath.c w32-io.c
+@HAVE_DOSISH_SYSTEM_TRUE@am__objects_5 = w32-io.lo
+am_libgpgme_la_OBJECTS = $(am__objects_4) $(am__objects_5)
libgpgme_la_OBJECTS = $(am_libgpgme_la_OBJECTS)
libgpgme_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -297,10 +272,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(libgpgme_glib_la_SOURCES) $(libgpgme_pthread_la_SOURCES) \
- $(libgpgme_la_SOURCES) $(gpgme_tool_SOURCES) gpgme-w32spawn.c
+SOURCES = $(libgpgme_glib_la_SOURCES) $(libgpgme_la_SOURCES) \
+ $(gpgme_tool_SOURCES) gpgme-w32spawn.c
DIST_SOURCES = $(am__libgpgme_glib_la_SOURCES_DIST) \
- $(am__libgpgme_pthread_la_SOURCES_DIST) \
$(am__libgpgme_la_SOURCES_DIST) $(gpgme_tool_SOURCES) \
gpgme-w32spawn.c
am__can_run_installinfo = \
@@ -461,6 +435,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -529,19 +506,14 @@ bin_SCRIPTS = gpgme-config
m4datadir = $(datadir)/aclocal
m4data_DATA = gpgme.m4
nodist_include_HEADERS = gpgme.h
-@HAVE_PTHREAD_FALSE@ltlib_gpgme_pthread =
-@HAVE_PTHREAD_TRUE@ltlib_gpgme_pthread = libgpgme-pthread.la
@BUILD_W32_GLIB_FALSE@ltlib_gpgme_glib =
@BUILD_W32_GLIB_TRUE@ltlib_gpgme_glib = libgpgme-glib.la
-lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
- $(ltlib_gpgme_pthread)
-
+lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib)
@HAVE_LD_VERSION_SCRIPT_FALSE@libgpgme_version_script_cmd =
@HAVE_LD_VERSION_SCRIPT_TRUE@libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
@HAVE_DOSISH_SYSTEM_FALSE@system_components = ath.h posix-util.c \
-@HAVE_DOSISH_SYSTEM_FALSE@ posix-sema.c posix-io.c \
-@HAVE_DOSISH_SYSTEM_FALSE@ $(am__append_1)
-@HAVE_DOSISH_SYSTEM_TRUE@system_components = w32-util.c w32-sema.c \
+@HAVE_DOSISH_SYSTEM_FALSE@ posix-io.c $(am__append_1)
+@HAVE_DOSISH_SYSTEM_TRUE@system_components = w32-util.c \
@HAVE_DOSISH_SYSTEM_TRUE@ $(am__append_1)
@HAVE_DOSISH_SYSTEM_FALSE@system_components_not_extra =
@HAVE_DOSISH_SYSTEM_TRUE@system_components_not_extra = w32-io.c
@@ -572,17 +544,13 @@ main_sources = \
$(uiserver_components) \
engine-g13.c vfs-mount.c vfs-create.c \
engine-spawn.c \
- gpgconf.c \
+ gpgconf.c queryswdb.c \
sema.h priv-io.h $(system_components) sys-util.h dirinfo.c \
- debug.c debug.h gpgme.c version.c error.c
-
-libgpgme_la_SOURCES = $(main_sources) \
- ath.h ath.c $(system_components_not_extra)
-
-libgpgme_pthread_la_SOURCES = $(main_sources) \
- ath.h ath-pthread.c $(system_components_not_extra)
+ debug.c debug.h gpgme.c version.c error.c \
+ ath.h ath.c
-@BUILD_W32_GLIB_TRUE@libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
+libgpgme_la_SOURCES = $(main_sources) $(system_components_not_extra)
+@BUILD_W32_GLIB_TRUE@libgpgme_glib_la_SOURCES = $(main_sources) w32-glib-io.c
# We use a global CFLAGS setting for all library
# versions, because then every object file is only compiled once.
@@ -610,15 +578,6 @@ libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
@GPG_ERROR_LIBS@
-libgpgme_pthread_la_LDFLAGS = \
- $(no_undefined) $(export_symbols) $(extra_ltoptions) \
- $(libgpgme_version_script_cmd) -version-info \
- @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
-
-libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
-libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
- -lpthread @GPG_ERROR_LIBS@
-
@BUILD_W32_GLIB_TRUE@libgpgme_glib_la_LDFLAGS = \
@BUILD_W32_GLIB_TRUE@ $(no_undefined) $(export_symbols) $(extra_ltoptions) \
@BUILD_W32_GLIB_TRUE@ $(libgpgme_version_script_cmd) -version-info \
@@ -709,9 +668,6 @@ clean-libLTLIBRARIES:
libgpgme-glib.la: $(libgpgme_glib_la_OBJECTS) $(libgpgme_glib_la_DEPENDENCIES) $(EXTRA_libgpgme_glib_la_DEPENDENCIES)
$(AM_V_CCLD)$(libgpgme_glib_la_LINK) $(am_libgpgme_glib_la_rpath) $(libgpgme_glib_la_OBJECTS) $(libgpgme_glib_la_LIBADD) $(LIBS)
-libgpgme-pthread.la: $(libgpgme_pthread_la_OBJECTS) $(libgpgme_pthread_la_DEPENDENCIES) $(EXTRA_libgpgme_pthread_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libgpgme_pthread_la_LINK) $(am_libgpgme_pthread_la_rpath) $(libgpgme_pthread_la_OBJECTS) $(libgpgme_pthread_la_LIBADD) $(LIBS)
-
libgpgme.la: $(libgpgme_la_OBJECTS) $(libgpgme_la_DEPENDENCIES) $(EXTRA_libgpgme_la_DEPENDENCIES)
$(AM_V_CCLD)$(libgpgme_la_LINK) -rpath $(libdir) $(libgpgme_la_OBJECTS) $(libgpgme_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@@ -869,7 +825,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vasprintf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argparse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assuan-support.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ath-pthread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ath.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b64dec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversion.Plo@am__quote@
@@ -916,9 +871,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passphrase.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-io.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-sema.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progress.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queryswdb.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-notation.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signers.Plo@am__quote@
@@ -934,7 +889,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w32-ce.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w32-glib-io.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w32-io.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w32-sema.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w32-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-global.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-private.Plo@am__quote@
diff --git a/src/argparse.c b/src/argparse.c
index 003334f..758173f 100644
--- a/src/argparse.c
+++ b/src/argparse.c
@@ -26,7 +26,7 @@
*
* You should have received a copies of the GNU General Public License
* and the GNU Lesser General Public License along with this program;
- * if not, see <http://www.gnu.org/licenses/>.
+ * if not, see <https://www.gnu.org/licenses/>.
*/
/* This file may be used as part of GnuPG or standalone. A GnuPG
@@ -1518,7 +1518,7 @@ ARGPARSE_STR2(ARGPARSE_GPL_VERSION)
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"GNU General Public License for more details.\n\n"
"You should have received a copy of the GNU General Public License\n"
-"along with this software. If not, see <http://www.gnu.org/licenses/>.\n";
+"along with this software. If not, see <https://www.gnu.org/licenses/>.\n";
break;
case 40: /* short and long usage */
case 41: p = ""; break;
diff --git a/src/argparse.h b/src/argparse.h
index 10b838f..81e881d 100644
--- a/src/argparse.h
+++ b/src/argparse.h
@@ -25,7 +25,7 @@
*
* You should have received a copies of the GNU General Public License
* and the GNU Lesser General Public License along with this program;
- * if not, see <http://www.gnu.org/licenses/>.
+ * if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_COMMON_ARGPARSE_H
diff --git a/src/ath-pthread.c b/src/ath-pthread.c
deleted file mode 100644
index 47b38ee..0000000
--- a/src/ath-pthread.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* ath-pthread.c - pthread module for self-adapting thread-safeness library
- Copyright (C) 2002, 2003, 2004 g10 Code GmbH
-
- This file is part of GPGME.
-
- GPGME is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- GPGME is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# endif
-#endif
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <pthread.h>
-
-#include "gpgme.h"
-
-#include "ath.h"
-
-
-/* The lock we take while checking for lazy lock initialization. */
-static pthread_mutex_t check_init_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* Initialize the mutex *PRIV. If JUST_CHECK is true, only do this if
- it is not already initialized. */
-static int
-mutex_pthread_init (ath_mutex_t *priv, int just_check)
-{
- int err = 0;
-
- if (just_check)
- pthread_mutex_lock (&check_init_lock);
- if (!*priv || !just_check)
- {
- pthread_mutex_t *lock = malloc (sizeof (pthread_mutex_t));
- if (!lock)
- err = ENOMEM;
- if (!err)
- {
- err = pthread_mutex_init (lock, NULL);
- if (err)
- free (lock);
- else
- *priv = (ath_mutex_t) lock;
- }
- }
- if (just_check)
- pthread_mutex_unlock (&check_init_lock);
- return err;
-}
-
-
-void
-ath_init (void)
-{
- /* Nothing to do. */
-}
-
-
-uintptr_t
-ath_self (void)
-{
- return (uintptr_t) pthread_self ();
-}
-
-
-int
-ath_mutex_init (ath_mutex_t *lock)
-{
- return mutex_pthread_init (lock, 0);
-}
-
-
-int
-ath_mutex_destroy (ath_mutex_t *lock)
-{
- int err = mutex_pthread_init (lock, 1);
- if (!err)
- {
- err = pthread_mutex_destroy ((pthread_mutex_t *) *lock);
- free (*lock);
- }
- return err;
-}
-
-
-int
-ath_mutex_lock (ath_mutex_t *lock)
-{
- int ret = mutex_pthread_init (lock, 1);
- if (ret)
- return ret;
-
- return pthread_mutex_lock ((pthread_mutex_t *) *lock);
-}
-
-
-int
-ath_mutex_unlock (ath_mutex_t *lock)
-{
- int ret = mutex_pthread_init (lock, 1);
- if (ret)
- return ret;
-
- return pthread_mutex_unlock ((pthread_mutex_t *) *lock);
-}
-
-
-gpgme_ssize_t
-ath_read (int fd, void *buf, size_t nbytes)
-{
- return read (fd, buf, nbytes);
-}
-
-
-gpgme_ssize_t
-ath_write (int fd, const void *buf, size_t nbytes)
-{
- return write (fd, buf, nbytes);
-}
-
-
-gpgme_ssize_t
-ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
- struct timeval *timeout)
-{
- return select (nfd, rset, wset, eset, timeout);
-}
-
-
-gpgme_ssize_t
-ath_waitpid (pid_t pid, int *status, int options)
-{
- return waitpid (pid, status, options);
-}
-
-
-int
-ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr)
-{
- return accept (s, addr, length_ptr);
-}
-
-
-int
-ath_connect (int s, const struct sockaddr *addr, socklen_t length)
-{
- return connect (s, addr, length);
-}
-
-int
-ath_sendmsg (int s, const struct msghdr *msg, int flags)
-{
- return sendmsg (s, msg, flags);
-}
-
-
-int
-ath_recvmsg (int s, struct msghdr *msg, int flags)
-{
- return recvmsg (s, msg, flags);
-}
diff --git a/src/ath.c b/src/ath.c
index ddd8a87..6b4667e 100644
--- a/src/ath.c
+++ b/src/ath.c
@@ -49,11 +49,6 @@
#include "ath.h"
-#define MUTEX_UNLOCKED ((ath_mutex_t) 0)
-#define MUTEX_LOCKED ((ath_mutex_t) 1)
-#define MUTEX_DESTROYED ((ath_mutex_t) 2)
-
-
#ifdef HAVE_W32_SYSTEM
#include <windows.h>
uintptr_t
@@ -80,52 +75,6 @@ ath_self (void)
#endif
-int
-ath_mutex_init (ath_mutex_t *lock)
-{
-#ifndef NDEBUG
- *lock = MUTEX_UNLOCKED;
-#endif
- return 0;
-}
-
-
-int
-ath_mutex_destroy (ath_mutex_t *lock)
-{
-#ifndef NDEBUG
- assert (*lock == MUTEX_UNLOCKED);
-
- *lock = MUTEX_DESTROYED;
-#endif
- return 0;
-}
-
-
-int
-ath_mutex_lock (ath_mutex_t *lock)
-{
-#ifndef NDEBUG
- assert (*lock == MUTEX_UNLOCKED);
-
- *lock = MUTEX_LOCKED;
-#endif
- return 0;
-}
-
-
-int
-ath_mutex_unlock (ath_mutex_t *lock)
-{
-#ifndef NDEBUG
- assert (*lock == MUTEX_LOCKED);
-
- *lock = MUTEX_UNLOCKED;
-#endif
- return 0;
-}
-
-
gpgme_ssize_t
ath_read (int fd, void *buf, size_t nbytes)
{
diff --git a/src/ath.h b/src/ath.h
index 8eb9eb9..a1be9e5 100644
--- a/src/ath.h
+++ b/src/ath.h
@@ -60,10 +60,6 @@
#define _ATH_PREFIX1(x,y) x ## y
#define _ATH_PREFIX2(x,y) _ATH_PREFIX1(x,y)
#define _ATH_PREFIX(x) _ATH_PREFIX2(_ATH_EXT_SYM_PREFIX,x)
-#define ath_mutex_init _ATH_PREFIX(ath_mutex_init)
-#define ath_mutex_destroy _ATH_PREFIX(ath_mutex_destroy)
-#define ath_mutex_lock _ATH_PREFIX(ath_mutex_lock)
-#define ath_mutex_unlock _ATH_PREFIX(ath_mutex_unlock)
#define ath_read _ATH_PREFIX(ath_read)
#define ath_write _ATH_PREFIX(ath_write)
#define ath_select _ATH_PREFIX(ath_select)
@@ -75,17 +71,8 @@
#endif
-typedef void *ath_mutex_t;
-#define ATH_MUTEX_INITIALIZER 0;
-
uintptr_t ath_self (void);
-/* Functions for mutual exclusion. */
-int ath_mutex_init (ath_mutex_t *mutex);
-int ath_mutex_destroy (ath_mutex_t *mutex);
-int ath_mutex_lock (ath_mutex_t *mutex);
-int ath_mutex_unlock (ath_mutex_t *mutex);
-
/* Replacement for the POSIX functions, which can be used to allow
other (user-level) threads to run. */
gpgme_ssize_t ath_read (int fd, void *buf, size_t nbytes);
diff --git a/src/b64dec.c b/src/b64dec.c
index 9a7efca..c824786 100644
--- a/src/b64dec.c
+++ b/src/b64dec.c
@@ -15,7 +15,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
diff --git a/src/context.h b/src/context.h
index 4b12c3b..1a8698c 100644
--- a/src/context.h
+++ b/src/context.h
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef CONTEXT_H
@@ -38,7 +38,8 @@ typedef enum
OPDATA_DECRYPT, OPDATA_SIGN, OPDATA_ENCRYPT, OPDATA_PASSPHRASE,
OPDATA_IMPORT, OPDATA_GENKEY, OPDATA_KEYLIST, OPDATA_EDIT,
OPDATA_VERIFY, OPDATA_TRUSTLIST, OPDATA_ASSUAN, OPDATA_VFS_MOUNT,
- OPDATA_PASSWD, OPDATA_EXPORT, OPDATA_KEYSIGN, OPDATA_TOFU_POLICY
+ OPDATA_PASSWD, OPDATA_EXPORT, OPDATA_KEYSIGN, OPDATA_TOFU_POLICY,
+ OPDATA_QUERY_SWDB
} ctx_op_data_id_t;
@@ -110,6 +111,9 @@ struct gpgme_context
* unmodified string, as received form gpg, will be returned. */
unsigned int raw_description : 1;
+ /* True if session keys should be exported upon decryption. */
+ unsigned int export_session_keys : 1;
+
/* Flags for keylist mode. */
gpgme_keylist_mode_t keylist_mode;
@@ -119,16 +123,21 @@ struct gpgme_context
/* Number of certs to be included. */
unsigned int include_certs;
- /* The number of keys in signers. */
+ /* The actual number of keys in SIGNERS, the allocated size of the
+ * array, and the array with the signing keys. */
unsigned int signers_len;
-
- /* Size of the following array. */
unsigned int signers_size;
gpgme_key_t *signers;
/* The signature notations for this context. */
gpgme_sig_notation_t sig_notations;
+ /* The sender's addr-spec or NULL. */
+ char *sender;
+
+ /* The gpg specific override session key or NULL. */
+ char *override_session_key;
+
/* The locale for the pinentry. */
char *lc_ctype;
char *lc_messages;
diff --git a/src/data-identify.c b/src/data-identify.c
index 615a4f3..857d06c 100644
--- a/src/data-identify.c
+++ b/src/data-identify.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/decrypt-verify.c b/src/decrypt-verify.c
index a334f86..e0aa8ea 100644
--- a/src/decrypt-verify.c
+++ b/src/decrypt-verify.c
@@ -77,7 +77,9 @@ decrypt_verify_start (gpgme_ctx_t ctx, int synchronous,
_gpgme_engine_set_status_handler (ctx->engine,
decrypt_verify_status_handler, ctx);
- return _gpgme_engine_op_decrypt_verify (ctx->engine, cipher, plain);
+ return _gpgme_engine_op_decrypt_verify (ctx->engine, cipher, plain,
+ ctx->export_session_keys,
+ ctx->override_session_key);
}
diff --git a/src/decrypt.c b/src/decrypt.c
index 51e4292..43717c0 100644
--- a/src/decrypt.c
+++ b/src/decrypt.c
@@ -63,6 +63,9 @@ release_op_data (void *hook)
if (opd->result.file_name)
free (opd->result.file_name);
+ if (opd->result.session_key)
+ free (opd->result.session_key);
+
while (recipient)
{
gpgme_recipient_t next = recipient->next;
@@ -277,6 +280,12 @@ _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code,
opd->last_recipient_p = &(*opd->last_recipient_p)->next;
break;
+ case GPGME_STATUS_SESSION_KEY:
+ if (opd->result.session_key)
+ free (opd->result.session_key);
+ opd->result.session_key = strdup(args);
+ break;
+
case GPGME_STATUS_NO_SECKEY:
{
gpgme_recipient_t rec = opd->result.recipients;
@@ -351,7 +360,7 @@ _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx)
static gpgme_error_t
decrypt_start (gpgme_ctx_t ctx, int synchronous,
- gpgme_data_t cipher, gpgme_data_t plain)
+ gpgme_data_t cipher, gpgme_data_t plain)
{
gpgme_error_t err;
@@ -381,7 +390,9 @@ decrypt_start (gpgme_ctx_t ctx, int synchronous,
_gpgme_engine_set_status_handler (ctx->engine, decrypt_status_handler, ctx);
- return _gpgme_engine_op_decrypt (ctx->engine, cipher, plain);
+ return _gpgme_engine_op_decrypt (ctx->engine, cipher, plain,
+ ctx->export_session_keys,
+ ctx->override_session_key);
}
diff --git a/src/dirinfo.c b/src/dirinfo.c
index b24a8a0..a0cbc03 100644
--- a/src/dirinfo.c
+++ b/src/dirinfo.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/engine-assuan.c b/src/engine-assuan.c
index 65924eb..3e3b89f 100644
--- a/src/engine-assuan.c
+++ b/src/engine-assuan.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/*
@@ -796,6 +796,7 @@ struct engine_ops _gpgme_engine_ops_assuan =
llass_transact, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
llass_set_io_cbs,
llass_io_event,
llass_cancel,
diff --git a/src/engine-backend.h b/src/engine-backend.h
index ccab0e3..a8457af 100644
--- a/src/engine-backend.h
+++ b/src/engine-backend.h
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ENGINE_BACKEND_H
@@ -62,9 +62,11 @@ struct engine_ops
gpgme_error_t (*set_locale) (void *engine, int category, const char *value);
gpgme_error_t (*set_protocol) (void *engine, gpgme_protocol_t protocol);
gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
- gpgme_data_t plain);
+ gpgme_data_t plain, int export_session_key,
+ const char *override_session_key);
gpgme_error_t (*decrypt_verify) (void *engine, gpgme_data_t ciph,
- gpgme_data_t plain);
+ gpgme_data_t plain, int export_session_key,
+ const char *override_session_key);
gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
gpgme_error_t (*edit) (void *engine, int type, gpgme_key_t key,
gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
@@ -111,7 +113,8 @@ struct engine_ops
gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t (*trustlist) (void *engine, const char *pattern);
gpgme_error_t (*verify) (void *engine, gpgme_data_t sig,
- gpgme_data_t signed_text, gpgme_data_t plaintext);
+ gpgme_data_t signed_text, gpgme_data_t plaintext,
+ gpgme_ctx_t ctx);
gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output,
unsigned int flags);
gpgme_error_t (*opassuan_transact) (void *engine,
@@ -126,6 +129,10 @@ struct engine_ops
gpgme_error_t (*conf_load) (void *engine, gpgme_conf_comp_t *conf_p);
gpgme_error_t (*conf_save) (void *engine, gpgme_conf_comp_t conf);
+ gpgme_error_t (*query_swdb) (void *engine,
+ const char *name, const char *iversion,
+ gpgme_query_swdb_result_t result);
+
void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs);
void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data);
diff --git a/src/engine-g13.c b/src/engine-g13.c
index d34db82..972c3a8 100644
--- a/src/engine-g13.c
+++ b/src/engine-g13.c
@@ -811,6 +811,7 @@ struct engine_ops _gpgme_engine_ops_g13 =
g13_transact,
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
g13_set_io_cbs,
g13_io_event,
g13_cancel,
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 4415c94..3ddaa07 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -16,7 +16,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
@@ -139,6 +139,9 @@ struct engine_gpg
struct gpgme_io_cbs io_cbs;
gpgme_pinentry_mode_t pinentry_mode;
+
+ /* NULL or the data object fed to --override_session_key-fd. */
+ gpgme_data_t override_session_key;
};
typedef struct engine_gpg *engine_gpg_t;
@@ -441,6 +444,8 @@ gpg_release (void *engine)
if (gpg->cmd.keyword)
free (gpg->cmd.keyword);
+ gpgme_data_release (gpg->override_session_key);
+
free (gpg);
}
@@ -1550,13 +1555,45 @@ add_input_size_hint (engine_gpg_t gpg, gpgme_data_t data)
static gpgme_error_t
-gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
+gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain,
+ int export_session_key, const char *override_session_key)
{
engine_gpg_t gpg = engine;
gpgme_error_t err;
err = add_arg (gpg, "--decrypt");
+ if (!err && export_session_key)
+ err = add_arg (gpg, "--show-session-key");
+
+ if (!err && override_session_key && *override_session_key)
+ {
+ if (have_gpg_version (gpg, "2.1.16"))
+ {
+ gpgme_data_release (gpg->override_session_key);
+ TRACE2 (DEBUG_ENGINE, "override", gpg, "seskey='%s' len=%zu\n",
+ override_session_key,
+ strlen (override_session_key));
+
+ err = gpgme_data_new_from_mem (&gpg->override_session_key,
+ override_session_key,
+ strlen (override_session_key), 1);
+ if (!err)
+ {
+ err = add_arg (gpg, "--override-session-key-fd");
+ if (!err)
+ err = add_data (gpg, gpg->override_session_key, -2, 0);
+ }
+ }
+ else
+ {
+ /* Using that option may leak the session key via ps(1). */
+ err = add_arg (gpg, "--override-session-key");
+ if (!err)
+ err = add_arg (gpg, override_session_key);
+ }
+ }
+
/* Tell the gpg object about the data. */
if (!err)
err = add_arg (gpg, "--output");
@@ -1646,6 +1683,23 @@ append_args_from_signers (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */)
static gpgme_error_t
+append_args_from_sender (engine_gpg_t gpg, gpgme_ctx_t ctx)
+{
+ gpgme_error_t err;
+
+ if (ctx->sender && have_gpg_version (gpg, "2.1.15"))
+ {
+ err = add_arg (gpg, "--sender");
+ if (!err)
+ err = add_arg (gpg, ctx->sender);
+ }
+ else
+ err = 0;
+ return err;
+}
+
+
+static gpgme_error_t
append_args_from_sig_notations (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */)
{
gpgme_error_t err = 0;
@@ -1893,6 +1947,9 @@ gpg_encrypt_sign (void *engine, gpgme_key_t recp[],
err = append_args_from_signers (gpg, ctx);
if (!err)
+ err = append_args_from_sender (gpg, ctx);
+
+ if (!err)
err = append_args_from_sig_notations (gpg, ctx);
/* Tell the gpg object about the data. */
@@ -2794,6 +2851,8 @@ gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
if (!err)
err = append_args_from_signers (gpg, ctx);
if (!err)
+ err = append_args_from_sender (gpg, ctx);
+ if (!err)
err = append_args_from_sig_notations (gpg, ctx);
if (gpgme_data_get_file_name (in))
@@ -2845,12 +2904,15 @@ gpg_trustlist (void *engine, const char *pattern)
static gpgme_error_t
gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
- gpgme_data_t plaintext)
+ gpgme_data_t plaintext, gpgme_ctx_t ctx)
{
engine_gpg_t gpg = engine;
- gpgme_error_t err = 0;
+ gpgme_error_t err;
- if (plaintext)
+ err = append_args_from_sender (gpg, ctx);
+ if (err)
+ ;
+ else if (plaintext)
{
/* Normal or cleartext signature. */
err = add_arg (gpg, "--output");
@@ -2944,6 +3006,7 @@ struct engine_ops _gpgme_engine_ops_gpg =
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
gpg_set_io_cbs,
gpg_io_event,
gpg_cancel,
diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index 90f32c7..2ea8673 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -16,7 +16,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
@@ -47,16 +47,26 @@
#include "engine-backend.h"
+
struct engine_gpgconf
{
char *file_name;
char *home_dir;
+ char *version;
};
typedef struct engine_gpgconf *engine_gpgconf_t;
+/* Return true if the engine's version is at least VERSION. */
+static int
+have_gpgconf_version (engine_gpgconf_t gpgconf, const char *version)
+{
+ return _gpgme_compare_versions (gpgconf->version, version);
+}
+
+
static char *
gpgconf_get_version (const char *file_name)
{
@@ -84,6 +94,8 @@ gpgconf_release (void *engine)
free (gpgconf->file_name);
if (gpgconf->home_dir)
free (gpgconf->home_dir);
+ if (gpgconf->version)
+ free (gpgconf->version);
free (gpgconf);
}
@@ -96,8 +108,6 @@ gpgconf_new (void **engine, const char *file_name, const char *home_dir,
gpgme_error_t err = 0;
engine_gpgconf_t gpgconf;
- (void)version; /* Not yet used. */
-
gpgconf = calloc (1, sizeof *gpgconf);
if (!gpgconf)
return gpg_error_from_syserror ();
@@ -114,6 +124,13 @@ gpgconf_new (void **engine, const char *file_name, const char *home_dir,
err = gpg_error_from_syserror ();
}
+ if (!err && version)
+ {
+ gpgconf->version = strdup (version);
+ if (!gpgconf->version)
+ err = gpg_error_from_syserror ();
+ }
+
if (err)
gpgconf_release (gpgconf);
else
@@ -209,7 +226,8 @@ gpgconf_read (void *engine, const char *arg1, char *arg2,
char *linebuf;
size_t linebufsize;
int linelen;
- char *argv[4] = { NULL /* file_name */, NULL, NULL, NULL };
+ char *argv[6];
+ int argc = 0;
int rp[2];
struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0},
{-1, -1} };
@@ -217,14 +235,19 @@ gpgconf_read (void *engine, const char *arg1, char *arg2,
int nread;
char *mark = NULL;
- argv[1] = (char*)arg1;
- argv[2] = arg2;
-
+ /* _gpgme_engine_new guarantees that this is not NULL. */
+ argv[argc++] = gpgconf->file_name;
- /* FIXME: Deal with engine->home_dir. */
+ if (gpgconf->home_dir && have_gpgconf_version (gpgconf, "2.1.13"))
+ {
+ argv[argc++] = (char*)"--homedir";
+ argv[argc++] = gpgconf->home_dir;
+ }
- /* _gpgme_engine_new guarantees that this is not NULL. */
- argv[0] = gpgconf->file_name;
+ argv[argc++] = (char*)arg1;
+ argv[argc++] = arg2;
+ argv[argc] = NULL;
+ assert (argc < DIM (argv));
if (_gpgme_io_pipe (rp, 1) < 0)
return gpg_error_from_syserror ();
@@ -685,16 +708,26 @@ gpgconf_write (void *engine, const char *arg1, char *arg2, gpgme_data_t conf)
#define BUFLEN 1024
char buf[BUFLEN];
int buflen = 0;
- char *argv[] = { NULL /* file_name */, (char*)arg1, arg2, 0 };
+ char *argv[6];
+ int argc = 0;
int rp[2];
struct spawn_fd_item_s cfd[] = { {-1, 0 /* STDIN_FILENO */}, {-1, -1} };
int status;
int nwrite;
- /* FIXME: Deal with engine->home_dir. */
-
/* _gpgme_engine_new guarantees that this is not NULL. */
- argv[0] = gpgconf->file_name;
+ argv[argc++] = gpgconf->file_name;
+
+ if (gpgconf->home_dir && have_gpgconf_version (gpgconf, "2.1.13"))
+ {
+ argv[argc++] = (char*)"--homedir";
+ argv[argc++] = gpgconf->home_dir;
+ }
+
+ argv[argc++] = (char*)arg1;
+ argv[argc++] = arg2;
+ argv[argc] = NULL;
+ assert (argc < DIM (argv));
if (_gpgme_io_pipe (rp, 0) < 0)
return gpg_error_from_syserror ();
@@ -909,6 +942,217 @@ gpgconf_conf_save (void *engine, gpgme_conf_comp_t comp)
}
+/* Parse a line received from gpgconf --query-swdb. This function may
+ * modify LINE. The result is stored at RESUL. */
+static gpg_error_t
+parse_swdb_line (char *line, gpgme_query_swdb_result_t result)
+{
+ char *field[9];
+ int fields = 0;
+ gpg_err_code_t ec;
+
+ while (line && fields < DIM (field))
+ {
+ field[fields++] = line;
+ line = strchr (line, ':');
+ if (line)
+ *line++ = 0;
+ }
+ /* We require that all fields exists - gpgme emits all these fields
+ * even on error. They might be empty, though. */
+ if (fields < 9)
+ return gpg_error (GPG_ERR_INV_ENGINE);
+
+ free (result->name);
+ result->name = strdup (field[0]);
+ if (!result->name)
+ return gpg_error_from_syserror ();
+
+ free (result->iversion);
+ result->iversion = strdup (field[1]);
+ if (!result->iversion)
+ return gpg_error_from_syserror ();
+
+ result->urgent = (strtol (field[3], NULL, 10) > 0);
+
+ ec = gpg_err_code (strtoul (field[4], NULL, 10));
+
+ result->created = _gpgme_parse_timestamp (field[5], NULL);
+ result->retrieved= _gpgme_parse_timestamp (field[6], NULL);
+
+ free (result->version);
+ result->version = strdup (field[7]);
+ if (!result->version)
+ return gpg_error_from_syserror ();
+
+ result->reldate = _gpgme_parse_timestamp (field[8], NULL);
+
+ /* Set other flags. */
+ result->warning = !!ec;
+ result->update = 0;
+ result->noinfo = 0;
+ result->unknown = 0;
+ result->tooold = 0;
+ result->error = 0;
+
+ switch (*field[2])
+ {
+ case '-': result->warning = 1; break;
+ case '?': result->unknown = result->warning = 1; break;
+ case 'u': result->update = 1; break;
+ case 'c': break;
+ case 'n': break;
+ default:
+ result->warning = 1;
+ if (!ec)
+ ec = GPG_ERR_INV_ENGINE;
+ break;
+ }
+
+ if (ec == GPG_ERR_TOO_OLD)
+ result->tooold = 1;
+ else if (ec == GPG_ERR_ENOENT)
+ result->noinfo = 1;
+ else if (ec)
+ result->error = 1;
+
+
+ return 0;
+}
+
+
+static gpgme_error_t
+gpgconf_query_swdb (void *engine,
+ const char *name, const char *iversion,
+ gpgme_query_swdb_result_t result)
+{
+ struct engine_gpgconf *gpgconf = engine;
+ gpgme_error_t err = 0;
+ char *linebuf;
+ size_t linebufsize;
+ int linelen;
+ char *argv[7];
+ int argc = 0;
+ int rp[2];
+ struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0},
+ {-1, -1} };
+ int status;
+ int nread;
+ char *mark = NULL;
+
+ if (!have_gpgconf_version (gpgconf, "2.1.16"))
+ return gpg_error (GPG_ERR_ENGINE_TOO_OLD);
+
+ /* _gpgme_engine_new guarantees that this is not NULL. */
+ argv[argc++] = gpgconf->file_name;
+
+ if (gpgconf->home_dir)
+ {
+ argv[argc++] = (char*)"--homedir";
+ argv[argc++] = gpgconf->home_dir;
+ }
+
+ argv[argc++] = (char*)"--query-swdb";
+ argv[argc++] = (char*)name;
+ argv[argc++] = (char*)iversion;
+ argv[argc] = NULL;
+ assert (argc < DIM (argv));
+
+ if (_gpgme_io_pipe (rp, 1) < 0)
+ return gpg_error_from_syserror ();
+
+ cfd[0].fd = rp[1];
+
+ status = _gpgme_io_spawn (gpgconf->file_name, argv,
+ IOSPAWN_FLAG_DETACHED, cfd, NULL, NULL, NULL);
+ if (status < 0)
+ {
+ _gpgme_io_close (rp[0]);
+ _gpgme_io_close (rp[1]);
+ return gpg_error_from_syserror ();
+ }
+
+ linebufsize = 2048; /* Same as used by gpgconf. */
+ linebuf = malloc (linebufsize);
+ if (!linebuf)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ linelen = 0;
+
+ while ((nread = _gpgme_io_read (rp[0], linebuf + linelen,
+ linebufsize - linelen - 1)))
+ {
+ char *line;
+ const char *lastmark = NULL;
+ size_t nused;
+
+ if (nread < 0)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+
+ linelen += nread;
+ linebuf[linelen] = '\0';
+
+ for (line=linebuf; (mark = strchr (line, '\n')); line = mark+1 )
+ {
+ lastmark = mark;
+ if (mark > line && mark[-1] == '\r')
+ mark[-1] = '\0';
+ else
+ mark[0] = '\0';
+
+ /* Got a full line. Due to the CR removal code (which
+ occurs only on Windows) we might be one-off and thus
+ would see empty lines. */
+ if (*line)
+ {
+ err = parse_swdb_line (line, result);
+ goto leave; /* Ready. */
+ }
+ else /* empty line. */
+ err = 0;
+ }
+
+ nused = lastmark? (lastmark + 1 - linebuf) : 0;
+ memmove (linebuf, linebuf + nused, linelen - nused);
+ linelen -= nused;
+
+ if (!(linelen < linebufsize - 1))
+ {
+ char *newlinebuf;
+
+ if (linelen < 8 * 1024 - 1)
+ linebufsize = 8 * 1024;
+ else if (linelen < 64 * 1024 - 1)
+ linebufsize = 64 * 1024;
+ else
+ {
+ /* We reached our limit - give up. */
+ err = gpg_error (GPG_ERR_LINE_TOO_LONG);
+ goto leave;
+ }
+
+ newlinebuf = realloc (linebuf, linebufsize);
+ if (!newlinebuf)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ linebuf = newlinebuf;
+ }
+ }
+
+ leave:
+ free (linebuf);
+ _gpgme_io_close (rp[0]);
+ return err;
+}
+
+
static void
gpgconf_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs)
{
@@ -966,6 +1210,7 @@ struct engine_ops _gpgme_engine_ops_gpgconf =
NULL, /* opassuan_transact */
gpgconf_conf_load,
gpgconf_conf_save,
+ gpgconf_query_swdb,
gpgconf_set_io_cbs,
NULL, /* io_event */
NULL, /* cancel */
diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c
index e7e2a20..d1be049 100644
--- a/src/engine-gpgsm.c
+++ b/src/engine-gpgsm.c
@@ -1120,11 +1120,17 @@ gpgsm_reset (void *engine)
static gpgme_error_t
-gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
+gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain,
+ int export_session_key, const char *override_session_key)
{
engine_gpgsm_t gpgsm = engine;
gpgme_error_t err;
+ /* gpgsm is not capable of exporting session keys right now, so we
+ * will ignore this if requested. */
+ (void)export_session_key;
+ (void)override_session_key;
+
if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -1901,11 +1907,13 @@ gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
static gpgme_error_t
gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
- gpgme_data_t plaintext)
+ gpgme_data_t plaintext, gpgme_ctx_t ctx)
{
engine_gpgsm_t gpgsm = engine;
gpgme_error_t err;
+ (void)ctx;
+
if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -2099,6 +2107,7 @@ struct engine_ops _gpgme_engine_ops_gpgsm =
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
gpgsm_set_io_cbs,
gpgsm_io_event,
gpgsm_cancel,
diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index df90cb2..1cd4421 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
@@ -469,6 +469,7 @@ struct engine_ops _gpgme_engine_ops_spawn =
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
engspawn_set_io_cbs,
engspawn_io_event, /* io_event */
engspawn_cancel, /* cancel */
diff --git a/src/engine-uiserver.c b/src/engine-uiserver.c
index 63e77de..ee7b1d2 100644
--- a/src/engine-uiserver.c
+++ b/src/engine-uiserver.c
@@ -960,13 +960,17 @@ uiserver_reset (void *engine)
static gpgme_error_t
_uiserver_decrypt (void *engine, int verify,
- gpgme_data_t ciph, gpgme_data_t plain)
+ gpgme_data_t ciph, gpgme_data_t plain,
+ int export_session_key, const char *override_session_key)
{
engine_uiserver_t uiserver = engine;
gpgme_error_t err;
const char *protocol;
char *cmd;
+ (void)override_session_key; /* Fixme: We need to see now to add this
+ * to the UI server protocol */
+
if (!uiserver)
return gpg_error (GPG_ERR_INV_VALUE);
if (uiserver->protocol == GPGME_PROTOCOL_DEFAULT)
@@ -978,8 +982,9 @@ _uiserver_decrypt (void *engine, int verify,
else
return gpgme_error (GPG_ERR_UNSUPPORTED_PROTOCOL);
- if (asprintf (&cmd, "DECRYPT%s%s", protocol,
- verify ? "" : " --no-verify") < 0)
+ if (asprintf (&cmd, "DECRYPT%s%s%s", protocol,
+ verify ? "" : " --no-verify",
+ export_session_key ? " --export-session-key" : "") < 0)
return gpg_error_from_syserror ();
uiserver->input_cb.data = ciph;
@@ -1006,16 +1011,21 @@ _uiserver_decrypt (void *engine, int verify,
static gpgme_error_t
-uiserver_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
+uiserver_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain,
+ int export_session_key, const char *override_session_key)
{
- return _uiserver_decrypt (engine, 0, ciph, plain);
+ return _uiserver_decrypt (engine, 0, ciph, plain,
+ export_session_key, override_session_key);
}
static gpgme_error_t
-uiserver_decrypt_verify (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
+uiserver_decrypt_verify (void *engine, gpgme_data_t ciph, gpgme_data_t plain,
+ int export_session_key,
+ const char *override_session_key)
{
- return _uiserver_decrypt (engine, 1, ciph, plain);
+ return _uiserver_decrypt (engine, 1, ciph, plain,
+ export_session_key, override_session_key);
}
@@ -1243,13 +1253,16 @@ uiserver_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
/* FIXME: Missing a way to specify --silent. */
static gpgme_error_t
uiserver_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
- gpgme_data_t plaintext)
+ gpgme_data_t plaintext, gpgme_ctx_t ctx)
{
engine_uiserver_t uiserver = engine;
gpgme_error_t err;
const char *protocol;
char *cmd;
+ (void)ctx; /* FIXME: We should to add a --sender option to the
+ * UISever protocol. */
+
if (!uiserver)
return gpg_error (GPG_ERR_INV_VALUE);
if (uiserver->protocol == GPGME_PROTOCOL_DEFAULT)
@@ -1390,11 +1403,12 @@ struct engine_ops _gpgme_engine_ops_uiserver =
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* query_swdb */
uiserver_set_io_cbs,
uiserver_io_event,
uiserver_cancel,
NULL, /* cancel_op */
NULL, /* passwd */
- NULL, /* set_pinentry_mode */
+ NULL, /* set_pinentry_mode */
NULL /* opspawn */
};
diff --git a/src/engine.c b/src/engine.c
index a1173a0..75d9ff7 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
@@ -653,7 +653,8 @@ _gpgme_engine_set_protocol (engine_t engine, gpgme_protocol_t protocol)
gpgme_error_t
_gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph,
- gpgme_data_t plain)
+ gpgme_data_t plain, int export_session_key,
+ const char *override_session_key)
{
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -661,13 +662,15 @@ _gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph,
if (!engine->ops->decrypt)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- return (*engine->ops->decrypt) (engine->engine, ciph, plain);
+ return (*engine->ops->decrypt) (engine->engine, ciph, plain,
+ export_session_key, override_session_key);
}
gpgme_error_t
_gpgme_engine_op_decrypt_verify (engine_t engine, gpgme_data_t ciph,
- gpgme_data_t plain)
+ gpgme_data_t plain, int export_session_key,
+ const char *override_session_key)
{
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -675,7 +678,9 @@ _gpgme_engine_op_decrypt_verify (engine_t engine, gpgme_data_t ciph,
if (!engine->ops->decrypt_verify)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- return (*engine->ops->decrypt_verify) (engine->engine, ciph, plain);
+ return (*engine->ops->decrypt_verify) (engine->engine, ciph, plain,
+ export_session_key,
+ override_session_key);
}
@@ -902,7 +907,8 @@ _gpgme_engine_op_trustlist (engine_t engine, const char *pattern)
gpgme_error_t
_gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig,
- gpgme_data_t signed_text, gpgme_data_t plaintext)
+ gpgme_data_t signed_text, gpgme_data_t plaintext,
+ gpgme_ctx_t ctx)
{
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -910,7 +916,8 @@ _gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig,
if (!engine->ops->verify)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- return (*engine->ops->verify) (engine->engine, sig, signed_text, plaintext);
+ return (*engine->ops->verify) (engine->engine, sig, signed_text, plaintext,
+ ctx);
}
@@ -978,6 +985,21 @@ _gpgme_engine_op_conf_save (engine_t engine, gpgme_conf_comp_t conf)
}
+gpgme_error_t
+_gpgme_engine_op_query_swdb (engine_t engine,
+ const char *name, const char *iversion,
+ gpgme_query_swdb_result_t result)
+{
+ if (!engine)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ if (!engine->ops->query_swdb)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+
+ return (*engine->ops->query_swdb) (engine->engine, name, iversion, result);
+}
+
+
void
_gpgme_engine_set_io_cbs (engine_t engine, gpgme_io_cbs_t io_cbs)
{
diff --git a/src/engine.h b/src/engine.h
index 4ce2bed..29d2f25 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -83,10 +83,15 @@ _gpgme_engine_set_colon_line_handler (engine_t engine,
engine_colon_line_handler_t fnc,
void *fnc_value);
gpgme_error_t _gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph,
- gpgme_data_t plain);
+ gpgme_data_t plain,
+ int export_session_key,
+ const char *override_session_key);
gpgme_error_t _gpgme_engine_op_decrypt_verify (engine_t engine,
gpgme_data_t ciph,
- gpgme_data_t plain);
+ gpgme_data_t plain,
+ int export_session_key,
+ const char *override_session_key
+ );
gpgme_error_t _gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
int allow_secret);
gpgme_error_t _gpgme_engine_op_edit (engine_t engine, int type,
@@ -152,7 +157,8 @@ gpgme_error_t _gpgme_engine_op_trustlist (engine_t engine,
const char *pattern);
gpgme_error_t _gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig,
gpgme_data_t signed_text,
- gpgme_data_t plaintext);
+ gpgme_data_t plaintext,
+ gpgme_ctx_t ctx);
gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine,
gpgme_data_t output,
@@ -172,6 +178,12 @@ gpgme_error_t _gpgme_engine_op_conf_load (engine_t engine,
gpgme_error_t _gpgme_engine_op_conf_save (engine_t engine,
gpgme_conf_comp_t conf);
+gpgme_error_t _gpgme_engine_op_query_swdb (engine_t engine,
+ const char *name,
+ const char *iversion,
+ gpgme_query_swdb_result_t result);
+
+
void _gpgme_engine_set_io_cbs (engine_t engine,
gpgme_io_cbs_t io_cbs);
void _gpgme_engine_io_event (engine_t engine,
diff --git a/src/export.c b/src/export.c
index 41a9eba..cd94050 100644
--- a/src/export.c
+++ b/src/export.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/genkey.c b/src/genkey.c
index 9dcf0be..ea3f1ea 100644
--- a/src/genkey.c
+++ b/src/genkey.c
@@ -15,7 +15,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/getauditlog.c b/src/getauditlog.c
index e2ba25e..dbaf260 100644
--- a/src/getauditlog.c
+++ b/src/getauditlog.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/gpgconf.c b/src/gpgconf.c
index 6591452..b1b84a6 100644
--- a/src/gpgconf.c
+++ b/src/gpgconf.c
@@ -65,7 +65,7 @@ gpgme_conf_release (gpgme_conf_comp_t conf)
}
-/* Public function to release load a configuration list. No
+/* Public function to load a configuration list. No
asynchronous interface for now. */
gpgme_error_t
gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p)
@@ -108,5 +108,3 @@ gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp)
ctx->protocol = proto;
return err;
}
-
-
diff --git a/src/gpgme-config.in b/src/gpgme-config.in
index 0d9fda2..a4d152e 100644
--- a/src/gpgme-config.in
+++ b/src/gpgme-config.in
@@ -32,7 +32,9 @@ gpg_error_libs="@GPG_ERROR_LIBS@"
# Configure thread packages.
thread_modules=""
-@HAVE_PTHREAD_TRUE@thread_modules="$thread_modules pthread"
+# For compatibility we keep proving the
+# thread modules variable.
+thread_modules="$thread_modules pthread"
libs_pthread="-lpthread"
cflags_pthread=""
@@ -50,7 +52,6 @@ usage()
cat <<EOF
Usage: gpgme-config [OPTIONS]
Options:
- --thread={${thread_modules}}]
--prefix
--exec-prefix
--version
@@ -139,7 +140,8 @@ while test $# -gt 0; do
result=
tmp_x=
case "$thread_module" in
- pthread) tmp_l="-lgpgme-pthread"; tmp_x="$libs_pthread" ;;
+ # deprecated
+ pthread) tmp_l="-lgpgme" ;;
*)
if test "x$with_glib" = "xyes" ; then
tmp_l="-lgpgme-glib"
diff --git a/src/gpgme-tool.c b/src/gpgme-tool.c
index fb158f1..3e2dc78 100644
--- a/src/gpgme-tool.c
+++ b/src/gpgme-tool.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/gpgme-w32spawn.c b/src/gpgme-w32spawn.c
index b510ba3..003b9b0 100644
--- a/src/gpgme-w32spawn.c
+++ b/src/gpgme-w32spawn.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
diff --git a/src/gpgme.c b/src/gpgme.c
index d59f808..cf767c7 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -16,7 +16,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
@@ -38,6 +38,7 @@
#include "debug.h"
#include "priv-io.h"
#include "sys-util.h"
+#include "mbox-util.h"
/* The default locale. */
@@ -84,39 +85,6 @@ gpgme_set_global_flag (const char *name, const char *value)
}
-/* Set the flag NAME for CTX to VALUE. The supported flags are:
- *
- * - full-status :: With a value of "1" the status callback set by
- * gpgme_set_status_cb returns all status lines
- * except for PROGRESS lines. With the default of
- * "0" the status callback is only called in certain
- * situations.
- */
-gpgme_error_t
-gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value)
-{
- int abool;
-
- if (!ctx || !name || !value)
- return gpg_error (GPG_ERR_INV_VALUE);
-
- abool = *value? !!atoi (value) : 0;
-
- if (!strcmp (name, "full-status"))
- {
- ctx->full_status = abool;
- }
- else if (!strcmp (name, "raw-description"))
- {
- ctx->raw_description = abool;
- }
- else
- return gpg_error (GPG_ERR_UNKNOWN_NAME);
-
- return 0;
-}
-
-
/* Create a new context as an environment for GPGME crypto
operations. */
@@ -275,12 +243,11 @@ gpgme_release (gpgme_ctx_t ctx)
_gpgme_release_result (ctx);
_gpgme_signers_clear (ctx);
_gpgme_sig_notation_clear (ctx);
- if (ctx->signers)
- free (ctx->signers);
- if (ctx->lc_ctype)
- free (ctx->lc_ctype);
- if (ctx->lc_messages)
- free (ctx->lc_messages);
+ free (ctx->sender);
+ free (ctx->signers);
+ free (ctx->lc_ctype);
+ free (ctx->lc_messages);
+ free (ctx->override_session_key);
_gpgme_engine_info_release (ctx->engine_info);
ctx->engine_info = NULL;
DESTROY_LOCK (ctx->lock);
@@ -459,6 +426,42 @@ gpgme_get_protocol_name (gpgme_protocol_t protocol)
}
}
+
+/* Store the sender's address in the context. ADDRESS is addr-spec of
+ * mailbox but my also be a complete mailbox, in which case this
+ * function extracts the addr-spec from it. Returns 0 on success or
+ * an error code if no valid addr-spec could be extracted from
+ * ADDRESS. */
+gpgme_error_t
+gpgme_set_sender (gpgme_ctx_t ctx, const char *address)
+{
+ char *p = NULL;
+
+ TRACE_BEG1 (DEBUG_CTX, "gpgme_set_sender", ctx, "sender='%s'",
+ address?address:"(null)");
+
+ if (!ctx || (address && !(p = _gpgme_mailbox_from_userid (address))))
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
+ free (ctx->sender);
+ ctx->sender = p;
+ return TRACE_ERR (0);
+}
+
+
+/* Return the sender's address (addr-spec part) from the context or
+ * NULL if none was set. The returned value is valid as long as the
+ * CTX is valid and gpgme_set_sender has not been used. */
+const char *
+gpgme_get_sender (gpgme_ctx_t ctx)
+{
+ TRACE1 (DEBUG_CTX, "gpgme_get_sender", ctx, "sender='%s'",
+ ctx?ctx->sender:"");
+
+ return ctx->sender;
+}
+
+
/* Enable or disable the use of an ascii armor for all output. */
void
gpgme_set_armor (gpgme_ctx_t ctx, int use_armor)
@@ -469,7 +472,7 @@ gpgme_set_armor (gpgme_ctx_t ctx, int use_armor)
if (!ctx)
return;
- ctx->use_armor = use_armor;
+ ctx->use_armor = !!use_armor;
}
@@ -483,6 +486,85 @@ gpgme_get_armor (gpgme_ctx_t ctx)
}
+/* Set the flag NAME for CTX to VALUE. The supported flags are:
+ *
+ * - full-status :: With a value of "1" the status callback set by
+ * gpgme_set_status_cb returns all status lines
+ * except for PROGRESS lines. With the default of
+ * "0" the status callback is only called in certain
+ * situations.
+ */
+gpgme_error_t
+gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value)
+{
+ gpgme_error_t err = 0;
+ int abool;
+
+ TRACE2 (DEBUG_CTX, "gpgme_set_ctx_flag", ctx,
+ "name='%s' value='%s'",
+ name? name:"(null)", value?value:"(null)");
+
+ abool = (value && *value)? !!atoi (value) : 0;
+
+ if (!ctx || !name || !value)
+ err = gpg_error (GPG_ERR_INV_VALUE);
+ else if (!strcmp (name, "full-status"))
+ {
+ ctx->full_status = abool;
+ }
+ else if (!strcmp (name, "raw-description"))
+ {
+ ctx->raw_description = abool;
+ }
+ else if (!strcmp (name, "export-session-key"))
+ {
+ ctx->export_session_keys = abool;
+ }
+ else if (!strcmp (name, "override-session-key"))
+ {
+ free (ctx->override_session_key);
+ ctx->override_session_key = strdup (value);
+ if (!ctx->override_session_key)
+ err = gpg_error_from_syserror ();
+ }
+ else
+ err = gpg_error (GPG_ERR_UNKNOWN_NAME);
+
+ return err;
+}
+
+
+/* Get the context flag named NAME. See gpgme_set_ctx_flag for a list
+ * of valid names. If the NAME is unknown NULL is returned. For a
+ * boolean flag an empty string is returned for False and the string
+ * "1" for True; thus either atoi or a simple string test can be
+ * used. */
+const char *
+gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name)
+{
+ if (!ctx || !name)
+ return NULL;
+ else if (!strcmp (name, "full-status"))
+ {
+ return ctx->full_status? "1":"";
+ }
+ else if (!strcmp (name, "raw-description"))
+ {
+ return ctx->raw_description? "1":"";
+ }
+ else if (!strcmp (name, "export-session-key"))
+ {
+ return ctx->export_session_keys? "1":"";
+ }
+ else if (!strcmp (name, "override-session-key"))
+ {
+ return ctx->override_session_key? ctx->override_session_key : "";
+ }
+ else
+ return NULL;
+}
+
+
/* Enable or disable the use of the special textmode. Textmode is for
example used for the RFC2015 signatures; note that the updated RFC
3156 mandates that the MUA does some preparations so that textmode
@@ -496,7 +578,7 @@ gpgme_set_textmode (gpgme_ctx_t ctx, int use_textmode)
if (!ctx)
return;
- ctx->use_textmode = use_textmode;
+ ctx->use_textmode = !!use_textmode;
}
/* Return the state of the textmode flag. */
@@ -520,7 +602,7 @@ gpgme_set_offline (gpgme_ctx_t ctx, int offline)
if (!ctx)
return;
- ctx->offline = offline;
+ ctx->offline = !!offline;
}
/* Return the state of the offline flag. */
diff --git a/src/gpgme.def b/src/gpgme.def
index c94c960..0d3ce74 100644
--- a/src/gpgme.def
+++ b/src/gpgme.def
@@ -246,5 +246,12 @@ EXPORTS
gpgme_addrspec_from_uid @186
+ gpgme_set_sender @187
+ gpgme_get_sender @188
+
+ gpgme_op_query_swdb @189
+ gpgme_op_query_swdb_result @190
+
+ gpgme_get_ctx_flag @191
; END
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 5c914ae..7cfe8f6 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -999,6 +999,9 @@ void gpgme_release (gpgme_ctx_t ctx);
gpgme_error_t gpgme_set_ctx_flag (gpgme_ctx_t ctx,
const char *name, const char *value);
+/* Get the value of the flag NAME from CTX. */
+const char *gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name);
+
/* Set the protocol to be used by CTX to PROTO. */
gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto);
@@ -1161,6 +1164,12 @@ gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
/* Get the sig notations for this context. */
gpgme_sig_notation_t gpgme_sig_notation_get (gpgme_ctx_t ctx);
+/* Store a sender address in the context. */
+gpgme_error_t gpgme_set_sender (gpgme_ctx_t ctx, const char *address);
+
+/* Get the sender address from the context. */
+const char *gpgme_get_sender (gpgme_ctx_t ctx);
+
/*
@@ -1521,6 +1530,10 @@ struct _gpgme_op_decrypt_result
/* The original file name of the plaintext message, if
available. */
char *file_name;
+
+ /* A textual representation of the session key used to decrypt the
+ * message, if available */
+ char *session_key;
};
typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t;
@@ -2412,6 +2425,67 @@ gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
+/* Information about software versions. */
+typedef struct _gpgme_op_query_swdb_result
+{
+ /* RFU */
+ struct _gpgme_op_query_swdb_result *next;
+
+ /* The name of the package (e.g. "gpgme", "gnupg") */
+ char *name;
+
+ /* The version number of the installed version. */
+ char *iversion;
+
+ /* The time the online info was created. */
+ unsigned long created;
+
+ /* The time the online info was retrieved. */
+ unsigned long retrieved;
+
+ /* This bit is set if an error occured or some of the information
+ * in this structure may not be set. */
+ unsigned int warning : 1;
+
+ /* An update is available. */
+ unsigned int update : 1;
+
+ /* The update is important. */
+ unsigned int urgent : 1;
+
+ /* No information at all available. */
+ unsigned int noinfo : 1;
+
+ /* The package name is not known. */
+ unsigned int unknown : 1;
+
+ /* The information here is too old. */
+ unsigned int tooold : 1;
+
+ /* Other error. */
+ unsigned int error : 1;
+
+ unsigned int _reserved : 25;
+
+ /* The version number of the latest released version. */
+ char *version;
+
+ /* The release date of that version. */
+ unsigned long reldate;
+
+} *gpgme_query_swdb_result_t;
+
+
+/* Run the gpgconf --query-swdb command. */
+gpgme_error_t gpgme_op_query_swdb (gpgme_ctx_t ctx,
+ const char *name, const char *iversion,
+ unsigned int reserved);
+
+/* Return the result from the last query_swdb operation. */
+gpgme_query_swdb_result_t gpgme_op_query_swdb_result (gpgme_ctx_t ctx);
+
+
+
/*
* Various functions.
diff --git a/src/keylist.c b/src/keylist.c
index 8a0c5a3..2ce0846 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -16,7 +16,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
@@ -54,6 +54,9 @@ typedef struct
{
struct _gpgme_op_keylist_result result;
+ /* The error code from ERROR keydb_search. */
+ gpgme_error_t keydb_search_err;
+
gpgme_key_t tmp_key;
/* This points to the last uid in tmp_key. */
@@ -135,10 +138,17 @@ keylist_status_handler (void *priv, gpgme_status_code_t code, char *args)
opd->result.truncated = 1;
break;
+ case GPGME_STATUS_ERROR:
+ err = _gpgme_parse_failure (args);
+ if (!opd->keydb_search_err && !strcmp (args, "keydb_search"))
+ opd->keydb_search_err = err;
+ err = 0;
+ break;
+
default:
break;
}
- return 0;
+ return err;
}
@@ -1138,7 +1148,8 @@ gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
return TRACE_ERR (err);
if (!opd->key_cond)
- return TRACE_ERR (gpg_error (GPG_ERR_EOF));
+ return TRACE_ERR (opd->keydb_search_err? opd->keydb_search_err
+ /**/ : gpg_error (GPG_ERR_EOF));
opd->key_cond = 0;
assert (opd->key_queue);
diff --git a/src/keysign.c b/src/keysign.c
index 7d08c11..c2fcabb 100644
--- a/src/keysign.c
+++ b/src/keysign.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/libgpgme.vers b/src/libgpgme.vers
index d3962db..a55cd10 100644
--- a/src/libgpgme.vers
+++ b/src/libgpgme.vers
@@ -101,6 +101,7 @@ GPGME_1.1 {
gpgme_pubkey_algo_string;
gpgme_set_ctx_flag;
+ gpgme_get_ctx_flag;
gpgme_data_set_flag;
gpgme_op_createkey_start;
@@ -119,6 +120,12 @@ GPGME_1.1 {
gpgme_op_interact;
gpgme_addrspec_from_uid;
+
+ gpgme_set_sender;
+ gpgme_get_sender;
+
+ gpgme_op_query_swdb;
+ gpgme_op_query_swdb_result;
};
diff --git a/src/mbox-util.c b/src/mbox-util.c
index 81e929b..0dafc2a 100644
--- a/src/mbox-util.c
+++ b/src/mbox-util.c
@@ -15,7 +15,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* NB: This code has been taken from GnuPG. Please keep it in sync
diff --git a/src/mbox-util.h b/src/mbox-util.h
index c5747b6..8be1343 100644
--- a/src/mbox-util.h
+++ b/src/mbox-util.h
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_COMMON_MBOX_UTIL_H
#define GNUPG_COMMON_MBOX_UTIL_H
diff --git a/src/op-support.c b/src/op-support.c
index 9f10cd3..d9217ec 100644
--- a/src/op-support.c
+++ b/src/op-support.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/opassuan.c b/src/opassuan.c
index e58240c..2bbaacd 100644
--- a/src/opassuan.c
+++ b/src/opassuan.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/parsetlv.c b/src/parsetlv.c
index 70c9518..b311a73 100644
--- a/src/parsetlv.c
+++ b/src/parsetlv.c
@@ -12,7 +12,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
diff --git a/src/parsetlv.h b/src/parsetlv.h
index 153073c..bea03d4 100644
--- a/src/parsetlv.h
+++ b/src/parsetlv.h
@@ -12,7 +12,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef PARSETLV_H
diff --git a/src/passwd.c b/src/passwd.c
index c34f357..5bd67a5 100644
--- a/src/passwd.c
+++ b/src/passwd.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/posix-io.c b/src/posix-io.c
index c0b2f4f..5296f5f 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
@@ -607,7 +607,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
if (fds[i].fd >= FD_SETSIZE)
{
TRACE_END (dbg_help, " -BAD- ]");
- gpg_err_set_errno (EBADF);
+ gpg_err_set_errno (EMFILE);
return TRACE_SYSRES (-1);
}
assert (!FD_ISSET (fds[i].fd, &readfds));
@@ -622,7 +622,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
if (fds[i].fd >= FD_SETSIZE)
{
TRACE_END (dbg_help, " -BAD- ]");
- gpg_err_set_errno (EBADF);
+ gpg_err_set_errno (EMFILE);
return TRACE_SYSRES (-1);
}
assert (!FD_ISSET (fds[i].fd, &writefds));
diff --git a/src/posix-sema.c b/src/posix-sema.c
deleted file mode 100644
index d04ce61..0000000
--- a/src/posix-sema.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* posix-sema.c
- Copyright (C) 2001 Werner Koch (dd9jn)
- Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH
-
- This file is part of GPGME.
-
- GPGME is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- GPGME is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#include "util.h"
-#include "sema.h"
-#include "ath.h"
-
-void
-_gpgme_sema_subsystem_init ()
-{
-}
-
-void
-_gpgme_sema_cs_enter (struct critsect_s *s)
-{
- _gpgme_ath_mutex_lock (&s->priv);
-}
-
-void
-_gpgme_sema_cs_leave (struct critsect_s *s)
-{
- _gpgme_ath_mutex_unlock (&s->priv);
-}
-
-void
-_gpgme_sema_cs_destroy (struct critsect_s *s)
-{
- _gpgme_ath_mutex_destroy (&s->priv);
- s->priv = NULL;
-}
diff --git a/src/queryswdb.c b/src/queryswdb.c
new file mode 100644
index 0000000..698a419
--- /dev/null
+++ b/src/queryswdb.c
@@ -0,0 +1,121 @@
+/* queryswdb.c - Access to the SWDB file
+ * Copyright (C) 2016 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 <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdlib.h>
+#include <assert.h>
+
+#include "gpgme.h"
+#include "debug.h"
+#include "context.h"
+#include "ops.h"
+
+
+typedef struct
+{
+ struct _gpgme_op_query_swdb_result result;
+
+} *op_data_t;
+
+
+
+static void
+release_op_data (void *hook)
+{
+ op_data_t opd = (op_data_t) hook;
+ gpgme_query_swdb_result_t result = &opd->result;
+
+ assert (!result->next);
+ free (result->name);
+ free (result->iversion);
+ free (result->version);
+}
+
+
+gpgme_query_swdb_result_t
+gpgme_op_query_swdb_result (gpgme_ctx_t ctx)
+{
+ void *hook;
+ op_data_t opd;
+ gpgme_error_t err;
+
+ TRACE_BEG (DEBUG_CTX, "gpgme_op_query_swdb_result", ctx);
+
+ err = _gpgme_op_data_lookup (ctx, OPDATA_QUERY_SWDB, &hook, -1, NULL);
+ opd = hook;
+
+ if (err || !opd)
+ {
+ TRACE_SUC0 ("result=(null)");
+ return NULL;
+ }
+
+ TRACE_SUC1 ("result=%p", &opd->result);
+ return &opd->result;
+}
+
+
+
+/* Query the swdb for software package NAME and check against the
+ * installed version given by IVERSION. If IVERSION is NULL a check
+ * is only done if GPGME can figure out the version by itself
+ * (e.g. for "gpgme" or "gnupg"). RESERVED should be 0.
+ *
+ * Note that we only implemented the synchronous variant of this
+ * function but the API is prepared for an asynchronous variant.
+ */
+gpgme_error_t
+gpgme_op_query_swdb (gpgme_ctx_t ctx, const char *name, const char *iversion,
+ unsigned int reserved)
+{
+ gpgme_error_t err;
+ void *hook;
+ op_data_t opd;
+
+ TRACE_BEG2 (DEBUG_CTX, "gpgme_op_query_swdb", ctx,
+ "name=%s, iversion=%a", name, iversion);
+
+ if (!ctx || reserved)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
+ if (ctx->protocol != GPGME_PROTOCOL_GPGCONF)
+ return TRACE_ERR (gpg_error (GPG_ERR_UNSUPPORTED_PROTOCOL));
+
+ if (!name)
+ name = "gpgme";
+
+ if (!iversion && !strcmp (name, "gpgme"))
+ iversion = VERSION;
+
+ err = _gpgme_op_reset (ctx, 1);
+ if (err)
+ return err;
+
+ err = _gpgme_op_data_lookup (ctx, OPDATA_QUERY_SWDB, &hook,
+ sizeof (*opd), release_op_data);
+ opd = hook;
+ if (err)
+ return TRACE_ERR (err);
+
+ err = _gpgme_engine_op_query_swdb (ctx->engine, name, iversion,
+ &opd->result);
+ return TRACE_ERR (err);
+}
diff --git a/src/sema.h b/src/sema.h
index 4b7c0af..5b0d53d 100644
--- a/src/sema.h
+++ b/src/sema.h
@@ -22,46 +22,23 @@
#ifndef SEMA_H
#define SEMA_H
-struct critsect_s
-{
- const char *name;
- void *priv;
-};
+#include <gpg-error.h>
#define DEFINE_GLOBAL_LOCK(name) \
- struct critsect_s name = { #name, NULL }
+ gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER
+
#define DEFINE_STATIC_LOCK(name) \
- static struct critsect_s name = { #name, NULL }
+ static gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER
-#define DECLARE_LOCK(name) \
- struct critsect_s name
-#define INIT_LOCK(a) \
- do \
- { \
- (a).name = #a; \
- (a).priv = NULL; \
- } \
- while (0)
-#define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name))
+#define INIT_LOCK(name) \
+ name = (gpgrt_lock_t) GPGRT_LOCK_INITIALIZER
+#define DECLARE_LOCK(name) gpgrt_lock_t name
-#define LOCK(name) \
- do \
- { \
- _gpgme_sema_cs_enter (&(name)); \
- } \
- while (0)
+#define DESTROY_LOCK(name) gpgrt_lock_destroy(&name)
-#define UNLOCK(name) \
- do \
- { \
- _gpgme_sema_cs_leave (&(name)); \
- } \
- while (0)
+#define LOCK(name) gpgrt_lock_lock(&name)
-void _gpgme_sema_subsystem_init (void);
-void _gpgme_sema_cs_enter (struct critsect_s *s);
-void _gpgme_sema_cs_leave (struct critsect_s *s);
-void _gpgme_sema_cs_destroy (struct critsect_s *s);
+#define UNLOCK(name) gpgrt_lock_unlock(&name)
#endif /* SEMA_H */
diff --git a/src/sys-util.h b/src/sys-util.h
index 541c557..094399c 100644
--- a/src/sys-util.h
+++ b/src/sys-util.h
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SYS_UTIL_H
diff --git a/src/tofupolicy.c b/src/tofupolicy.c
index 799779e..460e3ba 100644
--- a/src/tofupolicy.c
+++ b/src/tofupolicy.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/ttyname_r.c b/src/ttyname_r.c
index eed28bd..7aed79e 100644
--- a/src/ttyname_r.c
+++ b/src/ttyname_r.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#if HAVE_CONFIG_H
diff --git a/src/util.h b/src/util.h
index 1474b41..a1be6e7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -49,6 +49,11 @@
# define GPG_ERR_FALSE 256
#endif
+#if GPG_ERROR_VERSION_NUMBER < 0x011900 /* 1.25 */
+# define GPG_ERR_ENGINE_TOO_OLD 300
+# define GPG_ERR_TOO_OLD 308
+#endif
+
#ifndef GPGRT_ATTR_SENTINEL
# define GPGRT_ATTR_SENTINEL(a) /* */
#endif
diff --git a/src/verify.c b/src/verify.c
index eb1cc10..faa8deb 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -1104,7 +1104,8 @@ verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig,
if (!sig)
return gpg_error (GPG_ERR_NO_DATA);
- return _gpgme_engine_op_verify (ctx->engine, sig, signed_text, plaintext);
+ return _gpgme_engine_op_verify (ctx->engine, sig, signed_text, plaintext,
+ ctx);
}
diff --git a/src/version.c b/src/version.c
index 8bc898f..99698fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -74,7 +74,6 @@ do_subsystem_inits (void)
}
#endif
- _gpgme_sema_subsystem_init ();
_gpgme_debug_subsystem_init ();
_gpgme_io_subsystem_init ();
_gpgme_status_init ();
diff --git a/src/w32-ce.c b/src/w32-ce.c
index e42f053..e326bfe 100644
--- a/src/w32-ce.c
+++ b/src/w32-ce.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
diff --git a/src/w32-io.c b/src/w32-io.c
index 3a69541..0d1c810 100644
--- a/src/w32-io.c
+++ b/src/w32-io.c
@@ -84,6 +84,7 @@ static struct
duplicates works just fine. */
int dup_from;
} fd_table[MAX_SLAFD];
+DEFINE_STATIC_LOCK (fd_table_lock);
/* Returns the FD or -1 on resource limit. */
@@ -92,6 +93,8 @@ new_fd (void)
{
int idx;
+ LOCK (fd_table_lock);
+
for (idx = 0; idx < MAX_SLAFD; idx++)
if (! fd_table[idx].used)
break;
@@ -99,14 +102,18 @@ new_fd (void)
if (idx == MAX_SLAFD)
{
gpg_err_set_errno (EIO);
- return -1;
+ idx = -1;
+ }
+ else
+ {
+ fd_table[idx].used = 1;
+ fd_table[idx].handle = INVALID_HANDLE_VALUE;
+ fd_table[idx].socket = INVALID_SOCKET;
+ fd_table[idx].rvid = 0;
+ fd_table[idx].dup_from = -1;
}
- fd_table[idx].used = 1;
- fd_table[idx].handle = INVALID_HANDLE_VALUE;
- fd_table[idx].socket = INVALID_SOCKET;
- fd_table[idx].rvid = 0;
- fd_table[idx].dup_from = -1;
+ UNLOCK (fd_table_lock);
return idx;
}
@@ -115,14 +122,21 @@ new_fd (void)
void
release_fd (int fd)
{
- if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used)
+ if (fd < 0 || fd >= MAX_SLAFD)
return;
- fd_table[fd].used = 0;
- fd_table[fd].handle = INVALID_HANDLE_VALUE;
- fd_table[fd].socket = INVALID_SOCKET;
- fd_table[fd].rvid = 0;
- fd_table[fd].dup_from = -1;
+ LOCK (fd_table_lock);
+
+ if (fd_table[fd].used)
+ {
+ fd_table[fd].used = 0;
+ fd_table[fd].handle = INVALID_HANDLE_VALUE;
+ fd_table[fd].socket = INVALID_SOCKET;
+ fd_table[fd].rvid = 0;
+ fd_table[fd].dup_from = -1;
+ }
+
+ UNLOCK (fd_table_lock);
}
diff --git a/src/w32-sema.c b/src/w32-sema.c
deleted file mode 100644
index 648a6bb..0000000
--- a/src/w32-sema.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* w32-sema.c
- Copyright (C) 2001 Werner Koch (dd9jn)
- Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH
-
- This file is part of GPGME.
-
- GPGME is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- GPGME is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#include <io.h>
-
-#include "util.h"
-#include "sema.h"
-#include "debug.h"
-
-static void
-sema_fatal (const char *text)
-{
- fprintf (stderr, "sema.c: %s\n", text);
- abort ();
-}
-
-
-static void
-critsect_init (struct critsect_s *s)
-{
- CRITICAL_SECTION *mp;
- static CRITICAL_SECTION init_lock;
- static int initialized;
-
- if (!initialized) {
- /* The very first time we call this function, we assume that
- only one thread is running, so that we can bootstrap the
- semaphore code. */
- InitializeCriticalSection (&init_lock);
- initialized = 1;
- }
- if (!s)
- return; /* we just want to initialize ourself */
-
- /* first test whether it is really not initialized */
- EnterCriticalSection (&init_lock);
- if ( s->priv ) {
- LeaveCriticalSection (&init_lock);
- return;
- }
- /* now init it */
- mp = malloc ( sizeof *mp );
- if (!mp) {
- LeaveCriticalSection (&init_lock);
- sema_fatal ("out of core while creating critical section lock");
- }
- InitializeCriticalSection (mp);
- s->priv = mp;
- LeaveCriticalSection (&init_lock);
-}
-
-void
-_gpgme_sema_subsystem_init ()
-{
- /* fixme: we should check that there is only one thread running */
- critsect_init (NULL);
-}
-
-
-void
-_gpgme_sema_cs_enter ( struct critsect_s *s )
-{
- if (!s->priv)
- critsect_init (s);
- EnterCriticalSection ( (CRITICAL_SECTION*)s->priv );
-}
-
-void
-_gpgme_sema_cs_leave (struct critsect_s *s)
-{
- if (!s->priv)
- critsect_init (s);
- LeaveCriticalSection ((CRITICAL_SECTION*)s->priv);
-}
-
-void
-_gpgme_sema_cs_destroy ( struct critsect_s *s )
-{
- if (s && s->priv) {
- DeleteCriticalSection ((CRITICAL_SECTION*)s->priv);
- free (s->priv);
- s->priv = NULL;
- }
-}
diff --git a/src/w32-util.c b/src/w32-util.c
index 21de6dc..ad36c9a 100644
--- a/src/w32-util.c
+++ b/src/w32-util.c
@@ -16,7 +16,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
**/
#ifdef HAVE_CONFIG_H
@@ -415,8 +415,17 @@ find_program_at_standard_place (const char *name)
We First try the generic place and then fallback to the x86
(i.e. 32 bit) place. This will prefer a 64 bit of the program
over a 32 bit version on 64 bit Windows if installed. */
- if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0)
- || SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILESX86, 0))
+ if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0))
+ {
+ result = _gpgme_strconcat (path, "\\", name, NULL);
+ if (result && access (result, F_OK))
+ {
+ free (result);
+ result = NULL;
+ }
+ }
+ if (!result
+ && SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILESX86, 0))
{
result = _gpgme_strconcat (path, "\\", name, NULL);
if (result && access (result, F_OK))
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c71914f..30c35f0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,7 +15,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
## Process this file with automake to produce Makefile.in
@@ -33,7 +33,7 @@ noinst_HEADERS = run-support.h
noinst_PROGRAMS = $(TESTS) run-keylist run-export run-import run-sign \
run-verify run-encrypt run-identify run-decrypt run-genkey \
- run-keysign run-tofu
+ run-keysign run-tofu run-swdb
if RUN_GPG_TESTS
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 7af2558..a908f95 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -31,7 +31,7 @@
# 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 <http://www.gnu.org/licenses/>.
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
VPATH = @srcdir@
@@ -103,7 +103,7 @@ noinst_PROGRAMS = $(am__EXEEXT_1) run-keylist$(EXEEXT) \
run-export$(EXEEXT) run-import$(EXEEXT) run-sign$(EXEEXT) \
run-verify$(EXEEXT) run-encrypt$(EXEEXT) run-identify$(EXEEXT) \
run-decrypt$(EXEEXT) run-genkey$(EXEEXT) run-keysign$(EXEEXT) \
- run-tofu$(EXEEXT)
+ run-tofu$(EXEEXT) run-swdb$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/mkinstalldirs \
@@ -169,6 +169,10 @@ run_sign_SOURCES = run-sign.c
run_sign_OBJECTS = run-sign.$(OBJEXT)
run_sign_LDADD = $(LDADD)
run_sign_DEPENDENCIES = ../src/libgpgme.la
+run_swdb_SOURCES = run-swdb.c
+run_swdb_OBJECTS = run-swdb.$(OBJEXT)
+run_swdb_LDADD = $(LDADD)
+run_swdb_DEPENDENCIES = ../src/libgpgme.la
run_tofu_SOURCES = run-tofu.c
run_tofu_OBJECTS = run-tofu.$(OBJEXT)
run_tofu_LDADD = $(LDADD)
@@ -225,12 +229,12 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = run-decrypt.c run-encrypt.c run-export.c run-genkey.c \
run-identify.c run-import.c run-keylist.c run-keysign.c \
- run-sign.c run-tofu.c run-verify.c t-data.c t-engine-info.c \
- t-version.c
+ run-sign.c run-swdb.c run-tofu.c run-verify.c t-data.c \
+ t-engine-info.c t-version.c
DIST_SOURCES = run-decrypt.c run-encrypt.c run-export.c run-genkey.c \
run-identify.c run-import.c run-keylist.c run-keysign.c \
- run-sign.c run-tofu.c run-verify.c t-data.c t-engine-info.c \
- t-version.c
+ run-sign.c run-swdb.c run-tofu.c run-verify.c t-data.c \
+ t-engine-info.c t-version.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
@@ -452,6 +456,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -604,6 +611,10 @@ run-sign$(EXEEXT): $(run_sign_OBJECTS) $(run_sign_DEPENDENCIES) $(EXTRA_run_sign
@rm -f run-sign$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(run_sign_OBJECTS) $(run_sign_LDADD) $(LIBS)
+run-swdb$(EXEEXT): $(run_swdb_OBJECTS) $(run_swdb_DEPENDENCIES) $(EXTRA_run_swdb_DEPENDENCIES)
+ @rm -f run-swdb$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(run_swdb_OBJECTS) $(run_swdb_LDADD) $(LIBS)
+
run-tofu$(EXEEXT): $(run_tofu_OBJECTS) $(run_tofu_DEPENDENCIES) $(EXTRA_run_tofu_DEPENDENCIES)
@rm -f run-tofu$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(run_tofu_OBJECTS) $(run_tofu_LDADD) $(LIBS)
@@ -639,6 +650,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-keylist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-keysign.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-sign.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-swdb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-tofu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-verify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-data.Po@am__quote@
diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am
index 2538f63..c46feb0 100644
--- a/tests/gpg/Makefile.am
+++ b/tests/gpg/Makefile.am
@@ -38,7 +38,8 @@ 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-trustlist t-edit t-keylist t-keylist-sig t-wait \
- t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed $(tests_unix)
+ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed $(tests_unix) \
+ t-thread-keylist t-thread-keylist-verify
TESTS = initial.test $(c_tests) final.test
@@ -61,8 +62,10 @@ EXTRA_DIST = initial.test final.test \
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la
-t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread
-t_cancel_LDADD = ../../src/libgpgme-pthread.la -lpthread
+t_thread1_LDADD = ../../src/libgpgme.la -lpthread
+t_thread_keylist_LDADD = ../../src/libgpgme.la -lpthread
+t_thread_keylist_verify_LDADD = ../../src/libgpgme.la -lpthread
+t_cancel_LDADD = ../../src/libgpgme.la -lpthread
# We don't run t-genkey and t-cancel in the test suite, because it
# takes too long
@@ -90,7 +93,7 @@ export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
done
diff --git a/tests/gpg/Makefile.in b/tests/gpg/Makefile.in
index e1e943e..ed75d8a 100644
--- a/tests/gpg/Makefile.in
+++ b/tests/gpg/Makefile.in
@@ -132,13 +132,14 @@ am__EXEEXT_2 = t-encrypt$(EXEEXT) t-encrypt-sym$(EXEEXT) \
t-trustlist$(EXEEXT) t-edit$(EXEEXT) t-keylist$(EXEEXT) \
t-keylist-sig$(EXEEXT) t-wait$(EXEEXT) \
t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \
- t-gpgconf$(EXEEXT) t-encrypt-mixed$(EXEEXT) $(am__EXEEXT_1)
+ t-gpgconf$(EXEEXT) t-encrypt-mixed$(EXEEXT) $(am__EXEEXT_1) \
+ t-thread-keylist$(EXEEXT) t-thread-keylist-verify$(EXEEXT)
@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_3 = t-cancel$(EXEEXT)
am__EXEEXT_4 = t-genkey$(EXEEXT) $(am__EXEEXT_3)
PROGRAMS = $(noinst_PROGRAMS)
t_cancel_SOURCES = t-cancel.c
t_cancel_OBJECTS = t-cancel.$(OBJEXT)
-t_cancel_DEPENDENCIES = ../../src/libgpgme-pthread.la
+t_cancel_DEPENDENCIES = ../../src/libgpgme.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -219,9 +220,15 @@ t_signers_SOURCES = t-signers.c
t_signers_OBJECTS = t-signers.$(OBJEXT)
t_signers_LDADD = $(LDADD)
t_signers_DEPENDENCIES = ../../src/libgpgme.la
+t_thread_keylist_SOURCES = t-thread-keylist.c
+t_thread_keylist_OBJECTS = t-thread-keylist.$(OBJEXT)
+t_thread_keylist_DEPENDENCIES = ../../src/libgpgme.la
+t_thread_keylist_verify_SOURCES = t-thread-keylist-verify.c
+t_thread_keylist_verify_OBJECTS = t-thread-keylist-verify.$(OBJEXT)
+t_thread_keylist_verify_DEPENDENCIES = ../../src/libgpgme.la
t_thread1_SOURCES = t-thread1.c
t_thread1_OBJECTS = t-thread1.$(OBJEXT)
-t_thread1_DEPENDENCIES = ../../src/libgpgme-pthread.la
+t_thread1_DEPENDENCIES = ../../src/libgpgme.la
t_trustlist_SOURCES = t-trustlist.c
t_trustlist_OBJECTS = t-trustlist.$(OBJEXT)
t_trustlist_LDADD = $(LDADD)
@@ -273,13 +280,15 @@ SOURCES = t-cancel.c t-decrypt.c t-decrypt-verify.c t-edit.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-thread1.c t-trustlist.c t-verify.c t-wait.c
+ t-thread-keylist.c t-thread-keylist-verify.c t-thread1.c \
+ t-trustlist.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-thread1.c t-trustlist.c t-verify.c t-wait.c
+ t-thread-keylist.c t-thread-keylist-verify.c t-thread1.c \
+ t-trustlist.c t-verify.c t-wait.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -459,6 +468,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -534,7 +546,8 @@ 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-trustlist t-edit t-keylist t-keylist-sig t-wait \
- t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed $(tests_unix)
+ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed $(tests_unix) \
+ t-thread-keylist t-thread-keylist-verify
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
@@ -554,8 +567,10 @@ EXTRA_DIST = initial.test final.test \
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la
-t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread
-t_cancel_LDADD = ../../src/libgpgme-pthread.la -lpthread
+t_thread1_LDADD = ../../src/libgpgme.la -lpthread
+t_thread_keylist_LDADD = ../../src/libgpgme.la -lpthread
+t_thread_keylist_verify_LDADD = ../../src/libgpgme.la -lpthread
+t_cancel_LDADD = ../../src/libgpgme.la -lpthread
# We don't run t-genkey and t-cancel in the test suite, because it
# takes too long
@@ -684,6 +699,14 @@ t-signers$(EXEEXT): $(t_signers_OBJECTS) $(t_signers_DEPENDENCIES) $(EXTRA_t_sig
@rm -f t-signers$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_signers_OBJECTS) $(t_signers_LDADD) $(LIBS)
+t-thread-keylist$(EXEEXT): $(t_thread_keylist_OBJECTS) $(t_thread_keylist_DEPENDENCIES) $(EXTRA_t_thread_keylist_DEPENDENCIES)
+ @rm -f t-thread-keylist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_thread_keylist_OBJECTS) $(t_thread_keylist_LDADD) $(LIBS)
+
+t-thread-keylist-verify$(EXEEXT): $(t_thread_keylist_verify_OBJECTS) $(t_thread_keylist_verify_DEPENDENCIES) $(EXTRA_t_thread_keylist_verify_DEPENDENCIES)
+ @rm -f t-thread-keylist-verify$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_thread_keylist_verify_OBJECTS) $(t_thread_keylist_verify_LDADD) $(LIBS)
+
t-thread1$(EXEEXT): $(t_thread1_OBJECTS) $(t_thread1_DEPENDENCIES) $(EXTRA_t_thread1_DEPENDENCIES)
@rm -f t-thread1$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_thread1_OBJECTS) $(t_thread1_LDADD) $(LIBS)
@@ -726,6 +749,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-sig-notation.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-sign.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-signers.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-thread-keylist-verify.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-thread-keylist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-thread1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-trustlist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-verify.Po@am__quote@
@@ -1073,7 +1098,7 @@ export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
done
diff --git a/tests/gpg/t-decrypt-verify.c b/tests/gpg/t-decrypt-verify.c
index b774cfd..653d74e 100644
--- a/tests/gpg/t-decrypt-verify.c
+++ b/tests/gpg/t-decrypt-verify.c
@@ -15,7 +15,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/gpg/t-thread-keylist-verify.c b/tests/gpg/t-thread-keylist-verify.c
new file mode 100644
index 0000000..6f747a6
--- /dev/null
+++ b/tests/gpg/t-thread-keylist-verify.c
@@ -0,0 +1,142 @@
+/* t-thread-verify.c - Regression test.
+ Copyright (C) 2015 Intevation GmbH
+
+ This file is part of GPGME.
+
+ GPGME is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ GPGME is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gpgme.h>
+
+#include <pthread.h>
+
+#include "t-support.h"
+
+#define THREAD_COUNT 100
+
+static const char test_text1[] = "Just GNU it!\n";
+static const char test_sig1[] =
+"-----BEGIN PGP SIGNATURE-----\n"
+"\n"
+"iN0EABECAJ0FAjoS+i9FFIAAAAAAAwA5YmFyw7bDpMO8w58gZGFzIHdhcmVuIFVt\n"
+"bGF1dGUgdW5kIGpldHp0IGVpbiBwcm96ZW50JS1aZWljaGVuNRSAAAAAAAgAJGZv\n"
+"b2Jhci4xdGhpcyBpcyBhIG5vdGF0aW9uIGRhdGEgd2l0aCAyIGxpbmVzGhpodHRw\n"
+"Oi8vd3d3Lmd1Lm9yZy9wb2xpY3kvAAoJEC1yfMdoaXc0JBIAoIiLlUsvpMDOyGEc\n"
+"dADGKXF/Hcb+AKCJWPphZCphduxSvrzH0hgzHdeQaA==\n"
+"=nts1\n"
+"-----END PGP SIGNATURE-----\n";
+
+void *
+start_keylist (void *arg)
+{
+ gpgme_error_t err;
+ gpgme_ctx_t ctx;
+ gpgme_key_t key;
+
+ (void)arg;
+ err = gpgme_new (&ctx);
+ fail_if_err (err);
+
+ err = gpgme_op_keylist_start (ctx, NULL, 0);
+ fail_if_err (err);
+
+ while (!(err = gpgme_op_keylist_next (ctx, &key)))
+ {
+ gpgme_key_unref (key);
+ }
+
+ gpgme_release (ctx);
+ return NULL;
+}
+
+void *
+start_verify (void *arg)
+{
+ gpgme_ctx_t ctx;
+ gpgme_error_t err;
+ gpgme_data_t sig, text;
+ gpgme_verify_result_t result;
+ gpgme_signature_t signature;
+
+ (void)arg;
+
+ err = gpgme_new (&ctx);
+ fail_if_err (err);
+
+ /* Checking a valid message. */
+ err = gpgme_data_new_from_mem (&text, test_text1, strlen (test_text1), 0);
+ fail_if_err (err);
+ err = gpgme_data_new_from_mem (&sig, test_sig1, strlen (test_sig1), 0);
+ fail_if_err (err);
+ err = gpgme_op_verify (ctx, sig, text, NULL);
+ fail_if_err (err);
+ result = gpgme_op_verify_result (ctx);
+
+ signature = result->signatures;
+
+ if (strcmp (signature->fpr, "A0FF4590BB6122EDEF6E3C542D727CC768697734"))
+ {
+ fprintf (stderr, "%s:%i: Unexpected fingerprint: %s\n",
+ __FILE__, __LINE__, signature->fpr);
+ exit (1);
+ }
+ if (gpgme_err_code (signature->status) != GPG_ERR_NO_ERROR)
+ {
+ fprintf (stderr, "%s:%i: Unexpected signature status: %s\n",
+ __FILE__, __LINE__, gpgme_strerror (signature->status));
+ exit (1);
+ }
+ gpgme_free (text);
+ gpgme_free (sig);
+ gpgme_release (ctx);
+ return NULL;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ pthread_t verify_threads[THREAD_COUNT];
+ pthread_t keylist_threads[THREAD_COUNT];
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
+ (void)argc;
+ (void)argv;
+
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ if (pthread_create(&verify_threads[i], NULL, start_verify, NULL) ||
+ pthread_create(&keylist_threads[i], NULL, start_keylist, NULL))
+ {
+ fprintf(stderr, "%s:%i: failed to create threads \n",
+ __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ pthread_join (verify_threads[i], NULL);
+ pthread_join (keylist_threads[i], NULL);
+ }
+ return 0;
+}
diff --git a/tests/gpg/t-thread-keylist.c b/tests/gpg/t-thread-keylist.c
new file mode 100644
index 0000000..c03f1ca
--- /dev/null
+++ b/tests/gpg/t-thread-keylist.c
@@ -0,0 +1,85 @@
+/* t-thread-verify.c - Regression test.
+ Copyright (C) 2015 Intevation GmbH
+
+ This file is part of GPGME.
+
+ GPGME is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ GPGME is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gpgme.h>
+
+#include <pthread.h>
+
+#include "t-support.h"
+
+#define THREAD_COUNT 100
+
+void *
+start_keylist (void *arg)
+{
+ gpgme_error_t err;
+ gpgme_ctx_t ctx;
+ gpgme_key_t key;
+
+ (void) arg;
+ err = gpgme_new (&ctx);
+ fail_if_err (err);
+
+ err = gpgme_op_keylist_start (ctx, NULL, 0);
+ fail_if_err (err);
+
+ while (!(err = gpgme_op_keylist_next (ctx, &key)))
+ {
+ gpgme_key_unref (key);
+ }
+
+ gpgme_release (ctx);
+
+ return NULL;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ pthread_t keylist_threads[THREAD_COUNT];
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
+ (void)argc;
+ (void)argv;
+
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ if (pthread_create(&keylist_threads[i], NULL, start_keylist, NULL))
+ {
+ fprintf(stderr, "%s:%i: failed to create threads \n",
+ __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ pthread_join (keylist_threads[i], NULL);
+ }
+ return 0;
+}
diff --git a/tests/gpg/t-verify.c b/tests/gpg/t-verify.c
index 9842d3a..f955cc9 100644
--- a/tests/gpg/t-verify.c
+++ b/tests/gpg/t-verify.c
@@ -209,6 +209,7 @@ main (int argc, char *argv[])
gpgme_error_t err;
gpgme_data_t sig, text;
gpgme_verify_result_t result;
+ const char *s;
(void)argc;
(void)argv;
@@ -270,6 +271,54 @@ main (int argc, char *argv[])
exit (1);
}
+ /* Checking that set/get_sernder works. */
+ err = gpgme_set_sender (ctx, "foo@example.org");
+ fail_if_err (err);
+ s = gpgme_get_sender (ctx);
+ if (!s || strcmp (s, "foo@example.org"))
+ {
+ fprintf (stderr, "%s:%i: gpgme_{set,get}_sender mismatch\n",
+ __FILE__, __LINE__);
+ exit (1);
+ }
+
+ err = gpgme_set_sender (ctx, "<bar@example.org>");
+ fail_if_err (err);
+ s = gpgme_get_sender (ctx);
+ if (!s || strcmp (s, "bar@example.org"))
+ {
+ fprintf (stderr, "%s:%i: gpgme_{set,get}_sender mismatch\n",
+ __FILE__, __LINE__);
+ exit (1);
+ }
+
+ err = gpgme_set_sender (ctx, "Foo bar (comment) <foo@example.org>");
+ fail_if_err (err);
+ s = gpgme_get_sender (ctx);
+ if (!s || strcmp (s, "foo@example.org"))
+ {
+ fprintf (stderr, "%s:%i: gpgme_{set,get}_sender mismatch\n",
+ __FILE__, __LINE__);
+ exit (1);
+ }
+
+ err = gpgme_set_sender (ctx, "foo");
+ if (gpgme_err_code (err) != GPG_ERR_INV_VALUE)
+ {
+ fprintf (stderr, "%s:%i: gpgme_set_sender didn't detect bogus address\n",
+ __FILE__, __LINE__);
+ exit (1);
+ }
+ /* (the former address should still be there.) */
+ s = gpgme_get_sender (ctx);
+ if (!s || strcmp (s, "foo@example.org"))
+ {
+ fprintf (stderr, "%s:%i: gpgme_{set,get}_sender mismatch\n",
+ __FILE__, __LINE__);
+ exit (1);
+ }
+
+
gpgme_data_release (sig);
gpgme_data_release (text);
gpgme_release (ctx);
diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am
index 41645b6..46d6a9b 100644
--- a/tests/gpgsm/Makefile.am
+++ b/tests/gpgsm/Makefile.am
@@ -70,7 +70,7 @@ export GPG_AGENT_INFO :=
echo faked-system-time 1008241200 >> ./gpgsm.conf
./private-keys-v1.d/$(key_id).key: $(srcdir)/$(key_id)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key
./trustlist.txt:
diff --git a/tests/gpgsm/Makefile.in b/tests/gpgsm/Makefile.in
index d653b96..8f2109b 100644
--- a/tests/gpgsm/Makefile.in
+++ b/tests/gpgsm/Makefile.in
@@ -390,6 +390,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -917,7 +920,7 @@ export GPG_AGENT_INFO :=
echo faked-system-time 1008241200 >> ./gpgsm.conf
./private-keys-v1.d/$(key_id).key: $(srcdir)/$(key_id)
- test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
+ $(MKDIR_P) ./private-keys-v1.d
cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key
./trustlist.txt:
diff --git a/tests/gpgsm/cms-decrypt.c b/tests/gpgsm/cms-decrypt.c
index 580832d..794f013 100644
--- a/tests/gpgsm/cms-decrypt.c
+++ b/tests/gpgsm/cms-decrypt.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/gpgsm/cms-keylist.c b/tests/gpgsm/cms-keylist.c
index 7ed3a4e..ffe17e2 100644
--- a/tests/gpgsm/cms-keylist.c
+++ b/tests/gpgsm/cms-keylist.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/opassuan/Makefile.in b/tests/opassuan/Makefile.in
index 1740ad0..797c4ae 100644
--- a/tests/opassuan/Makefile.in
+++ b/tests/opassuan/Makefile.in
@@ -345,6 +345,9 @@ SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
SYSROOT = @SYSROOT@
VERSION = @VERSION@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MICRO = @VERSION_MICRO@
+VERSION_MINOR = @VERSION_MINOR@
VERSION_NUMBER = @VERSION_NUMBER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
diff --git a/tests/opassuan/t-command.c b/tests/opassuan/t-command.c
index 9c791ee..fd0ea71 100644
--- a/tests/opassuan/t-command.c
+++ b/tests/opassuan/t-command.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
diff --git a/tests/run-decrypt.c b/tests/run-decrypt.c
index 6d38aee..8bcca0e 100644
--- a/tests/run-decrypt.c
+++ b/tests/run-decrypt.c
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
@@ -51,9 +51,13 @@ print_result (gpgme_decrypt_result_t result)
{
gpgme_recipient_t recp;
int count = 0;
+
printf ("Original file name: %s\n", nonnull(result->file_name));
printf ("Wrong key usage: %i\n", result->wrong_key_usage);
- printf ("Unsupported algorithm: %s\n ", nonnull(result->unsupported_algorithm));
+ printf ("Unsupported algorithm: %s\n",
+ nonnull(result->unsupported_algorithm));
+ if (result->session_key)
+ printf ("Session key: %s\n", result->session_key);
for (recp = result->recipients; recp->next; recp = recp->next)
{
@@ -74,6 +78,8 @@ show_usage (int ex)
" --status print status lines from the backend\n"
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
+ " --export-session-key show the session key\n"
+ " --override-session-key STRING use STRING as session key\n"
, stderr);
exit (ex);
}
@@ -91,6 +97,8 @@ main (int argc, char **argv)
gpgme_data_t out = NULL;
gpgme_decrypt_result_t result;
int print_status = 0;
+ int export_session_key = 0;
+ const char *override_session_key = NULL;
if (argc)
{ argc--; argv++; }
@@ -125,6 +133,19 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_CMS;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--export-session-key"))
+ {
+ export_session_key = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--override-session-key"))
+ {
+ argc--; argv++;
+ if (!argc)
+ show_usage (1);
+ override_session_key = *argv;
+ argc--; argv++;
+ }
else if (!strncmp (*argv, "--", 2))
show_usage (1);
@@ -152,6 +173,27 @@ main (int argc, char **argv)
gpgme_set_status_cb (ctx, status_cb, NULL);
gpgme_set_ctx_flag (ctx, "full-status", "1");
}
+ if (export_session_key)
+ {
+ err = gpgme_set_ctx_flag (ctx, "export-session-key", "1");
+ if (err)
+ {
+ fprintf (stderr, PGM ": error requesting exported session key: %s\n",
+ gpgme_strerror (err));
+ exit (1);
+ }
+ }
+ if (override_session_key)
+ {
+ err = gpgme_set_ctx_flag (ctx, "override-session-key",
+ override_session_key);
+ if (err)
+ {
+ fprintf (stderr, PGM ": error overriding session key: %s\n",
+ gpgme_strerror (err));
+ exit (1);
+ }
+ }
err = gpgme_data_new_from_stream (&in, fp_in);
if (err)
@@ -176,10 +218,11 @@ main (int argc, char **argv)
fprintf (stderr, PGM ": decrypt failed: %s\n", gpgme_strerror (err));
exit (1);
}
- if (result) {
- print_result (result);
- print_data (out);
- }
+ if (result)
+ {
+ print_result (result);
+ print_data (out);
+ }
gpgme_data_release (out);
gpgme_data_release (in);
diff --git a/tests/run-encrypt.c b/tests/run-encrypt.c
index b94b028..fd86836 100644
--- a/tests/run-encrypt.c
+++ b/tests/run-encrypt.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-export.c b/tests/run-export.c
index b133f13..0bb5468 100644
--- a/tests/run-export.c
+++ b/tests/run-export.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-genkey.c b/tests/run-genkey.c
index 20e7db5..c5abc42 100644
--- a/tests/run-genkey.c
+++ b/tests/run-genkey.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-identify.c b/tests/run-identify.c
index d5ce55f..01e9671 100644
--- a/tests/run-identify.c
+++ b/tests/run-identify.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-import.c b/tests/run-import.c
index 9225f61..081c0fa 100644
--- a/tests/run-import.c
+++ b/tests/run-import.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 647a9ed..93fbeb5 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-keysign.c b/tests/run-keysign.c
index f5a13e4..5f6cfce 100644
--- a/tests/run-keysign.c
+++ b/tests/run-keysign.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
diff --git a/tests/run-sign.c b/tests/run-sign.c
index 70853ed..9f2e175 100644
--- a/tests/run-sign.c
+++ b/tests/run-sign.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
@@ -83,6 +83,7 @@ show_usage (int ex)
" --uiserver use the UI server\n"
" --loopback use a loopback pinentry\n"
" --key NAME use key NAME for signing\n"
+ " --sender MBOX use MBOX as sender address\n"
, stderr);
exit (ex);
}
@@ -101,6 +102,7 @@ main (int argc, char **argv)
gpgme_sign_result_t result;
int print_status = 0;
int use_loopback = 0;
+ const char *sender = NULL;
if (argc)
{ argc--; argv++; }
@@ -148,6 +150,14 @@ main (int argc, char **argv)
key_string = *argv;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--sender"))
+ {
+ argc--; argv++;
+ if (!argc)
+ show_usage (1);
+ sender = *argv;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--loopback"))
{
use_loopback = 1;
@@ -192,6 +202,12 @@ main (int argc, char **argv)
gpgme_key_unref (akey);
}
+ if (sender)
+ {
+ err = gpgme_set_sender (ctx, sender);
+ fail_if_err (err);
+ }
+
err = gpgme_data_new_from_file (&in, *argv, 1);
if (err)
{
diff --git a/tests/run-support.h b/tests/run-support.h
index e4a4f70..841b223 100644
--- a/tests/run-support.h
+++ b/tests/run-support.h
@@ -15,7 +15,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#include <unistd.h>
diff --git a/tests/run-swdb.c b/tests/run-swdb.c
new file mode 100644
index 0000000..a373254
--- /dev/null
+++ b/tests/run-swdb.c
@@ -0,0 +1,151 @@
+/* run-swdb.c - Test tool for SWDB function
+ * Copyright (C) 2016 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 <https://www.gnu.org/licenses/>.
+ */
+
+/* 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 <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include <gpgme.h>
+
+#define PGM "run-swdb"
+
+#include "run-support.h"
+
+
+static int verbose;
+
+
+static const char *
+isotimestr (unsigned long value)
+{
+ time_t t;
+ static char buffer[25+5];
+ struct tm *tp;
+
+ if (!value)
+ return "none";
+ t = value;
+
+ tp = gmtime (&t);
+ snprintf (buffer, sizeof buffer, "%04d-%02d-%02d %02d:%02d:%02d",
+ 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec);
+ return buffer;
+}
+
+
+static int
+show_usage (int ex)
+{
+ fputs ("usage: " PGM " [options] NAME [VERSION]\n\n"
+ "Options:\n"
+ " --verbose run in verbose mode\n"
+ " --status print status lines from the backend\n"
+ , stderr);
+ exit (ex);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+ gpgme_error_t err;
+ gpgme_ctx_t ctx;
+ gpgme_protocol_t protocol = GPGME_PROTOCOL_GPGCONF;
+ const char *name;
+ const char *iversion;
+ gpgme_query_swdb_result_t result;
+
+ if (argc)
+ { argc--; argv++; }
+
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--"))
+ {
+ argc--; argv++;
+ break;
+ }
+ else if (!strcmp (*argv, "--help"))
+ show_usage (0);
+ else if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strncmp (*argv, "--", 2))
+ show_usage (1);
+ }
+
+ if (argc < 1 || argc > 2)
+ show_usage (1);
+ name = argv[0];
+ iversion = argc > 1? argv[1] : NULL;
+
+ init_gpgme (protocol);
+
+ err = gpgme_new (&ctx);
+ fail_if_err (err);
+ gpgme_set_protocol (ctx, protocol);
+
+ err = gpgme_op_query_swdb (ctx, name, iversion, 0);
+ if (err)
+ {
+ fprintf (stderr, PGM ": error querying swdb: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ result = gpgme_op_query_swdb_result (ctx);
+ if (!result)
+ {
+ fprintf (stderr, PGM ": error querying swdb: %s\n", "no result");
+ exit (1);
+ }
+
+ printf ("package ...: %s\n"
+ "iversion ..: %s\n"
+ "version ...: %s\n",
+ nonnull (result->name),
+ nonnull (result->iversion),
+ nonnull (result->version));
+ printf ("reldate ...: %s\n", isotimestr (result->reldate));
+ printf ("created ...: %s\n", isotimestr (result->created));
+ printf ("retrieved .: %s\n", isotimestr (result->retrieved));
+ printf ("flags .....:%s%s%s%s%s%s%s\n",
+ result->warning? " warning" : "",
+ result->update? " update" : "",
+ result->urgent? " urgent" : "",
+ result->unknown? " unknown" : "",
+ result->tooold? " tooold" : "",
+ result->noinfo? " noinfo" : "",
+ result->error? " error" : "" );
+
+
+ gpgme_release (ctx);
+ return 0;
+}
diff --git a/tests/run-tofu.c b/tests/run-tofu.c
index ff55789..1f11c2d 100644
--- a/tests/run-tofu.c
+++ b/tests/run-tofu.c
@@ -14,7 +14,7 @@
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
@@ -99,6 +99,7 @@ main (int argc, char **argv)
const char *fpr;
const char *policystr = NULL;
gpgme_tofu_policy_t policy;
+ const char *s;
if (argc)
{ argc--; argv++; }
@@ -145,10 +146,31 @@ main (int argc, char **argv)
fail_if_err (err);
gpgme_set_protocol (ctx, protocol);
gpgme_set_armor (ctx, 1);
+
+
+ s = gpgme_get_ctx_flag (ctx, "no_such-flag");
+ if (s)
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag failed "
+ "(bad name not detected)\n");
+ exit (1);
+ }
+ s = gpgme_get_ctx_flag (ctx, "full-status");
+ if (!s || *s)
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag failed (wrong false)\n");
+ exit (1);
+ }
if (print_status)
{
gpgme_set_status_cb (ctx, status_cb, NULL);
gpgme_set_ctx_flag (ctx, "full-status", "1");
+ s = gpgme_get_ctx_flag (ctx, "full-status");
+ if (!s || strcmp (s, "1"))
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag fauled (wrong true)\n");
+ exit (1);
+ }
}
err = gpgme_get_key (ctx, fpr, &thekey, 0);
diff --git a/tests/run-verify.c b/tests/run-verify.c
index ebc20d9..3abc572 100644
--- a/tests/run-verify.c
+++ b/tests/run-verify.c
@@ -14,7 +14,7 @@
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 <http://www.gnu.org/licenses/>.
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
@@ -221,6 +221,7 @@ show_usage (int ex)
" --status print status lines from the backend\n"
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
+ " --sender MBOX use MBOX as sender address\n"
, stderr);
exit (ex);
}
@@ -239,6 +240,7 @@ main (int argc, char **argv)
gpgme_data_t msg = NULL;
gpgme_verify_result_t result;
int print_status = 0;
+ const char *sender = NULL;
if (argc)
{ argc--; argv++; }
@@ -273,6 +275,14 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_CMS;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--sender"))
+ {
+ argc--; argv++;
+ if (!argc)
+ show_usage (1);
+ sender = *argv;
+ argc--; argv++;
+ }
else if (!strncmp (*argv, "--", 2))
show_usage (1);
@@ -313,6 +323,12 @@ main (int argc, char **argv)
}
/* gpgme_set_ctx_flag (ctx, "raw-description", "1"); */
+ if (sender)
+ {
+ err = gpgme_set_sender (ctx, sender);
+ fail_if_err (err);
+ }
+
err = gpgme_data_new_from_stream (&sig, fp_sig);
if (err)
{