aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* qt,doc: Fix some API documentationIngo Klöcker2022-05-024-27/+5
| | | | | | | -- Fix or remove API documentation that has been copied and pasted from other jobs.
* qt: Fix connection to readyReadStandardOutput signalIngo Klöcker2022-04-292-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
* qt: Add test runner for refresh jobIngo Klöcker2022-04-292-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
* qt: Make RefreshKeysJob result compatible with standard job resultIngo Klöcker2022-04-291-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
* qt: Allow refreshing a list of keysIngo Klöcker2022-04-293-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
* qt: Minor refactoringIngo Klöcker2022-04-291-8/+10
| | | | | | | * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use namespace QGpgME. -- GnuPG-bug-id: 5951
* qt: Rename QGpgMERefreshKeysJob to QGpgMERefreshSMIMEKeysJobIngo Klöcker2022-04-294-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
* cpp,tests: Verify that requested keylist mode is usedIngo Klöcker2022-04-282-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
* cpp: Support new keylist modesIngo Klöcker2022-04-276-13/+37
| | | | | | | | | | | | | | * 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
* core: Support --locate-external-keys command of gpgIngo Klöcker2022-04-277-4/+46
| | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_FORCE_EXTERN): New. (GPGME_KEYLIST_MODE_LOCATE_EXTERNAL): New. * src/gpgme.c (gpgme_set_keylist_mode): Check for invalid mode. * src/engine-gpg.c (gpg_keylist_build_options): Use "--locate-external-keys" instead of "--locate-keys" if flag is set. * src/gpgme-json.c (op_keylist): New flag "force-extern". * src/gpgme-tool.c (gt_get_keylist_mode, cmd_keylist_mode): Handle new mode. -- GnuPG-bug-id: 5951
* qt: Rely on the bad passphrase error reported by gpgIngo Klöcker2022-04-251-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
* core: Return BAD_PASSPHRASE error code on symmetric decryption.Ingo Klöcker2022-04-251-2/+21
| | | | | | | | | | | | | * src/decrypt.c (op_data_t): Add field symdecrypt_failed. (parse_status_error): Handle BAD_PASSPHRASE error code. (_gpgme_decrypt_status_handler): Consult new field. -- Return a bad passphrase error if the failure during symmetric decryption is likely caused by the user entering a wrong passphrase. The special error code of a failed public key decryption takes precedence. GnuPG-bug-id: 5939
* qt: Report better error if decryption failed because of bad passphraseIngo Klöcker2022-04-221-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
* cpp: Allow changing the error of a resultIngo Klöcker2022-04-222-0/+9
| | | | | | | | | | * 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
* doc: Remove explanation about AM_PATH_GPGME_PTH for GNU Pth.NIIBE Yutaka2022-04-081-4/+0
| | | | | | | | | -- The commit 3ddf4c3d4000a9b0b52180c3aa3acf1387a193bf in 2011 removed the support. Signed-off-by: NIIBE Yutaka <[email protected]>
* qt,doc: Fix typo and grammar in API documentationIngo Klöcker2022-04-051-5/+2
| | | | --
* cpp: Handle canceling of an edit operationIngo Klöcker2022-04-051-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
* cpp: Return actual error if revocation failsIngo Klöcker2022-04-053-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
* cpp: Add internal utility function for splitting stringsIngo Klöcker2022-04-051-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
* cpp: Do not export symbols of the Private classIngo Klöcker2022-04-051-1/+1
| | | | | | | | * lang/cpp/src/gpgrevokekeyeditinteractor.h (class GpgRevokeKeyEditInteractor): Mark nested class Private as hidden. -- GnuPG-bug-id: 5904
* core: Don't use internal __assuan functions.NIIBE Yutaka2022-04-052-5/+29
| | | | | | | | | | * configure.ac (nanosleep): Detect. * src/assuan-support.c: Don't use __assuan_usleep. (my_socketpair): Don't use __assuan_socketpair. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* core: Don't keep using deprecated ath_ API.NIIBE Yutaka2022-04-052-11/+23
| | | | | | | | | | | | | | | | | * src/posix-io.c: Don't include ath.h. (_gpgme_io_read): Call read directly. (_gpgme_io_write): Call write directly. (_gpgme_io_waitpid): Call waitpid directly. (_gpgme_io_select_select): Call select directly. (_gpgme_io_recvmsg): Call recvmsg directly. (_gpgme_io_sendmsg): Call sendmsg directly. (_gpgme_io_connect): Call connect directly. * src/assuan-support.c: Don't include ath.h. (my_waitpid): Call waitpid directly. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* qt: Check arguments passed to the revoke key jobIngo Klöcker2022-03-312-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
* qt,tests: Verify reason code and description of revocationIngo Klöcker2022-03-301-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
* qt: Add job to revoke own OpenPGP keysIngo Klöcker2022-03-3010-5/+495
| | | | | | | | | | | | | | | | | | | | * 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
* cpp: Add interactor to revoke a keyIngo Klöcker2022-03-305-0/+290
| | | | | | | | | | * 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
* doc: Update NEWSIngo Klöcker2022-03-291-0/+2
| | | | | | -- GnuPG-bug-id: 5906
* qt: Set default visibility of all symbols to hiddenIngo Klöcker2022-03-281-0/+10
| | | | | | | | | | | | * configure.ac: Add -fvisibility=hidden to GPGME_QT_CFLAGS if gcc supports the flag. -- 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. GnuPG-bug-id: 5906
* cpp: Set default visibility of all symbols to hiddenIngo Klöcker2022-03-283-3/+254
| | | | | | | | | | | | | | | | | * 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
* cpp: Put local helper function into unnamed namespaceIngo Klöcker2022-03-281-0/+2
| | | | | | | lang/cpp/src/context.cpp (to_auditlog_flags): Wrap in unnamed namespace. -- GnuPG-bug-id: 5906
* doc: Remove bogus documentationIngo Klöcker2022-03-281-16/+0
| | | | | | | | -- These lines were accidentally added with the documentation for gpgme_op_setexpire. The actual documentation for gpgme_op_revuid_start is a bit further down.
* core: Support keylist mode for op_keylist_from_data.NIIBE Yutaka2022-03-165-5/+11
| | | | | | | | | | | | | | * src/engine-backend.h (keylist_data): Add MODE argument. * src/engine-gpg.c (gpg_keylist_data): Add MODE argument. * src/engine.c (_gpgme_engine_op_keylist_data): Likewise. * src/engine.h (_gpgme_engine_op_keylist_data): Declaration. * src/keylist.c (gpgme_op_keylist_from_data_start): Call _gpgme_engine_op_keylist_data with ctx->keylist_mode. -- GnuPG-bug-id: 5438 Signed-off-by: NIIBE Yutaka <[email protected]>
* qt: Add missing include of config.hIngo Klöcker2022-03-071-0/+4
| | | | | | | * lang/qt/src/util.cpp: Include config.h. -- GnuPG-bug-id: 5871
* qt,doc: Remove comments about throwing exceptionsIngo Klöcker2022-03-077-17/+0
| | | | | | -- The jobs do not throw GpgME::Exception anymore since a long time.
* doc: Update NEWSIngo Klöcker2022-03-071-1/+14
| | | | | | -- Add a few more changes in version 1.17.0.