aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* qt: Use QGpgMEExportJob also for export of secret keysIngo Klöcker2022-01-046-19/+152
| | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/protocol.h (Protocol::secretKeyExportJob): Document charset argument as ignored. * lang/qt/src/protocol_p.h (Protocol::secretKeyExportJob): Use QGpgMEExportJob instead of QGpgMESecretKeyExportJob. * lang/qt/src/qgpgmeexportjob.h (class QGpgMEExportJob): Add c'tor taking an export mode. Add member m_exportMode. Rename member m_flags to m_additionalExportModeFlags. (QGpgMEExportJob::~QGpgMEExportJob): Mark as override. * lang/qt/src/qgpgmeexportjob.cpp (QGpgMEExportJob::QGpgMEExportJob): Delegate to new c'tor. Implement new c'tor. (QGpgMEExportJob::~QGpgMEExportJob): Use default. (export_qba): Rename argument flags to mode. (QGpgMEExportJob::start): Pass combination of export mode and additional mode flags to export_qba. (QGpgMEExportJob::setExportFlags): Adapt to renaming of member. * lang/qt/tests/run-exportjob.cpp: New. -- This change makes it possible to export secret OpenPGP keys. GnuPG-bug-id: 5757
* cpp: Allow export of secret keysIngo Klöcker2022-01-042-13/+87
| | | | | | | | | | | | | | | | | | | | * lang/cpp/src/context.h (class Context): New member functions exportSecretKeys, startSecretKeyExport, exportKeys, startKeyExport. (Context::exportPublicKeys, Context::startPublicKeyExport): Rename argument flags/export_mode to mode. * lang/cpp/src/context.cpp (Context::exportPublicKeys): Return error if ExportSecret mode flag is set. Call exportKeys(). (Context::startPublicKeyExport): Return error if ExportSecret mode flag is set. Call startKeyExport(). (Context::exportSecretKeys, Context::startSecretKeyExport, Context::exportKeys, Context::startKeyExport): Implement. -- This adds export functions for secret key exports and generic export functions that can be used for any key export supported by gpgme_op_export[_ext][_start]. GnuPG-bug-id: 5757
* cpp: Mark ExportNoUID flag as obsoleteIngo Klöcker2022-01-041-1/+1
| | | | | | | | * lang/cpp/src/context.h (enum Context::ExportMode): Mark value ExportNoUID as obsolete -- GnuPG-bug-id: 5757
* core: Add new option --secret-subkey to help texts.Ingo Klöcker2022-01-042-1/+3
| | | | | | | | * src/gpgme-tool.c (hlp_export): Add new option. * tests/run-export.c (show_usage): Print new option. -- GnuPG-bug-id: 5757
* cpp: Remove obsolete workaroundIngo Klöcker2022-01-041-18/+0
| | | | | | | | | | | | | * lang/cpp/src/context.cpp (Context::startKeyListing, Context::exportPublicKeys, Context::startPublicKeyExport): Remove workaround. -- gpgme_op_keylist_ext[_start] supports GPGME_KEYLIST_MODE_EXTERN since a long time. And the export doesn't use a keylisting (anymore), so that the keylisting mode is irrelevant for the export. GnuPG-bug-id: 5757
* core: New export mode to export secret subkeys.Ingo Klöcker2022-01-047-5/+51
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET_SUBKEY): New. * src/export.c (check_mode): Allow new mode and check for invalid combinations. (export_keys_start): Return error if new mode flag is set. * src/engine-gpg.c (export_common): Implement. * src/gpgme-tool.c (cmd_export): New option --secret-subkey. * tests/run-export.c (main): New option --secret-subkey. -- This adds support for exporting secret subkeys (via gpg's --export-secret-subkeys) to gpgme_op_export[_ext][_start]. The flag is not supported by gpgme_op_export_keys[_start] because there is no way to specify which subkey(s) to export with these functions. GnuPG-bug-id: 5757
* doc: Remove documentation of obsolete export mode flagIngo Klöcker2022-01-041-4/+0
| | | | | | | | | | * doc/gpgme.texi: Remove GPGME_EXPORT_MODE_NOUID. -- Support for this experimental flag has been removed with revision c8fd8870b3bf089f99156448b7d1e59c1150f994. GnuPG-bug-id: 5757
* core: Check for unsupported export mode flagsIngo Klöcker2022-01-041-0/+12
| | | | | | | | | | | src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Return error if an unsupported mode flag is set. -- The minimal mode flag has no effect for X.509 certificates, but we still treat it as supported (as documented in the API documentation). GnuPG-bug-id: 5757
* core: Check for combination of ssh mode with other mode flagsIngo Klöcker2022-01-041-0/+10
| | | | | | | | | | * src/export.c (check_mode): Return error if ssh mode is combined with another mode flag. -- The SSH mode flag cannot be used in combination with other flags. GnuPG-bug-id: 5757
* core: Factor out the check for valid export mode flags.Ingo Klöcker2022-01-041-38/+22
| | | | | | | | * src/export.c (check_mode): New. (export_start, export_ext_start): Call check_mode. -- GnuPG-bug-id: 5757
* qt: Detect an import error caused by a wrong passwordIngo Klöcker2021-12-221-1/+17
| | | | | | | | | | | | | * lang/qt/src/qgpgmeimportjob.cpp (import_qba): Check import statuses of import result for bad passphrase errors. -- To allow users of the import job to handle a failed import caused by a wrong password more gracefully, check if all import statuses of the import result have a bad passphrase error and return a bad passphrase error as import result in this case. GnuPG-bug-id: 5713
* qt,tests: Add test runner for testing the import jobIngo Klöcker2021-12-222-1/+101
| | | | | | | | | * lang/qt/tests/Makefile.am (run_importjob_SOURCES): New. (noinst_PROGRAMS): Add run-importjob. * lang/qt/tests/run-importjob.cpp: New. -- GnuPG-bug-id: 5713
* cpp: Check fpr of import status for NULLIngo Klöcker2021-12-221-1/+3
| | | | | | | | * lang/cpp/src/importresult.cpp (GpgME::ImportResult::Private): Check fpr for NULL. -- GnuPG-bug-id: 5713
* core: Detect bad passphrase error on certificate importIngo Klöcker2021-12-224-7/+63
| | | | | | | | | | | | | | | | | | | | | * src/import.c (gpgme_op_import_result): Check fpr for NULL. (parse_error): New. (import_status_handler): Handle error status line. * doc/gpgme.texi (gpgme_import_status_t): Mention that fpr can be NULL. * tests/gpg/t-import.c (check_result): Check fpr for NULL. * tests/run-threaded.c (delete_impres): Check fpr for NULL. -- When importing an encrypted certificate a wrong passphrase may be entered. In this case gpgsm emits a status line with a bad passphrase error and an "invalid object" error. To make it possible for callers to handle a wrong passphrase error more gracefully, an import status with bad passphrase error is added to the import result for each status line with bad passphrase error. GnuPG-bug-id: 5713
* build: Update for newer autoconf.NIIBE Yutaka2021-12-221-3/+3
| | | | | | | | | * configure.ac (AC_PREREQ): Require >= 2.69. (AC_CONFIG_HEADERS): Use it instead of AC_CONFIG_HEADER. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* qt: Allow specifying an import filter when importing keysIngo Klöcker2021-12-154-8/+79
| | | | | | | | | | | | | | | * lang/qt/src/importjob.cpp (struct ImportJobPrivate): Add member m_importFilter. * lang/qt/src/importjob.cpp, lang/qt/src/importjob.h (class ImportJob): Add member functions setImportFilter and importFilter. * lang/qt/src/qgpgmeimportjob.cpp (import_qba): Add arg importFilter and adjust the callers. Set import filter context flag. * lang/qt/tests/t-import.cpp (ImportTest): Add member function testImportWithImportFilter. -- GnuPG-bug-id: 5739
* qt: Avoid test failure when test is run multiple timesIngo Klöcker2021-12-151-16/+26
| | | | | | | | | | | | * lang/qt/tests/t-import.cpp (ImportTest): Add member tempGpgHome and member function initTestCase. (keyFpr, keyData): Move to ImportTest::testImportWithKeyOrigin. -- Use different temporary GNUPGHOME's when running the test. This ensures that the import in the test is always done with a new keyring. GnuPG-bug-id: 5733
* qt: Fix erroneous reuse of JobPrivate objectsIngo Klöcker2021-12-151-0/+1
| | | | | | | | | | | | * lang/qt/src/job.cpp (Job::~Job): Destroy JobPrivate object belonging to destroyed job. -- In some tests different Job objects reused the same JobPrivate object because they were created with the same memory address. Obviously, this shouldn't happen. GnuPG-bug-id: 5739
* core: Allow setting import filters when importing keysIngo Klöcker2021-12-1411-6/+70
| | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): New field import_filter. * src/engine-backend.h (struct engine_ops): Add arg import_filter to field 'import'. * src/engine-gpg.c (gpg_import): Add arg import_filter and pass option --import-filter with argument value to gpg. Adjust all callers. * src/engine-gpgsm.c (gpgsm_import): Add dummy arg import_filter. * src/gpgme.c (gpgme_release): Free 'import_filter'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "import-filter". * tests/run-import.c (main): Add option --import-filter. -- This makes the --import-filter option available in the GPGME API for key imports. GnuPG-bug-id: 5739
* qt: Add pattern used for WKD lookup to resultIngo Klöcker2021-12-144-12/+23
| | | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmewkdlookupjob.cpp (run_wkd_get): Change type of arg email. (lookup_keys): Add pattern to result. * lang/qt/src/wkdlookupresult.h (class WKDLookupResult): Add arg pattern to c'tors. Add member function pattern. * lang/qt/src/wkdlookupresult.cpp (class WKDLookupResult::Private): Add field pattern. (WKDLookupResult::WKDLookupResult): Pass pattern to pimpl. (WKDLookupResult::pattern): New. * lang/qt/tests/t-wkdlookup.cpp (testWKDLookupAsync, testWKDLookupSync, testLookupWithNoResultAsync): Check pattern. -- GnuPG-bug-id: 5728
* core: Set --key-origin option only if supported by gpgIngo Klöcker2021-12-141-1/+1
| | | | | | | | * src/engine-gpg.c (gpg_import): Do not pass --key-origin option to gpg if gpg is too old. -- GnuPG-bug-id: 5733
* qt: Allow setting key origin when importing keysIngo Klöcker2021-12-146-9/+229
| | | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add importjob.cpp. * lang/qt/src/importjob.cpp: New. * lang/qt/src/importjob.h (class ImportJob): Add member functions setKeyOrigin, keyOrigin, keyOriginUrl. * lang/qt/src/qgpgmeimportjob.cpp (originToString): New. (import_qba): Set key origin context flag. (QGpgMEImportJob::start, QGpgMEImportJob::exec): Add options to call of import_qba. * lang/qt/tests/Makefile.am (the_tests, moc_files, noinst_PROGRAMS): Add new test. (t_import_SOURCES): New. * lang/qt/tests/t-import.cpp: New. -- GnuPG-bug-id: 5733
* qt,tests: Skip WKD lookup tests by defaultIngo Klöcker2021-12-143-2/+17
| | | | | | | | | | | * lang/qt/tests/t-support.cpp, lang/qt/tests/t-support.h (class QGpgMETest): Add member function doOnlineTests. * lang/qt/tests/t-wkdlookup.cpp (testWKDLookupAsync, testWKDLookupSync, testLookupWithNoResultAsync): Skip tests if online tests are not enabled. -- GnuPG-bug-id: 5728
* core: Allow specifiying a key origin when importing keysIngo Klöcker2021-12-1312-8/+81
| | | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): New field key_origin. * src/engine-backend.h (struct engine_ops): Add arg key_origin to field 'import'. * src/engine-gpg.c (gpg_import): Add arg key_origin and pass option --key-origin with argument value to gpg. Adjust all callers. * src/engine-gpgsm.c (gpgsm_import): Add dummy arg key_origin. * src/gpgme.c (gpgme_release): Free 'key_origin'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "key-origin". * tests/run-import.c (main): Add option --key-origin. * tests/gpg/t-import.c (main): Set and verify key origin. -- This makes the --key-origin option available in the GPGME API for key imports. GnuPG-bug-id: 5733
* doc: Fix a few errors in the documentation of gpgme_op_import_*Ingo Klöcker2021-12-131-7/+7
| | | | --
* qt: Support WKD lookup without implicit importIngo Klöcker2021-12-1313-8/+727
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add qgpgmewkdlookupjob.cpp, wkdlookupresult.cpp. (qgpgme_headers): Add wkdlookupjob.h, wkdlookupresult.h. (camelcase_headers): Add WKDLookupJob, WKDLookupResult. (private_qgpgme_headers): Add qgpgmewkdlookupjob.h. (qgpgme_moc_sources): Add qgpgmewkdlookupjob.moc, wkdlookupjob.moc. * lang/qt/src/job.cpp: Define c'tor and d'tor of WKDLookupJob. * lang/qt/src/protocol.h (Protocol::wkdLookupJob): New. * lang/qt/src/protocol_p.h (Protocol::wkdLookupJob): New. * lang/qt/src/qgpgmewkdlookupjob.cpp, lang/qt/src/qgpgmewkdlookupjob.h, lang/qt/src/wkdlookupjob.h, lang/qt/src/wkdlookupresult.cpp, lang/qt/src/wkdlookupresult.h: New. * lang/qt/tests/Makefile.am (EXTRA_DIST): Add final.test. (the_tests): New. (TESTS): Remove all t-*. Add $(the_tests) and final.test. (moc_files): Add t-wkdlookup.moc. (t_wkdlookup_SOURCES): New. (noinst_PROGRAMS): Add t-wkdlookup. * lang/qt/tests/final.test: New. * lang/qt/tests/t-support.h (QTest::toString): New template specialization for std::string. * lang/qt/tests/t-wkdlookup.cpp: New. -- The new WKDLookupJob allows running a WKD lookup without implicit import of the retrieved key. This makes it possible to do WKD lookups similar to keyserver lookups (aka external keylistings). The new final.test pseudo test stops a dirmngr that may have been started by the tests. The toString() template specialization enables printing of the actual and expected values in case of failed QCOMPARE. GnuPG-bug-id: 5728
* qt: Fix example for using the asynchronous job APIIngo Klöcker2021-12-131-0/+1
| | | | | * lang/qt/src/protocol.h (class Protocol): Fix API documentation. --
* cpp,tests: Add test runner for doing a WKD lookup without importIngo Klöcker2021-12-102-1/+166
| | | | | | | | | | | | | | | | | * lang/cpp/tests/Makefile.am (run_wkdlookup_SOURCES, programs_unix): New. (noinst_PROGRAMS): Add $(programs_unix). * lang/cpp/tests/run-wkdlookup.cpp: New. -- This test runner is a prototype for doing a WKD lookup without implicit import of the found key(s). Building this test runner is disabled on Windows because it may not work there. Feel free to enable it on Windows if the test runner works there. GnuPG-bug-id: 5728
* cpp: Add new supported components to API docs of dirInfo()Ingo Klöcker2021-12-101-1/+2
| | | | | | | lang/cpp/src/global.h: Update API doc of dirInfo(). -- GnuPG-bug-id: 5727
* core: Support all components with dirinfo()Ingo Klöcker2021-12-103-0/+75
| | | | | | | | | | | | | | | * src/dirinfo.c (WANT_KEYBOXD_NAME, WANT_AGENT_NAME, WANT_SCDAEMON_NAME, WANT_DIRMNGR_NAME, WANT_PINENTRY_NAME): New. (dirinfo): Add fields keyboxd_name, agent_name, scdaemon_name, dirmngr_name, pinentry_name. (parse_output): Support "keyboxd", "gpg-agent", "scdaemon", "dirmngr", "pinentry". (get_gpgconf_item): Return new components. tests/t-engine-info.c (main): Add new components to the output. -- GnuPG-bug-id: 5727
* 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