Commit Graph

249 Commits

Author SHA1 Message Date
Werner Koch
2e8feb6016 Add convenience macro GPGME_PROTOCOL_OPENPGP.
* src/gpgme.h.in (GPGME_PROTOCOL_OPENPGP): New.
2013-05-28 10:55:35 +02:00
Werner Koch
c29dad2315 w32: Fix installing of .def file.
* src/Makefile.am (install-def-file): Create libdir first.
2013-05-23 20:18:04 +02:00
Werner Koch
d4371ed30d Support --no-encrypt-to also with gpgme_op_encrypt_sign.
* src/engine-gpg.c (gpg_encrypt_sign): Support the
GPGME_ENCRYPT_NO_ENCRYPT_TO flag.
2013-05-22 16:32:15 +02:00
Werner Koch
567e6481d7 Allow symmetric encryption with gpgme_op_encrypt_sign.
* src/encrypt-sign.c (encrypt_sym_status_handler): New.
(encrypt_sign_start): Handle recp == NULL case.
* src/engine-gpg.c (gpg_encrypt_sign): Implement symmetric encryption.
* tests/gpg/t-encrypt-sign.c (main): Add a test case for this.
--

Co-authored-by: Kyle L. Huff <g10bts@curetheitch.com>
GnuPG-bug-id: 1440
2013-05-22 16:31:51 +02:00
Werner Koch
0c1de7abd5 gpgme-tool: Allow for symmetric encryption.
* src/gpgme-tool.c (gt_sign_encrypt): Pass NULL for recp if no
recipients are given.
2013-05-22 16:20:14 +02:00
Werner Koch
e99356306d Improve C++ compatibility of previous patch.
* src/gpgme.h.in: Move gpgme_sssize_t and gpgme_off_t typedefs into
the extern "C" scope.
--

Frankly, this does not help very much because g++ still does not
interpret gpgme_data_seek_cb_t as compatible with the C++ ssize_t.  I
am sorry for that API change but C and C++ are too different to always
get both of them under one umbrella.  However, the ABI should now be
identical to older gpgme versions.
2013-05-18 13:49:52 +02:00
Werner Koch
6d0d8e7ba0 Make definition of off_t robust against misbehaving w32 toolchains.
* 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-05-16 17:48:50 +02:00
Werner Koch
9e7df9aa6d w32: Change the way the I/O threads are cleaned up.
* src/w32-io.c (reader_context_s, create_reader)
(writer_context_s, create_writer): Rename STOPPED to CLOSE_EV.
(reader, writer): Remove setting of STOPPED.  Wait for CLOSE_EV and
then release the context.
(destroy_reader, destroy_writer): Do not wait but set the CLOSE_EV.
(kill_reader, kill_writer): Remove.
(_gpgme_io_close): Add code from kill_reader and kill_writer.
--

