aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cpp: Fix building with C++11Ingo Klöcker2022-08-191-7/+7
| | | | | | | | | | * lang/cpp/src/importresult.cpp (ImportResult::mergeWith): Replace 'auto' in lambdas with the actual type. -- Generic lambdas require C++14. GnuPG-bug-id: 6141
* qt,tests: Make test pass on 32-bit systemsIngo Klöcker2022-08-181-18/+24
| | | | | | | | | | | | | * lang/qt/tests/t-addexistingsubkey.cpp (AddExistingSubkeyJobTest::testAddExistingSubkeyWithExpiration): Handle negative expiration date. -- On 32-bit systems the expiration date of the test key overflows. This will cause the AddExistingSubkeyJob to fail. We expect it to fail with an "invalid time" error. GnuPG-bug-id: 6137
* cpp: Fix handling of "no key" or "invalid time" situationsIngo Klöcker2022-08-181-2/+2
| | | | | | | | | | | | * lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp (GpgAddExistingSubkeyEditInteractor::Private::nextState): Fix inverted logic of string comparisons. -- This fixes the problem that the interactor didn't return the proper error code if gpg didn't accept the key grip or the expiration date. GnuPG-bug-id: 6137
* qt,tests: Make sure expiration time is interpreted as unsigned numberIngo Klöcker2022-08-172-16/+16
| | | | | | | | | | | | | | * lang/qt/tests/t-addexistingsubkey.cpp, lang/qt/tests/t-changeexpiryjob.cpp: Convert expiration time to uint_least32_t. -- This doesn't change the outcome of the tests (they also pass without this change because of the expiration dates of the test keys), but it's still good practise to treat the expiration time as an unsigned number if the assertions check that the expiration time is in some range. GnuPG-bug-id: 6137
* qt,tests: Log the actual error code if the assertion failsIngo Klöcker2022-08-171-3/+3
| | | | | | | | | | | * lang/qt/tests/t-addexistingsubkey.cpp ( AddExistingSubkeyJobTest::testAddExistingSubkeyAsync, AddExistingSubkeyJobTest::testAddExistingSubkeySync, AddExistingSubkeyJobTest::testAddExistingSubkeyWithExpiration): Use QCOMPARE instead of QVERIFY for asserting equality. -- GnuPG-bug-id: 6137
* qt: Make sure expiration time is interpreted as unsigned numberIngo Klöcker2022-08-171-1/+2
| | | | | | | | | | | * lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp (add_subkey): Convert expiration time to uint_least32_t. -- This fixes the corresponding test on 32-bit systems where time_t (the return type of expirationTime()) is a signed 32-bit integer type. GnuPG-bug-id: 6137
* w32: Add another fallback to look for gpgconf.exeAndre Heinecke2022-08-121-2/+10
| | | | | | | | | | | | | | | | | * src/w32-util.c (_gpgme_get_gpgconf_path): Add fallback for GnuPG VS-Desktop install scheme. -- GnuPG VS-Desktop has the install layout: %PROGRAMFILES%\GnuPG VS-Desktop\bin\libgpgme.dll %PROGRAMFILES%\GnuPG VS-Desktop\GnuPG\bin\gpgconf.exe This fallback is of course only required if the registry string pointing to the correct install directory is broken. GnuPG-Bug-Id: T6131
* Qt: Fix working with no gpgconf in CryptoConfigAndre Heinecke2022-08-111-3/+4
| | | | | | | | | | | * lang/qt/src/cryptoconfig.cpp (CryptoConfig::entry): Add nullptr checks. -- This fixes a crash when gpgconf is not found. When every return value is NULL. GnuPG-Bug-Id: T6131
* Post release updatesWerner Koch2022-08-102-1/+5
| | | | --
* Release 1.18.0gpgme-1.18.0Werner Koch2022-08-102-17/+24
|
* tests: Make t-edit-sign more robust.Werner Koch2022-08-101-4/+2
| | | | | | | * tests/gpg/t-edit-sign.c (interact_fnc): Provide the default answer. -- A default answer to prompts should always be given.
* qt: Add missing includeIngo Klöcker2022-08-101-0/+1
| | | | | | | | * lang/qt/tests/t-revokekey.cpp: Include QDebug. -- Doesn't seem to matter with Qt 5.15.5, but seems to be needed for older versions of Qt.
* doc: Update NEWSIngo Klöcker2022-08-101-0/+11
| | | | | | -- GnuPG-bug-id: 5951, 6056
* qt: Add job to set the primary user ID of OpenPGP keysIngo Klöcker2022-08-0910-3/+410
| | | | | | | | | | | | | | | | * lang/qt/src/qgpgmesetprimaryuseridjob.cpp, lang/qt/src/qgpgmesetprimaryuseridjob.h, lang/qt/src/setprimaryuseridjob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function setPrimaryUserIDJob. * lang/qt/src/protocol_p.h (Protocol::setPrimaryUserIDJob): New. * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/t-setprimaryuserid.cpp: New. * lang/qt/tests/Makefile.am: Add new test. -- GnuPG-bug-id: 5938
* cpp: Add support for gpgme_op_set_uid_flagIngo Klöcker2022-08-093-0/+17
| | | | | | | | * lang/cpp/src/context.cpp, lang/cpp/src/context.h (Context::setPrimaryUid, Context::startSetPrimaryUid): New. -- GnuPG-bug-id: 5938
* python: Don't call __del__ from __exit__ method.NIIBE Yutaka2022-08-092-2/+5
| | | | | | | | | | | * lang/python/src/core.py (Context, Data): Don't call __del__ from __exit__ method, as the object may be still in use. * lang/python/tests/t-idiomatic.py: Fix the test. -- GnuPG-bug-id: 6060 Signed-off-by: NIIBE Yutaka <[email protected]>
* python: Don't access gpgme with wrapped=None.NIIBE Yutaka2022-08-051-0/+12
| | | | | | | | | | * lang/python/src/core.py (GpgmeWrapper, Context): Check self.wrapped is valid. -- GnuPG-bug-id: 6060 Signed-off-by: NIIBE Yutaka <[email protected]>
* python: Reset passphrase callback correctly.Jasper Spaans2022-08-051-8/+4
| | | | | | | | | | * lang/python/src/core.py (Context(GpgmeWrapper)): Reset passphrase callback correctly, for encrypt, decrypt, create_key, and create_subkey methods. -- Signed-off-by: Jasper Spaans <[email protected]>
* qt: Remove job for refreshing OpenPGP keysIngo Klöcker2022-08-048-303/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp, lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, lang/qt/src/refreshopenpgpkeysjob.h: Remove. * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. * lang/qt/src/protocol.h (class Protocol): Remove pure virtual member function refreshOpenPGPKeysJob. * lang/qt/src/protocol_p.h (Protocol::refreshOpenPGPKeysJob): Remove. * lang/qt/tests/run-refreshkeysjob.cpp (main): Use ReceiveKeysJob for OpenPGP keys. -- The RefreshOpenPGPKeysJob did more than it was intended to do, e.g. it imported new keys with the email addresses of the key to be refreshed via the configured auto-key-locate methods, but only a refresh from the key servers is wanted. For this we can use the ReceiveKeysJob. This commit mostly reverts the commits e12861f18c6b431b40bfa78eb6f1d149690a5fcd c64a8daf507a2216611861a12f312466b0bae8b2 The changes are source- and binary-compatible to the last release. GnuPG-bug-id: 5951
* build: Update config.guess and config.sub.NIIBE Yutaka2022-07-212-1951/+2316
| | | | | | | | | | * build-aux/config.guess: Update from upstream. * build-aux/config.sub: Ditto. -- GnuPG-bug-id: 6078 Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Fix for modern Autoconf.NIIBE Yutaka2022-07-211-5/+4
| | | | | | | | * m4/glib-2.0.m4: Use AC_RUN_IFELSE and AC_LINK_IFELSE. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* qt: Allow setting the file name of signed and encrypted dataIngo Klöcker2022-07-054-8/+82
| | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add signencryptjob.cpp. * lang/qt/src/signencryptjob.cpp: New. * lang/qt/src/signencryptjob.h (class SignEncryptJob): Add member functions setFileName, fileName. * lang/qt/src/qgpgmesignencryptjob.cpp (sign_encrypt): Set file name of input. (sign_encrypt_qba, QGpgMESignEncryptJob::exec, QGpgMESignEncryptJob::start): Pass file name to sign_encrypt resp. sign_encrypt_qba. -- This makes it possible to store the original name of a signed and encrypted file in the resulting data. GnuPG-bug-id: 6056
* qt: Allow setting the file name of encrypted dataIngo Klöcker2022-07-054-9/+84
| | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add encryptjob.cpp. * lang/qt/src/encryptjob.cpp: New. * lang/qt/src/encryptjob.h (class EncryptJob): Add member functions setFileName, fileName. * lang/qt/src/qgpgmeencryptjob.cpp (encrypt): Set file name of input. (encrypt_qba, QGpgMEEncryptJob::exec, QGpgMEEncryptJob::start): Pass file name to encrypt resp. encrypt_qba. -- This makes it possible to store the original name of an encrypted file in the encryption result. GnuPG-bug-id: 6056
* qt: Fix filename of cmake config files for w32Ingo Klöcker2022-07-041-1/+1
| | | | | | * lang/qt/src/Makefile.am (EXTRA_DIST): Add QGpgmeConfig-w32.cmake.in.in. --
* qt: Add #include <QStringList> needed for building against qt6Laurent Montel2022-07-044-7/+6
| | | | | | | | | | | * lang/qt/src/downloadjob.h, lang/qt/src/exportjob.h, lang/qt/src/keylistjob.h lang/qt/src/refreshkeysjob.h: in qt6 we need to use #include <QStringList> -- It fixes some compile qt6 compile error. Signed-off-by: Laurent Montel <[email protected]>
* cpp: Remove obsolete compatibility with KF5 variantsIngo Klöcker2022-06-302-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.
* build: When no gpg-error-config, not install gpgme-config.NIIBE Yutaka2022-06-282-0/+7
| | | | | | | | | | | | | | * configure.ac (USE_GPGRT_CONFIG): New. * src/Makefile.am [USE_GPGRT_CONFIG]: Conditionalize the install of gpgme-config. -- When system will migrate use of gpgrt-config and removal of gpg-error-config, gpgme-config will not be installed (but use gpgme.pc by gpgrt-config). Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Update gpg-error.m4NIIBE Yutaka2022-06-281-1/+2
| | | | | | | | * m4/gpg-error.m4: Update from libgpg-error. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Add support for clear text signatures to test runnerIngo Klöcker2022-06-141-0/+6
| | | | | | | | * tests/run-sign.c (show_usage): Add new argument "--clear". (main): Handle new argument "--clear". -- GnuPG-bug-id: 6028
* qt,tests: Allow 1-day-offset for expiration dateIngo Klöcker2022-06-101-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
* qt: Prevent u32 overflow when calculating expiration dateIngo Klöcker2022-06-103-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
* Revert "tests: Avoid problems with local time across a day boundary."Ingo Klöcker2022-06-092-2/+2
| | | | This reverts commit 5ba0e454a37c9b0d3badddfc2dad8bcc7c7af874.
* core: Handle import status lines during keylist operationIngo Klöcker2022-06-091-0/+4
| | | | | | | | | | | | * src/keylist.c (gpgme_op_keylist_from_data_start): Call _gpgme_op_import_init_result. -- This fixes a crash when importing keys from data. Initializing the import result was missing for this keylist operation. Fixes-commit: f3ca57dfd7af19f9b2fd01616a81dc889707a4d3 GnuPG-bug-id: 5951
* tests: Avoid problems with local time across a day boundary.Werner Koch2022-05-232-2/+2
| | | | | | -- GnuPG-bug-id: 5991
* cpp: Export KeyListModeSaverAndre Heinecke2022-05-121-1/+1
| | | | | | | * lang/cpp/src/context.h (Context::KeyListModeSaver): Add Export. -- This is required for Windows.
* core: Set SECRET flag of subkeys stored on smart cardsIngo Klöcker2022-05-061-0/+1
| | | | | | | | | | | | | * src/keylist.c (parse_sec_field15): Set SECRET flag. -- Explicitly setting the SECRET flag for subkeys stored on smart cards makes sure that the flag is also set if GPGME_KEYLIST_MODE_WITH_SECRET is used when listing OpenPGP keys (as documented in the API documentation). If secret keys are listed, then the flag is already set when the packet type is parsed. GnuPG-bug-id: 5965
* cpp: Output more properties of a subkeyIngo Klöcker2022-05-051-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
* cpp,tests: Actually parse the --with-secret optionIngo Klöcker2022-05-051-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
* qt: Revert change of result signal of RefreshKeysJobIngo Klöcker2022-05-052-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
* qt: Use lambda instead of std::bindIngo Klöcker2022-05-051-1/+1
| | | | | | | | | * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (QGpgMERefreshOpenPGPKeysJob::start): Replace std::bind call with a lambda. -- GnuPG-bug-id: 5951
* qt: Emit import result when refreshing OpenPGP keysIngo Klöcker2022-05-048-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
* cpp: Allow retrieving import result of key listing with locate modeIngo Klöcker2022-05-042-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
* core: Handle import status lines during keylist operationIngo Klöcker2022-05-043-23/+55
| | | | | | | | | | | | | | | | | | | | | | * src/import.c (import_status_handler): Rename to ... (_gpgme_import_status_handler): this. Make non-static. (_gpgme_op_import_init_result): New. (_gpgme_op_import_start, _gpgme_op_import_keys_start, _gpgme_op_receive_keys_start): Call _gpgme_op_import_init_result. * src/keylist.c (keylist_status_handler): Call _gpgme_import_status_handler to handle import status lines. (gpgme_op_keylist_start, gpgme_op_keylist_ext_start): Call _gpgme_op_import_init_result. * src/ops.h (_gpgme_op_import_init_result, _gpgme_import_status_handler): New prototypes. -- If a keylist operation with keylist mode GPGME_KEYLIST_MODE_LOCATE is run, then gpg emits import status lines. Handling those status lines allows users to retrieve the result of a --locate-(external)-keys command. GnuPG-bug-id: 5951
* cpp: Allow merging the results of two importsIngo Klöcker2022-05-042-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
* qt: Apply compiler hintIngo Klöcker2022-05-021-1/+1
| | | | | | * lang/qt/tests/t-verify.cpp (VerifyTest::testSignatureKey): Use reference type to prevent copying. --
* qt: Use GpgME::Locate aliasIngo Klöcker2022-05-022-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. --
* qt: Add job for refreshing OpenPGP keysIngo Klöcker2022-05-025-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
* cpp: Add RAII class for saving/restoring the key list modeIngo Klöcker2022-05-022-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
* qt: Add debug helper for Result classes with output stream operatorIngo Klöcker2022-05-021-0/+9
| | | | | | | * lang/qt/src/util.h (toLogString): New. -- GnuPG-bug-id: 5951
* qt: Factor out helper for getting the fingerprints of some keysIngo Klöcker2022-05-023-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