aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cpp: Add support for gpgme_op_revsigIngo Klöcker2020-10-293-12/+61
| | | | | | | | | | | | * lang/cpp/src/context.cpp, lang/cpp/src/context.h (Context::revokeSignature, Context::startRevokeSignature): New. * lang/cpp/src/context.cpp (getLFSeparatedListOfStrings, getLFSeparatedListOfUserIds): New. (getLFSeparatedListOfFingerprintsFromSubkeys): Extracted second part of function to getLFSeparatedListOfStrings. -- GnuPG-bug-id: 5094
* core: New function gpgme_op_revsig.Ingo Klöcker2020-10-2919-19/+416
| | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_revsig_start, gpgme_op_revsig): New. (GPGME_REVSIG_LFSEP): New. * src/context.h (ctx_op_data_id_t): Add OPDATA_REVSIG. * src/revsig.c: New. * src/Makefile.am (main_sources): Add revsig. * src/libgpgme.vers, src/gpgme.def: Add gpgme_op_revsig and gpgme_op_revsig_start. * src/engine.h, src/engine.c: (_gpgme_engine_op_revsig): New. * src/engine-backend.h (engine_ops): Add 'revsig' and adjust all engine initializers. * src/engine-gpg.c (gpg_revsig): New. (_gpgme_engine_ops_gpg): Set revsig to gpg_revsig. * doc/gpgme.texi: Document new functions. * tests/run-keysign.c: Add option --revoke. -- This extends GPGME to support the --quick-revoke-sig command added by GnuPG 2.2.24. This allows revoking key signatures. GnuPG-bug-id: 5094
* python: Handle the when case __doc__ is None.NIIBE Yutaka2020-10-271-1/+6
| | | | | | | | | * lang/python/src/core.py (GpgmeWrapper): Check if None. -- GnuPG-bug-id: 5075 Signed-off-by: NIIBE Yutaka <[email protected]>
* cpp: Add support for gpgme_cancelIngo Klöcker2020-10-233-0/+7
| | | | | | | | | | | | | * lang/cpp/src/context.cpp, lang/cpp/context.h (Context::cancelPendingOperationImmediately): New. * NEWS: Mention added API -- This allows immediate canceling of running operations, e.g. when a thread with a long running operation (like SCD DEVINFO --watch) is going to be terminated (on application shutdown). GnuPG-bug-id: 5066
* Add Assuan transaction that forwards status lines to another objectIngo Klöcker2020-10-235-1/+166
| | | | | | | | | | | | | | | * lang/cpp/src/Makefile.am: Add new files. * lang/cpp/src/interfaces/statusconsumer.h, lang/cpp/src/statusconsumerassuantransaction.cpp, lang/cpp/src/statusconsumerassuantransaction.h: New. * NEWS: Mention new API. -- This Assuan transaction is useful for long running Assuan commands. Classes implementing the StatusConsumer interface can process received status lines while the Assuan command is still running. GnuPG-bug-id: 5066
* qt: Add QDebug stream operator for GpgME::ErrorIngo Klöcker2020-10-234-1/+102
| | | | | | | | | | * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/debug.h, lang/qt/src/debug.cpp: New. * NEWS: Mention it. -- This was previously implemented in Kleopatra, but it makes sense for all users of qgpgme.
* cpp, qt: Add missing comparison operators for version info comparisonIngo Klöcker2020-10-233-0/+65
| | | | | | | | | * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator<=, EngineInfo::Version::operator>=, EngineInfo::Version::operator!=): New. * lang/qt/tests/t-various.cpp (TestVarious::testVersion): Add tests for new comparison operators. * NEWS: Mention added API
* cpp, qt: Fix version info comparisonIngo Klöcker2020-10-232-2/+4
| | | | | | | | | | | | * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator>(const Version &)): Fix logic. (EngineInfo::Version::operator>(const char *)): Use Version-overload of operator>. * lang/qt/tests/t-various.cpp: Add test. -- This fixes a logic error that 2.0.0 > 2.0.0 would return true.
* tests: Fix gcc incompatibilityWerner Koch2020-10-031-5/+13
| | | | | | | | | | * tests/json/t-json.c: Remove var definitions inside a for statement. -- This useful C99 feature seems to work only in recent gcc versions. We can't use it; see gnupg/doc/HACKING. GnuPG-bug-id: 5088
* gpgsm: Fix leaked fd.NIIBE Yutaka2020-10-011-1/+1
| | | | | | | | | | | * src/engine-gpgsm.c (gpgsm_new): Close gpgsm->diag_cb.server_fd. -- GnuPG-bug-id: 5074 Reported by: VladislavGrudinin Fixes-commit: dd21ec997cf4b6ba18538c63c728478110ad1f60 Signed-off-by: NIIBE Yutaka <[email protected]>
* core: Fully implement the inquire callback for assuan_transactWerner Koch2020-09-092-10/+19
| | | | | | | | | | | | | | | | | | | * src/engine-assuan.c (inquire_cb): Implement returning data. * tests/opassuan/t-command.c (inq_cb): Send some test data. -- The old code only allowed to send an empty response which was good enough for scdaemon's KNOWNCARDP inquire but not to send actual data. A quick test using a test smartcard might be ./t-command 'scd setattr --inquire PRIVATE-DO-1' and then reading the data back using gpg-connect-agent 'scd getattr PRIVATE-DO-1' /bye Signed-off-by: Werner Koch <[email protected]>
* qt: Update the documentation of ListAllKeysJobIngo Klöcker2020-09-081-2/+3
| | | | | | | | * lang/qt/src/listallkeysjob.h (ListAllKeysJob::start): Document that the mergeKeys argument is ignored with gpg >= 2.1. -- GnuPG-bug-id: 4794
* cpp: Update key with --with-secret instead of updating it twiceIngo Klöcker2020-09-081-5/+11
| | | | | | | | | | | * lang/cpp/src/key.cpp (Key::update): Call Context::key() only once with KeyListMode::WithSecret. -- With gpg >= 2.1, get the key with --with-secret instead of first trying to get the secret key and, if that fails, getting the public key. GnuPG-bug-id: 4794
* qt: List keys once with --with-secret instead of twiceIngo Klöcker2020-09-072-9/+116
| | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmelistallkeysjob.cpp (do_list_keys): Rename to do_list_keys_legacy and put into unnamed namespace. (merge_keys): Put into unnamed namespace. (list_keys): Rename to list_keys_legacy and put into unnamed namespace. (do_list_keys, list_keys): New. * lang/qt/tests/t-keylist.cpp (testListAllKeysSync): New. -- With gpg >= 2.1, list keys once with --with-secret instead of listing public keys and secret keys and then merging (part of) the information about the keys. GnuPG-bug-id: 4794
* cpp: Add keylist mode WithSecretIngo Klöcker2020-09-073-3/+13
| | | | | | | | | | * lang/cpp/src/global.h (WithSecret): New. * lang/cpp/src/context.cpp (operator<<): Handle WithSecret. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t, convert_from_gpgme_keylist_mode_t): Ditto. -- GnuPG-bug-id: 4794
* cpp: Add missing keylist modesIngo Klöcker2020-09-071-7/+23
| | | | | | | | * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t): Sort modes as in enum definition and add missing modes to check. (convert_from_gpgme_keylist_mode_t): Add missing handling of GPGME_KEYLIST_MODE_WITH_TOFU and GPGME_KEYLIST_MODE_WITH_KEYGRIP.
* cpp: Copy some more subkey properties when merging keysIngo Klöcker2020-09-031-0/+4
| | | | | | | | | | | * lang/cpp/src/key.cpp (Key::mergeWith): Also merge secret flag and keygrip -- The keygrip was lost if the result of a public key listing was merged with the result of a secret key listing as done by QGpgMEListAllKeysJob. GnuPG-bug-id: 4794
* qt: Fix an rfc2253 parser flawWerner Koch2020-08-281-3/+2
| | | | | | | | | | | | | | * lang/qt/src/dn.cpp (parse_dn_part): Fix parser. -- This could in theory result in reading bytes after a after Nul in a string and thus possible segv on unallocated memory or reading other parts of the memory. However, it is harmless because the rfc2253 strings have been received from GnuPG which is expected to emit correct syntax. GnuPG-bug-id: 5037
* core: Add error handling to setexpireIngo Klöcker2020-08-145-53/+204
| | | | | | | | | | | | | | | | | | | * src/genkey.c (setexpire, gpgme_op_setexpire_start, gpgme_op_setexpire): Move to ... * src/setexpire.c: New. * src/Makefile.am (main_sources): Add that file. * src/context.h (ctx_op_data_id_t): Add OPDATA_SETEXPIRE. * lang/qt/tests/t-various.cpp (testSetExpire): Test error handling. -- Errors (and failures) emitted via status-fd need to be handled explicitly, i.e. we need to provide an appropriate status handler with corresponding op_data_t. Additionally, we need to set a passphrase command handler if a passphrase callback is set in the context, e.g. during tests. GnuPG-bug-id: 4395
* qt: Support changing expiry of subkeysIngo Klöcker2020-08-114-4/+42
| | | | | | | | | | | | | * lang/qt/src/changeexpiryjob.h (ChangeExpiryJob::start): New overload that accepts subkeys (with empty implementation). * lang/qt/src/qgpgmechangeexpiryjob.h, lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJob::start): New overload that accepts subkeys. -- This adds the possibility to change the expiry of subkeys. GnuPG-bug-id: 4717
* cpp: Make private helper a file staticIngo Klöcker2020-08-102-3/+1
| | | | | | | | | * lang/cpp/src/context.h, lang/cpp/src/context.cpp (Context::getLFSeparatedListOfFingerprintsFromSubkeys): Remove from Context; make it a static function instead -- GnuPG-bug-id: 5003
* cpp: Use cstdlib getenv for portabilityAndre Heinecke2020-08-061-1/+2
| | | | | | | | | | * lang/cpp/src/editinteractor.cpp (EditInteractor::Private::Private): Use std::getenv. -- This should fix compiling on MacOS X GnuPG-Bug-Id: T5013
* qt: Port to new setExpire()Ingo Klöcker2020-08-051-18/+6
| | | | | | | | | | | | * lang/qt/src/qgpgmechangeexpiryjob.cpp (change_expiry): Use new setExpire() instead of edit() with GpgSetExpiryTimeEditInteractor -- Using the new setExpire() (which uses --quick-set-expire) is a lot less complex than using gpg's edit interface. It also feels faster. Next, I'll add support for changing the expiration time of subkeys. GnuPG-bug-id: 5003
* qt: Add test for setExpireIngo Klöcker2020-08-041-0/+54
| | | | | | | * lang/qt/tests/t-various.cpp (TestVarious::testSetExpire): New. -- GnuPG-bug-id: 5003
* cpp: Add support for gpgme_op_setexpireIngo Klöcker2020-08-043-1/+76
| | | | | | | | | | | | | | | | * lang/cpp/src/context.cpp (Context::setExpire, Context::startSetExpire): New. (Context::getLFSeparatedListOfFingerprintsFromSubkeys): New helper. * lang/cpp/src/context.h (Context::SetExpireFlags): New enum. (Context::setExpire, Context::startSetExpire): Add prototypes. (Context::getLFSeparatedListOfFingerprintsFromSubkeys): Add as private helper. -- GnuPG-bug-id: 5003
* cpp: Add ostream operator for subkeyIngo Klöcker2020-08-042-0/+23
| | | | | | | | * lang/cpp/src/key.cpp (Subkey): Add ostream operator. * lang/cpp/src/key.h: Update accordingly. -- This is helpful for debugging / showing the state of a subkey.
* core: New function gpgme_op_setexpire.Ingo Klöcker2020-08-0417-2/+308
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/genkey.c (setexpire): New. (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/engine.h, src/engine.c: (_gpgme_engine_op_setexpire): New. * src/engine-backend.h (engine_ops): Add 'setexpire' and adjust all engine initializers. * src/engine-gpg.c (gpg_setexpire): New. (_gpgme_engine_ops_gpg): Set setexpire to gpg_setexpire. * doc/gpgme.texi: Document new functions. * tests/run-genkey.c: Add option --setexpire. -- This extends GPGME to support the --quick-set-expire command added by GnuPG 2.1.22. This allows changing subkeys expiry date without going through the editinteractor interface. Co-authored-by: Andre Heinecke <[email protected]> GnuPG-bug-id: 4999
* Post release updatesWerner Koch2020-07-162-1/+4
| | | | --
* Release 1.14.0gpgme-1.14.0Werner Koch2020-07-162-9/+13
| | | | | | | * configure.ac: Bump LT versions to c=C34/A23/R0 cpp=C17/A11/R0 qt=C11/A4/R0. -- GnuPG-bug-id: 4996
* qt, cpp: Support export modesAndre Heinecke2020-07-166-14/+72
| | | | | | | | | | | | | * lang/cpp/context.cpp, lang/cpp/context.h (Context::startPublicKeyExport, Context::exportPublicKeys): Extend with flags paramenter. (Context::ExportMode): New. * lang/qt/src/exportjob.h (ExportJob::setExportMode): New. * lang/qt/src/qgpgmeexportjob.cpp, lang/qt/src/qgpgmeexportjob.h: Update accordingly. -- This adds the C++ and Qt API for export modes.
* core: Also allow GPGME_EXPORT_MODE_SSH for gpgme_op_export.Werner Koch2020-07-161-0/+1
| | | | | | | | | * src/export.c (export_start): Allow that mode. -- The test tools uses gpgme_op-export_ext and thus did not caught it. Signed-off-by: Werner Koch <[email protected]>
* core: New export mode to export as OpenSSH public key.Werner Koch2020-07-166-37/+97
| | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SSH): New. * src/export.c (export_ext_start): Allow for new mode. * src/engine-gpg.c (export_common): Implement. * tests/run-export.c (status_cb): New. (main): New options --status and --ssh. -- GnuPG-bug-id: 4310 Signed-off-by: Werner Koch <[email protected]>
* core: Deprecate the non-working trustlist functions.Werner Koch2020-07-1516-374/+17
| | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in: Clarify that the trustlist function should not be used. * src/engine.c (_gpgme_engine_op_trustlist): Always return an error. * src/engine-backend.h (struct engine_ops): Remove trustlist member. * src/engine-gpg.c (gpg_trustlist): Remove. (struct engine_ops): Remove that member. Also in all other engines. * tests/gpg/t-trustlist.c: Remove. * lang/python/tests/t-trustlist.py: Remove. -- This never worked in reality because the required feature has been removed from GnuPG version 1.3.2 soon after introduction of this feature in gpgme - 17 years ago. It was anyway marked as experimental. We keep the API and ABI, though. GnuPG-bug-id: 4834 Signed-off-by: Werner Koch <[email protected]>
* core: New keylist mode GPGME_KEYLIST_MODE_WITH_KEYGRIP.Werner Koch2020-07-1510-4/+33
| | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_KEYGRIP): New. * src/gpgme-json.c (op_keylist): New flag "keygrip". * src/engine-gpg.c (gpg_keylist_build_options): Pass the options. * lang/cpp/src/global.h (WithKeygrip): New. * lang/cpp/src/context.cpp: Add check. * lang/cpp/src/key.cpp (Key::update): Handle WithKeygrip. * lang/cpp/src/verificationresult.cpp: Ditto. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t): Ditto. -- GnuPG-bug-id: 4939 Signed-off-by: Werner Koch <[email protected]>
* python: Workaround for a regression in GnuPG 2.2.21Werner Koch2020-07-142-2/+16
| | | | | | | | | * lang/python/tests/support.py (is_gpg_version): New. * lang/python/tests/t-encrypt-sym.py: Add workaround. -- GnuPG-bug-id: 4991 Signed-off-by: Werner Koch <[email protected]>
* doc: Explain verify_result_t.status == 0 moreAndre Heinecke2020-06-091-2/+9
| | | | | | | | | | | | * doc/gpgme.texi (gpgme_verify_result_t): Explain GPGME_STATUS_NO_ERROR more clearly. -- This might help to avoid misunderstandings how the status can be interpreted and explains why a verify of unsigned PGP Data returns no error. As a reaction to CVE-2020-10759 discovered by Justin Steven.
* core: Fix setting of the chain_model signature result.Werner Koch2020-06-051-1/+1
| | | | | | | | | | | | | * src/verify.c (parse_trust): Fix detection of "chain" keyword. -- Fixes-commit: da6f3dc0c53f11f7432b3c258702db07d6c37f9a from 2007 shortly after introducing this. I doubt that this info has ever been used (it is for qualified signatures, which are only supported using the legacy German RegTP rules for them which were soon overturned by the commercial CAs). Signed-off-by: Werner Koch <[email protected]>
* tests: Remove/change tests for GnuPG 2.3 with no gpg.keyserver.NIIBE Yutaka2020-05-112-34/+4
| | | | | | | * lang/qt/tests/t-config.cpp (testKeyserver): Remove. * tests/gpg/t-gpgconf.c (main): Test with dirmngr.keyserver. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Explicitly link ws2_32Andre Heinecke2020-05-081-2/+3
| | | | | | | | | * src/Makefile.am (gpgme_w32_extra_libs): New. (libgpgme_la_LIBADD, libgpgme_glib_la_LIBADD): Use it. -- Since w32-io.c directly uses functions from ws2_32 it should not rely on libgpg-error to pull in this dependency.
* GPGME_CREATE_NOEXPIRE is only available since 1.9.0dupgit2020-05-081-1/+1
| | | | | | | | * doc/gpgme.texi: Fixes version number from 1.8.0 to 1.9.0 for GPGME_CREATE_NOEXPIRE. GnuPG-Bug-Id: T4922 Signed-off-by: dupgit <[email protected]>
* core: Make sure the keygrip is available in WITH_SECRET mode.Werner Koch2020-05-082-2/+6
| | | | | | | | | | | | | * src/engine-gpg.c (gpg_keylist_build_options): Send --with-keygrip if --with-secret is used. -- Since GnuPG 2.2.19 the keygrip was not anymore send if only --with-secret was used in a public key listing. Given that --with-secret requires computation of the keygrip anyway, there is no point in not requesting the keyrip in this case. GnuPG-bug-id: 4820
* tests, json: Do not check for keygrip of pubkeysAndre Heinecke2020-05-081-2/+0
| | | | | | | | | | | | | | | | | | | * tests/json/t-keylist-secret.out.json: Do not check for keygrip of bravo key. -- Since GnuPG 2.2.19 the keygrip is not emitted for public keys in a keylisting --with-secret. As the GPGME test suite should pass with several versions the json test cannot test this as the suite does not allow version checks for different output. What the intended behavior is might still be up for discussion, always adding --with-keygip is not a good solution because it slows down keylistings for large keyrings. GnuPG-Bug-Id: T4820
* tests: Add ECC key generation for tests/gpgsm.NIIBE Yutaka2020-03-272-33/+65
| | | | | | * tests/gpgsm/t-genkey.c (check_result): New. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Fix library dependency.NIIBE Yutaka2020-03-271-1/+1
| | | | | | | | | | | * src/Makefile.am (gpgme_tool_LDADD): Add @GPG_ERROR_LIBS@. -- Since gpgme-tool uses gpg_strerror, it should be linked to -lgpg-error. Signed-off-by: NIIBE Yutaka <[email protected]>
* core: New context flags "include-key-block" and "auto-key-import".Werner Koch2020-03-176-2/+92
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_ctx_flag): Add flags "include-key-block" and "auto-key-import". (gpgme_get_ctx_flag): Ditto. * src/context.h (struct gpgme_context): Add flags include_key_block and auto_key_import. * src/engine-gpg.c (struct engine_gpg): Likewise. (gpg_set_engine_flags): Set the flags for gpg versions >= 2.2.20. (gpg_decrypt): Set option according to the new flags. (gpg_encrypt): Ditto. (gpg_encrypt_sign): Ditto. (gpg_sign): Ditto. (gpg_verify): Ditto. tests/run-verify: Add option --auto-key-import. tests/run-sign: add option --include-key-block. -- GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* python: fix minor typo in howtoBernhard Reiter2020-03-031-1/+1
|
* qt: Change logging categoryaheinecke/json-testAndre Heinecke2020-02-1911-55/+58
| | | | | | | | | * lang/qt/src/*: Change logging category to macro to QGPGME_LOG. -- The old logging category macro had a typo and this way we are more consistent with other logging rules. For example you could write gpg.* in the logging conf.
* qt: Log execution args of gpg-cardAndre Heinecke2020-02-191-3/+5
| | | | * lang/qt/src/qgpgmegpgcardjob.cpp (do_work): Log call.
* python: Also detect python 3.9.Werner Koch2020-02-143-5/+5
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* qt: Add dummy context to make mixin happyAndre Heinecke2020-02-121-1/+2
| | | | | | * lang/qt/qgpgmegpgcardjob.cpp (QGpgMEGpgCardJob): Add context. -- Otherwise it fails with an assert.