aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
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-26w32: Hacks for building with 32 bit mingw64.Werner Koch2-1/+6
* configure.ac (INSERT__TYPEDEFS_FOR_GPGME_H): Add hacks for 32 bit mingw64. * src/util.h [W32]: Include winsock2.h before windows to make mingw64 happy. * src/w32-util.c (_WIN32_IE): Need to use 5.1 for mingw64. -- It is not clear to me what mingw64 wants to achieve with their POSIX hacks. In particular the off64_t stuff looks quite strange given that Windows has a pretty stable API for close to 2 decades. Thus I can't say whether it will really work when build with that toolchain.
2013-02-26Change the various version numbers to the new scheme.Werner Koch2-3/+20
* configure.ac: Rename my_foo variables to mym4_foo variables to make clear that they are processed by m4. (VERSION_NUMBER): New ac_subst. (AH_BOTTOM): Add CRIGHTBLURB macro. (BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP): Change them to work similar to libgpg-error et al. * src/versioninfo.rc.in: Remove use of BUILD_NUMBER and get it in line with gpg-error et al. * src/version.c (cright_blurb): New. (gpgme_check_version_internal): Add magic to display the above information. * tests/t-version.c (main): Add option --verbose.
2013-02-12Add macro GPGME_VERSION_NUMBER.Werner Koch1-1/+5
* src/gpgme.h.in (GPGME_VERSION_NUMBER): New. * configure.ac (my_version_major, my_version_minor) (my_version_micro): New m4 macros. (my_version): Build from new m4 macros. (VERSION_NUMBER): New ac_subst.
2013-02-12Add public function gpgme_get_pinentry_mode.Werner Koch4-0/+15
* src/gpgme.c (gpgme_get_pinentry_mode): New.
2013-02-07gpgme_tool: Support GPG's new pinentry-mode.Werner Koch3-5/+118
* src/gpgme-tool.c (log_error): Do not always print the error source. (gt_set_pinentry_mode): New. (server_passphrase_cb): New. (cmd_pinentry_mode): New. (register_commands): Add cmd_pinentry_mode. (options): Add option --gpg-binary. (struct args): Add field gpg-binary. (parse_options, main): Implement that option.
2013-02-07Add public function gpgme_set_pinentry_mode.Werner Koch13-7/+132
* 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-07Add public function gpgme_io_writen.Werner Koch4-126/+154
* src/gpgme.c (gpgme_io_read): New. -- This is a writen style variant for gpgme_io_write. It is often easier to use this one in passphrase and edit callbacks.
2013-02-06Use gpg_error_from_syserror instead of directly accessing errno.Werner Koch27-135/+133
-- 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-11-15Make _gpgme_encode_percent_string work for memory buffers.Werner Koch1-1/+1
* src/conversion.c (D_gpgme_encode_percent_string): Remove stray semicolon. Reported by Xi Wang. -- Obviously this function is not used with a supplied LEN argument != 0.
2012-10-24Fix ttyname problem on Android.Werner Koch1-4/+9
* configure.ac: Define macro and conditional HAVE_ANDROID_SYSTEM. * m4/gnupg-ttyname.m4: Force use of replacement on Android. * src/ttyname_r.c: Ditto. -- Android's bionic lib has no working ttyname_r() nor ttyname(). Using them anyway will print FIX ME! implement ttyname_r() bionic/libc/bionic/stubs.c:466 Thus we force the use of our replacement code which simply return "/dev/tty".
2012-10-19Trace the use of GPG_ERR_INV_ENGINE.Werner Koch20-37/+65
* src/debug.h: Include "gpgme.h" (_gpgme_trace_gpgme_error): New. (trace_gpg_error): New macro. Use it in all files where we return GPG_ERR_INV_ENGINE; also "include debug.h" as needed. -- This is a pretty common error code but often it is hard to figure out the actual cause. With debug level 4 we now print the file name and line number where this error code is generated by gpgme. Along with the git revision printed in the first log lines, this should give us an easier way to track down the problems related to this error code.
2012-10-19Avoid warning about initialized but not used variableWerner Koch1-2/+3
* src/engine-gpgsm.c (gpgsm_set_fd): Do not set DIR if not needed.
2012-10-11gpgme-tool: Use membuf functions to build up strings.Werner Koch1-32/+159
* src/gpgme-tool.c (clear_membuf, init_membuf, put_membuf) (put_membuf_str, get_membuf, peek_membuf): Add membuf functions. Take from GnuPG master's common/membuf.[ch] and patch for our use. (result_xml_escape): Rewrite using new functions. -- First counting, then allocating, and finally copying data is prone to errors. We better use the membuf functions which make it much easier.
2012-10-11gpgme-tool: Change license from LPGLv2+ to GPLv3+Werner Koch1-4/+5
* src/gpgme-tool.c: Change license notice. -- gpgme-tool.c is a standalone program, thus it makes no sense to keep it under the LGPL. We already had the manual under GPLv3+.
2012-10-11gpgme-tool: escape special characters in output XML data (<, >, and &).W. Trevor King1-2/+67
[[PGP Signed Part:Undecided]] src/gpgme-tool.c (result_xml_escape_replacement, result_xml_escape): New. (result_xml_tag_data): Use result_xml_escape() to escape data. (result_add_error): Use unescaped < and >. -- This is a general solution for generating valid XML, but the specific output that inspired the change was from the KEYLIST command: <uid>William Trevor King <[email protected]></uid> Now the uids are properly escaped: <uid>William Trevor King &lt;[email protected]&gt;</uid> Signed-off-by: W. Trevor King <[email protected]>
2012-10-11gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML.W. Trevor King1-1/+1
[[PGP Signed Part:Undecided]] src/gpgme-tool.c (cmd_keylist): Use <chain-id> instead of <chain_id>. -- All the other tags map struct attribute underscores to hyphens, so fixing <chain_id> follows the priciple of least surprise. Signed-off-by: W. Trevor King <[email protected]>
2012-09-28gpgme-tool: Return more detailed XML from KEYLISTW. Trevor King1-14/+120
src/gpgme-tool.c (cmd_keylist): Convert output from a list of to more detailed XML. (xml_preamble1, xml_preamble2, xml_end): Make global. (result_add_protocol, result_add_validity): New functions for generating XML from GPGME types. (result_add_string): Treat NULL strings as "". (result_xml_tag_data): Make 'data' a 'const char' so we can use the value returned by gpgme_get_protocol_name directly. -- This is a first pass at returning most of the gpgme_key_t data from the KEYLIST call. Signed-off-by: W. Trevor King <[email protected]>
2012-09-28gpgme-tool: Initialize input_fd and output_fdW. Trevor King1-0/+2
* src/gpgme-tool.c (gpgme_server): Initialize input_fd and output_fd. Signed-off-by: W. Trevor King <[email protected]>
2012-09-26gpgme-tool: Fix handling of file descriptorsWerner Koch1-16/+35
* src/gpgme-tool.c (server_reset_fds): Use close/CloseHandle instead of the assuan close functions. (_cmd_decrypt_verify, _cmd_sign_encrypt, cmd_verify, cmd_import) (cmd_export, cmd_genkey, cmd_getauditlog): Use SERVER object instead of assuan_get_*_fd functions. -- Although we used our own handlers for INPUT and OUTPUT, we still used assuan_get_input_fd, assuan_get_output_fd and their close functions. That clearly can't work because libassuan does not have any values for them.
2012-09-25Add gpgme_set_global_flag to help debuggingWerner Koch6-9/+66
* src/gpgme.c (gpgme_set_global_flag): New. * src/gpgme.h.in (gpgme_set_global_flag): New. * src/gpgme.def, src/libgpgme.vers: Add new public function. * src/debug.c (envvar_override): New.: (_gpgme_debug_set_debug_envvar): New. (debug_init): Take ENVVAR_OVERRIDE in account. -- On Android envvars can't be used, thus we need another way to enable GPGME debugging. The new function allows this and may be used in the future to implement similar things.
2012-09-25Remove all trailing whitespace from source filesWerner Koch73-657/+657
-- Command used: sed -i 's,[ \t]*$,,' FILE
2012-07-28Fix sign error in position calculation for mem_seek.Marcus Brinkmann1-1/+1
* data-mem.c (mem_seek): Fix sign error in position calculation.
2012-07-27Allow null context on gpgme_set_locale.Marcus Brinkmann1-3/+0
* gpgme.c (gpgme_set_locale): Allow CTX to be a null pointer.
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-07-13Make handling of new conf values more robust (bug#1413).Werner Koch1-50/+51
* src/engine-gpgconf.c (arg_to_data): Allow for NULL as value.string. -- I was not able to replicate the problem. However this patch makes the code more robust and tolerates errors by the user. IT should fix the problem at hand.
2012-05-02Release 1.3.2.gpgme-1.3.2Werner Koch1-1/+1
* configure.ac: Bump LT version to C19/A8/R1. * configure.ac (GITLOG_TO_CHANGELOG): Define. * Makefile.am (gen-ChangeLog): Use it.
2012-05-02Remove unused pth stuff from gpgme-config.Werner Koch1-6/+0
* src/gpgme-config.in: Remove unused pth stuff.
2012-05-02Update signature summary for the case of missing X.509 keys.Werner Koch1-5/+29
* src/verify.c (gpgme_op_verify_result): Update summary field. -- This is actually a hack to solve the problem that GPGME currently does not emit ERRSIG for a missing public key.
2012-04-30Fix timestamp parsing for y2038 hack.Werner Koch1-2/+3
* src/conversion.c (_gpgme_parse_timestamp): Set ENDP before year 2038 check.
2012-04-30Remove trailing white spaceWerner Koch2-49/+49
--
2012-04-20.gitignore: flesh out rules and add subdirectory-.gitignores.W. Trevor King1-0/+7
2012-04-13status-table.c: include string.h for strcmp.W. Trevor King1-0/+1
* status-table.c: include string.h to avoid `warning: implicit declaration of function 'strcmp'`.
2012-04-03gpgme-tool: add help messages for a number of commands.W. Trevor King1-23/+137
* src/gpgme-tool.c (hlp_engine, hlp_sub_protocol, hlp_armor, hlp_textmode, hlp_include_certs, hlp_keylist_mode, hlp_input, hlp_output, hlp_message, hlp_recipient, hlp_signer, hlp_signers_clear, hlp_decrypt, hlp_decrypt_verify, hlp_encrypt, hlp_sign_encrypt, hlp_sign, hlp_verify, hlp_import): New strings. (hlp_protocol): Fix typo. (register_commands): Add documentation strings. (doc): Mention Assuan.
2012-03-12Do not rely on glibc name of syscall.Marcus Brinkmann1-1/+1
* src/ath.c (ath_self): Use __NR_gettid, not SYS_gettid.
2012-02-14Rework status table to be less dynamically generated.Marcus Brinkmann11-173/+183
* 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.
2012-02-08Link gpgme-tool directly to libassuan, as it uses its interface.Marcus Brinkmann1-1/+1
* src/Makefile.am (gpgme_tool_LDADD): Add @LIBASSUAN_LIBS@.
2012-01-19Fix Solaris problems with ttyname_r.Werner Koch2-24/+104
* m4/gnupg-ttyname.m4: New. Based on ttyname_r from gnulib. * src/ttyname_r.c (_gpgme_ttyname_r): Rename from ttyname_r. Implement hacks required for Solaris and possible other non-fully Posix systems. * src/util.h: Include unistd.h. Redefine ttyname_r depending on REPLACE_TTYNAME_R and put it into the gpgme name space. -- Unfortunately we cant not use the ttyname_r replacement from gnulib because we want to keep GPGME LGPLv2+.
2012-01-19For W32 use a build number instead of abbreviated commit id.Werner Koch1-4/+4
We would need to use a shortened commit id so that it fits into an 16 bit Windows variable. Further it is a random number and not something increasing. Thus a build number made up from the day of the year and the hour is much more useful to describe a build number for a specific revision. * configure.ac [W32]: Replace BUILD_REVISION by BUILD_NUMBER. * src/versioninfo.rc.in: Ditto.
2011-12-02Generate the ChangeLog from commit logs.Werner Koch2-5/+14
* build-aux/gitlog-to-changelog: New script. Taken from gnulib. * build-aux/git-log-fix: New file. * build-aux/git-log-footer: New file. * build-aux/git-hook/commit-msg: New script. * doc/HACKING: New file. * ChangeLog: New file. * Makefile.am (EXTRA_DIST): Add new files. (gen-ChangeLog): New. (dist-hook): Run gen-ChangeLog. * autogen.sh: Install commit-msg hook for git. Rename all ChangeLog files to ChangeLog-2011.
2011-10-25Remove support for libgpgme-pth.Marcus Brinkmann4-273/+8
2011-05-26Check context pointers for null pointer on entry points.Marcus Brinkmann22-6/+266
2011-04-06gpgme-config cleanups and --host optionWerner Koch2-32/+68
gpgme-config.in: Add option --host. Change options --cflags and --libs to collapse duplicate include and lib dirs. Try to put extra libs at the end. Note that gpgme.m4 has not yet been extended.
2011-04-06Insert platform dependent typedefs into gpgme.hWerner Koch2-27/+28
We already modify gpgme.h per playform and thus we can also get rid of some #ifdefs. The change does not change anything for current platforms but should do the right think for W64. Note that as per MS specs ssize_t is to be defined as LONG_PTR which translates to a long on 32 bit platforms and to __int64 on 64 bit Windows platforms. We already used long in the past. There seems to be a problem with some versions of mingw32 which includes a ssize_t type typedefed to int. O(n 32 bit W32 platforms int and long are identically.
2011-02-03Add support for non-API GnuPG status codes.Werner Koch5-79/+125
As an example stub code for DECRYTPION_INFO has been added. Note that the status codes in gpgme.h do only make sense for the edit interactor interface and thus certain codes don't need to be part of the public interface.
2011-02-03Fix socket implementation on Windows.Marcus Brinkmann2-1/+5
2011-02-03 Marcus Brinkmann <[email protected]> * w32-io.c (_gpgme_io_socket): Return fd, not res.
2011-02-02Fix Windows port (spawn and assuan engine).Marcus Brinkmann4-44/+38
2011-02-02 Marcus Brinkmann <[email protected]> * configure.ac (NEED_LIBASSUAN_VERSION): Bump to 2.0.2 for system hooks. src/ 2011-02-02 Marcus Brinkmann <[email protected]> * assuan-support.c (my_socket, my_connect): New functions. (_gpgme_assuan_system_hooks): Add my_Socket, my_connect. * priv-io.h (_gpgme_io_socket): New prototype. * w32-io.c (pid_to_handle, handle_to_oid, fd_to_handle): Remove macros. (is_socket): Remove function. (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Remove some dead code. (_gpgme_io_spawn): Translate handles before DuplicateHandle them.
2011-02-022011-02-02 Marcus Brinkmann <[email protected]>Marcus Brinkmann2-15/+21
* w32-util.c (mkstemp): Don't use CreateFile instead of open (the function is not used on Windows CE, and the callers were not adjusted).
2011-01-21Fix gpgconf option change if not self-assigning.Marcus Brinkmann2-5/+8
2011-01-21 Marcus Brinkmann <[email protected]> * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is not self-assignment.
2010-12-08Allow multiple patterns for KEYLIST.Werner Koch2-6/+65