* 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
* lang/qt/src/qgpgmedecryptverifyjob.cpp (patch_decryption_result):
Removed.
(decrypt_verify): Remove usage of patch_decryption_result.
--
This reverts most of revision d8e5871dca.
GnuPG-bug-id: 5939
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
--
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.
* 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
* 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
* 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
* 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
* src/gpgme.h.in (gpgme_op_receive_keys_start, gpgme_op_receive_keys):
New.
* src/gpgme.def, src/libgpgme.vers: Add them.
* src/engine-backend.h (struct engine_ops): Add arg keyids to field
'import'.
* src/engine.h, src/engine.c (_gpgme_engine_op_import): Add arg keyids.
* src/engine.c (_gpgme_engine_op_import): Forward new arg keyids.
* src/import.c: (_gpgme_op_import_start, _gpgme_op_import_keys_start):
Pass NULL to new arg of _gpgme_op_import_start.
(_gpgme_op_receive_keys_start, gpgme_op_receive_keys_start,
gpgme_op_receive_keys): New.
* src/engine-gpg.c (gpg_import): Add arg keyids. Extend check for
valid arguments. Build command line if keyids are given.
* src/engine-gpgsm.c (gpgsm_import): Add arg keyids. Return error if
keyids is not NULL.
tests/run-receive-keys.c: New.
tests/Makefile.am (noinst_PROGRAMS): Add new test runner.
--
The new function allows importing keys given by their key ids or
fingerprints from a keyserver (like gpg's --recv-keys command).
GnuPG-bug-id: 5808
* lang/qt/src/importjob.h: Remove include of QByteArray.
--
QByteArray is included by other headers already. Besides: Qt headers
shouldn't be included with the package/module prefixes.
* lang/qt/src/importjob.h, lang/qt/src/wkdlookupresult.h: Include
headers of GpgME++ without "gpgme++/" prefix when building QGpgme.
* lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmewkdlookupjob.cpp,
lang/qt/src/wkdlookupresult.cpp, lang/qt/tests/t-import.cpp: Include
headers of GpgME++ without "gpgme++/" prefix.
--
* tests/run-genkey.c (parse_expire_string): Support default expiration
and no expiration. Set flag for no expiration.
(main): Allow update of flags when generating new key.
--
This makes the parsing of different values for expiration match the
parsing done by gpg's --quick-gen-key. In particular, this makes it
possible again to generate keys without expiration.
* lang/qt/src/addexistingsubkeyjob.h,
lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp,
lang/qt/src/qgpgmeaddexistingsubkeyjob.h: New.
* lang/qt/src/protocol.h (class Protocol): Add pure virtual member
function addExistingSubkeyJob.
* lang/qt/src/protocol_p.h (Protocol::addExistingSubkeyJob): Implement.
* 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_addexistingsubkey_SOURCES): New.
* lang/qt/tests/t-addexistingsubkey.cpp: New.
* lang/qt/tests/t-support.h (VERIFY_OR_RETURN_VALUE,
COMPARE_OR_RETURN_VALUE, VERIFY_OR_OBJECT, COMPARE_OR_OBJECT,
VERIFY_OR_FALSE, COMPARE_OR_FALSE): New.
* lang/qt/tests/t-support.h, lang/qt/tests/t-support.cpp
(class QQGpgMETest): New member function importSecretKeys.
--
The new job allows adding existing subkeys to other keys as with the
"addkey" edit-key command of gpg. The added subkey will have the same
expiration date (+/- 1 second) as the original subkey.
GnuPG-bug-id: 5770
* lang/qt/tests/t-support.h, lang/qt/tests/t-support.cpp
(class QGpgMETest): Add member function hookUpPassphraseProvider.
Add member mPassphraseProvider.
* lang/qt/tests/t-changeexpiryjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-remarks.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-trustsignatures.cpp,
lang/qt/tests/t-various.cpp: Use new helper.
--
GnuPG-bug-id: 5770
* lang/qt/tests/t-support.h (class QGpgMETest): Add signal asyncDone.
* lang/qt/tests/t-changeexpiryjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-import.cpp,
lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-remarks.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-trustsignatures.cpp,
lang/qt/tests/t-various.cpp,
lang/qt/tests/t-wkdlookup.cpp,
lang/qt/tests/t-wkspublish.cpp: Remove signal asyncDone from the test
classes.
--
This reduces duplication and makes it possible to use the signal in
the base class.
GnuPG-bug-id: 5770
src/export.c (export_status_handler): Handle "export_keys.secret".
--
This allows callers of the synchronous export operations to react
properly to errors (e.g. wrong passphrase) during the export of secret
keys.
GnuPG-bug-id: 5766