aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-uiserver.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-07-17Add per-ctx custom engine options.bjk/custom-engine-optionsBen Kibbey1-0/+2
* src/gpgme.h.in (gpgme_ctx_set_engine_options): New prototype. (gpgme_ctx_get_engine_options): Ditto. * src/engine-backend.h (engine_ops): Add set_options and get_options. * src/engine.c (gpgme_ctx_set_engine_options): New. (gpgme_ctx_get_engine_options): Ditto. * src/engine-gpg.c (gpg_set_options): New. (gpg_get_options): Ditto. * src/op-support.c (_gpgme_op_reset): Keep custom options. * src/engine-gpg.c (_gpgme_engine_ops_gpg): Adjust for new members. * src/engine-assuan.c (_gpgme_engine_ops_assuan): Ditto. * src/engine-g13.c (_gpgme_engine_ops_g13): Ditto. * src/engine-gpgconf.c (_gpgme_engine_ops_gpgconf): Ditto. * src/engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Ditto. * src/engine-spawn.c (_gpgme_engine_ops_spawn): Ditto. * src/engine-uiserver.c (_gpgme_engine_ops_uiserver): Ditto. * src/gpgme.def: Export new symbols. * src/libgpgme.vers: Ditto. * doc/gpgme.texi: Document these new functions. -- Not all of gpg2's features are exposed to libgpgme and adding these functions makes it possible to do things like specify an --s2k-count, etc.
2014-07-30Fix possible realloc overflow for gpgsm and uiserver engines.Werner Koch1-1/+1
* src/engine-gpgsm.c (status_handler): * src/engine-uiserver.c (status_handler): -- After a realloc (realloc is also used for initial alloc) the allocated size if the buffer is not correctly recorded. Thus an overflow can be introduced by receiving data with different line lengths in a specific order. This is not easy exploitable because libassuan constructs the line. However a crash has been reported and thus it might be possible to constructs an exploit. CVE-id: CVE-2014-3564 Reported-by: Tomáš Trnka
2014-04-10Add GPGME_PROTOCOL_SPAWN and gpgme_op_spawn.Werner Koch1-1/+2
* src/gpgme.h.in (GPGME_PROTOCOL_SPAWN): New. (GPGME_SPAWN_DETACHED, GPGME_SPAWN_ALLOW_SET_FG): New. * src/gpgme.c (gpgme_set_protocol): Add new protocol. (gpgme_get_protocol_name): Ditto. * src/spawn.c: New. * src/libgpgme.vers, src/gpgme.def: Add new public functions. * src/engine-spawn.c: New. * src/Makefile.am: Add new files. * src/engine-backend.h (struct engine_ops): Add OPSPAWN. * src/engine.c (engine_ops): Add _gpgme_engine_ops_spawn. (gpgme_get_engine_info): Add Spawn to the list of protocols. (_gpgme_engine_op_spawn): New. * src/gpgme-tool.c (gt_protocol_from_name): Add new protocol. (gt_spawn, cmd_spawn): New.
2013-08-02Prefer GnuPG-2 engines over GnuPG-1.Werner Koch1-2/+2
* src/util.h: Move some prototypes to ... * src/sys-util.h: New. * src/Makefile.am (main_sources): Add sys-util.h. * configure.ac (AH_VERBATIM): Add DIRSEP_C and DIRSEP_S. * src/dirinfo.c: Include sys-util.h. (WANT_GPG_NAME, WANT_GPGSM_NAME, WANT_G13_NAME) (WANT_UISRV_SOCKET): New. (dirinfo): Add corresponding fields. (parse_output): Add arg COMPONENTS and set new fields. (read_gpgconf_dirs): Add arg components and act upon it. (get_gpgconf_item): Call read_gpgconf_dirs two times. Add debug output. (_gpgme_get_default_gpg_name): New. (_gpgme_get_default_gpgsm_name): New. (_gpgme_get_default_g13_name): New. (_gpgme_get_default_gpgconf_name): New. (_gpgme_get_default_uisrv_socket): New. * src/engine-gpg.c, src/engine-g13.c, src/engine-gpgconf.c * src/engine-gpgsm.c, src/engine-uiserver.c: Change to use _gpgme_get_default_ instead of those from sys-util.h. * src/posix-util.c (_gpgme_get_gpg_path): Include sys-util.h. (_gpgme_get_uiserver_socket_path): Remove. * src/w32-util.c (_gpgme_get_gpg_path): Include sys-util.h. (_gpgme_get_uiserver_socket_path): Remove. -- The default engines names are now taken from the output of gpgconf. If gpgconf is not installed gpg 1 is assumed and locate the same was as gpgconf.
2013-05-16Make definition of off_t robust against misbehaving w32 toolchains.Werner Koch1-1/+1
* configure.ac (NEED__FILE_OFFSET_BITS): Change to define gpgme_off_t and gpgme_ssize_t. (API__OFF_T, API__SSIZE_T): New ac_subst. * src/gpgme.h.in: Replace all ssize_t and off_t by ac_subst macros. * src/assuan-support.c, src/ath-pthread.c, src/ath.c, src/ath.h * src/data-compat.c, src/data-fd.c, src/data-mem.c, src/data-stream.c * src/data-user.c, src/data.c, src/data.h, src/engine-gpgsm.c * src/engine-uiserver.c, src/gpgme-tool.c, src/gpgme.c: Replace off_t by gpgme_off_t and sszie_t by gpgme_ssize_t. * src/ath-pthread.c, src/ath.h: Include gpgme.h. -- For a detailed description, see the gpgme.texi diff.
2013-02-26Enable FD passing and thus building of the UI-server.Werner Koch1-1/+1
* configure.ac: Make --enable-fd-passing the default. * src/engine-uiserver.c (_gpgme_engine_ops_uiserver): Syntax fix.
2013-02-07Add public function gpgme_set_pinentry_mode.Werner Koch1-0/+2
* src/gpgme.c (gpgme_set_pinentry_mode): New. * src/gpgme.h.in (gpgme_pinentry_t): New. (gpgme_set_pinentry_mode): New. * src/context.h (struct gpgme_context): Add field pinentry_mode. * src/engine-backend.h (struct engine_ops): Add field set_pinentry_mode. * src/engine-gpg.c (struct engine_gpg): Add field pinentry_mode. (build_argv): Implement pinentry_mode. (gpg_set_pinentry_mode): New. (_gpgme_engine_ops_gpg): Register gpg_set_pinentry_mode. -- Note that this new fucntion may only be used with gpg 2.1.
2013-02-06Use gpg_error_from_syserror instead of directly accessing errno.Werner Koch1-15/+15
-- Also fixed a couple of minor thing; e.g. save the error before calling cleanup functions. Do not save the errno if only free is called in between.
2012-07-13Do not include the removed file status-table.hWerner Koch1-22/+21
* src/engine-uiserver.c: Remove status-table.h which is not anymore built. Fixes bug#1412. -- The file was actually removed from the code by 885243e0 but for unknown reasons the missing file was not reported by "make distcheck".
2012-02-14Rework status table to be less dynamically generated.Marcus Brinkmann1-26/+2
* src/Makefile.am (EXTRA_DIST): Remove mkstatus. (BUILT_SOURCE, MOSTLYCLEANFILES): Remove. (main_sources): Remove status-table.h, extra-stati.h. Add status-table.c. (status-table.h): Remove rules for built source. * src/decrypt.c: Don't include extra-stati.h. * src/engine-gpg.c: Don't include status-table.h. (status_cmp): Remove function. (read_status): Use _gpgme_parse_status. * src/engine-gpgsm.c: Don't include status-table.h. (status_cmp, parse_status): Remove function. (gpgsm_assuan_simple_command, status_handler): Use _gpgme_parse_status. * src/engine-uiserver.c: Don't include status-table.h. (status_cmp, parse_status): Remove function. (uiserver_assuan_simple_command, status_handler): Use _gpgme_parse_status. * src/gpgme.h.in (gpgme_status_code_t): Add GPGME_STATUS_DECRYPTION_INFO. * src/util.h (_gpgme_status_init,_gpgme_parse_status): New declaration. * src/status-table.c: New file. * src/extra-stati.h, src/mkstatus: Files removed. * version.c (do_subsystem_inits): Call _gpgme_status_init.
2010-11-03More include guards.Werner Koch1-1/+3
Provide access for Wince. Install dummy sehmap.h
2010-11-02First take on changes to allow building with MSC for W32CE.Werner Koch1-1/+3
Fixed regression in plain W32 build.
2009-11-17Fixes for the UI server engine .Werner Koch1-20/+22
2009-11-10Make recipients command work.Werner Koch1-10/+10
2009-11-10Pass fdpassing flag to assuan_socket_connect.Werner Koch1-1/+1
2009-11-102009-11-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-0/+1361
* configure.ac: Activate UIServer if FD passing is enabled and Assuan is available. m4/ 2009-11-10 Marcus Brinkmann <[email protected]> * libassuan.m4: Fix LIBASSUAN_VERSION. src/ 2009-11-10 Marcus Brinkmann <[email protected]> * Makefile.am (uiserver_components): New variable. (main_sources): Add it. * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument, implement it. Adjust callers. (gpgme_key_from_uid): New function. * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT. (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE, GPGME_ENCRYPT_EXPECT_SIGN. (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions. * libgpgme.vers, gpgme.def: Add new functions. * gpgme.c (gpgme_set_protocol): Add UIServer protocol. (gpgme_set_sub_protocol): New function. (gpgme_get_protocol_name): Add UIServer and default protocol. * assuan-support.c: Return correct error values, implement socketpair for POSIX. * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c, w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE arguments. Implement it for POSIX. Adjust all callers. * engine.h, engine-backend.h (_gpgme_engine_set_protocol) (_gpgme_engine_op_decrypt_verify): New prototypes. Adjust all users. * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer engine. (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New function. * decrypt-verify.c (decrypt_verify_start): Call _gpgme_engine_op_decrypt_verify. * util.h, posix-util.c, w32-util.c (_gpgme_get_uiserver_socket_path): New function. * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation. * gpgme-tool.c: Some support for UIServer protocol. * engine-uiserver.c: New file.