aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* cpp: Return engine info for engine used by the contextIngo Klöcker2021-12-071-1/+1
| | | | | | | | | | | | | | lang/cpp/src/context.cpp (Context::engineInfo()): Return engine info for protocol of context. -- This change also fixes Context::setEngineFileName() and Context::setEngineHomeDirectory() which overwrote home dir resp. file name of the engine info for the protocol of context with the corresponding value of the "first" engine info (i.e. engine info for gpg) instead of keeping the current home dir resp. file name. GnuPG-bug-id: 5722
* cpp: Factor out common code of GpgME::engineInfo() overloadsIngo Klöcker2021-12-071-28/+26
| | | | | | | | | | * lang/cpp/src/context.cpp (get_engine_info, get_static_engine_info): New. (GpgME::engineInfo(GpgME::Protocol), GpgME::engineInfo(GpgME::Engine)): Use get_static_engine_info(). -- GnuPG-bug-id: 5722
* core: Make the gpgconf option parsing of string types more robustWerner Koch2021-11-251-2/+4
| | | | | | | | | | | | * src/engine-gpgconf.c (gpgconf_parse_option): Skip the string indicator if it is not the empty string. -- Some versions of GnuPG (~2.2.28 to 2.2.33) returned a compliance indicator which should be an int but actually used string as type. Simply skipping the indicator without checking that this is the indicator does not allow to work around this type mismatch by the gpgme users.
* tests: Silence libtool warning on Windows.Werner Koch2021-11-251-0/+6
| | | | * tests/Makefile.am (AM_LDFLAGS): Use --no-fast-install on Windows.
* core: Support dirinfo("socketdir")Werner Koch2021-11-254-11/+24
| | | | | | | | | | | | | | | | | | | * src/dirinfo.c (WANT_SOCKETDIR): New. (dirinfo): Add field socketdir. (parse_output): Support "socketdir". (get_gpgconf_item): Return socketdir. * tests/t-engine-info.c (main): Add socketdir to the output. * src/w32-util.c (_gpgme_create_process_utf8): Fix indentation. -- GnuPG-bug-id: 5613 This is not strictly necessary because we could deduce this from one of the other socket info items but it is more clean to have a dedicated info item. The socketdir item is available for 5 years now (GnuPG commit 8e3fa5a4b205c534de2142e5d071712f957cf06a)
* posix: Use poll instead, when available, removing use of select.NIIBE Yutaka2021-11-256-16/+269
| | | | | | | | | | | | | * configure.ac (HAVE_POLL_H): Add the check. * src/ath.c [!HAVE_POLL_H] (ath_select): Enable conditionally. * src/posix-io.c [HAVE_POLL_H] (_gpgme_io_select_poll): Use poll. * tests/gpg/t-cancel.c [HAVE_POLL_H] (do_select): Use poll. * tests/gpg/t-eventloop.c [HAVE_POLL_H] (do_select): Use poll. -- GnuPG-bug-id: 2385 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgme.pc: Fix library dependency and use of includedir, libdir.NIIBE Yutaka2021-11-121-3/+3
| | | | | | | | | | | | | | | | * src/gpgme.pc.in (Require): Move gpg-error, libassuan to... (Requires.private): ... here. (Cflags): Add -I${includedir}. (Libs): Add -L${libdir}. -- This will result better library dependency for applications using gpgme. It will break build of an application which directly uses gpg-error or libassuan without specifying them (which means, depending on redundant/wrong gpgme.pc). Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Build using GPG_ERROR_MT_LIBS for thread use.NIIBE Yutaka2021-11-121-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | * tests/gpg/Makefile.am (WITH_THREAD_CPPFLAGS): New. (WITH_THREAD_LDADD): New. (t_thread1_CPPFLAGS, t_thread_keylist_CPPFLAGS) (t_thread_keylist_verify_CPPFLAGS) (t_cancel_CPPFLAGS): Use WITH_THREAD_CPPFLAGS. (t_thread1_LDADD, t_thread_keylist_LDADD) (t_thread_keylist_verify_LDADD) (t_cancel_LDADD): Use WITH_THREAD_LDADD. -- For library dependency at runtime, it's not 100% right to use GPG_ERROR_MT_LIBS here, because those test programs don't use libgpg-error directly at runtime. But, it's OK, because these are test programs, which don't need specifying minimum library dependency. It would be too much for configure of gpgme, to check how threaded application should be built, just for these test programs. Co-authored-by: Ben Kibbey <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Use GPG_ERROR_MT_LIBS for a test with threads.NIIBE Yutaka2021-11-111-2/+3
| | | | | | | | | | | * tests/Makefile.am (run_threaded_CPPFLAGS): New. (run_threaded_LDADD): Replace GPG_ERROR_LIBS to GPG_ERROR_MT_LIBS. -- Reported-by: Ben Kibbey <[email protected]> Fixes-commit: d0402f886b720d03369887c807581bd980ee70cf Signed-off-by: NIIBE Yutaka <[email protected]>
* libtool: Link without -flat_namespace for macOS.NIIBE Yutaka2021-11-101-9/+4
| | | | | | | | | | | | | | | | | | * m4/libtool.m4: Not setting 10.0 to MACOSX_DEPLOYMENT_TARGET when not defined. Only specify -flat_namespace to linker for specific (older) versions and hosts. -- Original patch was by: Jeremy Huddleston Sequoia <[email protected]> in https://lists.gnu.org/archive/html/libtool-patches/ 2020-06/msg00001.html Reported-by: Aleix Conchillo Flaque GnuPG-bug-id: 5610 Signed-off-by: NIIBE Yutaka <[email protected]>
* qt: Fix build against Qt 5.9Ingo Klöcker2021-09-132-3/+3
| | | | | | | | | | | | | * lang/qt/tests/t-keylist.cpp (KeyListTest::testListAllKeysSync): Ensure same type for both arguments of QCOMPARE. * lang/qt/tests/t-various.cpp (TestVarious::testSetExpire): Ensure same type for both arguments of QCOMPARE. -- Qt 5.9 does not yet have the generic qCompare helper which supports arguments of any type that can be compared with ==. GnuPG-bug-id: 5592
* build: Fix make distcheck problem.Werner Koch2021-08-272-4/+4
| | | | | | | * tests/start-stop-agent: Use -f with rm. Also use cat instead of cp. -- Also shorted some lines.
* qt: Expect UTF-8 on stderr on WindowsAndre Heinecke2021-08-271-44/+1
| | | | | | | | | | * lang/qt/src/threadedjobmixin.cpp (stringFromGpgOutput): Expect UTF-8. -- In recent versions more and more output was changed to be UTF-8 on Windows. Werner advised to always expect UTF-8 diagnostics.
* Add missing files for distributionAndre Heinecke2021-08-272-1/+3
| | | | | * lang/qt/src/Makefile.am (private_qgpgme_headers): Add job_p.h * tests/gpg/Makefile.am (EXTRA_DIST): Add gpg.conf.in
* core: Use flexible array member if compiler has support.NIIBE Yutaka2021-08-132-3/+4
| | | | | | | | | | | | | * configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Add. * src/engine-gpg.c (struct arg_and_data_s): Use FLEXIBLE_ARRAY_MEMBER. (_add_arg): Use offsetof instead of sizeof. (add_data): Likewise. -- Before this fix, GCC 11 warns (with its bound checking feature). Signed-off-by: NIIBE Yutaka <[email protected]>
* core: Fix results returned by gpgme_data_* functionsIngo Klöcker2021-08-032-4/+36
| | | | | | | | | | | | | src/debug.h (TRACE_SYSRES_OFF_T, _trace_sysres_off_t, TRACE_SYSRES_SSIZE_T, _trace_sysres_ssize_t): New. src/data.c (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Use appropriate new tracing macros instead of casting the results to int. -- This change adds tracing macros for results of system functions of type __off_t and __ssize_t. GnuPG-bug-id: 5481
* core: Support closefrom also for glibc.Jiri Kucera2021-07-271-1/+1
| | | | | | | | | | * src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom. -- Since 2.34, glibc introduces closefrom (the implementation follows *BSD standard). Signed-off-by: Werner Koch <[email protected]>
* core: Ensure gpg.conf for tests is recreated if necessaryIngo Klöcker2021-07-082-5/+7
| | | | | | | | | | * tests/gpg/gpg.conf.in: New. * tests/gpg/Makefile.am (gpg.conf): Copy gpg.conf.in instead of using echo to fill gpg.conf. -- This change ensures that gpg.conf is updated whenever new options are added for some tests.
* Make sure expiration time is interpreted as unsigned numberIngo Klöcker2021-07-081-1/+1
| | | | | | | | | | | * lang/qt/tests/t-various.cpp (testSignKeyWithExpiration): Convert expiration time to uint_least32_t. -- This fixes the test on 32-bit systems where time_t (the return type of expirationTime()) is a signed 32-bit integer type. GnuPG-bug-id: 5522
* qt: Allow retrieving the default value of a config entryIngo Klöcker2021-06-295-11/+77
| | | | | | | | | | | | | | * lang/qt/src/cryptoconfig.cpp, lang/qt/src/cryptoconfig.h (CryptoConfigEntry::defaultValue): New. * lang/qt/src/qgpgmenewcryptoconfig.cpp, lang/qt/src/qgpgmenewcryptoconfig.h (QGpgMENewCryptoConfigEntry::defaultValue): New. * lang/qt/tests/t-config.cpp (CryptoConfigTest::testDefault()): Add test of CryptoConfigEntry::defaultValue(). Port away from deprecated CryptoConfig::entry overload. -- GnuPG-bug-id: 5515
* Update NEWS.Ingo Klöcker2021-06-281-0/+9
| | | | | | | * NEWS: Add changes of ChangeExpiryJob. -- GnuPG-bug-id: 4717
* qt: Fix filenames in copyright headersIngo Klöcker2021-06-282-2/+2
| | | | | * lang/qt/src/qgpgmechangeownertrustjob.h, lang/qt/tests/t-trustsignatures.cpp: Use correct filenames.
* qt: Add test for ChangeExpiryJobIngo Klöcker2021-06-282-3/+430
| | | | | | | | | | * lang/qt/tests/Makefile.am (TESTS, moc_files, noinst_PROGRAMS): Add new test. (t_changeexpiryjob_SOURCES): New. * lang/qt/tests/t-changeexpiryjob.cpp: New. -- GnuPG-bug-id: 4717
* qt: Allow changing expiration date of primary key and all subkeysIngo Klöcker2021-06-284-10/+113
| | | | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add changeexpiryjob.cpp. * lang/qt/src/changeexpiryjob.cpp: New. * lang/qt/src/changeexpiryjob.h (enum ChangeExpiryJob::Option, typedef ChangeExpiryJob::Options, ChangeExpiryJob::setOptions, ChangeExpiryJob::options): New. * lang/qt/src/qgpgmechangeexpiryjob.cpp (change_expiry): Update the expiration date of primary key and/or some/all subkeys. (QGpgMEChangeExpiryJob::start): Add options to call of change_expiry. (ChangeExpiryJob::start): Moved implementation to changeexpiryjob.cpp. -- Additionally, to the default behavior (update expiration of primary key if no subkeys are specified resp. update expiration of specified subkeys) it is now possible to update the expiration of the primary key _and_ the specified/all subkeys. GnuPG-bug-id: 4717
* qt: Add mechanism for missing d-pointer in JobIngo Klöcker2021-06-282-0/+92
| | | | | | | | | | | | | | * lang/qt/src/job_p.h: New. * lang/qt/src/job.cpp (typedef JobPrivateHash, d_func, setJobPrivate, getJobPrivate): New. -- Because of ABI compatibility requirements we cannot add a d-pointer to Job. Therefore we store the d-pointers in a global static. This mechanism will allow Job subclasses to store additional data without breaking the ABI. GnuPG-bug-id: 4717
* qt: Remove superfluous trailing ';'Ingo Klöcker2021-06-261-3/+3
| | | | | lang/qt/src/signkeyjob.h (class SignKeyJob): Remove trailing ';' from inline implemented member functions
* core: Fix use-after-free issue in testIngo Klöcker2021-06-261-17/+37
| | | | | | | | | | | | * tests/gpg/t-edit-sign.c (sign_key, verify_key_signature): New. (main): Factored out signing and verifying the result. -- Factoring the two steps of the test into different functions fixes the use-after-free issue that was caused by accidentaly using a variable of the first step in the second step. GnuPG-bug-id: 5509
* Post release updatesWerner Koch2021-06-242-1/+5
| | | | --
* Release 1.16.0gpgme-1.16.0Werner Koch2021-06-242-14/+29
|
* python: Do not include the full file names in the docs.Werner Koch2021-06-241-1/+1
| | | | | | -- GnuPG-bug-id: 5299
* python: Allow returning signatures made by unknown keys in `decrypt`Jasper Spaans2021-06-242-3/+12
| | | | | | | | | | -- This functionality got dropped somewhere after 1.12, as part of the cleanup of the `Context.decrypt` call signature. Reintroduce it again, now using an explicit keyword argument `filter_signatures` (which defaults to hiding signatures by unknown keys). GnuPG-bug-id: 5292
* qt: Extend SignKeyJob to create signatures with expiration dateIngo Klöcker2021-06-224-3/+181
| | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/signkeyjob.h (SignKeyJob::setExpirationDate): New. * lang/qt/src/qgpgmesignkeyjob.h, lang/qt/src/qgpgmesignkeyjob.cpp (QGpgMESignKeyJob::setExpirationDate): New. * lang/qt/src/qgpgmesignkeyjob.cpp (QGpgMESignKeyJob::Private): Add member m_expiration. (sign_key): Handle expiration date. (QGpgMESignKeyJob::start): Pass expiration date to sign_key. * lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithoutExpiration, TestVarious::testSignKeyWithExpiration): New. (TestVarious::initTestCase): Add "allow-weak-key-signatures" to gpg.conf. -- This allows Kleopatra (and other users of QGpgme) to create key signatures with expiration date. GnuPG-bug-id: 5336, 5506
* core: Allow specifying an expiration date for key signaturesIngo Klöcker2021-06-227-1/+253
| | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): Add 'cert_expire'. * src/engine-gpg.c (append_args_from_cert_expire): New. (gpg_edit): Set option according to the new flag. * src/gpgme.c (gpgme_release): Free 'cert_expire'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "cert-expire". * tests/gpg/Makefile.am (c_tests): Add new test. (gpg.conf): Write "allow-weak-key-signatures" to gpg.conf. * tests/gpg/t-edit-sign.c: New. -- The new context flag "cert-expire" allows setting the expiration date for key signatures created with gpgme_op_interact. GnuPG-bug-id: 5336, 5505
* Update NEWS.Ingo Klöcker2021-06-211-0/+8
| | | | | | | * NEWS: Add news for recent changes -- GnuPG-bug-id: 5421, 5217
* qt: Add missing }Ingo Klöcker2021-06-181-0/+1
| | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (parseURL): Add missing }. -- Fixes-commit: 1dca8c2b3c6d6aa3dfd4215c911207f08a3bf9f1 GnuPG-bug-id: 5465
* qt: Add some error loggingIngo Klöcker2021-06-171-2/+5
| | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (setURLValueList): Log error if setting config value failed. -- GnuPG-bug-id: 5465
* qt: Do not set empty base DN as query of keyserver URLIngo Klöcker2021-06-171-1/+3
| | | | | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (parseURL): Only set non-empty base DN as URL query. -- This makes it possible to differentiate an unset query from an empty query. GnuPG-bug-id: 5465
* qt: Fix API documentationIngo Klöcker2021-06-171-5/+2
| | | | | | | | | * lang/qt/src/signkeyjob.h (SignKeyJob::start, SignKeyJob::setUserIDsToSign, SignKeyJob::setCheckLevel): Fix documentation of parameters. -- GnuPG-bug-id: 5245
* core: New data flags "io-buffer-size" and "sensitive".Werner Koch2021-06-147-39/+214
| | | | | | | | | | | | | | | | | | | | | * src/data.c (_gpgme_data_release): Free buffers. (gpgme_data_seek): Adjust from renamed fields. (gpgme_data_set_flag): Implement new flags. (_gpgme_data_inbound_handler): Allow the use of a malloced buffer. (_gpgme_data_outbound_handler): Ditto. * src/data.h (BUFFER_SIZE): Move out of the struct definition. (struct gpgme_data): Remove pending filed and introduce inbound and outbound fields. * src/conversion.c (_gpgme_wipememory): New. Taken from GnuPG. * src/cJSON.c (wipememory): Use this here too. * tests/run-decrypt.c (main): Add options "--large-buffers" and "--sensitive". -- GnuPG-bug-id: 5478 Signed-off-by: Werner Koch <[email protected]>
* core: Also detect AuthEnvelopedData (AEAD for CMS)Werner Koch2021-06-142-3/+3
| | | | | | * src/data-identify.c (basic_detection): Add OID. Signed-off-by: Werner Koch <[email protected]>
* qt: Flush output after write for QProcess outputAndre Heinecke2021-06-101-1/+11
| | | | | | | | | | | | | | | | | * lang/qt/src/dataprovider.cpp (QIODeviceDataProvider::write): Call waitForBytesWritten. -- The problem here is that QProcess writes into an internal buffer which is written to stdin of the process triggered by a signal/slot connection. That connection is broken when we move the QProcess into our GPGME thread and only restablished when our Job is finished. This caused Kleopatra to basically keep everything when decrypting a large archive in memory and only write it out to the unpack process once the decryption was finished. GnuPG-Bug-Id: T5475
* core,w32: Increase BUFFER_SIZE to 4096Andre Heinecke2021-06-101-0/+4
| | | | | | | | | | | * src/data.h (BUFFER_SIZE): Increase to 4096 for Windows. -- This brings it in line to the PIPE_BUF size on desktop Linux systems. This should increase performance when working with large files on Windows a bit. GnuPG-Bug-Id: T5478
* qt: Explicitly link libgpg-errorAndre Heinecke2021-06-091-1/+1
| | | | | | | | * lang/qt/src/Makefile.am (libqgpgme_la_LIBADD): Explicitly link gpg-error. -- Previously this was implicit from the libassuan flags.
* core: Explicitly add GPG_ERROR_CFLAGSAndre Heinecke2021-06-091-1/+1
| | | | | | | | | * src/Makefile.am (AM_CFLAGS): Add GPG_ERROR_CFLAGS -- This fixes the include directory for libgpg error if it is installed in a different prefix then libassuan. Previously libassuan provided the include directory also implicitly.
* qt: Add separate logging category for result of config loadingIngo Klöcker2021-06-023-7/+6
| | | | | | | | | | | | | | * lang/qt/src/qgpgme_debug.h: Make include guard match file name. * lang/qt/src/qgpgme_debug.h, lang/qt/src/qgpgme_debug.cpp (QGPGME_CONFIG_LOADING_LOG): New. * lang/qt/src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfig::reloadConfiguration): Use new logging category. -- Use a separate logging category for the extremely noisy logging of the result of config loading to make debug logging more useful. GnuPG-bug-id: 5217
* core: Fix a few checks for number of fields in keylist result parser.Ingo Klöcker2021-06-021-3/+3
| | | | | | | | | * src/keylist.c (keylist_colon_handler): Check for correct number of fields. -- This prevents NULL pointer dereferencing with older versions of gpg that may output less fields.
* qt: Add support for flags in LDAP server optionsIngo Klöcker2021-06-011-27/+48
| | | | | | | | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (parseURL): Handle extended LDAP server option syntax. (portToString): New. (splitURL): Append flags to LDAP server option. -- This adds support for the extended syntax of LDAP server options introduced in gpg 2.2.18/2.3. The flags are stored as fragment of a QUrl. GnuPG-bug-id: 5217
* tests: Improve the output of the run-keylist helper.Werner Koch2021-05-281-8/+1
| | | | | | | | | | | | * tests/run-keylist.c (main): Print all infos from the primary key. -- The test tool printed only the computed infos for the key and not the detailed one fro the primary key. The new output better reflects the data structure. Related to GnuPG-bug-id: 5454
* build: _DARWIN_C_SOURCE should be 1.NIIBE Yutaka2021-05-271-1/+1
| | | | | | | | | | * configure.ac (*-apple-darwin*): Set _DARWIN_C_SOURCE 1. -- GnuPG-bug-id: 5440 Reported-by: Jay Freeman Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Update gpg-error.m4NIIBE Yutaka2021-05-271-50/+69
| | | | | | | | * m4/gpg-error.m4: Update from libgpg-error. -- Signed-off-by: NIIBE Yutaka <[email protected]>