1 2011-04-06 Werner Koch <wk@g10code.com>
3 * gpgme.h.in: Use INSERT__TYPEDEFS_FOR_GPGME_H to include platform
6 2011-02-03 Werner Koch <wk@g10code.com>
9 * mkstatus: Extend to also process extra-stati.h
10 * Makefile.am (main_sources): Add extra-stati.h
11 (status-table.h): Depend on extra-stati.h and adjust rule.
13 2011-02-03 Marcus Brinkmann <marcus@g10code.com>
15 * w32-io.c (_gpgme_io_socket): Return fd, not res.
17 2011-02-02 Marcus Brinkmann <mb@g10code.com>
19 * assuan-support.c (my_socket, my_connect): New functions.
20 (_gpgme_assuan_system_hooks): Add my_Socket, my_connect.
21 * priv-io.h (_gpgme_io_socket): New prototype.
22 * w32-io.c (pid_to_handle, handle_to_oid, fd_to_handle): Remove macros.
23 (is_socket): Remove function.
24 (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Remove some dead code.
25 (_gpgme_io_spawn): Translate handles before DuplicateHandle them.
27 2011-02-02 Marcus Brinkmann <mb@g10code.com>
29 * w32-util.c (mkstemp): Don't use CreateFile instead of open (the
30 function is not used on Windows CE, and the callers were not
33 2011-01-21 Marcus Brinkmann <mb@g10code.com>
35 * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is
38 2010-12-08 Werner Koch <wk@g10code.com>
40 * gpgme-tool.c (strcpy_escaped_plus): New.
41 (DIM, xtoi_1, xtoi_2): New.
42 (cmd_keylist): Allow for multiple patterns.
44 2010-11-23 Marcus Brinkmann <mb@g10code.com>
46 * w32-io.c (create_reader, create_writer): Use small stack size on
49 2010-11-23 Marcus Brinkmann <mb@g10code.com>
51 * gpgme.h.in (gpgme_conf_arg_new): Make VALUE arg const void *.
52 * gpgconf.c (_gpgme_conf_arg_new): Likewise.
53 (gpgme_conf_arg_new): Likewise.
54 * engine-gpgconf.c (_gpgme_conf_arg_new): Likewise.
55 (gpgconf_write): Remove debug hack.
57 2010-11-19 Marcus Brinkmann <mb@g10code.com>
59 * engine-gpgconf.c (_gpgme_conf_opt_change): Support
60 self-assignment. Requested by Marc Mutz.
62 2010-11-17 Marcus Brinkmann <mb@g10code.com>
64 * vasprintf.c (int_vasprintf) [HAVE_W32CE_SYSTEM]: Just use a
65 fixed size buffer, as va_copy is not easy to fake.
67 2010-11-15 Marcus Brinkmann <mb@g10code.com>
69 * w32-ce.h (strcasecmp, strdup) [_MSC_VER]: Define.
70 * genkey.c, passphrase.c: Include util.h.
72 * w32-util.c (_gpgme_w32ce_get_debug_envvar): Fix return value.
74 2010-11-15 Werner Koch <wk@g10code.com>
76 * data-compat.c (gpgme_data_new_from_filepart)
77 (gpgme_data_new_from_file) [W32CE && _MSC_VER]: Return not
78 GPG_ERR_NOT_IMPLEMENTED.
80 * w32-ce.h (HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG, _IOLBF)
81 (abort) [_MSC_VER]: Provide these macros.
83 * ath.h [W32CE && _MSC_VER]: Include winsock2.h.
85 * ath.c (ath_read, ath_write) [W32CE && _MSC_VER]: Do not call
86 non-available functions.
88 2010-11-04 Werner Koch <wk@g10code.com>
90 * w32-ce.h [_MSC_VER && W32CE]: Undef leave.
91 * export.c: Include util.h so that we get the above undef.
93 * memrchr.c: Remove. Used to be a replacement function required
94 by the formerly included assuan code.
96 2010-11-03 Werner Koch <wk@g10code.com>
98 * debug.c (_gpgme_debug) [W32CE]: Replace locatime by GetLocalTime.
100 * signers.c (gpgme_signers_clear): Remove useless return.
101 Reported by Patrick Spendrin.
103 * w32-util.c: s/__inline__/GPG_ERR_INLINE/
105 * setenv.c: Include string.h due to our strerror replacement.
107 * w32-ce.h (access, bsearch): New macros.
108 * w32-ce.c (_gpgme_wince_access): New.
109 (RegQueryValueExA): Change DATA to a void*.
110 (_gpgme_wince_bsearch): New. Taken from glibc 2.6.
112 Guard include of sys/stat.h and sys/types.h.
114 2010-11-02 Werner Koch <wk@g10code.com>
116 * data-fd.c (read, write, lseek) [W32CE && ! __MINGW32CE__]: New.
117 Taken from Pedro Alves Public Domain code.
119 * w32-ce.h (SHGetSpecialFolderPath): Remove our defines and
120 prototypes. We use the system provided prototypes now.
121 * w32-ce.c: Include shlobj.h
122 (_WIN32_IE): Define to 0x0400
124 * w32-util.c: Explicitly include windows headers before util.h.
125 (_gpgme_w32ce_get_debug_envvar): Do not use wchar_t strings for
126 read_w32_registry_string.
127 (mkstemp): Use CreateFile instead of open.
129 * w32-io.c (handle_to_fd, fd_tohandle): Add. We need them for W32.
130 * w32-util.c (_WIN32_IE): Define to 0x0400.
132 * util.h [W32]: Include windows.h.
133 * w32-sema.c: Do not include windows.h directly.
134 * ath.c (ssize_t, pid_t)[_MSC_VER]: Add new types.
135 * gpgme.c (gpgme_result_ref, gpgme_result_unref): Do not use a
136 void pointer in pointer arithmetic.
137 * w32-util.c: Include util.h prior to ath.h. Don't include
139 (F_OK): Define if not defined.
140 * w32-ce.c: Include string.h.
141 (RegQueryValueExA): Use WINAPI modifier to match the declaration.
142 * vfs-create.c: Include string.h because under W32CE with MSC we
143 get a warning related to our strerror replacement.
144 * encrypt-sign.c: Include stdlib.h, string.h and errno.h.
145 * priv-io.h [W32CE]: Include w32-ce.h
146 * w32-ce.h: Include winsock2.h and ws2tcpip.h.
147 (_MSV_VER): Remove useless macro.
148 (pid_t): Add typedef.
150 Guard all includes of unistd.h and sys/time.h.
152 2010-10-28 Marcus Brinkmann <marcus@g10code.com>
154 * opassuan.c (gpgme_op_assuan_transact_ext): Fix uninitialized
155 value use. Reported by Marc Mutz.
157 2010-10-07 Werner Koch <wk@g10code.com>
159 * gpgme-tool.c (ARGP_ERR_UNKNOWN): Use EDEADLK if available.
161 * w32-util.c (_gpgme_w32ce_get_debug_envvar) [W32CE]: New.
162 * debug.c (debug_init) [W32CE]: Use new function.
164 2010-09-16 Werner Koch <wk@g10code.com>
166 * import.c: Include "util.h".
167 (parse_import): Return GPG_ERR_MISSING_ISSUER_CERT.
169 * util.h: Add fallback define for GPG_ERR_MISSING_ISSUER_CERT.
170 * op-support.c: Include "util.h".
171 (_gpgme_parse_inv_recp): Handle new code 12.
173 2010-09-02 Marcus Brinkmann <marcus@g10code.de>
175 * error.c (gpgme_err_code_to_errno): Fix cut and paste bug (thanks
178 2010-09-01 Marcus Brinkmann <marcus@g10code.de>
180 * w32-io.c: Revert change from 2009-06-18, as it created a race
183 2010-08-18 Marcus Brinkmann <marcus@g10code.de>
185 * gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
186 * libgpgme.vers: Likewise.
187 * gpgme.h.in (gpgme_error_from_errno): Fix return type to
189 (gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
190 (gpgme_error_from_syserror): New inline function (why are
191 gpgme_err_make_from_errno and gpgme_error_from_errno not inline
193 * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
194 (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
196 2010-08-03 Marcus Brinkmann <marcus@g10code.de>
198 * gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
199 (result_verify_to_xml, result_import_to_xml)
200 (result_genkey_to_xml): Check vigorously for null pointers.
202 * w32-io.c (GPGCEDEV_IOCTL_ASSIGN_RVID): New macro.
203 (_gpgme_io_spawn): Use ASSIGN_RVID.
205 2010-06-11 Marcus Brinkmann <marcus@g10code.de>
207 * w32-io.c (_gpgme_io_spawn): Remove debug printf.
209 2010-06-10 Marcus Brinkmann <marcus@g10code.de>
211 * gpgme-tool.c (gpgme_server): Use special hack for Windows CE to
212 get at stdin and stdout.
214 * engine-gpgsm.c (gpgsm_new): Translate returned achild_fds back
217 * debug.h (TRACE_SUC6): New macro.
218 * w32-io.c (MAX_SLAFD): New macro.
219 (fd_table): New static variable.
220 (new_fd, release_fd): New functions.
221 (fd_to_handle, handle_to_fd, handle_to_socket): Remove macros.
222 (MAX_READERS, MAX_WRITERS): Increase to 64.
223 (notify_table): Increase to MAX_SLAFD.
224 (struct reader_context_s, struct writer_context_s): Add member
226 (reader, writer): Use file_hd vs file_sock to decide if socket
227 operations to use. Remove auto-detect mode.
228 (create_reader, create_writer): Set file_sock. Unblock pending
229 thread only if this is a pipe fd.
230 (_gpgme_io_pipe): Allocate fds from table and return slot indices
231 instead of windows handles. This allows to properly handle RVIDs.
232 (_gpgme_io_close): Handle dup'ed file descriptors.
233 (build_commandline) [HAVE_W32_SYSTEM]: Use RVID from fd table now.
234 (_gpgme_io_spawn): Use fd table now.
235 (_gpgme_io_fd2str): Use RVID from fd table now.
236 (_gpgme_io_dup): Implement using fd table.
237 (_gpgme_io_socket): Allocate fds from table.
238 (_gpgme_io_connect): Use fd from table.
240 * w32-glib-io.c (find_channel): Check that the slot is used.
242 2010-06-09 Marcus Brinkmann <marcus@g10code.de>
244 * w32-io.c [HAVE_W32CE_SYSTEM]: Include assuan.h and winioctl.h.
245 (GPGCEDEV_IOCTL_UNBLOCK) [HAVE_W32CE_SYSTEM]: Define.
246 (set_synchronize) [HAVE_W32CE_SYSTEM]: Stub it out.
247 (is_socket): Allow to return -1 for auto-detect (old behaviour).
248 (is_socket) [HAVE_W32CE_SYSTEM]: Return -1.
249 (reader): Handle auto-detect case. Handle ctx->stop_me before
251 (destroy_reader) [HAVE_W32CE_SYSTEM]: Unblock a pending reader.
252 (writer): Handle auto-detect case. Handle ctx->stop_me with
254 (destroy_writer) [HAVE_W32CE_SYSTEM]: Unblock a pending writer.
255 (_gpgme_io_pipe) [HAVE_W32CE_SYSTEM]: Implement in terms of a
257 (build_commandline) [HAVE_W32CE_SYSTEM]: New function.
258 (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Implement it differently
260 (_gpgme_io_fd2str) [HAVE_W32CE_SYSTEM]: Implement it for RVIDs.
261 (_gpgme_io_dup) [HAVE_W32CE_SYSTEM]: Stub it out.
263 * gpgme-tool.c (result_add_timestamp): Add missing NULL argument.
264 (result_sign_to_xml): Protect against NULL fingerprint.
265 (struct server): New members input_fd, input_filename,
266 input_stream output_fd, output_filename, output_stream,
267 message_filename, message_stream.
268 (server_reset_fds): Deallocate those.
269 (server_parse_fd): New function.
270 (server_data_obj): Take optional filename argument and direction
271 argument. Also take new argument to return a filestream that
272 needs to be closed after destroying the data object.
273 Change all callers, too.
274 (input_notify, output_notify): Removed.
275 (cmd_input, cmd_output): New functions.
276 (gpgme_server): Do not register input and output notifier.
277 (register_commands): Use cmd_input and cmd_output.
278 (cmd_message): Rewritten to use server_parse_fd.
279 (cmd_delete, cmd_keylist): Fix inverted option check.
280 (main) [HAVE_W32CE_SYSTEM]: Sleep a bit to work around bug in ssh.
282 * genkey.c (gpgme_op_genkey): Return err with TRACE_ERR.
284 2010-05-12 Marcus Brinkmann <marcus@g10code.de>
286 * conversion.c (_gpgme_timegm) [HAVE_W32_SYSTEM]: New static
288 (_gpgme_parse_timestamp) [HAVE_W32_SYSTEM]: Use it.
290 * gpgme-tool.c (main): Protect call to setlocale with
293 * Makefile.am (system_components): Remove custom cppflags from
294 RCCOMPILE (because gpg-error adds -idirafter that makes RC bail.
295 [HAVE_W32CE_SYSTEM]: Add w32-ce.h and w32-ce.c, clear
297 * w32-ce.h, w32-ce.c: New files.
299 * priv-io.h: Include <sys/types.h>
302 2010-05-11 Marcus Brinkmann <marcus@g10code.de>
304 * w32-util.c: Include ath.h
305 (HAVE_ALLOW_SET_FOREGROUND_WINDOW) [!HAVE_W32CE_SYSTEM]: Define
307 (RTLD_LAZY, dlopen, dlsym,
308 dlclose) [!HAVE_ALLOW_SET_FORGROUND_WINDOW]: Don't define anymore.
309 (_gpgme_allow_set_foreground_window) [!HAVE_ALLOW_SET_FOREGROUND_WINDOW]:
311 (read_w32_registry_string): Use FooA variants of Windows functions
312 instead of Foo (which dispatches depending on UNICODE).
313 [!HAVE_W32CE_SYSTEM]: Don't check environment.
314 (w32_shgetfolderpath): Remove.
315 (find_program_at_standard_place): Call
316 SHGetSpecialFolderPath (which is available on all Windows systems
317 and also Windows CE).
318 (mkstemp): Use ath_self instead of getpid.
319 (_gpgme_mkstemp): Use GetTempPathA instead of GetTempPath.
321 * gpgme.h.in: Use _WIN32 instead of _MSC_VER. Include time.h for
324 2010-05-07 Marcus Brinkmann <marcus@g10code.de>
326 * engine-g13.c, gpgme.c, engine-gpgsm.c, engine-gpg.c,
327 op-support.c, engine-assuan.c, gpgme-tool.c: Include <locale.h>
328 only if available with HAVE_LOCALE_H and conditionalize use of
329 LC_CTYPE on its definition.
330 * engine-gpgconf.c: Do not include <locale.h>.
332 * engine-gpgsm.c (gpgsm_new, start): Cast between int and
334 * assuan-support.c (my_pipe, my_close, my_read, my_write): Likewise.
335 * gpgme-tool.c (server_data_obj, server_reset_fds, gpgme_server),
336 (my_recvmsg, my_sendmsg, my_spawn): Likewise.
337 * engine-assuan.c (start): Likewise.
338 * engine-g13.c (start): Likewise.
340 2010-05-06 Marcus Brinkmann <marcus@g10code.de>
342 * w32-glib-io.c, w32-io.c, w32-qt-io.cpp, w32-sema.c, w32-util.c:
343 Do not include <signal.h>.
345 * sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c,
346 decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c,
347 data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use
348 gpg_error_from_syserror instead gpg_error_from_errno, and use
349 gpg_err_set_errno to set error number.
350 * setenv.c: Include <gpg-error.h> and define __set_errno to use
352 * gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is
353 mapped in Windows CE) instead of E2BIG (which is not).
354 (gt_import_keys): Initialize err.
356 2010-04-19 Marcus Brinkmann <marcus@g10code.de>
358 * assuan-support.c (my_spawn): Cast to avoid warning.
359 * engine-g13.c (g13_new): Make ARGV array of pointer to const
361 (g13_assuan_simple_command) [!USE_DESCRIPTOR_FUNCTION]: Don't define.
362 * ops.h (_gpgme_key_append_name): Same in prototype.
363 * key.c (_gpgme_key_append_name): Make SRC argument pointer to
365 * posix-util.c (_gpgme_get_uiserver_socket_path): Make HOMEDIR
367 * vfs-mount.c (gpgme_op_vfs_transact_start): Never define this
368 potentially useful but currently unused function.
369 * vfs-create.c (gpgme_op_vfs_transact_start): Likewise.
371 2010-04-16 Werner Koch <wk@g10code.com>
373 * w32-io.c (is_socket): New.
374 (reader, writer): Use it to figure out the API to use.
376 2010-03-15 Werner Koch <wk@g10code.com>
378 * gpgme.h.in: Add autoconf template to set generated file to
379 read-only in an emacs buffer.
381 2010-03-12 Werner Koch <wk@g10code.com>
383 * gpgme.h.in (GPGME_STATUS_SUCCESS): Use the right file for the
386 * passwd.c (op_data_t): New.
387 (passwd_start): Setup OPD.
388 (passwd_status_handler): Return GPG_ERR_NOT_SUPPORTED if needed.
389 * context.h (OPDATA_PASSWD): New.
390 * gpgme.h (GPGME_STATUS_SUCCESS): New.
392 2010-03-09 Werner Koch <wk@g10code.com>
394 * engine-gpgsm.c (gpgsm_keylist): Try to start the agent.
396 2010-02-17 Werner Koch <wk@g10code.com>
398 * posix-io.c (notify_table): Change implementation.
399 (notify_table_item_t, notify_table_size, notify_table_lock): New.
400 (_gpgme_io_close, _gpgme_io_set_close_notify): Adjust for new
403 2010-02-16 Werner Koch <wk@g10code.com>
405 * gpgme-tool.c (spacep, has_option, skip_options): New.
406 (cmd_export): Implement option --minimal.
408 * gpgme.h.in (GPGME_EXPORT_MODE_MINIMAL): New.
409 * export.c (export_start, export_ext_start): Implement it.
410 * engine-gpg.c (export_common): Ditto.
412 2010-01-25 Werner Koch <wk@g10code.com>
414 * w32-io.c (_gpgme_io_connect): Fix return code check to make it work.
416 * version.c (do_subsystem_inits): Remove superfluous second
419 2010-01-22 Werner Koch <wk@g10code.com>
421 * w32-io.c (writer): Try to use send first.
422 (reader): Try to use recv first.
424 2010-01-08 Werner Koch <wk@g10code.com>
426 * engine-gpg.c (gpg_passwd): New.
427 (_gpgme_engine_ops_gpg): Register.
428 * passwd.c (parse_error): New.
429 (passwd_status_handler): Use it.
431 2010-01-07 Marcus Brinkmann <marcus@g10code.de>
433 * gpgme-tool.c (result_xml_write_cb_t, struct result_xml_state):
435 (MAX_TAGS): New macro.
436 (result_init, result_xml_indent, result_xml_tag_start)
437 (result_xml_tag_data, result_xml_tag_end, result_add_error)
438 (result_add_pubkey_algo, result_add_hash_algo, result_add_keyid)
439 (result_add_fpr, result_add_timestamp, result_add_sig_mode)
440 (result_add_value, result_add_string, result_encrypt_to_xml)
441 (result_decrypt_to_xml, result_sign_to_xml)
442 (result_verify_to_xml, result_import_to_xml)
443 (result_genkey_to_xml, result_keylist_to_xml)
444 (result_vfs_mount_to_xml): New functions.
445 (gt_result): Rewritten.
447 2010-01-05 Werner Koch <wk@g10code.com>
449 * gpgme-tool.c (gt_passwd, cmd_passwd): New.
450 (register_commands): Register.
452 * gpgme.h.in (gpgme_op_passwd_start, gpgme_op_passwd): New.
453 * libgpgme.vers, gpgme.def: Add new functions.
455 * Makefile.am (main_sources): Add passwd.c
456 * engine.c, engine.h (_gpgme_engine_op_passwd): New.
457 * engine-backend.h (struct engine_ops): Add PASSWD.
458 * engine-gpgsm.c (gpgsm_passwd): New.
459 (_gpgme_engine_ops_gpgsm): Register.
460 (gpgsm_reset): Reset only if we have a conenction.
462 * gpgme.h.in (GPGME_PK_ECDSA, GPGME_PK_ECDH): New.
463 * gpgme.c (gpgme_pubkey_algo_name): Add them.
465 2009-12-22 Marcus Brinkmann <marcus@g10code.de>
467 * debug.c: Test for TLS, not __GNUC__
469 2009-12-15 Marcus Brinkmann <marcus@g10code.de>
471 * assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
473 2009-12-10 Werner Koch <wk@g10code.com>
475 * debug.c (debug_init): Test on sgid process.
477 2009-12-08 Marcus Brinkmann <marcus@g10code.de>
479 * Makefile.am (LTRCCOMPILE): Refactor with ...
480 (RCCOMPILE): ... this new macro.
482 (gpgme_res_ldflag): Removed.
483 (gpgme_res): Use libtool object file name here.
484 (libgpgme_la_LDFLAGS): Remove gpgme_res_ldflag usage.
485 (libgpgme_la_LIBADD): Add gpgme_res.
487 * ath.c (ath_self) [HAVE_W32_SYSTEM]: Fix typo.
489 2009-12-02 Werner Koch <wk@g10code.com>
491 * gpgconf.c (gpgme_conf_arg_release): No return in a function
492 returning void. Reported by Wyllys Ingersoll.
494 2009-12-01 Werner Koch <wk@g10code.com>
496 * gpgme-tool.c (cmd_getauditlog): Add flag --html.
497 (hlp_getauditlog): New.
499 * gpgme-tool.c (GT_GCC_A_SENTINEL, GT_GCC_A_PRINTF): New.
500 (gt_write_status): Use sentinel.
501 (argp_error, log_error): Use printf attribute.
502 (argp_parse): Remove extra argument to argp_error.
503 (_gt_progress_cb, gt_get_engine_info, gt_get_keylist_mode)
504 (gt_result): Add NULL arg.
506 2009-11-26 Marcus Brinkmann <marcus@g10code.de>
508 * opassuan.c (opassuan_start): Allocate result structure before
511 2009-11-25 Marcus Brinkmann <marcus@g10code.de>
513 * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen
516 2009-11-13 <wk@g10code.com>
518 * sign.c (_gpgme_sign_status_handler): Handle SIG_CREATED_SEEN.
519 * engine-uiserver.c (uiserver_sign): Make sending SENDER optional.
521 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
523 * op-support.c (_gpgme_op_reset): Instead of last change, only set
524 sub protocol if it is not the default.
526 2009-11-10 Werner Koch <wk@g10code.com>
528 * op-support.c (_gpgme_op_reset): Ignore GPG_ERR_NOT_IMPLEMENTED
529 while setting the sub protocol.
531 * engine-uiserver.c (uiserver_new): Pass fdpassing flag to
532 assuan_socket_connect.
533 (set_recipients): Replace fingerprint by user id.
535 * engine-gpgsm.c (set_recipients): Fix non-terminating loop in
536 case of a missing key.
538 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
540 * gpgme.c (gpgme_new): Set default sub protocol.
541 * gpgme-tool.c: Implement get sub protocol.
543 * gpgme.h.in (gpgme_get_sub_protocol): Add prototype.
544 * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol.
545 * context.h (struct gpgme_context): New member sub_protocol.
546 * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol.
547 (gpgme_get_sub_protocol): New function.
548 * op-support.c (_gpgme_op_reset): Set sub protocol.
550 * Makefile.am (uiserver_components): New variable.
551 (main_sources): Add it.
552 * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
553 implement it. Adjust callers.
554 (gpgme_key_from_uid): New function.
555 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT.
556 (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE,
557 GPGME_ENCRYPT_EXPECT_SIGN.
558 (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions.
559 * libgpgme.vers, gpgme.def: Add new functions.
560 * gpgme.c (gpgme_set_protocol): Add UIServer protocol.
561 (gpgme_set_sub_protocol): New function.
562 (gpgme_get_protocol_name): Add UIServer and default protocol.
563 * assuan-support.c: Return correct error values, implement
564 socketpair for POSIX.
565 * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c,
566 w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE
567 arguments. Implement it for POSIX. Adjust all callers.
568 * engine.h, engine-backend.h (_gpgme_engine_set_protocol)
569 (_gpgme_engine_op_decrypt_verify): New prototypes. Adjust all
571 * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer
573 (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New
575 * decrypt-verify.c (decrypt_verify_start): Call
576 _gpgme_engine_op_decrypt_verify.
577 * util.h, posix-util.c,
578 w32-util.c (_gpgme_get_uiserver_socket_path): New function.
579 * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation.
580 * gpgme-tool.c: Some support for UIServer protocol.
581 * engine-uiserver.c: New file.
583 2009-11-09 Marcus Brinkmann <marcus@g10code.de>
585 * engine-gpgsm.c (gpgsm_new): Close server side FDs.
587 2009-11-06 Marcus Brinkmann <marcus@g10code.de>
589 * gpgme-tool.c (struct gpgme_tool): New members write_data and
591 (gt_write_data): New function.
592 (gt_result): Output vfs_mount result.
593 (server_write_data): New function.
594 (gpgme_server): Initialize write_data members.
596 2009-11-05 Marcus Brinkmann <marcus@g10code.de>
598 * engine-g13.c (struct engine_g13): Remove members RESULT_CB and
600 (g13_assuan_simple_command, status_handler): Don't use those anymore.
601 (g13_transact): Remove them from argument list, too.
602 * vfs-mount.c (_gpgme_vfs_mount_status_handler): New function.
603 (_gpgme_op_vfs_mount): Pass it to transact.
605 * engine-assuan.c (llass_new): Update use of assuan_socket_connect.
606 * engine-gpgsm.c (gpgsm_new): Update use of assuan_pipe_connect.
607 * engine-g13.c (g13_new): Likewise.
609 * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
610 * w32-io.c (_gpgme_io_spawn): Implement this flag.
611 * posix-io.c (_gpgme_io_spawn): Likewise.
612 * w32-glib-io.c (_gpgme_io_spawn): Likewise.
613 * assuan-support.c (my_spawn): Set this flag.
615 * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
616 * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
617 * delete.c (gpgme_op_delete_start): Likewise.
618 * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start):
620 * encrypt.c (gpgme_op_encrypt_start): Likewise.
621 * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise.
622 * export.c (gpgme_op_export_start, gpgme_op_export_ext_start)
623 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
624 * genkey.c (gpgme_op_genkey_start): Likewise.
625 * getauditlog.c (gpgme_op_getauditlog_start): Likewise.
626 * import.c (gpgme_op_import_start, gpgme_op_import_keys_start):
628 * opassuan.c (gpgme_op_assuan_transact_start): Likewise.
629 * sign.c (gpgme_op_sign_start): Likewise.
630 * verify.c (gpgme_op_verify_start): Likewise.
631 * vfs-create.c (gpgme_op_vfs_create): Likewise.
632 * vfs-mount.c (gpgme_op_vfs_mount): Likewise.
634 2009-11-04 Marcus Brinkmann <marcus@g10code.de>
636 * ath.h (ath_self): New prototype. Include <stdint.h>
637 * ath.c, ath-pth.c, ath-pthread.c (ath_self): New function.
638 * debug.h: Rewrite most macros to beautify debug output.
639 (_gpgme_debug_buffer): Remove tagname and tag argument.
640 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New prototypes.
641 * debug.c: Include <time.h>. Don't include assuan.h.
642 (frame_nr, FRAME_NR): New thread-specific variable and macro.
643 (debug_init): Do not initialize assuan. Call _gpgme_debug after
644 initialization instead using printf directly.
645 (_gpgme_debug): Do not call debug_init (we now ensure proper
646 initialization by user). Add timestamp and thread/process ID.
647 (_gpgme_debug_buffer): Do not take tagname and tag argument.
648 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New functions.
649 * version.c (gpgme_check_version_internal, gpgme_check_version):
650 Fix debug string. Do not initialize assuan.
651 * posix-io.c (get_max_fds): Use 0 not NULL (nicer debug output).
653 2009-11-04 Werner Koch <wk@g10code.com>
655 * gpgme-tool.c (register_commands): Add HELP feature.
657 2009-11-03 Werner Koch <wk@g10code.com>
659 * gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
661 2009-11-03 Marcus Brinkmann <marcus@g10code.de>
663 * Makefile.am (main_sources): Change g13.c to vfs-mount.c. Add
665 * vfs-create.c: New file.
666 * g13.c: Renamed to ...
667 * vfs-mount.c: ... this new file.
668 * gpgme.h.in (gpgme_op_vfs_create): New prototype.
669 * gpgme.def, libgpgme.vers: Add gpgme_op_vfs_create.
670 * gpgme-tool.c (gt_vfs_create, cmd_vfs_create): New functions.
671 (register_commands): Add VFS_CREATE and CREAET.
673 2009-11-02 Marcus Brinkmann <marcus@g10code.de>
675 * debug.h (_gpgme_debug_buffer): Make TAG argument const const.
676 * debug.c (_gpgme_debug_buffer): Likewise.
677 * gpgme-tool.c (input_notify, output_notify): Adjust type to new
679 * decrypt.c (gpgme_op_decrypt_result): Remove unused variable.
680 * opassuan.c (gpgme_op_assuan_transact): Fix return value.
682 2009-10-30 Marcus Brinkmann <marcus@g10code.de>
684 * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
685 (gpgme_tool_LDADD): New variable.
686 * gpgme-tool.c: New file.
687 * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
689 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
690 had that gone missing?).
691 (_gpgme_sig_notation_clear): New function without debug output.
692 (gpgme_release): Call it and _gpgme_signers_clear.
693 * signers.c (_gpgme_signers_clear): New function without debug output.
694 * g13.c (gpgme_op_vfs_mount): Add debug output.
695 * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
696 * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
697 * debug.h: Put tag in front of debug lines, should make for nicer
699 * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
700 * engine-g13.c (g13_new): Remove redundant assuan context allocation.
701 * version.c (gpgme_check_version_internal): Delay debug output
702 until after gpgme_check_version was called.
704 2009-10-28 Marcus Brinkmann <marcus@g10code.de>
706 * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
707 edit.c, import.c, export.c: Fix last change in debug output.
709 2009-10-27 Marcus Brinkmann <marcus@g10code.de>
711 * edit.c (gpgme_op_edit_start, gpgme_op_edit)
712 (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
713 * encrypt-sign.c (gpgme_op_encrypt_sign_start)
714 (gpgme_op_encrypt_sign): Likewise.
715 * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
716 (gpgme_op_encrypt_result): Likewise.
717 * export.c (gpgme_op_export_start, gpgme_op_export)
718 (gpgme_op_export_ext_start, gpgme_op_export_ext)
719 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
720 * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
721 (gpgme_op_genkey_result): Likewise.
722 * getauditlog.c (gpgme_op_getauditlog_start)
723 (gpgme_op_getauditlog): Likewise.
724 * import.c (gpgme_op_import_result, gpgme_op_import_start)
725 (gpgme_op_import): Likewise.
726 * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
727 (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
728 (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
729 * opassuan.c (gpgme_op_assuan_transact_start)
730 (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
731 (gpgme_op_assuan_transact): Likewise.
732 * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
733 * trustlist.c (gpgme_op_trustlist_start)
734 (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
735 * verify.c (gpgme_op_verify_start, gpgme_op_verify)
736 (gpgme_op_verify_result): Likewise.
738 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
740 * gpgme.h.in (struct gpgme_io_event_done_data)
741 (gpgme_io_event_done_data_t): New types.
742 (struct _gpgme_op_assuan_result): Deprecate the err member.
743 (gpgme_op_assuan_result): Deprecate (for now).
744 (gpgme_op_assuan_transact_ext): New prototype.
745 (gpgme_op_assuan_transact): Deprecate.
746 (struct _gpgme_op_g13_result): Replace with ...
747 (struct _gpgme_op_vfs_mount_result): ... this.
748 (gpgme_op_g13_mount): Replace with ...
749 (gpgme_op_vfs_mount): ... this.
750 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
751 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
752 (gpgme_op_g13_mount): Remove.
753 * libgpgme.vers: Likewise.
754 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
755 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
757 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
759 (_gpgme_wait_one_ext): New prototype.
760 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
761 * engine-g13.c (g13_cancel_op): New function.
762 (parse_status): Remove declaration.
763 (g13_assuan_simple_command): Do nothing with status lines for now.
764 (status_handler): Update opaque value access.
765 (_gpgme_engine_ops_g13): Add new cancel_op member.
766 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
767 Handle operational errors.
768 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
769 * data.c (_gpgme_data_inbound_handler)
770 (_gpgme_data_outbound_handler): Adjust opaque value access.
771 * engine-gpg.c (command_handler, status_handler)
772 (colon_line_handler): Likewise.
773 * engine-gpgsm.c (status_handler): Likewise.
774 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
775 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
776 * g13.c: Rewritten (and will be rewritten again).
777 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
778 and result_cb_value parameters from prototype.
779 (_gpgme_engine_cancel_op): New prototype.
780 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
781 (_gpgme_engine_op_assuan_transact): Remove result_cb and
782 result_cb_value parameter.
783 (_gpgme_engine_cancel_op): New function.
784 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
785 (struct io_cb_data): New struct to pass opaque data and get a
786 op_err return value. Needed because we can't modify I/O callback
787 handler signature because it is exposed to the user.
788 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
790 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
792 * wait-private.c (_gpgme_wait_on_condition): New argument to
793 retrieve the operational result. Handle operational errors in
794 session based protocols.
795 (_gpgme_wait_one_ext): New function.
796 (_gpgme_wait_one): Pass argument in invocation of
797 _gpgme_wait_on_condition.
798 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
799 (ctx_done): New argument OP_ERR.
800 (ctx_wait): New argument OP_ERR.
801 (gpgme_wait_ext): New function based on gpgme_wait but handling
803 (gpgme_wait): Implement in term of gpgme_wait_ext.
804 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
805 of _gpgme_wait_on_condition.
806 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
807 invocation of _gpgme_wait_on_condition.
808 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
809 and RESULT_CB_VALUE by LAST_OP_ERR.
810 (_gpgme_engine_assuan_last_op_err): Add this hack function.
811 (llass_cancel_op): New function.
812 (_gpgme_engine_llass_ops): Add cancel_op member.
813 (llass_status_handler): Update opaque value access.
814 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
815 * opassuan.c: Move compat hacks to the end of file.
816 (opassuan_start): Do not set OPD->result.err.
817 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
818 (gpgme_op_assuan_transact_ext): New function.
820 * debug.h (DEBUG_GLOBAL): New debug level.
821 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
822 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
823 * data-fd.c (gpgme_data_new_from_fd): Likewise.
824 * data-stream.c (gpgme_data_new_from_stream): Likewise.
825 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
826 (gpgme_op_decrypt): Likewise.
827 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
828 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
829 (gpgme_op_decrypt_verify): Likewise.
830 * sign.c (gpgme_op_sign_result): Fix debug message.
831 * data-mem.c (gpgme_data_new): Improve debug output.
832 * verify.c (parse_trust): Use atoi instead of
833 _gpgme_map_gnupg_error.
834 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
836 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
838 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
839 (g13_components): New variable.
840 (main_sources): Add $(g13_components).
841 * g13.c, engine-g13.c: New files.
842 * engine.c (engine_ops): Check for assuan for assuan engine, add
844 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
846 * conversion.c (_gpgme_encode_percent_string): New function.
847 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
848 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
849 (gpgme_op_g13_mount): New function.
850 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
851 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
852 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
853 * posix-util.c (_gpgme_get_g13_path): New function.
854 * w32-util.c (_gpgme_get_g13_path): New function.
855 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
857 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
859 * gpgme-config.in (netlibs): Remove.
860 (assuan_cflags, assuan_libs): Add.
862 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
863 (gpgsm_components): Move engine-assuan.c to ...
864 (assuan_components): ... this new variable.
865 (main_sources): Add this new variable.
866 (AM_CPPFLAGS): Remove $(assuan_cppflags).
867 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
868 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
869 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
870 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
871 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
872 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
873 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
875 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
876 _gpgme_io_sendmsg, _gpgme_io_waitpid.
877 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
879 * posix-io.c (_gpgme_io_waitpid): Make non-static.
880 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
881 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
882 * engine-gpgsm.c: Don't map assuan error codes. Use
883 assuan_release instead of assuan_disconnect.
884 (map_assuan_error): Remove function.
885 (gpgsm_new): Use new assuan context interface.
886 * engine-assuan.c: Use assuan_release instead of
888 (llass_new): Use new assuan context interface.
890 2009-10-07 <wk@g10code.com>
892 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
894 2009-08-06 Werner Koch <wk@g10code.com>
896 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
898 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
900 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
901 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
902 (_gpgme_op_sign_init_result): Factor code out to ...
903 (sign_init_result): .. new. Init new fields.
904 (sign_start): Use sign_init_result.
905 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
906 Return an error if no signature has been created.
908 2009-07-07 Werner Koch <wk@g10code.com>
910 * engine-gpgsm.c (struct engine_gpgsm): Add fields
911 input_helper_data and input_helper_memory.
912 (close_notify_handler): Release these new fields.
913 (gpgsm_import): Implement the keyarray feature.
915 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
917 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
920 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
922 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
923 [HAVE_STDINT_H]: Include <stdint.h>.
924 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
925 to (uintptr_t) before casting it to (void*) to silence GCC
928 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
929 * sign.c (_GPGME_IN_GPGME): Define it.
930 * keylist.c (_GPGME_IN_GPGME): Define it.
932 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
933 vasprintf and asprintf.
935 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
937 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
939 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
940 back! (GPA still uses it...).
942 * gpgme.def: Fix stupid typo.
943 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
945 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
947 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
949 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
950 (_gpgme_io_dup): Never allocate threads here.
951 (find_writer, find_reader): Check return value of thread creation
954 * context.h (CTX_OP_DATA_MAGIC): New macro.
955 (struct ctx_op_data): New member MAGIC.
956 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
957 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
959 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
961 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
963 * gpgme.c (result_ref_lock): New global variable.
964 (gpgme_result_ref, gpgme_result_unref): use it.
966 2009-06-16 Werner Koch <wk@g10code.com>
968 * version.c: Include stdlib.h.
970 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
971 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
972 * data.c (gpgme_data_set_encoding): Adjust for new values.
973 * engine-gpg.c (string_from_data): New.
974 (gpg_import): Implement --fetch-key feature.
976 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
977 * gpgme.def, libgpgme.vers: Add them.
978 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
979 (export_keys_start): New.
981 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
982 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
983 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
985 * export.c (gpgme_export_ext_start, gpgme_op_export)
986 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
987 (export_start): Ditto.
988 * engine.c (_gpgme_engine_op_export): Ditto.
989 * engine-backend.h (struct engine_ops): Ditto.
990 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
991 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
993 (gpg_export, gpg_export_ext): Factor common code out to ..
994 (export_common): .. this.
996 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
997 * gpgme.def, libgpgme.vers: Add them.
998 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
999 (_gpgme_op_import_keys_start): New.
1000 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
1001 * engine-backend.h (struct engine_ops): Ditto.
1002 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
1003 * engine-gpg.c (gpg_import): Ditto. Implement it.
1005 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
1007 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
1009 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
1011 * context.h (struct ctx_op_data): Add member "references".
1012 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
1013 (_gpgme_release_result): Use gpgme_result_unref.
1014 * op-support.c (_gpgme_op_data_lookup): Initialize references.
1016 2009-06-12 Werner Koch <wk@g10code.com>
1018 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
1019 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
1020 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
1021 (main): Pass flags for my_spawn.
1022 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
1024 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
1025 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
1026 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1027 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1028 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
1029 * engine-gpg.c (start): Call spawn with new flag.
1031 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
1032 _gpgme_allow_set_foreground_window. Change all callers.
1033 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
1035 2009-06-10 Werner Koch <wk@g10code.com>
1037 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
1039 2009-06-09 Werner Koch <wk@g10code.com>
1041 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
1043 * version.c (gpgme_check_version_internal): Make result const.
1045 * gpgme.c: Include priv-io.h.
1046 (gpgme_io_read, gpgme_io_write): New.
1047 * libgpgme.vers (GPGME_1.1): Add them.
1050 * Makefile.am (main_sources): Remove gpgme.h.
1051 (include_HEADERS): Rename to nodist_include_HEADERS so that a
1052 VPATH build won't use the distributed one.
1054 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
1056 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
1058 * gpgme.h.in (gpgme_check_version_internal): New prototype.
1059 (gpgme_check_version): New macro, overriding function of the same
1061 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
1062 * context.h (_gpgme_selftest): New variable declaration.
1063 * version.c: Include "context.h".
1064 (gpgme_check_version): Set _gpgme_selftest on success.
1065 (gpgme_check_version_internal): New function.
1066 * gpgme.c (_gpgme_selftest): Define it.
1067 (gpgme_new): Check the selftest result.
1069 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
1071 * gpgme.h.in (gpgme_encrypt_flags_t): Add
1072 GPGME_ENCRYPT_NO_ENCRYPT_TO.
1073 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
1074 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
1076 2009-05-14 Werner Koch <wk@g10code.com>
1078 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
1079 better maintainability and to help debugging.
1081 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
1083 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
1085 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
1087 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
1088 * w32-io.c (_gpgme_io_connect): Fix stupid error.
1090 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
1092 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
1093 (find_channel): Drop CREATE argument.
1094 (new_dummy_channel_from_fd, new_channel_from_fd)
1095 (new_channel_from_socket): New functions.
1096 (_gpgm_io_fd2str): Implement for sockets.
1097 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
1099 (_gpgme_io_pipe): Fix for new channel bookkeeping.
1100 (_gpgme_io_close, _gpgme_io_dup): Likewise.
1101 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
1102 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
1103 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
1104 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
1105 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
1106 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
1107 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
1109 2009-03-18 Werner Koch <wk@g10code.com>
1111 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
1112 * engine-gpgsm.c (gpgsm_keylist): Send new option.
1114 2009-03-13 Werner Koch <wk@g10code.com>
1116 * gpgme-config.in: Make sure locale is set to C.
1118 2009-02-24 Werner Koch <wk@g10code.com>
1120 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
1121 (gpgme_assuan_result_t): New.
1122 (gpgme_op_assuan_result): Change return type.
1123 (struct _gpgme_assuan_sendfnc_ctx)
1124 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
1125 (gpgme_assuan_inquire_cb_t): Changed.
1126 * opassuan.c (op_data_t): Make use of a result structure.
1127 (gpgme_op_assuan_result): Change return type.
1128 (opassuan_start): Use result structure.
1130 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
1131 (inquire_cb_sendfnc): Remove.
1132 (inquire_cb): Change for new callback scheme. Not yet finished.
1133 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
1135 2009-02-04 Werner Koch <wk@g10code.com>
1137 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
1139 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1141 2009-02-03 Werner Koch <wk@g10code.com>
1143 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
1145 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
1146 * keylist.c (keylist_colon_handler): Factor common code out to ...
1147 (parse_sec_field15): New. Set card number.
1149 2009-01-26 Werner Koch <wk@g10code.com>
1151 * opassuan.c, dirinfo.c, engine-assuan.c: New.
1152 * Makefile.am: Add them.
1153 * engine-backend.h: Add _gpgme_engine_ops_assuan.
1154 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
1156 * Makefile.am (gpgsm_components): Add engine-assuan.c.
1157 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
1158 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
1159 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
1160 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
1161 * gpgme.c (gpgme_get_protocol_name): Ditto.
1162 (gpgme_set_protocol): Support it.
1163 * engine.c (gpgme_get_engine_info): Ditto.
1164 (engine_ops): Register it.
1165 (_gpgme_engine_op_assuan_transact): New.
1166 * libgpgme.vers (gpgme_op_assuan_transact_start)
1167 (gpgme_op_assuan_transact): New.
1168 * gpgme.def (gpgme_op_assuan_transact_start)
1169 (gpgme_op_assuan_transact): New.
1170 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
1171 initialize to NULL for all engines.
1172 * engine.c (engine_get_home_dir): New.
1173 (gpgme_get_engine_info): Use it.
1174 (_gpgme_set_engine_info): Use it.
1175 * engine.h (engine_assuan_result_cb_t): New.
1176 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
1178 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
1180 * version.c (gpgme_check_version): Protect trace arg against NULL.
1182 2009-01-19 Werner Koch <wk@g10code.com>
1184 * rungpg.c: Rename to engine-gpg.c
1185 * Makefile.am (main_sources): Ditto.
1187 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
1189 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
1191 2008-11-18 Werner Koch <wk@g10code.com>
1193 * version.c (do_subsystem_inits): Always initialize I/O
1194 subsystem. Fixes regression from 2007-08-02.
1196 * decrypt.c (_gpgme_decrypt_status_handler): Use
1197 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
1199 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
1201 * wait-private.c (_gpgme_wait_on_condition): Remove unused
1203 * wait-global.c: Include ops.h to silence gcc warning.
1204 (_gpgme_wait_global_event_cb): Pass error value directly.
1205 * wait-user.c: Include ops.h to silence gcc warning.
1207 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
1208 silence gcc warning. Cast argument to execv to silence warning.
1209 * w32-io.c (_gpgme_io_spawn): Likewise.
1210 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
1212 2008-10-24 Werner Koch <wk@g10code.com>
1214 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
1216 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
1218 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
1219 string to C coded string.
1221 2008-10-20 Werner Koch <wk@g10code.com>
1223 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
1225 * gpgme.h: Rename to gpgme.h.in.
1226 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
1228 * posix-io.c: Include sys/uio.h. Fixes bug #818.
1230 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
1232 * w32-util.c (find_program_in_registry): Don't define.
1233 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
1234 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
1235 registry anymore. It is now no longer possible to overwrite the
1236 default location in that way.
1238 2008-10-17 Werner Koch <wk@g10code.com>
1240 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
1241 around a bug in mingw32.
1243 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
1245 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
1246 Submitted by "Daniel Mueller" <daniel@danm.de>
1248 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
1250 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
1252 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
1254 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
1255 * gpgme.c (_gpgme_cancel_with_err): New function.
1256 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
1257 * wait-private.c (_gpgme_wait_on_condition): Use
1258 _gpgme_cancel_with_err.
1259 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1260 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
1262 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
1264 * rungpg.c (command_handler): Remove I/O callback on error, too.
1266 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
1268 * gpgme.c (gpgme_cancel_async): Remove unused variable.
1270 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
1272 * libgpgme.vers: Add gpgme_cancel_async.
1273 * gpgme.def: Likewise.
1275 * context.h: Include "sema.h".
1276 (struct gpgme_context): New members lock and canceled.
1277 * gpgme.c (gpgme_new): Initialize lock.
1278 (gpgme_release): Destroy lock.
1279 (gpgme_cancel_async): New function.
1280 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
1281 * wait-global.c (gpgme_wait): Check cancel flag before processing
1283 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1284 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1286 2008-06-26 Werner Koch <wk@g10code.com>
1288 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
1289 (mkstemp): Need to use GetSystemTimeAsFileTime for better
1292 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
1294 * gpgme-w32spawn.c: New file.
1295 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
1296 with gpgme-w32spawn.
1297 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
1298 (gpgsm_set_locale): Return early if locale value is NULL.
1299 * util.h (_gpgme_mkstemp)
1300 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
1302 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
1303 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
1305 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
1306 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
1307 special filename FD rather than stdin.
1308 (struct arg_and_data_s): Add member ARG_LOCP.
1309 (struct fd_data_map_s): Add member ARG_LOC.
1310 (struct engine_gpg): Add member ARG_LOC to status and colon.
1311 (_add_arg, add_arg_with_locp): New function.
1312 (add_arg_ext): Reimplement in terms of _add_arg.
1313 (gpg_new): Remember argument location for status FD.
1314 (build_argv): Set argument location if requested. Also set
1315 argument location of fd_data_map for data items.
1316 (start): Adjust caller of _gpgme_io_spawn.
1317 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
1319 (_gpgme_io_spawn): Remove parent fd list argument.
1320 * posix-io.c (get_max_fds): New function.
1321 (_gpgme_io_dup): Add tracing.
1322 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
1323 fd list to contain all child fds that should be inherited. Close
1324 all other file descriptors after fork.
1325 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
1326 parent fd list. Change meaning of child fd list to contain all
1327 child fds that should be inherited. Do not inherit any file
1328 descriptors, but DuplicateHandle them. Spawn process through
1329 wrapper process. Provide wrapper process with a temporary file
1330 containing handle translation data. Return translated handle
1332 * w32-io.c (reader): Add more tracing output.
1333 (_gpgme_io_read): Likewise.
1334 * engine-gpgconf.c (gpgconf_read): Adjust caller of
1336 * version.c (_gpgme_get_program_version): Likewise.
1338 2008-06-20 Werner Koch <wk@g10code.com>
1340 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
1341 compatibility with old compilers. Fix amount of memmove. Fix
1344 2008-06-19 Werner Koch <wk@g10code.com>
1346 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
1347 change all callers and provide compatibilty macro.
1348 (gpgme_conf_type_t): Add complex types 34..37.
1349 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
1350 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
1352 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
1354 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
1356 2008-05-09 Werner Koch <wk@g10code.com>
1358 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
1361 2008-05-07 Werner Koch <wk@g10code.com>
1363 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
1364 self-explaining string. Needs a proper fix, though.
1366 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
1368 (gpg_build_keylist_options): .. new. Allow combination of extern
1370 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
1372 2008-05-06 Werner Koch <wk@g10code.com>
1374 * version.c (extract_version_string): New.
1375 (_gpgme_get_program_version): Use it to allow for suffixes in the
1378 2008-04-28 Werner Koch <wk@g10code.com>
1380 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
1383 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
1385 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
1386 Osterfeld, implement blocking select.
1388 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
1390 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
1392 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
1394 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
1395 Reported by Marc Mutz.
1397 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
1399 * decrypt.c (release_op_data): Release OPD->result.recipients.
1400 * encrypt.c (release_op_data): Release invalid_recipient.
1402 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
1404 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
1406 2008-02-14 Werner Koch <wk@g10code.com>
1408 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
1409 * posix-io.c (_gpgme_io_spawn): Ditto.
1410 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1411 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1412 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
1413 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
1415 * w32-util.c (_gpgme_allow_set_foregound_window): New.
1416 * posix-util.c (_gpgme_allow_set_foregound_window): New.
1417 * engine-gpgsm.c (default_inq_cb): New.
1418 (gpgsm_new) [W32]: Enable pinentry notifications.
1419 (status_handler): Handle inquiries.
1421 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
1423 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
1426 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
1428 * engine-gpgsm.c (map_input_enc): Rename to ...
1429 (map_data_enc): ... this. Also change all callers.
1430 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
1431 (gpgsm_sign): Set encoding for output.
1433 2008-01-28 Werner Koch <wk@g10code.com>
1435 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
1437 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
1439 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
1442 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
1444 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1446 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
1449 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
1451 * Makefile.am (gpgconf_components): New variable.
1452 (main_sources): Add gpgconf.c.
1453 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
1454 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
1455 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
1456 (gpgme_conf_arg_release, gpgme_conf_opt_change)
1457 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
1459 * gpgconf.c, engine-gpgconf.c: New files.
1460 * engine.h: (_gpgme_engine_op_conf_load,
1461 (_gpgme_engine_op_conf_save): New prototypes.
1462 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
1464 * posix-util.c (_gpgme_get_gpgconf_path): New function.
1465 * w32-util.c (_gpgme_get_gpgconf_path): New function.
1467 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
1469 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
1470 * gpgme.def: Add new gpgconf related interfaces.
1471 * libgpgme.vers: Likewise.
1472 * util.h (_gpgme_get_gpgconf_path): New prototype.
1473 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
1474 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
1475 (struct engine_ops): Add members for conf_load and conf_save.
1476 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
1477 (_gpgme_engine_op_conf_load,
1478 (_gpgme_engine_op_conf_save): New functions.
1479 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
1481 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
1483 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
1484 for installation directory. Remove old fallback default.
1485 (find_program_in_inst_dir): New function.
1487 2007-11-26 Werner Koch <wk@g10code.com>
1489 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
1490 always reset it before calling start.
1491 (gpgsm_new): Clear it.
1492 (status_handler): Implement it.
1493 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
1495 2007-11-23 Werner Koch <wk@g10code.com>
1497 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
1498 * getauditlog.c (getauditlog_start): Use that flag.
1500 2007-11-20 Werner Koch <wk@g10code.com>
1502 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
1504 2007-11-22 Werner Koch <wk@g10code.com>
1506 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
1507 * libgpgme.vers: Ditto.
1509 * getauditlog.c: New.
1510 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
1511 * engine-gpgsm.c (gpgsm_getauditlog): New.
1512 (_gpgme_engine_ops_gpgsm): Insert new function.
1513 (gpgsm_new): Try to enable audit log support.
1514 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
1516 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
1518 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1520 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
1522 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1524 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
1526 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
1529 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
1531 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
1534 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
1536 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
1537 w32-qt-io.cpp: New versions from Frank Osterfeld.
1539 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
1541 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
1542 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
1543 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
1544 Submitted by Frank Osterfeld.
1546 * priv-io.h, engine-gpgsm.c: Add comments.
1547 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
1548 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
1549 even if not primary.
1550 (_gpgme_io_dup): Acquire a reference. Replace unused
1551 implementation by assertion.
1553 2007-09-28 Werner Koch <wk@g10code.com>
1555 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
1556 (gpgsm_new): Set it.
1557 (gpgsm_set_fd): Use it.
1559 * w32-glib-io.c (find_channel): Add a new primary flag.
1560 (_gpgme_io_close): Close channel only if primary.
1561 (_gpgme_io_dup): Put newfd into the table as shallow copy.
1563 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
1564 * w32-io.c (_gpgme_io_select): Ditto.
1565 * w32-glib-io.c (_gpgme_io_select): Ditto.
1567 * posix-io.c (_gpgme_io_select): Ditto.
1568 * rungpg.c (read_status): Ditto.
1569 * wait.c (fd_table_put): Ditto.
1571 * rungpg.c (gpg_io_event): Add tracing.
1572 (start): Use gpg_io_event for sending the start event.
1573 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
1574 (start): Use gpgsm_io_event for sending the start event.
1575 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
1577 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
1579 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
1580 versions from Frank Osterfeld.
1582 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
1584 * w32-glib-io.c (_gpgme_io_spawn),
1585 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
1586 the process handle, return 0.
1588 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
1589 * gpgme.c (gpgme_get_protocol_name): Implement support for
1590 GPGME_PROTOCOL_UNKNOWN.
1592 * kdpipeiodevice.h: Fix last change.
1594 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
1595 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
1598 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
1600 * conversion.c, keylist.c: Include <sys/types.h>.
1602 * kdpipeiodevice.h: Use namespace _gpgme_.
1603 * kdpipeiodevice.cpp: Use namespace _gpgme_.
1604 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
1605 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
1606 _gpgme_::KDPipeIODevice.
1608 2007-09-17 Werner Koch <wk@g10code.com>
1610 * rungpg.c (gpg_new): Make robust against undefined ttyname or
1613 2007-09-14 Werner Koch <wk@g10code.com>
1615 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
1617 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
1619 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
1621 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
1623 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
1626 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
1628 * Makefile.am (libgpgme_qt_la_SOURCES): Move
1629 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
1630 another file (it's more like a header file than a cpp file, but
1631 automake doesn't know that).
1633 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
1634 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
1635 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
1637 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
1638 kdpipeiodevice.moc, w32-qt-io.c: New files.
1639 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
1640 (ltlib_gpgme_qt): New variable.
1641 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
1642 (libgpgme_qt_la_SOURCES): New variable.
1643 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
1644 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
1645 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
1646 (libgpgme_qt_la_LIBADD): New variables.
1648 * sema.h (struct critsect_s): Rename "private" to "priv" to make
1649 C++ users happy. Change users.
1650 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
1651 (_gpgme_sema_cs_destroy): Likewise.
1652 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
1653 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
1654 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
1656 (gpgme_get_fdptr): New function.
1657 * w32-io.c (gpgme_get_fdptr): New function
1658 * gpgme.def: Add gpgme_get_fdptr.
1660 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
1662 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
1663 (writer): Remove superfluous check.
1665 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
1667 * gpgme.h: Move include of gpg-error.h out of extern "C".
1669 2007-08-07 Werner Koch <wk@g10code.com>
1671 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
1672 * verify.c (parse_trust): Set Chain_MODEL.
1674 2007-08-02 Werner Koch <wk@g10code.com>
1676 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1677 * w32-io.c (_gpgme_io_spawn): Ditto.
1678 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1679 * debug.c (_gpgme_debug): Enable assuan logging.
1680 (_gpgme_debug_subsystem_init): New.
1681 * version.c (do_subsystem_inits): Disable assuan logging and
1682 initialize the debug system.
1683 (gpgme_check_version): Do not trace before the subsystems are
1686 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
1688 * debug.c: Include <errno.h> and "debug.h".
1689 (_gpgme_debug): Save and restore ERRNO.
1691 (_gpgme_debug_buffer): New function.
1692 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1693 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1694 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
1695 most of these files, add many more tracepoints.
1697 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
1699 * engine-gpgsm.c (status_handler): Do not send BYE here.
1701 * w32-io.c (struct reader_context_s, struct writer_context_s): New
1703 (create_reader, create_writer): Initialize C->refcount to 1.
1704 (destroy_reader, destroy_writer): Only destroy if C->refcount
1706 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1707 * priv-io.h (_gpgme_io_dup): New prototype.
1708 * posix-io.c (_gpgme_io_dup): New function.
1709 * w32-io.c (_gpgme_io_dup): Likewise.
1710 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1711 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1713 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
1715 * data-user.c (user_read, user_write, user_seek): Set errno and
1716 return -1 instead returning the error code directly.
1717 * data-compat.c (old_user_seek): Likewise.
1718 * gpgme.c (gpgme_sig_notation_add): Return error properly.
1720 * Revert the "close_notify_handler" returns int stuff. Always
1721 close in the _gpgme_io_close implementations.
1722 * engine-gpgsm.c (status_handler): Try to terminate the connection
1724 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1725 (_gpgme_io_write): Likewise.
1727 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1728 to _gpgme_close_notify_handler.
1729 (_gpgme_close_notify_handler): New type.
1730 (_gpgme_io_dup): Remove prototype.
1731 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1732 type of HANDLER to _gpgme_close_notify_handler_t.
1733 (_gpgme_io_close): Do not close the FD if handler returns 0.
1734 (_gpgme_io_dup): Remove function.
1735 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1736 _gpgme_io_close): Change type of HANDLER to
1737 _gpgme_close_notify_handler_t.
1738 (_gpgme_io_close): Do not close the FD if handler returns 0.
1739 (_gpgme_io_dup): Remove function.
1740 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1741 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1742 to _gpgme_close_notify_handler_t.
1743 (_gpgme_io_close): Do not close the FD if handler returns 0.
1744 * rungpg.c (close_notify_handler): Change return type to int,
1746 * engine-gpgsm.c (close_notify_handler): Change return type to
1747 int, return 0 for status FD and 1 for all other FDs.
1748 (start): Do not duplicate the status FD.
1750 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1752 * Makefile.am: Replace implicite rule by suffix rule. Add
1755 2007-07-12 Werner Koch <wk@g10code.com>
1757 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1758 system has been started.
1760 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1762 * priv-io.h (_gpgme_io_dup): New prototype.
1763 * posix-io.c (_gpgme_io_dup): New function.
1764 * w32-io.c (_gpgme_io_dup): Likewise.
1765 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1766 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1768 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1770 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1771 * funopen.c (funopen): Rename to _gpgme_funopen.
1773 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1775 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1776 * rungpg.c (gpg_new): Likewise.
1777 Submitted by Stephen Tether.
1779 2007-02-26 Werner Koch <wk@g10code.com>
1781 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1782 (_gpgme_verify_status_handler): Return an error if more than one
1783 plaintext has been seen.
1784 (parse_error): New arg SET_STATUS. Also detect it based on an
1785 ERROR status (gpg > 1.4.6).
1787 2007-01-26 Werner Koch <wk@g10code.com>
1789 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1790 * w32-glib-io.c (build_commandline): Ditto.
1792 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1794 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1796 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1798 * data.h (_gpgme_data_get_fd): Add prototype.
1799 (gpgme_data_get_fd_cb): New type.
1800 (struct _gpgme_data_cbs): New member get_fd.
1801 * data.c (_gpgme_data_get_fd): New function.
1802 * data-fd.c (fd_get_fd): New function.
1803 (fd_cbs): Add fd_get_fd.
1804 * data-stream.c (stream_get_fd): New function.
1805 (stream_cbs): Add stream_get_fd.
1806 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1807 * data-user.c (user_cbs): Likewise.
1808 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1809 short-cut by passing the data descriptor directly.
1811 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1813 * w32-io.c (build_commandline): Quote all command line arguments.
1814 * w32-glib-io.c (build_commandline): Likewise.
1816 2007-01-10 Werner Koch <wk@g10code.com>
1818 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1820 2007-01-08 Werner Koch <wk@g10code.com>
1822 * version.c (do_subsystem_inits): Do assuan init only if building
1824 * setenv.c: Include assuan-def.h only if building with Assuan
1827 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1829 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1830 * rungpg.c (gpg_set_locale): Ditto.
1832 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1834 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1835 switching protocols.
1836 (gpgme_ctx_set_engine_info): Likewise for engine info.
1837 * engine.h (_gpgme_engine_reset): New function prototype.
1838 * engine.c (_gpgme_engine_reset): New function.
1839 * engine-backend.h (struct engine_ops): New member RESET.
1840 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1841 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1842 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1843 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1845 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1846 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1847 function if available.
1848 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1850 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1852 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1853 lc_messages from prototype.
1854 (_gpgme_engine_set_locale): New prototype.
1855 * engine.c (_gpgme_engine_set_locale): New function.
1856 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1857 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1858 Remove arguments lc_messages and lc_ctype from member NEW.
1859 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1860 and lc_messages_set.
1861 (gpgsm_new): Remove lc_messages and lc_ctype
1863 (gpgsm_set_locale): New function.
1864 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1865 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1867 (gpg_release): Release lc_messages and lc_ctype if set.
1868 (gpg_new): Remove lc_messages and lc_ctype arguments.
1869 (gpg_set_locale): New function.
1870 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1871 (add_arg): Implement in terms of:
1872 (add_arg_ext): New function.
1873 (start): Set lc-messages and lc-ctype arguments here.
1875 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1877 * engine-gpgsm.c (struct engine_gpgsm): Move members
1878 input_fd_server, output_fd_server, message_fd_server to ...
1879 (iocb_data): ... here (as server_fd).
1880 (close_notify_handler): Reset tags as well.
1881 (gpgsm_new): Implement support for descriptor
1883 (fd_type_t): New type.
1884 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1885 for unused communication channels.
1886 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1887 relevant callers adjusted as well (previously of _gpgme_io_close).
1889 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1891 * version.c: Include "assuan.h".
1892 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1894 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1896 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1897 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1898 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1900 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1901 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1902 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1903 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1905 (noinst_LTLIBRARIES): Removed.
1906 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1907 (AM_CFLAGS): New variable.
1909 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1911 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1912 ASSUAN_CONTEXT with assuan_context_t.
1914 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1916 * engine-gpgsm.c (gpgsm_new): Check return value of
1917 assuan_pipe_connect.
1919 * rungpg.c: Include <unistd.h>.
1920 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1921 --lc-messages. Fixes issue 734.
1923 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1925 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1928 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1930 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1931 _gpgme_engine_io_event().
1933 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1935 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1937 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1940 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1942 * keylist.c (keylist_colon_handler): Move debug output after
1945 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1947 * gpgme-config.in (Options): Add NETLIBS.
1948 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1949 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1951 * rungpg.c (read_status): Fix comparison disguising as an
1954 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1956 * gpgme.c (gpgme_set_locale): Remove conditional on
1957 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1959 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1961 * rungpg.c (read_status): Strip potential carriage return.
1962 * genkey.c (get_key_parameter): Skip potential carriage return.
1963 * version.c (_gpgme_get_program_version): Strip potential carriage
1966 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1969 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1971 * keylist.c (gpgme_get_key): Also clone the engine info.
1973 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1975 * gpgme-config.in (cflags_pth): Revert accidential removal of
1976 pthread support with last change.
1978 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1980 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1981 (_gpgme_io_pipe): Open pipes in binary mode.
1983 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1985 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1986 checking the version correctly even after changing the engine
1987 information. Bug reported by Stéphane Corthésy.
1989 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1991 (colon_preprocessor_t): New type.
1992 (struct engine_gpg): New member colon.preprocess_fnc.
1993 (gpg_keylist_preprocess): New function.
1994 * keylist.c (keylist_colon_handler): Allow short key IDs.
1996 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1998 * w32-io.c (create_writer): Make C->have_data a manually resetted
2000 (writer): Move code from end of if block to beginning, so it
2001 is also run the first time.
2002 (_gpgme_io_write): Move assert check after error check. Reset
2003 the is_empty event, and also do it eagerly.
2004 (_gpgme_io_select): Unconditionally wait for the is_empty event.
2006 2006-01-26 Werner Koch <wk@g10code.com>
2008 * w32-util.c (_gpgme_get_conf_int): New.
2009 * posix-util.c (_gpgme_get_conf_int): New.
2010 * w32-io.c (get_desired_thread_priority): New.
2011 (create_reader, create_writer): Use it here.
2013 2006-01-04 Werner Koch <wk@g10code.com>
2015 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
2017 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
2018 statements. Disable error return for failed nonblocking call.
2020 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
2022 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
2025 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
2027 * w32-glib-io.c (find_channel): Set channel to unbuffered.
2028 (_gpgme_io_select): Fix debug output.
2030 2005-12-23 Werner Koch <wk@g10code.com>
2032 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
2033 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
2036 2005-12-20 Werner Koch <wk@g10code.com>
2038 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
2039 and GPGME_STATUS_PKA_TRUST_GOOD.
2040 (struct _gpgme_signature): New field pka_trust.
2041 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
2043 2005-12-06 Werner Koch <wk@g10code.com>
2045 * keylist.c (keylist_colon_handler): Store fingerprints of the
2046 subkeys. Reset the secret flag of subkeys for stub secret keys.
2047 (NR_FIELDS): Bumped up to 16
2049 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
2051 * engine.c (_gpgme_set_engine_info): Use new_file_name in
2052 engine_get_version invocation. Reported by Stéphane Corthésy.
2054 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
2056 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
2058 2005-11-18 Werner Koch <wk@g10code.com>
2060 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
2062 (find_channel): Better use g_io_channel_win32_new_fd instead of
2063 the autodetection function g_io_channel_unix_new.
2064 (_gpgme_io_select): Rewritten. It is now a fully working select
2067 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
2069 * priv-io.h (_gpgme_io_fd2str): New prototype.
2070 * posix-io.c (_gpgme_io_fd2str): New function.
2071 * w32-io.c (_gpgme_io_fd2str): New function.
2072 * rungpg.c: Use this new function.
2073 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
2074 again. Two's company, three's the musketeers.
2076 * w32-glib-io.c: Rewrote the file handle code. We don't create
2077 system fds for every handle (doesn't work for inherited handles),
2078 but we create pseudo fds in a private namespace that designate a
2079 handle and potentially a giochannel.
2081 2005-11-18 Werner Koch <wk@g10code.com>
2083 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
2085 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
2087 * w32-glib-io.c: New file.
2088 * gpgme.def (gpgme_get_giochannel): Add symbol.
2089 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
2091 (ltlib_gpgme_extra): New variable.
2092 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
2093 (system_components_not_extra): New variable.
2094 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
2095 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
2096 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
2097 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
2098 [BUILD_W32_GLIB]: New variables.
2099 * gpgme-config.in (glib): New option.
2100 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
2102 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
2104 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
2105 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
2106 * posix-io.c (_gpgme_io_kill): Removed.
2107 (_gpgme_io_waitpid): Declare static.
2109 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
2111 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
2113 2005-10-21 Werner Koch <wk@g10code.com>
2115 * Makefile.am: Fixed cut+paste problem
2117 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
2119 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
2122 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
2124 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
2127 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
2129 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
2132 * gpgme.h (gpgme_free): New prototype.
2133 * data-mem.c (gpgme_free): New function.
2134 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
2135 * gpgme.def: Add gpgme_free.
2137 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
2139 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
2141 * verify.c (parse_notation): Likewise for invocation.
2142 * conversion.c (_gpgme_decode_percent_string): Likewise to
2143 declaration. If set, do not replace '\0' characters with a
2145 * gpgme.h (struct _gpgme_key_sig): New field notations.
2146 * ops.h (_gpgme_parse_notation): New prototype.
2147 * sig-notation.c (_gpgme_parse_notation): New function.
2148 * key.c (gpgme_key_unref): Free all signature notations.
2149 * keylist.c (op_data_t): New member tmp_keysig.
2150 (finish_key): Clear OPD->tmp_keysig.
2151 * gpgme.c (gpgme_set_keylist_mode): Remove check.
2152 * rungpg.c (gpg_keylist): Support listing signature notations.
2153 (gpg_keylist_ext): Likewise.
2155 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
2157 * engine.h (_gpgme_set_engine_info): Add prototype.
2158 * engine-backend.h (struct engine_ops): Change return type of
2159 get_file_name() to const char * to silence gcc warning.
2160 * engine.c (engine_get_file_name): Change return type to const
2161 char * to silence gcc warning.
2162 (gpgme_get_engine_info): Use transitional variable to go from
2163 const char * to char * to silence gcc warning.
2164 (_gpgme_set_engine_info): Likewise.
2165 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
2166 char * to silence gcc warning.
2167 (gpgsm_new): Make ARGV a pointer to const char.
2168 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
2169 to char * to silence gcc warning.
2171 * gpgme.def: Add gpgme_data_set_file_name,
2172 gpgme_data_get_file_name, gpgme_sig_notation_clear,
2173 gpgme_sig_notation_add and gpgme_sig_notation_get.
2174 * libgpgme.vers: Add gpgme_sig_notation_clear,
2175 gpgme_sig_notation_add and gpgme_sig_notation_get.
2176 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
2177 * context.h (struct gpgme_context): New field sig_notations.
2178 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
2180 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
2181 (gpgme_sig_notation_flags_t): New type.
2182 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
2183 gpgme_sig_notation_get): New prototypes.
2184 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
2186 * sig-notation.c (_gpgme_sig_notation_free): New file.
2187 * verify.c (parse_notation): Use support functions.
2188 (release_op_data): Likewise.
2189 * rungpg.c (append_args_from_sig_notations): New function.
2190 (gpg_encrypt_sign, gpg_sign): Call it.
2192 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
2194 * data.h (struct gpgme_data): New member file_name.
2195 * data.c (gpgme_data_set_filename): New function.
2196 (_gpgme_data_release): Free DH->filename if necessary.
2197 (gpgme_data_get_filename): New function.
2198 * rungpg.c (gpg_encrypt): Set filename option.
2199 (gpg_encrypt_sign): Likewise.
2200 (gpg_sign): Likewise.
2201 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
2202 gpgme_data_get_file_name.
2204 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
2207 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
2209 * gpgme.h (struct _gpgme_key): Add field is_qualified.
2210 (struct _gpgme_subkey): Likewise.
2211 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
2214 2005-09-23 Werner Koch <wk@g10code.com>
2216 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
2218 (create_reader, create_writer): Set thread priority higher.
2220 2005-09-19 Werner Koch <wk@g10code.com>
2222 * w32-io.c (_gpgme_io_pipe): New environment variable to change
2223 the size of the pipe buffer.
2225 2005-09-13 Werner Koch <wk@g10code.com>
2227 * ath.c: Changes to make it work under W32.
2229 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
2231 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
2232 (ath_pth_src, ath_pthread_src): Removed.
2233 (w32_o_files): Replace ath-compat.o with ath.o.
2234 (libgpgme_pth_la_CFLAGS): New variable.
2235 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
2236 * ath.h (ath_pthread_available, ath_pth_available): Removed.
2237 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
2238 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
2239 (_ATH_COMPAT): Macro removed.
2240 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
2243 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
2245 * keylist.c (release_op_data): Do not free opd->tmp_uid.
2247 2005-09-07 Werner Koch <wk@g10code.com>
2249 * w32-io.c (build_commandline): Quote argv[0].
2251 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
2253 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
2255 * edit.c (command_handler): Do not depend on PROCESSED being
2258 * engine.h (engine_command_handler_t): Add new argument processed.
2259 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
2261 (_gpgme_passphrase_command_handler): ... this one.
2262 * passphrase.c (_gpgme_passphrase_command_handler_internal):
2264 (_gpgme_passphrase_command_handler): ... this one.
2265 * edit.c (command_handler): Add new argument processed. Remove
2266 local variable with the same name. Always return processed as
2268 * rungpg.c (command_handler): Send a newline character if the
2271 2005-08-26 Werner Koch <wk@g10code.com>
2273 * w32-util.c (read_w32_registry_string): Updated from code used by
2274 GnuPG. This allows for expanding strings and features the
2275 implicit fallback key.
2276 (w32_shgetfolderpath, find_program_at_standard_place): New.
2277 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
2278 entry, locate the programs at the standard place.
2279 (dlopen, dlsym, dlclose): New, so that we can keep on using what
2280 we are accustomed to.
2282 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
2283 semicolon is used which allows us to create files with drive
2286 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
2289 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
2291 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
2292 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
2293 (struct _gpgme_op_verify_result): Likewise.
2294 * ops.h (_gpgme_parse_plaintext): Add prototype.
2295 * op-support.c (_gpgme_parse_plaintext): New function.
2296 * decrypt.c (release_op_data): Release
2297 OPD->result.plaintext_filename.
2298 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2299 * verify.c (release_op_data): Release
2300 OPD->result.plaintext_filename.
2301 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2303 2005-08-08 Werner Koch <wk@g10code.com>
2305 * util.h (stpcpy): Renamed to ..
2306 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
2307 definitions when linking statically.
2308 * stpcpy.c: Removed.
2310 2005-08-19 Werner Koch <wk@g10code.com>
2313 * versioninfo.rc.in: New.
2314 * Makefile.am: Addes support for building a W32 DLL.
2316 * ttyname_r.c (ttyname_r) [W32]: Return error.
2317 * ath-compat.c [W32]: select and co are not yet supported; return
2319 * data-stream.c (stream_seek): Use ftell if ftello is not available.
2321 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
2323 * keylist.c (gpgme_get_key): Allow key IDs.
2325 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
2327 * gpgme.m4: Only call GPGME_CONFIG if found.
2329 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
2331 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
2333 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
2334 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
2336 (_gpgme_decrypt_status_handler): Fix last change.
2338 * gpgme.h (struct _gpgme_recipient): New structure.
2339 (gpgme_recipient_t): New type.
2340 (struct _gpgme_op_decrypt_result): Add member recipients.
2341 * decrypt.c (op_data_t): New member last_recipient_p.
2342 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
2343 (parse_enc_to): New function.
2344 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
2347 * wait-global.c (gpgme_wait): Break out of the fd processing loop
2349 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2351 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
2353 * wait.h (_gpgme_run_io_cb): New prototype.
2354 * wait.c (_gpgme_run_io_cb): New function.
2355 * wait-global.c (gpgme_wait): Call it.
2356 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
2357 * wait-private.c (_gpgme_wait_on_condition): Likewise.
2359 2005-06-02 Werner Koch <wk@g10code.com>
2361 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
2362 GPGME_STATUS_NEED_PASSPHRASE_PIN.
2363 (_gpgme_passphrase_command_handler_internal): Also act on the key
2364 "passphrase.pin.ask".
2366 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
2367 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
2368 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
2369 GPGME_STATUS_BACKUP_KEY_CREATED.
2371 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
2373 * data-user.c: Include <errno.h>.
2375 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
2377 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
2380 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
2382 * w32-io.c (_gpgme_io_select): Fix loop increment.
2384 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
2386 * data-user.c (user_release): Only call user hook if provided.
2387 (user_seek): Return EBADF if no user hook is provided.
2388 (user_read): Likewise.
2389 (user_write): Likewise.
2391 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
2393 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
2394 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
2395 the reset, just for cleanliness, and do not sent it at all if the
2396 default is requested.
2397 * gpgme.c (gpgme_set_include_certs): Allow to use
2398 GPGME_INCLUDE_CERTS_DEFAULT.
2400 2005-04-21 Werner Koch <wk@g10code.com>
2402 * verify.c (calc_sig_summary): Set the key revoked bit.
2404 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
2406 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
2407 in the list, not the user-provided CTX.
2408 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2410 * wait-global.c (gpgme_wait): If no context is found, and we
2411 should not hang, set *status to 0 and return NULL.
2412 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2414 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
2416 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
2417 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2418 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
2419 ENOSYS instead EOPNOTSUPP.
2420 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2421 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
2424 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
2426 * io.h: Rename to ...
2427 * priv-io.h: ... this.
2428 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
2429 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
2430 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
2431 Change all includes of "io.h" to "priv-io.h"
2433 2005-03-09 Werner Koch <wk@g10code.com>
2435 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
2436 cast away type checks.
2438 * io.h [W32]: Do not include stdio.h. If it is needed do it at
2441 * data.h [W32]: Removed kludge for EOPNOTSUP.
2442 * data.c, data-compat.c [W32]: Explicitly test for it here.
2444 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
2447 2005-03-07 Timo Schulz <twoaday@g10code.de>
2449 * gpgme.h: [_WIN32] Removed ssize_t typedef.
2450 * ath.h: [_WIN32] Added some (dummy) types.
2451 * io.h: [_WIN32] include stdio.h.
2452 * data.h: [_WIN32] Define EOPNOTSUPP.
2453 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
2454 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
2456 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
2458 * engine.c (_gpgme_set_engine_info): Fix assertion.
2460 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
2462 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
2464 * ttyname_r.c: New file.
2466 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
2468 * putc_unlocked.c, funopen.c: I just claim copyright on these
2469 files and change their license to LGPL, because they are totally
2470 trivial wrapper functions.
2471 * isascii.c: Change copyright notice to the one from ctype/ctype.h
2472 in the GNU C Library (CVS Head 2004-10-10), where isascii is
2473 defined as a macro doing exactly the same as the function in this
2475 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
2476 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
2477 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
2478 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
2479 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
2480 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
2481 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
2482 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
2483 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
2484 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
2485 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
2486 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
2487 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
2488 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
2491 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
2493 * libgpgme.vers (GPGME_1.1): New version.
2494 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
2495 member get_version(). Add arguments FILE_NAME and HOME_DIR to
2496 member new(). Change return type of get_file_name and get_version
2498 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
2499 pointer. Do not cache result.
2500 (gpgsm_new): Add file_name and home_dir argument, and use them
2501 instead of the defaults, if set.
2502 * rungpg.c (struct engine_gpg): New member file_name.
2503 (gpg_get_version): Change return type to char pointer, and do not
2505 (gpg_release): Free gpg->file_name.
2506 (gpg_new): Take new arguments file_name and home_dir. Set the
2507 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
2508 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
2509 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
2511 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2513 * engine.c: Include <assert.h>.
2514 (gpgme_get_engine_info): Set *INFO within the lock. Move
2515 ENGINE_INFO and ENGINE_INFO_LOCK to ....
2516 (engine_info, engine_info_lock): ... here. New static variables.
2517 (engine_get_version): Add file_name argument to
2518 get_version invocation. Change return type to char pointer.
2519 (gpgme_engine_check_version): Rewritten to free() the return value
2520 of engine_get_version after using it.
2521 (_gpgme_engine_info_release): New function.
2522 (gpgme_get_engine_info): Rewritten.
2523 (_gpgme_engine_info_copy): New function.
2524 (_gpgme_set_engine_info): New function.
2525 (gpgme_set_engine_info): New function.
2526 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2528 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
2529 and version to char * (remove the const). New member home_dir.
2530 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
2531 gpgme_ctx_set_engine_info): New prototypes.
2532 * context.h (struct gpgme_context): New member engine_info.
2533 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
2534 (gpgme_release): Deallocate CTX->engine_info.
2535 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
2537 * op-support.c (_gpgme_op_reset): Look for correct engine info and
2538 pass it to _gpgme_engine_new.
2539 * version.c (gpgme_check_version): Adjust to
2540 _gpgme_compare_versions returning an int.
2541 (_gpgme_compare_versions): Return an int value, not a const char
2543 * ops.h (_gpgme_compare_versions): Same for prototype.
2545 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
2547 * verify.c (parse_trust): If no reason is provided, set
2548 SIG->validity_reason to 0.
2549 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
2551 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
2553 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
2554 (start): Call map_assuan_error on return value of
2557 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
2559 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
2562 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
2564 * gpgme.m4: Implement the --api-version check.
2566 * rungpg.c (read_status): Move the polling of the output data pipe
2567 to just before removing the command fd, from just before adding
2568 it. This avoids buffering problems.
2570 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
2571 read, to improve debug output.
2573 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
2575 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
2576 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
2577 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
2578 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
2580 (gpgme_keylist_mode_t): Define as unsigned int.
2581 (gpgme_key_t): Change type of keylist_mode to
2582 gpgme_keylist_mode_t.
2584 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
2586 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
2589 * data-stream.c (stream_seek): Call ftello and return the current
2591 * data.h (struct gpgme_data): Change type of data.mem.offset to
2593 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
2594 callback. If SEEK_CUR, adjust the offset by the pending buffer
2595 size. Clear pending buffer on success.
2598 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
2600 * gpgme.m4: Add copyright notice.
2602 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
2604 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
2607 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
2609 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
2611 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
2613 * key.c (_gpgme_key_append_name): Make sure tail points to the
2614 byte following the uid.
2615 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
2618 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
2620 * libgpgme.vers: Remove C-style comment, which is not supported by
2623 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2625 * gpgme-config.in (Options): Support --api-version.
2627 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
2629 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
2630 * verify.c (parse_error): Likewise.
2632 * verify.c (parse_error): Do not skip location of where token.
2634 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
2635 * verify.c (_gpgme_verify_status_handler): Add handling of
2636 GPGME_STATUS_REVKEYSIG.
2637 (parse_trust): Likewise.
2639 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2641 * gpgme.h (struct _gpgme_decrypt_result): New fields
2642 wrong_key_usage and _unused.
2643 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
2644 character after a matched string, as in a protocol error this
2645 could skip over the trailing binary zero.
2646 Handle decrypt.keyusage error notifications.
2648 * gpgme.h (struct _gpgme_key): New member keylist_mode.
2649 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
2651 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
2653 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
2654 to unsigned int. Same for member _unused.
2656 * keylist.c (set_mainkey_trust_info): Rewritten.
2657 (set_subkey_capability): Handle 'd' (disabled).
2658 (set_mainkey_capability): Rewritten.
2660 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
2662 * gpgme.m4: Quote first argument to AC_DEFUN.
2664 2004-04-21 Werner Koch <wk@gnupg.org>
2666 * key.c (gpgme_key_unref): Allow passing NULL like free does.
2667 The rule of least surprise.
2669 2004-04-15 Werner Koch <wk@gnupg.org>
2671 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
2672 unused result.signatures items.
2674 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
2676 2004-04-08 Werner Koch <wk@gnupg.org>
2678 * verify.c (_gpgme_verify_status_handler): Ignore the error status
2679 if we can't process it.
2680 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2681 yesterday's hack. It is not any longer required.
2683 2004-04-07 Werner Koch <wk@gnupg.org>
2685 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2686 with meaningless error codes from the verify status function.
2688 2004-04-05 Werner Koch <wk@gnupg.org>
2690 * gpgme.h: Add GPGME_STATUS_NEWSIG.
2692 * verify.c (parse_error): Compare only the last part of the where
2694 (prepare_new_sig): New.
2695 (parse_new_sig): Use prepare_new_sig when required.
2696 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2698 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2699 option. Fixed pattern construction.
2700 (status_handler): Add debugging output.
2702 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
2704 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2705 isatty(). Submitted by Bernhard Herzog.
2707 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
2709 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2712 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2714 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2715 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
2717 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
2719 * gpgme-config.in: Do not emit include and lib directory for
2720 prefix "/usr" or "".
2722 2004-03-03 Werner Koch <wk@gnupg.org>
2724 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2727 2004-02-18 Werner Koch <wk@gnupg.org>
2729 * gpgme-config.in: Ignore setting of --prefix.
2731 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
2733 * rungpg.c (gpg_cancel): New function.
2734 (gpg_release): Call it here.
2735 (_gpgme_engine_ops_gpg): Add it here.
2736 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2738 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2740 * gpgme.c (gpgme_cancel): New function.
2741 * engine-backend.h (struct engine_ops): New member cancel.
2742 * engine.h (_gpgme_engine_cancel): New prototype.
2743 * engine.c (_gpgme_engine_cancel): New function.
2744 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2745 (gpgsm_cancel): New function.
2746 (gpgsm_release): Use it.
2747 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2749 2004-02-17 Werner Koch <wk@gnupg.org>
2751 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2752 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2754 2004-02-15 Werner Koch <wk@gnupg.org>
2756 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2757 by Adriaan de Groot.
2759 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2761 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2763 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2765 * data-stream.c (stream_seek): Likewise.
2767 2004-01-16 Werner Koch <wk@gnupg.org>
2769 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2772 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2774 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2776 2004-01-12 Werner Koch <wk@gnupg.org>
2778 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2780 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2782 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2783 (struct _gpgme_key_sig): For C++ compilers, rename class
2784 member to _obsolete_class. Add new member sig_class.
2785 (struct _gpgme_new_signature): Same here.
2786 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2788 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2789 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2790 * sign.c (parse_sig_created): Set SIG->sig_class.
2792 2003-12-22 Werner Koch <wk@gnupg.org>
2794 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2797 2003-11-19 Werner Koch <wk@gnupg.org>
2799 * conversion.c (_gpgme_parse_timestamp): New.
2800 (atoi_1, atoi_2, atoi_4): New.
2801 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2803 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2804 * sign.c (parse_sig_created): Ditto.
2806 2003-10-31 Werner Koch <wk@gnupg.org>
2808 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2811 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2813 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2814 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2816 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2818 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2821 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2824 * io.h (_gpgme_io_subsystem_init): New prototype.
2825 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2826 (_gpgme_io_spawn): Do not fixup signal handler here.
2827 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2829 * debug.c (debug_init): Drop const qualifier from E.
2831 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2833 (ath_connect): Make ADDR argument const.
2834 * ath-pthread.c (ath_connect): Likewise.
2835 * ath-pth.c (ath_connect): Likewise.
2836 * ath-compat.c (ath_connect): Likewise.
2837 * ath.c (ath_connect): Likewise.
2839 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2840 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2842 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2844 * util.h (_gpgme_hextobyte): Likewise for prototype.
2846 * gpgme.h: Remove trailing comma in enum.
2848 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2849 <signal.h>, <fcntl.h>, or "unistd.h".
2851 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2853 * engine-backend.h (struct engine_ops): Add argument TYPE.
2854 * engine.c (_gpgme_engine_op_edit): Likewise.
2855 * engine.h: Likewise.
2856 * rungpg.c (gpg_edit): Likewise. Use it.
2857 * edit.c (edit_start): Likewise. Pass it on.
2858 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2859 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2861 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2863 * gpgme.h (gpg_strerror_r): Change prototype to match
2864 gpg_strerror_r change.
2865 * error.c (gpg_strerror_r): Likewise, also update implementation.
2867 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2868 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2869 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2871 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2873 * gpgme.h: Add prototype for gpgme_set_locale.
2875 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2876 characteristics and use that instead __inline__.
2878 * context.h (struct gpgme_context): New members lc_ctype and
2880 * gpgme.c: Include <locale.h>.
2881 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2883 (gpgme_set_locale): New function.
2884 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2886 * engine.h (_gpgme_engine_new): Likewise.
2887 * engine-gpgsm.c (gpgsm_new): Likewise.
2888 * rungpg.c (gpg_new): Likewise.
2889 * engine-backend.h (struct engine_ops): Likewise to NEW.
2890 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2893 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2895 * gpgme.h (gpgme_strerror_r): New prototype.
2896 * error.c (gpgme_strerror_r): New function.
2898 * get-env.c: New file.
2899 * util.h (_gpgme_getenv): Add prototype.
2900 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2901 * rungpg.c (build_argv): Use _gpgme_getenv.
2902 * debug.c (debug_init): Likewise.
2903 * engine-gpgsm.c (gpgsm_new): Likewise.
2904 (gpgsm_new): Use ttyname_r.
2905 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2907 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2909 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2912 * gpgme-config.in: Rewritten.
2913 * gpgme.m4: Rewritten.
2915 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2917 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2918 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2919 updated to have better thread support, and the Makefile.am was
2920 changed to reflect that.
2922 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2923 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2924 value of status_fnc.
2925 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2927 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2929 * rungpg.c (start): Use saved_errno instead errno.
2931 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2933 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2934 * fopencookie.c: File removed.
2936 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2938 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2940 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2942 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2943 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2944 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2945 backward compatibility.
2947 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2949 * verify.c (parse_new_sig): Fix status parsing case.
2951 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2953 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2954 Lower _UNUSED to 23 bits.
2955 (struct _gpgme_key): Likewise.
2956 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2957 (set_subkey_capability): Support 'a'.
2959 * keylist.c (gpgme_get_key): Check if there is more than one key
2960 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2962 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2964 (_gpgme_decode_percent_string): Likewise.
2965 * conversion.c (_gpgme_decode_c_string): Likewise.
2966 (_gpgme_decode_percent_string): Likewise.
2967 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2968 * signers.c (gpgme_signers_clear): Likewise.
2969 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2970 Use SEQNO instead SEQ.
2971 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2972 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2974 (gpgme_wait): Change type of I and IDX to unsigned int.
2975 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2976 and I to unsigned int.
2977 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2978 int to suppress gcc warning.
2979 (_gpgme_io_set_close_notify): Likewise.
2980 (_gpgme_io_select): Change type of I to unsigned int.
2981 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2983 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2986 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2988 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2989 and wrong expression.
2990 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2991 * encrypt.c (encrypt_sym_status_handler): Likewise.
2992 * sign.c (sign_status_handler): Likewise.
2993 * verify.c (verify_status_handler): Likewise.
2994 * decrypt.c (decrypt_status_handler): Likewise.
2996 * engine.c (gpgme_get_engine_info): Initialize NULL.
2998 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
3000 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
3001 GPG_ERROR_LIBS when setting the corresponding variables.
3002 Reported by Stéphane Corthésy.
3004 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
3006 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
3007 the beginning of the block.
3009 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
3011 * data-mem.c (mem_write): Copy original buffer content.
3013 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
3015 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
3018 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
3020 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
3021 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
3024 * op-support.c (_gpgme_parse_inv_userid): Rename to
3025 _gpgme_parse_inv_recp and change to new datatype.
3026 * ops.h (_gpgme_parse_inv_key): Fix prototype.
3027 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
3028 __gpgme_invalid_key. Rename field ID to KEY.
3029 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
3030 (struct _gpgme_op_encrypt_result): Here, too.
3031 (struct _gpgme_op_sign_result): Likewise.
3032 * encrypt.c (struct op_data): Likewise.
3033 (release_op_data): Likewise.
3034 * sign.c (struct op_data): Likewise.
3035 (release_op_data): Likewise.
3037 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
3038 (_gpgme_io_write): Likewise.
3039 (_gpgme_io_pipe): Likewise.
3040 (_gpgme_io_select): Likewise.
3042 * rungpg.c (struct engine_gpg): Remove arg_error.
3043 (add_arg): Don't set arg_error.
3044 (add_data): Likewise.
3045 (start): Don't check arg_error.
3046 (gpg_new): Check return value of add_arg.
3047 * verify.c (parse_notation): Free allocated memory at error.
3049 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
3051 Everywhere: Use libgpg-error error codes.
3053 * Makefile.am (EXTRA_DIST): Remove mkerrors.
3054 (BUILT_SOURCES): Remove errors.c.
3055 (MOSTLYCLEANFILES): Likewise.
3056 (libgpgme_la_SOURCES): Likewise. Add error.c.
3057 (errors.c): Remove target.
3058 * mkerrors: File removed.
3059 * error.c: New file.
3061 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
3062 (gpgme_err_code_t, gpgme_err_source_t): New types.
3063 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
3064 New static inline functions.
3065 (gpgme_strsource, gpgme_err_code_from_errno,
3066 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
3067 gpgme_error_from_errno): New prototypes.
3069 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
3071 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
3072 (gpgme_op_export): Likewise.
3073 (gpgme_op_export_ext_start): New prototype.
3074 (gpgme_op_export_ext): Likewise.
3075 * engine.h: Likewise for _gpgme_engine_op_export and
3076 _gpgme_engine_op_export_ext.
3077 * engine-backend.h (struct engine_ops): Change second argument of
3078 prototype of export to const char *, and add reserverd int as
3079 third argument. Add prototype for export_ext.
3080 * engine.c (_gpgme_engine_op_export_ext): New function.
3081 (_gpgme_engine_op_export): Change second argument of prototype of
3082 export to const char *, and add reserverd int as third argument.
3083 * rungpg.c (gpg_export): Change second argument of prototype of
3084 export to const char *, and add reserverd int as third argument.
3085 (gpg_export_ext): New function.
3086 (gpg_keylist_ext): Break loop at error.
3087 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
3088 * engine-gpgsm.c (gpgsm_export): Change second argument of
3089 prototype of export to const char *, and add reserverd int as
3091 (gpgsm_export_ext): New function.
3092 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
3093 * export.c (export_start): Change second argument of prototype of
3094 export to const char *, and add reserverd int as third argument.
3095 (gpgme_op_export_start): Likewise.
3096 (export_ext_start): New function.
3097 (gpgme_op_export_ext_start): Likewise.
3098 (gpgme_op_export_ext): Likewise.
3100 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
3101 (gpgme_sigsum_t): New type for anonymous enum.
3103 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
3104 and return an error if RECP is not set.
3106 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
3107 * user-id.c: Remove file.
3108 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
3109 * gpgme.h (gpgme_encrypt_flags_t): New type.
3110 (gpgme_op_encrypt_start): Change second parameter to type
3111 gpgme_key_t[], and add third parameter.
3112 (gpgme_op_encrypt): Likewise.
3113 (gpgme_op_encrypt_sign_start): Likewise.
3114 (gpgme_op_encrypt_sign): Likewise.
3115 * encrypt.c (encrypt_start): Likewise.
3116 (gpgme_op_encrypt_start): Likewise.
3117 (gpgme_op_encrypt): Likewise. Pass flags to engine.
3118 * encrypt-sign.c (encrypt_sign_start): Likewise.
3119 (gpgme_op_encrypt_sign_start): Likewise.
3120 (gpgme_op_encrypt_sign): Likewise.
3121 * engine-backend.h (struct engine_ops): Likewise for prototypes of
3122 encrypt and encrypt_sign.
3123 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
3124 and _gpgme_engine_op_encrypt_sign.
3125 * engine.c (_gpgme_engine_op_encrypt): Likewise.
3126 (_gpgme_engine_op_encrypt_sign): Likewise.
3127 * rungpg.c (gpg_encrypt): Likewise.
3128 (gpg_encrypt_sign): Likewise.
3129 * rungpg.c (gpg_encrypt): Check flags for always trust option.
3130 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
3131 (set_recipients): Rewritten to use keys instead user IDs.
3132 * rungpg.c (append_args_from_recipients): Rewritten to use keys
3134 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
3135 returned to GPGME_Invalid_Key and GPGME_General_Error.
3137 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
3139 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
3140 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
3141 * rungpg.c: Rename GpgObject to engine_gpg_t.
3142 (struct gpg_object_s): Rename to struct engine_gpg.
3144 * context.h (struct gpgme_context): Change EngineObject to
3146 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
3147 (ctx_op_data_t): New type.
3148 (struct gpgme_context): Use it.
3149 * ops.h (_gpgme_op_data_lookup): Use new type name.
3150 * op-support.c (_gpgme_op_data_lookup): Likewise.
3151 * engine.c: Rename EngineObject to engine_t in the file. Also
3152 EngineStatusHandler to engine_status_handler_t,
3153 EngineCommandHandler to engine_command_handler_t and
3154 EngineColonLineHandler to engine_colon_line_handler.
3155 * rungpg.c (start): Likewise.
3156 * engine-gpgsm.c: Likewise.
3157 * engine-backend.h (struct engine_ops): Likewise
3158 * engine.h (struct engine_object_s): Rename to struct engine.
3159 (EngineObject): Rename to engine_t. Also everywhere else in the
3161 (EngineStatusHandler): Rename to engine_status_handler_t.
3162 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
3163 (EngineCommandHandler): Rename to engine_command_handler_t.
3165 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
3167 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
3169 * gpgme.h (gpgme_recipients_t): Removed.
3170 (gpgme_recipients_new, gpgme_recipients_release,
3171 gpgme_recipients_add_name,
3172 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
3173 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
3174 gpgme_recipients_enum_close): Removed.
3175 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
3176 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
3177 gpgme_op_export): Change second argument to gpgme_user_id_t.
3178 (gpgme_user_ids_release): New prototype.
3179 (gpgme_user_ids_append): Likewise.
3180 * ops.h (_gpgme_recipients_all_valid): Remove.
3181 (_gpgme_user_ids_all_valid): Add.
3182 * context.h (struct gpgme_recipients): Removed.
3183 * user-id.c: New file.
3184 * recipient.c: Removed file.
3185 * rungpg.c (append_args_from_recipients): Change last arg to
3186 gpgme_user_id_t. Reimplement.
3187 (gpg_encrypt): Change second arg to gpgme_user_id_t.
3188 (gpg_encrypt_sign): Likewise.
3189 (gpg_export): Likewise. Rewrite user ID list code.
3190 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
3192 (_gpgme_engine_op_encrypt_sign): Likewise.
3193 (_gpgme_engine_op_export): Likewise.
3194 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3195 _gpgme_engine_op_export): Likewise.
3196 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
3197 (gpgsm_encrypt): Likewise.
3198 (gpgsm_export): Likewise.
3199 * engine-backend.h (struct engine_ops): Likewise for members
3200 ENCRYPT, ENCRYPT_SIGN and EXPORT.
3201 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
3203 * encrypt.c (encrypt_start): Likewise. Don't check for count of
3205 (gpgme_op_encrypt_start): Likewise.
3206 (gpgme_op_encrypt): Likewise.
3207 * encrypt-sign.c (encrypt_sign_start): Likewise.
3208 (gpgme_op_encrypt_sign): Likewise.
3209 (gpgme_op_encrypt_sign_start): Likewise.
3211 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
3213 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
3214 * import.c (parse_import_res): Add skipped_new_keys parser.
3216 * op-support.c (_gpgme_parse_inv_userid): Add missing break
3218 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
3220 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
3222 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
3223 HOOK to avoid compiler warning. Don't ask, you don't want to know.
3224 (_gpgme_encrypt_status_handler): Likewise.
3225 (_gpgme_op_encrypt_init_result): Likewise.
3226 * decrypt.c (gpgme_op_decrypt_result): Likewise.
3227 (_gpgme_decrypt_status_handler): Likewise.
3228 (_gpgme_op_decrypt_init_result): Likewise.
3229 * verify.c (gpgme_op_verify_result): Likewise.
3230 (_gpgme_verify_status_handler): Likewise.
3231 (_gpgme_op_verify_init_result): Likewise.
3232 * edit.c (edit_status_handler): Likewise.
3233 (command_handler): Likewise.
3234 (edit_start): Likewise.
3235 * genkey.c (gpgme_op_genkey_result): Likewise.
3236 (genkey_status_handler): Likewise.
3237 (genkey_start): Likewise.
3238 * import.c (gpgme_op_import_result): Likewise.
3239 (import_status_handler): Likewise.
3240 (_gpgme_op_import_start): Likewise.
3241 * trustlist.c (gpgme_op_trustlist_next): Likewise.
3242 (_gpgme_op_trustlist_event_cb): Likewise.
3243 (gpgme_op_trustlist_start): Likewise.
3244 * keylist.c (gpgme_op_keylist_result): Likewise.
3245 (keylist_colon_handler): Likewise.
3246 (keylist_status_handler): Likewise.
3247 (_gpgme_op_keylist_event_cb): Likewise.
3248 (gpgme_op_keylist_start): Likewise.
3249 (gpgme_op_keylist_ext_start): Likewise.
3250 (gpgme_op_keylist_next): Likewise.
3251 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
3252 (_gpgme_passphrase_command_handler_internal): Likewise.
3253 * sign.c (gpgme_op_sign_result): Likewise.
3254 (_gpgme_sign_status_handler): Likewise.
3255 (_gpgme_op_sign_init_result): Likewise.
3257 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
3258 access to pointer type.
3260 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
3262 * engine.h (EngineCommandHandler): Change last argument to int fd.
3263 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
3265 (gpgme_edit_cb_t): Change last argument to int fd.
3266 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
3267 * passphrase.c: Include <assert.h>.
3268 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
3269 (release_op_data): Check values before calling free.
3270 (_gpgme_passphrase_status_handler): Likewise.
3271 (_gpgme_passphrase_command_handler_internal): New function.
3272 (_gpgme_passphrase_command_handler): Rewritten.
3273 * edit.c (edit_status_handler): Pass -1 as fd argument.
3274 (command_handler): Update prototype. New variable processed. Use
3275 it to store return value of
3276 _gpgme_passphrase_command_handler_internal which is now used
3277 instead _gpgme_passphrase_command_handler. Use it also to check
3278 if we should call the user's edit function. Pass fd to user's
3280 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
3282 (gpg_release): Check value before calling free. Do not release
3284 (command_cb): Function removed.
3285 (command_handler): New function. Thus we don't use a data object
3286 for command handler stuff anymore, but handle it directly. This
3287 allows proper error reporting (cancel of passphrase requests, for
3288 example). Also all callbacks work via direct writes to the file
3289 descriptor (so that passphrases are not kept in insecure memory).
3290 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
3291 (read_status): Check cmd.keyword before calling free. Install
3292 command_handler as the I/O callback handler with GPG as private
3295 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
3297 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
3298 decrypt_verify_start.
3299 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
3300 (gpgme_op_decrypt_verify): Likewise.
3301 * verify.c (verify_status_handler): New function that also calls
3302 progress status handler.
3303 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
3304 Rename to (verify_start).
3305 (gpgme_op_verify_start): Call verify_start.
3306 (gpgme_op_verify): Likewise.
3307 * encrypt.c (encrypt_status_handler): New function.
3308 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
3309 Make static. Rename to encrypt_sym_status_handler.
3310 (encrypt_start): Set status handler to encrypt_sym_status_handler
3311 or encrypt_status_handler.
3312 * sign.c (sign_status_handler): New function.
3313 (sign_start): Set status handler to sign_status_handler.
3314 * decrypt.c (decrypt_status_handler): New function that also calls
3315 progress status handler.
3316 (decrypt_start): Set status handler to decrypt_status_handler.
3317 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3318 * decrypt-verify.c (decrypt_verify_status_handler): Call
3319 _gpgme_progress_status_handler.
3321 * conversion.c (_gpgme_decode_c_string): Add missing break
3324 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
3325 to buffer to allocate.
3327 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
3329 * verify.c (parse_new_sig): Fix ERRSIG case.
3330 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
3332 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3334 * gpgme.h: The following types are renamed. The old name is kept
3335 as a deprecated typedef.
3336 (GpgmeCtx): Rename to gpgme_ctx_t.
3337 (GpgmeData): Rename to gpgme_data_t.
3338 (GpgmeRecipients): Rename to gpgme_recipients_t.
3339 (GpgmeError): Rename to gpgme_error_t.
3340 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
3341 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
3342 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
3343 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
3344 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
3345 (GpgmeAttr): Rename to gpgme_attr_t.
3346 (GpgmeValidity): Rename to gpgme_validity_t.
3347 (GpgmeProtocol): Rename to gpgme_protocol_t.
3348 (GpgmeStatusCode): Rename to gpgme_status_code_t.
3349 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
3350 (GpgmeSubkey): Rename to gpgme_subkey_t.
3351 (GpgmeKeySig): Rename to gpgme_keysig_t.
3352 (GpgmeUserID): Rename to gpgme_user_id_t.
3353 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
3354 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
3355 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
3356 (GpgmeIOCb): Rename to gpgme_io_cb_t.
3357 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
3358 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
3359 (GpgmeEventIO): Rename to gpgme_event_io_t.
3360 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
3361 (GpgmeIOCbs): Rename to gpgme_io_cbs.
3362 (gpgme_io_cbs_t): New type.
3363 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
3364 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
3365 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
3366 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
3367 (GpgmeDataCbs): Rename to gpgme_data_cbs.
3368 (gpgme_data_cbs_t): New type.
3369 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
3370 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
3371 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
3372 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
3373 (GpgmeSignResult): Rename to gpgme_sign_result_t.
3374 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
3375 (GpgmeSignature): Rename to gpgme_signature_t.
3376 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
3377 (GpgmeImportStatus): Rename to gpgme_import_status_t.
3378 (GpgmeImportResult): Rename to gpgme_import_result_t.
3379 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
3380 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
3381 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
3382 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
3383 GPGME_No_Recipients, GPGME_Invalid_Recipient and
3384 GPGME_No_Passphrase.
3385 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
3386 * context.h (struct gpgme_context_s): Rename to struct
3388 (struct gpgme_recipients_s): Rename to gpgme_recipients.
3390 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3392 * keylist.c (finish_key): Clear OPD->tmp_uid.
3394 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3396 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
3397 for NODATA status without signatures.
3399 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
3401 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
3402 (_gpgme_key_add_sig): Likewise.
3404 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
3406 * context.h (struct gpgme_context_s): Remove member op_info.
3408 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
3410 * gpgme.h (GpgmeError): Add deprecated values for
3411 GPGME_Invalid_Type and GPGME_Invalid_Mode.
3413 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
3415 * gpgme.h (gpgme_get_op_info): Remove prototype.
3416 * ops.h (_gpgme_set_op_info,
3417 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
3418 _gpgme_data_append, _gpgme_data_append_string,
3419 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
3420 _gpgme_data_append_percentstring_for_xml): Likewise.
3421 (_gpgme_progress_status_handler): Change first arg to void *.
3422 * progress.c (_gpgme_progress_status_handler): Likewise.
3423 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
3424 and <sys/types.h>, but <string.h>.
3425 (_gpgme_data_append): Remove function.
3426 (_gpgme_data_append_string): Likewise.
3427 (_gpgme_data_append_for_xml): Likewise.
3428 (_gpgme_data_append_string_for_xml): Likewise.
3429 (_gpgme_data_append_percentstring_for_xml): Likewise.
3430 * data-mem.c (_gpgme_data_get_as_string): Likewise.
3431 (_gpgme_data_release_and_return_string): Likewise.
3432 * gpgme.c (gpgme_get_op_info): Likewise.
3433 (_gpgme_set_op_info): Likewise.
3435 * gpgme.h (struct _gpgme_key): New structure.
3436 (GpgmeKey): Define using _gpgme_key.
3437 (struct _gpgme_subkey): New structure.
3438 (GpgmeSubKey): New type.
3439 (struct _gpgme_key_sig): New structure.
3440 (GpgmeKeySig): New type.
3441 (struct _gpgme_user_id): New structure.
3442 (GpgmeUserID): New type.
3443 (struct _gpgme_op_keylist_result): New structure.
3444 (GpgmeKeyListResult): New type.
3445 (gpgme_op_keylist_result): New function.
3446 (gpgme_key_get_as_xml): Remove prototype.
3447 * context.h (struct gpgme_context_s): Remove members tmp_key,
3448 tmp_uid, key_cond and key_queue.
3449 (struct key_queue_item_s): Remove structure.
3450 (struct user_id_s): Remove structure.
3451 (struct gpgme_recipients_s): Replace with simple
3453 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
3454 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
3455 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
3456 * rungpg.c (command_cb): Return GpgmeError instead int.
3457 New variable ERR. Use it to hold return value of cmd handler.
3458 (gpg_delete): Access fingerprint of key directly.
3459 (append_args_from_signers): Likewise.
3460 (gpg_edit): Likewise.
3461 (append_args_from_recipients): Use GpgmeUserID for recipient list.
3462 * engine-gpgsm.c: Do not include "key.h".
3463 (gpgsm_delete): Access fingerprint of key directly.
3464 (gpgsm_sign): Likewise.
3465 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
3467 * key.h: File removed.
3468 * key.c: Completely reworked to use exposed GpgmeKey data types.
3469 * keylist.c: Likewise.
3470 * recipient.c: Completely reworked to use GpgmeUserID.
3472 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
3474 * gpgme.h (gpgme_get_key): Remove force_update argument.
3475 * key-cache.c: File removed.
3476 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
3477 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
3479 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
3480 _gpgme_key_cache_add.
3481 (gpgme_get_key): New function.
3482 * verify.c (gpgme_get_sig_key): Remove last argument to
3483 gpgme_get_key invocation.
3485 * gpgme.h (struct _gpgme_trust_item): New structure.
3486 (GpgmeTrustItem): New type.
3487 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
3488 * context.h (struct trust_queue_item_s): Remove structure.
3489 (struct gpgme_context_s): Remove trust_queue member.
3490 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
3491 * trust-item.c: New file.
3492 * trustlist.c: Do not include <stdio.h> or <time.h>, but
3494 (struct trust_queue_item_s): Change to new type op_data_t.
3495 (trust_status_handler): Change first argument to void *.
3496 (trust_colon_handler): Likewise.
3497 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
3498 (gpgme_op_trustlist_start): Use op_data_t and rework error
3500 (gpgme_op_trustlist_next): Use op_data_t.
3501 (gpgme_trust_item_release): Remove function.
3502 (gpgme_trust_item_get_string_attr): Likewise.
3503 (gpgme_trust_item_get_int_attr): Likewise.
3505 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
3508 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
3510 * context.h: Remove OPDATA_VERIFY_COLLECTING.
3511 (struct gpgme_context_s): Remove member notation.
3512 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
3514 * gpgme.h (struct _gpgme_sig_notation): New structure.
3515 (GpgmeSigNotation): New type.
3516 (struct _gpgme_signature): New structure.
3517 (GpgmeSignature): New type.
3518 (struct _gpgme_op_verify_result): New structure.
3519 (GpgmeVerifyResult): New type.
3520 (gpgme_op_verify_result): New prototype.
3521 (gpgme_get_notation): Remove prototype.
3522 * ops.h (_gpgme_op_verify_init_result): New prototype.
3523 (_gpgme_verify_status_handler): Change first argument to void *.
3524 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
3526 * conversion.c (_gpgme_decode_percent_string): New function.
3527 (gnupg_errors): New static global.
3528 (_gpgme_map_gnupg_error): New function.
3529 * gpgme.c (gpgme_release): Don't release CTX->notation.
3530 (gpgme_get_notation): Remove function.
3531 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
3532 _gpgme_op_verify_init_result.
3533 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
3534 do include "gpgme.h".
3535 (struct verify_result): Replace with ...
3536 (op_data_t): ... this type.
3537 (release_verify_result): Remove function.
3538 (release_op_data): New function.
3539 (is_token): Remove function.
3540 (skip_token): Remove function.
3541 (copy_token): Remove function.
3542 (gpgme_op_verify_result): New function.
3543 (calc_sig_summary): Rewritten.
3544 (finish_sig): Remove function.
3545 (parse_new_sig): New function.
3546 (parse_valid_sig): New function.
3547 (parse_notation): New function.
3548 (parse_trust): New function.
3549 (parse_error): New function.
3550 (_gpgme_verify_status_handler): Rewritten. Change first argument
3552 (_gpgme_op_verify_start): Rework error handling. Call
3553 _gpgme_op_verify_init_result.
3554 (gpgme_op_verify): Do not release or clear CTX->notation.
3555 (gpgme_get_sig_status): Rewritten.
3556 (gpgme_get_sig_string_attr): Likewise.
3557 (gpgme_get_sig_ulong_attr): Likewise.
3558 (gpgme_get_sig_key): Likewise.
3560 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
3561 (GpgmeDecryptResult): New type.
3562 (gpgme_op_decrypt_result): New prototype.
3563 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
3564 (_gpgme_decrypt_status_handler): Fix prototype.
3565 (_gpgme_decrypt_start): Remove prototype.
3566 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
3567 <string.h> and <assert.h>, "util.h" and "context.h", but
3569 (decrypt_verify_status_handler): Change first argument to void *,
3570 and rework error handling.
3571 (_gpgme_op_decrypt_verify_start): New function.
3572 (gpgme_op_decrypt_verify_start): Rewrite using
3573 _gpgme_op_decrypt_verify_start.
3574 (gpgme_op_decrypt_verify): Likewise.
3575 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
3576 (struct decrypt_result): Change to typedef op_data_t, rewritten.
3577 (is_token): Remove function.
3578 (release_op_data): New function.
3579 (skip_token): Remove function.
3580 (gpgme_op_decrypt_result): New function.
3581 (_gpgme_decrypt_status_handler): Change first argument to void *.
3582 Rework error handling.
3583 (_gpgme_decrypt_start): Rename to ...
3584 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
3585 (_gpgme_op_decrypt_init_result): New function.
3586 (gpgme_op_decrypt_start): Use decrypt_start.
3587 (gpgme_op_decrypt): Likewise.
3589 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
3591 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
3592 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
3593 (_gpgme_op_encrypt_sign_start): Rename to ...
3594 (encrypt_sign_start): ... this.
3595 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
3596 _gpgme_op_encrypt_sign_start.
3597 (gpgme_op_encrypt_sign): Likewise.
3599 * gpgme.h (GpgmeEncryptResult): New data type.
3600 (gpgme_op_encrypt_result): New prototype.
3601 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
3602 (_gpgme_op_encrypt_status_handler): Fix prototype.
3603 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3604 _gpgme_op_encrypt_init_result.
3605 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
3606 "wait.h". Include <errno.h> and "gpgme.h".
3607 (SKIP_TOKEN_OR_RETURN): Remove macro.
3608 (struct encrypt_result): Rename to ...
3609 (op_data_t): ... new data type. Rewrite for user result data.
3610 (append_xml_encinfo): Remove function.
3611 (release_op_data): New function.
3612 (gpgme_op_encrypt_result): New function.
3613 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
3614 Rewrite result parsing.
3615 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
3617 (_gpgme_op_encrypt_init_result): New function.
3618 (_gpgme_op_encrypt_start): Rename to ...
3619 (encrypt_start): ... this.
3620 (gpgme_op_encrypt_start): Use encrypt_start, not
3621 gpgme_op_encrypt_start.
3622 (gpgme_op_encrypt): Likewise.
3624 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
3625 GpgmeNewSignature, GpgmeSignResult): New data types.
3626 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
3627 gpgme_hash_algo_name): New prototypes.
3628 * gpgme.c (gpgme_pubkey_algo_name): New function.
3629 (gpgme_hash_algo_name): Likewise.
3630 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
3632 (_gpgme_op_sign_status_handler): Fix prototype.
3633 * op-support.c: Include <errno.h> and <string.h>.
3634 (_gpgme_parse_inv_userid): New function.
3635 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
3636 <assert.h> and "util.h".
3637 (SKIP_TOKEN_OR_RETURN): Remove macro.
3638 (struct sign_result): Change to op_data_t type and rework it.
3639 (release_sign_result): Rename to ...
3640 (release_op_data): ... this and rewrite it.
3641 (append_xml_info): Remove function.
3642 (gpgme_op_sign_result): New function.
3643 (parse_sig_created): New function.
3644 (_gpgme_sign_status_handler): Change first argument to void *.
3645 Rewrite the function to use the new result structure and functions.
3646 (_gpgme_op_sign_init_result): New function.
3647 (_gpgme_op_sign_start): Rename to ...
3648 (sign_start): ... this. Call _gpgme_op_sign_init_result.
3649 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
3650 (gpgme_op_sign): Likewise.
3651 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3652 _gpgme_op_sign_init_result.
3654 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
3656 (enum delete_problem): Move into function delete_status_handler.
3657 (delete_status_handler): Change first argument to void *. Parse
3658 delete problem with strtol instead atoi. Return better error
3660 (_gpgme_op_delete_start): Rename to ...
3661 (delete_start): ... this. Rework error handling.
3662 (gpgme_op_delete_start): Use delete_start instead
3663 _gpgme_op_delete_start.
3664 (gpgme_op_delete): Likewise.
3665 * gpgme.h (GpgmeDataType): Removed.
3667 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
3669 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
3670 * import.c (parse_import_res): Parse unchanged field.
3672 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
3673 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
3674 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
3675 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
3676 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3677 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3678 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3679 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3680 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3681 (struct _gpgme_import_status): New structure.
3682 (GpgmeImportStatus): New type.
3683 (struct _gpgme_op_import_result): New structure.
3684 (GpgmeImportResult): New type.
3685 (gpgme_op_import_result): New function.
3686 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3687 (struct import_result): Change to type op_data_t.
3688 (release_import_result): Rename to ...
3689 (release_op_data): ... this.
3690 (append_xml_impinfo): Function removed.
3691 (gpgme_op_import_result): New function.
3692 (parse_import): New function.
3693 (parse_import_res): Likewise.
3694 (import_status_handler): Change first argument to void *. Rewrite
3695 to use new functions.
3696 (_gpgme_op_import_start): Rework error handling.
3698 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3699 (edit_resut): Change to typedef for op_data_t.
3700 (edit_status_handler): Change first argument to void *.
3701 Rework error handling.
3702 (command_handler): Rework error handling.
3703 (_gpgme_op_edit_start): Rename to ...
3704 (edit_start): ... this. Rework error handling.
3705 (gpgme_op_edit_start): Rewrite using edit_start.
3706 (gpgme_op_edit): Likewise.
3708 * ops.h (_gpgme_passphrase_start): Remove prototype.
3709 * passphrase.c: Do not include <assert.h>, "util.h" or
3710 "debug.h", but "gpgme.h".
3711 (struct passphrase_result): Change to typedef for op_data_t.
3712 (release_passphrase_result): Rename to release_op_data.
3713 (_gpgme_passphrase_status_handler): Change first argument to void *.
3714 Use new op_data_t type.
3715 (_gpgme_passphrase_command_handler): Use new op_data_t type.
3716 (_gpgme_passphrase_start): Remove function.
3717 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
3718 not call _gpgme_passphrase_start, but install command handler.
3719 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3720 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3721 * sign.c (_gpgme_op_sign_start): Likewise.
3723 * context.h (struct gpgme_context_s): Remove member initialized,
3724 use_cms and help_data_1. Add member protocol. Make use_armor and
3725 use_textmode bit flags. Make keylist_mode, include_certs,
3726 signers_len and signers_size unsigned.
3727 * gpgme.c (gpgme_new): Initialize CTX->protocol.
3728 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
3729 (gpgme_get_protocol): Likewise.
3730 (gpgme_release): Do not release CTX->help_data_1.
3731 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3733 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3735 * data.c: Do not include <assert.h>, but "gpgme.h".
3736 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3737 it will go. Do not assert DH.
3738 (_gpgme_data_outbound_handler): Do not assert DH.
3740 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3742 (export_status_handler): Change type of first argument to void *.
3743 (_gpgme_op_export_start): Rename to ...
3744 (export_start): ... this. Rework error handling.
3745 (gpgme_op_export_start): Rewritten to use export_start instead
3746 _gpgme_op_export_start.
3747 (gpgme_op_export): Likewise.
3749 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3750 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3751 GPGME_No_Passphrase): New macros.
3753 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3755 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3757 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3758 (GpgmeGenKeyResult): New type.
3759 (gpgme_op_genkey): Drop last argument.
3760 (gpgme_op_genkey_result): New function.
3761 * genkey.c: Do not include "util.h", but "gpgme.h".
3762 (struct genkey_result): Replace with ...
3763 (op_data_t): ... this new type.
3764 (release_genkey_result): Replace with ...
3765 (release_op_data): ... this new function.
3766 (gpgme_op_genkey_result): New function.
3767 (genkey_status_handler): Rewritten using new op_data_t type.
3768 (get_key_parameter): New function.
3769 (_gpgme_op_genkey_start): Renamed to
3770 (genkey_start): ... this and rewritten.
3771 (gpgme_op_genkey_start): Use genkey_start instead
3772 _gpgme_op_genkey_start.
3773 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3775 * context.h (struct gpgme_context_s): Remove member verbosity.
3776 * gpgme.c (gpgme_new): Do not set member verbosity.
3777 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3778 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3779 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3780 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3781 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3782 (gpg_set_verbosity): Remove function.
3783 * decrypt.c (_gpgme_decrypt_start): Don't call
3784 _gpgme_engine_set_verbosity.
3785 * delete.c (_gpgme_op_delete_start): Likewise.
3786 * edit.c (_gpgme_op_edit_start): Likewise.
3787 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3788 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3789 * export.c (_gpgme_op_export_start): Likewise.
3790 * genkey.c (_gpgme_op_genkey_start): Likewise.
3791 * import.c (_gpgme_op_import_start): Likewise.
3792 * keylist.c (gpgme_op_keylist_start): Likewise.
3793 (gpgme_op_keylist_ext_start): Likewise.
3794 * sign.c (_gpgme_op_sign_start): Likewise.
3795 * verify.c (_gpgme_op_verify_start): Likewise.
3797 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3798 * key.c (key_cache_initialized, key_cache_size,
3799 key_cache_max_chain_length, ): Removed.
3800 (struct key_cache_item_s, key_cache_lock, key_cache,
3801 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3802 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3803 * key-cache.c: ... here. New file.
3804 * key.h (_gpgme_key_cache_init): Remove prototypes.
3805 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3807 * version.c: Do not include "key.h".
3808 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3810 * mkstatus: Strip trailing comma.
3811 * gpgme.h (GpgmeStatus): Pretty print.
3813 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3814 GPGME_Bad_Passphrase.
3815 * passphrase.c (_gpgme_passphrase_status_handler): Use
3816 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3818 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3819 GPGME_No_UserID and GPGME_Invalid_Recipient to
3820 GPGME_Invalid_UserID.
3821 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3822 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3823 GPGME_Invalid_Recipient.
3824 (_gpgme_op_encrypt_start): Likewise.
3826 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3827 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3828 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3829 * wait-global.c (gpgme_wait): Likewise.
3830 * verify.c (_gpgme_op_verify_start): Likewise.
3831 (gpgme_get_sig_status): Don't check pending flag.
3832 (gpgme_get_sig_string_attr): Likewise.
3833 (gpgme_get_sig_ulong_attr): Likewise.
3834 (gpgme_get_sig_key): Likewise.
3835 * op-support.c (_gpgme_op_reset): Likewise.
3836 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3837 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3838 (gpgme_op_trustlist_end): Likewise.
3839 * sign.c (_gpgme_op_sign_start): Likewise.
3840 * context.h (struct gpgme_context_s): Remove member PENDING.
3841 * decrypt.c (_gpgme_decrypt_start): Likewise.
3842 * delete.c (_gpgme_op_delete_start): Likewise.
3843 * edit.c (_gpgme_op_edit_start): Likewise.
3844 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3845 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3846 * export.c (_gpgme_op_export_start): Likewise.
3847 * genkey.c (_gpgme_op_genkey_start): Likewise.
3848 * import.c (_gpgme_op_import_start): Likewise.
3849 * key.c (gpgme_get_key): Likewise.
3850 * keylist.c (gpgme_op_keylist_start): Likewise.
3851 (gpgme_op_keylist_ext_start): Likewise.
3852 (gpgme_op_keylist_next): Likewise.
3853 (gpgme_op_keylist_end): Likewise.
3854 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3856 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3858 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3859 and add argument for returning the result string.
3860 (gpgme_cancel): Remove prototype.
3861 * gpgme.c (gpgme_cancel): Remove function.
3862 * context.h (struct gpgme_context_s): Remove member cancel.
3863 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3864 passphrase callback in the new way.
3866 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3868 * edit.c (_gpgme_edit_status_handler): Call the progress status
3871 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3873 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3874 I/O handlers left to ...
3875 (_gpgme_user_io_cb_handler): ... here.
3877 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3879 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3880 could not be allocated.
3881 (gpgme_trust_item_release): Only release name if it is allocated.
3882 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3884 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3886 * rungpg.c (read_status): If he status handler returns an error,
3888 (status_handler): If read_status fails, just return the error.
3890 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3892 * engine-gpgsm.c (start): Handle all errors, not only most of
3894 (xtoi_1, xtoi_2): Remove macro.
3895 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3897 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3899 * engine-gpgsm.c (map_assuan_error): Replace
3900 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3901 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3903 * util.h (DIMof): Remove macro.
3905 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3906 _gpgme_data_unread): Prototypes removed.
3908 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3910 * types.h: File removed.
3911 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3912 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3914 * context.h: Likewise.
3915 * cengine-gpgsm.h: Likewise.
3916 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3917 for EngineStatusHandler, EngineColonLineHandler and
3918 EngineCommandHandler.
3919 (_gpgme_engine_set_status_handler): Change parameter type from
3920 GpgmeStatusHandler to EngineStatusHandler.
3921 (_gpgme_engine_set_command_handler): Change parameter type from
3922 GpgmeCommandHandler to EngineCommandHandler.
3923 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3924 GpgmeColonLineHandler to EngineColonLineHandler.
3925 * engine-backend.h: Include "engine.h" instead "types.h".
3926 (struct engine_ops): Change Gpgme*Handler parameters in members
3927 set_command_handler, set_colon_line_handler and set_status_handler
3929 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3930 type from GpgmeStatusHandler to EngineStatusHandler.
3931 (_gpgme_engine_set_command_handler): Change parameter type from
3932 GpgmeCommandHandler to EngineCommandHandler.
3933 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3934 GpgmeColonLineHandler to EngineColonLineHandler.
3935 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3936 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3937 member colon.fnc from GpgmeColonLineHandler to
3938 EngineColonLineHandler. Change type of member cmd.fnc from
3939 GpgmeCommandHandler to EngineCommandHandler.
3940 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3941 * rungpg.c (gpg_set_status_handler): Change parameter type from
3942 GpgmeStatusHandler to EngineStatusHandler.
3943 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3944 (assuan_simple_command): Likewise.
3945 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3946 from GpgmeColonLineHandler to EngineColonLineHandler.
3947 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3948 * rungpg.c (gpg_set_command_handler): Change parameter type from
3949 GpgmeCommandHandler to EngineCommandHandler.
3951 * engine-gpgsm.c (status_handler): Do not close status fd at end
3954 * ops.h (_gpgme_op_data_lookup): Add prototype.
3955 * op-support.c: Include <stdlib.h>.
3956 (_gpgme_op_data_lookup): New function.
3957 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3958 (struct decrypt_result_s): Rename to ...
3959 (struct decrypt_resul): ... this.
3960 (DecryptResult): New type.
3961 (_gpgme_decrypt_status_handler): Don't use
3962 test_and_allocate_result, but use _gpgme_op_data_lookup to
3963 retrieve result data object.
3964 * sign.c (_gpgme_release_sign_result): Function removed.
3965 (release_sign_result): New function.
3966 (struct sign_result_s): Rename to ...
3967 (struct sign_result): ... this.
3968 (SignResult): New type.
3969 (_gpgme_sign_status_handler): Don't use
3970 test_and_allocate_result, but use _gpgme_op_data_lookup to
3971 retrieve result data object.
3972 * encrypt.c (struct encrypt_result_s): Rename to ...
3973 (struct encrypt_result): ... this.
3974 (_gpgme_release_encrypt_result): Function removed.
3975 (release_encrypt_result): New function.
3976 (_gpgme_encrypt_status_handler): Don't use
3977 test_and_allocate_result, but use _gpgme_op_data_lookup to
3978 retrieve result data object.
3979 * verify.c (struct verify_result_s): Rename to ...
3980 (struct verify_result): ... this. Remove member next.
3981 (VerifyResult): New type.
3982 (_gpgme_release_verify_result): Function removed.
3983 (release_verify_result): New function.
3984 (finish_sig): Change first argument to type VerifyResult. Diddle
3985 the type of the op_data structure.
3986 (add_notation): Change first argument to type VerifyResult.
3987 (_gpgme_verify_status_handler): Don't use
3988 test_and_allocate_result, but use _gpgme_op_data_lookup to
3989 retrieve result data object.
3990 * passphrase.c (struct passphrase_result_s): Rename to ...
3991 (struct passphrase_result): ... this. Remove member next.
3992 (PassphraseResult): New type.
3993 (_gpgme_release_passphrase_result): Function removed.
3994 (release_passphrase_result): New function.
3995 (_gpgme_passphrase_status_handler): Don't use
3996 test_and_allocate_result, but use _gpgme_op_data_lookup to
3997 retrieve result data object.
3998 (_gpgme_passphrase_command_handler): Likewise.
3999 * keylist.c (struct keylist_result_s): Rename to ...
4000 (struct keylist_result): ... this. Remove member next.
4001 (KeylistResult): New type.
4002 (_gpgme_release_keylist_result): Function removed.
4003 (release_keylist_result): New function.
4004 (keylist_status_handler): Don't use
4005 test_and_allocate_result, but use _gpgme_op_data_lookup to
4006 retrieve result data object.
4007 * edit.c (struct edit_result_s): Rename to ...
4008 (struct edit_result): ... this. Remove member next.
4009 (EditResult): New type.
4010 (_gpgme_release_edit_result): Function removed.
4011 (release_edit_result): New function.
4012 (edit_status_handler): Don't use
4013 test_and_allocate_result, but use _gpgme_op_data_lookup to
4014 retrieve result data object.
4015 (command_handler): Likewise.
4016 * types.h (DecryptResult, SignResult, EncryptResult,
4017 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
4018 KeylistResult, EditResult): Types removed.
4019 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
4020 (test_and_allocate_result): Remove macro.
4021 (_gpgme_release_decrypt_result): Remove prototype.
4022 (_gpgme_decrypt_result): Remove prototype.
4023 (_gpgme_release_sign_result): Remove prototype.
4024 (_gpgme_release_encrypt_result): Remove prototype.
4025 (_gpgme_release_passphrase_result): Remove prototype.
4026 (_gpgme_release_import_result): Remove prototype.
4027 (_gpgme_release_delete_result): Remove prototype.
4028 (_gpgme_release_genkey_result): Remove prototype.
4029 (_gpgme_release_keylist_result): Remove prototype.
4030 (_gpgme_release_edit_result): Remove prototype.
4031 (_gpgme_release_verify_result): Remove prototype.
4032 * gpgme.c (_gpgme_release_result): Rewritten.
4033 * context.h (enum ctx_op_data_type): New enum.
4034 (struct ctx_op_data): New structure.
4035 (struct gpgme_context_s): Replace the member result with a member
4037 (fail_on_pending_request): Remove macro.
4038 * op-support.c (_gpgme_op_reset): Expand macro
4039 fail_on_pending_request.
4040 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
4042 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
4044 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
4045 (gpg_start): Rename to ...
4046 (start): ... this function. Change arguments to GpgObject.
4047 (gpg_decrypt): Call start.
4048 (gpg_edit): Likewise.
4049 (gpg_encrypt): Likewise.
4050 (gpg_encrypt_sign): Likewise.
4051 (gpg_export): Likewise.
4052 (gpg_import): Likewise.
4053 (gpg_keylist): Likewise.
4054 (gpg_keylist_ext): Likewise.
4055 (gpg_trustlist): Likewise.
4056 (gpg_verify): Likewise.
4058 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
4059 (gpgsm_start): Rename to ...
4060 (struct gpgsm_object_s): Remove member command.
4061 (gpgsm_release): Don't free command.
4062 (start): ... this function. Change arguments to GpgsmObject and
4064 (gpgsm_decrypt): Call start.
4065 (gpgsm_delete): Likewise.
4066 (gpgsm_encrypt): Likewise.
4067 (gpgsm_export): Likewise.
4068 (gpgsm_genkey): Likewise.
4069 (gpgsm_import): Likewise.
4070 (gpgsm_keylist): Likewise.
4071 (gpgsm_keylist_ext): Likewise.
4072 (gpgsm_verify): Likewise.
4074 * decrypt.c (_gpgme_decrypt_start): Don't call
4075 _gpgme_engine_start.
4076 * delete.c (_gpgme_op_delete_start): Likewise.
4077 * edit.c (_gpgme_op_edit_start): Likewise.
4078 * encrypt.c (_gpgme_op_encrypt_start):
4079 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
4080 * export.c (_gpgme_op_export_start): Likewise.
4081 * genkey.c (_gpgme_op_genkey_start): Likewise.
4082 * import.c (_gpgme_op_import_start): Likewise.
4083 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
4084 (gpgme_op_keylist_start): Likewise.
4085 * sign.c (_gpgme_op_sign_start): Likewise.
4086 * trustlist.c (gpgme_op_trustlist_start): Likewise.
4087 * verify.c (_gpgme_op_verify_start): Likewise.
4089 * engine-backend.h (struct engine_ops): Remove member start.
4091 * engine.h (_gpgme_engine_start): Remove prototype.
4092 * engine.c (_gpgme_engine_start): Remove function.
4094 2003-01-19 Miguel Coca <mcoca@gnu.org>
4096 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
4098 * w32-util.c: Include "sema.h".
4099 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
4102 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
4104 * types.h: Remove byte and ulong types.
4105 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
4107 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
4109 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
4110 few more escaped characters. Be more strict about buffer size.
4111 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
4112 BUF and DST to unsigned char instead byte.
4113 * progress.c (_gpgme_progress_status_handler): Use unsigned char
4115 * debug.c (trim_spaces): Likewise.
4117 * util.h (mk_error): Remove macro.
4118 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
4119 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
4120 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
4121 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
4122 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
4123 wait-private (literally everywhere): Expand the mk_error macro.
4125 * context.h (wait_on_request_or_fail): Remove macro.
4127 * context.h (gpgme_context_s): Remove member ERROR.
4128 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
4129 (GpgmeCommandHandler): Change return type to GpgmeError and add
4130 new argument RESULT.
4131 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
4132 (GpgmeEventIO): New event GPGME_EVENT_START.
4133 (GpgmeIdleFunc): Remove type.
4134 (gpgme_register_idle): Remove prototype.
4135 * data.c: Include <assert.h>.
4136 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
4137 Return any error instead ignoring it, don't close file descriptor
4139 (_gpgme_data_outbound_handler): Likewise.
4140 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4141 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
4142 Return error instead setting ctx->error. Return success at end of
4144 (gpgme_op_decrypt): Don't work around the old kludge anymore.
4145 * decrypt-verify.c (decrypt_verify_status_handler): Change return
4146 type to GpgmeError. Return possible errors.
4147 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
4149 (delete_status_handler): Change return type to GpgmeError. Return
4150 error instead setting ctx->error. Return success at end of
4152 * edit.c: Do not include <stdio.h> and <string.h>.
4153 (_gpgme_edit_status_handler): Change type to GpgmeError,
4154 make static and rename to ...
4155 (edit_status_handler): ... this. Return error directly.
4156 (command_handler): Change return type to GpgmeError, add result
4157 argument. Return error directly.
4158 * encrypt.c (status_handler_finish): Remove function.
4159 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
4160 Return error directly.
4161 (_gpgme_encrypt_sym_status_handler): Likewise.
4162 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4163 * engine-gpgsm.c (close_notify_handler): Do not signal done event
4165 (status_handler): Change return type to GpgmeError. Diddle things
4166 around a bit to return errors directly.
4167 (start): Send start event.
4168 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4169 (export_status_handler): Change return type to GpgmeError. Don't
4171 * genkey.c: Do not include <stdio.h> and <assert.h>.
4172 (genkey_status_handler): Change return type to GpgmeError. Don't
4173 check ctx->error. Return errors directly.
4174 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
4175 (_gpgme_op_event_cb): Function removed.
4176 (_gpgme_op_event_cb_user): Likewise.
4177 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4178 (import_status_handler): Change return type to GpgmeError. Don't
4180 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
4181 Change return type to GpgmeError, return error directly.
4182 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
4183 wait-private.c and wait-user.c
4184 * ops.h (test_and_allocate_result): Return error instead setting
4186 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
4187 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
4188 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
4189 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
4190 Change return type to GpgmeError.
4191 (_gpgme_passphease_command_handler): Change return type to
4192 GpgmeError and add new argument RESULT.
4193 * op-support.c: Use new callback functions, and change private
4194 data to ctx everywhere.
4195 * passphrase.c (_gpgme_passphrase_status_handler): Change return
4196 type to GpgmeError, return error directly.
4197 (_gpgme_passphrase_command_handler): Change return type to
4198 GpgmeError, add result argument. Return results accordingly.
4199 * progress.c (_gpgme_progress_status_handler): Change return type
4200 to GpgmeError, return errors directly.
4201 * rungpg.c (status_handler): Change return type to GpgmeError.
4202 Return error directly.
4203 (close_notify_handler): Don't send done event.
4204 (colon_line_handler): Change return type to GpgmeError, return
4206 * rungpg.c (start): Send start event.
4207 * sign.c (_gpgme_sign_status_handler): Change return type to
4208 GpgmeError, return errors directly.
4209 * trustlist.c (trustlist_status_handler): Change return type to
4210 GpgmeError. Return 0.
4211 (trustlist_colon_handler): Change return type GpgmeError. Return
4213 * verify.c (add_notation): Change return type to GpgmeError,
4214 return errors directly.
4215 (_gpgme_verify_status_handler): Likewise.
4216 * wait.h (struct fd_table): Remove lock member.
4217 (struct wait_item_s): Moved here from wait.c.
4218 (struct tag): New structure.
4219 (_gpgme_wait_event_cb): Remove prototype.
4220 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
4221 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
4222 _gpgme_wait_user_event_io_cb): New prototypes.
4223 * wait.c: Don't include <stdio.h>.
4224 (ftd_global, ctx_done_list, ctx_done_list_size,
4225 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
4227 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
4229 (gpgme_wait): Move to file wait-global.c.
4230 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
4231 member in wait item and tag.
4232 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
4233 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
4235 (gpgme_fd_table_init): Don't initialize FDT->lock.
4236 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
4237 (_gpgme_fd_table_put): Make static and rename to ...
4238 (fd_table_put): ... this function. Don't use FDT->lock.
4239 (struct wait_item_s): Move to wait.h.
4240 * wait-global.c: New file.
4241 * wait-private.c: New file.
4242 * wait-user.c: New file.
4244 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
4245 instead otrust_to_string to calculate validity.
4247 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
4249 * types.h (EngineObject): Move typedef to ...
4250 * engine.h: ... here.
4251 * types.h (GpgObject): Move typedef to ...
4252 * rungpg.c: ... here.
4253 * types.h (GpgsmObject): Move typedef to ...
4254 * engine-gpgsm.c: ... here.
4256 * util.h (return_if_fail, return_null_if_fail,
4257 return_val_if_fail): Remove macro.
4258 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
4259 * key.c (gpgme_key_ref): Likewise.
4260 * signers.c (gpgme_signers_enum): Likewise.
4261 (gpgme_signers_clear): Likewise.
4263 * engine-backend.h (struct engine_ops): Rename get_path to
4265 * gpgme.h (struct _gpgme_engine_info): Rename member path to
4267 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
4268 util.h. Other clean ups.
4269 (parse_version_number): Protect more seriously against
4271 (gpgme_get_engine_info): Move to ...
4272 * engine.c (gpgme_get_engine_info): ... here.
4273 (_gpgme_engine_get_info): Function removed.
4274 (_gpgme_engine_get_path): Make static and rename to ...
4275 (engine_get_file_name): .. this.
4276 (_gpgme_engine_get_version): Make static and rename to ...
4277 (engine_get_version): ... this.
4278 (_gpgme_engine_get_req_version): Make static and rename to ...
4279 (engine_get_req_version): ... this.
4280 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
4281 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
4284 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
4285 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
4286 (gpgme_get_protocol_name): New function.
4288 * engine-backend.h (struct engine_ops): New member
4289 get_req_version, remove member check_version.
4290 * engine.h (_gpgme_Engine_get_version): New prototype.
4291 * rungpg.c (gpg_get_req_version): New function.
4292 (gpg_check_version): Function removed.
4293 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
4295 * engine-gpgsm.c (gpgsm_get_req_version): New function.
4296 (gpgsm_check_version): Function removed.
4297 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
4298 gpgsm_check_version.
4299 * engine.c: Include ops.h.
4300 (_gpgme_engine_get_req_version): New function.
4301 (gpgme_engine_check_version): Rewritten.
4302 * version.c (gpgme_get_engine_info): Rewritten.
4303 * gpgme.h (gpgme_engine_info): New structure.
4304 (GpgmeEngineInfo): New type.
4306 2003-01-06 Werner Koch <wk@gnupg.org>
4308 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
4309 since gpg 1.3 to denote disabled keys.
4311 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
4313 * data-mem.c: Include <string.h>.
4314 * engine.c: Likewise.
4316 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
4318 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
4320 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
4322 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
4324 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
4326 * verify.c (gpgme_op_verify): Drop R_STAT argument.
4327 (_gpgme_intersect_stati): Function removed.
4328 * ops.h (_gpgme_intersect_stati): Remove prototype.
4330 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
4332 * libgpgme.vers: New file.
4333 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
4334 (libgpgme_version_script_cmd): New variable.
4335 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
4336 (libgpgme_la_DEPENDENCIES): New variable.
4338 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
4340 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
4341 (otrust_to_string): New function.
4342 (gpgme_key_get_as_xml): Use it.
4343 (validity_to_string): New function.
4344 (gpgme_key_get_string_attr): Beautify using above functions.
4345 (gpgme_key_get_ulong_attr): Likewise.
4347 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
4349 * data-mem.c (mem_release): Fix gcc warning.
4350 * data-user.c (user_release): Likewise.
4352 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
4354 * data.h (gpgme_data_release_cb): Change return type to void.
4355 (gpgme_data_read_cb): Change return type to ssize_t.
4356 * data.c (gpgme_data_read): Likewise.
4357 * data-stream.c (stream_read): Likewise.
4358 * data-fd.c (fd_read): Likewise.
4359 * data-mem.c (mem_read): Likewise.
4360 (mem_release): Change return type to void.
4361 * data-user.c (user_read): Change return type to ssize_t.
4362 (user_release): Change return type to void.
4363 * data-compat.c (old_user_read): Change return type to ssize_t.
4364 * gpgme.h (GpgmeDataReadCb): Likewise.
4365 (gpgme_data_read): Likewise.
4366 (GpgmeDataSeekCb): Change return type to off_t.
4368 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
4370 * gpgme.h: Add prototype for gpgme_get_key.
4371 * key.c (gpgme_get_key): New function.
4372 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
4374 * gpgme.h: Add prototypes for new interfaces
4375 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
4376 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
4377 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
4378 * key.h (struct certsig_s): New members ALGO, NAME_PART,
4379 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
4381 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
4382 Use that to determine if allocation is desired or not.
4383 * util.h: Adjust prototype of _gpgme_decode_c_string.
4384 * keylist.c (keylist_colon_handler): Adjust caller of
4385 _gpgme_decode_c_string.
4387 * key.h (struct gpgme_key_s): New member last_uid.
4388 * key.c (_gpgme_key_append_name): Rewritten using
4389 _gpgme_decode_c_string and the last_uid pointer.
4390 (my_isdigit): Macro removed.
4391 (ALLOC_CHUNK): Likewise.
4392 * keylist.c (set_userid_flags): Use last_uid member of KEY.
4394 * context.h (struct user_id_s): New member last_certsig.
4395 * key.h: Add prototype for _gpgme_key_add_certsig.
4396 * key.c (_gpgme_key_add_certsig): New function.
4397 (set_user_id_part): Move function before _gpgme_key_add_certsig.
4398 (parse_user_id): Change first argument to SRC, add new arguments
4399 NAME, EMAIL and COMMENT. Change code to use these arguments
4400 instead going through UID. Move function before
4402 (parse_x509_user_id): Likewise.
4403 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
4404 and parse_user_id invocation.
4405 (one_certsig_as_xml): New function.
4406 (one_uid_as_xml): Print signatures.
4407 * context.h (struct gpgme_context_s): New member TMP_UID.
4408 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
4411 * key.c (get_certsig): New function.
4412 (gpgme_key_sig_get_string_attr): Likewise.
4413 (gpgme_key_sig_get_ulong_attr): Likewise.
4415 * keylist.c: Include <ctype.h>.
4416 (my_isdigit): Macro removed.
4417 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
4418 (set_userid_flags): Likewise.
4419 (set_subkey_trust_info): Likewise.
4420 (set_ownertrust): Likewise.
4421 (finish_key): Move function up a bit and remove prototype.
4423 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
4425 (gpg_keylist_ext): Implement signature listing mode.
4427 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
4429 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
4430 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
4432 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
4433 CloseHandle for parent fds.
4435 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
4437 * gpgme.h [_MSC_VER]: Define ssize_t as long.
4439 2002-11-22 Werner Koch <wk@gnupg.org>
4441 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
4442 setlocale before doing another setlocale.
4444 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
4446 * decrypt.c: Some beautyfication.
4448 * verify.c (_gpgme_verify_status_handler): Treat
4449 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
4450 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
4452 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
4454 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
4455 (struct genkey_result_s): Add new member FPR.
4456 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
4457 (genkey_status_handler): Extract the fingerprint from the status
4459 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
4461 * gpgme.h: Adjust prototype of gpgme_op_genkey.
4463 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
4465 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
4466 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
4467 <twoaday@freakmail.de>.
4468 (gpg_keylist_ext): Likewise.
4470 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
4472 * import.c (append_xml_impinfo): Use
4473 _gpgme_data_append_string_for_xml rather than
4474 _gpgme_data_append_string for the field content.
4475 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
4477 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
4479 * rungpg.h, engine-gpgsm.h: File removed.
4480 * engine-backend.h: New file.
4481 * Makefile.am (gpgsm_components): New variable, set depending on
4482 automake conditional HAVE_GPGSM.
4483 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
4484 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
4485 (status-table.h): Depend on gpgme.h, not rungpg.h.
4486 * conversion.c: Include <stdlib.h>.
4487 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
4488 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
4489 functions and remove all function prototypes.
4490 (_gpgme_gpgsm_get_version): Make static and rename to ...
4491 (gpgsm_get_version): ... this.
4492 (_gpgme_gpgsm_check_version): Make static and rename to ...
4493 (gpgsm_check_version): ... this.
4494 (_gpgme_gpgsm_new): Make static. Change argument type from
4495 GpgsmObject * to void **. Call gpgsm_release instead
4496 _gpgme_gpgsm_release.
4497 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
4498 (gpgsm_check_decrypt): ... this.
4499 (_gpgme_gpgsm_op_delete): Make static and rename to ...
4500 (gpgsm_check_delete): ... this.
4501 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
4502 (gpgsm_check_set_recipients): ... this.
4503 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
4504 (gpgsm_encrypt): ... this.
4505 (_gpgme_gpgsm_op_export): Make static and rename to ...
4506 (gpgsm_export): ... this.
4507 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
4508 (gpgsm_genkey): ... this.
4509 (_gpgme_gpgsm_op_import): Make static and rename to ...
4510 (gpgsm_import): ... this.
4511 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
4512 (gpgsm_keylist): ... this.
4513 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
4514 (gpgsm_keylist_ext): ... this.
4515 (_gpgme_gpgsm_op_sign): Make static and rename to ...
4516 (gpgsm_sign): ... this.
4517 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
4518 (gpgsm_trustlist): ... this.
4519 (_gpgme_gpgsm_op_verify): Make static and rename to ...
4520 (gpgsm_verify): ... this.
4521 (gpgsm_status_handler): Rename to ...
4522 (status_handler): ... this.
4523 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
4524 (gpgsm_set_status_handler): ... this.
4525 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
4526 (gpgsm_set_colon_line_handler): ... this.
4527 (_gpgme_gpgsm_add_io_cb): Rename to ...
4528 (add_io_cb): ... this.
4529 (_gpgme_gpgsm_start): Make static and rename to ...
4530 (gpgsm_start): ... this.
4531 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
4532 (gpgsm_set_io_cb): ... this.
4533 (_gpgme_gpgsm_io_event): Make static and rename to ...
4534 (gpgsm_io_event): ... this.
4535 (struct _gpgme_engine_ops_gpgsm): New variable.
4536 [!ENABLE_GPGSM]: Removed.
4537 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
4538 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
4539 <stdlib.h> and "engine-backend.h".
4540 (struct engine_object_s): Rewritten.
4541 (engine_ops): New variable.
4542 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
4543 _gpgme_engine_check_version, _gpgme_engine_new,
4544 _gpgme_engine_release, _gpgme_engine_set_verbosity,
4545 _gpgme_engine_set_status_handler,
4546 _gpgme_engine_set_command_handler,
4547 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
4548 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
4549 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
4550 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
4551 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
4552 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
4553 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
4554 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
4555 _gpgme_engine_io_event): Reimplement.
4556 * engine.h: Fix a few comments and a variable name in a prototype.
4557 * ops.h: Do not include "rungpg.h".
4558 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
4560 * recipient.c: Likewise.
4561 * signers.c: Likewise.
4562 * version.c: Likewise.
4563 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
4564 functions and remove prototypes.
4565 (_gpgme_gpg_get_version): Make static and rename to ...
4566 (gpg_get_version): ... this.
4567 (_gpgme_gpg_check_version): Make static and rename to ...
4568 (gpg_check_version): ... this.
4569 (_gpgme_gpg_new): Make static. Change argument type from
4570 GpgObject * to void **. Call gpg_release instead
4572 (_gpgme_gpg_op_decrypt): Make static and rename to ...
4573 (gpg_check_decrypt): ... this.
4574 (_gpgme_gpg_op_delete): Make static and rename to ...
4575 (gpg_check_delete): ... this.
4576 (_gpgme_gpg_set_recipients): Make static and rename to ...
4577 (gpg_check_set_recipients): ... this.
4578 (_gpgme_gpg_op_encrypt): Make static and rename to ...
4579 (gpg_encrypt): ... this.
4580 (_gpgme_gpg_op_export): Make static and rename to ...
4581 (gpg_export): ... this.
4582 (_gpgme_gpg_op_genkey): Make static and rename to ...
4583 (gpg_genkey): ... this.
4584 (_gpgme_gpg_op_import): Make static and rename to ...
4585 (gpg_import): ... this.
4586 (_gpgme_gpg_op_keylist): Make static and rename to ...
4587 (gpg_keylist): ... this.
4588 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
4589 (gpg_keylist_ext): ... this.
4590 (_gpgme_gpg_op_sign): Make static and rename to ...
4591 (gpg_sign): ... this.
4592 (_gpgme_gpg_op_trustlist): Make static and rename to ...
4593 (gpg_trustlist): ... this.
4594 (_gpgme_gpg_op_verify): Make static and rename to ...
4595 (gpg_verify): ... this.
4596 (gpg_status_handler): Rename to ...
4597 (status_handler): ... this.
4598 (_gpgme_gpg_set_status_handler): Make static and rename to ...
4599 (gpg_set_status_handler): ... this.
4600 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
4601 (gpg_set_colon_line_handler): ... this.
4602 (gpgme_gpg_add_io_cb): Rename to ...
4603 (add_io_cb): ... this.
4604 (_gpgme_gpg_start): Make static and rename to ...
4605 (gpg_start): ... this.
4606 (_gpgme_gpg_set_io_cb): Make static and rename to ...
4607 (gpg_set_io_cb): ... this.
4608 (_gpgme_gpg_io_event): Make static and rename to ...
4609 (gpg_io_event): ... this.
4610 (struct _gpgme_engine_ops_gpg): New variable.
4612 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
4614 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
4617 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
4619 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
4620 data-compat.c: New file. Really check them in this time, completes
4623 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
4625 * types.h (GpgmeStatusHandler): ... here.
4626 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
4628 * types.h (GpgmeColonLineHandler): ... here.
4629 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
4631 * types.h (GpgmeCommandHandler): ... here.
4632 * engine.h: Don't include "rungpg.h".
4633 (_gpgme_engine_set_status_handler): Change type of
4634 argument from GpgStatusHandler to GpgmeStatusHandler.
4635 (_gpgme_engine_set_colon_line_handler): Change type of
4636 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4637 (_gpgme_engine_set_command_handler): Change type of
4638 argument from GpgCommandHandler to GpgmeCommandHandler.
4639 * engine-gpgsm.h: Don't include "rungpg.h".
4640 (_gpgme_gpgsm_set_status_handler): Change type of
4641 argument from GpgStatusHandler to GpgmeStatusHandler.
4642 (_gpgme_gpgsm_set_colon_line_handler): Change type of
4643 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4644 * engine-gpgsm.c: Do not include "rungpg.h".
4645 (struct gpgsm_object_s): Change type of
4646 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
4647 GpgmeColonLineHandler.
4648 (gpgsm_assuan_simple_command): Change type of argument from
4649 GpgStatusHandler to GpgmeStatusHandler.
4650 (_gpgme_gpgsm_set_status_handler): Likewise.
4651 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
4652 GpgColonLineHandler to GpgmeColonLineHandler.
4653 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
4654 argument from GpgStatusHandler to GpgmeStatusHandler.
4655 (_gpgme_gpg_set_colon_line_handler): Change type of
4656 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4657 (_gpgme_gpg_set_command_handler): Change type of
4658 argument from GpgCommandHandler to GpgmeCommandHandler.
4659 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
4660 GpgmeStatusHandler. Change type of colon.fnc to
4661 GpgmeColonLineHandler. Change type of cmd.fnc to
4662 GpgmeCommandLineHandler.
4663 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
4665 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
4666 to GpgmeColonLineHandler.
4667 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
4668 GpgmeCommandHandler.
4669 * engine.c (_gpgme_engine_set_status_handler): Change type of
4670 argument FNC to GpgmeStatusHandler.
4671 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
4672 to GpgmeColonLineHandler.
4673 (_gpgme_engine_set_command_handler): Change type of argument FNC to
4674 GpgmeCommandHandler.
4676 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4677 * rungpg.c (struct gpg_object_s): Remove PM.
4678 (pipemode_cb): Prototype removed.
4679 (add_pm_data): Function removed.
4680 (_gpgme_gpg_enable_pipemode): Likewise.
4681 (pipemode_copy): Likewise.
4682 (pipemode_cb): Likewise.
4683 (add_arg): Don't check for pipemode.
4684 (add_data): Likewise.
4685 (_gpgme_gpg_set_status_handler): Likewise.
4686 (_gpgme_gpg_set_colon_line_handler): Likewise.
4687 (_gpgme_gpg_set_command_handler): Likewise.
4688 (_gpgme_gpg_spawn): Likewise.
4689 (_gpgme_gpg_spawn): Don't set PM.active.
4690 (_gpgme_gpg_op_verify): Remove pipemode case.
4691 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4693 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4694 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4695 _gpgme_gpg_set_simple_line_handler): Prototype removed.
4696 (_gpgme_gpg_set_verbosity): New prototype.
4697 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4698 (add_data): ... this.
4699 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4700 (_gpgme_gpg_set_command_handler): Likewise.
4701 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4702 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4703 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4704 _gpgme_gpg_op_verify): Likewise.
4705 (_gpgme_gpg_add_pm_data): Rename to ...
4706 (add_pm_data): ... this.
4707 (_gpgme_gpg_op_verify): Call add_pm_data, not
4708 _gpgme_gpg_add_pm_data.
4709 (_gpgme_gpg_add_arg): Make static and rename to ...
4710 (add_arg): ... this.
4711 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4712 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4713 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4714 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4715 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4716 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4717 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4718 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4720 (_gpgme_gpg_set_verbosity): New function.
4721 (struct gpg_object_s): Remove member simple from colon.
4722 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4723 (_gpgme_gpg_set_simple_line_handler): Removed function.
4724 (read_colon_line): Don't check the GPG->colon.simple.
4725 * engine.c (_gpgme_engine_set_verbosity): Call
4726 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4728 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4730 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4731 _gpgme_strdup, _gpgme_free): Remove prototypes.
4732 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4734 * util.c: File removed.
4735 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4736 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4737 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4738 xtrycalloc, free instead of xfree.
4739 (_gpgme_data_append_percentstring_for_xml): Likewise.
4740 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4741 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4742 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4743 _gpgme_data_get_as_string): Likewise.
4744 * debug.c (debug_init): Likewise.
4745 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4746 * delete.c (_gpgme_release_delete_result): Likewise.
4747 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4749 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4750 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4751 _gpgme_engine_release): Likewise.
4752 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4753 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4754 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4755 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4756 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4757 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4758 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4759 * genkey.c (_gpgme_release_genkey_result): Likewise.
4760 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4761 * import.c (_gpgme_release_import_result): Likewise.
4762 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4763 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4764 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4765 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4766 * ops.h (test_and_allocate_result): Likewise.
4767 * passphrase.c (_gpgme_release_passphrase_result,
4768 _gpgme_passphrase_status_handler,
4769 _gpgme_passphrase_command_handler): Likewise.
4770 * progress.c (_gpgme_progress_status_handler): Likewise.
4771 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4772 gpgme_recipients_add_name_with_validity): Likewise.
4773 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4774 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4775 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4776 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4778 * sign.c (_gpgme_release_sign_result): Likewise.
4779 * signers.c (_gpgme_signers_add): Likewise.
4780 * trustlist.c (trust_item_new, trustlist_colon_handler,
4781 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4782 gpgme_trustitem_release): Likewise.
4783 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4784 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4786 * w32-io.c (create_reader, create_writer, destroy_reader,
4787 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4788 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4789 * w32-util.c (read_w32_registry_string): Likewise.
4790 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4791 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4792 * data-compat.c: Include <stdlib.h>.
4794 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4796 New data object component:
4798 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4799 GpgmeDataReleaseCb): New types.
4800 (struct GpgmeDataCbs): New structure.
4801 (gpgme_data_read): Changed prototype to match that of read() closely.
4802 (gpgme_data_write): Similar for write().
4803 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4804 gpgme_data_new_from_stream): New prototypes.
4805 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4807 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4808 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4809 * data.c: Reimplemented from scratch.
4810 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4811 data-user.c): New file.
4812 * context.h (struct gpgme_data_s): Removed.
4813 * conversion.c: Include <errno.h> and <sys/types.h>.
4814 (_gpgme_data_append): New function.
4815 * data.c (_gpgme_data_append_string): Move to ...
4816 * conversion.c (_gpgme_data_append_string): ... here.
4817 * data.c (_gpgme_data_append_for_xml): Move to ...
4818 * conversion.c (_gpgme_data_append_for_xml): ... here.
4819 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4820 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4821 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4822 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4824 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4826 * types.h (GpgmeDataMode): Type removed.
4828 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4829 * edit.c (_gpgme_op_edit_start): Likewise.
4830 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4831 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4832 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4833 * export.c (_gpgme_op_export_start): Likewise.
4834 * genkey.c (_gpgme_op_genkey_start): Likewise.
4835 * import.c (_gpgme_op_import_start): Likewise.
4836 * sign.c (_gpgme_op_sign_start): Likewise.
4837 * verify.c (_gpgme_op_verify_start): Likewise.
4839 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4840 no recipient if no data was returned.
4841 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4842 no recipient if no data was returned.
4843 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4844 no recipient if no data was returned.
4846 * engine.c (_gpgme_engine_op_verify): Add new argument to
4847 differentiate detached from normal signatures.
4848 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4849 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4850 mode of data argument.
4851 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4852 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4853 (gpgme_op_verify): Likewise for prototype.
4854 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4855 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4856 * verify.c (_gpgme_op_verify_start): Likewise.
4857 (gpgme_op_verify_start): Likewise.
4858 (gpgme_op_verify): Likewise.
4860 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4861 direction of data object.
4862 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4863 determine direction of data object.
4864 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4865 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4866 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4867 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4868 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4870 (build_argv): Use new member INBOUND to determine direction of
4871 file descriptor. Don't check the data type.
4872 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4874 * gpgme.c (gpgme_get_op_info): Don't call
4875 _gpgme_data_get_as_string if CTX->op_info is NULL.
4877 * version.c (gpgme_check_engine): Function removed.
4879 2002-09-30 Werner Koch <wk@gnupg.org>
4881 * keylist.c (keylist_colon_handler): Take care when printing a
4882 NULL with the DEBUG.
4884 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4885 (gpgsm_status_handler): Run the colon function to indicate EOF.
4886 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4888 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4890 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4891 multiplication with base. Reported by Stéphane Corthésy.
4893 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4894 operation type in invocation of _gpgme_op_reset.
4896 2002-09-20 Werner Koch <wk@gnupg.org>
4898 * ath.c: Include sys/time.h if sys/select.h is not available.
4900 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4902 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4903 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4905 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4907 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4908 into gpgme unconditionally.
4909 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4911 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4913 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4915 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4917 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4918 (_gpgme_debug_end): Likewise.
4919 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4921 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4923 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4925 * version.c (_gpgme_get_program_version): Likewise.
4926 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4928 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4930 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4933 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4935 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4936 _gpgme_op_edit so its prototype is known early on.
4938 * conversion.c: New file.
4939 * util.h: Add prototypes for _gpgme_decode_c_string and
4941 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4943 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4944 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4945 calls to _gpgme_hextobyte.
4946 (hash_key): Likewise.
4948 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4950 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4951 _gpgme_engine_release, as this will reset pending to zero in the
4952 event done callback on cancelled operations.
4954 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4956 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4957 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4959 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4960 * rungpg.h: Also to prototype.
4961 * engine.c (_gpgme_engine_op_edit): Likewise.
4962 * engine.h: Likewise.
4963 * edit.c (_gpgme_op_edit_start): Likewise.
4965 2002-08-29 Werner Koch <wk@gnupg.org>
4967 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4969 * vasprintf.c (va_copy): Define macro if not yet defined.
4971 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4973 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4974 CTX->result.passphrase->no_passphrase if passphrase is given (good
4975 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4977 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4979 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4980 Return 0 on success, -1 on error.
4981 * version.c (_gpgme_get_program_version): Don't wait for the child.
4982 * engine.c (_gpgme_engine_housecleaning): Function removed.
4983 (do_reaping): Likewise.
4984 (_gpgme_engine_add_child_to_reap_list): Likewise.
4985 (struct reap_s): Removed.
4986 (reap_list): Likewise.
4987 (reap_list_lock): Likewise.
4988 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4989 _gpgme_engine_housecleaning and
4990 _gpgme_engine_add_child_to_reap_list.
4991 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4992 (struct gpg_object_s): Remove PID member.
4993 (_gpgme_gpg_new): Don't initialize GPG->pid.
4994 (_gpgme_gpg_spawn): Don't set GPG->pid.
4995 * wait.c (run_idle): Removed.
4996 (gpgme_wait): Run idle_function directly.
4998 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
5000 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
5001 variables encrypt_info and encrypt_info_len.
5002 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
5003 * posix-sema.c (sema_fatal): Remove function.
5004 All these reported by Stéphane Corthésy.
5006 2002-08-23 Werner Koch <wk@gnupg.org>
5008 * gpgme-config.in: Made --prefix work for --libs.
5010 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
5012 * ath.h: Update list of symbols that get a prefix: Rename the
5013 ath_mutex_*_available symbols to ath_*_available.
5015 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
5017 * stpcpy.c: New file from gnulib.
5018 * Makefile.am (assuan_libobjs): Remove jnlib.
5020 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
5022 * gpgme.h: Add prototype for gpgme_op_import_ext.
5023 * import.c (struct import_result_s): New member `nr_considered'.
5024 Rename `any_imported' to `nr_imported'.
5025 (import_status_handler): Increment nr_imported. Set nr_considered
5027 (gpgme_op_import_ext): New function.
5028 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
5030 2002-08-20 Werner Koch <wk@gnupg.org>
5032 * gpgme.m4: Replaced with a new and faster version. This does not
5033 anymore try to build test programs. If we really need test
5034 programs, we should add an option to gpgme-config to do so.
5036 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
5038 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
5040 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
5041 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
5044 2002-08-19 Werner Koch <wk@gnupg.org>
5046 * decrypt.c (is_token,skip_token): Duplicated from verify.c
5047 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
5048 (_gpgme_decrypt_status_handler): Create an operation info.
5050 2002-08-14 Werner Koch <wk@gnupg.org>
5052 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
5053 * key.c (gpgme_key_release): Release it. We need to add more code
5055 (_gpgme_key_append_name): Use memset to intialize the struct.
5056 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
5057 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
5060 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
5061 information about the key type (PGP or X.509).
5062 (gpgme_key_get_ulong_attr): Likewise.
5064 * keylist.c (keylist_colon_handler): Include 1 in the check for
5065 valid algorithms so that RSA is usable. Store the issuer name and
5066 serial number also for "crs" records. Parse the expire date for
5068 (set_userid_flags): Put them onto the last appended key.
5070 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
5072 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
5074 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
5076 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
5079 The following changes make it possible to flush an inbound data
5080 pipe before invoking a command handler:
5082 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
5083 _gpgme_io_select. Set timeout of 0 if this is set.
5084 * w32-io.c (_gpgme_io_select): Likewise.
5085 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
5086 * wait.c (do_select): Add new argument to _gpgme_io_select
5088 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
5089 linked_data to prototype.
5090 * engine.h (_gpgme_engine_set_command_handler): Likewise.
5091 * engine.c (_gpgme_engine_set_command_handler): Likewise.
5092 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
5093 argument to _gpgme_engine_set_command_handler.
5094 * rungpg.c (struct gpg_object_s): New members linked_data and
5096 (_gpgme_gpg_new): Initialize those new members.
5097 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
5098 (build_argv): Handle linked_data in the same hack as cb_data.
5099 (read_status): If linked_data is in use, flush the pipe before
5100 activating the command handler.
5101 * gpgme.h: Add prototypes for gpgme_op_edit_start and
5104 The next changes export the status codes to the user:
5106 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
5107 all STATUS_ with GPGME_.
5108 * delete.c (delete_status_handler): Likewise.
5109 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
5110 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
5111 (_gpgme_encrypt_sym_status_handler): Likewise.
5112 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
5113 * engine-gpgsm.c (parse_status): Likewise.
5114 (gpgsm_status_handler): Likewise.
5115 (gpgsm_set_recipients): Likewise.
5116 * export.c (export_status_handler): Likewise.
5117 * genkey.c (genkey_status_handler): Likewise.
5118 * import.c (append_xml_impinfo): Likewise.
5119 (import_status_handler): Likewise.
5120 * keylist.c (keylist_status_handler): Likewise.
5121 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
5122 (command_handler): Likewise.
5123 * progress.c (_gpgme_progress_status_handler): Likewise.
5124 * sign.c (_gpgme_sign_status_handler): Likewise.
5125 * trustlist.c (trustlist_status_handler): Likewise.
5126 * verify.c (_gpgme_verify_status_handler): Likewise.
5127 * gpgme.h (GpgmeEditCb): New type.
5128 * rungpg.h (GpgStatusCode): Rename and move to ...
5129 * gpgme.h (GpgmeStatusCode): ... this and here.
5130 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
5131 * mkstatus: Prefix STATUS with GPGME_.
5132 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
5134 * ops.h (_gpgme_verify_status_handler,
5135 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
5136 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
5137 _gpgme_progress_status_handler): Likewise.
5138 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
5140 These changes add an edit operation to GPGME:
5142 * context.h (struct gpgme_context_s): New member RESULT.edit. *
5143 ops.h: Add prototype for _gpgme_release_edit_result and
5144 _gpgme_passphrase_command_handler.
5145 * passphrase.c (command_handler): Make non-static and rename to ...
5146 (_gpgme_passphrase_command_handler): ... this.
5147 (_gpgme_passphrase_start): Use new name for command handler.
5148 * types.h: Add EditResult type.
5149 * gpgme.c (_gpgme_release_result): Release EDIT result.
5151 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
5152 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
5154 (assuan_libobjs): New variable, set this instead
5156 * engine.h (_gpgme_engine_op_edit): New prototype.
5157 * engine.c (_gpgme_engine_op_edit): New function.
5158 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
5159 * rungpg.c (_gpgme_gpg_op_edit): New function.
5161 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
5163 * delete.c (delete_problem): New case ambigious specification.
5164 (delete_status_handler): Handle new case (poorly).
5166 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
5168 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
5170 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
5172 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
5174 * vasprintf.c: Update to more recent libiberty version.
5175 * debug.h: Replace #elsif with #elif.
5177 Submitted by Stéphane Corthésy:
5178 * util.h (vasprintf): Correct prototype.
5179 * encrypt-sign.c: Include <stddef.h>.
5180 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
5182 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
5183 * ath-pth.c: Likewise.
5185 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
5187 * wait.c (fdt_global): Make static. Reported by Stéphane
5190 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
5191 patterns. Reported by Stéphane Corthésy.
5193 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
5194 by Stéphane Corthésy.
5195 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
5196 silence gcc warning.
5198 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
5200 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
5202 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
5204 * gpgme.c (_gpgme_op_event_cb_user): New function.
5205 * op-support.c (_gpgme_op_reset): Support a new mode of operation
5206 for private or user event loop. Use new user event callback
5208 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
5209 * keylist.c (gpgme_op_keylist_start): Likewise.
5211 * rungpg.c (_gpgme_gpg_io_event): New function.
5212 * rungpg.h (_gpgme_gpg_io_event): New prototype.
5213 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
5214 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
5215 * engine.c (_gpgme_engine_io_event): New function.
5216 * engine.h (_gpgme_engine_io_event): New prototype.
5217 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
5218 the real work for the default IO callback routines to ...
5219 (_gpgme_op_keylist_event_cb): ... here. New function.
5220 * trustlist.c (trustlist_colon_handler): Signal
5221 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
5222 (_gpgme_op_trustlist_event_cb): ... here. New function.
5223 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
5224 and _gpgme_op_trustlist_event_cb when appropriate.
5225 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
5226 (_gpgme_op_trustlist_event_cb): Likewise.
5227 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
5228 user provided event handler directly.
5229 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
5231 * wait.c (_gpgme_add_io_cb): Likewise.
5232 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
5233 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
5234 argument. Fix up error handling.
5235 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
5236 new argument, fix up error handling.
5238 2002-07-03 Werner Koch <wk@gnupg.org>
5240 * encrypt.c (status_handler_finish): New.
5241 (_gpgme_encrypt_status_handler): Moved some code out to the new
5242 function and call this function also in case we get into the
5243 status handler with an error which might happen due to a kludge in
5246 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
5248 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5249 table (eg use synchronous mode).
5251 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
5253 * gpgme.h: Fix documentation of key attribute retrieval functions.
5255 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
5257 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
5258 prototype and change return type to GpgmeError.
5259 (_gpgme_wait_one): New prototype.
5260 * wait.c (gpgme_wait): Replace with the meat from
5261 _gpgme_wait_on_condition here, and remove the support for
5263 (_gpgme_wait_on_condition): Remove HANG argument from prototype
5264 and change return type to GpgmeError. Replace with meat from
5265 _gpgme_wait_one and add support for conditions.
5266 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
5268 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5269 table (eg use synchronous mode).
5270 (gpgme_op_keylist_next): Remove HANG argument from
5271 _gpgme_wait_on_condition. Check its return value.
5272 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
5273 table (eg use synchronous mode).
5274 (gpgme_op_trustlist_next): Remove HANG argument from
5275 _gpgme_wait_on_condition. Check its return value.
5277 2002-06-26 Werner Koch <wk@gnupg.org>
5279 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
5281 * import.c (append_xml_impinfo): Kludge to print fingerprint
5282 instead of keyid for use with gpgsm.
5283 (import_status_handler): Set a flag to know whether any import
5285 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
5287 2002-06-25 Werner Koch <wk@gnupg.org>
5289 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
5292 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
5294 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
5296 * export.c (gpgme_op_export): If no data was returned, return
5297 GPGME_No_Recipients.
5299 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
5301 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
5303 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
5305 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
5306 (parse_status): New function.
5307 (gpgsm_status_handler): Use parse_status.
5308 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
5309 STATUS_FNC_VALUE and process status messages.
5310 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
5311 (gpgsm_set_fd): Likewise.
5312 (_gpgme_gpgsm_op_keylist): Likewise.
5313 (_gpgme_gpgsm_op_keylist_ext): Likewise.
5314 (_gpgme_gpgsm_op_sign): Likewise.
5316 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
5318 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
5320 2002-06-20 Werner Koch <wk@gnupg.org>
5322 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
5324 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
5326 (_gpgme_verify_status_handler): Watch out for wrong key usage.
5327 (gpgme_get_sig_string_attr): Hack to return info on the key
5328 usage. Does now make use of the former RESERVED argument which
5329 has been renamed to WHATIDX.
5330 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
5332 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
5334 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
5335 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
5336 error, or there are no more file descriptors to wait on.
5337 (_gpgme_wait_on_condition): Ignore return value from do_select for
5340 2002-06-13 Werner Koch <wk@gnupg.org>
5342 * verify.c (gpgme_op_verify): Make sure that we never access an
5343 unitialized result structure.
5345 2002-06-12 Werner Koch <wk@gnupg.org>
5347 * keylist.c (struct keylist_result_s): New.
5348 (_gpgme_release_keylist_result): Release it here
5349 (keylist_status_handler): Handle truncated.
5350 (append_xml_keylistinfo): New.
5351 * gpgme.c (_gpgme_release_result): and use it here.
5352 * types.h: Declare the new type here.
5353 * context.h (struct gpgme_context_s): Use it here.
5355 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
5357 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
5358 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
5359 use our own close notification mechanism without interfering with
5362 2002-06-11 Werner Koch <wk@gnupg.org>
5364 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
5366 * verify.c (calc_sig_summary): New.
5367 (gpgme_get_sig_ulong_attr): And use it here.
5369 2002-06-10 Werner Koch <wk@gnupg.org>
5371 * rungpg.h: Add new status codes TRUNCATED and ERROR.
5372 * verify.c (is_token, copy_token): New.
5373 (_gpgme_verify_status_handler): Use copy_token, handle the new
5374 ERROR status and store the errorcode used withgpgsm and trust
5376 * gpgme.h: New attribute ERRTOK.
5377 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
5378 (gpgme_get_sig_string_attr): Use it here to return the last error.
5380 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
5382 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
5383 close notification for the status fd to ...
5384 (_gpgme_gpgsm_new): ... here.
5385 * wait.h: Include "sema.h". Remove prototypes of
5386 _gpgme_remove_proc_from_wait_queue and
5387 _gpgme_register_pipe_handler. Add prototypes of
5388 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
5389 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
5391 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
5392 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
5393 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
5394 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
5395 proc_s. Replace struct wait_item_s.
5396 (_gpgme_fd_table_init): New function.
5397 (_gpgme_fd_table_deinit): Likewise.
5398 (_gpgme_fd_table_put): Likewise.
5399 (set_process_done): Remove function.
5400 (do_select): Take argument FDT. Use that to decide which fds to
5402 (_gpgme_remove_proc_from_wait_queue): Remove function.
5403 (_gpgme_wait_event_cb): New function.
5404 (_gpgme_wait_one): Likewise.
5405 (_gpgme_register_pipe_hanldler): Remove function.
5406 (_gpgme_add_io_cb): New function.
5407 (_gpgme_remove_io_cb): Likewise.
5408 (_gpgme_freeze_fd): Remove function.
5409 (_gpgme_thaw_fd): Remove function.
5410 * rungpg.c (struct fd_data_map_s): Add new member TAG.
5411 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
5412 IDX to CMD. Add new member IO_CBS.
5413 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
5414 For each I/O callback, check if it should be unregistered. If all
5415 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
5416 Remove member RUNNING.
5417 (_gpgme_gpg_new): Initialize new members.
5418 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
5419 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
5420 (build_argv): Store away the index instead the file descriptor for
5422 (_gpgme_gpg_add_io_cb): New function.
5423 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
5425 (gpg_status_handler): Change return type to void, remove PID
5426 argument, close filedescriptor if EOF or error occurs.
5427 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
5428 Use IO_CBS->remove instead _gpgme_freeze_fd.
5429 (gpg_colon_line_handler): Change return type to void, remove PID
5430 argument, close filedescriptor if EOF or error occurs.
5431 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
5432 (_gpgme_gpg_set_io_cbs): New function.
5433 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
5434 _gpgme_gpg_set_io_cbs.
5435 * gpgme.h (GpgmeIOCb): New type.
5436 (GpgmeRegisterIOCb): Likewise.
5437 (GpgmeRemoveIOCb): Likewise.
5438 (GpgmeEventIO): Likewise.
5439 (GpgmeEventIOCb): Likewise.
5440 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
5441 (gpgme_set_op_io_cbs): New prototype.
5442 (gpgme_get_op_io_cbs): Likewise.
5443 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
5444 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
5445 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
5446 prototype. Add prototype for _gpgme_op_reset.
5447 Add synchronous argument to _gpgme_decrypt_start prototype.
5448 * io.h: Beautification.
5449 * gpgme.c: Include "wait.h".
5450 (gpgme_new): Initialize FDT.
5451 (gpgme_set_io_cbs): New function.
5452 (gpgme_get_io_cbs): Likewise.
5453 (_gpgme_op_event_cb): Likewise.
5454 * data.c (_gpgme_data_inbound_handler): Change return type to
5455 void. Drop PID argument. Close FD on error and EOF.
5456 (write_mem_data): Don't close FD here ...
5457 (write_cb_data): ... or here ...
5458 (_gpgme_data_outbound_handler): ... but here. Change return type
5459 to void. Drop PID argument.
5460 * context.h: Include "wait.h".
5461 (struct gpgme_context_s): New members FDT and IO_CBS.
5462 * op-support.c: New file.
5463 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
5464 * ops.h: Add prototype for _gpgme_op_reset().
5465 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
5467 (gpgme_op_decrypt_start): Add synchronous argument.
5468 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
5470 * delete.c (gpgme_op_delete_start): Rename to ...
5471 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
5472 Use _gpgme_op_reset. Make function static.
5473 (gpgme_op_delete_start): Just a wrapper around
5474 _gpgme_op_delete_start now.
5475 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
5477 * encrypt.c: Include "wait.h".
5478 (ggpgme_op_encrypt_start): Rename to ...
5479 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
5480 Use _gpgme_op_reset. Make function static.
5481 (gpgme_op_encrypt_start): Just a wrapper around
5482 _gpgme_op_encrypt_start now.
5483 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
5485 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
5486 (_gpgme_op_encrypt_sign_start): ... this. New argument
5487 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
5488 (gpgme_op_encrypt_sign_start): Just a wrapper around
5489 _gpgme_op_encrypt_sign_start now.
5490 (gpgme_op_encrypt_sign): Add synchronous argument. Use
5491 _gpgme_wait_one instead gpgme_wait.
5492 * export.c (gpgme_op_export_start): Rename to ...
5493 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
5494 Use _gpgme_op_reset. Make function static.
5495 (gpgme_op_export_start): Just a wrapper around
5496 _gpgme_op_export_start now.
5497 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
5499 * genkey.c (gpgme_op_genkey_start): Rename to ...
5500 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
5501 Use _gpgme_op_reset. Make function static.
5502 (gpgme_op_genkey_start): Just a wrapper around
5503 _gpgme_op_genkey_start now.
5504 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
5506 * import.c (gpgme_op_import_start): Rename to ...
5507 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
5508 Use _gpgme_op_reset. Make function static.
5509 (gpgme_op_import_start): Just a wrapper around
5510 _gpgme_op_import_start now.
5511 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
5513 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
5514 (gpgme_op_keylist_ext_start): Likewise.
5515 * sign.c (gpgme_op_sign_start): Rename to ...
5516 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
5517 _gpgme_op_reset. Make function static.
5518 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
5520 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
5522 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
5523 * verify.c (gpgme_op_verify_start): Rename to ...
5524 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
5525 Use _gpgme_op_reset. Make function static.
5526 (gpgme_op_verify_start): Just a wrapper around
5527 _gpgme_op_verify_start now.
5528 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
5530 * engine-gpgsm.c (iocb_data_t): New type.
5531 (struct gpgsm_object_s): New member status_cb. Replace input_fd
5532 and input_data with input_cb. Replace output_fd and output_data
5533 with output_cb. Replace message_fd and message_data with
5534 message_cb. New member io_cbs.
5535 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
5537 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
5538 callback, check if it should be unregistered. If all callbacks
5539 have been unregistered, trigger GPGME_EVENT_DONE.
5540 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
5541 names to close the file descriptors.
5542 (_gpgme_gpgsm_op_decrypt): Use new variable names,
5543 (_gpgme_gpgsm_op_encrypt): Likewise.
5544 (_gpgme_gpgsm_op_genkey): Likewise.
5545 (_gpgme_gpgsm_op_import): Likewise.
5546 (_gpgme_gpgsm_op_keylist): Likewise.
5547 (_gpgme_gpgsm_op_keylist_ext): Likewise.
5548 (_gpgme_gpgsm_op_sign): Likewise.
5549 (_gpgme_gpgsm_op_verify): Likewise.
5550 (gpgsm_status_handler): Drop argument PID. Change return type to
5551 void. Close status pipe before returning because of EOF or error.
5552 (_gpgme_gpgsm_add_io_cb): New function.
5553 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
5555 (_gpgme_gpgsm_set_io_cbs): New function.
5556 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
5557 * engine.c (_gpgme_engine_set_io_cbs): New function.
5558 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
5560 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
5562 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5564 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
5566 * key.c: Include <ctype.h>.
5567 (_gpgme_key_append_name): Skip one more char when
5568 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
5569 Handle hexadecimal encodings. Also reported by Marc. Thanks!
5571 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5573 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
5574 * posix-sema.c: Use that prefix here.
5575 * posix-io.c: Include "ath.h".
5576 (_gpgme_io_read): Use _gpgme_ath_read instead read.
5577 (_gpgme_io_write): Use _gpgme_ath_write instead write.
5578 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
5579 (_gpgme_io_select): Use _gpgme_ath_select instead select.
5581 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5583 * Makefile.am (ath_components): New variable.
5584 (ath_components_pthread): Likewise.
5585 (ath_components_pth): Likewise.
5586 (system_components): Add ath_componentes.
5590 * ath-pthread.c: Likewise.
5591 * ath-pth.c: Likewise.
5592 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
5594 * mutex.h: Remove file.
5596 2002-05-30 Werner Koch <wk@gnupg.org>
5598 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
5599 an issuer with IDX > 0. We don't support altIssuerNames for now.
5601 2002-05-22 Werner Koch <wk@gnupg.org>
5603 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
5604 missing variable definition. Oohh - Marcus was faster.
5606 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
5608 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
5610 2002-05-21 Werner Koch <wk@gnupg.org>
5612 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
5613 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
5615 2002-05-10 Werner Koch <wk@gnupg.org>
5617 * key.h (gpgme_key_s): Add OTRUST.
5618 * keylist.c (set_ownertrust): New.
5619 (keylist_colon_handler): Get the ownertrust value
5620 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
5623 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5625 * w32-util.c: New static variable GET_PATH_LOCK.
5626 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
5627 Take lock while determining path.
5628 (_gpgme_get_gpgsm_path): Likewise.
5629 * version.c (do_subsystem_inits): Set DONE to 1 after
5631 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
5632 while determining engine info.
5633 * rungpg.c (_gpgme_gpg_get_version): New variable
5634 GPG_VERSION_LOCK. Take the lock while determining the program
5636 * posix-io.c: Include "sema.h".
5637 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
5638 while fixing the signals.
5639 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
5640 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
5642 (capabilities_to_string): Make STRINGS very const.
5643 (_gpgme_key_cache_add): Lock the key cache.
5644 (_gpgme_key_cache_get): Likewise.
5645 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
5646 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
5647 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
5649 * engine.c (_gpgme_engine_get_info): New variable
5650 ENGINE_INFO_LOCK. Take lock while determining engine info.
5651 * engine-gpgsm.c: Include "sema.h".
5652 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
5653 lock while getting program version.
5655 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5657 * debug.h: New file.
5658 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
5659 * util.h: Removed all prototypes and declarations related to
5660 debugging. Include "debug.h".
5662 * debug.c (debug_level): Comment variable and remove superfluous
5665 (_gpgme_debug_enabled): Function removed.
5666 (struct debug_control_s): Definition removed.
5667 (_gpgme_debug_level): Function removed.
5668 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
5669 pritnf-style format specification and a variable number of
5671 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
5672 starts out with "%s" for simplicity.
5673 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
5674 TEXT argument anymore.
5676 * posix-io.c (_gpgme_io_select): Use new level argument for
5677 DEBUG_BEGIN instead explicit if construct.
5679 * debug.c (debug_init): Remove superfluous zero initializer,
5680 remove volatile flag of INITIALIZED. Do not use the
5681 double-checked locking algorithm, it is fundamentally flawed and
5682 will empty your fridge (on a more serious note, despite the
5683 volatile flag it doesn't give you the guarantee you would expect,
5684 for example on a DEC Alpha or an SMP machine. The volatile only
5685 serializes accesses to the volatile variable, but not to the other
5688 2002-05-03 Werner Koch <wk@gnupg.org>
5690 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5691 output to /dev/null.
5693 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5694 * gpgme.c (gpgme_get_protocol): New.
5696 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5697 (gpgme_data_read): Ditto.
5699 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5700 lines so that a claim can be made without looking up the key.
5701 (gpgme_get_sig_string_attr): New.
5702 (gpgme_get_sig_ulong_attr): New.
5704 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5706 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5707 list to align with the status.h file from gnupg.
5709 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5710 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5711 these new status codes. Store the expiration time
5713 2002-04-27 Werner Koch <wk@gnupg.org>
5715 * gpgme.h (GpgmeData_Encoding): New.
5716 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5717 * engine-gpgsm.c (map_input_enc): New. Use it in all local
5718 functions where the INPUT command gets send.
5720 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
5722 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5723 descriptor only when we don't need it anymore. Close the message
5724 descriptor if we don't need it.
5726 2002-04-26 Werner Koch <wk@gnupg.org>
5728 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5730 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5732 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5733 GPG->cmd.cb_data, not xfree.
5735 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5737 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5738 ttytype, lc_ctype and lc_messages options in the server.
5740 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5742 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5744 2002-04-23 Werner Koch <wk@gnupg.org>
5746 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5747 can_certify to return the requested values.
5749 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5751 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5753 (gpgme_get_passphrase_cb): Likewise.
5755 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5757 * gpgme.c (gpgme_get_passphrase_cb): New function.
5758 (gpgme_get_progress_cb): New function.
5759 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5760 gpgme_get_progress_cb.
5762 2002-03-28 Werner Koch <wk@gnupg.org>
5764 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5765 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5766 * keylist.c (keylist_colon_handler): Store them.
5767 * key.c (gpgme_key_release): Free them.
5768 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5770 2002-03-26 Werner Koch <wk@gnupg.org>
5772 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5774 2002-03-21 Werner Koch <wk@gnupg.org>
5776 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5779 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5781 * Makefile.am (system_components): New variable, set depending on
5783 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5784 * syshdr.h: File removed.
5786 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5787 * posix-sema.c: Likewise.
5788 * posix-util.c: Likewise.
5790 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5791 * w32-sema.c: Likewise.
5792 * w32-util.c: Likewise.
5794 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5795 * posix-sema.c: Likewise.
5796 * w32-io.c: Include `io.h', do not include `syshdr.h'
5797 * w32-sema.c: Likewise.
5798 * w32-util.c: Likewise.
5799 * data.c: Do not include `syshdr.h'.
5801 * wait.h: Code cleanup.
5803 * mutex.h: New file.
5804 * posix-sema.c: Implement.
5806 2002-03-08 Werner Koch <wk@gnupg.org>
5808 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5810 2002-03-07 Werner Koch <wk@gnupg.org>
5812 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5814 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5816 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5817 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5818 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5819 as status handler and run _gpgme_passphrase_start.
5820 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5822 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5825 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5827 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5829 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5830 error No_Passphrase if only a bad passphrase was provided.
5832 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5834 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5835 GPGME_DATA_MODE_IN, construct a command line that stores the
5837 * verify.c (gpgme_op_verify_start): Accept TEXT being
5838 uninitialized, and in this case interpret SIG as a normal or
5839 cleartext signature and TEXT as a return data object.
5840 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5842 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5844 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5847 2002-02-28 Werner Koch <wk@gnupg.org>
5849 * key.h (subkey_s): New member expires_at.
5850 * keylist.c (keylist_colon_handler): Set it here
5851 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5853 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5855 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5856 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5857 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5858 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5859 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5860 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5861 * keylist.c (gpgme_op_keylist_ext_start): New function.
5863 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5865 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5866 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5867 rename no_recipients to no_valid_recipients.
5868 (_gpgme_encrypt_status_handler): Include error for invalid
5870 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5871 argument to GpgsmObject. Use that to report back the status about
5874 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5876 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5878 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5880 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5881 see if the problem is due to a missing key, and report that back
5884 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5886 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5887 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5888 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5889 (_gpgme_gpg_op_sign): Use that new function.
5890 (_gpgme_gpg_op_encrypt_sign): New function.
5891 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5892 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5893 (gpgme_op_encrypt_sign): Likewise.
5894 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5895 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5896 (_gpgme_sign_status_handler): Add prototype.
5897 * sign.c (sign_status_handler): Rename to ...
5898 (_gpgme_sign_status_handler): ... this and make non-static.
5899 * encrypt.c (encrypt_status_handler): Rename to ...
5900 (_gpgme_encrypt_status_handler): ... this and make non-static.
5901 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5902 * sign.c (gpgme_op_sign_start): Likewise.
5904 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5906 * context.h (struct gpgme_context_s): New member include_certs.
5907 * gpgme.h (gpgme_set_include_certs): Add prototype.
5908 (gpgme_get_include_certs): Likewise.
5909 * gpgme.c (gpgme_set_include_certs): New function.
5910 (gpgme_get_include_certs): Likewise.
5911 (gpgme_new): Set include_certs to 1 (the default).
5912 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5913 and pass it to _gpgme_gpgsm_op_sign.
5914 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5915 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5916 include_certs and handle it.
5917 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5918 * sign.c (gpgme_op_sign_start): Add new argument to
5919 _gpgme_engine_op_sign call.
5921 2002-02-14 Werner Koch <wk@gnupg.org>
5923 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5925 2002-02-13 Werner Koch <wk@gnupg.org>
5927 * vasprintf.c, fopencookie.c: Add replacement functions.
5928 * util.h: Add prototypes for them.
5930 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5932 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5933 reach the end of the function.
5935 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5937 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5938 (gpgme_op_genkey_start): Skip newlines after opening tag.
5940 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5942 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5944 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5945 set, and pass them down to the crypto engine.
5946 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5947 * engine.h: Likewise.
5948 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5949 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5951 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5953 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5956 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5958 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5960 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5963 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5965 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5966 status of the returned context is returned.
5967 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5968 aware of cancelled processes, and to allow to use gpgme_wait with
5969 CTX being NULL (as documented in the source).
5970 (struct proc_s): New member REPORTED.
5971 * gpgme.h: Fix prototype.
5972 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5973 * sign.c (gpgme_op_sign): Likewise.
5974 * import.c (gpgme_op_import): Likewise.
5975 * genkey.c (gpgme_op_genkey): Likewise.
5976 * export.c (gpgme_op_export): Likewise.
5977 * encrypt.c (gpgme_op_encrypt): Likewise.
5978 * delete.c (gpgme_op_delete): Likewise.
5979 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5981 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5983 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5985 (gpgme_get_keylist_mode): New function.
5986 (gpgme_new): Set the default for keylist_mode member of CTX.
5988 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5989 (gpgme_get_keylist_mode): New prototype.
5990 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5991 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5993 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5995 This patch has gotten a bit large... mmh. The main thing that
5996 happens here is that error values are now not determined in the
5997 operation function after gpgme_wait completed, but in the status
5998 handler when EOF is received. It should always be the case that
5999 either an error is flagged or EOF is received, so that after a
6000 gpgme_wait you should never have the situation that no error is
6001 flagged and EOF is not received. One problem is that the engine
6002 status handlers don't have access to the context, a horrible
6003 kludge works around this for now. All errors that happen during a
6004 pending operation should be catched and reported in ctx->error,
6005 including out-of-core and cancellation. This rounds up neatly a
6006 couple of loose ends, and makes it possible to pass up any errors
6007 in the communication with the backend as well. As a bonus, there
6008 will be a function to access gpgme->wait, so that the operations
6009 can truly be implemented with their _start function.
6011 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
6012 error back to the context.
6013 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
6015 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
6017 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
6018 to a value indication that.
6020 * verify.c (add_notation): Set error, not out_of_core.
6021 (finish_sig): Likewise.
6022 (gpgme_op_verify_start): Don't clear out_of_core.
6023 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
6024 (gpgme_op_verify): And don't do it here.
6026 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
6027 (gpgme_op_trustlist_start): Don't clear out_of_core.
6028 (gpgme_op_trustlist_next): Check error, not out_of_core.
6029 (gpgme_op_trustlist_end): Likewise.
6031 * ops.h (test_and_allocate_result): New macro.
6032 (_gpgme_passphrase_result): Remove prototype.
6033 * delete.c (gpgme_op_delete): Return error from context.
6034 (delete_status_handler): Use macro test_and_allocate_result.
6035 Perform error checking at EOF.
6036 (gpgme_op_delete_start): Release result.
6037 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
6038 test_and_allocate_result, and perform error checking here.
6039 (_gpgme_passphrase_result): Function removed.
6040 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
6041 (gpgme_op_sign): Just return the error value from the context.
6042 (sign_status_handler): Only progress if no error is set yet. If
6043 we process an EOF, set the resulting error value (if any).
6044 * decrypt.c (_gpgme_decrypt_result): Function removed.
6045 (create_result_struct): Function removed.
6046 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
6047 caclulate error on EOF, do not progress with errors.
6048 (_gpgme_decrypt_start): Do not set out_of_core to zero.
6049 (gpgme_op_decrypt): Just return the error value from the context.
6050 * encrypt.c (encrypt_status_handler): Perform the error checking
6052 (gpgme_op_encrypt_start): Do not clear out_of_core.
6053 * export.c (export_status_handler): Return if error is set in context.
6054 (gpgme_op_export_start): Release result.
6055 (gpgme_op_export): Return error from context.
6056 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
6058 * genkey.c (genkey_status_handler): Use macro
6059 test_and_allocate_result. Perform error checking at EOF.
6060 (gpgme_op_genkey): Just return the error from context.
6061 * import.c (gpgme_op_import): Return the error from context.
6062 (import_status_handler): Use macro test_and_allocate_result.
6063 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
6064 (gpgme_op_keylist_next): Return error of context.
6065 (keylist_colon_handler): Set error instead out_of_code.
6066 (finish_key): Likewise.
6068 * context.h: Remove member out_of_core, add member error.
6069 * gpgme.c (_gpgme_release_result): Clear error flag.
6071 * engine.h (_gpgme_engine_get_error): New prototype.
6072 * engine.c (_gpgme_engine_get_error): New function.
6073 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
6075 * engine-gpgsm.c (map_assuan_error): New function.
6076 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
6077 use the new function to map error values.
6078 (gpgsm_set_fd): Change return type tp GpgmeError.
6079 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
6080 (gpgsm_set_recipients): Likewise. Change type of return value
6081 equivalently. Adjust error values.
6082 (_gpgme_gpgsm_op_import): Likewise.
6083 (_gpgme_gpgsm_op_sign): Likewise.
6084 (struct gpgsm_object_s): New member error.
6085 (gpgsm_status_handler): Set error if error occurs. Determine
6086 error number from ERR line received. If assuan_read_line fails,
6087 terminate the connection.
6089 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
6091 * Makefile.am (MOSTLYCLEANFILES): New variable.
6093 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
6095 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
6096 connection to the server.
6098 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
6100 * rungpg.h: Add STATUS_KEY_CREATED.
6102 * progress.c: New file.
6103 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
6105 * genkey.c (genkey_status_handler): Use
6106 _gpgme_progress_status_handler. Add check for status.
6107 (struct genkey_result_s): New structure.
6108 (_gpgme_release_genkey_result): New function.
6109 (gpgme_op_genkey): Check for error.
6110 * gpgme.c (_gpgme_release_result): Call
6111 _gpgme_release_genkey_result.
6112 * ops.h (_gpgme_release_genkey_result): Add prototype.
6113 * types.h (GenKeyResult): New type.
6114 * context.h (gpgme_context_s): Add GenKeyResult to member result.
6116 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
6118 * gpgme.c (_gpgme_release_result): Call
6119 _gpgme_release_delete_result.
6120 * ops.h (_gpgme_release_delete_result): Add prototype.
6121 * types.h (DeleteResult): New type.
6122 * context.h (gpgme_context_s): Add DeleteResult to member result.
6124 * delete.c (enum delete_problem): New type.
6125 (struct delete_result_s): New structure.
6126 (_gpgme_release_delete_result): New function.
6127 (delete_status_handler): Implement more status codes.
6128 (gpgme_op_delete): Return error on failure.
6130 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
6132 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
6134 * import.c (struct import_result_s): New structure.
6135 (_gpgme_release_import_result): New function.
6136 (append_xml_impinfo): Likewise.
6137 (import_status_handler): Implement.
6138 * gpgme.c (_gpgme_release_result): Add call to
6139 _gpgme_release_import_result.
6140 * ops.h (_gpgme_release_import_result): Add prototype.
6141 * types.h (ImportResult): New type.
6142 * context.h (gpgme_context_s): Add ImportResult to member result.
6144 * encrypt.c (gpgme_op_encrypt): Code clean up.
6146 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
6148 * gpgme.h: Add lots of comment and fix the formatting. Add
6149 gpgme_trustlist_end prototype.
6151 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
6153 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
6154 gpgme_register_idle to return and accept this type.
6155 * wait.c (gpgme_register_idle): Fix type.
6156 Save and return old value of idle_function.
6158 2002-01-29 Werner Koch <wk@gnupg.org>
6160 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
6162 * keylist.c (keylist_colon_handler): Add support for the new "crs"
6165 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6167 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
6168 not assuan_pipe_disconnect.
6170 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
6171 jnlib (needed by assuan) statically into libgpgme. Linking a
6172 static library into a shared library this way is not portable.
6174 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6176 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
6179 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6181 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
6182 from off_t to size_t.
6183 * gpgme.h: Likewise.
6185 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6187 * wait.c (_gpgme_wait_on_condition): If the process finished,
6188 reset the pending flag. Also if the operation was cancelled.
6190 (struct proc_s): Rename READY to DONE.
6191 (wait_item_s): Likewise.
6192 (set_process_ready): Rename to ...
6193 (set_process_done): ... this.
6194 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
6195 instead set_process_ready.
6196 (_gpgme_wait_on_condition): Likewise.
6197 (do_select): Rename READY to DONE.
6199 * verify.c (gpgme_op_verify): Do not set pending to zero here.
6200 * sign.c (gpgme_op_sign): Likewise.
6201 * import.c (gpgme_op_import): Likewise.
6202 * genkey.c (gpgme_op_genkey): Likewise.
6203 * export.c (gpgme_op_export): Likewise.
6204 * encrypt.c (gpgme_op_encrypt): Likewise.
6205 * delete.c (gpgme_op_delete): Likewise.
6206 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
6207 * decrypt.c (gpgme_op_decrypt): Likewise.
6209 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6211 * export.c: Cleanup.
6213 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
6215 * trustlist.c: Various source clean ups.
6216 (my_isdigit): Removed.
6217 (gpgme_op_trustlist_end): New function.
6219 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
6221 * gpgme.c: Various source clean ups, like renaming C to CTX where
6223 (gpgme_new): Clear R_CTX before starting the work.
6224 (my_isdigit): Removed.
6225 (my_isxdigit): Likewise.
6227 * data.c: Various source clean ups.
6228 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
6229 (gpgme_data_new_with_read_cb): Similar for READ_CB.
6230 (gpgme_data_new_from_file): Loop over fread while EINTR.
6231 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
6232 be zero. Loop over fread while EINTR.
6234 (my_isdigit): Removed.
6235 (my_isxdigit): Likewise.
6237 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
6239 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
6240 Pipe_Error where appropriate.
6242 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
6244 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
6246 * version.c (get_engine_info): Remove prototype.
6248 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
6250 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
6251 Fill it with the servers fds, and pass it to assuan_pipe_connect.
6253 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6255 * keylist.c (gpgme_op_keylist_end): New function.
6256 * gpgme.h (gpgme_op_keylist_end): New prototype.
6258 * engine.h (gpgme_engine_check_version): Move prototype to ...
6259 * gpgme.h (gpgme_engine_check_version): ... here.
6261 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
6263 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6265 * version.c (gpgme_get_engine_info): Reimplemented.
6266 (gpgme_check_engine): Reimplemented.
6267 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
6269 * engine.c: Include `io.h'.
6270 (gpgme_engine_get_info): New function.
6271 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
6274 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6276 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
6277 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
6278 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
6280 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
6281 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
6282 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
6283 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
6284 own function by call to _gpgme_engine_add_child_to_reap_list().
6286 * wait.c: Include `engine.h'.
6287 (run_idle): Call _gpgme_engine_housecleaning(), not
6288 _gpgme_gpg_housecleaning().
6290 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6292 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
6293 Initialize the next field of the uid structure.
6294 (gpgme_key_get_as_xml): Do not list last uid first.
6296 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
6298 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
6299 function [!ENABLE_GPGSM].
6301 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6303 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
6304 message_data, not SIG.
6305 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
6307 * sign.c (sign_status_handler): Call
6308 _gpgme_passphrase_status_handler early.
6310 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6312 * engine-gpgsm.c: Revert last change.
6314 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6316 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
6317 handler when ending this operation, otherwise the wait function
6320 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6322 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
6323 (_gpgme_gpgsm_new): Initialize some more members.
6324 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
6325 (gpgsm_status_handler): Rework the inline-data processing.
6327 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6329 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
6330 list that are not dup'ed, for those the close-on-exec flag is set
6332 * version.c (_gpgme_get_program_version): Remove first entry in
6333 CFD, as the close-on-exec flag is now set for this fd.
6335 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6337 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
6338 option to `ENCRYPT'.
6339 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
6342 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6344 * engine-gpgsm.c (close_notify_handler): New function.
6345 (_gpgme_gpgsm_new): Manage the file descriptors a
6346 bit differently. Do not set close-on-exec flags.
6347 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
6348 to -1, this is done by the close handler.
6349 (_gpgme_gpgsm_op_encrypt): Likewise.
6350 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
6351 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
6352 (_gpgme_gpgsm_op_sign): Likewise.
6353 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
6355 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
6356 non-inherited file descriptor index of the pipe.
6358 2001-12-13 Werner Koch <wk@gnupg.org>
6360 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
6361 (gpgsm_status_handler): Pass datalines to a colon handler
6362 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
6365 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
6367 (gpgsm_assuan_simple_command): Removed underscore from
6369 (_gpgme_gpgsm_start): Ditto.
6370 (gpgsm_assuan_simple_command): Replaced interal Assuan read
6371 function by the new assuan_read_line. Removed the use of the
6373 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
6374 (_gpgme_gpgsm_start): Use the documented way to get an fd from
6377 * keylist.c (keylist_colon_handler): Handle "crt" records
6378 * key.h (gpgme_key_s): Add an x509 flag.
6379 * key.c (parse_x509_user_id): New.
6380 (_gpgme_key_append_name): Handle x.509 names.
6382 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6384 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
6387 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6389 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
6390 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
6392 (_gpgme_gpgsm_op_sign): Likewise.
6394 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6396 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
6399 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
6401 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
6403 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
6405 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
6406 Deal with assuan read line returning more than one line (for now).
6408 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
6410 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
6411 the current protocol definition.
6413 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
6415 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
6418 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6420 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
6421 for now, rungpg.h and status-table.h.
6422 (gpgsm_status_handler): Implement more of the status handler.
6424 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6426 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
6427 (_gpgme_engine_op_delete): Likewise.
6428 (_gpgme_engine_op_encrypt): Likewise.
6429 (_gpgme_engine_op_export): Likewise.
6430 (_gpgme_engine_op_genkey): Likewise.
6431 (_gpgme_engine_op_keylist): Likewise.
6432 (_gpgme_engine_op_sign): Likewise.
6433 (_gpgme_engine_op_trustlist): Likewise.
6435 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
6436 (gpgsm_assuan_simple_command): Likewise.
6437 (gpgsm_set_recipients): Likewise.
6438 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
6439 (_gpgme_gpgsm_op_delete): New function.
6440 (_gpgme_gpgsm_op_export): Likewise.
6441 (_gpgme_gpgsm_op_genkey): Likewise.
6442 (_gpgme_gpgsm_op_sign): Likewise.
6443 (_gpgme_gpgsm_op_keylist): Likewise.
6444 (_gpgme_gpgsm_op_trustlist): Likewise.
6445 (_gpgme_gpgsm_release): Release command.
6446 (_gpgme_gpgsm_op_decrypt): Allocate command.
6447 (_gpgme_gpgsm_op_import): Likewise.
6448 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
6450 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6452 * gpgme.h (gpgme_set_protocol): New prototype.
6454 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6456 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
6457 (_gpgme_gpgsm_op_import): Likewise.
6459 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6461 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
6463 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
6465 2001-11-22 Werner Koch <wk@gnupg.org>
6467 * engine-gpgsm.c: Include more headers so that NULL and mk_error
6468 is defined even with an undefined GPGSM_PATH.
6470 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6472 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
6473 gpg_outbound_handler): Moved to ...
6474 * data.c (_gpgme_data_inbound_handler, write_mem_data,
6475 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
6476 _gpgme_* ones non-static.
6477 * data.c: Include io.h.
6479 * ops.h (_gpgme_data_inbound_handler): New prototype.
6480 (_gpgme_data_outbound_handler): Likewise.
6481 (_gpgme_gpg_spawn): Use these new functions.
6483 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
6484 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
6485 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
6486 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
6487 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
6488 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
6489 Include <rungpg.h> for status handler function.
6491 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
6492 input_data, output_fd, output_data, message_fd, message_data, command
6494 (_gpgme_gpgsm_new): Open input, output and message pipes before
6495 connecting to the client. Close server's ends afterwards.
6496 (_gpgme_gpgsm_release): Close open file descriptors. Remove
6497 server process from wait queue.
6498 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
6499 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
6501 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
6502 (_gpgme_engine_set_status_handler): Likewise.
6503 (_gpgme_engine_op_verify): Likewise.
6505 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
6507 * context.h: Do not include rungpg.h, but engine.h.
6508 (struct gpgme_context_s): Replace member gpg with engine.
6509 * gpgme.c (gpgme_release): Release engine, not gpg.
6511 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
6513 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
6514 Make static, change order of arguments, and return an error value.
6515 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
6517 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
6518 (_gpgme_gpg_op_encrypt): Likewise.
6519 (_gpgme_gpg_op_decrypt): Likewise.
6520 (_gpgme_gpg_op_delete): Likewise.
6521 (_gpgme_gpg_op_export): Likewise.
6522 (_gpgme_gpg_op_genkey): Likewise.
6523 (_gpgme_gpg_op_import): Likewise.
6524 (_gpgme_gpg_op_keylist): Likewise.
6525 (_gpgme_gpg_op_sign): Likewise.
6526 (_gpgme_gpg_op_trustlist): Likewise.
6527 * rungpg.c (_gpgme_gpg_op_verify): New function.
6528 (_gpgme_gpg_op_encrypt): Likewise.
6529 (_gpgme_gpg_op_decrypt): Likewise.
6530 (_gpgme_gpg_op_delete): Likewise.
6531 (_gpgme_gpg_op_export): Likewise.
6532 (_gpgme_gpg_op_genkey): Likewise.
6533 (_gpgme_gpg_op_import): Likewise.
6534 (_gpgme_gpg_op_keylist): Likewise.
6535 (_gpgme_gpg_op_sign): Likewise.
6536 (_gpgme_gpg_op_trustlist): Likewise.
6538 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
6539 (_gpgme_engine_set_command_handler): Likewise.
6540 (_gpgme_engine_set_colon_line_handler): Likewise.
6541 (_gpgme_engine_op_decrypt): Likewise.
6542 (_gpgme_engine_op_delete): Likewise.
6543 (_gpgme_engine_op_encrypt): Likewise.
6544 (_gpgme_engine_op_export): Likewise.
6545 (_gpgme_engine_op_genkey): Likewise.
6546 (_gpgme_engine_op_import): Likewise.
6547 (_gpgme_engine_op_keylist): Likewise.
6548 (_gpgme_engine_op_sign): Likewise.
6549 (_gpgme_engine_op_trustlist): Likewise.
6550 (_gpgme_engine_op_verify): Likewise.
6551 (_gpgme_engine_start): Likewise.
6552 * engine.c (_gpgme_engine_set_status_handler): New function.
6553 (_gpgme_engine_set_command_handler): Likewise.
6554 (_gpgme_engine_set_colon_line_handler): Likewise.
6555 (_gpgme_engine_op_decrypt): Likewise.
6556 (_gpgme_engine_op_delete): Likewise.
6557 (_gpgme_engine_op_encrypt): Likewise.
6558 (_gpgme_engine_op_export): Likewise.
6559 (_gpgme_engine_op_genkey): Likewise.
6560 (_gpgme_engine_op_import): Likewise.
6561 (_gpgme_engine_op_keylist): Likewise.
6562 (_gpgme_engine_op_sign): Likewise.
6563 (_gpgme_engine_op_trustlist): Likewise.
6564 (_gpgme_engine_op_verify): Likewise.
6565 (_gpgme_engine_start): Likewise.
6567 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
6569 * encrypt.c (gpgme_op_encrypt_start): Likewise.
6570 * decrypt.c (_gpgme_decrypt_start): Likewise.
6571 * passphrase.c (_gpgme_passphrase_start): Likewise.
6572 * keylist.c (gpgme_op_keylist_start): Likewise.
6574 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6576 * types.h: Add types EngineObject and GpgsmObject.
6578 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
6579 engine-gpgsm.c, engine.h and engine.c.
6580 * engine.h: New file.
6581 * engine.c: Likewise.
6582 * engine-gpgsm.h: Likewise.
6583 * engine-gpgsm.c: Likewise.
6585 * rungpg.c (_gpgme_gpg_get_version): New function.
6586 (_gpgme_gpg_check_version): Likewise.
6587 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
6588 _gpgme_gpg_check_version.
6590 * version.c (compare_versions): Rename to ...
6591 (_gpgme_compare_versions): ... this. Make non-static.
6592 (gpgme_check_version): Use _gpgme_compare_versions rather than
6594 (gpgme_check_engine): Likewise.
6595 * ops.h (_gpgme_get_program_version): Add prototype.
6597 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6599 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
6600 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
6601 (libgpgme_la_LIBADD): Likewise.
6603 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6605 * version.c: Remove global variables lineno and
6607 (version_handler): Removed.
6608 (_gpgme_get_program_version): New function.
6609 (get_engine_info): Don't use context and version_handler,
6610 but _gpgme_get_program_version.
6611 * ops.h (_gpgme_get_program_version): Add prototype for
6612 _gpgme_get_program_version (we expect to use it elsewhere soon).
6614 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
6616 * version.c (get_engine_info): If GnuPG is not available, return
6618 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
6620 (_gpgme_get_gpgsm_path): New function.
6621 * w32-util.c (find_program_in_registry): New static function.
6622 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
6623 to use find_program_in_registry.
6624 (_gpgme_get_gpgsm_path): New function.
6625 (util.h): Prototype _gpgme_get_gpgsm_path).
6626 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
6629 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6631 * decrypt-verify.c: New file.
6632 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
6633 * types.h: Add decrypt-verify types.
6635 * context.h: Add result type for decrypt-verify.
6636 * gpgme.h: Add decrypt-verify prototypes.
6638 * decrypt.c (decrypt_status_handler): Renamed to ...
6639 (_gpgme_decrypt_status_handler): ... this. Make non-static.
6640 (_gpgme_decrypt_start): New function, derived from
6641 gpgme_op_decrypt_start.
6642 (gpgme_op_decrypt_start): Reimplement in terms of
6643 _gpgme_decrypt_start.
6644 (_gpgme_decrypt_result): New function to retrieve error value.
6645 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
6646 * ops.h: Add prototypes for new functions.
6648 * verify.c (verify_status_handler): Renamed to ...
6649 (_gpgme_verify_status_handler): ... this. Make non-static.
6650 (gpgme_op_verify_start): Use new function name.
6651 (intersect_stati): Renamed to ...
6652 (_gpgme_intersect_stati): ... this. Make non-static.
6653 (gpgme_op_verify): Use new name.
6654 * ops.h: Add prototypes for new functions.
6656 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6658 * passphrase.c: New file.
6659 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
6660 * ops.h (_gpgme_passphrase_result): Add prototypes from
6662 * types.h: Likewise.
6663 * context.h: Add member passphrase to result.
6664 * gpgme.c (_gpgme_release_result): Release passphrase member.
6666 * decrypt.c: Some formatting and variable name changes (like
6668 (struct decrypt_result_s): Remove members now found in
6670 (_gpgme_release_decrypt_result): Don't release removed members.
6671 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
6672 and don't handle the cases catched there.
6673 (command_handler): Removed.
6674 (gpgme_op_decrypt_start): Don't set command handler, but invoke
6675 _gpgme_passphrase_start which does it.
6676 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6677 cases covered by it.
6679 * sign.c Some formatting and variable name changes (like
6681 (struct sign_result_s): Remove members now found in
6683 (_gpgme_release_sign_result): Don't release removed members.
6684 (sign_status_handler): Call _gpgme_passphrase_status_handler,
6685 and don't handle the cases catched there.
6686 (command_handler): Removed.
6687 (gpgme_op_sign_start): Don't set command handler, but invoke
6688 _gpgme_passphrase_start which does it.
6689 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6690 cases covered by it.
6692 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6694 * decrypt.c (command_handler): Fix last change.
6696 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6698 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6699 Rename R2 to NEXT_RESULT.
6700 (intersect_stati): Rename RES to RESULT.
6701 (gpgme_get_sig_status): Likewise. Do not check return_type, but
6702 the member verify of result.
6703 (gpgme_get_sig_key): Likewise.
6705 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
6706 RESULT is zero, return.
6707 (sign_status_handler, command_handler): Do not check return_type,
6708 but the member sign of result.
6709 (gpgme_op_sign): Likewise. Drop assertion.
6711 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6712 If RESULT is zero, return.
6713 (encrypt_status_handler): Do not check return_type, but the member
6715 (gpgme_op_encrypt): Likewise. Drop assertion.
6717 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6718 (create_result_struct): Do not set result_type.
6719 (command_handler, decrypt_status_handler): Do not check
6720 return_type, but the member decrypt of result.
6721 (gpgme_op_decrypt): Likewise. Drop assertion.
6723 * context.h (enum ResultType): Removed.
6724 (struct gpgme_context_s): Remove member result_type.
6725 (struct result): Replaces union result.
6726 * gpgme.c: Include string.h.
6727 (_gpgme_release_result): Release all members of c->result, which
6728 is now a struct. Zero out all members of the struct afterwards.
6730 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
6732 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6733 Release all members of the list GPG->arglist.
6734 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6736 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6738 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6740 * key.c: Include string.h.
6742 * recipient.c: Likewise.
6744 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6746 * context.h: New member signers_len.
6747 * signers.c (gpgme_signers_clear): Require that signers are
6748 non-NULL with assertion. Use signers_len to determine how much
6749 keys to release. Add documentation.
6750 (gpgme_signers_add): Use signers_len to determine if the buffer is
6751 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6753 (gpgme_signers_enum): Use signers_len to determine if key is
6754 available. Add documentation.
6756 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6758 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6759 ALLOC_CHUNK, not DH->length.
6761 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6763 * gpgme.c (gpgme_set_protocol): Fix last change.
6765 2001-10-15 Werner Koch <wk@gnupg.org>
6767 * gpgme.h (GpgmeProtocol): New.
6768 * gpgme.c (gpgme_set_protocol): New.
6770 2001-09-26 Werner Koch <wk@gnupg.org>
6772 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6773 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6775 2001-09-17 Werner Koch <wk@gnupg.org>
6777 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6778 callers to use this function without a check for tmp_key.
6780 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6781 emptying the queue. Bug reported by Stéphane Corthésy.
6783 2001-09-12 Werner Koch <wk@gnupg.org>
6785 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6787 2001-09-07 Werner Koch <wk@gnupg.org>
6789 * rungpg.h: Add NO_RECP.
6790 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6791 (gpgme_op_encrypt): Better error return.
6793 * verify.c (verify_status_handler): Take on NODATA.
6795 2001-09-03 Werner Koch <wk@gnupg.org>
6797 * rungpg.h: Added STATUS_INV_RECP.
6798 * gpgme.c (_gpgme_release_result): Add support for new
6799 EncryptResult object.
6800 * encrypt.c (append_xml_encinfo): New.
6801 (encrypt_status_handler): Add some status parsing.
6802 (_gpgme_release_encrypt_result): New.
6804 2001-08-29 Werner Koch <wk@gnupg.org>
6806 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6808 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6809 an EOF here. This is probably the reason for a lot of bugs
6810 related to keylisting. It is so obvious. Kudos to Enno Cramer
6811 for pointing that out.
6813 2001-08-28 Werner Koch <wk@gnupg.org>
6815 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6816 (_gpgme_set_op_info): New.
6817 (_gpgme_release_result): Reset the op_info here.
6818 * sign.c (append_xml_siginfo): New.
6819 (sign_status_handler): Store the sig create information.
6821 2001-07-31 Werner Koch <wk@gnupg.org>
6823 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6825 2001-07-30 Werner Koch <wk@gnupg.org>
6827 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6829 * rungpg.c (build_argv): Disable armor comments
6830 * w32-io.c (build_commandline): Need to add quotes here
6832 2001-07-24 Werner Koch <wk@gnupg.org>
6834 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6836 2001-07-23 Werner Koch <wk@gnupg.org>
6838 * util.c: Removed stpcpy() because we use the version from jnlib.
6840 2001-07-19 Werner Koch <wk@gnupg.org>
6842 * mkstatus: Define the collating sequence for sort.
6844 2001-06-26 Werner Koch <wk@gnupg.org>
6846 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6848 2001-06-15 Werner Koch <wk@gnupg.org>
6850 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6851 to Timo for pointing this out.
6853 2001-06-01 Werner Koch <wk@gnupg.org>
6855 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6858 2001-05-28 Werner Koch <wk@gnupg.org>
6860 * version.c (gpgme_check_engine): Stop version number parsing at
6861 the opening angle and not the closing one. By Tommy Reynolds.
6863 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6865 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6866 line, because it gave an error if another operation had been made
6867 before using the same context.
6869 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6870 one line to release the gpg object in the context (if any).
6872 2001-04-26 Werner Koch <wk@gnupg.org>
6874 * key.c, key.h (_gpgme_key_cache_init): New.
6875 (_gpgme_key_cache_add): New.
6876 (_gpgme_key_cache_get): New.
6877 * version.c (do_subsystem_inits): Init the cache.
6878 * keylist.c (finish_key): Put key into the cache
6879 * verify.c (gpgme_get_sig_key): First look into the cache.
6881 2001-04-19 Werner Koch <wk@gnupg.org>
6883 * keylist.c (parse_timestamp): Adjusted for the changed
6884 --fixed-list-mode of gpg 1.0.4h.
6886 2001-04-05 Werner Koch <wk@gnupg.org>
6888 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6890 2001-04-04 Werner Koch <wk@gnupg.org>
6892 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6893 are still bytes pending. Timo found this not easy to track down
6896 2001-04-02 Werner Koch <wk@gnupg.org>
6898 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6899 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6901 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6902 the mode set in the current context. Suggested by Timo.
6904 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6905 can_encrypt. By Timo.
6907 2001-03-30 Werner Koch <wk@gnupg.org>
6909 * debug.c (debug_init): Allow to specify a debug file.
6910 (_gpgme_debug_level): New.
6912 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6913 (_gpgme_io_select): Debug only with level > 2.
6915 2001-03-15 Werner Koch <wk@gnupg.org>
6917 * rungpg.c: Included time.h.
6919 * key.h: New keyflags for capabilities.
6920 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6921 (keylist_colon_handler): Parse them.
6922 * gpgme.h: New attribute values for capabilties.
6923 * key.c (gpgme_key_get_string_attr): Return them.
6924 (capabilities_to_string): New.
6925 (gpgme_key_get_ulong_attr): Return the global caps.
6927 2001-03-14 Werner Koch <wk@gnupg.org>
6929 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6930 Thanks to Jan Oliver Wagner.
6932 2001-03-13 Werner Koch <wk@gnupg.org>
6934 * context.h: Add invalid and revoke flags to user_id structure.
6935 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6936 (keylist_colon_handler): Adjust for that.
6937 (set_userid_flags): New.
6938 (set_mainkey_trust_info): Handle new key invalid flag
6939 (set_subkey_trust_info): Ditto.
6940 * gpgme.h: Add new attributes for key and user ID flags.
6941 * key.c (_gpgme_key_append_name): Init these flags
6942 (gpgme_key_get_as_xml): Print them.
6943 (one_uid_as_xml): New helper for above.
6944 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6945 Return the new attributes. Enhanced, so that subkey information
6946 can be returned now.
6948 2001-02-28 Werner Koch <wk@gnupg.org>
6950 * w32-io.c (destroy_reader): Set stop_me flag.
6951 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6952 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6953 (_gpgme_io_close): Cleanup a writer thread
6954 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6955 waiting which is now possible due to the use of a writer thread.
6957 2001-02-20 Werner Koch <wk@gnupg.org>
6959 * w32-io.c (destroy_reader,kill_reader): New.
6960 (create_reader, reader): Add a new event to stop the thread.
6961 (_gpgme_io_close): Kill the reader thread.
6963 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6964 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6966 * wait.c: Reworked the whole thing.
6967 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6968 (_gpgme_gpg_release): Remove the process from the wait queue.
6970 2001-02-19 Werner Koch <wk@gnupg.org>
6972 * w32-io.c (_gpgme_io_set_close_notify): New.
6973 (_gpgme_io_close): Do the notification.
6975 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6978 * wait.c (remove_process): Don't close the fd here.
6979 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6980 (_gpgme_wait_on_condition): Remove the assert on the queue and
6981 break out if we could not find the queue. The whole thing should
6984 * posix-io.c (_gpgme_io_set_close_notify): New.
6985 (_gpgme_io_close): Do the notification.
6987 * rungpg.c (close_notify_handler): New.
6988 (_gpgme_gpg_new): Register a callback for the fd.
6989 (_gpgme_gpg_set_colon_line_handler): Ditto.
6992 2001-02-13 Werner Koch <wk@gnupg.org>
6994 * rungpg.c (struct reap_s): Replaced pid_t by int.
6996 * types.h: Add ulong typedef.
6998 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6999 (_gpgme_gpg_release): Reap children.
7000 * io.h, posix-io.c (_gpgme_io_kill): New.
7001 * w32-io.c (_gpgme_io_kill): New (dummy).
7003 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
7005 * posix-io.c (_gpgme_io_read): Add some debug output.
7006 (_gpgme_io_write): Ditto.
7007 (_gpgme_io_select): Increased the timeout.
7009 2001-02-12 Werner Koch <wk@gnupg.org>
7011 Enhanced the signature verification, so that it can how handle
7012 more than one signature and is able to return more information on
7014 * verify.c (gpgme_get_sig_key): New.
7015 (gpgme_get_sig_status): New.
7017 * gpgme.h: Add stdio.h.
7018 (GpgmeSigStat): New status DIFF.
7020 2001-02-01 Werner Koch <wk@gnupg.org>
7022 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
7023 code to all Set/ResetEvent().
7025 * rungpg.c (read_status): Check for end of stream only if we have
7028 2001-01-31 Werner Koch <wk@gnupg.org>
7030 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
7031 (propagate_term_results,clear_active_fds): Removed.
7032 (count_active_fds): Renamed to ..
7033 (count_active_and_thawed_fds): .. this and count only thawed fds.
7035 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
7038 2001-01-30 Werner Koch <wk@gnupg.org>
7040 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
7042 * version.c (get_engine_info): Return better error information.
7044 * posix-util.c, w32-util.c: New.
7045 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
7046 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
7048 * signers.c (gpgme_signers_add): Ooops, one should test code and
7049 not just write it; the newarr was not assigned. Thanks to José
7050 for pointing this out. Hmmm, still not tested, why should a coder
7053 * w32-io.c: Does now use reader threads, so that we can use
7054 WaitForMultipleObjects.
7055 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
7056 Does currently only work for W32.
7058 * debug.c, util.h : New. Changed all fprintfs to use this new
7059 set of debugging functions.
7061 2001-01-23 Werner Koch <wk@gnupg.org>
7063 * data.c (_gpgme_data_release_and_return_string): Fixed string
7066 2001-01-22 Werner Koch <wk@gnupg.org>
7071 * key.c (gpgme_key_ref, gpgme_key_unref): New.
7072 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
7074 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
7075 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
7077 2001-01-05 Werner Koch <wk@gnupg.org>
7079 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
7082 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,
7085 This file is free software; as a special exception the author gives
7086 unlimited permission to copy and/or distribute it, with or without
7087 modifications, as long as this notice is preserved.
7089 This file is distributed in the hope that it will be useful, but
7090 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
7091 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.