aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python: Share generated methods between objects.justus/pyme3Justus Winter2016-05-122-10/+18
| | | | | | | | * lang/python/pyme/util.py (GpgmeWrapper.__getattr__): Monkey-patch the class. * lang/python/tests/t-wrapper.py: Demonstrate the sharing. Signed-off-by: Justus Winter <[email protected]>
* python: Raise exceptions on write errors.Justus Winter2016-05-122-1/+8
| | | | | | | * lang/python/pyme/core.py (Data.write): Handle errors. * lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function. Signed-off-by: Justus Winter <[email protected]>
* python: Fix writing to data buffers.Justus Winter2016-05-124-3/+71
| | | | | | | | | * lang/python/gpgme.i: Add typemap for buffers. * lang/python/pyme/core.py (Data.write): Fix function. * lang/python/tests/Makefile.am: Add new test. * lang/python/tests/t-data.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Add a test suite.Justus Winter2016-05-124-1/+47
| | | | | | | | | * configure.ac: Add new Makefile. * lang/python/Makefile.am: Add subdirectory. * lang/python/tests/Makefile.am: New file. * lang/python/tests/t-wrapper.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Cache generated wrapper functions.Justus Winter2016-05-121-3/+6
| | | | | | | * lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper functions. Signed-off-by: Justus Winter <[email protected]>
* python: Fix function invocation.Justus Winter2016-05-121-1/+1
| | | | | | | * lang/python/pyme/core.py (Data.new_from_fd): Fix function invocation. Signed-off-by: Justus Winter <[email protected]>
* python: Fix name of exception, make slot methods explicit.Justus Winter2016-05-121-1/+18
| | | | | | | | | * lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception, add docstring. (GpgmeWrapper._getnameprepend): New function. (GpgmeWrapper._errorcheck): Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Handle interpreter shutdown.Justus Winter2016-05-121-8/+22
| | | | | | | | | * lang/python/pyme/core.py: Avoid races at interpreter shutdown. This silences the most annoying occurrences, however this problem also affects the SWIG generated code, which might indicate that the real problem is somewhere else. If so, this change can be easily reverted. Signed-off-by: Justus Winter <[email protected]>
* python: Make test case more robust.Justus Winter2016-05-121-0/+4
| | | | | | * lang/python/examples/t-edit.py: Check if key is found. Signed-off-by: Justus Winter <[email protected]>
* python: Fix type translation.Justus Winter2016-05-123-27/+41
| | | | | | | | | | | | * lang/python/gpgme.i: Adjust to Python3's string type being 'Unicode', not 'bytes'. Fix type checking. * lang/python/core.py (Data.write): Add docstring mentioning the expected type of parameter 'buffer'. (Data.read): Adjust read loop. Also, use a saner chunk size, and join all chunks at the end instead of adding them. * lang/python/examples/simple.py: Adjust example. Signed-off-by: Justus Winter <[email protected]>
* python: Fix simple example.Justus Winter2016-05-111-1/+2
| | | | | | | * lang/python/examples/simple.py: Flush stdout, encode name as UTF-8 before passing it to GPGME. Signed-off-by: Justus Winter <[email protected]>
* python: Integrate into the build system.Justus Winter2016-05-115-31/+294
| | | | | | | | | | * configure.ac: Make Python bindings configurable, add new Makefile. * lang/python/Makefile.am: New file. * lang/python/setup.py: Integrate into the build system. * m4/ax_pkg_swig.m4: New file from the autoconf archive. * m4/m4_ax_swig_python.m4: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: PEP8 fixes.Justus Winter2016-05-104-33/+38
| | | | | | Cherry picked from 0267c151. Signed-off-by: Justus Winter <[email protected]>
* python: Delete trailing whitespace.Justus Winter2016-05-1014-78/+74
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Drop Debian packaging.Justus Winter2016-05-107-261/+0
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Rename bindings.Justus Winter2016-05-1054-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Merge branch 'master' into justus/pyme3Justus Winter2016-05-1064-979/+3293
|\
| * Allow cc to detect missing cases in a switch.Werner Koch2016-05-101-2/+2
| | | | | | | | | | | | | | * src/delete.c (delete_status_handler): Remove default case from a switch so that cc can check the use of all enum values. Signed-off-by: Werner Koch <[email protected]>
| * Fix possible _SC_OPEN_MAX max problem on AIX.Werner Koch2016-01-151-0/+13
| | | | | | | | | | | | | | | | * src/posix-io.c [HAVE_STDINT_H]: Include stdint.h. (get_max_fds): Limit returned value for too high values. -- Signed-off-by: Werner Koch <[email protected]>
| * w32: Avoid conflict with Mingw-w64 version 4.0.4-1Werner Koch2015-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | * src/w32-util.c (mkstemp): Rename to my_mkstemp. Change caller. -- For some reason the linker seems to use the mkstemp now provided by mingw instead of our static symbol. Strange. Reported-by: Andrej Kacian <[email protected]> Signed-off-by: Werner Koch <[email protected]>
| * Return on user cancellation of delete operationDaiki Ueno2015-12-041-0/+32
| | | | | | | | | | | | | | * src/delete.c (delete_status_handler): Return on ERROR status, if the error location is set to "delete_key.secret" and the code is either CANCELED or FULLY_CANCELED, which indicates a situation that the user selected "No" on the confirmation dialog.
| * doc: Fix minor errorsDaiki Ueno2015-12-041-15/+15
| | | | | | | | | | | | | | * doc/gpgme.texi: Fix errors and typos in the cancellation and gpgme_import_result_t documentation. Signed-off-by: Daiki Ueno <[email protected]>
| * Fix typos found by codespell.Justus Winter2015-12-028-13/+13
| | | | | | | | | | -- Signed-off-by: Justus Winter <[email protected]>
| * Make use of user passphrase handler during passwd.Ben Kibbey2015-10-291-0/+8
| | | | | | | | | | | | | | | | * src/passwd.c (passwd_start): set engine passphrase command handler. -- This allows for inquiring a passphrase when changing a passphrase rather than requiring a pinentry.
| * w32: Add extra diagnostic about possible missing gpgme-w32spawn.exe.Werner Koch2015-10-281-2/+7
| | | | | | | | | | | | * src/w32-io.c (_gpgme_io_spawn): Add a new diagnostic. Signed-off-by: Werner Koch <[email protected]>
| * w32: Improve locating gpgconf on 64 bit systems.Werner Koch2015-10-281-2/+7
| | | | | | | | | | | | | | * src/w32-util.c (find_program_at_standard_place): Fallback to CSIDL_PROGRAM_FILESX86. Signed-off-by: Werner Koch <[email protected]>
| * w32: Add new global flag "w32-inst-dir".Werner Koch2015-10-285-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_global_flag): Add flag "w32-inst-dir"; * src/posix-util.c (_gpgme_set_override_inst_dir): New stub. * src/w32-util.c (override_inst_dir): New var. (_gpgme_get_inst_dir): Return this var is set. (_gpgme_set_override_inst_dir): New. -- See https://lists.gnupg.org/pipermail/gnupg-devel/2015-September/030267.html for background. Signed-off-by: Werner Koch <[email protected]>
| * cleanup: Fix type mismatch around gpgme_error_t.NIIBE Yutaka2015-10-162-2/+2
| | | | | | | | | | | | * src/data-compat.c (gpgme_error_to_errno): Use gpg_err_code to get error code from gpgme_error_t. * src/gpgme.c (gpgme_new): Don't use gpgme_error.
| * gpgme-tool: Switch to argparse.c for option parsing.Werner Koch2015-08-314-491/+1862
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/argparse.c, src/argparse.h: New. Taken from current gnupg. * src/Makefile.am (gpgme_tool_SOURCES): New. * src/gpgme-tool.c: Remove all argp.h stuff. (my_strusage): New. (main): Change to use argparse. -- As a GnuPG related tool the user should get the same experience in option parsing as with gpg et al. Thus we use the same parser. Signed-off-by: Werner Koch <[email protected]>
| * Add gpgme_pubkey_algo_stringWerner Koch2015-08-308-33/+94
| | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_PK_EDDSA): New. (gpgme_pubkey_algo_string): New. * src/conversion.c (_gpgme_map_pk_algo): Add new algo. * src/gpgme.c (gpgme_pubkey_algo_string): New. (gpgme_pubkey_algo_name): Reformat. Signed-off-by: Werner Koch <[email protected]>
| * Post release updatesWerner Koch2015-08-262-1/+5
| | | | | | | | --
| * Release 1.6.0gpgme-1.6.0Werner Koch2015-08-265-20/+90
| | | | | | | | | | | | * configure.ac: Set LT version to C25/A14/R0. Signed-off-by: Werner Koch <[email protected]>
| * Make use of GPGRT macros is available.Werner Koch2015-08-261-12/+17
| | | | | | | | | | | | * src/gpgme.h.in (_GPGME_INLINE): Define using GPGRT_INLINE if possible. Fix problem with -Wundef by adding an extra "defined()". (_GPGME_GCC_VERSION): Define using GPGRT_ macro if possible.
| * Avoid -Wundef warnings if gpgme.h is used by g++.Werner Koch2015-08-251-20/+24
| | | | | | | | | | | | | | * src/gpgme.h.in (_GPGME_INLINE): Move definition into the extern-C-scope. Signed-off-by: Werner Koch <[email protected]>
| * Add configure option --enable-build-timestamp.Werner Koch2015-08-251-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default. -- This is based on libgpg-error commit d620005fd1a655d591fccb44639e22ea445e4554 but changed to be disbaled by default. Check there for some background. Signed-off-by: Werner Koch <[email protected]>
| * Relax ttyname_r error checksDaiki Ueno2015-08-255-29/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/engine-assuan.c (llass_new): Don't treat ttyname_r error as fatal. * src/engine-g13.c (g13_new): Likewise. * src/engine-gpg.c (gpg_new): Likewise. * src/engine-gpgsm.c (gpgsm_new): Likewise. * src/engine-uiserver.c (uiserver_new): Likewise. -- Even though isatty() returns 1, ttyname_r() may fail in many ways, e.g., when /dev/pts is not accessible under chroot. Since all our uses of ttyname_r() require that the function works, we can treat the failure as if isatty() fails. Signed-off-by: Daiki Ueno <[email protected]>
| * Cleanup layout of gpgme.hWerner Koch2015-08-252-167/+225
| | | | | | | | | | | | * src/gpgme.h.in: Reorder prototypes. Chnage some comments. Signed-off-by: Werner Koch <[email protected]>
| * Improve error return by checking the FAILURE status.Werner Koch2015-08-2511-2/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_STATUS_FAILURE): New. * src/status-table.c (FAILURE): New. * src/op-support.c (_gpgme_parse_failure): New. * src/passphrase.c (_gpgme_passphrase_status_handler): Forward FAILURE status line to the status callback. * src/decrypt.c (op_data_t): Add field failure_code. (_gpgme_decrypt_status_handler): Parse that code and act upon it on EOF. * src/encrypt.c (op_data_t): Add field failure_code. (_gpgme_encrypt_status_handler): Parse that code and act upon it on EOF. * src/genkey.c (op_data_t): Add field failure_code. (genkey_status_handler): Parse that code and act upon it on EOF. * src/passwd.c (op_data_t): Add field failure_code. (passwd_status_handler): Parse that code and act upon it on EOF. * src/sign.c (op_data_t): Add field failure_code. (_gpgme_sign_status_handler): Parse that code and act upon it on EOF. * src/verify.c (op_data_t): Add field failure_code. (_gpgme_verify_status_handler): Parse that code and act upon it on EOF. -- This requires GnuPG 2.1.8 to actually make a difference. Signed-off-by: Werner Koch <[email protected]>
| * tests: Build test programs in tests/ without wrappers.Werner Koch2015-08-251-0/+1
| | | | | | | | --
| * tests: Allow using run-sign to test loopback pinentry problems.Werner Koch2015-08-251-0/+26
| | | | | | | | * tests/run-sign.c: Add options --status and --loopback.
| * Call status_cb for an ERROR status seen in the passphrase handler.Werner Koch2015-08-241-0/+12
| | | | | | | | | | | | | | | | | | | | * src/passphrase.c (_gpgme_passphrase_status_handler): Call status_cb. -- Frankly, we should have a more generic way of feeding the status_cb handler than our current ad-hoc method. Signed-off-by: Werner Koch <[email protected]>
| * w32: Look for gpgconf in the new GnuPG 2.1 install dir.Werner Koch2015-08-241-6/+13
| | | | | | | | | | | | | | * src/w32-util.c (_gpgme_get_gpgconf_path): Try another location of gpgconf.exe. Signed-off-by: Werner Koch <[email protected]>
| * w32: Expect gpgme-w32spawn.exe only in the gpgme installation dir.Werner Koch2015-08-241-58/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32-util.c (find_program_at_standard_place): Remove. (_gpgme_get_gpg_path): Make the search order more explicit. (_gpgme_get_gpgconf_path): Ditto. (_gpgme_get_w32spawn_path): Search only in the inst_dir. -- This tries to avoid possible unclear bug reports by removing the fallback to the current gpg4win installation directory for the gpgme helper. It is expected that users of gpgme installing their own gpgme version also install the matching helper. Signed-off-by: Werner Koch <[email protected]>
| * w32: Print the installation directory in debug mode.Werner Koch2015-08-242-1/+15
| | | | | | | | | | | | | | | | | | | | * src/debug.c (debug_init) [W32]: Show libgpgme installation dir. -- I expect that gpgme will be distributed by applications and thus it will be helpful to see in the debug log which gpgme is actually used. Signed-off-by: Werner Koch <[email protected]>
| * Add an export secret key feature.Werner Koch2015-08-247-20/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET): New. (GPGME_EXPORT_MODE_RAW): New. (GPGME_EXPORT_MODE_PKCS12): New. * src/export.c (export_start, export_ext_start): Allow new flags. * src/engine-gpg.c (export_common): Support secret key export. * src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto. * src/gpgme-tool.c (cmd_export): Add options --secret, --raw, and --pkcs12. * tests/run-export.c (main): Likewise. -- Note that exporting secret X.509 keys requires GnuPG 2.1.8. Signed-off-by: Werner Koch <[email protected]>
| * Parse INQUIRE_MAXLEN in the passphrase callback.Ben Kibbey2015-08-161-3/+15
| | | | | | | | | | | | | | | | | | | | | | * src/passphrase.c (_gpgme_passphrase_status_handler): Parse GPGME_STATUS_INQUIRE_MAXLEN. * src/passphrase.c (_gpgme_passphrase_command_handler): Send the INQUIRE_MAXLEN status message. -- Fixes passing this status message along when decrypting symmetric data from gpg.
| * Fix gpgme_{get,set}_status_cb to match documentation.Ben Kibbey2015-08-152-9/+14
| | | | | | | | | | | | * doc/gpgme.texi: Minor fixes. * src/gpgme.c (gpgme_get_status_cb): Set return variables to NULL and check for a valid ctx pointer.
| * Parse the INQUIRE_MAXLEN status message.Ben Kibbey2015-08-155-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in: (gpgme_status_code_t): Add INQUIRE_MAXLEN. * src/status-table.c (status_table_s): Ditto. * src/genkey.c (genkey_status_handler): Parse INQUIRE_MAXLEN. * src/decrypt.c (_gpgme_decrypt_status_handler): Ditto. * src/sign.c (_gpgme_sign_status_handler): Ditto. This status message informs the client of the maximum length of an inquired line. It is sent from gpg and forwarded to the client via gpgme_status_cb_t.
| * Add gpgme_set/get_status_cb().Ben Kibbey2015-08-156-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_set_status_cb): New. (gpgme_get_status_cb): New. (gpgme_status_cb_t): New. * src/gpgme.c (gpgme_set_status_cb): New. (gpgme_get_status_cb): New. * src/context.h (status_cb): New. (status_cb_value): New. * src/gpgme.def: Export new symbols. * src/libgpgme.vers: Ditto. * doc/gpgme.texi: Document these new functions. -- This callback function is used to forward status messages from gpg back to the client.
| * Make use of user passphrase handler during genkey.Ben Kibbey2015-08-151-0/+8
| | | | | | | | | | | | | | | | | | * src/genkey.c (genkey_start): set engine passphrase command handler. -- This allows for inquiring a new passphrase during key generation rather than requiring a pinentry. Needs a patch to gnupg to make use of --command-fd with --gen-key.