* src/export.c (op_data_t): Add failure_code.
(export_status_handler): Set it.
(gpgme_op_export_ext, gpgme_op_export_keys): Also check the failure
code.
--
That is just in case we missed an error code. For example with older
gpg versions (e.g. 2.3.8) and exporting to a keyserver.
* lang/qt/src/qgpgmedecryptverifyarchivejob.cpp
(decrypt_verify_from_file_name): On Windows, convert Unicode file name
to UTF-8.
* lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt,
encrypt_to_filename): On Windows, convert Unicode file name from/to
UTF-8.
* lang/qt/src/qgpgmesignarchivejob.cpp (sign, sign_to_filename): Ditto.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt,
sign_encrypt_to_filename): Ditto.
--
On Windows, GnuPG expects file names to be UTF-8-encoded. This fixes
encrypting and decrypting folders with umlauts in the folder name and
in the file name of the archive. Encrypting and decrypting folders
with kanji still fails.
GnuPG-bug-id: 6728
* m4/qt6.m4: Check the build configuration of Qt 6 for
no_direct_extern_access.
--
If building with -mno-direct-extern-access has been neither enabled nor
disabled explicitly, then check whether Qt 6 was built with this flag.
The check is skipped, if we build for Windows.
GnuPG-bug-id: 6696
* configure.ac: Check if C++ compiler supports
-mno-direct-extern-access. Add option to enable building with
-mno-direct-extern-access.
* m4/ax_check_compile_flag.m4: New.
* m4/qt6.m4: Add -mno-direct-extern-access to GPGME_QT6_CFLAGS if
supported and requested.
--
This adds the possibility to build the Qt 6 bindings with the
-mno-direct-extern-access flag. This is required if Qt 6 was built with
this flag. This is a workaround for the lack of Qt 6's pkgconfig files
providing this flag if needed.
GnuPG-bug-id: 6696
* m4/qt6.m4: Remove attempt to build a Qt program with -fPIC.
--
libtool already takes care of adding -fPIC. Moreover, building without
-fPIC succeeded even if Qt was built with -fPIC, i.e. the check didn't
work as intended.
GnuPG-bug-id: 6696
* tests/run-keylist.c (main): Handle option --with-secret again.
--
Re-add handling of --with-secret option that was accidentally removed
with the previous commit.
GnuPG-bug-id: 6705
* src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_V5FPR): New.
(struct _gpgme_subkey): Add field v5fpr.
* src/engine-gpg.c (gpg_keylist_build_options): Pass new option to
gpg.
* src/key.c (gpgme_key_unref): Free new field.
* src/keylist.c (op_data_t): Parse and add "fp2" line.
* tests/run-keylist.c (show_usage): Add option --v5fpr.
* src/keylist.c (op_data_t): Add field failure_code.
(keylist_status_handler): Handle special value.
(gpgme_op_keylist_end): Return an error if a FAILURE line has been
seen.
--
Note that the failure code part has been added to better diagnose
problems if a wrong gpg version is used. If verything works right we
should not get this because we check that the gnupg version sis either
>= 2.4.4 or less than 2.3 and >= 2.2.42.
Note further that the v5fpr field may also be used to get the SHA-256
fingerprint of X.509 certificates (even without passing the new mode
flag).
GnuPG-bug-id: 6705
* src/engine-gpgsm.c (gpgsm_encrypt): Send the always-trust options.
* tests/run-encrypt.c: Add option --always-trust.
--
Note that the run-encrypt test tool used to assume always-trust for
OpenPGP since 1.7.0 This bug has also been fixed by introducing the
explicit option.
GnuPG-bug-id: 6559
* lang/qt/src/wkdrefreshjob.h, lang/qt/src/wkdrefreshjob.cpp
(WKDRefreshJob::start): New overload.
* lang/qt/src/wkdrefreshjob_p.h (WKDRefreshJobPrivate): Add field
m_userIds.
* lang/qt/src/qgpgmewkdrefreshjob.cpp (toEmailAddresses): New.
(locate_external_keys): Change return type and arguments.
(refresh_keys): Remove.
(QGpgMEWKDRefreshJobPrivate::startIt): Get emails from keys or user IDs.
Remove duplicates. Call locate_external_keys instead of refresh_keys.
* lang/qt/tests/run-wkdrefreshjob.cpp (CommandLineOptions,
parseCommandLine): New.
(main): Support new option --all-userids.
--
The new start() overload allows to specify the user IDs to use for the
WKD lookup explicitly. This allows updating user IDs via WKD which were
originally not retrieved via WKD.
GnuPG-bug-id: 6672
* lang/qt/tests/Makefile.am (AM_CPPFLAGS): Include Qt binding sources
before C++ binding sources and C sources.
--
This fixes the problem that the debug.h in the C sources was found
before the one in the Qt bindings.
Commit d23528cadf fixed it for Qt5, we
need Qt6 as well.
GnuPG-bug-id: 6673
* autogen.rc (final_info): Suggest to run configure from a build
subdirectory.
--
We recommend out-of-source builds. The suggestion what to do next shown
by autogen.sh should reflect this.
GnuPG-bug-id: 6673
* lang/qt/tests/Makefile.am (AM_CPPFLAGS): Include Qt binding sources
before C++ binding sources and C sources.
--
This fixes the problem that the debug.h in the C sources was found
before the one in the Qt bindings.
GnuPG-bug-id: 6673
* lang/qt/src/wkdrefreshjob.cpp, lang/qt/src/wkdrefreshjob.h,
lang/qt/src/wkdrefreshjob_p.h, lang/qt/src/qgpgmewkdrefreshjob.cpp,
lang/qt/src/qgpgmewkdrefreshjob.h: New.
* lang/qt/src/protocol.h (class Protocol): Add pure virtual member
function wkdRefreshJob
* lang/qt/src/protocol_p.h (Protocol::wkdRefreshJob): ... and
implement it.
* lang/qt/src/Makefile.am: Update accordingly.
* lang/qt/tests/run-wkdrefreshjob.cpp: New.
* lang/qt/tests/Makefile.am: Add new test runner.
--
This job allows updating keys via WKD. Only user IDs that were
originally retrieved via WKD (i.e. which have origin WKD) are
considered.
GnuPG-bug-id: 6672
* lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Remove output file
if operation was canceled or failed.
* lang/qt/src/qgpgmesignarchivejob.cpp (sign): Ditto.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Ditto.
* lang/qt/tests/run-encryptarchivejob.cpp (CommandLineOptions): Add
field cancelTimeout.
(parseCommandLine): Add option --cancel-after. Parse option value.
(main): Check for invalid cancel timeout. Start timer for canceling
the job.
* lang/qt/tests/run-signarchivejob.cpp (CommandLineOptions): Add
field cancelTimeout.
(parseCommandLine): Add option --cancel-after. Parse option value.
(main): Check for invalid cancel timeout. Start timer for canceling
the job.
--
This change ensures that the output file is removed if the creation of
a signed or encrypted archive was canceled or failed. The new option
of the test runners enables testing the cancelation of the jobs.
GnuPG-bug-id: 6584
* lang/qt/src/util.h: Move toLogString ...
* lang/qt/src/debug.h: ... here.
* lang/qt/tests/run-importjob.cpp (main): Use toLogString.
--
This allows using the helper in dependent projects without duplicating
it everywhere.
GnuPG-bug-id: 6584
* lang/cpp/src/descriptionresult.cpp (DescriptionResult::isMime): New.
* lang/cpp/src/descriptionresult.h: Update accordingly.
--
This exposes the is_mime metadata from a decryption result to users
of the C++ library.
GnuPG-bug-id: 6199
Signed-off-by: Carl Schwan <carl.schwan@gnupg.com>
* lang/qt/src/encryptjob.cpp, lang/qt/src/encryptjob.h,
lang/qt/src/encryptjob_p.h: Add inputEncoding/setInputEncoding
to EncryptJob
* lang/qt/src/qgpgmeencryptjob.cpp: Use newly added inputEncoding
to set encoding hint of the encrypted content
--
This allows applications like KMail to set the input encoding of the
encrypted content, which simplify and improve the performance of
identifying the content type then decrypting it.
GnuPG-bug-id: 6616
Signed-off-by: Carl Schwan <carl.schwan@gnupg.com>
* src/engine-gpg.c (gpg_verify): Use a separate pipe instead of stdout
for reading the plaintext.
* tests/gpg/t-support.h (PGM): Define if undefined.
(print_data): Undefine BUF_SIZE.
(check_data): New.
* tests/gpg/t-verify.c (clearsigned_plus_key_block): New.
(main): Add test.
--
Reading the plaintext from stdout is a bad idea because gpg can also
print other stuff on stdout, e.g. the keys contained in a public key
block. This is fixed by reading the plaintext via a special pipe.
GnuPG-bug-id: 6622
* src/verify.c (_gpgme_verify_status_handler): Return GPG_ERR_BAD_DATA
instead of GPG_ERR_GENERAL.
--
This gives users trying to decrypt and/or verify for example a public
key block a more useful error.
GnuPG-bug-id: 6617
* lang/qt/src/QGpgmeConfig-w32.cmake.in.in,
lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in: Get paths to check from
the target properties.
--
This avoids the error present in an older version where the files to
check used the correct path, but a wrong path of the DLL was set in the
target properties.
* lang/qt/src/QGpgmeConfig-w32.cmake.in.in: Fix typos in variable names.
--
Because of those typos the loop over the files to check was an empty
loops and therefore the wrong name of the DLL was never noticed.
* lang/qt/src/decryptverifyarchivejob.cpp,
lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add
member functions setInputFile, inputFile.
* lang/qt/src/decryptverifyarchivejob_p.h
(DecryptVerifyArchiveJobPrivate): Add member m_inputFilePath.
* lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (decrypt_verify): Move
creation of indata to decrypt_verify_from_io_device.
(decrypt_verify_from_io_device, decrypt_verify_from_file_name): New.
(QGpgMEDecryptVerifyArchiveJob::start): Use
decrypt_verify_from_io_device instead of decrypt_verify.
(QGpgMEDecryptVerifyArchiveJobPrivate::startIt): Start the job with the
values from member variables.
* lang/qt/tests/run-decryptverifyarchivejob.cpp (createInput): Remove.
(main): Remove creation of input. Make the job read the archive directly
from the given archive name.
--
This makes it possible to tell gpgtar to read the signed/encrypted
archive directly from a specified file bypassing GpgME's Data IO.
GnuPG-bug-id: 6530
* src/engine-gpg.c (add_file_name_arg_or_data): New.
(gpg_decrypt): Use add_file_name_arg_or_data instead of add_data for the
ciphertext.
(gpg_verify): Use add_file_name_arg_or_data instead of add_data for the
signature and the signed text.
* tests/run-decrypt.c (show_usage): New option --direct-file-io.
(main): Parse new option. If option is given, then don't open input
file, create simple data object instead of data object from stream and
set input file name on input data.
* tests/run-verify.c (show_usage): New option --direct-file-io.
(main): Parse new option. If option is given, then don't open input
files, create simple data objects instead of data objects from stream
and set input file names on input data objects.
--
This change makes it possible to tell gpg (and gpgtar) to read the
input (i.e. the signed/encrypted data or the signature or the created
archive) directly from the files with given file names instead of from
streams piped through GpgME's Data IO.
GnuPG-bug-id: 6530
* lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h
(EncryptArchiveJob): Add member functions setRecipients, recipients,
setInputPaths, inputPaths, setOutputFile, outputFile,
setEncryptionFlags, encryptionFlags.
* lang/qt/src/encryptarchivejob_p.h (EncryptArchiveJobPrivate): Add
members m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags.
* lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Move creation of
outdata to encrypt_to_io_device.
(encrypt_to_io_device, encrypt_to_filename): New.
(QGpgMEEncryptArchiveJob::start): Use encrypt_to_io_device instead of
encrypt.
(QGpgMEEncryptArchiveJobPrivate::startIt): Start the job with the
values from member variables.
* lang/qt/src/qgpgmesignarchivejob.cpp (sign): Move creation of
outdata to sign_to_io_device.
(sign_to_io_device, sign_to_filename): New.
(QGpgMESignArchiveJob::start): Use sign_to_io_device instead of sign.
(QGpgMESignArchiveJobPrivate::startIt): Start the job with the
values from member variables.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Move
creation of outdata to sign_encrypt_to_io_device.
(sign_encrypt_to_io_device, sign_encrypt_to_filename): New.
(QGpgMESignEncryptArchiveJob::start): Use sign_encrypt_to_io_device
instead of sign_encrypt.
(QGpgMESignEncryptArchiveJobPrivate::startIt): Start the job with the
values from member variables.
* lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h
(SignArchiveJob): Add member functions setSigner, signers,
setInputPaths, inputPaths, setOutputFile, outputFile.
* lang/qt/src/signarchivejob_p.h (SignArchiveJobPrivate): Add
members m_signers, m_inputPaths, m_outputFilePath.
* lang/qt/src/signencryptarchivejob.cpp,
lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Add
member functions setSigner, signers, setRecipients, recipients,
setInputPaths, inputPaths, setOutputFile, outputFile,
setEncryptionFlags, encryptionFlags.
* lang/qt/src/signencryptarchivejob_p.h (SignEncryptArchiveJobPrivate):
Add members m_signers, m_recipients, m_inputPaths, m_outputFilePath,
m_encryptionFlags.
* lang/qt/tests/run-encryptarchivejob.cpp (createOutput): Remove.
(checkOutputFilePath): New.
(main): Create file output writing to stdout if no archive name (or "-")
is given. Exit if file with given archive name already exists. Make
the jobs write the created archive directly to the given archive name.
* lang/qt/tests/run-signarchivejob.cpp (createOutput): Remove.
(checkOutputFilePath): New.
(main): Create file output writing to stdout if no archive name (or "-")
is given. Exit if file with given archive name already exists. Make
the jobs write the created archive directly to the given archive name.
--
This makes it possible to tell gpgtar to write the created archive
directly to a specified file bypassing GpgME's Data IO.
GnuPG-bug-id: 6530
* src/engine-gpg.c (gpg_encrypt): Pass output file name to gpg if output
has file name set.
(gpg_encrypt_sign): Ditto.
(gpg_sign): Ditto.
* tests/run-encrypt.c (show_usage): New option --output.
(main): Parse new option. Set file name on output if --output is given.
Do not print output if --output is given.
* tests/run-sign.c (show_usage): New option --output.
(main): Parse new option. Set file name on output if --output is given.
Do not print output if --output is given.
--
This change makes it possible to tell gpg (and gpgtar) to write the
output (i.e. the signed/encrypted data or the signature or the created
archive) directly to a file with given file name instead of piping
the output back to gpgme.
GnuPG-bug-id: 6530
* lang/qt/src/job.cpp, lang/qt/src/job.h (Job::startIt): New method.
* lang/qt/src/job_p.h (JobPrivate::startIt): New pure virtual method.
* lang/qt/src/qgpgmechangeexpiryjob.cpp
(QGpgMEChangeExpiryJobPrivate::startIt): New.
* lang/qt/src/qgpgmedecryptverifyarchivejob.cpp
(QGpgMEDecryptVerifyArchiveJobPrivate::startIt): New.
* lang/qt/src/qgpgmeencryptarchivejob.cpp
(QGpgMEEncryptArchiveJobPrivate::startIt): New.
* lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::startIt):
New.
* lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::startIt):
New.
* lang/qt/src/qgpgmelistallkeysjob.cpp
(QGpgMEListAllKeysJobPrivate::startIt): New.
* lang/qt/src/qgpgmesignarchivejob.cpp
(QGpgMESignArchiveJobPrivate::startIt): New.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp
(QGpgMESignEncryptArchiveJobPrivate::startIt): New.
* lang/qt/src/qgpgmesignencryptjob.cpp
(QGpgMESignEncryptJobPrivate::startIt): New.
--
startIt() starts a job if the necessary values have been set before.
This makes it possible to extend jobs with additional ways to start them
without having to worry about overloading existing virtual start()
methods. This will be used first for the different archive jobs.
GnuPG-bug-id: 6530
* lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::run): Make all
overloads public.
--
This allows calling the run() functions from the JobPrivate subclasses.
GnuPG-bug-id: 6530
* lang/qt/src/job_p.h (JobPrivate::start): Rename to startNow.
* lang/qt/src/job.cpp (Job::startNow): Adapt function call.
* lang/qt/src/qgpgmechangeexpiryjob.cpp
(QGpgMEChangeExpiryJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmedecryptverifyarchivejob.cpp
(QGpgMEDecryptVerifyArchiveJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmeencryptarchivejob.cpp
(QGpgMEEncryptArchiveJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::start):
Rename to startNow.
* lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::start):
Rename to startNow.
* lang/qt/src/qgpgmelistallkeysjob.cpp
(QGpgMEListAllKeysJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmesignarchivejob.cpp
(QGpgMESignArchiveJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp
(QGpgMESignEncryptArchiveJobPrivate::start): Rename to startNow.
* lang/qt/src/qgpgmesignencryptjob.cpp
(QGpgMESignEncryptJobPrivate::start): Rename to startNow.
--
Using the same name for the public and the private method avoids
confusion.
GnuPG-bug-id: 6530
* lang/qt/src/job.cpp, lang/qt/src/job_p.h (getJobPrivate): Replace with
two overloads for non-const pointer and const pointer to Job.
* lang/qt/src/job_p.h (jobPrivate): Replace with two template functions
for non-const pointer and const pointer to Job.
--
This helps avoid changing values stored in the JobPrivate class in
const functions (e.g. getters) of Job classes.
GnuPG-bug-id: 6530
* NEWS: Mention this.
* lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::setSizeHint): New.
* lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptverifyarchivejob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.cpp: Set size for input IODevice.
--
This fixes the case where the old detection of the size of QIOdevice
using seek would overflow and instead explicitly uses QIODevice::size
to check for the size and pass it through as an uint64.
GnuPG-Bug-Id: T6534
* lang/cpp/src/data.cpp (Data::setFlag): New.
* lang/cpp/src/data.h: Update accordingly.
* NEWS: Mention this.
--
This exposes the generic flag mechanism for data to users
of the C++ library. It is similar to Context::setFlag but
has no getter.
* tests/run-encrypt.c (cancel_after_progress): New.
(progress_cb): Take care of it.
(main): Add option --cancel.
--
This tool may now be used to test gpgme_cancel_async.
Releated to
GnuPG-bug-id: 6534