Package: gpgme
Homepage: https://gnupg.org/related_software/gpgme/
-Download: ftp://ftp.gnupg.org/gcrypt/gpgme/
+Download: https://gnupg.org/ftp/gcrypt/gpgme/
Repository: git://git.gnupg.org/gpgme.git
Maintainer: Werner Koch <wk@gnupg.org>
-Bug reports: https://bugs.gnupg.org (use category "gpgme")
+Bug reports: https://bugs.gnupg.org
Security related bug reports: security@gnupg.org
License (software): LGPLv2.1+
License (manual+tools): GPLv3+
+GPGME is free software. See the files COPYING for copying conditions.
+License copyright years may be listed using range notation, e.g.,
+2000-2013, indicating that every year in the range, inclusive, is a
+copyrightable year that would otherwise be listed individually.
+
+List of Copyright holders
+=========================
+
+ Copyright (C) 1991-2013 Free Software Foundation, Inc.
+ Copyright (C) 2000-2001 Werner Koch
+ Copyright (C) 2001-2017 g10 Code GmbH
+ Copyright (C) 2002 Klarälvdalens Datakonsult AB
+ Copyright (C) 2004-2008 Igor Belyi
+ Copyright (C) 2002 John Goerzen
+ Copyright (C) 2014, 2015 Martin Albrecht
+ Copyright (C) 2015 Ben McGinnes
+ Copyright (C) 2015-2016 Bundesamt für Sicherheit in der Informationstechnik
+ Copyright (C) 2016 Intevation GmbH
+
+
+Authors info
+============
+
FSF <gnu@gnu.org>
- Code taken from GnuPG 1.0: src/w32-util.c.
- Other from FSF projects: src/setenv.c, src/vasprintf.c,
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2014-09-24:878ul9w4j8.fsf@alice.fifthhorseman.net:
+Colin Watson <cjwatson@debian.org>
+2017-09-16:20170916031428.uypfrdojquvjteor@riva.ucam.org:
+Tobias Mueller <muelli@cryptobitch.de>
+2016-11-23:1479937342.11180.3.camel@cryptobitch.de:
Copyright 2001, 2002, 2012, 2013 g10 Code GmbH
+2017-12-12 Werner Koch <wk@gnupg.org>
+
+ Release 1.10.0.
+ + commit 6a42eb5f3809d5eb3767667c190b395d028886e7
+
+
+ Require libgpg-error 1.24 and libassuan 2.4.2.
+ + commit d4d04d6c0432b032f6ea23c8517fd6a5f623bb67
+ * src/util.h (GPG_ERR_FALSE): Remove due to newer libgpg-error.
+
+2017-12-11 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Don't use QDateTime::toSecsSinceEpoch.
+ + commit b61d0fbb74f04408dfe8637c719b97217e061a3c
+ * lang/qt/src/qgpgmequickjob.cpp (addSubkeyWorker)
+ (createWorker): Use toMSecsSinceEpoch instead toSecsSinceEpoch.
+
+2017-12-11 Werner Koch <wk@gnupg.org>
+
+ core,w32: Fix popping up of console windows due to gpgconf.
+ + commit 0a567a94d94cd93c5d88f5db802925c95f0974d0
+ * src/gpgme-w32spawn.c (my_spawn): Create w/o DETACHED_PROCESS.
+
+2017-12-07 Andre Heinecke <aheinecke@intevation.de>
+
+ cpp: Fix handling of lsig promotion.
+ + commit 1458adaea4acdcf7ebbead6668476fce92db5af8
+ * src/gpgsignkeyeditinteractor.cpp (SignKeyState): Add second
+ CONFIRM state.
+ (makeTable): Properly handle local_promote_okay.
+ (action): Handle CONFIRM2.
+
+ tests: Print userid signatures in run-keylist.
+ + commit 5ba1cbdf39efd90c7987bfc2bc030b6504e70076
+ * tests/run-keylist.c (main): Print UID signatures if there
+ are any.
+
+2017-12-04 Werner Koch <wk@gnupg.org>
+
+ core: Also check for a failed selftest in gpgm_data_new.
+ + commit 0c1244a2b7e30ab0610ae70166e1b5d0219782c3
+ * src/data.c (_gpgme_data_new): Check for failed selftest.
+ * tests/run-support.h (make_filename): Print a message on mallooc
+ failure.
+ (init_gpgme_basic): New.
+ * tests/run-identify.c (main): Call init_gpgme_basic becuase we do not
+ need to setup a protocol.
+ * tests/t-data.c: Define PGM and include run-support.h.
+ (make_filename): Remove.
+ (main): Call init_gpgme_basic.
+
+2017-12-04 Tobias Mueller <muelli@cryptobitch.de>
+
+ python: Default whence argument for Data() to SEEK_SET.
+ + commit 3cf9aedc92b6c65d2cb34037e52b9a299637d03b
+ * lang/python/gpgme.i: copied signature from gpgme.h and defaulted the
+ value to SEEK_SET.
+ * lang/python/tests/t-data.py: Added a test for no second argument
+
+2017-12-01 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Add job for quick commands.
+ + commit 7d1ac5d61de3c55bf7ff14997b4b111a0f90c177
+ * lang/qt/src/qgpgmequickjob.cpp,
+ lang/qt/src/qgpgmequickjob.h,
+ lang/qt/src/quickjob.h: New.
+ * lang/qt/src/Makefile.am,
+ lang/qt/src/protocol.h,
+ lang/qt/src/protocol_p.h,
+ lang/qt/src/job.cpp: Update accordingly.
+
+ cpp: Wrap create_key and create_subkey.
+ + commit 8e2d6c28a5e923f829b5a26d19d9d897949aa1fe
+ * lang/cpp/src/context.cpp,
+ lang/cpp/src/context.h (Context::startCreateKey)
+ (Context::createKey, Context::createSubkey)
+ (Context::startCreateSubkey): New.
+
+ Fix uid parsing for ldap keyserver.
+ + commit 651b3d8207cc7d85699f89fc4c21cb1243453aa8
+ * src/engine-gpg.c (gpg_keylist_preprocess): Check field count
+ for uid and add fallback.
+
+2017-11-30 Werner Koch <wk@gnupg.org>
+
+ tests: Add missing variable to gpgsm tests Makefile.
+ + commit f43016500774ab82f222249202bda6c463aaf63f
+ * tests/gpgsm/Makefile.am (GPG_AGENT): Set var. It is used later.
+
+2017-11-21 NIIBE Yutaka <gniibe@fsij.org>
+
+ tests: Make portability fix.
+ + commit c441fb73130f4c117094d7da4de9fe56f886e65d
+ * lang/python/tests/Makefile.am: Distinguish target and path.
+ * tests/gpg/Makefile.am: Ditto.
+ * tests/gpgsm/Makefile.am: Ditto.
+
+2017-11-14 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Fix IODeviceDataProvider with Process.
+ + commit 56b27b21d5f8dd95b9d6415c5e98b821774f3093
+ * lang/qt/src/dataprovider.cpp (blocking_read): Keep
+ reading if process is not atEnd.
+
+2017-10-12 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+ core: use getdents64 syscall on linux instead of getdents.
+ + commit 00daac15530eabed5e61d841b2df939c2242667c
+ * src/posix-io.c (get_max_fds): use getdents64 instead of getdents.
+
+2017-10-04 Werner Koch <wk@gnupg.org>
+
+ core: Allow disabling the use of SYS_getdents for Linux.
+ + commit 4632adf403611b50be2b4e852a4607070935d0e5
+ * configure.ac (USE_LINUX_GETDENTS): New ac_define. Add option
+ --disable-linux-getdents.
+ * src/posix-io.c: Make use of USE_LINUX_GETDENTS.
+
+2017-10-04 Colin Watson <cjwatson@debian.org>
+
+ core: Restore get_max_fds optimization on Linux.
+ + commit b5b996b1a142abb90296f5feadf0b5b19c59f738
+ * src/posix-io.c (get_max_fds): Restore Linux optimization, this time
+ using open/getdents/close rather than opendir/readdir/closedir.
+
+2017-09-04 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Add test for version info.
+ + commit bd5d470cef513b2f459316869b81267cde7a9f13
+ * lang/qt/tests/t-various.cpp (TestVarious::testVersion): New.
+
+ cpp: Fix version info comparison.
+ + commit 58d7bcead3394fa80c2a05d0d1e0fb4d9a1048b0
+ * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator<):
+ Fix logic.
+ * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator>):
+ New.
+ * NEWS: Mention added API
+
+2017-08-24 Werner Koch <wk@gnupg.org>
+
+ core: New context flag "auto-key-retrieve"
+ + commit 47f61df0704485b8165c9cf2a27ad57bcd864239
+ * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag
+ "auto-key-retrieve".
+ * src/context.h (gpgme_context): New field auto_key_retrieve.
+ * src/engine-backend.h (struct engine_ops): Add arg auto_key_retrieve
+ to field 'decrypt'.
+ * src/engine-gpg.c (gpg_decrypt): Add arg auto_key_retrieve and pass
+ option --auto-key-retrieve to gpg. Adjust all callers.
+ (gpg_verify): Ditto.
+ * src/engine-gpgsm.c (gpgsm_decrypt): Add dummy arg auto_key_retrieve.
+ * src/engine-uiserver.c (uiserver_decrypt): Ditto.
+ * tests/run-verify.c (main): Add option --auto-key-retrieve.
+
+ core: New public enum gpgme_keyorg_t.
+ + commit 9bde9144f0c2d0087799511e9b041dc945a4cfa8
+ * src/gpgme.h.in (gpgme_keyorg_t): New.
+ * src/keylist.c (parse_keyorg): New.
+ (keylist_colon_handler): Set key->ORIGIN.
+
+2017-08-24 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ gpgconf: Add more comments.
+ + commit 91e47d71652bd0f83b51089c343c3c4836bdfa8a
+ * src/engine-gpgconf.c (gpgconf_config_dir_cb, gpgconf_conf_dir):
+ Add comments.
+
+2017-08-23 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ Fix a couple of bugs pointed out by clang compiler warnings.
+ + commit bfb3a01a0c55aa327dcab061fa808672362cb09d
+ * src/engine-gpgconf.c (gpgconf_config_dir_cb): Fix cast.
+ * src/key.c (_gpgme_key_add_sig): Fix pointer reference.
+
+2017-08-21 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python: Support parallel build in tests.
+ + commit 57c12593082e4ad302041269f1c35f2fe7d2fb1a
+ * lang/python/tests/Makefile.am: Depend xcheck with all which was lost
+ due to the check hack.
+
+2017-08-21 Justus Winter <justus@g10code.com>
+
+ python: Improve keylist test.
+ + commit 70c8be9efe8de40bec0f0673589f3c9be7136674
+ * lang/python/tests/t-keylist.py: Check a keylist matching no keys.
+
+2017-08-16 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ doc: Add version information.
+ + commit b9b08e46934eea9083afb2eaf4bffa23d6c27801
+ * doc/gpgme.texi (since): New macro. Use it to add version
+ information to those APIs that are mentioned in the NEWS file.
+
+ doc: Clarify import keys operation further.
+ + commit 0ee7f4f178284dae153a59be710bc994820369e5
+ * doc/gpgme.texi (gpgme_op_import_keys): Further clarifications.
+
+ gpgconf: Fix some warnings.
+ + commit 3244d4daff892d5d3c39e78f4eb0934379beda2c
+ * tests/gpg/t-gpgconf.c (main): Fix warnings.
+ * src/engine-gpgconf.c (struct gpgconf_config_dir_s): New struct.
+ (gpgconf_config_dir_cb, gpgconf_conf_dir) Use it to fix warning.
+
+ gpgconf: Fix symbol export.
+ + commit 97a1abe72e73f85bbf922fa588d002a226db5459
+ * gpgme.def: Fix last change.
+ (gpgme_op_conf_save): Replace duplicate from c&p ...
+ (gpgme_op_conf_dir): ... with this.
+
+2017-08-15 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ NEWS: Add missing entry.
+ + commit fa3918598de35fef0bf626035d59ea36c53832b9
+
+
+ gpgconf: Add access to --list-dirs for non-default engine.
+ + commit 9f24e6c9010e171fd11c5cdac797cb8ce2e501dd
+ * src/engine-assuan.c (_gpgme_engine_ops_assuan): Add conf_dir.
+ * src/engine-g13.c (_gpgme_engine_ops_g13): Likewise.
+ * src/engine-gpg.c (_gpgme_engine_ops_gpg): Likewise.
+ * src/engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
+ * src/engine-spawn.c (_gpgme_engine_ops_spawn): Likewise.
+ * src/engine-uiserver.c (_gpgme_engine_ops_uiserver): Likewise.
+ * src/engine-backend.h (struct engine_ops): Likewise.
+ * src/engine-gpgconf.c (gpgconf_config_dir_cb, gpgconf_conf_dir):
+ New functions.
+ (struct engine_ops): Add gpgconf_conf_dir.
+ * src/engine.c (_gpgme_engine_op_conf_dir): New function.
+ * src/engine.h (_gpgme_engine_op_conf_dir): New prototype.
+ * src/gpgconf.c (gpgme_op_conf_dir): New function.
+ * src/gpgme.def (gpgme_op_conf_save): New symbol.
+ * src/gpgme.h.in (gpgme_op_conf_dir): New prototype.
+ * src/libgpgme.vers (gpgme_op_conf_dir): New symbol.
+ * tests/gpg/t-gpgconf.c (main): Test gpgme_op_conf_dir.
+
+2017-08-11 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ g10: Add new delete operations that allow more flags.
+ + commit a0cc6e01a8900b34cf231d8b5335ef3f85d01fdf
+ * NEWS: Document new interfaces.
+ * doc/gpgme.texi: Document new interfaces.
+ * src/gpgme.h.in (GPGME_DELETE_ALLOW_SECRET, GPGME_DELETE_FORCE,
+ gpgme_op_delete_ext_start, gpgme_op_delete_ext): New.
+ * src/delete.c (delete_start): Change allow_secret argument to flags.
+ (gpgme_op_delete_ext, gpgme_op_delete_ext_start): New functions.
+ * src/engine-backend.h (delete): Change allow_secret argument to flags.
+ * src/engine.c (_gpgme_engine_op_delete): Likewise.
+ * src/engine.h (_gpgme_engine_op_delete): Likewise (for prototype).
+ * src/engine-gpgsm.c (gpgsm_delete): Likewise.
+ * src/engine-gpg.c (gpg_delete): Likewise. Implement GPGME_DELETE_FORCE.
+ * src/gpgme.def (gpgme_op_delete_ext, gpgme_op_delete_ext_start): New.
+ * src/libgpgme.vers (gpgme_op_delete_ext, gpgme_op_delete_ext_start): New.
+
+2017-08-10 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ doc: Clarify import keys operation.
+ + commit dfb3ca85680534b3885ab04d3fba4752c5a6f998
+ * doc/gpgme.texi (gpgme_op_import_start): Fix grammar.
+ (gpgme_op_import_keys): Clarify some wording and fix result.
+ * src/import.c (gpgme_op_import_keys): Clarify comment.
+
+ doc: Add more tofu documentation.
+ + commit 274609baceda3378b21f84c3ae6a44806dad2dba
+ * doc/gpgme.texi (gpgme_tofu_info_t): Document structure.
+ (gpgme_sigsum_t): Document GPGME_SIGSUM_TOFU_CONFLICT.
+
+2017-07-27 Andre Heinecke <aheinecke@intevation.de>
+
+ core: Fix status parsing for decrypt + verify.
+ + commit d3796e4504a2b4f422de17d78f3acfe8dd199c9c
+ * src/decrypt.c (parse_status_error): Don't modify args.
+
+2017-07-26 Andre Heinecke <aheinecke@intevation.de>
+
+ cpp: Fix Key::isDeVs for subkeys.
+ + commit c7be41a5f850addceb2a95444bad2a31cdcd1ce5
+ * lang/cpp/src/key.cpp (Key::isDeVs): Check all subkeys.
+
+2017-07-13 Justus Winter <justus@g10code.com>
+
+ tests: Fix distcheck.
+ + commit 7fde780cc1773c6d3902d4f49a8d4aadbf3223d4
+ * tests/start-stop-agent: Remove backup file.
+
+ tests: Make agent spawning more robust.
+ + commit 9cd2b58dfb2c21cce64520cf4c726859b583d14e
+ * tests/gpgsm/Makefile.am (gpgsm.conf): Add agent-program directive.
+ * tests/start-stop-agent: Update agent-program directive.
+
+2017-07-12 Werner Koch <wk@gnupg.org>
+
+ tests: Fix printf compiler warning for an error case.
+ + commit 46d2e48105e0929ec38dd4106004dd60d941df9a
+ * tests/gpg/t-keylist.c (main): Cast DIM to int.
+
+ core: Return NO_SECKEY error code on decryption.
+ + commit ad0c5ab4cd8d3a1b11b37dc137b75a67aa26da37
+ * src/decrypt.c (op_data_t): Add flag any_no_seckey.
+ (_gpgme_decrypt_status_handler): Consult that flag.
+ (_gpgme_decrypt_status_handler): Set that flag.
+
+ core: Return CANCELED and BAD_PASSPHRASE error code on decryption.
+ + commit d37bc7e025cdc6228da45b2b527e9f3bfef71c71
+ * src/decrypt.c (op_data_t): Add field pkdecrypt_failed.
+ (_gpgme_decrypt_status_handler): Consult new field.
+ (parse_status_error): Handle some error codes.
+
+ core: Simplify parsing of STATUS_ERROR in decrypt.c.
+ + commit 87703dbb86ac8fd8abd23170f8038ea6e3dbde28
+ * src/decrypt.c (_gpgme_decrypt_status_handler): Factor some code out
+ to ...
+ (parse_status_error): new. Modernize parsing.
+
+2017-07-11 Justus Winter <justus@g10code.com>
+
+ python: Improve error handling.
+ + commit 1e68f93dc547ae75b921e43db35e3599de92e2cb
+ * NEWS: Update.
+ * lang/python/src/core.py (Context.__read__): New helper function.
+ (Context.encrypt): Attach partial results to exceptions.
+ (Context.decrypt): Likewise.
+ (Context.sign): Likewise.
+ (Context.verify): Likewise.
+ * lang/python/src/errors.py (GpgError): Move the core of GPGMEError to
+ this class, add a nicer interface for it. This makes the errors
+ thrown by this library more uniform, and allows us to track the
+ underlying error in synthesized high-level errors.
+ (GPGMEError): Simplify.
+ (...): Make sure to call the parent classes' constructor in all other
+ classes.
+
+2017-07-10 Andre Heinecke <aheinecke@intevation.de>
+
+ Add isDeVs to ostream operator.
+ + commit fe79eb8de3dc780eafb38a0a0a016748e764ff04
+ * lang/cpp/src/decryptionresult.cpp,
+ lang/cpp/src/verificationresult.cpp: Extend ostream operator
+ to include isDeVs.
+
+2017-06-12 Andre Heinecke <aheinecke@intevation.de>
+
+ cpp: Fix CMake config library name for GPGME.
+ + commit 5c53c702605b8d4458a14e6303cdc13f3b106efa
+ * lang/cpp/src/GpgmeppConfig.cmake.in.in: The link library
+ is of course also dynamic.
+
+2017-06-01 Justus Winter <justus@g10code.com>
+
+ Add flag 'is_de_vs' to decryption results and signatures.
+ + commit 05fa2a9c7764b28fdac35eb72631439df948ca0e
+ * NEWS: Update.
+ * lang/cpp/src/decryptionresult.cpp (DecryptionResult::isDeVs): New
+ function.
+ * lang/cpp/src/decryptionresult.h (DecryptionResult::isDeVs): New
+ prototype.
+ * lang/cpp/src/verificationresult.cpp (Signature::isDeVs): New
+ function.
+ * lang/cpp/src/verificationresult.h (Signature::isDeVs): New
+ prototype.
+ * lang/python/src/results.py (DecryptResult): Turn field 'is_de_vs'
+ into a boolean.
+ (Signature): Likewise.
+ * src/decrypt.c (_gpgme_decrypt_status_handler): Handle the new
+ compliance status line.
+ * src/verify.c (_gpgme_verify_status_handler): Likewise.
+ * src/gpgme.h.in (gpgme_status_code_t): Add new status codes for the
+ new status lines.
+ * src/keylist.c (parse_pub_field18): Move function to 'util.h'.
+ (keylist_colon_handler): Adapt callsites.
+ * src/status-table.c (status_table): Add new status lines.
+ * src/util.h (PARSE_COMPLIANCE_FLAGS): New macro. This used to be
+ 'parse_pub_field18', but turned into a macro to make it polymorphic.
+
+2017-05-18 Justus Winter <justus@g10code.com>
+
+ python: Fix build in certain cases.
+ + commit 84a203e60b9935bd8536cd2832fbc55d7f011341
+ * lang/python/setup.py.in: Prepend the Python build dir to the list of
+ include directories so that it takes precedence over any other include
+ directory.
+
+2017-05-10 Justus Winter <justus@g10code.com>
+
+ tests: Remove remnants of 'check-local'.
+ + commit a9b4c0ad0d1085ff76742e44cf0cf926e89d1f4c
+ * tests/gpgsm/Makefile.am (check-local): Drop rule and the dependency
+ on it.
+
+ python: Fix test environment creation.
+ + commit 6b4dd3b929ac23271bfa96edb9dbb142eca0a30f
+ * lang/python/tests/Makefile.am (pubring-stamp): Do not depend on the
+ configuration files, this can trigger superfluous rebuilds.
+
+ tests: Make sure to kill all previously running daemons.
+ + commit a226eca84670ef4e171c3a54e7caefb3a89254a4
+ * lang/python/tests/Makefile.am: Kill all previously running daemons
+ before creating the private key store.
+ * lang/qt/tests/Makefile.am: Likewise.
+ * tests/gpg/Makefile.am: Likewise.
+ * tests/gpgsm/Makefile.am: Likewise.
+
+ tests: Harmonize test suites.
+ + commit 15adff073bb89dc032d8342cfbbdad2850943f52
+ * lang/python/tests/Makefile.am: Create test environment as part of
+ 'make all'.
+ * tests/gpg/Makefile.am: Make sure the private keystore is created
+ first.
+ * tests/gpgsm/Makefile.am: Create test environment as part of
+ 'make all'. Make sure the private keystore is created
+ first.
+
+ qt: Stop agent on clean.
+ + commit 093b5497b7231590ce91ccf73ba64ebc0757f9e9
+ * lang/qt/tests/Makefile.am (clean-local): Stop agent.
+
+2017-05-10 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Add a missing include <functional>
+ + commit 5e27bf98b4c48cf6a239bcc94b7b67515ff339e7
+ * lang/qt/src/qgpgmenewcryptoconfig.cpp: Include functional.
+
+ qt: Undeprecate API that I find useful.
+ + commit cc2ef3d07c0d261bb9e8e8c0f2706e1a08e4ec53
+ * lang/qt/src/decryptjob.h,
+ lang/qt/src/decryptverifyjob.h,
+ lang/qt/src/signencryptjob.h,
+ lang/qt/src/verifydetachedjob.h,
+ lang/qt/src/verifyopaquejob.h: Undeprecate ByteArray based API.
+
+ qt, tests: Don't use internal API.
+ + commit b56f398eff4e3e70dea714c3174a5512dd9bcf33
+ * lang/qt/tests/t-encrypt.cpp, lang/qt/tests/t-tofuinfo.cpp:
+ Only use exported API.
+
+2017-05-03 Andre Heinecke <aheinecke@intevation.de>
+
+ core: Don't split gpgconf strings on comma.
+ + commit df4eb611e33dcab7bebf07b13734c7db7ccf40da
+ * src/engine-gpgconf.c (gpgconf_parse_option): Don't split
+ strings on comma.
+
+2017-04-25 Andre Heinecke <aheinecke@intevation.de>
+
+ qt, cpp: Add additional copyright BSI notes.
+ + commit 28734240e2a2ce67b64df55364f35e1648376311
+ * lang/cpp/Makefile.am,
+ lang/cpp/src/Makefile.am,
+ lang/cpp/src/callbacks.cpp,
+ lang/cpp/src/callbacks.h,
+ lang/cpp/src/configuration.cpp,
+ lang/cpp/src/configuration.h,
+ lang/cpp/src/context_glib.cpp,
+ lang/cpp/src/context_p.h,
+ lang/cpp/src/context_qt.cpp,
+ lang/cpp/src/context_vanilla.cpp,
+ lang/cpp/src/data_p.h,
+ lang/cpp/src/decryptionresult.cpp,
+ lang/cpp/src/decryptionresult.h,
+ lang/cpp/src/defaultassuantransaction.cpp,
+ lang/cpp/src/defaultassuantransaction.h,
+ lang/cpp/src/editinteractor.cpp,
+ lang/cpp/src/editinteractor.h,
+ lang/cpp/src/encryptionresult.cpp,
+ lang/cpp/src/encryptionresult.h,
+ lang/cpp/src/engineinfo.cpp,
+ lang/cpp/src/engineinfo.h,
+ lang/cpp/src/error.h,
+ lang/cpp/src/eventloopinteractor.cpp,
+ lang/cpp/src/eventloopinteractor.h,
+ lang/cpp/src/exception.cpp,
+ lang/cpp/src/exception.h,
+ lang/cpp/src/global.h,
+ lang/cpp/src/gpgadduserideditinteractor.cpp,
+ lang/cpp/src/gpgadduserideditinteractor.h,
+ lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
+ lang/cpp/src/gpgagentgetinfoassuantransaction.h,
+ lang/cpp/src/gpgmefw.h,
+ lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
+ lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
+ lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
+ lang/cpp/src/gpgsetownertrusteditinteractor.h,
+ lang/cpp/src/gpgsignkeyeditinteractor.cpp,
+ lang/cpp/src/gpgsignkeyeditinteractor.h,
+ lang/cpp/src/importresult.cpp,
+ lang/cpp/src/importresult.h,
+ lang/cpp/src/interfaces/assuantransaction.h,
+ lang/cpp/src/interfaces/dataprovider.h,
+ lang/cpp/src/interfaces/passphraseprovider.h,
+ lang/cpp/src/interfaces/progressprovider.h,
+ lang/cpp/src/keygenerationresult.cpp,
+ lang/cpp/src/keygenerationresult.h,
+ lang/cpp/src/keylistresult.cpp,
+ lang/cpp/src/keylistresult.h,
+ lang/cpp/src/notation.h,
+ lang/cpp/src/result.h,
+ lang/cpp/src/result_p.h,
+ lang/cpp/src/scdgetinfoassuantransaction.cpp,
+ lang/cpp/src/scdgetinfoassuantransaction.h,
+ lang/cpp/src/signingresult.cpp,
+ lang/cpp/src/signingresult.h,
+ lang/cpp/src/trustitem.cpp,
+ lang/cpp/src/trustitem.h,
+ lang/cpp/src/util.h,
+ lang/cpp/src/verificationresult.cpp,
+ lang/cpp/src/verificationresult.h,
+ lang/cpp/src/vfsmountresult.cpp,
+ lang/qt/Makefile.am,
+ lang/qt/doc/Makefile.am,
+ lang/qt/src/Makefile.am,
+ lang/qt/src/defaultkeygenerationjob.h,
+ lang/qt/tests/Makefile.am: Add missing copyright.
+
+ Change copyright from Intevation to BSI.
+ + commit 70035834326d0d04a5904ae01bc3757e577facf4
+ * lang/cpp/src/gpggencardkeyinteractor.cpp,
+ lang/cpp/src/gpggencardkeyinteractor.h,
+ lang/cpp/src/gpgmepp_export.h,
+ lang/cpp/src/swdbresult.cpp,
+ lang/cpp/src/swdbresult.h,
+ lang/cpp/src/tofuinfo.cpp,
+ lang/cpp/src/tofuinfo.h,
+ lang/qt/src/abstractimportjob.h,
+ lang/qt/src/adduseridjob.h,
+ lang/qt/src/changeexpiryjob.h,
+ lang/qt/src/changeownertrustjob.h,
+ lang/qt/src/changepasswdjob.h,
+ lang/qt/src/cryptoconfig.cpp,
+ lang/qt/src/cryptoconfig.h,
+ lang/qt/src/dataprovider.cpp,
+ lang/qt/src/dataprovider.h,
+ lang/qt/src/decryptjob.h,
+ lang/qt/src/decryptverifyjob.h,
+ lang/qt/src/deletejob.h,
+ lang/qt/src/dn.cpp,
+ lang/qt/src/dn.h,
+ lang/qt/src/downloadjob.h,
+ lang/qt/src/encryptjob.h,
+ lang/qt/src/exportjob.h,
+ lang/qt/src/hierarchicalkeylistjob.h,
+ lang/qt/src/importfromkeyserverjob.h,
+ lang/qt/src/importjob.h,
+ lang/qt/src/job.cpp,
+ lang/qt/src/job.h,
+ lang/qt/src/keyformailboxjob.h,
+ lang/qt/src/keygenerationjob.h,
+ lang/qt/src/keylistjob.h,
+ lang/qt/src/listallkeysjob.h,
+ lang/qt/src/multideletejob.h,
+ lang/qt/src/protocol.h,
+ lang/qt/src/protocol_p.h,
+ lang/qt/src/qgpgme_export.h,
+ lang/qt/src/qgpgmeadduseridjob.cpp,
+ lang/qt/src/qgpgmeadduseridjob.h,
+ lang/qt/src/qgpgmebackend.cpp,
+ lang/qt/src/qgpgmebackend.h,
+ lang/qt/src/qgpgmechangeexpiryjob.cpp,
+ lang/qt/src/qgpgmechangeexpiryjob.h,
+ lang/qt/src/qgpgmechangeownertrustjob.cpp,
+ lang/qt/src/qgpgmechangeownertrustjob.h,
+ lang/qt/src/qgpgmechangepasswdjob.cpp,
+ lang/qt/src/qgpgmechangepasswdjob.h,
+ lang/qt/src/qgpgmedecryptjob.cpp,
+ lang/qt/src/qgpgmedecryptjob.h,
+ lang/qt/src/qgpgmedecryptverifyjob.cpp,
+ lang/qt/src/qgpgmedecryptverifyjob.h,
+ lang/qt/src/qgpgmedeletejob.cpp,
+ lang/qt/src/qgpgmedeletejob.h,
+ lang/qt/src/qgpgmedownloadjob.cpp,
+ lang/qt/src/qgpgmedownloadjob.h,
+ lang/qt/src/qgpgmeencryptjob.cpp,
+ lang/qt/src/qgpgmeencryptjob.h,
+ lang/qt/src/qgpgmeexportjob.cpp,
+ lang/qt/src/qgpgmeexportjob.h,
+ lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
+ lang/qt/src/qgpgmeimportfromkeyserverjob.h,
+ lang/qt/src/qgpgmeimportjob.cpp,
+ lang/qt/src/qgpgmeimportjob.h,
+ lang/qt/src/qgpgmekeyformailboxjob.cpp,
+ lang/qt/src/qgpgmekeyformailboxjob.h,
+ lang/qt/src/qgpgmekeygenerationjob.cpp,
+ lang/qt/src/qgpgmekeygenerationjob.h,
+ lang/qt/src/qgpgmekeylistjob.cpp,
+ lang/qt/src/qgpgmekeylistjob.h,
+ lang/qt/src/qgpgmelistallkeysjob.cpp,
+ lang/qt/src/qgpgmelistallkeysjob.h,
+ lang/qt/src/qgpgmenewcryptoconfig.cpp,
+ lang/qt/src/qgpgmenewcryptoconfig.h,
+ lang/qt/src/qgpgmerefreshkeysjob.cpp,
+ lang/qt/src/qgpgmerefreshkeysjob.h,
+ lang/qt/src/qgpgmesecretkeyexportjob.cpp,
+ lang/qt/src/qgpgmesecretkeyexportjob.h,
+ lang/qt/src/qgpgmesignencryptjob.cpp,
+ lang/qt/src/qgpgmesignencryptjob.h,
+ lang/qt/src/qgpgmesignjob.cpp,
+ lang/qt/src/qgpgmesignjob.h,
+ lang/qt/src/qgpgmesignkeyjob.cpp,
+ lang/qt/src/qgpgmesignkeyjob.h,
+ lang/qt/src/qgpgmetofupolicyjob.cpp,
+ lang/qt/src/qgpgmetofupolicyjob.h,
+ lang/qt/src/qgpgmeverifydetachedjob.cpp,
+ lang/qt/src/qgpgmeverifydetachedjob.h,
+ lang/qt/src/qgpgmeverifyopaquejob.cpp,
+ lang/qt/src/qgpgmeverifyopaquejob.h,
+ lang/qt/src/qgpgmewkspublishjob.cpp,
+ lang/qt/src/qgpgmewkspublishjob.h,
+ lang/qt/src/refreshkeysjob.h,
+ lang/qt/src/signencryptjob.h,
+ lang/qt/src/signjob.h,
+ lang/qt/src/signkeyjob.h,
+ lang/qt/src/specialjob.h,
+ lang/qt/src/threadedjobmixin.cpp,
+ lang/qt/src/threadedjobmixin.h,
+ lang/qt/src/tofupolicyjob.h,
+ lang/qt/src/verifydetachedjob.h,
+ lang/qt/src/verifyopaquejob.h,
+ lang/qt/src/wkspublishjob.h,
+ lang/qt/tests/run-keyformailboxjob.cpp,
+ lang/qt/tests/t-config.cpp,
+ lang/qt/tests/t-encrypt.cpp,
+ lang/qt/tests/t-keylist.cpp,
+ lang/qt/tests/t-keylocate.cpp,
+ lang/qt/tests/t-ownertrust.cpp,
+ lang/qt/tests/t-support.cpp,
+ lang/qt/tests/t-support.h,
+ lang/qt/tests/t-tofuinfo.cpp,
+ lang/qt/tests/t-various.cpp,
+ lang/qt/tests/t-verify.cpp,
+ lang/qt/tests/t-wkspublish.cpp,
+ tests/gpg/t-encrypt-mixed.c,
+ tests/gpg/t-thread-keylist-verify.c,
+ tests/gpg/t-thread-keylist.c,
+ tests/run-decrypt.c: Change Intevation GmbH copyright to BSI.
+
+2017-04-24 Andre Heinecke <aheinecke@intevation.de>
+
+ doc: Improve doc on passphrase_cb / pinentry mode.
+ + commit 8d61aba1fe0379ba14494f8ae2011ba531554ef4
+ * doc/gpgme.texi (Passphrase Callback): Mention pinentry_mode and
+ restrictions.
+ (Pinentry Mode): Fix wording and clarify versions that need
+ loopback mode for passphrase_cb to work.
+
+2017-04-24 Justus Winter <justus@g10code.com>
+
+ tests: Update encrypted sample files.
+ + commit ac28e66f46132ae4a854d04b2f17acd4d55e4296
+ * tests/gpg/cipher-1.asc: Update file.
+ * tests/gpg/cipher-2.asc: Likewise.
+
+2017-04-11 Justus Winter <justus@g10code.com>
+
+ python: Skip TOFU test if not supported by GnuPG.
+ + commit 979d48e823357af9999a2adb34d75adaade8dec2
+ * lang/python/tests/support.py (have_tofu_support): New function.
+ * lang/python/tests/t-quick-key-manipulation.py: Skip TOFU test if not
+ supported by GnuPG.
+
+2017-04-11 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python: use autoconf pre-processor when building via autoconf.
+ + commit a827382cafe7f1425455dcc8bf5ef049172eb493
+ * configure.ac: Add AC_PROG_CPP.
+ * lang/python/Makefile.am: Set CPP environment for setup.py to use.
+
+ python: fix run-tests missing python_libdir.
+ + commit d785c053a982bddefd7014dc6856d1af345fe9fb
+ * lang/python/tests/run-tests.py: Set python_libdir if --python-libdir
+ is set.
+
+2017-04-10 Justus Winter <justus@g10code.com>
+
+ python: Fix distcheck.
+ + commit db476e923415f8e458720aaafde7234b802a33ab
+ * lang/python/Makefile.am (uninstall-local): Explicitly request the
+ scheme 'posix_prefix'. On Python2.7 the default scheme is
+ 'posix_local', breaking distcheck.
+
+2017-04-10 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python: Support alternatate libdir for tests.
+ + commit 3cc90b67fa970e716c8672ec5c5f591fa11ab216
+ * lang/python/tests/run-tests.py: Add --python-libdir optional
+ parameter.
+
+ python: Read gpg-error.h using the pre-processor.
+ + commit 7309ce6f5f7c86570953a141965d4f54cd9ad9a0
+ * lang/python/setup.py.in: Read gpg-error.h using the pre-processor.
+
+ python: Remove unneeded stats copy.
+ + commit df8433bffa9e669897243f08edf7845762250e4a
+ * lang/python/setup.py.in: errors.i, gpgme.h are generated and always
+ newer than the original.
+
+ python: Remove usage of PYTHON_VERSIONS.
+ + commit 25e6444b3f4601c7821beab06bc4520deacb007b
+ * configure.ac: Remove PYTHON_VERSIONS subst.
+ * lang/python/Makefile.am: Use basename of python as builddir prefix.
+ * lang/python/tests/run-tests.py: Likewise.
+
+ tests: Do not use check-local magic as dependency.
+ + commit ebefc6cbf937d14ced65f7ded79c4ba901507d23
+ * tests/gpg/Makefile.am: Use BUILT_SOURCES instead of check-local
+ and initial.test.
+ * lang/qt/tests/Makefile.am: Ditto.
+
+ python: support .pydistutils.cfg mode.
+ + commit 365c649ad073f2697438dc014160943ae31a1447
+ * lang/python/setup.py.in: Do not parse arguments.
+
+2017-04-07 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python: simplify build, some fixups.
+ + commit 49195c487e6c923f7137f092b982e7d833d98de6
+ * lang/python/gpg/version.py.in: Rename to lang/python/version.py.in.
+ configure.ac: Generate version.py.in in lang/python.
+ * lang/python/MANIFEST.in: Include version.py explicitly.
+ * lang/python/gpg: Rename to 'src'.
+ * lang/python/Makefile.am: Do not copy source files, do not use absolute
+ directories, support lib64 in uninstall, clean also dist directory, use
+ symlink for gpg src.
+ * lang/python/setup.py.in: Use builddir, copy sources into builddir,
+ copy version.py into module.
+
+2017-04-05 Justus Winter <justus@g10code.com>
+
+ python: Fix vpath builds, fix distcheck.
+ + commit e7d9c0c3d773f826dbd2ed417d04e25c410f3374
+ * lang/python/gpgme-h-clean.py: Delete file.
+ * lang/python/MANIFEST.in: Adapt accordingly.
+ * lang/python/Makefile.am (EXTRA_DIST): Likewise.
+ (COPY_FILES_GPG): Bring variable back.
+ (copystamp): Copy files.
+ (clean-local): Delete copied files.
+ (install-exec-local): Do not create and install list of installed
+ files.
+ (uninstall-local): Instead, create some explicit rules to uninstall
+ the extension.
+ * lang/python/setup.py.in: Parse arguments. Locate files either in
+ the source directory, or in the build base directory. Inline the code
+ from 'gpgme-h-clean.py'. Copy 'helpers.c', add source directory as
+ include directory.
+
+2017-04-05 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python: Generate files into build directory.
+ + commit 801d7d8c5dd530d26ad6c4bcc94d986e6e022da4
+ * lang/python/setup.py.in: Generate files within BuildExtFirstHack
+ adjust build flags at this point instead of global.
+ * lang/python/Makefile.am: Remove logic of separate source directory per
+ python version in favor of build directory.
+ * lang/python/tests/run-tests.py: Adjust build directory location.
+
+2017-04-03 Pietro Cerutti <gahr@gahr.ch>
+
+ FreeBSD's closefrom(2) does not return errors.
+ + commit 50565982cdd502c3852fcc6f598932bd32b5cdc3
+
+
+2017-04-03 Igor Gnatenko <ignatenkobrain@fedoraproject.org>
+
+ qt: pass fmt to gpgrt_asprintf()
+ + commit 5d4f977dac542340c877fdd4b1304fa8f6e058e6
+ * lang/qt/src/dn.cpp (parse_dn_part): Add fmt argument instead of
+ using name directly.
+
+ GnuPG-Bug-Id: 3023
+
+2017-03-30 Andre Heinecke <aheinecke@intevation.de>
+
+ python: Don't treat skipped tests as error.
+ + commit f8a9ecc6290ebd73fa36647cdfca285fe4d94a62
+ * lang/python/tests/run-tests.py (failed): Don't count skipped tests
+ for the return code.
+
+2017-03-30 Justus Winter <justus@g10code.com>
+
+ python: Fix skipping tests if running with GnuPG < 2.1.12.
+ + commit 159505a28864399cc5405d9f85f35ab011a3259e
+ * final.py: Import 'support.py' for the side-effect of checking the
+ GnuPG version.
+ * t-data.py: Likewise.
+ * t-protocol-assuan.py: Likewise.
+ * t-wrapper.py: Likewise.
+ * t-callbacks.py: Avoid warning about 'support' being unused.
+ * t-edit.py: Likewise.
+ * t-encrypt-sym.py: Likewise.
+ * t-file-name.py: Likewise.
+ * t-idiomatic.py: Likewise.
+ * t-sig-notation.py: Likewise.
+ * t-trustlist.py: Likewise.
+ * t-verify.py: Likewise.
+ * t-wait.py: Likewise.
+ * t-keylist-from-data.py: Trim unused imports.
+
+2017-03-30 Andre Heinecke <aheinecke@intevation.de>
+
+ qt: Handle if gpg does not support tofu in test.
+ + commit 2c063a8d60418ee59ae80da221420c6f3fa19abb
+ * lang/qt/src/t-tofuinfo.cpp (TestTofuInfo::testSupported): Treat
+ it as unsupported if secret keylisting already fails.
+
+2017-03-29 Alon Bar-Lev <alon.barlev@gmail.com>
+
+ python,build: Reinstate prepare target.
+ + commit 9786e3a96e6772166f3523e74a748b9db20fae7c
+ * lang/python/Makefile.am: Fix 'prepare' target.
+ * lang/python/setup.py.in: Use 'abs_top_builddir' instead of guessing
+ the path.
+
+2017-03-28 Justus Winter <justus@g10code.com>
+
+ tests: Run the threading tests only on UNIX.
+ + commit 7e9f7752c992f957ccfde3b274865c633096e3bb
+ * tests/gpg/Makefile.am (tests_unix): Add 't-thread-keylist' and
+ 't-thread-keylist-verify'.
+ (c_tests): Drop them here.
+
+ tests: Make error message more helpful.
+ + commit a13e4abe9463579ef23d1acea39a093abfc6528d
+ * tests/gpg/t-keylist.c (main): Print number of returned and expected
+ keys.
+
2017-03-28 Werner Koch <wk@gnupg.org>
Release 1.9.0.
<cpp>: Bump LT version to C10/A4/R0.
<qt>: Bump LT version to C9/A2/R0.
+2017-03-28 Andre Heinecke <aheinecke@intevation.de>
+
+ Revert "qt: Disable testEncryptDecryptNowrap"
+ + commit a2ccb3172896a90bc27c95964ef94bd7c0924802
+ This reverts commit 57d60b20f16dd5f1bccbbcaa0a6ed75a554a6414.
+
+2017-03-28 Werner Koch <wk@gnupg.org>
+
core: Prepare for new key listing data send by gpg.
+ commit 813ae5fa2d712aa9679b791c67c9c1c43d36ffe4
* src/gpgme.h.in (gpgme_user_id_t): New fields 'origin' and
$(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/gpg/version.py.in COPYING \
- COPYING.LESSER THANKS TODO build-aux/compile \
+ 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 \
build-aux/missing build-aux/mkinstalldirs \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = lang/python/gpg/version.py
+CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
distclean-hdr:
-rm -f config.h stamp-h1
-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:
-rm -f *.lo
+Noteworthy changes in version 1.10.0 (2017-12-12)
+-------------------------------------------------
+
+ * Now returns more specific error codes for decryption to distinguish
+ between bad passphrase, user canceled, and no secret key.
+
+ * Now returns key origin information if available.
+
+ * Added context flag "auto-key-retrieve" to selectively enable the
+ corresponding gpg option.
+
+ * Added flag is_de_vs to decryption and verify results.
+
+ * py: Use SEEK_SET as default for data.seek.
+
+ * cpp: Various new APIs.
+
+ * Reduced spawn overhead on Linux again. Added new configure option
+ --disable-linux-getdents to disable this feature for very old
+ Linux versions.
+
+ * Improved the Python bindings build system.
+
+ * Made the test suite less fragile.
+
+ * Interface changes relative to the 1.9.0 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgme_decrypt_result_t EXTENDED: New field 'is_de_vs'.
+ gpgme_signature_t EXTENDED: New field 'is_de_vs'.
+ gpgme_keyorg_t NEW.
+ gpgme_op_delete_ext NEW.
+ gpgme_op_delete_ext_start NEW.
+ GPGME_DELETE_ALLOW_SECRET NEW.
+ GPGME_DELETE_FORCE NEW.
+ gpgme_op_conf_dir NEW.
+ gpgme_set_ctx_flag EXTENDED: New flag 'auto-key-retrieve'.
+ cpp: DecryptionResult::isDeVs NEW.
+ cpp: Signature::isDeVs NEW.
+ cpp: EngineInfo::Version::operator> NEW.
+ cpp: Context::createKey NEW.
+ cpp: Context::startCreateKey NEW.
+ cpp: Context::createSubkey NEW.
+ cpp: Context::startCreateSubkey NEW.
+ qt: QuickJob NEW.
+ py: DecryptResult EXTENDED: New boolean field 'is_de_vs'.
+ py: Signature EXTENDED: New boolean field 'is_de_vs'.
+ py: GpgError EXTENDED: Partial results in 'results'.
+
+ [c=C30/A19/R0 cpp=C11/A5/R0 qt=C10/A3/R0]
+
+
Noteworthy changes in version 1.9.0 (2017-03-28)
------------------------------------------------
* Many smaller bug fixes.
-
* Interface changes relative to the 1.8.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_op_createkey CHANGED: Meaning of 'expire' parameter.
applications. GPGME provides a high-level crypto API for encryption,
decryption, signing, signature verification and key management.
-GPGME comes with language bindings for Common Lisp, C++, QT, Python2
+GPGME comes with language bindings for Common Lisp, C++, QT, Python2,
and Python 3.
-GPGME uses GnuPG and GpgSM as its backends to support OpenPGP and the
+GPGME uses GnuPG as its backend to support OpenPGP and the
Cryptographic Message Syntax (CMS).
See the files COPYING, COPYING.LESSER, and each file for copyright and
Check that you have unmodified sources. See below on how to do this.
Don't skip it - this is an important step!
-To build GPGME, you need to install libgpg-error (>= 1.11) and
-Libassuan (>= 2.0.2).
+To build GPGME, you need to install libgpg-error (>= 1.24) and
+Libassuan (>= 2.4.2).
-For support of the OpenPGP protocol (default), you should use the
-latest version of GnuPG (>= 1.4) , available at:
-ftp://ftp.gnupg.org/gcrypt/gnupg/. For support of the CMS
-(Cryptographic Message Syntax) protocol and lot of other features, you
-need a GnuPG version >= 2.0.
+For support of the OpenPGP and the CMS protocols, you should use the
+latest version of GnuPG (>= 2.1.18) , available at:
+https://gnupg.org/ftp/gcrypt/gnupg/.
-For building the GIT version of GPGME please see the file README.GIT
+For building the Git version of GPGME please see the file README.GIT
for more information.
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
- this signature is either of:
+ this signature is at least one of:
- rsa2048/4F25E3B6 2011-01-12 [expires: 2019-12-31]
+ rsa2048 2011-01-12 [expires: 2019-12-31]
Key fingerprint = D869 2123 C406 5DEA 5E0F 3AB5 249B 39D2 4F25 E3B6
Werner Koch (dist sig)
- rsa2048/E0856959 2014-10-29 [expires: 2019-12-31]
+ rsa2048 2014-10-29 [expires: 2019-12-31]
Key fingerprint = 46CC 7308 65BB 5C78 EBAB ADCF 0437 6F3E E085 6959
David Shaw (GnuPG Release Signing Key) <dshaw 'at' jabberwocky.com>
- rsa2048/33BD3F06 2014-10-29 [expires: 2016-10-28]
+ rsa2048 2014-10-29 [expires: 2020-10-30]
Key fingerprint = 031E C253 6E58 0D8E A286 A9F2 2071 B08A 33BD 3F06
NIIBE Yutaka (GnuPG Release Key) <gniibe 'at' fsij.org>
- rsa2048/7EFD60D9 2014-10-19 [expires: 2020-12-31]
- Key fingerprint = D238 EA65 D64C 67ED 4C30 73F2 8A86 1B1C 7EFD 60D9
- Werner Koch (Release Signing Key)
-
- rsa3072/4B092E28 2017-03-17 [expires: 2027-03-15]
+ rsa3072 2017-03-17 [expires: 2027-03-15]
Key fingerprint = 5B80 C575 4298 F0CB 55D8 ED6A BCEF 7E29 4B09 2E28
Andre Heinecke (Release Signing Key)
- You may retrieve these files from the keyservers using this command
-
- gpg --recv-keys 249B39D24F25E3B6 04376F3EE0856959 \
- 2071B08A33BD3F06 8A861B1C7EFD60D9 BCEF7E294B092E28
-
- The keys are also available at https://gnupg.org/signature_key.html
+ The keys are available at <https://gnupg.org/signature_key.html>
and in released GnuPG tarballs in the file g10/distsigkey.gpg .
You have to make sure that these are really the desired keys and
not faked one. You should do this by comparing the fingerprints
])
dnl LIST_MEMBER()
-dnl Check wether an element ist contained in a list. Set `found' to
+dnl Check whether an element ist contained in a list. Set `found' to
dnl `1' if the element is found in the list, to `0' otherwise.
AC_DEFUN([LIST_MEMBER],
[
#! /bin/sh
# autogen.sh
-# Copyright (C) 2003, 2014 g10 Code GmbH
+# Copyright (C) 2003, 2014, 2017 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# configure it for the respective package. It is maintained as part of
# GnuPG and source copied by other packages.
#
-# Version: 2014-01-10
+# Version: 2017-01-17
configure_ac="configure.ac"
info () {
if [ -z "${SILENT}" ]; then
- echo "autogen.sh:" "$*"
+ echo "autogen.sh:" "$*" >&2
fi
}
DIE=no
FORCE=
SILENT=
+PRINT_HOST=no
+PRINT_BUILD=no
tmp=$(dirname "$0")
tsdir=$(cd "${tmp}"; pwd)
+version_parts=3
if [ -n "${AUTOGEN_SH_SILENT}" ]; then
SILENT=" --silent"
fi
if test x"$1" = x"--help"; then
- echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]"
+ echo "usage: ./autogen.sh [OPTIONS] [ARGS]"
+ echo " Options:"
+ echo " --silent Silent operation"
+ echo " --force Pass --force to autoconf"
+ echo " --find-version Helper for configure.ac"
+ echo " --build-TYPE Configure to cross build for TYPE"
+ echo " --print-host Print only the host triplet"
+ echo " --print-build Print only the build platform triplet"
+ echo ""
+ echo " ARGS are passed to configure in --build-TYPE mode."
+ echo " Configuration for this script is expected in autogen.rc"
exit 0
fi
if test x"$1" = x"--silent"; then
FORCE=" --force"
shift
fi
+if test x"$1" = x"--print-host"; then
+ PRINT_HOST=yes
+ shift
+fi
+if test x"$1" = x"--print-build"; then
+ PRINT_BUILD=yes
+ shift
+fi
# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces
myhost=""
myhostsub=""
case "$1" in
+ --find-version)
+ myhost="find-version"
+ SILENT=" --silent"
+ shift
+ ;;
--build-w32)
myhost="w32"
shift
. "$HOME/.gnupg-autogen.rc"
fi
+
+# **** FIND VERSION ****
+# This is a helper for the configure.ac M4 magic
+# Called
+# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]
+# returns a complete version string with automatic beta numbering.
+if [ "$myhost" = "find-version" ]; then
+ package="$1"
+ major="$2"
+ minor="$3"
+ micro="$4"
+
+ if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then
+ echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2
+ exit 1
+ fi
+
+ case "$version_parts" in
+ 2)
+ matchstr1="$package-$major.[0-9]*"
+ matchstr2="$package-$major-base"
+ vers="$major.$minor"
+ ;;
+ *)
+ matchstr1="$package-$major.$minor.[0-9]*"
+ matchstr2="$package-$major.$minor-base"
+ vers="$major.$minor.$micro"
+ ;;
+ esac
+
+ beta=no
+ if [ -e .git ]; then
+ ingit=yes
+ tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
+ tmp=$(echo "$tmp" | sed s/^"$package"//)
+ if [ -n "$tmp" ]; then
+ tmp=$(echo "$tmp" | sed s/^"$package"// \
+ | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
+ else
+ tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
+ | awk -F- '$4!=0{print"-beta"$4}')
+ fi
+ [ -n "$tmp" ] && beta=yes
+ rev=$(git rev-parse --short HEAD | tr -d '\n\r')
+ rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
+ else
+ ingit=no
+ beta=yes
+ tmp="-unknown"
+ rev="0000000"
+ rvd="0"
+ fi
+
+ echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:"
+ exit 0
+fi
+# **** end FIND VERSION ****
+
+
+if [ ! -f "$tsdir/build-aux/config.guess" ]; then
+ fatal "$tsdir/build-aux/config.guess not found"
+ exit 1
+fi
+build=`$tsdir/build-aux/config.guess`
+if [ $PRINT_BUILD = yes ]; then
+ echo "$build"
+ exit 0
+fi
+
+
+
# ******************
# W32 build script
# ******************
if [ "$myhost" = "w32" ]; then
- if [ ! -f "$tsdir/build-aux/config.guess" ]; then
- fatal "$tsdir/build-aux/config.guess not found"
- exit 1
- fi
- build=`$tsdir/build-aux/config.guess`
-
case $myhostsub in
ce)
w32root="$w32ce_root"
fi
die_p
fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
$tsdir/configure --enable-maintainer-mode ${SILENT} \
--prefix=${w32root} \
- --host=${host} --build=${build} \
+ --host=${host} --build=${build} SYSROOT=${w32root} \
+ PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \
${configure_opts} ${extraoptions} "$@"
rc=$?
exit $rc
# ***** AMD64 cross build script *******
# Used to cross-compile for AMD64 (for testing)
if [ "$myhost" = "amd64" ]; then
- shift
- if [ ! -f $tsdir/build-aux/config.guess ]; then
- echo "$tsdir/build-aux/config.guess not found" >&2
- exit 1
- fi
- build=`$tsdir/build-aux/config.guess`
-
[ -z "$amd64root" ] && amd64root="$HOME/amd64root"
info "Using $amd64root as standard install directory"
replace_sysroot
echo "Stop." >&2
exit 1
fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
# Check the git setup.
if [ -d .git ]; then
- CP="cp -a"
- [ -z "${SILENT}" ] && CP="$CP -v"
+ CP="cp -p"
+ # If we have a GNU cp we can add -v
+ if cp --version >/dev/null 2>/dev/null; then
+ [ -z "${SILENT}" ] && CP="$CP -v"
+ fi
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
[ -z "${SILENT}" ] && cat <<EOF
*** Activating trailing whitespace git pre-commit hook. ***
/* Defined if descriptor passing is enabled and supported */
#undef USE_DESCRIPTOR_PASSING
+/* Defined if SYS_getdents can be used on Linux */
+#undef USE_LINUX_GETDENTS
+
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gpgme 1.9.0.
+# Generated by GNU Autoconf 2.69 for gpgme 1.10.0.
#
# Report bugs to <http://bugs.gnupg.org>.
#
# Identity of this package.
PACKAGE_NAME='gpgme'
PACKAGE_TARNAME='gpgme'
-PACKAGE_VERSION='1.9.0'
-PACKAGE_STRING='gpgme 1.9.0'
+PACKAGE_VERSION='1.10.0'
+PACKAGE_STRING='gpgme 1.10.0'
PACKAGE_BUGREPORT='http://bugs.gnupg.org'
PACKAGE_URL=''
BUILD_FILEVERSION
BUILD_REVISION
ENABLED_LANGUAGES
-PYTHON_VERSIONS
PYTHONS
PYTHON_EXTRA_LDFLAGS
PYTHON_EXTRA_LIBS
with_gpg_error_prefix
with_libassuan_prefix
enable_fd_passing
+enable_linux_getdents
'
ac_precious_vars='build_alias
host_alias
# 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.9.0 to adapt to many kinds of systems.
+\`configure' configures gpgme 1.10.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gpgme 1.9.0:";;
+ short | recursive ) echo "Configuration of gpgme 1.10.0:";;
esac
cat <<\_ACEOF
--disable-g13-test disable G13 regression test
--disable-largefile omit support for large files
--disable-fd-passing do not use FD passing
+ --disable-linux-getdents
+ do not use SYS_getdents on Linux
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gpgme configure 1.9.0
+gpgme configure 1.10.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
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.9.0, which was
+It was created by gpgme $as_me 1.10.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# (Interfaces added: AGE++)
# (Interfaces removed/changed: AGE=0)
#
-LIBGPGME_LT_CURRENT=29
-LIBGPGME_LT_AGE=18
+LIBGPGME_LT_CURRENT=30
+LIBGPGME_LT_AGE=19
LIBGPGME_LT_REVISION=0
# 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=10
-LIBGPGMEPP_LT_AGE=4
+LIBGPGMEPP_LT_CURRENT=11
+LIBGPGMEPP_LT_AGE=5
LIBGPGMEPP_LT_REVISION=0
-LIBQGPGME_LT_CURRENT=9
-LIBQGPGME_LT_AGE=2
+LIBQGPGME_LT_CURRENT=10
+LIBQGPGME_LT_AGE=3
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.17
+NEED_GPG_ERROR_VERSION=1.24
NEED_LIBASSUAN_API=2
-NEED_LIBASSUAN_VERSION=2.0.2
+NEED_LIBASSUAN_VERSION=2.4.2
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
VERSION_MAJOR=1
-VERSION_MINOR=9
+VERSION_MINOR=10
VERSION_MICRO=0
ac_aux_dir=
# Define the identity of the package.
PACKAGE='gpgme'
- VERSION='1.9.0'
+ VERSION='1.10.0'
cat >>confdefs.h <<_ACEOF
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
#define VERSION "$VERSION"
_ACEOF
-VERSION_NUMBER=0x010900
+VERSION_NUMBER=0x010a00
# We need to compile and run a program on the build machine. A
fi
-# Note: You need to declare all possible langauges also in
+# Note: You need to declare all possible languages also in
# lang/Makefile.am's DIST_SUBDIRS.
# Check whether --enable-languages was given.
if test "${enable_languages+set}" = set; then :
done
if test "$found" = "1"; then
- # We need to ensure that in the langauge order qt comes after cpp
+ # We need to ensure that in the language order qt comes after cpp
# so we remove qt first and explicitly add it as last list member.
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
PYTHONS=$PYTHONS
- PYTHON_VERSIONS=$PYTHON_VERSIONS
-
fi
fi
#
# Provide information about the build.
#
-BUILD_REVISION="aa0390e"
+BUILD_REVISION="6a42eb5"
cat >>confdefs.h <<_ACEOF
BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
-BUILD_FILEVERSION="${BUILD_FILEVERSION}43523"
+BUILD_FILEVERSION="${BUILD_FILEVERSION}27202"
# Check whether --enable-build-timestamp was given.
+# Option --disable-linux-getdents
+#
+# By default we use SYS_getdents on Linux to optimize fd closing
+# before an exec. This option allows to switch this optimization off.
+use_linux_getdents=yes
+# Check whether --enable-linux-getdents was given.
+if test "${enable_linux_getdents+set}" = set; then :
+ enableval=$enable_linux_getdents; use_linux_getdents=$enableval
+fi
+
+if test "$use_linux_getdents" = "yes"; then
+ case "${host}" in
+ *-*-linux*)
+
+$as_echo "#define USE_LINUX_GETDENTS 1" >>confdefs.h
+
+ ;;
+ esac
+fi
+
+
+#
# Add a few constants to help porting to W32
+#
fi
ac_config_files="$ac_config_files lang/qt/doc/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/Makefile lang/python/version.py lang/python/tests/Makefile"
ac_config_files="$ac_config_files lang/python/setup.py"
# 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.9.0, which was
+This file was extended by gpgme $as_me 1.10.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
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.9.0
+gpgme config.status 1.10.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
"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/gpg/version.py") CONFIG_FILES="$CONFIG_FILES lang/python/gpg/version.py" ;;
+ "lang/python/version.py") CONFIG_FILES="$CONFIG_FILES lang/python/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" ;;
echo "
GPGME v${VERSION} has been configured as follows:
- Revision: aa0390e (43523)
+ Revision: 6a42eb5 (27202)
Platform: $host
UI Server: $uiserver
# 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, [9])
+m4_define(mym4_version_minor, [10])
m4_define(mym4_version_micro, [0])
# Below is m4 magic to extract and compute the revision number, the
# (Interfaces added: AGE++)
# (Interfaces removed/changed: AGE=0)
#
-LIBGPGME_LT_CURRENT=29
-LIBGPGME_LT_AGE=18
+LIBGPGME_LT_CURRENT=30
+LIBGPGME_LT_AGE=19
LIBGPGME_LT_REVISION=0
# 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=10
-LIBGPGMEPP_LT_AGE=4
+LIBGPGMEPP_LT_CURRENT=11
+LIBGPGMEPP_LT_AGE=5
LIBGPGMEPP_LT_REVISION=0
-LIBQGPGME_LT_CURRENT=9
-LIBQGPGME_LT_AGE=2
+LIBQGPGME_LT_CURRENT=10
+LIBQGPGME_LT_AGE=3
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.17
+NEED_GPG_ERROR_VERSION=1.24
NEED_LIBASSUAN_API=2
-NEED_LIBASSUAN_VERSION=2.0.2
+NEED_LIBASSUAN_VERSION=2.4.2
PACKAGE=$PACKAGE_NAME
#endif])
AC_PROG_CC
+AC_PROG_CPP
AC_PROG_CXX
# Note: A suitable gitlog-to-changelog script can be found in GnuPG master.
fi
-# Note: You need to declare all possible langauges also in
+# Note: You need to declare all possible languages also in
# lang/Makefile.am's DIST_SUBDIRS.
AC_ARG_ENABLE([languages],
AC_HELP_STRING([--enable-languages=languages],
# Check that if qt is enabled cpp also is enabled
LIST_MEMBER("qt", $enabled_languages)
if test "$found" = "1"; then
- # We need to ensure that in the langauge order qt comes after cpp
+ # We need to ensure that in the language order qt comes after cpp
# so we remove qt first and explicitly add it as last list member.
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
LIST_MEMBER("cpp", $enabled_languages)
fi
AC_SUBST(PYTHONS, $PYTHONS)
- AC_SUBST(PYTHON_VERSIONS, $PYTHON_VERSIONS)
fi
fi
AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no")
+# Option --disable-linux-getdents
+#
+# By default we use SYS_getdents on Linux to optimize fd closing
+# before an exec. This option allows to switch this optimization off.
+use_linux_getdents=yes
+AC_ARG_ENABLE(linux-getdents,
+ AC_HELP_STRING([--disable-linux-getdents],
+ [do not use SYS_getdents on Linux]),
+ use_linux_getdents=$enableval)
+if test "$use_linux_getdents" = "yes"; then
+ case "${host}" in
+ *-*-linux*)
+ AC_DEFINE(USE_LINUX_GETDENTS,1,
+ [Defined if SYS_getdents can be used on Linux])
+ ;;
+ esac
+fi
+
+
+#
# Add a few constants to help porting to W32
+#
AH_VERBATIM([SEPCONSTANTS],
[
/* Separators as used in $PATH and file name. */
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/gpg/version.py
+ lang/python/version.py
lang/python/tests/Makefile])
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
AC_OUTPUT
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
This file documents the GPGME library.
- This is Edition 1.9.0, last updated 16 November 2016, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.9.0.
+ This is Edition 1.10.0, last updated 8 December 2017, of ‘The ‘GnuPG
+Made Easy’ Reference Manual’, for Version 1.10.0.
Copyright © 2002–2008, 2010, 2012–2017 g10 Code GmbH.
\1f
Indirect:
-gpgme.info-1: 1672
-gpgme.info-2: 321787
+gpgme.info-1: 1673
+gpgme.info-2: 302282
\1f
Tag Table:
(Indirect)
-Node: Top\7f1672
-Node: Introduction\7f9265
-Node: Getting Started\7f10055
-Node: Features\7f11516
-Node: Overview\7f12828
-Node: Preparation\7f13937
-Node: Header\7f14934
-Node: Building the Source\7f15681
-Node: Largefile Support (LFS)\7f17825
-Node: Using Automake\7f23239
-Node: Using Libtool\7f25792
-Node: Library Version Check\7f26154
-Node: Signal Handling\7f32166
-Node: Multi-Threading\7f33436
-Ref: Multi-Threading-Footnote-1\7f34852
-Node: Protocols and Engines\7f35275
-Node: Engine Version Check\7f37920
-Node: Engine Information\7f40424
-Node: Engine Configuration\7f44284
-Node: OpenPGP\7f45568
-Node: Cryptographic Message Syntax\7f45908
-Node: Assuan\7f46221
-Node: Algorithms\7f46595
-Ref: Algorithms-Footnote-1\7f47074
-Node: Public Key Algorithms\7f47202
-Node: Hash Algorithms\7f49689
-Node: Error Handling\7f50879
-Node: Error Values\7f52753
-Node: Error Sources\7f57956
-Node: Error Codes\7f60396
-Node: Error Strings\7f65187
-Node: Exchanging Data\7f66994
-Node: Creating Data Buffers\7f68860
-Node: Memory Based Data Buffers\7f69376
-Node: File Based Data Buffers\7f72809
-Node: Callback Based Data Buffers\7f75011
-Node: Destroying Data Buffers\7f79202
-Node: Manipulating Data Buffers\7f80690
-Node: Data Buffer I/O Operations\7f81182
-Node: Data Buffer Meta-Data\7f83555
-Node: Data Buffer Convenience\7f87921
-Node: Contexts\7f89898
-Node: Creating Contexts\7f91084
-Node: Destroying Contexts\7f91931
-Node: Result Management\7f92270
-Node: Context Attributes\7f93813
-Node: Protocol Selection\7f94850
-Node: Crypto Engine\7f95882
-Node: Setting the Sender\7f97732
-Node: ASCII Armor\7f99207
-Node: Text Mode\7f99836
-Node: Offline Mode\7f100770
-Node: Pinentry Mode\7f101842
-Node: Included Certificates\7f103527
-Node: Key Listing Mode\7f104949
-Node: Passphrase Callback\7f109041
-Node: Progress Meter Callback\7f112428
-Node: Status Message Callback\7f114413
-Node: Locale\7f119123
-Node: Key Management\7f120682
-Node: Key objects\7f121910
-Node: Listing Keys\7f133583
-Node: Information About Keys\7f142211
-Node: Manipulating Keys\7f143519
-Node: Generating Keys\7f144089
-Node: Signing Keys\7f162005
-Node: Exporting Keys\7f165552
-Node: Importing Keys\7f172245
-Ref: Importing Keys-Footnote-1\7f179150
-Node: Deleting Keys\7f179278
-Node: Changing Passphrases\7f180723
-Node: Changing TOFU Data\7f182012
-Node: Advanced Key Editing\7f184063
-Node: Trust Item Management\7f186712
-Node: Listing Trust Items\7f187748
-Node: Manipulating Trust Items\7f190109
-Node: Crypto Operations\7f190752
-Node: Decrypt\7f192016
-Node: Verify\7f198345
-Node: Decrypt and Verify\7f210614
-Node: Sign\7f213450
-Node: Selecting Signers\7f214014
-Node: Creating a Signature\7f215401
-Node: Signature Notation Data\7f220171
-Node: Encrypt\7f222399
-Node: Encrypting a Plaintext\7f222755
-Node: Miscellaneous\7f230358
-Node: Running other Programs\7f230770
-Node: Using the Assuan protocol\7f232846
-Node: Checking for updates\7f235568
-Node: Run Control\7f240326
-Node: Waiting For Completion\7f241070
-Node: Using External Event Loops\7f243188
-Node: I/O Callback Interface\7f245160
-Node: Registering I/O Callbacks\7f250398
-Node: I/O Callback Example\7f252436
-Node: I/O Callback Example GTK+\7f259061
-Node: I/O Callback Example GDK\7f260850
-Node: I/O Callback Example Qt\7f262492
-Node: Cancellation\7f264780
-Node: UI Server Protocol\7f267050
-Ref: UI Server Protocol-Footnote-1\7f268485
-Node: UI Server Encrypt\7f268604
-Node: UI Server Sign\7f273962
-Node: UI Server Decrypt\7f276315
-Node: UI Server Verify\7f277970
-Node: UI Server Set Input Files\7f281542
-Node: UI Server Sign/Encrypt Files\7f282612
-Node: UI Server Verify/Decrypt Files\7f284420
-Node: UI Server Import/Export Keys\7f286296
-Node: UI Server Checksum Files\7f287358
-Node: Miscellaneous UI Server Commands\7f289574
-Ref: command SENDER\7f291505
-Node: Debugging\7f293207
-Node: Deprecated Functions\7f294956
-Node: Library Copying\7f321787
-Node: Copying\7f350007
-Node: Concept Index\7f387757
-Node: Function and Data Index\7f402536
+Node: Top\7f1673
+Node: Introduction\7f9267
+Node: Getting Started\7f10057
+Node: Features\7f11518
+Node: Overview\7f12830
+Node: Preparation\7f13939
+Node: Header\7f14936
+Node: Building the Source\7f15683
+Node: Largefile Support (LFS)\7f17827
+Node: Using Automake\7f23243
+Node: Using Libtool\7f25796
+Node: Library Version Check\7f26158
+Node: Signal Handling\7f32218
+Node: Multi-Threading\7f33488
+Ref: Multi-Threading-Footnote-1\7f34904
+Node: Protocols and Engines\7f35327
+Node: Engine Version Check\7f38078
+Node: Engine Information\7f40601
+Node: Engine Configuration\7f44461
+Node: OpenPGP\7f45765
+Node: Cryptographic Message Syntax\7f46105
+Node: Assuan\7f46418
+Node: Algorithms\7f46792
+Ref: Algorithms-Footnote-1\7f47271
+Node: Public Key Algorithms\7f47399
+Node: Hash Algorithms\7f50001
+Node: Error Handling\7f51215
+Node: Error Values\7f53089
+Node: Error Sources\7f58292
+Node: Error Codes\7f60732
+Node: Error Strings\7f65525
+Node: Exchanging Data\7f67332
+Node: Creating Data Buffers\7f69217
+Node: Memory Based Data Buffers\7f69733
+Node: File Based Data Buffers\7f73166
+Node: Callback Based Data Buffers\7f75368
+Node: Destroying Data Buffers\7f79559
+Node: Manipulating Data Buffers\7f81066
+Node: Data Buffer I/O Operations\7f81558
+Node: Data Buffer Meta-Data\7f83931
+Node: Data Buffer Convenience\7f88450
+Node: Contexts\7f90670
+Node: Creating Contexts\7f91856
+Node: Destroying Contexts\7f92703
+Node: Result Management\7f93042
+Node: Context Attributes\7f94623
+Node: Protocol Selection\7f95660
+Node: Crypto Engine\7f96692
+Node: Setting the Sender\7f98581
+Node: ASCII Armor\7f100094
+Node: Text Mode\7f100723
+Node: Offline Mode\7f101657
+Node: Pinentry Mode\7f102767
+Node: Included Certificates\7f104661
+Node: Key Listing Mode\7f106107
+Node: Passphrase Callback\7f110319
+Node: Progress Meter Callback\7f113881
+Node: Status Message Callback\7f115866
+Node: Locale\7f121218
+Node: Key Management\7f122796
+Node: Key objects\7f124024
+Node: Listing Keys\7f138248
+Node: Information About Keys\7f146901
+Node: Manipulating Keys\7f148209
+Node: Generating Keys\7f148779
+Node: Signing Keys\7f167101
+Node: Exporting Keys\7f170734
+Node: Importing Keys\7f177541
+Ref: Importing Keys-Footnote-1\7f184685
+Node: Deleting Keys\7f184813
+Node: Changing Passphrases\7f187093
+Node: Changing TOFU Data\7f188420
+Node: Advanced Key Editing\7f190528
+Node: Trust Item Management\7f193261
+Node: Listing Trust Items\7f194297
+Node: Manipulating Trust Items\7f196658
+Node: Crypto Operations\7f197301
+Node: Decrypt\7f198565
+Node: Verify\7f205072
+Node: Decrypt and Verify\7f217536
+Node: Sign\7f220391
+Node: Selecting Signers\7f220955
+Node: Creating a Signature\7f222361
+Node: Signature Notation Data\7f227131
+Node: Encrypt\7f229416
+Node: Encrypting a Plaintext\7f229772
+Node: Miscellaneous\7f237495
+Node: Running other Programs\7f237907
+Node: Using the Assuan protocol\7f240070
+Node: Checking for updates\7f242868
+Node: Run Control\7f247685
+Node: Waiting For Completion\7f248429
+Node: Using External Event Loops\7f250547
+Node: I/O Callback Interface\7f252519
+Node: Registering I/O Callbacks\7f257759
+Node: I/O Callback Example\7f259798
+Node: I/O Callback Example GTK+\7f266423
+Node: I/O Callback Example GDK\7f268212
+Node: I/O Callback Example Qt\7f269854
+Node: Cancellation\7f272142
+Node: UI Server Protocol\7f274450
+Ref: UI Server Protocol-Footnote-1\7f275885
+Node: UI Server Encrypt\7f276004
+Node: UI Server Sign\7f281362
+Node: UI Server Decrypt\7f283715
+Node: UI Server Verify\7f285370
+Node: UI Server Set Input Files\7f288942
+Node: UI Server Sign/Encrypt Files\7f290012
+Node: UI Server Verify/Decrypt Files\7f291820
+Node: UI Server Import/Export Keys\7f293696
+Node: UI Server Checksum Files\7f294758
+Node: Miscellaneous UI Server Commands\7f296976
+Ref: command SENDER\7f298907
+Node: Debugging\7f302282
+Node: Deprecated Functions\7f304031
+Node: Library Copying\7f329248
+Node: Copying\7f357468
+Node: Concept Index\7f395218
+Node: Function and Data Index\7f409997
\1f
End Tag Table
This file documents the GPGME library.
- This is Edition 1.9.0, last updated 16 November 2016, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.9.0.
+ This is Edition 1.10.0, last updated 8 December 2017, of ‘The ‘GnuPG
+Made Easy’ Reference Manual’, for Version 1.10.0.
Copyright © 2002–2008, 2010, 2012–2017 g10 Code GmbH.
Main Menu
*********
-This is Edition 1.9.0, last updated 16 November 2016, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.9.0 of the GPGME library.
+This is Edition 1.10.0, last updated 8 December 2017, of ‘The ‘GnuPG
+Made Easy’ Reference Manual’, for Version 1.10.0 of the GPGME library.
* Menu:
systems. To address offsets in large files, you can either enable
largefile support add-on. Then a new data type ‘off64_t’ is provided,
which is 64 bit wide. Or you can replace the existing ‘off_t’ data type
-with its 64 bit wide counterpart. All occurences of ‘off_t’ are then
+with its 64 bit wide counterpart. All occurrences of ‘off_t’ are then
automagically replaced.
As if matters were not complex enough, there are also two different
types of file descriptors in such systems. This is important because if
file descriptors are exchanged between programs that use a different
maximum file size, certain errors must be produced on some file
-descriptors to prevent subtle overflow bugs from occuring.
+descriptors to prevent subtle overflow bugs from occurring.
As you can see, supporting two different maximum file sizes at the
same time is not at all an easy task. However, the maximum file size
library.
If a selftest fails, the function may still succeed. Selftest
- errors are returned later when invoking ‘gpgme_new’, so that a
- detailed error code can be returned (historically,
- ‘gpgme_check_version’ does not return a detailed error code).
+ errors are returned later when invoking ‘gpgme_new’ or
+ ‘gpgme-data_new’, so that a detailed error code can be returned
+ (historically, ‘gpgme_check_version’ does not return a detailed
+ error code).
-- Function: int gpgme_set_global_flag (const char *NAME,
const char *VALUE)
+ SINCE: 1.4.0
+
On some systems it is not easy to set environment variables and
thus hard to use GPGME’s internal trace facility for debugging.
This function has been introduced as an alternative way to enable
‘require-gnupg’
Set the mimimum version of the required GnuPG engine. If that
version is not met, GPGME fails early instead of trying to use
- the existant version. The given version must be a string with
+ the existent version. The given version must be a string with
major, minor, and micro number. Example: "2.1.0".
‘w32-inst-dir’
supported:
‘GPGME_PROTOCOL_OpenPGP’
+ ‘GPGME_PROTOCOL_OPENPGP’
This specifies the OpenPGP protocol.
‘GPGME_PROTOCOL_CMS’
help.
‘GPGME_PROTOCOL_ASSUAN’
+ SINCE: 1.2.0
+
This specifies the raw Assuan protocol.
‘GPGME_PROTOCOL_G13’
+ SINCE: 1.3.0
+
Under development. Please ask on <gnupg-devel@gnupg.org> for
help.
help.
‘GPGME_PROTOCOL_SPAWN’
+ SINCE: 1.5.0
+
Special protocol for use with ‘gpgme_op_spawn’.
‘GPGME_PROTOCOL_UNKNOWN’
========================
-- Function: const char * gpgme_get_dirinfo (cons char *WHAT)
+ SINCE: 1.5.0
+
The function ‘gpgme_get_dirinfo’ returns a statically allocated
string with the value associated to WHAT. The returned values are
the defaults and won’t change even after ‘gpgme_set_engine_info’
-- Function: gpgme_error_t gpgme_set_engine_info
(gpgme_protocol_t PROTO, const char *FILE_NAME,
const char *HOME_DIR)
+ SINCE: 1.1.0
+
The function ‘gpgme_set_engine_info’ changes the default
configuration of the crypto engine implementing the protocol PROTO.
The new defaults are not applied to already created GPGME contexts.
This function returns the error code ‘GPG_ERR_NO_ERROR’ if
- successful, or an eror code on failure.
+ successful, or an error code on failure.
The functions ‘gpgme_ctx_get_engine_info’ and
‘gpgme_ctx_set_engine_info’ can be used to change the engine
GnuPG.
‘GPGME_PK_ECC’
+ SINCE: 1.5.0
+
This value is a generic indicator for ellipic curve
algorithms.
‘GPGME_PK_ECDSA’
+ SINCE: 1.3.0
+
This value indicates ECDSA, the Elliptic Curve Digital
Signature Algorithm as defined by FIPS 186-2 and RFC-6637.
‘GPGME_PK_ECDH’
+ SINCE: 1.3.0
+
This value indicates ECDH, the Eliptic Curve Diffie-Hellmann
encryption algorithm as defined by RFC-6637.
‘GPGME_PK_EDDSA’
+ SINCE: 1.7.0
+
This value indicates the EdDSA algorithm.
-- Function: const char * gpgme_pubkey_algo_name
If ALGO is not a valid public key algorithm, ‘NULL’ is returned.
-- Function: char * gpgme_pubkey_algo_string (gpgme_subkey_t KEY)
+ SINCE: 1.7.0
+
The function ‘gpgme_pubkey_algo_string’ is a convenience function
to build and return an algorithm string in the same way GnuPG does
(e.g. “rsa2048” or “ed25519”). The caller must free the result
‘GPGME_MD_SHA384’
‘GPGME_MD_SHA512’
‘GPGME_MD_SHA224’
+ SINCE: 1.5.0
+
‘GPGME_MD_MD4’
‘GPGME_MD_CRC32’
‘GPGME_MD_CRC32_RFC1510’
Also, it is guaranteed that an error value made from the error code
‘0’ will be ‘0’ itself (as a whole). This means that the error
source information is lost for this error code, however, as this
- error code indicates that no error occured, this is generally not a
- problem.
+ error code indicates that no error occurred, this is generally not
+ a problem.
‘GPG_ERR_GENERAL’
This value means that something went wrong, but either there is not
for the certificate.
‘GPG_ERR_NO_POLICY_MATCH’
- This value indicates that a policy issue occured.
+ This value indicates that a policy issue occurred.
‘GPG_ERR_NO_SECKEY’
This value indicates that no secret key for the user ID is
relevant, for example, if the external event loop mechanism is used.
-- Data type: gpgme_off_t
+ SINCE: 1.4.1
+
On POSIX platforms the ‘gpgme_off_t’ type is an alias for ‘off_t’;
it may be used interchangeable. On Windows platforms ‘gpgme_off_t’
is defined as a long (i.e. 32 bit) for 32 bit Windows and as a 64
any case, the data object DH is destroyed.
-- Function: void gpgme_free (void *BUFFER)
+ SINCE: 1.1.1
+
The function ‘gpgme_free’ releases the memory returned by
‘gpgme_data_release_and_get_mem’ and ‘gpgme_pubkey_algo_string’.
It should be used instead of the system libraries ‘free’ function
---------------------------
-- Function: char * gpgme_data_get_file_name (gpgme_data_t DH)
+ SINCE: 1.1.0
+
The function ‘gpgme_data_get_file_name’ returns a pointer to a
string containing the file name associated with the data object.
The file name will be stored in the output when encrypting or
-- Function: gpgme_error_t gpgme_data_set_file_name (gpgme_data_t DH,
const char *FILE_NAME)
+ SINCE: 1.1.0
+
The function ‘gpgme_data_set_file_name’ sets the file name
associated with the data object. The file name will be stored in
the output when encrypting or signing the data and will be returned
used by OpenPGP and PEM.
‘GPGME_DATA_ENCODING_MIME’
+ SINCE: 1.7.0
+
This specifies that the data is encoded as a MIME part.
‘GPGME_DATA_ENCODING_URL’
+ SINCE: 1.2.0
+
The data is a list of linefeed delimited URLs. This is only
useful with ‘gpgme_op_import’.
‘GPGME_DATA_ENCODING_URL0’
+ SINCE: 1.2.0
+
The data is a list of binary zero delimited URLs. This is
only useful with ‘gpgme_op_import’.
‘GPGME_DATA_ENCODING_URLESC’
+ SINCE: 1.2.0
+
The data is a list of linefeed delimited URLs with all control
and space characters percent escaped. This mode is is not yet
implemented.
-- Function: gpgme_error_t gpgme_data_set_flag (gpgme_data_t DH,
const char *NAME, const char *VALUE)
+ SINCE: 1.7.0
+
Some minor properties of the data object can be controlled with
flags set by this function. The properties are identified by the
following values for NAME:
---------------------------------------
-- Data type: enum gpgme_data_type_t
+ SINCE: 1.4.3
+
The ‘gpgme_data_type_t’ type is used to return the detected type of
the content of a data buffer.
‘GPGME_DATA_TYPE_PGP_SIGNED’
The data is an OpenPGP signed message. This may be a binary
signature, a detached one or a cleartext signature.
+‘GPGME_DATA_TYPE_PGP_ENCRYPTED’
+ SINCE: 1.7.0
+
+ The data is an OpenPGP encrypted message.
+‘GPGME_DATA_TYPE_PGP_SIGNATURE’
+ SINCE: 1.7.0
+
+ The data is an OpenPGP detached signature.
‘GPGME_DATA_TYPE_PGP_OTHER’
This is a generic OpenPGP message. In most cases this will be
encrypted data.
private keys for X.509.
-- Function: gpgme_data_type_t gpgme_data_identify (gpgme_data_t DH)
+ SINCE: 1.4.3
+
The function ‘gpgme_data_identify’ returns the type of the data
with the handle DH. If it is not possible to perform the
identification, the function returns zero
lifetime beyond that of the current operation or context.
-- Function: void gpgme_result_ref (void *RESULT)
+ SINCE: 1.2.0
+
The function ‘gpgme_result_ref’ acquires an additional reference
for the result RESULT, which may be of any type ‘gpgme_*_result_t’.
As long as the user holds a reference, the result structure is
guaranteed to be valid and unmodified.
-- Function: void gpgme_result_unref (void *RESULT)
+ SINCE: 1.2.0
+
The function ‘gpgme_result_unref’ releases a reference for the
result RESULT. If this was the last reference, the result
structure will be destroyed and all resources associated to it will
-- Function: gpgme_engine_info_t gpgme_ctx_get_engine_info
(gpgme_ctx_t CTX)
+ SINCE: 1.1.0
+
The function ‘gpgme_ctx_get_engine_info’ returns a linked list of
engine info structures. Each info structure describes the
configuration of one configured backend, as used by the context
-- Function: gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t CTX,
gpgme_protocol_t PROTO, const char *FILE_NAME,
const char *HOME_DIR)
+ SINCE: 1.1.0
+
The function ‘gpgme_ctx_set_engine_info’ changes the configuration
of the crypto engine implementing the protocol PROTO for the
context CTX.
operation on the context CTX.
This function returns the error code ‘GPG_ERR_NO_ERROR’ if
- successful, or an eror code on failure.
+ successful, or an error code on failure.
\1f
File: gpgme.info, Node: Setting the Sender, Next: ASCII Armor, Prev: Crypto Engine, Up: Context Attributes
-- Function: gpgme_error_t gpgme_set_sender (gpgme_ctx_t CTX,
int ADDRESS)
+ SINCE: 1.8.0
+
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
-- Function: const char * gpgme_get_sender (gpgme_ctx_t CTX)
+ SINCE: 1.8.0
+
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
------------------
-- Function: void gpgme_set_offline (gpgme_ctx_t CTX, int YES)
+ SINCE: 1.6.0
+
The function ‘gpgme_set_offline’ specifies if offline mode should
be used. By default, offline mode is not used.
Offline mode is disabled if YES is zero, and enabled otherwise.
-- Function: int gpgme_get_offline (gpgme_ctx_t CTX)
+ SINCE: 1.6.0
+
The function ‘gpgme_get_offline’ returns 1 if offline mode is
enabled, and ‘0’ if it is not, or if CTX is not a valid pointer.
-------------------
-- Function: gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t CTX,
- gpgme_pinentry_mode_t MODE) The function ‘gpgme_set_pinentry_mode’
- specifies the pinentry mode to be used.
+ gpgme_pinentry_mode_t MODE)
+
+ SINCE: 1.4.0
+
+ The function ‘gpgme_set_pinentry_mode’ specifies the pinentry mode
+ to be used.
For GnuPG >= 2.1 this option is required to be set to
‘GPGME_PINENTRY_MODE_LOOPBACK’ to enable the passphrase callback
-- Function: gpgme_pinentry_mode_t gpgme_get_pinentry_mode
(gpgme_ctx_t CTX)
+ SINCE: 1.4.0
+
The function ‘gpgme_get_pinenty_mode’ returns the mode set for the
context.
-- Data type: enum gpgme_pinentry_mode_t
+ SINCE: 1.4.0
+
The ‘gpgme_minentry_mode_t’ type specifies the set of possible
pinentry modes that are supported by GPGME if GnuPG >= 2.1 is used.
The following modes are supported:
‘GPGME_PINENTRY_MODE_DEFAULT’
+ SINCE: 1.4.0
+
Use the default of the agent, which is ask.
‘GPGME_PINENTRY_MODE_ASK’
+ SINCE: 1.4.0
+
Force the use of the Pinentry.
‘GPGME_PINENTRY_MODE_CANCEL’
+ SINCE: 1.4.0
+
Emulate use of Pinentry’s cancel button.
‘GPGME_PINENTRY_MODE_ERROR’
+ SINCE: 1.4.0
+
Return a Pinentry error ‘No Pinentry’.
‘GPGME_PINENTRY_MODE_LOOPBACK’
+ SINCE: 1.4.0
+
Redirect Pinentry queries to the caller. This enables the use
- of ‘gpgme_set_passphrase_cb’ whis pinentry queries redirected
- to gpgme.
+ of ‘gpgme_set_passphrase_cb’ because pinentry queries are
+ redirected to gpgme.
- Note: This mode requires ‘allow-loopback-pinentry’ to be
- enabled in the ‘gpg-agent.conf’ or an agent started with that
- option.
+ Note: For 2.1.0 - 2.1.12 this mode requires
+ ‘allow-loopback-pinentry’ to be enabled in the
+ ‘gpg-agent.conf’ or an agent started with that option.
\1f
File: gpgme.info, Node: Included Certificates, Next: Key Listing Mode, Prev: Pinentry Mode, Up: Context Attributes
values of NR_OF_CERTS are:
‘GPGME_INCLUDE_CERTS_DEFAULT’
+ SINCE: 1.0.3
+
Fall back to the default of the crypto backend. This is the
default for GPGME.
‘-2’
‘GPGME_KEYLIST_MODE_EXTERN’
The ‘GPGME_KEYLIST_MODE_EXTERN’ symbol specifies that an
external source should be searched for keys in the keylisting
- operation. The type of external source is dependant on the
+ operation. The type of external source is dependent on the
crypto engine used and whether it is combined with
‘GPGME_KEYLIST_MODE_LOCAL’. For example, it can be a remote
keyserver or LDAP certificate server.
signatures should be included in the listed keys.
‘GPGME_KEYLIST_MODE_SIG_NOTATIONS’
+ SINCE: 1.1.1
+
The ‘GPGME_KEYLIST_MODE_SIG_NOTATIONS’ symbol specifies that
the signature notations on key signatures should be included
in the listed keys. This only works if
‘GPGME_KEYLIST_MODE_SIGS’ is also enabled.
‘GPGME_KEYLIST_MODE_WITH_TOFU’
+ SINCE: 1.7.0
+
The ‘GPGME_KEYLIST_MODE_WITH_TOFU’ symbol specifies that
information pertaining to the TOFU trust model should be
included in the listed keys.
‘GPGME_KEYLIST_MODE_WITH_SECRET’
+ SINCE: 1.5.1
+
The ‘GPGME_KEYLIST_MODE_WITH_SECRET’ returns information about
the presence of a corresponding secret key in a public key
listing. A public key listing with this mode is slower than a
versions >= 2.1.
‘GPGME_KEYLIST_MODE_EPHEMERAL’
+ SINCE: 1.2.0
+
The ‘GPGME_KEYLIST_MODE_EPHEMERAL’ symbol specifies that keys
flagged as ephemeral are included in the listing.
‘GPGME_KEYLIST_MODE_VALIDATE’
+ SINCE: 0.4.5
+
The ‘GPGME_KEYLIST_MODE_VALIDATE’ symbol specifies that the
backend should do key or certificate validation and not just
get the validity information from an internal cache. This
You can use the error code ‘GPG_ERR_CANCELED’ to abort the
operation. Otherwise, return ‘0’.
+ Note: The passphrase_cb only works with GnuPG 1.x and 2.1.x and not
+ with the 2.0.x series. See ‘gpgme_set_pinentry_mode’ for more
+ details on 2.1.x usage.
+
-- Function: void gpgme_set_passphrase_cb (gpgme_ctx_t CTX,
gpgme_passphrase_cb_t PASSFUNC, void *HOOK_VALUE)
The function ‘gpgme_set_passphrase_cb’ sets the function that is
-- Function: void gpgme_set_status_cb (gpgme_ctx_t CTX,
gpgme_status_cb_t STATUSFUNC, void *HOOK_VALUE)
+ SINCE: 1.6.0
+
The function ‘gpgme_set_status_cb’ sets the function that is used
when a status message is received from gpg to STATUSFUNC. The
function STATUSFUNC needs to be implemented by the user, and
-- Function: void gpgme_get_status_cb (gpgme_ctx_t CTX,
gpgme_status_cb_t *STATUSFUNC, void **HOOK_VALUE)
+ SINCE: 1.6.0
+
The function ‘gpgme_get_status_cb’ returns the function that is
used to process status messages from gpg in *STATUSFUNC, and the
first argument for this function in *HOOK_VALUE. If no status
-- Function: gpgme_error_t gpgme_set_ctx_flag (gpgme_ctx_t CTX,
const char *NAME, const char *VALUE)
+ SINCE: 1.7.0
+
Some minor properties of the context can be controlled with flags
set by this function. The properties are identified by the
following values for NAME:
GnuPG < 2.1.16 will leak the session key on many platforms via
ps(1).
+ ‘"auto-key-retrieve"’
+ Setting the VALUE to "1" asks the backend to automatically
+ retrieve a key for signature verification if possible. Note
+ that this option makes a "web bug" like behavior possible.
+ Keyserver or Web Key Directory operators can see which keys
+ you request, so by sending you a message signed by a brand new
+ key (which you naturally will not have on your local keyring),
+ the operator can tell both your IP address and the time when
+ you verified the signature.
+
This function returns ‘0’ on success.
-- Function: const char * gpgme_get_ctx_flag (gpgme_ctx_t CTX,
const char *NAME)
+ SINCE: 1.8.0
+
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
-- Function: gpgme_error_t gpgme_set_locale (gpgme_ctx_t CTX,
int CATEGORY, const char *VALUE)
+ SINCE: 0.4.3
+
The function ‘gpgme_set_locale’ sets the locale of the context CTX,
or the default locale if CTX is a null pointer.
following members:
‘gpgme_keylist_mode_t keylist_mode’
+ SINCE: 0.9.0
+
The keylist mode that was active when the key was retrieved.
‘unsigned int revoked : 1’
create key certificates.
‘unsigned int can_authenticate : 1’
+ SINCE: 0.4.5
+
This is true if the key (ie one of its subkeys) can be used
for authentication.
‘unsigned int is_qualified : 1’
+ SINCE: 1.1.0
+
This is true if the key can be used for qualified signatures
according to local government regulations.
‘GPGME_KEYLIST_MODE_WITH_SECRET’ is active.
‘unsigned int origin : 5’
+ SINCE: 1.8.0
+
Reserved for the origin of this key.
‘gpgme_protocol_t protocol’
user ID in the list is the main (or primary) user ID.
‘char *fpr’
+ SINCE: 1.7.0
+
This field gives the fingerprint of the primary key. Note
that this is a copy of the fingerprint of the first subkey.
For an incomplete key (for example from a verification result)
nevertheless.
‘unsigned long last_update’
+ SINCE: 1.8.0
+
Reserved for the time of the last update of this key.
-- Data type: gpgme_subkey_t
+ SINCE: 1.5.0
The ‘gpgme_subkey_t’ type is a pointer to a subkey structure.
Subkeys are one component of a ‘gpgme_key_t’ object. In fact,
certificates.
‘unsigned int can_authenticate : 1’
+ SINCE: 0.4.5
+
This is true if the subkey can be used for authentication.
‘unsigned int is_qualified : 1’
+ SINCE: 1.1.0
+
This is true if the subkey can be used for qualified
signatures according to local government regulations.
‘unsigned int is_de_vs : 1’
+ SINCE: 1.8.0
+
This is true if the subkey complies with the rules for
classified information in Germany at the restricted level
(VS-NfD). This are currently RSA keys of at least 2048 bits or
if available.
‘char *keygrip’
+ SINCE: 1.7.0
+
The keygrip of the subkey in hex digit form or ‘NULL’ if not
availabale.
subkey does not expire.
‘unsigned int is_cardkey : 1’
+ SINCE: 1.2.0
+
True if the secret key is stored on a smart card.
‘char *card_number’
+ SINCE: 1.2.0
+
The serial number of a smart card holding this key or ‘NULL’.
‘char *curve’
is available ‘NULL’ is stored.
‘gpgme_tofu_info_t tofu’
+ SINCE: 1.7.0
+
If not ‘NULL’ information from the TOFU database pertaining to
this user id.
This is a linked list with the signatures on this user ID.
‘unsigned int origin : 5’
+ SINCE: 1.8.0
+
Reserved for the origin of this user ID.
‘unsigned long last_update’
+ SINCE: 1.8.0
+
Reserved for the time of the last update of this user ID.
+ -- Data type: gpgme_tofu_info_t
+
+ SINCE: 1.7.0
+
+ The ‘gpgme_tofu_info_t’ type is a pointer to a tofu info structure.
+ Tofu info structures are one component of a ‘gpgme_user_id_t’
+ object, and provide information from the TOFU database pertaining
+ to the user ID.
+
+ The tofu info structure has the following members:
+
+ ‘gpgme_key_sig_t next’
+ This is a pointer to the next tofu info structure in the
+ linked list, or ‘NULL’ if this is the last element.
+
+ ‘unsigned int validity : 3’
+ This is the TOFU validity. It can have the following values:
+
+ ‘0’
+ The value ‘0’ indicates a conflict.
+
+ ‘1’
+ The value ‘1’ indicates a key without history.
+
+ ‘2’
+ The value ‘2’ indicates a key with too little history.
+
+ ‘3’
+ The value ‘3’ indicates a key with enough history for
+ basic trust.
+
+ ‘4’
+ The value ‘4’ indicates a key with a lot of history.
+
+ ‘unsigned int policy : 4’
+ This is the TOFU policy, see ‘gpgme_tofu_policy_t’.
+
+ ‘unsigned short signcount’
+ This is the number of signatures seen for this binding (or
+ ‘USHRT_MAX’ if there are more than that).
+
+ ‘unsigned short encrcount’
+ This is the number of encryptions done with this binding (or
+ ‘USHRT_MAX’ if there are more than that).
+
+ ‘unsigned long signfirst’
+ Number of seconds since Epoch when the first signature was
+ seen with this binding.
+
+ ‘unsigned long signlast’
+ Number of seconds since Epoch when the last signature was seen
+ with this binding.
+
+ ‘unsigned long encrfirst’
+ Number of seconds since Epoch when the first encryption was
+ done with this binding.
+
+ ‘unsigned long encrlast’
+ Number of seconds since Epoch when the last encryption was
+ done with this binding.
+
+ ‘char *description’
+ A human-readable string summarizing the TOFU data (or NULL).
+
-- Data type: gpgme_key_sig_t
The ‘gpgme_key_sig_t’ type is a pointer to a key signature
not a valid pointer, and passes through any errors that are
reported by the crypto engine support routines.
- -- Function: gpgme_error_t gpgme_op_keylist_from_data (gpgme_ctx_t CTX,
- gpgme_data_t DATA, int RESERVED)
+ -- Function: gpgme_error_t gpgme_op_keylist_from_data_start
+ (gpgme_ctx_t CTX, gpgme_data_t DATA, int RESERVED)
+
+ SINCE: 1.8.0
The function ‘gpgme_op_keylist_from_data_start’ initiates a key
listing operation inside the context CTX. In contrast to the other
unsigned long EXPIRES, gpgme_key_t EXTRAKEY,
unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_createkey’ generates a new key for the
procotol active in the context CTX. As of now this function does
only work for OpenPGP and requires at least version 2.1.13 of
‘GPGME_CREATE_ENCR’
‘GPGME_CREATE_CERT’
‘GPGME_CREATE_AUTH’
+ SINCE: 1.7.0
+
Do not create the key with the default capabilities (key
usage) of the requested algorithm but use those explicitly
given by these flags: “signing”, “encryption”,
protocol.
‘GPGME_CREATE_NOPASSWD’
+ SINCE: 1.7.0
+
Request generation of the key without password protection.
‘GPGME_CREATE_SELFSIGNED’
+ SINCE: 1.7.0
+
For an X.509 key do not create a CSR but a self-signed
certificate. This has not yet been implemented.
‘GPGME_CREATE_NOSTORE’
+ SINCE: 1.7.0
+
Do not store the created key in the local key database. This
has not yet been implemented.
‘GPGME_CREATE_WANTPUB’
‘GPGME_CREATE_WANTSEC’
+ SINCE: 1.7.0
+
Return the public or secret key as part of the result
structure. This has not yet been implemented.
‘GPGME_CREATE_FORCE’
+ SINCE: 1.7.0
+
The engine does not allow the creation of a key with a user ID
already existing in the local key database. This flag can be
used to override this check.
‘GPGME_CREATE_NOEXPIRE’
+ SINCE: 1.8.0
+
Request generation of keys that do not expire.
After the operation completed successfully, information about the
unsigned long EXPIRES, gpgme_key_t EXTRAKEY,
unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_createkey_start’ initiates a
‘gpgme_op_createkey’ operation; see there for details. It must be
completed by calling ‘gpgme_wait’ on the context. *Note Waiting
gpgme_key_t KEY, const char *ALGO, unsigned long RESERVED,
unsigned long EXPIRES, unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_createsubkey’ creates and adds a new subkey
to the primary OpenPGP key given by KEY. The only allowed protocol
in CTX is ‘GPGME_PROTOCOL_OPENPGP’. Subkeys (aka secondary keys)
unsigned long RESERVED, unsigned long EXPIRES,
unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_createsubkey_start’ initiates a
‘gpgme_op_createsubkey’ operation; see there for details. It must
be completed by calling ‘gpgme_wait’ on the context. *Note Waiting
-- Function: gpgme_error_t gpgme_op_adduid (gpgme_ctx_t CTX,
gpgme_key_t KEY, const char *USERID, unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_adduid’ adds a new user ID to the OpenPGP
key given by KEY. Adding additional user IDs after key creation is
a feature of the OpenPGP protocol and thus the protocol for the
-- Function: gpgme_error_t gpgme_op_adduid_start (gpgme_ctx_t CTX,
gpgme_key_t KEY, const char *USERID, unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_adduid_start’ initiates a ‘gpgme_op_adduid’
operation; see there for details. It must be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
-- Function: gpgme_error_t gpgme_op_revuid (gpgme_ctx_t CTX,
gpgme_key_t KEY, const char *USERID, unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_revuid’ revokes a user ID from the OpenPGP
key given by KEY. Revoking user IDs after key creation is a
feature of the OpenPGP protocol and thus the protocol for the
-- Function: gpgme_error_t gpgme_op_revuid_start (gpgme_ctx_t CTX,
gpgme_key_t KEY, const char *USERID, unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_revuid_start’ initiates a ‘gpgme_op_revuid’
operation; see there for details. It must be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
gpgme_key_t KEY, const char *USERID, cons char * NAME,
cons char * VALUE);
+ SINCE: 1.8.0
+
The function ‘gpgme_op_set_uid_flag’ is used to set flags on a user
ID from the OpenPGP key given by KEY. Setting flags on user IDs
after key creation is a feature of the OpenPGP protocol and thus
(gpgme_ctx_t CTX, gpgme_key_t KEY, const char *USERID,
cons char * NAME, cons char * VALUE);
+ SINCE: 1.8.0
+
The function ‘gpgme_op_set_uid_flag_start’ initiates a
‘gpgme_op_set_uid_flag’ operation; see there for details. It must
be completed by calling ‘gpgme_wait’ on the context. *Note Waiting
provide the fingerprint, ‘fpr’ will be a null pointer.
‘gpgme_data_t pubkey’
+ SINCE: 1.7.0
+
This will eventually be used to return the public key. It is
currently not used.
‘gpgme_data_t seckey’
+ SINCE: 1.7.0
+
This will eventually be used to return the secret key. It is
currently not used.
gpgme_key_t KEY, const char *USERID, unsigned long EXPIRES,
unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_keysign’ adds a new key signature to the
public key KEY. This function requires at least version 2.1.12 of
GnuPG.
FLAGS can be set to the bit-wise OR of the following flags:
‘GPGME_KEYSIGN_LOCAL’
+ SINCE: 1.7.0
+
Instead of creating an exportable key signature, create a key
signature which is is marked as non-exportable.
‘GPGME_KEYSIGN_LFSEP’
+ SINCE: 1.7.0
+
Although linefeeds are uncommon in user IDs this flag is
required to explicitly declare that USERID may contain several
linefeed separated user IDs.
gpgme_key_t KEY, const char *USERID, unsigned long EXPIRES,
unsigned int FLAGS);
+ SINCE: 1.7.0
+
The function ‘gpgme_op_keysign_start’ initiates a
‘gpgme_op_keysign’ operation; see there for details. It must be
completed by calling ‘gpgme_wait’ on the context. *Note Waiting
the export function is set to ‘NULL’.
‘GPGME_EXPORT_MODE_MINIMAL’
+ SINCE: 1.3.1
+
If this bit is set, the smallest possible key is exported. For
OpenPGP keys it removes all signatures except for the latest
self-signatures. For X.509 keys it has no effect.
‘GPGME_EXPORT_MODE_SECRET’
+ SINCE: 1.6.0
+
Instead of exporting the public key, the secret key is exported.
This may not be combined with ‘GPGME_EXPORT_MODE_EXTERN’. For
X.509 the export format is PKCS#8.
‘GPGME_EXPORT_MODE_RAW’
+ SINCE: 1.6.0
+
If this flag is used with ‘GPGME_EXPORT_MODE_SECRET’ for an X.509
key the export format will be changed to PKCS#1. This flag may not
be used with OpenPGP.
‘GPGME_EXPORT_MODE_PKCS12’
+ SINCE: 1.6.0
+
If this flag is used with ‘GPGME_EXPORT_MODE_SECRET’ for an X.509
key the export format will be changed to PKCS#12 which also
includes the certificate. This flag may not be used with OpenPGP.
-- Function: gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t CTX,
gpgme_key_t keys[], gpgme_export_mode_t MODE,
gpgme_data_t KEYDATA)
+ SINCE: 1.2.0
+
The function ‘gpgme_op_export_keys’ extracts public keys and
returns them in the data buffer KEYDATA. The output format of the
key data returned is determined by the ASCII armor attribute set
-- Function: gpgme_error_t gpgme_op_export_keys_start (gpgme_ctx_t CTX,
gpgme_key_t KEYS[], gpgme_export_mode_t MODE,
gpgme_data_t KEYDATA)
+ SINCE: 1.2.0
+
The function ‘gpgme_op_export_keys_start’ initiates a
‘gpgme_op_export_ext’ operation. It can be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
context. *Note Waiting For Completion::.
The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
- import could be started successfully, ‘GPG_ERR_INV_VALUE’ if
- KEYDATA if CTX or KEYDATA is not a valid pointer, and
- ‘GPG_ERR_NO_DATA’ if KEYDATA is an empty data buffer.
+ import could be started successfully, ‘GPG_ERR_INV_VALUE’ if CTX or
+ KEYDATA is not a valid pointer, and ‘GPG_ERR_NO_DATA’ if KEYDATA is
+ an empty data buffer.
-- Function: gpgme_error_t gpgme_op_import_keys (gpgme_ctx_t CTX,
gpgme_key_t *KEYS)
+ SINCE: 1.2.0
+
The function ‘gpgme_op_import_keys’ adds the keys described by the
‘NULL’ terminated array KEYS to the key ring of the crypto engine
- used by CTX. This function is the general interface to move a key
- from one crypto engine to another as long as they are compatible.
- In particular it is used to actually import and make keys permanent
+ used by CTX. It is used to actually import and make keys permanent
which have been retrieved from an external source (i.e. using
- ‘GPGME_KEYLIST_MODE_EXTERN’). (1)
+ ‘GPGME_KEYLIST_MODE_EXTERN’) earlier. The external keylisting must
+ have been made with the same context configuration (in particular
+ the same home directory). (1) Note that for OpenPGP this may
+ require another access to the keyserver over the network.
Only keys of the currently selected protocol of CTX are considered
for import. Other keys specified by the KEYS are ignored. As of
now all considered keys must have been retrieved using the same
- method, that is the used key listing mode must be identical.
+ method, i.e. the used key listing mode must be identical.
After the operation completed successfully, the result can be
retrieved with ‘gpgme_op_import_result’.
+ To move keys from one home directory to another, export and import
+ the keydata using ‘gpgme_op_export’ and ‘gpgme_op_import’.
+
The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
- import was completed successfully, ‘GPG_ERR_INV_VALUE’ if KEYDATA
- if CTX or KEYDATA is not a valid pointer, ‘GPG_ERR_CONFLICT’ if the
- key listing mode does not match, and ‘GPG_ERR_NO_DATA’ if no keys
- are considered for export.
+ import was completed successfully, ‘GPG_ERR_INV_VALUE’ if CTX is
+ not a valid pointer, ‘GPG_ERR_CONFLICT’ if the key listing mode
+ does not match, and ‘GPG_ERR_NO_DATA’ if no keys are considered for
+ export.
-- Function: gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t CTX,
gpgme_key_t *KEYS)
+ SINCE: 1.2.0
+
The function ‘gpgme_op_import_keys_start’ initiates a
‘gpgme_op_import_keys’ operation. It can be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
7.5.9 Deleting Keys
-------------------
- -- Function: gpgme_error_t gpgme_op_delete (gpgme_ctx_t CTX,
- const gpgme_key_t KEY, int ALLOW_SECRET)
- The function ‘gpgme_op_delete’ deletes the key KEY from the key
- ring of the crypto engine used by CTX. If ALLOW_SECRET is ‘0’,
- only public keys are deleted, otherwise secret keys are deleted as
- well, if that is supported.
+ -- Function: gpgme_error_t gpgme_op_delete_ext (gpgme_ctx_t CTX,
+ const gpgme_key_t KEY, unsigned int FLAGS)
+ SINCE: 1.9.1
+
+ The function ‘gpgme_op_delete_ext’ deletes the key KEY from the key
+ ring of the crypto engine used by CTX.
+
+ FLAGS can be set to the bit-wise OR of the following flags:
+
+ ‘GPGME_DELETE_ALLOW_SECRET’
+ SINCE: 1.9.1
+
+ If not set, only public keys are deleted. If set, secret keys
+ are deleted as well, if that is supported.
+
+ ‘GPGME_DELETE_FORCE’
+ SINCE: 1.9.1
+
+ If set, the user is not asked to confirm the deletion.
The function returns the error code ‘GPG_ERR_NO_ERROR’ if the key
was deleted successfully, ‘GPG_ERR_INV_VALUE’ if CTX or KEY is not
unambiguously, and ‘GPG_ERR_CONFLICT’ if the secret key for KEY is
available, but ALLOW_SECRET is zero.
- -- Function: gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t CTX,
- const gpgme_key_t KEY, int ALLOW_SECRET)
- The function ‘gpgme_op_delete_start’ initiates a ‘gpgme_op_delete’
- operation. It can be completed by calling ‘gpgme_wait’ on the
- context. *Note Waiting For Completion::.
+ -- Function: gpgme_error_t gpgme_op_delete_ext_start (gpgme_ctx_t CTX,
+ const gpgme_key_t KEY, unsigned int FLAGS)
+ SINCE: 1.9.1
+
+ The function ‘gpgme_op_delete_ext_start’ initiates a
+ ‘gpgme_op_delete’ operation. It can be completed by calling
+ ‘gpgme_wait’ on the context. *Note Waiting For Completion::.
The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX
or KEY is not a valid pointer.
+ The following functions allow only to use one particular flag.
+
+ -- Function: gpgme_error_t gpgme_op_delete (gpgme_ctx_t CTX,
+ const gpgme_key_t KEY, int ALLOW_SECRET)
+ Similar to ‘gpgme_op_delete_ext’, but only the flag
+ ‘GPGME_DELETE_ALLOW_SECRET’ can be provided.
+
+ -- Function: gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t CTX,
+ const gpgme_key_t KEY, int ALLOW_SECRET)
+ Similar to ‘gpgme_op_delete_ext_start’, but only the flag
+ ‘GPGME_DELETE_ALLOW_SECRET’ can be provided.
+
\1f
File: gpgme.info, Node: Changing Passphrases, Next: Changing TOFU Data, Prev: Deleting Keys, Up: Key Management
-- Function: gpgme_error_t gpgme_op_passwd (gpgme_ctx_t CTX,
const gpgme_key_t KEY, unsigned int FLAGS)
+ SINCE: 1.3.0
+
The function ‘gpgme_op_passwd’ changes the passphrase of the
private key associated with KEY. The only allowed value for FLAGS
is ‘0’. The backend engine will usually popup a window to ask for
-- Function: gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t CTX,
const gpgme_key_t KEY, unsigned int FLAGS)
+ SINCE: 1.3.0
+
The function ‘gpgme_op_passwd_start’ initiates a ‘gpgme_op_passwd’
operation. It can be completed by calling ‘gpgme_wait’ on the
context. *Note Waiting For Completion::.
for a key. See the GnuPG manual for details on the TOFU implementation.
-- Data type: enum gpgme_tofu_policy_t
+ SINCE: 1.7.0
+
The ‘gpgme_tofu_policy_t’ type specifies the set of possible policy
values that are supported by GPGME:
-- Function: gpgme_error_t gpgme_op_tofu_policy (gpgme_ctx_t CTX,
const gpgme_key_t KEY, gpgme_tofu_policy_t POLICY)
+ SINCE: 1.7.0
+
The function ‘gpgme_op_tofu_policy’ changes the TOFU policy of KEY.
The valid values for POLICY are listed above. As of now this
function does only work for OpenPGP and requires at least version
-- Function: gpgme_error_t gpgme_op_tofu_policy_start (gpgme_ctx_t CTX,
const gpgme_key_t KEY, gpgme_tofu_policy_t POLICY)
+ SINCE: 1.7.0
+
The function ‘gpgme_op_tofu_policy_start’ initiates a
‘gpgme_op_tofu_policy’ operation. It can be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
-- Data type: gpgme_error_t (*gpgme_interact_cb_t) (void *HANDLE,
const char *STATUS, const char *ARGS, int FD)
+
+ SINCE: 1.7.0
+
The ‘gpgme_interact_cb_t’ type is the type of functions which GPGME
calls if it a key interact operation is on-going. The status
keyword STATUS and the argument line ARGS are passed through by
-- Function: gpgme_error_t gpgme_op_interact (gpgme_ctx_t CTX,
gpgme_key_t KEY, unsigned int FLAGS, gpgme_interact_cb_t FNC,
void *HANDLE, gpgme_data_t OUT)
+
+ SINCE: 1.7.0
+
The function ‘gpgme_op_interact’ processes the key KEY
interactively, using the interact callback function FNC with the
handle HANDLE. The callback is invoked for every status and
value is:
‘GPGME_INTERACT_CARD’
+ SINCE: 1.7.0
+
This is used for smartcard based keys and uses gpg’s
‘--card-edit’ command.
-- Function: gpgme_error_t gpgme_op_interact_start (gpgme_ctx_t CTX,
gpgme_key_t KEY, unsigned int FLAGS, gpgme_interact_cb_t FNC,
void *HANDLE, gpgme_data_t OUT)
+
+ SINCE: 1.7.0
+
The function ‘gpgme_op_interact_start’ initiates a
‘gpgme_op_interact’ operation. It can be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
CIPHER does not contain any data to decrypt,
‘GPG_ERR_DECRYPT_FAILED’ if CIPHER is not a valid cipher text,
‘GPG_ERR_BAD_PASSPHRASE’ if the passphrase for the secret key could
- not be retrieved, and passes through any errors that are reported
+ not be retrieved, and passes through some errors that are reported
by the crypto engine support routines.
-- Function: gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t CTX,
gpgme_decrypt_flags_t FLAGS, gpgme_data_t CIPHER,
gpgme_data_t PLAIN)
+ SINCE: 1.8.0
+
The function ‘gpgme_op_decrypt_ext’ is the same as
‘gpgme_op_decrypt_ext’ but has an additional argument FLAGS. If
FLAGS is 0 both function behave identically.
of the following bit values:
‘GPGME_DECRYPT_VERIFY’
+ SINCE: 1.8.0
+
The ‘GPGME_DECRYPT_VERIFY’ symbol specifies that this function
shall exacty act as ‘gpgme_op_decrypt_verify’.
‘GPGME_DECRYPT_UNWRAP’
+ SINCE: 1.8.0
+
The ‘GPGME_DECRYPT_UNWRAP’ symbol specifies that the output
shall be an OpenPGP message with only the encryption layer
removed. This requires GnuPG 2.1.12 and works only for
gpgme_ctx_t CTX, gpgme_decrypt_flags_t FLAGS,
gpgme_data_t CIPHER, gpgme_data_t PLAIN)
+ SINCE: 1.8.0
+
The function ‘gpgme_op_decrypt_ext_start’ initiates a
‘gpgme_op_decrypt_ext’ operation. It can be completed by calling
‘gpgme_wait’ on the context. *Note Waiting For Completion::.
CIPHER or PLAIN is not a valid pointer.
-- Data type: gpgme_recipient_t
+ SINCE: 1.1.0
+
This is a pointer to a structure used to store information about
the recipient of an encrypted text which is decrypted in a
‘gpgme_op_decrypt’ operation. This information (except for the
describes the algorithm that is not supported.
‘unsigned int wrong_key_usage : 1’
+ SINCE: 0.9.0
+
This is true if the key was not used according to its policy.
‘gpgme_recipient_t recipients’
+ SINCE: 1.1.0
+
This is a linked list of recipients to which this message was
encrypted.
it is known, otherwise this is a null pointer.
‘char *session_key’
+ SINCE: 1.8.0
+
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
combination of one or multiple of the following bit values:
‘GPGME_SIG_NOTATION_HUMAN_READABLE’
+ SINCE: 1.1.0
+
The ‘GPGME_SIG_NOTATION_HUMAN_READABLE’ symbol specifies
that the notation data is in human readable form
‘GPGME_SIG_NOTATION_CRITICAL’
+ SINCE: 1.1.0
+
The ‘GPGME_SIG_NOTATION_CRITICAL’ symbol specifies that
the notation data is critical.
‘GPGME_SIGSUM_SYS_ERROR’
A system error occured.
+ ‘GPGME_SIGSUM_TOFU_CONFLICT’
+ A TOFU conflict was detected.
+
‘char *fpr’
This is the fingerprint or key ID of the signature.
also be reflected by the validity of the signature.
‘unsigned int chain_model : 1’
+ SINCE: 1.1.6
+
This is true if the validity of the signature has been checked
using the chain model. In the chain model the time the
signature has been created must be within the validity period
The mailbox from the PKA information or ‘NULL’.
‘gpgme_key_t key’
+ SINCE: 1.7.0
+
An object describing the key used to create the signature.
This key object may be incomplete in that it only conveys
information availabale directly with a signature. It may also
-- Function: char * gpgme_addrspec_from_uid (const char *UID)
+ SINCE: 1.7.1
+
Return the mail address (called “addr-spec” in RFC-5322) from the
string UID which is assumed to be a user id (called “address” in
RFC-5322). All plain ASCII characters (i.e. those with bit 7
Calling this function acquires an additional reference for the key.
-- Function: unsigned int gpgme_signers_count (const gpgme_ctx_t CTX)
+ SINCE: 1.4.3
+
The function ‘gpgme_signers_count’ returns the number of signer
keys in the context CTX.
signature is verified.
-- Function: void gpgme_sig_notation_clear (gpgme_ctx_t CTX)
+ SINCE: 1.1.0
+
The function ‘gpgme_sig_notation_clear’ removes the notation data
from the context CTX. Subsequent signing operations from this
context will not include any notation data.
-- Function: gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t CTX,
const char *NAME, const char *VALUE,
gpgme_sig_notation_flags_t FLAGS)
+ SINCE: 1.1.0
+
The function ‘gpgme_sig_notation_add’ adds the notation data with
the name NAME and the value VALUE to the context CTX.
-- Function: gpgme_sig_notation_t gpgme_sig_notation_get
(const gpgme_ctx_t CTX)
+ SINCE: 1.1.0
+
The function ‘gpgme_sig_notation_get’ returns the linked list of
notation data structures that are contained in the context CTX.
untrusted keys.
‘GPGME_ENCRYPT_NO_ENCRYPT_TO’
+ SINCE: 1.2.0
+
The ‘GPGME_ENCRYPT_NO_ENCRYPT_TO’ symbol specifies that no
default or hidden default recipients as configured in the
crypto backend should be included. This can be useful for
managing different user profiles.
‘GPGME_ENCRYPT_NO_COMPRESS’
+ SINCE: 1.5.0
+
The ‘GPGME_ENCRYPT_NO_COMPRESS’ symbol specifies that the
plaintext shall not be compressed before it is encrypted.
This is in some cases useful if the length of the encrypted
symbol the UI Server is advised to also expect a sign command.
‘GPGME_ENCRYPT_SYMMETRIC’
+ SINCE: 1.7.0
+
The ‘GPGME_ENCRYPT_SYMMETRIC’ symbol specifies that the output
should be additionally encrypted symmetrically even if
recipients are provided. This feature is only supported for
for the OpenPGP crypto engine.
‘GPGME_ENCRYPT_THROW_KEYIDS’
+ SINCE: 1.8.0
+
The ‘GPGME_ENCRYPT_THROW_KEYIDS’ symbols requests that the
identifiers for the decrption keys are not included in the
ciphertext. On the receiving side, the use of this flag may
encryption.
‘GPGME_ENCRYPT_WRAP’
+ SINCE: 1.8.0
+
The ‘GPGME_ENCRYPT_WRAP’ symbol specifies that the input is an
OpenPGP message and not a plain data. This is the counterpart
to ‘GPGME_DECRYPT_UNWRAP’.
gpgme_data_t DATAOUT, gpgme_data_t DATAERR,
unsigned int FLAGS)
+ SINCE: 1.5.0
+
The function ‘gpgme_op_spawn’ runs the program FILE with the
arguments taken from the NULL terminated array ARGV. If no
arguments are required ARGV may be given as ‘NULL’. In the latter
of the following bit values:
‘GPGME_SPAWN_DETACHED’
+ SINCE: 1.5.0
+
Under Windows this flag inhibits the allocation of a new
console for the program. This is useful for a GUI application
which needs to call a command line helper tool.
+
‘GPGME_SPAWN_ALLOW_SET_FG’
+ SINCE: 1.5.0
+
Under Windows this flag allows the called program to put
itself into the foreground.
gpgme_data_t DATAOUT, gpgme_data_t DATAERR,
unsigned int FLAGS)
+ SINCE: 1.5.0
+
This is the asynchronous variant of ‘gpgme_op_spawn’.
\1f
-- Data type: gpgme_error_t (*gpgme_assuan_data_cb_t) (void *OPAQUE,
const void *DATA, size_t DATALEN)
+ SINCE: 1.2.0
+
This callback receives any data sent by the server. OPAQUE is the
pointer passed to ‘gpgme_op_assuan_transact_start’, DATA of length
DATALEN refers to the data sent.
-- Data type: gpgme_error_t (*gpgme_assuan_inquire_cb_t) (void *OPAQUE,
const char *NAME, const char *ARGS, gpgme_data_t *R_DATA)
+ SINCE: 1.2.0
+
This callback is used to provide additional data to the Assuan
server. OPAQUE is the pointer passed to
‘gpgme_op_assuan_transact_start’, NAME and ARGS specify what kind
-- Data type: gpgme_error_t (*gpgme_assuan_status_cb_t) (void *OPAQUE,
const char *STATUS, const char *ARGS)
+ SINCE: 1.2.0
+
This callback receives any status lines sent by the server. OPAQUE
is the pointer passed to ‘gpgme_op_assuan_transact_start’, STATUS
and ARGS denote the status update sent.
gpgme_assuan_inquire_cb_t INQUIRE_CB, void * INQUIRE_CB_VALUE,
gpgme_assuan_status_cb_t STATUS_CB, void * STATUS_CB_VALUE)
+ SINCE: 1.2.0
+
Send the Assuan COMMAND and return results via the callbacks. Any
callback may be ‘NULL’. The result of the operation may be
retrieved using ‘gpgme_wait_ext’.
available.
-- Data type: gpgme_query_swdb_result_t
+ SINCE: 1.8.0
+
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
enough.
‘error’
- If this flag is set some other error has occured.
+ If this flag is set some other error has occurred.
‘version’
The version string 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)
+ SINCE: 1.8.0
+
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
-- Function: gpgme_query_swdb_result_t gpgme_op_query_swdb_result
(gpgme_ctx_t CTX)
+ SINCE: 1.8.0
+
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
+ valid if the last operation on the context was a successful 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.
‘gpgme_event_io_cb_t’ function with GPGME and will always be passed
as the first argument when registering a callback function. For
example, the user can use this to determine the context in which
- this event has occured.
+ this event has occurred.
- TYPE will specify the type of event that has occured. TYPE_DATA
+ TYPE will specify the type of event that has occurred. TYPE_DATA
specifies the event further, as described in the above list of
possible ‘gpgme_event_io_t’ types.
‘void *event_priv’
This is passed as the first argument to the ‘event’ function
when it is called by GPGME. For example, it can be used to
- determine the context in which the event has occured.
+ determine the context in which the event has occurred.
-- Function: void gpgme_set_io_cbs (gpgme_ctx_t CTX,
struct gpgme_io_cbs *IO_CBS)
I/O occurs in the target context).
-- Function: gpgme_ctx_t gpgme_cancel (gpgme_ctx_t CTX)
+ SINCE: 0.4.5
+
The function ‘gpgme_cancel’ attempts to cancel a pending operation
in the context CTX. This only works if you use the global event
loop or your own event loop.
this case the state of CTX is not modified).
-- Function: gpgme_ctx_t gpgme_cancel_async (gpgme_ctx_t CTX)
+ SINCE: 1.1.7
+
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
commands. Afterwards, the actual operation is requested:
-- Command: CHECKSUM_CREATE_FILES --nohup
- Request that checksums are created for the files specifed by
+ Request that checksums are created for the files specified by
‘FILE’. The choice of checksum algorithm and the destination
storage and format for the created checksums depend on the
preferences of the user and the functionality provided by the UI
the operation asynchronously.
-- Command: CHECKSUM_VERIFY_FILES --nohup
- Request that checksums are created for the files specifed by ‘FILE’
- and verified against previously created and stored checksums. The
- choice of checksum algorithm and the source storage and format for
- previously created checksums depend on the preferences of the user
- and the functionality provided by the UI server. For directories,
- the server may offer multiple options to the user (for example
- ignore or process recursively).
+ Request that checksums are created for the files specified by
+ ‘FILE’ and verified against previously created and stored
+ checksums. The choice of checksum algorithm and the source storage
+ and format for previously created checksums depend on the
+ preferences of the user and the functionality provided by the UI
+ server. For directories, the server may offer multiple options to
+ the user (for example ignore or process recursively).
If the source storage of previously created checksums is available
to the user through the Windows shell, this command may also accept
This command may be used at any time and overrides the effect of
the last command. A ‘RESET’ undoes the effect of this command.
-\1f
-File: gpgme.info, Node: Debugging, Next: Deprecated Functions, Prev: UI Server Protocol, Up: Top
-
-Appendix B How to solve problems
-********************************
-
-Everyone knows that software often does not do what it should do and
-thus there is a need to track down problems. This is in particular true
-for applications using a complex library like GPGME and of course also
-for the library itself. Here we give a few hints on how to solve such
-problems.
-
- First of all you should make sure that the keys you want to use are
-installed in the GnuPG engine and are usable. Thus the first test is to
-run the desired operation using ‘gpg’ or ‘gpgsm’ on the command line.
-If you can’t figure out why things don’t work, you may use GPGME’s built
-in trace feature. This feature is either enabled using the environment
-variable ‘GPGME_DEBUG’ or, if this is not possible, by calling the
-function ‘gpgme_set_global_flag’. The value is the trace level and an
-optional file name. If no file name is given the trace output is
-printed to ‘stderr’.
-
-For example
- GPGME_DEBUG=9:/home/user/mygpgme.log
-(Note that under Windows you use a semicolon in place of the colon to
-separate the fields.)
-
- A trace level of 9 is pretty verbose and thus you may want to start
-off with a lower level. The exact definition of the trace levels and
-the output format may change with any release; you need to check the
-source code for details. In any case the trace log should be helpful to
-understand what is going going on. Warning: The trace log may reveal
-sensitive details like passphrases or other data you use in your
-application. If you are asked to send a log file, make sure that you
-run your tests only with play data.
-
-\1f
-File: gpgme.info, Node: Deprecated Functions, Next: Library Copying, Prev: Debugging, Up: Top
-
-Appendix C Deprecated Functions
-*******************************
-
-For backward compatibility GPGME has a number of functions, data types
-and constants which are deprecated and should not be used anymore. We
-document here those which are really old to help understanding old code
-and to allow migration to their modern counterparts.
-
- *Warning:* These interfaces will be removed in a future version of
-GPGME.
-
- -- Function: void gpgme_key_release (gpgme_key_t KEY)
- The function ‘gpgme_key_release’ is equivalent to
- ‘gpgme_key_unref’.
-
- -- Function: void gpgme_trust_item_release (gpgme_trust_item_t ITEM)
- The function ‘gpgme_trust_item_release’ is an alias for
- ‘gpgme_trust_item_unref’.
-
- -- Function: gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t CTX,
- gpgme_data_t KEYDATA, int *NR)
- The function ‘gpgme_op_import_ext’ is equivalent to:
-
- gpgme_error_t err = gpgme_op_import (ctx, keydata);
- if (!err)
- {
- gpgme_import_result_t result = gpgme_op_import_result (ctx);
- *nr = result->considered;
- }
-
- -- Data type: gpgme_error_t (*gpgme_edit_cb_t) (void *HANDLE,
- gpgme_status_code_t STATUS, const char *ARGS, int FD)
- The ‘gpgme_edit_cb_t’ type is the type of functions which GPGME
- calls if it a key edit operation is on-going. The status code
- STATUS and the argument line ARGS are passed through by GPGME from
- the crypto engine. The file descriptor FD is -1 for normal status
- messages. If STATUS indicates a command rather than a status
- message, the response to the command should be written to FD. The
- HANDLE is provided by the user at start of operation.
-
- The function should return ‘GPG_ERR_FALSE’ if it did not handle the
- status code, ‘0’ for success, or any other error value.
-
- -- Function: gpgme_error_t gpgme_op_edit (gpgme_ctx_t CTX,
- gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
- gpgme_data_t OUT)
- Note: This function is deprecated, please use ‘gpgme_op_interact’
- instead.
-
- The function ‘gpgme_op_edit’ processes the key KEY interactively,
- using the edit callback function FNC with the handle HANDLE. The
- callback is invoked for every status and command request from the
- crypto engine. The output of the crypto engine is written to the
- data object OUT.
-
- Note that the protocol between the callback function and the crypto
- engine is specific to the crypto engine and no further support in
- implementing this protocol correctly is provided by GPGME.
-
- The function returns the error code ‘GPG_ERR_NO_ERROR’ if the edit
- operation completes successfully, ‘GPG_ERR_INV_VALUE’ if CTX or KEY
- is not a valid pointer, and any error returned by the crypto engine
- or the edit callback handler.
-
- -- Function: gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t CTX,
- gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
- gpgme_data_t OUT)
- Note: This function is deprecated, please use
- ‘gpgme_op_interact_start’ instead.
-
- The function ‘gpgme_op_edit_start’ initiates a ‘gpgme_op_edit’
- operation. It can be completed by calling ‘gpgme_wait’ on the
- context. *Note Waiting For Completion::.
-
- The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
- operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX
- or KEY is not a valid pointer.
-
- -- Function: gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t CTX,
- gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
- gpgme_data_t OUT)
- Note: This function is deprecated, please use ‘gpgme_op_interact’
- with the flag ‘GPGME_INTERACT_CARD’ instead.
-
- The function ‘gpgme_op_card_edit’ is analogous to ‘gpgme_op_edit’,
- but should be used to process the smart card corresponding to the
- key KEY.
-
- -- Function: gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t CTX,
- gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
- gpgme_data_t OUT)
- Note: This function is deprecated, please use
- ‘gpgme_op_interact_start’ with the flag ‘GPGME_INTERACT_CARD’
- instead.
-
- The function ‘gpgme_op_card_edit_start’ initiates a
- ‘gpgme_op_card_edit’ operation. It can be completed by calling
- ‘gpgme_wait’ on the context. *Note Waiting For Completion::.
-
- The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
- operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX
- or KEY is not a valid pointer.
-
- -- Function: gpgme_error_t gpgme_data_new_with_read_cb
- (gpgme_data_t *DH, int (*READFUNC) (void *HOOK, char *BUFFER,
- size_t COUNT, size_t *NREAD), void *HOOK_VALUE)
- The function ‘gpgme_data_new_with_read_cb’ creates a new
- ‘gpgme_data_t’ object and uses the callback function READFUNC to
- retrieve the data on demand. As the callback function can supply
- the data in any way it wants, this is the most flexible data type
- GPGME provides. However, it can not be used to write data.
-
- The callback function receives HOOK_VALUE as its first argument
- whenever it is invoked. It should return up to COUNT bytes in
- BUFFER, and return the number of bytes actually read in NREAD. It
- may return ‘0’ in NREAD if no data is currently available. To
- indicate ‘EOF’ the function should return with an error code of
- ‘-1’ and set NREAD to ‘0’. The callback function may support to
- reset its internal read pointer if it is invoked with BUFFER and
- NREAD being ‘NULL’ and COUNT being ‘0’.
-
- The function returns the error code ‘GPG_ERR_NO_ERROR’ if the data
- object was successfully created, ‘GPG_ERR_INV_VALUE’ if DH or
- READFUNC is not a valid pointer, and ‘GPG_ERR_ENOMEM’ if not enough
- memory is available.
-
- -- Function: gpgme_error_t gpgme_data_rewind (gpgme_data_t DH)
- The function ‘gpgme_data_rewind’ is equivalent to:
-
- return (gpgme_data_seek (dh, 0, SEEK_SET) == -1)
- ? gpgme_error_from_errno (errno) : 0;
-
- -- Data type: gpgme_attr_t
- The ‘gpgme_attr_t’ type is used to specify a key or trust item
- attribute. The following attributes are defined:
-
- ‘GPGME_ATTR_KEYID’
- This is the key ID of a sub key. It is representable as a
- string.
-
- For trust items, the trust item refers to the key with this
- ID.
-
- ‘GPGME_ATTR_FPR’
- This is the fingerprint of a sub key. It is representable as
- a string.
-
- ‘GPGME_ATTR_ALGO’
- This is the crypto algorithm for which the sub key can be
- used. It is representable as a string and as a number. The
- numbers correspond to the ‘enum gcry_pk_algos’ values in the
- gcrypt library.
-
- ‘GPGME_ATTR_LEN’
- This is the key length of a sub key. It is representable as a
- number.
-
- ‘GPGME_ATTR_CREATED’
- This is the timestamp at creation time of a sub key. It is
- representable as a number.
-
- ‘GPGME_ATTR_EXPIRE’
- This is the expiration time of a sub key. It is representable
- as a number.
-
- ‘GPGME_ATTR_OTRUST’
- XXX FIXME (also for trust items)
-
- ‘GPGME_ATTR_USERID’
- This is a user ID. There can be more than one user IDs in a
- GPGME_KEY_T object. The first one (with index 0) is the
- primary user ID. The user ID is representable as a number.
-
- For trust items, this is the user ID associated with this
- trust item.
-
- ‘GPGME_ATTR_NAME’
- This is the name belonging to a user ID. It is representable
- as a string.
-
- ‘GPGME_ATTR_EMAIL’
- This is the email address belonging to a user ID. It is
- representable as a string.
-
- ‘GPGME_ATTR_COMMENT’
- This is the comment belonging to a user ID. It is
- representable as a string.
-
- ‘GPGME_ATTR_VALIDITY’
- This is the validity belonging to a user ID. It is
- representable as a string and as a number. See below for a
- list of available validities.
-
- For trust items, this is the validity that is associated with
- this trust item.
-
- ‘GPGME_ATTR_UID_REVOKED’
- This specifies if a user ID is revoked. It is representable
- as a number, and is ‘1’ if the user ID is revoked, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_UID_INVALID’
- This specifies if a user ID is invalid. It is representable
- as a number, and is ‘1’ if the user ID is invalid, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_LEVEL’
- This is the trust level of a trust item.
-
- ‘GPGME_ATTR_TYPE’
- This returns information about the type of key. For the
- string function this will eother be "PGP" or "X.509". The
- integer function returns 0 for PGP and 1 for X.509. It is
- also used for the type of a trust item.
-
- ‘GPGME_ATTR_IS_SECRET’
- This specifies if the key is a secret key. It is
- representable as a number, and is ‘1’ if the key is revoked,
- and ‘0’ otherwise.
-
- ‘GPGME_ATTR_KEY_REVOKED’
- This specifies if a sub key is revoked. It is representable
- as a number, and is ‘1’ if the key is revoked, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_KEY_INVALID’
- This specifies if a sub key is invalid. It is representable
- as a number, and is ‘1’ if the key is invalid, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_KEY_EXPIRED’
- This specifies if a sub key is expired. It is representable
- as a number, and is ‘1’ if the key is expired, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_KEY_DISABLED’
- This specifies if a sub key is disabled. It is representable
- as a number, and is ‘1’ if the key is disabled, and ‘0’
- otherwise.
-
- ‘GPGME_ATTR_KEY_CAPS’
- This is a description of the capabilities of a sub key. It is
- representable as a string. The string contains the letter “e”
- if the key can be used for encryption, “s” if the key can be
- used for signatures, and “c” if the key can be used for
- certifications.
-
- ‘GPGME_ATTR_CAN_ENCRYPT’
- This specifies if a sub key can be used for encryption. It is
- representable as a number, and is ‘1’ if the sub key can be
- used for encryption, and ‘0’ otherwise.
-
- ‘GPGME_ATTR_CAN_SIGN’
- This specifies if a sub key can be used to create data
- signatures. It is representable as a number, and is ‘1’ if
- the sub key can be used for signatures, and ‘0’ otherwise.
-
- ‘GPGME_ATTR_CAN_CERTIFY’
- This specifies if a sub key can be used to create key
- certificates. It is representable as a number, and is ‘1’ if
- the sub key can be used for certifications, and ‘0’ otherwise.
-
- ‘GPGME_ATTR_SERIAL’
- The X.509 issuer serial attribute of the key. It is
- representable as a string.
-
- ‘GPGME_ATTR_ISSUE’
- The X.509 issuer name attribute of the key. It is
- representable as a string.
-
- ‘GPGME_ATTR_CHAINID’
- The X.509 chain ID can be used to build the certification
- chain. It is representable as a string.
-
- -- Function: const char * gpgme_key_get_string_attr (gpgme_key_t KEY,
- gpgme_attr_t WHAT, const void *RESERVED, int IDX)
- The function ‘gpgme_key_get_string_attr’ returns the value of the
- string-representable attribute WHAT of key KEY. If the attribute
- is an attribute of a sub key or an user ID, IDX specifies the sub
- key or user ID of which the attribute value is returned. The
- argument RESERVED is reserved for later use and should be ‘NULL’.
-
- The string returned is only valid as long as the key is valid.
-
- The function returns ‘0’ if an attribute can’t be returned as a
- string, KEY is not a valid pointer, IDX out of range, or RESERVED
- not ‘NULL’.
-
- -- Function: unsigned long gpgme_key_get_ulong_attr (gpgme_key_t KEY,
- gpgme_attr_t WHAT, const void *RESERVED, int IDX)
- The function ‘gpgme_key_get_ulong_attr’ returns the value of the
- number-representable attribute WHAT of key KEY. If the attribute
- is an attribute of a sub key or an user ID, IDX specifies the sub
- key or user ID of which the attribute value is returned. The
- argument RESERVED is reserved for later use and should be ‘NULL’.
-
- The function returns ‘0’ if the attribute can’t be returned as a
- number, KEY is not a valid pointer, IDX out of range, or RESERVED
- not ‘NULL’.
-
- The signatures on a key are only available if the key was retrieved
-via a listing operation with the ‘GPGME_KEYLIST_MODE_SIGS’ mode enabled,
-because it is expensive to retrieve all signatures of a key.
-
- So, before using the below interfaces to retrieve the signatures on a
-key, you have to make sure that the key was listed with signatures
-enabled. One convenient, but blocking, way to do this is to use the
-function ‘gpgme_get_key’.
-
- -- Data type: gpgme_attr_t
- The ‘gpgme_attr_t’ type is used to specify a key signature
- attribute. The following attributes are defined:
-
- ‘GPGME_ATTR_KEYID’
- This is the key ID of the key which was used for the
- signature. It is representable as a string.
-
- ‘GPGME_ATTR_ALGO’
- This is the crypto algorithm used to create the signature. It
- is representable as a string and as a number. The numbers
- correspond to the ‘enum gcry_pk_algos’ values in the gcrypt
- library.
-
- ‘GPGME_ATTR_CREATED’
- This is the timestamp at creation time of the signature. It
- is representable as a number.
-
- ‘GPGME_ATTR_EXPIRE’
- This is the expiration time of the signature. It is
- representable as a number.
-
- ‘GPGME_ATTR_USERID’
- This is the user ID associated with the signing key. The user
- ID is representable as a number.
-
- ‘GPGME_ATTR_NAME’
- This is the name belonging to a user ID. It is representable
- as a string.
-
- ‘GPGME_ATTR_EMAIL’
- This is the email address belonging to a user ID. It is
- representable as a string.
-
- ‘GPGME_ATTR_COMMENT’
- This is the comment belonging to a user ID. It is
- representable as a string.
-
- ‘GPGME_ATTR_KEY_REVOKED’
- This specifies if a key signature is a revocation signature.
- It is representable as a number, and is ‘1’ if the key is
- revoked, and ‘0’ otherwise.
-
- ‘GPGME_ATTR_SIG_CLASS’
- This specifies the signature class of a key signature. It is
- representable as a number. The meaning is specific to the
- crypto engine.
-
- ‘GPGME_ATTR_SIG_CLASS’
- This specifies the signature class of a key signature. It is
- representable as a number. The meaning is specific to the
- crypto engine.
-
- ‘GPGME_ATTR_SIG_STATUS’
- This is the same value as returned by ‘gpgme_get_sig_status’.
-
- -- Function: const char * gpgme_key_sig_get_string_attr
- (gpgme_key_t KEY, int UID_IDX, gpgme_attr_t WHAT,
- const void *RESERVED, int IDX)
- The function ‘gpgme_key_sig_get_string_attr’ returns the value of
- the string-representable attribute WHAT of the signature IDX on the
- user ID UID_IDX in the key KEY. The argument RESERVED is reserved
- for later use and should be ‘NULL’.
-
- The string returned is only valid as long as the key is valid.
-
- The function returns ‘0’ if an attribute can’t be returned as a
- string, KEY is not a valid pointer, UID_IDX or IDX out of range, or
- RESERVED not ‘NULL’.
-
- -- Function: unsigned long gpgme_key_sig_get_ulong_attr
- (gpgme_key_t KEY, int UID_IDX, gpgme_attr_t WHAT,
- const void *RESERVED, int IDX)
- The function ‘gpgme_key_sig_get_ulong_attr’ returns the value of
- the number-representable attribute WHAT of the signature IDX on the
- user ID UID_IDX in the key KEY. The argument RESERVED is reserved
- for later use and should be ‘NULL’.
-
- The function returns ‘0’ if an attribute can’t be returned as a
- string, KEY is not a valid pointer, UID_IDX or IDX out of range, or
- RESERVED not ‘NULL’.
-
- Trust items have attributes which can be queried using the interfaces
-below. The attribute identifiers are shared with those for key
-attributes. *Note Information About Keys::.
-
- -- Function: const char * gpgme_trust_item_get_string_attr
- (gpgme_trust_item_t ITEM, gpgme_attr_t WHAT,
- const void *RESERVED, int IDX)
- The function ‘gpgme_trust_item_get_string_attr’ returns the value
- of the string-representable attribute WHAT of trust item ITEM. The
- arguments IDX and RESERVED are reserved for later use and should be
- ‘0’ and ‘NULL’ respectively.
-
- The string returned is only valid as long as the key is valid.
-
- The function returns ‘0’ if an attribute can’t be returned as a
- string, KEY is not a valid pointer, IDX out of range, or RESERVED
- not ‘NULL’.
-
- -- Function: int gpgme_trust_item_get_int_attr
- (gpgme_trust_item_t ITEM, gpgme_attr_t WHAT,
- const void *RESERVED, int IDX)
- The function ‘gpgme_trust_item_get_int_attr’ returns the value of
- the number-representable attribute WHAT of trust item ITEM. If the
- attribute occurs more than once in the trust item, the index is
- specified by IDX. However, currently no such attribute exists, so
- IDX should be ‘0’. The argument RESERVED is reserved for later use
- and should be ‘NULL’.
-
- The function returns ‘0’ if the attribute can’t be returned as a
- number, KEY is not a valid pointer, IDX out of range, or RESERVED
- not ‘NULL’.
-
- -- Data type: enum gpgme_sig_stat_t
- The ‘gpgme_sig_stat_t’ type holds the result of a signature check,
- or the combined result of all signatures. The following results
- are possible:
-
- ‘GPGME_SIG_STAT_NONE’
- This status should not occur in normal operation.
-
- ‘GPGME_SIG_STAT_GOOD’
- This status indicates that the signature is valid. For the
- combined result this status means that all signatures are
- valid.
-
- ‘GPGME_SIG_STAT_GOOD_EXP’
- This status indicates that the signature is valid but expired.
- For the combined result this status means that all signatures
- are valid and expired.
-
- ‘GPGME_SIG_STAT_GOOD_EXPKEY’
- This status indicates that the signature is valid but the key
- used to verify the signature has expired. For the combined
- result this status means that all signatures are valid and all
- keys are expired.
-
- ‘GPGME_SIG_STAT_BAD’
- This status indicates that the signature is invalid. For the
- combined result this status means that all signatures are
- invalid.
-
- ‘GPGME_SIG_STAT_NOKEY’
- This status indicates that the signature could not be verified
- due to a missing key. For the combined result this status
- means that all signatures could not be checked due to missing
- keys.
-
- ‘GPGME_SIG_STAT_NOSIG’
- This status indicates that the signature data provided was not
- a real signature.
-
- ‘GPGME_SIG_STAT_ERROR’
- This status indicates that there was some other error which
- prevented the signature verification.
-
- ‘GPGME_SIG_STAT_DIFF’
- For the combined result this status means that at least two
- signatures have a different status. You can get each key’s
- status with ‘gpgme_get_sig_status’.
-
- -- Function: const char * gpgme_get_sig_status (gpgme_ctx_t CTX,
- int IDX, gpgme_sig_stat_t *R_STAT, time_t *R_CREATED)
- The function ‘gpgme_get_sig_status’ is equivalent to:
-
- gpgme_verify_result_t result;
- gpgme_signature_t sig;
-
- result = gpgme_op_verify_result (ctx);
- sig = result->signatures;
-
- while (sig && idx)
- {
- sig = sig->next;
- idx--;
- }
- if (!sig || idx)
- return NULL;
-
- if (r_stat)
- {
- switch (gpg_err_code (sig->status))
- {
- case GPG_ERR_NO_ERROR:
- *r_stat = GPGME_SIG_STAT_GOOD;
- break;
-
- case GPG_ERR_BAD_SIGNATURE:
- *r_stat = GPGME_SIG_STAT_BAD;
- break;
-
- case GPG_ERR_NO_PUBKEY:
- *r_stat = GPGME_SIG_STAT_NOKEY;
- break;
-
- case GPG_ERR_NO_DATA:
- *r_stat = GPGME_SIG_STAT_NOSIG;
- break;
-
- case GPG_ERR_SIG_EXPIRED:
- *r_stat = GPGME_SIG_STAT_GOOD_EXP;
- break;
-
- case GPG_ERR_KEY_EXPIRED:
- *r_stat = GPGME_SIG_STAT_GOOD_EXPKEY;
- break;
-
- default:
- *r_stat = GPGME_SIG_STAT_ERROR;
- break;
- }
- }
- if (r_created)
- *r_created = sig->timestamp;
- return sig->fpr;
-
- -- Function: const char * gpgme_get_sig_string_attr (gpgme_ctx_t CTX,
- int IDX, gpgme_attr_t WHAT, int WHATIDX)
- The function ‘gpgme_get_sig_string_attr’ is equivalent to:
-
- gpgme_verify_result_t result;
- gpgme_signature_t sig;
-
- result = gpgme_op_verify_result (ctx);
- sig = result->signatures;
-
- while (sig && idx)
- {
- sig = sig->next;
- idx--;
- }
- if (!sig || idx)
- return NULL;
-
- switch (what)
- {
- case GPGME_ATTR_FPR:
- return sig->fpr;
-
- case GPGME_ATTR_ERRTOK:
- if (whatidx == 1)
- return sig->wrong_key_usage ? "Wrong_Key_Usage" : "";
- else
- return "";
- default:
- break;
- }
-
- return NULL;
-
- -- Function: const char * gpgme_get_sig_ulong_attr (gpgme_ctx_t CTX,
- int IDX, gpgme_attr_t WAHT, int WHATIDX)
- The function ‘gpgme_get_sig_ulong_attr’ is equivalent to:
-
- gpgme_verify_result_t result;
- gpgme_signature_t sig;
-
- result = gpgme_op_verify_result (ctx);
- sig = result->signatures;
-
- while (sig && idx)
- {
- sig = sig->next;
- idx--;
- }
- if (!sig || idx)
- return 0;
-
- switch (what)
- {
- case GPGME_ATTR_CREATED:
- return sig->timestamp;
-
- case GPGME_ATTR_EXPIRE:
- return sig->exp_timestamp;
-
- case GPGME_ATTR_VALIDITY:
- return (unsigned long) sig->validity;
-
- case GPGME_ATTR_SIG_STATUS:
- switch (sig->status)
- {
- case GPG_ERR_NO_ERROR:
- return GPGME_SIG_STAT_GOOD;
-
- case GPG_ERR_BAD_SIGNATURE:
- return GPGME_SIG_STAT_BAD;
-
- case GPG_ERR_NO_PUBKEY:
- return GPGME_SIG_STAT_NOKEY;
-
- case GPG_ERR_NO_DATA:
- return GPGME_SIG_STAT_NOSIG;
-
- case GPG_ERR_SIG_EXPIRED:
- return GPGME_SIG_STAT_GOOD_EXP;
-
- case GPG_ERR_KEY_EXPIRED:
- return GPGME_SIG_STAT_GOOD_EXPKEY;
-
- default:
- return GPGME_SIG_STAT_ERROR;
- }
-
- case GPGME_ATTR_SIG_SUMMARY:
- return sig->summary;
-
- default:
- break;
- }
- return 0;
-
- -- Function: const char * gpgme_get_sig_key (gpgme_ctx_t CTX, int IDX,
- gpgme_key_t *R_KEY)
- The function ‘gpgme_get_sig_key’ is equivalent to:
-
- gpgme_verify_result_t result;
- gpgme_signature_t sig;
-
- result = gpgme_op_verify_result (ctx);
- sig = result->signatures;
-
- while (sig && idx)
- {
- sig = sig->next;
- idx--;
- }
- if (!sig || idx)
- return gpg_error (GPG_ERR_EOF);
-
- return gpgme_get_key (ctx, sig->fpr, r_key, 0);
-
This file documents the GPGME library.
- This is Edition 1.9.0, last updated 16 November 2016, of ‘The ‘GnuPG
-Made Easy’ Reference Manual’, for Version 1.9.0.
+ This is Edition 1.10.0, last updated 8 December 2017, of ‘The ‘GnuPG
+Made Easy’ Reference Manual’, for Version 1.10.0.
Copyright © 2002–2008, 2010, 2012–2017 g10 Code GmbH.
Public License for more details.
\1f
+File: gpgme.info, Node: Debugging, Next: Deprecated Functions, Prev: UI Server Protocol, Up: Top
+
+Appendix B How to solve problems
+********************************
+
+Everyone knows that software often does not do what it should do and
+thus there is a need to track down problems. This is in particular true
+for applications using a complex library like GPGME and of course also
+for the library itself. Here we give a few hints on how to solve such
+problems.
+
+ First of all you should make sure that the keys you want to use are
+installed in the GnuPG engine and are usable. Thus the first test is to
+run the desired operation using ‘gpg’ or ‘gpgsm’ on the command line.
+If you can’t figure out why things don’t work, you may use GPGME’s built
+in trace feature. This feature is either enabled using the environment
+variable ‘GPGME_DEBUG’ or, if this is not possible, by calling the
+function ‘gpgme_set_global_flag’. The value is the trace level and an
+optional file name. If no file name is given the trace output is
+printed to ‘stderr’.
+
+For example
+ GPGME_DEBUG=9:/home/user/mygpgme.log
+(Note that under Windows you use a semicolon in place of the colon to
+separate the fields.)
+
+ A trace level of 9 is pretty verbose and thus you may want to start
+off with a lower level. The exact definition of the trace levels and
+the output format may change with any release; you need to check the
+source code for details. In any case the trace log should be helpful to
+understand what is going going on. Warning: The trace log may reveal
+sensitive details like passphrases or other data you use in your
+application. If you are asked to send a log file, make sure that you
+run your tests only with play data.
+
+\1f
+File: gpgme.info, Node: Deprecated Functions, Next: Library Copying, Prev: Debugging, Up: Top
+
+Appendix C Deprecated Functions
+*******************************
+
+For backward compatibility GPGME has a number of functions, data types
+and constants which are deprecated and should not be used anymore. We
+document here those which are really old to help understanding old code
+and to allow migration to their modern counterparts.
+
+ *Warning:* These interfaces will be removed in a future version of
+GPGME.
+
+ -- Function: void gpgme_key_release (gpgme_key_t KEY)
+ The function ‘gpgme_key_release’ is equivalent to
+ ‘gpgme_key_unref’.
+
+ -- Function: void gpgme_trust_item_release (gpgme_trust_item_t ITEM)
+ The function ‘gpgme_trust_item_release’ is an alias for
+ ‘gpgme_trust_item_unref’.
+
+ -- Function: gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t CTX,
+ gpgme_data_t KEYDATA, int *NR)
+ SINCE: 0.3.9
+
+ The function ‘gpgme_op_import_ext’ is equivalent to:
+
+ gpgme_error_t err = gpgme_op_import (ctx, keydata);
+ if (!err)
+ {
+ gpgme_import_result_t result = gpgme_op_import_result (ctx);
+ *nr = result->considered;
+ }
+
+ -- Data type: gpgme_error_t (*gpgme_edit_cb_t) (void *HANDLE,
+ gpgme_status_code_t STATUS, const char *ARGS, int FD)
+ The ‘gpgme_edit_cb_t’ type is the type of functions which GPGME
+ calls if it a key edit operation is on-going. The status code
+ STATUS and the argument line ARGS are passed through by GPGME from
+ the crypto engine. The file descriptor FD is -1 for normal status
+ messages. If STATUS indicates a command rather than a status
+ message, the response to the command should be written to FD. The
+ HANDLE is provided by the user at start of operation.
+
+ The function should return ‘GPG_ERR_FALSE’ if it did not handle the
+ status code, ‘0’ for success, or any other error value.
+
+ -- Function: gpgme_error_t gpgme_op_edit (gpgme_ctx_t CTX,
+ gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
+ gpgme_data_t OUT)
+ SINCE: 0.3.9
+
+ Note: This function is deprecated, please use ‘gpgme_op_interact’
+ instead.
+
+ The function ‘gpgme_op_edit’ processes the key KEY interactively,
+ using the edit callback function FNC with the handle HANDLE. The
+ callback is invoked for every status and command request from the
+ crypto engine. The output of the crypto engine is written to the
+ data object OUT.
+
+ Note that the protocol between the callback function and the crypto
+ engine is specific to the crypto engine and no further support in
+ implementing this protocol correctly is provided by GPGME.
+
+ The function returns the error code ‘GPG_ERR_NO_ERROR’ if the edit
+ operation completes successfully, ‘GPG_ERR_INV_VALUE’ if CTX or KEY
+ is not a valid pointer, and any error returned by the crypto engine
+ or the edit callback handler.
+
+ -- Function: gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t CTX,
+ gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
+ gpgme_data_t OUT)
+
+ SINCE: 0.3.9
+
+ Note: This function is deprecated, please use
+ ‘gpgme_op_interact_start’ instead.
+
+ The function ‘gpgme_op_edit_start’ initiates a ‘gpgme_op_edit’
+ operation. It can be completed by calling ‘gpgme_wait’ on the
+ context. *Note Waiting For Completion::.
+
+ The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
+ operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX
+ or KEY is not a valid pointer.
+
+ -- Function: gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t CTX,
+ gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
+ gpgme_data_t OUT)
+ Note: This function is deprecated, please use ‘gpgme_op_interact’
+ with the flag ‘GPGME_INTERACT_CARD’ instead.
+
+ The function ‘gpgme_op_card_edit’ is analogous to ‘gpgme_op_edit’,
+ but should be used to process the smart card corresponding to the
+ key KEY.
+
+ -- Function: gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t CTX,
+ gpgme_key_t KEY, gpgme_edit_cb_t FNC, void *HANDLE,
+ gpgme_data_t OUT)
+ Note: This function is deprecated, please use
+ ‘gpgme_op_interact_start’ with the flag ‘GPGME_INTERACT_CARD’
+ instead.
+
+ The function ‘gpgme_op_card_edit_start’ initiates a
+ ‘gpgme_op_card_edit’ operation. It can be completed by calling
+ ‘gpgme_wait’ on the context. *Note Waiting For Completion::.
+
+ The function returns the error code ‘GPG_ERR_NO_ERROR’ if the
+ operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX
+ or KEY is not a valid pointer.
+
+ -- Function: gpgme_error_t gpgme_data_new_with_read_cb
+ (gpgme_data_t *DH, int (*READFUNC) (void *HOOK, char *BUFFER,
+ size_t COUNT, size_t *NREAD), void *HOOK_VALUE)
+ The function ‘gpgme_data_new_with_read_cb’ creates a new
+ ‘gpgme_data_t’ object and uses the callback function READFUNC to
+ retrieve the data on demand. As the callback function can supply
+ the data in any way it wants, this is the most flexible data type
+ GPGME provides. However, it can not be used to write data.
+
+ The callback function receives HOOK_VALUE as its first argument
+ whenever it is invoked. It should return up to COUNT bytes in
+ BUFFER, and return the number of bytes actually read in NREAD. It
+ may return ‘0’ in NREAD if no data is currently available. To
+ indicate ‘EOF’ the function should return with an error code of
+ ‘-1’ and set NREAD to ‘0’. The callback function may support to
+ reset its internal read pointer if it is invoked with BUFFER and
+ NREAD being ‘NULL’ and COUNT being ‘0’.
+
+ The function returns the error code ‘GPG_ERR_NO_ERROR’ if the data
+ object was successfully created, ‘GPG_ERR_INV_VALUE’ if DH or
+ READFUNC is not a valid pointer, and ‘GPG_ERR_ENOMEM’ if not enough
+ memory is available.
+
+ -- Function: gpgme_error_t gpgme_data_rewind (gpgme_data_t DH)
+ The function ‘gpgme_data_rewind’ is equivalent to:
+
+ return (gpgme_data_seek (dh, 0, SEEK_SET) == -1)
+ ? gpgme_error_from_errno (errno) : 0;
+
+ -- Data type: gpgme_attr_t
+ The ‘gpgme_attr_t’ type is used to specify a key or trust item
+ attribute. The following attributes are defined:
+
+ ‘GPGME_ATTR_KEYID’
+ This is the key ID of a sub key. It is representable as a
+ string.
+
+ For trust items, the trust item refers to the key with this
+ ID.
+
+ ‘GPGME_ATTR_FPR’
+ This is the fingerprint of a sub key. It is representable as
+ a string.
+
+ ‘GPGME_ATTR_ALGO’
+ This is the crypto algorithm for which the sub key can be
+ used. It is representable as a string and as a number. The
+ numbers correspond to the ‘enum gcry_pk_algos’ values in the
+ gcrypt library.
+
+ ‘GPGME_ATTR_LEN’
+ This is the key length of a sub key. It is representable as a
+ number.
+
+ ‘GPGME_ATTR_CREATED’
+ This is the timestamp at creation time of a sub key. It is
+ representable as a number.
+
+ ‘GPGME_ATTR_EXPIRE’
+ This is the expiration time of a sub key. It is representable
+ as a number.
+
+ ‘GPGME_ATTR_OTRUST’
+ XXX FIXME (also for trust items)
+
+ ‘GPGME_ATTR_USERID’
+ This is a user ID. There can be more than one user IDs in a
+ GPGME_KEY_T object. The first one (with index 0) is the
+ primary user ID. The user ID is representable as a number.
+
+ For trust items, this is the user ID associated with this
+ trust item.
+
+ ‘GPGME_ATTR_NAME’
+ This is the name belonging to a user ID. It is representable
+ as a string.
+
+ ‘GPGME_ATTR_EMAIL’
+ This is the email address belonging to a user ID. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_COMMENT’
+ This is the comment belonging to a user ID. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_VALIDITY’
+ This is the validity belonging to a user ID. It is
+ representable as a string and as a number. See below for a
+ list of available validities.
+
+ For trust items, this is the validity that is associated with
+ this trust item.
+
+ ‘GPGME_ATTR_UID_REVOKED’
+ This specifies if a user ID is revoked. It is representable
+ as a number, and is ‘1’ if the user ID is revoked, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_UID_INVALID’
+ This specifies if a user ID is invalid. It is representable
+ as a number, and is ‘1’ if the user ID is invalid, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_LEVEL’
+ This is the trust level of a trust item.
+
+ ‘GPGME_ATTR_TYPE’
+ This returns information about the type of key. For the
+ string function this will eother be "PGP" or "X.509". The
+ integer function returns 0 for PGP and 1 for X.509. It is
+ also used for the type of a trust item.
+
+ ‘GPGME_ATTR_IS_SECRET’
+ This specifies if the key is a secret key. It is
+ representable as a number, and is ‘1’ if the key is revoked,
+ and ‘0’ otherwise.
+
+ ‘GPGME_ATTR_KEY_REVOKED’
+ This specifies if a sub key is revoked. It is representable
+ as a number, and is ‘1’ if the key is revoked, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_KEY_INVALID’
+ This specifies if a sub key is invalid. It is representable
+ as a number, and is ‘1’ if the key is invalid, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_KEY_EXPIRED’
+ This specifies if a sub key is expired. It is representable
+ as a number, and is ‘1’ if the key is expired, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_KEY_DISABLED’
+ This specifies if a sub key is disabled. It is representable
+ as a number, and is ‘1’ if the key is disabled, and ‘0’
+ otherwise.
+
+ ‘GPGME_ATTR_KEY_CAPS’
+ This is a description of the capabilities of a sub key. It is
+ representable as a string. The string contains the letter “e”
+ if the key can be used for encryption, “s” if the key can be
+ used for signatures, and “c” if the key can be used for
+ certifications.
+
+ ‘GPGME_ATTR_CAN_ENCRYPT’
+ This specifies if a sub key can be used for encryption. It is
+ representable as a number, and is ‘1’ if the sub key can be
+ used for encryption, and ‘0’ otherwise.
+
+ ‘GPGME_ATTR_CAN_SIGN’
+ This specifies if a sub key can be used to create data
+ signatures. It is representable as a number, and is ‘1’ if
+ the sub key can be used for signatures, and ‘0’ otherwise.
+
+ ‘GPGME_ATTR_CAN_CERTIFY’
+ This specifies if a sub key can be used to create key
+ certificates. It is representable as a number, and is ‘1’ if
+ the sub key can be used for certifications, and ‘0’ otherwise.
+
+ ‘GPGME_ATTR_SERIAL’
+ The X.509 issuer serial attribute of the key. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_ISSUE’
+ The X.509 issuer name attribute of the key. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_CHAINID’
+ The X.509 chain ID can be used to build the certification
+ chain. It is representable as a string.
+
+ -- Function: const char * gpgme_key_get_string_attr (gpgme_key_t KEY,
+ gpgme_attr_t WHAT, const void *RESERVED, int IDX)
+ The function ‘gpgme_key_get_string_attr’ returns the value of the
+ string-representable attribute WHAT of key KEY. If the attribute
+ is an attribute of a sub key or an user ID, IDX specifies the sub
+ key or user ID of which the attribute value is returned. The
+ argument RESERVED is reserved for later use and should be ‘NULL’.
+
+ The string returned is only valid as long as the key is valid.
+
+ The function returns ‘0’ if an attribute can’t be returned as a
+ string, KEY is not a valid pointer, IDX out of range, or RESERVED
+ not ‘NULL’.
+
+ -- Function: unsigned long gpgme_key_get_ulong_attr (gpgme_key_t KEY,
+ gpgme_attr_t WHAT, const void *RESERVED, int IDX)
+ The function ‘gpgme_key_get_ulong_attr’ returns the value of the
+ number-representable attribute WHAT of key KEY. If the attribute
+ is an attribute of a sub key or an user ID, IDX specifies the sub
+ key or user ID of which the attribute value is returned. The
+ argument RESERVED is reserved for later use and should be ‘NULL’.
+
+ The function returns ‘0’ if the attribute can’t be returned as a
+ number, KEY is not a valid pointer, IDX out of range, or RESERVED
+ not ‘NULL’.
+
+ The signatures on a key are only available if the key was retrieved
+via a listing operation with the ‘GPGME_KEYLIST_MODE_SIGS’ mode enabled,
+because it is expensive to retrieve all signatures of a key.
+
+ So, before using the below interfaces to retrieve the signatures on a
+key, you have to make sure that the key was listed with signatures
+enabled. One convenient, but blocking, way to do this is to use the
+function ‘gpgme_get_key’.
+
+ -- Data type: gpgme_attr_t
+ The ‘gpgme_attr_t’ type is used to specify a key signature
+ attribute. The following attributes are defined:
+
+ ‘GPGME_ATTR_KEYID’
+ This is the key ID of the key which was used for the
+ signature. It is representable as a string.
+
+ ‘GPGME_ATTR_ALGO’
+ This is the crypto algorithm used to create the signature. It
+ is representable as a string and as a number. The numbers
+ correspond to the ‘enum gcry_pk_algos’ values in the gcrypt
+ library.
+
+ ‘GPGME_ATTR_CREATED’
+ This is the timestamp at creation time of the signature. It
+ is representable as a number.
+
+ ‘GPGME_ATTR_EXPIRE’
+ This is the expiration time of the signature. It is
+ representable as a number.
+
+ ‘GPGME_ATTR_USERID’
+ This is the user ID associated with the signing key. The user
+ ID is representable as a number.
+
+ ‘GPGME_ATTR_NAME’
+ This is the name belonging to a user ID. It is representable
+ as a string.
+
+ ‘GPGME_ATTR_EMAIL’
+ This is the email address belonging to a user ID. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_COMMENT’
+ This is the comment belonging to a user ID. It is
+ representable as a string.
+
+ ‘GPGME_ATTR_KEY_REVOKED’
+ This specifies if a key signature is a revocation signature.
+ It is representable as a number, and is ‘1’ if the key is
+ revoked, and ‘0’ otherwise.
+
+ ‘GPGME_ATTR_SIG_CLASS’
+ This specifies the signature class of a key signature. It is
+ representable as a number. The meaning is specific to the
+ crypto engine.
+
+ ‘GPGME_ATTR_SIG_CLASS’
+ This specifies the signature class of a key signature. It is
+ representable as a number. The meaning is specific to the
+ crypto engine.
+
+ ‘GPGME_ATTR_SIG_STATUS’
+ This is the same value as returned by ‘gpgme_get_sig_status’.
+
+ -- Function: const char * gpgme_key_sig_get_string_attr
+ (gpgme_key_t KEY, int UID_IDX, gpgme_attr_t WHAT,
+ const void *RESERVED, int IDX)
+ The function ‘gpgme_key_sig_get_string_attr’ returns the value of
+ the string-representable attribute WHAT of the signature IDX on the
+ user ID UID_IDX in the key KEY. The argument RESERVED is reserved
+ for later use and should be ‘NULL’.
+
+ The string returned is only valid as long as the key is valid.
+
+ The function returns ‘0’ if an attribute can’t be returned as a
+ string, KEY is not a valid pointer, UID_IDX or IDX out of range, or
+ RESERVED not ‘NULL’.
+
+ -- Function: unsigned long gpgme_key_sig_get_ulong_attr
+ (gpgme_key_t KEY, int UID_IDX, gpgme_attr_t WHAT,
+ const void *RESERVED, int IDX)
+ The function ‘gpgme_key_sig_get_ulong_attr’ returns the value of
+ the number-representable attribute WHAT of the signature IDX on the
+ user ID UID_IDX in the key KEY. The argument RESERVED is reserved
+ for later use and should be ‘NULL’.
+
+ The function returns ‘0’ if an attribute can’t be returned as a
+ string, KEY is not a valid pointer, UID_IDX or IDX out of range, or
+ RESERVED not ‘NULL’.
+
+ Trust items have attributes which can be queried using the interfaces
+below. The attribute identifiers are shared with those for key
+attributes. *Note Information About Keys::.
+
+ -- Function: const char * gpgme_trust_item_get_string_attr
+ (gpgme_trust_item_t ITEM, gpgme_attr_t WHAT,
+ const void *RESERVED, int IDX)
+ The function ‘gpgme_trust_item_get_string_attr’ returns the value
+ of the string-representable attribute WHAT of trust item ITEM. The
+ arguments IDX and RESERVED are reserved for later use and should be
+ ‘0’ and ‘NULL’ respectively.
+
+ The string returned is only valid as long as the key is valid.
+
+ The function returns ‘0’ if an attribute can’t be returned as a
+ string, KEY is not a valid pointer, IDX out of range, or RESERVED
+ not ‘NULL’.
+
+ -- Function: int gpgme_trust_item_get_int_attr
+ (gpgme_trust_item_t ITEM, gpgme_attr_t WHAT,
+ const void *RESERVED, int IDX)
+ The function ‘gpgme_trust_item_get_int_attr’ returns the value of
+ the number-representable attribute WHAT of trust item ITEM. If the
+ attribute occurs more than once in the trust item, the index is
+ specified by IDX. However, currently no such attribute exists, so
+ IDX should be ‘0’. The argument RESERVED is reserved for later use
+ and should be ‘NULL’.
+
+ The function returns ‘0’ if the attribute can’t be returned as a
+ number, KEY is not a valid pointer, IDX out of range, or RESERVED
+ not ‘NULL’.
+
+ -- Data type: enum gpgme_sig_stat_t
+ The ‘gpgme_sig_stat_t’ type holds the result of a signature check,
+ or the combined result of all signatures. The following results
+ are possible:
+
+ ‘GPGME_SIG_STAT_NONE’
+ This status should not occur in normal operation.
+
+ ‘GPGME_SIG_STAT_GOOD’
+ This status indicates that the signature is valid. For the
+ combined result this status means that all signatures are
+ valid.
+
+ ‘GPGME_SIG_STAT_GOOD_EXP’
+ This status indicates that the signature is valid but expired.
+ For the combined result this status means that all signatures
+ are valid and expired.
+
+ ‘GPGME_SIG_STAT_GOOD_EXPKEY’
+ This status indicates that the signature is valid but the key
+ used to verify the signature has expired. For the combined
+ result this status means that all signatures are valid and all
+ keys are expired.
+
+ ‘GPGME_SIG_STAT_BAD’
+ This status indicates that the signature is invalid. For the
+ combined result this status means that all signatures are
+ invalid.
+
+ ‘GPGME_SIG_STAT_NOKEY’
+ This status indicates that the signature could not be verified
+ due to a missing key. For the combined result this status
+ means that all signatures could not be checked due to missing
+ keys.
+
+ ‘GPGME_SIG_STAT_NOSIG’
+ This status indicates that the signature data provided was not
+ a real signature.
+
+ ‘GPGME_SIG_STAT_ERROR’
+ This status indicates that there was some other error which
+ prevented the signature verification.
+
+ ‘GPGME_SIG_STAT_DIFF’
+ For the combined result this status means that at least two
+ signatures have a different status. You can get each key’s
+ status with ‘gpgme_get_sig_status’.
+
+ -- Function: const char * gpgme_get_sig_status (gpgme_ctx_t CTX,
+ int IDX, gpgme_sig_stat_t *R_STAT, time_t *R_CREATED)
+ The function ‘gpgme_get_sig_status’ is equivalent to:
+
+ gpgme_verify_result_t result;
+ gpgme_signature_t sig;
+
+ result = gpgme_op_verify_result (ctx);
+ sig = result->signatures;
+
+ while (sig && idx)
+ {
+ sig = sig->next;
+ idx--;
+ }
+ if (!sig || idx)
+ return NULL;
+
+ if (r_stat)
+ {
+ switch (gpg_err_code (sig->status))
+ {
+ case GPG_ERR_NO_ERROR:
+ *r_stat = GPGME_SIG_STAT_GOOD;
+ break;
+
+ case GPG_ERR_BAD_SIGNATURE:
+ *r_stat = GPGME_SIG_STAT_BAD;
+ break;
+
+ case GPG_ERR_NO_PUBKEY:
+ *r_stat = GPGME_SIG_STAT_NOKEY;
+ break;
+
+ case GPG_ERR_NO_DATA:
+ *r_stat = GPGME_SIG_STAT_NOSIG;
+ break;
+
+ case GPG_ERR_SIG_EXPIRED:
+ *r_stat = GPGME_SIG_STAT_GOOD_EXP;
+ break;
+
+ case GPG_ERR_KEY_EXPIRED:
+ *r_stat = GPGME_SIG_STAT_GOOD_EXPKEY;
+ break;
+
+ default:
+ *r_stat = GPGME_SIG_STAT_ERROR;
+ break;
+ }
+ }
+ if (r_created)
+ *r_created = sig->timestamp;
+ return sig->fpr;
+
+ -- Function: const char * gpgme_get_sig_string_attr (gpgme_ctx_t CTX,
+ int IDX, gpgme_attr_t WHAT, int WHATIDX)
+ The function ‘gpgme_get_sig_string_attr’ is equivalent to:
+
+ gpgme_verify_result_t result;
+ gpgme_signature_t sig;
+
+ result = gpgme_op_verify_result (ctx);
+ sig = result->signatures;
+
+ while (sig && idx)
+ {
+ sig = sig->next;
+ idx--;
+ }
+ if (!sig || idx)
+ return NULL;
+
+ switch (what)
+ {
+ case GPGME_ATTR_FPR:
+ return sig->fpr;
+
+ case GPGME_ATTR_ERRTOK:
+ if (whatidx == 1)
+ return sig->wrong_key_usage ? "Wrong_Key_Usage" : "";
+ else
+ return "";
+ default:
+ break;
+ }
+
+ return NULL;
+
+ -- Function: const char * gpgme_get_sig_ulong_attr (gpgme_ctx_t CTX,
+ int IDX, gpgme_attr_t WAHT, int WHATIDX)
+ The function ‘gpgme_get_sig_ulong_attr’ is equivalent to:
+
+ gpgme_verify_result_t result;
+ gpgme_signature_t sig;
+
+ result = gpgme_op_verify_result (ctx);
+ sig = result->signatures;
+
+ while (sig && idx)
+ {
+ sig = sig->next;
+ idx--;
+ }
+ if (!sig || idx)
+ return 0;
+
+ switch (what)
+ {
+ case GPGME_ATTR_CREATED:
+ return sig->timestamp;
+
+ case GPGME_ATTR_EXPIRE:
+ return sig->exp_timestamp;
+
+ case GPGME_ATTR_VALIDITY:
+ return (unsigned long) sig->validity;
+
+ case GPGME_ATTR_SIG_STATUS:
+ switch (sig->status)
+ {
+ case GPG_ERR_NO_ERROR:
+ return GPGME_SIG_STAT_GOOD;
+
+ case GPG_ERR_BAD_SIGNATURE:
+ return GPGME_SIG_STAT_BAD;
+
+ case GPG_ERR_NO_PUBKEY:
+ return GPGME_SIG_STAT_NOKEY;
+
+ case GPG_ERR_NO_DATA:
+ return GPGME_SIG_STAT_NOSIG;
+
+ case GPG_ERR_SIG_EXPIRED:
+ return GPGME_SIG_STAT_GOOD_EXP;
+
+ case GPG_ERR_KEY_EXPIRED:
+ return GPGME_SIG_STAT_GOOD_EXPKEY;
+
+ default:
+ return GPGME_SIG_STAT_ERROR;
+ }
+
+ case GPGME_ATTR_SIG_SUMMARY:
+ return sig->summary;
+
+ default:
+ break;
+ }
+ return 0;
+
+ -- Function: const char * gpgme_get_sig_key (gpgme_ctx_t CTX, int IDX,
+ gpgme_key_t *R_KEY)
+ The function ‘gpgme_get_sig_key’ is equivalent to:
+
+ gpgme_verify_result_t result;
+ gpgme_signature_t sig;
+
+ result = gpgme_op_verify_result (ctx);
+ sig = result->signatures;
+
+ while (sig && idx)
+ {
+ sig = sig->next;
+ idx--;
+ }
+ if (!sig || idx)
+ return gpg_error (GPG_ERR_EOF);
+
+ return gpgme_get_key (ctx, sig->fpr, r_key, 0);
+
+\1f
File: gpgme.info, Node: Library Copying, Next: Copying, Prev: Deprecated Functions, Up: Top
GNU Lesser General Public License
* ENCRYPT_SIGN_FILES: UI Server Sign/Encrypt Files.
(line 11)
* enum gpgme_data_encoding_t: Data Buffer Meta-Data.
- (line 27)
+ (line 31)
* enum gpgme_data_type_t: Data Buffer Convenience.
(line 6)
* enum gpgme_event_io_t: I/O Callback Interface.
(line 58)
* enum gpgme_hash_algo_t: Hash Algorithms. (line 9)
-* enum gpgme_pinentry_mode_t: Pinentry Mode. (line 19)
+* enum gpgme_pinentry_mode_t: Pinentry Mode. (line 25)
* enum gpgme_protocol_t: Protocols and Engines.
(line 16)
* enum gpgme_pubkey_algo_t: Public Key Algorithms.
* enum gpgme_sig_mode_t: Creating a Signature.
(line 6)
* enum gpgme_sig_stat_t: Deprecated Functions.
- (line 434)
+ (line 441)
* enum gpgme_tofu_policy_t: Changing TOFU Data. (line 10)
* FILE: UI Server Set Input Files.
(line 9)
(line 9)
* gpgme_addrspec_from_uid: Decrypt and Verify. (line 48)
* gpgme_attr_t: Deprecated Functions.
- (line 137)
+ (line 144)
* gpgme_attr_t <1>: Deprecated Functions.
- (line 314)
+ (line 321)
* gpgme_cancel: Cancellation. (line 16)
-* gpgme_cancel_async: Cancellation. (line 36)
+* gpgme_cancel_async: Cancellation. (line 38)
* gpgme_check_version: Library Version Check.
(line 6)
* gpgme_ctx_get_engine_info: Crypto Engine. (line 12)
-* gpgme_ctx_set_engine_info: Crypto Engine. (line 24)
+* gpgme_ctx_set_engine_info: Crypto Engine. (line 26)
* gpgme_ctx_t: Contexts. (line 11)
* gpgme_data_encoding_t: Data Buffer Meta-Data.
- (line 28)
+ (line 32)
* gpgme_data_get_encoding: Data Buffer Meta-Data.
- (line 69)
+ (line 81)
* gpgme_data_get_file_name: Data Buffer Meta-Data.
(line 6)
* gpgme_data_identify: Data Buffer Convenience.
- (line 36)
+ (line 46)
* gpgme_data_new: Memory Based Data Buffers.
(line 12)
* gpgme_data_new_from_cbs: Callback Based Data Buffers.
* gpgme_data_new_from_stream: File Based Data Buffers.
(line 29)
* gpgme_data_new_with_read_cb: Deprecated Functions.
- (line 107)
+ (line 114)
* gpgme_data_read: Data Buffer I/O Operations.
(line 6)
* gpgme_data_read_cb_t: Callback Based Data Buffers.
* gpgme_data_release_cb_t: Callback Based Data Buffers.
(line 55)
* gpgme_data_rewind: Deprecated Functions.
- (line 131)
+ (line 138)
* gpgme_data_seek: Data Buffer I/O Operations.
(line 26)
* gpgme_data_seek_cb_t: Callback Based Data Buffers.
(line 46)
* gpgme_data_set_encoding: Data Buffer Meta-Data.
- (line 75)
+ (line 87)
* gpgme_data_set_file_name: Data Buffer Meta-Data.
- (line 16)
+ (line 18)
* gpgme_data_set_flag: Data Buffer Meta-Data.
- (line 80)
+ (line 92)
* gpgme_data_t: Exchanging Data. (line 13)
* gpgme_data_type_t: Data Buffer Convenience.
(line 7)
(line 16)
* gpgme_data_write_cb_t: Callback Based Data Buffers.
(line 29)
-* gpgme_decrypt_result_t: Decrypt. (line 91)
+* gpgme_decrypt_result_t: Decrypt. (line 101)
* gpgme_edit_cb_t: Deprecated Functions.
- (line 35)
+ (line 37)
* gpgme_encrypt_result_t: Encrypting a Plaintext.
- (line 108)
+ (line 118)
* gpgme_engine_check_version: Engine Version Check.
- (line 65)
+ (line 67)
* gpgme_engine_info_t: Engine Information. (line 6)
* gpgme_error: Error Values. (line 65)
* gpgme_error_from_errno: Error Values. (line 89)
* gpgme_error_t (*gpgme_assuan_data_cb_t) (void *OPAQUE, const void *DATA, size_t DATALEN): Using the Assuan protocol.
(line 15)
* gpgme_error_t (*gpgme_assuan_inquire_cb_t) (void *OPAQUE, const char *NAME, const char *ARGS, gpgme_data_t *R_DATA): Using the Assuan protocol.
- (line 22)
+ (line 24)
* gpgme_error_t (*gpgme_assuan_status_cb_t) (void *OPAQUE, const char *STATUS, const char *ARGS): Using the Assuan protocol.
- (line 34)
+ (line 38)
* gpgme_error_t (*gpgme_edit_cb_t) (void *HANDLE, gpgme_status_code_t STATUS, const char *ARGS, int FD): Deprecated Functions.
- (line 33)
+ (line 35)
* gpgme_error_t (*gpgme_interact_cb_t) (void *HANDLE, const char *STATUS, const char *ARGS, int FD): Advanced Key Editing.
(line 6)
* gpgme_error_t (*gpgme_io_cb_t) (void *DATA, int FD): I/O Callback Interface.
(line 7)
* gpgme_free: Destroying Data Buffers.
(line 25)
-* gpgme_genkey_result_t: Generating Keys. (line 347)
+* gpgme_genkey_result_t: Generating Keys. (line 381)
* gpgme_get_armor: ASCII Armor. (line 13)
* gpgme_get_ctx_flag: Status Message Callback.
- (line 93)
+ (line 109)
* gpgme_get_dirinfo: Engine Version Check.
(line 6)
* gpgme_get_engine_info: Engine Information. (line 46)
* gpgme_get_include_certs: Included Certificates.
- (line 35)
+ (line 37)
* gpgme_get_io_cbs: Registering I/O Callbacks.
(line 44)
-* gpgme_get_key: Listing Keys. (line 177)
-* gpgme_get_keylist_mode: Key Listing Mode. (line 73)
-* gpgme_get_offline: Offline Mode. (line 23)
-* gpgme_get_passphrase_cb: Passphrase Callback. (line 59)
-* gpgme_get_pinentry_mode: Pinentry Mode. (line 14)
+* gpgme_get_key: Listing Keys. (line 178)
+* gpgme_get_keylist_mode: Key Listing Mode. (line 83)
+* gpgme_get_offline: Offline Mode. (line 25)
+* gpgme_get_passphrase_cb: Passphrase Callback. (line 63)
+* gpgme_get_pinentry_mode: Pinentry Mode. (line 18)
* gpgme_get_progress_cb: Progress Meter Callback.
(line 31)
* gpgme_get_protocol: Protocol Selection. (line 21)
* gpgme_get_protocol_name: Protocols and Engines.
- (line 51)
-* gpgme_get_sender: Setting the Sender. (line 27)
+ (line 58)
+* gpgme_get_sender: Setting the Sender. (line 29)
* gpgme_get_sig_key: Deprecated Functions.
- (line 634)
+ (line 641)
* gpgme_get_sig_status: Deprecated Functions.
- (line 482)
+ (line 489)
* gpgme_get_sig_string_attr: Deprecated Functions.
- (line 538)
+ (line 545)
* gpgme_get_sig_ulong_attr: Deprecated Functions.
- (line 572)
+ (line 579)
* gpgme_get_status_cb: Status Message Callback.
- (line 29)
+ (line 31)
* gpgme_get_textmode: Text Mode. (line 20)
-* gpgme_hash_algo_name: Hash Algorithms. (line 28)
+* gpgme_hash_algo_name: Hash Algorithms. (line 30)
* gpgme_hash_algo_t: Hash Algorithms. (line 10)
-* gpgme_import_result_t: Importing Keys. (line 110)
-* gpgme_import_status_t: Importing Keys. (line 72)
+* gpgme_import_result_t: Importing Keys. (line 118)
+* gpgme_import_status_t: Importing Keys. (line 80)
* gpgme_interact_cb_t: Advanced Key Editing.
- (line 8)
+ (line 11)
* gpgme_invalid_key_t: Crypto Operations. (line 10)
* gpgme_io_cb_t: I/O Callback Interface.
(line 7)
-* gpgme_keylist_result_t: Listing Keys. (line 154)
+* gpgme_keylist_result_t: Listing Keys. (line 155)
* gpgme_key_get_string_attr: Deprecated Functions.
- (line 279)
+ (line 286)
* gpgme_key_get_ulong_attr: Deprecated Functions.
- (line 293)
+ (line 300)
* gpgme_key_ref: Manipulating Keys. (line 6)
* gpgme_key_release: Deprecated Functions.
(line 14)
* gpgme_key_sig_get_string_attr: Deprecated Functions.
- (line 370)
+ (line 377)
* gpgme_key_sig_get_ulong_attr: Deprecated Functions.
- (line 386)
-* gpgme_key_sig_t: Key objects. (line 244)
+ (line 393)
+* gpgme_key_sig_t: Key objects. (line 339)
* gpgme_key_t: Key objects. (line 10)
* gpgme_key_unref: Manipulating Keys. (line 10)
* gpgme_new: Creating Contexts. (line 6)
* gpgme_new_signature_t: Creating a Signature.
(line 57)
* gpgme_off_t: Exchanging Data. (line 24)
-* gpgme_op_adduid: Generating Keys. (line 167)
-* gpgme_op_adduid_start: Generating Keys. (line 191)
+* gpgme_op_adduid: Generating Keys. (line 189)
+* gpgme_op_adduid_start: Generating Keys. (line 215)
* gpgme_op_assuan_transact_ext: Using the Assuan protocol.
- (line 56)
+ (line 64)
* gpgme_op_assuan_transact_start: Using the Assuan protocol.
- (line 41)
+ (line 47)
* gpgme_op_card_edit: Deprecated Functions.
- (line 82)
+ (line 89)
* gpgme_op_card_edit_start: Deprecated Functions.
- (line 92)
+ (line 99)
* gpgme_op_createkey: Generating Keys. (line 14)
-* gpgme_op_createkey_start: Generating Keys. (line 103)
-* gpgme_op_createsubkey: Generating Keys. (line 114)
-* gpgme_op_createsubkey_start: Generating Keys. (line 156)
+* gpgme_op_createkey_start: Generating Keys. (line 119)
+* gpgme_op_createsubkey: Generating Keys. (line 132)
+* gpgme_op_createsubkey_start: Generating Keys. (line 176)
* gpgme_op_decrypt: Decrypt. (line 6)
* gpgme_op_decrypt_ext: Decrypt. (line 30)
-* gpgme_op_decrypt_ext_start: Decrypt. (line 54)
-* gpgme_op_decrypt_result: Decrypt. (line 128)
+* gpgme_op_decrypt_ext_start: Decrypt. (line 60)
+* gpgme_op_decrypt_result: Decrypt. (line 144)
* gpgme_op_decrypt_start: Decrypt. (line 20)
* gpgme_op_decrypt_verify: Decrypt and Verify. (line 6)
* 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_delete: Deleting Keys. (line 47)
+* gpgme_op_delete_ext: Deleting Keys. (line 6)
+* gpgme_op_delete_ext_start: Deleting Keys. (line 33)
+* gpgme_op_delete_start: Deleting Keys. (line 52)
* gpgme_op_edit: Deprecated Functions.
- (line 46)
+ (line 48)
* gpgme_op_edit_start: Deprecated Functions.
- (line 68)
+ (line 72)
* gpgme_op_encrypt: Encrypting a Plaintext.
(line 6)
* gpgme_op_encrypt_result: Encrypting a Plaintext.
- (line 119)
+ (line 129)
* gpgme_op_encrypt_sign: Encrypting a Plaintext.
- (line 130)
+ (line 140)
* gpgme_op_encrypt_sign_start: Encrypting a Plaintext.
- (line 141)
+ (line 151)
* gpgme_op_encrypt_start: Encrypting a Plaintext.
- (line 90)
-* gpgme_op_export: Exporting Keys. (line 38)
-* gpgme_op_export_ext: Exporting Keys. (line 71)
-* gpgme_op_export_ext_start: Exporting Keys. (line 93)
-* gpgme_op_export_keys: Exporting Keys. (line 105)
-* gpgme_op_export_keys_start: Exporting Keys. (line 130)
-* gpgme_op_export_start: Exporting Keys. (line 59)
-* gpgme_op_genkey: Generating Keys. (line 270)
-* gpgme_op_genkey_result: Generating Keys. (line 380)
-* gpgme_op_genkey_start: Generating Keys. (line 335)
+ (line 100)
+* gpgme_op_export: Exporting Keys. (line 46)
+* gpgme_op_export_ext: Exporting Keys. (line 79)
+* gpgme_op_export_ext_start: Exporting Keys. (line 101)
+* gpgme_op_export_keys: Exporting Keys. (line 113)
+* gpgme_op_export_keys_start: Exporting Keys. (line 140)
+* gpgme_op_export_start: Exporting Keys. (line 67)
+* gpgme_op_genkey: Generating Keys. (line 304)
+* gpgme_op_genkey_result: Generating Keys. (line 418)
+* gpgme_op_genkey_start: Generating Keys. (line 369)
* gpgme_op_import: Importing Keys. (line 9)
* gpgme_op_import_ext: Deprecated Functions.
(line 22)
* gpgme_op_import_keys: Importing Keys. (line 35)
-* gpgme_op_import_keys_start: Importing Keys. (line 59)
-* gpgme_op_import_result: Importing Keys. (line 160)
+* gpgme_op_import_keys_start: Importing Keys. (line 65)
+* gpgme_op_import_result: Importing Keys. (line 168)
* gpgme_op_import_start: Importing Keys. (line 24)
* gpgme_op_interact: Advanced Key Editing.
- (line 20)
+ (line 23)
* gpgme_op_interact_start: Advanced Key Editing.
- (line 45)
-* gpgme_op_keylist_end: Listing Keys. (line 110)
+ (line 53)
+* gpgme_op_keylist_end: Listing Keys. (line 111)
* gpgme_op_keylist_ext_start: Listing Keys. (line 34)
-* gpgme_op_keylist_from_data: Listing Keys. (line 67)
-* gpgme_op_keylist_next: Listing Keys. (line 93)
-* gpgme_op_keylist_result: Listing Keys. (line 165)
+* gpgme_op_keylist_from_data_start: Listing Keys. (line 67)
+* gpgme_op_keylist_next: Listing Keys. (line 94)
+* gpgme_op_keylist_result: Listing Keys. (line 166)
* gpgme_op_keylist_start: Listing Keys. (line 6)
* gpgme_op_keysign: Signing Keys. (line 12)
-* gpgme_op_keysign_start: Signing Keys. (line 67)
+* gpgme_op_keysign_start: Signing Keys. (line 73)
* gpgme_op_passwd: Changing Passphrases.
(line 6)
* gpgme_op_passwd_start: Changing Passphrases.
- (line 19)
+ (line 21)
* gpgme_op_query_swdb: Checking for updates.
- (line 66)
+ (line 68)
* gpgme_op_query_swdb_result: Checking for updates.
- (line 76)
-* gpgme_op_revuid: Generating Keys. (line 198)
-* gpgme_op_revuid_start: Generating Keys. (line 224)
-* gpgme_op_set_uid_flag_start: Generating Keys. (line 261)
-* gpgme_op_set_ui_flag: Generating Keys. (line 231)
+ (line 80)
+* gpgme_op_revuid: Generating Keys. (line 224)
+* gpgme_op_revuid_start: Generating Keys. (line 252)
+* gpgme_op_set_uid_flag_start: Generating Keys. (line 293)
+* gpgme_op_set_ui_flag: Generating Keys. (line 261)
* gpgme_op_sign: Creating a Signature.
(line 21)
* gpgme_op_sign_result: Creating a Signature.
* gpgme_op_spawn: Running other Programs.
(line 13)
* gpgme_op_spawn_start: Running other Programs.
- (line 38)
-* gpgme_op_tofu_policy: Changing TOFU Data. (line 27)
-* gpgme_op_tofu_policy_start: Changing TOFU Data. (line 39)
+ (line 45)
+* gpgme_op_tofu_policy: Changing TOFU Data. (line 29)
+* gpgme_op_tofu_policy_start: Changing TOFU Data. (line 43)
* gpgme_op_trustlist_end: Listing Trust Items. (line 44)
* gpgme_op_trustlist_next: Listing Trust Items. (line 27)
* gpgme_op_trustlist_start: Listing Trust Items. (line 6)
* gpgme_op_verify: Verify. (line 6)
-* gpgme_op_verify_result: Verify. (line 272)
+* gpgme_op_verify_result: Verify. (line 283)
* gpgme_op_verify_start: Verify. (line 26)
* gpgme_passphrase_cb_t: Passphrase Callback. (line 10)
-* gpgme_pinentry_mode_t: Pinentry Mode. (line 20)
+* gpgme_pinentry_mode_t: Pinentry Mode. (line 26)
* gpgme_progress_cb_t: Progress Meter Callback.
(line 8)
* gpgme_protocol_t: Protocols and Engines.
(line 17)
* gpgme_protocol_t <1>: Engine Information. (line 7)
* gpgme_pubkey_algo_name: Public Key Algorithms.
- (line 50)
+ (line 58)
* gpgme_pubkey_algo_string: Public Key Algorithms.
- (line 60)
+ (line 68)
* gpgme_pubkey_algo_t: Public Key Algorithms.
(line 10)
* gpgme_query_swdb_result_t: Checking for updates.
(line 11)
-* gpgme_recipient_t: Decrypt. (line 67)
+* gpgme_recipient_t: Decrypt. (line 75)
* gpgme_register_io_cb_t: I/O Callback Interface.
(line 23)
* gpgme_release: Destroying Contexts. (line 6)
* gpgme_result_ref: Result Management. (line 15)
-* gpgme_result_unref: Result Management. (line 21)
+* gpgme_result_unref: Result Management. (line 23)
* gpgme_set_armor: ASCII Armor. (line 6)
* gpgme_set_ctx_flag: Status Message Callback.
- (line 37)
+ (line 41)
* gpgme_set_engine_info: Engine Configuration.
(line 11)
* gpgme_set_global_flag: Library Version Check.
- (line 43)
+ (line 44)
* gpgme_set_include_certs: Included Certificates.
(line 6)
* gpgme_set_io_cbs: Registering I/O Callbacks.
* gpgme_set_keylist_mode: Key Listing Mode. (line 6)
* gpgme_set_locale: Locale. (line 14)
* gpgme_set_offline: Offline Mode. (line 6)
-* gpgme_set_passphrase_cb: Passphrase Callback. (line 36)
+* gpgme_set_passphrase_cb: Passphrase Callback. (line 40)
* gpgme_set_pinentry_mode: Pinentry Mode. (line 6)
* gpgme_set_progress_cb: Progress Meter Callback.
(line 16)
* gpgme_set_status_cb: Status Message Callback.
(line 17)
* gpgme_set_textmode: Text Mode. (line 6)
-* gpgme_signature_t: Verify. (line 88)
+* gpgme_signature_t: Verify. (line 92)
* gpgme_signers_add: Selecting Signers. (line 18)
* gpgme_signers_clear: Selecting Signers. (line 11)
* gpgme_signers_count: Selecting Signers. (line 25)
-* gpgme_signers_enum: Selecting Signers. (line 29)
+* gpgme_signers_enum: Selecting Signers. (line 31)
* gpgme_sign_result_t: Creating a Signature.
(line 85)
* gpgme_sig_mode_t: Creating a Signature.
(line 7)
* gpgme_sig_notation_add: Signature Notation Data.
- (line 17)
+ (line 19)
* gpgme_sig_notation_clear: Signature Notation Data.
(line 10)
* gpgme_sig_notation_get: Signature Notation Data.
- (line 41)
+ (line 45)
* gpgme_sig_notation_t: Verify. (line 38)
* gpgme_sig_stat_t: Deprecated Functions.
- (line 435)
-* gpgme_ssize_t: Exchanging Data. (line 30)
+ (line 442)
+* gpgme_ssize_t: Exchanging Data. (line 32)
* gpgme_status_cb_t: Status Message Callback.
(line 8)
* gpgme_strerror: Error Strings. (line 6)
* gpgme_strerror_r: Error Strings. (line 15)
* gpgme_strsource: Error Strings. (line 26)
-* gpgme_subkey_t: Key objects. (line 100)
-* gpgme_tofu_policy_t: Changing TOFU Data. (line 11)
+* gpgme_subkey_t: Key objects. (line 112)
+* gpgme_tofu_info_t: Key objects. (line 275)
+* gpgme_tofu_policy_t: Changing TOFU Data. (line 13)
* gpgme_trust_item_get_int_attr: Deprecated Functions.
- (line 419)
+ (line 426)
* gpgme_trust_item_get_string_attr: Deprecated Functions.
- (line 404)
+ (line 411)
* gpgme_trust_item_ref: Manipulating Trust Items.
(line 6)
* gpgme_trust_item_release: Deprecated Functions.
(line 8)
* gpgme_trust_item_unref: Manipulating Trust Items.
(line 10)
-* gpgme_user_id_t: Key objects. (line 192)
+* gpgme_user_id_t: Key objects. (line 217)
* gpgme_validity_t: Information About Keys.
(line 9)
-* gpgme_verify_result_t: Verify. (line 257)
+* gpgme_verify_result_t: Verify. (line 268)
* gpgme_wait: Waiting For Completion.
(line 6)
* IMPORT_FILES: UI Server Import/Export Keys.
@sc{s:} \string\
@end macro
+@c API version.
+@macro since{string}
+ @sc{Since:} \string\
+@end macro
+
@c
@c T I T L E P A G E
largefile support add-on. Then a new data type @code{off64_t} is
provided, which is 64 bit wide. Or you can replace the existing
@code{off_t} data type with its 64 bit wide counterpart. All
-occurences of @code{off_t} are then automagically replaced.
+occurrences of @code{off_t} are then automagically replaced.
As if matters were not complex enough, there are also two different
types of file descriptors in such systems. This is important because
if file descriptors are exchanged between programs that use a
different maximum file size, certain errors must be produced on some
-file descriptors to prevent subtle overflow bugs from occuring.
+file descriptors to prevent subtle overflow bugs from occurring.
As you can see, supporting two different maximum file sizes at the
same time is not at all an easy task. However, the maximum file size
features are provided by the installed version of the library.
If a selftest fails, the function may still succeed. Selftest errors
-are returned later when invoking @code{gpgme_new}, so that a detailed
-error code can be returned (historically, @code{gpgme_check_version}
-does not return a detailed error code).
+are returned later when invoking @code{gpgme_new} or
+@code{gpgme-data_new}, so that a detailed error code can be returned
+(historically, @code{gpgme_check_version} does not return a detailed
+error code).
@end deftypefun
(@w{const char *@var{name}}, @
@w{const char *@var{value}})
+@since{1.4.0}
+
On some systems it is not easy to set environment variables and thus
hard to use @acronym{GPGME}'s internal trace facility for debugging.
This function has been introduced as an alternative way to enable
@item require-gnupg
Set the mimimum version of the required GnuPG engine. If that version
-is not met, GPGME fails early instead of trying to use the existant
+is not met, GPGME fails early instead of trying to use the existent
version. The given version must be a string with major, minor, and
micro number. Example: "2.1.0".
@table @code
@item GPGME_PROTOCOL_OpenPGP
+@itemx GPGME_PROTOCOL_OPENPGP
This specifies the OpenPGP protocol.
@item GPGME_PROTOCOL_CMS
Under development. Please ask on @email{gnupg-devel@@gnupg.org} for help.
@item GPGME_PROTOCOL_ASSUAN
+@since{1.2.0}
+
This specifies the raw Assuan protocol.
@item GPGME_PROTOCOL_G13
+@since{1.3.0}
+
Under development. Please ask on @email{gnupg-devel@@gnupg.org} for help.
@item GPGME_PROTOCOL_UISERVER
Under development. Please ask on @email{gnupg-devel@@gnupg.org} for help.
@item GPGME_PROTOCOL_SPAWN
+@since{1.5.0}
+
Special protocol for use with @code{gpgme_op_spawn}.
@item GPGME_PROTOCOL_UNKNOWN
@cindex version check, of the engines
@deftypefun @w{const char *} gpgme_get_dirinfo (@w{cons char *@var{what}})
+@since{1.5.0}
+
The function @code{gpgme_get_dirinfo} returns a statically allocated
string with the value associated to @var{what}. The returned values
are the defaults and won't change even after
individually.
@deftypefun gpgme_error_t gpgme_set_engine_info (@w{gpgme_protocol_t @var{proto}}, @w{const char *@var{file_name}}, @w{const char *@var{home_dir}})
+@since{1.1.0}
+
The function @code{gpgme_set_engine_info} changes the default
configuration of the crypto engine implementing the protocol
@var{proto}.
The new defaults are not applied to already created GPGME contexts.
This function returns the error code @code{GPG_ERR_NO_ERROR} if
-successful, or an eror code on failure.
+successful, or an error code on failure.
@end deftypefun
The functions @code{gpgme_ctx_get_engine_info} and
This value also indicates ElGamal and is used specifically in GnuPG.
@item GPGME_PK_ECC
+@since{1.5.0}
+
This value is a generic indicator for ellipic curve algorithms.
@item GPGME_PK_ECDSA
+@since{1.3.0}
+
This value indicates ECDSA, the Elliptic Curve Digital Signature
Algorithm as defined by FIPS 186-2 and RFC-6637.
@item GPGME_PK_ECDH
+@since{1.3.0}
+
This value indicates ECDH, the Eliptic Curve Diffie-Hellmann
encryption algorithm as defined by RFC-6637.
@item GPGME_PK_EDDSA
+@since{1.7.0}
+
This value indicates the EdDSA algorithm.
@end table
@end deftypefun
@deftypefun {char *} gpgme_pubkey_algo_string (@w{gpgme_subkey_t @var{key}})
+@since{1.7.0}
+
The function @code{gpgme_pubkey_algo_string} is a convenience function
to build and return an algorithm string in the same way GnuPG does
(e.g. ``rsa2048'' or ``ed25519''). The caller must free the result
@item GPGME_MD_SHA384
@item GPGME_MD_SHA512
@item GPGME_MD_SHA224
+@since{1.5.0}
+
@item GPGME_MD_MD4
@item GPGME_MD_CRC32
@item GPGME_MD_CRC32_RFC1510
@code{0}. Also, it is guaranteed that an error value made from the
error code @code{0} will be @code{0} itself (as a whole). This means
that the error source information is lost for this error code,
-however, as this error code indicates that no error occured, this is
+however, as this error code indicates that no error occurred, this is
generally not a problem.
@item GPG_ERR_GENERAL
the certificate.
@item GPG_ERR_NO_POLICY_MATCH
-This value indicates that a policy issue occured.
+This value indicates that a policy issue occurred.
@item GPG_ERR_NO_SECKEY
This value indicates that no secret key for the user ID is available.
is used.
@deftp {Data type} {gpgme_off_t}
+@since{1.4.1}
+
On POSIX platforms the @code{gpgme_off_t} type is an alias for
@code{off_t}; it may be used interchangeable. On Windows platforms
@code{gpgme_off_t} is defined as a long (i.e. 32 bit) for 32 bit
@deftypefun void gpgme_free (@w{void *@var{buffer}})
+@since{1.1.1}
+
The function @code{gpgme_free} releases the memory returned by
@code{gpgme_data_release_and_get_mem} and
@code{gpgme_pubkey_algo_string}. It should be used instead of the
@cindex data buffer, encoding
@deftypefun {char *} gpgme_data_get_file_name (@w{gpgme_data_t @var{dh}})
+@since{1.1.0}
+
The function @code{gpgme_data_get_file_name} returns a pointer to a
string containing the file name associated with the data object. The
file name will be stored in the output when encrypting or signing the
@deftypefun gpgme_error_t gpgme_data_set_file_name (@w{gpgme_data_t @var{dh}}, @w{const char *@var{file_name}})
+@since{1.1.0}
+
The function @code{gpgme_data_set_file_name} sets the file name
associated with the data object. The file name will be stored in the
output when encrypting or signing the data and will be returned to the
OpenPGP and PEM.
@item GPGME_DATA_ENCODING_MIME
+@since{1.7.0}
+
This specifies that the data is encoded as a MIME part.
@item GPGME_DATA_ENCODING_URL
+@since{1.2.0}
+
The data is a list of linefeed delimited URLs. This is only useful with
@code{gpgme_op_import}.
@item GPGME_DATA_ENCODING_URL0
+@since{1.2.0}
+
The data is a list of binary zero delimited URLs. This is only useful
with @code{gpgme_op_import}.
@item GPGME_DATA_ENCODING_URLESC
+@since{1.2.0}
+
The data is a list of linefeed delimited URLs with all control and space
characters percent escaped. This mode is is not yet implemented.
@w{const char *@var{name}}, @
@w{const char *@var{value}})
+@since{1.7.0}
+
Some minor properties of the data object can be controlled with flags
set by this function. The properties are identified by the following
values for @var{name}:
@deftp {Data type} {enum gpgme_data_type_t}
@tindex gpgme_data_type_t
+@since{1.4.3}
+
The @code{gpgme_data_type_t} type is used to return the detected type
of the content of a data buffer.
@end deftp
@item GPGME_DATA_TYPE_PGP_SIGNED
The data is an OpenPGP signed message. This may be a binary
signature, a detached one or a cleartext signature.
+@item GPGME_DATA_TYPE_PGP_ENCRYPTED
+@since{1.7.0}
+
+The data is an OpenPGP encrypted message.
+@item GPGME_DATA_TYPE_PGP_SIGNATURE
+@since{1.7.0}
+
+The data is an OpenPGP detached signature.
@item GPGME_DATA_TYPE_PGP_OTHER
This is a generic OpenPGP message. In most cases this will be
encrypted data.
@end table
@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}})
+@since{1.4.3}
+
The function @code{gpgme_data_identify} returns the type of the data
with the handle @var{dh}. If it is not possible to perform the
identification, the function returns zero
context.
@deftypefun void gpgme_result_ref (@w{void *@var{result}})
+@since{1.2.0}
+
The function @code{gpgme_result_ref} acquires an additional reference
for the result @var{result}, which may be of any type
@code{gpgme_*_result_t}. As long as the user holds a reference, the
@end deftypefun
@deftypefun void gpgme_result_unref (@w{void *@var{result}})
+@since{1.2.0}
+
The function @code{gpgme_result_unref} releases a reference for the
result @var{result}. If this was the last reference, the result
structure will be destroyed and all resources associated to it will be
@xref{Engine Configuration}.
@deftypefun gpgme_engine_info_t gpgme_ctx_get_engine_info (@w{gpgme_ctx_t @var{ctx}})
+@since{1.1.0}
+
The function @code{gpgme_ctx_get_engine_info} returns a linked list of
engine info structures. Each info structure describes the
configuration of one configured backend, as used by the context
@end deftypefun
@deftypefun gpgme_error_t gpgme_ctx_set_engine_info (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_protocol_t @var{proto}}, @w{const char *@var{file_name}}, @w{const char *@var{home_dir}})
+@since{1.1.0}
+
The function @code{gpgme_ctx_set_engine_info} changes the
configuration of the crypto engine implementing the protocol
@var{proto} for the context @var{ctx}.
context @var{ctx}.
This function returns the error code @code{GPG_ERR_NO_ERROR} if
-successful, or an eror code on failure.
+successful, or an error code on failure.
@end deftypefun
(@w{gpgme_ctx_t @var{ctx}}, @
@w{int @var{address}})
+@since{1.8.0}
+
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
@deftypefun @w{const char *} gpgme_get_sender @
(@w{gpgme_ctx_t @var{ctx}})
+@since{1.8.0}
+
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
@cindex offline mode
@deftypefun void gpgme_set_offline (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{yes}})
+@since{1.6.0}
+
The function @code{gpgme_set_offline} specifies if offline mode
should be used. By default, offline mode is not used.
@end deftypefun
@deftypefun int gpgme_get_offline (@w{gpgme_ctx_t @var{ctx}})
+@since{1.6.0}
+
The function @code{gpgme_get_offline} returns 1 if offline
mode is enabled, and @code{0} if it is not, or if @var{ctx} is not a
valid pointer.
@deftypefun gpgme_error_t gpgme_set_pinentry_mode (@w{gpgme_ctx_t @var{ctx}},
@w{gpgme_pinentry_mode_t @var{mode}})
+
+@since{1.4.0}
+
The function @code{gpgme_set_pinentry_mode} specifies the pinentry mode
to be used.
@end deftypefun
@deftypefun gpgme_pinentry_mode_t gpgme_get_pinentry_mode (@w{gpgme_ctx_t @var{ctx}})
+@since{1.4.0}
+
The function @code{gpgme_get_pinenty_mode} returns the
mode set for the context.
@end deftypefun
@deftp {Data type} {enum gpgme_pinentry_mode_t}
@tindex gpgme_pinentry_mode_t
+@since{1.4.0}
+
The @code{gpgme_minentry_mode_t} type specifies the set of possible pinentry
modes that are supported by @acronym{GPGME} if GnuPG >= 2.1 is used.
The following modes are supported:
@table @code
@item GPGME_PINENTRY_MODE_DEFAULT
+@since{1.4.0}
+
Use the default of the agent, which is ask.
@item GPGME_PINENTRY_MODE_ASK
+@since{1.4.0}
+
Force the use of the Pinentry.
@item GPGME_PINENTRY_MODE_CANCEL
+@since{1.4.0}
+
Emulate use of Pinentry's cancel button.
@item GPGME_PINENTRY_MODE_ERROR
+@since{1.4.0}
+
Return a Pinentry error @code{No Pinentry}.
@item GPGME_PINENTRY_MODE_LOOPBACK
+@since{1.4.0}
+
Redirect Pinentry queries to the caller.
-This enables the use of @code{gpgme_set_passphrase_cb} whis pinentry
-queries redirected to gpgme.
+This enables the use of @code{gpgme_set_passphrase_cb} because pinentry
+queries are redirected to gpgme.
-Note: This mode requires @code{allow-loopback-pinentry} to be enabled
-in the @file{gpg-agent.conf} or an agent started with that option.
+Note: For 2.1.0 - 2.1.12 this mode requires @code{allow-loopback-pinentry}
+to be enabled in the @file{gpg-agent.conf} or an agent started with that option.
@end table
@end deftp
@table @code
@item GPGME_INCLUDE_CERTS_DEFAULT
+@since{1.0.3}
+
Fall back to the default of the crypto backend. This is the default
for GPGME.
@item -2
@item GPGME_KEYLIST_MODE_EXTERN
The @code{GPGME_KEYLIST_MODE_EXTERN} symbol specifies that an external
source should be searched for keys in the keylisting operation. The
-type of external source is dependant on the crypto engine used and
+type of external source is dependent on the crypto engine used and
whether it is combined with @code{GPGME_KEYLIST_MODE_LOCAL}. For
example, it can be a remote keyserver or LDAP certificate server.
signatures should be included in the listed keys.
@item GPGME_KEYLIST_MODE_SIG_NOTATIONS
+@since{1.1.1}
+
The @code{GPGME_KEYLIST_MODE_SIG_NOTATIONS} symbol specifies that the
signature notations on key signatures should be included in the listed
keys. This only works if @code{GPGME_KEYLIST_MODE_SIGS} is also
enabled.
@item GPGME_KEYLIST_MODE_WITH_TOFU
+@since{1.7.0}
+
The @code{GPGME_KEYLIST_MODE_WITH_TOFU} symbol specifies that
information pertaining to the TOFU trust model should be included in
the listed keys.
@item GPGME_KEYLIST_MODE_WITH_SECRET
+@since{1.5.1}
+
The @code{GPGME_KEYLIST_MODE_WITH_SECRET} returns information about
the presence of a corresponding secret key in a public key listing. A
public key listing with this mode is slower than a standard listing
is only supported for GnuPG versions >= 2.1.
@item GPGME_KEYLIST_MODE_EPHEMERAL
+@since{1.2.0}
+
The @code{GPGME_KEYLIST_MODE_EPHEMERAL} symbol specifies that keys
flagged as ephemeral are included in the listing.
@item GPGME_KEYLIST_MODE_VALIDATE
+@since{0.4.5}
+
The @code{GPGME_KEYLIST_MODE_VALIDATE} symbol specifies that the
backend should do key or certificate validation and not just get the
validity information from an internal cache. This might be an
If an error occurs, return the corresponding @code{gpgme_error_t}
value. You can use the error code @code{GPG_ERR_CANCELED} to abort
the operation. Otherwise, return @code{0}.
+
+Note: The passphrase_cb only works with GnuPG 1.x and 2.1.x and not
+with the 2.0.x series. See @code{gpgme_set_pinentry_mode} for more
+details on 2.1.x usage.
@end deftp
@deftypefun void gpgme_set_passphrase_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_passphrase_cb_t @var{passfunc}}, @w{void *@var{hook_value}})
@end deftp
@deftypefun void gpgme_set_status_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_status_cb_t @var{statusfunc}}, @w{void *@var{hook_value}})
+@since{1.6.0}
+
The function @code{gpgme_set_status_cb} sets the function that is used when a
status message is received from gpg to @var{statusfunc}. The function
@var{statusfunc} needs to be implemented by the user, and whenever it is
@end deftypefun
@deftypefun void gpgme_get_status_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_status_cb_t *@var{statusfunc}}, @w{void **@var{hook_value}})
+@since{1.6.0}
+
The function @code{gpgme_get_status_cb} returns the function that is used to
process status messages from gpg in @var{*statusfunc}, and the first argument
for this function in @var{*hook_value}. If no status message callback is set,
@w{const char *@var{name}}, @
@w{const char *@var{value}})
+@since{1.7.0}
+
Some minor properties of the context can be controlled with flags set
by this function. The properties are identified by the following
values for @var{name}:
using this feature with GnuPG < 2.1.16 will leak the session key on
many platforms via ps(1).
+@item "auto-key-retrieve"
+Setting the @var{value} to "1" asks the backend to automatically
+retrieve a key for signature verification if possible. Note that this
+option makes a "web bug" like behavior possible. Keyserver or Web Key
+Directory operators can see which keys you request, so by sending you
+a message signed by a brand new key (which you naturally will not have
+on your local keyring), the operator can tell both your IP address and
+the time when you verified the signature.
+
+
@end table
This function returns @code{0} on success.
(@w{gpgme_ctx_t @var{ctx}}, @
@w{const char *@var{name}})
+@since{1.8.0}
+
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
contexts created afterwards.
@deftypefun gpgme_error_t gpgme_set_locale (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{category}}, @w{const char *@var{value}})
+@since{0.4.3}
+
The function @code{gpgme_set_locale} sets the locale of the context
@var{ctx}, or the default locale if @var{ctx} is a null pointer.
@table @code
@item gpgme_keylist_mode_t keylist_mode
+@since{0.9.0}
+
The keylist mode that was active when the key was retrieved.
@item unsigned int revoked : 1
key certificates.
@item unsigned int can_authenticate : 1
+@since{0.4.5}
+
This is true if the key (ie one of its subkeys) can be used for
authentication.
@item unsigned int is_qualified : 1
+@since{1.1.0}
+
This is true if the key can be used for qualified signatures according
to local government regulations.
been requested or if @code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
@item unsigned int origin : 5
+@since{1.8.0}
+
Reserved for the origin of this key.
@item gpgme_protocol_t protocol
in the list is the main (or primary) user ID.
@item char *fpr
+@since{1.7.0}
+
This field gives the fingerprint of the primary key. Note that
this is a copy of the fingerprint of the first subkey. For an
incomplete key (for example from a verification result) a subkey may
be missing but this field may be set nevertheless.
@item unsigned long last_update
+@since{1.8.0}
+
Reserved for the time of the last update of this key.
@end table
@deftp {Data type} gpgme_subkey_t
+@since{1.5.0}
The @code{gpgme_subkey_t} type is a pointer to a subkey structure.
Subkeys are one component of a @code{gpgme_key_t} object. In fact,
This is true if the subkey can be used to create key certificates.
@item unsigned int can_authenticate : 1
+@since{0.4.5}
+
This is true if the subkey can be used for authentication.
@item unsigned int is_qualified : 1
+@since{1.1.0}
+
This is true if the subkey can be used for qualified signatures
according to local government regulations.
@item unsigned int is_de_vs : 1
+@since{1.8.0}
+
This is true if the subkey complies with the rules for classified
information in Germany at the restricted level (VS-NfD). This are
currently RSA keys of at least 2048 bits or ECDH/ECDSA keys using a
available.
@item char *keygrip
+@since{1.7.0}
+
The keygrip of the subkey in hex digit form or @code{NULL} if not
availabale.
does not expire.
@item unsigned int is_cardkey : 1
+@since{1.2.0}
+
True if the secret key is stored on a smart card.
@item char *card_number
+@since{1.2.0}
+
The serial number of a smart card holding this key or @code{NULL}.
@item char *curve
@code{NULL} is stored.
@item gpgme_tofu_info_t tofu
+@since{1.7.0}
+
If not @code{NULL} information from the TOFU database pertaining to
this user id.
This is a linked list with the signatures on this user ID.
@item unsigned int origin : 5
+@since{1.8.0}
+
Reserved for the origin of this user ID.
@item unsigned long last_update
+@since{1.8.0}
+
Reserved for the time of the last update of this user ID.
@end table
@end deftp
+@deftp {Data type} gpgme_tofu_info_t
+
+@since{1.7.0}
+
+The @code{gpgme_tofu_info_t} type is a pointer to a tofu info
+structure. Tofu info structures are one component of a
+@code{gpgme_user_id_t} object, and provide information from the TOFU
+database pertaining to the user ID.
+
+The tofu info structure has the following members:
+
+@table @code
+@item gpgme_key_sig_t next
+This is a pointer to the next tofu info structure in the linked
+list, or @code{NULL} if this is the last element.
+
+@item unsigned int validity : 3
+This is the TOFU validity. It can have the following values:
+
+@table @code
+@item 0
+The value @code{0} indicates a conflict.
+
+@item 1
+The value @code{1} indicates a key without history.
+
+@item 2
+The value @code{2} indicates a key with too little history.
+
+@item 3
+The value @code{3} indicates a key with enough history for basic trust.
+
+@item 4
+The value @code{4} indicates a key with a lot of history.
+
+@end table
+
+@item unsigned int policy : 4
+This is the TOFU policy, see @code{gpgme_tofu_policy_t}.
+
+@item unsigned short signcount
+This is the number of signatures seen for this binding (or
+@code{USHRT_MAX} if there are more than that).
+
+@item unsigned short encrcount
+This is the number of encryptions done with this binding (or
+@code{USHRT_MAX} if there are more than that).
+
+@item unsigned long signfirst
+Number of seconds since Epoch when the first signature was seen with
+this binding.
+
+@item unsigned long signlast
+Number of seconds since Epoch when the last signature was seen with
+this binding.
+
+@item unsigned long encrfirst
+Number of seconds since Epoch when the first encryption was done with
+this binding.
+
+@item unsigned long encrlast
+Number of seconds since Epoch when the last encryption was done with
+this binding.
+
+@item char *description
+A human-readable string summarizing the TOFU data (or NULL).
+
+@end table
+@end deftp
+
+
@deftp {Data type} gpgme_key_sig_t
The @code{gpgme_key_sig_t} type is a pointer to a key signature structure.
are reported by the crypto engine support routines.
@end deftypefun
-@deftypefun gpgme_error_t gpgme_op_keylist_from_data @
+@deftypefun gpgme_error_t gpgme_op_keylist_from_data_start @
(@w{gpgme_ctx_t @var{ctx}}, @
@w{gpgme_data_t @var{data}}, @
@w{int @var{reserved}})
+@since{1.8.0}
+
The function @code{gpgme_op_keylist_from_data_start} initiates a key
listing operation inside the context @var{ctx}. In contrast to the
other key listing operation the keys are read from the supplied
@w{gpgme_key_t @var{extrakey}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_createkey} generates a new key for the
procotol active in the context @var{ctx}. As of now this function
does only work for OpenPGP and requires at least version 2.1.13 of
@itemx GPGME_CREATE_ENCR
@itemx GPGME_CREATE_CERT
@itemx GPGME_CREATE_AUTH
+@since{1.7.0}
+
Do not create the key with the default capabilities (key usage) of the
requested algorithm but use those explicitly given by these flags:
``signing'', ``encryption'', ``certification'', or ``authentication''.
protocol.
@item GPGME_CREATE_NOPASSWD
+@since{1.7.0}
+
Request generation of the key without password protection.
@item GPGME_CREATE_SELFSIGNED
+@since{1.7.0}
+
For an X.509 key do not create a CSR but a self-signed certificate.
This has not yet been implemented.
@item GPGME_CREATE_NOSTORE
+@since{1.7.0}
+
Do not store the created key in the local key database.
This has not yet been implemented.
@item GPGME_CREATE_WANTPUB
@itemx GPGME_CREATE_WANTSEC
+@since{1.7.0}
+
Return the public or secret key as part of the result structure.
This has not yet been implemented.
@item GPGME_CREATE_FORCE
+@since{1.7.0}
+
The engine does not allow the creation of a key with a user ID
already existing in the local key database. This flag can be used to
override this check.
@item GPGME_CREATE_NOEXPIRE
+@since{1.8.0}
+
Request generation of keys that do not expire.
@end table
@w{gpgme_key_t @var{extrakey}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_createkey_start} initiates a
@code{gpgme_op_createkey} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
@w{unsigned long @var{expires}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_createsubkey} creates and adds a new
subkey to the primary OpenPGP key given by @var{KEY}. The only
allowed protocol in @var{ctx} is @code{GPGME_PROTOCOL_OPENPGP}.
@w{unsigned long @var{expires}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_createsubkey_start} initiates a
@code{gpgme_op_createsubkey} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
@w{const char *@var{userid}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_adduid} adds a new user ID to the OpenPGP
key given by @var{KEY}. Adding additional user IDs after key creation
is a feature of the OpenPGP protocol and thus the protocol for the
@w{const char *@var{userid}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_adduid_start} initiates a
@code{gpgme_op_adduid} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
@w{const char *@var{userid}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_revuid} revokes a user ID from the OpenPGP
key given by @var{KEY}. Revoking user IDs after key creation is a
feature of the OpenPGP protocol and thus the protocol for the context
@w{const char *@var{userid}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_revuid_start} initiates a
@code{gpgme_op_revuid} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
@w{cons char * @var{name}}, @
@w{cons char * @var{value}});
+@since{1.8.0}
+
The function @code{gpgme_op_set_uid_flag} is used to set flags on a
user ID from the OpenPGP key given by @var{KEY}. Setting flags on
user IDs after key creation is a feature of the OpenPGP protocol and
@w{cons char * @var{name}}, @
@w{cons char * @var{value}});
+@since{1.8.0}
+
The function @code{gpgme_op_set_uid_flag_start} initiates a
@code{gpgme_op_set_uid_flag} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
fingerprint, @code{fpr} will be a null pointer.
@item gpgme_data_t pubkey
+@since{1.7.0}
+
This will eventually be used to return the public key. It is
currently not used.
@item gpgme_data_t seckey
+@since{1.7.0}
+
This will eventually be used to return the secret key. It is
currently not used.
@w{unsigned long @var{expires}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_keysign} adds a new key signature to the
public key @var{KEY}. This function requires at least version 2.1.12 of
GnuPG.
@table @code
@item GPGME_KEYSIGN_LOCAL
+@since{1.7.0}
+
Instead of creating an exportable key signature, create a key
signature which is is marked as non-exportable.
@item GPGME_KEYSIGN_LFSEP
+@since{1.7.0}
+
Although linefeeds are uncommon in user IDs this flag is required to
explicitly declare that @var{userid} may contain several linefeed
separated user IDs.
@w{unsigned long @var{expires}}, @
@w{unsigned int @var{flags}});
+@since{1.7.0}
+
The function @code{gpgme_op_keysign_start} initiates a
@code{gpgme_op_keysign} operation; see there for details. It must
be completed by calling @code{gpgme_wait} on the context.
export function is set to @code{NULL}.
@item GPGME_EXPORT_MODE_MINIMAL
+@since{1.3.1}
+
If this bit is set, the smallest possible key is exported. For OpenPGP
keys it removes all signatures except for the latest self-signatures.
For X.509 keys it has no effect.
@item GPGME_EXPORT_MODE_SECRET
+@since{1.6.0}
+
Instead of exporting the public key, the secret key is exported. This
may not be combined with @code{GPGME_EXPORT_MODE_EXTERN}. For X.509
the export format is PKCS#8.
@item GPGME_EXPORT_MODE_RAW
+@since{1.6.0}
+
If this flag is used with @code{GPGME_EXPORT_MODE_SECRET} for an X.509
key the export format will be changed to PKCS#1. This flag may not be
used with OpenPGP.
@item GPGME_EXPORT_MODE_PKCS12
+@since{1.6.0}
+
If this flag is used with @code{GPGME_EXPORT_MODE_SECRET} for an X.509
key the export format will be changed to PKCS#12 which also includes
the certificate. This flag may not be used with OpenPGP.
@deftypefun gpgme_error_t gpgme_op_export_keys (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t keys[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}})
+@since{1.2.0}
+
The function @code{gpgme_op_export_keys} extracts public keys and returns
them in the data buffer @var{keydata}. The output format of the key
data returned is determined by the @acronym{ASCII} armor attribute set
@end deftypefun
@deftypefun gpgme_error_t gpgme_op_export_keys_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{keys}[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}})
+@since{1.2.0}
+
The function @code{gpgme_op_export_keys_start} initiates a
@code{gpgme_op_export_ext} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
import could be started successfully, @code{GPG_ERR_INV_VALUE} if
-@var{keydata} if @var{ctx} or @var{keydata} is not a valid pointer,
-and @code{GPG_ERR_NO_DATA} if @var{keydata} is an empty data buffer.
+@var{ctx} or @var{keydata} is not a valid pointer, and
+@code{GPG_ERR_NO_DATA} if @var{keydata} is an empty data buffer.
@end deftypefun
@deftypefun gpgme_error_t gpgme_op_import_keys (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t *@var{keys}})
-The function @code{gpgme_op_import_keys} adds the keys described by the
-@code{NULL} terminated array @var{keys} to the key ring of the crypto
-engine used by @var{ctx}. This function is the general interface to
-move a key from one crypto engine to another as long as they are
-compatible. In particular it is used to actually import and make keys
-permanent which have been retrieved from an external source (i.e. using
-@code{GPGME_KEYLIST_MODE_EXTERN}). @footnote{Thus it is a replacement
-for the usual workaround of exporting and then importing a key to make
-an X.509 key permanent.}
+@since{1.2.0}
+
+The function @code{gpgme_op_import_keys} adds the keys described by
+the @code{NULL} terminated array @var{keys} to the key ring of the
+crypto engine used by @var{ctx}. It is used to actually import and
+make keys permanent which have been retrieved from an external source
+(i.e. using @code{GPGME_KEYLIST_MODE_EXTERN}) earlier. The external
+keylisting must have been made with the same context configuration (in
+particular the same home directory). @footnote{Thus it is a
+replacement for the usual workaround of exporting and then importing a
+key to make an X.509 key permanent.} Note that for OpenPGP this may
+require another access to the keyserver over the network.
Only keys of the currently selected protocol of @var{ctx} are
considered for import. Other keys specified by the @var{keys} are
ignored. As of now all considered keys must have been retrieved using
-the same method, that is the used key listing mode must be identical.
+the same method, i.e. the used key listing mode must be identical.
After the operation completed successfully, the result can be
retrieved with @code{gpgme_op_import_result}.
+To move keys from one home directory to another, export and import the
+keydata using @code{gpgme_op_export} and @code{gpgme_op_import}.
+
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
import was completed successfully, @code{GPG_ERR_INV_VALUE} if
-@var{keydata} if @var{ctx} or @var{keydata} is not a valid pointer,
-@code{GPG_ERR_CONFLICT} if the key listing mode does not match, and
-@code{GPG_ERR_NO_DATA} if no keys are considered for export.
+@var{ctx} is not a valid pointer, @code{GPG_ERR_CONFLICT} if the key
+listing mode does not match, and @code{GPG_ERR_NO_DATA} if no keys are
+considered for export.
@end deftypefun
@deftypefun gpgme_error_t gpgme_op_import_keys_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t *@var{keys}})
+@since{1.2.0}
+
The function @code{gpgme_op_import_keys_start} initiates a
@code{gpgme_op_import_keys} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
@cindex key, delete
@cindex key ring, delete from
-@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
-The function @code{gpgme_op_delete} deletes the key @var{key} from the
-key ring of the crypto engine used by @var{ctx}. If
-@var{allow_secret} is @code{0}, only public keys are deleted,
-otherwise secret keys are deleted as well, if that is supported.
+@deftypefun gpgme_error_t gpgme_op_delete_ext (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{unsigned int @var{flags}})
+@since{1.9.1}
+
+The function @code{gpgme_op_delete_ext} deletes the key @var{key} from
+the key ring of the crypto engine used by @var{ctx}.
+
+@var{flags} can be set to the bit-wise OR of the following flags:
+
+@table @code
+@item GPGME_DELETE_ALLOW_SECRET
+@since{1.9.1}
+
+If not set, only public keys are deleted. If set, secret keys are
+deleted as well, if that is supported.
+
+@item GPGME_DELETE_FORCE
+@since{1.9.1}
+
+If set, the user is not asked to confirm the deletion.
+@end table
The function returns the error code @code{GPG_ERR_NO_ERROR} if the key
was deleted successfully, @code{GPG_ERR_INV_VALUE} if @var{ctx} or
@var{key} is available, but @var{allow_secret} is zero.
@end deftypefun
-@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
-The function @code{gpgme_op_delete_start} initiates a
+@deftypefun gpgme_error_t gpgme_op_delete_ext_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{unsigned int @var{flags}})
+@since{1.9.1}
+
+The function @code{gpgme_op_delete_ext_start} initiates a
@code{gpgme_op_delete} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
@var{ctx} or @var{key} is not a valid pointer.
@end deftypefun
+The following functions allow only to use one particular flag.
+
+@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
+Similar to @code{gpgme_op_delete_ext}, but only the flag
+@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
+@end deftypefun
+
+@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
+Similar to @code{gpgme_op_delete_ext_start}, but only the flag
+@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
+@end deftypefun
+
@node Changing Passphrases
@subsection Changing Passphrases
@w{const gpgme_key_t @var{key}}, @
@w{unsigned int @var{flags}})
+@since{1.3.0}
+
The function @code{gpgme_op_passwd} changes the passphrase of the
private key associated with @var{key}. The only allowed value for
@var{flags} is @code{0}. The backend engine will usually popup a window
@w{const gpgme_key_t @var{key}}, @
@w{unsigned int @var{flags}})
+@since{1.3.0}
+
The function @code{gpgme_op_passwd_start} initiates a
@code{gpgme_op_passwd} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
implementation.
@deftp {Data type} {enum gpgme_tofu_policy_t}
+@since{1.7.0}
+
@tindex gpgme_tofu_policy_t
The @code{gpgme_tofu_policy_t} type specifies the set of possible
policy values that are supported by @acronym{GPGME}:
@w{const gpgme_key_t @var{key}}, @
@w{gpgme_tofu_policy_t @var{policy}})
+@since{1.7.0}
+
The function @code{gpgme_op_tofu_policy} changes the TOFU policy of
@var{key}. The valid values for @var{policy} are listed above. As of
now this function does only work for OpenPGP and requires at least
@w{const gpgme_key_t @var{key}}, @
@w{gpgme_tofu_policy_t @var{policy}})
+@since{1.7.0}
+
The function @code{gpgme_op_tofu_policy_start} initiates a
@code{gpgme_op_tofu_policy} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
@w{const char *@var{status}}, @
@w{const char *@var{args}}, @
@w{int @var{fd}})}
+
+@since{1.7.0}
+
@tindex gpgme_interact_cb_t
The @code{gpgme_interact_cb_t} type is the type of functions which
@acronym{GPGME} calls if it a key interact operation is on-going. The
@w{gpgme_interact_cb_t @var{fnc}}, @
@w{void *@var{handle}}, @
@w{gpgme_data_t @var{out}})
+
+@since{1.7.0}
+
The function @code{gpgme_op_interact} processes the key @var{KEY}
interactively, using the interact callback function @var{FNC} with the
handle @var{HANDLE}. The callback is invoked for every status and
@table @code
@item GPGME_INTERACT_CARD
+@since{1.7.0}
+
This is used for smartcard based keys and uses gpg’s
@code{--card-edit} command.
@w{gpgme_interact_cb_t @var{fnc}}, @
@w{void *@var{handle}}, @
@w{gpgme_data_t @var{out}})
+
+@since{1.7.0}
+
The function @code{gpgme_op_interact_start} initiates a
@code{gpgme_op_interact} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
@code{GPG_ERR_NO_DATA} if @var{cipher} does not contain any data to
decrypt, @code{GPG_ERR_DECRYPT_FAILED} if @var{cipher} is not a valid
cipher text, @code{GPG_ERR_BAD_PASSPHRASE} if the passphrase for the
-secret key could not be retrieved, and passes through any errors that
+secret key could not be retrieved, and passes through some errors that
are reported by the crypto engine support routines.
@end deftypefun
@w{gpgme_data_t @var{cipher}}, @
@w{gpgme_data_t @var{plain}})
+@since{1.8.0}
+
The function @code{gpgme_op_decrypt_ext} is the same as
@code{gpgme_op_decrypt_ext} but has an additional argument
@var{flags}. If @var{flags} is 0 both function behave identically.
@table @code
@item GPGME_DECRYPT_VERIFY
+@since{1.8.0}
+
The @code{GPGME_DECRYPT_VERIFY} symbol specifies that this function
shall exacty act as @code{gpgme_op_decrypt_verify}.
@item GPGME_DECRYPT_UNWRAP
+@since{1.8.0}
+
The @code{GPGME_DECRYPT_UNWRAP} symbol specifies that the output shall
be an OpenPGP message with only the encryption layer removed. This
requires GnuPG 2.1.12 and works only for OpenPGP. This is the
@w{gpgme_data_t @var{cipher}}, @
@w{gpgme_data_t @var{plain}})
+@since{1.8.0}
+
The function @code{gpgme_op_decrypt_ext_start} initiates a
@code{gpgme_op_decrypt_ext} operation. It can be completed by calling
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
@deftp {Data type} {gpgme_recipient_t}
+@since{1.1.0}
+
This is a pointer to a structure used to store information about the
recipient of an encrypted text which is decrypted in a
@code{gpgme_op_decrypt} operation. This information (except for the
algorithm that is not supported.
@item unsigned int wrong_key_usage : 1
+@since{0.9.0}
+
This is true if the key was not used according to its policy.
@item gpgme_recipient_t recipients
+@since{1.1.0}
+
This is a linked list of recipients to which this message was encrypted.
@item char *file_name
known, otherwise this is a null pointer.
@item char *session_key
+@since{1.8.0}
+
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,
@table @code
@item GPGME_SIG_NOTATION_HUMAN_READABLE
+@since{1.1.0}
+
The @code{GPGME_SIG_NOTATION_HUMAN_READABLE} symbol specifies that the
notation data is in human readable form
@item GPGME_SIG_NOTATION_CRITICAL
+@since{1.1.0}
+
The @code{GPGME_SIG_NOTATION_CRITICAL} symbol specifies that the
notation data is critical.
@item GPGME_SIGSUM_SYS_ERROR
A system error occured.
+
+ @item GPGME_SIGSUM_TOFU_CONFLICT
+ A TOFU conflict was detected.
@end table
@item char *fpr
reflected by the validity of the signature.
@item unsigned int chain_model : 1
+@since{1.1.6}
+
This is true if the validity of the signature has been checked using the
chain model. In the chain model the time the signature has been created
must be within the validity period of the certificate and the time the
The mailbox from the PKA information or @code{NULL}.
@item gpgme_key_t key
+@since{1.7.0}
+
An object describing the key used to create the signature. This key
object may be incomplete in that it only conveys information
availabale directly with a signature. It may also be @code{NULL} if
@deftypefun @w{char *} gpgme_addrspec_from_uid (@w{const char *@var{uid}})
+@since{1.7.1}
+
Return the mail address (called ``addr-spec'' in RFC-5322) from the
string @var{uid} which is assumed to be a user id (called ``address''
in RFC-5322). All plain ASCII characters (i.e. those with bit 7
@end deftypefun
@deftypefun @w{unsigned int} gpgme_signers_count (@w{const gpgme_ctx_t @var{ctx}})
+@since{1.4.3}
+
The function @code{gpgme_signers_count} returns the number of signer keys in
the context @var{ctx}.
@end deftypefun
the signature is verified.
@deftypefun void gpgme_sig_notation_clear (@w{gpgme_ctx_t @var{ctx}})
+@since{1.1.0}
+
The function @code{gpgme_sig_notation_clear} removes the notation data
from the context @var{ctx}. Subsequent signing operations from this
context will not include any notation data.
@end deftypefun
@deftypefun gpgme_error_t gpgme_sig_notation_add (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{name}}, @w{const char *@var{value}}, @w{gpgme_sig_notation_flags_t @var{flags}})
+@since{1.1.0}
+
The function @code{gpgme_sig_notation_add} adds the notation data with
the name @var{name} and the value @var{value} to the context
@var{ctx}.
@end deftypefun
@deftypefun gpgme_sig_notation_t gpgme_sig_notation_get (@w{const gpgme_ctx_t @var{ctx}})
+@since{1.1.0}
+
The function @code{gpgme_sig_notation_get} returns the linked list of
notation data structures that are contained in the context @var{ctx}.
with care; in general it is not a good idea to use any untrusted keys.
@item GPGME_ENCRYPT_NO_ENCRYPT_TO
+@since{1.2.0}
+
The @code{GPGME_ENCRYPT_NO_ENCRYPT_TO} symbol specifies that no
default or hidden default recipients as configured in the crypto
backend should be included. This can be useful for managing different
user profiles.
@item GPGME_ENCRYPT_NO_COMPRESS
+@since{1.5.0}
+
The @code{GPGME_ENCRYPT_NO_COMPRESS} symbol specifies that the
plaintext shall not be compressed before it is encrypted. This is
in some cases useful if the length of the encrypted message
also expect a sign command.
@item GPGME_ENCRYPT_SYMMETRIC
+@since{1.7.0}
+
The @code{GPGME_ENCRYPT_SYMMETRIC} symbol specifies that the
output should be additionally encrypted symmetrically even
if recipients are provided. This feature is only supported for
for the OpenPGP crypto engine.
@item GPGME_ENCRYPT_THROW_KEYIDS
+@since{1.8.0}
+
The @code{GPGME_ENCRYPT_THROW_KEYIDS} symbols requests that the
identifiers for the decrption keys are not included in the ciphertext.
On the receiving side, the use of this flag may slow down the
This flag is only honored for OpenPGP encryption.
@item GPGME_ENCRYPT_WRAP
+@since{1.8.0}
+
The @code{GPGME_ENCRYPT_WRAP} symbol specifies that the input is an
OpenPGP message and not a plain data. This is the counterpart to
@code{GPGME_DECRYPT_UNWRAP}.
@w{gpgme_data_t @var{dataout}}, @w{gpgme_data_t @var{dataerr}}, @
@w{unsigned int @var{flags}})
+@since{1.5.0}
+
The function @code{gpgme_op_spawn} runs the program @var{file} with
the arguments taken from the NULL terminated array @var{argv}. If no
arguments are required @var{argv} may be given as @code{NULL}. In the
@table @code
@item GPGME_SPAWN_DETACHED
+@since{1.5.0}
+
Under Windows this flag inhibits the allocation of a new console for
the program. This is useful for a GUI application which needs to call
a command line helper tool.
+
@item GPGME_SPAWN_ALLOW_SET_FG
+@since{1.5.0}
+
Under Windows this flag allows the called program to put itself into
the foreground.
@end table
@w{gpgme_data_t @var{dataout}}, @w{gpgme_data_t @var{dataerr}}, @
@w{unsigned int @var{flags}})
+@since{1.5.0}
+
This is the asynchronous variant of @code{gpgme_op_spawn}.
@end deftypefun
(@w{void *@var{opaque}}, @w{const void *@var{data}}, @
@w{size_t @var{datalen}})}
+@since{1.2.0}
+
This callback receives any data sent by the server. @var{opaque} is
the pointer passed to @code{gpgme_op_assuan_transact_start},
@var{data} of length @var{datalen} refers to the data sent.
(@w{void *@var{opaque}}, @w{const char *@var{name}}, @
@w{const char *@var{args}}, @w{gpgme_data_t *@var{r_data}})}
+@since{1.2.0}
+
This callback is used to provide additional data to the Assuan server.
@var{opaque} is the pointer passed to
@code{gpgme_op_assuan_transact_start}, @var{name} and @var{args}
(@w{void *@var{opaque}}, @w{const char *@var{status}}, @
@w{const char *@var{args}})}
+@since{1.2.0}
+
This callback receives any status lines sent by the server.
@var{opaque} is the pointer passed to
@code{gpgme_op_assuan_transact_start}, @var{status} and @var{args}
@w{gpgme_assuan_status_cb_t @var{status_cb}}, @
@w{void * @var{status_cb_value}})
+@since{1.2.0}
+
Send the Assuan @var{command} and return results via the callbacks.
Any callback may be @code{NULL}. The result of the operation may be
retrieved using @code{gpgme_wait_ext}.
software package is available.
@deftp {Data type} {gpgme_query_swdb_result_t}
+@since{1.8.0}
+
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
If this flag is set the available information is not fresh enough.
@item error
-If this flag is set some other error has occured.
+If this flag is set some other error has occurred.
@item version
The version string of the latest released version.
@w{const char *@var{iversion}}, @
@w{gpgme_data_t @var{reserved}})
+@since{1.8.0}
+
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
@deftypefun gpgme_query_swdb_result_t gpgme_op_query_swdb_result @
(@w{gpgme_ctx_t @var{ctx}})
+@since{1.8.0}
+
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
+valid if the last operation on the context was a successful 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}.
@code{gpgme_event_io_cb_t} function with @acronym{GPGME} and will always be
passed as the first argument when registering a callback function.
For example, the user can use this to determine the context in which
-this event has occured.
+this event has occurred.
-@var{type} will specify the type of event that has occured.
+@var{type} will specify the type of event that has occurred.
@var{type_data} specifies the event further, as described in the above
list of possible @code{gpgme_event_io_t} types.
@item void *event_priv
This is passed as the first argument to the @code{event} function when
it is called by @acronym{GPGME}. For example, it can be used to
-determine the context in which the event has occured.
+determine the context in which the event has occurred.
@end table
@end deftp
(typically the next time I/O occurs in the target context).
@deftypefun gpgme_ctx_t gpgme_cancel (@w{gpgme_ctx_t @var{ctx}})
+@since{0.4.5}
+
The function @code{gpgme_cancel} attempts to cancel a pending
operation in the context @var{ctx}. This only works if you use the
global event loop or your own event loop.
@deftypefun gpgme_ctx_t gpgme_cancel_async (@w{gpgme_ctx_t @var{ctx}})
+@since{1.1.7}
+
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
@deftypefun gpgme_error_t gpgme_op_import_ext (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{keydata}}, @w{int *@var{nr}})
+@since{0.3.9}
+
The function @code{gpgme_op_import_ext} is equivalent to:
@example
@end deftp
@deftypefun gpgme_error_t gpgme_op_edit (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{key}}, @w{gpgme_edit_cb_t @var{fnc}}, @w{void *@var{handle}}, @w{gpgme_data_t @var{out}})
+@since{0.3.9}
+
Note: This function is deprecated, please use
@code{gpgme_op_interact} instead.
@end deftypefun
@deftypefun gpgme_error_t gpgme_op_edit_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{key}}, @w{gpgme_edit_cb_t @var{fnc}}, @w{void *@var{handle}}, @w{gpgme_data_t @var{out}})
+
+@since{0.3.9}
+
Note: This function is deprecated, please use
@code{gpgme_op_interact_start} instead.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
-% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \argtorun.
-% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
%
% used to check whether the current environment is the one expected.
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
-% are not treated as enviroments; they don't open a group. (The
+% are not treated as environments; they don't open a group. (The
% implementation of @end takes care not to call \endgroup in this
% special case.)
\fi
}
-% Evironment mismatch, #1 expected:
+% Environment mismatch, #1 expected:
\def\badenverr{%
\errhelp = \EMsimple
\errmessage{This command can appear only \inenvironment\temp,
% In case a @footnote appears in a vbox, save the footnote text and create
% the real \insert just after the vbox finished. Otherwise, the insertion
% would be lost.
-% Similarily, if a @footnote appears inside an alignment, save the footnote
+% Similarly, if a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is finished.
% And the same can be done for other insert classes. --kasal, 16nov03.
@code{FILE} commands. Afterwards, the actual operation is requested:
@deffn Command CHECKSUM_CREATE_FILES --nohup
-Request that checksums are created for the files specifed by
+Request that checksums are created for the files specified by
@code{FILE}. The choice of checksum algorithm and the destination
storage and format for the created checksums depend on the preferences
of the user and the functionality provided by the UI server. For
@deffn Command CHECKSUM_VERIFY_FILES --nohup
-Request that checksums are created for the files specifed by
+Request that checksums are created for the files specified by
@code{FILE} and verified against previously created and stored
checksums. The choice of checksum algorithm and the source storage
and format for previously created checksums depend on the preferences
# This is a template. The dist target uses it to create the real file.
Summary: GPGME - GnuPG Made Easy
Name: gpgme
-Version: 1.9.0
+Version: 1.10.0
Release: 1
URL: https://gnupg.org/gpgme.html
Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
(defsystem gpgme
:description "GnuPG Made Easy."
:author "g10 Code GmbH"
- :version "1.9.0"
+ :version "1.10.0"
:licence "GPL"
:depends-on ("cffi" "gpg-error")
:components ((:file "gpgme-package")
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
@SET_MAKE@
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
Data data;
/* Start the edit on some key previously obtained. */
Error e = ctx->edit(key, std::unique_ptr<EditInteractor>(ei), data);
- /* Errors provide boolean comparision */
+ /* Errors provide boolean comparison */
if (!e)
...
/* Delete the context */
set_target_properties(Gpgmepp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
- INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme.so;@LIBASSUAN_LIBS@"
+ INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
)
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
@SET_MAKE@
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
/*
callbacks.cpp - callback targets for internal use:
Copyright (C) 2003,2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
callbacks.h - callback targets for internal use:
Copyright (C) 2003 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
configuration.cpp - wraps gpgme configuration components
Copyright (C) 2010 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
configuration.h - wraps gpgme configuration components
Copyright (C) 2010 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
{
public:
Component() : comp() {}
- explicit Component(const shared_gpgme_conf_comp_t &comp)
- : comp(comp) {}
+ explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp)
+ : comp(gpgme_comp) {}
// copy ctor is ok
{
public:
Option() : comp(), opt(0) {}
- Option(const shared_gpgme_conf_comp_t &comp, gpgme_conf_opt_t opt)
- : comp(comp), opt(opt) {}
+ Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt)
+ : comp(gpgme_comp), opt(gpgme_opt) {}
const Option &operator=(const Option &other)
{
k.impl(), to_tofu_policy_t(policy)));
}
+Error Context::startCreateKey (const char *userid,
+ const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ const Key &certkey,
+ unsigned int flags)
+{
+ return Error(d->lasterr = gpgme_op_createkey_start(d->ctx,
+ userid,
+ algo,
+ reserved,
+ expires,
+ certkey.impl(),
+ flags));
+}
+
+Error Context::createKey (const char *userid,
+ const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ const Key &certkey,
+ unsigned int flags)
+{
+ return Error(d->lasterr = gpgme_op_createkey(d->ctx,
+ userid,
+ algo,
+ reserved,
+ expires,
+ certkey.impl(),
+ flags));
+}
+
Error Context::addUid(const Key &k, const char *userid)
{
return Error(d->lasterr = gpgme_op_adduid(d->ctx,
k.impl(), userid, 0));
}
+Error Context::createSubkey(const Key &k, const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ unsigned int flags)
+{
+ return Error(d->lasterr = gpgme_op_createsubkey(d->ctx,
+ k.impl(), algo, reserved, expires, flags));
+}
+
+Error Context::startCreateSubkey(const Key &k, const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ unsigned int flags)
+{
+ return Error(d->lasterr = gpgme_op_createsubkey_start(d->ctx,
+ k.impl(), algo, reserved, expires, flags));
+}
+
// Engine Spawn stuff
Error Context::spawn(const char *file, const char *argv[],
Data &input, Data &output, Data &err,
GpgME::Error edit(const Key &key, std::unique_ptr<EditInteractor> function, Data &out);
GpgME::Error startEditing(const Key &key, std::unique_ptr<EditInteractor> function, Data &out);
+
+ //
+ // Modern Interface actions. Require 2.1.x
+ //
+ Error startCreateKey (const char *userid,
+ const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ const Key &certkey,
+ unsigned int flags);
+ Error createKey (const char *userid,
+ const char *algo,
+ unsigned long reserved,
+ unsigned long expires,
+ const Key &certkey,
+ unsigned int flags);
+
Error addUid(const Key &key, const char *userid);
Error startAddUid(const Key &key, const char *userid);
Error revUid(const Key &key, const char *userid);
Error startRevUid(const Key &key, const char *userid);
+ Error createSubkey(const Key &key, const char *algo,
+ unsigned long reserved = 0,
+ unsigned long expires = 0,
+ unsigned int flags = 0);
+ Error startCreateSubkey(const Key &key, const char *algo,
+ unsigned long reserved = 0,
+ unsigned long expires = 0,
+ unsigned int flags = 0);
+
// using TofuInfo::Policy
Error setTofuPolicy(const Key &k, unsigned int policy);
Error setTofuPolicyStart(const Key &k, unsigned int policy);
/*
context_p.h - wraps a gpgme context (private part)
Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
context_vanilla.cpp - wraps a gpgme key context, gpgme (vanilla)-specific functions
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
data_p.h - wraps a gpgme data object, private part -*- c++ -*-
Copyright (C) 2003,2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
decryptionresult.cpp - wraps a gpgme keygen result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
return d && d->res.wrong_key_usage;
}
+bool GpgME::DecryptionResult::isDeVs() const
+{
+ return d && d->res.is_de_vs;
+}
+
const char *GpgME::DecryptionResult::fileName() const
{
return d ? d->res.file_name : 0 ;
<< "\n fileName: " << protect(result.fileName())
<< "\n unsupportedAlgorithm: " << protect(result.unsupportedAlgorithm())
<< "\n isWrongKeyUsage: " << result.isWrongKeyUsage()
+ << "\n isDeVs " << result.isDeVs()
<< "\n recipients:\n";
const std::vector<DecryptionResult::Recipient> recipients = result.recipients();
std::copy(recipients.begin(), recipients.end(),
/*
decryptionresult.h - wraps a gpgme keygen result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
return isWrongKeyUsage();
}
bool isWrongKeyUsage() const;
+ bool isDeVs() const;
const char *fileName() const;
/*
defaultassuantransaction.cpp - default Assuan Transaction that just stores data and status lines
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
defaultassuantransaction.h - default Assuan Transaction that just stores data and status lines
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
editinteractor.cpp - Interface for edit interactors
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
editinteractor.h - Interface for edit interactors
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
encryptionresult.cpp - wraps a gpgme verify result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
encryptionresult.h - wraps a gpgme sign result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
engineinfo.h
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
engineinfo.h
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
bool operator < (const Version& other)
{
- if (major < other.major)
- return true;
- if (minor < other.minor)
- return true;
- if (patch < other.patch)
- return true;
- return false;
+ if (major > other.major ||
+ (major == other.major && minor > other.minor) ||
+ (major == other.major && minor == other.minor && patch > other.patch) ||
+ (major >= other.major && minor >= other.minor && patch >= other.patch)) {
+ return false;
+ }
+ return true;
}
bool operator < (const char* other)
return operator<(Version(other));
}
+ bool operator > (const char* other)
+ {
+ return !operator<(Version(other));
+ }
+
+ bool operator > (const Version & other)
+ {
+ return !operator<(other);
+ }
bool operator == (const Version& other)
{
return major == other.major
/*
error.h - wraps a gpgme error
Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
eventloopinteractor.cpp
Copyright (C) 2003,2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
eventloopinteractor.h
Copyright (C) 2003,2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
exception.cpp - exception wrapping a gpgme error
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
exception.h - exception wrapping a gpgme error
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
global.h - global gpgme functions and enums
Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgadduserideditinteractor.cpp - Edit Interactor to add a new UID to an OpenPGP key
Copyright (C) 2008 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgadduserideditinteractor.h - Edit Interactor to add a new UID to an OpenPGP key
Copyright (C) 2008 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgagentgetinfoassuantransaction.cpp - Assuan Transaction to get information from gpg-agent
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgagentgetinfoassuantransaction.h - Assuan Transaction to get information from gpg-agent
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpggencardkeyinteractor.cpp - Edit Interactor to generate a key on a card
- Copyright (C) 2017 Intevation GmbH
+ Copyright (C) 2017 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpggencardkeyinteractor.h - Edit Interactor to generate a key on a card
- Copyright (C) 2017 Intevation GmbH
+ Copyright (C) 2017 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgmefw.h - Forwards declarations for gpgme (0.3 and 0.4)
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*gpgmepp_export.h - Export macros for gpgmepp
- Copyright (C) 2016, Intevation GmbH
+ Copyright (C) 2016, by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgsetexpirytimeeditinteractor.cpp - Edit Interactor to change the expiry time of an OpenPGP key
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgsetexpirytimeeditinteractor.h - Edit Interactor to change the expiry time of an OpenPGP key
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgsetownertrusteditinteractor.cpp - Edit Interactor to change the expiry time of an OpenPGP key
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgsetownertrusteditinteractor.h - Edit Interactor to change the owner trust of an OpenPGP key
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
gpgsignkeyeditinteractor.cpp - Edit Interactor to change the expiry time of an OpenPGP key
Copyright (C) 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
SET_TRUST_DEPTH,
SET_TRUST_REGEXP,
CONFIRM,
+ CONFIRM2,
QUIT,
SAVE,
ERROR = EditInteractor::ErrorState
addEntry(START, GET_LINE, "keyedit.prompt", COMMAND);
addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL);
addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM);
+ addEntry(COMMAND, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM2);
addEntry(UIDS_ANSWER_SIGN_ALL, GET_BOOL, "sign_uid.okay", CONFIRM);
addEntry(UIDS_ANSWER_SIGN_ALL, GET_LINE, "sign_uid.expire", SET_EXPIRE);
addEntry(UIDS_ANSWER_SIGN_ALL, GET_LINE, "sign_uid.class", SET_CHECK_LEVEL);
addEntry(SET_EXPIRE, GET_BOOL, "sign_uid.class", SET_CHECK_LEVEL);
addEntry(CONFIRM, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM);
addEntry(CONFIRM, GET_BOOL, "sign_uid.okay", CONFIRM);
+ addEntry(CONFIRM2, GET_BOOL, "sign_uid.okay", CONFIRM);
addEntry(CONFIRM, GET_LINE, "keyedit.prompt", COMMAND);
addEntry(CONFIRM, GET_LINE, "trustsign_prompt.trust_value", SET_TRUST_VALUE);
addEntry(CONFIRM, GET_LINE, "sign_uid.expire", SET_EXPIRE);
return 0;
case SET_CHECK_LEVEL:
return check_level_strings[d->checkLevel];
+ case CONFIRM2:
case CONFIRM:
return answer(true);
case QUIT:
/*
gpgsignkeyeditinteractor.h - Edit Interactor to change the owner trust of an OpenPGP key
Copyright (C) 2008 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
importresult.cpp - wraps a gpgme import result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
importresult.h - wraps a gpgme import result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
assuantransaction.h - Interface for ASSUAN transactions
- Copyright (C) 2009 Klarälvdalens Datakonsult AB <info@kdab.com>
+ Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH <info@kdab.com>
Author: Marc Mutz <marc@kdab.com>
This file is part of GPGME++.
/*
interface/dataprovider.h - Interface for data sources
Copyright (C) 2003 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
interface/passphraseprovider.h - Interface for passphrase callbacks
Copyright (C) 2003,2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
interface/progressprovider.h - Interface for progress reports
Copyright (C) 2003 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
bool Key::isDeVs() const
{
- return key && key->subkeys && key->subkeys->is_de_vs;
+ if (!key) {
+ return false;
+ }
+ if (!key->subkeys || !key->subkeys->is_de_vs) {
+ return false;
+ }
+ for (gpgme_sub_key_t subkey = key->subkeys ; subkey ; subkey = subkey->next) {
+ if (!subkey->is_de_vs) {
+ return false;
+ }
+ }
+ return true;
}
const char *Key::issuerSerial() const
/*
keygenerationresult.cpp - wraps a gpgme keygen result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
keygenerationresult.h - wraps a gpgme keygen result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
keylistresult.cpp - wraps a gpgme keylist result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
keylistresult.h - wraps a gpgme keylist result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
notation.h - wraps a gpgme verify result
Copyright (C) 2004, 2007 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
result.h - base class for results
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
result.h - base class for results
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
scdgetinfoassuantransaction.cpp - Assuan Transaction to get information from scdaemon
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
scdgetinfoassuantransaction.h - Assuan Transaction to get information from scdaemon
Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
signingresult.cpp - wraps a gpgme verify result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
signingresult.h - wraps a gpgme sign result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/* swdbresult.cpp - wraps gpgme swdb result / query
- Copyright (C) 2016 Intevation GmbH
+ Copyright (C) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
swdbresult.h - wraps a gpgme swdb query / rsult
- Copyright (C) 2016 Intevation GmbH
+ Copyright (C) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/* The time the online info was retrieved. */
unsigned long retrieved() const;
- /* This bit is set if an error occured or some of the information
+ /* This bit is set if an error occurred or some of the information
* in this structure may not be set. */
bool warning() const;
/* tofuinfo.cpp - wraps gpgme tofu info
- Copyright (C) 2016 Intevation GmbH
+ Copyright (C) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
tofuinfo.h - wraps gpgme tofu info
- Copyright (C) 2016 Intevation GmbH
+ Copyright (C) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
trustitem.cpp - wraps a gpgme trust item
Copyright (C) 2003 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
/*
trustitem.h - wraps a gpgme trust item
Copyright (C) 2003 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
/*
util.h - some inline helper functions
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
/*
verificationresult.cpp - wraps a gpgme verify result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
return !isNull() && d->sigs[idx]->chain_model;
}
+bool GpgME::Signature::isDeVs() const
+{
+ return !isNull() && d->sigs[idx]->is_de_vs;
+}
+
GpgME::Signature::PKAStatus GpgME::Signature::pkaStatus() const
{
if (!isNull()) {
<< "\n publicKeyAlgorithm: " << protect(sig.publicKeyAlgorithmAsString())
<< "\n hashAlgorithm: " << protect(sig.hashAlgorithmAsString())
<< "\n policyURL: " << protect(sig.policyURL())
+ << "\n isDeVs " << sig.isDeVs()
<< "\n notations:\n";
const std::vector<Notation> nota = sig.notations();
std::copy(nota.begin(), nota.end(),
/*
verificationresult.h - wraps a gpgme verify result
Copyright (C) 2004 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME++.
}
bool isWrongKeyUsage() const;
bool isVerifiedUsingChainModel() const;
+ bool isDeVs() const;
enum PKAStatus {
UnknownPKAStatus, PKAVerificationFailed, PKAVerificationSucceeded
/*
vfsmountresult.cpp - wraps a gpgme vfs mount result
- Copyright (C) 2009 Klarälvdalens Datakonsult AB <info@kdab.com>
+ Copyright (C) 2009 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH <info@kdab.com>
Author: Marc Mutz <marc@kdab.com>, Volker Krause <volker@kdab.com>
This file is part of GPGME++.
recursive-include examples *.py
-include gpgme-h-clean.py gpgme.i
+include gpgme.i
include helpers.c helpers.h private.h
+include version.py
recursive-include gpg *.py
MANIFEST.in \
gpgme.i \
helpers.c helpers.h private.h \
- gpgme-h-clean.py \
examples \
- gpg
+ src
SUBDIRS = . tests
-COPY_FILES = \
- $(srcdir)/gpgme.i \
- $(srcdir)/README \
- $(srcdir)/MANIFEST.in \
- $(srcdir)/gpgme-h-clean.py \
- $(srcdir)/examples \
- $(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
-
-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
+.PHONY: prepare
+prepare: copystamp
# For VPATH builds we need to copy some files because Python's
# distutils are not VPATH-aware.
-copystamp: $(COPY_FILES) $(COPY_FILES_GPG)
- set -e ; for VERSION in $(PYTHON_VERSIONS); do \
- $(MKDIR_P) python$${VERSION}-gpg/gpg ; \
- cp -R $(COPY_FILES) python$${VERSION}-gpg ; \
- cp setup.py python$${VERSION}-gpg ; \
- cp gpg/version.py python$${VERSION}-gpg/gpg ; \
- ln -sf "$(abs_top_srcdir)/src/data.h" python$${VERSION}-gpg ; \
- ln -sf "$(abs_top_builddir)/config.h" python$${VERSION}-gpg ; \
- cp -R $(COPY_FILES_GPG) python$${VERSION}-gpg/gpg ; \
- done
+copystamp:
+ ln -sf "$(top_srcdir)/src/data.h" .
+ ln -sf "$(top_builddir)/config.h" .
+ ln -sf "$(srcdir)/src" gpg
touch $@
all-local: copystamp
- set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
- PYTHON="$$1" ; shift ; \
- cd python$${VERSION}-gpg && \
+ set -e ; for PYTHON in $(PYTHONS); do \
+ CPP="$(CPP)" \
CFLAGS="$(CFLAGS)" \
- $$PYTHON setup.py build --verbose ; \
- cd .. ; \
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $$PYTHON setup.py build --verbose --build-base="$$(basename "$${PYTHON}")-gpg" ; \
done
-python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc: copystamp
- cd python$(PYTHON_VERSION)-gpg && \
+ $(MKDIR_P) python$(PYTHON_VERSION)-gpg-dist
+ CPP="$(CPP)" \
CFLAGS="$(CFLAGS)" \
- $(PYTHON) setup.py sdist --verbose
- gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz
-
-.PHONY: prepare
-prepare: copystamp
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $(PYTHON) setup.py sdist --verbose --dist-dir=python$(PYTHON_VERSION)-gpg-dist \
+ --manifest=python$(PYTHON_VERSION)-gpg-dist/MANIFEST
+ gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz
.PHONY: sdist
-sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
- python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
+sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
.PHONY: upload
-upload: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
- python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
+upload: python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz \
+ python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz.asc
twine upload $^
-CLEANFILES = copystamp
+CLEANFILES = copystamp \
+ config.h \
+ data.h \
+ gpg
# Remove the rest.
#
# permissions.
clean-local:
rm -rf -- build
- for VERSION in $(PYTHON_VERSIONS); do \
- find python$${VERSION}-gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \
- rm -rf -- python$${VERSION}-gpg ; \
+ for PYTHON in $(PYTHONS); do \
+ find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
+ rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
done
install-exec-local:
- rm -f install_files.txt
- set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
- PYTHON="$$1" ; shift ; \
- cd python$${VERSION}-gpg ; \
- $$PYTHON setup.py install \
- --prefix $(DESTDIR)$(prefix) \
- --record files.txt \
+ set -e ; for PYTHON in $(PYTHONS); do \
+ CPP="$(CPP)" \
+ CFLAGS="$(CFLAGS)" \
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $$PYTHON setup.py \
+ build \
+ --build-base="$$(basename "$${PYTHON}")-gpg" \
+ install \
+ --prefix "$(DESTDIR)$(prefix)" \
--verbose ; \
- cat files.txt >> ../install_files.txt ; \
- rm files.txt ; \
- cd .. ; \
done
- $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
- mv install_files.txt $(DESTDIR)$(pythondir)/gpg
uninstall-local:
- xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
- rm -rf -- $(DESTDIR)$(pythondir)/gpg
+ set -x; GV=$$(echo $(VERSION) | tr - _); for PYTHON in $(PYTHONS); do \
+ PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
+ rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
+ "$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info ; \
+ done
host_triplet = @host@
subdir = lang/python
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/build-aux/mkinstalldirs $(srcdir)/setup.py.in \
- README
+ $(top_srcdir)/build-aux/mkinstalldirs $(srcdir)/version.py.in \
+ $(srcdir)/setup.py.in README
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 \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = setup.py
+CONFIG_CLEAN_FILES = version.py setup.py
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
MANIFEST.in \
gpgme.i \
helpers.c helpers.h private.h \
- gpgme-h-clean.py \
examples \
- gpg
+ src
SUBDIRS = . tests
-COPY_FILES = \
- $(srcdir)/gpgme.i \
- $(srcdir)/README \
- $(srcdir)/MANIFEST.in \
- $(srcdir)/gpgme-h-clean.py \
- $(srcdir)/examples \
- $(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
-
-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 = copystamp
+CLEANFILES = copystamp \
+ config.h \
+ data.h \
+ gpg
+
all: all-recursive
.SUFFIXES:
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+version.py: $(top_builddir)/config.status $(srcdir)/version.py.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ps ps-am tags tags-am uninstall uninstall-am uninstall-local
+.PHONY: prepare
+prepare: copystamp
+
# For VPATH builds we need to copy some files because Python's
# distutils are not VPATH-aware.
-copystamp: $(COPY_FILES) $(COPY_FILES_GPG)
- set -e ; for VERSION in $(PYTHON_VERSIONS); do \
- $(MKDIR_P) python$${VERSION}-gpg/gpg ; \
- cp -R $(COPY_FILES) python$${VERSION}-gpg ; \
- cp setup.py python$${VERSION}-gpg ; \
- cp gpg/version.py python$${VERSION}-gpg/gpg ; \
- ln -sf "$(abs_top_srcdir)/src/data.h" python$${VERSION}-gpg ; \
- ln -sf "$(abs_top_builddir)/config.h" python$${VERSION}-gpg ; \
- cp -R $(COPY_FILES_GPG) python$${VERSION}-gpg/gpg ; \
- done
+copystamp:
+ ln -sf "$(top_srcdir)/src/data.h" .
+ ln -sf "$(top_builddir)/config.h" .
+ ln -sf "$(srcdir)/src" gpg
touch $@
all-local: copystamp
- set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
- PYTHON="$$1" ; shift ; \
- cd python$${VERSION}-gpg && \
+ set -e ; for PYTHON in $(PYTHONS); do \
+ CPP="$(CPP)" \
CFLAGS="$(CFLAGS)" \
- $$PYTHON setup.py build --verbose ; \
- cd .. ; \
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $$PYTHON setup.py build --verbose --build-base="$$(basename "$${PYTHON}")-gpg" ; \
done
-python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc: copystamp
- cd python$(PYTHON_VERSION)-gpg && \
+ $(MKDIR_P) python$(PYTHON_VERSION)-gpg-dist
+ CPP="$(CPP)" \
CFLAGS="$(CFLAGS)" \
- $(PYTHON) setup.py sdist --verbose
- gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz
-
-.PHONY: prepare
-prepare: copystamp
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $(PYTHON) setup.py sdist --verbose --dist-dir=python$(PYTHON_VERSION)-gpg-dist \
+ --manifest=python$(PYTHON_VERSION)-gpg-dist/MANIFEST
+ gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz
.PHONY: sdist
-sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
- python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
+sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
.PHONY: upload
-upload: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
- python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
+upload: python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz \
+ python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz.asc
twine upload $^
# Remove the rest.
# permissions.
clean-local:
rm -rf -- build
- for VERSION in $(PYTHON_VERSIONS); do \
- find python$${VERSION}-gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \
- rm -rf -- python$${VERSION}-gpg ; \
+ for PYTHON in $(PYTHONS); do \
+ find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
+ rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
done
install-exec-local:
- rm -f install_files.txt
- set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
- PYTHON="$$1" ; shift ; \
- cd python$${VERSION}-gpg ; \
- $$PYTHON setup.py install \
- --prefix $(DESTDIR)$(prefix) \
- --record files.txt \
+ set -e ; for PYTHON in $(PYTHONS); do \
+ CPP="$(CPP)" \
+ CFLAGS="$(CFLAGS)" \
+ srcdir="$(srcdir)" \
+ top_builddir="$(top_builddir)" \
+ $$PYTHON setup.py \
+ build \
+ --build-base="$$(basename "$${PYTHON}")-gpg" \
+ install \
+ --prefix "$(DESTDIR)$(prefix)" \
--verbose ; \
- cat files.txt >> ../install_files.txt ; \
- rm files.txt ; \
- cd .. ; \
done
- $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
- mv install_files.txt $(DESTDIR)$(pythondir)/gpg
uninstall-local:
- xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
- rm -rf -- $(DESTDIR)$(pythondir)/gpg
+ set -x; GV=$$(echo $(VERSION) | tr - _); for PYTHON in $(PYTHONS); do \
+ PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
+ rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
+ "$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info ; \
+ done
# 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.
# of them.
with gpg.Context() as c:
# Note: We must not modify the key store during iteration,
- # therfore, we explicitly make a list.
+ # therefore, we explicitly make a list.
keys = list(c.keylist(user))
for k in keys:
+++ /dev/null
-# Copyright (C) 2016 g10 Code GmbH
-# Copyright (C) 2015 Ben McGinnes <ben@adversary.org>
-# Copyright (C) 2004 Igor Belyi <belyi@users.sourceforge.net>
-#
-# This library 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.
-#
-# This library 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 library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-from __future__ import absolute_import, print_function
-del absolute_import, print_function
-
-from . import gpgme
-
-productname = 'gpg'
-versionstr = "1.9.0"
-gpgme_versionstr = gpgme.GPGME_VERSION
-in_tree_build = bool(gpgme.cvar.gpg_in_tree_build)
-
-versionlist = versionstr.split(".")
-major = versionlist[0]
-minor = versionlist[1]
-patch = versionlist[2]
-
-copyright = """\
-Copyright (C) 2016 g10 Code GmbH
-Copyright (C) 2015 Ben McGinnes
-Copyright (C) 2014-2015 Martin Albrecht
-Copyright (C) 2004-2008 Igor Belyi
-Copyright (C) 2002 John Goerzen"""
-
-author = "The GnuPG hackers"
-author_email = "gnupg-devel@gnupg.org"
-
-description = "Python support for GPGME GnuPG cryptography library"
-homepage = "https://gnupg.org"
-
-license = """Copyright (C) 2016 g10 Code GmbH
-Copyright (C) 2015 Ben McGinnes <ben@adversary.org>
-Copyright (C) 2014, 2015 Martin Albrecht <martinralbrecht@googlemail.com>
-Copyright (C) 2004, 2008 Igor Belyi <belyi@users.sourceforge.net>
-Copyright (C) 2002 John Goerzen <jgoerzen@complete.org>
-
-This library 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.
-
-This library 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 library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"""
-
-# Interface hygiene. Keep this at the end.
-del gpgme
+++ /dev/null
-#!/usr/bin/env python
-
-# Copyright (C) 2016 g10 Code GmbH
-# Copyright (C) 2004,2008 Igor Belyi <belyi@users.sourceforge.net>
-#
-# This library 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.
-#
-# This library 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 library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
-
-import sys, re
-
-if len(sys.argv) != 2:
- sys.stderr.write("Usage: %s path/to/[gpgme|gpg-error].h\n" % sys.argv[0])
- sys.exit(1)
-
-deprec_func = re.compile(r'^(.*typedef.*|.*\(.*\)|[^#]+\s+.+)'
- + r'\s*_GPGME_DEPRECATED(_OUTSIDE_GPGME)?\(.*\);\s*',
- re.S)
-line_break = re.compile(';|\\$|\\x0c|^\s*#|{');
-
-if 'gpgme.h' in sys.argv[1]:
- gpgme = open(sys.argv[1])
- tmp = gpgme.readline()
- text = ''
- while tmp:
- text += re.sub(' class ', ' _py_obsolete_class ', tmp)
- if line_break.search(tmp):
- if not deprec_func.search(text):
- sys.stdout.write(text)
- text = ''
- tmp = gpgme.readline()
- sys.stdout.write(text)
- gpgme.close()
-else:
- filter_re = re.compile(r'GPG_ERR_[^ ]* =')
- rewrite_re = re.compile(r' *(.*) = .*')
- for line in open(sys.argv[1]):
- if not filter_re.search(line):
- continue
- print(rewrite_re.sub(r'%constant long \1 = \1;', line.strip()))
const char *pattern="",
int secret_only=0);
+/* The whence argument is surprising in Python-land,
+ because BytesIO or StringIO objects do not require it.
+ It defaults to SEEK_SET. Let's do that for Data objects, too */
+off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence=SEEK_SET);
+
/* Include the unmodified <gpgme.h> for cc, and the cleaned-up local
version for SWIG. We do, however, want to hide certain fields on
some structs, which we provide prior to including the version for
#!/usr/bin/env python
-# Copyright (C) 2016 g10 Code GmbH
-# Copyright (C) 2004 Igor Belyi <belyi@users.sourceforge.net>
+# Copyright (C) 2016-2017 g10 Code GmbH
+# Copyright (C) 2004,2008 Igor Belyi <belyi@users.sourceforge.net>
# Copyright (C) 2002 John Goerzen <jgoerzen@complete.org>
#
# This library is free software; you can redistribute it and/or
from distutils.core import setup, Extension
import os, os.path, sys
import glob
+import re
+import shutil
import subprocess
# Out-of-tree build of the gpg bindings.
extra_swig_opts = []
extra_macros = dict()
-if os.path.exists("../../../src/gpgme-config"):
+top_builddir = os.environ.get("top_builddir")
+if top_builddir:
# In-tree build.
in_tree = True
- gpgme_config = ["../../../src/gpgme-config"] + gpgme_config_flags
- gpgme_h = "../../../src/gpgme.h"
- library_dirs = ["../../../src/.libs"] # XXX uses libtool internals
+ gpgme_config = [os.path.join(top_builddir, "src/gpgme-config")] + gpgme_config_flags
+ gpgme_h = os.path.join(top_builddir, "src/gpgme.h")
+ library_dirs = [os.path.join(top_builddir, "src/.libs")] # XXX uses libtool internals
extra_macros.update(
HAVE_CONFIG_H=1,
HAVE_DATA_H=1,
devnull = open(os.devnull, "w")
try:
- subprocess.check_call(gpg_error_config + ['--version'],
- stdout=devnull)
-except:
- sys.exit("Could not find gpg-error-config. " +
- "Please install the libgpg-error development package.")
-
-try:
subprocess.check_call(gpgme_config + ['--version'],
stdout=devnull)
except:
if not gpgme_h:
gpgme_h = os.path.join(getconfig("prefix")[0], "include", "gpgme.h")
-gpg_error_prefix = getconfig("prefix", config=gpg_error_config)[0]
-gpg_error_h = os.path.join(gpg_error_prefix, "include", "gpg-error.h")
-if not os.path.exists(gpg_error_h):
- gpg_error_h = \
- glob.glob(os.path.join(gpg_error_prefix, "include",
- "*", "gpg-error.h"))[0]
-
-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],
- stdout=open("gpgme.h", "w"))
-subprocess.check_call([sys.executable, "gpgme-h-clean.py", gpg_error_h],
- stdout=open("errors.i", "w"))
-
define_macros = []
libs = getconfig('libs')
library_dirs.append(os.path.join(tgt, item))
break
+def in_srcdir(name):
+ return os.path.join(os.environ.get("srcdir", ""), name)
+def up_to_date(source, target):
+ return (os.path.exists(target)
+ and os.path.getmtime(source) <= os.path.getmtime(target))
+
# We build an Extension using SWIG, which generates a Python module.
# By default, the 'build_py' step is run before 'build_ext', and
# therefore the generated Python module is not copied into the build
# http://stackoverflow.com/questions/12491328/python-distutils-not-include-the-swig-generated-module
from distutils.command.build import build
class BuildExtFirstHack(build):
+
+ def _read_header(self, header, cflags):
+ tmp_include = self._in_build_base("include1.h")
+ with open(tmp_include, 'w') as f:
+ f.write("#include <%s>" % header)
+ return subprocess.check_output(os.environ.get('CPP', 'cc -E').split() + cflags + [tmp_include]).decode('utf-8')
+
+ def _write_if_unchanged(self, target, content):
+ if os.path.exists(target):
+ with open(target) as f:
+ if f.read() == content:
+ return
+
+ with open(target, "w") as sink:
+ sink.write(content)
+
+ def _generate_gpgme_h(self, source_name, sink_name):
+ if up_to_date(source_name, sink_name):
+ return
+
+ print("Using gpgme.h from {}".format(source_name))
+
+ deprec_func = re.compile(r'^(.*typedef.*|.*\(.*\)|[^#]+\s+.+)'
+ + r'\s*_GPGME_DEPRECATED(_OUTSIDE_GPGME)?\(.*\);\s*',
+ re.S)
+ line_break = re.compile(';|\\$|\\x0c|^\s*#|{')
+
+ with open(sink_name, "w") as sink, open(source_name) as source:
+ text = ''
+ for line in source:
+ text += re.sub(' class ', ' _py_obsolete_class ', line)
+ if line_break.search(line):
+ if not deprec_func.search(text):
+ sink.write(text)
+ text = ''
+ sink.write(text)
+
+ def _generate_errors_i(self):
+
+ try:
+ subprocess.check_call(gpg_error_config + ['--version'],
+ stdout=devnull)
+ except:
+ sys.exit("Could not find gpg-error-config. " +
+ "Please install the libgpg-error development package.")
+
+ gpg_error_content = self._read_header("gpg-error.h", getconfig("cflags", config=gpg_error_config))
+
+ filter_re = re.compile(r'GPG_ERR_[^ ]* =')
+ rewrite_re = re.compile(r' *(.*) = .*')
+
+ errors_i_content = ''
+ for line in gpg_error_content.splitlines():
+ if not filter_re.search(line):
+ continue
+ errors_i_content += rewrite_re.sub(r'%constant long \1 = \1;'+'\n', line.strip())
+
+ self._write_if_unchanged(self._in_build_base("errors.i"), errors_i_content)
+
+ def _in_build_base(self, name):
+ return os.path.join(self.build_base, name)
+
+ def _generate(self):
+ # Cleanup gpgme.h from deprecated functions and typedefs.
+ if not os.path.exists(self.build_base):
+ os.makedirs(self.build_base)
+
+ self._generate_gpgme_h(gpgme_h, self._in_build_base("gpgme.h"))
+ self._generate_errors_i()
+
+ # Copy due to http://bugs.python.org/issue2624
+ # Avoid creating in srcdir
+ for source, target in ((in_srcdir(n), self._in_build_base(n))
+ for n in ('gpgme.i', 'helpers.c', 'private.h', 'helpers.h')):
+ if not up_to_date(source, target):
+ shutil.copy2(source, target)
+
+ # Append generated files via build_base
+ if not os.path.exists(os.path.join(self.build_lib, "gpg")):
+ os.makedirs(os.path.join(self.build_lib, "gpg"))
+ shutil.copy2("version.py", os.path.join(self.build_lib, "gpg"))
+
def run(self):
+ self._generate()
+
+ swig_sources.extend((self._in_build_base('gpgme.i'), self._in_build_base('helpers.c')))
+ swig_opts.extend(['-I' + self.build_base,
+ '-outdir', os.path.join(self.build_lib, 'gpg')])
+ include_dirs.insert(0, self.build_base)
+
self.run_command('build_ext')
build.run(self)
py3 = [] if sys.version_info.major < 3 else ['-py3']
-swige = Extension("gpg._gpgme", ["gpgme.i", "helpers.c"],
- swig_opts = ['-threads',
- '-outdir', 'gpg'] + py3 + extra_swig_opts,
+swig_sources = []
+swig_opts = ['-threads'] + py3 + extra_swig_opts
+swige = Extension("gpg._gpgme",
+ sources = swig_sources,
+ swig_opts = swig_opts,
include_dirs = include_dirs,
define_macros = define_macros,
library_dirs = library_dirs,
result = func(slf.wrapped, *args)
if slf._callback_excinfo:
gpgme.gpg_raise_callback_exception(slf)
- return errorcheck(result, "Invocation of " + name)
+ return errorcheck(result, name)
else:
def _funcwrap(slf, *args):
result = func(slf.wrapped, *args)
self.protocol = protocol
self.home_dir = home_dir
+ def __read__(self, sink, data):
+ """Read helper
+
+ Helper function to retrieve the results of an operation, or
+ None if SINK is given.
+ """
+ if sink or data == None:
+ return None
+ data.seek(0, os.SEEK_SET)
+ return data.read()
+
def __repr__(self):
return (
"Context(armor={0.armor}, "
else:
self.op_encrypt(recipients, flags, plaintext, ciphertext)
except errors.GPGMEError as e:
+ result = self.op_encrypt_result()
+ sig_result = self.op_sign_result() if sign else None
+ results = (self.__read__(sink, ciphertext),
+ result, sig_result)
if e.getcode() == errors.UNUSABLE_PUBKEY:
- result = self.op_encrypt_result()
if result.invalid_recipients:
- raise errors.InvalidRecipients(result.invalid_recipients)
+ raise errors.InvalidRecipients(result.invalid_recipients,
+ error=e.error,
+ results=results)
if e.getcode() == errors.UNUSABLE_SECKEY:
sig_result = self.op_sign_result()
if sig_result.invalid_signers:
- raise errors.InvalidSigners(sig_result.invalid_signers)
- raise
+ raise errors.InvalidSigners(sig_result.invalid_signers,
+ error=e.error,
+ results=results)
+ # Otherwise, just raise the error, but attach the results
+ # first.
+ e.results = results
+ raise e
finally:
if passphrase != None:
self.pinentry_mode = old_pinentry_mode
sig_result = self.op_sign_result() if sign else None
assert not sig_result or not sig_result.invalid_signers
- cipherbytes = None
- if not sink:
- ciphertext.seek(0, os.SEEK_SET)
- cipherbytes = ciphertext.read()
- return cipherbytes, result, sig_result
+ return self.__read__(sink, ciphertext), result, sig_result
def decrypt(self, ciphertext, sink=None, passphrase=None, verify=True):
"""Decrypt data
self.op_decrypt_verify(ciphertext, plaintext)
else:
self.op_decrypt(ciphertext, plaintext)
+ except errors.GPGMEError as e:
+ result = self.op_decrypt_result()
+ verify_result = self.op_verify_result() if verify else None
+ # Just raise the error, but attach the results first.
+ e.results = (self.__read__(sink, plaintext),
+ result, verify_result)
+ raise e
finally:
if passphrase != None:
self.pinentry_mode = old_pinentry_mode
result = self.op_decrypt_result()
verify_result = self.op_verify_result() if verify else None
+ results = (self.__read__(sink, plaintext), result, verify_result)
if result.unsupported_algorithm:
- raise errors.UnsupportedAlgorithm(result.unsupported_algorithm)
+ raise errors.UnsupportedAlgorithm(result.unsupported_algorithm,
+ results=results)
if verify:
if any(s.status != errors.NO_ERROR
for s in verify_result.signatures):
- raise errors.BadSignatures(verify_result)
+ raise errors.BadSignatures(verify_result, results=results)
if verify and verify != True:
missing = list()
if not ok:
missing.append(key)
if missing:
- raise errors.MissingSignatures(verify_result, missing)
+ raise errors.MissingSignatures(verify_result, missing,
+ results=results)
- plainbytes = None
- if not sink:
- plaintext.seek(0, os.SEEK_SET)
- plainbytes = plaintext.read()
- return plainbytes, result, verify_result
+ return results
def sign(self, data, sink=None, mode=constants.SIG_MODE_NORMAL):
"""Sign data
try:
self.op_sign(data, signeddata, mode)
except errors.GPGMEError as e:
+ results = (self.__read__(sink, signeddata),
+ self.op_sign_result())
if e.getcode() == errors.UNUSABLE_SECKEY:
- result = self.op_sign_result()
- if result.invalid_signers:
- raise errors.InvalidSigners(result.invalid_signers)
- raise
+ if results[1].invalid_signers:
+ raise errors.InvalidSigners(results[1].invalid_signers,
+ error=e.error,
+ results=results)
+ e.results = results
+ raise e
result = self.op_sign_result()
assert not result.invalid_signers
- signedbytes = None
- if not sink:
- signeddata.seek(0, os.SEEK_SET)
- signedbytes = signeddata.read()
- return signedbytes, result
+ return self.__read__(sink, signeddata), result
def verify(self, signed_data, signature=None, sink=None, verify=[]):
"""Verify signatures
else:
data = sink if sink else Data()
- if signature:
- self.op_verify(signature, signed_data, None)
- else:
- self.op_verify(signed_data, None, data)
+ try:
+ if signature:
+ self.op_verify(signature, signed_data, None)
+ else:
+ self.op_verify(signed_data, None, data)
+ except errors.GPGMEError as e:
+ # Just raise the error, but attach the results first.
+ e.results = (self.__read__(sink, data),
+ self.op_verify_result())
+ raise e
- result = self.op_verify_result()
- if any(s.status != errors.NO_ERROR for s in result.signatures):
- raise errors.BadSignatures(result)
+ results = (self.__read__(sink, data), self.op_verify_result())
+ if any(s.status != errors.NO_ERROR for s in results[1].signatures):
+ raise errors.BadSignatures(results[1], results=results)
missing = list()
for key in verify:
ok = False
for subkey in key.subkeys:
- for sig in result.signatures:
+ for sig in results[1].signatures:
if sig.summary & constants.SIGSUM_VALID == 0:
continue
if subkey.can_sign and subkey.fpr == sig.fpr:
if not ok:
missing.append(key)
if missing:
- raise errors.MissingSignatures(result, missing)
+ raise errors.MissingSignatures(results[1], missing,
+ results=results)
- plainbytes = None
- if data and not sink:
- data.seek(0, os.SEEK_SET)
- plainbytes = data.read()
- return plainbytes, result
+ return results
def keylist(self, pattern=None, secret=False,
mode=constants.keylist.mode.LOCAL,
+# Copyright (C) 2016-2017 g10 Code GmbH
# Copyright (C) 2004 Igor Belyi <belyi@users.sourceforge.net>
# Copyright (C) 2002 John Goerzen <jgoerzen@complete.org>
#
del util
class GpgError(Exception):
- pass
+ """A GPG Error
-class GPGMEError(GpgError):
- def __init__(self, error = None, message = None):
+ This is the base of all errors thrown by this library.
+
+ If the error originated from GPGME, then additional information
+ can be found by looking at 'code' for the error code, and 'source'
+ for the errors origin. Suitable constants for comparison are
+ defined in this module. 'code_str' and 'source_str' are
+ human-readable versions of the former two properties.
+
+ If 'context' is not None, then it contains a human-readable hint
+ as to where the error originated from.
+
+ If 'results' is not None, it is a tuple containing results of the
+ operation that failed. The tuples elements are the results of the
+ function that raised the error. Some operations return results
+ even though they signal an error. Of course this information must
+ be taken with a grain of salt. But often, this information is
+ useful for diagnostic uses or to give the user feedback. Since
+ the normal control flow is disrupted by the exception, the callee
+ can no longer return results, hence we attach them to the
+ exception objects.
+
+ """
+ def __init__(self, error=None, context=None, results=None):
self.error = error
- self.message = message
+ self.context = context
+ self.results = results
+
+ @property
+ def code(self):
+ if self.error == None:
+ return None
+ return gpgme.gpgme_err_code(self.error)
+
+ @property
+ def code_str(self):
+ if self.error == None:
+ return None
+ return gpgme.gpgme_strerror(self.error)
+
+ @property
+ def source(self):
+ if self.error == None:
+ return None
+ return gpgme.gpgme_err_source(self.error)
+
+ @property
+ def source_str(self):
+ if self.error == None:
+ return None
+ return gpgme.gpgme_strsource(self.error)
+
+ def __str__(self):
+ msgs = []
+ if self.context != None:
+ msgs.append(self.context)
+ if self.error != None:
+ msgs.append(self.source_str)
+ msgs.append(self.code_str)
+ return ': '.join(msgs)
+
+class GPGMEError(GpgError):
+ '''Generic error
+
+ This is a generic error that wraps the underlying libraries native
+ error type. It is thrown when the low-level API is invoked and
+ returns an error. This is the error that was used in PyME.
+ '''
@classmethod
def fromSyserror(cls):
return cls(gpgme.gpgme_err_code_from_syserror())
-
+ @property
+ def message(self):
+ return self.context
def getstring(self):
- message = "%s: %s" % (gpgme.gpgme_strsource(self.error),
- gpgme.gpgme_strerror(self.error))
- if self.message != None:
- message = "%s: %s" % (self.message, message)
- return message
-
+ return str(self)
def getcode(self):
- return gpgme.gpgme_err_code(self.error)
-
+ return self.code
def getsource(self):
- return gpgme.gpgme_err_source(self.error)
+ return self.source
- def __str__(self):
- return self.getstring()
def errorcheck(retval, extradata = None):
if retval:
pass
class InvalidRecipients(EncryptionError):
- def __init__(self, recipients):
+ def __init__(self, recipients, **kwargs):
+ EncryptionError.__init__(self, **kwargs)
self.recipients = recipients
def __str__(self):
return ", ".join("{}: {}".format(r.fpr,
pass
class UnsupportedAlgorithm(DeryptionError):
- def __init__(self, algorithm):
+ def __init__(self, algorithm, **kwargs):
+ DeryptionError.__init__(self, **kwargs)
self.algorithm = algorithm
def __str__(self):
return self.algorithm
pass
class InvalidSigners(SigningError):
- def __init__(self, signers):
+ def __init__(self, signers, **kwargs):
+ SigningError.__init__(self, **kwargs)
self.signers = signers
def __str__(self):
return ", ".join("{}: {}".format(s.fpr,
for s in self.signers)
class VerificationError(GpgError):
- pass
+ def __init__(self, result, **kwargs):
+ GpgError.__init__(self, **kwargs)
+ self.result = result
class BadSignatures(VerificationError):
- def __init__(self, result):
- self.result = result
def __str__(self):
return ", ".join("{}: {}".format(s.fpr,
gpgme.gpgme_strerror(s.status))
if s.status != NO_ERROR)
class MissingSignatures(VerificationError):
- def __init__(self, result, missing):
- self.result = result
+ def __init__(self, result, missing, **kwargs):
+ VerificationError.__init__(self, result, **kwargs)
self.missing = missing
def __str__(self):
return ", ".join(k.subkeys[0].fpr for k in self.missing)
pass
class DecryptResult(Result):
- _type = dict(wrong_key_usage=bool)
+ _type = dict(wrong_key_usage=bool, is_de_vs=bool)
_map = dict(recipients=Recipient)
class NewSignature(Result):
pass
class Signature(Result):
- _type = dict(wrong_key_usage=bool, chain_model=bool)
+ _type = dict(wrong_key_usage=bool, chain_model=bool, is_de_vs=bool)
_map = dict(notations=Notation)
class VerifyResult(Result):
.PHONY: xcheck
-xcheck: ./pubring-stamp
+xcheck: all
$(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
--interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
$(XTESTS)
-rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
-./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
+BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
+
+private-keys-v1.d/gpg-sample.stamp: $(private_keys)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
done
echo x > ./private-keys-v1.d/gpg-sample.stamp
-./pubring-stamp: $(test_srcdir)/pubdemo.asc \
- ./gpg.conf ./gpg-agent.conf \
+pubring-stamp: $(test_srcdir)/pubdemo.asc \
./private-keys-v1.d/gpg-sample.stamp
$(GPG) --batch --no-permission-warning \
--import $(test_srcdir)/pubdemo.asc
--import $(test_srcdir)/secdemo.asc
echo x > ./pubring-stamp
-./gpg.conf:
+gpg.conf:
# This is required for t-sig-notations.
echo no-force-v3-sigs > ./gpg.conf
echo ignore-invalid-option agent-program >> ./gpg.conf
echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf
-./gpg-agent.conf:
+gpg-agent.conf:
# This is required for gpg2, which does not support command fd.
echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
$(test_srcdir)/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
$(test_srcdir)/7A030357C0F253A5BBCD282FFC4E521B37558F5C
-all: all-am
+BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
+
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
fi; \
done
check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile
installdirs:
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
uninstall-am:
-.MAKE: install-am install-strip
+.MAKE: all check install install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
.PHONY: xcheck
-xcheck: ./pubring-stamp
+xcheck: all
$(TESTS_ENVIRONMENT) $(PYTHON) $(srcdir)/run-tests.py \
--interpreters="$(PYTHONS)" --srcdir=$(srcdir) $(TESTFLAGS) \
$(XTESTS)
-$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol
-./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
+private-keys-v1.d/gpg-sample.stamp: $(private_keys)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \
done
echo x > ./private-keys-v1.d/gpg-sample.stamp
-./pubring-stamp: $(test_srcdir)/pubdemo.asc \
- ./gpg.conf ./gpg-agent.conf \
+pubring-stamp: $(test_srcdir)/pubdemo.asc \
./private-keys-v1.d/gpg-sample.stamp
$(GPG) --batch --no-permission-warning \
--import $(test_srcdir)/pubdemo.asc
--import $(test_srcdir)/secdemo.asc
echo x > ./pubring-stamp
-./gpg.conf:
+gpg.conf:
# This is required for t-sig-notations.
echo no-force-v3-sigs > ./gpg.conf
echo ignore-invalid-option agent-program >> ./gpg.conf
echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf
-./gpg-agent.conf:
+gpg-agent.conf:
# This is required for gpg2, which does not support command fd.
echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
import os
import subprocess
+import support
+_ = support # to appease pyflakes.
subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
"tests", "start-stop-agent"), "--stop"])
parser.add_argument('--builddir', type=str,
default=os.environ.get("abs_builddir", ""),
help='Location of the tests.')
+parser.add_argument('--python-libdir', type=str,
+ default=None,
+ help='Optional location of the in-tree module lib directory.')
parser.add_argument('--parallel', action="store_true", default=False,
help='Ignored. For compatibility with run-tests.scm.')
version = subprocess.check_output(
[interpreter, "-c", "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))"]).strip().decode()
- pattern = os.path.join(args.builddir, "..",
- "python{0}-gpg".format(version),
- "build",
- "lib*"+version)
- builddirs = glob.glob(pattern)
- if len(builddirs) == 0:
- sys.exit("Build directory matching {0!r} not found.".format(pattern))
- elif len(builddirs) > 1:
- sys.exit("Multiple build directories matching {0!r} found: {1}".format(
- pattern, builddirs))
+ if args.python_libdir:
+ python_libdir = args.python_libdir
+ else:
+ pattern = os.path.join(args.builddir, "..",
+ "{0}-gpg".format(os.path.basename(interpreter)),
+ "lib*")
+ libdirs = glob.glob(pattern)
+ if len(libdirs) == 0:
+ sys.exit("Build directory matching {0!r} not found.".format(pattern))
+ elif len(libdirs) > 1:
+ sys.exit("Multiple build directories matching {0!r} found: {1}".format(
+ pattern, libdirs))
+ python_libdir = libdirs[0]
env = dict(os.environ)
- env["PYTHONPATH"] = builddirs[0]
+ env["PYTHONPATH"] = python_libdir
if not args.quiet:
print("Running tests using {0} ({1})...".format(interpreter, version))
if not args.quiet:
print("{0} tests run, {1} succeeded, {2} failed, {3} skipped.".format(
len(results), count(0), failed(), count(77)))
- sys.exit(len(results) - count(0))
+ sys.exit(len(results) - count(0) - count(77))
sys.exit(results[0])
c.engine_info.version, '.'.join(map(str, version))))
sys.exit(77)
+def have_tofu_support(ctx, some_uid):
+ keys = list(ctx.keylist(some_uid,
+ mode=(gpg.constants.keylist.mode.LOCAL
+ |gpg.constants.keylist.mode.WITH_TOFU)))
+ return len(keys) > 0
+
# Skip the Python tests for GnuPG < 2.1.12. Prior versions do not
# understand the command line flags that we assume exist. C.f. issue
# 3008.
import os
import gpg
import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
c = gpg.Context()
c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
import os
import tempfile
import gpg
+import support
+_ = support # to appease pyflakes.
data = gpg.Data('Hello world!')
assert data.read() == b'Hello world!'
data.seek(0, os.SEEK_SET)
assert data.read() == b'Hello world!'
+data = gpg.Data()
+data.write(b'Hello world!')
+# We expect the second argument to default to SEEK_SET
+data.seek(0)
+assert data.read() == b'Hello world!'
+
binjunk = bytes(range(256))
data = gpg.Data()
data.write(binjunk)
import os
import gpg
import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
class KeyEditor(object):
def __init__(self):
import os
import gpg
import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
for passphrase in ("abc", b"abc"):
c = gpg.Context()
import os
import gpg
import support
+_ = support # to appease pyflakes.
testname = "abcde12345"
import tempfile
import gpg
import support
+_ = support # to appease pyflakes.
# Both Context and Data can be used as context manager:
with gpg.Context() as c, gpg.Data() as d:
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
-import os
-import sys
import gpg
import support
assert len(alpha_keys) == 1, "Expected only one key for 'Alpha', got %r" % len(alpha_keys)
+# Check negative result.
+assert len(list(c.keylist("no such key in sight"))) == 0
+
for i, key in enumerate(c.keylist()):
try:
del absolute_import, print_function, unicode_literals
import gpg
+import support
+_ = support # to appease pyflakes.
with gpg.Context(protocol=gpg.constants.protocol.ASSUAN) as c:
# Do nothing.
import os
import gpg
+import sys
import support
support.assert_gpg_version((2, 1, 14))
with open(os.path.join(ctx.home_dir, "gpg.conf"), "a") as handle:
handle.write("trust-model tofu+pgp\n")
+ if not support.have_tofu_support(ctx, bravo):
+ print("GnuPG does not support TOFU, skipping TOFU tests.")
+ sys.exit()
+
for name, policy in [(name, getattr(gpg.constants.tofu.policy, name))
for name in filter(lambda x: not x.startswith('__'),
dir(gpg.constants.tofu.policy))]:
import os
import gpg
import support
+_ = support # to appease pyflakes.
expected_notations = {
"laughing@me": ("Just Squeeze Me", gpg.constants.sig.notation.HUMAN_READABLE),
import gpg
import support
+_ = support # to appease pyflakes.
c = gpg.Context()
import os
import gpg
import support
+_ = support # to appease pyflakes.
test_text1 = b"Just GNU it!\n"
test_text1f= b"Just GNU it?\n"
import time
import gpg
import support
+_ = support # to appease pyflakes.
c = gpg.Context()
c.set_armor(True)
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
import gpg
+import support
+_ = support # to appease pyflakes.
d0 = gpg.Data()
d0.seek # trigger on-demand-wrapping
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
@SET_MAKE@
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
result handlers.
The result signal provides a tuple of objects with the
-appropiate result information for this job. For historic
+appropriate result information for this job. For historic
reasons each result signal also includes an AuditLog
and an AuditLog Error. These are only useful for
S/MIME signature validation but are part of other jobs
job->start(keys, inptr, outptr, Context::AlwaysTrust);
/* Do not delete the job as it is autodeleted. */
-Syncronus usage:
+Synchronous usage:
/* Create a job */
KeyListJob *listjob = openpgp()->keyListJob(false, false, false);
# Makefile.am - Makefile for GPGME Qt docs.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGME.
#
@SET_MAKE@
# Makefile.am - Makefile for GPGME Qt docs.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGME.
#
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
qgpgmesignjob.cpp qgpgmesignkeyjob.cpp qgpgmeverifydetachedjob.cpp \
qgpgmeverifyopaquejob.cpp threadedjobmixin.cpp \
qgpgmekeyformailboxjob.cpp gpgme_backend_debug.cpp \
- qgpgmetofupolicyjob.cpp \
+ qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \
defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \
dn.cpp cryptoconfig.cpp
protocol.h \
qgpgme_export.h \
qgpgmenewcryptoconfig.h \
+ quickjob.h \
specialjob.h \
signjob.h \
signkeyjob.h \
MultiDeleteJob \
Protocol \
QGpgMENewCryptoConfig \
+ QuickJob \
SpecialJob \
SignJob \
SignKeyJob \
qgpgmekeyformailboxjob.h \
qgpgmewkspublishjob.h \
qgpgmetofupolicyjob.h \
+ qgpgmequickjob.h \
threadedjobmixin.h
qgpgme_moc_sources = \
keyformailboxjob.moc \
wkspublishjob.moc \
qgpgmekeyformailboxjob.moc \
- defaultkeygenerationjob.moc
+ defaultkeygenerationjob.moc \
+ quickjob.moc \
+ qgpgmequickjob.moc
qgpgmeincludedir = $(includedir)/qgpgme
qgpgmeinclude_HEADERS = $(qgpgme_headers)
qgpgmeverifydetachedjob.lo qgpgmeverifyopaquejob.lo \
threadedjobmixin.lo qgpgmekeyformailboxjob.lo \
gpgme_backend_debug.lo qgpgmetofupolicyjob.lo \
- defaultkeygenerationjob.lo qgpgmewkspublishjob.lo dn.lo \
- cryptoconfig.lo
+ qgpgmequickjob.lo defaultkeygenerationjob.lo \
+ qgpgmewkspublishjob.lo dn.lo cryptoconfig.lo
am__objects_2 =
am_libqgpgme_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_2)
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
top_srcdir = @top_srcdir@
# Makefile.am for GPGMEPP.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGMEPP.
#
qgpgmesignjob.cpp qgpgmesignkeyjob.cpp qgpgmeverifydetachedjob.cpp \
qgpgmeverifyopaquejob.cpp threadedjobmixin.cpp \
qgpgmekeyformailboxjob.cpp gpgme_backend_debug.cpp \
- qgpgmetofupolicyjob.cpp \
+ qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \
defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \
dn.cpp cryptoconfig.cpp
protocol.h \
qgpgme_export.h \
qgpgmenewcryptoconfig.h \
+ quickjob.h \
specialjob.h \
signjob.h \
signkeyjob.h \
MultiDeleteJob \
Protocol \
QGpgMENewCryptoConfig \
+ QuickJob \
SpecialJob \
SignJob \
SignKeyJob \
qgpgmekeyformailboxjob.h \
qgpgmewkspublishjob.h \
qgpgmetofupolicyjob.h \
+ qgpgmequickjob.h \
threadedjobmixin.h
qgpgme_moc_sources = \
keyformailboxjob.moc \
wkspublishjob.moc \
qgpgmekeyformailboxjob.moc \
- defaultkeygenerationjob.moc
+ defaultkeygenerationjob.moc \
+ quickjob.moc \
+ qgpgmequickjob.moc
qgpgmeincludedir = $(includedir)/qgpgme
qgpgmeinclude_HEADERS = $(qgpgme_headers)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmekeylistjob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmelistallkeysjob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmenewcryptoconfig.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmequickjob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmerefreshkeysjob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesecretkeyexportjob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignencryptjob.Plo@am__quote@
--- /dev/null
+#include "qgpgme/quickjob.h"
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2009 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2010 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
cryptoconfig.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2017 Intevation GmbH
+ Copyright (c) 2017 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* dataprovider.cpp
Copyright (C) 2004 Klarävdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of QGPGME.
if (p->error() == QProcess::UnknownError &&
p->exitStatus() == QProcess::NormalExit &&
p->exitCode() == 0) {
- return 0;
+ if (io->atEnd()) {
+ // EOF
+ return 0;
+ } // continue reading even if process ended to ensure
+ // everything is read.
} else {
Error::setSystemError(GPG_ERR_EIO);
return -1;
/* dataprovider.h
Copyright (C) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of QGPGME.
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Starts the decryption operation. \a cipherText is the data to
decrypt.
*/
- virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const QByteArray &cipherText) = 0;
+ virtual GpgME::Error start(const QByteArray &cipherText) = 0;
/*!
\overload
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Starts the combined decryption and verification operation.
\a cipherText is the data to decrypt and later verify.
*/
- virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const QByteArray &cipherText) = 0;
+ virtual GpgME::Error start(const QByteArray &cipherText) = 0;
/*!
\overload
/* defaultkeygenerationjob.h
Copyright (c) 2016 Klarälvdalens Datakonsult AB
+ 2016 Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
for (unsigned int i = 0; i < numOidMaps; ++i)
if (!strcasecmp((char *)p, oidmap[i].oid)) {
free(p);
- gpgrt_asprintf(&p, oidmap[i].name);
+ gpgrt_asprintf(&p, "%s", oidmap[i].name);
break;
}
array->key = p;
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "wkspublishjob.h"
#include "tofupolicyjob.h"
#include "threadedjobmixin.h"
+#include "quickjob.h"
#include <QCoreApplication>
#include <QDebug>
make_job_subclass(KeyForMailboxJob)
make_job_subclass(WKSPublishJob)
make_job_subclass(TofuPolicyJob)
+make_job_subclass(QuickJob)
#undef make_job_subclass
#include "keyformailboxjob.moc"
#include "wkspublishjob.moc"
#include "tofupolicyjob.moc"
+#include "quickjob.moc"
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
keyformailboxjob.h
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
class KeyForMailboxJob;
class WKSPublishJob;
class TofuPolicyJob;
+class QuickJob;
/** The main entry point for QGpgME Comes in OpenPGP and SMIME(CMS) flavors.
*
/** A Job to set tofu policy */
virtual TofuPolicyJob *tofuPolicyJob() const = 0;
+
+ /** A Job for the quick commands */
+ virtual QuickJob *quickJob() const = 0;
};
/** Obtain a reference to the OpenPGP Protocol.
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "qgpgmekeyformailboxjob.h"
#include "qgpgmewkspublishjob.h"
#include "qgpgmetofupolicyjob.h"
+#include "qgpgmequickjob.h"
namespace
{
}
return new QGpgME::QGpgMETofuPolicyJob(context);
}
+
+ QGpgME::QuickJob *quickJob() const Q_DECL_OVERRIDE
+ {
+ if (mProtocol != GpgME::OpenPGP) {
+ return Q_NULLPTR;
+ }
+ GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
+ if (!context) {
+ return Q_NULLPTR;
+ }
+ return new QGpgME::QGpgMEQuickJob(context);
+ }
};
}
/* qgpgme_export.h - Export macros for qgpgme
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2010 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2010 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
qgpgmekeyformailboxjob.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of libkleopatra, the KDE keymanagement library
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2010 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include <sstream>
#include <string>
+#include <functional>
#include <cassert>
#include <functional>
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2010 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
--- /dev/null
+/* qgpgmequickjob.cpp
+
+ Copyright (c) 2017 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 "qgpgmequickjob.h"
+
+#include "context.h"
+#include "key.h"
+#include "util.h"
+
+using namespace QGpgME;
+using namespace GpgME;
+
+QGpgMEQuickJob::QGpgMEQuickJob(Context *context)
+ : mixin_type(context)
+{
+ lateInitialization();
+}
+
+QGpgMEQuickJob::~QGpgMEQuickJob() {}
+
+static QGpgMEQuickJob::result_type createWorker(GpgME::Context *ctx,
+ const QString &uid,
+ const char *algo,
+ const QDateTime &expires,
+ const GpgME::Key &key,
+ unsigned int flags)
+{
+ auto err = ctx->createKey(uid.toUtf8().constData(),
+ algo,
+ 0,
+ expires.isValid() ? (unsigned long) (expires.toMSecsSinceEpoch() / 1000) : 0,
+ key,
+ flags);
+ return std::make_tuple(err, QString(), Error());
+}
+
+static QGpgMEQuickJob::result_type addSubkeyWorker(GpgME::Context *ctx,
+ const GpgME::Key &key,
+ const char *algo,
+ const QDateTime &expires,
+ unsigned int flags)
+{
+ auto err = ctx->createSubkey(key, algo, 0,
+ expires.isValid() ? (unsigned long) (expires.toMSecsSinceEpoch() / 1000): 0,
+ flags);
+ return std::make_tuple(err, QString(), Error());
+}
+
+static QGpgMEQuickJob::result_type addUidWorker(GpgME::Context *ctx,
+ const GpgME::Key &key,
+ const QString &uid)
+{
+ auto err = ctx->addUid(key, uid.toUtf8().constData());
+ return std::make_tuple(err, QString(), Error());
+}
+
+static QGpgMEQuickJob::result_type revUidWorker(GpgME::Context *ctx,
+ const GpgME::Key &key,
+ const QString &uid)
+{
+ auto err = ctx->revUid(key, uid.toUtf8().constData());
+ return std::make_tuple(err, QString(), Error());
+}
+
+void QGpgMEQuickJob::startCreate(const QString &uid,
+ const char *algo,
+ const QDateTime &expires,
+ const GpgME::Key &key,
+ unsigned int flags)
+{
+ run(std::bind(&createWorker, std::placeholders::_1, uid, algo,
+ expires, key, flags));
+}
+
+void QGpgMEQuickJob::startAddUid(const GpgME::Key &key, const QString &uid)
+{
+ run(std::bind(&addUidWorker, std::placeholders::_1, key, uid));
+}
+
+void QGpgMEQuickJob::startRevUid(const GpgME::Key &key, const QString &uid)
+{
+ run(std::bind(&revUidWorker, std::placeholders::_1, key, uid));
+}
+
+void QGpgMEQuickJob::startAddSubkey(const GpgME::Key &key, const char *algo,
+ const QDateTime &expires,
+ unsigned int flags)
+{
+ run(std::bind(&addSubkeyWorker, std::placeholders::_1, key, algo,
+ expires, flags));
+}
+#include "qgpgmequickjob.moc"
--- /dev/null
+/* qgpgmequickjob.h
+
+ Copyright (c) 2017 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_QGPGMEQUICKJOB_H
+#define QGPGME_QGPGMEQUICKJOB_H
+
+#include "quickjob.h"
+
+#include "threadedjobmixin.h"
+
+namespace GpgME {
+class Key;
+}
+
+class QDateTime;
+class QString;
+
+namespace QGpgME{
+
+/**
+ * Interface to the modern key manipulation functions.
+ */
+class QGpgMEQuickJob
+#ifdef Q_MOC_RUN
+ : public QuickJob
+#else
+ : public _detail::ThreadedJobMixin<QuickJob, std::tuple<GpgME::Error, QString, GpgME::Error> >
+#endif
+{
+ Q_OBJECT
+#ifdef Q_MOC_RUN
+public Q_SLOTS:
+ void slotFinished();
+#endif
+public:
+ explicit QGpgMEQuickJob(GpgME::Context *context);
+ ~QGpgMEQuickJob();
+
+ void startCreate(const QString &uid,
+ const char *algo,
+ const QDateTime &expires = QDateTime(),
+ const GpgME::Key &key = GpgME::Key(),
+ unsigned int flags = 0) Q_DECL_OVERRIDE;
+ void startAddUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE;
+ void startRevUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE;
+ void startAddSubkey(const GpgME::Key &key, const char *algo,
+ const QDateTime &expires = QDateTime(),
+ unsigned int flags = 0) Q_DECL_OVERRIDE;
+
+Q_SIGNALS:
+ void result(const GpgME::Error &error,
+ const QString &auditLogAsHtml, const GpgME::Error &auditLogError);
+};
+
+}
+#endif
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarävdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarävdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* qgpgmetofupolicyjob.cpp
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* qgpgmetofupolicyjob.h
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* wkspublishjob.cpp
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* qgpgmewkspublishjob.h
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
--- /dev/null
+/* quickjob.h
+
+ Copyright (c) 2017 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_QUICKJOB_H
+#define QGPGME_QUICKJOB_H
+
+#include "job.h"
+
+#include "qgpgme_export.h"
+
+#include <QDateTime>
+
+#ifdef BUILDING_QGPGME
+# include "key.h"
+#else
+# include <gpgme++/key.h>
+#endif
+
+class QString;
+
+namespace QGpgME{
+
+/**
+ * Interface to the modern key manipulation functions.
+ */
+class QGPGME_EXPORT QuickJob : public Job
+{
+ Q_OBJECT
+public:
+ explicit QuickJob(QObject *parent = Q_NULLPTR);
+ ~QuickJob();
+
+ /** Start --quick-gen-key */
+ virtual void startCreate(const QString &uid,
+ const char *algo,
+ const QDateTime &expires = QDateTime(),
+ const GpgME::Key &key = GpgME::Key(),
+ unsigned int flags = 0) = 0;
+
+ /** Start --quick-adduid */
+ virtual void startAddUid(const GpgME::Key &key, const QString &uid) = 0;
+
+ /** Start --quick-revuid */
+ virtual void startRevUid(const GpgME::Key &key, const QString &uid) = 0;
+
+ /** Start --quick-add-key */
+ virtual void startAddSubkey(const GpgME::Key &key, const char *algo,
+ const QDateTime &expires = QDateTime(),
+ unsigned int flags = 0) = 0;
+
+Q_SIGNALS:
+ void result(const GpgME::Error &error,
+ const QString &auditLogAsHtml, const GpgME::Error &auditLogError);
+};
+
+}
+#endif
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
\em recipient keys will not be performed, but full validity
assumed for all \em recipient keys without further checks.
*/
- virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const std::vector<GpgME::Key> &signers,
+ virtual GpgME::Error start(const std::vector<GpgME::Key> &signers,
const std::vector<GpgME::Key> &recipients,
const QByteArray &plainText,
bool alwaysTrust = false) = 0;
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2008 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* tofupolicyjob.h
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
signature data, while \a signedData contains the data over
which the signature was made.
*/
- virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const QByteArray &signature,
+ virtual GpgME::Error start(const QByteArray &signature,
const QByteArray &signedData) = 0;
/*!
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
signature data, while \a signedData contains the data over
which the signature was made.
*/
- virtual QGPGME_DEPRECATED_EXPORT GpgME::Error start(const QByteArray &signedData) = 0;
+ virtual GpgME::Error start(const QByteArray &signedData) = 0;
/*!
\overload
/* wkspublishjob.h
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
# Makefile.am - Makefile for GPGME Qt tests.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGME.
#
-I$(top_srcdir)/lang/qt/src \
-DTOP_SRCDIR="$(top_srcdir)"
-check-local: ./pubring-stamp
-
-# To guarantee that check-local is run before any tests we
-# add this dependency:
-initial.test : check-local
-
support_src = t-support.h t-support.cpp
t_keylist_SOURCES = t-keylist.cpp $(support_src)
nodist_t_keylist_SOURCES = $(moc_files)
-BUILT_SOURCES = $(moc_files)
+BUILT_SOURCES = $(moc_files) pubring-stamp
noinst_PROGRAMS = t-keylist t-keylocate t-ownertrust t-tofuinfo t-encrypt \
run-keyformailboxjob t-wkspublish t-verify t-various t-config
gpg.conf tofu.db
clean-local:
+ -$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d crls.d
export GNUPGHOME := $(abs_builddir)
-./pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
+pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
$(top_srcdir)/tests/gpg/secdemo.asc
+ -gpgconf --kill all
echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf
echo "allow-loopback-pinentry" >> gpg-agent.conf
echo "ignore-invalid-option pinentry-mode" > gpg.conf
$(GPG) --no-permission-warning \
--passphrase "abc" \
--import $(top_srcdir)/tests/gpg/secdemo.asc
- touch ./pubring-stamp
+ touch pubring-stamp
.cpp.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
@SET_MAKE@
# Makefile.am - Makefile for GPGME Qt tests.
-# Copyright (C) 2016 Intevation GmbH
+# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
#
# This file is part of GPGME.
#
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
t_config_SOURCES = t-config.cpp $(support_src)
run_keyformailboxjob_SOURCES = run-keyformailboxjob.cpp
nodist_t_keylist_SOURCES = $(moc_files)
-BUILT_SOURCES = $(moc_files)
+BUILT_SOURCES = $(moc_files) pubring-stamp
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp $(moc_files) \
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS)
.MAKE: all check check-am install install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \
- check-local clean clean-generic clean-libtool clean-local \
- clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- 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
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man 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
-check-local: ./pubring-stamp
-
-# To guarantee that check-local is run before any tests we
-# add this dependency:
-initial.test : check-local
-
clean-local:
+ -$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d crls.d
export GNUPGHOME := $(abs_builddir)
-./pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
+pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \
$(top_srcdir)/tests/gpg/secdemo.asc
+ -gpgconf --kill all
echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf
echo "allow-loopback-pinentry" >> gpg-agent.conf
echo "ignore-invalid-option pinentry-mode" > gpg.conf
$(GPG) --no-permission-warning \
--passphrase "abc" \
--import $(top_srcdir)/tests/gpg/secdemo.asc
- touch ./pubring-stamp
+ touch pubring-stamp
.cpp.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
run-keyformailbox.cpp
This file is part of QGpgME's test suite.
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License,
/* t-config.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-encrypt.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "encryptjob.h"
#include "signencryptjob.h"
#include "signingresult.h"
-#include "qgpgmeencryptjob.h"
+#include "encryptjob.h"
#include "encryptionresult.h"
#include "decryptionresult.h"
-#include "qgpgmedecryptjob.h"
+#include "decryptjob.h"
#include "qgpgmebackend.h"
#include "keylistresult.h"
#include "engineinfo.h"
if (!decryptSupported()) {
return;
}
- auto ctx = Context::createForProtocol(OpenPGP);
+ auto decJob = openpgp()->decryptJob();
+ auto ctx = Job::context(decJob);
TestPassphraseProvider provider;
ctx->setPassphraseProvider(&provider);
ctx->setPinentryMode(Context::PinentryLoopback);
- auto decJob = new QGpgMEDecryptJob(ctx);
QByteArray plainText;
auto decResult = decJob->exec(cipherText, plainText);
QVERIFY(!decResult.error());
if (!decryptSupported()) {
return;
}
- auto ctx = Context::createForProtocol(OpenPGP);
+ auto job = openpgp()->encryptJob();
+ auto ctx = Job::context(job);
TestPassphraseProvider provider;
ctx->setPassphraseProvider(&provider);
ctx->setPinentryMode(Context::PinentryLoopback);
ctx->setArmor(true);
ctx->setTextMode(true);
- auto job = new QGpgMEEncryptJob(ctx);
QByteArray cipherText;
auto result = job->exec(std::vector<Key>(), QStringLiteral("Hello symmetric World").toUtf8(), Context::AlwaysTrust, cipherText);
delete job;
killAgent(mDir.path());
- auto ctx2 = Context::createForProtocol(OpenPGP);
+ auto decJob = openpgp()->decryptJob();
+ auto ctx2 = Job::context(decJob);
ctx2->setPassphraseProvider(&provider);
ctx2->setPinentryMode(Context::PinentryLoopback);
- auto decJob = new QGpgMEDecryptJob(ctx2);
QByteArray plainText;
auto decResult = decJob->exec(cipherText, plainText);
QVERIFY(!result.error());
delete decJob;
}
-private:
- /* This apparently does not work under ASAN currently. TODO fix and reeanble */
void testEncryptDecryptNowrap()
{
/* Now decrypt */
if (!decryptSupported()) {
return;
}
- auto ctx = Context::createForProtocol(OpenPGP);
+
+ auto decJob = openpgp()->decryptJob();
+ auto ctx = Job::context(decJob);
TestPassphraseProvider provider;
ctx->setPassphraseProvider(&provider);
ctx->setPinentryMode(Context::PinentryLoopback);
ctx->setDecryptionFlags(Context::DecryptUnwrap);
- auto decJob = new QGpgMEDecryptJob(ctx);
QByteArray plainText;
auto decResult = decJob->exec(cipherText, plainText);
QVERIFY(keys.size() == 1);
delete listjob;
- auto ctx = Context::createForProtocol(OpenPGP);
+ auto job = openpgp()->encryptJob();
+ auto ctx = Job::context(job);
ctx->setPassphraseProvider(new TestPassphraseProvider);
ctx->setPinentryMode(Context::PinentryLoopback);
ctx->setArmor(true);
ctx->setTextMode(true);
- auto job = new QGpgMEEncryptJob(ctx);
QByteArray cipherText;
printf("Before exec, flags: %x\n", Context::Symmetric | Context::AlwaysTrust);
auto result = job->exec(keys, QStringLiteral("Hello symmetric World").toUtf8(),
agentConf.write("allow-loopback-pinentry");
agentConf.close();
- auto ctx2 = Context::createForProtocol(OpenPGP);
+ auto decJob = openpgp()->decryptJob();
+ auto ctx2 = Job::context(decJob);
ctx2->setPassphraseProvider(new TestPassphraseProvider);
ctx2->setPinentryMode(Context::PinentryLoopback);
ctx2->setTextMode(true);
- auto decJob = new QGpgMEDecryptJob(ctx2);
QByteArray plainText;
auto decResult = decJob->exec(cipherText, plainText);
QVERIFY(!decResult.error());
/* t-keylist.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-keylocate.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-ownertrust.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-support.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-support.h
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-tofuinfo.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "importresult.h"
#include "keylistjob.h"
#include "keylistresult.h"
-#include "qgpgmesignjob.h"
+#include "signjob.h"
#include "key.h"
#include "t-support.h"
#include "engineinfo.h"
+#include "context.h"
#include <iostream>
using namespace QGpgME;
private:
bool testSupported()
{
- return !(GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.16");
+ static bool initialized, supported;
+ if (initialized) {
+ return supported;
+ }
+ initialized = true;
+ if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.16") {
+ return false;
+ }
+ // If the keylist fails here this means that gnupg does not
+ // support tofu at all. It can be disabled at compile time. So no
+ // tests.
+ auto *job = openpgp()->keyListJob(false, false, false);
+ job->addMode(GpgME::WithTofu);
+ std::vector<GpgME::Key> keys;
+ job->exec(QStringList() << QStringLiteral("zulu@example.net"), true, keys);
+ delete job;
+ supported = !keys.empty();
+ return supported;
}
void testTofuCopy(TofuInfo other, const TofuInfo &orig)
void signAndVerify(const QString &what, const GpgME::Key &key, int expected)
{
- Context *ctx = Context::createForProtocol(OpenPGP);
+ auto job = openpgp()->signJob();
+ auto ctx = Job::context(job);
TestPassphraseProvider provider;
ctx->setPassphraseProvider(&provider);
ctx->setPinentryMode(Context::PinentryLoopback);
- auto *job = new QGpgMESignJob(ctx);
std::vector<Key> keys;
keys.push_back(key);
void testTofuConflict()
{
+ if (!testSupported()) {
+ return;
+ }
+
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.19") {
return;
}
/* t-various.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2017 Intevation GmbH
+ Copyright (c) 2017 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
QVERIFY(id_revoked);
}
+ void testVersion()
+ {
+ QVERIFY(EngineInfo::Version("2.1.0") < EngineInfo::Version("2.1.1"));
+ QVERIFY(EngineInfo::Version("2.1.10") < EngineInfo::Version("2.1.11"));
+ QVERIFY(EngineInfo::Version("2.2.0") > EngineInfo::Version("2.1.19"));
+ QVERIFY(EngineInfo::Version("1.0.0") < EngineInfo::Version("2.0.0"));
+ QVERIFY(EngineInfo::Version("0.1.0") < EngineInfo::Version("1.0.0"));
+ QVERIFY(!(EngineInfo::Version("2.0.0") < EngineInfo::Version("2.0.0")));
+ QVERIFY(EngineInfo::Version("3.0.0") > EngineInfo::Version("2.3.20"));
+ QVERIFY(EngineInfo::Version("3.0.1") > EngineInfo::Version("3.0.0"));
+ QVERIFY(EngineInfo::Version("3.1.0") > EngineInfo::Version("3.0.20"));
+ }
+
void initTestCase()
{
QGpgMETest::initTestCase();
/* t-verifiy.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* t-wkspublish.cpp
This file is part of qgpgme, the Qt API binding for gpgme
- Copyright (c) 2016 Intevation GmbH
+ Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
QGpgME is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
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 stpcpy.c ttyname_r.c setenv.c \
+ $(srcdir)/gpgme-config.in ttyname_r.c setenv.c stpcpy.c \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
* flag is cleared with each operation. */
unsigned int redraw_suggested : 1;
+ /* True if the option --auto-key-retrieve shall be passed to gpg. */
+ unsigned int auto_key_retrieve : 1;
+
/* Flags for keylist mode. */
gpgme_keylist_mode_t keylist_mode;
/* Split a string into space delimited fields and remove leading and
- * trailing spaces from each field. A pointer to the each field is
+ * trailing spaces from each field. A pointer to each field is
* stored in ARRAY. Stop splitting at ARRAYSIZE fields. The function
* modifies STRING. The number of parsed fields is returned.
*/
return gpg_error (GPG_ERR_INV_VALUE);
*r_dh = NULL;
+
+ if (_gpgme_selftest)
+ return _gpgme_selftest;
+
dh = calloc (1, sizeof (*dh));
if (!dh)
return gpg_error_from_syserror ();
-/* This should be called as soon as the locks are intialized. It is
+/* This should be called as soon as the locks are initialized. It is
required so that the assuan logging gets conncted to the gpgme log
stream as early as possible. */
void
flags,
cipher, plain,
ctx->export_session_keys,
- ctx->override_session_key);
+ ctx->override_session_key,
+ ctx->auto_key_retrieve);
}
/* decrypt.c - Decrypt function.
Copyright (C) 2000 Werner Koch (dd9jn)
- Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
+ Copyright (C) 2001, 2002, 2003, 2004, 2017 g10 Code GmbH
This file is part of GPGME.
gpg_error_t failure_code;
int okay;
+
+ /* A flag telling that the a decryption failed and an optional error
+ * code to further specify the failure. */
int failed;
+ gpg_error_t pkdecrypt_failed;
+
+ /* At least one secret key is not available. gpg issues NO_SECKEY
+ * status lines for each key the message has been encrypted to but
+ * that secret key is not available. This can't be done for hidden
+ * recipients, though. We track it here to allow for a better error
+ * message that the general DECRYPTION_FAILED. */
+ int any_no_seckey;
/* A pointer to the next pointer of the last recipient in the list.
This makes appending new invalid signers painless while
return &opd->result;
}
+
\f
+/* Parse the ARGS of an error status line and record some error
+ * conditions at OPD. Returns 0 on success. */
+static gpgme_error_t
+parse_status_error (char *args, op_data_t opd)
+{
+ gpgme_error_t err;
+ char *field[3];
+ int nfields;
+ char *args2;
+
+ if (!args)
+ return trace_gpg_error (GPG_ERR_INV_ENGINE);
+
+ args2 = strdup (args); /* Split modifies the input string. */
+ nfields = _gpgme_split_fields (args2, field, DIM (field));
+ if (nfields < 1)
+ {
+ free (args2);
+ return trace_gpg_error (GPG_ERR_INV_ENGINE); /* Required arg missing. */
+ }
+ err = nfields < 2 ? 0 : atoi (field[1]);
+
+ if (!strcmp (field[0], "decrypt.algorithm"))
+ {
+ if (gpg_err_code (err) == GPG_ERR_UNSUPPORTED_ALGORITHM
+ && nfields > 2
+ && strcmp (field[2], "?"))
+ {
+ opd->result.unsupported_algorithm = strdup (field[2]);
+ if (!opd->result.unsupported_algorithm)
+ {
+ free (args2);
+ return gpg_error_from_syserror ();
+ }
+ }
+ }
+ else if (!strcmp (field[0], "decrypt.keyusage"))
+ {
+ if (gpg_err_code (err) == GPG_ERR_WRONG_KEY_USAGE)
+ opd->result.wrong_key_usage = 1;
+ }
+ else if (!strcmp (field[0], "pkdecrypt_failed"))
+ {
+ switch (gpg_err_code (err))
+ {
+ case GPG_ERR_CANCELED:
+ case GPG_ERR_FULLY_CANCELED:
+ /* It is better to return with a cancel error code than the
+ * general decryption failed error code. */
+ opd->pkdecrypt_failed = gpg_err_make (gpg_err_source (err),
+ GPG_ERR_CANCELED);
+ break;
+
+ case GPG_ERR_BAD_PASSPHRASE:
+ /* A bad passphrase is severe enough that we return this
+ * error code. */
+ opd->pkdecrypt_failed = err;
+ break;
+
+ default:
+ /* For now all other error codes are ignored and the
+ * standard DECRYPT_FAILED is returned. */
+ break;
+ }
+ }
+
+
+ free (args2);
+ return 0;
+}
+
+
static gpgme_error_t
parse_enc_to (char *args, gpgme_recipient_t *recp, gpgme_protocol_t protocol)
{
case GPGME_STATUS_EOF:
/* FIXME: These error values should probably be attributed to
the underlying crypto engine (as error source). */
- if (opd->failed)
+ if (opd->failed && opd->pkdecrypt_failed)
+ return opd->pkdecrypt_failed;
+ else if (opd->failed && opd->any_no_seckey)
+ return gpg_error (GPG_ERR_NO_SECKEY);
+ else if (opd->failed)
return gpg_error (GPG_ERR_DECRYPT_FAILED);
else if (!opd->okay)
return gpg_error (GPG_ERR_NO_DATA);
/* Note that this is an informational status code which should
not lead to an error return unless it is something not
related to the backend. */
- {
- const char d_alg[] = "decrypt.algorithm";
- const char k_alg[] = "decrypt.keyusage";
-
- if (!strncmp (args, d_alg, sizeof (d_alg) - 1))
- {
- args += sizeof (d_alg) - 1;
- while (*args == ' ')
- args++;
-
- if (gpg_err_code (atoi (args)) == GPG_ERR_UNSUPPORTED_ALGORITHM)
- {
- char *end;
-
- while (*args && *args != ' ')
- args++;
- while (*args == ' ')
- args++;
-
- end = strchr (args, ' ');
- if (end)
- *end = '\0';
-
- if (!(*args == '?' && *(args + 1) == '\0'))
- {
- opd->result.unsupported_algorithm = strdup (args);
- if (!opd->result.unsupported_algorithm)
- return gpg_error_from_syserror ();
- }
- }
- }
- else if (!strncmp (args, k_alg, sizeof (k_alg) - 1))
- {
- args += sizeof (k_alg) - 1;
- while (*args == ' ')
- args++;
-
- if (gpg_err_code (atoi (args)) == GPG_ERR_WRONG_KEY_USAGE)
- opd->result.wrong_key_usage = 1;
- }
- }
+ err = parse_status_error (args, opd);
+ if (err)
+ return err;
break;
case GPGME_STATUS_ENC_TO:
case GPGME_STATUS_NO_SECKEY:
{
gpgme_recipient_t rec = opd->result.recipients;
-
while (rec)
{
if (!strcmp (rec->keyid, args))
/* FIXME: Is this ok? */
if (!rec)
return trace_gpg_error (GPG_ERR_INV_ENGINE);
+ opd->any_no_seckey = 1;
}
break;
}
break;
+ case GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE:
+ PARSE_COMPLIANCE_FLAGS (args, &opd->result);
+ break;
+
default:
break;
}
flags,
cipher, plain,
ctx->export_session_keys,
- ctx->override_session_key);
+ ctx->override_session_key,
+ ctx->auto_key_retrieve);
}
static gpgme_error_t
delete_start (gpgme_ctx_t ctx, int synchronous, const gpgme_key_t key,
- int allow_secret)
+ unsigned int flags)
{
gpgme_error_t err;
_gpgme_engine_set_status_handler (ctx->engine, delete_status_handler, ctx);
- return _gpgme_engine_op_delete (ctx->engine, key, allow_secret);
+ return _gpgme_engine_op_delete (ctx->engine, key, flags);
}
{
gpgme_error_t err;
- TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx,
+ TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete_start", ctx,
"key=%p (%s), allow_secret=%i", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
- err = delete_start (ctx, 0, key, allow_secret);
+ err = delete_start (ctx, 0, key,
+ allow_secret ? GPGME_DELETE_ALLOW_SECRET : 0);
return TRACE_ERR (err);
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
- err = delete_start (ctx, 1, key, allow_secret);
+ err = delete_start (ctx, 1, key,
+ allow_secret ? GPGME_DELETE_ALLOW_SECRET : 0);
+ if (!err)
+ err = _gpgme_wait_one (ctx);
+ return err;
+}
+
+
+/* Delete KEY from the keyring. */
+gpgme_error_t
+gpgme_op_delete_ext_start (gpgme_ctx_t ctx, const gpgme_key_t key,
+ unsigned int flags)
+{
+ gpgme_error_t err;
+
+ TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete_ext_start", ctx,
+ "key=%p (%s), flags=0x%x", key,
+ (key->subkeys && key->subkeys->fpr) ?
+ key->subkeys->fpr : "invalid", flags);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
+ err = delete_start (ctx, 0, key, flags);
+ return TRACE_ERR (err);
+}
+
+
+/* Delete KEY from the keyring. */
+gpgme_error_t
+gpgme_op_delete_ext (gpgme_ctx_t ctx, const gpgme_key_t key,
+ unsigned int flags)
+{
+ gpgme_error_t err;
+
+ TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete_ext", ctx,
+ "key=%p (%s), flags=0x%x", key,
+ (key->subkeys && key->subkeys->fpr) ?
+ key->subkeys->fpr : "invalid", flags);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
+ err = delete_start (ctx, 1, key, flags);
if (!err)
err = _gpgme_wait_one (ctx);
return err;
\f
-/* The deprectated interface. */
+/* The deprecated interface. */
static gpgme_error_t
edit_start (gpgme_ctx_t ctx, int synchronous, int type, gpgme_key_t key,
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
llass_transact, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
llass_set_io_cbs,
llass_io_event,
gpgme_decrypt_flags_t flags,
gpgme_data_t ciph,
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);
+ const char *override_session_key,
+ int auto_key_retrieve);
+ gpgme_error_t (*delete) (void *engine, gpgme_key_t key, unsigned int flags);
gpgme_error_t (*edit) (void *engine, int type, gpgme_key_t key,
gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t (*encrypt) (void *engine, gpgme_key_t recp[],
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 (*conf_dir) (void *engine, const char *what, char **result);
gpgme_error_t (*query_swdb) (void *engine,
const char *name, const char *iversion,
g13_transact,
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
g13_set_io_cbs,
g13_io_event,
gpg_decrypt (void *engine,
gpgme_decrypt_flags_t flags,
gpgme_data_t ciph, gpgme_data_t plain,
- int export_session_key, const char *override_session_key)
+ int export_session_key, const char *override_session_key,
+ int auto_key_retrieve)
{
engine_gpg_t gpg = engine;
gpgme_error_t err;
if (!err && export_session_key)
err = add_arg (gpg, "--show-session-key");
+ if (!err && auto_key_retrieve)
+ err = add_arg (gpg, "--auto-key-retrieve");
+
if (!err && override_session_key && *override_session_key)
{
if (have_gpg_version (gpg, "2.1.16"))
}
static gpgme_error_t
-gpg_delete (void *engine, gpgme_key_t key, int allow_secret)
+gpg_delete (void *engine, gpgme_key_t key, unsigned int flags)
{
engine_gpg_t gpg = engine;
- gpgme_error_t err;
+ gpgme_error_t err = 0;
+ int allow_secret = flags & GPGME_DELETE_ALLOW_SECRET;
+ int force = flags & GPGME_DELETE_FORCE;
- err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key"
- : "--delete-key");
+ if (force)
+ err = add_arg (gpg, "--yes");
+ if (!err)
+ err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key"
+ : "--delete-key");
if (!err)
err = add_arg (gpg, "--");
if (!err)
if (!err && (flags & GPGME_ENCRYPT_WRAP))
{
- /* gpg is current not abale to detect already compressed
+ /* gpg is current not able to detect already compressed
* packets. Thus when using
* gpg --unwrap -d | gpg --no-literal -e
* the encryption would add an additional compression layer.
as defined in 5.2. Machine Readable Indexes of the OpenPGP
HTTP Keyserver Protocol (draft).
+ For an ldap keyserver the format is:
+ uid:<escaped uid string>
+
We want:
uid:o<flags>::::<creatdate>:<expdate>:::<c-coded uid>:
*/
}
*dst = '\0';
- if (gpgrt_asprintf (r_line, "uid:o%s::::%s:%s:::%s:",
- field[4], field[2], field[3], uid) < 0)
- return gpg_error_from_syserror ();
+ if (fields < 4)
+ {
+ if (gpgrt_asprintf (r_line, "uid:o::::::::%s:", uid) < 0)
+ return gpg_error_from_syserror ();
+ }
+ else
+ {
+ if (gpgrt_asprintf (r_line, "uid:o%s::::%s:%s:::%s:",
+ field[4], field[2], field[3], uid) < 0)
+ return gpg_error_from_syserror ();
+ }
}
return 0;
gpgme_error_t err;
err = append_args_from_sender (gpg, ctx);
+ if (!err && ctx->auto_key_retrieve)
+ err = add_arg (gpg, "--auto-key-retrieve");
+
if (err)
;
else if (plaintext)
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
gpg_set_io_cbs,
gpg_io_event,
gpgme_conf_arg_t *arg_p, char *line)
{
gpgme_error_t err;
- char *mark;
+ char *mark = NULL;
if (!line[0])
return 0;
{
gpgme_conf_arg_t arg;
- mark = strchr (line, ',');
+ if (opt->type != GPGME_CONF_STRING)
+ mark = strchr (line, ',');
if (mark)
*mark = '\0';
}
+struct gpgconf_config_dir_s
+{
+ const char *what;
+ char *result;
+};
+
+/* Called for each line in the gpgconf --list-dirs output. Searches
+ for the desired line and returns the result, indicating success by
+ a special error value GPG_ERR_USER_1 (which terminates the
+ operation immediately). */
+static gpgme_error_t
+gpgconf_config_dir_cb (void *hook, char *line)
+{
+ /* This is an input- and output-parameter. */
+ struct gpgconf_config_dir_s *data = (struct gpgconf_config_dir_s *) hook;
+ int len = strlen(data->what);
+
+ if (!strncmp(line, data->what, len) && line[len] == ':')
+ {
+ char *result = strdup(&line[len + 1]);
+ if (!result)
+ return gpg_error_from_syserror ();
+ data->result = result;
+ return gpg_error(GPG_ERR_USER_1);
+ }
+ return 0;
+}
+
+
+/* Like gpgme_get_dirinfo, but uses the home directory of ENGINE and
+ does not cache the result. */
+static gpgme_error_t
+gpgconf_conf_dir (void *engine, const char *what, char **result)
+{
+ gpgme_error_t err;
+ struct gpgconf_config_dir_s data;
+
+ data.what = what;
+ data.result = NULL;
+ err = gpgconf_read (engine, "--list-dirs", NULL,
+ gpgconf_config_dir_cb, &data);
+ if (gpg_err_code (err) == GPG_ERR_USER_1)
+ {
+ /* This signals to us that a result was found. */
+ *result = data.result;
+ return 0;
+ }
+
+ if (!err)
+ err = gpg_error(GPG_ERR_NOT_FOUND);
+ return 0;
+}
+
+
/* Parse a line received from gpgconf --query-swdb. This function may
* modify LINE. The result is stored at RESUL. */
static gpg_error_t
NULL, /* opassuan_transact */
gpgconf_conf_load,
gpgconf_conf_save,
+ gpgconf_conf_dir,
gpgconf_query_swdb,
gpgconf_set_io_cbs,
NULL, /* io_event */
gpgsm_decrypt (void *engine,
gpgme_decrypt_flags_t flags,
gpgme_data_t ciph, gpgme_data_t plain,
- int export_session_key, const char *override_session_key)
+ int export_session_key, const char *override_session_key,
+ int auto_key_retrieve)
{
engine_gpgsm_t gpgsm = engine;
gpgme_error_t err;
(void)export_session_key;
(void)override_session_key;
+ /* --auto-key-retrieve is also not supported. */
+ (void)auto_key_retrieve;
+
if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE);
static gpgme_error_t
-gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret)
+gpgsm_delete (void *engine, gpgme_key_t key, unsigned int flags)
{
engine_gpgsm_t gpgsm = engine;
gpgme_error_t err;
char *line;
int length = 8; /* "DELKEYS " */
- (void)allow_secret;
+ (void)flags;
if (!fpr)
return gpg_error (GPG_ERR_INV_VALUE);
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
gpgsm_set_io_cbs,
gpgsm_io_event,
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
engspawn_set_io_cbs,
engspawn_io_event, /* io_event */
uiserver_decrypt (void *engine,
gpgme_decrypt_flags_t flags,
gpgme_data_t ciph, gpgme_data_t plain,
- int export_session_key, const char *override_session_key)
+ int export_session_key, const char *override_session_key,
+ int auto_key_retrieve)
{
engine_uiserver_t uiserver = engine;
gpgme_error_t err;
(void)override_session_key; /* Fixme: We need to see now to add this
* to the UI server protocol */
+ (void)auto_key_retrieve; /* Not yet supported. */
+
if (!uiserver)
return gpg_error (GPG_ERR_INV_VALUE);
NULL, /* opassuan_transact */
NULL, /* conf_load */
NULL, /* conf_save */
+ NULL, /* conf_dir */
NULL, /* query_swdb */
uiserver_set_io_cbs,
uiserver_io_event,
gpgme_decrypt_flags_t flags,
gpgme_data_t ciph,
gpgme_data_t plain, int export_session_key,
- const char *override_session_key)
+ const char *override_session_key,
+ int auto_key_retrieve)
{
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
return (*engine->ops->decrypt) (engine->engine, flags, ciph, plain,
- export_session_key, override_session_key);
+ export_session_key, override_session_key,
+ auto_key_retrieve);
}
gpgme_error_t
_gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
- int allow_secret)
+ unsigned int flags)
{
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
if (!engine->ops->delete)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- return (*engine->ops->delete) (engine->engine, key, allow_secret);
+ return (*engine->ops->delete) (engine->engine, key, flags);
}
gpgme_error_t
+_gpgme_engine_op_conf_dir (engine_t engine, const char *what, char **result)
+{
+ if (!engine)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ if (!engine->ops->conf_dir)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+
+ return (*engine->ops->conf_dir) (engine->engine, what, result);
+}
+
+
+gpgme_error_t
_gpgme_engine_op_query_swdb (engine_t engine,
const char *name, const char *iversion,
gpgme_query_swdb_result_t result)
gpgme_data_t ciph,
gpgme_data_t plain,
int export_session_key,
- const char *override_session_key);
+ const char *override_session_key,
+ int auto_key_retrieve);
gpgme_error_t _gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
- int allow_secret);
+ unsigned int flags);
gpgme_error_t _gpgme_engine_op_edit (engine_t engine, int type,
gpgme_key_t key, gpgme_data_t out,
gpgme_ctx_t ctx /* FIXME */);
gpgme_conf_comp_t *conf_p);
gpgme_error_t _gpgme_engine_op_conf_save (engine_t engine,
gpgme_conf_comp_t conf);
+gpgme_error_t _gpgme_engine_op_conf_dir (engine_t engine,
+ const char *what,
+ char **result);
gpgme_error_t _gpgme_engine_op_query_swdb (engine_t engine,
const char *name,
}
-/* See set_uid_flag. Thsi is the synchronous variant. */
+/* See set_uid_flag. This is the synchronous variant. */
gpgme_error_t
gpgme_op_set_uid_flag (gpgme_ctx_t ctx,
gpgme_key_t key, const char *userid,
ctx->protocol = proto;
return err;
}
+
+
+gpgme_error_t
+gpgme_op_conf_dir (gpgme_ctx_t ctx, const char *what, char **result)
+{
+ gpgme_error_t err;
+ gpgme_protocol_t proto;
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ proto = ctx->protocol;
+ ctx->protocol = GPGME_PROTOCOL_GPGCONF;
+ err = _gpgme_op_reset (ctx, 1);
+ if (err)
+ return err;
+
+ err = _gpgme_engine_op_conf_dir (ctx->engine, what, result);
+ ctx->protocol = proto;
+ return err;
+}
}
cr_flags |= CREATE_SUSPENDED;
- cr_flags |= DETACHED_PROCESS;
if (!CreateProcessA (argv[0],
arg_string,
&sec_attr, /* process security attributes */
if (!ctx->override_session_key)
err = gpg_error_from_syserror ();
}
+ else if (!strcmp (name, "auto-key-retrieve"))
+ {
+ ctx->auto_key_retrieve = abool;
+ }
else
err = gpg_error (GPG_ERR_UNKNOWN_NAME);
{
return ctx->override_session_key? ctx->override_session_key : "";
}
+ else if (!strcmp (name, "auto-key-retrieve"))
+ {
+ return ctx->auto_key_retrieve? "1":"";
+ }
else
return NULL;
}
gpgme_op_decrypt_ext @195
gpgme_op_decrypt_ext_start @196
+ gpgme_op_delete_ext @197
+ gpgme_op_delete_ext_start @198
+
+ gpgme_op_conf_dir @199
+
; END
gpgme_tofu_policy_t;
+/* The key origin values. */
+typedef enum
+ {
+ GPGME_KEYORG_UNKNOWN = 0,
+ GPGME_KEYORG_KS = 1,
+ GPGME_KEYORG_DANE = 3,
+ GPGME_KEYORG_WKD = 4,
+ GPGME_KEYORG_URL = 5,
+ GPGME_KEYORG_FILE = 6,
+ GPGME_KEYORG_SELF = 7,
+ GPGME_KEYORG_OTHER = 31
+ }
+gpgme_keyorg_t;
+
+
/* The available protocols. */
typedef enum
{
/* The malloced TOFU information or NULL. */
gpgme_tofu_info_t tofu;
- /* Time of the last refresh of thsi user id. 0 if unknown. */
+ /* Time of the last refresh of this user id. 0 if unknown. */
unsigned long last_update;
};
typedef struct _gpgme_user_id *gpgme_user_id_t;
/* Key should not have been used for encryption. */
unsigned int wrong_key_usage : 1;
+ /* True if the message was encrypted in compliance to the de-vs
+ * mode. */
+ unsigned int is_de_vs : 1;
+
/* Internal to GPGME, do not use. */
- int _unused : 31;
+ int _unused : 30;
gpgme_recipient_t recipients;
/* Validity has been verified using the chain model. */
unsigned int chain_model : 1;
+ /* True if the signature is in compliance to the de-vs mode. */
+ unsigned int is_de_vs : 1;
+
/* Internal to GPGME, do not use. */
- int _unused : 28;
+ int _unused : 27;
gpgme_validity_t validity;
gpgme_error_t validity_reason;
gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key,
int allow_secret);
+/* Flags for the key delete functions. */
+#define GPGME_DELETE_ALLOW_SECRET (1 << 0) /* Also delete secret key. */
+#define GPGME_DELETE_FORCE (1 << 1) /* Do not ask user to confirm. */
+
+gpgme_error_t gpgme_op_delete_ext_start (gpgme_ctx_t ctx, const gpgme_key_t key,
+ unsigned int flags);
+gpgme_error_t gpgme_op_delete_ext (gpgme_ctx_t ctx, const gpgme_key_t key,
+ unsigned int flags);
+
\f
/*
* Key signing interface
follow chained components! */
gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
+/* Retrieve the configured directory. */
+gpgme_error_t gpgme_op_conf_dir(gpgme_ctx_t ctx, const char *what,
+ char **result);
+
/* Information about software versions.
* This structure shall be considered read-only and an application
GPGME_STATUS_TOFU_USER = 95,
GPGME_STATUS_TOFU_STATS = 96,
GPGME_STATUS_TOFU_STATS_LONG = 97,
- GPGME_STATUS_NOTATION_FLAGS = 98
+ GPGME_STATUS_NOTATION_FLAGS = 98,
+ GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE = 99,
+ GPGME_STATUS_VERIFICATION_COMPLIANCE_MODE = 100
}
gpgme_status_code_t;
}
-/* Import the keys from the array KEYS into the keyring. This
- function allows to move a key from one engine to another as long as
- they are compatible. In particular it is used to actually import
- keys retrieved from an external source (i.e. using
- GPGME_KEYLIST_MODE_EXTERN). It replaces the old workaround of
- exporting and then importing a key as used to make an X.509 key
- permanent. This function automagically does the right thing.
+/* Import the keys from the array KEYS into the keyring. In
+ particular it is used to actually import keys retrieved from an
+ external source (i.e. using GPGME_KEYLIST_MODE_EXTERN). It
+ replaces the old workaround of exporting and then importing a key
+ as used to make an X.509 key permanent. This function
+ automagically does the right thing.
KEYS is a NULL terminated array of gpgme key objects. The result
is the usual import result structure. Only keys matching the
&sig->comment, dst);
}
else
- sig->uid = '\0';
+ sig->uid[0] = '\0';
if (!uid->signatures)
uid->signatures = sig;
}
+static gpgme_keyorg_t
+parse_keyorg (const char *string)
+{
+ switch (atoi (string))
+ {
+ case 0: return GPGME_KEYORG_UNKNOWN;
+ case 1:
+ case 2:
+ return GPGME_KEYORG_KS;
+ case 3: return GPGME_KEYORG_DANE;
+ case 4: return GPGME_KEYORG_WKD;
+ case 5: return GPGME_KEYORG_URL;
+ case 6: return GPGME_KEYORG_FILE;
+ case 7: return GPGME_KEYORG_SELF;
+ default: return GPGME_KEYORG_OTHER;
+ }
+}
+
+
/* Parse field 15 of a secret key or subkey. This fields holds a
reference to smartcards. FIELD is the content of the field and we
are allowed to modify it. */
}
-/* Parse the compliance field. */
-static void
-parse_pub_field18 (gpgme_subkey_t subkey, char *field)
-{
- char *p, *endp;
- unsigned long ul;
-
- for (p = field; p && (ul = strtoul (p, &endp, 10)) && p != endp; p = endp)
- {
- switch (ul)
- {
- case 23: subkey->is_de_vs = 1; break;
- }
- }
-}
-
-
/* Parse a tfs record. */
static gpg_error_t
parse_tfs_record (gpgme_user_id_t uid, char **field, int nfield)
/* Field 18 has the compliance flags. */
if (fields >= 17 && *field[17])
- parse_pub_field18 (subkey, field[17]);
+ PARSE_COMPLIANCE_FLAGS (field[17], subkey);
if (fields >= 20)
{
key->last_update = _gpgme_parse_timestamp_ul (field[18]);
- key->origin = 0; /* Fixme: Not yet defined in gpg. */
+ key->origin = parse_keyorg (field[19]);
}
break;
/* Field 18 has the compliance flags. */
if (fields >= 17 && *field[17])
- parse_pub_field18 (subkey, field[17]);
+ PARSE_COMPLIANCE_FLAGS (field[17], subkey);
break;
if (fields >= 20)
{
opd->tmp_uid->last_update = _gpgme_parse_timestamp_ul (field[18]);
- opd->tmp_uid->origin = 0; /* Fixme: Not yet defined in gpg. */
+ opd->tmp_uid->origin = parse_keyorg (field[19]);
}
}
break;
gpgme_conf_opt_change;
gpgme_op_conf_load;
gpgme_op_conf_save;
+ gpgme_op_conf_dir;
gpgme_cancel_async;
gpgme_op_decrypt_verify_start;
gpgme_op_delete;
gpgme_op_delete_start;
+ gpgme_op_delete_ext;
+ gpgme_op_delete_ext_start;
gpgme_op_edit;
gpgme_op_edit_start;
gpgme_op_encrypt;
-/* parsetlv.h - TLV functions defintions
+/* parsetlv.h - TLV functions definitions
* Copyright (C) 2012 g10 Code GmbH
*
* This file is free software; you can redistribute it and/or modify
#include <ctype.h>
#include <sys/resource.h>
-#if __linux__
+#ifdef USE_LINUX_GETDENTS
+# include <sys/syscall.h>
# include <sys/types.h>
# include <dirent.h>
-#endif /*__linux__ */
+#endif /*USE_LINUX_GETDENTS*/
#include "util.h"
#include "ath.h"
#include "debug.h"
+
\f
void
_gpgme_io_subsystem_init (void)
}
+#ifdef USE_LINUX_GETDENTS
+/* This is not declared in public headers; getdents64(2) says that we must
+ * define it ourselves. */
+struct linux_dirent64
+{
+ ino64_t d_ino;
+ off64_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[];
+};
+
+# define DIR_BUF_SIZE 1024
+#endif /*USE_LINUX_GETDENTS*/
+
+
static long int
get_max_fds (void)
{
* than for example doing 4096 close calls where almost all of them
* will fail.
*
- * Unfortunately we can't call opendir between fork and exec in a
- * multi-threaded process because opendir uses malloc and thus a
- * mutex which may deadlock with a malloc in another thread. Thus
- * the code is not used until we can have a opendir variant which
- * does not use malloc. */
-/* #ifdef __linux__ */
-/* { */
-/* DIR *dir = NULL; */
-/* struct dirent *dir_entry; */
-/* const char *s; */
-/* int x; */
-
-/* dir = opendir ("/proc/self/fd"); */
-/* if (dir) */
-/* { */
-/* while ((dir_entry = readdir (dir))) */
-/* { */
-/* s = dir_entry->d_name; */
-/* if ( *s < '0' || *s > '9') */
-/* continue; */
-/* x = atoi (s); */
-/* if (x > fds) */
-/* fds = x; */
-/* } */
-/* closedir (dir); */
-/* } */
-/* if (fds != -1) */
-/* { */
-/* fds++; */
-/* source = "/proc"; */
-/* } */
-/* } */
-/* #endif /\* __linux__ *\/ */
+ * We can't use the normal opendir/readdir/closedir interface between
+ * fork and exec in a multi-threaded process because opendir uses
+ * malloc and thus a mutex which may deadlock with a malloc in another
+ * thread. However, the underlying getdents system call is safe. */
+#ifdef USE_LINUX_GETDENTS
+ {
+ int dir_fd;
+ char dir_buf[DIR_BUF_SIZE];
+ struct linux_dirent64 *dir_entry;
+ int r, pos;
+ const char *s;
+ int x;
+
+ dir_fd = open ("/proc/self/fd", O_RDONLY | O_DIRECTORY);
+ if (dir_fd != -1)
+ {
+ for (;;)
+ {
+ r = syscall(SYS_getdents64, dir_fd, dir_buf, DIR_BUF_SIZE);
+ if (r == -1)
+ {
+ /* Fall back to other methods. */
+ fds = -1;
+ break;
+ }
+ if (r == 0)
+ break;
+
+ for (pos = 0; pos < r; pos += dir_entry->d_reclen)
+ {
+ dir_entry = (struct linux_dirent64 *) (dir_buf + pos);
+ s = dir_entry->d_name;
+ if (*s < '0' || *s > '9')
+ continue;
+ /* atoi is not guaranteed to be async-signal-safe. */
+ for (x = 0; *s >= '0' && *s <= '9'; s++)
+ x = x * 10 + (*s - '0');
+ if (!*s && x > fds && x != dir_fd)
+ fds = x;
+ }
+ }
+
+ close (dir_fd);
+ }
+ if (fds != -1)
+ {
+ fds++;
+ source = "/proc";
+ }
+ }
+#endif /*USE_LINUX_GETDENTS*/
#ifdef RLIMIT_NOFILE
if (fds == -1)
* have closefrom(2) we first figure out the highest fd we
* do not want to close, then call closefrom, and on success
* use the regular code to close all fds up to the start
- * point of closefrom. Note that Solaris' closefrom does
+ * point of closefrom. Note that Solaris' and FreeBSD's closefrom do
* not return errors. */
#ifdef HAVE_CLOSEFROM
{
if (fd_list[i].fd > fd)
fd = fd_list[i].fd;
fd++;
-#ifdef __sun
+#if defined(__sun) || defined(__FreeBSD__)
closefrom (fd);
max_fds = fd;
#else /*!__sun */
{ "ALREADY_SIGNED", GPGME_STATUS_ALREADY_SIGNED },
{ "ATTRIBUTE", GPGME_STATUS_ATTRIBUTE },
{ "BACKUP_KEY_CREATED", GPGME_STATUS_BACKUP_KEY_CREATED },
- { "BAD_PASSPHRASE", GPGME_STATUS_BAD_PASSPHRASE },
{ "BADARMOR", GPGME_STATUS_BADARMOR },
{ "BADMDC", GPGME_STATUS_BADMDC },
{ "BADSIG", GPGME_STATUS_BADSIG },
+ { "BAD_PASSPHRASE", GPGME_STATUS_BAD_PASSPHRASE },
{ "BEGIN_DECRYPTION", GPGME_STATUS_BEGIN_DECRYPTION },
{ "BEGIN_ENCRYPTION", GPGME_STATUS_BEGIN_ENCRYPTION },
{ "BEGIN_SIGNING", GPGME_STATUS_BEGIN_SIGNING },
{ "DECRYPTION_INFO", GPGME_STATUS_DECRYPTION_INFO },
{ "DECRYPTION_OKAY", GPGME_STATUS_DECRYPTION_OKAY },
{ "DELETE_PROBLEM", GPGME_STATUS_DELETE_PROBLEM },
+ { "DECRYPTION_COMPLIANCE_MODE", GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE },
{ "ENC_TO", GPGME_STATUS_ENC_TO },
{ "END_DECRYPTION", GPGME_STATUS_END_DECRYPTION },
{ "END_ENCRYPTION", GPGME_STATUS_END_ENCRYPTION },
{ "GET_BOOL", GPGME_STATUS_GET_BOOL },
{ "GET_HIDDEN", GPGME_STATUS_GET_HIDDEN },
{ "GET_LINE", GPGME_STATUS_GET_LINE },
- { "GOOD_PASSPHRASE", GPGME_STATUS_GOOD_PASSPHRASE },
{ "GOODMDC", GPGME_STATUS_GOODMDC },
{ "GOODSIG", GPGME_STATUS_GOODSIG },
+ { "GOOD_PASSPHRASE", GPGME_STATUS_GOOD_PASSPHRASE },
{ "GOT_IT", GPGME_STATUS_GOT_IT },
+ { "IMPORTED", GPGME_STATUS_IMPORTED },
{ "IMPORT_OK", GPGME_STATUS_IMPORT_OK },
{ "IMPORT_PROBLEM", GPGME_STATUS_IMPORT_PROBLEM },
{ "IMPORT_RES", GPGME_STATUS_IMPORT_RES },
- { "IMPORTED", GPGME_STATUS_IMPORTED },
{ "INQUIRE_MAXLEN", GPGME_STATUS_INQUIRE_MAXLEN },
{ "INV_RECP", GPGME_STATUS_INV_RECP },
{ "INV_SGNR", GPGME_STATUS_INV_SGNR },
+ { "KEYEXPIRED", GPGME_STATUS_KEYEXPIRED },
+ { "KEYREVOKED", GPGME_STATUS_KEYREVOKED },
{ "KEY_CONSIDERED", GPGME_STATUS_KEY_CONSIDERED },
{ "KEY_CREATED", GPGME_STATUS_KEY_CREATED },
{ "KEY_NOT_CREATED", GPGME_STATUS_KEY_NOT_CREATED },
- { "KEYEXPIRED", GPGME_STATUS_KEYEXPIRED },
- { "KEYREVOKED", GPGME_STATUS_KEYREVOKED },
{ "LEAVE", GPGME_STATUS_LEAVE },
{ "MISSING_PASSPHRASE", GPGME_STATUS_MISSING_PASSPHRASE },
{ "MOUNTPOINT", GPGME_STATUS_MOUNTPOINT },
{ "NEED_PASSPHRASE_PIN", GPGME_STATUS_NEED_PASSPHRASE_PIN },
{ "NEED_PASSPHRASE_SYM", GPGME_STATUS_NEED_PASSPHRASE_SYM },
{ "NEWSIG", GPGME_STATUS_NEWSIG },
- { "NO_PUBKEY", GPGME_STATUS_NO_PUBKEY },
- { "NO_RECP", GPGME_STATUS_NO_RECP },
- { "NO_SECKEY", GPGME_STATUS_NO_SECKEY },
- { "NO_SGNR", GPGME_STATUS_NO_SGNR },
{ "NODATA", GPGME_STATUS_NODATA },
{ "NOTATION_DATA", GPGME_STATUS_NOTATION_DATA },
{ "NOTATION_FLAGS", GPGME_STATUS_NOTATION_FLAGS },
{ "NOTATION_NAME", GPGME_STATUS_NOTATION_NAME },
+ { "NO_PUBKEY", GPGME_STATUS_NO_PUBKEY },
+ { "NO_RECP", GPGME_STATUS_NO_RECP },
+ { "NO_SECKEY", GPGME_STATUS_NO_SECKEY },
+ { "NO_SGNR", GPGME_STATUS_NO_SGNR },
{ "PINENTRY_LAUNCHED", GPGME_STATUS_PINENTRY_LAUNCHED},
{ "PKA_TRUST_BAD", GPGME_STATUS_PKA_TRUST_BAD },
{ "PKA_TRUST_GOOD", GPGME_STATUS_PKA_TRUST_GOOD },
{ "SHM_GET_BOOL", GPGME_STATUS_SHM_GET_BOOL },
{ "SHM_GET_HIDDEN", GPGME_STATUS_SHM_GET_HIDDEN },
{ "SHM_INFO", GPGME_STATUS_SHM_INFO },
+ { "SIGEXPIRED", GPGME_STATUS_SIGEXPIRED },
{ "SIG_CREATED", GPGME_STATUS_SIG_CREATED },
{ "SIG_ID", GPGME_STATUS_SIG_ID },
{ "SIG_SUBPACKET", GPGME_STATUS_SIG_SUBPACKET },
- { "SIGEXPIRED", GPGME_STATUS_SIGEXPIRED },
{ "SUCCESS", GPGME_STATUS_SUCCESS },
{ "TOFU_STATS", GPGME_STATUS_TOFU_STATS },
{ "TOFU_STATS_LONG", GPGME_STATUS_TOFU_STATS_LONG },
{ "UNEXPECTED", GPGME_STATUS_UNEXPECTED },
{ "USERID_HINT", GPGME_STATUS_USERID_HINT },
{ "VALIDSIG", GPGME_STATUS_VALIDSIG },
+ { "VERIFICATION_COMPLIANCE_MODE", GPGME_STATUS_VERIFICATION_COMPLIANCE_MODE },
{NULL, 0}
};
K for a key
The RECNO is either the one of the dir record or the one of the uid
record. OT is the the usual trust letter and only availabel on K
- lines. VAL is the calcualted validity MC is the marginal trust
+ lines. VAL is the calculated validity MC is the marginal trust
counter and only available on U lines CC is the same for the
complete count NAME ist the username and only printed on U
lines. */
\f
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
-#if GPG_ERROR_VERSION_NUMBER < 0x011500 /* 1.21 */
-# 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
int _gpgme_assuan_log_cb (assuan_context_t ctx, void *hook,
unsigned int cat, const char *msg);
+\f
+
+/* Parse the compliance field. */
+#define PARSE_COMPLIANCE_FLAGS(flags, result) \
+ do { \
+ char *comp_p, *comp_endp; \
+ unsigned long comp_ul; \
+ \
+ for (comp_p = (flags); \
+ comp_p \
+ && (comp_ul = strtoul (comp_p, &comp_endp, 10)) \
+ && comp_p != comp_endp; \
+ comp_p = comp_endp) \
+ { \
+ switch (comp_ul) \
+ { \
+ case 23: (result)->is_de_vs = 1; break; \
+ } \
+ } \
+ } while (0)
+
+
#endif /* UTIL_H */
if (err)
return err;
+ case GPGME_STATUS_VERIFICATION_COMPLIANCE_MODE:
+ PARSE_COMPLIANCE_FLAGS (args, opd->current_sig);
+ break;
+
default:
break;
}
* gpg/t-keylist.c: Reordered list to match new demo keyring. Add
arg for number of subkeys and for extra checking function.
(main): Enhanced a few error outputs. Changed subkey
- counting. Call extra checking fucntion.
+ counting. Call extra checking function.
(check_whisky): New.
2005-10-07 Marcus Brinkmann <marcus@g10code.de>
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
if HAVE_W32_SYSTEM
tests_unix =
else
-tests_unix = t-eventloop t-thread1
+tests_unix = t-eventloop t-thread1 t-thread-keylist t-thread-keylist-verify
endif
c_tests = \
t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \
t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \
t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait \
- t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed $(tests_unix) \
- t-thread-keylist t-thread-keylist-verify
+ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed \
+ $(tests_unix)
TESTS = initial.test $(c_tests) final.test
pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \
geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys)
+BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la
-$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d
-check-local: ./gpg.conf ./gpg-agent.conf ./pubring-stamp \
- ./private-keys-v1.d/gpg-sample.stamp
-
-# To guarantee that check-local is run before any tests we
-# add this dependency:
-initial.test : check-local
-
export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
-./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
+private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
done
echo x > ./private-keys-v1.d/gpg-sample.stamp
-./pubring-stamp: $(srcdir)/pubdemo.asc
+pubring-stamp: $(srcdir)/pubdemo.asc ./private-keys-v1.d/gpg-sample.stamp
$(GPG) --batch --no-permission-warning \
--import $(srcdir)/pubdemo.asc
-$(GPG) --batch --no-permission-warning \
--import $(srcdir)/secdemo.asc
echo x > ./pubring-stamp
-./gpg.conf:
+gpg.conf:
# This is required for t-sig-notations.
echo no-force-v3-sigs > ./gpg.conf
-./gpg-agent.conf:
+gpg-agent.conf:
# This is required for gpg2, which does not support command fd.
echo pinentry-program $(abs_srcdir)/pinentry > ./gpg-agent.conf
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_1 = t-eventloop$(EXEEXT) \
-@HAVE_W32_SYSTEM_FALSE@ t-thread1$(EXEEXT)
+@HAVE_W32_SYSTEM_FALSE@ t-thread1$(EXEEXT) \
+@HAVE_W32_SYSTEM_FALSE@ t-thread-keylist$(EXEEXT) \
+@HAVE_W32_SYSTEM_FALSE@ t-thread-keylist-verify$(EXEEXT)
am__EXEEXT_2 = t-encrypt$(EXEEXT) t-encrypt-sym$(EXEEXT) \
t-encrypt-sign$(EXEEXT) t-sign$(EXEEXT) t-signers$(EXEEXT) \
t-decrypt$(EXEEXT) t-verify$(EXEEXT) t-decrypt-verify$(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-thread-keylist$(EXEEXT) t-thread-keylist-verify$(EXEEXT)
+ t-gpgconf$(EXEEXT) t-encrypt-mixed$(EXEEXT) $(am__EXEEXT_1)
@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_3 = t-cancel$(EXEEXT)
am__EXEEXT_4 = t-genkey$(EXEEXT) $(am__EXEEXT_3)
PROGRAMS = $(noinst_PROGRAMS)
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
# The keylist tests must come after the import and the edit test.
noinst_HEADERS = t-support.h
-@HAVE_W32_SYSTEM_FALSE@tests_unix = t-eventloop t-thread1
+@HAVE_W32_SYSTEM_FALSE@tests_unix = t-eventloop t-thread1 t-thread-keylist t-thread-keylist-verify
@HAVE_W32_SYSTEM_TRUE@tests_unix =
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-thread-keylist t-thread-keylist-verify
+ t-encrypt-large t-file-name t-gpgconf t-encrypt-mixed \
+ $(tests_unix)
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \
geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys)
+BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
+
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la
# We don't run t-genkey and t-cancel in the test suite, because it
# takes too long
tests_skipped = t-genkey $(am__append_1)
-all: all-am
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
-check: check-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS) $(HEADERS)
installdirs:
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
uninstall-am:
-.MAKE: check-am install-am install-strip
+.MAKE: all check check-am install install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \
- check-local clean clean-generic clean-libtool clean-local \
- clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- 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
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man 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
clean-local:
-$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d
-check-local: ./gpg.conf ./gpg-agent.conf ./pubring-stamp \
- ./private-keys-v1.d/gpg-sample.stamp
-
-# To guarantee that check-local is run before any tests we
-# add this dependency:
-initial.test : check-local
-
export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
-./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
+private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
for k in $(private_keys); do \
cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
done
echo x > ./private-keys-v1.d/gpg-sample.stamp
-./pubring-stamp: $(srcdir)/pubdemo.asc
+pubring-stamp: $(srcdir)/pubdemo.asc ./private-keys-v1.d/gpg-sample.stamp
$(GPG) --batch --no-permission-warning \
--import $(srcdir)/pubdemo.asc
-$(GPG) --batch --no-permission-warning \
--import $(srcdir)/secdemo.asc
echo x > ./pubring-stamp
-./gpg.conf:
+gpg.conf:
# This is required for t-sig-notations.
echo no-force-v3-sigs > ./gpg.conf
-./gpg-agent.conf:
+gpg-agent.conf:
# This is required for gpg2, which does not support command fd.
echo pinentry-program $(abs_srcdir)/pinentry > ./gpg-agent.conf
-----BEGIN PGP MESSAGE-----
-Version: GnuPG v1.0.4-2 (GNU/Linux)
-Comment: For info see http://www.gnupg.org
-hQEOA2rm1+5GqHH4EAP/Tcqiuhvrjj+RFBKnWn2A7f1ztV17U2EngYFy8TbZYGNp
-JoMNdpA7GNZs7iqc/x1epaZDKfaQwWEtARZmK/4nlhB48N+oZeKTm7PXIkRPqrCZ
-3fxJjCJaU0yrNGuO345DOr0QwDImVhubVEkfgs8yXK2Szx2G8X3LmiaILHAqA2oD
-/1ZqjY8k+ovrLL/qe8un/NTwzSjKIPVGR6mhLFXmj8fnp2kSsbo+Bhh4MczTRR6l
-SA32z25vcakKu2qn5Wa4yDcx9NcMt8RHXzmfMDLj6UFq99QqKeLK2ywcIpY9p/GL
-fQyaf7r3HTVugBSaoOzegLJ+L7MfWohrStkMeLnJQnro0nYBjADVcUQuSS4N3lst
-Df3XrxxA/iJvxt4F9K27u4tp5U1HDg1CIxVrkMs92LBri3S6ZtfjdoqQ7QghFwGP
-Kw1lKiWayM6NH9rcCKSgk4kl4P/2l3f78XeFgiywN7UGeSoH3BLMSv9gSxl5KrAz
-d2imhTMrfEvZ
-=y4ng
+hQEOA2rm1+5GqHH4EAP/XKz8pdonnZg2dqJhjdas4vQHPxspxLhgf7OuYigodBpI
+l7srTvqtuRsDFNorgURW6DjPqfGqpZsn2uf8enUskunHVMQFBILX38d+G5SkisqF
+uOZUlmh0ZfVocCBGYt8ZPfa9ObmitPmZvhCReCHFlTj588ZjofKuNjmfw+QfmNcD
+/j4z4ijv6dKHQCm7EAjnOsCw9SbrAVpRXjibN7KT+w6QT6m+5w9k4RfhkTOlqrHq
+5d3ZyxLctdTkXlk0hXz1Mey4AEKTtlZGvrQVIhaX4hcB4NFJB0fZJ/pnKypi1H6q
+0bSBq2p6kCzJuNvrEr4wk4B1NsOTBacUSffXLrfsEH2F0ngBzN7d/KHBImu81F8w
+x96f6dELyYetV0UwhyFrPrA3lBQf9q5cNDqPiCHooUFOudQ5t0h7VtSU3fyaYoit
+cJGPFkIxhv+VAbEW/h5muEg3KO1iEqLP4RK3y0Jjy4pyEauAgviM68Vjf4OVvgta
+/IblIrp1FHxoCpA=
+=sEuD
-----END PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----
-Version: GnuPG v1.0.6 (GNU/Linux)
-Comment: Weitere Infos: siehe http://www.gnupg.org
-hQEOA++dwnahcsiBEAP9HgkC1ElQwZRX1X/MBF54Q28dpXKr84IviO4QcbnnhmYk
-2IlaNe6mr8R7kNM1aqJFK3fnobqnSWwM/VBObMqqYnzZSfclCNsy66sojQJxwXcz
-DKQKi69BLaC6aTMnX048tOl8pJpR72fkffUOUa5ywDHVVVUClDG3XkIrfM1du3YD
-/A6vFSrRylupKhQBxdtSUx5IDmpDYwG2vqqbYKoMaQ4pPSKLYV2zskU+pQWRlk6y
-nwPGY5h9eGz0xYHMPxhe9VnwljeTEDwz5U4CHF3wQ8h5WBxOVx5QN/H/UyjpmoJT
-ddrIu+8GgajhBVKVYAOqr577exkiSDA60/JrYbKZBvzL0sAJAUu+HoeMPJ+5/RYF
-pLSdz/3MbVDRJJqzV2TJnEBvFtPa6urzx99P0u4xr+RJMFmR9/99YXhYz7+Y6d/B
-44F6B3YouYxiK39IoOUcYPZTwb5kaudD5a3mU3XxEhSDUpnyvowPiKQO1T8CPd2u
-2HsD3KeaOc2VFE0gnvqECvUTQfSCZCk/kil8XVAMHZrEA0bWAYiaHfHEOB8SRCy8
-rW0wsON4uDXmZpUkfOjFoYZdpJI7fDKkb5uYUzFZDasharEaXb1X/5xSAclx
-=+eYk
+hQEOA++dwnahcsiBEAQAqaF1yuTJ26FmJHndyaHUjazx7j8/Z/Ht3O+jSAOaoJFR
+84rK4Tte0JQYTCl3XxwSEwr48OAtyeTstLjabGAvBoHrXVP3xC0U7kBalZm2lwcq
+A8dDDoa3uMkWi1OJ3e2o79/z6SdTHEgRIRomAku1JaXFGTd8OsFhW782RpKUBOID
+/jMs9o2sa/gDhWVaeC3SaQovl2xb45ev0nMibED916BQvv3NkH5/EzeM6v788h63
+4yUkWWNr0/bnJ21chlxIbvICjHfuGAEDw+i4HhK/nLBL3Ep4ADtLP7OPZJHlcQgI
+g8mAztasBxTGGUuFYvRT0X7sbaSPxLR26vbTCYAo/P/80sA4AYGhBuYPsRN4JzX9
+QaSrToKjPbaZqq+nHQYCvi6m5xAjMT0HVdXejMtZMKwv4TRm7IVCimtIZqrlvw7c
+Kj+ZcDGq9qb7urnzC5mdAZkXyNtZxmMKYFI0ci7zMnflvIM87JrVEjZbjjiXlcVy
+mSxhufOOweLJARkJ4mKVq1tr8REu8/ots4fDzUIAITM3z8pKA7doWAH2VTo0Idmc
+wYOoTLkiq1Z8fxeryB6U66C831PDiWe7W0usRSVo5rZ7laLZeOGl33fAAZCNLTgv
+tOPWWg5rCpRTVXgQ6Edl7DtzKI1z4EJbuEUs6shW+OT3bNISiDz2am8remU=
+=9AEU
-----END PGP MESSAGE-----
/* t-encrypt-mixed.c - Regression test.
- Copyright (C) 2016 Intevation GmbH
+ Copyright (C) 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
err = gpgme_new (&ctx);
fail_if_err (err);
+ {
+ /* Let's check getting the agent-socket directory for different homedirs. */
+ char *result1 = NULL;
+ char *result2 = NULL;
+ err = gpgme_ctx_set_engine_info (ctx, GPGME_PROTOCOL_GPGCONF, NULL, "/tmp/foo");
+ fail_if_err (err);
+ err = gpgme_op_conf_dir (ctx, "agent-socket", &result1);
+ fail_if_err (err);
+
+ err = gpgme_ctx_set_engine_info (ctx, GPGME_PROTOCOL_GPGCONF, NULL, NULL);
+ fail_if_err (err);
+ err = gpgme_op_conf_dir (ctx, "agent-socket", &result2);
+ fail_if_err (err);
+
+ /* They have to be different. */
+ test (strcmp(result1, result2));
+ gpgme_free (result1);
+ gpgme_free (result2);
+ }
+
err = gpgme_op_conf_load (ctx, &conf);
fail_if_err (err);
if (keys[i].fpr)
{
- fprintf (stderr, "Less keys returned than expected\n");
+ fprintf (stderr, "Less keys (%d) returned than expected (%d)\n",
+ i, (int)(DIM (keys) - 1));
exit (1);
}
/* t-thread-verify.c - Regression test.
- Copyright (C) 2015 Intevation GmbH
+ Copyright (C) 2015 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
/* t-thread-verify.c - Regression test.
- Copyright (C) 2015 Intevation GmbH
+ Copyright (C) 2015 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
## Process this file with automake to produce Makefile.in
GPGSM = gpgsm
+GPG_AGENT = gpg-agent
TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= \
top_srcdir=$(top_srcdir)
key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939
-CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \
+CLEANFILES = pubring-stamp pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \
random_seed S.gpg-agent
clean-local:
-$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d
-check-local: ./pubring.kbx ./gpgsm.conf \
- ./private-keys-v1.d/$(key_id).key ./trustlist.txt
-
-# To guarantee that check-local is run before any tests we add this
-# dependency:
-initial.test : check-local
-
export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
-./pubring.kbx: $(srcdir)/cert_g10code_test1.der
+BUILT_SOURCES = gpgsm.conf trustlist.txt pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
+
+pubring-stamp: $(srcdir)/cert_g10code_test1.der ./private-keys-v1.d/gpg-sample.stamp
$(GPGSM) --import $(srcdir)/cert_g10code_test1.der
+ touch pubring-stamp
-./gpgsm.conf:
+gpgsm.conf:
echo disable-crl-checks > ./gpgsm.conf
echo faked-system-time 1008241200 >> ./gpgsm.conf
+ echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpgsm.conf
-./private-keys-v1.d/$(key_id).key: $(srcdir)/$(key_id)
+private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(key_id)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key
+ echo x > ./private-keys-v1.d/gpg-sample.stamp
-./trustlist.txt:
+trustlist.txt:
echo $(key_id) > ./trustlist.txt
echo >> ./trustlist.txt
echo "# CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE" >> ./trustlist.txt
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
GPGSM = gpgsm
+GPG_AGENT = gpg-agent
TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= \
top_srcdir=$(top_srcdir)
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la
key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939
-CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \
+CLEANFILES = pubring-stamp pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \
random_seed S.gpg-agent
-all: all-am
+BUILT_SOURCES = gpgsm.conf trustlist.txt pubring-stamp \
+ private-keys-v1.d/gpg-sample.stamp
+
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
-check: check-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS) $(HEADERS)
installdirs:
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
uninstall-am:
-.MAKE: check-am install-am install-strip
+.MAKE: all check check-am install install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \
- check-local clean clean-generic clean-libtool clean-local \
- clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- 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
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man 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
clean-local:
-$(top_srcdir)/tests/start-stop-agent --stop
-rm -fR private-keys-v1.d
-check-local: ./pubring.kbx ./gpgsm.conf \
- ./private-keys-v1.d/$(key_id).key ./trustlist.txt
-
-# To guarantee that check-local is run before any tests we add this
-# dependency:
-initial.test : check-local
-
export GNUPGHOME := $(abs_builddir)
export GPG_AGENT_INFO :=
-./pubring.kbx: $(srcdir)/cert_g10code_test1.der
+pubring-stamp: $(srcdir)/cert_g10code_test1.der ./private-keys-v1.d/gpg-sample.stamp
$(GPGSM) --import $(srcdir)/cert_g10code_test1.der
+ touch pubring-stamp
-./gpgsm.conf:
+gpgsm.conf:
echo disable-crl-checks > ./gpgsm.conf
echo faked-system-time 1008241200 >> ./gpgsm.conf
+ echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpgsm.conf
-./private-keys-v1.d/$(key_id).key: $(srcdir)/$(key_id)
+private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(key_id)
+ -gpgconf --kill all
$(MKDIR_P) ./private-keys-v1.d
cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key
+ echo x > ./private-keys-v1.d/gpg-sample.stamp
-./trustlist.txt:
+trustlist.txt:
echo $(key_id) > ./trustlist.txt
echo >> ./trustlist.txt
echo "# CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE" >> ./trustlist.txt
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
-PYTHON_VERSIONS = @PYTHON_VERSIONS@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RC = @RC@
/* run-decrypt.c - Helper to perform a verify operation
Copyright (C) 2009 g10 Code GmbH
- 2016 Intevation GmbH
+ 2016 by Bundesamt für Sicherheit in der Informationstechnik
+ Software engineering by Intevation GmbH
This file is part of GPGME.
}
- init_gpgme (GPGME_PROTOCOL_OpenPGP);
+ init_gpgme_basic ();
for (; argc; argc--, argv++)
{
{
gpgme_user_id_t uid;
gpgme_tofu_info_t ti;
+ gpgme_key_sig_t ks;
int nuids;
int nsub;
+ int nsigs;
printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?");
printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?");
printf (" first: %s\n", isotimestr (ti->encrfirst));
printf (" last: %s\n", isotimestr (ti->encrlast));
}
+ for (nsigs=0, ks=uid->signatures; ks; ks = ks->next, nsigs++)
+ {
+ printf ("signature %d: %s\n", nsigs, nonnull (ks->uid));
+ printf (" keyid: %s\n", nonnull (ks->keyid));
+ printf (" created: %s\n", isotimestr(ks->timestamp));
+ printf (" expires: %s\n", isotimestr(ks->expires));
+ printf (" class: %x\n", ks->sig_class);
+ }
}
putchar ('\n');
srcdir = ".";
buf = malloc (strlen(srcdir) + strlen(fname) + 2);
if (!buf)
- exit (8);
+ {
+ fprintf (stderr, "%s:%d: could not allocate string: %s\n",
+ __FILE__, __LINE__, strerror (errno));
+ exit (8);
+ }
strcpy (buf, srcdir);
strcat (buf, "/");
strcat (buf, fname);
void
-init_gpgme (gpgme_protocol_t proto)
+init_gpgme_basic (void)
{
- gpgme_error_t err;
-
gpgme_check_version (NULL);
setlocale (LC_ALL, "");
gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
#ifndef HAVE_W32_SYSTEM
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
#endif
+}
+
+
+void
+init_gpgme (gpgme_protocol_t proto)
+{
+ gpg_error_t err;
+ init_gpgme_basic ();
err = gpgme_engine_check_version (proto);
fail_if_err (err);
}
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
" --sender MBOX use MBOX as sender address\n"
+ " --auto-key-retrieve\n"
, stderr);
exit (ex);
}
main (int argc, char **argv)
{
int last_argc = -1;
+ const char *s;
gpgme_error_t err;
gpgme_ctx_t ctx;
gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP;
gpgme_verify_result_t result;
int print_status = 0;
const char *sender = NULL;
+ int auto_key_retrieve = 0;
if (argc)
{ argc--; argv++; }
sender = *argv;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--auto-key-retrieve"))
+ {
+ auto_key_retrieve = 1;
+ argc--; argv++;
+ }
+
else if (!strncmp (*argv, "--", 2))
show_usage (1);
}
/* gpgme_set_ctx_flag (ctx, "raw-description", "1"); */
+ if (auto_key_retrieve)
+ {
+ gpgme_set_ctx_flag (ctx, "auto-key-retrieve", "1");
+ s = gpgme_get_ctx_flag (ctx, "auto-key-retrieve");
+ if (!s || strcmp (s, "1"))
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag failed for '%s'\n",
+ "auto-key-retrieve");
+ exit (1);
+ }
+ }
+
if (sender)
{
err = gpgme_set_sender (ctx, sender);
exit 0
fi
+# Update 'agent-program' in the configuration files to make sure we
+# will always start exactly this agent again if we ever need to.
+for F in gpg.conf gpgsm.conf
+do
+ if test -f "$GNUPGHOME/$F"
+ then
+ mv "$GNUPGHOME/$F" "$GNUPGHOME/$F~"
+ sed -e "s#^agent-program.*#agent-program ${GPG_AGENT}|--debug-quick-random#" \
+ >"$GNUPGHOME/$F" <"$GNUPGHOME/$F~"
+ rm "$GNUPGHOME/$F~"
+ fi
+done
+
if [ "$(gpg-connect-agent --no-autostart getval\ $token /bye 2>/dev/null | head -1)" \
= "D set" ]; then
echo "gpg-agent already running" >&2
#include <string.h>
#include <errno.h>
-#include <gpgme.h>
+#define PGM "t-data"
+#include "run-support.h"
+#undef fail_if_err
#define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: (%i) gpgme_error_t " \
"%s\n", __FILE__, __LINE__, round, \
exit (1); } \
} while(0)
-static char *
-make_filename (const char *fname)
-{
- const char *srcdir = getenv ("srcdir");
- char *buf;
-
- if (!srcdir)
- srcdir = ".";
- buf = malloc (strlen(srcdir) + strlen(fname) + 2 );
- if (!buf)
- {
- fprintf (stderr, "%s:%d: could not allocate string: %s\n",
- __FILE__, __LINE__, strerror (errno));
- exit (1);
- }
- strcpy (buf, srcdir);
- strcat (buf, "/");
- strcat (buf, fname);
- return buf;
-}
-
typedef enum
{
TEST_INITIALIZER,
gpgme_error_t err = 0;
gpgme_data_t data;
+ init_gpgme_basic ();
+
while (++round)
{
switch (round)