1 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
3 * gpgme.h.in (struct gpgme_io_event_done_data)
4 (gpgme_io_event_done_data_t): New types.
5 (struct _gpgme_op_assuan_result): Deprecate the err member.
6 (gpgme_op_assuan_result): Deprecate (for now).
7 (gpgme_op_assuan_transact_ext): New prototype.
8 (gpgme_op_assuan_transact): Deprecate.
9 (struct _gpgme_op_g13_result): Replace with ...
10 (struct _gpgme_op_vfs_mount_result): ... this.
11 (gpgme_op_g13_mount): Replace with ...
12 (gpgme_op_vfs_mount): ... this.
13 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
14 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
15 (gpgme_op_g13_mount): Remove.
16 * libgpgme.vers: Likewise.
17 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
18 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
20 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
22 (_gpgme_wait_one_ext): New prototype.
23 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
24 * engine-g13.c (g13_cancel_op): New function.
25 (parse_status): Remove declaration.
26 (g13_assuan_simple_command): Do nothing with status lines for now.
27 (status_handler): Update opaque value access.
28 (_gpgme_engine_ops_g13): Add new cancel_op member.
29 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
30 Handle operational errors.
31 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
32 * data.c (_gpgme_data_inbound_handler)
33 (_gpgme_data_outbound_handler): Adjust opaque value access.
34 * engine-gpg.c (command_handler, status_handler)
35 (colon_line_handler): Likewise.
36 * engine-gpgsm.c (status_handler): Likewise.
37 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
38 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
39 * g13.c: Rewritten (and will be rewritten again).
40 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
41 and result_cb_value parameters from prototype.
42 (_gpgme_engine_cancel_op): New prototype.
43 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
44 (_gpgme_engine_op_assuan_transact): Remove result_cb and
45 result_cb_value parameter.
46 (_gpgme_engine_cancel_op): New function.
47 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
48 (struct io_cb_data): New struct to pass opaque data and get a
49 op_err return value. Needed because we can't modify I/O callback
50 handler signature because it is exposed to the user.
51 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
53 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
55 * wait-private.c (_gpgme_wait_on_condition): New argument to
56 retrieve the operational result. Handle operational errors in
57 session based protocols.
58 (_gpgme_wait_one_ext): New function.
59 (_gpgme_wait_one): Pass argument in invocation of
60 _gpgme_wait_on_condition.
61 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
62 (ctx_done): New argument OP_ERR.
63 (ctx_wait): New argument OP_ERR.
64 (gpgme_wait_ext): New function based on gpgme_wait but handling
66 (gpgme_wait): Implement in term of gpgme_wait_ext.
67 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
68 of _gpgme_wait_on_condition.
69 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
70 invocation of _gpgme_wait_on_condition.
71 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
72 and RESULT_CB_VALUE by LAST_OP_ERR.
73 (_gpgme_engine_assuan_last_op_err): Add this hack function.
74 (llass_cancel_op): New function.
75 (_gpgme_engine_llass_ops): Add cancel_op member.
76 (llass_status_handler): Update opaque value access.
77 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
78 * opassuan.c: Move compat hacks to the end of file.
79 (opassuan_start): Do not set OPD->result.err.
80 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
81 (gpgme_op_assuan_transact_ext): New function.
83 * debug.h (DEBUG_GLOBAL): New debug level.
84 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
85 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
86 * data-fd.c (gpgme_data_new_from_fd): Likewise.
87 * data-stream.c (gpgme_data_new_from_stream): Likewise.
88 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
89 (gpgme_op_decrypt): Likewise.
90 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
91 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
92 (gpgme_op_decrypt_verify): Likewise.
93 * sign.c (gpgme_op_sign_result): Fix debug message.
94 * data-mem.c (gpgme_data_new): Improve debug output.
95 * verify.c (parse_trust): Use atoi instead of
96 _gpgme_map_gnupg_error.
97 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
99 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
101 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
102 (g13_components): New variable.
103 (main_sources): Add $(g13_components).
104 * g13.c, engine-g13.c: New files.
105 * engine.c (engine_ops): Check for assuan for assuan engine, add
107 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
109 * conversion.c (_gpgme_encode_percent_string): New function.
110 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
111 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
112 (gpgme_op_g13_mount): New function.
113 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
114 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
115 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
116 * posix-util.c (_gpgme_get_g13_path): New function.
117 * w32-util.c (_gpgme_get_g13_path): New function.
118 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
120 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
122 * gpgme-config.in (netlibs): Remove.
123 (assuan_cflags, assuan_libs): Add.
125 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
126 (gpgsm_components): Move engine-assuan.c to ...
127 (assuan_components): ... this new variable.
128 (main_sources): Add this new variable.
129 (AM_CPPFLAGS): Remove $(assuan_cppflags).
130 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
131 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
132 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
133 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
134 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
135 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
136 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
138 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
139 _gpgme_io_sendmsg, _gpgme_io_waitpid.
140 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
142 * posix-io.c (_gpgme_io_waitpid): Make non-static.
143 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
144 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
145 * engine-gpgsm.c: Don't map assuan error codes. Use
146 assuan_release instead of assuan_disconnect.
147 (map_assuan_error): Remove function.
148 (gpgsm_new): Use new assuan context interface.
149 * engine-assuan.c: Use assuan_release instead of
151 (llass_new): Use new assuan context interface.
153 2009-10-07 <wk@g10code.com>
155 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
157 2009-08-06 Werner Koch <wk@g10code.com>
159 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
161 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
163 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
164 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
165 (_gpgme_op_sign_init_result): Factor code out to ...
166 (sign_init_result): .. new. Init new fields.
167 (sign_start): Use sign_init_result.
168 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
169 Return an error if no signature has been created.
171 2009-07-07 Werner Koch <wk@g10code.com>
173 * engine-gpgsm.c (struct engine_gpgsm): Add fields
174 input_helper_data and input_helper_memory.
175 (close_notify_handler): Release these new fields.
176 (gpgsm_import): Implement the keyarray feature.
178 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
180 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
183 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
185 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
186 [HAVE_STDINT_H]: Include <stdint.h>.
187 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
188 to (uintptr_t) before casting it to (void*) to silence GCC
191 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
192 * sign.c (_GPGME_IN_GPGME): Define it.
193 * keylist.c (_GPGME_IN_GPGME): Define it.
195 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
196 vasprintf and asprintf.
198 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
200 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
202 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
203 back! (GPA still uses it...).
205 * gpgme.def: Fix stupid typo.
206 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
208 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
210 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
212 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
213 (_gpgme_io_dup): Never allocate threads here.
214 (find_writer, find_reader): Check return value of thread creation
217 * context.h (CTX_OP_DATA_MAGIC): New macro.
218 (struct ctx_op_data): New member MAGIC.
219 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
220 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
222 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
224 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
226 * gpgme.c (result_ref_lock): New global variable.
227 (gpgme_result_ref, gpgme_result_unref): use it.
229 2009-06-16 Werner Koch <wk@g10code.com>
231 * version.c: Include stdlib.h.
233 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
234 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
235 * data.c (gpgme_data_set_encoding): Adjust for new values.
236 * engine-gpg.c (string_from_data): New.
237 (gpg_import): Implement --fetch-key feature.
239 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
240 * gpgme.def, libgpgme.vers: Add them.
241 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
242 (export_keys_start): New.
244 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
245 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
246 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
248 * export.c (gpgme_export_ext_start, gpgme_op_export)
249 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
250 (export_start): Ditto.
251 * engine.c (_gpgme_engine_op_export): Ditto.
252 * engine-backend.h (struct engine_ops): Ditto.
253 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
254 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
256 (gpg_export, gpg_export_ext): Factor common code out to ..
257 (export_common): .. this.
259 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
260 * gpgme.def, libgpgme.vers: Add them.
261 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
262 (_gpgme_op_import_keys_start): New.
263 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
264 * engine-backend.h (struct engine_ops): Ditto.
265 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
266 * engine-gpg.c (gpg_import): Ditto. Implement it.
268 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
270 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
272 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
274 * context.h (struct ctx_op_data): Add member "references".
275 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
276 (_gpgme_release_result): Use gpgme_result_unref.
277 * op-support.c (_gpgme_op_data_lookup): Initialize references.
279 2009-06-12 Werner Koch <wk@g10code.com>
281 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
282 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
283 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
284 (main): Pass flags for my_spawn.
285 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
287 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
288 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
289 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
290 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
291 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
292 * engine-gpg.c (start): Call spawn with new flag.
294 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
295 _gpgme_allow_set_foreground_window. Change all callers.
296 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
298 2009-06-10 Werner Koch <wk@g10code.com>
300 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
302 2009-06-09 Werner Koch <wk@g10code.com>
304 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
306 * version.c (gpgme_check_version_internal): Make result const.
308 * gpgme.c: Include priv-io.h.
309 (gpgme_io_read, gpgme_io_write): New.
310 * libgpgme.vers (GPGME_1.1): Add them.
313 * Makefile.am (main_sources): Remove gpgme.h.
314 (include_HEADERS): Rename to nodist_include_HEADERS so that a
315 VPATH build won't use the distributed one.
317 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
319 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
321 * gpgme.h.in (gpgme_check_version_internal): New prototype.
322 (gpgme_check_version): New macro, overriding function of the same
324 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
325 * context.h (_gpgme_selftest): New variable declaration.
326 * version.c: Include "context.h".
327 (gpgme_check_version): Set _gpgme_selftest on success.
328 (gpgme_check_version_internal): New function.
329 * gpgme.c (_gpgme_selftest): Define it.
330 (gpgme_new): Check the selftest result.
332 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
334 * gpgme.h.in (gpgme_encrypt_flags_t): Add
335 GPGME_ENCRYPT_NO_ENCRYPT_TO.
336 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
337 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
339 2009-05-14 Werner Koch <wk@g10code.com>
341 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
342 better maintainability and to help debugging.
344 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
346 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
348 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
350 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
351 * w32-io.c (_gpgme_io_connect): Fix stupid error.
353 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
355 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
356 (find_channel): Drop CREATE argument.
357 (new_dummy_channel_from_fd, new_channel_from_fd)
358 (new_channel_from_socket): New functions.
359 (_gpgm_io_fd2str): Implement for sockets.
360 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
362 (_gpgme_io_pipe): Fix for new channel bookkeeping.
363 (_gpgme_io_close, _gpgme_io_dup): Likewise.
364 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
365 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
366 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
367 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
368 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
369 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
370 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
372 2009-03-18 Werner Koch <wk@g10code.com>
374 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
375 * engine-gpgsm.c (gpgsm_keylist): Send new option.
377 2009-03-13 Werner Koch <wk@g10code.com>
379 * gpgme-config.in: Make sure locale is set to C.
381 2009-02-24 Werner Koch <wk@g10code.com>
383 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
384 (gpgme_assuan_result_t): New.
385 (gpgme_op_assuan_result): Change return type.
386 (struct _gpgme_assuan_sendfnc_ctx)
387 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
388 (gpgme_assuan_inquire_cb_t): Changed.
389 * opassuan.c (op_data_t): Make use of a result structure.
390 (gpgme_op_assuan_result): Change return type.
391 (opassuan_start): Use result structure.
393 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
394 (inquire_cb_sendfnc): Remove.
395 (inquire_cb): Change for new callback scheme. Not yet finished.
396 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
398 2009-02-04 Werner Koch <wk@g10code.com>
400 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
402 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
404 2009-02-03 Werner Koch <wk@g10code.com>
406 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
408 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
409 * keylist.c (keylist_colon_handler): Factor common code out to ...
410 (parse_sec_field15): New. Set card number.
412 2009-01-26 Werner Koch <wk@g10code.com>
414 * opassuan.c, dirinfo.c, engine-assuan.c: New.
415 * Makefile.am: Add them.
416 * engine-backend.h: Add _gpgme_engine_ops_assuan.
417 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
419 * Makefile.am (gpgsm_components): Add engine-assuan.c.
420 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
421 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
422 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
423 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
424 * gpgme.c (gpgme_get_protocol_name): Ditto.
425 (gpgme_set_protocol): Support it.
426 * engine.c (gpgme_get_engine_info): Ditto.
427 (engine_ops): Register it.
428 (_gpgme_engine_op_assuan_transact): New.
429 * libgpgme.vers (gpgme_op_assuan_transact_start)
430 (gpgme_op_assuan_transact): New.
431 * gpgme.def (gpgme_op_assuan_transact_start)
432 (gpgme_op_assuan_transact): New.
433 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
434 initialize to NULL for all engines.
435 * engine.c (engine_get_home_dir): New.
436 (gpgme_get_engine_info): Use it.
437 (_gpgme_set_engine_info): Use it.
438 * engine.h (engine_assuan_result_cb_t): New.
439 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
441 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
443 * version.c (gpgme_check_version): Protect trace arg against NULL.
445 2009-01-19 Werner Koch <wk@g10code.com>
447 * rungpg.c: Rename to engine-gpg.c
448 * Makefile.am (main_sources): Ditto.
450 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
452 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
454 2008-11-18 Werner Koch <wk@g10code.com>
456 * version.c (do_subsystem_inits): Always initialize I/O
457 subsystem. Fixes regression from 2007-08-02.
459 * decrypt.c (_gpgme_decrypt_status_handler): Use
460 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
462 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
464 * wait-private.c (_gpgme_wait_on_condition): Remove unused
466 * wait-global.c: Include ops.h to silence gcc warning.
467 (_gpgme_wait_global_event_cb): Pass error value directly.
468 * wait-user.c: Include ops.h to silence gcc warning.
470 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
471 silence gcc warning. Cast argument to execv to silence warning.
472 * w32-io.c (_gpgme_io_spawn): Likewise.
473 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
475 2008-10-24 Werner Koch <wk@g10code.com>
477 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
479 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
481 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
482 string to C coded string.
484 2008-10-20 Werner Koch <wk@g10code.com>
486 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
488 * gpgme.h: Rename to gpgme.h.in.
489 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
491 * posix-io.c: Include sys/uio.h. Fixes bug #818.
493 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
495 * w32-util.c (find_program_in_registry): Don't define.
496 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
497 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
498 registry anymore. It is now no longer possible to overwrite the
499 default location in that way.
501 2008-10-17 Werner Koch <wk@g10code.com>
503 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
504 around a bug in mingw32.
506 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
508 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
509 Submitted by "Daniel Mueller" <daniel@danm.de>
511 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
513 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
515 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
517 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
518 * gpgme.c (_gpgme_cancel_with_err): New function.
519 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
520 * wait-private.c (_gpgme_wait_on_condition): Use
521 _gpgme_cancel_with_err.
522 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
523 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
525 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
527 * rungpg.c (command_handler): Remove I/O callback on error, too.
529 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
531 * gpgme.c (gpgme_cancel_async): Remove unused variable.
533 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
535 * libgpgme.vers: Add gpgme_cancel_async.
536 * gpgme.def: Likewise.
538 * context.h: Include "sema.h".
539 (struct gpgme_context): New members lock and canceled.
540 * gpgme.c (gpgme_new): Initialize lock.
541 (gpgme_release): Destroy lock.
542 (gpgme_cancel_async): New function.
543 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
544 * wait-global.c (gpgme_wait): Check cancel flag before processing
546 * wait-private.c (_gpgme_wait_on_condition): Likewise.
547 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
549 2008-06-26 Werner Koch <wk@g10code.com>
551 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
552 (mkstemp): Need to use GetSystemTimeAsFileTime for better
555 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
557 * gpgme-w32spawn.c: New file.
558 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
560 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
561 (gpgsm_set_locale): Return early if locale value is NULL.
562 * util.h (_gpgme_mkstemp)
563 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
565 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
566 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
568 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
569 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
570 special filename FD rather than stdin.
571 (struct arg_and_data_s): Add member ARG_LOCP.
572 (struct fd_data_map_s): Add member ARG_LOC.
573 (struct engine_gpg): Add member ARG_LOC to status and colon.
574 (_add_arg, add_arg_with_locp): New function.
575 (add_arg_ext): Reimplement in terms of _add_arg.
576 (gpg_new): Remember argument location for status FD.
577 (build_argv): Set argument location if requested. Also set
578 argument location of fd_data_map for data items.
579 (start): Adjust caller of _gpgme_io_spawn.
580 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
582 (_gpgme_io_spawn): Remove parent fd list argument.
583 * posix-io.c (get_max_fds): New function.
584 (_gpgme_io_dup): Add tracing.
585 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
586 fd list to contain all child fds that should be inherited. Close
587 all other file descriptors after fork.
588 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
589 parent fd list. Change meaning of child fd list to contain all
590 child fds that should be inherited. Do not inherit any file
591 descriptors, but DuplicateHandle them. Spawn process through
592 wrapper process. Provide wrapper process with a temporary file
593 containing handle translation data. Return translated handle
595 * w32-io.c (reader): Add more tracing output.
596 (_gpgme_io_read): Likewise.
597 * engine-gpgconf.c (gpgconf_read): Adjust caller of
599 * version.c (_gpgme_get_program_version): Likewise.
601 2008-06-20 Werner Koch <wk@g10code.com>
603 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
604 compatibility with old compilers. Fix amount of memmove. Fix
607 2008-06-19 Werner Koch <wk@g10code.com>
609 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
610 change all callers and provide compatibilty macro.
611 (gpgme_conf_type_t): Add complex types 34..37.
612 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
613 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
615 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
617 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
619 2008-05-09 Werner Koch <wk@g10code.com>
621 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
624 2008-05-07 Werner Koch <wk@g10code.com>
626 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
627 self-explaining string. Needs a proper fix, though.
629 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
631 (gpg_build_keylist_options): .. new. Allow combination of extern
633 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
635 2008-05-06 Werner Koch <wk@g10code.com>
637 * version.c (extract_version_string): New.
638 (_gpgme_get_program_version): Use it to allow for suffixes in the
641 2008-04-28 Werner Koch <wk@g10code.com>
643 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
646 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
648 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
649 Osterfeld, implement blocking select.
651 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
653 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
655 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
657 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
658 Reported by Marc Mutz.
660 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
662 * decrypt.c (release_op_data): Release OPD->result.recipients.
663 * encrypt.c (release_op_data): Release invalid_recipient.
665 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
667 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
669 2008-02-14 Werner Koch <wk@g10code.com>
671 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
672 * posix-io.c (_gpgme_io_spawn): Ditto.
673 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
674 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
675 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
676 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
678 * w32-util.c (_gpgme_allow_set_foregound_window): New.
679 * posix-util.c (_gpgme_allow_set_foregound_window): New.
680 * engine-gpgsm.c (default_inq_cb): New.
681 (gpgsm_new) [W32]: Enable pinentry notifications.
682 (status_handler): Handle inquiries.
684 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
686 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
689 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
691 * engine-gpgsm.c (map_input_enc): Rename to ...
692 (map_data_enc): ... this. Also change all callers.
693 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
694 (gpgsm_sign): Set encoding for output.
696 2008-01-28 Werner Koch <wk@g10code.com>
698 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
700 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
702 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
705 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
707 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
709 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
712 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
714 * Makefile.am (gpgconf_components): New variable.
715 (main_sources): Add gpgconf.c.
716 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
717 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
718 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
719 (gpgme_conf_arg_release, gpgme_conf_opt_change)
720 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
722 * gpgconf.c, engine-gpgconf.c: New files.
723 * engine.h: (_gpgme_engine_op_conf_load,
724 (_gpgme_engine_op_conf_save): New prototypes.
725 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
727 * posix-util.c (_gpgme_get_gpgconf_path): New function.
728 * w32-util.c (_gpgme_get_gpgconf_path): New function.
730 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
732 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
733 * gpgme.def: Add new gpgconf related interfaces.
734 * libgpgme.vers: Likewise.
735 * util.h (_gpgme_get_gpgconf_path): New prototype.
736 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
737 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
738 (struct engine_ops): Add members for conf_load and conf_save.
739 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
740 (_gpgme_engine_op_conf_load,
741 (_gpgme_engine_op_conf_save): New functions.
742 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
744 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
746 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
747 for installation directory. Remove old fallback default.
748 (find_program_in_inst_dir): New function.
750 2007-11-26 Werner Koch <wk@g10code.com>
752 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
753 always reset it before calling start.
754 (gpgsm_new): Clear it.
755 (status_handler): Implement it.
756 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
758 2007-11-23 Werner Koch <wk@g10code.com>
760 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
761 * getauditlog.c (getauditlog_start): Use that flag.
763 2007-11-22 Werner Koch <wk@g10code.com>
765 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
766 * libgpgme.vers: Ditto.
768 * getauditlog.c: New.
769 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
770 * engine-gpgsm.c (gpgsm_getauditlog): New.
771 (_gpgme_engine_ops_gpgsm): Insert new function.
772 (gpgsm_new): Try to enable audit log support.
773 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
775 2007-11-20 Werner Koch <wk@g10code.com>
777 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
779 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
781 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
783 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
785 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
787 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
789 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
792 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
794 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
797 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
799 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
800 w32-qt-io.cpp: New versions from Frank Osterfeld.
802 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
804 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
805 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
806 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
807 Submitted by Frank Osterfeld.
809 * priv-io.h, engine-gpgsm.c: Add comments.
810 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
811 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
813 (_gpgme_io_dup): Acquire a reference. Replace unused
814 implementation by assertion.
816 2007-09-28 Werner Koch <wk@g10code.com>
818 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
820 (gpgsm_set_fd): Use it.
822 * w32-glib-io.c (find_channel): Add a new primary flag.
823 (_gpgme_io_close): Close channel only if primary.
824 (_gpgme_io_dup): Put newfd into the table as shallow copy.
826 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
827 * w32-io.c (_gpgme_io_select): Ditto.
828 * w32-glib-io.c (_gpgme_io_select): Ditto.
830 * posix-io.c (_gpgme_io_select): Ditto.
831 * rungpg.c (read_status): Ditto.
832 * wait.c (fd_table_put): Ditto.
834 * rungpg.c (gpg_io_event): Add tracing.
835 (start): Use gpg_io_event for sending the start event.
836 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
837 (start): Use gpgsm_io_event for sending the start event.
838 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
840 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
842 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
843 versions from Frank Osterfeld.
845 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
847 * w32-glib-io.c (_gpgme_io_spawn),
848 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
849 the process handle, return 0.
851 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
852 * gpgme.c (gpgme_get_protocol_name): Implement support for
853 GPGME_PROTOCOL_UNKNOWN.
855 * kdpipeiodevice.h: Fix last change.
857 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
858 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
861 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
863 * conversion.c, keylist.c: Include <sys/types.h>.
865 * kdpipeiodevice.h: Use namespace _gpgme_.
866 * kdpipeiodevice.cpp: Use namespace _gpgme_.
867 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
868 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
869 _gpgme_::KDPipeIODevice.
871 2007-09-17 Werner Koch <wk@g10code.com>
873 * rungpg.c (gpg_new): Make robust against undefined ttyname or
876 2007-09-14 Werner Koch <wk@g10code.com>
878 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
880 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
882 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
884 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
886 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
889 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
891 * Makefile.am (libgpgme_qt_la_SOURCES): Move
892 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
893 another file (it's more like a header file than a cpp file, but
894 automake doesn't know that).
896 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
897 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
898 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
900 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
901 kdpipeiodevice.moc, w32-qt-io.c: New files.
902 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
903 (ltlib_gpgme_qt): New variable.
904 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
905 (libgpgme_qt_la_SOURCES): New variable.
906 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
907 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
908 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
909 (libgpgme_qt_la_LIBADD): New variables.
911 * sema.h (struct critsect_s): Rename "private" to "priv" to make
912 C++ users happy. Change users.
913 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
914 (_gpgme_sema_cs_destroy): Likewise.
915 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
916 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
917 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
919 (gpgme_get_fdptr): New function.
920 * w32-io.c (gpgme_get_fdptr): New function
921 * gpgme.def: Add gpgme_get_fdptr.
923 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
925 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
926 (writer): Remove superfluous check.
928 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
930 * gpgme.h: Move include of gpg-error.h out of extern "C".
932 2007-08-07 Werner Koch <wk@g10code.com>
934 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
935 * verify.c (parse_trust): Set Chain_MODEL.
937 2007-08-02 Werner Koch <wk@g10code.com>
939 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
940 * w32-io.c (_gpgme_io_spawn): Ditto.
941 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
942 * debug.c (_gpgme_debug): Enable assuan logging.
943 (_gpgme_debug_subsystem_init): New.
944 * version.c (do_subsystem_inits): Disable assuan logging and
945 initialize the debug system.
946 (gpgme_check_version): Do not trace before the subsystems are
949 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
951 * debug.c: Include <errno.h> and "debug.h".
952 (_gpgme_debug): Save and restore ERRNO.
954 (_gpgme_debug_buffer): New function.
955 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
956 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
957 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
958 most of these files, add many more tracepoints.
960 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
962 * engine-gpgsm.c (status_handler): Do not send BYE here.
964 * w32-io.c (struct reader_context_s, struct writer_context_s): New
966 (create_reader, create_writer): Initialize C->refcount to 1.
967 (destroy_reader, destroy_writer): Only destroy if C->refcount
969 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
970 * priv-io.h (_gpgme_io_dup): New prototype.
971 * posix-io.c (_gpgme_io_dup): New function.
972 * w32-io.c (_gpgme_io_dup): Likewise.
973 * w32-glib-io.c (_gpgme_io_dup): Likewise.
974 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
976 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
978 * data-user.c (user_read, user_write, user_seek): Set errno and
979 return -1 instead returning the error code directly.
980 * data-compat.c (old_user_seek): Likewise.
981 * gpgme.c (gpgme_sig_notation_add): Return error properly.
983 * Revert the "close_notify_handler" returns int stuff. Always
984 close in the _gpgme_io_close implementations.
985 * engine-gpgsm.c (status_handler): Try to terminate the connection
987 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
988 (_gpgme_io_write): Likewise.
990 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
991 to _gpgme_close_notify_handler.
992 (_gpgme_close_notify_handler): New type.
993 (_gpgme_io_dup): Remove prototype.
994 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
995 type of HANDLER to _gpgme_close_notify_handler_t.
996 (_gpgme_io_close): Do not close the FD if handler returns 0.
997 (_gpgme_io_dup): Remove function.
998 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
999 _gpgme_io_close): Change type of HANDLER to
1000 _gpgme_close_notify_handler_t.
1001 (_gpgme_io_close): Do not close the FD if handler returns 0.
1002 (_gpgme_io_dup): Remove function.
1003 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1004 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1005 to _gpgme_close_notify_handler_t.
1006 (_gpgme_io_close): Do not close the FD if handler returns 0.
1007 * rungpg.c (close_notify_handler): Change return type to int,
1009 * engine-gpgsm.c (close_notify_handler): Change return type to
1010 int, return 0 for status FD and 1 for all other FDs.
1011 (start): Do not duplicate the status FD.
1013 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1015 * Makefile.am: Replace implicite rule by suffix rule. Add
1018 2007-07-12 Werner Koch <wk@g10code.com>
1020 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1021 system has been started.
1023 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1025 * priv-io.h (_gpgme_io_dup): New prototype.
1026 * posix-io.c (_gpgme_io_dup): New function.
1027 * w32-io.c (_gpgme_io_dup): Likewise.
1028 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1029 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1031 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1033 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1034 * funopen.c (funopen): Rename to _gpgme_funopen.
1036 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1038 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1039 * rungpg.c (gpg_new): Likewise.
1040 Submitted by Stephen Tether.
1042 2007-02-26 Werner Koch <wk@g10code.com>
1044 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1045 (_gpgme_verify_status_handler): Return an error if more than one
1046 plaintext has been seen.
1047 (parse_error): New arg SET_STATUS. Also detect it based on an
1048 ERROR status (gpg > 1.4.6).
1050 2007-01-26 Werner Koch <wk@g10code.com>
1052 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1053 * w32-glib-io.c (build_commandline): Ditto.
1055 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1057 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1059 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1061 * data.h (_gpgme_data_get_fd): Add prototype.
1062 (gpgme_data_get_fd_cb): New type.
1063 (struct _gpgme_data_cbs): New member get_fd.
1064 * data.c (_gpgme_data_get_fd): New function.
1065 * data-fd.c (fd_get_fd): New function.
1066 (fd_cbs): Add fd_get_fd.
1067 * data-stream.c (stream_get_fd): New function.
1068 (stream_cbs): Add stream_get_fd.
1069 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1070 * data-user.c (user_cbs): Likewise.
1071 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1072 short-cut by passing the data descriptor directly.
1074 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1076 * w32-io.c (build_commandline): Quote all command line arguments.
1077 * w32-glib-io.c (build_commandline): Likewise.
1079 2007-01-10 Werner Koch <wk@g10code.com>
1081 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1083 2007-01-08 Werner Koch <wk@g10code.com>
1085 * version.c (do_subsystem_inits): Do assuan init only if building
1087 * setenv.c: Include assuan-def.h only if building with Assuan
1090 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1092 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1093 * rungpg.c (gpg_set_locale): Ditto.
1095 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1097 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1098 switching protocols.
1099 (gpgme_ctx_set_engine_info): Likewise for engine info.
1100 * engine.h (_gpgme_engine_reset): New function prototype.
1101 * engine.c (_gpgme_engine_reset): New function.
1102 * engine-backend.h (struct engine_ops): New member RESET.
1103 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1104 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1105 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1106 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1108 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1109 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1110 function if available.
1111 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1113 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1115 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1116 lc_messages from prototype.
1117 (_gpgme_engine_set_locale): New prototype.
1118 * engine.c (_gpgme_engine_set_locale): New function.
1119 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1120 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1121 Remove arguments lc_messages and lc_ctype from member NEW.
1122 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1123 and lc_messages_set.
1124 (gpgsm_new): Remove lc_messages and lc_ctype
1126 (gpgsm_set_locale): New function.
1127 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1128 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1130 (gpg_release): Release lc_messages and lc_ctype if set.
1131 (gpg_new): Remove lc_messages and lc_ctype arguments.
1132 (gpg_set_locale): New function.
1133 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1134 (add_arg): Implement in terms of:
1135 (add_arg_ext): New function.
1136 (start): Set lc-messages and lc-ctype arguments here.
1138 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1140 * engine-gpgsm.c (struct engine_gpgsm): Move members
1141 input_fd_server, output_fd_server, message_fd_server to ...
1142 (iocb_data): ... here (as server_fd).
1143 (close_notify_handler): Reset tags as well.
1144 (gpgsm_new): Implement support for descriptor
1146 (fd_type_t): New type.
1147 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1148 for unused communication channels.
1149 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1150 relevant callers adjusted as well (previously of _gpgme_io_close).
1152 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1154 * version.c: Include "assuan.h".
1155 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1157 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1159 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1160 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1161 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1163 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1164 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1165 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1166 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1168 (noinst_LTLIBRARIES): Removed.
1169 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1170 (AM_CFLAGS): New variable.
1172 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1174 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1175 ASSUAN_CONTEXT with assuan_context_t.
1177 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1179 * engine-gpgsm.c (gpgsm_new): Check return value of
1180 assuan_pipe_connect.
1182 * rungpg.c: Include <unistd.h>.
1183 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1184 --lc-messages. Fixes issue 734.
1186 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1188 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1191 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1193 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1194 _gpgme_engine_io_event().
1196 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1198 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1200 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1203 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1205 * keylist.c (keylist_colon_handler): Move debug output after
1208 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1210 * gpgme-config.in (Options): Add NETLIBS.
1211 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1212 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1214 * rungpg.c (read_status): Fix comparison disguising as an
1217 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1219 * gpgme.c (gpgme_set_locale): Remove conditional on
1220 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1222 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1224 * rungpg.c (read_status): Strip potential carriage return.
1225 * genkey.c (get_key_parameter): Skip potential carriage return.
1226 * version.c (_gpgme_get_program_version): Strip potential carriage
1229 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1232 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1234 * keylist.c (gpgme_get_key): Also clone the engine info.
1236 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1238 * gpgme-config.in (cflags_pth): Revert accidential removal of
1239 pthread support with last change.
1241 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1243 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1244 (_gpgme_io_pipe): Open pipes in binary mode.
1246 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1248 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1249 checking the version correctly even after changing the engine
1250 information. Bug reported by Stéphane Corthésy.
1252 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1254 (colon_preprocessor_t): New type.
1255 (struct engine_gpg): New member colon.preprocess_fnc.
1256 (gpg_keylist_preprocess): New function.
1257 * keylist.c (keylist_colon_handler): Allow short key IDs.
1259 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1261 * w32-io.c (create_writer): Make C->have_data a manually resetted
1263 (writer): Move code from end of if block to beginning, so it
1264 is also run the first time.
1265 (_gpgme_io_write): Move assert check after error check. Reset
1266 the is_empty event, and also do it eagerly.
1267 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1269 2006-01-26 Werner Koch <wk@g10code.com>
1271 * w32-util.c (_gpgme_get_conf_int): New.
1272 * posix-util.c (_gpgme_get_conf_int): New.
1273 * w32-io.c (get_desired_thread_priority): New.
1274 (create_reader, create_writer): Use it here.
1276 2006-01-04 Werner Koch <wk@g10code.com>
1278 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1280 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1281 statements. Disable error return for failed nonblocking call.
1283 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1285 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1288 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1290 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1291 (_gpgme_io_select): Fix debug output.
1293 2005-12-23 Werner Koch <wk@g10code.com>
1295 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1296 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1299 2005-12-20 Werner Koch <wk@g10code.com>
1301 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1302 and GPGME_STATUS_PKA_TRUST_GOOD.
1303 (struct _gpgme_signature): New field pka_trust.
1304 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1306 2005-12-06 Werner Koch <wk@g10code.com>
1308 * keylist.c (keylist_colon_handler): Store fingerprints of the
1309 subkeys. Reset the secret flag of subkeys for stub secret keys.
1310 (NR_FIELDS): Bumped up to 16
1312 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1314 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1315 engine_get_version invocation. Reported by Stéphane Corthésy.
1317 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1319 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1321 2005-11-18 Werner Koch <wk@g10code.com>
1323 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1325 (find_channel): Better use g_io_channel_win32_new_fd instead of
1326 the autodetection function g_io_channel_unix_new.
1327 (_gpgme_io_select): Rewritten. It is now a fully working select
1330 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1332 * priv-io.h (_gpgme_io_fd2str): New prototype.
1333 * posix-io.c (_gpgme_io_fd2str): New function.
1334 * w32-io.c (_gpgme_io_fd2str): New function.
1335 * rungpg.c: Use this new function.
1336 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1337 again. Two's company, three's the musketeers.
1339 * w32-glib-io.c: Rewrote the file handle code. We don't create
1340 system fds for every handle (doesn't work for inherited handles),
1341 but we create pseudo fds in a private namespace that designate a
1342 handle and potentially a giochannel.
1344 2005-11-18 Werner Koch <wk@g10code.com>
1346 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1348 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1350 * w32-glib-io.c: New file.
1351 * gpgme.def (gpgme_get_giochannel): Add symbol.
1352 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1354 (ltlib_gpgme_extra): New variable.
1355 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1356 (system_components_not_extra): New variable.
1357 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1358 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1359 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1360 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1361 [BUILD_W32_GLIB]: New variables.
1362 * gpgme-config.in (glib): New option.
1363 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1365 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1367 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1368 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1369 * posix-io.c (_gpgme_io_kill): Removed.
1370 (_gpgme_io_waitpid): Declare static.
1372 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1374 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1376 2005-10-21 Werner Koch <wk@g10code.com>
1378 * Makefile.am: Fixed cut+paste problem
1380 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1382 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1385 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1387 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1390 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1392 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1395 * gpgme.h (gpgme_free): New prototype.
1396 * data-mem.c (gpgme_free): New function.
1397 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1398 * gpgme.def: Add gpgme_free.
1400 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1402 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1404 * verify.c (parse_notation): Likewise for invocation.
1405 * conversion.c (_gpgme_decode_percent_string): Likewise to
1406 declaration. If set, do not replace '\0' characters with a
1408 * gpgme.h (struct _gpgme_key_sig): New field notations.
1409 * ops.h (_gpgme_parse_notation): New prototype.
1410 * sig-notation.c (_gpgme_parse_notation): New function.
1411 * key.c (gpgme_key_unref): Free all signature notations.
1412 * keylist.c (op_data_t): New member tmp_keysig.
1413 (finish_key): Clear OPD->tmp_keysig.
1414 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1415 * rungpg.c (gpg_keylist): Support listing signature notations.
1416 (gpg_keylist_ext): Likewise.
1418 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1420 * engine.h (_gpgme_set_engine_info): Add prototype.
1421 * engine-backend.h (struct engine_ops): Change return type of
1422 get_file_name() to const char * to silence gcc warning.
1423 * engine.c (engine_get_file_name): Change return type to const
1424 char * to silence gcc warning.
1425 (gpgme_get_engine_info): Use transitional variable to go from
1426 const char * to char * to silence gcc warning.
1427 (_gpgme_set_engine_info): Likewise.
1428 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1429 char * to silence gcc warning.
1430 (gpgsm_new): Make ARGV a pointer to const char.
1431 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1432 to char * to silence gcc warning.
1434 * gpgme.def: Add gpgme_data_set_file_name,
1435 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1436 gpgme_sig_notation_add and gpgme_sig_notation_get.
1437 * libgpgme.vers: Add gpgme_sig_notation_clear,
1438 gpgme_sig_notation_add and gpgme_sig_notation_get.
1439 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1440 * context.h (struct gpgme_context): New field sig_notations.
1441 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1443 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1444 (gpgme_sig_notation_flags_t): New type.
1445 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1446 gpgme_sig_notation_get): New prototypes.
1447 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1449 * sig-notation.c (_gpgme_sig_notation_free): New file.
1450 * verify.c (parse_notation): Use support functions.
1451 (release_op_data): Likewise.
1452 * rungpg.c (append_args_from_sig_notations): New function.
1453 (gpg_encrypt_sign, gpg_sign): Call it.
1455 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1457 * data.h (struct gpgme_data): New member file_name.
1458 * data.c (gpgme_data_set_filename): New function.
1459 (_gpgme_data_release): Free DH->filename if necessary.
1460 (gpgme_data_get_filename): New function.
1461 * rungpg.c (gpg_encrypt): Set filename option.
1462 (gpg_encrypt_sign): Likewise.
1463 (gpg_sign): Likewise.
1464 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1465 gpgme_data_get_file_name.
1467 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1470 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1472 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1473 (struct _gpgme_subkey): Likewise.
1474 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1477 2005-09-23 Werner Koch <wk@g10code.com>
1479 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1481 (create_reader, create_writer): Set thread priority higher.
1483 2005-09-19 Werner Koch <wk@g10code.com>
1485 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1486 the size of the pipe buffer.
1488 2005-09-13 Werner Koch <wk@g10code.com>
1490 * ath.c: Changes to make it work under W32.
1492 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1494 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1495 (ath_pth_src, ath_pthread_src): Removed.
1496 (w32_o_files): Replace ath-compat.o with ath.o.
1497 (libgpgme_pth_la_CFLAGS): New variable.
1498 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1499 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1500 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1501 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1502 (_ATH_COMPAT): Macro removed.
1503 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1506 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1508 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1510 2005-09-07 Werner Koch <wk@g10code.com>
1512 * w32-io.c (build_commandline): Quote argv[0].
1514 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1516 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1518 * edit.c (command_handler): Do not depend on PROCESSED being
1521 * engine.h (engine_command_handler_t): Add new argument processed.
1522 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1524 (_gpgme_passphrase_command_handler): ... this one.
1525 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1527 (_gpgme_passphrase_command_handler): ... this one.
1528 * edit.c (command_handler): Add new argument processed. Remove
1529 local variable with the same name. Always return processed as
1531 * rungpg.c (command_handler): Send a newline character if the
1534 2005-08-26 Werner Koch <wk@g10code.com>
1536 * w32-util.c (read_w32_registry_string): Updated from code used by
1537 GnuPG. This allows for expanding strings and features the
1538 implicit fallback key.
1539 (w32_shgetfolderpath, find_program_at_standard_place): New.
1540 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1541 entry, locate the programs at the standard place.
1542 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1543 we are accustomed to.
1545 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1546 semicolon is used which allows us to create files with drive
1549 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1552 2005-08-19 Werner Koch <wk@g10code.com>
1555 * versioninfo.rc.in: New.
1556 * Makefile.am: Addes support for building a W32 DLL.
1558 * ttyname_r.c (ttyname_r) [W32]: Return error.
1559 * ath-compat.c [W32]: select and co are not yet supported; return
1561 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1563 2005-08-08 Werner Koch <wk@g10code.com>
1565 * util.h (stpcpy): Renamed to ..
1566 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1567 definitions when linking statically.
1568 * stpcpy.c: Removed.
1570 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1572 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1573 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1574 (struct _gpgme_op_verify_result): Likewise.
1575 * ops.h (_gpgme_parse_plaintext): Add prototype.
1576 * op-support.c (_gpgme_parse_plaintext): New function.
1577 * decrypt.c (release_op_data): Release
1578 OPD->result.plaintext_filename.
1579 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1580 * verify.c (release_op_data): Release
1581 OPD->result.plaintext_filename.
1582 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1584 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1586 * keylist.c (gpgme_get_key): Allow key IDs.
1588 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1590 * gpgme.m4: Only call GPGME_CONFIG if found.
1592 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1594 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1596 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1597 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1599 (_gpgme_decrypt_status_handler): Fix last change.
1601 * gpgme.h (struct _gpgme_recipient): New structure.
1602 (gpgme_recipient_t): New type.
1603 (struct _gpgme_op_decrypt_result): Add member recipients.
1604 * decrypt.c (op_data_t): New member last_recipient_p.
1605 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1606 (parse_enc_to): New function.
1607 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1610 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1612 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1614 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1616 * wait.h (_gpgme_run_io_cb): New prototype.
1617 * wait.c (_gpgme_run_io_cb): New function.
1618 * wait-global.c (gpgme_wait): Call it.
1619 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1620 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1622 2005-06-02 Werner Koch <wk@g10code.com>
1624 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1625 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1626 (_gpgme_passphrase_command_handler_internal): Also act on the key
1627 "passphrase.pin.ask".
1629 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1630 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1631 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1632 GPGME_STATUS_BACKUP_KEY_CREATED.
1634 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1636 * data-user.c: Include <errno.h>.
1638 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1640 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1643 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1645 * w32-io.c (_gpgme_io_select): Fix loop increment.
1647 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1649 * data-user.c (user_release): Only call user hook if provided.
1650 (user_seek): Return EBADF if no user hook is provided.
1651 (user_read): Likewise.
1652 (user_write): Likewise.
1654 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1656 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1657 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1658 the reset, just for cleanliness, and do not sent it at all if the
1659 default is requested.
1660 * gpgme.c (gpgme_set_include_certs): Allow to use
1661 GPGME_INCLUDE_CERTS_DEFAULT.
1663 2005-04-21 Werner Koch <wk@g10code.com>
1665 * verify.c (calc_sig_summary): Set the key revoked bit.
1667 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1669 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1670 in the list, not the user-provided CTX.
1671 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1673 * wait-global.c (gpgme_wait): If no context is found, and we
1674 should not hang, set *status to 0 and return NULL.
1675 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1677 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1679 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1680 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1681 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1682 ENOSYS instead EOPNOTSUPP.
1683 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1684 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1687 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1689 * io.h: Rename to ...
1690 * priv-io.h: ... this.
1691 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1692 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1693 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1694 Change all includes of "io.h" to "priv-io.h"
1696 2005-03-09 Werner Koch <wk@g10code.com>
1698 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1699 cast away type checks.
1701 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1704 * data.h [W32]: Removed kludge for EOPNOTSUP.
1705 * data.c, data-compat.c [W32]: Explicitly test for it here.
1707 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1710 2005-03-07 Timo Schulz <twoaday@g10code.de>
1712 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1713 * ath.h: [_WIN32] Added some (dummy) types.
1714 * io.h: [_WIN32] include stdio.h.
1715 * data.h: [_WIN32] Define EOPNOTSUPP.
1716 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1717 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1719 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1721 * engine.c (_gpgme_set_engine_info): Fix assertion.
1723 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1725 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1727 * ttyname_r.c: New file.
1729 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1731 * putc_unlocked.c, funopen.c: I just claim copyright on these
1732 files and change their license to LGPL, because they are totally
1733 trivial wrapper functions.
1734 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1735 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1736 defined as a macro doing exactly the same as the function in this
1738 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1739 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1740 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1741 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1742 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1743 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1744 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1745 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1746 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1747 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1748 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1749 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1750 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1751 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1754 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1756 * libgpgme.vers (GPGME_1.1): New version.
1757 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1758 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1759 member new(). Change return type of get_file_name and get_version
1761 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1762 pointer. Do not cache result.
1763 (gpgsm_new): Add file_name and home_dir argument, and use them
1764 instead of the defaults, if set.
1765 * rungpg.c (struct engine_gpg): New member file_name.
1766 (gpg_get_version): Change return type to char pointer, and do not
1768 (gpg_release): Free gpg->file_name.
1769 (gpg_new): Take new arguments file_name and home_dir. Set the
1770 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1771 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1772 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1774 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1776 * engine.c: Include <assert.h>.
1777 (gpgme_get_engine_info): Set *INFO within the lock. Move
1778 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1779 (engine_info, engine_info_lock): ... here. New static variables.
1780 (engine_get_version): Add file_name argument to
1781 get_version invocation. Change return type to char pointer.
1782 (gpgme_engine_check_version): Rewritten to free() the return value
1783 of engine_get_version after using it.
1784 (_gpgme_engine_info_release): New function.
1785 (gpgme_get_engine_info): Rewritten.
1786 (_gpgme_engine_info_copy): New function.
1787 (_gpgme_set_engine_info): New function.
1788 (gpgme_set_engine_info): New function.
1789 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1791 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1792 and version to char * (remove the const). New member home_dir.
1793 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1794 gpgme_ctx_set_engine_info): New prototypes.
1795 * context.h (struct gpgme_context): New member engine_info.
1796 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1797 (gpgme_release): Deallocate CTX->engine_info.
1798 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1800 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1801 pass it to _gpgme_engine_new.
1802 * version.c (gpgme_check_version): Adjust to
1803 _gpgme_compare_versions returning an int.
1804 (_gpgme_compare_versions): Return an int value, not a const char
1806 * ops.h (_gpgme_compare_versions): Same for prototype.
1808 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1810 * verify.c (parse_trust): If no reason is provided, set
1811 SIG->validity_reason to 0.
1812 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1814 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1816 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1817 (start): Call map_assuan_error on return value of
1820 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1822 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1825 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1827 * gpgme.m4: Implement the --api-version check.
1829 * rungpg.c (read_status): Move the polling of the output data pipe
1830 to just before removing the command fd, from just before adding
1831 it. This avoids buffering problems.
1833 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1834 read, to improve debug output.
1836 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1838 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1839 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1840 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1841 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1843 (gpgme_keylist_mode_t): Define as unsigned int.
1844 (gpgme_key_t): Change type of keylist_mode to
1845 gpgme_keylist_mode_t.
1847 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1849 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1852 * data-stream.c (stream_seek): Call ftello and return the current
1854 * data.h (struct gpgme_data): Change type of data.mem.offset to
1856 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1857 callback. If SEEK_CUR, adjust the offset by the pending buffer
1858 size. Clear pending buffer on success.
1861 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1863 * gpgme.m4: Add copyright notice.
1865 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1867 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1870 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1872 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1874 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1876 * key.c (_gpgme_key_append_name): Make sure tail points to the
1877 byte following the uid.
1878 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1881 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1883 * libgpgme.vers: Remove C-style comment, which is not supported by
1886 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1888 * gpgme-config.in (Options): Support --api-version.
1890 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1892 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1893 * verify.c (parse_error): Likewise.
1895 * verify.c (parse_error): Do not skip location of where token.
1897 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1898 * verify.c (_gpgme_verify_status_handler): Add handling of
1899 GPGME_STATUS_REVKEYSIG.
1900 (parse_trust): Likewise.
1902 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1904 * gpgme.h (struct _gpgme_decrypt_result): New fields
1905 wrong_key_usage and _unused.
1906 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1907 character after a matched string, as in a protocol error this
1908 could skip over the trailing binary zero.
1909 Handle decrypt.keyusage error notifications.
1911 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1912 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1914 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1916 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1917 to unsigned int. Same for member _unused.
1919 * keylist.c (set_mainkey_trust_info): Rewritten.
1920 (set_subkey_capability): Handle 'd' (disabled).
1921 (set_mainkey_capability): Rewritten.
1923 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1925 * gpgme.m4: Quote first argument to AC_DEFUN.
1927 2004-04-21 Werner Koch <wk@gnupg.org>
1929 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1930 The rule of least surprise.
1932 2004-04-15 Werner Koch <wk@gnupg.org>
1934 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1935 unused result.signatures items.
1937 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1939 2004-04-08 Werner Koch <wk@gnupg.org>
1941 * verify.c (_gpgme_verify_status_handler): Ignore the error status
1942 if we can't process it.
1943 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
1944 yesterday's hack. It is not any longer required.
1946 2004-04-07 Werner Koch <wk@gnupg.org>
1948 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
1949 with meaningless error codes from the verify status function.
1951 2004-04-05 Werner Koch <wk@gnupg.org>
1953 * gpgme.h: Add GPGME_STATUS_NEWSIG.
1955 * verify.c (parse_error): Compare only the last part of the where
1957 (prepare_new_sig): New.
1958 (parse_new_sig): Use prepare_new_sig when required.
1959 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
1961 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
1962 option. Fixed pattern construction.
1963 (status_handler): Add debugging output.
1965 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
1967 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
1968 isatty(). Submitted by Bernhard Herzog.
1970 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
1972 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
1975 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
1977 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
1978 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
1980 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
1982 * gpgme-config.in: Do not emit include and lib directory for
1983 prefix "/usr" or "".
1985 2004-03-03 Werner Koch <wk@gnupg.org>
1987 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
1990 2004-02-18 Werner Koch <wk@gnupg.org>
1992 * gpgme-config.in: Ignore setting of --prefix.
1994 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
1996 * rungpg.c (gpg_cancel): New function.
1997 (gpg_release): Call it here.
1998 (_gpgme_engine_ops_gpg): Add it here.
1999 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2001 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2003 * gpgme.c (gpgme_cancel): New function.
2004 * engine-backend.h (struct engine_ops): New member cancel.
2005 * engine.h (_gpgme_engine_cancel): New prototype.
2006 * engine.c (_gpgme_engine_cancel): New function.
2007 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2008 (gpgsm_cancel): New function.
2009 (gpgsm_release): Use it.
2010 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2012 2004-02-17 Werner Koch <wk@gnupg.org>
2014 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2015 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2017 2004-02-15 Werner Koch <wk@gnupg.org>
2019 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2020 by Adriaan de Groot.
2022 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2024 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2026 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2028 * data-stream.c (stream_seek): Likewise.
2030 2004-01-16 Werner Koch <wk@gnupg.org>
2032 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2035 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2037 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2039 2004-01-12 Werner Koch <wk@gnupg.org>
2041 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2043 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2045 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2046 (struct _gpgme_key_sig): For C++ compilers, rename class
2047 member to _obsolete_class. Add new member sig_class.
2048 (struct _gpgme_new_signature): Same here.
2049 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2051 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2052 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2053 * sign.c (parse_sig_created): Set SIG->sig_class.
2055 2003-12-22 Werner Koch <wk@gnupg.org>
2057 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2060 2003-11-19 Werner Koch <wk@gnupg.org>
2062 * conversion.c (_gpgme_parse_timestamp): New.
2063 (atoi_1, atoi_2, atoi_4): New.
2064 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2066 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2067 * sign.c (parse_sig_created): Ditto.
2069 2003-10-31 Werner Koch <wk@gnupg.org>
2071 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2074 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2076 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2077 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2079 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2081 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2084 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2087 * io.h (_gpgme_io_subsystem_init): New prototype.
2088 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2089 (_gpgme_io_spawn): Do not fixup signal handler here.
2090 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2092 * debug.c (debug_init): Drop const qualifier from E.
2094 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2096 (ath_connect): Make ADDR argument const.
2097 * ath-pthread.c (ath_connect): Likewise.
2098 * ath-pth.c (ath_connect): Likewise.
2099 * ath-compat.c (ath_connect): Likewise.
2100 * ath.c (ath_connect): Likewise.
2102 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2103 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2105 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2107 * util.h (_gpgme_hextobyte): Likewise for prototype.
2109 * gpgme.h: Remove trailing comma in enum.
2111 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2112 <signal.h>, <fcntl.h>, or "unistd.h".
2114 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2116 * engine-backend.h (struct engine_ops): Add argument TYPE.
2117 * engine.c (_gpgme_engine_op_edit): Likewise.
2118 * engine.h: Likewise.
2119 * rungpg.c (gpg_edit): Likewise. Use it.
2120 * edit.c (edit_start): Likewise. Pass it on.
2121 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2122 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2124 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2126 * gpgme.h (gpg_strerror_r): Change prototype to match
2127 gpg_strerror_r change.
2128 * error.c (gpg_strerror_r): Likewise, also update implementation.
2130 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2131 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2132 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2134 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2136 * gpgme.h: Add prototype for gpgme_set_locale.
2138 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2139 characteristics and use that instead __inline__.
2141 * context.h (struct gpgme_context): New members lc_ctype and
2143 * gpgme.c: Include <locale.h>.
2144 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2146 (gpgme_set_locale): New function.
2147 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2149 * engine.h (_gpgme_engine_new): Likewise.
2150 * engine-gpgsm.c (gpgsm_new): Likewise.
2151 * rungpg.c (gpg_new): Likewise.
2152 * engine-backend.h (struct engine_ops): Likewise to NEW.
2153 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2156 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2158 * gpgme.h (gpgme_strerror_r): New prototype.
2159 * error.c (gpgme_strerror_r): New function.
2161 * get-env.c: New file.
2162 * util.h (_gpgme_getenv): Add prototype.
2163 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2164 * rungpg.c (build_argv): Use _gpgme_getenv.
2165 * debug.c (debug_init): Likewise.
2166 * engine-gpgsm.c (gpgsm_new): Likewise.
2167 (gpgsm_new): Use ttyname_r.
2168 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2170 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2172 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2175 * gpgme-config.in: Rewritten.
2176 * gpgme.m4: Rewritten.
2178 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2180 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2181 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2182 updated to have better thread support, and the Makefile.am was
2183 changed to reflect that.
2185 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2186 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2187 value of status_fnc.
2188 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2190 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2192 * rungpg.c (start): Use saved_errno instead errno.
2194 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2196 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2197 * fopencookie.c: File removed.
2199 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2201 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2203 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2205 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2206 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2207 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2208 backward compatibility.
2210 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2212 * verify.c (parse_new_sig): Fix status parsing case.
2214 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2216 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2217 Lower _UNUSED to 23 bits.
2218 (struct _gpgme_key): Likewise.
2219 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2220 (set_subkey_capability): Support 'a'.
2222 * keylist.c (gpgme_get_key): Check if there is more than one key
2223 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2225 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2227 (_gpgme_decode_percent_string): Likewise.
2228 * conversion.c (_gpgme_decode_c_string): Likewise.
2229 (_gpgme_decode_percent_string): Likewise.
2230 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2231 * signers.c (gpgme_signers_clear): Likewise.
2232 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2233 Use SEQNO instead SEQ.
2234 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2235 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2237 (gpgme_wait): Change type of I and IDX to unsigned int.
2238 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2239 and I to unsigned int.
2240 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2241 int to suppress gcc warning.
2242 (_gpgme_io_set_close_notify): Likewise.
2243 (_gpgme_io_select): Change type of I to unsigned int.
2244 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2246 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2249 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2251 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2252 and wrong expression.
2253 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2254 * encrypt.c (encrypt_sym_status_handler): Likewise.
2255 * sign.c (sign_status_handler): Likewise.
2256 * verify.c (verify_status_handler): Likewise.
2257 * decrypt.c (decrypt_status_handler): Likewise.
2259 * engine.c (gpgme_get_engine_info): Initialize NULL.
2261 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2263 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2264 GPG_ERROR_LIBS when setting the corresponding variables.
2265 Reported by Stéphane Corthésy.
2267 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2269 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2270 the beginning of the block.
2272 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2274 * data-mem.c (mem_write): Copy original buffer content.
2276 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2278 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2281 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2283 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2284 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2287 * op-support.c (_gpgme_parse_inv_userid): Rename to
2288 _gpgme_parse_inv_recp and change to new datatype.
2289 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2290 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2291 __gpgme_invalid_key. Rename field ID to KEY.
2292 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2293 (struct _gpgme_op_encrypt_result): Here, too.
2294 (struct _gpgme_op_sign_result): Likewise.
2295 * encrypt.c (struct op_data): Likewise.
2296 (release_op_data): Likewise.
2297 * sign.c (struct op_data): Likewise.
2298 (release_op_data): Likewise.
2300 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2301 (_gpgme_io_write): Likewise.
2302 (_gpgme_io_pipe): Likewise.
2303 (_gpgme_io_select): Likewise.
2305 * rungpg.c (struct engine_gpg): Remove arg_error.
2306 (add_arg): Don't set arg_error.
2307 (add_data): Likewise.
2308 (start): Don't check arg_error.
2309 (gpg_new): Check return value of add_arg.
2310 * verify.c (parse_notation): Free allocated memory at error.
2312 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2314 Everywhere: Use libgpg-error error codes.
2316 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2317 (BUILT_SOURCES): Remove errors.c.
2318 (MOSTLYCLEANFILES): Likewise.
2319 (libgpgme_la_SOURCES): Likewise. Add error.c.
2320 (errors.c): Remove target.
2321 * mkerrors: File removed.
2322 * error.c: New file.
2324 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2325 (gpgme_err_code_t, gpgme_err_source_t): New types.
2326 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2327 New static inline functions.
2328 (gpgme_strsource, gpgme_err_code_from_errno,
2329 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2330 gpgme_error_from_errno): New prototypes.
2332 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2334 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2335 (gpgme_op_export): Likewise.
2336 (gpgme_op_export_ext_start): New prototype.
2337 (gpgme_op_export_ext): Likewise.
2338 * engine.h: Likewise for _gpgme_engine_op_export and
2339 _gpgme_engine_op_export_ext.
2340 * engine-backend.h (struct engine_ops): Change second argument of
2341 prototype of export to const char *, and add reserverd int as
2342 third argument. Add prototype for export_ext.
2343 * engine.c (_gpgme_engine_op_export_ext): New function.
2344 (_gpgme_engine_op_export): Change second argument of prototype of
2345 export to const char *, and add reserverd int as third argument.
2346 * rungpg.c (gpg_export): Change second argument of prototype of
2347 export to const char *, and add reserverd int as third argument.
2348 (gpg_export_ext): New function.
2349 (gpg_keylist_ext): Break loop at error.
2350 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2351 * engine-gpgsm.c (gpgsm_export): Change second argument of
2352 prototype of export to const char *, and add reserverd int as
2354 (gpgsm_export_ext): New function.
2355 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2356 * export.c (export_start): Change second argument of prototype of
2357 export to const char *, and add reserverd int as third argument.
2358 (gpgme_op_export_start): Likewise.
2359 (export_ext_start): New function.
2360 (gpgme_op_export_ext_start): Likewise.
2361 (gpgme_op_export_ext): Likewise.
2363 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2364 (gpgme_sigsum_t): New type for anonymous enum.
2366 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2367 and return an error if RECP is not set.
2369 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2370 * user-id.c: Remove file.
2371 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2372 * gpgme.h (gpgme_encrypt_flags_t): New type.
2373 (gpgme_op_encrypt_start): Change second parameter to type
2374 gpgme_key_t[], and add third parameter.
2375 (gpgme_op_encrypt): Likewise.
2376 (gpgme_op_encrypt_sign_start): Likewise.
2377 (gpgme_op_encrypt_sign): Likewise.
2378 * encrypt.c (encrypt_start): Likewise.
2379 (gpgme_op_encrypt_start): Likewise.
2380 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2381 * encrypt-sign.c (encrypt_sign_start): Likewise.
2382 (gpgme_op_encrypt_sign_start): Likewise.
2383 (gpgme_op_encrypt_sign): Likewise.
2384 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2385 encrypt and encrypt_sign.
2386 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2387 and _gpgme_engine_op_encrypt_sign.
2388 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2389 (_gpgme_engine_op_encrypt_sign): Likewise.
2390 * rungpg.c (gpg_encrypt): Likewise.
2391 (gpg_encrypt_sign): Likewise.
2392 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2393 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2394 (set_recipients): Rewritten to use keys instead user IDs.
2395 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2397 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2398 returned to GPGME_Invalid_Key and GPGME_General_Error.
2400 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2402 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2403 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2404 * rungpg.c: Rename GpgObject to engine_gpg_t.
2405 (struct gpg_object_s): Rename to struct engine_gpg.
2407 * context.h (struct gpgme_context): Change EngineObject to
2409 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2410 (ctx_op_data_t): New type.
2411 (struct gpgme_context): Use it.
2412 * ops.h (_gpgme_op_data_lookup): Use new type name.
2413 * op-support.c (_gpgme_op_data_lookup): Likewise.
2414 * engine.c: Rename EngineObject to engine_t in the file. Also
2415 EngineStatusHandler to engine_status_handler_t,
2416 EngineCommandHandler to engine_command_handler_t and
2417 EngineColonLineHandler to engine_colon_line_handler.
2418 * rungpg.c (start): Likewise.
2419 * engine-gpgsm.c: Likewise.
2420 * engine-backend.h (struct engine_ops): Likewise
2421 * engine.h (struct engine_object_s): Rename to struct engine.
2422 (EngineObject): Rename to engine_t. Also everywhere else in the
2424 (EngineStatusHandler): Rename to engine_status_handler_t.
2425 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2426 (EngineCommandHandler): Rename to engine_command_handler_t.
2428 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2430 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2432 * gpgme.h (gpgme_recipients_t): Removed.
2433 (gpgme_recipients_new, gpgme_recipients_release,
2434 gpgme_recipients_add_name,
2435 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2436 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2437 gpgme_recipients_enum_close): Removed.
2438 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2439 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2440 gpgme_op_export): Change second argument to gpgme_user_id_t.
2441 (gpgme_user_ids_release): New prototype.
2442 (gpgme_user_ids_append): Likewise.
2443 * ops.h (_gpgme_recipients_all_valid): Remove.
2444 (_gpgme_user_ids_all_valid): Add.
2445 * context.h (struct gpgme_recipients): Removed.
2446 * user-id.c: New file.
2447 * recipient.c: Removed file.
2448 * rungpg.c (append_args_from_recipients): Change last arg to
2449 gpgme_user_id_t. Reimplement.
2450 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2451 (gpg_encrypt_sign): Likewise.
2452 (gpg_export): Likewise. Rewrite user ID list code.
2453 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2455 (_gpgme_engine_op_encrypt_sign): Likewise.
2456 (_gpgme_engine_op_export): Likewise.
2457 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2458 _gpgme_engine_op_export): Likewise.
2459 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2460 (gpgsm_encrypt): Likewise.
2461 (gpgsm_export): Likewise.
2462 * engine-backend.h (struct engine_ops): Likewise for members
2463 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2464 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2466 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2468 (gpgme_op_encrypt_start): Likewise.
2469 (gpgme_op_encrypt): Likewise.
2470 * encrypt-sign.c (encrypt_sign_start): Likewise.
2471 (gpgme_op_encrypt_sign): Likewise.
2472 (gpgme_op_encrypt_sign_start): Likewise.
2474 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2476 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2477 * import.c (parse_import_res): Add skipped_new_keys parser.
2479 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2481 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2483 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2485 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2486 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2487 (_gpgme_encrypt_status_handler): Likewise.
2488 (_gpgme_op_encrypt_init_result): Likewise.
2489 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2490 (_gpgme_decrypt_status_handler): Likewise.
2491 (_gpgme_op_decrypt_init_result): Likewise.
2492 * verify.c (gpgme_op_verify_result): Likewise.
2493 (_gpgme_verify_status_handler): Likewise.
2494 (_gpgme_op_verify_init_result): Likewise.
2495 * edit.c (edit_status_handler): Likewise.
2496 (command_handler): Likewise.
2497 (edit_start): Likewise.
2498 * genkey.c (gpgme_op_genkey_result): Likewise.
2499 (genkey_status_handler): Likewise.
2500 (genkey_start): Likewise.
2501 * import.c (gpgme_op_import_result): Likewise.
2502 (import_status_handler): Likewise.
2503 (_gpgme_op_import_start): Likewise.
2504 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2505 (_gpgme_op_trustlist_event_cb): Likewise.
2506 (gpgme_op_trustlist_start): Likewise.
2507 * keylist.c (gpgme_op_keylist_result): Likewise.
2508 (keylist_colon_handler): Likewise.
2509 (keylist_status_handler): Likewise.
2510 (_gpgme_op_keylist_event_cb): Likewise.
2511 (gpgme_op_keylist_start): Likewise.
2512 (gpgme_op_keylist_ext_start): Likewise.
2513 (gpgme_op_keylist_next): Likewise.
2514 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2515 (_gpgme_passphrase_command_handler_internal): Likewise.
2516 * sign.c (gpgme_op_sign_result): Likewise.
2517 (_gpgme_sign_status_handler): Likewise.
2518 (_gpgme_op_sign_init_result): Likewise.
2520 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2521 access to pointer type.
2523 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2525 * engine.h (EngineCommandHandler): Change last argument to int fd.
2526 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2528 (gpgme_edit_cb_t): Change last argument to int fd.
2529 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2530 * passphrase.c: Include <assert.h>.
2531 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2532 (release_op_data): Check values before calling free.
2533 (_gpgme_passphrase_status_handler): Likewise.
2534 (_gpgme_passphrase_command_handler_internal): New function.
2535 (_gpgme_passphrase_command_handler): Rewritten.
2536 * edit.c (edit_status_handler): Pass -1 as fd argument.
2537 (command_handler): Update prototype. New variable processed. Use
2538 it to store return value of
2539 _gpgme_passphrase_command_handler_internal which is now used
2540 instead _gpgme_passphrase_command_handler. Use it also to check
2541 if we should call the user's edit function. Pass fd to user's
2543 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2545 (gpg_release): Check value before calling free. Do not release
2547 (command_cb): Function removed.
2548 (command_handler): New function. Thus we don't use a data object
2549 for command handler stuff anymore, but handle it directly. This
2550 allows proper error reporting (cancel of passphrase requests, for
2551 example). Also all callbacks work via direct writes to the file
2552 descriptor (so that passphrases are not kept in insecure memory).
2553 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2554 (read_status): Check cmd.keyword before calling free. Install
2555 command_handler as the I/O callback handler with GPG as private
2558 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2560 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2561 decrypt_verify_start.
2562 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2563 (gpgme_op_decrypt_verify): Likewise.
2564 * verify.c (verify_status_handler): New function that also calls
2565 progress status handler.
2566 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2567 Rename to (verify_start).
2568 (gpgme_op_verify_start): Call verify_start.
2569 (gpgme_op_verify): Likewise.
2570 * encrypt.c (encrypt_status_handler): New function.
2571 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2572 Make static. Rename to encrypt_sym_status_handler.
2573 (encrypt_start): Set status handler to encrypt_sym_status_handler
2574 or encrypt_status_handler.
2575 * sign.c (sign_status_handler): New function.
2576 (sign_start): Set status handler to sign_status_handler.
2577 * decrypt.c (decrypt_status_handler): New function that also calls
2578 progress status handler.
2579 (decrypt_start): Set status handler to decrypt_status_handler.
2580 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2581 * decrypt-verify.c (decrypt_verify_status_handler): Call
2582 _gpgme_progress_status_handler.
2584 * conversion.c (_gpgme_decode_c_string): Add missing break
2587 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2588 to buffer to allocate.
2590 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2592 * verify.c (parse_new_sig): Fix ERRSIG case.
2593 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2595 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2597 * gpgme.h: The following types are renamed. The old name is kept
2598 as a deprecated typedef.
2599 (GpgmeCtx): Rename to gpgme_ctx_t.
2600 (GpgmeData): Rename to gpgme_data_t.
2601 (GpgmeRecipients): Rename to gpgme_recipients_t.
2602 (GpgmeError): Rename to gpgme_error_t.
2603 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2604 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2605 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2606 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2607 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2608 (GpgmeAttr): Rename to gpgme_attr_t.
2609 (GpgmeValidity): Rename to gpgme_validity_t.
2610 (GpgmeProtocol): Rename to gpgme_protocol_t.
2611 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2612 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2613 (GpgmeSubkey): Rename to gpgme_subkey_t.
2614 (GpgmeKeySig): Rename to gpgme_keysig_t.
2615 (GpgmeUserID): Rename to gpgme_user_id_t.
2616 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2617 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2618 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2619 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2620 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2621 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2622 (GpgmeEventIO): Rename to gpgme_event_io_t.
2623 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2624 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2625 (gpgme_io_cbs_t): New type.
2626 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2627 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2628 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2629 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2630 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2631 (gpgme_data_cbs_t): New type.
2632 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2633 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2634 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2635 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2636 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2637 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2638 (GpgmeSignature): Rename to gpgme_signature_t.
2639 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2640 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2641 (GpgmeImportResult): Rename to gpgme_import_result_t.
2642 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2643 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2644 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2645 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2646 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2647 GPGME_No_Passphrase.
2648 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2649 * context.h (struct gpgme_context_s): Rename to struct
2651 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2653 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2655 * keylist.c (finish_key): Clear OPD->tmp_uid.
2657 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2659 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2660 for NODATA status without signatures.
2662 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2664 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2665 (_gpgme_key_add_sig): Likewise.
2667 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2669 * context.h (struct gpgme_context_s): Remove member op_info.
2671 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2673 * gpgme.h (GpgmeError): Add deprecated values for
2674 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2676 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2678 * gpgme.h (gpgme_get_op_info): Remove prototype.
2679 * ops.h (_gpgme_set_op_info,
2680 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2681 _gpgme_data_append, _gpgme_data_append_string,
2682 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2683 _gpgme_data_append_percentstring_for_xml): Likewise.
2684 (_gpgme_progress_status_handler): Change first arg to void *.
2685 * progress.c (_gpgme_progress_status_handler): Likewise.
2686 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2687 and <sys/types.h>, but <string.h>.
2688 (_gpgme_data_append): Remove function.
2689 (_gpgme_data_append_string): Likewise.
2690 (_gpgme_data_append_for_xml): Likewise.
2691 (_gpgme_data_append_string_for_xml): Likewise.
2692 (_gpgme_data_append_percentstring_for_xml): Likewise.
2693 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2694 (_gpgme_data_release_and_return_string): Likewise.
2695 * gpgme.c (gpgme_get_op_info): Likewise.
2696 (_gpgme_set_op_info): Likewise.
2698 * gpgme.h (struct _gpgme_key): New structure.
2699 (GpgmeKey): Define using _gpgme_key.
2700 (struct _gpgme_subkey): New structure.
2701 (GpgmeSubKey): New type.
2702 (struct _gpgme_key_sig): New structure.
2703 (GpgmeKeySig): New type.
2704 (struct _gpgme_user_id): New structure.
2705 (GpgmeUserID): New type.
2706 (struct _gpgme_op_keylist_result): New structure.
2707 (GpgmeKeyListResult): New type.
2708 (gpgme_op_keylist_result): New function.
2709 (gpgme_key_get_as_xml): Remove prototype.
2710 * context.h (struct gpgme_context_s): Remove members tmp_key,
2711 tmp_uid, key_cond and key_queue.
2712 (struct key_queue_item_s): Remove structure.
2713 (struct user_id_s): Remove structure.
2714 (struct gpgme_recipients_s): Replace with simple
2716 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2717 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2718 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2719 * rungpg.c (command_cb): Return GpgmeError instead int.
2720 New variable ERR. Use it to hold return value of cmd handler.
2721 (gpg_delete): Access fingerprint of key directly.
2722 (append_args_from_signers): Likewise.
2723 (gpg_edit): Likewise.
2724 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2725 * engine-gpgsm.c: Do not include "key.h".
2726 (gpgsm_delete): Access fingerprint of key directly.
2727 (gpgsm_sign): Likewise.
2728 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2730 * key.h: File removed.
2731 * key.c: Completely reworked to use exposed GpgmeKey data types.
2732 * keylist.c: Likewise.
2733 * recipient.c: Completely reworked to use GpgmeUserID.
2735 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2737 * gpgme.h (gpgme_get_key): Remove force_update argument.
2738 * key-cache.c: File removed.
2739 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2740 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2742 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2743 _gpgme_key_cache_add.
2744 (gpgme_get_key): New function.
2745 * verify.c (gpgme_get_sig_key): Remove last argument to
2746 gpgme_get_key invocation.
2748 * gpgme.h (struct _gpgme_trust_item): New structure.
2749 (GpgmeTrustItem): New type.
2750 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2751 * context.h (struct trust_queue_item_s): Remove structure.
2752 (struct gpgme_context_s): Remove trust_queue member.
2753 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2754 * trust-item.c: New file.
2755 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2757 (struct trust_queue_item_s): Change to new type op_data_t.
2758 (trust_status_handler): Change first argument to void *.
2759 (trust_colon_handler): Likewise.
2760 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2761 (gpgme_op_trustlist_start): Use op_data_t and rework error
2763 (gpgme_op_trustlist_next): Use op_data_t.
2764 (gpgme_trust_item_release): Remove function.
2765 (gpgme_trust_item_get_string_attr): Likewise.
2766 (gpgme_trust_item_get_int_attr): Likewise.
2768 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2771 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2773 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2774 (struct gpgme_context_s): Remove member notation.
2775 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2777 * gpgme.h (struct _gpgme_sig_notation): New structure.
2778 (GpgmeSigNotation): New type.
2779 (struct _gpgme_signature): New structure.
2780 (GpgmeSignature): New type.
2781 (struct _gpgme_op_verify_result): New structure.
2782 (GpgmeVerifyResult): New type.
2783 (gpgme_op_verify_result): New prototype.
2784 (gpgme_get_notation): Remove prototype.
2785 * ops.h (_gpgme_op_verify_init_result): New prototype.
2786 (_gpgme_verify_status_handler): Change first argument to void *.
2787 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2789 * conversion.c (_gpgme_decode_percent_string): New function.
2790 (gnupg_errors): New static global.
2791 (_gpgme_map_gnupg_error): New function.
2792 * gpgme.c (gpgme_release): Don't release CTX->notation.
2793 (gpgme_get_notation): Remove function.
2794 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2795 _gpgme_op_verify_init_result.
2796 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2797 do include "gpgme.h".
2798 (struct verify_result): Replace with ...
2799 (op_data_t): ... this type.
2800 (release_verify_result): Remove function.
2801 (release_op_data): New function.
2802 (is_token): Remove function.
2803 (skip_token): Remove function.
2804 (copy_token): Remove function.
2805 (gpgme_op_verify_result): New function.
2806 (calc_sig_summary): Rewritten.
2807 (finish_sig): Remove function.
2808 (parse_new_sig): New function.
2809 (parse_valid_sig): New function.
2810 (parse_notation): New function.
2811 (parse_trust): New function.
2812 (parse_error): New function.
2813 (_gpgme_verify_status_handler): Rewritten. Change first argument
2815 (_gpgme_op_verify_start): Rework error handling. Call
2816 _gpgme_op_verify_init_result.
2817 (gpgme_op_verify): Do not release or clear CTX->notation.
2818 (gpgme_get_sig_status): Rewritten.
2819 (gpgme_get_sig_string_attr): Likewise.
2820 (gpgme_get_sig_ulong_attr): Likewise.
2821 (gpgme_get_sig_key): Likewise.
2823 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2824 (GpgmeDecryptResult): New type.
2825 (gpgme_op_decrypt_result): New prototype.
2826 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2827 (_gpgme_decrypt_status_handler): Fix prototype.
2828 (_gpgme_decrypt_start): Remove prototype.
2829 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2830 <string.h> and <assert.h>, "util.h" and "context.h", but
2832 (decrypt_verify_status_handler): Change first argument to void *,
2833 and rework error handling.
2834 (_gpgme_op_decrypt_verify_start): New function.
2835 (gpgme_op_decrypt_verify_start): Rewrite using
2836 _gpgme_op_decrypt_verify_start.
2837 (gpgme_op_decrypt_verify): Likewise.
2838 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2839 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2840 (is_token): Remove function.
2841 (release_op_data): New function.
2842 (skip_token): Remove function.
2843 (gpgme_op_decrypt_result): New function.
2844 (_gpgme_decrypt_status_handler): Change first argument to void *.
2845 Rework error handling.
2846 (_gpgme_decrypt_start): Rename to ...
2847 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2848 (_gpgme_op_decrypt_init_result): New function.
2849 (gpgme_op_decrypt_start): Use decrypt_start.
2850 (gpgme_op_decrypt): Likewise.
2852 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2854 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2855 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2856 (_gpgme_op_encrypt_sign_start): Rename to ...
2857 (encrypt_sign_start): ... this.
2858 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2859 _gpgme_op_encrypt_sign_start.
2860 (gpgme_op_encrypt_sign): Likewise.
2862 * gpgme.h (GpgmeEncryptResult): New data type.
2863 (gpgme_op_encrypt_result): New prototype.
2864 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2865 (_gpgme_op_encrypt_status_handler): Fix prototype.
2866 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2867 _gpgme_op_encrypt_init_result.
2868 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2869 "wait.h". Include <errno.h> and "gpgme.h".
2870 (SKIP_TOKEN_OR_RETURN): Remove macro.
2871 (struct encrypt_result): Rename to ...
2872 (op_data_t): ... new data type. Rewrite for user result data.
2873 (append_xml_encinfo): Remove function.
2874 (release_op_data): New function.
2875 (gpgme_op_encrypt_result): New function.
2876 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2877 Rewrite result parsing.
2878 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2880 (_gpgme_op_encrypt_init_result): New function.
2881 (_gpgme_op_encrypt_start): Rename to ...
2882 (encrypt_start): ... this.
2883 (gpgme_op_encrypt_start): Use encrypt_start, not
2884 gpgme_op_encrypt_start.
2885 (gpgme_op_encrypt): Likewise.
2887 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2888 GpgmeNewSignature, GpgmeSignResult): New data types.
2889 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2890 gpgme_hash_algo_name): New prototypes.
2891 * gpgme.c (gpgme_pubkey_algo_name): New function.
2892 (gpgme_hash_algo_name): Likewise.
2893 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2895 (_gpgme_op_sign_status_handler): Fix prototype.
2896 * op-support.c: Include <errno.h> and <string.h>.
2897 (_gpgme_parse_inv_userid): New function.
2898 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2899 <assert.h> and "util.h".
2900 (SKIP_TOKEN_OR_RETURN): Remove macro.
2901 (struct sign_result): Change to op_data_t type and rework it.
2902 (release_sign_result): Rename to ...
2903 (release_op_data): ... this and rewrite it.
2904 (append_xml_info): Remove function.
2905 (gpgme_op_sign_result): New function.
2906 (parse_sig_created): New function.
2907 (_gpgme_sign_status_handler): Change first argument to void *.
2908 Rewrite the function to use the new result structure and functions.
2909 (_gpgme_op_sign_init_result): New function.
2910 (_gpgme_op_sign_start): Rename to ...
2911 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2912 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2913 (gpgme_op_sign): Likewise.
2914 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2915 _gpgme_op_sign_init_result.
2917 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2919 (enum delete_problem): Move into function delete_status_handler.
2920 (delete_status_handler): Change first argument to void *. Parse
2921 delete problem with strtol instead atoi. Return better error
2923 (_gpgme_op_delete_start): Rename to ...
2924 (delete_start): ... this. Rework error handling.
2925 (gpgme_op_delete_start): Use delete_start instead
2926 _gpgme_op_delete_start.
2927 (gpgme_op_delete): Likewise.
2928 * gpgme.h (GpgmeDataType): Removed.
2930 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2932 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2933 * import.c (parse_import_res): Parse unchanged field.
2935 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2936 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2937 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2938 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2939 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
2940 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
2941 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
2942 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
2943 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
2944 (struct _gpgme_import_status): New structure.
2945 (GpgmeImportStatus): New type.
2946 (struct _gpgme_op_import_result): New structure.
2947 (GpgmeImportResult): New type.
2948 (gpgme_op_import_result): New function.
2949 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
2950 (struct import_result): Change to type op_data_t.
2951 (release_import_result): Rename to ...
2952 (release_op_data): ... this.
2953 (append_xml_impinfo): Function removed.
2954 (gpgme_op_import_result): New function.
2955 (parse_import): New function.
2956 (parse_import_res): Likewise.
2957 (import_status_handler): Change first argument to void *. Rewrite
2958 to use new functions.
2959 (_gpgme_op_import_start): Rework error handling.
2961 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
2962 (edit_resut): Change to typedef for op_data_t.
2963 (edit_status_handler): Change first argument to void *.
2964 Rework error handling.
2965 (command_handler): Rework error handling.
2966 (_gpgme_op_edit_start): Rename to ...
2967 (edit_start): ... this. Rework error handling.
2968 (gpgme_op_edit_start): Rewrite using edit_start.
2969 (gpgme_op_edit): Likewise.
2971 * ops.h (_gpgme_passphrase_start): Remove prototype.
2972 * passphrase.c: Do not include <assert.h>, "util.h" or
2973 "debug.h", but "gpgme.h".
2974 (struct passphrase_result): Change to typedef for op_data_t.
2975 (release_passphrase_result): Rename to release_op_data.
2976 (_gpgme_passphrase_status_handler): Change first argument to void *.
2977 Use new op_data_t type.
2978 (_gpgme_passphrase_command_handler): Use new op_data_t type.
2979 (_gpgme_passphrase_start): Remove function.
2980 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
2981 not call _gpgme_passphrase_start, but install command handler.
2982 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2983 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2984 * sign.c (_gpgme_op_sign_start): Likewise.
2986 * context.h (struct gpgme_context_s): Remove member initialized,
2987 use_cms and help_data_1. Add member protocol. Make use_armor and
2988 use_textmode bit flags. Make keylist_mode, include_certs,
2989 signers_len and signers_size unsigned.
2990 * gpgme.c (gpgme_new): Initialize CTX->protocol.
2991 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
2992 (gpgme_get_protocol): Likewise.
2993 (gpgme_release): Do not release CTX->help_data_1.
2994 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
2996 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
2998 * data.c: Do not include <assert.h>, but "gpgme.h".
2999 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3000 it will go. Do not assert DH.
3001 (_gpgme_data_outbound_handler): Do not assert DH.
3003 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3005 (export_status_handler): Change type of first argument to void *.
3006 (_gpgme_op_export_start): Rename to ...
3007 (export_start): ... this. Rework error handling.
3008 (gpgme_op_export_start): Rewritten to use export_start instead
3009 _gpgme_op_export_start.
3010 (gpgme_op_export): Likewise.
3012 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3013 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3014 GPGME_No_Passphrase): New macros.
3016 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3018 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3020 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3021 (GpgmeGenKeyResult): New type.
3022 (gpgme_op_genkey): Drop last argument.
3023 (gpgme_op_genkey_result): New function.
3024 * genkey.c: Do not include "util.h", but "gpgme.h".
3025 (struct genkey_result): Replace with ...
3026 (op_data_t): ... this new type.
3027 (release_genkey_result): Replace with ...
3028 (release_op_data): ... this new function.
3029 (gpgme_op_genkey_result): New function.
3030 (genkey_status_handler): Rewritten using new op_data_t type.
3031 (get_key_parameter): New function.
3032 (_gpgme_op_genkey_start): Renamed to
3033 (genkey_start): ... this and rewritten.
3034 (gpgme_op_genkey_start): Use genkey_start instead
3035 _gpgme_op_genkey_start.
3036 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3038 * context.h (struct gpgme_context_s): Remove member verbosity.
3039 * gpgme.c (gpgme_new): Do not set member verbosity.
3040 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3041 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3042 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3043 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3044 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3045 (gpg_set_verbosity): Remove function.
3046 * decrypt.c (_gpgme_decrypt_start): Don't call
3047 _gpgme_engine_set_verbosity.
3048 * delete.c (_gpgme_op_delete_start): Likewise.
3049 * edit.c (_gpgme_op_edit_start): Likewise.
3050 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3051 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3052 * export.c (_gpgme_op_export_start): Likewise.
3053 * genkey.c (_gpgme_op_genkey_start): Likewise.
3054 * import.c (_gpgme_op_import_start): Likewise.
3055 * keylist.c (gpgme_op_keylist_start): Likewise.
3056 (gpgme_op_keylist_ext_start): Likewise.
3057 * sign.c (_gpgme_op_sign_start): Likewise.
3058 * verify.c (_gpgme_op_verify_start): Likewise.
3060 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3061 * key.c (key_cache_initialized, key_cache_size,
3062 key_cache_max_chain_length, ): Removed.
3063 (struct key_cache_item_s, key_cache_lock, key_cache,
3064 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3065 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3066 * key-cache.c: ... here. New file.
3067 * key.h (_gpgme_key_cache_init): Remove prototypes.
3068 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3070 * version.c: Do not include "key.h".
3071 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3073 * mkstatus: Strip trailing comma.
3074 * gpgme.h (GpgmeStatus): Pretty print.
3076 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3077 GPGME_Bad_Passphrase.
3078 * passphrase.c (_gpgme_passphrase_status_handler): Use
3079 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3081 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3082 GPGME_No_UserID and GPGME_Invalid_Recipient to
3083 GPGME_Invalid_UserID.
3084 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3085 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3086 GPGME_Invalid_Recipient.
3087 (_gpgme_op_encrypt_start): Likewise.
3089 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3090 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3091 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3092 * wait-global.c (gpgme_wait): Likewise.
3093 * verify.c (_gpgme_op_verify_start): Likewise.
3094 (gpgme_get_sig_status): Don't check pending flag.
3095 (gpgme_get_sig_string_attr): Likewise.
3096 (gpgme_get_sig_ulong_attr): Likewise.
3097 (gpgme_get_sig_key): Likewise.
3098 * op-support.c (_gpgme_op_reset): Likewise.
3099 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3100 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3101 (gpgme_op_trustlist_end): Likewise.
3102 * sign.c (_gpgme_op_sign_start): Likewise.
3103 * context.h (struct gpgme_context_s): Remove member PENDING.
3104 * decrypt.c (_gpgme_decrypt_start): Likewise.
3105 * delete.c (_gpgme_op_delete_start): Likewise.
3106 * edit.c (_gpgme_op_edit_start): Likewise.
3107 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3108 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3109 * export.c (_gpgme_op_export_start): Likewise.
3110 * genkey.c (_gpgme_op_genkey_start): Likewise.
3111 * import.c (_gpgme_op_import_start): Likewise.
3112 * key.c (gpgme_get_key): Likewise.
3113 * keylist.c (gpgme_op_keylist_start): Likewise.
3114 (gpgme_op_keylist_ext_start): Likewise.
3115 (gpgme_op_keylist_next): Likewise.
3116 (gpgme_op_keylist_end): Likewise.
3117 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3119 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3121 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3122 and add argument for returning the result string.
3123 (gpgme_cancel): Remove prototype.
3124 * gpgme.c (gpgme_cancel): Remove function.
3125 * context.h (struct gpgme_context_s): Remove member cancel.
3126 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3127 passphrase callback in the new way.
3129 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3131 * edit.c (_gpgme_edit_status_handler): Call the progress status
3134 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3136 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3137 I/O handlers left to ...
3138 (_gpgme_user_io_cb_handler): ... here.
3140 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3142 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3143 could not be allocated.
3144 (gpgme_trust_item_release): Only release name if it is allocated.
3145 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3147 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3149 * rungpg.c (read_status): If he status handler returns an error,
3151 (status_handler): If read_status fails, just return the error.
3153 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3155 * engine-gpgsm.c (start): Handle all errors, not only most of
3157 (xtoi_1, xtoi_2): Remove macro.
3158 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3160 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3162 * engine-gpgsm.c (map_assuan_error): Replace
3163 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3164 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3166 * util.h (DIMof): Remove macro.
3168 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3169 _gpgme_data_unread): Prototypes removed.
3171 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3173 * types.h: File removed.
3174 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3175 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3177 * context.h: Likewise.
3178 * cengine-gpgsm.h: Likewise.
3179 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3180 for EngineStatusHandler, EngineColonLineHandler and
3181 EngineCommandHandler.
3182 (_gpgme_engine_set_status_handler): Change parameter type from
3183 GpgmeStatusHandler to EngineStatusHandler.
3184 (_gpgme_engine_set_command_handler): Change parameter type from
3185 GpgmeCommandHandler to EngineCommandHandler.
3186 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3187 GpgmeColonLineHandler to EngineColonLineHandler.
3188 * engine-backend.h: Include "engine.h" instead "types.h".
3189 (struct engine_ops): Change Gpgme*Handler parameters in members
3190 set_command_handler, set_colon_line_handler and set_status_handler
3192 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3193 type from GpgmeStatusHandler to EngineStatusHandler.
3194 (_gpgme_engine_set_command_handler): Change parameter type from
3195 GpgmeCommandHandler to EngineCommandHandler.
3196 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3197 GpgmeColonLineHandler to EngineColonLineHandler.
3198 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3199 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3200 member colon.fnc from GpgmeColonLineHandler to
3201 EngineColonLineHandler. Change type of member cmd.fnc from
3202 GpgmeCommandHandler to EngineCommandHandler.
3203 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3204 * rungpg.c (gpg_set_status_handler): Change parameter type from
3205 GpgmeStatusHandler to EngineStatusHandler.
3206 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3207 (assuan_simple_command): Likewise.
3208 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3209 from GpgmeColonLineHandler to EngineColonLineHandler.
3210 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3211 * rungpg.c (gpg_set_command_handler): Change parameter type from
3212 GpgmeCommandHandler to EngineCommandHandler.
3214 * engine-gpgsm.c (status_handler): Do not close status fd at end
3217 * ops.h (_gpgme_op_data_lookup): Add prototype.
3218 * op-support.c: Include <stdlib.h>.
3219 (_gpgme_op_data_lookup): New function.
3220 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3221 (struct decrypt_result_s): Rename to ...
3222 (struct decrypt_resul): ... this.
3223 (DecryptResult): New type.
3224 (_gpgme_decrypt_status_handler): Don't use
3225 test_and_allocate_result, but use _gpgme_op_data_lookup to
3226 retrieve result data object.
3227 * sign.c (_gpgme_release_sign_result): Function removed.
3228 (release_sign_result): New function.
3229 (struct sign_result_s): Rename to ...
3230 (struct sign_result): ... this.
3231 (SignResult): New type.
3232 (_gpgme_sign_status_handler): Don't use
3233 test_and_allocate_result, but use _gpgme_op_data_lookup to
3234 retrieve result data object.
3235 * encrypt.c (struct encrypt_result_s): Rename to ...
3236 (struct encrypt_result): ... this.
3237 (_gpgme_release_encrypt_result): Function removed.
3238 (release_encrypt_result): New function.
3239 (_gpgme_encrypt_status_handler): Don't use
3240 test_and_allocate_result, but use _gpgme_op_data_lookup to
3241 retrieve result data object.
3242 * verify.c (struct verify_result_s): Rename to ...
3243 (struct verify_result): ... this. Remove member next.
3244 (VerifyResult): New type.
3245 (_gpgme_release_verify_result): Function removed.
3246 (release_verify_result): New function.
3247 (finish_sig): Change first argument to type VerifyResult. Diddle
3248 the type of the op_data structure.
3249 (add_notation): Change first argument to type VerifyResult.
3250 (_gpgme_verify_status_handler): Don't use
3251 test_and_allocate_result, but use _gpgme_op_data_lookup to
3252 retrieve result data object.
3253 * passphrase.c (struct passphrase_result_s): Rename to ...
3254 (struct passphrase_result): ... this. Remove member next.
3255 (PassphraseResult): New type.
3256 (_gpgme_release_passphrase_result): Function removed.
3257 (release_passphrase_result): New function.
3258 (_gpgme_passphrase_status_handler): Don't use
3259 test_and_allocate_result, but use _gpgme_op_data_lookup to
3260 retrieve result data object.
3261 (_gpgme_passphrase_command_handler): Likewise.
3262 * keylist.c (struct keylist_result_s): Rename to ...
3263 (struct keylist_result): ... this. Remove member next.
3264 (KeylistResult): New type.
3265 (_gpgme_release_keylist_result): Function removed.
3266 (release_keylist_result): New function.
3267 (keylist_status_handler): Don't use
3268 test_and_allocate_result, but use _gpgme_op_data_lookup to
3269 retrieve result data object.
3270 * edit.c (struct edit_result_s): Rename to ...
3271 (struct edit_result): ... this. Remove member next.
3272 (EditResult): New type.
3273 (_gpgme_release_edit_result): Function removed.
3274 (release_edit_result): New function.
3275 (edit_status_handler): Don't use
3276 test_and_allocate_result, but use _gpgme_op_data_lookup to
3277 retrieve result data object.
3278 (command_handler): Likewise.
3279 * types.h (DecryptResult, SignResult, EncryptResult,
3280 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3281 KeylistResult, EditResult): Types removed.
3282 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3283 (test_and_allocate_result): Remove macro.
3284 (_gpgme_release_decrypt_result): Remove prototype.
3285 (_gpgme_decrypt_result): Remove prototype.
3286 (_gpgme_release_sign_result): Remove prototype.
3287 (_gpgme_release_encrypt_result): Remove prototype.
3288 (_gpgme_release_passphrase_result): Remove prototype.
3289 (_gpgme_release_import_result): Remove prototype.
3290 (_gpgme_release_delete_result): Remove prototype.
3291 (_gpgme_release_genkey_result): Remove prototype.
3292 (_gpgme_release_keylist_result): Remove prototype.
3293 (_gpgme_release_edit_result): Remove prototype.
3294 (_gpgme_release_verify_result): Remove prototype.
3295 * gpgme.c (_gpgme_release_result): Rewritten.
3296 * context.h (enum ctx_op_data_type): New enum.
3297 (struct ctx_op_data): New structure.
3298 (struct gpgme_context_s): Replace the member result with a member
3300 (fail_on_pending_request): Remove macro.
3301 * op-support.c (_gpgme_op_reset): Expand macro
3302 fail_on_pending_request.
3303 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3305 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3307 * types.h (EngineObject): Move typedef to ...
3308 * engine.h: ... here.
3309 * types.h (GpgObject): Move typedef to ...
3310 * rungpg.c: ... here.
3311 * types.h (GpgsmObject): Move typedef to ...
3312 * engine-gpgsm.c: ... here.
3314 * util.h (return_if_fail, return_null_if_fail,
3315 return_val_if_fail): Remove macro.
3316 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3317 * key.c (gpgme_key_ref): Likewise.
3318 * signers.c (gpgme_signers_enum): Likewise.
3319 (gpgme_signers_clear): Likewise.
3321 * engine-backend.h (struct engine_ops): Rename get_path to
3323 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3325 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3326 util.h. Other clean ups.
3327 (parse_version_number): Protect more seriously against
3329 (gpgme_get_engine_info): Move to ...
3330 * engine.c (gpgme_get_engine_info): ... here.
3331 (_gpgme_engine_get_info): Function removed.
3332 (_gpgme_engine_get_path): Make static and rename to ...
3333 (engine_get_file_name): .. this.
3334 (_gpgme_engine_get_version): Make static and rename to ...
3335 (engine_get_version): ... this.
3336 (_gpgme_engine_get_req_version): Make static and rename to ...
3337 (engine_get_req_version): ... this.
3338 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3339 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3342 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3343 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3344 (gpgme_get_protocol_name): New function.
3346 * engine-backend.h (struct engine_ops): New member
3347 get_req_version, remove member check_version.
3348 * engine.h (_gpgme_Engine_get_version): New prototype.
3349 * rungpg.c (gpg_get_req_version): New function.
3350 (gpg_check_version): Function removed.
3351 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3353 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3354 (gpgsm_check_version): Function removed.
3355 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3356 gpgsm_check_version.
3357 * engine.c: Include ops.h.
3358 (_gpgme_engine_get_req_version): New function.
3359 (gpgme_engine_check_version): Rewritten.
3360 * version.c (gpgme_get_engine_info): Rewritten.
3361 * gpgme.h (gpgme_engine_info): New structure.
3362 (GpgmeEngineInfo): New type.
3364 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3366 * types.h: Remove byte and ulong types.
3367 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3369 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3371 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3372 few more escaped characters. Be more strict about buffer size.
3373 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3374 BUF and DST to unsigned char instead byte.
3375 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3377 * debug.c (trim_spaces): Likewise.
3379 * util.h (mk_error): Remove macro.
3380 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3381 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3382 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3383 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3384 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3385 wait-private (literally everywhere): Expand the mk_error macro.
3387 * context.h (wait_on_request_or_fail): Remove macro.
3389 * context.h (gpgme_context_s): Remove member ERROR.
3390 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3391 (GpgmeCommandHandler): Change return type to GpgmeError and add
3392 new argument RESULT.
3393 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3394 (GpgmeEventIO): New event GPGME_EVENT_START.
3395 (GpgmeIdleFunc): Remove type.
3396 (gpgme_register_idle): Remove prototype.
3397 * data.c: Include <assert.h>.
3398 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3399 Return any error instead ignoring it, don't close file descriptor
3401 (_gpgme_data_outbound_handler): Likewise.
3402 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3403 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3404 Return error instead setting ctx->error. Return success at end of
3406 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3407 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3408 type to GpgmeError. Return possible errors.
3409 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3411 (delete_status_handler): Change return type to GpgmeError. Return
3412 error instead setting ctx->error. Return success at end of
3414 * edit.c: Do not include <stdio.h> and <string.h>.
3415 (_gpgme_edit_status_handler): Change type to GpgmeError,
3416 make static and rename to ...
3417 (edit_status_handler): ... this. Return error directly.
3418 (command_handler): Change return type to GpgmeError, add result
3419 argument. Return error directly.
3420 * encrypt.c (status_handler_finish): Remove function.
3421 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3422 Return error directly.
3423 (_gpgme_encrypt_sym_status_handler): Likewise.
3424 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3425 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3427 (status_handler): Change return type to GpgmeError. Diddle things
3428 around a bit to return errors directly.
3429 (start): Send start event.
3430 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3431 (export_status_handler): Change return type to GpgmeError. Don't
3433 * genkey.c: Do not include <stdio.h> and <assert.h>.
3434 (genkey_status_handler): Change return type to GpgmeError. Don't
3435 check ctx->error. Return errors directly.
3436 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3437 (_gpgme_op_event_cb): Function removed.
3438 (_gpgme_op_event_cb_user): Likewise.
3439 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3440 (import_status_handler): Change return type to GpgmeError. Don't
3442 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3443 Change return type to GpgmeError, return error directly.
3444 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3445 wait-private.c and wait-user.c
3446 * ops.h (test_and_allocate_result): Return error instead setting
3448 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3449 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3450 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3451 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3452 Change return type to GpgmeError.
3453 (_gpgme_passphease_command_handler): Change return type to
3454 GpgmeError and add new argument RESULT.
3455 * op-support.c: Use new callback functions, and change private
3456 data to ctx everywhere.
3457 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3458 type to GpgmeError, return error directly.
3459 (_gpgme_passphrase_command_handler): Change return type to
3460 GpgmeError, add result argument. Return results accordingly.
3461 * progress.c (_gpgme_progress_status_handler): Change return type
3462 to GpgmeError, return errors directly.
3463 * rungpg.c (status_handler): Change return type to GpgmeError.
3464 Return error directly.
3465 (close_notify_handler): Don't send done event.
3466 (colon_line_handler): Change return type to GpgmeError, return
3468 * rungpg.c (start): Send start event.
3469 * sign.c (_gpgme_sign_status_handler): Change return type to
3470 GpgmeError, return errors directly.
3471 * trustlist.c (trustlist_status_handler): Change return type to
3472 GpgmeError. Return 0.
3473 (trustlist_colon_handler): Change return type GpgmeError. Return
3475 * verify.c (add_notation): Change return type to GpgmeError,
3476 return errors directly.
3477 (_gpgme_verify_status_handler): Likewise.
3478 * wait.h (struct fd_table): Remove lock member.
3479 (struct wait_item_s): Moved here from wait.c.
3480 (struct tag): New structure.
3481 (_gpgme_wait_event_cb): Remove prototype.
3482 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3483 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3484 _gpgme_wait_user_event_io_cb): New prototypes.
3485 * wait.c: Don't include <stdio.h>.
3486 (ftd_global, ctx_done_list, ctx_done_list_size,
3487 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3489 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3491 (gpgme_wait): Move to file wait-global.c.
3492 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3493 member in wait item and tag.
3494 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3495 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3497 (gpgme_fd_table_init): Don't initialize FDT->lock.
3498 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3499 (_gpgme_fd_table_put): Make static and rename to ...
3500 (fd_table_put): ... this function. Don't use FDT->lock.
3501 (struct wait_item_s): Move to wait.h.
3502 * wait-global.c: New file.
3503 * wait-private.c: New file.
3504 * wait-user.c: New file.
3506 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3507 instead otrust_to_string to calculate validity.
3509 2003-01-19 Miguel Coca <mcoca@gnu.org>
3511 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3513 * w32-util.c: Include "sema.h".
3514 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3517 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3519 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3520 (gpg_start): Rename to ...
3521 (start): ... this function. Change arguments to GpgObject.
3522 (gpg_decrypt): Call start.
3523 (gpg_edit): Likewise.
3524 (gpg_encrypt): Likewise.
3525 (gpg_encrypt_sign): Likewise.
3526 (gpg_export): Likewise.
3527 (gpg_import): Likewise.
3528 (gpg_keylist): Likewise.
3529 (gpg_keylist_ext): Likewise.
3530 (gpg_trustlist): Likewise.
3531 (gpg_verify): Likewise.
3533 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3534 (gpgsm_start): Rename to ...
3535 (struct gpgsm_object_s): Remove member command.
3536 (gpgsm_release): Don't free command.
3537 (start): ... this function. Change arguments to GpgsmObject and
3539 (gpgsm_decrypt): Call start.
3540 (gpgsm_delete): Likewise.
3541 (gpgsm_encrypt): Likewise.
3542 (gpgsm_export): Likewise.
3543 (gpgsm_genkey): Likewise.
3544 (gpgsm_import): Likewise.
3545 (gpgsm_keylist): Likewise.
3546 (gpgsm_keylist_ext): Likewise.
3547 (gpgsm_verify): Likewise.
3549 * decrypt.c (_gpgme_decrypt_start): Don't call
3550 _gpgme_engine_start.
3551 * delete.c (_gpgme_op_delete_start): Likewise.
3552 * edit.c (_gpgme_op_edit_start): Likewise.
3553 * encrypt.c (_gpgme_op_encrypt_start):
3554 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3555 * export.c (_gpgme_op_export_start): Likewise.
3556 * genkey.c (_gpgme_op_genkey_start): Likewise.
3557 * import.c (_gpgme_op_import_start): Likewise.
3558 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3559 (gpgme_op_keylist_start): Likewise.
3560 * sign.c (_gpgme_op_sign_start): Likewise.
3561 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3562 * verify.c (_gpgme_op_verify_start): Likewise.
3564 * engine-backend.h (struct engine_ops): Remove member start.
3566 * engine.h (_gpgme_engine_start): Remove prototype.
3567 * engine.c (_gpgme_engine_start): Remove function.
3569 2003-01-06 Werner Koch <wk@gnupg.org>
3571 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3572 since gpg 1.3 to denote disabled keys.
3574 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3576 * data-mem.c: Include <string.h>.
3577 * engine.c: Likewise.
3579 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3581 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3583 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3585 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3587 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3589 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3590 (_gpgme_intersect_stati): Function removed.
3591 * ops.h (_gpgme_intersect_stati): Remove prototype.
3593 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3595 * libgpgme.vers: New file.
3596 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3597 (libgpgme_version_script_cmd): New variable.
3598 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3599 (libgpgme_la_DEPENDENCIES): New variable.
3601 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3603 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3604 (otrust_to_string): New function.
3605 (gpgme_key_get_as_xml): Use it.
3606 (validity_to_string): New function.
3607 (gpgme_key_get_string_attr): Beautify using above functions.
3608 (gpgme_key_get_ulong_attr): Likewise.
3610 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3612 * data-mem.c (mem_release): Fix gcc warning.
3613 * data-user.c (user_release): Likewise.
3615 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3617 * data.h (gpgme_data_release_cb): Change return type to void.
3618 (gpgme_data_read_cb): Change return type to ssize_t.
3619 * data.c (gpgme_data_read): Likewise.
3620 * data-stream.c (stream_read): Likewise.
3621 * data-fd.c (fd_read): Likewise.
3622 * data-mem.c (mem_read): Likewise.
3623 (mem_release): Change return type to void.
3624 * data-user.c (user_read): Change return type to ssize_t.
3625 (user_release): Change return type to void.
3626 * data-compat.c (old_user_read): Change return type to ssize_t.
3627 * gpgme.h (GpgmeDataReadCb): Likewise.
3628 (gpgme_data_read): Likewise.
3629 (GpgmeDataSeekCb): Change return type to off_t.
3631 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3633 * gpgme.h: Add prototype for gpgme_get_key.
3634 * key.c (gpgme_get_key): New function.
3635 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3637 * gpgme.h: Add prototypes for new interfaces
3638 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3639 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3640 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3641 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3642 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3644 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3645 Use that to determine if allocation is desired or not.
3646 * util.h: Adjust prototype of _gpgme_decode_c_string.
3647 * keylist.c (keylist_colon_handler): Adjust caller of
3648 _gpgme_decode_c_string.
3650 * key.h (struct gpgme_key_s): New member last_uid.
3651 * key.c (_gpgme_key_append_name): Rewritten using
3652 _gpgme_decode_c_string and the last_uid pointer.
3653 (my_isdigit): Macro removed.
3654 (ALLOC_CHUNK): Likewise.
3655 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3657 * context.h (struct user_id_s): New member last_certsig.
3658 * key.h: Add prototype for _gpgme_key_add_certsig.
3659 * key.c (_gpgme_key_add_certsig): New function.
3660 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3661 (parse_user_id): Change first argument to SRC, add new arguments
3662 NAME, EMAIL and COMMENT. Change code to use these arguments
3663 instead going through UID. Move function before
3665 (parse_x509_user_id): Likewise.
3666 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3667 and parse_user_id invocation.
3668 (one_certsig_as_xml): New function.
3669 (one_uid_as_xml): Print signatures.
3670 * context.h (struct gpgme_context_s): New member TMP_UID.
3671 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3674 * key.c (get_certsig): New function.
3675 (gpgme_key_sig_get_string_attr): Likewise.
3676 (gpgme_key_sig_get_ulong_attr): Likewise.
3678 * keylist.c: Include <ctype.h>.
3679 (my_isdigit): Macro removed.
3680 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3681 (set_userid_flags): Likewise.
3682 (set_subkey_trust_info): Likewise.
3683 (set_ownertrust): Likewise.
3684 (finish_key): Move function up a bit and remove prototype.
3686 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3688 (gpg_keylist_ext): Implement signature listing mode.
3690 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3692 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3693 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3695 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3696 CloseHandle for parent fds.
3698 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3700 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3702 2002-11-22 Werner Koch <wk@gnupg.org>
3704 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3705 setlocale before doing another setlocale.
3707 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3709 * decrypt.c: Some beautyfication.
3711 * verify.c (_gpgme_verify_status_handler): Treat
3712 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3713 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3715 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3717 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3718 (struct genkey_result_s): Add new member FPR.
3719 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3720 (genkey_status_handler): Extract the fingerprint from the status
3722 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3724 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3726 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3728 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3729 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3730 <twoaday@freakmail.de>.
3731 (gpg_keylist_ext): Likewise.
3733 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3735 * import.c (append_xml_impinfo): Use
3736 _gpgme_data_append_string_for_xml rather than
3737 _gpgme_data_append_string for the field content.
3738 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3740 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3742 * rungpg.h, engine-gpgsm.h: File removed.
3743 * engine-backend.h: New file.
3744 * Makefile.am (gpgsm_components): New variable, set depending on
3745 automake conditional HAVE_GPGSM.
3746 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3747 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3748 (status-table.h): Depend on gpgme.h, not rungpg.h.
3749 * conversion.c: Include <stdlib.h>.
3750 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3751 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3752 functions and remove all function prototypes.
3753 (_gpgme_gpgsm_get_version): Make static and rename to ...
3754 (gpgsm_get_version): ... this.
3755 (_gpgme_gpgsm_check_version): Make static and rename to ...
3756 (gpgsm_check_version): ... this.
3757 (_gpgme_gpgsm_new): Make static. Change argument type from
3758 GpgsmObject * to void **. Call gpgsm_release instead
3759 _gpgme_gpgsm_release.
3760 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3761 (gpgsm_check_decrypt): ... this.
3762 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3763 (gpgsm_check_delete): ... this.
3764 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3765 (gpgsm_check_set_recipients): ... this.
3766 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3767 (gpgsm_encrypt): ... this.
3768 (_gpgme_gpgsm_op_export): Make static and rename to ...
3769 (gpgsm_export): ... this.
3770 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3771 (gpgsm_genkey): ... this.
3772 (_gpgme_gpgsm_op_import): Make static and rename to ...
3773 (gpgsm_import): ... this.
3774 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3775 (gpgsm_keylist): ... this.
3776 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3777 (gpgsm_keylist_ext): ... this.
3778 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3779 (gpgsm_sign): ... this.
3780 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3781 (gpgsm_trustlist): ... this.
3782 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3783 (gpgsm_verify): ... this.
3784 (gpgsm_status_handler): Rename to ...
3785 (status_handler): ... this.
3786 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3787 (gpgsm_set_status_handler): ... this.
3788 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3789 (gpgsm_set_colon_line_handler): ... this.
3790 (_gpgme_gpgsm_add_io_cb): Rename to ...
3791 (add_io_cb): ... this.
3792 (_gpgme_gpgsm_start): Make static and rename to ...
3793 (gpgsm_start): ... this.
3794 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3795 (gpgsm_set_io_cb): ... this.
3796 (_gpgme_gpgsm_io_event): Make static and rename to ...
3797 (gpgsm_io_event): ... this.
3798 (struct _gpgme_engine_ops_gpgsm): New variable.
3799 [!ENABLE_GPGSM]: Removed.
3800 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3801 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3802 <stdlib.h> and "engine-backend.h".
3803 (struct engine_object_s): Rewritten.
3804 (engine_ops): New variable.
3805 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3806 _gpgme_engine_check_version, _gpgme_engine_new,
3807 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3808 _gpgme_engine_set_status_handler,
3809 _gpgme_engine_set_command_handler,
3810 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3811 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3812 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3813 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3814 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3815 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3816 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3817 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3818 _gpgme_engine_io_event): Reimplement.
3819 * engine.h: Fix a few comments and a variable name in a prototype.
3820 * ops.h: Do not include "rungpg.h".
3821 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3823 * recipient.c: Likewise.
3824 * signers.c: Likewise.
3825 * version.c: Likewise.
3826 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3827 functions and remove prototypes.
3828 (_gpgme_gpg_get_version): Make static and rename to ...
3829 (gpg_get_version): ... this.
3830 (_gpgme_gpg_check_version): Make static and rename to ...
3831 (gpg_check_version): ... this.
3832 (_gpgme_gpg_new): Make static. Change argument type from
3833 GpgObject * to void **. Call gpg_release instead
3835 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3836 (gpg_check_decrypt): ... this.
3837 (_gpgme_gpg_op_delete): Make static and rename to ...
3838 (gpg_check_delete): ... this.
3839 (_gpgme_gpg_set_recipients): Make static and rename to ...
3840 (gpg_check_set_recipients): ... this.
3841 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3842 (gpg_encrypt): ... this.
3843 (_gpgme_gpg_op_export): Make static and rename to ...
3844 (gpg_export): ... this.
3845 (_gpgme_gpg_op_genkey): Make static and rename to ...
3846 (gpg_genkey): ... this.
3847 (_gpgme_gpg_op_import): Make static and rename to ...
3848 (gpg_import): ... this.
3849 (_gpgme_gpg_op_keylist): Make static and rename to ...
3850 (gpg_keylist): ... this.
3851 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3852 (gpg_keylist_ext): ... this.
3853 (_gpgme_gpg_op_sign): Make static and rename to ...
3854 (gpg_sign): ... this.
3855 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3856 (gpg_trustlist): ... this.
3857 (_gpgme_gpg_op_verify): Make static and rename to ...
3858 (gpg_verify): ... this.
3859 (gpg_status_handler): Rename to ...
3860 (status_handler): ... this.
3861 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3862 (gpg_set_status_handler): ... this.
3863 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3864 (gpg_set_colon_line_handler): ... this.
3865 (gpgme_gpg_add_io_cb): Rename to ...
3866 (add_io_cb): ... this.
3867 (_gpgme_gpg_start): Make static and rename to ...
3868 (gpg_start): ... this.
3869 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3870 (gpg_set_io_cb): ... this.
3871 (_gpgme_gpg_io_event): Make static and rename to ...
3872 (gpg_io_event): ... this.
3873 (struct _gpgme_engine_ops_gpg): New variable.
3875 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3877 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3880 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3882 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3883 data-compat.c: New file. Really check them in this time, completes
3886 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3888 * types.h (GpgmeStatusHandler): ... here.
3889 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3891 * types.h (GpgmeColonLineHandler): ... here.
3892 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3894 * types.h (GpgmeCommandHandler): ... here.
3895 * engine.h: Don't include "rungpg.h".
3896 (_gpgme_engine_set_status_handler): Change type of
3897 argument from GpgStatusHandler to GpgmeStatusHandler.
3898 (_gpgme_engine_set_colon_line_handler): Change type of
3899 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3900 (_gpgme_engine_set_command_handler): Change type of
3901 argument from GpgCommandHandler to GpgmeCommandHandler.
3902 * engine-gpgsm.h: Don't include "rungpg.h".
3903 (_gpgme_gpgsm_set_status_handler): Change type of
3904 argument from GpgStatusHandler to GpgmeStatusHandler.
3905 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3906 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3907 * engine-gpgsm.c: Do not include "rungpg.h".
3908 (struct gpgsm_object_s): Change type of
3909 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3910 GpgmeColonLineHandler.
3911 (gpgsm_assuan_simple_command): Change type of argument from
3912 GpgStatusHandler to GpgmeStatusHandler.
3913 (_gpgme_gpgsm_set_status_handler): Likewise.
3914 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3915 GpgColonLineHandler to GpgmeColonLineHandler.
3916 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3917 argument from GpgStatusHandler to GpgmeStatusHandler.
3918 (_gpgme_gpg_set_colon_line_handler): Change type of
3919 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3920 (_gpgme_gpg_set_command_handler): Change type of
3921 argument from GpgCommandHandler to GpgmeCommandHandler.
3922 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3923 GpgmeStatusHandler. Change type of colon.fnc to
3924 GpgmeColonLineHandler. Change type of cmd.fnc to
3925 GpgmeCommandLineHandler.
3926 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3928 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3929 to GpgmeColonLineHandler.
3930 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3931 GpgmeCommandHandler.
3932 * engine.c (_gpgme_engine_set_status_handler): Change type of
3933 argument FNC to GpgmeStatusHandler.
3934 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3935 to GpgmeColonLineHandler.
3936 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3937 GpgmeCommandHandler.
3939 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
3940 * rungpg.c (struct gpg_object_s): Remove PM.
3941 (pipemode_cb): Prototype removed.
3942 (add_pm_data): Function removed.
3943 (_gpgme_gpg_enable_pipemode): Likewise.
3944 (pipemode_copy): Likewise.
3945 (pipemode_cb): Likewise.
3946 (add_arg): Don't check for pipemode.
3947 (add_data): Likewise.
3948 (_gpgme_gpg_set_status_handler): Likewise.
3949 (_gpgme_gpg_set_colon_line_handler): Likewise.
3950 (_gpgme_gpg_set_command_handler): Likewise.
3951 (_gpgme_gpg_spawn): Likewise.
3952 (_gpgme_gpg_spawn): Don't set PM.active.
3953 (_gpgme_gpg_op_verify): Remove pipemode case.
3954 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
3956 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3957 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
3958 _gpgme_gpg_set_simple_line_handler): Prototype removed.
3959 (_gpgme_gpg_set_verbosity): New prototype.
3960 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
3961 (add_data): ... this.
3962 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
3963 (_gpgme_gpg_set_command_handler): Likewise.
3964 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3965 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3966 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3967 _gpgme_gpg_op_verify): Likewise.
3968 (_gpgme_gpg_add_pm_data): Rename to ...
3969 (add_pm_data): ... this.
3970 (_gpgme_gpg_op_verify): Call add_pm_data, not
3971 _gpgme_gpg_add_pm_data.
3972 (_gpgme_gpg_add_arg): Make static and rename to ...
3973 (add_arg): ... this.
3974 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
3975 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
3976 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
3977 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
3978 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3979 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
3980 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
3981 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
3983 (_gpgme_gpg_set_verbosity): New function.
3984 (struct gpg_object_s): Remove member simple from colon.
3985 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
3986 (_gpgme_gpg_set_simple_line_handler): Removed function.
3987 (read_colon_line): Don't check the GPG->colon.simple.
3988 * engine.c (_gpgme_engine_set_verbosity): Call
3989 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
3991 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3993 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
3994 _gpgme_strdup, _gpgme_free): Remove prototypes.
3995 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
3997 * util.c: File removed.
3998 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
3999 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4000 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4001 xtrycalloc, free instead of xfree.
4002 (_gpgme_data_append_percentstring_for_xml): Likewise.
4003 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4004 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4005 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4006 _gpgme_data_get_as_string): Likewise.
4007 * debug.c (debug_init): Likewise.
4008 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4009 * delete.c (_gpgme_release_delete_result): Likewise.
4010 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4012 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4013 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4014 _gpgme_engine_release): Likewise.
4015 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4016 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4017 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4018 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4019 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4020 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4021 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4022 * genkey.c (_gpgme_release_genkey_result): Likewise.
4023 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4024 * import.c (_gpgme_release_import_result): Likewise.
4025 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4026 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4027 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4028 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4029 * ops.h (test_and_allocate_result): Likewise.
4030 * passphrase.c (_gpgme_release_passphrase_result,
4031 _gpgme_passphrase_status_handler,
4032 _gpgme_passphrase_command_handler): Likewise.
4033 * progress.c (_gpgme_progress_status_handler): Likewise.
4034 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4035 gpgme_recipients_add_name_with_validity): Likewise.
4036 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4037 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4038 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4039 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4041 * sign.c (_gpgme_release_sign_result): Likewise.
4042 * signers.c (_gpgme_signers_add): Likewise.
4043 * trustlist.c (trust_item_new, trustlist_colon_handler,
4044 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4045 gpgme_trustitem_release): Likewise.
4046 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4047 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4049 * w32-io.c (create_reader, create_writer, destroy_reader,
4050 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4051 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4052 * w32-util.c (read_w32_registry_string): Likewise.
4053 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4054 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4055 * data-compat.c: Include <stdlib.h>.
4057 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4059 New data object component:
4061 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4062 GpgmeDataReleaseCb): New types.
4063 (struct GpgmeDataCbs): New structure.
4064 (gpgme_data_read): Changed prototype to match that of read() closely.
4065 (gpgme_data_write): Similar for write().
4066 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4067 gpgme_data_new_from_stream): New prototypes.
4068 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4070 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4071 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4072 * data.c: Reimplemented from scratch.
4073 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4074 data-user.c): New file.
4075 * context.h (struct gpgme_data_s): Removed.
4076 * conversion.c: Include <errno.h> and <sys/types.h>.
4077 (_gpgme_data_append): New function.
4078 * data.c (_gpgme_data_append_string): Move to ...
4079 * conversion.c (_gpgme_data_append_string): ... here.
4080 * data.c (_gpgme_data_append_for_xml): Move to ...
4081 * conversion.c (_gpgme_data_append_for_xml): ... here.
4082 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4083 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4084 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4085 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4087 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4089 * types.h (GpgmeDataMode): Type removed.
4091 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4092 * edit.c (_gpgme_op_edit_start): Likewise.
4093 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4094 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4095 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4096 * export.c (_gpgme_op_export_start): Likewise.
4097 * genkey.c (_gpgme_op_genkey_start): Likewise.
4098 * import.c (_gpgme_op_import_start): Likewise.
4099 * sign.c (_gpgme_op_sign_start): Likewise.
4100 * verify.c (_gpgme_op_verify_start): Likewise.
4102 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4103 no recipient if no data was returned.
4104 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4105 no recipient if no data was returned.
4106 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4107 no recipient if no data was returned.
4109 * engine.c (_gpgme_engine_op_verify): Add new argument to
4110 differentiate detached from normal signatures.
4111 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4112 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4113 mode of data argument.
4114 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4115 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4116 (gpgme_op_verify): Likewise for prototype.
4117 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4118 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4119 * verify.c (_gpgme_op_verify_start): Likewise.
4120 (gpgme_op_verify_start): Likewise.
4121 (gpgme_op_verify): Likewise.
4123 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4124 direction of data object.
4125 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4126 determine direction of data object.
4127 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4128 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4129 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4130 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4131 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4133 (build_argv): Use new member INBOUND to determine direction of
4134 file descriptor. Don't check the data type.
4135 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4137 * gpgme.c (gpgme_get_op_info): Don't call
4138 _gpgme_data_get_as_string if CTX->op_info is NULL.
4140 * version.c (gpgme_check_engine): Function removed.
4142 2002-09-30 Werner Koch <wk@gnupg.org>
4144 * keylist.c (keylist_colon_handler): Take care when printing a
4145 NULL with the DEBUG.
4147 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4148 (gpgsm_status_handler): Run the colon function to indicate EOF.
4149 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4151 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4153 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4154 multiplication with base. Reported by Stéphane Corthésy.
4156 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4157 operation type in invocation of _gpgme_op_reset.
4159 2002-09-20 Werner Koch <wk@gnupg.org>
4161 * ath.c: Include sys/time.h if sys/select.h is not available.
4163 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4165 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4166 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4168 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4170 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4171 into gpgme unconditionally.
4172 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4174 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4176 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4178 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4180 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4181 (_gpgme_debug_end): Likewise.
4182 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4184 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4186 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4188 * version.c (_gpgme_get_program_version): Likewise.
4189 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4191 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4193 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4196 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4198 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4199 _gpgme_op_edit so its prototype is known early on.
4201 * conversion.c: New file.
4202 * util.h: Add prototypes for _gpgme_decode_c_string and
4204 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4206 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4207 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4208 calls to _gpgme_hextobyte.
4209 (hash_key): Likewise.
4211 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4213 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4214 _gpgme_engine_release, as this will reset pending to zero in the
4215 event done callback on cancelled operations.
4217 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4219 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4220 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4222 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4223 * rungpg.h: Also to prototype.
4224 * engine.c (_gpgme_engine_op_edit): Likewise.
4225 * engine.h: Likewise.
4226 * edit.c (_gpgme_op_edit_start): Likewise.
4228 2002-08-29 Werner Koch <wk@gnupg.org>
4230 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4232 * vasprintf.c (va_copy): Define macro if not yet defined.
4234 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4236 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4237 CTX->result.passphrase->no_passphrase if passphrase is given (good
4238 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4240 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4242 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4243 Return 0 on success, -1 on error.
4244 * version.c (_gpgme_get_program_version): Don't wait for the child.
4245 * engine.c (_gpgme_engine_housecleaning): Function removed.
4246 (do_reaping): Likewise.
4247 (_gpgme_engine_add_child_to_reap_list): Likewise.
4248 (struct reap_s): Removed.
4249 (reap_list): Likewise.
4250 (reap_list_lock): Likewise.
4251 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4252 _gpgme_engine_housecleaning and
4253 _gpgme_engine_add_child_to_reap_list.
4254 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4255 (struct gpg_object_s): Remove PID member.
4256 (_gpgme_gpg_new): Don't initialize GPG->pid.
4257 (_gpgme_gpg_spawn): Don't set GPG->pid.
4258 * wait.c (run_idle): Removed.
4259 (gpgme_wait): Run idle_function directly.
4261 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4263 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4264 variables encrypt_info and encrypt_info_len.
4265 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4266 * posix-sema.c (sema_fatal): Remove function.
4267 All these reported by Stéphane Corthésy.
4269 2002-08-23 Werner Koch <wk@gnupg.org>
4271 * gpgme-config.in: Made --prefix work for --libs.
4273 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4275 * ath.h: Update list of symbols that get a prefix: Rename the
4276 ath_mutex_*_available symbols to ath_*_available.
4278 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4280 * stpcpy.c: New file from gnulib.
4281 * Makefile.am (assuan_libobjs): Remove jnlib.
4283 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4285 * gpgme.h: Add prototype for gpgme_op_import_ext.
4286 * import.c (struct import_result_s): New member `nr_considered'.
4287 Rename `any_imported' to `nr_imported'.
4288 (import_status_handler): Increment nr_imported. Set nr_considered
4290 (gpgme_op_import_ext): New function.
4291 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4293 2002-08-20 Werner Koch <wk@gnupg.org>
4295 * gpgme.m4: Replaced with a new and faster version. This does not
4296 anymore try to build test programs. If we really need test
4297 programs, we should add an option to gpgme-config to do so.
4299 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4301 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4303 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4304 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4307 2002-08-19 Werner Koch <wk@gnupg.org>
4309 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4310 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4311 (_gpgme_decrypt_status_handler): Create an operation info.
4313 2002-08-14 Werner Koch <wk@gnupg.org>
4315 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4316 * key.c (gpgme_key_release): Release it. We need to add more code
4318 (_gpgme_key_append_name): Use memset to intialize the struct.
4319 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4320 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4323 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4324 information about the key type (PGP or X.509).
4325 (gpgme_key_get_ulong_attr): Likewise.
4327 * keylist.c (keylist_colon_handler): Include 1 in the check for
4328 valid algorithms so that RSA is usable. Store the issuer name and
4329 serial number also for "crs" records. Parse the expire date for
4331 (set_userid_flags): Put them onto the last appended key.
4333 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4335 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4337 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4339 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4342 The following changes make it possible to flush an inbound data
4343 pipe before invoking a command handler:
4345 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4346 _gpgme_io_select. Set timeout of 0 if this is set.
4347 * w32-io.c (_gpgme_io_select): Likewise.
4348 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4349 * wait.c (do_select): Add new argument to _gpgme_io_select
4351 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4352 linked_data to prototype.
4353 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4354 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4355 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4356 argument to _gpgme_engine_set_command_handler.
4357 * rungpg.c (struct gpg_object_s): New members linked_data and
4359 (_gpgme_gpg_new): Initialize those new members.
4360 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4361 (build_argv): Handle linked_data in the same hack as cb_data.
4362 (read_status): If linked_data is in use, flush the pipe before
4363 activating the command handler.
4364 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4367 The next changes export the status codes to the user:
4369 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4370 all STATUS_ with GPGME_.
4371 * delete.c (delete_status_handler): Likewise.
4372 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4373 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4374 (_gpgme_encrypt_sym_status_handler): Likewise.
4375 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4376 * engine-gpgsm.c (parse_status): Likewise.
4377 (gpgsm_status_handler): Likewise.
4378 (gpgsm_set_recipients): Likewise.
4379 * export.c (export_status_handler): Likewise.
4380 * genkey.c (genkey_status_handler): Likewise.
4381 * import.c (append_xml_impinfo): Likewise.
4382 (import_status_handler): Likewise.
4383 * keylist.c (keylist_status_handler): Likewise.
4384 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4385 (command_handler): Likewise.
4386 * progress.c (_gpgme_progress_status_handler): Likewise.
4387 * sign.c (_gpgme_sign_status_handler): Likewise.
4388 * trustlist.c (trustlist_status_handler): Likewise.
4389 * verify.c (_gpgme_verify_status_handler): Likewise.
4390 * gpgme.h (GpgmeEditCb): New type.
4391 * rungpg.h (GpgStatusCode): Rename and move to ...
4392 * gpgme.h (GpgmeStatusCode): ... this and here.
4393 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4394 * mkstatus: Prefix STATUS with GPGME_.
4395 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4397 * ops.h (_gpgme_verify_status_handler,
4398 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4399 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4400 _gpgme_progress_status_handler): Likewise.
4401 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4403 These changes add an edit operation to GPGME:
4405 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4406 ops.h: Add prototype for _gpgme_release_edit_result and
4407 _gpgme_passphrase_command_handler.
4408 * passphrase.c (command_handler): Make non-static and rename to ...
4409 (_gpgme_passphrase_command_handler): ... this.
4410 (_gpgme_passphrase_start): Use new name for command handler.
4411 * types.h: Add EditResult type.
4412 * gpgme.c (_gpgme_release_result): Release EDIT result.
4414 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4415 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4417 (assuan_libobjs): New variable, set this instead
4419 * engine.h (_gpgme_engine_op_edit): New prototype.
4420 * engine.c (_gpgme_engine_op_edit): New function.
4421 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4422 * rungpg.c (_gpgme_gpg_op_edit): New function.
4424 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4426 * delete.c (delete_problem): New case ambigious specification.
4427 (delete_status_handler): Handle new case (poorly).
4429 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4431 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4433 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4435 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4437 * vasprintf.c: Update to more recent libiberty version.
4438 * debug.h: Replace #elsif with #elif.
4440 Submitted by Stéphane Corthésy:
4441 * util.h (vasprintf): Correct prototype.
4442 * encrypt-sign.c: Include <stddef.h>.
4443 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4445 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4446 * ath-pth.c: Likewise.
4448 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4450 * wait.c (fdt_global): Make static. Reported by Stéphane
4453 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4454 patterns. Reported by Stéphane Corthésy.
4456 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4457 by Stéphane Corthésy.
4458 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4459 silence gcc warning.
4461 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4463 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4465 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4467 * gpgme.c (_gpgme_op_event_cb_user): New function.
4468 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4469 for private or user event loop. Use new user event callback
4471 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4472 * keylist.c (gpgme_op_keylist_start): Likewise.
4474 * rungpg.c (_gpgme_gpg_io_event): New function.
4475 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4476 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4477 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4478 * engine.c (_gpgme_engine_io_event): New function.
4479 * engine.h (_gpgme_engine_io_event): New prototype.
4480 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4481 the real work for the default IO callback routines to ...
4482 (_gpgme_op_keylist_event_cb): ... here. New function.
4483 * trustlist.c (trustlist_colon_handler): Signal
4484 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4485 (_gpgme_op_trustlist_event_cb): ... here. New function.
4486 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4487 and _gpgme_op_trustlist_event_cb when appropriate.
4488 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4489 (_gpgme_op_trustlist_event_cb): Likewise.
4490 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4491 user provided event handler directly.
4492 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4494 * wait.c (_gpgme_add_io_cb): Likewise.
4495 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4496 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4497 argument. Fix up error handling.
4498 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4499 new argument, fix up error handling.
4501 2002-07-03 Werner Koch <wk@gnupg.org>
4503 * encrypt.c (status_handler_finish): New.
4504 (_gpgme_encrypt_status_handler): Moved some code out to the new
4505 function and call this function also in case we get into the
4506 status handler with an error which might happen due to a kludge in
4509 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4511 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4512 table (eg use synchronous mode).
4514 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4516 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4517 prototype and change return type to GpgmeError.
4518 (_gpgme_wait_one): New prototype.
4519 * wait.c (gpgme_wait): Replace with the meat from
4520 _gpgme_wait_on_condition here, and remove the support for
4522 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4523 and change return type to GpgmeError. Replace with meat from
4524 _gpgme_wait_one and add support for conditions.
4525 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4527 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4528 table (eg use synchronous mode).
4529 (gpgme_op_keylist_next): Remove HANG argument from
4530 _gpgme_wait_on_condition. Check its return value.
4531 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4532 table (eg use synchronous mode).
4533 (gpgme_op_trustlist_next): Remove HANG argument from
4534 _gpgme_wait_on_condition. Check its return value.
4536 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4538 * gpgme.h: Fix documentation of key attribute retrieval functions.
4540 2002-06-26 Werner Koch <wk@gnupg.org>
4542 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4544 * import.c (append_xml_impinfo): Kludge to print fingerprint
4545 instead of keyid for use with gpgsm.
4546 (import_status_handler): Set a flag to know whether any import
4548 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4550 2002-06-25 Werner Koch <wk@gnupg.org>
4552 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4555 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4557 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4559 * export.c (gpgme_op_export): If no data was returned, return
4560 GPGME_No_Recipients.
4562 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4564 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4566 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4568 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4569 (parse_status): New function.
4570 (gpgsm_status_handler): Use parse_status.
4571 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4572 STATUS_FNC_VALUE and process status messages.
4573 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4574 (gpgsm_set_fd): Likewise.
4575 (_gpgme_gpgsm_op_keylist): Likewise.
4576 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4577 (_gpgme_gpgsm_op_sign): Likewise.
4579 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4581 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4583 2002-06-20 Werner Koch <wk@gnupg.org>
4585 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4587 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4589 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4590 (gpgme_get_sig_string_attr): Hack to return info on the key
4591 usage. Does now make use of the former RESERVED argument which
4592 has been renamed to WHATIDX.
4593 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4595 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4597 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4598 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4599 error, or there are no more file descriptors to wait on.
4600 (_gpgme_wait_on_condition): Ignore return value from do_select for
4603 2002-06-13 Werner Koch <wk@gnupg.org>
4605 * verify.c (gpgme_op_verify): Make sure that we never access an
4606 unitialized result structure.
4608 2002-06-12 Werner Koch <wk@gnupg.org>
4610 * keylist.c (struct keylist_result_s): New.
4611 (_gpgme_release_keylist_result): Release it here
4612 (keylist_status_handler): Handle truncated.
4613 (append_xml_keylistinfo): New.
4614 * gpgme.c (_gpgme_release_result): and use it here.
4615 * types.h: Declare the new type here.
4616 * context.h (struct gpgme_context_s): Use it here.
4618 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4620 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4621 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4622 use our own close notification mechanism without interfering with
4625 2002-06-11 Werner Koch <wk@gnupg.org>
4627 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4629 * verify.c (calc_sig_summary): New.
4630 (gpgme_get_sig_ulong_attr): And use it here.
4632 2002-06-10 Werner Koch <wk@gnupg.org>
4634 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4635 * verify.c (is_token, copy_token): New.
4636 (_gpgme_verify_status_handler): Use copy_token, handle the new
4637 ERROR status and store the errorcode used withgpgsm and trust
4639 * gpgme.h: New attribute ERRTOK.
4640 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4641 (gpgme_get_sig_string_attr): Use it here to return the last error.
4643 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4645 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4646 close notification for the status fd to ...
4647 (_gpgme_gpgsm_new): ... here.
4648 * wait.h: Include "sema.h". Remove prototypes of
4649 _gpgme_remove_proc_from_wait_queue and
4650 _gpgme_register_pipe_handler. Add prototypes of
4651 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4652 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4654 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4655 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4656 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4657 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4658 proc_s. Replace struct wait_item_s.
4659 (_gpgme_fd_table_init): New function.
4660 (_gpgme_fd_table_deinit): Likewise.
4661 (_gpgme_fd_table_put): Likewise.
4662 (set_process_done): Remove function.
4663 (do_select): Take argument FDT. Use that to decide which fds to
4665 (_gpgme_remove_proc_from_wait_queue): Remove function.
4666 (_gpgme_wait_event_cb): New function.
4667 (_gpgme_wait_one): Likewise.
4668 (_gpgme_register_pipe_hanldler): Remove function.
4669 (_gpgme_add_io_cb): New function.
4670 (_gpgme_remove_io_cb): Likewise.
4671 (_gpgme_freeze_fd): Remove function.
4672 (_gpgme_thaw_fd): Remove function.
4673 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4674 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4675 IDX to CMD. Add new member IO_CBS.
4676 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4677 For each I/O callback, check if it should be unregistered. If all
4678 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4679 Remove member RUNNING.
4680 (_gpgme_gpg_new): Initialize new members.
4681 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4682 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4683 (build_argv): Store away the index instead the file descriptor for
4685 (_gpgme_gpg_add_io_cb): New function.
4686 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4688 (gpg_status_handler): Change return type to void, remove PID
4689 argument, close filedescriptor if EOF or error occurs.
4690 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4691 Use IO_CBS->remove instead _gpgme_freeze_fd.
4692 (gpg_colon_line_handler): Change return type to void, remove PID
4693 argument, close filedescriptor if EOF or error occurs.
4694 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4695 (_gpgme_gpg_set_io_cbs): New function.
4696 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4697 _gpgme_gpg_set_io_cbs.
4698 * gpgme.h (GpgmeIOCb): New type.
4699 (GpgmeRegisterIOCb): Likewise.
4700 (GpgmeRemoveIOCb): Likewise.
4701 (GpgmeEventIO): Likewise.
4702 (GpgmeEventIOCb): Likewise.
4703 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4704 (gpgme_set_op_io_cbs): New prototype.
4705 (gpgme_get_op_io_cbs): Likewise.
4706 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4707 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4708 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4709 prototype. Add prototype for _gpgme_op_reset.
4710 Add synchronous argument to _gpgme_decrypt_start prototype.
4711 * io.h: Beautification.
4712 * gpgme.c: Include "wait.h".
4713 (gpgme_new): Initialize FDT.
4714 (gpgme_set_io_cbs): New function.
4715 (gpgme_get_io_cbs): Likewise.
4716 (_gpgme_op_event_cb): Likewise.
4717 * data.c (_gpgme_data_inbound_handler): Change return type to
4718 void. Drop PID argument. Close FD on error and EOF.
4719 (write_mem_data): Don't close FD here ...
4720 (write_cb_data): ... or here ...
4721 (_gpgme_data_outbound_handler): ... but here. Change return type
4722 to void. Drop PID argument.
4723 * context.h: Include "wait.h".
4724 (struct gpgme_context_s): New members FDT and IO_CBS.
4725 * op-support.c: New file.
4726 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4727 * ops.h: Add prototype for _gpgme_op_reset().
4728 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4730 (gpgme_op_decrypt_start): Add synchronous argument.
4731 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4733 * delete.c (gpgme_op_delete_start): Rename to ...
4734 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4735 Use _gpgme_op_reset. Make function static.
4736 (gpgme_op_delete_start): Just a wrapper around
4737 _gpgme_op_delete_start now.
4738 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4740 * encrypt.c: Include "wait.h".
4741 (ggpgme_op_encrypt_start): Rename to ...
4742 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4743 Use _gpgme_op_reset. Make function static.
4744 (gpgme_op_encrypt_start): Just a wrapper around
4745 _gpgme_op_encrypt_start now.
4746 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4748 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4749 (_gpgme_op_encrypt_sign_start): ... this. New argument
4750 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4751 (gpgme_op_encrypt_sign_start): Just a wrapper around
4752 _gpgme_op_encrypt_sign_start now.
4753 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4754 _gpgme_wait_one instead gpgme_wait.
4755 * export.c (gpgme_op_export_start): Rename to ...
4756 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4757 Use _gpgme_op_reset. Make function static.
4758 (gpgme_op_export_start): Just a wrapper around
4759 _gpgme_op_export_start now.
4760 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4762 * genkey.c (gpgme_op_genkey_start): Rename to ...
4763 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4764 Use _gpgme_op_reset. Make function static.
4765 (gpgme_op_genkey_start): Just a wrapper around
4766 _gpgme_op_genkey_start now.
4767 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4769 * import.c (gpgme_op_import_start): Rename to ...
4770 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4771 Use _gpgme_op_reset. Make function static.
4772 (gpgme_op_import_start): Just a wrapper around
4773 _gpgme_op_import_start now.
4774 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4776 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4777 (gpgme_op_keylist_ext_start): Likewise.
4778 * sign.c (gpgme_op_sign_start): Rename to ...
4779 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4780 _gpgme_op_reset. Make function static.
4781 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4783 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4785 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4786 * verify.c (gpgme_op_verify_start): Rename to ...
4787 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4788 Use _gpgme_op_reset. Make function static.
4789 (gpgme_op_verify_start): Just a wrapper around
4790 _gpgme_op_verify_start now.
4791 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4793 * engine-gpgsm.c (iocb_data_t): New type.
4794 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4795 and input_data with input_cb. Replace output_fd and output_data
4796 with output_cb. Replace message_fd and message_data with
4797 message_cb. New member io_cbs.
4798 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4800 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4801 callback, check if it should be unregistered. If all callbacks
4802 have been unregistered, trigger GPGME_EVENT_DONE.
4803 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4804 names to close the file descriptors.
4805 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4806 (_gpgme_gpgsm_op_encrypt): Likewise.
4807 (_gpgme_gpgsm_op_genkey): Likewise.
4808 (_gpgme_gpgsm_op_import): Likewise.
4809 (_gpgme_gpgsm_op_keylist): Likewise.
4810 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4811 (_gpgme_gpgsm_op_sign): Likewise.
4812 (_gpgme_gpgsm_op_verify): Likewise.
4813 (gpgsm_status_handler): Drop argument PID. Change return type to
4814 void. Close status pipe before returning because of EOF or error.
4815 (_gpgme_gpgsm_add_io_cb): New function.
4816 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4818 (_gpgme_gpgsm_set_io_cbs): New function.
4819 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4820 * engine.c (_gpgme_engine_set_io_cbs): New function.
4821 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4823 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4825 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4827 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4829 * key.c: Include <ctype.h>.
4830 (_gpgme_key_append_name): Skip one more char when
4831 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4832 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4834 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4836 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4837 * posix-sema.c: Use that prefix here.
4838 * posix-io.c: Include "ath.h".
4839 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4840 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4841 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4842 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4844 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4846 * Makefile.am (ath_components): New variable.
4847 (ath_components_pthread): Likewise.
4848 (ath_components_pth): Likewise.
4849 (system_components): Add ath_componentes.
4853 * ath-pthread.c: Likewise.
4854 * ath-pth.c: Likewise.
4855 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4857 * mutex.h: Remove file.
4859 2002-05-30 Werner Koch <wk@gnupg.org>
4861 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4862 an issuer with IDX > 0. We don't support altIssuerNames for now.
4864 2002-05-22 Werner Koch <wk@gnupg.org>
4866 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4867 missing variable definition. Oohh - Marcus was faster.
4869 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4871 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4873 2002-05-21 Werner Koch <wk@gnupg.org>
4875 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4876 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4878 2002-05-10 Werner Koch <wk@gnupg.org>
4880 * key.h (gpgme_key_s): Add OTRUST.
4881 * keylist.c (set_ownertrust): New.
4882 (keylist_colon_handler): Get the ownertrust value
4883 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4886 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4888 * w32-util.c: New static variable GET_PATH_LOCK.
4889 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4890 Take lock while determining path.
4891 (_gpgme_get_gpgsm_path): Likewise.
4892 * version.c (do_subsystem_inits): Set DONE to 1 after
4894 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4895 while determining engine info.
4896 * rungpg.c (_gpgme_gpg_get_version): New variable
4897 GPG_VERSION_LOCK. Take the lock while determining the program
4899 * posix-io.c: Include "sema.h".
4900 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4901 while fixing the signals.
4902 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4903 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4905 (capabilities_to_string): Make STRINGS very const.
4906 (_gpgme_key_cache_add): Lock the key cache.
4907 (_gpgme_key_cache_get): Likewise.
4908 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4909 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4910 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4912 * engine.c (_gpgme_engine_get_info): New variable
4913 ENGINE_INFO_LOCK. Take lock while determining engine info.
4914 * engine-gpgsm.c: Include "sema.h".
4915 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4916 lock while getting program version.
4918 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4920 * debug.h: New file.
4921 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4922 * util.h: Removed all prototypes and declarations related to
4923 debugging. Include "debug.h".
4925 * debug.c (debug_level): Comment variable and remove superfluous
4928 (_gpgme_debug_enabled): Function removed.
4929 (struct debug_control_s): Definition removed.
4930 (_gpgme_debug_level): Function removed.
4931 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4932 pritnf-style format specification and a variable number of
4934 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4935 starts out with "%s" for simplicity.
4936 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4937 TEXT argument anymore.
4939 * posix-io.c (_gpgme_io_select): Use new level argument for
4940 DEBUG_BEGIN instead explicit if construct.
4942 * debug.c (debug_init): Remove superfluous zero initializer,
4943 remove volatile flag of INITIALIZED. Do not use the
4944 double-checked locking algorithm, it is fundamentally flawed and
4945 will empty your fridge (on a more serious note, despite the
4946 volatile flag it doesn't give you the guarantee you would expect,
4947 for example on a DEC Alpha or an SMP machine. The volatile only
4948 serializes accesses to the volatile variable, but not to the other
4951 2002-05-03 Werner Koch <wk@gnupg.org>
4953 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
4954 output to /dev/null.
4956 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
4957 * gpgme.c (gpgme_get_protocol): New.
4959 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
4960 (gpgme_data_read): Ditto.
4962 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
4963 lines so that a claim can be made without looking up the key.
4964 (gpgme_get_sig_string_attr): New.
4965 (gpgme_get_sig_ulong_attr): New.
4967 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
4969 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
4970 list to align with the status.h file from gnupg.
4972 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
4973 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
4974 these new status codes. Store the expiration time
4976 2002-04-27 Werner Koch <wk@gnupg.org>
4978 * gpgme.h (GpgmeData_Encoding): New.
4979 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
4980 * engine-gpgsm.c (map_input_enc): New. Use it in all local
4981 functions where the INPUT command gets send.
4983 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
4985 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
4986 descriptor only when we don't need it anymore. Close the message
4987 descriptor if we don't need it.
4989 2002-04-26 Werner Koch <wk@gnupg.org>
4991 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
4993 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4995 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
4996 GPG->cmd.cb_data, not xfree.
4998 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5000 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5001 ttytype, lc_ctype and lc_messages options in the server.
5003 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5005 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5007 2002-04-23 Werner Koch <wk@gnupg.org>
5009 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5010 can_certify to return the requested values.
5012 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5014 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5016 (gpgme_get_passphrase_cb): Likewise.
5018 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5020 * gpgme.c (gpgme_get_passphrase_cb): New function.
5021 (gpgme_get_progress_cb): New function.
5022 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5023 gpgme_get_progress_cb.
5025 2002-03-28 Werner Koch <wk@gnupg.org>
5027 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5028 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5029 * keylist.c (keylist_colon_handler): Store them.
5030 * key.c (gpgme_key_release): Free them.
5031 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5033 2002-03-26 Werner Koch <wk@gnupg.org>
5035 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5037 2002-03-21 Werner Koch <wk@gnupg.org>
5039 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5042 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5044 * Makefile.am (system_components): New variable, set depending on
5046 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5047 * syshdr.h: File removed.
5049 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5050 * posix-sema.c: Likewise.
5051 * posix-util.c: Likewise.
5053 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5054 * w32-sema.c: Likewise.
5055 * w32-util.c: Likewise.
5057 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5058 * posix-sema.c: Likewise.
5059 * w32-io.c: Include `io.h', do not include `syshdr.h'
5060 * w32-sema.c: Likewise.
5061 * w32-util.c: Likewise.
5062 * data.c: Do not include `syshdr.h'.
5064 * wait.h: Code cleanup.
5066 * mutex.h: New file.
5067 * posix-sema.c: Implement.
5069 2002-03-08 Werner Koch <wk@gnupg.org>
5071 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5073 2002-03-07 Werner Koch <wk@gnupg.org>
5075 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5077 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5079 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5080 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5081 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5082 as status handler and run _gpgme_passphrase_start.
5083 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5085 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5088 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5090 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5092 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5093 error No_Passphrase if only a bad passphrase was provided.
5095 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5097 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5098 GPGME_DATA_MODE_IN, construct a command line that stores the
5100 * verify.c (gpgme_op_verify_start): Accept TEXT being
5101 uninitialized, and in this case interpret SIG as a normal or
5102 cleartext signature and TEXT as a return data object.
5103 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5105 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5107 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5110 2002-02-28 Werner Koch <wk@gnupg.org>
5112 * key.h (subkey_s): New member expires_at.
5113 * keylist.c (keylist_colon_handler): Set it here
5114 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5116 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5118 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5119 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5120 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5121 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5122 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5123 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5124 * keylist.c (gpgme_op_keylist_ext_start): New function.
5126 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5128 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5129 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5130 rename no_recipients to no_valid_recipients.
5131 (_gpgme_encrypt_status_handler): Include error for invalid
5133 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5134 argument to GpgsmObject. Use that to report back the status about
5137 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5139 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5141 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5143 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5144 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5145 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5146 (_gpgme_gpg_op_sign): Use that new function.
5147 (_gpgme_gpg_op_encrypt_sign): New function.
5148 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5149 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5150 (gpgme_op_encrypt_sign): Likewise.
5151 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5152 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5153 (_gpgme_sign_status_handler): Add prototype.
5154 * sign.c (sign_status_handler): Rename to ...
5155 (_gpgme_sign_status_handler): ... this and make non-static.
5156 * encrypt.c (encrypt_status_handler): Rename to ...
5157 (_gpgme_encrypt_status_handler): ... this and make non-static.
5158 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5159 * sign.c (gpgme_op_sign_start): Likewise.
5161 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5163 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5164 see if the problem is due to a missing key, and report that back
5167 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5169 * context.h (struct gpgme_context_s): New member include_certs.
5170 * gpgme.h (gpgme_set_include_certs): Add prototype.
5171 (gpgme_get_include_certs): Likewise.
5172 * gpgme.c (gpgme_set_include_certs): New function.
5173 (gpgme_get_include_certs): Likewise.
5174 (gpgme_new): Set include_certs to 1 (the default).
5175 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5176 and pass it to _gpgme_gpgsm_op_sign.
5177 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5178 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5179 include_certs and handle it.
5180 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5181 * sign.c (gpgme_op_sign_start): Add new argument to
5182 _gpgme_engine_op_sign call.
5184 2002-02-14 Werner Koch <wk@gnupg.org>
5186 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5188 2002-02-13 Werner Koch <wk@gnupg.org>
5190 * vasprintf.c, fopencookie.c: Add replacement functions.
5191 * util.h: Add prototypes for them.
5193 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5195 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5196 reach the end of the function.
5198 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5200 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5201 (gpgme_op_genkey_start): Skip newlines after opening tag.
5203 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5205 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5207 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5208 set, and pass them down to the crypto engine.
5209 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5210 * engine.h: Likewise.
5211 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5212 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5214 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5216 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5219 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5221 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5223 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5226 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5228 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5229 status of the returned context is returned.
5230 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5231 aware of cancelled processes, and to allow to use gpgme_wait with
5232 CTX being NULL (as documented in the source).
5233 (struct proc_s): New member REPORTED.
5234 * gpgme.h: Fix prototype.
5235 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5236 * sign.c (gpgme_op_sign): Likewise.
5237 * import.c (gpgme_op_import): Likewise.
5238 * genkey.c (gpgme_op_genkey): Likewise.
5239 * export.c (gpgme_op_export): Likewise.
5240 * encrypt.c (gpgme_op_encrypt): Likewise.
5241 * delete.c (gpgme_op_delete): Likewise.
5242 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5244 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5246 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5248 (gpgme_get_keylist_mode): New function.
5249 (gpgme_new): Set the default for keylist_mode member of CTX.
5251 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5252 (gpgme_get_keylist_mode): New prototype.
5253 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5254 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5256 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5258 This patch has gotten a bit large... mmh. The main thing that
5259 happens here is that error values are now not determined in the
5260 operation function after gpgme_wait completed, but in the status
5261 handler when EOF is received. It should always be the case that
5262 either an error is flagged or EOF is received, so that after a
5263 gpgme_wait you should never have the situation that no error is
5264 flagged and EOF is not received. One problem is that the engine
5265 status handlers don't have access to the context, a horrible
5266 kludge works around this for now. All errors that happen during a
5267 pending operation should be catched and reported in ctx->error,
5268 including out-of-core and cancellation. This rounds up neatly a
5269 couple of loose ends, and makes it possible to pass up any errors
5270 in the communication with the backend as well. As a bonus, there
5271 will be a function to access gpgme->wait, so that the operations
5272 can truly be implemented with their _start function.
5274 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5275 error back to the context.
5276 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5278 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5280 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5281 to a value indication that.
5283 * verify.c (add_notation): Set error, not out_of_core.
5284 (finish_sig): Likewise.
5285 (gpgme_op_verify_start): Don't clear out_of_core.
5286 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5287 (gpgme_op_verify): And don't do it here.
5289 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5290 (gpgme_op_trustlist_start): Don't clear out_of_core.
5291 (gpgme_op_trustlist_next): Check error, not out_of_core.
5292 (gpgme_op_trustlist_end): Likewise.
5294 * ops.h (test_and_allocate_result): New macro.
5295 (_gpgme_passphrase_result): Remove prototype.
5296 * delete.c (gpgme_op_delete): Return error from context.
5297 (delete_status_handler): Use macro test_and_allocate_result.
5298 Perform error checking at EOF.
5299 (gpgme_op_delete_start): Release result.
5300 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5301 test_and_allocate_result, and perform error checking here.
5302 (_gpgme_passphrase_result): Function removed.
5303 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5304 (gpgme_op_sign): Just return the error value from the context.
5305 (sign_status_handler): Only progress if no error is set yet. If
5306 we process an EOF, set the resulting error value (if any).
5307 * decrypt.c (_gpgme_decrypt_result): Function removed.
5308 (create_result_struct): Function removed.
5309 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5310 caclulate error on EOF, do not progress with errors.
5311 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5312 (gpgme_op_decrypt): Just return the error value from the context.
5313 * encrypt.c (encrypt_status_handler): Perform the error checking
5315 (gpgme_op_encrypt_start): Do not clear out_of_core.
5316 * export.c (export_status_handler): Return if error is set in context.
5317 (gpgme_op_export_start): Release result.
5318 (gpgme_op_export): Return error from context.
5319 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5321 * genkey.c (genkey_status_handler): Use macro
5322 test_and_allocate_result. Perform error checking at EOF.
5323 (gpgme_op_genkey): Just return the error from context.
5324 * import.c (gpgme_op_import): Return the error from context.
5325 (import_status_handler): Use macro test_and_allocate_result.
5326 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5327 (gpgme_op_keylist_next): Return error of context.
5328 (keylist_colon_handler): Set error instead out_of_code.
5329 (finish_key): Likewise.
5331 * context.h: Remove member out_of_core, add member error.
5332 * gpgme.c (_gpgme_release_result): Clear error flag.
5334 * engine.h (_gpgme_engine_get_error): New prototype.
5335 * engine.c (_gpgme_engine_get_error): New function.
5336 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5338 * engine-gpgsm.c (map_assuan_error): New function.
5339 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5340 use the new function to map error values.
5341 (gpgsm_set_fd): Change return type tp GpgmeError.
5342 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5343 (gpgsm_set_recipients): Likewise. Change type of return value
5344 equivalently. Adjust error values.
5345 (_gpgme_gpgsm_op_import): Likewise.
5346 (_gpgme_gpgsm_op_sign): Likewise.
5347 (struct gpgsm_object_s): New member error.
5348 (gpgsm_status_handler): Set error if error occurs. Determine
5349 error number from ERR line received. If assuan_read_line fails,
5350 terminate the connection.
5352 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5354 * Makefile.am (MOSTLYCLEANFILES): New variable.
5356 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5358 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5359 connection to the server.
5361 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5363 * rungpg.h: Add STATUS_KEY_CREATED.
5365 * progress.c: New file.
5366 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5368 * genkey.c (genkey_status_handler): Use
5369 _gpgme_progress_status_handler. Add check for status.
5370 (struct genkey_result_s): New structure.
5371 (_gpgme_release_genkey_result): New function.
5372 (gpgme_op_genkey): Check for error.
5373 * gpgme.c (_gpgme_release_result): Call
5374 _gpgme_release_genkey_result.
5375 * ops.h (_gpgme_release_genkey_result): Add prototype.
5376 * types.h (GenKeyResult): New type.
5377 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5379 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5381 * gpgme.c (_gpgme_release_result): Call
5382 _gpgme_release_delete_result.
5383 * ops.h (_gpgme_release_delete_result): Add prototype.
5384 * types.h (DeleteResult): New type.
5385 * context.h (gpgme_context_s): Add DeleteResult to member result.
5387 * delete.c (enum delete_problem): New type.
5388 (struct delete_result_s): New structure.
5389 (_gpgme_release_delete_result): New function.
5390 (delete_status_handler): Implement more status codes.
5391 (gpgme_op_delete): Return error on failure.
5393 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5395 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5397 * import.c (struct import_result_s): New structure.
5398 (_gpgme_release_import_result): New function.
5399 (append_xml_impinfo): Likewise.
5400 (import_status_handler): Implement.
5401 * gpgme.c (_gpgme_release_result): Add call to
5402 _gpgme_release_import_result.
5403 * ops.h (_gpgme_release_import_result): Add prototype.
5404 * types.h (ImportResult): New type.
5405 * context.h (gpgme_context_s): Add ImportResult to member result.
5407 * encrypt.c (gpgme_op_encrypt): Code clean up.
5409 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5411 * gpgme.h: Add lots of comment and fix the formatting. Add
5412 gpgme_trustlist_end prototype.
5414 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5416 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5417 gpgme_register_idle to return and accept this type.
5418 * wait.c (gpgme_register_idle): Fix type.
5419 Save and return old value of idle_function.
5421 2002-01-29 Werner Koch <wk@gnupg.org>
5423 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5425 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5428 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5430 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5431 not assuan_pipe_disconnect.
5433 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5434 jnlib (needed by assuan) statically into libgpgme. Linking a
5435 static library into a shared library this way is not portable.
5437 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5439 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5442 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5444 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5445 from off_t to size_t.
5446 * gpgme.h: Likewise.
5448 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5450 * wait.c (_gpgme_wait_on_condition): If the process finished,
5451 reset the pending flag. Also if the operation was cancelled.
5453 (struct proc_s): Rename READY to DONE.
5454 (wait_item_s): Likewise.
5455 (set_process_ready): Rename to ...
5456 (set_process_done): ... this.
5457 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5458 instead set_process_ready.
5459 (_gpgme_wait_on_condition): Likewise.
5460 (do_select): Rename READY to DONE.
5462 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5463 * sign.c (gpgme_op_sign): Likewise.
5464 * import.c (gpgme_op_import): Likewise.
5465 * genkey.c (gpgme_op_genkey): Likewise.
5466 * export.c (gpgme_op_export): Likewise.
5467 * encrypt.c (gpgme_op_encrypt): Likewise.
5468 * delete.c (gpgme_op_delete): Likewise.
5469 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5470 * decrypt.c (gpgme_op_decrypt): Likewise.
5472 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5474 * export.c: Cleanup.
5476 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5478 * trustlist.c: Various source clean ups.
5479 (my_isdigit): Removed.
5480 (gpgme_op_trustlist_end): New function.
5482 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5484 * gpgme.c: Various source clean ups, like renaming C to CTX where
5486 (gpgme_new): Clear R_CTX before starting the work.
5487 (my_isdigit): Removed.
5488 (my_isxdigit): Likewise.
5490 * data.c: Various source clean ups.
5491 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5492 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5493 (gpgme_data_new_from_file): Loop over fread while EINTR.
5494 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5495 be zero. Loop over fread while EINTR.
5497 (my_isdigit): Removed.
5498 (my_isxdigit): Likewise.
5500 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5502 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5503 Pipe_Error where appropriate.
5505 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5507 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5509 * version.c (get_engine_info): Remove prototype.
5511 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5513 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5514 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5516 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5518 * keylist.c (gpgme_op_keylist_end): New function.
5519 * gpgme.h (gpgme_op_keylist_end): New prototype.
5521 * engine.h (gpgme_engine_check_version): Move prototype to ...
5522 * gpgme.h (gpgme_engine_check_version): ... here.
5524 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5526 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5528 * version.c (gpgme_get_engine_info): Reimplemented.
5529 (gpgme_check_engine): Reimplemented.
5530 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5532 * engine.c: Include `io.h'.
5533 (gpgme_engine_get_info): New function.
5534 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5537 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5539 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5540 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5541 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5543 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5544 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5545 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5546 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5547 own function by call to _gpgme_engine_add_child_to_reap_list().
5549 * wait.c: Include `engine.h'.
5550 (run_idle): Call _gpgme_engine_housecleaning(), not
5551 _gpgme_gpg_housecleaning().
5553 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5555 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5556 Initialize the next field of the uid structure.
5557 (gpgme_key_get_as_xml): Do not list last uid first.
5559 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5561 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5562 function [!ENABLE_GPGSM].
5564 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5566 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5567 message_data, not SIG.
5568 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5570 * sign.c (sign_status_handler): Call
5571 _gpgme_passphrase_status_handler early.
5573 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5575 * engine-gpgsm.c: Revert last change.
5577 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5579 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5580 handler when ending this operation, otherwise the wait function
5583 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5585 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5586 (_gpgme_gpgsm_new): Initialize some more members.
5587 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5588 (gpgsm_status_handler): Rework the inline-data processing.
5590 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5592 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5593 list that are not dup'ed, for those the close-on-exec flag is set
5595 * version.c (_gpgme_get_program_version): Remove first entry in
5596 CFD, as the close-on-exec flag is now set for this fd.
5598 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5600 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5601 option to `ENCRYPT'.
5602 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5605 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5607 * engine-gpgsm.c (close_notify_handler): New function.
5608 (_gpgme_gpgsm_new): Manage the file descriptors a
5609 bit differently. Do not set close-on-exec flags.
5610 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5611 to -1, this is done by the close handler.
5612 (_gpgme_gpgsm_op_encrypt): Likewise.
5613 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5614 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5615 (_gpgme_gpgsm_op_sign): Likewise.
5616 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5618 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5619 non-inherited file descriptor index of the pipe.
5621 2001-12-13 Werner Koch <wk@gnupg.org>
5623 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5624 (gpgsm_status_handler): Pass datalines to a colon handler
5625 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5628 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5630 (gpgsm_assuan_simple_command): Removed underscore from
5632 (_gpgme_gpgsm_start): Ditto.
5633 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5634 function by the new assuan_read_line. Removed the use of the
5636 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5637 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5640 * keylist.c (keylist_colon_handler): Handle "crt" records
5641 * key.h (gpgme_key_s): Add an x509 flag.
5642 * key.c (parse_x509_user_id): New.
5643 (_gpgme_key_append_name): Handle x.509 names.
5645 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5647 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5650 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5652 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5653 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5655 (_gpgme_gpgsm_op_sign): Likewise.
5657 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5659 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5662 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5664 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5666 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5668 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5669 Deal with assuan read line returning more than one line (for now).
5671 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5673 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5674 the current protocol definition.
5676 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5678 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5681 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5683 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5684 for now, rungpg.h and status-table.h.
5685 (gpgsm_status_handler): Implement more of the status handler.
5687 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5689 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5690 (_gpgme_engine_op_delete): Likewise.
5691 (_gpgme_engine_op_encrypt): Likewise.
5692 (_gpgme_engine_op_export): Likewise.
5693 (_gpgme_engine_op_genkey): Likewise.
5694 (_gpgme_engine_op_keylist): Likewise.
5695 (_gpgme_engine_op_sign): Likewise.
5696 (_gpgme_engine_op_trustlist): Likewise.
5698 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5699 (gpgsm_assuan_simple_command): Likewise.
5700 (gpgsm_set_recipients): Likewise.
5701 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5702 (_gpgme_gpgsm_op_delete): New function.
5703 (_gpgme_gpgsm_op_export): Likewise.
5704 (_gpgme_gpgsm_op_genkey): Likewise.
5705 (_gpgme_gpgsm_op_sign): Likewise.
5706 (_gpgme_gpgsm_op_keylist): Likewise.
5707 (_gpgme_gpgsm_op_trustlist): Likewise.
5708 (_gpgme_gpgsm_release): Release command.
5709 (_gpgme_gpgsm_op_decrypt): Allocate command.
5710 (_gpgme_gpgsm_op_import): Likewise.
5711 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5713 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5715 * gpgme.h (gpgme_set_protocol): New prototype.
5717 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5719 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5720 (_gpgme_gpgsm_op_import): Likewise.
5722 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5724 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5726 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5728 2001-11-22 Werner Koch <wk@gnupg.org>
5730 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5731 is defined even with an undefined GPGSM_PATH.
5733 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5735 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5736 gpg_outbound_handler): Moved to ...
5737 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5738 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5739 _gpgme_* ones non-static.
5740 * data.c: Include io.h.
5742 * ops.h (_gpgme_data_inbound_handler): New prototype.
5743 (_gpgme_data_outbound_handler): Likewise.
5744 (_gpgme_gpg_spawn): Use these new functions.
5746 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5747 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5748 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5749 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5750 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5751 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5752 Include <rungpg.h> for status handler function.
5754 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5755 input_data, output_fd, output_data, message_fd, message_data, command
5757 (_gpgme_gpgsm_new): Open input, output and message pipes before
5758 connecting to the client. Close server's ends afterwards.
5759 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5760 server process from wait queue.
5761 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5762 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5764 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5765 (_gpgme_engine_set_status_handler): Likewise.
5766 (_gpgme_engine_op_verify): Likewise.
5768 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5770 * context.h: Do not include rungpg.h, but engine.h.
5771 (struct gpgme_context_s): Replace member gpg with engine.
5772 * gpgme.c (gpgme_release): Release engine, not gpg.
5774 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5776 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5777 Make static, change order of arguments, and return an error value.
5778 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5780 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5781 (_gpgme_gpg_op_encrypt): Likewise.
5782 (_gpgme_gpg_op_decrypt): Likewise.
5783 (_gpgme_gpg_op_delete): Likewise.
5784 (_gpgme_gpg_op_export): Likewise.
5785 (_gpgme_gpg_op_genkey): Likewise.
5786 (_gpgme_gpg_op_import): Likewise.
5787 (_gpgme_gpg_op_keylist): Likewise.
5788 (_gpgme_gpg_op_sign): Likewise.
5789 (_gpgme_gpg_op_trustlist): Likewise.
5790 * rungpg.c (_gpgme_gpg_op_verify): New function.
5791 (_gpgme_gpg_op_encrypt): Likewise.
5792 (_gpgme_gpg_op_decrypt): Likewise.
5793 (_gpgme_gpg_op_delete): Likewise.
5794 (_gpgme_gpg_op_export): Likewise.
5795 (_gpgme_gpg_op_genkey): Likewise.
5796 (_gpgme_gpg_op_import): Likewise.
5797 (_gpgme_gpg_op_keylist): Likewise.
5798 (_gpgme_gpg_op_sign): Likewise.
5799 (_gpgme_gpg_op_trustlist): Likewise.
5801 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5802 (_gpgme_engine_set_command_handler): Likewise.
5803 (_gpgme_engine_set_colon_line_handler): Likewise.
5804 (_gpgme_engine_op_decrypt): Likewise.
5805 (_gpgme_engine_op_delete): Likewise.
5806 (_gpgme_engine_op_encrypt): Likewise.
5807 (_gpgme_engine_op_export): Likewise.
5808 (_gpgme_engine_op_genkey): Likewise.
5809 (_gpgme_engine_op_import): Likewise.
5810 (_gpgme_engine_op_keylist): Likewise.
5811 (_gpgme_engine_op_sign): Likewise.
5812 (_gpgme_engine_op_trustlist): Likewise.
5813 (_gpgme_engine_op_verify): Likewise.
5814 (_gpgme_engine_start): Likewise.
5815 * engine.c (_gpgme_engine_set_status_handler): New function.
5816 (_gpgme_engine_set_command_handler): Likewise.
5817 (_gpgme_engine_set_colon_line_handler): Likewise.
5818 (_gpgme_engine_op_decrypt): Likewise.
5819 (_gpgme_engine_op_delete): Likewise.
5820 (_gpgme_engine_op_encrypt): Likewise.
5821 (_gpgme_engine_op_export): Likewise.
5822 (_gpgme_engine_op_genkey): Likewise.
5823 (_gpgme_engine_op_import): Likewise.
5824 (_gpgme_engine_op_keylist): Likewise.
5825 (_gpgme_engine_op_sign): Likewise.
5826 (_gpgme_engine_op_trustlist): Likewise.
5827 (_gpgme_engine_op_verify): Likewise.
5828 (_gpgme_engine_start): Likewise.
5830 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5832 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5833 * decrypt.c (_gpgme_decrypt_start): Likewise.
5834 * passphrase.c (_gpgme_passphrase_start): Likewise.
5835 * keylist.c (gpgme_op_keylist_start): Likewise.
5837 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5839 * types.h: Add types EngineObject and GpgsmObject.
5841 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5842 engine-gpgsm.c, engine.h and engine.c.
5843 * engine.h: New file.
5844 * engine.c: Likewise.
5845 * engine-gpgsm.h: Likewise.
5846 * engine-gpgsm.c: Likewise.
5848 * rungpg.c (_gpgme_gpg_get_version): New function.
5849 (_gpgme_gpg_check_version): Likewise.
5850 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5851 _gpgme_gpg_check_version.
5853 * version.c (compare_versions): Rename to ...
5854 (_gpgme_compare_versions): ... this. Make non-static.
5855 (gpgme_check_version): Use _gpgme_compare_versions rather than
5857 (gpgme_check_engine): Likewise.
5858 * ops.h (_gpgme_get_program_version): Add prototype.
5860 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5862 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5863 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5864 (libgpgme_la_LIBADD): Likewise.
5866 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5868 * version.c: Remove global variables lineno and
5870 (version_handler): Removed.
5871 (_gpgme_get_program_version): New function.
5872 (get_engine_info): Don't use context and version_handler,
5873 but _gpgme_get_program_version.
5874 * ops.h (_gpgme_get_program_version): Add prototype for
5875 _gpgme_get_program_version (we expect to use it elsewhere soon).
5877 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5879 * version.c (get_engine_info): If GnuPG is not available, return
5881 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5883 (_gpgme_get_gpgsm_path): New function.
5884 * w32-util.c (find_program_in_registry): New static function.
5885 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5886 to use find_program_in_registry.
5887 (_gpgme_get_gpgsm_path): New function.
5888 (util.h): Prototype _gpgme_get_gpgsm_path).
5889 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5892 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5894 * decrypt-verify.c: New file.
5895 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5896 * types.h: Add decrypt-verify types.
5898 * context.h: Add result type for decrypt-verify.
5899 * gpgme.h: Add decrypt-verify prototypes.
5901 * decrypt.c (decrypt_status_handler): Renamed to ...
5902 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5903 (_gpgme_decrypt_start): New function, derived from
5904 gpgme_op_decrypt_start.
5905 (gpgme_op_decrypt_start): Reimplement in terms of
5906 _gpgme_decrypt_start.
5907 (_gpgme_decrypt_result): New function to retrieve error value.
5908 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5909 * ops.h: Add prototypes for new functions.
5911 * verify.c (verify_status_handler): Renamed to ...
5912 (_gpgme_verify_status_handler): ... this. Make non-static.
5913 (gpgme_op_verify_start): Use new function name.
5914 (intersect_stati): Renamed to ...
5915 (_gpgme_intersect_stati): ... this. Make non-static.
5916 (gpgme_op_verify): Use new name.
5917 * ops.h: Add prototypes for new functions.
5919 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5921 * passphrase.c: New file.
5922 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5923 * ops.h (_gpgme_passphrase_result): Add prototypes from
5925 * types.h: Likewise.
5926 * context.h: Add member passphrase to result.
5927 * gpgme.c (_gpgme_release_result): Release passphrase member.
5929 * decrypt.c: Some formatting and variable name changes (like
5931 (struct decrypt_result_s): Remove members now found in
5933 (_gpgme_release_decrypt_result): Don't release removed members.
5934 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5935 and don't handle the cases catched there.
5936 (command_handler): Removed.
5937 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5938 _gpgme_passphrase_start which does it.
5939 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
5940 cases covered by it.
5942 * sign.c Some formatting and variable name changes (like
5944 (struct sign_result_s): Remove members now found in
5946 (_gpgme_release_sign_result): Don't release removed members.
5947 (sign_status_handler): Call _gpgme_passphrase_status_handler,
5948 and don't handle the cases catched there.
5949 (command_handler): Removed.
5950 (gpgme_op_sign_start): Don't set command handler, but invoke
5951 _gpgme_passphrase_start which does it.
5952 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
5953 cases covered by it.
5955 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5957 * decrypt.c (command_handler): Fix last change.
5959 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5961 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
5962 Rename R2 to NEXT_RESULT.
5963 (intersect_stati): Rename RES to RESULT.
5964 (gpgme_get_sig_status): Likewise. Do not check return_type, but
5965 the member verify of result.
5966 (gpgme_get_sig_key): Likewise.
5968 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
5969 RESULT is zero, return.
5970 (sign_status_handler, command_handler): Do not check return_type,
5971 but the member sign of result.
5972 (gpgme_op_sign): Likewise. Drop assertion.
5974 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
5975 If RESULT is zero, return.
5976 (encrypt_status_handler): Do not check return_type, but the member
5978 (gpgme_op_encrypt): Likewise. Drop assertion.
5980 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
5981 (create_result_struct): Do not set result_type.
5982 (command_handler, decrypt_status_handler): Do not check
5983 return_type, but the member decrypt of result.
5984 (gpgme_op_decrypt): Likewise. Drop assertion.
5986 * context.h (enum ResultType): Removed.
5987 (struct gpgme_context_s): Remove member result_type.
5988 (struct result): Replaces union result.
5989 * gpgme.c: Include string.h.
5990 (_gpgme_release_result): Release all members of c->result, which
5991 is now a struct. Zero out all members of the struct afterwards.
5993 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
5995 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
5996 Release all members of the list GPG->arglist.
5997 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
5999 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6001 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6003 * key.c: Include string.h.
6005 * recipient.c: Likewise.
6007 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6009 * context.h: New member signers_len.
6010 * signers.c (gpgme_signers_clear): Require that signers are
6011 non-NULL with assertion. Use signers_len to determine how much
6012 keys to release. Add documentation.
6013 (gpgme_signers_add): Use signers_len to determine if the buffer is
6014 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6016 (gpgme_signers_enum): Use signers_len to determine if key is
6017 available. Add documentation.
6019 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6021 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6022 ALLOC_CHUNK, not DH->length.
6024 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6026 * gpgme.c (gpgme_set_protocol): Fix last change.
6028 2001-10-15 Werner Koch <wk@gnupg.org>
6030 * gpgme.h (GpgmeProtocol): New.
6031 * gpgme.c (gpgme_set_protocol): New.
6033 2001-09-26 Werner Koch <wk@gnupg.org>
6035 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6036 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6038 2001-09-17 Werner Koch <wk@gnupg.org>
6040 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6041 callers to use this function without a check for tmp_key.
6043 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6044 emptying the queue. Bug reported by Stéphane Corthésy.
6046 2001-09-12 Werner Koch <wk@gnupg.org>
6048 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6050 2001-09-07 Werner Koch <wk@gnupg.org>
6052 * rungpg.h: Add NO_RECP.
6053 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6054 (gpgme_op_encrypt): Better error return.
6056 * verify.c (verify_status_handler): Take on NODATA.
6058 2001-09-03 Werner Koch <wk@gnupg.org>
6060 * rungpg.h: Added STATUS_INV_RECP.
6061 * gpgme.c (_gpgme_release_result): Add support for new
6062 EncryptResult object.
6063 * encrypt.c (append_xml_encinfo): New.
6064 (encrypt_status_handler): Add some status parsing.
6065 (_gpgme_release_encrypt_result): New.
6067 2001-08-29 Werner Koch <wk@gnupg.org>
6069 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6071 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6072 an EOF here. This is probably the reason for a lot of bugs
6073 related to keylisting. It is so obvious. Kudos to Enno Cramer
6074 for pointing that out.
6076 2001-08-28 Werner Koch <wk@gnupg.org>
6078 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6079 (_gpgme_set_op_info): New.
6080 (_gpgme_release_result): Reset the op_info here.
6081 * sign.c (append_xml_siginfo): New.
6082 (sign_status_handler): Store the sig create information.
6084 2001-07-31 Werner Koch <wk@gnupg.org>
6086 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6088 2001-07-30 Werner Koch <wk@gnupg.org>
6090 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6092 * rungpg.c (build_argv): Disable armor comments
6093 * w32-io.c (build_commandline): Need to add quotes here
6095 2001-07-24 Werner Koch <wk@gnupg.org>
6097 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6099 2001-07-23 Werner Koch <wk@gnupg.org>
6101 * util.c: Removed stpcpy() because we use the version from jnlib.
6103 2001-07-19 Werner Koch <wk@gnupg.org>
6105 * mkstatus: Define the collating sequence for sort.
6107 2001-06-26 Werner Koch <wk@gnupg.org>
6109 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6111 2001-06-15 Werner Koch <wk@gnupg.org>
6113 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6114 to Timo for pointing this out.
6116 2001-06-01 Werner Koch <wk@gnupg.org>
6118 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6121 2001-05-28 Werner Koch <wk@gnupg.org>
6123 * version.c (gpgme_check_engine): Stop version number parsing at
6124 the opening angle and not the closing one. By Tommy Reynolds.
6126 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6128 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6129 line, because it gave an error if another operation had been made
6130 before using the same context.
6132 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6133 one line to release the gpg object in the context (if any).
6135 2001-04-26 Werner Koch <wk@gnupg.org>
6137 * key.c, key.h (_gpgme_key_cache_init): New.
6138 (_gpgme_key_cache_add): New.
6139 (_gpgme_key_cache_get): New.
6140 * version.c (do_subsystem_inits): Init the cache.
6141 * keylist.c (finish_key): Put key into the cache
6142 * verify.c (gpgme_get_sig_key): First look into the cache.
6144 2001-04-19 Werner Koch <wk@gnupg.org>
6146 * keylist.c (parse_timestamp): Adjusted for the changed
6147 --fixed-list-mode of gpg 1.0.4h.
6149 2001-04-05 Werner Koch <wk@gnupg.org>
6151 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6153 2001-04-04 Werner Koch <wk@gnupg.org>
6155 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6156 are still bytes pending. Timo found this not easy to track down
6159 2001-04-02 Werner Koch <wk@gnupg.org>
6161 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6162 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6164 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6165 the mode set in the current context. Suggested by Timo.
6167 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6168 can_encrypt. By Timo.
6170 2001-03-30 Werner Koch <wk@gnupg.org>
6172 * debug.c (debug_init): Allow to specify a debug file.
6173 (_gpgme_debug_level): New.
6175 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6176 (_gpgme_io_select): Debug only with level > 2.
6178 2001-03-15 Werner Koch <wk@gnupg.org>
6180 * rungpg.c: Included time.h.
6182 * key.h: New keyflags for capabilities.
6183 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6184 (keylist_colon_handler): Parse them.
6185 * gpgme.h: New attribute values for capabilties.
6186 * key.c (gpgme_key_get_string_attr): Return them.
6187 (capabilities_to_string): New.
6188 (gpgme_key_get_ulong_attr): Return the global caps.
6190 2001-03-14 Werner Koch <wk@gnupg.org>
6192 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6193 Thanks to Jan Oliver Wagner.
6195 2001-03-13 Werner Koch <wk@gnupg.org>
6197 * context.h: Add invalid and revoke flags to user_id structure.
6198 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6199 (keylist_colon_handler): Adjust for that.
6200 (set_userid_flags): New.
6201 (set_mainkey_trust_info): Handle new key invalid flag
6202 (set_subkey_trust_info): Ditto.
6203 * gpgme.h: Add new attributes for key and user ID flags.
6204 * key.c (_gpgme_key_append_name): Init these flags
6205 (gpgme_key_get_as_xml): Print them.
6206 (one_uid_as_xml): New helper for above.
6207 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6208 Return the new attributes. Enhanced, so that subkey information
6209 can be returned now.
6211 2001-02-28 Werner Koch <wk@gnupg.org>
6213 * w32-io.c (destroy_reader): Set stop_me flag.
6214 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6215 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6216 (_gpgme_io_close): Cleanup a writer thread
6217 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6218 waiting which is now possible due to the use of a writer thread.
6220 2001-02-20 Werner Koch <wk@gnupg.org>
6222 * w32-io.c (destroy_reader,kill_reader): New.
6223 (create_reader, reader): Add a new event to stop the thread.
6224 (_gpgme_io_close): Kill the reader thread.
6226 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6227 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6229 * wait.c: Reworked the whole thing.
6230 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6231 (_gpgme_gpg_release): Remove the process from the wait queue.
6233 2001-02-19 Werner Koch <wk@gnupg.org>
6235 * w32-io.c (_gpgme_io_set_close_notify): New.
6236 (_gpgme_io_close): Do the notification.
6238 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6241 * wait.c (remove_process): Don't close the fd here.
6242 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6243 (_gpgme_wait_on_condition): Remove the assert on the queue and
6244 break out if we could not find the queue. The whole thing should
6247 * posix-io.c (_gpgme_io_set_close_notify): New.
6248 (_gpgme_io_close): Do the notification.
6250 * rungpg.c (close_notify_handler): New.
6251 (_gpgme_gpg_new): Register a callback for the fd.
6252 (_gpgme_gpg_set_colon_line_handler): Ditto.
6255 2001-02-13 Werner Koch <wk@gnupg.org>
6257 * rungpg.c (struct reap_s): Replaced pid_t by int.
6259 * types.h: Add ulong typedef.
6261 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6262 (_gpgme_gpg_release): Reap children.
6263 * io.h, posix-io.c (_gpgme_io_kill): New.
6264 * w32-io.c (_gpgme_io_kill): New (dummy).
6266 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6268 * posix-io.c (_gpgme_io_read): Add some debug output.
6269 (_gpgme_io_write): Ditto.
6270 (_gpgme_io_select): Increased the timeout.
6272 2001-02-12 Werner Koch <wk@gnupg.org>
6274 Enhanced the signature verification, so that it can how handle
6275 more than one signature and is able to return more information on
6277 * verify.c (gpgme_get_sig_key): New.
6278 (gpgme_get_sig_status): New.
6280 * gpgme.h: Add stdio.h.
6281 (GpgmeSigStat): New status DIFF.
6283 2001-02-01 Werner Koch <wk@gnupg.org>
6285 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6286 code to all Set/ResetEvent().
6288 * rungpg.c (read_status): Check for end of stream only if we have
6291 2001-01-31 Werner Koch <wk@gnupg.org>
6293 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6294 (propagate_term_results,clear_active_fds): Removed.
6295 (count_active_fds): Renamed to ..
6296 (count_active_and_thawed_fds): .. this and count only thawed fds.
6298 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6301 2001-01-30 Werner Koch <wk@gnupg.org>
6303 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6305 * version.c (get_engine_info): Return better error information.
6307 * posix-util.c, w32-util.c: New.
6308 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6309 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6311 * signers.c (gpgme_signers_add): Ooops, one should test code and
6312 not just write it; the newarr was not assigned. Thanks to José
6313 for pointing this out. Hmmm, still not tested, why should a coder
6316 * w32-io.c: Does now use reader threads, so that we can use
6317 WaitForMultipleObjects.
6318 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6319 Does currently only work for W32.
6321 * debug.c, util.h : New. Changed all fprintfs to use this new
6322 set of debugging functions.
6324 2001-01-23 Werner Koch <wk@gnupg.org>
6326 * data.c (_gpgme_data_release_and_return_string): Fixed string
6329 2001-01-22 Werner Koch <wk@gnupg.org>
6334 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6335 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6337 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6338 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6340 2001-01-05 Werner Koch <wk@gnupg.org>
6342 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6345 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6347 This file is free software; as a special exception the author gives
6348 unlimited permission to copy and/or distribute it, with or without
6349 modifications, as long as this notice is preserved.
6351 This file is distributed in the hope that it will be useful, but
6352 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6353 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.