aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* python: Build for both Python2 and Python3.Justus Winter2016-09-145-18/+177
| | | | | | | | | | * NEWS: Update. * configure.ac: Check for multiple Python versions. * lang/python/Makefile.am: Build and install for both Python versions. * lang/python/tests/Makefile.am: Test both versions. * lang/python/tests/run-tests.py: New test runner. Signed-off-by: Justus Winter <[email protected]>
* python: Import from __future__ to align behavior of Python 2.7.Justus Winter2016-09-1459-0/+177
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Use more generic shebang.Justus Winter2016-09-1438-38/+38
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* core: New function gpgme_op_adduid.Werner Koch2016-09-147-33/+192
| | | | | | | | | | | | | * src/genkey.c: Replace most error codes GPG_ERR_INV_VALUE by GPG_ERR_INV_ARG. (struct op_data_t): Add field UIDMODE. (genkey_status_handler): Use UIDMODE. (adduid_start): New. (gpgme_op_adduid_start, gpgme_op_adduid): New. * src/gpgme.def, src/libgpgme.vers: Add them. * tests/run-genkey.c: Add option --adduid. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_createsubkey.Werner Koch2016-09-147-33/+196
| | | | | | | | | | | | * src/genkey.c (createsubkey_start): New. (gpgme_op_createsubkey_start, gpgme_op_createsubkey): New. * src/gpgme.def, src/libgpgme.vers: Add them. * src/engine-gpg.c (gpg_createkey): Factor some code out to ... (gpg_add_algo_usage_expire): new. (gpg_addkey): Implement. * tests/run-genkey.c: Add option --addkey. Signed-off-by: Werner Koch <[email protected]>
* core: Use const char * where appropriate.Werner Koch2016-09-138-25/+35
| | | | Signed-off-by: Werner Koch <[email protected]>
* core: Cast away the common const problem with spawn and argv.Werner Koch2016-09-132-5/+5
| | | | | | * src/dirinfo.c (read_gpgconf_dirs): Use a cast to assignd to ARGV. Signed-off-by: Werner Koch <[email protected]>
* core: Fix condition-always-true warning in trace macro.Werner Koch2016-09-131-1/+1
| | | | | | * src/data-compat.c (old_user_read): Cast AMT. Signed-off-by: Werner Koch <[email protected]>
* core: Mark unused function args.Werner Koch2016-09-1320-1/+86
| | | | Signed-off-by: Werner Koch <[email protected]>
* tests: Mark lots of unused vars and fix const mismatches.Werner Koch2016-09-1336-216/+289
| | | | Signed-off-by: Werner Koch <[email protected]>
* tests: Use gpgme_io_write in passhrase callbacks.Werner Koch2016-09-133-20/+21
| | | | | | | | * tests/gpg/t-support.h (passphrase_cb): Use gpgme_io_write. * tests/gpgsm/t-support.h (passphrase_cb): Ditto. * tests/run-support.h (passphrase_cb): Ditto. Signed-off-by: Werner Koch <[email protected]>
* core: Do not pass const char* to functions taking a char*.Werner Koch2016-09-135-8/+20
| | | | Signed-off-by: Werner Koch <[email protected]>
* build: Use more compiler warningsWerner Koch2016-09-131-0/+29
| | | | | | | | | | * configure.ac: Add useful compiler warnings. -- It is strange that this seems to be the only GnuPG package which does not use modern warning. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_create_key.Werner Koch2016-09-1313-59/+775
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/engine-backend.h (engine_ops): Change prototype of genkey. * src/engine-gpgsm.c (gpgsm_genkey): Change accordingly. * src/engine-gpg.c (gpg_genkey): Change it to a dispatcher. (gpg_createkey_from_param): New for the old functionality. (gpg_createkey_legacy): New. Stub for now. (gpg_createkey): New. (gpg_addkey): New. Stub for now. (gpg_adduid): New. Stub for now. * src/engine.c (_gpgme_engine_op_genkey): Add new args. * src/genkey.c (op_data_t): Add field ERROR_CODE. (parse_error): New. (genkey_status_handler): Parse ERROR status line. (genkey_start): Use NULL/0 for the new args. (createkey_start): New. (gpgme_op_createkey_start, gpgme_op_createkey): New. * src/gpgme.def, src/libgpgme.vers: Add gpgme_op_createkey_start and gpgme_op_createkey. * src/gpgme.h.in (_gpgme_op_genkey_result): Add fields PUBKEY and SECKEY. (GPGME_CREATE_SIGN): New. (GPGME_CREATE_ENCR): New. (GPGME_CREATE_CERT): New. (GPGME_CREATE_AUTH): New. (GPGME_CREATE_NOPASSWD): New. (GPGME_CREATE_SELFSIGNED): New. (GPGME_CREATE_NOSTORE): New. (GPGME_CREATE_WANTPUB): New. (GPGME_CREATE_WANTSEC): New. (GPGME_CREATE_FORCE): New. * tests/run-genkey.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add it. -- This function uses the new --quick-gen-key API of gpg. A limited compatibility mode to use older gpg versions and gpgsm will eventually be provided. Not all flags are currently implemented. ./run-genkey --unprotected --force [email protected] Create a new standard key with the given user id. --force is used to allow creating more than one key with that user id in the keyring. ./run-genkey --unprotected --force \ [email protected] default default 2145826800 Creates a new standard key with an expiration date of 2037-12-31. ./run-genkey --unprotected --force \ [email protected] future-default default 2145826800 Create a standard key using the fugure default algorithms. Signed-off-by: Werner Koch <[email protected]>
* python: Handle slight differences between Python 2 and 3.Justus Winter2016-09-136-32/+61
| | | | | | | | | | | | | | | | | | | * lang/python/helpers.c (pyDataWriteCb): Handle Python integers being returned on Python 2. (pyDataSeekCb): Likewise. * lang/python/pyme/core.py (Data.__init__): Fix testing for string argument. (Data.new_from_filepart): Likewise. * lang/python/pyme/util.py (is_a_string): New function. * lang/python/tests/t-encrypt-large.py (read_cb): Force evaluation of generator. * lang/python/tests/t-idiomatic.py: Partly skip test on Python 2. * lang/python/tests/t-verify.py (check_result): Here, the difference between 2 and 3 really matters. We cannot change the char * conversion in Python 2 without breaking all existing applications, and using bytestrings in Python 3 would be very inconvenient. Signed-off-by: Justus Winter <[email protected]>
* python: Fix types and error handling.Justus Winter2016-09-131-11/+26
| | | | | | | * lang/python/helpers.c (_pyme_edit_cb): Drop the const. (_pyme_assuan_{data,inquire,status}_cb): Fix error handling. Signed-off-by: Justus Winter <[email protected]>
* python: Avoid Python3-only form of super().Justus Winter2016-09-121-4/+5
| | | | | | | | | | * lang/python/pyme/core.py (GpgmeWrapper.__repr__): Use more compatible form of super. (GpgmeWrapper.__setattr__): Likewise. (Context.__init__): Likewise. (Data.__init__): Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Make type translation compatible with Python 2.7.Justus Winter2016-09-122-13/+78
| | | | | | | * lang/python/gpgme.i: Avoid functions not available in Python 2.7. * lang/python/helpers.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Avoid hardcoding the interpreter.Justus Winter2016-09-121-2/+2
| | | | | | * lang/python/setup.py.in: Avoid hardcoding the interpreter. Signed-off-by: Justus Winter <[email protected]>
* python: Do not rely on subprocess.DEVNULL.Justus Winter2016-09-121-2/+7
| | | | | | * lang/python/setup.py.in: Do not rely on subprocess.DEVNULL. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix version comparison.Justus Winter2016-09-121-2/+2
| | | | | | | * tests/gpg/t-sig-notation.c: Fix version comparison. Fixes-commit: a0263ad2 Signed-off-by: Justus Winter <[email protected]>
* tests: Make signature notation test compatible with older GnuPGs.Justus Winter2016-09-122-3/+40
| | | | | | | | | * lang/python/tests/t-sig-notation.py: Only check the critical flag when GnuPG >= 2.1.13 is used. * tests/gpg/t-sig-notation.c: Likewise. Fixes-commit: c88c9ef3 Signed-off-by: Justus Winter <[email protected]>
* qt: Fix some includesAndre Heinecke2016-09-123-3/+7
| | | | | | | | | | | * lang/qt/src/qgpgmekeyformailboxjob.cpp: Explicitly include QStringList. * lang/qt/tests/t-support.h, lang/qt/tests/t-support.cpp: Move includes into impl. Explicitly include QDir. -- This fixes build against Qt versions where the includes are less implicit.
* qt: Fix tofu test.Justus Winter2016-09-121-6/+6
| | | | | | | * lang/qt/tests/t-tofuinfo.cpp: Adjust member names. Fixes-commit: 120b1478 Signed-off-by: Justus Winter <[email protected]>
* core,cpp: Extend the TOFU information.Werner Koch2016-09-077-23/+85
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpeme_tofu_info): Rename FIRSTSEEN to SIGNFIRST and LASTSEEN to SIGNLAST. Add ENCRFIST and ENCRLAST. * src/keylist.c (parse_tfs_record): Parse to ENCRFIRST and ENCRLAST. * src/verify.c (parse_tofu_stats): Ditto. * tests/run-keylist.c (main): Adjust and print encrypt stats. * tests/run-verify.c (print_result): Ditto. * lang/cpp/src/tofuinfo.h (TofuInfo): Rename firstSeen to signFirst and lastSeen to signLast. Add encrCount, encrFirst and encrLast. * lang/cpp/src/tofuinfo.cpp (encrCount, encrFirst, encrLast): New. -- The latest GnuPG commits have the needed changes but we also allow the use of currently released GnuPG version. Signed-off-by: Werner Koch <[email protected]>
* tests: Set passphrase cb in t-encrypt-mixedAndre Heinecke2016-09-061-0/+2
| | | | | | | | * tests/gpg/t-encrypt-mixed.c (main): Set passphrase cb. -- This fixes the test when run without an agent and our faked pinentry program.
* core: Check for gpg version for loopback modeAndre Heinecke2016-09-061-1/+1
| | | | | | | | | | * src/engine-gpg.c (build_argv): Check for version 2.1.0 before adding pinentry-mode. -- This is a compatibility fix for older versions that don't support this flag which would otherwise result in an invalid argument error.
* core: Fix passphrase cb for mixed sym encryptAndre Heinecke2016-09-062-3/+2
| | | | | | | | | | * src/encrypt.c (encrypt_start): Handle SYMMETRIC flag. * src/encrypt-sign.c (encrypt_sign_start): Ditto. -- This causes the passphrace command handler to be properly registered which in turn will result in the passphrase callback beeing called.
* qt: Clarify comment and strings in tofuinfo testAndre Heinecke2016-09-051-4/+8
| | | | | * lang/qt/tests/t-tofuinfo.cpp (testTofuSignCount) (testTofuKeyList): Ensure distinct messages. Clarify comment.
* qt: Enable signcount checks in tofuinfo testAndre Heinecke2016-09-051-12/+27
| | | | | | | * lang/qt/tests/t-tofuinfo.cpp: Enable checks for signcount. -- Signcount for userIDs works now as expected with gnupg 2.1.16.
* cpp: Add convenience update function to a keyAndre Heinecke2016-09-052-0/+28
| | | | | | | | | * lang/cpp/src/key.cpp (Key::update): New. * lang/cpp/src/key.h: Update accordingly. -- This function helps if you have an incomplete key or want to make sure all info in a key is complete (e.g. validity / tofuinfo)
* cpp: Add ostream operators for key and uidAndre Heinecke2016-09-052-0/+42
| | | | | | | | | * lang/cpp/src/key.cpp (Key, UserID): Add ostream operator. * lang/cpp/src/key.h: Update accordingly. -- This is helpful debugging / showing the state of a key / uid and tofuinfo.
* qt: Add missing header redirectionAndre Heinecke2016-09-052-3/+13
| | | | | | | | | * lang/qt/src/keyformailboxjob.h, lang/qt/src/qgpgmekeyformailboxjob.h: Fix includes. -- This ensures that when building qgpgme you do not need an installed gpgme++.
* qt: Include cpp before core directoryAndre Heinecke2016-09-051-1/+1
| | | | | | | | | * lang/qt/src/Makefile.am (AM_CPPFLAGS): Include cpp before core. -- Both core and cpp have headers that have the same names, this can lead to the wrong headers beeing included when qt bindings are built.
* qt: Fix 2.1 t-support copyAndre Heinecke2016-08-251-1/+3
| | | | * lang/qt/src/t-support.cpp (copyKeyring): Fix seckey copy.
* qt: Fix and extend TofuInfo test.Andre Heinecke2016-08-251-10/+51
| | | | | | | * lang/qt/tests/t-tofuinfo.cpp: Delete executed jobs. (testTofuKeyList): New. (testSupported): Activate for 2.1.16 (signAndVerify): Disable sigcount tests.
* qt: Fix keyring copy in testsAndre Heinecke2016-08-253-3/+3
| | | | | | * lang/qt/test/t-encrypt.cpp, lang/qt/test/t-tofuinfo.cpp: Assert on copy failure. * lang/qt/test/t-support.cpp (copyKeyrings): Fix path.
* qt: Add generic flag support for keylistjobsAndre Heinecke2016-08-253-1/+10
| | | | | | | | | | * lang/qt/src/keylistjob.h (addMode): New. * lang/qt/src/qgpgmekeylistjob.h (addMode): New. * lang/qt/src/qgpgmekeylistjob.cpp (addMode: New. -- Instead of new API for each new thing lets be a bit more generic / open.
* qt: Ensure that current src dir is included firstAndre Heinecke2016-08-251-2/+3
| | | | | | | | * lang/qt/src/Makefile.am: Reorder include directives. -- This fixes the problem that QGpgME would pick up gpgme or gpgme++ headers from an installed version.
* cpp: Add WithTofu Keylist ModeAndre Heinecke2016-08-253-1/+6
| | | | | | * lang/cpp/src/context.cpp: Handle WithTofu. * lang/cpp/src/global.h (KeyListMode): Add WithTofu. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t): Handle WithTofu.
* qt: Fix tofuinfo test when gpg is gpg2Andre Heinecke2016-08-254-10/+30
| | | | | | | | | | | * lang/qt/tests/t-support.cpp (QGpgMETest::copyKeyrings): New helper. * lang/qt/tests/t-support.h: Declare. * lang/qt/tests/t-encrypt.cpp: use it * lang/qt/tests/t-tofuinbo.cpp: ditto. -- New helper takes care of copying the correct files for either keybox or keyring.
* qt: Remove unused variable in testAndre Heinecke2016-08-251-2/+0
| | | | * t-wkspublish.cpp (testWKSPublishCreate): Remove context.
* qt: Add test for wkspublishjobAndre Heinecke2016-08-252-3/+284
| | | | | | | | | | * lang/qt/tests/t-wkspublish.cpp: New. * lang/qt/tests/Makefile.am: Update accordingly. -- Most tests are disabled by default as tey require an online connection. Define DO_ONLINE_TESTS to enable the tests.
* qt: Add WKSPublishJobAndre Heinecke2016-08-257-3/+388
| | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/job.cpp: Include moc / subclass stub. * lang/qt/src/protocol.h: Add virtual for new job. * lang/qt/src/protocol_p.h: Add job. * lang/qt/src/wkspublishjob.h: Interface for WKSPublishJob. * lang/qt/src/qgpgmewkspublishjob.cpp, lang/qt/src/qgpgmewkspublishjob.h: New. -- The Job was originally intended to be used with a SpawnEngine Context but QProcess was a better fit for the job. Usage is similar to the client tool. check, create, recieve.
* Cpp: Change firstSeen / lastSeen return valuesAndre Heinecke2016-08-252-6/+6
| | | | | | * lang/cpp/src/tofuinfo.cpp, lang/cpp/src/tofuinfo.h (TofuInfo::firstSeen, TofuInfo::lastSeen): Change return values to unsigned long and update doc.
* Cpp: Add wrapper for gpgme_get_dirinfoAndre Heinecke2016-08-252-0/+14
| | | | | * lang/cpp/src/context.cpp (dirInfo): New. * lang/cpp/src/global.h (dirInfo): New.
* Cpp: Add support for spawn engineAndre Heinecke2016-08-253-1/+66
| | | | | | | * lang/cpp/src/context.cpp (Context::spawn, Context::spawnAsync): New. * lang/cpp/src/context.h: Add prototypes. (SpawnFlags): New. * lang/cpp/src/global.h (SpawnEngine): Added.
* core: Add GPGME_KEYLIST_MODE_WITH_TOFU.Werner Koch2016-08-257-15/+186
| | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_TOFU): New. * src/engine-gpg.c (gpg_keylist_build_options): Use that. * src/keylist.c: Include limits.h. (parse_tfs_record): New. (keylist_colon_handler): Support TFS record. * tests/run-keylist.c: Include time.h. (isotimestr): New. (main): Add option --tofu. Print TOFU info. * tests/run-verify.c: Include time.h. (isotimestr): New. (print_result): Use isotimestr for TOFU dates. Signed-off-by: Werner Koch <[email protected]>
* core: Adjust for TOFU_STATS change in gnupg 2.1.16.Werner Koch2016-08-242-9/+5
| | | | | | | | | | | | | | | * src/gpgme.h.in (_gpgme_tofu_info): Change 'firstseen' and 'lastseen' to a timestamp value. * src/verify.c (parse_tofu_stats): Do not cap these values at UINT_MAX. -- Using an unsigned long here is okay: We will never get an error and even on machines where unsigned long is 32 bit (e.g. Windows64) this allows us to operate until 2106. By then Windows will be a footnote in history or Windows128 has changed that type to something larger than 32 bit ;-) Signed-off-by: Werner Koch <[email protected]>
* core: Set the 'encrcount' field in gpgme_tofu_info_t.Werner Koch2016-08-241-2/+8
| | | | | | * src/verify.c (parse_tofu_stats): Set ENCRCOUNT field. Signed-off-by: Werner Koch <[email protected]>