1 2010-09-01 Marcus Brinkmann <marcus@g10code.de>
3 * w32-io.c: Revert change from 2009-06-18, as it created a race
6 2010-08-18 Marcus Brinkmann <marcus@g10code.de>
8 * gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
9 * libgpgme.vers: Likewise.
10 * gpgme.h.in (gpgme_error_from_errno): Fix return type to
12 (gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
13 (gpgme_error_from_syserror): New inline function (why are
14 gpgme_err_make_from_errno and gpgme_error_from_errno not inline
16 * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
17 (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
19 2010-08-03 Marcus Brinkmann <marcus@g10code.de>
21 * gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
22 (result_verify_to_xml, result_import_to_xml)
23 (result_genkey_to_xml): Check vigorously for null pointers.
25 * w32-io.c (GPGCEDEV_IOCTL_ASSIGN_RVID): New macro.
26 (_gpgme_io_spawn): Use ASSIGN_RVID.
28 2010-06-11 Marcus Brinkmann <marcus@g10code.de>
30 * w32-io.c (_gpgme_io_spawn): Remove debug printf.
32 2010-06-10 Marcus Brinkmann <marcus@g10code.de>
34 * gpgme-tool.c (gpgme_server): Use special hack for Windows CE to
35 get at stdin and stdout.
37 * engine-gpgsm.c (gpgsm_new): Translate returned achild_fds back
40 * debug.h (TRACE_SUC6): New macro.
41 * w32-io.c (MAX_SLAFD): New macro.
42 (fd_table): New static variable.
43 (new_fd, release_fd): New functions.
44 (fd_to_handle, handle_to_fd, handle_to_socket): Remove macros.
45 (MAX_READERS, MAX_WRITERS): Increase to 64.
46 (notify_table): Increase to MAX_SLAFD.
47 (struct reader_context_s, struct writer_context_s): Add member
49 (reader, writer): Use file_hd vs file_sock to decide if socket
50 operations to use. Remove auto-detect mode.
51 (create_reader, create_writer): Set file_sock. Unblock pending
52 thread only if this is a pipe fd.
53 (_gpgme_io_pipe): Allocate fds from table and return slot indices
54 instead of windows handles. This allows to properly handle RVIDs.
55 (_gpgme_io_close): Handle dup'ed file descriptors.
56 (build_commandline) [HAVE_W32_SYSTEM]: Use RVID from fd table now.
57 (_gpgme_io_spawn): Use fd table now.
58 (_gpgme_io_fd2str): Use RVID from fd table now.
59 (_gpgme_io_dup): Implement using fd table.
60 (_gpgme_io_socket): Allocate fds from table.
61 (_gpgme_io_connect): Use fd from table.
63 * w32-glib-io.c (find_channel): Check that the slot is used.
65 2010-06-09 Marcus Brinkmann <marcus@g10code.de>
67 * w32-io.c [HAVE_W32CE_SYSTEM]: Include assuan.h and winioctl.h.
68 (GPGCEDEV_IOCTL_UNBLOCK) [HAVE_W32CE_SYSTEM]: Define.
69 (set_synchronize) [HAVE_W32CE_SYSTEM]: Stub it out.
70 (is_socket): Allow to return -1 for auto-detect (old behaviour).
71 (is_socket) [HAVE_W32CE_SYSTEM]: Return -1.
72 (reader): Handle auto-detect case. Handle ctx->stop_me before
74 (destroy_reader) [HAVE_W32CE_SYSTEM]: Unblock a pending reader.
75 (writer): Handle auto-detect case. Handle ctx->stop_me with
77 (destroy_writer) [HAVE_W32CE_SYSTEM]: Unblock a pending writer.
78 (_gpgme_io_pipe) [HAVE_W32CE_SYSTEM]: Implement in terms of a
80 (build_commandline) [HAVE_W32CE_SYSTEM]: New function.
81 (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Implement it differently
83 (_gpgme_io_fd2str) [HAVE_W32CE_SYSTEM]: Implement it for RVIDs.
84 (_gpgme_io_dup) [HAVE_W32CE_SYSTEM]: Stub it out.
86 * gpgme-tool.c (result_add_timestamp): Add missing NULL argument.
87 (result_sign_to_xml): Protect against NULL fingerprint.
88 (struct server): New members input_fd, input_filename,
89 input_stream output_fd, output_filename, output_stream,
90 message_filename, message_stream.
91 (server_reset_fds): Deallocate those.
92 (server_parse_fd): New function.
93 (server_data_obj): Take optional filename argument and direction
94 argument. Also take new argument to return a filestream that
95 needs to be closed after destroying the data object.
96 Change all callers, too.
97 (input_notify, output_notify): Removed.
98 (cmd_input, cmd_output): New functions.
99 (gpgme_server): Do not register input and output notifier.
100 (register_commands): Use cmd_input and cmd_output.
101 (cmd_message): Rewritten to use server_parse_fd.
102 (cmd_delete, cmd_keylist): Fix inverted option check.
103 (main) [HAVE_W32CE_SYSTEM]: Sleep a bit to work around bug in ssh.
105 * genkey.c (gpgme_op_genkey): Return err with TRACE_ERR.
107 2010-05-12 Marcus Brinkmann <marcus@g10code.de>
109 * conversion.c (_gpgme_timegm) [HAVE_W32_SYSTEM]: New static
111 (_gpgme_parse_timestamp) [HAVE_W32_SYSTEM]: Use it.
113 * gpgme-tool.c (main): Protect call to setlocale with
116 * Makefile.am (system_components): Remove custom cppflags from
117 RCCOMPILE (because gpg-error adds -idirafter that makes RC bail.
118 [HAVE_W32CE_SYSTEM]: Add w32-ce.h and w32-ce.c, clear
120 * w32-ce.h, w32-ce.c: New files.
122 * priv-io.h: Include <sys/types.h>
125 2010-05-11 Marcus Brinkmann <marcus@g10code.de>
127 * w32-util.c: Include ath.h
128 (HAVE_ALLOW_SET_FOREGROUND_WINDOW) [!HAVE_W32CE_SYSTEM]: Define
130 (RTLD_LAZY, dlopen, dlsym,
131 dlclose) [!HAVE_ALLOW_SET_FORGROUND_WINDOW]: Don't define anymore.
132 (_gpgme_allow_set_foreground_window) [!HAVE_ALLOW_SET_FOREGROUND_WINDOW]:
134 (read_w32_registry_string): Use FooA variants of Windows functions
135 instead of Foo (which dispatches depending on UNICODE).
136 [!HAVE_W32CE_SYSTEM]: Don't check environment.
137 (w32_shgetfolderpath): Remove.
138 (find_program_at_standard_place): Call
139 SHGetSpecialFolderPath (which is available on all Windows systems
140 and also Windows CE).
141 (mkstemp): Use ath_self instead of getpid.
142 (_gpgme_mkstemp): Use GetTempPathA instead of GetTempPath.
144 * gpgme.h.in: Use _WIN32 instead of _MSC_VER. Include time.h for
147 2010-05-07 Marcus Brinkmann <marcus@g10code.de>
149 * engine-g13.c, gpgme.c, engine-gpgsm.c, engine-gpg.c,
150 op-support.c, engine-assuan.c, gpgme-tool.c: Include <locale.h>
151 only if available with HAVE_LOCALE_H and conditionalize use of
152 LC_CTYPE on its definition.
153 * engine-gpgconf.c: Do not include <locale.h>.
155 * engine-gpgsm.c (gpgsm_new, start): Cast between int and
157 * assuan-support.c (my_pipe, my_close, my_read, my_write): Likewise.
158 * gpgme-tool.c (server_data_obj, server_reset_fds, gpgme_server),
159 (my_recvmsg, my_sendmsg, my_spawn): Likewise.
160 * engine-assuan.c (start): Likewise.
161 * engine-g13.c (start): Likewise.
163 2010-05-06 Marcus Brinkmann <marcus@g10code.de>
165 * w32-glib-io.c, w32-io.c, w32-qt-io.cpp, w32-sema.c, w32-util.c:
166 Do not include <signal.h>.
168 * sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c,
169 decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c,
170 data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use
171 gpg_error_from_syserror instead gpg_error_from_errno, and use
172 gpg_err_set_errno to set error number.
173 * setenv.c: Include <gpg-error.h> and define __set_errno to use
175 * gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is
176 mapped in Windows CE) instead of E2BIG (which is not).
177 (gt_import_keys): Initialize err.
179 2010-04-19 Marcus Brinkmann <marcus@g10code.de>
181 * assuan-support.c (my_spawn): Cast to avoid warning.
182 * engine-g13.c (g13_new): Make ARGV array of pointer to const
184 (g13_assuan_simple_command) [!USE_DESCRIPTOR_FUNCTION]: Don't define.
185 * ops.h (_gpgme_key_append_name): Same in prototype.
186 * key.c (_gpgme_key_append_name): Make SRC argument pointer to
188 * posix-util.c (_gpgme_get_uiserver_socket_path): Make HOMEDIR
190 * vfs-mount.c (gpgme_op_vfs_transact_start): Never define this
191 potentially useful but currently unused function.
192 * vfs-create.c (gpgme_op_vfs_transact_start): Likewise.
194 2010-04-16 Werner Koch <wk@g10code.com>
196 * w32-io.c (is_socket): New.
197 (reader, writer): Use it to figure out the API to use.
199 2010-03-15 Werner Koch <wk@g10code.com>
201 * gpgme.h.in: Add autoconf template to set generated file to
202 read-only in an emacs buffer.
204 2010-03-12 Werner Koch <wk@g10code.com>
206 * gpgme.h.in (GPGME_STATUS_SUCCESS): Use the right file for the
209 * passwd.c (op_data_t): New.
210 (passwd_start): Setup OPD.
211 (passwd_status_handler): Return GPG_ERR_NOT_SUPPORTED if needed.
212 * context.h (OPDATA_PASSWD): New.
213 * gpgme.h (GPGME_STATUS_SUCCESS): New.
215 2010-03-09 Werner Koch <wk@g10code.com>
217 * engine-gpgsm.c (gpgsm_keylist): Try to start the agent.
219 2010-02-17 Werner Koch <wk@g10code.com>
221 * posix-io.c (notify_table): Change implementation.
222 (notify_table_item_t, notify_table_size, notify_table_lock): New.
223 (_gpgme_io_close, _gpgme_io_set_close_notify): Adjust for new
226 2010-02-16 Werner Koch <wk@g10code.com>
228 * gpgme-tool.c (spacep, has_option, skip_options): New.
229 (cmd_export): Implement option --minimal.
231 * gpgme.h.in (GPGME_EXPORT_MODE_MINIMAL): New.
232 * export.c (export_start, export_ext_start): Implement it.
233 * engine-gpg.c (export_common): Ditto.
235 2010-01-25 Werner Koch <wk@g10code.com>
237 * w32-io.c (_gpgme_io_connect): Fix return code check to make it work.
239 * version.c (do_subsystem_inits): Remove superfluous second
242 2010-01-22 Werner Koch <wk@g10code.com>
244 * w32-io.c (writer): Try to use send first.
245 (reader): Try to use recv first.
247 2010-01-08 Werner Koch <wk@g10code.com>
249 * engine-gpg.c (gpg_passwd): New.
250 (_gpgme_engine_ops_gpg): Register.
251 * passwd.c (parse_error): New.
252 (passwd_status_handler): Use it.
254 2010-01-07 Marcus Brinkmann <marcus@g10code.de>
256 * gpgme-tool.c (result_xml_write_cb_t, struct result_xml_state):
258 (MAX_TAGS): New macro.
259 (result_init, result_xml_indent, result_xml_tag_start)
260 (result_xml_tag_data, result_xml_tag_end, result_add_error)
261 (result_add_pubkey_algo, result_add_hash_algo, result_add_keyid)
262 (result_add_fpr, result_add_timestamp, result_add_sig_mode)
263 (result_add_value, result_add_string, result_encrypt_to_xml)
264 (result_decrypt_to_xml, result_sign_to_xml)
265 (result_verify_to_xml, result_import_to_xml)
266 (result_genkey_to_xml, result_keylist_to_xml)
267 (result_vfs_mount_to_xml): New functions.
268 (gt_result): Rewritten.
270 2010-01-05 Werner Koch <wk@g10code.com>
272 * gpgme-tool.c (gt_passwd, cmd_passwd): New.
273 (register_commands): Register.
275 * gpgme.h.in (gpgme_op_passwd_start, gpgme_op_passwd): New.
276 * libgpgme.vers, gpgme.def: Add new functions.
278 * Makefile.am (main_sources): Add passwd.c
279 * engine.c, engine.h (_gpgme_engine_op_passwd): New.
280 * engine-backend.h (struct engine_ops): Add PASSWD.
281 * engine-gpgsm.c (gpgsm_passwd): New.
282 (_gpgme_engine_ops_gpgsm): Register.
283 (gpgsm_reset): Reset only if we have a conenction.
285 * gpgme.h.in (GPGME_PK_ECDSA, GPGME_PK_ECDH): New.
286 * gpgme.c (gpgme_pubkey_algo_name): Add them.
288 2009-12-22 Marcus Brinkmann <marcus@g10code.de>
290 * debug.c: Test for TLS, not __GNUC__
292 2009-12-15 Marcus Brinkmann <marcus@g10code.de>
294 * assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
296 2009-12-10 Werner Koch <wk@g10code.com>
298 * debug.c (debug_init): Test on sgid process.
300 2009-12-08 Marcus Brinkmann <marcus@g10code.de>
302 * Makefile.am (LTRCCOMPILE): Refactor with ...
303 (RCCOMPILE): ... this new macro.
305 (gpgme_res_ldflag): Removed.
306 (gpgme_res): Use libtool object file name here.
307 (libgpgme_la_LDFLAGS): Remove gpgme_res_ldflag usage.
308 (libgpgme_la_LIBADD): Add gpgme_res.
310 * ath.c (ath_self) [HAVE_W32_SYSTEM]: Fix typo.
312 2009-12-02 Werner Koch <wk@g10code.com>
314 * gpgconf.c (gpgme_conf_arg_release): No return in a function
315 returning void. Reported by Wyllys Ingersoll.
317 2009-12-01 Werner Koch <wk@g10code.com>
319 * gpgme-tool.c (cmd_getauditlog): Add flag --html.
320 (hlp_getauditlog): New.
322 * gpgme-tool.c (GT_GCC_A_SENTINEL, GT_GCC_A_PRINTF): New.
323 (gt_write_status): Use sentinel.
324 (argp_error, log_error): Use printf attribute.
325 (argp_parse): Remove extra argument to argp_error.
326 (_gt_progress_cb, gt_get_engine_info, gt_get_keylist_mode)
327 (gt_result): Add NULL arg.
329 2009-11-26 Marcus Brinkmann <marcus@g10code.de>
331 * opassuan.c (opassuan_start): Allocate result structure before
334 2009-11-25 Marcus Brinkmann <marcus@g10code.de>
336 * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen
339 2009-11-13 <wk@g10code.com>
341 * sign.c (_gpgme_sign_status_handler): Handle SIG_CREATED_SEEN.
342 * engine-uiserver.c (uiserver_sign): Make sending SENDER optional.
344 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
346 * op-support.c (_gpgme_op_reset): Instead of last change, only set
347 sub protocol if it is not the default.
349 2009-11-10 Werner Koch <wk@g10code.com>
351 * op-support.c (_gpgme_op_reset): Ignore GPG_ERR_NOT_IMPLEMENTED
352 while setting the sub protocol.
354 * engine-uiserver.c (uiserver_new): Pass fdpassing flag to
355 assuan_socket_connect.
356 (set_recipients): Replace fingerprint by user id.
358 * engine-gpgsm.c (set_recipients): Fix non-terminating loop in
359 case of a missing key.
361 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
363 * gpgme.c (gpgme_new): Set default sub protocol.
364 * gpgme-tool.c: Implement get sub protocol.
366 * gpgme.h.in (gpgme_get_sub_protocol): Add prototype.
367 * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol.
368 * context.h (struct gpgme_context): New member sub_protocol.
369 * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol.
370 (gpgme_get_sub_protocol): New function.
371 * op-support.c (_gpgme_op_reset): Set sub protocol.
373 * Makefile.am (uiserver_components): New variable.
374 (main_sources): Add it.
375 * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
376 implement it. Adjust callers.
377 (gpgme_key_from_uid): New function.
378 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT.
379 (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE,
380 GPGME_ENCRYPT_EXPECT_SIGN.
381 (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions.
382 * libgpgme.vers, gpgme.def: Add new functions.
383 * gpgme.c (gpgme_set_protocol): Add UIServer protocol.
384 (gpgme_set_sub_protocol): New function.
385 (gpgme_get_protocol_name): Add UIServer and default protocol.
386 * assuan-support.c: Return correct error values, implement
387 socketpair for POSIX.
388 * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c,
389 w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE
390 arguments. Implement it for POSIX. Adjust all callers.
391 * engine.h, engine-backend.h (_gpgme_engine_set_protocol)
392 (_gpgme_engine_op_decrypt_verify): New prototypes. Adjust all
394 * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer
396 (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New
398 * decrypt-verify.c (decrypt_verify_start): Call
399 _gpgme_engine_op_decrypt_verify.
400 * util.h, posix-util.c,
401 w32-util.c (_gpgme_get_uiserver_socket_path): New function.
402 * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation.
403 * gpgme-tool.c: Some support for UIServer protocol.
404 * engine-uiserver.c: New file.
406 2009-11-09 Marcus Brinkmann <marcus@g10code.de>
408 * engine-gpgsm.c (gpgsm_new): Close server side FDs.
410 2009-11-06 Marcus Brinkmann <marcus@g10code.de>
412 * gpgme-tool.c (struct gpgme_tool): New members write_data and
414 (gt_write_data): New function.
415 (gt_result): Output vfs_mount result.
416 (server_write_data): New function.
417 (gpgme_server): Initialize write_data members.
419 2009-11-05 Marcus Brinkmann <marcus@g10code.de>
421 * engine-g13.c (struct engine_g13): Remove members RESULT_CB and
423 (g13_assuan_simple_command, status_handler): Don't use those anymore.
424 (g13_transact): Remove them from argument list, too.
425 * vfs-mount.c (_gpgme_vfs_mount_status_handler): New function.
426 (_gpgme_op_vfs_mount): Pass it to transact.
428 * engine-assuan.c (llass_new): Update use of assuan_socket_connect.
429 * engine-gpgsm.c (gpgsm_new): Update use of assuan_pipe_connect.
430 * engine-g13.c (g13_new): Likewise.
432 * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
433 * w32-io.c (_gpgme_io_spawn): Implement this flag.
434 * posix-io.c (_gpgme_io_spawn): Likewise.
435 * w32-glib-io.c (_gpgme_io_spawn): Likewise.
436 * assuan-support.c (my_spawn): Set this flag.
438 * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
439 * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
440 * delete.c (gpgme_op_delete_start): Likewise.
441 * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start):
443 * encrypt.c (gpgme_op_encrypt_start): Likewise.
444 * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise.
445 * export.c (gpgme_op_export_start, gpgme_op_export_ext_start)
446 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
447 * genkey.c (gpgme_op_genkey_start): Likewise.
448 * getauditlog.c (gpgme_op_getauditlog_start): Likewise.
449 * import.c (gpgme_op_import_start, gpgme_op_import_keys_start):
451 * opassuan.c (gpgme_op_assuan_transact_start): Likewise.
452 * sign.c (gpgme_op_sign_start): Likewise.
453 * verify.c (gpgme_op_verify_start): Likewise.
454 * vfs-create.c (gpgme_op_vfs_create): Likewise.
455 * vfs-mount.c (gpgme_op_vfs_mount): Likewise.
457 2009-11-04 Marcus Brinkmann <marcus@g10code.de>
459 * ath.h (ath_self): New prototype. Include <stdint.h>
460 * ath.c, ath-pth.c, ath-pthread.c (ath_self): New function.
461 * debug.h: Rewrite most macros to beautify debug output.
462 (_gpgme_debug_buffer): Remove tagname and tag argument.
463 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New prototypes.
464 * debug.c: Include <time.h>. Don't include assuan.h.
465 (frame_nr, FRAME_NR): New thread-specific variable and macro.
466 (debug_init): Do not initialize assuan. Call _gpgme_debug after
467 initialization instead using printf directly.
468 (_gpgme_debug): Do not call debug_init (we now ensure proper
469 initialization by user). Add timestamp and thread/process ID.
470 (_gpgme_debug_buffer): Do not take tagname and tag argument.
471 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New functions.
472 * version.c (gpgme_check_version_internal, gpgme_check_version):
473 Fix debug string. Do not initialize assuan.
474 * posix-io.c (get_max_fds): Use 0 not NULL (nicer debug output).
476 2009-11-04 Werner Koch <wk@g10code.com>
478 * gpgme-tool.c (register_commands): Add HELP feature.
480 2009-11-03 Werner Koch <wk@g10code.com>
482 * gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
484 2009-11-03 Marcus Brinkmann <marcus@g10code.de>
486 * Makefile.am (main_sources): Change g13.c to vfs-mount.c. Add
488 * vfs-create.c: New file.
489 * g13.c: Renamed to ...
490 * vfs-mount.c: ... this new file.
491 * gpgme.h.in (gpgme_op_vfs_create): New prototype.
492 * gpgme.def, libgpgme.vers: Add gpgme_op_vfs_create.
493 * gpgme-tool.c (gt_vfs_create, cmd_vfs_create): New functions.
494 (register_commands): Add VFS_CREATE and CREAET.
496 2009-11-02 Marcus Brinkmann <marcus@g10code.de>
498 * debug.h (_gpgme_debug_buffer): Make TAG argument const const.
499 * debug.c (_gpgme_debug_buffer): Likewise.
500 * gpgme-tool.c (input_notify, output_notify): Adjust type to new
502 * decrypt.c (gpgme_op_decrypt_result): Remove unused variable.
503 * opassuan.c (gpgme_op_assuan_transact): Fix return value.
505 2009-10-30 Marcus Brinkmann <marcus@g10code.de>
507 * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
508 (gpgme_tool_LDADD): New variable.
509 * gpgme-tool.c: New file.
510 * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
512 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
513 had that gone missing?).
514 (_gpgme_sig_notation_clear): New function without debug output.
515 (gpgme_release): Call it and _gpgme_signers_clear.
516 * signers.c (_gpgme_signers_clear): New function without debug output.
517 * g13.c (gpgme_op_vfs_mount): Add debug output.
518 * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
519 * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
520 * debug.h: Put tag in front of debug lines, should make for nicer
522 * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
523 * engine-g13.c (g13_new): Remove redundant assuan context allocation.
524 * version.c (gpgme_check_version_internal): Delay debug output
525 until after gpgme_check_version was called.
527 2009-10-28 Marcus Brinkmann <marcus@g10code.de>
529 * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
530 edit.c, import.c, export.c: Fix last change in debug output.
532 2009-10-27 Marcus Brinkmann <marcus@g10code.de>
534 * edit.c (gpgme_op_edit_start, gpgme_op_edit)
535 (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
536 * encrypt-sign.c (gpgme_op_encrypt_sign_start)
537 (gpgme_op_encrypt_sign): Likewise.
538 * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
539 (gpgme_op_encrypt_result): Likewise.
540 * export.c (gpgme_op_export_start, gpgme_op_export)
541 (gpgme_op_export_ext_start, gpgme_op_export_ext)
542 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
543 * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
544 (gpgme_op_genkey_result): Likewise.
545 * getauditlog.c (gpgme_op_getauditlog_start)
546 (gpgme_op_getauditlog): Likewise.
547 * import.c (gpgme_op_import_result, gpgme_op_import_start)
548 (gpgme_op_import): Likewise.
549 * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
550 (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
551 (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
552 * opassuan.c (gpgme_op_assuan_transact_start)
553 (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
554 (gpgme_op_assuan_transact): Likewise.
555 * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
556 * trustlist.c (gpgme_op_trustlist_start)
557 (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
558 * verify.c (gpgme_op_verify_start, gpgme_op_verify)
559 (gpgme_op_verify_result): Likewise.
561 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
563 * gpgme.h.in (struct gpgme_io_event_done_data)
564 (gpgme_io_event_done_data_t): New types.
565 (struct _gpgme_op_assuan_result): Deprecate the err member.
566 (gpgme_op_assuan_result): Deprecate (for now).
567 (gpgme_op_assuan_transact_ext): New prototype.
568 (gpgme_op_assuan_transact): Deprecate.
569 (struct _gpgme_op_g13_result): Replace with ...
570 (struct _gpgme_op_vfs_mount_result): ... this.
571 (gpgme_op_g13_mount): Replace with ...
572 (gpgme_op_vfs_mount): ... this.
573 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
574 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
575 (gpgme_op_g13_mount): Remove.
576 * libgpgme.vers: Likewise.
577 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
578 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
580 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
582 (_gpgme_wait_one_ext): New prototype.
583 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
584 * engine-g13.c (g13_cancel_op): New function.
585 (parse_status): Remove declaration.
586 (g13_assuan_simple_command): Do nothing with status lines for now.
587 (status_handler): Update opaque value access.
588 (_gpgme_engine_ops_g13): Add new cancel_op member.
589 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
590 Handle operational errors.
591 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
592 * data.c (_gpgme_data_inbound_handler)
593 (_gpgme_data_outbound_handler): Adjust opaque value access.
594 * engine-gpg.c (command_handler, status_handler)
595 (colon_line_handler): Likewise.
596 * engine-gpgsm.c (status_handler): Likewise.
597 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
598 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
599 * g13.c: Rewritten (and will be rewritten again).
600 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
601 and result_cb_value parameters from prototype.
602 (_gpgme_engine_cancel_op): New prototype.
603 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
604 (_gpgme_engine_op_assuan_transact): Remove result_cb and
605 result_cb_value parameter.
606 (_gpgme_engine_cancel_op): New function.
607 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
608 (struct io_cb_data): New struct to pass opaque data and get a
609 op_err return value. Needed because we can't modify I/O callback
610 handler signature because it is exposed to the user.
611 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
613 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
615 * wait-private.c (_gpgme_wait_on_condition): New argument to
616 retrieve the operational result. Handle operational errors in
617 session based protocols.
618 (_gpgme_wait_one_ext): New function.
619 (_gpgme_wait_one): Pass argument in invocation of
620 _gpgme_wait_on_condition.
621 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
622 (ctx_done): New argument OP_ERR.
623 (ctx_wait): New argument OP_ERR.
624 (gpgme_wait_ext): New function based on gpgme_wait but handling
626 (gpgme_wait): Implement in term of gpgme_wait_ext.
627 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
628 of _gpgme_wait_on_condition.
629 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
630 invocation of _gpgme_wait_on_condition.
631 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
632 and RESULT_CB_VALUE by LAST_OP_ERR.
633 (_gpgme_engine_assuan_last_op_err): Add this hack function.
634 (llass_cancel_op): New function.
635 (_gpgme_engine_llass_ops): Add cancel_op member.
636 (llass_status_handler): Update opaque value access.
637 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
638 * opassuan.c: Move compat hacks to the end of file.
639 (opassuan_start): Do not set OPD->result.err.
640 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
641 (gpgme_op_assuan_transact_ext): New function.
643 * debug.h (DEBUG_GLOBAL): New debug level.
644 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
645 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
646 * data-fd.c (gpgme_data_new_from_fd): Likewise.
647 * data-stream.c (gpgme_data_new_from_stream): Likewise.
648 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
649 (gpgme_op_decrypt): Likewise.
650 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
651 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
652 (gpgme_op_decrypt_verify): Likewise.
653 * sign.c (gpgme_op_sign_result): Fix debug message.
654 * data-mem.c (gpgme_data_new): Improve debug output.
655 * verify.c (parse_trust): Use atoi instead of
656 _gpgme_map_gnupg_error.
657 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
659 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
661 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
662 (g13_components): New variable.
663 (main_sources): Add $(g13_components).
664 * g13.c, engine-g13.c: New files.
665 * engine.c (engine_ops): Check for assuan for assuan engine, add
667 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
669 * conversion.c (_gpgme_encode_percent_string): New function.
670 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
671 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
672 (gpgme_op_g13_mount): New function.
673 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
674 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
675 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
676 * posix-util.c (_gpgme_get_g13_path): New function.
677 * w32-util.c (_gpgme_get_g13_path): New function.
678 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
680 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
682 * gpgme-config.in (netlibs): Remove.
683 (assuan_cflags, assuan_libs): Add.
685 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
686 (gpgsm_components): Move engine-assuan.c to ...
687 (assuan_components): ... this new variable.
688 (main_sources): Add this new variable.
689 (AM_CPPFLAGS): Remove $(assuan_cppflags).
690 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
691 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
692 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
693 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
694 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
695 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
696 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
698 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
699 _gpgme_io_sendmsg, _gpgme_io_waitpid.
700 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
702 * posix-io.c (_gpgme_io_waitpid): Make non-static.
703 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
704 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
705 * engine-gpgsm.c: Don't map assuan error codes. Use
706 assuan_release instead of assuan_disconnect.
707 (map_assuan_error): Remove function.
708 (gpgsm_new): Use new assuan context interface.
709 * engine-assuan.c: Use assuan_release instead of
711 (llass_new): Use new assuan context interface.
713 2009-10-07 <wk@g10code.com>
715 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
717 2009-08-06 Werner Koch <wk@g10code.com>
719 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
721 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
723 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
724 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
725 (_gpgme_op_sign_init_result): Factor code out to ...
726 (sign_init_result): .. new. Init new fields.
727 (sign_start): Use sign_init_result.
728 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
729 Return an error if no signature has been created.
731 2009-07-07 Werner Koch <wk@g10code.com>
733 * engine-gpgsm.c (struct engine_gpgsm): Add fields
734 input_helper_data and input_helper_memory.
735 (close_notify_handler): Release these new fields.
736 (gpgsm_import): Implement the keyarray feature.
738 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
740 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
743 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
745 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
746 [HAVE_STDINT_H]: Include <stdint.h>.
747 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
748 to (uintptr_t) before casting it to (void*) to silence GCC
751 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
752 * sign.c (_GPGME_IN_GPGME): Define it.
753 * keylist.c (_GPGME_IN_GPGME): Define it.
755 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
756 vasprintf and asprintf.
758 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
760 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
762 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
763 back! (GPA still uses it...).
765 * gpgme.def: Fix stupid typo.
766 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
768 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
770 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
772 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
773 (_gpgme_io_dup): Never allocate threads here.
774 (find_writer, find_reader): Check return value of thread creation
777 * context.h (CTX_OP_DATA_MAGIC): New macro.
778 (struct ctx_op_data): New member MAGIC.
779 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
780 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
782 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
784 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
786 * gpgme.c (result_ref_lock): New global variable.
787 (gpgme_result_ref, gpgme_result_unref): use it.
789 2009-06-16 Werner Koch <wk@g10code.com>
791 * version.c: Include stdlib.h.
793 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
794 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
795 * data.c (gpgme_data_set_encoding): Adjust for new values.
796 * engine-gpg.c (string_from_data): New.
797 (gpg_import): Implement --fetch-key feature.
799 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
800 * gpgme.def, libgpgme.vers: Add them.
801 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
802 (export_keys_start): New.
804 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
805 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
806 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
808 * export.c (gpgme_export_ext_start, gpgme_op_export)
809 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
810 (export_start): Ditto.
811 * engine.c (_gpgme_engine_op_export): Ditto.
812 * engine-backend.h (struct engine_ops): Ditto.
813 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
814 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
816 (gpg_export, gpg_export_ext): Factor common code out to ..
817 (export_common): .. this.
819 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
820 * gpgme.def, libgpgme.vers: Add them.
821 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
822 (_gpgme_op_import_keys_start): New.
823 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
824 * engine-backend.h (struct engine_ops): Ditto.
825 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
826 * engine-gpg.c (gpg_import): Ditto. Implement it.
828 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
830 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
832 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
834 * context.h (struct ctx_op_data): Add member "references".
835 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
836 (_gpgme_release_result): Use gpgme_result_unref.
837 * op-support.c (_gpgme_op_data_lookup): Initialize references.
839 2009-06-12 Werner Koch <wk@g10code.com>
841 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
842 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
843 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
844 (main): Pass flags for my_spawn.
845 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
847 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
848 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
849 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
850 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
851 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
852 * engine-gpg.c (start): Call spawn with new flag.
854 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
855 _gpgme_allow_set_foreground_window. Change all callers.
856 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
858 2009-06-10 Werner Koch <wk@g10code.com>
860 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
862 2009-06-09 Werner Koch <wk@g10code.com>
864 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
866 * version.c (gpgme_check_version_internal): Make result const.
868 * gpgme.c: Include priv-io.h.
869 (gpgme_io_read, gpgme_io_write): New.
870 * libgpgme.vers (GPGME_1.1): Add them.
873 * Makefile.am (main_sources): Remove gpgme.h.
874 (include_HEADERS): Rename to nodist_include_HEADERS so that a
875 VPATH build won't use the distributed one.
877 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
879 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
881 * gpgme.h.in (gpgme_check_version_internal): New prototype.
882 (gpgme_check_version): New macro, overriding function of the same
884 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
885 * context.h (_gpgme_selftest): New variable declaration.
886 * version.c: Include "context.h".
887 (gpgme_check_version): Set _gpgme_selftest on success.
888 (gpgme_check_version_internal): New function.
889 * gpgme.c (_gpgme_selftest): Define it.
890 (gpgme_new): Check the selftest result.
892 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
894 * gpgme.h.in (gpgme_encrypt_flags_t): Add
895 GPGME_ENCRYPT_NO_ENCRYPT_TO.
896 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
897 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
899 2009-05-14 Werner Koch <wk@g10code.com>
901 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
902 better maintainability and to help debugging.
904 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
906 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
908 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
910 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
911 * w32-io.c (_gpgme_io_connect): Fix stupid error.
913 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
915 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
916 (find_channel): Drop CREATE argument.
917 (new_dummy_channel_from_fd, new_channel_from_fd)
918 (new_channel_from_socket): New functions.
919 (_gpgm_io_fd2str): Implement for sockets.
920 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
922 (_gpgme_io_pipe): Fix for new channel bookkeeping.
923 (_gpgme_io_close, _gpgme_io_dup): Likewise.
924 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
925 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
926 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
927 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
928 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
929 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
930 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
932 2009-03-18 Werner Koch <wk@g10code.com>
934 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
935 * engine-gpgsm.c (gpgsm_keylist): Send new option.
937 2009-03-13 Werner Koch <wk@g10code.com>
939 * gpgme-config.in: Make sure locale is set to C.
941 2009-02-24 Werner Koch <wk@g10code.com>
943 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
944 (gpgme_assuan_result_t): New.
945 (gpgme_op_assuan_result): Change return type.
946 (struct _gpgme_assuan_sendfnc_ctx)
947 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
948 (gpgme_assuan_inquire_cb_t): Changed.
949 * opassuan.c (op_data_t): Make use of a result structure.
950 (gpgme_op_assuan_result): Change return type.
951 (opassuan_start): Use result structure.
953 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
954 (inquire_cb_sendfnc): Remove.
955 (inquire_cb): Change for new callback scheme. Not yet finished.
956 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
958 2009-02-04 Werner Koch <wk@g10code.com>
960 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
962 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
964 2009-02-03 Werner Koch <wk@g10code.com>
966 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
968 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
969 * keylist.c (keylist_colon_handler): Factor common code out to ...
970 (parse_sec_field15): New. Set card number.
972 2009-01-26 Werner Koch <wk@g10code.com>
974 * opassuan.c, dirinfo.c, engine-assuan.c: New.
975 * Makefile.am: Add them.
976 * engine-backend.h: Add _gpgme_engine_ops_assuan.
977 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
979 * Makefile.am (gpgsm_components): Add engine-assuan.c.
980 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
981 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
982 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
983 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
984 * gpgme.c (gpgme_get_protocol_name): Ditto.
985 (gpgme_set_protocol): Support it.
986 * engine.c (gpgme_get_engine_info): Ditto.
987 (engine_ops): Register it.
988 (_gpgme_engine_op_assuan_transact): New.
989 * libgpgme.vers (gpgme_op_assuan_transact_start)
990 (gpgme_op_assuan_transact): New.
991 * gpgme.def (gpgme_op_assuan_transact_start)
992 (gpgme_op_assuan_transact): New.
993 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
994 initialize to NULL for all engines.
995 * engine.c (engine_get_home_dir): New.
996 (gpgme_get_engine_info): Use it.
997 (_gpgme_set_engine_info): Use it.
998 * engine.h (engine_assuan_result_cb_t): New.
999 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
1001 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
1003 * version.c (gpgme_check_version): Protect trace arg against NULL.
1005 2009-01-19 Werner Koch <wk@g10code.com>
1007 * rungpg.c: Rename to engine-gpg.c
1008 * Makefile.am (main_sources): Ditto.
1010 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
1012 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
1014 2008-11-18 Werner Koch <wk@g10code.com>
1016 * version.c (do_subsystem_inits): Always initialize I/O
1017 subsystem. Fixes regression from 2007-08-02.
1019 * decrypt.c (_gpgme_decrypt_status_handler): Use
1020 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
1022 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
1024 * wait-private.c (_gpgme_wait_on_condition): Remove unused
1026 * wait-global.c: Include ops.h to silence gcc warning.
1027 (_gpgme_wait_global_event_cb): Pass error value directly.
1028 * wait-user.c: Include ops.h to silence gcc warning.
1030 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
1031 silence gcc warning. Cast argument to execv to silence warning.
1032 * w32-io.c (_gpgme_io_spawn): Likewise.
1033 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
1035 2008-10-24 Werner Koch <wk@g10code.com>
1037 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
1039 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
1041 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
1042 string to C coded string.
1044 2008-10-20 Werner Koch <wk@g10code.com>
1046 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
1048 * gpgme.h: Rename to gpgme.h.in.
1049 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
1051 * posix-io.c: Include sys/uio.h. Fixes bug #818.
1053 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
1055 * w32-util.c (find_program_in_registry): Don't define.
1056 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
1057 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
1058 registry anymore. It is now no longer possible to overwrite the
1059 default location in that way.
1061 2008-10-17 Werner Koch <wk@g10code.com>
1063 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
1064 around a bug in mingw32.
1066 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
1068 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
1069 Submitted by "Daniel Mueller" <daniel@danm.de>
1071 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
1073 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
1075 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
1077 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
1078 * gpgme.c (_gpgme_cancel_with_err): New function.
1079 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
1080 * wait-private.c (_gpgme_wait_on_condition): Use
1081 _gpgme_cancel_with_err.
1082 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1083 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
1085 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
1087 * rungpg.c (command_handler): Remove I/O callback on error, too.
1089 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
1091 * gpgme.c (gpgme_cancel_async): Remove unused variable.
1093 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
1095 * libgpgme.vers: Add gpgme_cancel_async.
1096 * gpgme.def: Likewise.
1098 * context.h: Include "sema.h".
1099 (struct gpgme_context): New members lock and canceled.
1100 * gpgme.c (gpgme_new): Initialize lock.
1101 (gpgme_release): Destroy lock.
1102 (gpgme_cancel_async): New function.
1103 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
1104 * wait-global.c (gpgme_wait): Check cancel flag before processing
1106 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1107 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1109 2008-06-26 Werner Koch <wk@g10code.com>
1111 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
1112 (mkstemp): Need to use GetSystemTimeAsFileTime for better
1115 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
1117 * gpgme-w32spawn.c: New file.
1118 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
1119 with gpgme-w32spawn.
1120 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
1121 (gpgsm_set_locale): Return early if locale value is NULL.
1122 * util.h (_gpgme_mkstemp)
1123 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
1125 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
1126 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
1128 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
1129 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
1130 special filename FD rather than stdin.
1131 (struct arg_and_data_s): Add member ARG_LOCP.
1132 (struct fd_data_map_s): Add member ARG_LOC.
1133 (struct engine_gpg): Add member ARG_LOC to status and colon.
1134 (_add_arg, add_arg_with_locp): New function.
1135 (add_arg_ext): Reimplement in terms of _add_arg.
1136 (gpg_new): Remember argument location for status FD.
1137 (build_argv): Set argument location if requested. Also set
1138 argument location of fd_data_map for data items.
1139 (start): Adjust caller of _gpgme_io_spawn.
1140 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
1142 (_gpgme_io_spawn): Remove parent fd list argument.
1143 * posix-io.c (get_max_fds): New function.
1144 (_gpgme_io_dup): Add tracing.
1145 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
1146 fd list to contain all child fds that should be inherited. Close
1147 all other file descriptors after fork.
1148 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
1149 parent fd list. Change meaning of child fd list to contain all
1150 child fds that should be inherited. Do not inherit any file
1151 descriptors, but DuplicateHandle them. Spawn process through
1152 wrapper process. Provide wrapper process with a temporary file
1153 containing handle translation data. Return translated handle
1155 * w32-io.c (reader): Add more tracing output.
1156 (_gpgme_io_read): Likewise.
1157 * engine-gpgconf.c (gpgconf_read): Adjust caller of
1159 * version.c (_gpgme_get_program_version): Likewise.
1161 2008-06-20 Werner Koch <wk@g10code.com>
1163 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
1164 compatibility with old compilers. Fix amount of memmove. Fix
1167 2008-06-19 Werner Koch <wk@g10code.com>
1169 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
1170 change all callers and provide compatibilty macro.
1171 (gpgme_conf_type_t): Add complex types 34..37.
1172 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
1173 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
1175 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
1177 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
1179 2008-05-09 Werner Koch <wk@g10code.com>
1181 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
1184 2008-05-07 Werner Koch <wk@g10code.com>
1186 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
1187 self-explaining string. Needs a proper fix, though.
1189 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
1191 (gpg_build_keylist_options): .. new. Allow combination of extern
1193 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
1195 2008-05-06 Werner Koch <wk@g10code.com>
1197 * version.c (extract_version_string): New.
1198 (_gpgme_get_program_version): Use it to allow for suffixes in the
1201 2008-04-28 Werner Koch <wk@g10code.com>
1203 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
1206 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
1208 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
1209 Osterfeld, implement blocking select.
1211 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
1213 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
1215 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
1217 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
1218 Reported by Marc Mutz.
1220 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
1222 * decrypt.c (release_op_data): Release OPD->result.recipients.
1223 * encrypt.c (release_op_data): Release invalid_recipient.
1225 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
1227 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
1229 2008-02-14 Werner Koch <wk@g10code.com>
1231 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
1232 * posix-io.c (_gpgme_io_spawn): Ditto.
1233 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1234 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1235 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
1236 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
1238 * w32-util.c (_gpgme_allow_set_foregound_window): New.
1239 * posix-util.c (_gpgme_allow_set_foregound_window): New.
1240 * engine-gpgsm.c (default_inq_cb): New.
1241 (gpgsm_new) [W32]: Enable pinentry notifications.
1242 (status_handler): Handle inquiries.
1244 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
1246 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
1249 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
1251 * engine-gpgsm.c (map_input_enc): Rename to ...
1252 (map_data_enc): ... this. Also change all callers.
1253 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
1254 (gpgsm_sign): Set encoding for output.
1256 2008-01-28 Werner Koch <wk@g10code.com>
1258 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
1260 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
1262 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
1265 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
1267 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1269 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
1272 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
1274 * Makefile.am (gpgconf_components): New variable.
1275 (main_sources): Add gpgconf.c.
1276 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
1277 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
1278 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
1279 (gpgme_conf_arg_release, gpgme_conf_opt_change)
1280 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
1282 * gpgconf.c, engine-gpgconf.c: New files.
1283 * engine.h: (_gpgme_engine_op_conf_load,
1284 (_gpgme_engine_op_conf_save): New prototypes.
1285 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
1287 * posix-util.c (_gpgme_get_gpgconf_path): New function.
1288 * w32-util.c (_gpgme_get_gpgconf_path): New function.
1290 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
1292 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
1293 * gpgme.def: Add new gpgconf related interfaces.
1294 * libgpgme.vers: Likewise.
1295 * util.h (_gpgme_get_gpgconf_path): New prototype.
1296 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
1297 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
1298 (struct engine_ops): Add members for conf_load and conf_save.
1299 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
1300 (_gpgme_engine_op_conf_load,
1301 (_gpgme_engine_op_conf_save): New functions.
1302 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
1304 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
1306 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
1307 for installation directory. Remove old fallback default.
1308 (find_program_in_inst_dir): New function.
1310 2007-11-26 Werner Koch <wk@g10code.com>
1312 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
1313 always reset it before calling start.
1314 (gpgsm_new): Clear it.
1315 (status_handler): Implement it.
1316 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
1318 2007-11-23 Werner Koch <wk@g10code.com>
1320 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
1321 * getauditlog.c (getauditlog_start): Use that flag.
1323 2007-11-22 Werner Koch <wk@g10code.com>
1325 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
1326 * libgpgme.vers: Ditto.
1328 * getauditlog.c: New.
1329 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
1330 * engine-gpgsm.c (gpgsm_getauditlog): New.
1331 (_gpgme_engine_ops_gpgsm): Insert new function.
1332 (gpgsm_new): Try to enable audit log support.
1333 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
1335 2007-11-20 Werner Koch <wk@g10code.com>
1337 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
1339 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
1341 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1343 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
1345 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1347 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
1349 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
1352 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
1354 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
1357 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
1359 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
1360 w32-qt-io.cpp: New versions from Frank Osterfeld.
1362 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
1364 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
1365 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
1366 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
1367 Submitted by Frank Osterfeld.
1369 * priv-io.h, engine-gpgsm.c: Add comments.
1370 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
1371 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
1372 even if not primary.
1373 (_gpgme_io_dup): Acquire a reference. Replace unused
1374 implementation by assertion.
1376 2007-09-28 Werner Koch <wk@g10code.com>
1378 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
1379 (gpgsm_new): Set it.
1380 (gpgsm_set_fd): Use it.
1382 * w32-glib-io.c (find_channel): Add a new primary flag.
1383 (_gpgme_io_close): Close channel only if primary.
1384 (_gpgme_io_dup): Put newfd into the table as shallow copy.
1386 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
1387 * w32-io.c (_gpgme_io_select): Ditto.
1388 * w32-glib-io.c (_gpgme_io_select): Ditto.
1390 * posix-io.c (_gpgme_io_select): Ditto.
1391 * rungpg.c (read_status): Ditto.
1392 * wait.c (fd_table_put): Ditto.
1394 * rungpg.c (gpg_io_event): Add tracing.
1395 (start): Use gpg_io_event for sending the start event.
1396 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
1397 (start): Use gpgsm_io_event for sending the start event.
1398 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
1400 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
1402 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
1403 versions from Frank Osterfeld.
1405 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
1407 * w32-glib-io.c (_gpgme_io_spawn),
1408 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
1409 the process handle, return 0.
1411 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
1412 * gpgme.c (gpgme_get_protocol_name): Implement support for
1413 GPGME_PROTOCOL_UNKNOWN.
1415 * kdpipeiodevice.h: Fix last change.
1417 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
1418 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
1421 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
1423 * conversion.c, keylist.c: Include <sys/types.h>.
1425 * kdpipeiodevice.h: Use namespace _gpgme_.
1426 * kdpipeiodevice.cpp: Use namespace _gpgme_.
1427 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
1428 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
1429 _gpgme_::KDPipeIODevice.
1431 2007-09-17 Werner Koch <wk@g10code.com>
1433 * rungpg.c (gpg_new): Make robust against undefined ttyname or
1436 2007-09-14 Werner Koch <wk@g10code.com>
1438 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
1440 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
1442 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
1444 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
1446 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
1449 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
1451 * Makefile.am (libgpgme_qt_la_SOURCES): Move
1452 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
1453 another file (it's more like a header file than a cpp file, but
1454 automake doesn't know that).
1456 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
1457 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
1458 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
1460 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
1461 kdpipeiodevice.moc, w32-qt-io.c: New files.
1462 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
1463 (ltlib_gpgme_qt): New variable.
1464 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
1465 (libgpgme_qt_la_SOURCES): New variable.
1466 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
1467 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
1468 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
1469 (libgpgme_qt_la_LIBADD): New variables.
1471 * sema.h (struct critsect_s): Rename "private" to "priv" to make
1472 C++ users happy. Change users.
1473 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
1474 (_gpgme_sema_cs_destroy): Likewise.
1475 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
1476 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
1477 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
1479 (gpgme_get_fdptr): New function.
1480 * w32-io.c (gpgme_get_fdptr): New function
1481 * gpgme.def: Add gpgme_get_fdptr.
1483 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
1485 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
1486 (writer): Remove superfluous check.
1488 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
1490 * gpgme.h: Move include of gpg-error.h out of extern "C".
1492 2007-08-07 Werner Koch <wk@g10code.com>
1494 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
1495 * verify.c (parse_trust): Set Chain_MODEL.
1497 2007-08-02 Werner Koch <wk@g10code.com>
1499 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1500 * w32-io.c (_gpgme_io_spawn): Ditto.
1501 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1502 * debug.c (_gpgme_debug): Enable assuan logging.
1503 (_gpgme_debug_subsystem_init): New.
1504 * version.c (do_subsystem_inits): Disable assuan logging and
1505 initialize the debug system.
1506 (gpgme_check_version): Do not trace before the subsystems are
1509 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
1511 * debug.c: Include <errno.h> and "debug.h".
1512 (_gpgme_debug): Save and restore ERRNO.
1514 (_gpgme_debug_buffer): New function.
1515 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1516 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1517 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
1518 most of these files, add many more tracepoints.
1520 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
1522 * engine-gpgsm.c (status_handler): Do not send BYE here.
1524 * w32-io.c (struct reader_context_s, struct writer_context_s): New
1526 (create_reader, create_writer): Initialize C->refcount to 1.
1527 (destroy_reader, destroy_writer): Only destroy if C->refcount
1529 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1530 * priv-io.h (_gpgme_io_dup): New prototype.
1531 * posix-io.c (_gpgme_io_dup): New function.
1532 * w32-io.c (_gpgme_io_dup): Likewise.
1533 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1534 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1536 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
1538 * data-user.c (user_read, user_write, user_seek): Set errno and
1539 return -1 instead returning the error code directly.
1540 * data-compat.c (old_user_seek): Likewise.
1541 * gpgme.c (gpgme_sig_notation_add): Return error properly.
1543 * Revert the "close_notify_handler" returns int stuff. Always
1544 close in the _gpgme_io_close implementations.
1545 * engine-gpgsm.c (status_handler): Try to terminate the connection
1547 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1548 (_gpgme_io_write): Likewise.
1550 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1551 to _gpgme_close_notify_handler.
1552 (_gpgme_close_notify_handler): New type.
1553 (_gpgme_io_dup): Remove prototype.
1554 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1555 type of HANDLER to _gpgme_close_notify_handler_t.
1556 (_gpgme_io_close): Do not close the FD if handler returns 0.
1557 (_gpgme_io_dup): Remove function.
1558 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1559 _gpgme_io_close): Change type of HANDLER to
1560 _gpgme_close_notify_handler_t.
1561 (_gpgme_io_close): Do not close the FD if handler returns 0.
1562 (_gpgme_io_dup): Remove function.
1563 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1564 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1565 to _gpgme_close_notify_handler_t.
1566 (_gpgme_io_close): Do not close the FD if handler returns 0.
1567 * rungpg.c (close_notify_handler): Change return type to int,
1569 * engine-gpgsm.c (close_notify_handler): Change return type to
1570 int, return 0 for status FD and 1 for all other FDs.
1571 (start): Do not duplicate the status FD.
1573 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1575 * Makefile.am: Replace implicite rule by suffix rule. Add
1578 2007-07-12 Werner Koch <wk@g10code.com>
1580 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1581 system has been started.
1583 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1585 * priv-io.h (_gpgme_io_dup): New prototype.
1586 * posix-io.c (_gpgme_io_dup): New function.
1587 * w32-io.c (_gpgme_io_dup): Likewise.
1588 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1589 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1591 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1593 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1594 * funopen.c (funopen): Rename to _gpgme_funopen.
1596 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1598 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1599 * rungpg.c (gpg_new): Likewise.
1600 Submitted by Stephen Tether.
1602 2007-02-26 Werner Koch <wk@g10code.com>
1604 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1605 (_gpgme_verify_status_handler): Return an error if more than one
1606 plaintext has been seen.
1607 (parse_error): New arg SET_STATUS. Also detect it based on an
1608 ERROR status (gpg > 1.4.6).
1610 2007-01-26 Werner Koch <wk@g10code.com>
1612 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1613 * w32-glib-io.c (build_commandline): Ditto.
1615 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1617 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1619 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1621 * data.h (_gpgme_data_get_fd): Add prototype.
1622 (gpgme_data_get_fd_cb): New type.
1623 (struct _gpgme_data_cbs): New member get_fd.
1624 * data.c (_gpgme_data_get_fd): New function.
1625 * data-fd.c (fd_get_fd): New function.
1626 (fd_cbs): Add fd_get_fd.
1627 * data-stream.c (stream_get_fd): New function.
1628 (stream_cbs): Add stream_get_fd.
1629 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1630 * data-user.c (user_cbs): Likewise.
1631 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1632 short-cut by passing the data descriptor directly.
1634 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1636 * w32-io.c (build_commandline): Quote all command line arguments.
1637 * w32-glib-io.c (build_commandline): Likewise.
1639 2007-01-10 Werner Koch <wk@g10code.com>
1641 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1643 2007-01-08 Werner Koch <wk@g10code.com>
1645 * version.c (do_subsystem_inits): Do assuan init only if building
1647 * setenv.c: Include assuan-def.h only if building with Assuan
1650 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1652 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1653 * rungpg.c (gpg_set_locale): Ditto.
1655 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1657 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1658 switching protocols.
1659 (gpgme_ctx_set_engine_info): Likewise for engine info.
1660 * engine.h (_gpgme_engine_reset): New function prototype.
1661 * engine.c (_gpgme_engine_reset): New function.
1662 * engine-backend.h (struct engine_ops): New member RESET.
1663 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1664 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1665 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1666 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1668 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1669 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1670 function if available.
1671 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1673 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1675 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1676 lc_messages from prototype.
1677 (_gpgme_engine_set_locale): New prototype.
1678 * engine.c (_gpgme_engine_set_locale): New function.
1679 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1680 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1681 Remove arguments lc_messages and lc_ctype from member NEW.
1682 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1683 and lc_messages_set.
1684 (gpgsm_new): Remove lc_messages and lc_ctype
1686 (gpgsm_set_locale): New function.
1687 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1688 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1690 (gpg_release): Release lc_messages and lc_ctype if set.
1691 (gpg_new): Remove lc_messages and lc_ctype arguments.
1692 (gpg_set_locale): New function.
1693 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1694 (add_arg): Implement in terms of:
1695 (add_arg_ext): New function.
1696 (start): Set lc-messages and lc-ctype arguments here.
1698 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1700 * engine-gpgsm.c (struct engine_gpgsm): Move members
1701 input_fd_server, output_fd_server, message_fd_server to ...
1702 (iocb_data): ... here (as server_fd).
1703 (close_notify_handler): Reset tags as well.
1704 (gpgsm_new): Implement support for descriptor
1706 (fd_type_t): New type.
1707 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1708 for unused communication channels.
1709 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1710 relevant callers adjusted as well (previously of _gpgme_io_close).
1712 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1714 * version.c: Include "assuan.h".
1715 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1717 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1719 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1720 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1721 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1723 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1724 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1725 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1726 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1728 (noinst_LTLIBRARIES): Removed.
1729 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1730 (AM_CFLAGS): New variable.
1732 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1734 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1735 ASSUAN_CONTEXT with assuan_context_t.
1737 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1739 * engine-gpgsm.c (gpgsm_new): Check return value of
1740 assuan_pipe_connect.
1742 * rungpg.c: Include <unistd.h>.
1743 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1744 --lc-messages. Fixes issue 734.
1746 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1748 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1751 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1753 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1754 _gpgme_engine_io_event().
1756 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1758 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1760 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1763 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1765 * keylist.c (keylist_colon_handler): Move debug output after
1768 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1770 * gpgme-config.in (Options): Add NETLIBS.
1771 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1772 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1774 * rungpg.c (read_status): Fix comparison disguising as an
1777 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1779 * gpgme.c (gpgme_set_locale): Remove conditional on
1780 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1782 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1784 * rungpg.c (read_status): Strip potential carriage return.
1785 * genkey.c (get_key_parameter): Skip potential carriage return.
1786 * version.c (_gpgme_get_program_version): Strip potential carriage
1789 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1792 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1794 * keylist.c (gpgme_get_key): Also clone the engine info.
1796 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1798 * gpgme-config.in (cflags_pth): Revert accidential removal of
1799 pthread support with last change.
1801 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1803 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1804 (_gpgme_io_pipe): Open pipes in binary mode.
1806 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1808 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1809 checking the version correctly even after changing the engine
1810 information. Bug reported by Stéphane Corthésy.
1812 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1814 (colon_preprocessor_t): New type.
1815 (struct engine_gpg): New member colon.preprocess_fnc.
1816 (gpg_keylist_preprocess): New function.
1817 * keylist.c (keylist_colon_handler): Allow short key IDs.
1819 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1821 * w32-io.c (create_writer): Make C->have_data a manually resetted
1823 (writer): Move code from end of if block to beginning, so it
1824 is also run the first time.
1825 (_gpgme_io_write): Move assert check after error check. Reset
1826 the is_empty event, and also do it eagerly.
1827 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1829 2006-01-26 Werner Koch <wk@g10code.com>
1831 * w32-util.c (_gpgme_get_conf_int): New.
1832 * posix-util.c (_gpgme_get_conf_int): New.
1833 * w32-io.c (get_desired_thread_priority): New.
1834 (create_reader, create_writer): Use it here.
1836 2006-01-04 Werner Koch <wk@g10code.com>
1838 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1840 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1841 statements. Disable error return for failed nonblocking call.
1843 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1845 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1848 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1850 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1851 (_gpgme_io_select): Fix debug output.
1853 2005-12-23 Werner Koch <wk@g10code.com>
1855 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1856 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1859 2005-12-20 Werner Koch <wk@g10code.com>
1861 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1862 and GPGME_STATUS_PKA_TRUST_GOOD.
1863 (struct _gpgme_signature): New field pka_trust.
1864 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1866 2005-12-06 Werner Koch <wk@g10code.com>
1868 * keylist.c (keylist_colon_handler): Store fingerprints of the
1869 subkeys. Reset the secret flag of subkeys for stub secret keys.
1870 (NR_FIELDS): Bumped up to 16
1872 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1874 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1875 engine_get_version invocation. Reported by Stéphane Corthésy.
1877 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1879 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1881 2005-11-18 Werner Koch <wk@g10code.com>
1883 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1885 (find_channel): Better use g_io_channel_win32_new_fd instead of
1886 the autodetection function g_io_channel_unix_new.
1887 (_gpgme_io_select): Rewritten. It is now a fully working select
1890 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1892 * priv-io.h (_gpgme_io_fd2str): New prototype.
1893 * posix-io.c (_gpgme_io_fd2str): New function.
1894 * w32-io.c (_gpgme_io_fd2str): New function.
1895 * rungpg.c: Use this new function.
1896 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1897 again. Two's company, three's the musketeers.
1899 * w32-glib-io.c: Rewrote the file handle code. We don't create
1900 system fds for every handle (doesn't work for inherited handles),
1901 but we create pseudo fds in a private namespace that designate a
1902 handle and potentially a giochannel.
1904 2005-11-18 Werner Koch <wk@g10code.com>
1906 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1908 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1910 * w32-glib-io.c: New file.
1911 * gpgme.def (gpgme_get_giochannel): Add symbol.
1912 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1914 (ltlib_gpgme_extra): New variable.
1915 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1916 (system_components_not_extra): New variable.
1917 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1918 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1919 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1920 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1921 [BUILD_W32_GLIB]: New variables.
1922 * gpgme-config.in (glib): New option.
1923 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1925 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1927 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1928 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1929 * posix-io.c (_gpgme_io_kill): Removed.
1930 (_gpgme_io_waitpid): Declare static.
1932 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1934 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1936 2005-10-21 Werner Koch <wk@g10code.com>
1938 * Makefile.am: Fixed cut+paste problem
1940 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1942 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1945 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1947 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1950 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1952 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1955 * gpgme.h (gpgme_free): New prototype.
1956 * data-mem.c (gpgme_free): New function.
1957 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1958 * gpgme.def: Add gpgme_free.
1960 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1962 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1964 * verify.c (parse_notation): Likewise for invocation.
1965 * conversion.c (_gpgme_decode_percent_string): Likewise to
1966 declaration. If set, do not replace '\0' characters with a
1968 * gpgme.h (struct _gpgme_key_sig): New field notations.
1969 * ops.h (_gpgme_parse_notation): New prototype.
1970 * sig-notation.c (_gpgme_parse_notation): New function.
1971 * key.c (gpgme_key_unref): Free all signature notations.
1972 * keylist.c (op_data_t): New member tmp_keysig.
1973 (finish_key): Clear OPD->tmp_keysig.
1974 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1975 * rungpg.c (gpg_keylist): Support listing signature notations.
1976 (gpg_keylist_ext): Likewise.
1978 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1980 * engine.h (_gpgme_set_engine_info): Add prototype.
1981 * engine-backend.h (struct engine_ops): Change return type of
1982 get_file_name() to const char * to silence gcc warning.
1983 * engine.c (engine_get_file_name): Change return type to const
1984 char * to silence gcc warning.
1985 (gpgme_get_engine_info): Use transitional variable to go from
1986 const char * to char * to silence gcc warning.
1987 (_gpgme_set_engine_info): Likewise.
1988 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1989 char * to silence gcc warning.
1990 (gpgsm_new): Make ARGV a pointer to const char.
1991 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1992 to char * to silence gcc warning.
1994 * gpgme.def: Add gpgme_data_set_file_name,
1995 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1996 gpgme_sig_notation_add and gpgme_sig_notation_get.
1997 * libgpgme.vers: Add gpgme_sig_notation_clear,
1998 gpgme_sig_notation_add and gpgme_sig_notation_get.
1999 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
2000 * context.h (struct gpgme_context): New field sig_notations.
2001 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
2003 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
2004 (gpgme_sig_notation_flags_t): New type.
2005 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
2006 gpgme_sig_notation_get): New prototypes.
2007 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
2009 * sig-notation.c (_gpgme_sig_notation_free): New file.
2010 * verify.c (parse_notation): Use support functions.
2011 (release_op_data): Likewise.
2012 * rungpg.c (append_args_from_sig_notations): New function.
2013 (gpg_encrypt_sign, gpg_sign): Call it.
2015 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
2017 * data.h (struct gpgme_data): New member file_name.
2018 * data.c (gpgme_data_set_filename): New function.
2019 (_gpgme_data_release): Free DH->filename if necessary.
2020 (gpgme_data_get_filename): New function.
2021 * rungpg.c (gpg_encrypt): Set filename option.
2022 (gpg_encrypt_sign): Likewise.
2023 (gpg_sign): Likewise.
2024 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
2025 gpgme_data_get_file_name.
2027 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
2030 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
2032 * gpgme.h (struct _gpgme_key): Add field is_qualified.
2033 (struct _gpgme_subkey): Likewise.
2034 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
2037 2005-09-23 Werner Koch <wk@g10code.com>
2039 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
2041 (create_reader, create_writer): Set thread priority higher.
2043 2005-09-19 Werner Koch <wk@g10code.com>
2045 * w32-io.c (_gpgme_io_pipe): New environment variable to change
2046 the size of the pipe buffer.
2048 2005-09-13 Werner Koch <wk@g10code.com>
2050 * ath.c: Changes to make it work under W32.
2052 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
2054 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
2055 (ath_pth_src, ath_pthread_src): Removed.
2056 (w32_o_files): Replace ath-compat.o with ath.o.
2057 (libgpgme_pth_la_CFLAGS): New variable.
2058 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
2059 * ath.h (ath_pthread_available, ath_pth_available): Removed.
2060 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
2061 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
2062 (_ATH_COMPAT): Macro removed.
2063 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
2066 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
2068 * keylist.c (release_op_data): Do not free opd->tmp_uid.
2070 2005-09-07 Werner Koch <wk@g10code.com>
2072 * w32-io.c (build_commandline): Quote argv[0].
2074 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
2076 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
2078 * edit.c (command_handler): Do not depend on PROCESSED being
2081 * engine.h (engine_command_handler_t): Add new argument processed.
2082 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
2084 (_gpgme_passphrase_command_handler): ... this one.
2085 * passphrase.c (_gpgme_passphrase_command_handler_internal):
2087 (_gpgme_passphrase_command_handler): ... this one.
2088 * edit.c (command_handler): Add new argument processed. Remove
2089 local variable with the same name. Always return processed as
2091 * rungpg.c (command_handler): Send a newline character if the
2094 2005-08-26 Werner Koch <wk@g10code.com>
2096 * w32-util.c (read_w32_registry_string): Updated from code used by
2097 GnuPG. This allows for expanding strings and features the
2098 implicit fallback key.
2099 (w32_shgetfolderpath, find_program_at_standard_place): New.
2100 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
2101 entry, locate the programs at the standard place.
2102 (dlopen, dlsym, dlclose): New, so that we can keep on using what
2103 we are accustomed to.
2105 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
2106 semicolon is used which allows us to create files with drive
2109 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
2112 2005-08-19 Werner Koch <wk@g10code.com>
2115 * versioninfo.rc.in: New.
2116 * Makefile.am: Addes support for building a W32 DLL.
2118 * ttyname_r.c (ttyname_r) [W32]: Return error.
2119 * ath-compat.c [W32]: select and co are not yet supported; return
2121 * data-stream.c (stream_seek): Use ftell if ftello is not available.
2123 2005-08-08 Werner Koch <wk@g10code.com>
2125 * util.h (stpcpy): Renamed to ..
2126 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
2127 definitions when linking statically.
2128 * stpcpy.c: Removed.
2130 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
2132 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
2133 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
2134 (struct _gpgme_op_verify_result): Likewise.
2135 * ops.h (_gpgme_parse_plaintext): Add prototype.
2136 * op-support.c (_gpgme_parse_plaintext): New function.
2137 * decrypt.c (release_op_data): Release
2138 OPD->result.plaintext_filename.
2139 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2140 * verify.c (release_op_data): Release
2141 OPD->result.plaintext_filename.
2142 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2144 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
2146 * keylist.c (gpgme_get_key): Allow key IDs.
2148 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
2150 * gpgme.m4: Only call GPGME_CONFIG if found.
2152 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
2154 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
2156 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
2157 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
2159 (_gpgme_decrypt_status_handler): Fix last change.
2161 * gpgme.h (struct _gpgme_recipient): New structure.
2162 (gpgme_recipient_t): New type.
2163 (struct _gpgme_op_decrypt_result): Add member recipients.
2164 * decrypt.c (op_data_t): New member last_recipient_p.
2165 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
2166 (parse_enc_to): New function.
2167 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
2170 * wait-global.c (gpgme_wait): Break out of the fd processing loop
2172 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2174 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
2176 * wait.h (_gpgme_run_io_cb): New prototype.
2177 * wait.c (_gpgme_run_io_cb): New function.
2178 * wait-global.c (gpgme_wait): Call it.
2179 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
2180 * wait-private.c (_gpgme_wait_on_condition): Likewise.
2182 2005-06-02 Werner Koch <wk@g10code.com>
2184 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
2185 GPGME_STATUS_NEED_PASSPHRASE_PIN.
2186 (_gpgme_passphrase_command_handler_internal): Also act on the key
2187 "passphrase.pin.ask".
2189 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
2190 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
2191 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
2192 GPGME_STATUS_BACKUP_KEY_CREATED.
2194 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
2196 * data-user.c: Include <errno.h>.
2198 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
2200 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
2203 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
2205 * w32-io.c (_gpgme_io_select): Fix loop increment.
2207 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
2209 * data-user.c (user_release): Only call user hook if provided.
2210 (user_seek): Return EBADF if no user hook is provided.
2211 (user_read): Likewise.
2212 (user_write): Likewise.
2214 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
2216 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
2217 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
2218 the reset, just for cleanliness, and do not sent it at all if the
2219 default is requested.
2220 * gpgme.c (gpgme_set_include_certs): Allow to use
2221 GPGME_INCLUDE_CERTS_DEFAULT.
2223 2005-04-21 Werner Koch <wk@g10code.com>
2225 * verify.c (calc_sig_summary): Set the key revoked bit.
2227 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
2229 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
2230 in the list, not the user-provided CTX.
2231 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2233 * wait-global.c (gpgme_wait): If no context is found, and we
2234 should not hang, set *status to 0 and return NULL.
2235 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2237 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
2239 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
2240 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2241 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
2242 ENOSYS instead EOPNOTSUPP.
2243 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2244 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
2247 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
2249 * io.h: Rename to ...
2250 * priv-io.h: ... this.
2251 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
2252 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
2253 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
2254 Change all includes of "io.h" to "priv-io.h"
2256 2005-03-09 Werner Koch <wk@g10code.com>
2258 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
2259 cast away type checks.
2261 * io.h [W32]: Do not include stdio.h. If it is needed do it at
2264 * data.h [W32]: Removed kludge for EOPNOTSUP.
2265 * data.c, data-compat.c [W32]: Explicitly test for it here.
2267 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
2270 2005-03-07 Timo Schulz <twoaday@g10code.de>
2272 * gpgme.h: [_WIN32] Removed ssize_t typedef.
2273 * ath.h: [_WIN32] Added some (dummy) types.
2274 * io.h: [_WIN32] include stdio.h.
2275 * data.h: [_WIN32] Define EOPNOTSUPP.
2276 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
2277 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
2279 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
2281 * engine.c (_gpgme_set_engine_info): Fix assertion.
2283 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
2285 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
2287 * ttyname_r.c: New file.
2289 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
2291 * putc_unlocked.c, funopen.c: I just claim copyright on these
2292 files and change their license to LGPL, because they are totally
2293 trivial wrapper functions.
2294 * isascii.c: Change copyright notice to the one from ctype/ctype.h
2295 in the GNU C Library (CVS Head 2004-10-10), where isascii is
2296 defined as a macro doing exactly the same as the function in this
2298 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
2299 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
2300 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
2301 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
2302 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
2303 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
2304 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
2305 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
2306 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
2307 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
2308 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
2309 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
2310 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
2311 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
2314 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
2316 * libgpgme.vers (GPGME_1.1): New version.
2317 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
2318 member get_version(). Add arguments FILE_NAME and HOME_DIR to
2319 member new(). Change return type of get_file_name and get_version
2321 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
2322 pointer. Do not cache result.
2323 (gpgsm_new): Add file_name and home_dir argument, and use them
2324 instead of the defaults, if set.
2325 * rungpg.c (struct engine_gpg): New member file_name.
2326 (gpg_get_version): Change return type to char pointer, and do not
2328 (gpg_release): Free gpg->file_name.
2329 (gpg_new): Take new arguments file_name and home_dir. Set the
2330 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
2331 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
2332 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
2334 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2336 * engine.c: Include <assert.h>.
2337 (gpgme_get_engine_info): Set *INFO within the lock. Move
2338 ENGINE_INFO and ENGINE_INFO_LOCK to ....
2339 (engine_info, engine_info_lock): ... here. New static variables.
2340 (engine_get_version): Add file_name argument to
2341 get_version invocation. Change return type to char pointer.
2342 (gpgme_engine_check_version): Rewritten to free() the return value
2343 of engine_get_version after using it.
2344 (_gpgme_engine_info_release): New function.
2345 (gpgme_get_engine_info): Rewritten.
2346 (_gpgme_engine_info_copy): New function.
2347 (_gpgme_set_engine_info): New function.
2348 (gpgme_set_engine_info): New function.
2349 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2351 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
2352 and version to char * (remove the const). New member home_dir.
2353 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
2354 gpgme_ctx_set_engine_info): New prototypes.
2355 * context.h (struct gpgme_context): New member engine_info.
2356 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
2357 (gpgme_release): Deallocate CTX->engine_info.
2358 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
2360 * op-support.c (_gpgme_op_reset): Look for correct engine info and
2361 pass it to _gpgme_engine_new.
2362 * version.c (gpgme_check_version): Adjust to
2363 _gpgme_compare_versions returning an int.
2364 (_gpgme_compare_versions): Return an int value, not a const char
2366 * ops.h (_gpgme_compare_versions): Same for prototype.
2368 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
2370 * verify.c (parse_trust): If no reason is provided, set
2371 SIG->validity_reason to 0.
2372 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
2374 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
2376 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
2377 (start): Call map_assuan_error on return value of
2380 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
2382 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
2385 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
2387 * gpgme.m4: Implement the --api-version check.
2389 * rungpg.c (read_status): Move the polling of the output data pipe
2390 to just before removing the command fd, from just before adding
2391 it. This avoids buffering problems.
2393 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
2394 read, to improve debug output.
2396 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
2398 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
2399 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
2400 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
2401 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
2403 (gpgme_keylist_mode_t): Define as unsigned int.
2404 (gpgme_key_t): Change type of keylist_mode to
2405 gpgme_keylist_mode_t.
2407 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
2409 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
2412 * data-stream.c (stream_seek): Call ftello and return the current
2414 * data.h (struct gpgme_data): Change type of data.mem.offset to
2416 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
2417 callback. If SEEK_CUR, adjust the offset by the pending buffer
2418 size. Clear pending buffer on success.
2421 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
2423 * gpgme.m4: Add copyright notice.
2425 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
2427 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
2430 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
2432 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
2434 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
2436 * key.c (_gpgme_key_append_name): Make sure tail points to the
2437 byte following the uid.
2438 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
2441 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
2443 * libgpgme.vers: Remove C-style comment, which is not supported by
2446 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2448 * gpgme-config.in (Options): Support --api-version.
2450 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
2452 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
2453 * verify.c (parse_error): Likewise.
2455 * verify.c (parse_error): Do not skip location of where token.
2457 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
2458 * verify.c (_gpgme_verify_status_handler): Add handling of
2459 GPGME_STATUS_REVKEYSIG.
2460 (parse_trust): Likewise.
2462 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2464 * gpgme.h (struct _gpgme_decrypt_result): New fields
2465 wrong_key_usage and _unused.
2466 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
2467 character after a matched string, as in a protocol error this
2468 could skip over the trailing binary zero.
2469 Handle decrypt.keyusage error notifications.
2471 * gpgme.h (struct _gpgme_key): New member keylist_mode.
2472 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
2474 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
2476 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
2477 to unsigned int. Same for member _unused.
2479 * keylist.c (set_mainkey_trust_info): Rewritten.
2480 (set_subkey_capability): Handle 'd' (disabled).
2481 (set_mainkey_capability): Rewritten.
2483 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
2485 * gpgme.m4: Quote first argument to AC_DEFUN.
2487 2004-04-21 Werner Koch <wk@gnupg.org>
2489 * key.c (gpgme_key_unref): Allow passing NULL like free does.
2490 The rule of least surprise.
2492 2004-04-15 Werner Koch <wk@gnupg.org>
2494 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
2495 unused result.signatures items.
2497 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
2499 2004-04-08 Werner Koch <wk@gnupg.org>
2501 * verify.c (_gpgme_verify_status_handler): Ignore the error status
2502 if we can't process it.
2503 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2504 yesterday's hack. It is not any longer required.
2506 2004-04-07 Werner Koch <wk@gnupg.org>
2508 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2509 with meaningless error codes from the verify status function.
2511 2004-04-05 Werner Koch <wk@gnupg.org>
2513 * gpgme.h: Add GPGME_STATUS_NEWSIG.
2515 * verify.c (parse_error): Compare only the last part of the where
2517 (prepare_new_sig): New.
2518 (parse_new_sig): Use prepare_new_sig when required.
2519 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2521 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2522 option. Fixed pattern construction.
2523 (status_handler): Add debugging output.
2525 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
2527 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2528 isatty(). Submitted by Bernhard Herzog.
2530 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
2532 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2535 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2537 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2538 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
2540 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
2542 * gpgme-config.in: Do not emit include and lib directory for
2543 prefix "/usr" or "".
2545 2004-03-03 Werner Koch <wk@gnupg.org>
2547 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2550 2004-02-18 Werner Koch <wk@gnupg.org>
2552 * gpgme-config.in: Ignore setting of --prefix.
2554 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
2556 * rungpg.c (gpg_cancel): New function.
2557 (gpg_release): Call it here.
2558 (_gpgme_engine_ops_gpg): Add it here.
2559 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2561 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2563 * gpgme.c (gpgme_cancel): New function.
2564 * engine-backend.h (struct engine_ops): New member cancel.
2565 * engine.h (_gpgme_engine_cancel): New prototype.
2566 * engine.c (_gpgme_engine_cancel): New function.
2567 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2568 (gpgsm_cancel): New function.
2569 (gpgsm_release): Use it.
2570 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2572 2004-02-17 Werner Koch <wk@gnupg.org>
2574 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2575 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2577 2004-02-15 Werner Koch <wk@gnupg.org>
2579 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2580 by Adriaan de Groot.
2582 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2584 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2586 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2588 * data-stream.c (stream_seek): Likewise.
2590 2004-01-16 Werner Koch <wk@gnupg.org>
2592 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2595 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2597 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2599 2004-01-12 Werner Koch <wk@gnupg.org>
2601 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2603 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2605 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2606 (struct _gpgme_key_sig): For C++ compilers, rename class
2607 member to _obsolete_class. Add new member sig_class.
2608 (struct _gpgme_new_signature): Same here.
2609 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2611 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2612 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2613 * sign.c (parse_sig_created): Set SIG->sig_class.
2615 2003-12-22 Werner Koch <wk@gnupg.org>
2617 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2620 2003-11-19 Werner Koch <wk@gnupg.org>
2622 * conversion.c (_gpgme_parse_timestamp): New.
2623 (atoi_1, atoi_2, atoi_4): New.
2624 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2626 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2627 * sign.c (parse_sig_created): Ditto.
2629 2003-10-31 Werner Koch <wk@gnupg.org>
2631 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2634 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2636 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2637 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2639 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2641 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2644 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2647 * io.h (_gpgme_io_subsystem_init): New prototype.
2648 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2649 (_gpgme_io_spawn): Do not fixup signal handler here.
2650 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2652 * debug.c (debug_init): Drop const qualifier from E.
2654 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2656 (ath_connect): Make ADDR argument const.
2657 * ath-pthread.c (ath_connect): Likewise.
2658 * ath-pth.c (ath_connect): Likewise.
2659 * ath-compat.c (ath_connect): Likewise.
2660 * ath.c (ath_connect): Likewise.
2662 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2663 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2665 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2667 * util.h (_gpgme_hextobyte): Likewise for prototype.
2669 * gpgme.h: Remove trailing comma in enum.
2671 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2672 <signal.h>, <fcntl.h>, or "unistd.h".
2674 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2676 * engine-backend.h (struct engine_ops): Add argument TYPE.
2677 * engine.c (_gpgme_engine_op_edit): Likewise.
2678 * engine.h: Likewise.
2679 * rungpg.c (gpg_edit): Likewise. Use it.
2680 * edit.c (edit_start): Likewise. Pass it on.
2681 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2682 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2684 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2686 * gpgme.h (gpg_strerror_r): Change prototype to match
2687 gpg_strerror_r change.
2688 * error.c (gpg_strerror_r): Likewise, also update implementation.
2690 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2691 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2692 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2694 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2696 * gpgme.h: Add prototype for gpgme_set_locale.
2698 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2699 characteristics and use that instead __inline__.
2701 * context.h (struct gpgme_context): New members lc_ctype and
2703 * gpgme.c: Include <locale.h>.
2704 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2706 (gpgme_set_locale): New function.
2707 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2709 * engine.h (_gpgme_engine_new): Likewise.
2710 * engine-gpgsm.c (gpgsm_new): Likewise.
2711 * rungpg.c (gpg_new): Likewise.
2712 * engine-backend.h (struct engine_ops): Likewise to NEW.
2713 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2716 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2718 * gpgme.h (gpgme_strerror_r): New prototype.
2719 * error.c (gpgme_strerror_r): New function.
2721 * get-env.c: New file.
2722 * util.h (_gpgme_getenv): Add prototype.
2723 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2724 * rungpg.c (build_argv): Use _gpgme_getenv.
2725 * debug.c (debug_init): Likewise.
2726 * engine-gpgsm.c (gpgsm_new): Likewise.
2727 (gpgsm_new): Use ttyname_r.
2728 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2730 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2732 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2735 * gpgme-config.in: Rewritten.
2736 * gpgme.m4: Rewritten.
2738 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2740 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2741 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2742 updated to have better thread support, and the Makefile.am was
2743 changed to reflect that.
2745 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2746 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2747 value of status_fnc.
2748 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2750 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2752 * rungpg.c (start): Use saved_errno instead errno.
2754 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2756 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2757 * fopencookie.c: File removed.
2759 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2761 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2763 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2765 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2766 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2767 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2768 backward compatibility.
2770 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2772 * verify.c (parse_new_sig): Fix status parsing case.
2774 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2776 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2777 Lower _UNUSED to 23 bits.
2778 (struct _gpgme_key): Likewise.
2779 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2780 (set_subkey_capability): Support 'a'.
2782 * keylist.c (gpgme_get_key): Check if there is more than one key
2783 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2785 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2787 (_gpgme_decode_percent_string): Likewise.
2788 * conversion.c (_gpgme_decode_c_string): Likewise.
2789 (_gpgme_decode_percent_string): Likewise.
2790 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2791 * signers.c (gpgme_signers_clear): Likewise.
2792 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2793 Use SEQNO instead SEQ.
2794 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2795 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2797 (gpgme_wait): Change type of I and IDX to unsigned int.
2798 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2799 and I to unsigned int.
2800 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2801 int to suppress gcc warning.
2802 (_gpgme_io_set_close_notify): Likewise.
2803 (_gpgme_io_select): Change type of I to unsigned int.
2804 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2806 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2809 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2811 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2812 and wrong expression.
2813 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2814 * encrypt.c (encrypt_sym_status_handler): Likewise.
2815 * sign.c (sign_status_handler): Likewise.
2816 * verify.c (verify_status_handler): Likewise.
2817 * decrypt.c (decrypt_status_handler): Likewise.
2819 * engine.c (gpgme_get_engine_info): Initialize NULL.
2821 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2823 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2824 GPG_ERROR_LIBS when setting the corresponding variables.
2825 Reported by Stéphane Corthésy.
2827 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2829 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2830 the beginning of the block.
2832 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2834 * data-mem.c (mem_write): Copy original buffer content.
2836 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2838 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2841 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2843 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2844 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2847 * op-support.c (_gpgme_parse_inv_userid): Rename to
2848 _gpgme_parse_inv_recp and change to new datatype.
2849 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2850 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2851 __gpgme_invalid_key. Rename field ID to KEY.
2852 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2853 (struct _gpgme_op_encrypt_result): Here, too.
2854 (struct _gpgme_op_sign_result): Likewise.
2855 * encrypt.c (struct op_data): Likewise.
2856 (release_op_data): Likewise.
2857 * sign.c (struct op_data): Likewise.
2858 (release_op_data): Likewise.
2860 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2861 (_gpgme_io_write): Likewise.
2862 (_gpgme_io_pipe): Likewise.
2863 (_gpgme_io_select): Likewise.
2865 * rungpg.c (struct engine_gpg): Remove arg_error.
2866 (add_arg): Don't set arg_error.
2867 (add_data): Likewise.
2868 (start): Don't check arg_error.
2869 (gpg_new): Check return value of add_arg.
2870 * verify.c (parse_notation): Free allocated memory at error.
2872 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2874 Everywhere: Use libgpg-error error codes.
2876 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2877 (BUILT_SOURCES): Remove errors.c.
2878 (MOSTLYCLEANFILES): Likewise.
2879 (libgpgme_la_SOURCES): Likewise. Add error.c.
2880 (errors.c): Remove target.
2881 * mkerrors: File removed.
2882 * error.c: New file.
2884 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2885 (gpgme_err_code_t, gpgme_err_source_t): New types.
2886 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2887 New static inline functions.
2888 (gpgme_strsource, gpgme_err_code_from_errno,
2889 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2890 gpgme_error_from_errno): New prototypes.
2892 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2894 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2895 (gpgme_op_export): Likewise.
2896 (gpgme_op_export_ext_start): New prototype.
2897 (gpgme_op_export_ext): Likewise.
2898 * engine.h: Likewise for _gpgme_engine_op_export and
2899 _gpgme_engine_op_export_ext.
2900 * engine-backend.h (struct engine_ops): Change second argument of
2901 prototype of export to const char *, and add reserverd int as
2902 third argument. Add prototype for export_ext.
2903 * engine.c (_gpgme_engine_op_export_ext): New function.
2904 (_gpgme_engine_op_export): Change second argument of prototype of
2905 export to const char *, and add reserverd int as third argument.
2906 * rungpg.c (gpg_export): Change second argument of prototype of
2907 export to const char *, and add reserverd int as third argument.
2908 (gpg_export_ext): New function.
2909 (gpg_keylist_ext): Break loop at error.
2910 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2911 * engine-gpgsm.c (gpgsm_export): Change second argument of
2912 prototype of export to const char *, and add reserverd int as
2914 (gpgsm_export_ext): New function.
2915 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2916 * export.c (export_start): Change second argument of prototype of
2917 export to const char *, and add reserverd int as third argument.
2918 (gpgme_op_export_start): Likewise.
2919 (export_ext_start): New function.
2920 (gpgme_op_export_ext_start): Likewise.
2921 (gpgme_op_export_ext): Likewise.
2923 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2924 (gpgme_sigsum_t): New type for anonymous enum.
2926 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2927 and return an error if RECP is not set.
2929 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2930 * user-id.c: Remove file.
2931 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2932 * gpgme.h (gpgme_encrypt_flags_t): New type.
2933 (gpgme_op_encrypt_start): Change second parameter to type
2934 gpgme_key_t[], and add third parameter.
2935 (gpgme_op_encrypt): Likewise.
2936 (gpgme_op_encrypt_sign_start): Likewise.
2937 (gpgme_op_encrypt_sign): Likewise.
2938 * encrypt.c (encrypt_start): Likewise.
2939 (gpgme_op_encrypt_start): Likewise.
2940 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2941 * encrypt-sign.c (encrypt_sign_start): Likewise.
2942 (gpgme_op_encrypt_sign_start): Likewise.
2943 (gpgme_op_encrypt_sign): Likewise.
2944 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2945 encrypt and encrypt_sign.
2946 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2947 and _gpgme_engine_op_encrypt_sign.
2948 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2949 (_gpgme_engine_op_encrypt_sign): Likewise.
2950 * rungpg.c (gpg_encrypt): Likewise.
2951 (gpg_encrypt_sign): Likewise.
2952 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2953 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2954 (set_recipients): Rewritten to use keys instead user IDs.
2955 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2957 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2958 returned to GPGME_Invalid_Key and GPGME_General_Error.
2960 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2962 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2963 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2964 * rungpg.c: Rename GpgObject to engine_gpg_t.
2965 (struct gpg_object_s): Rename to struct engine_gpg.
2967 * context.h (struct gpgme_context): Change EngineObject to
2969 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2970 (ctx_op_data_t): New type.
2971 (struct gpgme_context): Use it.
2972 * ops.h (_gpgme_op_data_lookup): Use new type name.
2973 * op-support.c (_gpgme_op_data_lookup): Likewise.
2974 * engine.c: Rename EngineObject to engine_t in the file. Also
2975 EngineStatusHandler to engine_status_handler_t,
2976 EngineCommandHandler to engine_command_handler_t and
2977 EngineColonLineHandler to engine_colon_line_handler.
2978 * rungpg.c (start): Likewise.
2979 * engine-gpgsm.c: Likewise.
2980 * engine-backend.h (struct engine_ops): Likewise
2981 * engine.h (struct engine_object_s): Rename to struct engine.
2982 (EngineObject): Rename to engine_t. Also everywhere else in the
2984 (EngineStatusHandler): Rename to engine_status_handler_t.
2985 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2986 (EngineCommandHandler): Rename to engine_command_handler_t.
2988 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2990 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2992 * gpgme.h (gpgme_recipients_t): Removed.
2993 (gpgme_recipients_new, gpgme_recipients_release,
2994 gpgme_recipients_add_name,
2995 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2996 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2997 gpgme_recipients_enum_close): Removed.
2998 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2999 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
3000 gpgme_op_export): Change second argument to gpgme_user_id_t.
3001 (gpgme_user_ids_release): New prototype.
3002 (gpgme_user_ids_append): Likewise.
3003 * ops.h (_gpgme_recipients_all_valid): Remove.
3004 (_gpgme_user_ids_all_valid): Add.
3005 * context.h (struct gpgme_recipients): Removed.
3006 * user-id.c: New file.
3007 * recipient.c: Removed file.
3008 * rungpg.c (append_args_from_recipients): Change last arg to
3009 gpgme_user_id_t. Reimplement.
3010 (gpg_encrypt): Change second arg to gpgme_user_id_t.
3011 (gpg_encrypt_sign): Likewise.
3012 (gpg_export): Likewise. Rewrite user ID list code.
3013 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
3015 (_gpgme_engine_op_encrypt_sign): Likewise.
3016 (_gpgme_engine_op_export): Likewise.
3017 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3018 _gpgme_engine_op_export): Likewise.
3019 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
3020 (gpgsm_encrypt): Likewise.
3021 (gpgsm_export): Likewise.
3022 * engine-backend.h (struct engine_ops): Likewise for members
3023 ENCRYPT, ENCRYPT_SIGN and EXPORT.
3024 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
3026 * encrypt.c (encrypt_start): Likewise. Don't check for count of
3028 (gpgme_op_encrypt_start): Likewise.
3029 (gpgme_op_encrypt): Likewise.
3030 * encrypt-sign.c (encrypt_sign_start): Likewise.
3031 (gpgme_op_encrypt_sign): Likewise.
3032 (gpgme_op_encrypt_sign_start): Likewise.
3034 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
3036 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
3037 * import.c (parse_import_res): Add skipped_new_keys parser.
3039 * op-support.c (_gpgme_parse_inv_userid): Add missing break
3041 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
3043 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
3045 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
3046 HOOK to avoid compiler warning. Don't ask, you don't want to know.
3047 (_gpgme_encrypt_status_handler): Likewise.
3048 (_gpgme_op_encrypt_init_result): Likewise.
3049 * decrypt.c (gpgme_op_decrypt_result): Likewise.
3050 (_gpgme_decrypt_status_handler): Likewise.
3051 (_gpgme_op_decrypt_init_result): Likewise.
3052 * verify.c (gpgme_op_verify_result): Likewise.
3053 (_gpgme_verify_status_handler): Likewise.
3054 (_gpgme_op_verify_init_result): Likewise.
3055 * edit.c (edit_status_handler): Likewise.
3056 (command_handler): Likewise.
3057 (edit_start): Likewise.
3058 * genkey.c (gpgme_op_genkey_result): Likewise.
3059 (genkey_status_handler): Likewise.
3060 (genkey_start): Likewise.
3061 * import.c (gpgme_op_import_result): Likewise.
3062 (import_status_handler): Likewise.
3063 (_gpgme_op_import_start): Likewise.
3064 * trustlist.c (gpgme_op_trustlist_next): Likewise.
3065 (_gpgme_op_trustlist_event_cb): Likewise.
3066 (gpgme_op_trustlist_start): Likewise.
3067 * keylist.c (gpgme_op_keylist_result): Likewise.
3068 (keylist_colon_handler): Likewise.
3069 (keylist_status_handler): Likewise.
3070 (_gpgme_op_keylist_event_cb): Likewise.
3071 (gpgme_op_keylist_start): Likewise.
3072 (gpgme_op_keylist_ext_start): Likewise.
3073 (gpgme_op_keylist_next): Likewise.
3074 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
3075 (_gpgme_passphrase_command_handler_internal): Likewise.
3076 * sign.c (gpgme_op_sign_result): Likewise.
3077 (_gpgme_sign_status_handler): Likewise.
3078 (_gpgme_op_sign_init_result): Likewise.
3080 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
3081 access to pointer type.
3083 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
3085 * engine.h (EngineCommandHandler): Change last argument to int fd.
3086 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
3088 (gpgme_edit_cb_t): Change last argument to int fd.
3089 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
3090 * passphrase.c: Include <assert.h>.
3091 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
3092 (release_op_data): Check values before calling free.
3093 (_gpgme_passphrase_status_handler): Likewise.
3094 (_gpgme_passphrase_command_handler_internal): New function.
3095 (_gpgme_passphrase_command_handler): Rewritten.
3096 * edit.c (edit_status_handler): Pass -1 as fd argument.
3097 (command_handler): Update prototype. New variable processed. Use
3098 it to store return value of
3099 _gpgme_passphrase_command_handler_internal which is now used
3100 instead _gpgme_passphrase_command_handler. Use it also to check
3101 if we should call the user's edit function. Pass fd to user's
3103 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
3105 (gpg_release): Check value before calling free. Do not release
3107 (command_cb): Function removed.
3108 (command_handler): New function. Thus we don't use a data object
3109 for command handler stuff anymore, but handle it directly. This
3110 allows proper error reporting (cancel of passphrase requests, for
3111 example). Also all callbacks work via direct writes to the file
3112 descriptor (so that passphrases are not kept in insecure memory).
3113 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
3114 (read_status): Check cmd.keyword before calling free. Install
3115 command_handler as the I/O callback handler with GPG as private
3118 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
3120 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
3121 decrypt_verify_start.
3122 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
3123 (gpgme_op_decrypt_verify): Likewise.
3124 * verify.c (verify_status_handler): New function that also calls
3125 progress status handler.
3126 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
3127 Rename to (verify_start).
3128 (gpgme_op_verify_start): Call verify_start.
3129 (gpgme_op_verify): Likewise.
3130 * encrypt.c (encrypt_status_handler): New function.
3131 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
3132 Make static. Rename to encrypt_sym_status_handler.
3133 (encrypt_start): Set status handler to encrypt_sym_status_handler
3134 or encrypt_status_handler.
3135 * sign.c (sign_status_handler): New function.
3136 (sign_start): Set status handler to sign_status_handler.
3137 * decrypt.c (decrypt_status_handler): New function that also calls
3138 progress status handler.
3139 (decrypt_start): Set status handler to decrypt_status_handler.
3140 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3141 * decrypt-verify.c (decrypt_verify_status_handler): Call
3142 _gpgme_progress_status_handler.
3144 * conversion.c (_gpgme_decode_c_string): Add missing break
3147 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
3148 to buffer to allocate.
3150 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
3152 * verify.c (parse_new_sig): Fix ERRSIG case.
3153 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
3155 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3157 * gpgme.h: The following types are renamed. The old name is kept
3158 as a deprecated typedef.
3159 (GpgmeCtx): Rename to gpgme_ctx_t.
3160 (GpgmeData): Rename to gpgme_data_t.
3161 (GpgmeRecipients): Rename to gpgme_recipients_t.
3162 (GpgmeError): Rename to gpgme_error_t.
3163 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
3164 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
3165 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
3166 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
3167 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
3168 (GpgmeAttr): Rename to gpgme_attr_t.
3169 (GpgmeValidity): Rename to gpgme_validity_t.
3170 (GpgmeProtocol): Rename to gpgme_protocol_t.
3171 (GpgmeStatusCode): Rename to gpgme_status_code_t.
3172 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
3173 (GpgmeSubkey): Rename to gpgme_subkey_t.
3174 (GpgmeKeySig): Rename to gpgme_keysig_t.
3175 (GpgmeUserID): Rename to gpgme_user_id_t.
3176 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
3177 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
3178 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
3179 (GpgmeIOCb): Rename to gpgme_io_cb_t.
3180 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
3181 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
3182 (GpgmeEventIO): Rename to gpgme_event_io_t.
3183 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
3184 (GpgmeIOCbs): Rename to gpgme_io_cbs.
3185 (gpgme_io_cbs_t): New type.
3186 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
3187 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
3188 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
3189 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
3190 (GpgmeDataCbs): Rename to gpgme_data_cbs.
3191 (gpgme_data_cbs_t): New type.
3192 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
3193 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
3194 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
3195 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
3196 (GpgmeSignResult): Rename to gpgme_sign_result_t.
3197 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
3198 (GpgmeSignature): Rename to gpgme_signature_t.
3199 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
3200 (GpgmeImportStatus): Rename to gpgme_import_status_t.
3201 (GpgmeImportResult): Rename to gpgme_import_result_t.
3202 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
3203 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
3204 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
3205 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
3206 GPGME_No_Recipients, GPGME_Invalid_Recipient and
3207 GPGME_No_Passphrase.
3208 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
3209 * context.h (struct gpgme_context_s): Rename to struct
3211 (struct gpgme_recipients_s): Rename to gpgme_recipients.
3213 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3215 * keylist.c (finish_key): Clear OPD->tmp_uid.
3217 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
3219 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
3220 for NODATA status without signatures.
3222 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
3224 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
3225 (_gpgme_key_add_sig): Likewise.
3227 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
3229 * context.h (struct gpgme_context_s): Remove member op_info.
3231 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
3233 * gpgme.h (GpgmeError): Add deprecated values for
3234 GPGME_Invalid_Type and GPGME_Invalid_Mode.
3236 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
3238 * gpgme.h (gpgme_get_op_info): Remove prototype.
3239 * ops.h (_gpgme_set_op_info,
3240 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
3241 _gpgme_data_append, _gpgme_data_append_string,
3242 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
3243 _gpgme_data_append_percentstring_for_xml): Likewise.
3244 (_gpgme_progress_status_handler): Change first arg to void *.
3245 * progress.c (_gpgme_progress_status_handler): Likewise.
3246 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
3247 and <sys/types.h>, but <string.h>.
3248 (_gpgme_data_append): Remove function.
3249 (_gpgme_data_append_string): Likewise.
3250 (_gpgme_data_append_for_xml): Likewise.
3251 (_gpgme_data_append_string_for_xml): Likewise.
3252 (_gpgme_data_append_percentstring_for_xml): Likewise.
3253 * data-mem.c (_gpgme_data_get_as_string): Likewise.
3254 (_gpgme_data_release_and_return_string): Likewise.
3255 * gpgme.c (gpgme_get_op_info): Likewise.
3256 (_gpgme_set_op_info): Likewise.
3258 * gpgme.h (struct _gpgme_key): New structure.
3259 (GpgmeKey): Define using _gpgme_key.
3260 (struct _gpgme_subkey): New structure.
3261 (GpgmeSubKey): New type.
3262 (struct _gpgme_key_sig): New structure.
3263 (GpgmeKeySig): New type.
3264 (struct _gpgme_user_id): New structure.
3265 (GpgmeUserID): New type.
3266 (struct _gpgme_op_keylist_result): New structure.
3267 (GpgmeKeyListResult): New type.
3268 (gpgme_op_keylist_result): New function.
3269 (gpgme_key_get_as_xml): Remove prototype.
3270 * context.h (struct gpgme_context_s): Remove members tmp_key,
3271 tmp_uid, key_cond and key_queue.
3272 (struct key_queue_item_s): Remove structure.
3273 (struct user_id_s): Remove structure.
3274 (struct gpgme_recipients_s): Replace with simple
3276 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
3277 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
3278 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
3279 * rungpg.c (command_cb): Return GpgmeError instead int.
3280 New variable ERR. Use it to hold return value of cmd handler.
3281 (gpg_delete): Access fingerprint of key directly.
3282 (append_args_from_signers): Likewise.
3283 (gpg_edit): Likewise.
3284 (append_args_from_recipients): Use GpgmeUserID for recipient list.
3285 * engine-gpgsm.c: Do not include "key.h".
3286 (gpgsm_delete): Access fingerprint of key directly.
3287 (gpgsm_sign): Likewise.
3288 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
3290 * key.h: File removed.
3291 * key.c: Completely reworked to use exposed GpgmeKey data types.
3292 * keylist.c: Likewise.
3293 * recipient.c: Completely reworked to use GpgmeUserID.
3295 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
3297 * gpgme.h (gpgme_get_key): Remove force_update argument.
3298 * key-cache.c: File removed.
3299 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
3300 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
3302 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
3303 _gpgme_key_cache_add.
3304 (gpgme_get_key): New function.
3305 * verify.c (gpgme_get_sig_key): Remove last argument to
3306 gpgme_get_key invocation.
3308 * gpgme.h (struct _gpgme_trust_item): New structure.
3309 (GpgmeTrustItem): New type.
3310 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
3311 * context.h (struct trust_queue_item_s): Remove structure.
3312 (struct gpgme_context_s): Remove trust_queue member.
3313 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
3314 * trust-item.c: New file.
3315 * trustlist.c: Do not include <stdio.h> or <time.h>, but
3317 (struct trust_queue_item_s): Change to new type op_data_t.
3318 (trust_status_handler): Change first argument to void *.
3319 (trust_colon_handler): Likewise.
3320 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
3321 (gpgme_op_trustlist_start): Use op_data_t and rework error
3323 (gpgme_op_trustlist_next): Use op_data_t.
3324 (gpgme_trust_item_release): Remove function.
3325 (gpgme_trust_item_get_string_attr): Likewise.
3326 (gpgme_trust_item_get_int_attr): Likewise.
3328 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
3331 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
3333 * context.h: Remove OPDATA_VERIFY_COLLECTING.
3334 (struct gpgme_context_s): Remove member notation.
3335 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
3337 * gpgme.h (struct _gpgme_sig_notation): New structure.
3338 (GpgmeSigNotation): New type.
3339 (struct _gpgme_signature): New structure.
3340 (GpgmeSignature): New type.
3341 (struct _gpgme_op_verify_result): New structure.
3342 (GpgmeVerifyResult): New type.
3343 (gpgme_op_verify_result): New prototype.
3344 (gpgme_get_notation): Remove prototype.
3345 * ops.h (_gpgme_op_verify_init_result): New prototype.
3346 (_gpgme_verify_status_handler): Change first argument to void *.
3347 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
3349 * conversion.c (_gpgme_decode_percent_string): New function.
3350 (gnupg_errors): New static global.
3351 (_gpgme_map_gnupg_error): New function.
3352 * gpgme.c (gpgme_release): Don't release CTX->notation.
3353 (gpgme_get_notation): Remove function.
3354 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
3355 _gpgme_op_verify_init_result.
3356 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
3357 do include "gpgme.h".
3358 (struct verify_result): Replace with ...
3359 (op_data_t): ... this type.
3360 (release_verify_result): Remove function.
3361 (release_op_data): New function.
3362 (is_token): Remove function.
3363 (skip_token): Remove function.
3364 (copy_token): Remove function.
3365 (gpgme_op_verify_result): New function.
3366 (calc_sig_summary): Rewritten.
3367 (finish_sig): Remove function.
3368 (parse_new_sig): New function.
3369 (parse_valid_sig): New function.
3370 (parse_notation): New function.
3371 (parse_trust): New function.
3372 (parse_error): New function.
3373 (_gpgme_verify_status_handler): Rewritten. Change first argument
3375 (_gpgme_op_verify_start): Rework error handling. Call
3376 _gpgme_op_verify_init_result.
3377 (gpgme_op_verify): Do not release or clear CTX->notation.
3378 (gpgme_get_sig_status): Rewritten.
3379 (gpgme_get_sig_string_attr): Likewise.
3380 (gpgme_get_sig_ulong_attr): Likewise.
3381 (gpgme_get_sig_key): Likewise.
3383 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
3384 (GpgmeDecryptResult): New type.
3385 (gpgme_op_decrypt_result): New prototype.
3386 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
3387 (_gpgme_decrypt_status_handler): Fix prototype.
3388 (_gpgme_decrypt_start): Remove prototype.
3389 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
3390 <string.h> and <assert.h>, "util.h" and "context.h", but
3392 (decrypt_verify_status_handler): Change first argument to void *,
3393 and rework error handling.
3394 (_gpgme_op_decrypt_verify_start): New function.
3395 (gpgme_op_decrypt_verify_start): Rewrite using
3396 _gpgme_op_decrypt_verify_start.
3397 (gpgme_op_decrypt_verify): Likewise.
3398 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
3399 (struct decrypt_result): Change to typedef op_data_t, rewritten.
3400 (is_token): Remove function.
3401 (release_op_data): New function.
3402 (skip_token): Remove function.
3403 (gpgme_op_decrypt_result): New function.
3404 (_gpgme_decrypt_status_handler): Change first argument to void *.
3405 Rework error handling.
3406 (_gpgme_decrypt_start): Rename to ...
3407 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
3408 (_gpgme_op_decrypt_init_result): New function.
3409 (gpgme_op_decrypt_start): Use decrypt_start.
3410 (gpgme_op_decrypt): Likewise.
3412 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
3414 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
3415 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
3416 (_gpgme_op_encrypt_sign_start): Rename to ...
3417 (encrypt_sign_start): ... this.
3418 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
3419 _gpgme_op_encrypt_sign_start.
3420 (gpgme_op_encrypt_sign): Likewise.
3422 * gpgme.h (GpgmeEncryptResult): New data type.
3423 (gpgme_op_encrypt_result): New prototype.
3424 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
3425 (_gpgme_op_encrypt_status_handler): Fix prototype.
3426 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3427 _gpgme_op_encrypt_init_result.
3428 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
3429 "wait.h". Include <errno.h> and "gpgme.h".
3430 (SKIP_TOKEN_OR_RETURN): Remove macro.
3431 (struct encrypt_result): Rename to ...
3432 (op_data_t): ... new data type. Rewrite for user result data.
3433 (append_xml_encinfo): Remove function.
3434 (release_op_data): New function.
3435 (gpgme_op_encrypt_result): New function.
3436 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
3437 Rewrite result parsing.
3438 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
3440 (_gpgme_op_encrypt_init_result): New function.
3441 (_gpgme_op_encrypt_start): Rename to ...
3442 (encrypt_start): ... this.
3443 (gpgme_op_encrypt_start): Use encrypt_start, not
3444 gpgme_op_encrypt_start.
3445 (gpgme_op_encrypt): Likewise.
3447 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
3448 GpgmeNewSignature, GpgmeSignResult): New data types.
3449 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
3450 gpgme_hash_algo_name): New prototypes.
3451 * gpgme.c (gpgme_pubkey_algo_name): New function.
3452 (gpgme_hash_algo_name): Likewise.
3453 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
3455 (_gpgme_op_sign_status_handler): Fix prototype.
3456 * op-support.c: Include <errno.h> and <string.h>.
3457 (_gpgme_parse_inv_userid): New function.
3458 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
3459 <assert.h> and "util.h".
3460 (SKIP_TOKEN_OR_RETURN): Remove macro.
3461 (struct sign_result): Change to op_data_t type and rework it.
3462 (release_sign_result): Rename to ...
3463 (release_op_data): ... this and rewrite it.
3464 (append_xml_info): Remove function.
3465 (gpgme_op_sign_result): New function.
3466 (parse_sig_created): New function.
3467 (_gpgme_sign_status_handler): Change first argument to void *.
3468 Rewrite the function to use the new result structure and functions.
3469 (_gpgme_op_sign_init_result): New function.
3470 (_gpgme_op_sign_start): Rename to ...
3471 (sign_start): ... this. Call _gpgme_op_sign_init_result.
3472 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
3473 (gpgme_op_sign): Likewise.
3474 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3475 _gpgme_op_sign_init_result.
3477 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
3479 (enum delete_problem): Move into function delete_status_handler.
3480 (delete_status_handler): Change first argument to void *. Parse
3481 delete problem with strtol instead atoi. Return better error
3483 (_gpgme_op_delete_start): Rename to ...
3484 (delete_start): ... this. Rework error handling.
3485 (gpgme_op_delete_start): Use delete_start instead
3486 _gpgme_op_delete_start.
3487 (gpgme_op_delete): Likewise.
3488 * gpgme.h (GpgmeDataType): Removed.
3490 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
3492 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
3493 * import.c (parse_import_res): Parse unchanged field.
3495 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
3496 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
3497 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
3498 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
3499 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3500 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3501 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3502 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3503 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3504 (struct _gpgme_import_status): New structure.
3505 (GpgmeImportStatus): New type.
3506 (struct _gpgme_op_import_result): New structure.
3507 (GpgmeImportResult): New type.
3508 (gpgme_op_import_result): New function.
3509 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3510 (struct import_result): Change to type op_data_t.
3511 (release_import_result): Rename to ...
3512 (release_op_data): ... this.
3513 (append_xml_impinfo): Function removed.
3514 (gpgme_op_import_result): New function.
3515 (parse_import): New function.
3516 (parse_import_res): Likewise.
3517 (import_status_handler): Change first argument to void *. Rewrite
3518 to use new functions.
3519 (_gpgme_op_import_start): Rework error handling.
3521 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3522 (edit_resut): Change to typedef for op_data_t.
3523 (edit_status_handler): Change first argument to void *.
3524 Rework error handling.
3525 (command_handler): Rework error handling.
3526 (_gpgme_op_edit_start): Rename to ...
3527 (edit_start): ... this. Rework error handling.
3528 (gpgme_op_edit_start): Rewrite using edit_start.
3529 (gpgme_op_edit): Likewise.
3531 * ops.h (_gpgme_passphrase_start): Remove prototype.
3532 * passphrase.c: Do not include <assert.h>, "util.h" or
3533 "debug.h", but "gpgme.h".
3534 (struct passphrase_result): Change to typedef for op_data_t.
3535 (release_passphrase_result): Rename to release_op_data.
3536 (_gpgme_passphrase_status_handler): Change first argument to void *.
3537 Use new op_data_t type.
3538 (_gpgme_passphrase_command_handler): Use new op_data_t type.
3539 (_gpgme_passphrase_start): Remove function.
3540 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
3541 not call _gpgme_passphrase_start, but install command handler.
3542 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3543 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3544 * sign.c (_gpgme_op_sign_start): Likewise.
3546 * context.h (struct gpgme_context_s): Remove member initialized,
3547 use_cms and help_data_1. Add member protocol. Make use_armor and
3548 use_textmode bit flags. Make keylist_mode, include_certs,
3549 signers_len and signers_size unsigned.
3550 * gpgme.c (gpgme_new): Initialize CTX->protocol.
3551 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
3552 (gpgme_get_protocol): Likewise.
3553 (gpgme_release): Do not release CTX->help_data_1.
3554 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3556 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3558 * data.c: Do not include <assert.h>, but "gpgme.h".
3559 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3560 it will go. Do not assert DH.
3561 (_gpgme_data_outbound_handler): Do not assert DH.
3563 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3565 (export_status_handler): Change type of first argument to void *.
3566 (_gpgme_op_export_start): Rename to ...
3567 (export_start): ... this. Rework error handling.
3568 (gpgme_op_export_start): Rewritten to use export_start instead
3569 _gpgme_op_export_start.
3570 (gpgme_op_export): Likewise.
3572 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3573 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3574 GPGME_No_Passphrase): New macros.
3576 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3578 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3580 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3581 (GpgmeGenKeyResult): New type.
3582 (gpgme_op_genkey): Drop last argument.
3583 (gpgme_op_genkey_result): New function.
3584 * genkey.c: Do not include "util.h", but "gpgme.h".
3585 (struct genkey_result): Replace with ...
3586 (op_data_t): ... this new type.
3587 (release_genkey_result): Replace with ...
3588 (release_op_data): ... this new function.
3589 (gpgme_op_genkey_result): New function.
3590 (genkey_status_handler): Rewritten using new op_data_t type.
3591 (get_key_parameter): New function.
3592 (_gpgme_op_genkey_start): Renamed to
3593 (genkey_start): ... this and rewritten.
3594 (gpgme_op_genkey_start): Use genkey_start instead
3595 _gpgme_op_genkey_start.
3596 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3598 * context.h (struct gpgme_context_s): Remove member verbosity.
3599 * gpgme.c (gpgme_new): Do not set member verbosity.
3600 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3601 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3602 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3603 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3604 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3605 (gpg_set_verbosity): Remove function.
3606 * decrypt.c (_gpgme_decrypt_start): Don't call
3607 _gpgme_engine_set_verbosity.
3608 * delete.c (_gpgme_op_delete_start): Likewise.
3609 * edit.c (_gpgme_op_edit_start): Likewise.
3610 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3611 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3612 * export.c (_gpgme_op_export_start): Likewise.
3613 * genkey.c (_gpgme_op_genkey_start): Likewise.
3614 * import.c (_gpgme_op_import_start): Likewise.
3615 * keylist.c (gpgme_op_keylist_start): Likewise.
3616 (gpgme_op_keylist_ext_start): Likewise.
3617 * sign.c (_gpgme_op_sign_start): Likewise.
3618 * verify.c (_gpgme_op_verify_start): Likewise.
3620 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3621 * key.c (key_cache_initialized, key_cache_size,
3622 key_cache_max_chain_length, ): Removed.
3623 (struct key_cache_item_s, key_cache_lock, key_cache,
3624 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3625 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3626 * key-cache.c: ... here. New file.
3627 * key.h (_gpgme_key_cache_init): Remove prototypes.
3628 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3630 * version.c: Do not include "key.h".
3631 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3633 * mkstatus: Strip trailing comma.
3634 * gpgme.h (GpgmeStatus): Pretty print.
3636 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3637 GPGME_Bad_Passphrase.
3638 * passphrase.c (_gpgme_passphrase_status_handler): Use
3639 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3641 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3642 GPGME_No_UserID and GPGME_Invalid_Recipient to
3643 GPGME_Invalid_UserID.
3644 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3645 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3646 GPGME_Invalid_Recipient.
3647 (_gpgme_op_encrypt_start): Likewise.
3649 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3650 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3651 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3652 * wait-global.c (gpgme_wait): Likewise.
3653 * verify.c (_gpgme_op_verify_start): Likewise.
3654 (gpgme_get_sig_status): Don't check pending flag.
3655 (gpgme_get_sig_string_attr): Likewise.
3656 (gpgme_get_sig_ulong_attr): Likewise.
3657 (gpgme_get_sig_key): Likewise.
3658 * op-support.c (_gpgme_op_reset): Likewise.
3659 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3660 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3661 (gpgme_op_trustlist_end): Likewise.
3662 * sign.c (_gpgme_op_sign_start): Likewise.
3663 * context.h (struct gpgme_context_s): Remove member PENDING.
3664 * decrypt.c (_gpgme_decrypt_start): Likewise.
3665 * delete.c (_gpgme_op_delete_start): Likewise.
3666 * edit.c (_gpgme_op_edit_start): Likewise.
3667 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3668 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3669 * export.c (_gpgme_op_export_start): Likewise.
3670 * genkey.c (_gpgme_op_genkey_start): Likewise.
3671 * import.c (_gpgme_op_import_start): Likewise.
3672 * key.c (gpgme_get_key): Likewise.
3673 * keylist.c (gpgme_op_keylist_start): Likewise.
3674 (gpgme_op_keylist_ext_start): Likewise.
3675 (gpgme_op_keylist_next): Likewise.
3676 (gpgme_op_keylist_end): Likewise.
3677 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3679 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3681 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3682 and add argument for returning the result string.
3683 (gpgme_cancel): Remove prototype.
3684 * gpgme.c (gpgme_cancel): Remove function.
3685 * context.h (struct gpgme_context_s): Remove member cancel.
3686 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3687 passphrase callback in the new way.
3689 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3691 * edit.c (_gpgme_edit_status_handler): Call the progress status
3694 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3696 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3697 I/O handlers left to ...
3698 (_gpgme_user_io_cb_handler): ... here.
3700 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3702 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3703 could not be allocated.
3704 (gpgme_trust_item_release): Only release name if it is allocated.
3705 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3707 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3709 * rungpg.c (read_status): If he status handler returns an error,
3711 (status_handler): If read_status fails, just return the error.
3713 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3715 * engine-gpgsm.c (start): Handle all errors, not only most of
3717 (xtoi_1, xtoi_2): Remove macro.
3718 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3720 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3722 * engine-gpgsm.c (map_assuan_error): Replace
3723 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3724 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3726 * util.h (DIMof): Remove macro.
3728 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3729 _gpgme_data_unread): Prototypes removed.
3731 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3733 * types.h: File removed.
3734 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3735 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3737 * context.h: Likewise.
3738 * cengine-gpgsm.h: Likewise.
3739 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3740 for EngineStatusHandler, EngineColonLineHandler and
3741 EngineCommandHandler.
3742 (_gpgme_engine_set_status_handler): Change parameter type from
3743 GpgmeStatusHandler to EngineStatusHandler.
3744 (_gpgme_engine_set_command_handler): Change parameter type from
3745 GpgmeCommandHandler to EngineCommandHandler.
3746 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3747 GpgmeColonLineHandler to EngineColonLineHandler.
3748 * engine-backend.h: Include "engine.h" instead "types.h".
3749 (struct engine_ops): Change Gpgme*Handler parameters in members
3750 set_command_handler, set_colon_line_handler and set_status_handler
3752 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3753 type from GpgmeStatusHandler to EngineStatusHandler.
3754 (_gpgme_engine_set_command_handler): Change parameter type from
3755 GpgmeCommandHandler to EngineCommandHandler.
3756 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3757 GpgmeColonLineHandler to EngineColonLineHandler.
3758 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3759 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3760 member colon.fnc from GpgmeColonLineHandler to
3761 EngineColonLineHandler. Change type of member cmd.fnc from
3762 GpgmeCommandHandler to EngineCommandHandler.
3763 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3764 * rungpg.c (gpg_set_status_handler): Change parameter type from
3765 GpgmeStatusHandler to EngineStatusHandler.
3766 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3767 (assuan_simple_command): Likewise.
3768 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3769 from GpgmeColonLineHandler to EngineColonLineHandler.
3770 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3771 * rungpg.c (gpg_set_command_handler): Change parameter type from
3772 GpgmeCommandHandler to EngineCommandHandler.
3774 * engine-gpgsm.c (status_handler): Do not close status fd at end
3777 * ops.h (_gpgme_op_data_lookup): Add prototype.
3778 * op-support.c: Include <stdlib.h>.
3779 (_gpgme_op_data_lookup): New function.
3780 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3781 (struct decrypt_result_s): Rename to ...
3782 (struct decrypt_resul): ... this.
3783 (DecryptResult): New type.
3784 (_gpgme_decrypt_status_handler): Don't use
3785 test_and_allocate_result, but use _gpgme_op_data_lookup to
3786 retrieve result data object.
3787 * sign.c (_gpgme_release_sign_result): Function removed.
3788 (release_sign_result): New function.
3789 (struct sign_result_s): Rename to ...
3790 (struct sign_result): ... this.
3791 (SignResult): New type.
3792 (_gpgme_sign_status_handler): Don't use
3793 test_and_allocate_result, but use _gpgme_op_data_lookup to
3794 retrieve result data object.
3795 * encrypt.c (struct encrypt_result_s): Rename to ...
3796 (struct encrypt_result): ... this.
3797 (_gpgme_release_encrypt_result): Function removed.
3798 (release_encrypt_result): New function.
3799 (_gpgme_encrypt_status_handler): Don't use
3800 test_and_allocate_result, but use _gpgme_op_data_lookup to
3801 retrieve result data object.
3802 * verify.c (struct verify_result_s): Rename to ...
3803 (struct verify_result): ... this. Remove member next.
3804 (VerifyResult): New type.
3805 (_gpgme_release_verify_result): Function removed.
3806 (release_verify_result): New function.
3807 (finish_sig): Change first argument to type VerifyResult. Diddle
3808 the type of the op_data structure.
3809 (add_notation): Change first argument to type VerifyResult.
3810 (_gpgme_verify_status_handler): Don't use
3811 test_and_allocate_result, but use _gpgme_op_data_lookup to
3812 retrieve result data object.
3813 * passphrase.c (struct passphrase_result_s): Rename to ...
3814 (struct passphrase_result): ... this. Remove member next.
3815 (PassphraseResult): New type.
3816 (_gpgme_release_passphrase_result): Function removed.
3817 (release_passphrase_result): New function.
3818 (_gpgme_passphrase_status_handler): Don't use
3819 test_and_allocate_result, but use _gpgme_op_data_lookup to
3820 retrieve result data object.
3821 (_gpgme_passphrase_command_handler): Likewise.
3822 * keylist.c (struct keylist_result_s): Rename to ...
3823 (struct keylist_result): ... this. Remove member next.
3824 (KeylistResult): New type.
3825 (_gpgme_release_keylist_result): Function removed.
3826 (release_keylist_result): New function.
3827 (keylist_status_handler): Don't use
3828 test_and_allocate_result, but use _gpgme_op_data_lookup to
3829 retrieve result data object.
3830 * edit.c (struct edit_result_s): Rename to ...
3831 (struct edit_result): ... this. Remove member next.
3832 (EditResult): New type.
3833 (_gpgme_release_edit_result): Function removed.
3834 (release_edit_result): New function.
3835 (edit_status_handler): Don't use
3836 test_and_allocate_result, but use _gpgme_op_data_lookup to
3837 retrieve result data object.
3838 (command_handler): Likewise.
3839 * types.h (DecryptResult, SignResult, EncryptResult,
3840 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3841 KeylistResult, EditResult): Types removed.
3842 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3843 (test_and_allocate_result): Remove macro.
3844 (_gpgme_release_decrypt_result): Remove prototype.
3845 (_gpgme_decrypt_result): Remove prototype.
3846 (_gpgme_release_sign_result): Remove prototype.
3847 (_gpgme_release_encrypt_result): Remove prototype.
3848 (_gpgme_release_passphrase_result): Remove prototype.
3849 (_gpgme_release_import_result): Remove prototype.
3850 (_gpgme_release_delete_result): Remove prototype.
3851 (_gpgme_release_genkey_result): Remove prototype.
3852 (_gpgme_release_keylist_result): Remove prototype.
3853 (_gpgme_release_edit_result): Remove prototype.
3854 (_gpgme_release_verify_result): Remove prototype.
3855 * gpgme.c (_gpgme_release_result): Rewritten.
3856 * context.h (enum ctx_op_data_type): New enum.
3857 (struct ctx_op_data): New structure.
3858 (struct gpgme_context_s): Replace the member result with a member
3860 (fail_on_pending_request): Remove macro.
3861 * op-support.c (_gpgme_op_reset): Expand macro
3862 fail_on_pending_request.
3863 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3865 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3867 * types.h (EngineObject): Move typedef to ...
3868 * engine.h: ... here.
3869 * types.h (GpgObject): Move typedef to ...
3870 * rungpg.c: ... here.
3871 * types.h (GpgsmObject): Move typedef to ...
3872 * engine-gpgsm.c: ... here.
3874 * util.h (return_if_fail, return_null_if_fail,
3875 return_val_if_fail): Remove macro.
3876 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3877 * key.c (gpgme_key_ref): Likewise.
3878 * signers.c (gpgme_signers_enum): Likewise.
3879 (gpgme_signers_clear): Likewise.
3881 * engine-backend.h (struct engine_ops): Rename get_path to
3883 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3885 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3886 util.h. Other clean ups.
3887 (parse_version_number): Protect more seriously against
3889 (gpgme_get_engine_info): Move to ...
3890 * engine.c (gpgme_get_engine_info): ... here.
3891 (_gpgme_engine_get_info): Function removed.
3892 (_gpgme_engine_get_path): Make static and rename to ...
3893 (engine_get_file_name): .. this.
3894 (_gpgme_engine_get_version): Make static and rename to ...
3895 (engine_get_version): ... this.
3896 (_gpgme_engine_get_req_version): Make static and rename to ...
3897 (engine_get_req_version): ... this.
3898 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3899 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3902 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3903 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3904 (gpgme_get_protocol_name): New function.
3906 * engine-backend.h (struct engine_ops): New member
3907 get_req_version, remove member check_version.
3908 * engine.h (_gpgme_Engine_get_version): New prototype.
3909 * rungpg.c (gpg_get_req_version): New function.
3910 (gpg_check_version): Function removed.
3911 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3913 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3914 (gpgsm_check_version): Function removed.
3915 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3916 gpgsm_check_version.
3917 * engine.c: Include ops.h.
3918 (_gpgme_engine_get_req_version): New function.
3919 (gpgme_engine_check_version): Rewritten.
3920 * version.c (gpgme_get_engine_info): Rewritten.
3921 * gpgme.h (gpgme_engine_info): New structure.
3922 (GpgmeEngineInfo): New type.
3924 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3926 * types.h: Remove byte and ulong types.
3927 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3929 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3931 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3932 few more escaped characters. Be more strict about buffer size.
3933 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3934 BUF and DST to unsigned char instead byte.
3935 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3937 * debug.c (trim_spaces): Likewise.
3939 * util.h (mk_error): Remove macro.
3940 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3941 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3942 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3943 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3944 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3945 wait-private (literally everywhere): Expand the mk_error macro.
3947 * context.h (wait_on_request_or_fail): Remove macro.
3949 * context.h (gpgme_context_s): Remove member ERROR.
3950 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3951 (GpgmeCommandHandler): Change return type to GpgmeError and add
3952 new argument RESULT.
3953 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3954 (GpgmeEventIO): New event GPGME_EVENT_START.
3955 (GpgmeIdleFunc): Remove type.
3956 (gpgme_register_idle): Remove prototype.
3957 * data.c: Include <assert.h>.
3958 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3959 Return any error instead ignoring it, don't close file descriptor
3961 (_gpgme_data_outbound_handler): Likewise.
3962 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3963 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3964 Return error instead setting ctx->error. Return success at end of
3966 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3967 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3968 type to GpgmeError. Return possible errors.
3969 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3971 (delete_status_handler): Change return type to GpgmeError. Return
3972 error instead setting ctx->error. Return success at end of
3974 * edit.c: Do not include <stdio.h> and <string.h>.
3975 (_gpgme_edit_status_handler): Change type to GpgmeError,
3976 make static and rename to ...
3977 (edit_status_handler): ... this. Return error directly.
3978 (command_handler): Change return type to GpgmeError, add result
3979 argument. Return error directly.
3980 * encrypt.c (status_handler_finish): Remove function.
3981 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3982 Return error directly.
3983 (_gpgme_encrypt_sym_status_handler): Likewise.
3984 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3985 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3987 (status_handler): Change return type to GpgmeError. Diddle things
3988 around a bit to return errors directly.
3989 (start): Send start event.
3990 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3991 (export_status_handler): Change return type to GpgmeError. Don't
3993 * genkey.c: Do not include <stdio.h> and <assert.h>.
3994 (genkey_status_handler): Change return type to GpgmeError. Don't
3995 check ctx->error. Return errors directly.
3996 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3997 (_gpgme_op_event_cb): Function removed.
3998 (_gpgme_op_event_cb_user): Likewise.
3999 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4000 (import_status_handler): Change return type to GpgmeError. Don't
4002 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
4003 Change return type to GpgmeError, return error directly.
4004 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
4005 wait-private.c and wait-user.c
4006 * ops.h (test_and_allocate_result): Return error instead setting
4008 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
4009 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
4010 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
4011 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
4012 Change return type to GpgmeError.
4013 (_gpgme_passphease_command_handler): Change return type to
4014 GpgmeError and add new argument RESULT.
4015 * op-support.c: Use new callback functions, and change private
4016 data to ctx everywhere.
4017 * passphrase.c (_gpgme_passphrase_status_handler): Change return
4018 type to GpgmeError, return error directly.
4019 (_gpgme_passphrase_command_handler): Change return type to
4020 GpgmeError, add result argument. Return results accordingly.
4021 * progress.c (_gpgme_progress_status_handler): Change return type
4022 to GpgmeError, return errors directly.
4023 * rungpg.c (status_handler): Change return type to GpgmeError.
4024 Return error directly.
4025 (close_notify_handler): Don't send done event.
4026 (colon_line_handler): Change return type to GpgmeError, return
4028 * rungpg.c (start): Send start event.
4029 * sign.c (_gpgme_sign_status_handler): Change return type to
4030 GpgmeError, return errors directly.
4031 * trustlist.c (trustlist_status_handler): Change return type to
4032 GpgmeError. Return 0.
4033 (trustlist_colon_handler): Change return type GpgmeError. Return
4035 * verify.c (add_notation): Change return type to GpgmeError,
4036 return errors directly.
4037 (_gpgme_verify_status_handler): Likewise.
4038 * wait.h (struct fd_table): Remove lock member.
4039 (struct wait_item_s): Moved here from wait.c.
4040 (struct tag): New structure.
4041 (_gpgme_wait_event_cb): Remove prototype.
4042 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
4043 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
4044 _gpgme_wait_user_event_io_cb): New prototypes.
4045 * wait.c: Don't include <stdio.h>.
4046 (ftd_global, ctx_done_list, ctx_done_list_size,
4047 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
4049 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
4051 (gpgme_wait): Move to file wait-global.c.
4052 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
4053 member in wait item and tag.
4054 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
4055 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
4057 (gpgme_fd_table_init): Don't initialize FDT->lock.
4058 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
4059 (_gpgme_fd_table_put): Make static and rename to ...
4060 (fd_table_put): ... this function. Don't use FDT->lock.
4061 (struct wait_item_s): Move to wait.h.
4062 * wait-global.c: New file.
4063 * wait-private.c: New file.
4064 * wait-user.c: New file.
4066 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
4067 instead otrust_to_string to calculate validity.
4069 2003-01-19 Miguel Coca <mcoca@gnu.org>
4071 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
4073 * w32-util.c: Include "sema.h".
4074 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
4077 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
4079 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
4080 (gpg_start): Rename to ...
4081 (start): ... this function. Change arguments to GpgObject.
4082 (gpg_decrypt): Call start.
4083 (gpg_edit): Likewise.
4084 (gpg_encrypt): Likewise.
4085 (gpg_encrypt_sign): Likewise.
4086 (gpg_export): Likewise.
4087 (gpg_import): Likewise.
4088 (gpg_keylist): Likewise.
4089 (gpg_keylist_ext): Likewise.
4090 (gpg_trustlist): Likewise.
4091 (gpg_verify): Likewise.
4093 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
4094 (gpgsm_start): Rename to ...
4095 (struct gpgsm_object_s): Remove member command.
4096 (gpgsm_release): Don't free command.
4097 (start): ... this function. Change arguments to GpgsmObject and
4099 (gpgsm_decrypt): Call start.
4100 (gpgsm_delete): Likewise.
4101 (gpgsm_encrypt): Likewise.
4102 (gpgsm_export): Likewise.
4103 (gpgsm_genkey): Likewise.
4104 (gpgsm_import): Likewise.
4105 (gpgsm_keylist): Likewise.
4106 (gpgsm_keylist_ext): Likewise.
4107 (gpgsm_verify): Likewise.
4109 * decrypt.c (_gpgme_decrypt_start): Don't call
4110 _gpgme_engine_start.
4111 * delete.c (_gpgme_op_delete_start): Likewise.
4112 * edit.c (_gpgme_op_edit_start): Likewise.
4113 * encrypt.c (_gpgme_op_encrypt_start):
4114 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
4115 * export.c (_gpgme_op_export_start): Likewise.
4116 * genkey.c (_gpgme_op_genkey_start): Likewise.
4117 * import.c (_gpgme_op_import_start): Likewise.
4118 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
4119 (gpgme_op_keylist_start): Likewise.
4120 * sign.c (_gpgme_op_sign_start): Likewise.
4121 * trustlist.c (gpgme_op_trustlist_start): Likewise.
4122 * verify.c (_gpgme_op_verify_start): Likewise.
4124 * engine-backend.h (struct engine_ops): Remove member start.
4126 * engine.h (_gpgme_engine_start): Remove prototype.
4127 * engine.c (_gpgme_engine_start): Remove function.
4129 2003-01-06 Werner Koch <wk@gnupg.org>
4131 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
4132 since gpg 1.3 to denote disabled keys.
4134 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
4136 * data-mem.c: Include <string.h>.
4137 * engine.c: Likewise.
4139 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
4141 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
4143 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
4145 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
4147 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
4149 * verify.c (gpgme_op_verify): Drop R_STAT argument.
4150 (_gpgme_intersect_stati): Function removed.
4151 * ops.h (_gpgme_intersect_stati): Remove prototype.
4153 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
4155 * libgpgme.vers: New file.
4156 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
4157 (libgpgme_version_script_cmd): New variable.
4158 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
4159 (libgpgme_la_DEPENDENCIES): New variable.
4161 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
4163 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
4164 (otrust_to_string): New function.
4165 (gpgme_key_get_as_xml): Use it.
4166 (validity_to_string): New function.
4167 (gpgme_key_get_string_attr): Beautify using above functions.
4168 (gpgme_key_get_ulong_attr): Likewise.
4170 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
4172 * data-mem.c (mem_release): Fix gcc warning.
4173 * data-user.c (user_release): Likewise.
4175 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
4177 * data.h (gpgme_data_release_cb): Change return type to void.
4178 (gpgme_data_read_cb): Change return type to ssize_t.
4179 * data.c (gpgme_data_read): Likewise.
4180 * data-stream.c (stream_read): Likewise.
4181 * data-fd.c (fd_read): Likewise.
4182 * data-mem.c (mem_read): Likewise.
4183 (mem_release): Change return type to void.
4184 * data-user.c (user_read): Change return type to ssize_t.
4185 (user_release): Change return type to void.
4186 * data-compat.c (old_user_read): Change return type to ssize_t.
4187 * gpgme.h (GpgmeDataReadCb): Likewise.
4188 (gpgme_data_read): Likewise.
4189 (GpgmeDataSeekCb): Change return type to off_t.
4191 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
4193 * gpgme.h: Add prototype for gpgme_get_key.
4194 * key.c (gpgme_get_key): New function.
4195 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
4197 * gpgme.h: Add prototypes for new interfaces
4198 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
4199 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
4200 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
4201 * key.h (struct certsig_s): New members ALGO, NAME_PART,
4202 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
4204 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
4205 Use that to determine if allocation is desired or not.
4206 * util.h: Adjust prototype of _gpgme_decode_c_string.
4207 * keylist.c (keylist_colon_handler): Adjust caller of
4208 _gpgme_decode_c_string.
4210 * key.h (struct gpgme_key_s): New member last_uid.
4211 * key.c (_gpgme_key_append_name): Rewritten using
4212 _gpgme_decode_c_string and the last_uid pointer.
4213 (my_isdigit): Macro removed.
4214 (ALLOC_CHUNK): Likewise.
4215 * keylist.c (set_userid_flags): Use last_uid member of KEY.
4217 * context.h (struct user_id_s): New member last_certsig.
4218 * key.h: Add prototype for _gpgme_key_add_certsig.
4219 * key.c (_gpgme_key_add_certsig): New function.
4220 (set_user_id_part): Move function before _gpgme_key_add_certsig.
4221 (parse_user_id): Change first argument to SRC, add new arguments
4222 NAME, EMAIL and COMMENT. Change code to use these arguments
4223 instead going through UID. Move function before
4225 (parse_x509_user_id): Likewise.
4226 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
4227 and parse_user_id invocation.
4228 (one_certsig_as_xml): New function.
4229 (one_uid_as_xml): Print signatures.
4230 * context.h (struct gpgme_context_s): New member TMP_UID.
4231 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
4234 * key.c (get_certsig): New function.
4235 (gpgme_key_sig_get_string_attr): Likewise.
4236 (gpgme_key_sig_get_ulong_attr): Likewise.
4238 * keylist.c: Include <ctype.h>.
4239 (my_isdigit): Macro removed.
4240 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
4241 (set_userid_flags): Likewise.
4242 (set_subkey_trust_info): Likewise.
4243 (set_ownertrust): Likewise.
4244 (finish_key): Move function up a bit and remove prototype.
4246 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
4248 (gpg_keylist_ext): Implement signature listing mode.
4250 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
4252 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
4253 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
4255 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
4256 CloseHandle for parent fds.
4258 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
4260 * gpgme.h [_MSC_VER]: Define ssize_t as long.
4262 2002-11-22 Werner Koch <wk@gnupg.org>
4264 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
4265 setlocale before doing another setlocale.
4267 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
4269 * decrypt.c: Some beautyfication.
4271 * verify.c (_gpgme_verify_status_handler): Treat
4272 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
4273 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
4275 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
4277 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
4278 (struct genkey_result_s): Add new member FPR.
4279 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
4280 (genkey_status_handler): Extract the fingerprint from the status
4282 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
4284 * gpgme.h: Adjust prototype of gpgme_op_genkey.
4286 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
4288 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
4289 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
4290 <twoaday@freakmail.de>.
4291 (gpg_keylist_ext): Likewise.
4293 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
4295 * import.c (append_xml_impinfo): Use
4296 _gpgme_data_append_string_for_xml rather than
4297 _gpgme_data_append_string for the field content.
4298 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
4300 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
4302 * rungpg.h, engine-gpgsm.h: File removed.
4303 * engine-backend.h: New file.
4304 * Makefile.am (gpgsm_components): New variable, set depending on
4305 automake conditional HAVE_GPGSM.
4306 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
4307 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
4308 (status-table.h): Depend on gpgme.h, not rungpg.h.
4309 * conversion.c: Include <stdlib.h>.
4310 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
4311 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
4312 functions and remove all function prototypes.
4313 (_gpgme_gpgsm_get_version): Make static and rename to ...
4314 (gpgsm_get_version): ... this.
4315 (_gpgme_gpgsm_check_version): Make static and rename to ...
4316 (gpgsm_check_version): ... this.
4317 (_gpgme_gpgsm_new): Make static. Change argument type from
4318 GpgsmObject * to void **. Call gpgsm_release instead
4319 _gpgme_gpgsm_release.
4320 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
4321 (gpgsm_check_decrypt): ... this.
4322 (_gpgme_gpgsm_op_delete): Make static and rename to ...
4323 (gpgsm_check_delete): ... this.
4324 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
4325 (gpgsm_check_set_recipients): ... this.
4326 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
4327 (gpgsm_encrypt): ... this.
4328 (_gpgme_gpgsm_op_export): Make static and rename to ...
4329 (gpgsm_export): ... this.
4330 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
4331 (gpgsm_genkey): ... this.
4332 (_gpgme_gpgsm_op_import): Make static and rename to ...
4333 (gpgsm_import): ... this.
4334 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
4335 (gpgsm_keylist): ... this.
4336 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
4337 (gpgsm_keylist_ext): ... this.
4338 (_gpgme_gpgsm_op_sign): Make static and rename to ...
4339 (gpgsm_sign): ... this.
4340 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
4341 (gpgsm_trustlist): ... this.
4342 (_gpgme_gpgsm_op_verify): Make static and rename to ...
4343 (gpgsm_verify): ... this.
4344 (gpgsm_status_handler): Rename to ...
4345 (status_handler): ... this.
4346 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
4347 (gpgsm_set_status_handler): ... this.
4348 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
4349 (gpgsm_set_colon_line_handler): ... this.
4350 (_gpgme_gpgsm_add_io_cb): Rename to ...
4351 (add_io_cb): ... this.
4352 (_gpgme_gpgsm_start): Make static and rename to ...
4353 (gpgsm_start): ... this.
4354 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
4355 (gpgsm_set_io_cb): ... this.
4356 (_gpgme_gpgsm_io_event): Make static and rename to ...
4357 (gpgsm_io_event): ... this.
4358 (struct _gpgme_engine_ops_gpgsm): New variable.
4359 [!ENABLE_GPGSM]: Removed.
4360 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
4361 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
4362 <stdlib.h> and "engine-backend.h".
4363 (struct engine_object_s): Rewritten.
4364 (engine_ops): New variable.
4365 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
4366 _gpgme_engine_check_version, _gpgme_engine_new,
4367 _gpgme_engine_release, _gpgme_engine_set_verbosity,
4368 _gpgme_engine_set_status_handler,
4369 _gpgme_engine_set_command_handler,
4370 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
4371 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
4372 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
4373 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
4374 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
4375 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
4376 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
4377 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
4378 _gpgme_engine_io_event): Reimplement.
4379 * engine.h: Fix a few comments and a variable name in a prototype.
4380 * ops.h: Do not include "rungpg.h".
4381 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
4383 * recipient.c: Likewise.
4384 * signers.c: Likewise.
4385 * version.c: Likewise.
4386 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
4387 functions and remove prototypes.
4388 (_gpgme_gpg_get_version): Make static and rename to ...
4389 (gpg_get_version): ... this.
4390 (_gpgme_gpg_check_version): Make static and rename to ...
4391 (gpg_check_version): ... this.
4392 (_gpgme_gpg_new): Make static. Change argument type from
4393 GpgObject * to void **. Call gpg_release instead
4395 (_gpgme_gpg_op_decrypt): Make static and rename to ...
4396 (gpg_check_decrypt): ... this.
4397 (_gpgme_gpg_op_delete): Make static and rename to ...
4398 (gpg_check_delete): ... this.
4399 (_gpgme_gpg_set_recipients): Make static and rename to ...
4400 (gpg_check_set_recipients): ... this.
4401 (_gpgme_gpg_op_encrypt): Make static and rename to ...
4402 (gpg_encrypt): ... this.
4403 (_gpgme_gpg_op_export): Make static and rename to ...
4404 (gpg_export): ... this.
4405 (_gpgme_gpg_op_genkey): Make static and rename to ...
4406 (gpg_genkey): ... this.
4407 (_gpgme_gpg_op_import): Make static and rename to ...
4408 (gpg_import): ... this.
4409 (_gpgme_gpg_op_keylist): Make static and rename to ...
4410 (gpg_keylist): ... this.
4411 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
4412 (gpg_keylist_ext): ... this.
4413 (_gpgme_gpg_op_sign): Make static and rename to ...
4414 (gpg_sign): ... this.
4415 (_gpgme_gpg_op_trustlist): Make static and rename to ...
4416 (gpg_trustlist): ... this.
4417 (_gpgme_gpg_op_verify): Make static and rename to ...
4418 (gpg_verify): ... this.
4419 (gpg_status_handler): Rename to ...
4420 (status_handler): ... this.
4421 (_gpgme_gpg_set_status_handler): Make static and rename to ...
4422 (gpg_set_status_handler): ... this.
4423 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
4424 (gpg_set_colon_line_handler): ... this.
4425 (gpgme_gpg_add_io_cb): Rename to ...
4426 (add_io_cb): ... this.
4427 (_gpgme_gpg_start): Make static and rename to ...
4428 (gpg_start): ... this.
4429 (_gpgme_gpg_set_io_cb): Make static and rename to ...
4430 (gpg_set_io_cb): ... this.
4431 (_gpgme_gpg_io_event): Make static and rename to ...
4432 (gpg_io_event): ... this.
4433 (struct _gpgme_engine_ops_gpg): New variable.
4435 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
4437 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
4440 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
4442 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
4443 data-compat.c: New file. Really check them in this time, completes
4446 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
4448 * types.h (GpgmeStatusHandler): ... here.
4449 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
4451 * types.h (GpgmeColonLineHandler): ... here.
4452 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
4454 * types.h (GpgmeCommandHandler): ... here.
4455 * engine.h: Don't include "rungpg.h".
4456 (_gpgme_engine_set_status_handler): Change type of
4457 argument from GpgStatusHandler to GpgmeStatusHandler.
4458 (_gpgme_engine_set_colon_line_handler): Change type of
4459 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4460 (_gpgme_engine_set_command_handler): Change type of
4461 argument from GpgCommandHandler to GpgmeCommandHandler.
4462 * engine-gpgsm.h: Don't include "rungpg.h".
4463 (_gpgme_gpgsm_set_status_handler): Change type of
4464 argument from GpgStatusHandler to GpgmeStatusHandler.
4465 (_gpgme_gpgsm_set_colon_line_handler): Change type of
4466 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4467 * engine-gpgsm.c: Do not include "rungpg.h".
4468 (struct gpgsm_object_s): Change type of
4469 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
4470 GpgmeColonLineHandler.
4471 (gpgsm_assuan_simple_command): Change type of argument from
4472 GpgStatusHandler to GpgmeStatusHandler.
4473 (_gpgme_gpgsm_set_status_handler): Likewise.
4474 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
4475 GpgColonLineHandler to GpgmeColonLineHandler.
4476 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
4477 argument from GpgStatusHandler to GpgmeStatusHandler.
4478 (_gpgme_gpg_set_colon_line_handler): Change type of
4479 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4480 (_gpgme_gpg_set_command_handler): Change type of
4481 argument from GpgCommandHandler to GpgmeCommandHandler.
4482 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
4483 GpgmeStatusHandler. Change type of colon.fnc to
4484 GpgmeColonLineHandler. Change type of cmd.fnc to
4485 GpgmeCommandLineHandler.
4486 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
4488 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
4489 to GpgmeColonLineHandler.
4490 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
4491 GpgmeCommandHandler.
4492 * engine.c (_gpgme_engine_set_status_handler): Change type of
4493 argument FNC to GpgmeStatusHandler.
4494 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
4495 to GpgmeColonLineHandler.
4496 (_gpgme_engine_set_command_handler): Change type of argument FNC to
4497 GpgmeCommandHandler.
4499 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4500 * rungpg.c (struct gpg_object_s): Remove PM.
4501 (pipemode_cb): Prototype removed.
4502 (add_pm_data): Function removed.
4503 (_gpgme_gpg_enable_pipemode): Likewise.
4504 (pipemode_copy): Likewise.
4505 (pipemode_cb): Likewise.
4506 (add_arg): Don't check for pipemode.
4507 (add_data): Likewise.
4508 (_gpgme_gpg_set_status_handler): Likewise.
4509 (_gpgme_gpg_set_colon_line_handler): Likewise.
4510 (_gpgme_gpg_set_command_handler): Likewise.
4511 (_gpgme_gpg_spawn): Likewise.
4512 (_gpgme_gpg_spawn): Don't set PM.active.
4513 (_gpgme_gpg_op_verify): Remove pipemode case.
4514 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4516 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4517 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4518 _gpgme_gpg_set_simple_line_handler): Prototype removed.
4519 (_gpgme_gpg_set_verbosity): New prototype.
4520 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4521 (add_data): ... this.
4522 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4523 (_gpgme_gpg_set_command_handler): Likewise.
4524 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4525 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4526 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4527 _gpgme_gpg_op_verify): Likewise.
4528 (_gpgme_gpg_add_pm_data): Rename to ...
4529 (add_pm_data): ... this.
4530 (_gpgme_gpg_op_verify): Call add_pm_data, not
4531 _gpgme_gpg_add_pm_data.
4532 (_gpgme_gpg_add_arg): Make static and rename to ...
4533 (add_arg): ... this.
4534 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4535 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4536 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4537 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4538 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4539 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4540 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4541 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4543 (_gpgme_gpg_set_verbosity): New function.
4544 (struct gpg_object_s): Remove member simple from colon.
4545 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4546 (_gpgme_gpg_set_simple_line_handler): Removed function.
4547 (read_colon_line): Don't check the GPG->colon.simple.
4548 * engine.c (_gpgme_engine_set_verbosity): Call
4549 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4551 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4553 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4554 _gpgme_strdup, _gpgme_free): Remove prototypes.
4555 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4557 * util.c: File removed.
4558 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4559 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4560 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4561 xtrycalloc, free instead of xfree.
4562 (_gpgme_data_append_percentstring_for_xml): Likewise.
4563 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4564 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4565 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4566 _gpgme_data_get_as_string): Likewise.
4567 * debug.c (debug_init): Likewise.
4568 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4569 * delete.c (_gpgme_release_delete_result): Likewise.
4570 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4572 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4573 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4574 _gpgme_engine_release): Likewise.
4575 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4576 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4577 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4578 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4579 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4580 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4581 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4582 * genkey.c (_gpgme_release_genkey_result): Likewise.
4583 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4584 * import.c (_gpgme_release_import_result): Likewise.
4585 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4586 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4587 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4588 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4589 * ops.h (test_and_allocate_result): Likewise.
4590 * passphrase.c (_gpgme_release_passphrase_result,
4591 _gpgme_passphrase_status_handler,
4592 _gpgme_passphrase_command_handler): Likewise.
4593 * progress.c (_gpgme_progress_status_handler): Likewise.
4594 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4595 gpgme_recipients_add_name_with_validity): Likewise.
4596 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4597 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4598 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4599 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4601 * sign.c (_gpgme_release_sign_result): Likewise.
4602 * signers.c (_gpgme_signers_add): Likewise.
4603 * trustlist.c (trust_item_new, trustlist_colon_handler,
4604 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4605 gpgme_trustitem_release): Likewise.
4606 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4607 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4609 * w32-io.c (create_reader, create_writer, destroy_reader,
4610 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4611 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4612 * w32-util.c (read_w32_registry_string): Likewise.
4613 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4614 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4615 * data-compat.c: Include <stdlib.h>.
4617 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4619 New data object component:
4621 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4622 GpgmeDataReleaseCb): New types.
4623 (struct GpgmeDataCbs): New structure.
4624 (gpgme_data_read): Changed prototype to match that of read() closely.
4625 (gpgme_data_write): Similar for write().
4626 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4627 gpgme_data_new_from_stream): New prototypes.
4628 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4630 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4631 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4632 * data.c: Reimplemented from scratch.
4633 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4634 data-user.c): New file.
4635 * context.h (struct gpgme_data_s): Removed.
4636 * conversion.c: Include <errno.h> and <sys/types.h>.
4637 (_gpgme_data_append): New function.
4638 * data.c (_gpgme_data_append_string): Move to ...
4639 * conversion.c (_gpgme_data_append_string): ... here.
4640 * data.c (_gpgme_data_append_for_xml): Move to ...
4641 * conversion.c (_gpgme_data_append_for_xml): ... here.
4642 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4643 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4644 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4645 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4647 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4649 * types.h (GpgmeDataMode): Type removed.
4651 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4652 * edit.c (_gpgme_op_edit_start): Likewise.
4653 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4654 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4655 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4656 * export.c (_gpgme_op_export_start): Likewise.
4657 * genkey.c (_gpgme_op_genkey_start): Likewise.
4658 * import.c (_gpgme_op_import_start): Likewise.
4659 * sign.c (_gpgme_op_sign_start): Likewise.
4660 * verify.c (_gpgme_op_verify_start): Likewise.
4662 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4663 no recipient if no data was returned.
4664 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4665 no recipient if no data was returned.
4666 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4667 no recipient if no data was returned.
4669 * engine.c (_gpgme_engine_op_verify): Add new argument to
4670 differentiate detached from normal signatures.
4671 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4672 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4673 mode of data argument.
4674 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4675 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4676 (gpgme_op_verify): Likewise for prototype.
4677 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4678 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4679 * verify.c (_gpgme_op_verify_start): Likewise.
4680 (gpgme_op_verify_start): Likewise.
4681 (gpgme_op_verify): Likewise.
4683 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4684 direction of data object.
4685 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4686 determine direction of data object.
4687 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4688 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4689 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4690 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4691 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4693 (build_argv): Use new member INBOUND to determine direction of
4694 file descriptor. Don't check the data type.
4695 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4697 * gpgme.c (gpgme_get_op_info): Don't call
4698 _gpgme_data_get_as_string if CTX->op_info is NULL.
4700 * version.c (gpgme_check_engine): Function removed.
4702 2002-09-30 Werner Koch <wk@gnupg.org>
4704 * keylist.c (keylist_colon_handler): Take care when printing a
4705 NULL with the DEBUG.
4707 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4708 (gpgsm_status_handler): Run the colon function to indicate EOF.
4709 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4711 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4713 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4714 multiplication with base. Reported by Stéphane Corthésy.
4716 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4717 operation type in invocation of _gpgme_op_reset.
4719 2002-09-20 Werner Koch <wk@gnupg.org>
4721 * ath.c: Include sys/time.h if sys/select.h is not available.
4723 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4725 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4726 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4728 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4730 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4731 into gpgme unconditionally.
4732 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4734 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4736 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4738 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4740 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4741 (_gpgme_debug_end): Likewise.
4742 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4744 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4746 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4748 * version.c (_gpgme_get_program_version): Likewise.
4749 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4751 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4753 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4756 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4758 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4759 _gpgme_op_edit so its prototype is known early on.
4761 * conversion.c: New file.
4762 * util.h: Add prototypes for _gpgme_decode_c_string and
4764 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4766 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4767 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4768 calls to _gpgme_hextobyte.
4769 (hash_key): Likewise.
4771 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4773 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4774 _gpgme_engine_release, as this will reset pending to zero in the
4775 event done callback on cancelled operations.
4777 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4779 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4780 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4782 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4783 * rungpg.h: Also to prototype.
4784 * engine.c (_gpgme_engine_op_edit): Likewise.
4785 * engine.h: Likewise.
4786 * edit.c (_gpgme_op_edit_start): Likewise.
4788 2002-08-29 Werner Koch <wk@gnupg.org>
4790 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4792 * vasprintf.c (va_copy): Define macro if not yet defined.
4794 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4796 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4797 CTX->result.passphrase->no_passphrase if passphrase is given (good
4798 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4800 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4802 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4803 Return 0 on success, -1 on error.
4804 * version.c (_gpgme_get_program_version): Don't wait for the child.
4805 * engine.c (_gpgme_engine_housecleaning): Function removed.
4806 (do_reaping): Likewise.
4807 (_gpgme_engine_add_child_to_reap_list): Likewise.
4808 (struct reap_s): Removed.
4809 (reap_list): Likewise.
4810 (reap_list_lock): Likewise.
4811 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4812 _gpgme_engine_housecleaning and
4813 _gpgme_engine_add_child_to_reap_list.
4814 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4815 (struct gpg_object_s): Remove PID member.
4816 (_gpgme_gpg_new): Don't initialize GPG->pid.
4817 (_gpgme_gpg_spawn): Don't set GPG->pid.
4818 * wait.c (run_idle): Removed.
4819 (gpgme_wait): Run idle_function directly.
4821 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4823 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4824 variables encrypt_info and encrypt_info_len.
4825 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4826 * posix-sema.c (sema_fatal): Remove function.
4827 All these reported by Stéphane Corthésy.
4829 2002-08-23 Werner Koch <wk@gnupg.org>
4831 * gpgme-config.in: Made --prefix work for --libs.
4833 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4835 * ath.h: Update list of symbols that get a prefix: Rename the
4836 ath_mutex_*_available symbols to ath_*_available.
4838 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4840 * stpcpy.c: New file from gnulib.
4841 * Makefile.am (assuan_libobjs): Remove jnlib.
4843 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4845 * gpgme.h: Add prototype for gpgme_op_import_ext.
4846 * import.c (struct import_result_s): New member `nr_considered'.
4847 Rename `any_imported' to `nr_imported'.
4848 (import_status_handler): Increment nr_imported. Set nr_considered
4850 (gpgme_op_import_ext): New function.
4851 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4853 2002-08-20 Werner Koch <wk@gnupg.org>
4855 * gpgme.m4: Replaced with a new and faster version. This does not
4856 anymore try to build test programs. If we really need test
4857 programs, we should add an option to gpgme-config to do so.
4859 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4861 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4863 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4864 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4867 2002-08-19 Werner Koch <wk@gnupg.org>
4869 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4870 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4871 (_gpgme_decrypt_status_handler): Create an operation info.
4873 2002-08-14 Werner Koch <wk@gnupg.org>
4875 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4876 * key.c (gpgme_key_release): Release it. We need to add more code
4878 (_gpgme_key_append_name): Use memset to intialize the struct.
4879 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4880 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4883 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4884 information about the key type (PGP or X.509).
4885 (gpgme_key_get_ulong_attr): Likewise.
4887 * keylist.c (keylist_colon_handler): Include 1 in the check for
4888 valid algorithms so that RSA is usable. Store the issuer name and
4889 serial number also for "crs" records. Parse the expire date for
4891 (set_userid_flags): Put them onto the last appended key.
4893 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4895 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4897 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4899 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4902 The following changes make it possible to flush an inbound data
4903 pipe before invoking a command handler:
4905 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4906 _gpgme_io_select. Set timeout of 0 if this is set.
4907 * w32-io.c (_gpgme_io_select): Likewise.
4908 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4909 * wait.c (do_select): Add new argument to _gpgme_io_select
4911 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4912 linked_data to prototype.
4913 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4914 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4915 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4916 argument to _gpgme_engine_set_command_handler.
4917 * rungpg.c (struct gpg_object_s): New members linked_data and
4919 (_gpgme_gpg_new): Initialize those new members.
4920 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4921 (build_argv): Handle linked_data in the same hack as cb_data.
4922 (read_status): If linked_data is in use, flush the pipe before
4923 activating the command handler.
4924 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4927 The next changes export the status codes to the user:
4929 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4930 all STATUS_ with GPGME_.
4931 * delete.c (delete_status_handler): Likewise.
4932 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4933 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4934 (_gpgme_encrypt_sym_status_handler): Likewise.
4935 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4936 * engine-gpgsm.c (parse_status): Likewise.
4937 (gpgsm_status_handler): Likewise.
4938 (gpgsm_set_recipients): Likewise.
4939 * export.c (export_status_handler): Likewise.
4940 * genkey.c (genkey_status_handler): Likewise.
4941 * import.c (append_xml_impinfo): Likewise.
4942 (import_status_handler): Likewise.
4943 * keylist.c (keylist_status_handler): Likewise.
4944 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4945 (command_handler): Likewise.
4946 * progress.c (_gpgme_progress_status_handler): Likewise.
4947 * sign.c (_gpgme_sign_status_handler): Likewise.
4948 * trustlist.c (trustlist_status_handler): Likewise.
4949 * verify.c (_gpgme_verify_status_handler): Likewise.
4950 * gpgme.h (GpgmeEditCb): New type.
4951 * rungpg.h (GpgStatusCode): Rename and move to ...
4952 * gpgme.h (GpgmeStatusCode): ... this and here.
4953 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4954 * mkstatus: Prefix STATUS with GPGME_.
4955 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4957 * ops.h (_gpgme_verify_status_handler,
4958 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4959 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4960 _gpgme_progress_status_handler): Likewise.
4961 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4963 These changes add an edit operation to GPGME:
4965 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4966 ops.h: Add prototype for _gpgme_release_edit_result and
4967 _gpgme_passphrase_command_handler.
4968 * passphrase.c (command_handler): Make non-static and rename to ...
4969 (_gpgme_passphrase_command_handler): ... this.
4970 (_gpgme_passphrase_start): Use new name for command handler.
4971 * types.h: Add EditResult type.
4972 * gpgme.c (_gpgme_release_result): Release EDIT result.
4974 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4975 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4977 (assuan_libobjs): New variable, set this instead
4979 * engine.h (_gpgme_engine_op_edit): New prototype.
4980 * engine.c (_gpgme_engine_op_edit): New function.
4981 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4982 * rungpg.c (_gpgme_gpg_op_edit): New function.
4984 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4986 * delete.c (delete_problem): New case ambigious specification.
4987 (delete_status_handler): Handle new case (poorly).
4989 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4991 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4993 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4995 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4997 * vasprintf.c: Update to more recent libiberty version.
4998 * debug.h: Replace #elsif with #elif.
5000 Submitted by Stéphane Corthésy:
5001 * util.h (vasprintf): Correct prototype.
5002 * encrypt-sign.c: Include <stddef.h>.
5003 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
5005 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
5006 * ath-pth.c: Likewise.
5008 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
5010 * wait.c (fdt_global): Make static. Reported by Stéphane
5013 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
5014 patterns. Reported by Stéphane Corthésy.
5016 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
5017 by Stéphane Corthésy.
5018 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
5019 silence gcc warning.
5021 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
5023 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
5025 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
5027 * gpgme.c (_gpgme_op_event_cb_user): New function.
5028 * op-support.c (_gpgme_op_reset): Support a new mode of operation
5029 for private or user event loop. Use new user event callback
5031 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
5032 * keylist.c (gpgme_op_keylist_start): Likewise.
5034 * rungpg.c (_gpgme_gpg_io_event): New function.
5035 * rungpg.h (_gpgme_gpg_io_event): New prototype.
5036 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
5037 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
5038 * engine.c (_gpgme_engine_io_event): New function.
5039 * engine.h (_gpgme_engine_io_event): New prototype.
5040 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
5041 the real work for the default IO callback routines to ...
5042 (_gpgme_op_keylist_event_cb): ... here. New function.
5043 * trustlist.c (trustlist_colon_handler): Signal
5044 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
5045 (_gpgme_op_trustlist_event_cb): ... here. New function.
5046 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
5047 and _gpgme_op_trustlist_event_cb when appropriate.
5048 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
5049 (_gpgme_op_trustlist_event_cb): Likewise.
5050 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
5051 user provided event handler directly.
5052 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
5054 * wait.c (_gpgme_add_io_cb): Likewise.
5055 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
5056 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
5057 argument. Fix up error handling.
5058 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
5059 new argument, fix up error handling.
5061 2002-07-03 Werner Koch <wk@gnupg.org>
5063 * encrypt.c (status_handler_finish): New.
5064 (_gpgme_encrypt_status_handler): Moved some code out to the new
5065 function and call this function also in case we get into the
5066 status handler with an error which might happen due to a kludge in
5069 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
5071 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5072 table (eg use synchronous mode).
5074 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
5076 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
5077 prototype and change return type to GpgmeError.
5078 (_gpgme_wait_one): New prototype.
5079 * wait.c (gpgme_wait): Replace with the meat from
5080 _gpgme_wait_on_condition here, and remove the support for
5082 (_gpgme_wait_on_condition): Remove HANG argument from prototype
5083 and change return type to GpgmeError. Replace with meat from
5084 _gpgme_wait_one and add support for conditions.
5085 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
5087 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5088 table (eg use synchronous mode).
5089 (gpgme_op_keylist_next): Remove HANG argument from
5090 _gpgme_wait_on_condition. Check its return value.
5091 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
5092 table (eg use synchronous mode).
5093 (gpgme_op_trustlist_next): Remove HANG argument from
5094 _gpgme_wait_on_condition. Check its return value.
5096 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
5098 * gpgme.h: Fix documentation of key attribute retrieval functions.
5100 2002-06-26 Werner Koch <wk@gnupg.org>
5102 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
5104 * import.c (append_xml_impinfo): Kludge to print fingerprint
5105 instead of keyid for use with gpgsm.
5106 (import_status_handler): Set a flag to know whether any import
5108 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
5110 2002-06-25 Werner Koch <wk@gnupg.org>
5112 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
5115 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
5117 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
5119 * export.c (gpgme_op_export): If no data was returned, return
5120 GPGME_No_Recipients.
5122 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
5124 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
5126 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
5128 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
5129 (parse_status): New function.
5130 (gpgsm_status_handler): Use parse_status.
5131 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
5132 STATUS_FNC_VALUE and process status messages.
5133 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
5134 (gpgsm_set_fd): Likewise.
5135 (_gpgme_gpgsm_op_keylist): Likewise.
5136 (_gpgme_gpgsm_op_keylist_ext): Likewise.
5137 (_gpgme_gpgsm_op_sign): Likewise.
5139 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
5141 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
5143 2002-06-20 Werner Koch <wk@gnupg.org>
5145 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
5147 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
5149 (_gpgme_verify_status_handler): Watch out for wrong key usage.
5150 (gpgme_get_sig_string_attr): Hack to return info on the key
5151 usage. Does now make use of the former RESERVED argument which
5152 has been renamed to WHATIDX.
5153 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
5155 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
5157 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
5158 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
5159 error, or there are no more file descriptors to wait on.
5160 (_gpgme_wait_on_condition): Ignore return value from do_select for
5163 2002-06-13 Werner Koch <wk@gnupg.org>
5165 * verify.c (gpgme_op_verify): Make sure that we never access an
5166 unitialized result structure.
5168 2002-06-12 Werner Koch <wk@gnupg.org>
5170 * keylist.c (struct keylist_result_s): New.
5171 (_gpgme_release_keylist_result): Release it here
5172 (keylist_status_handler): Handle truncated.
5173 (append_xml_keylistinfo): New.
5174 * gpgme.c (_gpgme_release_result): and use it here.
5175 * types.h: Declare the new type here.
5176 * context.h (struct gpgme_context_s): Use it here.
5178 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
5180 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
5181 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
5182 use our own close notification mechanism without interfering with
5185 2002-06-11 Werner Koch <wk@gnupg.org>
5187 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
5189 * verify.c (calc_sig_summary): New.
5190 (gpgme_get_sig_ulong_attr): And use it here.
5192 2002-06-10 Werner Koch <wk@gnupg.org>
5194 * rungpg.h: Add new status codes TRUNCATED and ERROR.
5195 * verify.c (is_token, copy_token): New.
5196 (_gpgme_verify_status_handler): Use copy_token, handle the new
5197 ERROR status and store the errorcode used withgpgsm and trust
5199 * gpgme.h: New attribute ERRTOK.
5200 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
5201 (gpgme_get_sig_string_attr): Use it here to return the last error.
5203 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
5205 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
5206 close notification for the status fd to ...
5207 (_gpgme_gpgsm_new): ... here.
5208 * wait.h: Include "sema.h". Remove prototypes of
5209 _gpgme_remove_proc_from_wait_queue and
5210 _gpgme_register_pipe_handler. Add prototypes of
5211 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
5212 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
5214 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
5215 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
5216 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
5217 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
5218 proc_s. Replace struct wait_item_s.
5219 (_gpgme_fd_table_init): New function.
5220 (_gpgme_fd_table_deinit): Likewise.
5221 (_gpgme_fd_table_put): Likewise.
5222 (set_process_done): Remove function.
5223 (do_select): Take argument FDT. Use that to decide which fds to
5225 (_gpgme_remove_proc_from_wait_queue): Remove function.
5226 (_gpgme_wait_event_cb): New function.
5227 (_gpgme_wait_one): Likewise.
5228 (_gpgme_register_pipe_hanldler): Remove function.
5229 (_gpgme_add_io_cb): New function.
5230 (_gpgme_remove_io_cb): Likewise.
5231 (_gpgme_freeze_fd): Remove function.
5232 (_gpgme_thaw_fd): Remove function.
5233 * rungpg.c (struct fd_data_map_s): Add new member TAG.
5234 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
5235 IDX to CMD. Add new member IO_CBS.
5236 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
5237 For each I/O callback, check if it should be unregistered. If all
5238 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
5239 Remove member RUNNING.
5240 (_gpgme_gpg_new): Initialize new members.
5241 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
5242 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
5243 (build_argv): Store away the index instead the file descriptor for
5245 (_gpgme_gpg_add_io_cb): New function.
5246 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
5248 (gpg_status_handler): Change return type to void, remove PID
5249 argument, close filedescriptor if EOF or error occurs.
5250 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
5251 Use IO_CBS->remove instead _gpgme_freeze_fd.
5252 (gpg_colon_line_handler): Change return type to void, remove PID
5253 argument, close filedescriptor if EOF or error occurs.
5254 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
5255 (_gpgme_gpg_set_io_cbs): New function.
5256 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
5257 _gpgme_gpg_set_io_cbs.
5258 * gpgme.h (GpgmeIOCb): New type.
5259 (GpgmeRegisterIOCb): Likewise.
5260 (GpgmeRemoveIOCb): Likewise.
5261 (GpgmeEventIO): Likewise.
5262 (GpgmeEventIOCb): Likewise.
5263 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
5264 (gpgme_set_op_io_cbs): New prototype.
5265 (gpgme_get_op_io_cbs): Likewise.
5266 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
5267 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
5268 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
5269 prototype. Add prototype for _gpgme_op_reset.
5270 Add synchronous argument to _gpgme_decrypt_start prototype.
5271 * io.h: Beautification.
5272 * gpgme.c: Include "wait.h".
5273 (gpgme_new): Initialize FDT.
5274 (gpgme_set_io_cbs): New function.
5275 (gpgme_get_io_cbs): Likewise.
5276 (_gpgme_op_event_cb): Likewise.
5277 * data.c (_gpgme_data_inbound_handler): Change return type to
5278 void. Drop PID argument. Close FD on error and EOF.
5279 (write_mem_data): Don't close FD here ...
5280 (write_cb_data): ... or here ...
5281 (_gpgme_data_outbound_handler): ... but here. Change return type
5282 to void. Drop PID argument.
5283 * context.h: Include "wait.h".
5284 (struct gpgme_context_s): New members FDT and IO_CBS.
5285 * op-support.c: New file.
5286 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
5287 * ops.h: Add prototype for _gpgme_op_reset().
5288 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
5290 (gpgme_op_decrypt_start): Add synchronous argument.
5291 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
5293 * delete.c (gpgme_op_delete_start): Rename to ...
5294 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
5295 Use _gpgme_op_reset. Make function static.
5296 (gpgme_op_delete_start): Just a wrapper around
5297 _gpgme_op_delete_start now.
5298 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
5300 * encrypt.c: Include "wait.h".
5301 (ggpgme_op_encrypt_start): Rename to ...
5302 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
5303 Use _gpgme_op_reset. Make function static.
5304 (gpgme_op_encrypt_start): Just a wrapper around
5305 _gpgme_op_encrypt_start now.
5306 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
5308 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
5309 (_gpgme_op_encrypt_sign_start): ... this. New argument
5310 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
5311 (gpgme_op_encrypt_sign_start): Just a wrapper around
5312 _gpgme_op_encrypt_sign_start now.
5313 (gpgme_op_encrypt_sign): Add synchronous argument. Use
5314 _gpgme_wait_one instead gpgme_wait.
5315 * export.c (gpgme_op_export_start): Rename to ...
5316 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
5317 Use _gpgme_op_reset. Make function static.
5318 (gpgme_op_export_start): Just a wrapper around
5319 _gpgme_op_export_start now.
5320 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
5322 * genkey.c (gpgme_op_genkey_start): Rename to ...
5323 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
5324 Use _gpgme_op_reset. Make function static.
5325 (gpgme_op_genkey_start): Just a wrapper around
5326 _gpgme_op_genkey_start now.
5327 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
5329 * import.c (gpgme_op_import_start): Rename to ...
5330 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
5331 Use _gpgme_op_reset. Make function static.
5332 (gpgme_op_import_start): Just a wrapper around
5333 _gpgme_op_import_start now.
5334 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
5336 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
5337 (gpgme_op_keylist_ext_start): Likewise.
5338 * sign.c (gpgme_op_sign_start): Rename to ...
5339 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
5340 _gpgme_op_reset. Make function static.
5341 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
5343 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
5345 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
5346 * verify.c (gpgme_op_verify_start): Rename to ...
5347 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
5348 Use _gpgme_op_reset. Make function static.
5349 (gpgme_op_verify_start): Just a wrapper around
5350 _gpgme_op_verify_start now.
5351 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
5353 * engine-gpgsm.c (iocb_data_t): New type.
5354 (struct gpgsm_object_s): New member status_cb. Replace input_fd
5355 and input_data with input_cb. Replace output_fd and output_data
5356 with output_cb. Replace message_fd and message_data with
5357 message_cb. New member io_cbs.
5358 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
5360 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
5361 callback, check if it should be unregistered. If all callbacks
5362 have been unregistered, trigger GPGME_EVENT_DONE.
5363 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
5364 names to close the file descriptors.
5365 (_gpgme_gpgsm_op_decrypt): Use new variable names,
5366 (_gpgme_gpgsm_op_encrypt): Likewise.
5367 (_gpgme_gpgsm_op_genkey): Likewise.
5368 (_gpgme_gpgsm_op_import): Likewise.
5369 (_gpgme_gpgsm_op_keylist): Likewise.
5370 (_gpgme_gpgsm_op_keylist_ext): Likewise.
5371 (_gpgme_gpgsm_op_sign): Likewise.
5372 (_gpgme_gpgsm_op_verify): Likewise.
5373 (gpgsm_status_handler): Drop argument PID. Change return type to
5374 void. Close status pipe before returning because of EOF or error.
5375 (_gpgme_gpgsm_add_io_cb): New function.
5376 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
5378 (_gpgme_gpgsm_set_io_cbs): New function.
5379 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
5380 * engine.c (_gpgme_engine_set_io_cbs): New function.
5381 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
5383 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
5385 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5387 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
5389 * key.c: Include <ctype.h>.
5390 (_gpgme_key_append_name): Skip one more char when
5391 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
5392 Handle hexadecimal encodings. Also reported by Marc. Thanks!
5394 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5396 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
5397 * posix-sema.c: Use that prefix here.
5398 * posix-io.c: Include "ath.h".
5399 (_gpgme_io_read): Use _gpgme_ath_read instead read.
5400 (_gpgme_io_write): Use _gpgme_ath_write instead write.
5401 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
5402 (_gpgme_io_select): Use _gpgme_ath_select instead select.
5404 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5406 * Makefile.am (ath_components): New variable.
5407 (ath_components_pthread): Likewise.
5408 (ath_components_pth): Likewise.
5409 (system_components): Add ath_componentes.
5413 * ath-pthread.c: Likewise.
5414 * ath-pth.c: Likewise.
5415 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
5417 * mutex.h: Remove file.
5419 2002-05-30 Werner Koch <wk@gnupg.org>
5421 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
5422 an issuer with IDX > 0. We don't support altIssuerNames for now.
5424 2002-05-22 Werner Koch <wk@gnupg.org>
5426 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
5427 missing variable definition. Oohh - Marcus was faster.
5429 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
5431 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
5433 2002-05-21 Werner Koch <wk@gnupg.org>
5435 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
5436 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
5438 2002-05-10 Werner Koch <wk@gnupg.org>
5440 * key.h (gpgme_key_s): Add OTRUST.
5441 * keylist.c (set_ownertrust): New.
5442 (keylist_colon_handler): Get the ownertrust value
5443 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
5446 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5448 * w32-util.c: New static variable GET_PATH_LOCK.
5449 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
5450 Take lock while determining path.
5451 (_gpgme_get_gpgsm_path): Likewise.
5452 * version.c (do_subsystem_inits): Set DONE to 1 after
5454 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
5455 while determining engine info.
5456 * rungpg.c (_gpgme_gpg_get_version): New variable
5457 GPG_VERSION_LOCK. Take the lock while determining the program
5459 * posix-io.c: Include "sema.h".
5460 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
5461 while fixing the signals.
5462 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
5463 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
5465 (capabilities_to_string): Make STRINGS very const.
5466 (_gpgme_key_cache_add): Lock the key cache.
5467 (_gpgme_key_cache_get): Likewise.
5468 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
5469 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
5470 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
5472 * engine.c (_gpgme_engine_get_info): New variable
5473 ENGINE_INFO_LOCK. Take lock while determining engine info.
5474 * engine-gpgsm.c: Include "sema.h".
5475 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
5476 lock while getting program version.
5478 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5480 * debug.h: New file.
5481 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
5482 * util.h: Removed all prototypes and declarations related to
5483 debugging. Include "debug.h".
5485 * debug.c (debug_level): Comment variable and remove superfluous
5488 (_gpgme_debug_enabled): Function removed.
5489 (struct debug_control_s): Definition removed.
5490 (_gpgme_debug_level): Function removed.
5491 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
5492 pritnf-style format specification and a variable number of
5494 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
5495 starts out with "%s" for simplicity.
5496 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
5497 TEXT argument anymore.
5499 * posix-io.c (_gpgme_io_select): Use new level argument for
5500 DEBUG_BEGIN instead explicit if construct.
5502 * debug.c (debug_init): Remove superfluous zero initializer,
5503 remove volatile flag of INITIALIZED. Do not use the
5504 double-checked locking algorithm, it is fundamentally flawed and
5505 will empty your fridge (on a more serious note, despite the
5506 volatile flag it doesn't give you the guarantee you would expect,
5507 for example on a DEC Alpha or an SMP machine. The volatile only
5508 serializes accesses to the volatile variable, but not to the other
5511 2002-05-03 Werner Koch <wk@gnupg.org>
5513 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5514 output to /dev/null.
5516 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5517 * gpgme.c (gpgme_get_protocol): New.
5519 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5520 (gpgme_data_read): Ditto.
5522 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5523 lines so that a claim can be made without looking up the key.
5524 (gpgme_get_sig_string_attr): New.
5525 (gpgme_get_sig_ulong_attr): New.
5527 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5529 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5530 list to align with the status.h file from gnupg.
5532 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5533 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5534 these new status codes. Store the expiration time
5536 2002-04-27 Werner Koch <wk@gnupg.org>
5538 * gpgme.h (GpgmeData_Encoding): New.
5539 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5540 * engine-gpgsm.c (map_input_enc): New. Use it in all local
5541 functions where the INPUT command gets send.
5543 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
5545 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5546 descriptor only when we don't need it anymore. Close the message
5547 descriptor if we don't need it.
5549 2002-04-26 Werner Koch <wk@gnupg.org>
5551 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5553 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5555 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5556 GPG->cmd.cb_data, not xfree.
5558 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5560 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5561 ttytype, lc_ctype and lc_messages options in the server.
5563 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5565 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5567 2002-04-23 Werner Koch <wk@gnupg.org>
5569 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5570 can_certify to return the requested values.
5572 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5574 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5576 (gpgme_get_passphrase_cb): Likewise.
5578 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5580 * gpgme.c (gpgme_get_passphrase_cb): New function.
5581 (gpgme_get_progress_cb): New function.
5582 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5583 gpgme_get_progress_cb.
5585 2002-03-28 Werner Koch <wk@gnupg.org>
5587 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5588 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5589 * keylist.c (keylist_colon_handler): Store them.
5590 * key.c (gpgme_key_release): Free them.
5591 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5593 2002-03-26 Werner Koch <wk@gnupg.org>
5595 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5597 2002-03-21 Werner Koch <wk@gnupg.org>
5599 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5602 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5604 * Makefile.am (system_components): New variable, set depending on
5606 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5607 * syshdr.h: File removed.
5609 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5610 * posix-sema.c: Likewise.
5611 * posix-util.c: Likewise.
5613 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5614 * w32-sema.c: Likewise.
5615 * w32-util.c: Likewise.
5617 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5618 * posix-sema.c: Likewise.
5619 * w32-io.c: Include `io.h', do not include `syshdr.h'
5620 * w32-sema.c: Likewise.
5621 * w32-util.c: Likewise.
5622 * data.c: Do not include `syshdr.h'.
5624 * wait.h: Code cleanup.
5626 * mutex.h: New file.
5627 * posix-sema.c: Implement.
5629 2002-03-08 Werner Koch <wk@gnupg.org>
5631 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5633 2002-03-07 Werner Koch <wk@gnupg.org>
5635 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5637 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5639 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5640 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5641 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5642 as status handler and run _gpgme_passphrase_start.
5643 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5645 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5648 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5650 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5652 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5653 error No_Passphrase if only a bad passphrase was provided.
5655 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5657 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5658 GPGME_DATA_MODE_IN, construct a command line that stores the
5660 * verify.c (gpgme_op_verify_start): Accept TEXT being
5661 uninitialized, and in this case interpret SIG as a normal or
5662 cleartext signature and TEXT as a return data object.
5663 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5665 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5667 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5670 2002-02-28 Werner Koch <wk@gnupg.org>
5672 * key.h (subkey_s): New member expires_at.
5673 * keylist.c (keylist_colon_handler): Set it here
5674 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5676 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5678 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5679 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5680 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5681 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5682 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5683 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5684 * keylist.c (gpgme_op_keylist_ext_start): New function.
5686 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5688 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5689 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5690 rename no_recipients to no_valid_recipients.
5691 (_gpgme_encrypt_status_handler): Include error for invalid
5693 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5694 argument to GpgsmObject. Use that to report back the status about
5697 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5699 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5701 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5703 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5704 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5705 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5706 (_gpgme_gpg_op_sign): Use that new function.
5707 (_gpgme_gpg_op_encrypt_sign): New function.
5708 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5709 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5710 (gpgme_op_encrypt_sign): Likewise.
5711 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5712 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5713 (_gpgme_sign_status_handler): Add prototype.
5714 * sign.c (sign_status_handler): Rename to ...
5715 (_gpgme_sign_status_handler): ... this and make non-static.
5716 * encrypt.c (encrypt_status_handler): Rename to ...
5717 (_gpgme_encrypt_status_handler): ... this and make non-static.
5718 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5719 * sign.c (gpgme_op_sign_start): Likewise.
5721 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5723 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5724 see if the problem is due to a missing key, and report that back
5727 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5729 * context.h (struct gpgme_context_s): New member include_certs.
5730 * gpgme.h (gpgme_set_include_certs): Add prototype.
5731 (gpgme_get_include_certs): Likewise.
5732 * gpgme.c (gpgme_set_include_certs): New function.
5733 (gpgme_get_include_certs): Likewise.
5734 (gpgme_new): Set include_certs to 1 (the default).
5735 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5736 and pass it to _gpgme_gpgsm_op_sign.
5737 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5738 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5739 include_certs and handle it.
5740 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5741 * sign.c (gpgme_op_sign_start): Add new argument to
5742 _gpgme_engine_op_sign call.
5744 2002-02-14 Werner Koch <wk@gnupg.org>
5746 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5748 2002-02-13 Werner Koch <wk@gnupg.org>
5750 * vasprintf.c, fopencookie.c: Add replacement functions.
5751 * util.h: Add prototypes for them.
5753 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5755 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5756 reach the end of the function.
5758 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5760 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5761 (gpgme_op_genkey_start): Skip newlines after opening tag.
5763 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5765 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5767 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5768 set, and pass them down to the crypto engine.
5769 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5770 * engine.h: Likewise.
5771 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5772 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5774 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5776 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5779 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5781 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5783 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5786 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5788 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5789 status of the returned context is returned.
5790 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5791 aware of cancelled processes, and to allow to use gpgme_wait with
5792 CTX being NULL (as documented in the source).
5793 (struct proc_s): New member REPORTED.
5794 * gpgme.h: Fix prototype.
5795 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5796 * sign.c (gpgme_op_sign): Likewise.
5797 * import.c (gpgme_op_import): Likewise.
5798 * genkey.c (gpgme_op_genkey): Likewise.
5799 * export.c (gpgme_op_export): Likewise.
5800 * encrypt.c (gpgme_op_encrypt): Likewise.
5801 * delete.c (gpgme_op_delete): Likewise.
5802 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5804 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5806 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5808 (gpgme_get_keylist_mode): New function.
5809 (gpgme_new): Set the default for keylist_mode member of CTX.
5811 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5812 (gpgme_get_keylist_mode): New prototype.
5813 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5814 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5816 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5818 This patch has gotten a bit large... mmh. The main thing that
5819 happens here is that error values are now not determined in the
5820 operation function after gpgme_wait completed, but in the status
5821 handler when EOF is received. It should always be the case that
5822 either an error is flagged or EOF is received, so that after a
5823 gpgme_wait you should never have the situation that no error is
5824 flagged and EOF is not received. One problem is that the engine
5825 status handlers don't have access to the context, a horrible
5826 kludge works around this for now. All errors that happen during a
5827 pending operation should be catched and reported in ctx->error,
5828 including out-of-core and cancellation. This rounds up neatly a
5829 couple of loose ends, and makes it possible to pass up any errors
5830 in the communication with the backend as well. As a bonus, there
5831 will be a function to access gpgme->wait, so that the operations
5832 can truly be implemented with their _start function.
5834 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5835 error back to the context.
5836 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5838 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5840 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5841 to a value indication that.
5843 * verify.c (add_notation): Set error, not out_of_core.
5844 (finish_sig): Likewise.
5845 (gpgme_op_verify_start): Don't clear out_of_core.
5846 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5847 (gpgme_op_verify): And don't do it here.
5849 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5850 (gpgme_op_trustlist_start): Don't clear out_of_core.
5851 (gpgme_op_trustlist_next): Check error, not out_of_core.
5852 (gpgme_op_trustlist_end): Likewise.
5854 * ops.h (test_and_allocate_result): New macro.
5855 (_gpgme_passphrase_result): Remove prototype.
5856 * delete.c (gpgme_op_delete): Return error from context.
5857 (delete_status_handler): Use macro test_and_allocate_result.
5858 Perform error checking at EOF.
5859 (gpgme_op_delete_start): Release result.
5860 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5861 test_and_allocate_result, and perform error checking here.
5862 (_gpgme_passphrase_result): Function removed.
5863 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5864 (gpgme_op_sign): Just return the error value from the context.
5865 (sign_status_handler): Only progress if no error is set yet. If
5866 we process an EOF, set the resulting error value (if any).
5867 * decrypt.c (_gpgme_decrypt_result): Function removed.
5868 (create_result_struct): Function removed.
5869 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5870 caclulate error on EOF, do not progress with errors.
5871 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5872 (gpgme_op_decrypt): Just return the error value from the context.
5873 * encrypt.c (encrypt_status_handler): Perform the error checking
5875 (gpgme_op_encrypt_start): Do not clear out_of_core.
5876 * export.c (export_status_handler): Return if error is set in context.
5877 (gpgme_op_export_start): Release result.
5878 (gpgme_op_export): Return error from context.
5879 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5881 * genkey.c (genkey_status_handler): Use macro
5882 test_and_allocate_result. Perform error checking at EOF.
5883 (gpgme_op_genkey): Just return the error from context.
5884 * import.c (gpgme_op_import): Return the error from context.
5885 (import_status_handler): Use macro test_and_allocate_result.
5886 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5887 (gpgme_op_keylist_next): Return error of context.
5888 (keylist_colon_handler): Set error instead out_of_code.
5889 (finish_key): Likewise.
5891 * context.h: Remove member out_of_core, add member error.
5892 * gpgme.c (_gpgme_release_result): Clear error flag.
5894 * engine.h (_gpgme_engine_get_error): New prototype.
5895 * engine.c (_gpgme_engine_get_error): New function.
5896 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5898 * engine-gpgsm.c (map_assuan_error): New function.
5899 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5900 use the new function to map error values.
5901 (gpgsm_set_fd): Change return type tp GpgmeError.
5902 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5903 (gpgsm_set_recipients): Likewise. Change type of return value
5904 equivalently. Adjust error values.
5905 (_gpgme_gpgsm_op_import): Likewise.
5906 (_gpgme_gpgsm_op_sign): Likewise.
5907 (struct gpgsm_object_s): New member error.
5908 (gpgsm_status_handler): Set error if error occurs. Determine
5909 error number from ERR line received. If assuan_read_line fails,
5910 terminate the connection.
5912 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5914 * Makefile.am (MOSTLYCLEANFILES): New variable.
5916 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5918 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5919 connection to the server.
5921 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5923 * rungpg.h: Add STATUS_KEY_CREATED.
5925 * progress.c: New file.
5926 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5928 * genkey.c (genkey_status_handler): Use
5929 _gpgme_progress_status_handler. Add check for status.
5930 (struct genkey_result_s): New structure.
5931 (_gpgme_release_genkey_result): New function.
5932 (gpgme_op_genkey): Check for error.
5933 * gpgme.c (_gpgme_release_result): Call
5934 _gpgme_release_genkey_result.
5935 * ops.h (_gpgme_release_genkey_result): Add prototype.
5936 * types.h (GenKeyResult): New type.
5937 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5939 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5941 * gpgme.c (_gpgme_release_result): Call
5942 _gpgme_release_delete_result.
5943 * ops.h (_gpgme_release_delete_result): Add prototype.
5944 * types.h (DeleteResult): New type.
5945 * context.h (gpgme_context_s): Add DeleteResult to member result.
5947 * delete.c (enum delete_problem): New type.
5948 (struct delete_result_s): New structure.
5949 (_gpgme_release_delete_result): New function.
5950 (delete_status_handler): Implement more status codes.
5951 (gpgme_op_delete): Return error on failure.
5953 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5955 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5957 * import.c (struct import_result_s): New structure.
5958 (_gpgme_release_import_result): New function.
5959 (append_xml_impinfo): Likewise.
5960 (import_status_handler): Implement.
5961 * gpgme.c (_gpgme_release_result): Add call to
5962 _gpgme_release_import_result.
5963 * ops.h (_gpgme_release_import_result): Add prototype.
5964 * types.h (ImportResult): New type.
5965 * context.h (gpgme_context_s): Add ImportResult to member result.
5967 * encrypt.c (gpgme_op_encrypt): Code clean up.
5969 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5971 * gpgme.h: Add lots of comment and fix the formatting. Add
5972 gpgme_trustlist_end prototype.
5974 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5976 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5977 gpgme_register_idle to return and accept this type.
5978 * wait.c (gpgme_register_idle): Fix type.
5979 Save and return old value of idle_function.
5981 2002-01-29 Werner Koch <wk@gnupg.org>
5983 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5985 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5988 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5990 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5991 not assuan_pipe_disconnect.
5993 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5994 jnlib (needed by assuan) statically into libgpgme. Linking a
5995 static library into a shared library this way is not portable.
5997 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5999 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
6002 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6004 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
6005 from off_t to size_t.
6006 * gpgme.h: Likewise.
6008 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6010 * wait.c (_gpgme_wait_on_condition): If the process finished,
6011 reset the pending flag. Also if the operation was cancelled.
6013 (struct proc_s): Rename READY to DONE.
6014 (wait_item_s): Likewise.
6015 (set_process_ready): Rename to ...
6016 (set_process_done): ... this.
6017 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
6018 instead set_process_ready.
6019 (_gpgme_wait_on_condition): Likewise.
6020 (do_select): Rename READY to DONE.
6022 * verify.c (gpgme_op_verify): Do not set pending to zero here.
6023 * sign.c (gpgme_op_sign): Likewise.
6024 * import.c (gpgme_op_import): Likewise.
6025 * genkey.c (gpgme_op_genkey): Likewise.
6026 * export.c (gpgme_op_export): Likewise.
6027 * encrypt.c (gpgme_op_encrypt): Likewise.
6028 * delete.c (gpgme_op_delete): Likewise.
6029 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
6030 * decrypt.c (gpgme_op_decrypt): Likewise.
6032 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
6034 * export.c: Cleanup.
6036 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
6038 * trustlist.c: Various source clean ups.
6039 (my_isdigit): Removed.
6040 (gpgme_op_trustlist_end): New function.
6042 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
6044 * gpgme.c: Various source clean ups, like renaming C to CTX where
6046 (gpgme_new): Clear R_CTX before starting the work.
6047 (my_isdigit): Removed.
6048 (my_isxdigit): Likewise.
6050 * data.c: Various source clean ups.
6051 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
6052 (gpgme_data_new_with_read_cb): Similar for READ_CB.
6053 (gpgme_data_new_from_file): Loop over fread while EINTR.
6054 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
6055 be zero. Loop over fread while EINTR.
6057 (my_isdigit): Removed.
6058 (my_isxdigit): Likewise.
6060 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
6062 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
6063 Pipe_Error where appropriate.
6065 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
6067 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
6069 * version.c (get_engine_info): Remove prototype.
6071 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
6073 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
6074 Fill it with the servers fds, and pass it to assuan_pipe_connect.
6076 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6078 * keylist.c (gpgme_op_keylist_end): New function.
6079 * gpgme.h (gpgme_op_keylist_end): New prototype.
6081 * engine.h (gpgme_engine_check_version): Move prototype to ...
6082 * gpgme.h (gpgme_engine_check_version): ... here.
6084 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
6086 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6088 * version.c (gpgme_get_engine_info): Reimplemented.
6089 (gpgme_check_engine): Reimplemented.
6090 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
6092 * engine.c: Include `io.h'.
6093 (gpgme_engine_get_info): New function.
6094 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
6097 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6099 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
6100 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
6101 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
6103 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
6104 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
6105 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
6106 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
6107 own function by call to _gpgme_engine_add_child_to_reap_list().
6109 * wait.c: Include `engine.h'.
6110 (run_idle): Call _gpgme_engine_housecleaning(), not
6111 _gpgme_gpg_housecleaning().
6113 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
6115 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
6116 Initialize the next field of the uid structure.
6117 (gpgme_key_get_as_xml): Do not list last uid first.
6119 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
6121 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
6122 function [!ENABLE_GPGSM].
6124 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6126 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
6127 message_data, not SIG.
6128 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
6130 * sign.c (sign_status_handler): Call
6131 _gpgme_passphrase_status_handler early.
6133 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6135 * engine-gpgsm.c: Revert last change.
6137 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6139 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
6140 handler when ending this operation, otherwise the wait function
6143 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
6145 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
6146 (_gpgme_gpgsm_new): Initialize some more members.
6147 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
6148 (gpgsm_status_handler): Rework the inline-data processing.
6150 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6152 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
6153 list that are not dup'ed, for those the close-on-exec flag is set
6155 * version.c (_gpgme_get_program_version): Remove first entry in
6156 CFD, as the close-on-exec flag is now set for this fd.
6158 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6160 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
6161 option to `ENCRYPT'.
6162 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
6165 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
6167 * engine-gpgsm.c (close_notify_handler): New function.
6168 (_gpgme_gpgsm_new): Manage the file descriptors a
6169 bit differently. Do not set close-on-exec flags.
6170 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
6171 to -1, this is done by the close handler.
6172 (_gpgme_gpgsm_op_encrypt): Likewise.
6173 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
6174 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
6175 (_gpgme_gpgsm_op_sign): Likewise.
6176 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
6178 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
6179 non-inherited file descriptor index of the pipe.
6181 2001-12-13 Werner Koch <wk@gnupg.org>
6183 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
6184 (gpgsm_status_handler): Pass datalines to a colon handler
6185 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
6188 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
6190 (gpgsm_assuan_simple_command): Removed underscore from
6192 (_gpgme_gpgsm_start): Ditto.
6193 (gpgsm_assuan_simple_command): Replaced interal Assuan read
6194 function by the new assuan_read_line. Removed the use of the
6196 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
6197 (_gpgme_gpgsm_start): Use the documented way to get an fd from
6200 * keylist.c (keylist_colon_handler): Handle "crt" records
6201 * key.h (gpgme_key_s): Add an x509 flag.
6202 * key.c (parse_x509_user_id): New.
6203 (_gpgme_key_append_name): Handle x.509 names.
6205 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6207 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
6210 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6212 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
6213 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
6215 (_gpgme_gpgsm_op_sign): Likewise.
6217 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
6219 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
6222 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
6224 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
6226 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
6228 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
6229 Deal with assuan read line returning more than one line (for now).
6231 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
6233 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
6234 the current protocol definition.
6236 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
6238 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
6241 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6243 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
6244 for now, rungpg.h and status-table.h.
6245 (gpgsm_status_handler): Implement more of the status handler.
6247 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6249 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
6250 (_gpgme_engine_op_delete): Likewise.
6251 (_gpgme_engine_op_encrypt): Likewise.
6252 (_gpgme_engine_op_export): Likewise.
6253 (_gpgme_engine_op_genkey): Likewise.
6254 (_gpgme_engine_op_keylist): Likewise.
6255 (_gpgme_engine_op_sign): Likewise.
6256 (_gpgme_engine_op_trustlist): Likewise.
6258 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
6259 (gpgsm_assuan_simple_command): Likewise.
6260 (gpgsm_set_recipients): Likewise.
6261 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
6262 (_gpgme_gpgsm_op_delete): New function.
6263 (_gpgme_gpgsm_op_export): Likewise.
6264 (_gpgme_gpgsm_op_genkey): Likewise.
6265 (_gpgme_gpgsm_op_sign): Likewise.
6266 (_gpgme_gpgsm_op_keylist): Likewise.
6267 (_gpgme_gpgsm_op_trustlist): Likewise.
6268 (_gpgme_gpgsm_release): Release command.
6269 (_gpgme_gpgsm_op_decrypt): Allocate command.
6270 (_gpgme_gpgsm_op_import): Likewise.
6271 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
6273 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6275 * gpgme.h (gpgme_set_protocol): New prototype.
6277 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6279 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
6280 (_gpgme_gpgsm_op_import): Likewise.
6282 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6284 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
6286 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
6288 2001-11-22 Werner Koch <wk@gnupg.org>
6290 * engine-gpgsm.c: Include more headers so that NULL and mk_error
6291 is defined even with an undefined GPGSM_PATH.
6293 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
6295 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
6296 gpg_outbound_handler): Moved to ...
6297 * data.c (_gpgme_data_inbound_handler, write_mem_data,
6298 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
6299 _gpgme_* ones non-static.
6300 * data.c: Include io.h.
6302 * ops.h (_gpgme_data_inbound_handler): New prototype.
6303 (_gpgme_data_outbound_handler): Likewise.
6304 (_gpgme_gpg_spawn): Use these new functions.
6306 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
6307 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
6308 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
6309 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
6310 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
6311 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
6312 Include <rungpg.h> for status handler function.
6314 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
6315 input_data, output_fd, output_data, message_fd, message_data, command
6317 (_gpgme_gpgsm_new): Open input, output and message pipes before
6318 connecting to the client. Close server's ends afterwards.
6319 (_gpgme_gpgsm_release): Close open file descriptors. Remove
6320 server process from wait queue.
6321 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
6322 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
6324 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
6325 (_gpgme_engine_set_status_handler): Likewise.
6326 (_gpgme_engine_op_verify): Likewise.
6328 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
6330 * context.h: Do not include rungpg.h, but engine.h.
6331 (struct gpgme_context_s): Replace member gpg with engine.
6332 * gpgme.c (gpgme_release): Release engine, not gpg.
6334 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
6336 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
6337 Make static, change order of arguments, and return an error value.
6338 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
6340 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
6341 (_gpgme_gpg_op_encrypt): Likewise.
6342 (_gpgme_gpg_op_decrypt): Likewise.
6343 (_gpgme_gpg_op_delete): Likewise.
6344 (_gpgme_gpg_op_export): Likewise.
6345 (_gpgme_gpg_op_genkey): Likewise.
6346 (_gpgme_gpg_op_import): Likewise.
6347 (_gpgme_gpg_op_keylist): Likewise.
6348 (_gpgme_gpg_op_sign): Likewise.
6349 (_gpgme_gpg_op_trustlist): Likewise.
6350 * rungpg.c (_gpgme_gpg_op_verify): New function.
6351 (_gpgme_gpg_op_encrypt): Likewise.
6352 (_gpgme_gpg_op_decrypt): Likewise.
6353 (_gpgme_gpg_op_delete): Likewise.
6354 (_gpgme_gpg_op_export): Likewise.
6355 (_gpgme_gpg_op_genkey): Likewise.
6356 (_gpgme_gpg_op_import): Likewise.
6357 (_gpgme_gpg_op_keylist): Likewise.
6358 (_gpgme_gpg_op_sign): Likewise.
6359 (_gpgme_gpg_op_trustlist): Likewise.
6361 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
6362 (_gpgme_engine_set_command_handler): Likewise.
6363 (_gpgme_engine_set_colon_line_handler): Likewise.
6364 (_gpgme_engine_op_decrypt): Likewise.
6365 (_gpgme_engine_op_delete): Likewise.
6366 (_gpgme_engine_op_encrypt): Likewise.
6367 (_gpgme_engine_op_export): Likewise.
6368 (_gpgme_engine_op_genkey): Likewise.
6369 (_gpgme_engine_op_import): Likewise.
6370 (_gpgme_engine_op_keylist): Likewise.
6371 (_gpgme_engine_op_sign): Likewise.
6372 (_gpgme_engine_op_trustlist): Likewise.
6373 (_gpgme_engine_op_verify): Likewise.
6374 (_gpgme_engine_start): Likewise.
6375 * engine.c (_gpgme_engine_set_status_handler): New function.
6376 (_gpgme_engine_set_command_handler): Likewise.
6377 (_gpgme_engine_set_colon_line_handler): Likewise.
6378 (_gpgme_engine_op_decrypt): Likewise.
6379 (_gpgme_engine_op_delete): Likewise.
6380 (_gpgme_engine_op_encrypt): Likewise.
6381 (_gpgme_engine_op_export): Likewise.
6382 (_gpgme_engine_op_genkey): Likewise.
6383 (_gpgme_engine_op_import): Likewise.
6384 (_gpgme_engine_op_keylist): Likewise.
6385 (_gpgme_engine_op_sign): Likewise.
6386 (_gpgme_engine_op_trustlist): Likewise.
6387 (_gpgme_engine_op_verify): Likewise.
6388 (_gpgme_engine_start): Likewise.
6390 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
6392 * encrypt.c (gpgme_op_encrypt_start): Likewise.
6393 * decrypt.c (_gpgme_decrypt_start): Likewise.
6394 * passphrase.c (_gpgme_passphrase_start): Likewise.
6395 * keylist.c (gpgme_op_keylist_start): Likewise.
6397 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6399 * types.h: Add types EngineObject and GpgsmObject.
6401 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
6402 engine-gpgsm.c, engine.h and engine.c.
6403 * engine.h: New file.
6404 * engine.c: Likewise.
6405 * engine-gpgsm.h: Likewise.
6406 * engine-gpgsm.c: Likewise.
6408 * rungpg.c (_gpgme_gpg_get_version): New function.
6409 (_gpgme_gpg_check_version): Likewise.
6410 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
6411 _gpgme_gpg_check_version.
6413 * version.c (compare_versions): Rename to ...
6414 (_gpgme_compare_versions): ... this. Make non-static.
6415 (gpgme_check_version): Use _gpgme_compare_versions rather than
6417 (gpgme_check_engine): Likewise.
6418 * ops.h (_gpgme_get_program_version): Add prototype.
6420 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6422 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
6423 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
6424 (libgpgme_la_LIBADD): Likewise.
6426 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6428 * version.c: Remove global variables lineno and
6430 (version_handler): Removed.
6431 (_gpgme_get_program_version): New function.
6432 (get_engine_info): Don't use context and version_handler,
6433 but _gpgme_get_program_version.
6434 * ops.h (_gpgme_get_program_version): Add prototype for
6435 _gpgme_get_program_version (we expect to use it elsewhere soon).
6437 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
6439 * version.c (get_engine_info): If GnuPG is not available, return
6441 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
6443 (_gpgme_get_gpgsm_path): New function.
6444 * w32-util.c (find_program_in_registry): New static function.
6445 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
6446 to use find_program_in_registry.
6447 (_gpgme_get_gpgsm_path): New function.
6448 (util.h): Prototype _gpgme_get_gpgsm_path).
6449 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
6452 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6454 * decrypt-verify.c: New file.
6455 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
6456 * types.h: Add decrypt-verify types.
6458 * context.h: Add result type for decrypt-verify.
6459 * gpgme.h: Add decrypt-verify prototypes.
6461 * decrypt.c (decrypt_status_handler): Renamed to ...
6462 (_gpgme_decrypt_status_handler): ... this. Make non-static.
6463 (_gpgme_decrypt_start): New function, derived from
6464 gpgme_op_decrypt_start.
6465 (gpgme_op_decrypt_start): Reimplement in terms of
6466 _gpgme_decrypt_start.
6467 (_gpgme_decrypt_result): New function to retrieve error value.
6468 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
6469 * ops.h: Add prototypes for new functions.
6471 * verify.c (verify_status_handler): Renamed to ...
6472 (_gpgme_verify_status_handler): ... this. Make non-static.
6473 (gpgme_op_verify_start): Use new function name.
6474 (intersect_stati): Renamed to ...
6475 (_gpgme_intersect_stati): ... this. Make non-static.
6476 (gpgme_op_verify): Use new name.
6477 * ops.h: Add prototypes for new functions.
6479 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6481 * passphrase.c: New file.
6482 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
6483 * ops.h (_gpgme_passphrase_result): Add prototypes from
6485 * types.h: Likewise.
6486 * context.h: Add member passphrase to result.
6487 * gpgme.c (_gpgme_release_result): Release passphrase member.
6489 * decrypt.c: Some formatting and variable name changes (like
6491 (struct decrypt_result_s): Remove members now found in
6493 (_gpgme_release_decrypt_result): Don't release removed members.
6494 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
6495 and don't handle the cases catched there.
6496 (command_handler): Removed.
6497 (gpgme_op_decrypt_start): Don't set command handler, but invoke
6498 _gpgme_passphrase_start which does it.
6499 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6500 cases covered by it.
6502 * sign.c Some formatting and variable name changes (like
6504 (struct sign_result_s): Remove members now found in
6506 (_gpgme_release_sign_result): Don't release removed members.
6507 (sign_status_handler): Call _gpgme_passphrase_status_handler,
6508 and don't handle the cases catched there.
6509 (command_handler): Removed.
6510 (gpgme_op_sign_start): Don't set command handler, but invoke
6511 _gpgme_passphrase_start which does it.
6512 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6513 cases covered by it.
6515 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6517 * decrypt.c (command_handler): Fix last change.
6519 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6521 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6522 Rename R2 to NEXT_RESULT.
6523 (intersect_stati): Rename RES to RESULT.
6524 (gpgme_get_sig_status): Likewise. Do not check return_type, but
6525 the member verify of result.
6526 (gpgme_get_sig_key): Likewise.
6528 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
6529 RESULT is zero, return.
6530 (sign_status_handler, command_handler): Do not check return_type,
6531 but the member sign of result.
6532 (gpgme_op_sign): Likewise. Drop assertion.
6534 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6535 If RESULT is zero, return.
6536 (encrypt_status_handler): Do not check return_type, but the member
6538 (gpgme_op_encrypt): Likewise. Drop assertion.
6540 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6541 (create_result_struct): Do not set result_type.
6542 (command_handler, decrypt_status_handler): Do not check
6543 return_type, but the member decrypt of result.
6544 (gpgme_op_decrypt): Likewise. Drop assertion.
6546 * context.h (enum ResultType): Removed.
6547 (struct gpgme_context_s): Remove member result_type.
6548 (struct result): Replaces union result.
6549 * gpgme.c: Include string.h.
6550 (_gpgme_release_result): Release all members of c->result, which
6551 is now a struct. Zero out all members of the struct afterwards.
6553 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
6555 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6556 Release all members of the list GPG->arglist.
6557 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6559 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6561 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6563 * key.c: Include string.h.
6565 * recipient.c: Likewise.
6567 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6569 * context.h: New member signers_len.
6570 * signers.c (gpgme_signers_clear): Require that signers are
6571 non-NULL with assertion. Use signers_len to determine how much
6572 keys to release. Add documentation.
6573 (gpgme_signers_add): Use signers_len to determine if the buffer is
6574 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6576 (gpgme_signers_enum): Use signers_len to determine if key is
6577 available. Add documentation.
6579 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6581 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6582 ALLOC_CHUNK, not DH->length.
6584 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6586 * gpgme.c (gpgme_set_protocol): Fix last change.
6588 2001-10-15 Werner Koch <wk@gnupg.org>
6590 * gpgme.h (GpgmeProtocol): New.
6591 * gpgme.c (gpgme_set_protocol): New.
6593 2001-09-26 Werner Koch <wk@gnupg.org>
6595 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6596 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6598 2001-09-17 Werner Koch <wk@gnupg.org>
6600 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6601 callers to use this function without a check for tmp_key.
6603 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6604 emptying the queue. Bug reported by Stéphane Corthésy.
6606 2001-09-12 Werner Koch <wk@gnupg.org>
6608 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6610 2001-09-07 Werner Koch <wk@gnupg.org>
6612 * rungpg.h: Add NO_RECP.
6613 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6614 (gpgme_op_encrypt): Better error return.
6616 * verify.c (verify_status_handler): Take on NODATA.
6618 2001-09-03 Werner Koch <wk@gnupg.org>
6620 * rungpg.h: Added STATUS_INV_RECP.
6621 * gpgme.c (_gpgme_release_result): Add support for new
6622 EncryptResult object.
6623 * encrypt.c (append_xml_encinfo): New.
6624 (encrypt_status_handler): Add some status parsing.
6625 (_gpgme_release_encrypt_result): New.
6627 2001-08-29 Werner Koch <wk@gnupg.org>
6629 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6631 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6632 an EOF here. This is probably the reason for a lot of bugs
6633 related to keylisting. It is so obvious. Kudos to Enno Cramer
6634 for pointing that out.
6636 2001-08-28 Werner Koch <wk@gnupg.org>
6638 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6639 (_gpgme_set_op_info): New.
6640 (_gpgme_release_result): Reset the op_info here.
6641 * sign.c (append_xml_siginfo): New.
6642 (sign_status_handler): Store the sig create information.
6644 2001-07-31 Werner Koch <wk@gnupg.org>
6646 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6648 2001-07-30 Werner Koch <wk@gnupg.org>
6650 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6652 * rungpg.c (build_argv): Disable armor comments
6653 * w32-io.c (build_commandline): Need to add quotes here
6655 2001-07-24 Werner Koch <wk@gnupg.org>
6657 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6659 2001-07-23 Werner Koch <wk@gnupg.org>
6661 * util.c: Removed stpcpy() because we use the version from jnlib.
6663 2001-07-19 Werner Koch <wk@gnupg.org>
6665 * mkstatus: Define the collating sequence for sort.
6667 2001-06-26 Werner Koch <wk@gnupg.org>
6669 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6671 2001-06-15 Werner Koch <wk@gnupg.org>
6673 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6674 to Timo for pointing this out.
6676 2001-06-01 Werner Koch <wk@gnupg.org>
6678 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6681 2001-05-28 Werner Koch <wk@gnupg.org>
6683 * version.c (gpgme_check_engine): Stop version number parsing at
6684 the opening angle and not the closing one. By Tommy Reynolds.
6686 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6688 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6689 line, because it gave an error if another operation had been made
6690 before using the same context.
6692 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6693 one line to release the gpg object in the context (if any).
6695 2001-04-26 Werner Koch <wk@gnupg.org>
6697 * key.c, key.h (_gpgme_key_cache_init): New.
6698 (_gpgme_key_cache_add): New.
6699 (_gpgme_key_cache_get): New.
6700 * version.c (do_subsystem_inits): Init the cache.
6701 * keylist.c (finish_key): Put key into the cache
6702 * verify.c (gpgme_get_sig_key): First look into the cache.
6704 2001-04-19 Werner Koch <wk@gnupg.org>
6706 * keylist.c (parse_timestamp): Adjusted for the changed
6707 --fixed-list-mode of gpg 1.0.4h.
6709 2001-04-05 Werner Koch <wk@gnupg.org>
6711 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6713 2001-04-04 Werner Koch <wk@gnupg.org>
6715 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6716 are still bytes pending. Timo found this not easy to track down
6719 2001-04-02 Werner Koch <wk@gnupg.org>
6721 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6722 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6724 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6725 the mode set in the current context. Suggested by Timo.
6727 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6728 can_encrypt. By Timo.
6730 2001-03-30 Werner Koch <wk@gnupg.org>
6732 * debug.c (debug_init): Allow to specify a debug file.
6733 (_gpgme_debug_level): New.
6735 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6736 (_gpgme_io_select): Debug only with level > 2.
6738 2001-03-15 Werner Koch <wk@gnupg.org>
6740 * rungpg.c: Included time.h.
6742 * key.h: New keyflags for capabilities.
6743 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6744 (keylist_colon_handler): Parse them.
6745 * gpgme.h: New attribute values for capabilties.
6746 * key.c (gpgme_key_get_string_attr): Return them.
6747 (capabilities_to_string): New.
6748 (gpgme_key_get_ulong_attr): Return the global caps.
6750 2001-03-14 Werner Koch <wk@gnupg.org>
6752 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6753 Thanks to Jan Oliver Wagner.
6755 2001-03-13 Werner Koch <wk@gnupg.org>
6757 * context.h: Add invalid and revoke flags to user_id structure.
6758 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6759 (keylist_colon_handler): Adjust for that.
6760 (set_userid_flags): New.
6761 (set_mainkey_trust_info): Handle new key invalid flag
6762 (set_subkey_trust_info): Ditto.
6763 * gpgme.h: Add new attributes for key and user ID flags.
6764 * key.c (_gpgme_key_append_name): Init these flags
6765 (gpgme_key_get_as_xml): Print them.
6766 (one_uid_as_xml): New helper for above.
6767 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6768 Return the new attributes. Enhanced, so that subkey information
6769 can be returned now.
6771 2001-02-28 Werner Koch <wk@gnupg.org>
6773 * w32-io.c (destroy_reader): Set stop_me flag.
6774 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6775 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6776 (_gpgme_io_close): Cleanup a writer thread
6777 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6778 waiting which is now possible due to the use of a writer thread.
6780 2001-02-20 Werner Koch <wk@gnupg.org>
6782 * w32-io.c (destroy_reader,kill_reader): New.
6783 (create_reader, reader): Add a new event to stop the thread.
6784 (_gpgme_io_close): Kill the reader thread.
6786 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6787 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6789 * wait.c: Reworked the whole thing.
6790 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6791 (_gpgme_gpg_release): Remove the process from the wait queue.
6793 2001-02-19 Werner Koch <wk@gnupg.org>
6795 * w32-io.c (_gpgme_io_set_close_notify): New.
6796 (_gpgme_io_close): Do the notification.
6798 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6801 * wait.c (remove_process): Don't close the fd here.
6802 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6803 (_gpgme_wait_on_condition): Remove the assert on the queue and
6804 break out if we could not find the queue. The whole thing should
6807 * posix-io.c (_gpgme_io_set_close_notify): New.
6808 (_gpgme_io_close): Do the notification.
6810 * rungpg.c (close_notify_handler): New.
6811 (_gpgme_gpg_new): Register a callback for the fd.
6812 (_gpgme_gpg_set_colon_line_handler): Ditto.
6815 2001-02-13 Werner Koch <wk@gnupg.org>
6817 * rungpg.c (struct reap_s): Replaced pid_t by int.
6819 * types.h: Add ulong typedef.
6821 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6822 (_gpgme_gpg_release): Reap children.
6823 * io.h, posix-io.c (_gpgme_io_kill): New.
6824 * w32-io.c (_gpgme_io_kill): New (dummy).
6826 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6828 * posix-io.c (_gpgme_io_read): Add some debug output.
6829 (_gpgme_io_write): Ditto.
6830 (_gpgme_io_select): Increased the timeout.
6832 2001-02-12 Werner Koch <wk@gnupg.org>
6834 Enhanced the signature verification, so that it can how handle
6835 more than one signature and is able to return more information on
6837 * verify.c (gpgme_get_sig_key): New.
6838 (gpgme_get_sig_status): New.
6840 * gpgme.h: Add stdio.h.
6841 (GpgmeSigStat): New status DIFF.
6843 2001-02-01 Werner Koch <wk@gnupg.org>
6845 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6846 code to all Set/ResetEvent().
6848 * rungpg.c (read_status): Check for end of stream only if we have
6851 2001-01-31 Werner Koch <wk@gnupg.org>
6853 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6854 (propagate_term_results,clear_active_fds): Removed.
6855 (count_active_fds): Renamed to ..
6856 (count_active_and_thawed_fds): .. this and count only thawed fds.
6858 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6861 2001-01-30 Werner Koch <wk@gnupg.org>
6863 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6865 * version.c (get_engine_info): Return better error information.
6867 * posix-util.c, w32-util.c: New.
6868 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6869 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6871 * signers.c (gpgme_signers_add): Ooops, one should test code and
6872 not just write it; the newarr was not assigned. Thanks to José
6873 for pointing this out. Hmmm, still not tested, why should a coder
6876 * w32-io.c: Does now use reader threads, so that we can use
6877 WaitForMultipleObjects.
6878 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6879 Does currently only work for W32.
6881 * debug.c, util.h : New. Changed all fprintfs to use this new
6882 set of debugging functions.
6884 2001-01-23 Werner Koch <wk@gnupg.org>
6886 * data.c (_gpgme_data_release_and_return_string): Fixed string
6889 2001-01-22 Werner Koch <wk@gnupg.org>
6894 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6895 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6897 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6898 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6900 2001-01-05 Werner Koch <wk@gnupg.org>
6902 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6905 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6907 This file is free software; as a special exception the author gives
6908 unlimited permission to copy and/or distribute it, with or without
6909 modifications, as long as this notice is preserved.
6911 This file is distributed in the hope that it will be useful, but
6912 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6913 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.