aboutsummaryrefslogtreecommitdiffstats
path: root/lang (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-01-04cpp: Add const-overload of UserID::Signature::operator<Ingo Klöcker2-1/+9
lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<): Add const-overload. Deprecate non-const overload. -- This fixes compilation on FreeBSD with clang 10.
2021-01-04Qt: Undeprecate QByteArray based start functsAndre Heinecke2-2/+2
* lang/qt/src/encryptjob.h, lang/qt/src/signjob.h (start): Undeprecate QByteArray based functions. -- While the QIODevice access might avoid a copy it is more difficult to manage the data and lifetime of the QIODevices in calling code. The QByteArray calls are convienient for small data objects like mails where an in memory copy is not really expensive anymore.
2020-12-03python: Fix key_export*.NIIBE Yutaka1-3/+3
* lang/python/src/core.py (key_export): Just raise an error. (key_export_minimal, key_export_secret): Ditto. -- GnuPG-bug-id: 5149 Fixes-commit: 7faef33d13fa8efce152ca7aa6e9d39030c1cf08 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-11-20Revert "cpp: Use portable off_t size_t"Andre Heinecke5-9/+149
This reverts commit 88294023c196497cfa6737be262c8b0c09d2a3ce. -- This commit was too early and i needed to test more this is breaking more then it helps so for now revert it before we can do a proper solution.
2020-11-18cpp: Use portable off_t size_tAndre Heinecke5-149/+9
* configure.ac: Configure cpp data.h.in * lang/cpp/src/Makefile.am: Generate data.h * lang/cpp/src/data.cpp, lang/cpp/src/data.h: Use portable types. * lang/qt/src/Makefile.am: Include build dir. * lang/qt/tests/makefile.am: Include build dir. -- These kind of patches have been around for a while, IMO this should not create an ABI incompatbility for cases where it already works because the types should be the same so I think this is not an interface break. GnuPG-Bug-Id: T3996
2020-11-18qt: Avoid empty "[email protected]" signature notationsIngo Klöcker1-1/+1
* lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Check remark for being an empty string instead of a null QString. -- GnuPG-bug-id: 5142 Co-authored-by: Daniel Kahn Gillmor
2020-11-12qt: Fix export of qDebug GpgME::Error overloadAndre Heinecke1-0/+1
* lang/qt/src/debug.cpp: Include debug.h to get the export decl.
2020-11-12python: Fix a test for newer GnuPG (>= 2.3).NIIBE Yutaka1-1/+2
* lang/python/tests/t-quick-subkey-creation.py: Specify RSA. -- Using GnuPG 2.3, a key with default (ed25519/cv25519) cannot have some combination of capabilities (e.g., "encr auth"). Signed-off-by: NIIBE Yutaka <[email protected]>
2020-11-11qt: Add export macro for QDebug operatorAndre Heinecke1-1/+3
* lang/qt/src/debug.h: Add export macro. -- This is public API so it should be exported. This did not resolve a link issue for Windows that I've experienced when building. But this might be to some uncleanlyness in my build environment.
2020-11-11qt: Allow build with older GnuPG (< 2.2.18).NIIBE Yutaka1-1/+4
* lang/qt/tests/t-remarks.cpp (initTestCase): Check gpg for allow-weak-key-signatures option. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-11-03qt: Make audit parameters of result signal optionalIngo Klöcker1-1/+1
lang/qt/src/quickjob.h (QuickJob::result): Make parameters auditLogAsHtml and audigLogError optional. -- This aligns the signature of QuickJob's result signal with the result signals of the other Job subclasses. GnuPG-bug-id: 5094
2020-11-03cpp: Mark helper functions as staticIngo Klöcker1-6/+6
lang/cpp/src/key.cpp (find_subkey, verify_subkey, find_uid, verify_uid, find_signature, verify_signature): Mark as static.
2020-11-03cpp: Make signatures belonging to the same user ID sortableIngo Klöcker2-1/+63
lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<): New. lang/cpp/src/key.cpp (signature_index): New. -- operator< defines a canonical sort order for signatures belonging to the same user ID. It is based on the sort order defined by cmp_signodes() in g10/keylist.c of gnupg. In particular, the ordering of signatures made with the same key by creation time allows to see easily whether the most recent signature is a certification or a revocation. GnuPG-bug-id: 5094 recent
2020-10-29qt: Add support for revoke signature quick commandIngo Klöcker3-2/+38
* lang/qt/src/quickjob.h (QuickJob::startRevokeSignature): New. * lang/qt/src/qgpgmequickjob.h, lang/qt/src/qgpgmequickjob.cpp (QGpgMEQuickJob::startRevokeSignature): New. * lang/qt/src/qgpgmequickjob.cpp (revokeSignatureWorker): New. -- GnuPG-bug-id: 5094
2020-10-29qt: Some minor cleanupsIngo Klöcker1-13/+3
* lang/qt/src/qgpgmequickjob.h: (GpgME::Key, QDateTime, QString): Remove superfluous forward declarations. (QGpgMEQuickJob): Remove superfluous second template argument. It is identical to the default. (QGpgMEQuickJob::result): Remove. It is already defined in the base class.
2020-10-29cpp: Add support for gpgme_op_revsigIngo Klöcker2-12/+57
* 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
2020-10-27python: Handle the when case __doc__ is None.NIIBE Yutaka1-1/+6
* lang/python/src/core.py (GpgmeWrapper): Check if None. -- GnuPG-bug-id: 5075 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-10-23cpp: Add support for gpgme_cancelIngo Klöcker2-0/+6
* 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
2020-10-23Add Assuan transaction that forwards status lines to another objectIngo Klöcker4-1/+164
* 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
2020-10-23qt: Add QDebug stream operator for GpgME::ErrorIngo Klöcker3-1/+99
* 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.
2020-10-23cpp, qt: Add missing comparison operators for version info comparisonIngo Klöcker2-0/+62
* 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
2020-10-23cpp, qt: Fix version info comparisonIngo Klöcker2-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.
2020-09-08qt: Update the documentation of ListAllKeysJobIngo Klöcker1-2/+3
* lang/qt/src/listallkeysjob.h (ListAllKeysJob::start): Document that the mergeKeys argument is ignored with gpg >= 2.1. -- GnuPG-bug-id: 4794
2020-09-08cpp: Update key with --with-secret instead of updating it twiceIngo Klöcker1-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
2020-09-07qt: List keys once with --with-secret instead of twiceIngo Klöcker2-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
2020-09-07cpp: Add keylist mode WithSecretIngo Klöcker3-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
2020-09-07cpp: Add missing keylist modesIngo Klöcker1-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.
2020-09-03cpp: Copy some more subkey properties when merging keysIngo Klöcker1-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
2020-08-28qt: Fix an rfc2253 parser flawWerner Koch1-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
2020-08-14core: Add error handling to setexpireIngo Klöcker1-0/+9
* 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
2020-08-11qt: Support changing expiry of subkeysIngo Klöcker3-4/+39
* 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
2020-08-10cpp: Make private helper a file staticIngo Klöcker2-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
2020-08-06cpp: Use cstdlib getenv for portabilityAndre Heinecke1-1/+2
* lang/cpp/src/editinteractor.cpp (EditInteractor::Private::Private): Use std::getenv. -- This should fix compiling on MacOS X GnuPG-Bug-Id: T5013
2020-08-05qt: Port to new setExpire()Ingo Klöcker1-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
2020-08-04qt: Add test for setExpireIngo Klöcker1-0/+54
* lang/qt/tests/t-various.cpp (TestVarious::testSetExpire): New. -- GnuPG-bug-id: 5003
2020-08-04cpp: Add support for gpgme_op_setexpireIngo Klöcker2-1/+72
* 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
2020-08-04cpp: Add ostream operator for subkeyIngo Klöcker2-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.
2020-07-16qt, cpp: Support export modesAndre Heinecke5-14/+68
* 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.
2020-07-15core: Deprecate the non-working trustlist functions.Werner Koch2-47/+0
* 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]>
2020-07-15core: New keylist mode GPGME_KEYLIST_MODE_WITH_KEYGRIP.Werner Koch5-3/+10
* 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]>
2020-07-14python: Workaround for a regression in GnuPG 2.2.21Werner Koch2-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]>
2020-05-11tests: Remove/change tests for GnuPG 2.3 with no gpg.keyserver.NIIBE Yutaka1-30/+0
* 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]>
2020-03-03python: fix minor typo in howtoBernhard Reiter1-1/+1
2020-02-19qt: Change logging categoryaheinecke/json-testAndre Heinecke10-55/+55
* 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.
2020-02-19qt: Log execution args of gpg-cardAndre Heinecke1-3/+5
* lang/qt/src/qgpgmegpgcardjob.cpp (do_work): Log call.
2020-02-14python: Also detect python 3.9.Werner Koch1-2/+2
-- Signed-off-by: Werner Koch <[email protected]>
2020-02-12qt: Add dummy context to make mixin happyAndre Heinecke1-1/+2
* lang/qt/qgpgmegpgcardjob.cpp (QGpgMEGpgCardJob): Add context. -- Otherwise it fails with an assert.
2020-02-12qt: Add GpgCardJob following the job patternAndre Heinecke8-2/+319
* lang/qt/src/Makefile.am: Add new files. * lang/qt/src/job.cpp (GpgCardJob): Add impl stuff. * lang/qt/src/protocol.h (gpgCardJob): Get one. * lang/qt/src/qgpgmebackend.cpp, lang/qt/src/qgpgmebackend.h: Add helpers to get the job. * lang/qt/src/qgpgmegpgcardjob.cpp, lang/qt/src/gpgcardjob.h, lang/qt/src/qgpgmegpgcardjob.h: New. -- This is annoyingly complex to add a simple new job. In the future we should implement something like this without the threadedjobmixin stuff. But the idea was to follow the usual job pattern. GnuPG-Bug-Id: T4794
2019-12-13cpp, qt: Use uidhash to select uids for signingAndre Heinecke5-1/+24
* lang/cpp/src/gpgsignkeyeditinteractor.cpp (action): Use uidhash instead of number. (GpgSignKeyEditInteractor::setKey): New. * lang/cpp/src/gpgsignkeyeditinteractor.h: Update accordingly. * lang/cpp/src/key.h, lang/cpp/src/key.cpp: Wrap uidhash. * lang/qt/src/qgpgmesignkeyjob.cpp: Set the key. -- Using the uidhash avoids problems when the user ids on --edit-key are different ones then the uids captured by gpgme when listing keys. Or if they are in a different order. This can happen with cached keys or keys with user attributes.
2019-11-07qt,tests: Take care for old DSA key using deprecated digest algo.NIIBE Yutaka1-0/+4
* lang/qt/tests/t-remarks.cpp (initTestCase): Supply allow-weak-key-signatures flag for GnuPG 2.3, which normally rejects use of SHA1 digest. Signed-off-by: NIIBE Yutaka <[email protected]>