aboutsummaryrefslogtreecommitdiffstats
path: root/lang (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-06-30cpp: Remove obsolete compatibility with KF5 variantsIngo Klöcker2-8/+0
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in, lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove find_package() call. -- The KF5 variants have been removed years ago with revision a3cf30f89418c8a6bc9456533d95ba7fc2a33a4c.
2022-06-10qt,tests: Allow 1-day-offset for expiration dateIngo Klöcker1-1/+9
* lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration): Assert that the expiration date is either 2106-02-05 or 2106-02-04. -- This avoids a test failure if the test is run at 00:xx:xx in a location that uses DST. GnuPG-bug-id: 5991
2022-06-10qt: Prevent u32 overflow when calculating expiration dateIngo Klöcker3-7/+5
* lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Change maxAllowedDate to 2106-02-05. Change log-level from warning to debug. * lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration): Remove check for warning. Adapt assertion. -- Capping the expiration date at 2106-02-05 prevents a u32 overflow when adding the number of days until the maximal date to the current time. GnuPG-bug-id: 5991
2022-06-09Revert "tests: Avoid problems with local time across a day boundary."Ingo Klöcker1-1/+1
This reverts commit 5ba0e454a37c9b0d3badddfc2dad8bcc7c7af874.
2022-05-23tests: Avoid problems with local time across a day boundary.Werner Koch1-1/+1
-- GnuPG-bug-id: 5991
2022-05-12cpp: Export KeyListModeSaverAndre Heinecke1-1/+1
* lang/cpp/src/context.h (Context::KeyListModeSaver): Add Export. -- This is required for Windows.
2022-05-05cpp: Output more properties of a subkeyIngo Klöcker1-3/+9
* lang/cpp/src/key.cpp (ostream operator<< for Subkey): Fix wrong output of isInvalid and isDisabled flags. Add output of key grip, card serial number and the flags isSecret, isQualified, isDeVs, and isCardKey. -- This makes it easier to check those properties for different keys, e.g. with the run-keylist test program. GnuPG-bug-id: 5965
2022-05-05cpp,tests: Actually parse the --with-secret optionIngo Klöcker1-0/+4
* lang/cpp/tests/run-keylist.cpp (main): Handle --with-secret option. Print error for unknown option. -- The --with-secret option was already listed in the help. Now it also works. GnuPG-bug-id: 5965
2022-05-05qt: Revert change of result signal of RefreshKeysJobIngo Klöcker2-2/+2
* lang/qt/src/refreshkeysjob.h (RefreshKeysJob::result): Remove optional parameters auditLogAsHtml and auditLogError. * lang/qt/tests/run-refreshkeysjob.cpp (main): Update accordingly. -- This reverts f4c35609257156d0e32b8dd7315011b484919f05. The reason for the previous change does no longer apply. GnuPG-bug-id: 5951
2022-05-05qt: Use lambda instead of std::bindIngo Klöcker1-1/+1
* lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (QGpgMERefreshOpenPGPKeysJob::start): Replace std::bind call with a lambda. -- GnuPG-bug-id: 5951
2022-05-04qt: Emit import result when refreshing OpenPGP keysIngo Klöcker8-43/+149
* lang/qt/src/refreshopenpgpkeysjob.h: New. * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h (class QGpgMERefreshOpenPGPKeysJob): Derive from RefreshOpenPGPKeysJob with result ImportResult. Remove unused start overload. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (locate_external_keys): Ignore result of KeyListJob. Return import result. (receive_keys): Return import result. (refresh_keys): Merge the two import results and return the result. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function refreshOpenPGPKeysJob. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Return nullptr for OpenPGP protocol. (Protocol::refreshOpenPGPKeysJob): New. * lang/qt/tests/run-refreshkeysjob.cpp (main): Use appropriate job for the protocol of the key to refresh. -- This adds RefreshOpenPGPKeysJob complementing RefreshKeysJob (for S/MIME keys). Changing the result type of RefreshKeysJob would break the ABI. Therefore we have to introduce a new base class for the refresh job for OpenPGP. We derive this base class from AbstractImportJob because we want to return an import result. GnuPG-bug-id: 5951
2022-05-04cpp: Allow retrieving import result of key listing with locate modeIngo Klöcker2-3/+10
* lang/cpp/src/context_p.h (enum Context::Private::Operation): Add value KeyListWithImport. * lang/cpp/src/context.cpp (Context::startKeyListing, Context::nextKey): Set lastop to KeyListWithImport if keylist mode includes Locate. -- Adding Import to lastop for keylist operations that perform a locate allows retrieving the import result with Context::importResult. GnuPG-bug-id: 5951
2022-05-04cpp: Allow merging the results of two importsIngo Klöcker2-0/+135
* lang/cpp/src/importresult.h, lang/cpp/src/importresult.cpp (class ImportResult): Add member function mergeWith. -- This allows creating a consolidated result of several independent imports. If the import results to merge considered the same keys, then not all counts can be consolidated correctly, but the important numbers like the number of considered keys, the number of imported keys, the number of unchanged keys and the numbers of new user IDs, subkeys, signatures and revocations should be correct. GnuPG-bug-id: 5951
2022-05-02qt: Apply compiler hintIngo Klöcker1-1/+1
* lang/qt/tests/t-verify.cpp (VerifyTest::testSignatureKey): Use reference type to prevent copying. --
2022-05-02qt: Use GpgME::Locate aliasIngo Klöcker2-2/+2
* lang/qt/src/protocol_p.h (Protocol::locateKeysJob): Use Locate alias instead of Extern|Local. * lang/qt/src/qgpgmekeyformailboxjob.cpp (do_work): Ditto. --
2022-05-02qt: Add job for refreshing OpenPGP keysIngo Klöcker5-4/+218
* lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp: New. * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Add support for OpenPGP protocol. -- The new job performs a --locate-external-keys for the email addresses of all not revoked user IDs of the given keys, and it performs a --recv-keys for the fingerprints of the given keys. The former may import new keys from WKD or an LDAP server or via some other (hopefully trusted) auto-key-locate mechanism. GnuPG-bug-id: 5951
2022-05-02cpp: Add RAII class for saving/restoring the key list modeIngo Klöcker2-0/+24
* lang/cpp/src/context.h, lang/cpp/src/context.cpp (class Context): Add nested class KeyListModeSaver. -- This RAII-style class can be used to save the currently used key list mode in case it needs to be changed temporarily. On destruction, it will restore the key list mode that was active at construction time. GnuPG-bug-id: 5951
2022-05-02qt: Add debug helper for Result classes with output stream operatorIngo Klöcker1-0/+9
* lang/qt/src/util.h (toLogString): New. -- GnuPG-bug-id: 5951
2022-05-02qt: Factor out helper for getting the fingerprints of some keysIngo Klöcker3-6/+23
* lang/qt/src/util.h, lang/qt/src/util.cpp (toFingerprints): New. * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use the helper. -- GnuPG-bug-id: 5951
2022-05-02qt,doc: Fix some API documentationIngo Klöcker4-27/+5
-- Fix or remove API documentation that has been copied and pasted from other jobs.
2022-04-29qt: Fix connection to readyReadStandardOutput signalIngo Klöcker2-10/+6
* lang/qt/src/qgpgmerefreshsmimekeysjob.h, lang/qt/src/qgpgmerefreshsmimekeysjob.cpp (QGpgMERefreshSMIMEKeysJob::slotStderr): Remove. * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp (QGpgMERefreshSMIMEKeysJob::startAProcess): Handle readyReadStandardOutput and readyReadStandardError signals with lambdas. -- For now output stdout and stderr of gpgsm process as debug log. In particular, this "adds" the missing slot slotStdout. GnuPG-bug-id: 5951
2022-04-29qt: Add test runner for refresh jobIngo Klöcker2-1/+140
* lang/qt/tests/run-refreshkeysjob.cpp: New. * lang/qt/tests/Makefile.am (run_refreshkeysjob_SOURCES): New. (noinst_PROGRAMS): Add new build artifact. -- GnuPG-bug-id: 5951
2022-04-29qt: Make RefreshKeysJob result compatible with standard job resultIngo Klöcker1-1/+1
* lang/qt/src/refreshkeysjob.h (RefreshKeysJob::result): Add optional parameters auditLogAsHtml and auditLogError. -- This is necessary for the OpenPGP-implementation of this job. GnuPG-bug-id: 5951
2022-04-29qt: Allow refreshing a list of keysIngo Klöcker3-7/+38
* lang/qt/src/refreshkeysjob.h (class RefreshKeysJob): Add pure virtual member function start taking a list of keys. * lang/qt/src/qgpgmerefreshsmimekeysjob.h, lang/qt/src/qgpgmerefreshsmimekeysjob.cpp (class QGpgMERefreshSMIMEKeysJob): Implement new member function. -- The new overload makes it easier to refresh some keys if one does already have Keys. GnuPG-bug-id: 5951
2022-04-29qt: Minor refactoringIngo Klöcker1-8/+10
* lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use namespace QGpgME. -- GnuPG-bug-id: 5951
2022-04-29qt: Rename QGpgMERefreshKeysJob to QGpgMERefreshSMIMEKeysJobIngo Klöcker4-24/+24
* lang/qt/src/qgpgmerefreshkeysjob.h, lang/qt/src/qgpgmerefreshkeysjob.cpp: Change name to * lang/qt/src/qgpgmerefreshsmimekeysjob.h, lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: ... this, and adapt the include guard. (class QGpgMERefreshKeysJob): Rename to QGpgMERefreshSMIMEKeysJob. * lang/qt/src/Makefile.am: Adapt mentioned file names accordingly. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Use renamed class. -- To avoid confusion with a similar job for OpenPGP keys with a completely different implementation, we rename this class to make clear that it is specific for S/MIME keys. GnuPG-bug-id: 5951
2022-04-28cpp,tests: Verify that requested keylist mode is usedIngo Klöcker2-0/+12
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp (main): Check used keylist mode. -- Since Context::setKeyListMode() does not return the error returned by gpgme, we need to verify explicitly that the keylist mode was set successfully. GnuPG-bug-id: 5951
2022-04-27cpp: Support new keylist modesIngo Klöcker5-13/+34
* lang/cpp/src/global.h (ForceExtern, LocateExternal, KeyListModeMask): New. * lang/cpp/src/context.cpp (operator<<): Add check. * lang/cpp/src/util.h (gpgme_keylist_mode_t, convert_from_gpgme_keylist_mode_t): Handle ForceExtern. * lang/cpp/tests/run-getkey.cpp (show_usage, main): Add arguments --force-extern and --locate-external. * lang/cpp/tests/run-keylist.cpp (show_usage, main): Ditto. -- GnuPG-bug-id: 5951
2022-04-25qt: Rely on the bad passphrase error reported by gpgIngo Klöcker1-17/+2
* lang/qt/src/qgpgmedecryptverifyjob.cpp (patch_decryption_result): Removed. (decrypt_verify): Remove usage of patch_decryption_result. -- This reverts most of revision d8e5871dca9425811873058150677a158235613d. GnuPG-bug-id: 5939
2022-04-22qt: Report better error if decryption failed because of bad passphraseIngo Klöcker1-7/+20
* lang/qt/src/qgpgmedecryptverifyjob.cpp (patch_decryption_result): New. (decrypt_verify): Call patch_decryption_result. -- Replace the generic "decryption failed" error with the more specific "bad passphrase" error if the audit log indicates that a wrong symmetric password caused the decryption to fail. GnuPG-bug-id: 5939
2022-04-22cpp: Allow changing the error of a resultIngo Klöcker1-0/+8
* lang/cpp/src/result.h (class Result): Add member function setError. -- This can be used to replace the error of a result with a more suitable error. GnuPG-bug-id: 5939
2022-04-05qt,doc: Fix typo and grammar in API documentationIngo Klöcker1-5/+2
--
2022-04-05cpp: Handle canceling of an edit operationIngo Klöcker1-2/+2
* lang/cpp/src/editinteractor.cpp (CallbackHelper::edit_interactor_callback_impl): Check for error _or_ canceled state. -- Without this canceling an edit operation resulted in a "General error". GnuPG-bug-id: 5904
2022-04-05cpp: Return actual error if revocation failsIngo Klöcker3-0/+22
* lang/cpp/src/editinteractor.cpp, lang/cpp/src/editinteractor.h (EditInteractor::parseStatusError): New. * lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState): Handle status error. -- With this change the interactor returns a proper error like "Bad Passphrase" or "Empty Passphrase" instead of an unspecific "General Error" if a status error occurred. GnuPG-bug-id: 5904
2022-04-05cpp: Add internal utility function for splitting stringsIngo Klöcker1-0/+13
* lang/cpp/src/util.h (split): New. -- This function splits a given string using the given delimiter into several strings. GnuPG-bug-id: 5904
2022-04-05cpp: Do not export symbols of the Private classIngo Klöcker1-1/+1
* lang/cpp/src/gpgrevokekeyeditinteractor.h (class GpgRevokeKeyEditInteractor): Mark nested class Private as hidden. -- GnuPG-bug-id: 5904
2022-03-31qt: Check arguments passed to the revoke key jobIngo Klöcker2-5/+98
* lang/qt/src/qgpgmerevokekeyjob.cpp (check_arguments): New. (QGpgMERevokeKeyJob::start, QGpgMERevokeKeyJob::exec): Call check_arguments. * lang/qt/tests/t-revokekey.cpp (RevokeKeyJobTest): Add member functions testErrorHandling_nullKey, testErrorHandling_invalidReason, testErrorHandling_invalidDescription. -- Check that the key is not a null key, that the reason has a valid value, and that the description lines do not contain endline characters and are not empty. GnuPG-bug-id: 5904
2022-03-30qt,tests: Verify reason code and description of revocationIngo Klöcker1-0/+66
* lang/qt/tests/t-revokekey.cpp (RevokeKeyJobTest::testRevokeKeyAsync, RevokeKeyJobTest::testRevokeKeySync_noReasonDescription, RevokeKeyJobTest::testRevokeKeySync_oneLineReasonDescription, RevokeKeyJobTest::testRevokeKeySync_twoLinesReasonDescription): Call verifyReason. (class RevokeKeyJobTest): Add private member function verifyReason. -- gpgme doesn't parse the information, so we run gpg manually to verify the revocation reason and the description. GnuPG-bug-id: 5904
2022-03-30qt: Add job to revoke own OpenPGP keysIngo Klöcker9-4/+492
* lang/qt/src/revokekeyjob.h, lang/qt/src/qgpgmerevokekeyjob.h, lang/qt/src/qgpgmerevokekeyjob.cpp: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function revokeKeyJob. * lang/qt/src/protocol_p.h (Protocol::revokeKeyJob): New. * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/Makefile.am (the_tests, moc_files, noinst_PROGRAMS): Add new test. (t_revokekey_SOURCES): New. * lang/qt/tests/t-revokekey.cpp: New. -- The new job allows revoking own OpenPGP keys as with the "revkey" edit-key command of gpg. GnuPG-bug-id: 5904
2022-03-30cpp: Add interactor to revoke a keyIngo Klöcker4-0/+283
* lang/cpp/src/global.h (enum class RevocationReason): New. * lang/cpp/src/gpgrevokekeyeditinteractor.cpp, lang/cpp/src/gpgrevokekeyeditinteractor.h: New. * lang/cpp/src/Makefile.am: Add new files. -- GnuPG-bug-id: 5904
2022-03-28cpp: Set default visibility of all symbols to hiddenIngo Klöcker1-1/+2
* configure.ac: Add -fvisibility=hidden to GPGME_CPP_CFLAGS if gcc supports the flag. * lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add GPGME_CPP_CFLAGS. * m4/ax_gcc_func_attribute.m4: New. -- With this change all defined symbols are hidden by default, so that they are not exported anymore. All symbols that are part of the ABI and that shall still be exported are already marked as having default visibility. The m4 macro was taken from the website mentioned in the License header of the file. GnuPG-bug-id: 5906
2022-03-28cpp: Put local helper function into unnamed namespaceIngo Klöcker1-0/+2
lang/cpp/src/context.cpp (to_auditlog_flags): Wrap in unnamed namespace. -- GnuPG-bug-id: 5906
2022-03-07qt: Add missing include of config.hIngo Klöcker1-0/+4
* lang/qt/src/util.cpp: Include config.h. -- GnuPG-bug-id: 5871
2022-03-07qt,doc: Remove comments about throwing exceptionsIngo Klöcker7-17/+0
-- The jobs do not throw GpgME::Exception anymore since a long time.
2022-02-17qt: Fix ABI compatibility with 1.16.0Ingo Klöcker1-6/+7
* lang/qt/src/protocol.h (class Protocol): Move new virtual methods to the end of the class. -- This makes the vtable offsets of the old virtual methods match those in 1.16.0 again. GnuPG-bug-id: 5834
2022-02-07qt: Fix build for older Qt versions.Werner Koch1-0/+1
* lang/qt/src/util.cpp: Include <functional>.
2022-02-03qt: Add job to import keys given by key idsIngo Klöcker9-1/+316
* lang/qt/src/receivekeysjob.h, lang/qt/src/qgpgmereceivekeysjob.h, lang/qt/src/qgpgmereceivekeysjob.cpp: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function receiveKeysJob. * lang/qt/src/protocol_p.h (Protocol::receiveKeysJob): Implement it. * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/run-receivekeysjob.cpp: New. * lang/qt/tests/Makefile.am: Add new test runner. -- This job allows importing keys that are given by their key ids (or fingerprints) from keyservers as with gpg's recv-keys command. GnuPG-bug-id: 5808
2022-02-03qt: Add helper for converting QStringList to vector of stringsIngo Klöcker3-2/+101
* lang/qt/src/util.h, lang/qt/src/util.cpp: New. * lang/qt/src/Makefile.am (qgpgme_sources, private_qgpgme_headers): Add new files. -- Additionally to the internal helper function toStrings(), this adds a copy of the internal make_error helper of GpgME++ which is used in a few places by QGpgME. We use the same error source id as GpgME++. GnuPG-bug-id: 5808
2022-02-03cpp: Allow import of keys given by key idsIngo Klöcker2-0/+20
* lang/cpp/src/context.h (class Context): Add overloads of member functions importKeys and startKeyImport * lang/cpp/src/context.cpp (class Context): ... and implement them. -- GnuPG-bug-id: 5808
2022-02-03cpp: Add internal adapter for passing a vector of strings to gpgmeIngo Klöcker3-2/+73
* lang/cpp/src/util.h (class StringsToCStrings): New. * lang/cpp/src/util.cpp: New. * lang/cpp/src/Makefile.am: Add new file. -- This adapter simplifies passing a vector of strings as NULL-terminated array of const char* to the C-interface of gpgme. GnuPG-bug-id: 5808