The old code was prone to deadlocks which were actually exhibited at
Kleopatra startup.  The new code is much more straightforward and
easier to understand.  The reason for the complex old code was
probably due to our former idea to allow re-use of the I/O threads.
However we have long given up on this.
2013-05-11 15:38:08 +02:00
Werner Koch
9f330be821 Fix hang in socket closing.
* src/w32-io.c (destroy_reader): Call shutdown.
(reader): Do not print an error in the shutdown case.
2013-05-08 20:38:50 +02:00
Werner Koch
2118f49701 Improve debug output of the I/O reader and writer.
* src/w32-io.c (reader, writer): Also print file_sock.
2013-05-08 19:10:41 +02:00
Werner Koch
a7e5f1096f Simplify a debug code function.
* src/debug.c (_gpgme_debug): Remove static space string.
2013-05-06 20:22:23 +02:00
Werner Koch
f623a6b94c Allow reading of long gpgconf output lines.
* src/engine-gpgconf.c (gpgconf_read): Rewrite to allow for line
lengths up to 64k.
2013-04-30 18:09:13 +02:00
Werner Koch
5090f6f246 Enable FD passing and thus building of the UI-server.
* configure.ac: Make --enable-fd-passing the default.
* src/engine-uiserver.c (_gpgme_engine_ops_uiserver): Syntax fix.
2013-02-26 17:26:44 +01:00
Werner Koch
cdae524b28 w32: Hacks for building with 32 bit mingw64.
* 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-26 17:10:45 +01:00
Werner Koch
d8b46c919f Change the various version numbers to the new scheme.
* 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-26 17:10:18 +01:00
Werner Koch
f48f75b1e8 Add macro GPGME_VERSION_NUMBER.
* 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-12 14:02:08 +01:00
Werner Koch
4f38155441 Add public function gpgme_get_pinentry_mode.
* src/gpgme.c (gpgme_get_pinentry_mode): New.
2013-02-12 10:42:54 +01:00
Werner Koch
02a2cf0ccb gpgme_tool: Support GPG's new pinentry-mode.
* 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-07 21:03:44 +01:00
Werner Koch
61a0d92b67 Add public function gpgme_set_pinentry_mode.
* 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-07 20:59:16 +01:00
Werner Koch
29eced5068 Add public function gpgme_io_writen.
* 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-07 20:51:29 +01:00
Werner Koch
51fd6d8292 Use gpg_error_from_syserror instead of directly accessing errno.
--

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.
2013-02-06 17:35:40 +01:00
Werner Koch
1a17acd8e9 Make _gpgme_encode_percent_string work for memory buffers.
* 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-11-15 11:14:58 +01:00
Werner Koch
12a0c93433 Fix ttyname problem on Android.
* 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-24 16:44:34 +02:00
Werner Koch
bd24feaa86 Trace the use of GPG_ERR_INV_ENGINE.
* 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-19 11:23:39 +02:00
Werner Koch
14a8fd4eec Avoid warning about initialized but not used variable
* src/engine-gpgsm.c (gpgsm_set_fd): Do not set DIR if not needed.
2012-10-19 11:18:08 +02:00
Werner Koch
e11e7fc558 gpgme-tool: Use membuf functions to build up strings.
* 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-11 17:02:50 +02:00
Werner Koch
aa30b47aa0 gpgme-tool: Change license from LPGLv2+ to GPLv3+
* 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-11 16:54:58 +02:00
W. Trevor King
3f1329e1c9 gpgme-tool: escape special characters in output XML data (<, >, and &).
[[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 <wking@tremily.us></uid>

Now the uids are properly escaped:

   <uid>William Trevor King &lt;wking@tremily.us&gt;</uid>

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-11 16:22:46 +02:00
W. Trevor King
c28ebca9f2 gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML.
[[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 <wking@tremily.us>
2012-10-11 16:18:24 +02:00
W. Trevor King
3d69b51f7f gpgme-tool: Return more detailed XML from KEYLIST
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 <wking@tremily.us>
2012-09-28 08:31:51 +02:00
W. Trevor King
dda3702a90 gpgme-tool: Initialize input_fd and output_fd
* src/gpgme-tool.c (gpgme_server): Initialize input_fd and output_fd.

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-09-28 08:25:48 +02:00
Werner Koch
193eb62538 gpgme-tool: Fix handling of file descriptors
* 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-26 09:37:22 +02:00
Werner Koch
c62b79a1d6 Add gpgme_set_global_flag to help debugging
* 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-25 15:38:26 +02:00
Werner Koch
139e798c87 Remove all trailing whitespace from source files
--
Command used:  sed -i 's,[ \t]*$,,' FILE
2012-09-25 15:29:49 +02:00
Marcus Brinkmann
8384ccbd1a Fix sign error in position calculation for mem_seek.
* data-mem.c (mem_seek): Fix sign error in position calculation.
2012-07-28 22:06:09 +02:00
Marcus Brinkmann
434735f71e Allow null context on gpgme_set_locale.
* gpgme.c (gpgme_set_locale): Allow CTX to be a null pointer.
2012-07-28 01:17:03 +02:00
Werner Koch
e7aeaebb01 Do not include the removed file status-table.h
* 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-13 14:00:22 +02:00
Werner Koch
9f081da735 Make handling of new conf values more robust (bug#1413).
* 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-07-13 10:59:22 +02:00
Werner Koch
9c8608f702 Release 1.3.2.
* configure.ac: Bump LT version to C19/A8/R1.

* configure.ac (GITLOG_TO_CHANGELOG): Define.
* Makefile.am (gen-ChangeLog): Use it.
2012-05-02 11:18:24 +02:00
Werner Koch
295dd3f238 Remove unused pth stuff from gpgme-config.
* src/gpgme-config.in: Remove unused pth stuff.
2012-05-02 10:43:22 +02:00
Werner Koch
d6402b888f Update signature summary for the case of missing X.509 keys.
* 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-05-02 10:30:09 +02:00
Werner Koch
1a21574b48 Fix timestamp parsing for y2038 hack.
* src/conversion.c (_gpgme_parse_timestamp): Set ENDP before year 2038
check.
2012-04-30 17:46:15 +02:00
Werner Koch
22de98b7a6 Remove trailing white space
--
2012-04-30 17:42:53 +02:00
W. Trevor King
4cb408d33e .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
W. Trevor King
62bbe58280 status-table.c: include string.h for strcmp.
* status-table.c: include string.h to avoid `warning: implicit
declaration of function 'strcmp'`.
2012-04-13 10:02:39 +02:00
W. Trevor King
c318e69d8f gpgme-tool: add help messages for a number of commands.
* 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-04-03 15:20:27 +02:00
Marcus Brinkmann
ff0a640a18 Do not rely on glibc name of syscall.
* src/ath.c (ath_self): Use __NR_gettid, not SYS_gettid.
2012-03-12 16:37:26 +01:00
Marcus Brinkmann
885243e054 Rework status table to be less dynamically generated.
* 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-14 13:34:44 +01:00
Marcus Brinkmann
3f03897cbd Link gpgme-tool directly to libassuan, as it uses its interface.
* src/Makefile.am (gpgme_tool_LDADD): Add @LIBASSUAN_LIBS@.
2012-02-08 15:18:11 +01:00
Werner Koch
2f304957f5 Fix Solaris problems with ttyname_r.
* 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-19 18:43:10 +01:00
Werner Koch
574b087e84 For W32 use a build number instead of abbreviated commit id.
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.
2012-01-19 16:04:19 +01:00
Werner Koch
a4c4ee1aae Generate the ChangeLog from commit logs.
* 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-12-02 11:36:37 +01:00
Marcus Brinkmann
3ddf4c3d40 Remove support for libgpgme-pth. 2011-10-25 18:59:26 +02:00
Marcus Brinkmann
b34add3fe4 Check context pointers for null pointer on entry points. 2011-05-26 16:01:26 +02:00
Werner Koch
cdefec02b3 gpgme-config cleanups and --host option
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-06 20:10:45 +02:00
Werner Koch
7e547d87d2 Insert platform dependent typedefs into gpgme.h
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-04-06 13:45:15 +02:00
Werner Koch
b001a8df68 Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme 2011-02-03 20:51:36 +01:00
Werner Koch
55ad4d80e2 Add support for non-API GnuPG status codes.
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-03 20:49:41 +01:00
Marcus Brinkmann
2bdbe88822 Fix socket implementation on Windows.
2011-02-03  Marcus Brinkmann  <marcus@g10code.com>

        * w32-io.c (_gpgme_io_socket): Return fd, not res.
2011-02-03 12:38:28 +01:00
Marcus Brinkmann
129741d2f7 Fix Windows port (spawn and assuan engine).
2011-02-02  Marcus Brinkmann  <mb@g10code.com>

        * configure.ac (NEED_LIBASSUAN_VERSION): Bump to 2.0.2 for system hooks.

src/
2011-02-02  Marcus Brinkmann  <mb@g10code.com>

        * 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-02 14:11:18 +01:00
Marcus Brinkmann
de287a7996 Merge commit 'a2b9adafe46c55a2c26dd46163055bbdf3526835' 2011-02-02 13:51:42 +01:00
Marcus Brinkmann
a2b9adafe4 2011-02-02 Marcus Brinkmann <mb@g10code.com>
* 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-02-02 13:47:53 +01:00
Marcus Brinkmann
1f0f033f55 Fix gpgconf option change if not self-assigning.
2011-01-21  Marcus Brinkmann  <mb@g10code.com>

        * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is
        not self-assignment.
2011-01-21 04:21:30 +01:00
Werner Koch
ce1d166ef7 Allow multiple patterns for KEYLIST. 2010-12-08 09:55:00 +00:00
Marcus Brinkmann
e59b0a98ba 2010-11-23 Marcus Brinkmann <mb@g10code.com>
* w32-io.c (create_reader, create_writer): Use small stack size on
        Windows CE.
2010-11-23 10:47:59 +00:00
Marcus Brinkmann
eff0b7766a 2010-11-23 Marcus Brinkmann <mb@g10code.com>
* gpgme.h.in (gpgme_conf_arg_new): Make VALUE arg const void *.
	* gpgconf.c (_gpgme_conf_arg_new): Likewise.
	(gpgme_conf_arg_new): Likewise.
	* engine-gpgconf.c (_gpgme_conf_arg_new): Likewise.
	(gpgconf_write): Remove debug hack.
2010-11-23 09:46:52 +00:00
Marcus Brinkmann
ed8c52941c 2010-11-19 Marcus Brinkmann <mb@g10code.com>
* engine-gpgconf.c (_gpgme_conf_opt_change): Support
	self-assignment.  Requested by Marc Mutz.
2010-11-19 16:06:43 +00:00
Marcus Brinkmann
f1527436c4 2010-11-17 Marcus Brinkmann <mb@g10code.com>
* vasprintf.c (int_vasprintf) [HAVE_W32CE_SYSTEM]: Just use a
        fixed size buffer, as va_copy is not easy to fake.
2010-11-17 02:11:05 +00:00
Marcus Brinkmann
f8e4d353fa 2010-11-15 Marcus Brinkmann <mb@g10code.com>
* w32-ce.h (strcasecmp, strdup) [_MSC_VER]: Define.
	* genkey.c, passphrase.c: Include util.h.
2010-11-15 15:30:04 +00:00
Marcus Brinkmann
15ef3c9eeb 2010-11-15 Marcus Brinkmann <mb@g10code.com>
* w32-util.c (_gpgme_w32ce_get_debug_envvar): Fix return value.
2010-11-15 15:11:59 +00:00
Werner Koch
eef49ef417 Fixes for the MSC build 2010-11-15 08:40:30 +00:00
Werner Koch
44b2702258 More changes for W32CE with MSC. 2010-11-04 08:16:57 +00:00
Werner Koch
83d88d444e Hopefully last changes for building with MSC. 2010-11-03 10:33:10 +00:00
Werner Koch
21eb91ae3a More include guards.
Provide access for Wince.
Install dummy sehmap.h
2010-11-03 09:56:27 +00:00
Werner Koch
753375ffcf Might now build for CE using MSC. 2010-11-02 20:17:57 +00:00
Werner Koch
987993a38d First take on changes to allow building with MSC for W32CE.
Fixed regression in plain W32 build.
2010-11-02 16:27:46 +00:00
Marcus Brinkmann
b65638692e 2010-10-28 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
* opassuan.c (gpgme_op_assuan_transact_ext): Fix uninitialized
	value use.  Reported by Marc Mutz.
2010-10-28 14:00:14 +00:00
Werner Koch
de9f0b932e Fix last change 2010-10-07 12:54:17 +00:00
Werner Koch
c2ef39811d Enable debugging feature for W32CE.
kFreeBSD portability fix.
2010-10-07 10:58:51 +00:00
Werner Koch
b927279603 Return GPG_ERR_MISSING_ISSUER_CERT. 2010-09-16 14:17:50 +00:00
Werner Koch
bc22c2098d Add a new error code. 2010-09-16 13:39:00 +00:00
Marcus Brinkmann
c828c9d9a4 2010-09-02 Marcus Brinkmann <marcus@g10code.de>
* error.c (gpgme_err_code_to_errno): Fix cut and paste bug (thanks
	to Marc Mutz).
2010-09-02 21:33:26 +00:00
Marcus Brinkmann
03c7412e47 2010-09-01 Marcus Brinkmann <marcus@g10code.de>
* w32-io.c: Revert change from 2009-06-18, as it created a race
        condition.
2010-09-01 00:46:19 +00:00
Marcus Brinkmann
15a3f59481 2010-08-18 Marcus Brinkmann <marcus@g10code.de>
* gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
        * libgpgme.vers: Likewise.
        * gpgme.h.in (gpgme_error_from_errno): Fix return type to
        gpgme_error_t.
	(gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
	(gpgme_error_from_syserror): New inline function (why are
        gpgme_err_make_from_errno and gpgme_error_from_errno not inline
        functions?).
        * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
        (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
2010-08-18 14:14:27 +00:00
Marcus Brinkmann
bfd550e0d9 Are you ready already? 2010-08-04 07:47:05 +00:00
Marcus Brinkmann
cf2d82c41c Too embarrassing for a changelog entry. 2010-08-04 07:40:33 +00:00
Marcus Brinkmann
6aa92258ce 2010-08-03 Marcus Brinkmann <marcus@g10code.de>
* gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
	(result_verify_to_xml, result_import_to_xml)
        (result_genkey_to_xml):	Check vigorously for null pointers.
2010-08-03 09:16:01 +00:00
Marcus Brinkmann
6e5c9be0b6 2010-08-03 Marcus Brinkmann <marcus@g10code.de>
* w32-io.c (GPGCEDEV_IOCTL_ASSIGN_RVID): New macro.
        (_gpgme_io_spawn): Use ASSIGN_RVID.
2010-08-03 09:01:24 +00:00
Werner Koch
f89d122607 comment typo fixes 2010-06-29 17:13:07 +00:00
Marcus Brinkmann
6181854e4d 2010-06-11 Marcus Brinkmann <marcus@g10code.de>
* w32-io.c (_gpgme_io_spawn): Remove debug printf.
2010-06-10 23:29:06 +00:00
Marcus Brinkmann
f5d82bf1df 2010-06-10 Marcus Brinkmann <marcus@g10code.de>
* gpgme-tool.c (gpgme_server): Use special hack for Windows CE to
	get at stdin and stdout.
2010-06-10 17:29:43 +00:00
Marcus Brinkmann
99c855353f 2010-06-10 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_new): Translate returned achild_fds back
	to child_fds.
2010-06-10 16:13:14 +00:00
Marcus Brinkmann
dbb1112da1 2010-06-10 Marcus Brinkmann <marcus@g10code.de>
* debug.h (TRACE_SUC6): New macro.
	* w32-io.c (MAX_SLAFD): New macro.
	(fd_table): New static variable.
	(new_fd, release_fd): New functions.
	(fd_to_handle, handle_to_fd, handle_to_socket): Remove macros.
	(MAX_READERS, MAX_WRITERS): Increase to 64.
	(notify_table): Increase to MAX_SLAFD.
	(struct reader_context_s, struct writer_context_s): Add member
	file_sock.
	(reader, writer): Use file_hd vs file_sock to decide if socket
	operations to use.  Remove auto-detect mode.
	(create_reader, create_writer): Set file_sock.  Unblock pending
	thread only if this is a pipe fd.
	(_gpgme_io_pipe): Allocate fds from table and return slot indices
	instead of windows handles.  This allows to properly handle RVIDs.
	(_gpgme_io_close): Handle dup'ed file descriptors.
	(build_commandline) [HAVE_W32_SYSTEM]: Use RVID from fd table now.
	(_gpgme_io_spawn): Use fd table now.
	(_gpgme_io_fd2str): Use RVID from fd table now.
	(_gpgme_io_dup): Implement using fd table.
	(_gpgme_io_socket): Allocate fds from table.
	(_gpgme_io_connect): Use fd from table.
2010-06-10 13:49:19 +00:00
Marcus Brinkmann
b243c4263e * debug.h (TRACE_SUC6): New macro. 2010-06-10 13:41:12 +00:00
Marcus Brinkmann
9386a5e760 2010-06-09 Marcus Brinkmann <marcus@g10code.de>
* w32-io.c [HAVE_W32CE_SYSTEM]: Include assuan.h and winioctl.h.
	(GPGCEDEV_IOCTL_UNBLOCK) [HAVE_W32CE_SYSTEM]: Define.
	(set_synchronize) [HAVE_W32CE_SYSTEM]: Stub it out.
	(is_socket): Allow to return -1 for auto-detect (old behaviour).
	(is_socket) [HAVE_W32CE_SYSTEM]: Return -1.
	(reader): Handle auto-detect case.  Handle ctx->stop_me before
	checking for EOF.
	(destroy_reader) [HAVE_W32CE_SYSTEM]: Unblock a pending reader.
	(writer): Handle auto-detect case.  Handle ctx->stop_me with
	ERROR_BUSY.
	(destroy_writer) [HAVE_W32CE_SYSTEM]: Unblock a pending writer.
	(_gpgme_io_pipe) [HAVE_W32CE_SYSTEM]: Implement in terms of a
	half-pipe.
	(build_commandline) [HAVE_W32CE_SYSTEM]: New function.
	(_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Implement it differently
	for this platform.
	(_gpgme_io_fd2str) [HAVE_W32CE_SYSTEM]: Implement it for RVIDs.
	(_gpgme_io_dup) [HAVE_W32CE_SYSTEM]: Stub it out.
2010-06-09 13:33:31 +00:00
Marcus Brinkmann
13774269c0 2010-06-09 Marcus Brinkmann <marcus@g10code.de>
* gpgme-tool.c (result_add_timestamp): Add missing NULL argument.
	(result_sign_to_xml): Protect against NULL fingerprint.
	(struct server): New members input_fd, input_filename,
	input_stream output_fd, output_filename, output_stream,
	message_filename, message_stream.
	(server_reset_fds): Deallocate those.
	(server_parse_fd): New function.
	(server_data_obj): Take optional filename argument and direction
	argument.  Also take new argument to return a filestream that
	needs to be closed after destroying the data object.
	Change all callers, too.
	(input_notify, output_notify): Removed.
	(cmd_input, cmd_output): New functions.
	(gpgme_server): Do not register input and output notifier.
	(register_commands): Use cmd_input and cmd_output.
	(cmd_message): Rewritten to use server_parse_fd.
	(cmd_delete, cmd_keylist): Fix inverted option check.
	(main) [HAVE_W32CE_SYSTEM]: Sleep a bit to work around bug in ssh.
2010-06-09 13:23:30 +00:00
Marcus Brinkmann
3029f454e3 2010-06-09 Marcus Brinkmann <marcus@g10code.de>
* genkey.c (gpgme_op_genkey): Return err with TRACE_ERR.
2010-06-09 13:14:44 +00:00
Marcus Brinkmann
9f77c2541c 2010-05-12 Marcus Brinkmann <marcus@g10code.de>
* conversion.c (_gpgme_timegm) [HAVE_W32_SYSTEM]: New static
	function.
	(_gpgme_parse_timestamp) [HAVE_W32_SYSTEM]: Use it.
2010-05-12 18:20:36 +00:00
Marcus Brinkmann
8d27defa02 2010-05-12 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Check for setlocale.

src/
2010-05-12  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme-tool.c (main): Protect call to setlocale with
	HAVE_SETLOCALE.
2010-05-12 17:40:08 +00:00
Marcus Brinkmann
ca3e5c63b9 2010-05-12 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (system_components): Remove custom cppflags from
	RCCOMPILE (because gpg-error adds -idirafter that makes RC bail.
	[HAVE_W32CE_SYSTEM]: Add w32-ce.h and w32-ce.c, clear
	libexec_PROGRAMS.
	* w32-ce.h, w32-ce.c: New files.
2010-05-12 17:21:36 +00:00