aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Post release updatesgpgme-1.9-branchWerner Koch2017-03-282-2/+6
| | | | --
* Release 1.9.0gpgme-1.9.0Werner Koch2017-03-285-18/+45
| | | | | | | | | * configure.ac <c>: Bump LT version to C29/A18/R0. <cpp>: Bump LT version to C10/A4/R0. <qt>: Bump LT version to C9/A2/R0. -- Signed-off-by: Werner Koch <[email protected]>
* core: Prepare for new key listing data send by gpg.Werner Koch2017-03-287-9/+71
| | | | | | | | | | | | * src/gpgme.h.in (gpgme_user_id_t): New fields 'origin' and 'last_update'. (gpgme_key_t): New fields 'origin' and 'last_update'. * src/conversion.c (_gpgme_parse_timestamp_ul): New. * src/keylist.c (keylist_colon_handler): Parse fields 19 and 20. * tests/run-keylist.c (main): Print new fields. Signed-off-by: Werner Koch <[email protected]>
* qt: Disable testEncryptDecryptNowrapAndre Heinecke2017-03-271-0/+2
| | | | | | | | | | | * lang/qt/tests/t-encrypt.cpp (EncryptTest::testEncryptDecryptNowrap): Disable test. -- This test produces failures under CI/ASAN conditions as the verify after the unwrap returns an error. As we currently don't have time to look into this more it's disabled for now. Similar to the testMixedEncryptDecrypt.
* python: Skip tests if running with GnuPG < 2.1.12.Justus Winter2017-03-271-1/+6
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Fix error message. Skip all tests when we use GnuPG older than 2.1.12. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* Mention new cpp changes in the NEWSAndre Heinecke2017-03-241-0/+6
| | | | | | -- Somone that calls a function startCombinedDecryptionAndVerification should be required to always type it without autocompletion.
* cpp: Respect decrypt flags in new functionsAndre Heinecke2017-03-241-4/+4
| | | | | | | | | * lang/cpp/src/context.cpp: Respect directly provided flags in the new decrypt functions. -- Overlooked in the initial commit. Also fixed the according unused variable warnings.
* qt: Add unittest for decrypt unwrapAndre Heinecke2017-03-241-1/+66
| | | | | * lang/qt/tests/t-encrypt.cpp (EncryptTest::testEncryptDecryptNowrap): New.
* cpp: Use gpgme_op_decrypt_ex and add new flags.Andre Heinecke2017-03-243-11/+58
| | | | | | | | | | | | | | | | * lang/cpp/src/context.cpp: New decrypt and decryptVerify functions that take flags as arguments. Use new variants in old functions. (Context::setDecryptionFlags): New helper. (Context::Private::Private): Initialize new member. * lang/cpp/src/context_p.h (Context::Private::decryptFlags): New. * lang/cpp/src/context.h (Context::DecryptFlags): New enum. (Context::EncryptionFlags): Extend for EncryptWrap. -- The setDecryptionFlags provides a generic way to set decryption flags for the whole context. This allows existing code to just keep using the old functions and modify the decryption behavior in a central place.
* core: New flags GPGME_DECRYPT_UNWRAP and GPGME_ENCRYPT_WRAP.Werner Koch2017-03-2420-75/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_ENCRYPT_WRAP): New const. (gpgme_decrypt_flags_t): New enum. (GPGME_DECRYPT_VERIFY): New const (GPGME_DECRYPT_UNWRAP): New const (gpgme_op_decrypt_ext_start): New func. (gpgme_op_decrypt_ext): New func. * src/decrypt-verify.c (gpgme_op_decrypt_ext_start): New. (gpgme_op_decrypt_ext): New. (decrypt_verify_start): Add arg FLAGS. Replace call to engine_op_decrypt_verify by the plain decrypt with the flag set. (gpgme_op_decrypt_verify_start): Pass the flag. (gpgme_op_decrypt_verify): Pass the flag. * src/decrypt.c (decrypt_start): Rename to ... (_gpgme_decrypt_start): this. Add arg FLAGS. Pass FLAGS to engine_op_decrypt. (gpgme_op_decrypt_start): Adjust for chnage pass 0 for FLAG. (gpgme_op_decrypt_start): Ditto. * src/engine.c (_gpgme_engine_op_decrypt_verify): Remove. (_gpgme_engine_op_decrypt): Add arg FLAGS. * src/gpgme.def, src/libgpgme.vers: Add new functions. * src/engine-backend.h (struct engine_ops): Remove member 'decrypt_verify'. Add FLAGS to 'decrypt'. Adjust all initialization. * src/engine-uiserver.c (uiserver_decrypt): Remove. (uiserver_decrypt_verify): Remove. (_uiserver_decrypt): Rename to ... (uiserver_decrypt): this. Replace arg VERIFY by new arg FLAGS. * src/engine-gpg.c (gpg_decrypt): Support GPGME_DECRYPT_UNWRAP. (gpg_encrypt): Support GPGME_ENCRYPT_WRAP. * tests/run-decrypt.c (main): New option --unwrap. * tests/run-encrypt.c (main): New option --wrap. -- Manual testing of that wrap/unwrap feature can be done this way: ./run-encrypt --verbose --key Alice /etc/motd > x ./run-decrypt --verbose --unwrap x > y ./run-encrypt --verbose --key Bob --wrap y > z 1. The message was first encrypted to Alice. 2. Alice decrypts the message receiving a valid OpenPGP message. 3. Alice encrypt that message to Bob This will also work with encrypted and signed messages; the signature will be kept intact during re-encryption. Requires GnuPG 2.1.12. Signed-off-by: Werner Koch <[email protected]>
* qt: Add test for Data::toKeysAndre Heinecke2017-03-221-0/+30
| | | | * lang/qt/tests/t-various.cpp (TestVarious::testKeyFromFile): New.
* cpp: Wrap keylist_from_dataAndre Heinecke2017-03-223-0/+30
| | | | | | | | * lang/cpp/data.h, lang/cpp/data.cpp (GpgME::Data::toKeys): New. -- Doing this in data instead of Context is a bit more idiomatic. But this could also be added to Context.
* qt: Initialize library first in testsAndre Heinecke2017-03-221-0/+2
| | | | | * lang/qt/tests/t-support.cpp (QGpgMETest::initTestCase): Initialize library.
* python: Improve Python detection.Justus Winter2017-03-221-2/+4
| | | | | | | | | | | * m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Prefer the generic 'pythonX' over 'pythonX.Y'. This way we select the users preferred version for both flavors. Prefer 'python' over 'python3' but not over 'python2' so that the algorithm still finds a 'python2' even if 'python' is a Python3. Fixes-commit: 5189c08af9468cdeb6f16a6ecd0fee53e1e3aa0e Signed-off-by: Justus Winter <[email protected]>
* core: New API gpgme_op_set_uid_flag.Werner Koch2017-03-219-32/+189
| | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_set_uid_flag_start): New. (gpgme_op_set_uid_flag_start): New. * src/gpgme.def, src/libgpgme.vers: Add them. * src/genkey.c (addrevuid_start): Change arg revoke to a flag. (gpgme_op_revuid_start): Pass GENKEY_EXTRAFLAG_REVOKE for the fomer revoke parameter. (gpgme_op_revuid): Ditto. (set_uid_flag): New. (gpgme_op_set_uid_flag_start): New. (gpgme_op_set_uid_flag): New. * src/engine.h (GENKEY_EXTRAFLAG_SETPRIMARY): new. * src/engine-gpg.c (gpg_adduid): Implement that flag. * tests/run-genkey.c (main): New command --set-primary. -- GnuPG-bug-id: 2931 Signed-off-by: Werner Koch <[email protected]>
* python: Wrap 'gpgme_op_keylist_from_data_start'.Justus Winter2017-03-216-5/+243
| | | | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): New keyword argument 'source'. If given, list keys from 'source'. * lang/python/gpgme.i: Wrap the argument to 'gpgme_op_keylist_from_data_start'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/support.py (EphemeralContext): Do not throw an error if no agent has been started in the context. * lang/python/tests/t-keylist-from-data.py: New file. Signed-off-by: Justus Winter <[email protected]>
* core: Extend gpgme_get_dirinfo to return the gpg-wks-client name.Werner Koch2017-03-213-1/+18
| | | | | | | | | * src/dirinfo.c (WANT_GPG_WKS_CLIENT_NAME): New const. (struct dirinfo): New field 'gpg_wks_client_name'. (get_gpgconf_item): Build it on demand. (gpgme_get_dirinfo): New value "gpg-wks-client-name" for WHAT. Signed-off-by: Werner Koch <[email protected]>
* core: New encryption flag GPGME_ENCRYPT_THROW_KEYIDS.Werner Koch2017-03-215-3/+24
| | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_ENCRYPT_THROW_KEYIDS): New flag. * src/engine-gpg.c (gpg_encrypt): Implement flag (gpg_encrypt_sign): Implement flag. * tests/run-encrypt.c (main): New option --throw-keyids. -- It would be nice to also selectively hide recipients (that is gpg --hidden-recipient) but our API does not ye allow this because it is based on key objects. A possible way to implement that would be a API to set processing flags into a key but this is complicated due to the reference counting and thus the possibility that a key object is used by different context. Signed-off-by: Werner Koch <[email protected]>
* core: New public API gpgme_op_keylist_from_data_start.Andre Heinecke2017-03-2117-8/+167
| | | | | | | | | | | | | | | | | * src/gpgme.h.in: New API gpgme_op_keylist_from_data_start. * src/libgpgme.vers, src/gpgme.def: Add it. * src/keylist.c (gpgme_op_keylist_from_data_start): New. * src/engine-backend.h (engine_ops): Add field 'keylist_data'. Change all engines to pass NULL for it. * src/engine.c (_gpgme_engine_op_keylist_data): New. * src/engine-gpg.c (gpg_keylist_data): New. (_gpgme_engine_ops_gpg): Register gpg_keylist_data. * tests/run-keylist.c (main): New option --from-file. -- Co-authored-by: Werner Koch <[email protected]> GnuPG-bug-id: 2819
* core,cpp: New key flag 'is_de_vs'.Werner Koch2017-03-207-6/+57
| | | | | | | | | | | | | | * src/gpgme.h.in (_gpgme_subkey): New flag is_de_vs. * tests/run-keylist.c (main): Print that flag. * src/keylist.c (parse_pub_field18): New. (keylist_colon_handler): Parse compliance flags. * lang/cpp/src/key.cpp (Key::isDeVs): New. (Subkey::isDeVs): New. * lang/cpp/src/key.h (class Key): New method isDeVs. (class Subkey): New method isDeVs. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix distcheck.Justus Winter2017-03-201-1/+2
| | | | | | | | * tests/start-stop-agent: Do not create 'gpg-agent.conf' if it does not exist. Fixes-commit: 16b202d9999591b71fb8bb49f6db10ef96d4cbe8 Signed-off-by: Justus Winter <[email protected]>
* python: Fix version check.Justus Winter2017-03-201-1/+3
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Cope with non-released versions. Fixes-commit: e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6 Signed-off-by: Justus Winter <[email protected]>
* tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.Justus Winter2017-03-202-1/+8
| | | | | | | | | | | * lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the option. This breaks gpg-agent from GnuPG 2.0. * tests/start-stop-agent: Rather, check if the option is supported and add it to the configuration if it is. GnuPG-bug-id: 3008 Fixes-commit: bbf19124bbec9eb6298cef2914baae7ac74382fe Signed-off-by: Justus Winter <[email protected]>
* python: Skip tests if GnuPG is too old.Justus Winter2017-03-207-0/+16
| | | | | | | | | | | | | | * lang/python/tests/support.py (assert_gpg_version): New function. * lang/python/tests/t-callbacks.py: Use the new function to skip the test if GnuPG is too old. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-quick-key-creation.py: Likewise. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-key-signing.py: Likewise. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* python: Remove superfluous initialization.Justus Winter2017-03-2021-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (init_gpgme): Remove. This is an remnant from the c tests. Nowadays, the Python bindings initialize GPGME automagically. * lang/python/tests/initial.py: Remove call to 'support.init_gpgme'. * lang/python/tests/t-callbacks.py: Likewise. * lang/python/tests/t-decrypt-verify.py: Likewise. * lang/python/tests/t-decrypt.py: Likewise. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-large.py: Likewise. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-idiomatic.py: Likewise. * lang/python/tests/t-import.py: Likewise. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. * lang/python/tests/t-verify.py: Likewise. * lang/python/tests/t-wait.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Make error message more helpful.Justus Winter2017-03-141-6/+11
| | | | | | | * lang/python/tests/run-tests.py: Make the error message shown when we cannot locate the python module in the build tree more helpful. Signed-off-by: Justus Winter <[email protected]>
* python: Make tests more robust.Justus Winter2017-03-141-11/+10
| | | | | | | | | * lang/python/tests/support.py (TemporaryDirectory): Always use our own version even if 'tempfile.TemporaryDirectory' is provided, because we need to use 'shutil.rmtree(..., ignore_errors=True)' to avoid it tripping over gpg-agent deleting its own sockets. Signed-off-by: Justus Winter <[email protected]>
* python: Improve build system integration.Justus Winter2017-03-141-11/+10
| | | | | | | * lang/python/Makefile.am: Use 'set -e' when chaining shell commands together in rules. Signed-off-by: Justus Winter <[email protected]>
* build: Improve Python detection.Justus Winter2017-03-141-14/+24
| | | | | | | * configure.ac: Do not error out too early if we don't find a matching Python version. We handle this case later. Signed-off-by: Justus Winter <[email protected]>
* build: Tune M4 macros for our needs.Justus Winter2017-03-142-4/+7
| | | | | | | | | | * m4/ax_python_devel.m4: Do not emit 'HAVE_PYTHON'. * m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Add newer Python versions, drop older ones. Also, sort the list with older versions at the front, newer and generic versions towards the end. This makes the algorithm pick the lowest version that meets the version requirement. Signed-off-by: Justus Winter <[email protected]>
* build: Add M4 macros for python.Justus Winter2017-03-141-0/+239
| | | | | | * m4/python.m4: New file. Signed-off-by: Justus Winter <[email protected]>
* qt: Add test for DN parserAndre Heinecke2017-03-131-0/+10
| | | | | | | | * qt/tests/t-various.cpp (testDN): New. -- A simple test for the DN parser that would have caught the new / free mismatch fixed in 9d5048d4.
* qt: Use gpgrt_asprintf instead of qstrdupAndre Heinecke2017-03-131-2/+2
| | | | | | | | | * lang/qt/src/dn.cpp (parse_dn_part): Use gpgrt_asprintf instead of qstrdup. -- This fixes a new / free mismatch because qstrdup uses new and the allocated parts are freed with free. Similar to: a09ed3f2
* core: Fix status error return for gpgsm.Werner Koch2017-03-092-4/+11
| | | | | | | | | | | * src/engine-gpgsm.c (gpgsm_assuan_simple_command): Make sure CB_ERR is returned. * src/import.c (parse_import_res): Do not return an error for the last field. (import_status_handler): Actually return the error from parse_import_res. Signed-off-by: Werner Koch <[email protected]>
* python: Print path of the Python module used during tests.Justus Winter2017-03-021-0/+3
| | | | | | | | * lang/python/tests/initial.py: Print path of the Python module used during tests. Useful to detect if by any mistake the wrong module is picked up. Signed-off-by: Justus Winter <[email protected]>
* core: Fix minor code style thing.Werner Koch2017-03-021-1/+1
| | | | | | | * src/engine-gpg.c (gpg_add_algo_usage_expire): Use double parenthesis for bit tests. Signed-off-by: Werner Koch <[email protected]>
* Revert "core: Fix error types."Werner Koch2017-03-024-7/+5
| | | | | | | | | | | | -- This reverts commit 6df6e01ed5a581765d245bf7303cda4497d0eb22. gpgme_error_t et al are from a time where we had no hard dependency on libgpg-error. Now libgpg-error is a required and thus it does not make sense to have these surrogates. In fact we should ventually completely remove them. Signed-off-by: Werner Koch <[email protected]>
* cpp: Add subkey keygrip to APIAndre Heinecke2017-03-023-1/+9
| | | | | * lang/cpp/src/key.cpp (Subkey::keyGrip): New. * lang/cpp/src/key.h: Update accordingly.
* cpp: Add interactor to generate keys on smartcardAndre Heinecke2017-03-015-1/+411
| | | | | | | | * lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse): Handle new states. * lang/cpp/src/gpggencardkeyinteractor.cpp, lang/cpp/src/gpggencardkeyinteractor.h: New. * lang/cpp/src/Makefile.am: Update accordingly.
* qt: Allow creation of default keys without nameAndre Heinecke2017-03-011-3/+8
| | | | | * lang/qt/src/defaultkeygenerationjob.cpp (DefaultKeyGenerationJob::start): Handle empty name and email.
* doc: Correct documentation for recp arg of gpgme_op_encrypt_sign_startDaniel Kahn Gillmor2017-02-261-1/+1
| | | | | | | * doc/gpgme.texi (gpgme_op_encrypt_sign_start): recp is an array of gpgme_key_t, not a single element. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* python: Fix test.Justus Winter2017-02-201-1/+2
| | | | | | | | | * lang/python/tests/t-quick-key-manipulation.py: Modify the configuration file in the ephemeral home directory, not the one used by all the tests. Fixes-commit: 15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5 Signed-off-by: Justus Winter <[email protected]>
* python: Support manipulating the TOFU policy.Justus Winter2017-02-179-5/+103
| | | | | | | | | | | | | | * NEWS: Update. * doc/gpgme.texi: Fix typos. * lang/python/gpg/constants/__init__.py: Import new files. * lang/python/gpg/constants/tofu/__init__.py: New file. * lang/python/gpg/constants/tofu/policy.py: New file. * lang/python/gpg/core.py (Context.key_tofu_policy): New function. * lang/python/gpgme.i: Nice reprs for gpgme_tofu_info_t. * lang/python/setup.py.in: Install new package. * lang/python/tests/t-quick-key-manipulation.py: Extend test. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key signing.Justus Winter2017-02-177-8/+195
| | | | | | | | | | | | | * NEWS: Update. * doc/gpgme.texi (gpgme_op_keysign): Fix the description of the 'expire' argument. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/keysign.py: New file. * lang/python/gpg/core.py (Context.key_sign): New function. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-quick-key-signing.py: New test. Signed-off-by: Justus Winter <[email protected]>
* python: Fix teardown of ephemeral contexts.Justus Winter2017-02-174-260/+250
| | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (EphemeralContext): New function. * lang/python/tests/t-quick-key-creation.py: Use the new function to manage ephemeral contexts. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-subkey-creation.py: Likewise. -- Previously, there was a problem with cleaning up ephemeral home directories. shutil.rmtree deleted the agents main socket, gpg-agent detected that, and deleted the other sockets as well, racing shutil.rmtree which did not cope will with that. Fix this by asking the agent nicely to shut down. Signed-off-by: Justus Winter <[email protected]>
* python: Fix using strings as commands in the assuan protocol.Justus Winter2017-02-172-4/+7
| | | | | | | | | * lang/python/gpg/core.py (Context.assuan_transact): Fix testing whether the command is a string on Python2. * lang/python/tests/t-protocol-assuan.py: Improve the test to detect this problem. Signed-off-by: Justus Winter <[email protected]>
* python: Support adding and revoking UIDs.Justus Winter2017-02-164-1/+131
| | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.key_add_uid): New function. (Context.key_revoke_uid): Likewise. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-key-manipulation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick subkey creation.Justus Winter2017-02-164-1/+196
| | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.create_subkey): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-subkey-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key creation.Justus Winter2017-02-167-5/+276
| | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/create.py: New file. * lang/python/gpg/core.py (Context.create_key): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/support.py (TemporaryDirectory): New class. * lang/python/tests/t-quick-key-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix passphrase callback wrapping.Justus Winter2017-02-161-1/+15
| | | | | | | * lang/python/helpers.c (pyPassphraseCb): Cope with 'passphrase_info' being NULL. Signed-off-by: Justus Winter <[email protected]>