aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* cpp: Get rid of AssuanResult due to its deprecation.Werner Koch2016-08-246-203/+40
| | | | | | | | | | | | | | * lang/cpp/src/assuanresult.cpp: Remove. * lang/cpp/src/assuanresult.h: Remove. * lang/cpp/src/Makefile.am: Remove these files. * lang/cpp/src/context.cpp: Remove header assuanresult.h (assuanTransact): Change return type to Error. Use gpgme_op_assuan_transact_ext. (startAssuanTransaction): Change return type to Error. (assuanResult): Remove * lang/cpp/src/context.h (assuanResult): Adjust for changes. Signed-off-by: Werner Koch <[email protected]>
* Qt: Adapt (disabled) tofuinfo test to new APIAndre Heinecke2016-08-241-49/+60
| | | | | | | | * lang/qt/tests/t-tofuinfo.cpp: Switch to UID based API. -- Test is still disabled as GnuPG still returns unexpected results.
* Cpp: Add Key to signatureAndre Heinecke2016-08-242-0/+20
| | | | | * lang/cpp/src/verificationresult.cpp, lang/cpp/src/verificationresult.h (Signature::key): New.
* Cpp: Use fpr field for primaryFingerprintAndre Heinecke2016-08-241-5/+10
| | | | | | | | | | * lang/cpp/src/key.cpp (Key::primaryFingerprint): Return fpr value if available. -- Should not be necessary but we might have an incomplete key without subkeys but the fingerprint already set in gpgme's data type.
* Cpp: Move tofuinfo from signature to useridAndre Heinecke2016-08-237-72/+17
| | | | | | | | | | | | | | * lang/cpp/src/key.cpp (UserID::tofuInfo): New. * lang/cpp/src/key.h: Update accordingly. * lang/cpp/src/tofuinfo.cpp: Remove dropped fields. * lang/cpp/src/tofuinfo.h: Update accordingly. * lang/cpp/src/verificationresult.cpp, lang/cpp/src/verificationresult.h: Remove tofu info. * lang/qt/tests/t-tofuinfo.cpp: Disable for now. -- With be4ff75d7 Tofu info now lives with a UserID Object. While this breaks API it was not yet released.
* core: Put the protocol into a TOFU created key object.Werner Koch2016-08-231-2/+3
| | | | | | | | * src/verify.c (parse_tofu_user): Add arg 'protocol' and store it in the KEY. (_gpgme_verify_status_handler): Pass protocol. Signed-off-by: Werner Koch <[email protected]>
* core: Change the way TOFU information are represented.Werner Koch2016-08-239-121/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_signature): Remove field 'tofu'. Add field 'key'. (struct _gpgme_key): Add field 'fpr'. (struct _gpgme_user_id): Add field 'tofu'. (struct _gpgme_tofu_info): Remove fields 'address' and 'fpr'. * src/key.c (gpgme_key_unref): Release TOFU and FPR. * src/keylist.c (keylist_colon_handler): Store the fingerprint of the first subkey also in KEY. * src/verify.c (release_tofu_info): Remove. (release_op_data): Release KEY. (parse_tofu_user): Rewrite for new data structure. (parse_tofu_stats): Ditto. (parse_tofu_stats_long): Ditto. * tests/run-verify.c (print_result): Ditto. * tests/run-keylist.c (main): Print more fields. -- TOFU information are now associated with the user ID and not with a separate object. Note that this breaks code relying on the former non-released TOFU feature. The C++ bindings won't work right now. Signed-off-by: Werner Koch <[email protected]>
* core: Extend gpgme_user_id_t with 'address'.Werner Koch2016-08-235-25/+62
| | | | | | | | | * src/mbox-util.c, src/mbox-util.h: Adjust for use in gpgme. * src/Makefile.am (main_sources): Add mbox-util. * src/key.c (_gpgme_key_append_name): Set 'address' field of uid. (gpgme_key_unref): Free it. Signed-off-by: Werner Koch <[email protected]>
* core: New code for parsing mail addresses.Werner Koch2016-08-222-0/+268
| | | | | | | | | | | | | | * src/mbox-util.c: New. * src/mbox-util.h: New. -- The files haven been copied verbatim from GnuPG 2.1.15 commit 54245979e691129ed9d3a6c642087fb8d3227449 after the license has been changed in GnuPG. We need this file too match GnuPG's idea of a mail address. Signed-off-by: Werner Koch <[email protected]>
* core: Add new items for gpgme_get_dirinfo.Werner Koch2016-08-223-5/+104
| | | | | | | | | | | | | * src/dirinfo.c (WANT_SYSCONFDIR, WANT_LIBEXECDIR, WANT_LIBDIR): New. (WANT_DATADIR, WANT_LCOALEDIR, WANT_AGENT_SSH_SOCKET): New (WANT_DIRMNGR_SOCKET): New. (dirinfo): Add fields 'sysconfdir', 'bindir', 'libexecdir', 'libdir', 'datadir', 'localedir', 'agent_ssh_socket', and 'dirmngr_socket'. (parse_output): Set these fields. (get_gpgconf_item): Return them. (gpgme_get_dirinfo): Likewise. Signed-off-by: Werner Koch <[email protected]>
* core: Base gpgme_get_dirinfo(uiserver-socket) on the socket dir.Werner Koch2016-08-221-10/+23
| | | | | | | * src/dirinfo.c (dirname_len): New. (parse_output): Change computation of UISRV_SOCKET. Signed-off-by: Werner Koch <[email protected]>
* core: New commands --lang and --have-lang for gpgme-configWerner Koch2016-08-213-10/+40
| | | | | | | | * configure.ac (GPGME_CONFIG_AVAIL_LANG): New ac_subst. * src/gpgme-config.in (avail_lang): Add commands --lang and --have-lang. Signed-off-by: Werner Koch <[email protected]>
* core: Remove (now) useless diagnosticAndre Heinecke2016-08-181-2/+0
| | | | | | | | | | | * src/w32-io.c(_gpgme_io_spawn): Remove spawnhelper not found diagnostic. -- When spawnhelper is not found the error is now catched before the CreateProcess call so the added diagnostic in bb2d11c (which was not helpful because the value for spawnhelper would be NULL in that case) is now no longer needed.
* core: Fail loudly in case w32 spawner not foundAndre Heinecke2016-08-181-0/+26
| | | | | | | | | | | | | | | | * src/w32-io.c (_gpgme_io_spawn): Show a message box in case gpgme-w32spawn.exe not found. -- Otherwise every engine call will just fail with unsupported protocol. Even in the debug output the problem was not made clear because CreateProcess will fail with error code 87 (Invalid Parameter) because spawnhelper is NULL. The helpful error message for ERROR_INVALID_PARAMETER would have been: "is 'NULL' correctly installed" As GpgME basically becomes useless on Windows without the spawnhelper we want to fail very loud in that case.
* Cpp: Fix some pedantic warningsAndre Heinecke2016-08-173-4/+4
| | | | | | | * lang/cpp/src/context.cpp, lang/cpp/src/context.h (Context::getKeysFromRecipients): Remove ignored / invalid const qualifier. * lang/cpp/src/result.h: Don't shadow error function in ctor.
* core: New global flag "require-gnupg".Werner Koch2016-08-166-6/+61
| | | | | | | | | | | * src/gpgme.c (gpgme_set_global_flag): Add flag. * src/engine.c (engine_minimal_version): New variable. (_gpgme_set_engine_minimal_version): New function. (gpgme_get_engine_info): Check that flag. * tests/run-keylist.c (main): New option --require-gnupg. Signed-off-by: Werner Koch <[email protected]>
* core: Simplify setting of dummy versions.Werner Koch2016-08-165-14/+42
| | | | | | | | | | | | | | | | * src/engine.c (_gpgme_engine_info_release): Do not assert but free FILE_NAME. (gpgme_get_engine_info): Provide default for VERSION and REQ_VERSION. Use calloc instead of malloc. (_gpgme_set_engine_info): Ditto. * src/engine-assuan.c (llass_get_version): Return NULL. (llass_get_req_version): Ditto. * src/engine-spawn.c (engspawn_get_version): Ditto. (engspawn_get_req_version): Ditto. * src/engine-uiserver.c (uiserver_get_version): Ditto. (uiserver_get_req_version): Ditto. Signed-off-by: Werner Koch <[email protected]>
* Qt: Add test for progress signal of encryptjobAndre Heinecke2016-08-121-0/+62
| | | | | | | | * lang/qt/tests/t-encrypt.cpp (testProgress): New. -- This tests that a ByteArray IODevice now gives proper progress signals.
* Cpp: Provide size-hint for seekable and mem dataAndre Heinecke2016-08-121-0/+10
| | | | | | | | | * lang/cpp/src/data.cpp (GpgME::Data::Data): Set size-hint for mem and DataProvider based Data. -- This fixes the case that QGpgME did not have a total value for progress as the size was unknown.
* core: Make use of the "size-hint" in engine-gpg.Werner Koch2016-08-123-4/+134
| | | | | | | | | | | | | | * src/engine-gpg.c: Include data.h. (add_input_size_hint): New. (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign) (gpg_verify): Call new function, * tests/run-encrypt.c (status_cb): Print to stderr. (progress_cb): New.o (main): Add option --progress. Print full-status lines. Provide a size for the input data. Signed-off-by: Werner Koch <[email protected]>
* core: Add gpgme_data_set_flag to add more meta data to data objects.Werner Koch2016-08-128-0/+68
| | | | | | | | | | | * src/gpgme.h.in (gpgme_data_set_flag): New public function. * src/data.c (gpgme_data_set_flag): New. (_gpgme_data_get_size_hint): New. * src/data.h (strucy gpgme_data): Add field 'size_hint'. * src/gpgme.def, src/libgpgme.vers: Add new function. * src/conversion.c (_gpgme_string_to_off): New. Signed-off-by: Werner Koch <[email protected]>
* Add Python bindings to NEWS.Justus Winter2016-08-121-0/+2
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Qt: Fix defaultkeygenerationjob buildAndre Heinecke2016-08-121-0/+2
| | | | * lang/qt/src/defaultkeygenerationjob.cpp: Include moc.
* Qt: Add DefaultKeyGenerationJobAndre Heinecke2016-08-113-4/+207
| | | | | | | | | | | | | | | | | | | * lang/qt/src/defaultkeygenerationjob.cpp, lang/qt/src/defaultkeygenerationjob.h: New. * lang/qt/src/Makefile.am: Update accordingly. -- The defaultkeygenerationjob makes it easier to just generate a key in the future this should probably use quick-gen key but since this is not exposed in gpgme we hardcode the defaults and do it with the params file. This is also the first job that uses a new and better architecture without backend abstraction and the pimpl pattern instead of a specialized subclass. This is an adoption of kde's libkleo commit f49b7157 Thanks [email protected]
* Qt: Ensure all public classes are exportedAndre Heinecke2016-08-1113-15/+29
| | | | | | | | | | | | | | | | | | | | * src/abstractimportjob.h, src/cryptoconfig.h, src/deletejob.h, src/exportjob.h, src/importfromkeyserverjob.h, src/importjob.h, src/keygenerationjob.h, src/keylistjob.h, src/listallkeysjob.h, src/refreshkeysjob.h, src/signencryptjob.h, src/specialjob.h, src/verifydetachedjob.h: Export classes. -- This is an adoption of kde's libkleo commit: d6a71a4e Thanks [email protected]
* Qt: Add KeyForMailboxJobAndre Heinecke2016-08-119-4/+399
| | | | | | | | | | | | | | | | * lang/qt/src/job.cpp: Include moc and make subclass. * lang/qt/src/keyformailboxjob.h, lang/qt/src/qgpgmekeyformailboxjob.cpp, lang/qt/src/qgpgmekeyformailboxjob.h: New. * lang/qt/tests/run-keyformailboxjob.cpp: New manual test. * lang/qt/tests/Makefile.am: Add run-keyformailboxjob. * lang/qt/src/Makefile.am: Update accordingly. * lang/qt/src/protocol.h, lang/qt/src/protocol_p.h: Add keyformailboxjob. -- The KeyForMailboxjob can be used to determine the best key to use to encrypt something to a given mail address.
* doc: Get rid of version.texiWerner Koch2016-08-104-3/+354
| | | | | | | | | | | | | | | | | * configure.ac (CC_FOR_BUILD): New. * doc/mkdefsinc.c: New. Taken from GnuPG and modified for gpgme. * doc/Makefile.am (EXTRA_DIST): Add defsincdate and mkdefsinc.c (BUILT_SOURCES): new. (gpgme.texi): New dependency. (mkdefsinc, defsincdate, defs.inc): New rules. (dist-hook): New. * doc/gpgme.texi: Include defs.inc. Remove version.texi. -- GnuPG-bug-id: 2352 That new system should also yield more approriate date infos for the manual.
* build: Declare all languages for make dist.Werner Koch2016-08-102-0/+4
| | | | | | * lang/Makefile.am (DIST_SUBDIRS): New. Signed-off-by: Werner Koch <[email protected]>
* core: Do not identify PNG files as PGP signatures.Werner Koch2016-08-101-0/+5
| | | | | | | | * src/data-identify.c (next_openpgp_packet): Blacklist PNG files. -- GnuPG-bug-id: 2314 Signed-off-by: Werner Koch <[email protected]>
* Cpp: Handle empty recipients consistentlyAndre Heinecke2016-08-102-38/+38
| | | | | | | | | | | | | | * lang/cpp/src/context.cpp (Context::getKeysFromRecipients): New helper. (Context::encrypt, Context::startEncryption, Context::signAndEncrypt) (Context::startCombinedSigningAndEncryption): Use new helper. * lang/cpp/src/context.h (Context::getKeysFromRecipients): Add as private helper. -- bf776ce was incomplete as the code to handle recpients was duplicated four times. This is now unified and constently uses a nullptr instead of an empty array.
* core: Handle ENCRYPT_SYMMETRIC also for sig & encAndre Heinecke2016-08-101-4/+7
| | | | | * src/engine-gpg.c (gpg_encrypt_sign): Handle ENCRYPT_SYMMETRIC flag.
* Qt: Remove unused variableAndre Heinecke2016-08-101-1/+1
| | | | | * lang/qt/src/qgpgmerefreshkeysjob.cpp (slotStatus): Remove unused variable typ.
* Qt: Create TestPassphraseProvider on stackAndre Heinecke2016-08-102-4/+7
| | | | | | | | * lang/qt/tests/t-encrypt.cpp, lang/qt/tests/t-tofuinfo.cpp: Create TestPassphraseProvider on stack. -- Context does not delete the provider. This fixes ASAN errors.
* Cpp: Clarify ownership of provider classesAndre Heinecke2016-08-101-0/+14
| | | | | * lang/cpp/src/context.h: Note that the context does not take ownership of providers.
* tests: Fix memory leak.Justus Winter2016-08-101-0/+1
| | | | | | * tests/gpg/t-encrypt-mixed.c (main): Free 'text2'. Signed-off-by: Justus Winter <[email protected]>
* core: Ensure err is initalized in gpg_encryptAndre Heinecke2016-08-101-1/+1
| | | | * src/engine-gpg.c (gpg_encrypt): Initialize err.
* Qt: Fix t-keylist moc includeAndre Heinecke2016-08-101-1/+0
| | | | | | | | | * lang/qt/tests/t-keylist.cpp: Don't include t-support.moc -- Accidental leftover from trying to generate t-support moc from another cpp file. This was solved instead by a new rule to generate moc files from the header.
* Qt: Clean up debug output in testsAndre Heinecke2016-08-091-2/+1
| | | | | * lang/qt/tests/t-support.cpp: Remove accidentally commited debug output.
* Qt: Add encryption test and refactor testsuiteAndre Heinecke2016-08-098-46/+302
| | | | | | | | | | | | * lang/qt/tests/Makefile.am: Add t-encrypt and t-support. * lang/qt/tests/t-support.cpp, lang/qt/tests/t-support.c (QGpgMETest): New. Class to handle common cleanup / init. * lang/qt/tests/t-keylist.cpp, lang/qt/tests/t-keylocate.cpp, lang/qt/tests/t-ownertrust.cpp, lang/qt/tests/t-tofuinfo.cpp: Inherit QGpgMETest. * lang/qt/tests/t-encrypt.cpp: New. Test Symetric and Asymectric encryption. Mixed encryption test is disabled.
* Qt: Add support for EncryptJobs with generic flagsAndre Heinecke2016-08-096-22/+100
| | | | | | | | | | | | | | * lang/qt/src/encryptjob.h, lang/qt/src/signencryptjob.h, lang/qt/src/qgpgmeencryptjob.h, lang/qt/src/qgpgmeencryptjob.cpp, lang/qt/src/qgpgmesignencryptjob.cpp, lang/qt/src/qgpgmeencryptjob.cpp: Add start and exec overloads that accept generic EncryptFlags. -- While this technically is an ABI break (vtable change) there are no known classes outside qgpgme that inherit encryptjob or signencryptjob. And the new functions should be added to the bottom of the vtable.
* Cpp: Add support for all EncryptionFlagsAndre Heinecke2016-08-092-1/+26
| | | | | * lang/cpp/src/context.h (EncryptionFlags): Extend. * lang/cpp/src/context.cpp (encryptflags2encryptflags): Ditto.
* Cpp: Fix simple symmetric encryptionAndre Heinecke2016-08-091-1/+2
| | | | | | | | * lang/cpp/src/context.cpp (Context::encrypt): If no recipients are provided encrypt with NULL and not an empty array. -- Sending an empty array leads to an invalid argument error.
* core: Add support for mixed symmetric and asym encAndre Heinecke2016-08-097-7/+154
| | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_encrypt_flags_t): New flag GPGME_ENCRYPT_SYMMETRIC. * src/engine-gpg.c (gpg_encrypt): Also add --symmetric if the flag is given. * NEWS: Mention new flag. * tests/run-encrypt.c (show_usage): Extend for --symmetric. (main): Handle --symmetric. (main): Set passphrase_cb in loopback mode. (main): Fix encrypt call if no recipients are given. * tests/gpg/t-encrypt-mixed.c: New. * tests/gpg/Makefile.am (c_tests): Add new test. * doc/gpgme.texi: Document new flag.
* core: Let GPGME_PROTOCOL_ASSUAN pass Assuan comments through.Werner Koch2016-08-081-0/+1
| | | | | | | | * src/engine-assuan.c (llass_new): Set ASSUAN_CONVEY_COMMENTS, -- GnuPG-bug-id: 2429 Signed-off-by: Werner Koch <[email protected]>
* Prepend LD_LIBRARY_PATH for python testsAndre Heinecke2016-08-081-1/+1
| | | | | | | | | | | * lang/python/tests/Makefile.am (TESTS_ENVIRONMENT): Prepend path instead of setting the value. -- This fixes the case where tools / libararies are needed for a working GnuPG system that are pointed to by LD_LIBRARY_PATH. E.g. GnuPG itself is installed in a custom prefix and PATH / LD_LIBRARY_PATH is set accordingly.
* python: Clean up and modernize examples.Justus Winter2016-08-0514-500/+360
| | | | | | | | | | | | | | | | | | | | * lang/python/examples/Examples.rst: Delete file. * lang/python/examples/t-edit.py: Likewise. This is actually a test case and has been moved to 'tests'. * lang/python/examples/assuan.py: New file. * lang/python/examples/decryption-filter.py: Likewise. * lang/python/examples/delkey.py: Modernize. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/exportimport.py: Likewise. * lang/python/examples/genkey.py: Likewise. * lang/python/examples/inter-edit.py: Likewise. * lang/python/examples/sign.py: Likewise. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/testCMSgetkey.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* core: Extend gpgme_subkey_t to carry the keygrip.Werner Koch2016-08-046-10/+76
| | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_subkey): Add file 'keygrip'. * src/key.c (gpgme_key_unref): Free KEYGRIP. * src/keylist.c (keylist_colon_handler): Parse GRP records. * src/engine-gpg.c (gpg_keylist_build_options): Do not use --with-fingerprint options for gpg versions >= 2.1.15. * tests/run-keylist.c (main): Print subkeys and keygrips. Signed-off-by: Werner Koch <[email protected]>
* python: Add a nicer interface to list keys.Justus Winter2016-08-032-1/+16
| | | | | | | * lang/python/pyme/core.py (Context.keylist): New method. * lang/python/tests/t-keylist.py: Test new method. Signed-off-by: Justus Winter <[email protected]>
* python: Add a flag identifying in-tree builds.Justus Winter2016-08-024-1/+24
| | | | | | | | | | * lang/python/helpers.c (pyme_in_tree_build): New variable. * lang/python/helpers.h (pyme_in_tree_build): New declaration. * lang/python/pyme/version.py.in (in_tree_build): New variable. * lang/python/setup.py.in: Rework macro handling, set 'IN_TREE_BUILD' as appropriate. Signed-off-by: Justus Winter <[email protected]>
* python: Fix build system integration.Justus Winter2016-08-021-3/+17
| | | | | | | * lang/python/Makefile.am: Be more careful when cleaning the build directory, we must not delete the generated file 'pyme/version.py'. Signed-off-by: Justus Winter <[email protected]>