1 2009-10-28 Marcus Brinkmann <marcus@g10code.de>
3 * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
4 edit.c, import.c, export.c: Fix last change in debug output.
6 2009-10-27 Marcus Brinkmann <marcus@g10code.de>
8 * edit.c (gpgme_op_edit_start, gpgme_op_edit)
9 (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
10 * encrypt-sign.c (gpgme_op_encrypt_sign_start)
11 (gpgme_op_encrypt_sign): Likewise.
12 * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
13 (gpgme_op_encrypt_result): Likewise.
14 * export.c (gpgme_op_export_start, gpgme_op_export)
15 (gpgme_op_export_ext_start, gpgme_op_export_ext)
16 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
17 * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
18 (gpgme_op_genkey_result): Likewise.
19 * getauditlog.c (gpgme_op_getauditlog_start)
20 (gpgme_op_getauditlog): Likewise.
21 * import.c (gpgme_op_import_result, gpgme_op_import_start)
22 (gpgme_op_import): Likewise.
23 * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
24 (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
25 (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
26 * opassuan.c (gpgme_op_assuan_transact_start)
27 (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
28 (gpgme_op_assuan_transact): Likewise.
29 * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
30 * trustlist.c (gpgme_op_trustlist_start)
31 (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
32 * verify.c (gpgme_op_verify_start, gpgme_op_verify)
33 (gpgme_op_verify_result): Likewise.
35 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
37 * gpgme.h.in (struct gpgme_io_event_done_data)
38 (gpgme_io_event_done_data_t): New types.
39 (struct _gpgme_op_assuan_result): Deprecate the err member.
40 (gpgme_op_assuan_result): Deprecate (for now).
41 (gpgme_op_assuan_transact_ext): New prototype.
42 (gpgme_op_assuan_transact): Deprecate.
43 (struct _gpgme_op_g13_result): Replace with ...
44 (struct _gpgme_op_vfs_mount_result): ... this.
45 (gpgme_op_g13_mount): Replace with ...
46 (gpgme_op_vfs_mount): ... this.
47 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
48 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
49 (gpgme_op_g13_mount): Remove.
50 * libgpgme.vers: Likewise.
51 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
52 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
54 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
56 (_gpgme_wait_one_ext): New prototype.
57 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
58 * engine-g13.c (g13_cancel_op): New function.
59 (parse_status): Remove declaration.
60 (g13_assuan_simple_command): Do nothing with status lines for now.
61 (status_handler): Update opaque value access.
62 (_gpgme_engine_ops_g13): Add new cancel_op member.
63 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
64 Handle operational errors.
65 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
66 * data.c (_gpgme_data_inbound_handler)
67 (_gpgme_data_outbound_handler): Adjust opaque value access.
68 * engine-gpg.c (command_handler, status_handler)
69 (colon_line_handler): Likewise.
70 * engine-gpgsm.c (status_handler): Likewise.
71 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
72 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
73 * g13.c: Rewritten (and will be rewritten again).
74 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
75 and result_cb_value parameters from prototype.
76 (_gpgme_engine_cancel_op): New prototype.
77 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
78 (_gpgme_engine_op_assuan_transact): Remove result_cb and
79 result_cb_value parameter.
80 (_gpgme_engine_cancel_op): New function.
81 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
82 (struct io_cb_data): New struct to pass opaque data and get a
83 op_err return value. Needed because we can't modify I/O callback
84 handler signature because it is exposed to the user.
85 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
87 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
89 * wait-private.c (_gpgme_wait_on_condition): New argument to
90 retrieve the operational result. Handle operational errors in
91 session based protocols.
92 (_gpgme_wait_one_ext): New function.
93 (_gpgme_wait_one): Pass argument in invocation of
94 _gpgme_wait_on_condition.
95 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
96 (ctx_done): New argument OP_ERR.
97 (ctx_wait): New argument OP_ERR.
98 (gpgme_wait_ext): New function based on gpgme_wait but handling
100 (gpgme_wait): Implement in term of gpgme_wait_ext.
101 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
102 of _gpgme_wait_on_condition.
103 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
104 invocation of _gpgme_wait_on_condition.
105 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
106 and RESULT_CB_VALUE by LAST_OP_ERR.
107 (_gpgme_engine_assuan_last_op_err): Add this hack function.
108 (llass_cancel_op): New function.
109 (_gpgme_engine_llass_ops): Add cancel_op member.
110 (llass_status_handler): Update opaque value access.
111 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
112 * opassuan.c: Move compat hacks to the end of file.
113 (opassuan_start): Do not set OPD->result.err.
114 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
115 (gpgme_op_assuan_transact_ext): New function.
117 * debug.h (DEBUG_GLOBAL): New debug level.
118 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
119 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
120 * data-fd.c (gpgme_data_new_from_fd): Likewise.
121 * data-stream.c (gpgme_data_new_from_stream): Likewise.
122 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
123 (gpgme_op_decrypt): Likewise.
124 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
125 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
126 (gpgme_op_decrypt_verify): Likewise.
127 * sign.c (gpgme_op_sign_result): Fix debug message.
128 * data-mem.c (gpgme_data_new): Improve debug output.
129 * verify.c (parse_trust): Use atoi instead of
130 _gpgme_map_gnupg_error.
131 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
133 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
135 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
136 (g13_components): New variable.
137 (main_sources): Add $(g13_components).
138 * g13.c, engine-g13.c: New files.
139 * engine.c (engine_ops): Check for assuan for assuan engine, add
141 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
143 * conversion.c (_gpgme_encode_percent_string): New function.
144 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
145 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
146 (gpgme_op_g13_mount): New function.
147 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
148 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
149 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
150 * posix-util.c (_gpgme_get_g13_path): New function.
151 * w32-util.c (_gpgme_get_g13_path): New function.
152 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
154 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
156 * gpgme-config.in (netlibs): Remove.
157 (assuan_cflags, assuan_libs): Add.
159 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
160 (gpgsm_components): Move engine-assuan.c to ...
161 (assuan_components): ... this new variable.
162 (main_sources): Add this new variable.
163 (AM_CPPFLAGS): Remove $(assuan_cppflags).
164 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
165 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
166 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
167 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
168 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
169 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
170 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
172 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
173 _gpgme_io_sendmsg, _gpgme_io_waitpid.
174 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
176 * posix-io.c (_gpgme_io_waitpid): Make non-static.
177 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
178 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
179 * engine-gpgsm.c: Don't map assuan error codes. Use
180 assuan_release instead of assuan_disconnect.
181 (map_assuan_error): Remove function.
182 (gpgsm_new): Use new assuan context interface.
183 * engine-assuan.c: Use assuan_release instead of
185 (llass_new): Use new assuan context interface.
187 2009-10-07 <wk@g10code.com>
189 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
191 2009-08-06 Werner Koch <wk@g10code.com>
193 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
195 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
197 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
198 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
199 (_gpgme_op_sign_init_result): Factor code out to ...
200 (sign_init_result): .. new. Init new fields.
201 (sign_start): Use sign_init_result.
202 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
203 Return an error if no signature has been created.
205 2009-07-07 Werner Koch <wk@g10code.com>
207 * engine-gpgsm.c (struct engine_gpgsm): Add fields
208 input_helper_data and input_helper_memory.
209 (close_notify_handler): Release these new fields.
210 (gpgsm_import): Implement the keyarray feature.
212 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
214 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
217 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
219 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
220 [HAVE_STDINT_H]: Include <stdint.h>.
221 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
222 to (uintptr_t) before casting it to (void*) to silence GCC
225 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
226 * sign.c (_GPGME_IN_GPGME): Define it.
227 * keylist.c (_GPGME_IN_GPGME): Define it.
229 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
230 vasprintf and asprintf.
232 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
234 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
236 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
237 back! (GPA still uses it...).
239 * gpgme.def: Fix stupid typo.
240 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
242 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
244 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
246 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
247 (_gpgme_io_dup): Never allocate threads here.
248 (find_writer, find_reader): Check return value of thread creation
251 * context.h (CTX_OP_DATA_MAGIC): New macro.
252 (struct ctx_op_data): New member MAGIC.
253 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
254 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
256 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
258 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
260 * gpgme.c (result_ref_lock): New global variable.
261 (gpgme_result_ref, gpgme_result_unref): use it.
263 2009-06-16 Werner Koch <wk@g10code.com>
265 * version.c: Include stdlib.h.
267 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
268 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
269 * data.c (gpgme_data_set_encoding): Adjust for new values.
270 * engine-gpg.c (string_from_data): New.
271 (gpg_import): Implement --fetch-key feature.
273 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
274 * gpgme.def, libgpgme.vers: Add them.
275 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
276 (export_keys_start): New.
278 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
279 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
280 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
282 * export.c (gpgme_export_ext_start, gpgme_op_export)
283 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
284 (export_start): Ditto.
285 * engine.c (_gpgme_engine_op_export): Ditto.
286 * engine-backend.h (struct engine_ops): Ditto.
287 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
288 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
290 (gpg_export, gpg_export_ext): Factor common code out to ..
291 (export_common): .. this.
293 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
294 * gpgme.def, libgpgme.vers: Add them.
295 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
296 (_gpgme_op_import_keys_start): New.
297 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
298 * engine-backend.h (struct engine_ops): Ditto.
299 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
300 * engine-gpg.c (gpg_import): Ditto. Implement it.
302 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
304 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
306 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
308 * context.h (struct ctx_op_data): Add member "references".
309 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
310 (_gpgme_release_result): Use gpgme_result_unref.
311 * op-support.c (_gpgme_op_data_lookup): Initialize references.
313 2009-06-12 Werner Koch <wk@g10code.com>
315 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
316 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
317 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
318 (main): Pass flags for my_spawn.
319 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
321 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
322 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
323 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
324 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
325 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
326 * engine-gpg.c (start): Call spawn with new flag.
328 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
329 _gpgme_allow_set_foreground_window. Change all callers.
330 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
332 2009-06-10 Werner Koch <wk@g10code.com>
334 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
336 2009-06-09 Werner Koch <wk@g10code.com>
338 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
340 * version.c (gpgme_check_version_internal): Make result const.
342 * gpgme.c: Include priv-io.h.
343 (gpgme_io_read, gpgme_io_write): New.
344 * libgpgme.vers (GPGME_1.1): Add them.
347 * Makefile.am (main_sources): Remove gpgme.h.
348 (include_HEADERS): Rename to nodist_include_HEADERS so that a
349 VPATH build won't use the distributed one.
351 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
353 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
355 * gpgme.h.in (gpgme_check_version_internal): New prototype.
356 (gpgme_check_version): New macro, overriding function of the same
358 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
359 * context.h (_gpgme_selftest): New variable declaration.
360 * version.c: Include "context.h".
361 (gpgme_check_version): Set _gpgme_selftest on success.
362 (gpgme_check_version_internal): New function.
363 * gpgme.c (_gpgme_selftest): Define it.
364 (gpgme_new): Check the selftest result.
366 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
368 * gpgme.h.in (gpgme_encrypt_flags_t): Add
369 GPGME_ENCRYPT_NO_ENCRYPT_TO.
370 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
371 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
373 2009-05-14 Werner Koch <wk@g10code.com>
375 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
376 better maintainability and to help debugging.
378 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
380 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
382 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
384 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
385 * w32-io.c (_gpgme_io_connect): Fix stupid error.
387 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
389 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
390 (find_channel): Drop CREATE argument.
391 (new_dummy_channel_from_fd, new_channel_from_fd)
392 (new_channel_from_socket): New functions.
393 (_gpgm_io_fd2str): Implement for sockets.
394 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
396 (_gpgme_io_pipe): Fix for new channel bookkeeping.
397 (_gpgme_io_close, _gpgme_io_dup): Likewise.
398 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
399 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
400 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
401 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
402 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
403 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
404 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
406 2009-03-18 Werner Koch <wk@g10code.com>
408 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
409 * engine-gpgsm.c (gpgsm_keylist): Send new option.
411 2009-03-13 Werner Koch <wk@g10code.com>
413 * gpgme-config.in: Make sure locale is set to C.
415 2009-02-24 Werner Koch <wk@g10code.com>
417 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
418 (gpgme_assuan_result_t): New.
419 (gpgme_op_assuan_result): Change return type.
420 (struct _gpgme_assuan_sendfnc_ctx)
421 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
422 (gpgme_assuan_inquire_cb_t): Changed.
423 * opassuan.c (op_data_t): Make use of a result structure.
424 (gpgme_op_assuan_result): Change return type.
425 (opassuan_start): Use result structure.
427 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
428 (inquire_cb_sendfnc): Remove.
429 (inquire_cb): Change for new callback scheme. Not yet finished.
430 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
432 2009-02-04 Werner Koch <wk@g10code.com>
434 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
436 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
438 2009-02-03 Werner Koch <wk@g10code.com>
440 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
442 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
443 * keylist.c (keylist_colon_handler): Factor common code out to ...
444 (parse_sec_field15): New. Set card number.
446 2009-01-26 Werner Koch <wk@g10code.com>
448 * opassuan.c, dirinfo.c, engine-assuan.c: New.
449 * Makefile.am: Add them.
450 * engine-backend.h: Add _gpgme_engine_ops_assuan.
451 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
453 * Makefile.am (gpgsm_components): Add engine-assuan.c.
454 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
455 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
456 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
457 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
458 * gpgme.c (gpgme_get_protocol_name): Ditto.
459 (gpgme_set_protocol): Support it.
460 * engine.c (gpgme_get_engine_info): Ditto.
461 (engine_ops): Register it.
462 (_gpgme_engine_op_assuan_transact): New.
463 * libgpgme.vers (gpgme_op_assuan_transact_start)
464 (gpgme_op_assuan_transact): New.
465 * gpgme.def (gpgme_op_assuan_transact_start)
466 (gpgme_op_assuan_transact): New.
467 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
468 initialize to NULL for all engines.
469 * engine.c (engine_get_home_dir): New.
470 (gpgme_get_engine_info): Use it.
471 (_gpgme_set_engine_info): Use it.
472 * engine.h (engine_assuan_result_cb_t): New.
473 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
475 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
477 * version.c (gpgme_check_version): Protect trace arg against NULL.
479 2009-01-19 Werner Koch <wk@g10code.com>
481 * rungpg.c: Rename to engine-gpg.c
482 * Makefile.am (main_sources): Ditto.
484 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
486 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
488 2008-11-18 Werner Koch <wk@g10code.com>
490 * version.c (do_subsystem_inits): Always initialize I/O
491 subsystem. Fixes regression from 2007-08-02.
493 * decrypt.c (_gpgme_decrypt_status_handler): Use
494 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
496 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
498 * wait-private.c (_gpgme_wait_on_condition): Remove unused
500 * wait-global.c: Include ops.h to silence gcc warning.
501 (_gpgme_wait_global_event_cb): Pass error value directly.
502 * wait-user.c: Include ops.h to silence gcc warning.
504 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
505 silence gcc warning. Cast argument to execv to silence warning.
506 * w32-io.c (_gpgme_io_spawn): Likewise.
507 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
509 2008-10-24 Werner Koch <wk@g10code.com>
511 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
513 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
515 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
516 string to C coded string.
518 2008-10-20 Werner Koch <wk@g10code.com>
520 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
522 * gpgme.h: Rename to gpgme.h.in.
523 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
525 * posix-io.c: Include sys/uio.h. Fixes bug #818.
527 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
529 * w32-util.c (find_program_in_registry): Don't define.
530 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
531 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
532 registry anymore. It is now no longer possible to overwrite the
533 default location in that way.
535 2008-10-17 Werner Koch <wk@g10code.com>
537 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
538 around a bug in mingw32.
540 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
542 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
543 Submitted by "Daniel Mueller" <daniel@danm.de>
545 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
547 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
549 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
551 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
552 * gpgme.c (_gpgme_cancel_with_err): New function.
553 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
554 * wait-private.c (_gpgme_wait_on_condition): Use
555 _gpgme_cancel_with_err.
556 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
557 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
559 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
561 * rungpg.c (command_handler): Remove I/O callback on error, too.
563 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
565 * gpgme.c (gpgme_cancel_async): Remove unused variable.
567 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
569 * libgpgme.vers: Add gpgme_cancel_async.
570 * gpgme.def: Likewise.
572 * context.h: Include "sema.h".
573 (struct gpgme_context): New members lock and canceled.
574 * gpgme.c (gpgme_new): Initialize lock.
575 (gpgme_release): Destroy lock.
576 (gpgme_cancel_async): New function.
577 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
578 * wait-global.c (gpgme_wait): Check cancel flag before processing
580 * wait-private.c (_gpgme_wait_on_condition): Likewise.
581 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
583 2008-06-26 Werner Koch <wk@g10code.com>
585 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
586 (mkstemp): Need to use GetSystemTimeAsFileTime for better
589 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
591 * gpgme-w32spawn.c: New file.
592 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
594 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
595 (gpgsm_set_locale): Return early if locale value is NULL.
596 * util.h (_gpgme_mkstemp)
597 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
599 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
600 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
602 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
603 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
604 special filename FD rather than stdin.
605 (struct arg_and_data_s): Add member ARG_LOCP.
606 (struct fd_data_map_s): Add member ARG_LOC.
607 (struct engine_gpg): Add member ARG_LOC to status and colon.
608 (_add_arg, add_arg_with_locp): New function.
609 (add_arg_ext): Reimplement in terms of _add_arg.
610 (gpg_new): Remember argument location for status FD.
611 (build_argv): Set argument location if requested. Also set
612 argument location of fd_data_map for data items.
613 (start): Adjust caller of _gpgme_io_spawn.
614 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
616 (_gpgme_io_spawn): Remove parent fd list argument.
617 * posix-io.c (get_max_fds): New function.
618 (_gpgme_io_dup): Add tracing.
619 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
620 fd list to contain all child fds that should be inherited. Close
621 all other file descriptors after fork.
622 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
623 parent fd list. Change meaning of child fd list to contain all
624 child fds that should be inherited. Do not inherit any file
625 descriptors, but DuplicateHandle them. Spawn process through
626 wrapper process. Provide wrapper process with a temporary file
627 containing handle translation data. Return translated handle
629 * w32-io.c (reader): Add more tracing output.
630 (_gpgme_io_read): Likewise.
631 * engine-gpgconf.c (gpgconf_read): Adjust caller of
633 * version.c (_gpgme_get_program_version): Likewise.
635 2008-06-20 Werner Koch <wk@g10code.com>
637 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
638 compatibility with old compilers. Fix amount of memmove. Fix
641 2008-06-19 Werner Koch <wk@g10code.com>
643 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
644 change all callers and provide compatibilty macro.
645 (gpgme_conf_type_t): Add complex types 34..37.
646 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
647 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
649 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
651 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
653 2008-05-09 Werner Koch <wk@g10code.com>
655 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
658 2008-05-07 Werner Koch <wk@g10code.com>
660 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
661 self-explaining string. Needs a proper fix, though.
663 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
665 (gpg_build_keylist_options): .. new. Allow combination of extern
667 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
669 2008-05-06 Werner Koch <wk@g10code.com>
671 * version.c (extract_version_string): New.
672 (_gpgme_get_program_version): Use it to allow for suffixes in the
675 2008-04-28 Werner Koch <wk@g10code.com>
677 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
680 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
682 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
683 Osterfeld, implement blocking select.
685 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
687 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
689 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
691 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
692 Reported by Marc Mutz.
694 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
696 * decrypt.c (release_op_data): Release OPD->result.recipients.
697 * encrypt.c (release_op_data): Release invalid_recipient.
699 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
701 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
703 2008-02-14 Werner Koch <wk@g10code.com>
705 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
706 * posix-io.c (_gpgme_io_spawn): Ditto.
707 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
708 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
709 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
710 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
712 * w32-util.c (_gpgme_allow_set_foregound_window): New.
713 * posix-util.c (_gpgme_allow_set_foregound_window): New.
714 * engine-gpgsm.c (default_inq_cb): New.
715 (gpgsm_new) [W32]: Enable pinentry notifications.
716 (status_handler): Handle inquiries.
718 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
720 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
723 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
725 * engine-gpgsm.c (map_input_enc): Rename to ...
726 (map_data_enc): ... this. Also change all callers.
727 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
728 (gpgsm_sign): Set encoding for output.
730 2008-01-28 Werner Koch <wk@g10code.com>
732 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
734 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
736 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
739 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
741 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
743 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
746 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
748 * Makefile.am (gpgconf_components): New variable.
749 (main_sources): Add gpgconf.c.
750 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
751 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
752 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
753 (gpgme_conf_arg_release, gpgme_conf_opt_change)
754 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
756 * gpgconf.c, engine-gpgconf.c: New files.
757 * engine.h: (_gpgme_engine_op_conf_load,
758 (_gpgme_engine_op_conf_save): New prototypes.
759 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
761 * posix-util.c (_gpgme_get_gpgconf_path): New function.
762 * w32-util.c (_gpgme_get_gpgconf_path): New function.
764 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
766 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
767 * gpgme.def: Add new gpgconf related interfaces.
768 * libgpgme.vers: Likewise.
769 * util.h (_gpgme_get_gpgconf_path): New prototype.
770 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
771 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
772 (struct engine_ops): Add members for conf_load and conf_save.
773 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
774 (_gpgme_engine_op_conf_load,
775 (_gpgme_engine_op_conf_save): New functions.
776 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
778 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
780 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
781 for installation directory. Remove old fallback default.
782 (find_program_in_inst_dir): New function.
784 2007-11-26 Werner Koch <wk@g10code.com>
786 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
787 always reset it before calling start.
788 (gpgsm_new): Clear it.
789 (status_handler): Implement it.
790 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
792 2007-11-23 Werner Koch <wk@g10code.com>
794 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
795 * getauditlog.c (getauditlog_start): Use that flag.
797 2007-11-22 Werner Koch <wk@g10code.com>
799 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
800 * libgpgme.vers: Ditto.
802 * getauditlog.c: New.
803 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
804 * engine-gpgsm.c (gpgsm_getauditlog): New.
805 (_gpgme_engine_ops_gpgsm): Insert new function.
806 (gpgsm_new): Try to enable audit log support.
807 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
809 2007-11-20 Werner Koch <wk@g10code.com>
811 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
813 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
815 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
817 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
819 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
821 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
823 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
826 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
828 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
831 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
833 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
834 w32-qt-io.cpp: New versions from Frank Osterfeld.
836 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
838 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
839 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
840 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
841 Submitted by Frank Osterfeld.
843 * priv-io.h, engine-gpgsm.c: Add comments.
844 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
845 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
847 (_gpgme_io_dup): Acquire a reference. Replace unused
848 implementation by assertion.
850 2007-09-28 Werner Koch <wk@g10code.com>
852 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
854 (gpgsm_set_fd): Use it.
856 * w32-glib-io.c (find_channel): Add a new primary flag.
857 (_gpgme_io_close): Close channel only if primary.
858 (_gpgme_io_dup): Put newfd into the table as shallow copy.
860 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
861 * w32-io.c (_gpgme_io_select): Ditto.
862 * w32-glib-io.c (_gpgme_io_select): Ditto.
864 * posix-io.c (_gpgme_io_select): Ditto.
865 * rungpg.c (read_status): Ditto.
866 * wait.c (fd_table_put): Ditto.
868 * rungpg.c (gpg_io_event): Add tracing.
869 (start): Use gpg_io_event for sending the start event.
870 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
871 (start): Use gpgsm_io_event for sending the start event.
872 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
874 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
876 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
877 versions from Frank Osterfeld.
879 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
881 * w32-glib-io.c (_gpgme_io_spawn),
882 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
883 the process handle, return 0.
885 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
886 * gpgme.c (gpgme_get_protocol_name): Implement support for
887 GPGME_PROTOCOL_UNKNOWN.
889 * kdpipeiodevice.h: Fix last change.
891 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
892 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
895 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
897 * conversion.c, keylist.c: Include <sys/types.h>.
899 * kdpipeiodevice.h: Use namespace _gpgme_.
900 * kdpipeiodevice.cpp: Use namespace _gpgme_.
901 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
902 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
903 _gpgme_::KDPipeIODevice.
905 2007-09-17 Werner Koch <wk@g10code.com>
907 * rungpg.c (gpg_new): Make robust against undefined ttyname or
910 2007-09-14 Werner Koch <wk@g10code.com>
912 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
914 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
916 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
918 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
920 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
923 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
925 * Makefile.am (libgpgme_qt_la_SOURCES): Move
926 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
927 another file (it's more like a header file than a cpp file, but
928 automake doesn't know that).
930 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
931 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
932 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
934 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
935 kdpipeiodevice.moc, w32-qt-io.c: New files.
936 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
937 (ltlib_gpgme_qt): New variable.
938 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
939 (libgpgme_qt_la_SOURCES): New variable.
940 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
941 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
942 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
943 (libgpgme_qt_la_LIBADD): New variables.
945 * sema.h (struct critsect_s): Rename "private" to "priv" to make
946 C++ users happy. Change users.
947 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
948 (_gpgme_sema_cs_destroy): Likewise.
949 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
950 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
951 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
953 (gpgme_get_fdptr): New function.
954 * w32-io.c (gpgme_get_fdptr): New function
955 * gpgme.def: Add gpgme_get_fdptr.
957 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
959 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
960 (writer): Remove superfluous check.
962 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
964 * gpgme.h: Move include of gpg-error.h out of extern "C".
966 2007-08-07 Werner Koch <wk@g10code.com>
968 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
969 * verify.c (parse_trust): Set Chain_MODEL.
971 2007-08-02 Werner Koch <wk@g10code.com>
973 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
974 * w32-io.c (_gpgme_io_spawn): Ditto.
975 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
976 * debug.c (_gpgme_debug): Enable assuan logging.
977 (_gpgme_debug_subsystem_init): New.
978 * version.c (do_subsystem_inits): Disable assuan logging and
979 initialize the debug system.
980 (gpgme_check_version): Do not trace before the subsystems are
983 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
985 * debug.c: Include <errno.h> and "debug.h".
986 (_gpgme_debug): Save and restore ERRNO.
988 (_gpgme_debug_buffer): New function.
989 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
990 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
991 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
992 most of these files, add many more tracepoints.
994 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
996 * engine-gpgsm.c (status_handler): Do not send BYE here.
998 * w32-io.c (struct reader_context_s, struct writer_context_s): New
1000 (create_reader, create_writer): Initialize C->refcount to 1.
1001 (destroy_reader, destroy_writer): Only destroy if C->refcount
1003 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1004 * priv-io.h (_gpgme_io_dup): New prototype.
1005 * posix-io.c (_gpgme_io_dup): New function.
1006 * w32-io.c (_gpgme_io_dup): Likewise.
1007 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1008 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1010 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
1012 * data-user.c (user_read, user_write, user_seek): Set errno and
1013 return -1 instead returning the error code directly.
1014 * data-compat.c (old_user_seek): Likewise.
1015 * gpgme.c (gpgme_sig_notation_add): Return error properly.
1017 * Revert the "close_notify_handler" returns int stuff. Always
1018 close in the _gpgme_io_close implementations.
1019 * engine-gpgsm.c (status_handler): Try to terminate the connection
1021 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1022 (_gpgme_io_write): Likewise.
1024 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1025 to _gpgme_close_notify_handler.
1026 (_gpgme_close_notify_handler): New type.
1027 (_gpgme_io_dup): Remove prototype.
1028 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1029 type of HANDLER to _gpgme_close_notify_handler_t.
1030 (_gpgme_io_close): Do not close the FD if handler returns 0.
1031 (_gpgme_io_dup): Remove function.
1032 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1033 _gpgme_io_close): Change type of HANDLER to
1034 _gpgme_close_notify_handler_t.
1035 (_gpgme_io_close): Do not close the FD if handler returns 0.
1036 (_gpgme_io_dup): Remove function.
1037 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1038 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1039 to _gpgme_close_notify_handler_t.
1040 (_gpgme_io_close): Do not close the FD if handler returns 0.
1041 * rungpg.c (close_notify_handler): Change return type to int,
1043 * engine-gpgsm.c (close_notify_handler): Change return type to
1044 int, return 0 for status FD and 1 for all other FDs.
1045 (start): Do not duplicate the status FD.
1047 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1049 * Makefile.am: Replace implicite rule by suffix rule. Add
1052 2007-07-12 Werner Koch <wk@g10code.com>
1054 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1055 system has been started.
1057 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1059 * priv-io.h (_gpgme_io_dup): New prototype.
1060 * posix-io.c (_gpgme_io_dup): New function.
1061 * w32-io.c (_gpgme_io_dup): Likewise.
1062 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1063 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1065 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1067 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1068 * funopen.c (funopen): Rename to _gpgme_funopen.
1070 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1072 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1073 * rungpg.c (gpg_new): Likewise.
1074 Submitted by Stephen Tether.
1076 2007-02-26 Werner Koch <wk@g10code.com>
1078 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1079 (_gpgme_verify_status_handler): Return an error if more than one
1080 plaintext has been seen.
1081 (parse_error): New arg SET_STATUS. Also detect it based on an
1082 ERROR status (gpg > 1.4.6).
1084 2007-01-26 Werner Koch <wk@g10code.com>
1086 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1087 * w32-glib-io.c (build_commandline): Ditto.
1089 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1091 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1093 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1095 * data.h (_gpgme_data_get_fd): Add prototype.
1096 (gpgme_data_get_fd_cb): New type.
1097 (struct _gpgme_data_cbs): New member get_fd.
1098 * data.c (_gpgme_data_get_fd): New function.
1099 * data-fd.c (fd_get_fd): New function.
1100 (fd_cbs): Add fd_get_fd.
1101 * data-stream.c (stream_get_fd): New function.
1102 (stream_cbs): Add stream_get_fd.
1103 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1104 * data-user.c (user_cbs): Likewise.
1105 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1106 short-cut by passing the data descriptor directly.
1108 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1110 * w32-io.c (build_commandline): Quote all command line arguments.
1111 * w32-glib-io.c (build_commandline): Likewise.
1113 2007-01-10 Werner Koch <wk@g10code.com>
1115 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1117 2007-01-08 Werner Koch <wk@g10code.com>
1119 * version.c (do_subsystem_inits): Do assuan init only if building
1121 * setenv.c: Include assuan-def.h only if building with Assuan
1124 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1126 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1127 * rungpg.c (gpg_set_locale): Ditto.
1129 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1131 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1132 switching protocols.
1133 (gpgme_ctx_set_engine_info): Likewise for engine info.
1134 * engine.h (_gpgme_engine_reset): New function prototype.
1135 * engine.c (_gpgme_engine_reset): New function.
1136 * engine-backend.h (struct engine_ops): New member RESET.
1137 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1138 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1139 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1140 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1142 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1143 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1144 function if available.
1145 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1147 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1149 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1150 lc_messages from prototype.
1151 (_gpgme_engine_set_locale): New prototype.
1152 * engine.c (_gpgme_engine_set_locale): New function.
1153 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1154 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1155 Remove arguments lc_messages and lc_ctype from member NEW.
1156 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1157 and lc_messages_set.
1158 (gpgsm_new): Remove lc_messages and lc_ctype
1160 (gpgsm_set_locale): New function.
1161 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1162 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1164 (gpg_release): Release lc_messages and lc_ctype if set.
1165 (gpg_new): Remove lc_messages and lc_ctype arguments.
1166 (gpg_set_locale): New function.
1167 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1168 (add_arg): Implement in terms of:
1169 (add_arg_ext): New function.
1170 (start): Set lc-messages and lc-ctype arguments here.
1172 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1174 * engine-gpgsm.c (struct engine_gpgsm): Move members
1175 input_fd_server, output_fd_server, message_fd_server to ...
1176 (iocb_data): ... here (as server_fd).
1177 (close_notify_handler): Reset tags as well.
1178 (gpgsm_new): Implement support for descriptor
1180 (fd_type_t): New type.
1181 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1182 for unused communication channels.
1183 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1184 relevant callers adjusted as well (previously of _gpgme_io_close).
1186 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1188 * version.c: Include "assuan.h".
1189 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1191 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1193 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1194 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1195 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1197 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1198 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1199 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1200 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1202 (noinst_LTLIBRARIES): Removed.
1203 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1204 (AM_CFLAGS): New variable.
1206 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1208 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1209 ASSUAN_CONTEXT with assuan_context_t.
1211 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1213 * engine-gpgsm.c (gpgsm_new): Check return value of
1214 assuan_pipe_connect.
1216 * rungpg.c: Include <unistd.h>.
1217 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1218 --lc-messages. Fixes issue 734.
1220 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1222 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1225 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1227 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1228 _gpgme_engine_io_event().
1230 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1232 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1234 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1237 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1239 * keylist.c (keylist_colon_handler): Move debug output after
1242 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1244 * gpgme-config.in (Options): Add NETLIBS.
1245 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1246 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1248 * rungpg.c (read_status): Fix comparison disguising as an
1251 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1253 * gpgme.c (gpgme_set_locale): Remove conditional on
1254 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1256 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1258 * rungpg.c (read_status): Strip potential carriage return.
1259 * genkey.c (get_key_parameter): Skip potential carriage return.
1260 * version.c (_gpgme_get_program_version): Strip potential carriage
1263 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1266 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1268 * keylist.c (gpgme_get_key): Also clone the engine info.
1270 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1272 * gpgme-config.in (cflags_pth): Revert accidential removal of
1273 pthread support with last change.
1275 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1277 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1278 (_gpgme_io_pipe): Open pipes in binary mode.
1280 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1282 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1283 checking the version correctly even after changing the engine
1284 information. Bug reported by Stéphane Corthésy.
1286 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1288 (colon_preprocessor_t): New type.
1289 (struct engine_gpg): New member colon.preprocess_fnc.
1290 (gpg_keylist_preprocess): New function.
1291 * keylist.c (keylist_colon_handler): Allow short key IDs.
1293 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1295 * w32-io.c (create_writer): Make C->have_data a manually resetted
1297 (writer): Move code from end of if block to beginning, so it
1298 is also run the first time.
1299 (_gpgme_io_write): Move assert check after error check. Reset
1300 the is_empty event, and also do it eagerly.
1301 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1303 2006-01-26 Werner Koch <wk@g10code.com>
1305 * w32-util.c (_gpgme_get_conf_int): New.
1306 * posix-util.c (_gpgme_get_conf_int): New.
1307 * w32-io.c (get_desired_thread_priority): New.
1308 (create_reader, create_writer): Use it here.
1310 2006-01-04 Werner Koch <wk@g10code.com>
1312 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1314 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1315 statements. Disable error return for failed nonblocking call.
1317 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1319 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1322 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1324 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1325 (_gpgme_io_select): Fix debug output.
1327 2005-12-23 Werner Koch <wk@g10code.com>
1329 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1330 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1333 2005-12-20 Werner Koch <wk@g10code.com>
1335 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1336 and GPGME_STATUS_PKA_TRUST_GOOD.
1337 (struct _gpgme_signature): New field pka_trust.
1338 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1340 2005-12-06 Werner Koch <wk@g10code.com>
1342 * keylist.c (keylist_colon_handler): Store fingerprints of the
1343 subkeys. Reset the secret flag of subkeys for stub secret keys.
1344 (NR_FIELDS): Bumped up to 16
1346 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1348 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1349 engine_get_version invocation. Reported by Stéphane Corthésy.
1351 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1353 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1355 2005-11-18 Werner Koch <wk@g10code.com>
1357 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1359 (find_channel): Better use g_io_channel_win32_new_fd instead of
1360 the autodetection function g_io_channel_unix_new.
1361 (_gpgme_io_select): Rewritten. It is now a fully working select
1364 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1366 * priv-io.h (_gpgme_io_fd2str): New prototype.
1367 * posix-io.c (_gpgme_io_fd2str): New function.
1368 * w32-io.c (_gpgme_io_fd2str): New function.
1369 * rungpg.c: Use this new function.
1370 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1371 again. Two's company, three's the musketeers.
1373 * w32-glib-io.c: Rewrote the file handle code. We don't create
1374 system fds for every handle (doesn't work for inherited handles),
1375 but we create pseudo fds in a private namespace that designate a
1376 handle and potentially a giochannel.
1378 2005-11-18 Werner Koch <wk@g10code.com>
1380 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1382 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1384 * w32-glib-io.c: New file.
1385 * gpgme.def (gpgme_get_giochannel): Add symbol.
1386 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1388 (ltlib_gpgme_extra): New variable.
1389 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1390 (system_components_not_extra): New variable.
1391 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1392 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1393 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1394 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1395 [BUILD_W32_GLIB]: New variables.
1396 * gpgme-config.in (glib): New option.
1397 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1399 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1401 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1402 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1403 * posix-io.c (_gpgme_io_kill): Removed.
1404 (_gpgme_io_waitpid): Declare static.
1406 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1408 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1410 2005-10-21 Werner Koch <wk@g10code.com>
1412 * Makefile.am: Fixed cut+paste problem
1414 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1416 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1419 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1421 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1424 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1426 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1429 * gpgme.h (gpgme_free): New prototype.
1430 * data-mem.c (gpgme_free): New function.
1431 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1432 * gpgme.def: Add gpgme_free.
1434 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1436 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1438 * verify.c (parse_notation): Likewise for invocation.
1439 * conversion.c (_gpgme_decode_percent_string): Likewise to
1440 declaration. If set, do not replace '\0' characters with a
1442 * gpgme.h (struct _gpgme_key_sig): New field notations.
1443 * ops.h (_gpgme_parse_notation): New prototype.
1444 * sig-notation.c (_gpgme_parse_notation): New function.
1445 * key.c (gpgme_key_unref): Free all signature notations.
1446 * keylist.c (op_data_t): New member tmp_keysig.
1447 (finish_key): Clear OPD->tmp_keysig.
1448 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1449 * rungpg.c (gpg_keylist): Support listing signature notations.
1450 (gpg_keylist_ext): Likewise.
1452 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1454 * engine.h (_gpgme_set_engine_info): Add prototype.
1455 * engine-backend.h (struct engine_ops): Change return type of
1456 get_file_name() to const char * to silence gcc warning.
1457 * engine.c (engine_get_file_name): Change return type to const
1458 char * to silence gcc warning.
1459 (gpgme_get_engine_info): Use transitional variable to go from
1460 const char * to char * to silence gcc warning.
1461 (_gpgme_set_engine_info): Likewise.
1462 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1463 char * to silence gcc warning.
1464 (gpgsm_new): Make ARGV a pointer to const char.
1465 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1466 to char * to silence gcc warning.
1468 * gpgme.def: Add gpgme_data_set_file_name,
1469 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1470 gpgme_sig_notation_add and gpgme_sig_notation_get.
1471 * libgpgme.vers: Add gpgme_sig_notation_clear,
1472 gpgme_sig_notation_add and gpgme_sig_notation_get.
1473 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1474 * context.h (struct gpgme_context): New field sig_notations.
1475 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1477 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1478 (gpgme_sig_notation_flags_t): New type.
1479 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1480 gpgme_sig_notation_get): New prototypes.
1481 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1483 * sig-notation.c (_gpgme_sig_notation_free): New file.
1484 * verify.c (parse_notation): Use support functions.
1485 (release_op_data): Likewise.
1486 * rungpg.c (append_args_from_sig_notations): New function.
1487 (gpg_encrypt_sign, gpg_sign): Call it.
1489 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1491 * data.h (struct gpgme_data): New member file_name.
1492 * data.c (gpgme_data_set_filename): New function.
1493 (_gpgme_data_release): Free DH->filename if necessary.
1494 (gpgme_data_get_filename): New function.
1495 * rungpg.c (gpg_encrypt): Set filename option.
1496 (gpg_encrypt_sign): Likewise.
1497 (gpg_sign): Likewise.
1498 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1499 gpgme_data_get_file_name.
1501 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1504 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1506 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1507 (struct _gpgme_subkey): Likewise.
1508 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1511 2005-09-23 Werner Koch <wk@g10code.com>
1513 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1515 (create_reader, create_writer): Set thread priority higher.
1517 2005-09-19 Werner Koch <wk@g10code.com>
1519 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1520 the size of the pipe buffer.
1522 2005-09-13 Werner Koch <wk@g10code.com>
1524 * ath.c: Changes to make it work under W32.
1526 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1528 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1529 (ath_pth_src, ath_pthread_src): Removed.
1530 (w32_o_files): Replace ath-compat.o with ath.o.
1531 (libgpgme_pth_la_CFLAGS): New variable.
1532 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1533 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1534 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1535 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1536 (_ATH_COMPAT): Macro removed.
1537 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1540 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1542 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1544 2005-09-07 Werner Koch <wk@g10code.com>
1546 * w32-io.c (build_commandline): Quote argv[0].
1548 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1550 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1552 * edit.c (command_handler): Do not depend on PROCESSED being
1555 * engine.h (engine_command_handler_t): Add new argument processed.
1556 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1558 (_gpgme_passphrase_command_handler): ... this one.
1559 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1561 (_gpgme_passphrase_command_handler): ... this one.
1562 * edit.c (command_handler): Add new argument processed. Remove
1563 local variable with the same name. Always return processed as
1565 * rungpg.c (command_handler): Send a newline character if the
1568 2005-08-26 Werner Koch <wk@g10code.com>
1570 * w32-util.c (read_w32_registry_string): Updated from code used by
1571 GnuPG. This allows for expanding strings and features the
1572 implicit fallback key.
1573 (w32_shgetfolderpath, find_program_at_standard_place): New.
1574 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1575 entry, locate the programs at the standard place.
1576 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1577 we are accustomed to.
1579 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1580 semicolon is used which allows us to create files with drive
1583 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1586 2005-08-19 Werner Koch <wk@g10code.com>
1589 * versioninfo.rc.in: New.
1590 * Makefile.am: Addes support for building a W32 DLL.
1592 * ttyname_r.c (ttyname_r) [W32]: Return error.
1593 * ath-compat.c [W32]: select and co are not yet supported; return
1595 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1597 2005-08-08 Werner Koch <wk@g10code.com>
1599 * util.h (stpcpy): Renamed to ..
1600 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1601 definitions when linking statically.
1602 * stpcpy.c: Removed.
1604 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1606 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1607 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1608 (struct _gpgme_op_verify_result): Likewise.
1609 * ops.h (_gpgme_parse_plaintext): Add prototype.
1610 * op-support.c (_gpgme_parse_plaintext): New function.
1611 * decrypt.c (release_op_data): Release
1612 OPD->result.plaintext_filename.
1613 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1614 * verify.c (release_op_data): Release
1615 OPD->result.plaintext_filename.
1616 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1618 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1620 * keylist.c (gpgme_get_key): Allow key IDs.
1622 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1624 * gpgme.m4: Only call GPGME_CONFIG if found.
1626 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1628 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1630 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1631 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1633 (_gpgme_decrypt_status_handler): Fix last change.
1635 * gpgme.h (struct _gpgme_recipient): New structure.
1636 (gpgme_recipient_t): New type.
1637 (struct _gpgme_op_decrypt_result): Add member recipients.
1638 * decrypt.c (op_data_t): New member last_recipient_p.
1639 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1640 (parse_enc_to): New function.
1641 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1644 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1646 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1648 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1650 * wait.h (_gpgme_run_io_cb): New prototype.
1651 * wait.c (_gpgme_run_io_cb): New function.
1652 * wait-global.c (gpgme_wait): Call it.
1653 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1654 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1656 2005-06-02 Werner Koch <wk@g10code.com>
1658 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1659 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1660 (_gpgme_passphrase_command_handler_internal): Also act on the key
1661 "passphrase.pin.ask".
1663 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1664 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1665 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1666 GPGME_STATUS_BACKUP_KEY_CREATED.
1668 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1670 * data-user.c: Include <errno.h>.
1672 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1674 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1677 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1679 * w32-io.c (_gpgme_io_select): Fix loop increment.
1681 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1683 * data-user.c (user_release): Only call user hook if provided.
1684 (user_seek): Return EBADF if no user hook is provided.
1685 (user_read): Likewise.
1686 (user_write): Likewise.
1688 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1690 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1691 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1692 the reset, just for cleanliness, and do not sent it at all if the
1693 default is requested.
1694 * gpgme.c (gpgme_set_include_certs): Allow to use
1695 GPGME_INCLUDE_CERTS_DEFAULT.
1697 2005-04-21 Werner Koch <wk@g10code.com>
1699 * verify.c (calc_sig_summary): Set the key revoked bit.
1701 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1703 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1704 in the list, not the user-provided CTX.
1705 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1707 * wait-global.c (gpgme_wait): If no context is found, and we
1708 should not hang, set *status to 0 and return NULL.
1709 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1711 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1713 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1714 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1715 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1716 ENOSYS instead EOPNOTSUPP.
1717 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1718 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1721 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1723 * io.h: Rename to ...
1724 * priv-io.h: ... this.
1725 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1726 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1727 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1728 Change all includes of "io.h" to "priv-io.h"
1730 2005-03-09 Werner Koch <wk@g10code.com>
1732 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1733 cast away type checks.
1735 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1738 * data.h [W32]: Removed kludge for EOPNOTSUP.
1739 * data.c, data-compat.c [W32]: Explicitly test for it here.
1741 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1744 2005-03-07 Timo Schulz <twoaday@g10code.de>
1746 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1747 * ath.h: [_WIN32] Added some (dummy) types.
1748 * io.h: [_WIN32] include stdio.h.
1749 * data.h: [_WIN32] Define EOPNOTSUPP.
1750 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1751 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1753 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1755 * engine.c (_gpgme_set_engine_info): Fix assertion.
1757 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1759 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1761 * ttyname_r.c: New file.
1763 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1765 * putc_unlocked.c, funopen.c: I just claim copyright on these
1766 files and change their license to LGPL, because they are totally
1767 trivial wrapper functions.
1768 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1769 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1770 defined as a macro doing exactly the same as the function in this
1772 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1773 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1774 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1775 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1776 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1777 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1778 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1779 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1780 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1781 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1782 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1783 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1784 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1785 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1788 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1790 * libgpgme.vers (GPGME_1.1): New version.
1791 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1792 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1793 member new(). Change return type of get_file_name and get_version
1795 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1796 pointer. Do not cache result.
1797 (gpgsm_new): Add file_name and home_dir argument, and use them
1798 instead of the defaults, if set.
1799 * rungpg.c (struct engine_gpg): New member file_name.
1800 (gpg_get_version): Change return type to char pointer, and do not
1802 (gpg_release): Free gpg->file_name.
1803 (gpg_new): Take new arguments file_name and home_dir. Set the
1804 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1805 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1806 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1808 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1810 * engine.c: Include <assert.h>.
1811 (gpgme_get_engine_info): Set *INFO within the lock. Move
1812 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1813 (engine_info, engine_info_lock): ... here. New static variables.
1814 (engine_get_version): Add file_name argument to
1815 get_version invocation. Change return type to char pointer.
1816 (gpgme_engine_check_version): Rewritten to free() the return value
1817 of engine_get_version after using it.
1818 (_gpgme_engine_info_release): New function.
1819 (gpgme_get_engine_info): Rewritten.
1820 (_gpgme_engine_info_copy): New function.
1821 (_gpgme_set_engine_info): New function.
1822 (gpgme_set_engine_info): New function.
1823 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1825 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1826 and version to char * (remove the const). New member home_dir.
1827 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1828 gpgme_ctx_set_engine_info): New prototypes.
1829 * context.h (struct gpgme_context): New member engine_info.
1830 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1831 (gpgme_release): Deallocate CTX->engine_info.
1832 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1834 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1835 pass it to _gpgme_engine_new.
1836 * version.c (gpgme_check_version): Adjust to
1837 _gpgme_compare_versions returning an int.
1838 (_gpgme_compare_versions): Return an int value, not a const char
1840 * ops.h (_gpgme_compare_versions): Same for prototype.
1842 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1844 * verify.c (parse_trust): If no reason is provided, set
1845 SIG->validity_reason to 0.
1846 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1848 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1850 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1851 (start): Call map_assuan_error on return value of
1854 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1856 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1859 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1861 * gpgme.m4: Implement the --api-version check.
1863 * rungpg.c (read_status): Move the polling of the output data pipe
1864 to just before removing the command fd, from just before adding
1865 it. This avoids buffering problems.
1867 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1868 read, to improve debug output.
1870 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1872 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1873 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1874 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1875 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1877 (gpgme_keylist_mode_t): Define as unsigned int.
1878 (gpgme_key_t): Change type of keylist_mode to
1879 gpgme_keylist_mode_t.
1881 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1883 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1886 * data-stream.c (stream_seek): Call ftello and return the current
1888 * data.h (struct gpgme_data): Change type of data.mem.offset to
1890 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1891 callback. If SEEK_CUR, adjust the offset by the pending buffer
1892 size. Clear pending buffer on success.
1895 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1897 * gpgme.m4: Add copyright notice.
1899 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1901 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1904 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1906 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1908 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1910 * key.c (_gpgme_key_append_name): Make sure tail points to the
1911 byte following the uid.
1912 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1915 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1917 * libgpgme.vers: Remove C-style comment, which is not supported by
1920 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1922 * gpgme-config.in (Options): Support --api-version.
1924 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1926 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1927 * verify.c (parse_error): Likewise.
1929 * verify.c (parse_error): Do not skip location of where token.
1931 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1932 * verify.c (_gpgme_verify_status_handler): Add handling of
1933 GPGME_STATUS_REVKEYSIG.
1934 (parse_trust): Likewise.
1936 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1938 * gpgme.h (struct _gpgme_decrypt_result): New fields
1939 wrong_key_usage and _unused.
1940 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1941 character after a matched string, as in a protocol error this
1942 could skip over the trailing binary zero.
1943 Handle decrypt.keyusage error notifications.
1945 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1946 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1948 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1950 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1951 to unsigned int. Same for member _unused.
1953 * keylist.c (set_mainkey_trust_info): Rewritten.
1954 (set_subkey_capability): Handle 'd' (disabled).
1955 (set_mainkey_capability): Rewritten.
1957 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1959 * gpgme.m4: Quote first argument to AC_DEFUN.
1961 2004-04-21 Werner Koch <wk@gnupg.org>
1963 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1964 The rule of least surprise.
1966 2004-04-15 Werner Koch <wk@gnupg.org>
1968 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1969 unused result.signatures items.
1971 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1973 2004-04-08 Werner Koch <wk@gnupg.org>
1975 * verify.c (_gpgme_verify_status_handler): Ignore the error status
1976 if we can't process it.
1977 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
1978 yesterday's hack. It is not any longer required.
1980 2004-04-07 Werner Koch <wk@gnupg.org>
1982 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
1983 with meaningless error codes from the verify status function.
1985 2004-04-05 Werner Koch <wk@gnupg.org>
1987 * gpgme.h: Add GPGME_STATUS_NEWSIG.
1989 * verify.c (parse_error): Compare only the last part of the where
1991 (prepare_new_sig): New.
1992 (parse_new_sig): Use prepare_new_sig when required.
1993 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
1995 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
1996 option. Fixed pattern construction.
1997 (status_handler): Add debugging output.
1999 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
2001 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2002 isatty(). Submitted by Bernhard Herzog.
2004 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
2006 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2009 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2011 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2012 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
2014 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
2016 * gpgme-config.in: Do not emit include and lib directory for
2017 prefix "/usr" or "".
2019 2004-03-03 Werner Koch <wk@gnupg.org>
2021 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2024 2004-02-18 Werner Koch <wk@gnupg.org>
2026 * gpgme-config.in: Ignore setting of --prefix.
2028 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
2030 * rungpg.c (gpg_cancel): New function.
2031 (gpg_release): Call it here.
2032 (_gpgme_engine_ops_gpg): Add it here.
2033 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2035 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2037 * gpgme.c (gpgme_cancel): New function.
2038 * engine-backend.h (struct engine_ops): New member cancel.
2039 * engine.h (_gpgme_engine_cancel): New prototype.
2040 * engine.c (_gpgme_engine_cancel): New function.
2041 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2042 (gpgsm_cancel): New function.
2043 (gpgsm_release): Use it.
2044 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2046 2004-02-17 Werner Koch <wk@gnupg.org>
2048 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2049 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2051 2004-02-15 Werner Koch <wk@gnupg.org>
2053 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2054 by Adriaan de Groot.
2056 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2058 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2060 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2062 * data-stream.c (stream_seek): Likewise.
2064 2004-01-16 Werner Koch <wk@gnupg.org>
2066 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2069 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2071 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2073 2004-01-12 Werner Koch <wk@gnupg.org>
2075 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2077 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2079 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2080 (struct _gpgme_key_sig): For C++ compilers, rename class
2081 member to _obsolete_class. Add new member sig_class.
2082 (struct _gpgme_new_signature): Same here.
2083 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2085 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2086 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2087 * sign.c (parse_sig_created): Set SIG->sig_class.
2089 2003-12-22 Werner Koch <wk@gnupg.org>
2091 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2094 2003-11-19 Werner Koch <wk@gnupg.org>
2096 * conversion.c (_gpgme_parse_timestamp): New.
2097 (atoi_1, atoi_2, atoi_4): New.
2098 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2100 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2101 * sign.c (parse_sig_created): Ditto.
2103 2003-10-31 Werner Koch <wk@gnupg.org>
2105 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2108 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2110 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2111 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2113 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2115 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2118 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2121 * io.h (_gpgme_io_subsystem_init): New prototype.
2122 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2123 (_gpgme_io_spawn): Do not fixup signal handler here.
2124 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2126 * debug.c (debug_init): Drop const qualifier from E.
2128 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2130 (ath_connect): Make ADDR argument const.
2131 * ath-pthread.c (ath_connect): Likewise.
2132 * ath-pth.c (ath_connect): Likewise.
2133 * ath-compat.c (ath_connect): Likewise.
2134 * ath.c (ath_connect): Likewise.
2136 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2137 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2139 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2141 * util.h (_gpgme_hextobyte): Likewise for prototype.
2143 * gpgme.h: Remove trailing comma in enum.
2145 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2146 <signal.h>, <fcntl.h>, or "unistd.h".
2148 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2150 * engine-backend.h (struct engine_ops): Add argument TYPE.
2151 * engine.c (_gpgme_engine_op_edit): Likewise.
2152 * engine.h: Likewise.
2153 * rungpg.c (gpg_edit): Likewise. Use it.
2154 * edit.c (edit_start): Likewise. Pass it on.
2155 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2156 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2158 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2160 * gpgme.h (gpg_strerror_r): Change prototype to match
2161 gpg_strerror_r change.
2162 * error.c (gpg_strerror_r): Likewise, also update implementation.
2164 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2165 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2166 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2168 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2170 * gpgme.h: Add prototype for gpgme_set_locale.
2172 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2173 characteristics and use that instead __inline__.
2175 * context.h (struct gpgme_context): New members lc_ctype and
2177 * gpgme.c: Include <locale.h>.
2178 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2180 (gpgme_set_locale): New function.
2181 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2183 * engine.h (_gpgme_engine_new): Likewise.
2184 * engine-gpgsm.c (gpgsm_new): Likewise.
2185 * rungpg.c (gpg_new): Likewise.
2186 * engine-backend.h (struct engine_ops): Likewise to NEW.
2187 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2190 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2192 * gpgme.h (gpgme_strerror_r): New prototype.
2193 * error.c (gpgme_strerror_r): New function.
2195 * get-env.c: New file.
2196 * util.h (_gpgme_getenv): Add prototype.
2197 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2198 * rungpg.c (build_argv): Use _gpgme_getenv.
2199 * debug.c (debug_init): Likewise.
2200 * engine-gpgsm.c (gpgsm_new): Likewise.
2201 (gpgsm_new): Use ttyname_r.
2202 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2204 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2206 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2209 * gpgme-config.in: Rewritten.
2210 * gpgme.m4: Rewritten.
2212 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2214 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2215 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2216 updated to have better thread support, and the Makefile.am was
2217 changed to reflect that.
2219 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2220 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2221 value of status_fnc.
2222 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2224 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2226 * rungpg.c (start): Use saved_errno instead errno.
2228 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2230 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2231 * fopencookie.c: File removed.
2233 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2235 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2237 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2239 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2240 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2241 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2242 backward compatibility.
2244 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2246 * verify.c (parse_new_sig): Fix status parsing case.
2248 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2250 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2251 Lower _UNUSED to 23 bits.
2252 (struct _gpgme_key): Likewise.
2253 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2254 (set_subkey_capability): Support 'a'.
2256 * keylist.c (gpgme_get_key): Check if there is more than one key
2257 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2259 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2261 (_gpgme_decode_percent_string): Likewise.
2262 * conversion.c (_gpgme_decode_c_string): Likewise.
2263 (_gpgme_decode_percent_string): Likewise.
2264 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2265 * signers.c (gpgme_signers_clear): Likewise.
2266 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2267 Use SEQNO instead SEQ.
2268 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2269 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2271 (gpgme_wait): Change type of I and IDX to unsigned int.
2272 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2273 and I to unsigned int.
2274 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2275 int to suppress gcc warning.
2276 (_gpgme_io_set_close_notify): Likewise.
2277 (_gpgme_io_select): Change type of I to unsigned int.
2278 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2280 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2283 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2285 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2286 and wrong expression.
2287 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2288 * encrypt.c (encrypt_sym_status_handler): Likewise.
2289 * sign.c (sign_status_handler): Likewise.
2290 * verify.c (verify_status_handler): Likewise.
2291 * decrypt.c (decrypt_status_handler): Likewise.
2293 * engine.c (gpgme_get_engine_info): Initialize NULL.
2295 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2297 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2298 GPG_ERROR_LIBS when setting the corresponding variables.
2299 Reported by Stéphane Corthésy.
2301 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2303 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2304 the beginning of the block.
2306 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2308 * data-mem.c (mem_write): Copy original buffer content.
2310 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2312 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2315 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2317 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2318 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2321 * op-support.c (_gpgme_parse_inv_userid): Rename to
2322 _gpgme_parse_inv_recp and change to new datatype.
2323 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2324 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2325 __gpgme_invalid_key. Rename field ID to KEY.
2326 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2327 (struct _gpgme_op_encrypt_result): Here, too.
2328 (struct _gpgme_op_sign_result): Likewise.
2329 * encrypt.c (struct op_data): Likewise.
2330 (release_op_data): Likewise.
2331 * sign.c (struct op_data): Likewise.
2332 (release_op_data): Likewise.
2334 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2335 (_gpgme_io_write): Likewise.
2336 (_gpgme_io_pipe): Likewise.
2337 (_gpgme_io_select): Likewise.
2339 * rungpg.c (struct engine_gpg): Remove arg_error.
2340 (add_arg): Don't set arg_error.
2341 (add_data): Likewise.
2342 (start): Don't check arg_error.
2343 (gpg_new): Check return value of add_arg.
2344 * verify.c (parse_notation): Free allocated memory at error.
2346 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2348 Everywhere: Use libgpg-error error codes.
2350 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2351 (BUILT_SOURCES): Remove errors.c.
2352 (MOSTLYCLEANFILES): Likewise.
2353 (libgpgme_la_SOURCES): Likewise. Add error.c.
2354 (errors.c): Remove target.
2355 * mkerrors: File removed.
2356 * error.c: New file.
2358 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2359 (gpgme_err_code_t, gpgme_err_source_t): New types.
2360 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2361 New static inline functions.
2362 (gpgme_strsource, gpgme_err_code_from_errno,
2363 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2364 gpgme_error_from_errno): New prototypes.
2366 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2368 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2369 (gpgme_op_export): Likewise.
2370 (gpgme_op_export_ext_start): New prototype.
2371 (gpgme_op_export_ext): Likewise.
2372 * engine.h: Likewise for _gpgme_engine_op_export and
2373 _gpgme_engine_op_export_ext.
2374 * engine-backend.h (struct engine_ops): Change second argument of
2375 prototype of export to const char *, and add reserverd int as
2376 third argument. Add prototype for export_ext.
2377 * engine.c (_gpgme_engine_op_export_ext): New function.
2378 (_gpgme_engine_op_export): Change second argument of prototype of
2379 export to const char *, and add reserverd int as third argument.
2380 * rungpg.c (gpg_export): Change second argument of prototype of
2381 export to const char *, and add reserverd int as third argument.
2382 (gpg_export_ext): New function.
2383 (gpg_keylist_ext): Break loop at error.
2384 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2385 * engine-gpgsm.c (gpgsm_export): Change second argument of
2386 prototype of export to const char *, and add reserverd int as
2388 (gpgsm_export_ext): New function.
2389 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2390 * export.c (export_start): Change second argument of prototype of
2391 export to const char *, and add reserverd int as third argument.
2392 (gpgme_op_export_start): Likewise.
2393 (export_ext_start): New function.
2394 (gpgme_op_export_ext_start): Likewise.
2395 (gpgme_op_export_ext): Likewise.
2397 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2398 (gpgme_sigsum_t): New type for anonymous enum.
2400 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2401 and return an error if RECP is not set.
2403 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2404 * user-id.c: Remove file.
2405 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2406 * gpgme.h (gpgme_encrypt_flags_t): New type.
2407 (gpgme_op_encrypt_start): Change second parameter to type
2408 gpgme_key_t[], and add third parameter.
2409 (gpgme_op_encrypt): Likewise.
2410 (gpgme_op_encrypt_sign_start): Likewise.
2411 (gpgme_op_encrypt_sign): Likewise.
2412 * encrypt.c (encrypt_start): Likewise.
2413 (gpgme_op_encrypt_start): Likewise.
2414 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2415 * encrypt-sign.c (encrypt_sign_start): Likewise.
2416 (gpgme_op_encrypt_sign_start): Likewise.
2417 (gpgme_op_encrypt_sign): Likewise.
2418 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2419 encrypt and encrypt_sign.
2420 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2421 and _gpgme_engine_op_encrypt_sign.
2422 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2423 (_gpgme_engine_op_encrypt_sign): Likewise.
2424 * rungpg.c (gpg_encrypt): Likewise.
2425 (gpg_encrypt_sign): Likewise.
2426 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2427 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2428 (set_recipients): Rewritten to use keys instead user IDs.
2429 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2431 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2432 returned to GPGME_Invalid_Key and GPGME_General_Error.
2434 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2436 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2437 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2438 * rungpg.c: Rename GpgObject to engine_gpg_t.
2439 (struct gpg_object_s): Rename to struct engine_gpg.
2441 * context.h (struct gpgme_context): Change EngineObject to
2443 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2444 (ctx_op_data_t): New type.
2445 (struct gpgme_context): Use it.
2446 * ops.h (_gpgme_op_data_lookup): Use new type name.
2447 * op-support.c (_gpgme_op_data_lookup): Likewise.
2448 * engine.c: Rename EngineObject to engine_t in the file. Also
2449 EngineStatusHandler to engine_status_handler_t,
2450 EngineCommandHandler to engine_command_handler_t and
2451 EngineColonLineHandler to engine_colon_line_handler.
2452 * rungpg.c (start): Likewise.
2453 * engine-gpgsm.c: Likewise.
2454 * engine-backend.h (struct engine_ops): Likewise
2455 * engine.h (struct engine_object_s): Rename to struct engine.
2456 (EngineObject): Rename to engine_t. Also everywhere else in the
2458 (EngineStatusHandler): Rename to engine_status_handler_t.
2459 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2460 (EngineCommandHandler): Rename to engine_command_handler_t.
2462 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2464 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2466 * gpgme.h (gpgme_recipients_t): Removed.
2467 (gpgme_recipients_new, gpgme_recipients_release,
2468 gpgme_recipients_add_name,
2469 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2470 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2471 gpgme_recipients_enum_close): Removed.
2472 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2473 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2474 gpgme_op_export): Change second argument to gpgme_user_id_t.
2475 (gpgme_user_ids_release): New prototype.
2476 (gpgme_user_ids_append): Likewise.
2477 * ops.h (_gpgme_recipients_all_valid): Remove.
2478 (_gpgme_user_ids_all_valid): Add.
2479 * context.h (struct gpgme_recipients): Removed.
2480 * user-id.c: New file.
2481 * recipient.c: Removed file.
2482 * rungpg.c (append_args_from_recipients): Change last arg to
2483 gpgme_user_id_t. Reimplement.
2484 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2485 (gpg_encrypt_sign): Likewise.
2486 (gpg_export): Likewise. Rewrite user ID list code.
2487 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2489 (_gpgme_engine_op_encrypt_sign): Likewise.
2490 (_gpgme_engine_op_export): Likewise.
2491 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2492 _gpgme_engine_op_export): Likewise.
2493 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2494 (gpgsm_encrypt): Likewise.
2495 (gpgsm_export): Likewise.
2496 * engine-backend.h (struct engine_ops): Likewise for members
2497 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2498 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2500 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2502 (gpgme_op_encrypt_start): Likewise.
2503 (gpgme_op_encrypt): Likewise.
2504 * encrypt-sign.c (encrypt_sign_start): Likewise.
2505 (gpgme_op_encrypt_sign): Likewise.
2506 (gpgme_op_encrypt_sign_start): Likewise.
2508 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2510 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2511 * import.c (parse_import_res): Add skipped_new_keys parser.
2513 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2515 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2517 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2519 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2520 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2521 (_gpgme_encrypt_status_handler): Likewise.
2522 (_gpgme_op_encrypt_init_result): Likewise.
2523 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2524 (_gpgme_decrypt_status_handler): Likewise.
2525 (_gpgme_op_decrypt_init_result): Likewise.
2526 * verify.c (gpgme_op_verify_result): Likewise.
2527 (_gpgme_verify_status_handler): Likewise.
2528 (_gpgme_op_verify_init_result): Likewise.
2529 * edit.c (edit_status_handler): Likewise.
2530 (command_handler): Likewise.
2531 (edit_start): Likewise.
2532 * genkey.c (gpgme_op_genkey_result): Likewise.
2533 (genkey_status_handler): Likewise.
2534 (genkey_start): Likewise.
2535 * import.c (gpgme_op_import_result): Likewise.
2536 (import_status_handler): Likewise.
2537 (_gpgme_op_import_start): Likewise.
2538 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2539 (_gpgme_op_trustlist_event_cb): Likewise.
2540 (gpgme_op_trustlist_start): Likewise.
2541 * keylist.c (gpgme_op_keylist_result): Likewise.
2542 (keylist_colon_handler): Likewise.
2543 (keylist_status_handler): Likewise.
2544 (_gpgme_op_keylist_event_cb): Likewise.
2545 (gpgme_op_keylist_start): Likewise.
2546 (gpgme_op_keylist_ext_start): Likewise.
2547 (gpgme_op_keylist_next): Likewise.
2548 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2549 (_gpgme_passphrase_command_handler_internal): Likewise.
2550 * sign.c (gpgme_op_sign_result): Likewise.
2551 (_gpgme_sign_status_handler): Likewise.
2552 (_gpgme_op_sign_init_result): Likewise.
2554 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2555 access to pointer type.
2557 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2559 * engine.h (EngineCommandHandler): Change last argument to int fd.
2560 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2562 (gpgme_edit_cb_t): Change last argument to int fd.
2563 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2564 * passphrase.c: Include <assert.h>.
2565 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2566 (release_op_data): Check values before calling free.
2567 (_gpgme_passphrase_status_handler): Likewise.
2568 (_gpgme_passphrase_command_handler_internal): New function.
2569 (_gpgme_passphrase_command_handler): Rewritten.
2570 * edit.c (edit_status_handler): Pass -1 as fd argument.
2571 (command_handler): Update prototype. New variable processed. Use
2572 it to store return value of
2573 _gpgme_passphrase_command_handler_internal which is now used
2574 instead _gpgme_passphrase_command_handler. Use it also to check
2575 if we should call the user's edit function. Pass fd to user's
2577 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2579 (gpg_release): Check value before calling free. Do not release
2581 (command_cb): Function removed.
2582 (command_handler): New function. Thus we don't use a data object
2583 for command handler stuff anymore, but handle it directly. This
2584 allows proper error reporting (cancel of passphrase requests, for
2585 example). Also all callbacks work via direct writes to the file
2586 descriptor (so that passphrases are not kept in insecure memory).
2587 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2588 (read_status): Check cmd.keyword before calling free. Install
2589 command_handler as the I/O callback handler with GPG as private
2592 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2594 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2595 decrypt_verify_start.
2596 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2597 (gpgme_op_decrypt_verify): Likewise.
2598 * verify.c (verify_status_handler): New function that also calls
2599 progress status handler.
2600 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2601 Rename to (verify_start).
2602 (gpgme_op_verify_start): Call verify_start.
2603 (gpgme_op_verify): Likewise.
2604 * encrypt.c (encrypt_status_handler): New function.
2605 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2606 Make static. Rename to encrypt_sym_status_handler.
2607 (encrypt_start): Set status handler to encrypt_sym_status_handler
2608 or encrypt_status_handler.
2609 * sign.c (sign_status_handler): New function.
2610 (sign_start): Set status handler to sign_status_handler.
2611 * decrypt.c (decrypt_status_handler): New function that also calls
2612 progress status handler.
2613 (decrypt_start): Set status handler to decrypt_status_handler.
2614 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2615 * decrypt-verify.c (decrypt_verify_status_handler): Call
2616 _gpgme_progress_status_handler.
2618 * conversion.c (_gpgme_decode_c_string): Add missing break
2621 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2622 to buffer to allocate.
2624 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2626 * verify.c (parse_new_sig): Fix ERRSIG case.
2627 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2629 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2631 * gpgme.h: The following types are renamed. The old name is kept
2632 as a deprecated typedef.
2633 (GpgmeCtx): Rename to gpgme_ctx_t.
2634 (GpgmeData): Rename to gpgme_data_t.
2635 (GpgmeRecipients): Rename to gpgme_recipients_t.
2636 (GpgmeError): Rename to gpgme_error_t.
2637 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2638 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2639 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2640 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2641 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2642 (GpgmeAttr): Rename to gpgme_attr_t.
2643 (GpgmeValidity): Rename to gpgme_validity_t.
2644 (GpgmeProtocol): Rename to gpgme_protocol_t.
2645 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2646 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2647 (GpgmeSubkey): Rename to gpgme_subkey_t.
2648 (GpgmeKeySig): Rename to gpgme_keysig_t.
2649 (GpgmeUserID): Rename to gpgme_user_id_t.
2650 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2651 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2652 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2653 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2654 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2655 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2656 (GpgmeEventIO): Rename to gpgme_event_io_t.
2657 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2658 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2659 (gpgme_io_cbs_t): New type.
2660 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2661 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2662 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2663 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2664 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2665 (gpgme_data_cbs_t): New type.
2666 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2667 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2668 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2669 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2670 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2671 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2672 (GpgmeSignature): Rename to gpgme_signature_t.
2673 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2674 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2675 (GpgmeImportResult): Rename to gpgme_import_result_t.
2676 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2677 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2678 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2679 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2680 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2681 GPGME_No_Passphrase.
2682 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2683 * context.h (struct gpgme_context_s): Rename to struct
2685 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2687 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2689 * keylist.c (finish_key): Clear OPD->tmp_uid.
2691 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2693 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2694 for NODATA status without signatures.
2696 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2698 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2699 (_gpgme_key_add_sig): Likewise.
2701 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2703 * context.h (struct gpgme_context_s): Remove member op_info.
2705 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2707 * gpgme.h (GpgmeError): Add deprecated values for
2708 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2710 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2712 * gpgme.h (gpgme_get_op_info): Remove prototype.
2713 * ops.h (_gpgme_set_op_info,
2714 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2715 _gpgme_data_append, _gpgme_data_append_string,
2716 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2717 _gpgme_data_append_percentstring_for_xml): Likewise.
2718 (_gpgme_progress_status_handler): Change first arg to void *.
2719 * progress.c (_gpgme_progress_status_handler): Likewise.
2720 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2721 and <sys/types.h>, but <string.h>.
2722 (_gpgme_data_append): Remove function.
2723 (_gpgme_data_append_string): Likewise.
2724 (_gpgme_data_append_for_xml): Likewise.
2725 (_gpgme_data_append_string_for_xml): Likewise.
2726 (_gpgme_data_append_percentstring_for_xml): Likewise.
2727 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2728 (_gpgme_data_release_and_return_string): Likewise.
2729 * gpgme.c (gpgme_get_op_info): Likewise.
2730 (_gpgme_set_op_info): Likewise.
2732 * gpgme.h (struct _gpgme_key): New structure.
2733 (GpgmeKey): Define using _gpgme_key.
2734 (struct _gpgme_subkey): New structure.
2735 (GpgmeSubKey): New type.
2736 (struct _gpgme_key_sig): New structure.
2737 (GpgmeKeySig): New type.
2738 (struct _gpgme_user_id): New structure.
2739 (GpgmeUserID): New type.
2740 (struct _gpgme_op_keylist_result): New structure.
2741 (GpgmeKeyListResult): New type.
2742 (gpgme_op_keylist_result): New function.
2743 (gpgme_key_get_as_xml): Remove prototype.
2744 * context.h (struct gpgme_context_s): Remove members tmp_key,
2745 tmp_uid, key_cond and key_queue.
2746 (struct key_queue_item_s): Remove structure.
2747 (struct user_id_s): Remove structure.
2748 (struct gpgme_recipients_s): Replace with simple
2750 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2751 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2752 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2753 * rungpg.c (command_cb): Return GpgmeError instead int.
2754 New variable ERR. Use it to hold return value of cmd handler.
2755 (gpg_delete): Access fingerprint of key directly.
2756 (append_args_from_signers): Likewise.
2757 (gpg_edit): Likewise.
2758 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2759 * engine-gpgsm.c: Do not include "key.h".
2760 (gpgsm_delete): Access fingerprint of key directly.
2761 (gpgsm_sign): Likewise.
2762 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2764 * key.h: File removed.
2765 * key.c: Completely reworked to use exposed GpgmeKey data types.
2766 * keylist.c: Likewise.
2767 * recipient.c: Completely reworked to use GpgmeUserID.
2769 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2771 * gpgme.h (gpgme_get_key): Remove force_update argument.
2772 * key-cache.c: File removed.
2773 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2774 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2776 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2777 _gpgme_key_cache_add.
2778 (gpgme_get_key): New function.
2779 * verify.c (gpgme_get_sig_key): Remove last argument to
2780 gpgme_get_key invocation.
2782 * gpgme.h (struct _gpgme_trust_item): New structure.
2783 (GpgmeTrustItem): New type.
2784 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2785 * context.h (struct trust_queue_item_s): Remove structure.
2786 (struct gpgme_context_s): Remove trust_queue member.
2787 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2788 * trust-item.c: New file.
2789 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2791 (struct trust_queue_item_s): Change to new type op_data_t.
2792 (trust_status_handler): Change first argument to void *.
2793 (trust_colon_handler): Likewise.
2794 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2795 (gpgme_op_trustlist_start): Use op_data_t and rework error
2797 (gpgme_op_trustlist_next): Use op_data_t.
2798 (gpgme_trust_item_release): Remove function.
2799 (gpgme_trust_item_get_string_attr): Likewise.
2800 (gpgme_trust_item_get_int_attr): Likewise.
2802 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2805 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2807 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2808 (struct gpgme_context_s): Remove member notation.
2809 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2811 * gpgme.h (struct _gpgme_sig_notation): New structure.
2812 (GpgmeSigNotation): New type.
2813 (struct _gpgme_signature): New structure.
2814 (GpgmeSignature): New type.
2815 (struct _gpgme_op_verify_result): New structure.
2816 (GpgmeVerifyResult): New type.
2817 (gpgme_op_verify_result): New prototype.
2818 (gpgme_get_notation): Remove prototype.
2819 * ops.h (_gpgme_op_verify_init_result): New prototype.
2820 (_gpgme_verify_status_handler): Change first argument to void *.
2821 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2823 * conversion.c (_gpgme_decode_percent_string): New function.
2824 (gnupg_errors): New static global.
2825 (_gpgme_map_gnupg_error): New function.
2826 * gpgme.c (gpgme_release): Don't release CTX->notation.
2827 (gpgme_get_notation): Remove function.
2828 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2829 _gpgme_op_verify_init_result.
2830 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2831 do include "gpgme.h".
2832 (struct verify_result): Replace with ...
2833 (op_data_t): ... this type.
2834 (release_verify_result): Remove function.
2835 (release_op_data): New function.
2836 (is_token): Remove function.
2837 (skip_token): Remove function.
2838 (copy_token): Remove function.
2839 (gpgme_op_verify_result): New function.
2840 (calc_sig_summary): Rewritten.
2841 (finish_sig): Remove function.
2842 (parse_new_sig): New function.
2843 (parse_valid_sig): New function.
2844 (parse_notation): New function.
2845 (parse_trust): New function.
2846 (parse_error): New function.
2847 (_gpgme_verify_status_handler): Rewritten. Change first argument
2849 (_gpgme_op_verify_start): Rework error handling. Call
2850 _gpgme_op_verify_init_result.
2851 (gpgme_op_verify): Do not release or clear CTX->notation.
2852 (gpgme_get_sig_status): Rewritten.
2853 (gpgme_get_sig_string_attr): Likewise.
2854 (gpgme_get_sig_ulong_attr): Likewise.
2855 (gpgme_get_sig_key): Likewise.
2857 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2858 (GpgmeDecryptResult): New type.
2859 (gpgme_op_decrypt_result): New prototype.
2860 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2861 (_gpgme_decrypt_status_handler): Fix prototype.
2862 (_gpgme_decrypt_start): Remove prototype.
2863 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2864 <string.h> and <assert.h>, "util.h" and "context.h", but
2866 (decrypt_verify_status_handler): Change first argument to void *,
2867 and rework error handling.
2868 (_gpgme_op_decrypt_verify_start): New function.
2869 (gpgme_op_decrypt_verify_start): Rewrite using
2870 _gpgme_op_decrypt_verify_start.
2871 (gpgme_op_decrypt_verify): Likewise.
2872 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2873 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2874 (is_token): Remove function.
2875 (release_op_data): New function.
2876 (skip_token): Remove function.
2877 (gpgme_op_decrypt_result): New function.
2878 (_gpgme_decrypt_status_handler): Change first argument to void *.
2879 Rework error handling.
2880 (_gpgme_decrypt_start): Rename to ...
2881 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2882 (_gpgme_op_decrypt_init_result): New function.
2883 (gpgme_op_decrypt_start): Use decrypt_start.
2884 (gpgme_op_decrypt): Likewise.
2886 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2888 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2889 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2890 (_gpgme_op_encrypt_sign_start): Rename to ...
2891 (encrypt_sign_start): ... this.
2892 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2893 _gpgme_op_encrypt_sign_start.
2894 (gpgme_op_encrypt_sign): Likewise.
2896 * gpgme.h (GpgmeEncryptResult): New data type.
2897 (gpgme_op_encrypt_result): New prototype.
2898 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2899 (_gpgme_op_encrypt_status_handler): Fix prototype.
2900 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2901 _gpgme_op_encrypt_init_result.
2902 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2903 "wait.h". Include <errno.h> and "gpgme.h".
2904 (SKIP_TOKEN_OR_RETURN): Remove macro.
2905 (struct encrypt_result): Rename to ...
2906 (op_data_t): ... new data type. Rewrite for user result data.
2907 (append_xml_encinfo): Remove function.
2908 (release_op_data): New function.
2909 (gpgme_op_encrypt_result): New function.
2910 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2911 Rewrite result parsing.
2912 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2914 (_gpgme_op_encrypt_init_result): New function.
2915 (_gpgme_op_encrypt_start): Rename to ...
2916 (encrypt_start): ... this.
2917 (gpgme_op_encrypt_start): Use encrypt_start, not
2918 gpgme_op_encrypt_start.
2919 (gpgme_op_encrypt): Likewise.
2921 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2922 GpgmeNewSignature, GpgmeSignResult): New data types.
2923 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2924 gpgme_hash_algo_name): New prototypes.
2925 * gpgme.c (gpgme_pubkey_algo_name): New function.
2926 (gpgme_hash_algo_name): Likewise.
2927 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2929 (_gpgme_op_sign_status_handler): Fix prototype.
2930 * op-support.c: Include <errno.h> and <string.h>.
2931 (_gpgme_parse_inv_userid): New function.
2932 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2933 <assert.h> and "util.h".
2934 (SKIP_TOKEN_OR_RETURN): Remove macro.
2935 (struct sign_result): Change to op_data_t type and rework it.
2936 (release_sign_result): Rename to ...
2937 (release_op_data): ... this and rewrite it.
2938 (append_xml_info): Remove function.
2939 (gpgme_op_sign_result): New function.
2940 (parse_sig_created): New function.
2941 (_gpgme_sign_status_handler): Change first argument to void *.
2942 Rewrite the function to use the new result structure and functions.
2943 (_gpgme_op_sign_init_result): New function.
2944 (_gpgme_op_sign_start): Rename to ...
2945 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2946 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2947 (gpgme_op_sign): Likewise.
2948 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2949 _gpgme_op_sign_init_result.
2951 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2953 (enum delete_problem): Move into function delete_status_handler.
2954 (delete_status_handler): Change first argument to void *. Parse
2955 delete problem with strtol instead atoi. Return better error
2957 (_gpgme_op_delete_start): Rename to ...
2958 (delete_start): ... this. Rework error handling.
2959 (gpgme_op_delete_start): Use delete_start instead
2960 _gpgme_op_delete_start.
2961 (gpgme_op_delete): Likewise.
2962 * gpgme.h (GpgmeDataType): Removed.
2964 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2966 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2967 * import.c (parse_import_res): Parse unchanged field.
2969 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2970 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2971 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2972 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2973 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
2974 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
2975 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
2976 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
2977 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
2978 (struct _gpgme_import_status): New structure.
2979 (GpgmeImportStatus): New type.
2980 (struct _gpgme_op_import_result): New structure.
2981 (GpgmeImportResult): New type.
2982 (gpgme_op_import_result): New function.
2983 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
2984 (struct import_result): Change to type op_data_t.
2985 (release_import_result): Rename to ...
2986 (release_op_data): ... this.
2987 (append_xml_impinfo): Function removed.
2988 (gpgme_op_import_result): New function.
2989 (parse_import): New function.
2990 (parse_import_res): Likewise.
2991 (import_status_handler): Change first argument to void *. Rewrite
2992 to use new functions.
2993 (_gpgme_op_import_start): Rework error handling.
2995 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
2996 (edit_resut): Change to typedef for op_data_t.
2997 (edit_status_handler): Change first argument to void *.
2998 Rework error handling.
2999 (command_handler): Rework error handling.
3000 (_gpgme_op_edit_start): Rename to ...
3001 (edit_start): ... this. Rework error handling.
3002 (gpgme_op_edit_start): Rewrite using edit_start.
3003 (gpgme_op_edit): Likewise.
3005 * ops.h (_gpgme_passphrase_start): Remove prototype.
3006 * passphrase.c: Do not include <assert.h>, "util.h" or
3007 "debug.h", but "gpgme.h".
3008 (struct passphrase_result): Change to typedef for op_data_t.
3009 (release_passphrase_result): Rename to release_op_data.
3010 (_gpgme_passphrase_status_handler): Change first argument to void *.
3011 Use new op_data_t type.
3012 (_gpgme_passphrase_command_handler): Use new op_data_t type.
3013 (_gpgme_passphrase_start): Remove function.
3014 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
3015 not call _gpgme_passphrase_start, but install command handler.
3016 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3017 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3018 * sign.c (_gpgme_op_sign_start): Likewise.
3020 * context.h (struct gpgme_context_s): Remove member initialized,
3021 use_cms and help_data_1. Add member protocol. Make use_armor and
3022 use_textmode bit flags. Make keylist_mode, include_certs,
3023 signers_len and signers_size unsigned.
3024 * gpgme.c (gpgme_new): Initialize CTX->protocol.
3025 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
3026 (gpgme_get_protocol): Likewise.
3027 (gpgme_release): Do not release CTX->help_data_1.
3028 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3030 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3032 * data.c: Do not include <assert.h>, but "gpgme.h".
3033 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3034 it will go. Do not assert DH.
3035 (_gpgme_data_outbound_handler): Do not assert DH.
3037 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3039 (export_status_handler): Change type of first argument to void *.
3040 (_gpgme_op_export_start): Rename to ...
3041 (export_start): ... this. Rework error handling.
3042 (gpgme_op_export_start): Rewritten to use export_start instead
3043 _gpgme_op_export_start.
3044 (gpgme_op_export): Likewise.
3046 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3047 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3048 GPGME_No_Passphrase): New macros.
3050 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3052 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3054 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3055 (GpgmeGenKeyResult): New type.
3056 (gpgme_op_genkey): Drop last argument.
3057 (gpgme_op_genkey_result): New function.
3058 * genkey.c: Do not include "util.h", but "gpgme.h".
3059 (struct genkey_result): Replace with ...
3060 (op_data_t): ... this new type.
3061 (release_genkey_result): Replace with ...
3062 (release_op_data): ... this new function.
3063 (gpgme_op_genkey_result): New function.
3064 (genkey_status_handler): Rewritten using new op_data_t type.
3065 (get_key_parameter): New function.
3066 (_gpgme_op_genkey_start): Renamed to
3067 (genkey_start): ... this and rewritten.
3068 (gpgme_op_genkey_start): Use genkey_start instead
3069 _gpgme_op_genkey_start.
3070 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3072 * context.h (struct gpgme_context_s): Remove member verbosity.
3073 * gpgme.c (gpgme_new): Do not set member verbosity.
3074 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3075 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3076 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3077 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3078 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3079 (gpg_set_verbosity): Remove function.
3080 * decrypt.c (_gpgme_decrypt_start): Don't call
3081 _gpgme_engine_set_verbosity.
3082 * delete.c (_gpgme_op_delete_start): Likewise.
3083 * edit.c (_gpgme_op_edit_start): Likewise.
3084 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3085 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3086 * export.c (_gpgme_op_export_start): Likewise.
3087 * genkey.c (_gpgme_op_genkey_start): Likewise.
3088 * import.c (_gpgme_op_import_start): Likewise.
3089 * keylist.c (gpgme_op_keylist_start): Likewise.
3090 (gpgme_op_keylist_ext_start): Likewise.
3091 * sign.c (_gpgme_op_sign_start): Likewise.
3092 * verify.c (_gpgme_op_verify_start): Likewise.
3094 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3095 * key.c (key_cache_initialized, key_cache_size,
3096 key_cache_max_chain_length, ): Removed.
3097 (struct key_cache_item_s, key_cache_lock, key_cache,
3098 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3099 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3100 * key-cache.c: ... here. New file.
3101 * key.h (_gpgme_key_cache_init): Remove prototypes.
3102 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3104 * version.c: Do not include "key.h".
3105 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3107 * mkstatus: Strip trailing comma.
3108 * gpgme.h (GpgmeStatus): Pretty print.
3110 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3111 GPGME_Bad_Passphrase.
3112 * passphrase.c (_gpgme_passphrase_status_handler): Use
3113 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3115 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3116 GPGME_No_UserID and GPGME_Invalid_Recipient to
3117 GPGME_Invalid_UserID.
3118 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3119 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3120 GPGME_Invalid_Recipient.
3121 (_gpgme_op_encrypt_start): Likewise.
3123 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3124 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3125 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3126 * wait-global.c (gpgme_wait): Likewise.
3127 * verify.c (_gpgme_op_verify_start): Likewise.
3128 (gpgme_get_sig_status): Don't check pending flag.
3129 (gpgme_get_sig_string_attr): Likewise.
3130 (gpgme_get_sig_ulong_attr): Likewise.
3131 (gpgme_get_sig_key): Likewise.
3132 * op-support.c (_gpgme_op_reset): Likewise.
3133 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3134 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3135 (gpgme_op_trustlist_end): Likewise.
3136 * sign.c (_gpgme_op_sign_start): Likewise.
3137 * context.h (struct gpgme_context_s): Remove member PENDING.
3138 * decrypt.c (_gpgme_decrypt_start): Likewise.
3139 * delete.c (_gpgme_op_delete_start): Likewise.
3140 * edit.c (_gpgme_op_edit_start): Likewise.
3141 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3142 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3143 * export.c (_gpgme_op_export_start): Likewise.
3144 * genkey.c (_gpgme_op_genkey_start): Likewise.
3145 * import.c (_gpgme_op_import_start): Likewise.
3146 * key.c (gpgme_get_key): Likewise.
3147 * keylist.c (gpgme_op_keylist_start): Likewise.
3148 (gpgme_op_keylist_ext_start): Likewise.
3149 (gpgme_op_keylist_next): Likewise.
3150 (gpgme_op_keylist_end): Likewise.
3151 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3153 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3155 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3156 and add argument for returning the result string.
3157 (gpgme_cancel): Remove prototype.
3158 * gpgme.c (gpgme_cancel): Remove function.
3159 * context.h (struct gpgme_context_s): Remove member cancel.
3160 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3161 passphrase callback in the new way.
3163 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3165 * edit.c (_gpgme_edit_status_handler): Call the progress status
3168 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3170 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3171 I/O handlers left to ...
3172 (_gpgme_user_io_cb_handler): ... here.
3174 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3176 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3177 could not be allocated.
3178 (gpgme_trust_item_release): Only release name if it is allocated.
3179 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3181 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3183 * rungpg.c (read_status): If he status handler returns an error,
3185 (status_handler): If read_status fails, just return the error.
3187 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3189 * engine-gpgsm.c (start): Handle all errors, not only most of
3191 (xtoi_1, xtoi_2): Remove macro.
3192 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3194 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3196 * engine-gpgsm.c (map_assuan_error): Replace
3197 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3198 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3200 * util.h (DIMof): Remove macro.
3202 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3203 _gpgme_data_unread): Prototypes removed.
3205 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3207 * types.h: File removed.
3208 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3209 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3211 * context.h: Likewise.
3212 * cengine-gpgsm.h: Likewise.
3213 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3214 for EngineStatusHandler, EngineColonLineHandler and
3215 EngineCommandHandler.
3216 (_gpgme_engine_set_status_handler): Change parameter type from
3217 GpgmeStatusHandler to EngineStatusHandler.
3218 (_gpgme_engine_set_command_handler): Change parameter type from
3219 GpgmeCommandHandler to EngineCommandHandler.
3220 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3221 GpgmeColonLineHandler to EngineColonLineHandler.
3222 * engine-backend.h: Include "engine.h" instead "types.h".
3223 (struct engine_ops): Change Gpgme*Handler parameters in members
3224 set_command_handler, set_colon_line_handler and set_status_handler
3226 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3227 type from GpgmeStatusHandler to EngineStatusHandler.
3228 (_gpgme_engine_set_command_handler): Change parameter type from
3229 GpgmeCommandHandler to EngineCommandHandler.
3230 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3231 GpgmeColonLineHandler to EngineColonLineHandler.
3232 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3233 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3234 member colon.fnc from GpgmeColonLineHandler to
3235 EngineColonLineHandler. Change type of member cmd.fnc from
3236 GpgmeCommandHandler to EngineCommandHandler.
3237 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3238 * rungpg.c (gpg_set_status_handler): Change parameter type from
3239 GpgmeStatusHandler to EngineStatusHandler.
3240 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3241 (assuan_simple_command): Likewise.
3242 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3243 from GpgmeColonLineHandler to EngineColonLineHandler.
3244 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3245 * rungpg.c (gpg_set_command_handler): Change parameter type from
3246 GpgmeCommandHandler to EngineCommandHandler.
3248 * engine-gpgsm.c (status_handler): Do not close status fd at end
3251 * ops.h (_gpgme_op_data_lookup): Add prototype.
3252 * op-support.c: Include <stdlib.h>.
3253 (_gpgme_op_data_lookup): New function.
3254 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3255 (struct decrypt_result_s): Rename to ...
3256 (struct decrypt_resul): ... this.
3257 (DecryptResult): New type.
3258 (_gpgme_decrypt_status_handler): Don't use
3259 test_and_allocate_result, but use _gpgme_op_data_lookup to
3260 retrieve result data object.
3261 * sign.c (_gpgme_release_sign_result): Function removed.
3262 (release_sign_result): New function.
3263 (struct sign_result_s): Rename to ...
3264 (struct sign_result): ... this.
3265 (SignResult): New type.
3266 (_gpgme_sign_status_handler): Don't use
3267 test_and_allocate_result, but use _gpgme_op_data_lookup to
3268 retrieve result data object.
3269 * encrypt.c (struct encrypt_result_s): Rename to ...
3270 (struct encrypt_result): ... this.
3271 (_gpgme_release_encrypt_result): Function removed.
3272 (release_encrypt_result): New function.
3273 (_gpgme_encrypt_status_handler): Don't use
3274 test_and_allocate_result, but use _gpgme_op_data_lookup to
3275 retrieve result data object.
3276 * verify.c (struct verify_result_s): Rename to ...
3277 (struct verify_result): ... this. Remove member next.
3278 (VerifyResult): New type.
3279 (_gpgme_release_verify_result): Function removed.
3280 (release_verify_result): New function.
3281 (finish_sig): Change first argument to type VerifyResult. Diddle
3282 the type of the op_data structure.
3283 (add_notation): Change first argument to type VerifyResult.
3284 (_gpgme_verify_status_handler): Don't use
3285 test_and_allocate_result, but use _gpgme_op_data_lookup to
3286 retrieve result data object.
3287 * passphrase.c (struct passphrase_result_s): Rename to ...
3288 (struct passphrase_result): ... this. Remove member next.
3289 (PassphraseResult): New type.
3290 (_gpgme_release_passphrase_result): Function removed.
3291 (release_passphrase_result): New function.
3292 (_gpgme_passphrase_status_handler): Don't use
3293 test_and_allocate_result, but use _gpgme_op_data_lookup to
3294 retrieve result data object.
3295 (_gpgme_passphrase_command_handler): Likewise.
3296 * keylist.c (struct keylist_result_s): Rename to ...
3297 (struct keylist_result): ... this. Remove member next.
3298 (KeylistResult): New type.
3299 (_gpgme_release_keylist_result): Function removed.
3300 (release_keylist_result): New function.
3301 (keylist_status_handler): Don't use
3302 test_and_allocate_result, but use _gpgme_op_data_lookup to
3303 retrieve result data object.
3304 * edit.c (struct edit_result_s): Rename to ...
3305 (struct edit_result): ... this. Remove member next.
3306 (EditResult): New type.
3307 (_gpgme_release_edit_result): Function removed.
3308 (release_edit_result): New function.
3309 (edit_status_handler): Don't use
3310 test_and_allocate_result, but use _gpgme_op_data_lookup to
3311 retrieve result data object.
3312 (command_handler): Likewise.
3313 * types.h (DecryptResult, SignResult, EncryptResult,
3314 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3315 KeylistResult, EditResult): Types removed.
3316 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3317 (test_and_allocate_result): Remove macro.
3318 (_gpgme_release_decrypt_result): Remove prototype.
3319 (_gpgme_decrypt_result): Remove prototype.
3320 (_gpgme_release_sign_result): Remove prototype.
3321 (_gpgme_release_encrypt_result): Remove prototype.
3322 (_gpgme_release_passphrase_result): Remove prototype.
3323 (_gpgme_release_import_result): Remove prototype.
3324 (_gpgme_release_delete_result): Remove prototype.
3325 (_gpgme_release_genkey_result): Remove prototype.
3326 (_gpgme_release_keylist_result): Remove prototype.
3327 (_gpgme_release_edit_result): Remove prototype.
3328 (_gpgme_release_verify_result): Remove prototype.
3329 * gpgme.c (_gpgme_release_result): Rewritten.
3330 * context.h (enum ctx_op_data_type): New enum.
3331 (struct ctx_op_data): New structure.
3332 (struct gpgme_context_s): Replace the member result with a member
3334 (fail_on_pending_request): Remove macro.
3335 * op-support.c (_gpgme_op_reset): Expand macro
3336 fail_on_pending_request.
3337 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3339 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3341 * types.h (EngineObject): Move typedef to ...
3342 * engine.h: ... here.
3343 * types.h (GpgObject): Move typedef to ...
3344 * rungpg.c: ... here.
3345 * types.h (GpgsmObject): Move typedef to ...
3346 * engine-gpgsm.c: ... here.
3348 * util.h (return_if_fail, return_null_if_fail,
3349 return_val_if_fail): Remove macro.
3350 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3351 * key.c (gpgme_key_ref): Likewise.
3352 * signers.c (gpgme_signers_enum): Likewise.
3353 (gpgme_signers_clear): Likewise.
3355 * engine-backend.h (struct engine_ops): Rename get_path to
3357 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3359 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3360 util.h. Other clean ups.
3361 (parse_version_number): Protect more seriously against
3363 (gpgme_get_engine_info): Move to ...
3364 * engine.c (gpgme_get_engine_info): ... here.
3365 (_gpgme_engine_get_info): Function removed.
3366 (_gpgme_engine_get_path): Make static and rename to ...
3367 (engine_get_file_name): .. this.
3368 (_gpgme_engine_get_version): Make static and rename to ...
3369 (engine_get_version): ... this.
3370 (_gpgme_engine_get_req_version): Make static and rename to ...
3371 (engine_get_req_version): ... this.
3372 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3373 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3376 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3377 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3378 (gpgme_get_protocol_name): New function.
3380 * engine-backend.h (struct engine_ops): New member
3381 get_req_version, remove member check_version.
3382 * engine.h (_gpgme_Engine_get_version): New prototype.
3383 * rungpg.c (gpg_get_req_version): New function.
3384 (gpg_check_version): Function removed.
3385 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3387 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3388 (gpgsm_check_version): Function removed.
3389 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3390 gpgsm_check_version.
3391 * engine.c: Include ops.h.
3392 (_gpgme_engine_get_req_version): New function.
3393 (gpgme_engine_check_version): Rewritten.
3394 * version.c (gpgme_get_engine_info): Rewritten.
3395 * gpgme.h (gpgme_engine_info): New structure.
3396 (GpgmeEngineInfo): New type.
3398 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3400 * types.h: Remove byte and ulong types.
3401 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3403 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3405 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3406 few more escaped characters. Be more strict about buffer size.
3407 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3408 BUF and DST to unsigned char instead byte.
3409 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3411 * debug.c (trim_spaces): Likewise.
3413 * util.h (mk_error): Remove macro.
3414 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3415 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3416 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3417 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3418 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3419 wait-private (literally everywhere): Expand the mk_error macro.
3421 * context.h (wait_on_request_or_fail): Remove macro.
3423 * context.h (gpgme_context_s): Remove member ERROR.
3424 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3425 (GpgmeCommandHandler): Change return type to GpgmeError and add
3426 new argument RESULT.
3427 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3428 (GpgmeEventIO): New event GPGME_EVENT_START.
3429 (GpgmeIdleFunc): Remove type.
3430 (gpgme_register_idle): Remove prototype.
3431 * data.c: Include <assert.h>.
3432 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3433 Return any error instead ignoring it, don't close file descriptor
3435 (_gpgme_data_outbound_handler): Likewise.
3436 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3437 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3438 Return error instead setting ctx->error. Return success at end of
3440 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3441 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3442 type to GpgmeError. Return possible errors.
3443 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3445 (delete_status_handler): Change return type to GpgmeError. Return
3446 error instead setting ctx->error. Return success at end of
3448 * edit.c: Do not include <stdio.h> and <string.h>.
3449 (_gpgme_edit_status_handler): Change type to GpgmeError,
3450 make static and rename to ...
3451 (edit_status_handler): ... this. Return error directly.
3452 (command_handler): Change return type to GpgmeError, add result
3453 argument. Return error directly.
3454 * encrypt.c (status_handler_finish): Remove function.
3455 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3456 Return error directly.
3457 (_gpgme_encrypt_sym_status_handler): Likewise.
3458 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3459 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3461 (status_handler): Change return type to GpgmeError. Diddle things
3462 around a bit to return errors directly.
3463 (start): Send start event.
3464 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3465 (export_status_handler): Change return type to GpgmeError. Don't
3467 * genkey.c: Do not include <stdio.h> and <assert.h>.
3468 (genkey_status_handler): Change return type to GpgmeError. Don't
3469 check ctx->error. Return errors directly.
3470 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3471 (_gpgme_op_event_cb): Function removed.
3472 (_gpgme_op_event_cb_user): Likewise.
3473 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3474 (import_status_handler): Change return type to GpgmeError. Don't
3476 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3477 Change return type to GpgmeError, return error directly.
3478 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3479 wait-private.c and wait-user.c
3480 * ops.h (test_and_allocate_result): Return error instead setting
3482 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3483 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3484 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3485 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3486 Change return type to GpgmeError.
3487 (_gpgme_passphease_command_handler): Change return type to
3488 GpgmeError and add new argument RESULT.
3489 * op-support.c: Use new callback functions, and change private
3490 data to ctx everywhere.
3491 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3492 type to GpgmeError, return error directly.
3493 (_gpgme_passphrase_command_handler): Change return type to
3494 GpgmeError, add result argument. Return results accordingly.
3495 * progress.c (_gpgme_progress_status_handler): Change return type
3496 to GpgmeError, return errors directly.
3497 * rungpg.c (status_handler): Change return type to GpgmeError.
3498 Return error directly.
3499 (close_notify_handler): Don't send done event.
3500 (colon_line_handler): Change return type to GpgmeError, return
3502 * rungpg.c (start): Send start event.
3503 * sign.c (_gpgme_sign_status_handler): Change return type to
3504 GpgmeError, return errors directly.
3505 * trustlist.c (trustlist_status_handler): Change return type to
3506 GpgmeError. Return 0.
3507 (trustlist_colon_handler): Change return type GpgmeError. Return
3509 * verify.c (add_notation): Change return type to GpgmeError,
3510 return errors directly.
3511 (_gpgme_verify_status_handler): Likewise.
3512 * wait.h (struct fd_table): Remove lock member.
3513 (struct wait_item_s): Moved here from wait.c.
3514 (struct tag): New structure.
3515 (_gpgme_wait_event_cb): Remove prototype.
3516 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3517 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3518 _gpgme_wait_user_event_io_cb): New prototypes.
3519 * wait.c: Don't include <stdio.h>.
3520 (ftd_global, ctx_done_list, ctx_done_list_size,
3521 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3523 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3525 (gpgme_wait): Move to file wait-global.c.
3526 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3527 member in wait item and tag.
3528 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3529 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3531 (gpgme_fd_table_init): Don't initialize FDT->lock.
3532 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3533 (_gpgme_fd_table_put): Make static and rename to ...
3534 (fd_table_put): ... this function. Don't use FDT->lock.
3535 (struct wait_item_s): Move to wait.h.
3536 * wait-global.c: New file.
3537 * wait-private.c: New file.
3538 * wait-user.c: New file.
3540 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3541 instead otrust_to_string to calculate validity.
3543 2003-01-19 Miguel Coca <mcoca@gnu.org>
3545 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3547 * w32-util.c: Include "sema.h".
3548 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3551 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3553 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3554 (gpg_start): Rename to ...
3555 (start): ... this function. Change arguments to GpgObject.
3556 (gpg_decrypt): Call start.
3557 (gpg_edit): Likewise.
3558 (gpg_encrypt): Likewise.
3559 (gpg_encrypt_sign): Likewise.
3560 (gpg_export): Likewise.
3561 (gpg_import): Likewise.
3562 (gpg_keylist): Likewise.
3563 (gpg_keylist_ext): Likewise.
3564 (gpg_trustlist): Likewise.
3565 (gpg_verify): Likewise.
3567 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3568 (gpgsm_start): Rename to ...
3569 (struct gpgsm_object_s): Remove member command.
3570 (gpgsm_release): Don't free command.
3571 (start): ... this function. Change arguments to GpgsmObject and
3573 (gpgsm_decrypt): Call start.
3574 (gpgsm_delete): Likewise.
3575 (gpgsm_encrypt): Likewise.
3576 (gpgsm_export): Likewise.
3577 (gpgsm_genkey): Likewise.
3578 (gpgsm_import): Likewise.
3579 (gpgsm_keylist): Likewise.
3580 (gpgsm_keylist_ext): Likewise.
3581 (gpgsm_verify): Likewise.
3583 * decrypt.c (_gpgme_decrypt_start): Don't call
3584 _gpgme_engine_start.
3585 * delete.c (_gpgme_op_delete_start): Likewise.
3586 * edit.c (_gpgme_op_edit_start): Likewise.
3587 * encrypt.c (_gpgme_op_encrypt_start):
3588 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3589 * export.c (_gpgme_op_export_start): Likewise.
3590 * genkey.c (_gpgme_op_genkey_start): Likewise.
3591 * import.c (_gpgme_op_import_start): Likewise.
3592 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3593 (gpgme_op_keylist_start): Likewise.
3594 * sign.c (_gpgme_op_sign_start): Likewise.
3595 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3596 * verify.c (_gpgme_op_verify_start): Likewise.
3598 * engine-backend.h (struct engine_ops): Remove member start.
3600 * engine.h (_gpgme_engine_start): Remove prototype.
3601 * engine.c (_gpgme_engine_start): Remove function.
3603 2003-01-06 Werner Koch <wk@gnupg.org>
3605 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3606 since gpg 1.3 to denote disabled keys.
3608 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3610 * data-mem.c: Include <string.h>.
3611 * engine.c: Likewise.
3613 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3615 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3617 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3619 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3621 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3623 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3624 (_gpgme_intersect_stati): Function removed.
3625 * ops.h (_gpgme_intersect_stati): Remove prototype.
3627 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3629 * libgpgme.vers: New file.
3630 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3631 (libgpgme_version_script_cmd): New variable.
3632 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3633 (libgpgme_la_DEPENDENCIES): New variable.
3635 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3637 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3638 (otrust_to_string): New function.
3639 (gpgme_key_get_as_xml): Use it.
3640 (validity_to_string): New function.
3641 (gpgme_key_get_string_attr): Beautify using above functions.
3642 (gpgme_key_get_ulong_attr): Likewise.
3644 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3646 * data-mem.c (mem_release): Fix gcc warning.
3647 * data-user.c (user_release): Likewise.
3649 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3651 * data.h (gpgme_data_release_cb): Change return type to void.
3652 (gpgme_data_read_cb): Change return type to ssize_t.
3653 * data.c (gpgme_data_read): Likewise.
3654 * data-stream.c (stream_read): Likewise.
3655 * data-fd.c (fd_read): Likewise.
3656 * data-mem.c (mem_read): Likewise.
3657 (mem_release): Change return type to void.
3658 * data-user.c (user_read): Change return type to ssize_t.
3659 (user_release): Change return type to void.
3660 * data-compat.c (old_user_read): Change return type to ssize_t.
3661 * gpgme.h (GpgmeDataReadCb): Likewise.
3662 (gpgme_data_read): Likewise.
3663 (GpgmeDataSeekCb): Change return type to off_t.
3665 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3667 * gpgme.h: Add prototype for gpgme_get_key.
3668 * key.c (gpgme_get_key): New function.
3669 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3671 * gpgme.h: Add prototypes for new interfaces
3672 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3673 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3674 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3675 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3676 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3678 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3679 Use that to determine if allocation is desired or not.
3680 * util.h: Adjust prototype of _gpgme_decode_c_string.
3681 * keylist.c (keylist_colon_handler): Adjust caller of
3682 _gpgme_decode_c_string.
3684 * key.h (struct gpgme_key_s): New member last_uid.
3685 * key.c (_gpgme_key_append_name): Rewritten using
3686 _gpgme_decode_c_string and the last_uid pointer.
3687 (my_isdigit): Macro removed.
3688 (ALLOC_CHUNK): Likewise.
3689 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3691 * context.h (struct user_id_s): New member last_certsig.
3692 * key.h: Add prototype for _gpgme_key_add_certsig.
3693 * key.c (_gpgme_key_add_certsig): New function.
3694 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3695 (parse_user_id): Change first argument to SRC, add new arguments
3696 NAME, EMAIL and COMMENT. Change code to use these arguments
3697 instead going through UID. Move function before
3699 (parse_x509_user_id): Likewise.
3700 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3701 and parse_user_id invocation.
3702 (one_certsig_as_xml): New function.
3703 (one_uid_as_xml): Print signatures.
3704 * context.h (struct gpgme_context_s): New member TMP_UID.
3705 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3708 * key.c (get_certsig): New function.
3709 (gpgme_key_sig_get_string_attr): Likewise.
3710 (gpgme_key_sig_get_ulong_attr): Likewise.
3712 * keylist.c: Include <ctype.h>.
3713 (my_isdigit): Macro removed.
3714 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3715 (set_userid_flags): Likewise.
3716 (set_subkey_trust_info): Likewise.
3717 (set_ownertrust): Likewise.
3718 (finish_key): Move function up a bit and remove prototype.
3720 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3722 (gpg_keylist_ext): Implement signature listing mode.
3724 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3726 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3727 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3729 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3730 CloseHandle for parent fds.
3732 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3734 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3736 2002-11-22 Werner Koch <wk@gnupg.org>
3738 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3739 setlocale before doing another setlocale.
3741 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3743 * decrypt.c: Some beautyfication.
3745 * verify.c (_gpgme_verify_status_handler): Treat
3746 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3747 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3749 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3751 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3752 (struct genkey_result_s): Add new member FPR.
3753 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3754 (genkey_status_handler): Extract the fingerprint from the status
3756 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3758 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3760 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3762 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3763 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3764 <twoaday@freakmail.de>.
3765 (gpg_keylist_ext): Likewise.
3767 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3769 * import.c (append_xml_impinfo): Use
3770 _gpgme_data_append_string_for_xml rather than
3771 _gpgme_data_append_string for the field content.
3772 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3774 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3776 * rungpg.h, engine-gpgsm.h: File removed.
3777 * engine-backend.h: New file.
3778 * Makefile.am (gpgsm_components): New variable, set depending on
3779 automake conditional HAVE_GPGSM.
3780 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3781 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3782 (status-table.h): Depend on gpgme.h, not rungpg.h.
3783 * conversion.c: Include <stdlib.h>.
3784 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3785 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3786 functions and remove all function prototypes.
3787 (_gpgme_gpgsm_get_version): Make static and rename to ...
3788 (gpgsm_get_version): ... this.
3789 (_gpgme_gpgsm_check_version): Make static and rename to ...
3790 (gpgsm_check_version): ... this.
3791 (_gpgme_gpgsm_new): Make static. Change argument type from
3792 GpgsmObject * to void **. Call gpgsm_release instead
3793 _gpgme_gpgsm_release.
3794 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3795 (gpgsm_check_decrypt): ... this.
3796 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3797 (gpgsm_check_delete): ... this.
3798 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3799 (gpgsm_check_set_recipients): ... this.
3800 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3801 (gpgsm_encrypt): ... this.
3802 (_gpgme_gpgsm_op_export): Make static and rename to ...
3803 (gpgsm_export): ... this.
3804 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3805 (gpgsm_genkey): ... this.
3806 (_gpgme_gpgsm_op_import): Make static and rename to ...
3807 (gpgsm_import): ... this.
3808 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3809 (gpgsm_keylist): ... this.
3810 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3811 (gpgsm_keylist_ext): ... this.
3812 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3813 (gpgsm_sign): ... this.
3814 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3815 (gpgsm_trustlist): ... this.
3816 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3817 (gpgsm_verify): ... this.
3818 (gpgsm_status_handler): Rename to ...
3819 (status_handler): ... this.
3820 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3821 (gpgsm_set_status_handler): ... this.
3822 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3823 (gpgsm_set_colon_line_handler): ... this.
3824 (_gpgme_gpgsm_add_io_cb): Rename to ...
3825 (add_io_cb): ... this.
3826 (_gpgme_gpgsm_start): Make static and rename to ...
3827 (gpgsm_start): ... this.
3828 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3829 (gpgsm_set_io_cb): ... this.
3830 (_gpgme_gpgsm_io_event): Make static and rename to ...
3831 (gpgsm_io_event): ... this.
3832 (struct _gpgme_engine_ops_gpgsm): New variable.
3833 [!ENABLE_GPGSM]: Removed.
3834 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3835 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3836 <stdlib.h> and "engine-backend.h".
3837 (struct engine_object_s): Rewritten.
3838 (engine_ops): New variable.
3839 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3840 _gpgme_engine_check_version, _gpgme_engine_new,
3841 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3842 _gpgme_engine_set_status_handler,
3843 _gpgme_engine_set_command_handler,
3844 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3845 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3846 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3847 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3848 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3849 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3850 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3851 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3852 _gpgme_engine_io_event): Reimplement.
3853 * engine.h: Fix a few comments and a variable name in a prototype.
3854 * ops.h: Do not include "rungpg.h".
3855 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3857 * recipient.c: Likewise.
3858 * signers.c: Likewise.
3859 * version.c: Likewise.
3860 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3861 functions and remove prototypes.
3862 (_gpgme_gpg_get_version): Make static and rename to ...
3863 (gpg_get_version): ... this.
3864 (_gpgme_gpg_check_version): Make static and rename to ...
3865 (gpg_check_version): ... this.
3866 (_gpgme_gpg_new): Make static. Change argument type from
3867 GpgObject * to void **. Call gpg_release instead
3869 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3870 (gpg_check_decrypt): ... this.
3871 (_gpgme_gpg_op_delete): Make static and rename to ...
3872 (gpg_check_delete): ... this.
3873 (_gpgme_gpg_set_recipients): Make static and rename to ...
3874 (gpg_check_set_recipients): ... this.
3875 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3876 (gpg_encrypt): ... this.
3877 (_gpgme_gpg_op_export): Make static and rename to ...
3878 (gpg_export): ... this.
3879 (_gpgme_gpg_op_genkey): Make static and rename to ...
3880 (gpg_genkey): ... this.
3881 (_gpgme_gpg_op_import): Make static and rename to ...
3882 (gpg_import): ... this.
3883 (_gpgme_gpg_op_keylist): Make static and rename to ...
3884 (gpg_keylist): ... this.
3885 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3886 (gpg_keylist_ext): ... this.
3887 (_gpgme_gpg_op_sign): Make static and rename to ...
3888 (gpg_sign): ... this.
3889 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3890 (gpg_trustlist): ... this.
3891 (_gpgme_gpg_op_verify): Make static and rename to ...
3892 (gpg_verify): ... this.
3893 (gpg_status_handler): Rename to ...
3894 (status_handler): ... this.
3895 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3896 (gpg_set_status_handler): ... this.
3897 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3898 (gpg_set_colon_line_handler): ... this.
3899 (gpgme_gpg_add_io_cb): Rename to ...
3900 (add_io_cb): ... this.
3901 (_gpgme_gpg_start): Make static and rename to ...
3902 (gpg_start): ... this.
3903 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3904 (gpg_set_io_cb): ... this.
3905 (_gpgme_gpg_io_event): Make static and rename to ...
3906 (gpg_io_event): ... this.
3907 (struct _gpgme_engine_ops_gpg): New variable.
3909 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3911 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3914 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3916 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3917 data-compat.c: New file. Really check them in this time, completes
3920 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3922 * types.h (GpgmeStatusHandler): ... here.
3923 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3925 * types.h (GpgmeColonLineHandler): ... here.
3926 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3928 * types.h (GpgmeCommandHandler): ... here.
3929 * engine.h: Don't include "rungpg.h".
3930 (_gpgme_engine_set_status_handler): Change type of
3931 argument from GpgStatusHandler to GpgmeStatusHandler.
3932 (_gpgme_engine_set_colon_line_handler): Change type of
3933 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3934 (_gpgme_engine_set_command_handler): Change type of
3935 argument from GpgCommandHandler to GpgmeCommandHandler.
3936 * engine-gpgsm.h: Don't include "rungpg.h".
3937 (_gpgme_gpgsm_set_status_handler): Change type of
3938 argument from GpgStatusHandler to GpgmeStatusHandler.
3939 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3940 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3941 * engine-gpgsm.c: Do not include "rungpg.h".
3942 (struct gpgsm_object_s): Change type of
3943 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3944 GpgmeColonLineHandler.
3945 (gpgsm_assuan_simple_command): Change type of argument from
3946 GpgStatusHandler to GpgmeStatusHandler.
3947 (_gpgme_gpgsm_set_status_handler): Likewise.
3948 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3949 GpgColonLineHandler to GpgmeColonLineHandler.
3950 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3951 argument from GpgStatusHandler to GpgmeStatusHandler.
3952 (_gpgme_gpg_set_colon_line_handler): Change type of
3953 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3954 (_gpgme_gpg_set_command_handler): Change type of
3955 argument from GpgCommandHandler to GpgmeCommandHandler.
3956 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3957 GpgmeStatusHandler. Change type of colon.fnc to
3958 GpgmeColonLineHandler. Change type of cmd.fnc to
3959 GpgmeCommandLineHandler.
3960 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3962 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3963 to GpgmeColonLineHandler.
3964 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3965 GpgmeCommandHandler.
3966 * engine.c (_gpgme_engine_set_status_handler): Change type of
3967 argument FNC to GpgmeStatusHandler.
3968 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3969 to GpgmeColonLineHandler.
3970 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3971 GpgmeCommandHandler.
3973 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
3974 * rungpg.c (struct gpg_object_s): Remove PM.
3975 (pipemode_cb): Prototype removed.
3976 (add_pm_data): Function removed.
3977 (_gpgme_gpg_enable_pipemode): Likewise.
3978 (pipemode_copy): Likewise.
3979 (pipemode_cb): Likewise.
3980 (add_arg): Don't check for pipemode.
3981 (add_data): Likewise.
3982 (_gpgme_gpg_set_status_handler): Likewise.
3983 (_gpgme_gpg_set_colon_line_handler): Likewise.
3984 (_gpgme_gpg_set_command_handler): Likewise.
3985 (_gpgme_gpg_spawn): Likewise.
3986 (_gpgme_gpg_spawn): Don't set PM.active.
3987 (_gpgme_gpg_op_verify): Remove pipemode case.
3988 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
3990 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3991 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
3992 _gpgme_gpg_set_simple_line_handler): Prototype removed.
3993 (_gpgme_gpg_set_verbosity): New prototype.
3994 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
3995 (add_data): ... this.
3996 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
3997 (_gpgme_gpg_set_command_handler): Likewise.
3998 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3999 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4000 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4001 _gpgme_gpg_op_verify): Likewise.
4002 (_gpgme_gpg_add_pm_data): Rename to ...
4003 (add_pm_data): ... this.
4004 (_gpgme_gpg_op_verify): Call add_pm_data, not
4005 _gpgme_gpg_add_pm_data.
4006 (_gpgme_gpg_add_arg): Make static and rename to ...
4007 (add_arg): ... this.
4008 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4009 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4010 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4011 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4012 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4013 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4014 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4015 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4017 (_gpgme_gpg_set_verbosity): New function.
4018 (struct gpg_object_s): Remove member simple from colon.
4019 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4020 (_gpgme_gpg_set_simple_line_handler): Removed function.
4021 (read_colon_line): Don't check the GPG->colon.simple.
4022 * engine.c (_gpgme_engine_set_verbosity): Call
4023 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4025 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4027 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4028 _gpgme_strdup, _gpgme_free): Remove prototypes.
4029 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4031 * util.c: File removed.
4032 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4033 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4034 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4035 xtrycalloc, free instead of xfree.
4036 (_gpgme_data_append_percentstring_for_xml): Likewise.
4037 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4038 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4039 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4040 _gpgme_data_get_as_string): Likewise.
4041 * debug.c (debug_init): Likewise.
4042 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4043 * delete.c (_gpgme_release_delete_result): Likewise.
4044 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4046 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4047 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4048 _gpgme_engine_release): Likewise.
4049 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4050 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4051 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4052 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4053 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4054 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4055 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4056 * genkey.c (_gpgme_release_genkey_result): Likewise.
4057 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4058 * import.c (_gpgme_release_import_result): Likewise.
4059 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4060 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4061 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4062 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4063 * ops.h (test_and_allocate_result): Likewise.
4064 * passphrase.c (_gpgme_release_passphrase_result,
4065 _gpgme_passphrase_status_handler,
4066 _gpgme_passphrase_command_handler): Likewise.
4067 * progress.c (_gpgme_progress_status_handler): Likewise.
4068 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4069 gpgme_recipients_add_name_with_validity): Likewise.
4070 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4071 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4072 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4073 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4075 * sign.c (_gpgme_release_sign_result): Likewise.
4076 * signers.c (_gpgme_signers_add): Likewise.
4077 * trustlist.c (trust_item_new, trustlist_colon_handler,
4078 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4079 gpgme_trustitem_release): Likewise.
4080 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4081 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4083 * w32-io.c (create_reader, create_writer, destroy_reader,
4084 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4085 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4086 * w32-util.c (read_w32_registry_string): Likewise.
4087 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4088 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4089 * data-compat.c: Include <stdlib.h>.
4091 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4093 New data object component:
4095 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4096 GpgmeDataReleaseCb): New types.
4097 (struct GpgmeDataCbs): New structure.
4098 (gpgme_data_read): Changed prototype to match that of read() closely.
4099 (gpgme_data_write): Similar for write().
4100 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4101 gpgme_data_new_from_stream): New prototypes.
4102 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4104 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4105 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4106 * data.c: Reimplemented from scratch.
4107 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4108 data-user.c): New file.
4109 * context.h (struct gpgme_data_s): Removed.
4110 * conversion.c: Include <errno.h> and <sys/types.h>.
4111 (_gpgme_data_append): New function.
4112 * data.c (_gpgme_data_append_string): Move to ...
4113 * conversion.c (_gpgme_data_append_string): ... here.
4114 * data.c (_gpgme_data_append_for_xml): Move to ...
4115 * conversion.c (_gpgme_data_append_for_xml): ... here.
4116 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4117 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4118 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4119 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4121 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4123 * types.h (GpgmeDataMode): Type removed.
4125 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4126 * edit.c (_gpgme_op_edit_start): Likewise.
4127 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4128 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4129 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4130 * export.c (_gpgme_op_export_start): Likewise.
4131 * genkey.c (_gpgme_op_genkey_start): Likewise.
4132 * import.c (_gpgme_op_import_start): Likewise.
4133 * sign.c (_gpgme_op_sign_start): Likewise.
4134 * verify.c (_gpgme_op_verify_start): Likewise.
4136 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4137 no recipient if no data was returned.
4138 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4139 no recipient if no data was returned.
4140 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4141 no recipient if no data was returned.
4143 * engine.c (_gpgme_engine_op_verify): Add new argument to
4144 differentiate detached from normal signatures.
4145 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4146 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4147 mode of data argument.
4148 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4149 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4150 (gpgme_op_verify): Likewise for prototype.
4151 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4152 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4153 * verify.c (_gpgme_op_verify_start): Likewise.
4154 (gpgme_op_verify_start): Likewise.
4155 (gpgme_op_verify): Likewise.
4157 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4158 direction of data object.
4159 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4160 determine direction of data object.
4161 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4162 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4163 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4164 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4165 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4167 (build_argv): Use new member INBOUND to determine direction of
4168 file descriptor. Don't check the data type.
4169 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4171 * gpgme.c (gpgme_get_op_info): Don't call
4172 _gpgme_data_get_as_string if CTX->op_info is NULL.
4174 * version.c (gpgme_check_engine): Function removed.
4176 2002-09-30 Werner Koch <wk@gnupg.org>
4178 * keylist.c (keylist_colon_handler): Take care when printing a
4179 NULL with the DEBUG.
4181 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4182 (gpgsm_status_handler): Run the colon function to indicate EOF.
4183 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4185 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4187 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4188 multiplication with base. Reported by Stéphane Corthésy.
4190 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4191 operation type in invocation of _gpgme_op_reset.
4193 2002-09-20 Werner Koch <wk@gnupg.org>
4195 * ath.c: Include sys/time.h if sys/select.h is not available.
4197 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4199 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4200 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4202 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4204 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4205 into gpgme unconditionally.
4206 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4208 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4210 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4212 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4214 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4215 (_gpgme_debug_end): Likewise.
4216 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4218 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4220 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4222 * version.c (_gpgme_get_program_version): Likewise.
4223 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4225 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4227 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4230 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4232 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4233 _gpgme_op_edit so its prototype is known early on.
4235 * conversion.c: New file.
4236 * util.h: Add prototypes for _gpgme_decode_c_string and
4238 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4240 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4241 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4242 calls to _gpgme_hextobyte.
4243 (hash_key): Likewise.
4245 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4247 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4248 _gpgme_engine_release, as this will reset pending to zero in the
4249 event done callback on cancelled operations.
4251 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4253 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4254 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4256 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4257 * rungpg.h: Also to prototype.
4258 * engine.c (_gpgme_engine_op_edit): Likewise.
4259 * engine.h: Likewise.
4260 * edit.c (_gpgme_op_edit_start): Likewise.
4262 2002-08-29 Werner Koch <wk@gnupg.org>
4264 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4266 * vasprintf.c (va_copy): Define macro if not yet defined.
4268 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4270 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4271 CTX->result.passphrase->no_passphrase if passphrase is given (good
4272 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4274 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4276 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4277 Return 0 on success, -1 on error.
4278 * version.c (_gpgme_get_program_version): Don't wait for the child.
4279 * engine.c (_gpgme_engine_housecleaning): Function removed.
4280 (do_reaping): Likewise.
4281 (_gpgme_engine_add_child_to_reap_list): Likewise.
4282 (struct reap_s): Removed.
4283 (reap_list): Likewise.
4284 (reap_list_lock): Likewise.
4285 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4286 _gpgme_engine_housecleaning and
4287 _gpgme_engine_add_child_to_reap_list.
4288 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4289 (struct gpg_object_s): Remove PID member.
4290 (_gpgme_gpg_new): Don't initialize GPG->pid.
4291 (_gpgme_gpg_spawn): Don't set GPG->pid.
4292 * wait.c (run_idle): Removed.
4293 (gpgme_wait): Run idle_function directly.
4295 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4297 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4298 variables encrypt_info and encrypt_info_len.
4299 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4300 * posix-sema.c (sema_fatal): Remove function.
4301 All these reported by Stéphane Corthésy.
4303 2002-08-23 Werner Koch <wk@gnupg.org>
4305 * gpgme-config.in: Made --prefix work for --libs.
4307 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4309 * ath.h: Update list of symbols that get a prefix: Rename the
4310 ath_mutex_*_available symbols to ath_*_available.
4312 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4314 * stpcpy.c: New file from gnulib.
4315 * Makefile.am (assuan_libobjs): Remove jnlib.
4317 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4319 * gpgme.h: Add prototype for gpgme_op_import_ext.
4320 * import.c (struct import_result_s): New member `nr_considered'.
4321 Rename `any_imported' to `nr_imported'.
4322 (import_status_handler): Increment nr_imported. Set nr_considered
4324 (gpgme_op_import_ext): New function.
4325 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4327 2002-08-20 Werner Koch <wk@gnupg.org>
4329 * gpgme.m4: Replaced with a new and faster version. This does not
4330 anymore try to build test programs. If we really need test
4331 programs, we should add an option to gpgme-config to do so.
4333 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4335 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4337 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4338 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4341 2002-08-19 Werner Koch <wk@gnupg.org>
4343 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4344 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4345 (_gpgme_decrypt_status_handler): Create an operation info.
4347 2002-08-14 Werner Koch <wk@gnupg.org>
4349 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4350 * key.c (gpgme_key_release): Release it. We need to add more code
4352 (_gpgme_key_append_name): Use memset to intialize the struct.
4353 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4354 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4357 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4358 information about the key type (PGP or X.509).
4359 (gpgme_key_get_ulong_attr): Likewise.
4361 * keylist.c (keylist_colon_handler): Include 1 in the check for
4362 valid algorithms so that RSA is usable. Store the issuer name and
4363 serial number also for "crs" records. Parse the expire date for
4365 (set_userid_flags): Put them onto the last appended key.
4367 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4369 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4371 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4373 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4376 The following changes make it possible to flush an inbound data
4377 pipe before invoking a command handler:
4379 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4380 _gpgme_io_select. Set timeout of 0 if this is set.
4381 * w32-io.c (_gpgme_io_select): Likewise.
4382 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4383 * wait.c (do_select): Add new argument to _gpgme_io_select
4385 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4386 linked_data to prototype.
4387 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4388 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4389 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4390 argument to _gpgme_engine_set_command_handler.
4391 * rungpg.c (struct gpg_object_s): New members linked_data and
4393 (_gpgme_gpg_new): Initialize those new members.
4394 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4395 (build_argv): Handle linked_data in the same hack as cb_data.
4396 (read_status): If linked_data is in use, flush the pipe before
4397 activating the command handler.
4398 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4401 The next changes export the status codes to the user:
4403 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4404 all STATUS_ with GPGME_.
4405 * delete.c (delete_status_handler): Likewise.
4406 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4407 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4408 (_gpgme_encrypt_sym_status_handler): Likewise.
4409 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4410 * engine-gpgsm.c (parse_status): Likewise.
4411 (gpgsm_status_handler): Likewise.
4412 (gpgsm_set_recipients): Likewise.
4413 * export.c (export_status_handler): Likewise.
4414 * genkey.c (genkey_status_handler): Likewise.
4415 * import.c (append_xml_impinfo): Likewise.
4416 (import_status_handler): Likewise.
4417 * keylist.c (keylist_status_handler): Likewise.
4418 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4419 (command_handler): Likewise.
4420 * progress.c (_gpgme_progress_status_handler): Likewise.
4421 * sign.c (_gpgme_sign_status_handler): Likewise.
4422 * trustlist.c (trustlist_status_handler): Likewise.
4423 * verify.c (_gpgme_verify_status_handler): Likewise.
4424 * gpgme.h (GpgmeEditCb): New type.
4425 * rungpg.h (GpgStatusCode): Rename and move to ...
4426 * gpgme.h (GpgmeStatusCode): ... this and here.
4427 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4428 * mkstatus: Prefix STATUS with GPGME_.
4429 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4431 * ops.h (_gpgme_verify_status_handler,
4432 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4433 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4434 _gpgme_progress_status_handler): Likewise.
4435 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4437 These changes add an edit operation to GPGME:
4439 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4440 ops.h: Add prototype for _gpgme_release_edit_result and
4441 _gpgme_passphrase_command_handler.
4442 * passphrase.c (command_handler): Make non-static and rename to ...
4443 (_gpgme_passphrase_command_handler): ... this.
4444 (_gpgme_passphrase_start): Use new name for command handler.
4445 * types.h: Add EditResult type.
4446 * gpgme.c (_gpgme_release_result): Release EDIT result.
4448 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4449 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4451 (assuan_libobjs): New variable, set this instead
4453 * engine.h (_gpgme_engine_op_edit): New prototype.
4454 * engine.c (_gpgme_engine_op_edit): New function.
4455 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4456 * rungpg.c (_gpgme_gpg_op_edit): New function.
4458 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4460 * delete.c (delete_problem): New case ambigious specification.
4461 (delete_status_handler): Handle new case (poorly).
4463 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4465 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4467 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4469 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4471 * vasprintf.c: Update to more recent libiberty version.
4472 * debug.h: Replace #elsif with #elif.
4474 Submitted by Stéphane Corthésy:
4475 * util.h (vasprintf): Correct prototype.
4476 * encrypt-sign.c: Include <stddef.h>.
4477 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4479 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4480 * ath-pth.c: Likewise.
4482 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4484 * wait.c (fdt_global): Make static. Reported by Stéphane
4487 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4488 patterns. Reported by Stéphane Corthésy.
4490 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4491 by Stéphane Corthésy.
4492 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4493 silence gcc warning.
4495 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4497 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4499 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4501 * gpgme.c (_gpgme_op_event_cb_user): New function.
4502 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4503 for private or user event loop. Use new user event callback
4505 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4506 * keylist.c (gpgme_op_keylist_start): Likewise.
4508 * rungpg.c (_gpgme_gpg_io_event): New function.
4509 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4510 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4511 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4512 * engine.c (_gpgme_engine_io_event): New function.
4513 * engine.h (_gpgme_engine_io_event): New prototype.
4514 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4515 the real work for the default IO callback routines to ...
4516 (_gpgme_op_keylist_event_cb): ... here. New function.
4517 * trustlist.c (trustlist_colon_handler): Signal
4518 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4519 (_gpgme_op_trustlist_event_cb): ... here. New function.
4520 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4521 and _gpgme_op_trustlist_event_cb when appropriate.
4522 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4523 (_gpgme_op_trustlist_event_cb): Likewise.
4524 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4525 user provided event handler directly.
4526 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4528 * wait.c (_gpgme_add_io_cb): Likewise.
4529 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4530 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4531 argument. Fix up error handling.
4532 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4533 new argument, fix up error handling.
4535 2002-07-03 Werner Koch <wk@gnupg.org>
4537 * encrypt.c (status_handler_finish): New.
4538 (_gpgme_encrypt_status_handler): Moved some code out to the new
4539 function and call this function also in case we get into the
4540 status handler with an error which might happen due to a kludge in
4543 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4545 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4546 table (eg use synchronous mode).
4548 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4550 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4551 prototype and change return type to GpgmeError.
4552 (_gpgme_wait_one): New prototype.
4553 * wait.c (gpgme_wait): Replace with the meat from
4554 _gpgme_wait_on_condition here, and remove the support for
4556 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4557 and change return type to GpgmeError. Replace with meat from
4558 _gpgme_wait_one and add support for conditions.
4559 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4561 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4562 table (eg use synchronous mode).
4563 (gpgme_op_keylist_next): Remove HANG argument from
4564 _gpgme_wait_on_condition. Check its return value.
4565 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4566 table (eg use synchronous mode).
4567 (gpgme_op_trustlist_next): Remove HANG argument from
4568 _gpgme_wait_on_condition. Check its return value.
4570 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4572 * gpgme.h: Fix documentation of key attribute retrieval functions.
4574 2002-06-26 Werner Koch <wk@gnupg.org>
4576 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4578 * import.c (append_xml_impinfo): Kludge to print fingerprint
4579 instead of keyid for use with gpgsm.
4580 (import_status_handler): Set a flag to know whether any import
4582 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4584 2002-06-25 Werner Koch <wk@gnupg.org>
4586 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4589 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4591 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4593 * export.c (gpgme_op_export): If no data was returned, return
4594 GPGME_No_Recipients.
4596 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4598 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4600 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4602 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4603 (parse_status): New function.
4604 (gpgsm_status_handler): Use parse_status.
4605 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4606 STATUS_FNC_VALUE and process status messages.
4607 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4608 (gpgsm_set_fd): Likewise.
4609 (_gpgme_gpgsm_op_keylist): Likewise.
4610 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4611 (_gpgme_gpgsm_op_sign): Likewise.
4613 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4615 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4617 2002-06-20 Werner Koch <wk@gnupg.org>
4619 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4621 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4623 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4624 (gpgme_get_sig_string_attr): Hack to return info on the key
4625 usage. Does now make use of the former RESERVED argument which
4626 has been renamed to WHATIDX.
4627 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4629 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4631 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4632 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4633 error, or there are no more file descriptors to wait on.
4634 (_gpgme_wait_on_condition): Ignore return value from do_select for
4637 2002-06-13 Werner Koch <wk@gnupg.org>
4639 * verify.c (gpgme_op_verify): Make sure that we never access an
4640 unitialized result structure.
4642 2002-06-12 Werner Koch <wk@gnupg.org>
4644 * keylist.c (struct keylist_result_s): New.
4645 (_gpgme_release_keylist_result): Release it here
4646 (keylist_status_handler): Handle truncated.
4647 (append_xml_keylistinfo): New.
4648 * gpgme.c (_gpgme_release_result): and use it here.
4649 * types.h: Declare the new type here.
4650 * context.h (struct gpgme_context_s): Use it here.
4652 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4654 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4655 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4656 use our own close notification mechanism without interfering with
4659 2002-06-11 Werner Koch <wk@gnupg.org>
4661 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4663 * verify.c (calc_sig_summary): New.
4664 (gpgme_get_sig_ulong_attr): And use it here.
4666 2002-06-10 Werner Koch <wk@gnupg.org>
4668 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4669 * verify.c (is_token, copy_token): New.
4670 (_gpgme_verify_status_handler): Use copy_token, handle the new
4671 ERROR status and store the errorcode used withgpgsm and trust
4673 * gpgme.h: New attribute ERRTOK.
4674 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4675 (gpgme_get_sig_string_attr): Use it here to return the last error.
4677 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4679 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4680 close notification for the status fd to ...
4681 (_gpgme_gpgsm_new): ... here.
4682 * wait.h: Include "sema.h". Remove prototypes of
4683 _gpgme_remove_proc_from_wait_queue and
4684 _gpgme_register_pipe_handler. Add prototypes of
4685 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4686 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4688 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4689 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4690 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4691 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4692 proc_s. Replace struct wait_item_s.
4693 (_gpgme_fd_table_init): New function.
4694 (_gpgme_fd_table_deinit): Likewise.
4695 (_gpgme_fd_table_put): Likewise.
4696 (set_process_done): Remove function.
4697 (do_select): Take argument FDT. Use that to decide which fds to
4699 (_gpgme_remove_proc_from_wait_queue): Remove function.
4700 (_gpgme_wait_event_cb): New function.
4701 (_gpgme_wait_one): Likewise.
4702 (_gpgme_register_pipe_hanldler): Remove function.
4703 (_gpgme_add_io_cb): New function.
4704 (_gpgme_remove_io_cb): Likewise.
4705 (_gpgme_freeze_fd): Remove function.
4706 (_gpgme_thaw_fd): Remove function.
4707 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4708 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4709 IDX to CMD. Add new member IO_CBS.
4710 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4711 For each I/O callback, check if it should be unregistered. If all
4712 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4713 Remove member RUNNING.
4714 (_gpgme_gpg_new): Initialize new members.
4715 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4716 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4717 (build_argv): Store away the index instead the file descriptor for
4719 (_gpgme_gpg_add_io_cb): New function.
4720 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4722 (gpg_status_handler): Change return type to void, remove PID
4723 argument, close filedescriptor if EOF or error occurs.
4724 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4725 Use IO_CBS->remove instead _gpgme_freeze_fd.
4726 (gpg_colon_line_handler): Change return type to void, remove PID
4727 argument, close filedescriptor if EOF or error occurs.
4728 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4729 (_gpgme_gpg_set_io_cbs): New function.
4730 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4731 _gpgme_gpg_set_io_cbs.
4732 * gpgme.h (GpgmeIOCb): New type.
4733 (GpgmeRegisterIOCb): Likewise.
4734 (GpgmeRemoveIOCb): Likewise.
4735 (GpgmeEventIO): Likewise.
4736 (GpgmeEventIOCb): Likewise.
4737 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4738 (gpgme_set_op_io_cbs): New prototype.
4739 (gpgme_get_op_io_cbs): Likewise.
4740 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4741 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4742 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4743 prototype. Add prototype for _gpgme_op_reset.
4744 Add synchronous argument to _gpgme_decrypt_start prototype.
4745 * io.h: Beautification.
4746 * gpgme.c: Include "wait.h".
4747 (gpgme_new): Initialize FDT.
4748 (gpgme_set_io_cbs): New function.
4749 (gpgme_get_io_cbs): Likewise.
4750 (_gpgme_op_event_cb): Likewise.
4751 * data.c (_gpgme_data_inbound_handler): Change return type to
4752 void. Drop PID argument. Close FD on error and EOF.
4753 (write_mem_data): Don't close FD here ...
4754 (write_cb_data): ... or here ...
4755 (_gpgme_data_outbound_handler): ... but here. Change return type
4756 to void. Drop PID argument.
4757 * context.h: Include "wait.h".
4758 (struct gpgme_context_s): New members FDT and IO_CBS.
4759 * op-support.c: New file.
4760 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4761 * ops.h: Add prototype for _gpgme_op_reset().
4762 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4764 (gpgme_op_decrypt_start): Add synchronous argument.
4765 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4767 * delete.c (gpgme_op_delete_start): Rename to ...
4768 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4769 Use _gpgme_op_reset. Make function static.
4770 (gpgme_op_delete_start): Just a wrapper around
4771 _gpgme_op_delete_start now.
4772 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4774 * encrypt.c: Include "wait.h".
4775 (ggpgme_op_encrypt_start): Rename to ...
4776 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4777 Use _gpgme_op_reset. Make function static.
4778 (gpgme_op_encrypt_start): Just a wrapper around
4779 _gpgme_op_encrypt_start now.
4780 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4782 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4783 (_gpgme_op_encrypt_sign_start): ... this. New argument
4784 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4785 (gpgme_op_encrypt_sign_start): Just a wrapper around
4786 _gpgme_op_encrypt_sign_start now.
4787 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4788 _gpgme_wait_one instead gpgme_wait.
4789 * export.c (gpgme_op_export_start): Rename to ...
4790 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4791 Use _gpgme_op_reset. Make function static.
4792 (gpgme_op_export_start): Just a wrapper around
4793 _gpgme_op_export_start now.
4794 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4796 * genkey.c (gpgme_op_genkey_start): Rename to ...
4797 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4798 Use _gpgme_op_reset. Make function static.
4799 (gpgme_op_genkey_start): Just a wrapper around
4800 _gpgme_op_genkey_start now.
4801 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4803 * import.c (gpgme_op_import_start): Rename to ...
4804 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4805 Use _gpgme_op_reset. Make function static.
4806 (gpgme_op_import_start): Just a wrapper around
4807 _gpgme_op_import_start now.
4808 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4810 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4811 (gpgme_op_keylist_ext_start): Likewise.
4812 * sign.c (gpgme_op_sign_start): Rename to ...
4813 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4814 _gpgme_op_reset. Make function static.
4815 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4817 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4819 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4820 * verify.c (gpgme_op_verify_start): Rename to ...
4821 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4822 Use _gpgme_op_reset. Make function static.
4823 (gpgme_op_verify_start): Just a wrapper around
4824 _gpgme_op_verify_start now.
4825 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4827 * engine-gpgsm.c (iocb_data_t): New type.
4828 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4829 and input_data with input_cb. Replace output_fd and output_data
4830 with output_cb. Replace message_fd and message_data with
4831 message_cb. New member io_cbs.
4832 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4834 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4835 callback, check if it should be unregistered. If all callbacks
4836 have been unregistered, trigger GPGME_EVENT_DONE.
4837 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4838 names to close the file descriptors.
4839 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4840 (_gpgme_gpgsm_op_encrypt): Likewise.
4841 (_gpgme_gpgsm_op_genkey): Likewise.
4842 (_gpgme_gpgsm_op_import): Likewise.
4843 (_gpgme_gpgsm_op_keylist): Likewise.
4844 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4845 (_gpgme_gpgsm_op_sign): Likewise.
4846 (_gpgme_gpgsm_op_verify): Likewise.
4847 (gpgsm_status_handler): Drop argument PID. Change return type to
4848 void. Close status pipe before returning because of EOF or error.
4849 (_gpgme_gpgsm_add_io_cb): New function.
4850 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4852 (_gpgme_gpgsm_set_io_cbs): New function.
4853 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4854 * engine.c (_gpgme_engine_set_io_cbs): New function.
4855 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4857 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4859 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4861 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4863 * key.c: Include <ctype.h>.
4864 (_gpgme_key_append_name): Skip one more char when
4865 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4866 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4868 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4870 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4871 * posix-sema.c: Use that prefix here.
4872 * posix-io.c: Include "ath.h".
4873 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4874 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4875 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4876 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4878 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4880 * Makefile.am (ath_components): New variable.
4881 (ath_components_pthread): Likewise.
4882 (ath_components_pth): Likewise.
4883 (system_components): Add ath_componentes.
4887 * ath-pthread.c: Likewise.
4888 * ath-pth.c: Likewise.
4889 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4891 * mutex.h: Remove file.
4893 2002-05-30 Werner Koch <wk@gnupg.org>
4895 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4896 an issuer with IDX > 0. We don't support altIssuerNames for now.
4898 2002-05-22 Werner Koch <wk@gnupg.org>
4900 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4901 missing variable definition. Oohh - Marcus was faster.
4903 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4905 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4907 2002-05-21 Werner Koch <wk@gnupg.org>
4909 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4910 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4912 2002-05-10 Werner Koch <wk@gnupg.org>
4914 * key.h (gpgme_key_s): Add OTRUST.
4915 * keylist.c (set_ownertrust): New.
4916 (keylist_colon_handler): Get the ownertrust value
4917 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4920 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4922 * w32-util.c: New static variable GET_PATH_LOCK.
4923 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4924 Take lock while determining path.
4925 (_gpgme_get_gpgsm_path): Likewise.
4926 * version.c (do_subsystem_inits): Set DONE to 1 after
4928 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4929 while determining engine info.
4930 * rungpg.c (_gpgme_gpg_get_version): New variable
4931 GPG_VERSION_LOCK. Take the lock while determining the program
4933 * posix-io.c: Include "sema.h".
4934 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4935 while fixing the signals.
4936 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4937 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4939 (capabilities_to_string): Make STRINGS very const.
4940 (_gpgme_key_cache_add): Lock the key cache.
4941 (_gpgme_key_cache_get): Likewise.
4942 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4943 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4944 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4946 * engine.c (_gpgme_engine_get_info): New variable
4947 ENGINE_INFO_LOCK. Take lock while determining engine info.
4948 * engine-gpgsm.c: Include "sema.h".
4949 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4950 lock while getting program version.
4952 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4954 * debug.h: New file.
4955 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4956 * util.h: Removed all prototypes and declarations related to
4957 debugging. Include "debug.h".
4959 * debug.c (debug_level): Comment variable and remove superfluous
4962 (_gpgme_debug_enabled): Function removed.
4963 (struct debug_control_s): Definition removed.
4964 (_gpgme_debug_level): Function removed.
4965 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4966 pritnf-style format specification and a variable number of
4968 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4969 starts out with "%s" for simplicity.
4970 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4971 TEXT argument anymore.
4973 * posix-io.c (_gpgme_io_select): Use new level argument for
4974 DEBUG_BEGIN instead explicit if construct.
4976 * debug.c (debug_init): Remove superfluous zero initializer,
4977 remove volatile flag of INITIALIZED. Do not use the
4978 double-checked locking algorithm, it is fundamentally flawed and
4979 will empty your fridge (on a more serious note, despite the
4980 volatile flag it doesn't give you the guarantee you would expect,
4981 for example on a DEC Alpha or an SMP machine. The volatile only
4982 serializes accesses to the volatile variable, but not to the other
4985 2002-05-03 Werner Koch <wk@gnupg.org>
4987 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
4988 output to /dev/null.
4990 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
4991 * gpgme.c (gpgme_get_protocol): New.
4993 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
4994 (gpgme_data_read): Ditto.
4996 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
4997 lines so that a claim can be made without looking up the key.
4998 (gpgme_get_sig_string_attr): New.
4999 (gpgme_get_sig_ulong_attr): New.
5001 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5003 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5004 list to align with the status.h file from gnupg.
5006 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5007 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5008 these new status codes. Store the expiration time
5010 2002-04-27 Werner Koch <wk@gnupg.org>
5012 * gpgme.h (GpgmeData_Encoding): New.
5013 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5014 * engine-gpgsm.c (map_input_enc): New. Use it in all local
5015 functions where the INPUT command gets send.
5017 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
5019 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5020 descriptor only when we don't need it anymore. Close the message
5021 descriptor if we don't need it.
5023 2002-04-26 Werner Koch <wk@gnupg.org>
5025 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5027 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5029 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5030 GPG->cmd.cb_data, not xfree.
5032 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5034 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5035 ttytype, lc_ctype and lc_messages options in the server.
5037 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5039 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5041 2002-04-23 Werner Koch <wk@gnupg.org>
5043 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5044 can_certify to return the requested values.
5046 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5048 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5050 (gpgme_get_passphrase_cb): Likewise.
5052 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5054 * gpgme.c (gpgme_get_passphrase_cb): New function.
5055 (gpgme_get_progress_cb): New function.
5056 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5057 gpgme_get_progress_cb.
5059 2002-03-28 Werner Koch <wk@gnupg.org>
5061 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5062 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5063 * keylist.c (keylist_colon_handler): Store them.
5064 * key.c (gpgme_key_release): Free them.
5065 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5067 2002-03-26 Werner Koch <wk@gnupg.org>
5069 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5071 2002-03-21 Werner Koch <wk@gnupg.org>
5073 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5076 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5078 * Makefile.am (system_components): New variable, set depending on
5080 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5081 * syshdr.h: File removed.
5083 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5084 * posix-sema.c: Likewise.
5085 * posix-util.c: Likewise.
5087 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5088 * w32-sema.c: Likewise.
5089 * w32-util.c: Likewise.
5091 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5092 * posix-sema.c: Likewise.
5093 * w32-io.c: Include `io.h', do not include `syshdr.h'
5094 * w32-sema.c: Likewise.
5095 * w32-util.c: Likewise.
5096 * data.c: Do not include `syshdr.h'.
5098 * wait.h: Code cleanup.
5100 * mutex.h: New file.
5101 * posix-sema.c: Implement.
5103 2002-03-08 Werner Koch <wk@gnupg.org>
5105 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5107 2002-03-07 Werner Koch <wk@gnupg.org>
5109 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5111 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5113 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5114 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5115 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5116 as status handler and run _gpgme_passphrase_start.
5117 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5119 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5122 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5124 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5126 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5127 error No_Passphrase if only a bad passphrase was provided.
5129 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5131 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5132 GPGME_DATA_MODE_IN, construct a command line that stores the
5134 * verify.c (gpgme_op_verify_start): Accept TEXT being
5135 uninitialized, and in this case interpret SIG as a normal or
5136 cleartext signature and TEXT as a return data object.
5137 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5139 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5141 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5144 2002-02-28 Werner Koch <wk@gnupg.org>
5146 * key.h (subkey_s): New member expires_at.
5147 * keylist.c (keylist_colon_handler): Set it here
5148 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5150 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5152 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5153 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5154 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5155 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5156 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5157 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5158 * keylist.c (gpgme_op_keylist_ext_start): New function.
5160 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5162 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5163 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5164 rename no_recipients to no_valid_recipients.
5165 (_gpgme_encrypt_status_handler): Include error for invalid
5167 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5168 argument to GpgsmObject. Use that to report back the status about
5171 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5173 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5175 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5177 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5178 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5179 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5180 (_gpgme_gpg_op_sign): Use that new function.
5181 (_gpgme_gpg_op_encrypt_sign): New function.
5182 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5183 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5184 (gpgme_op_encrypt_sign): Likewise.
5185 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5186 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5187 (_gpgme_sign_status_handler): Add prototype.
5188 * sign.c (sign_status_handler): Rename to ...
5189 (_gpgme_sign_status_handler): ... this and make non-static.
5190 * encrypt.c (encrypt_status_handler): Rename to ...
5191 (_gpgme_encrypt_status_handler): ... this and make non-static.
5192 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5193 * sign.c (gpgme_op_sign_start): Likewise.
5195 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5197 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5198 see if the problem is due to a missing key, and report that back
5201 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5203 * context.h (struct gpgme_context_s): New member include_certs.
5204 * gpgme.h (gpgme_set_include_certs): Add prototype.
5205 (gpgme_get_include_certs): Likewise.
5206 * gpgme.c (gpgme_set_include_certs): New function.
5207 (gpgme_get_include_certs): Likewise.
5208 (gpgme_new): Set include_certs to 1 (the default).
5209 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5210 and pass it to _gpgme_gpgsm_op_sign.
5211 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5212 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5213 include_certs and handle it.
5214 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5215 * sign.c (gpgme_op_sign_start): Add new argument to
5216 _gpgme_engine_op_sign call.
5218 2002-02-14 Werner Koch <wk@gnupg.org>
5220 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5222 2002-02-13 Werner Koch <wk@gnupg.org>
5224 * vasprintf.c, fopencookie.c: Add replacement functions.
5225 * util.h: Add prototypes for them.
5227 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5229 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5230 reach the end of the function.
5232 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5234 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5235 (gpgme_op_genkey_start): Skip newlines after opening tag.
5237 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5239 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5241 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5242 set, and pass them down to the crypto engine.
5243 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5244 * engine.h: Likewise.
5245 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5246 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5248 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5250 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5253 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5255 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5257 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5260 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5262 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5263 status of the returned context is returned.
5264 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5265 aware of cancelled processes, and to allow to use gpgme_wait with
5266 CTX being NULL (as documented in the source).
5267 (struct proc_s): New member REPORTED.
5268 * gpgme.h: Fix prototype.
5269 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5270 * sign.c (gpgme_op_sign): Likewise.
5271 * import.c (gpgme_op_import): Likewise.
5272 * genkey.c (gpgme_op_genkey): Likewise.
5273 * export.c (gpgme_op_export): Likewise.
5274 * encrypt.c (gpgme_op_encrypt): Likewise.
5275 * delete.c (gpgme_op_delete): Likewise.
5276 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5278 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5280 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5282 (gpgme_get_keylist_mode): New function.
5283 (gpgme_new): Set the default for keylist_mode member of CTX.
5285 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5286 (gpgme_get_keylist_mode): New prototype.
5287 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5288 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5290 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5292 This patch has gotten a bit large... mmh. The main thing that
5293 happens here is that error values are now not determined in the
5294 operation function after gpgme_wait completed, but in the status
5295 handler when EOF is received. It should always be the case that
5296 either an error is flagged or EOF is received, so that after a
5297 gpgme_wait you should never have the situation that no error is
5298 flagged and EOF is not received. One problem is that the engine
5299 status handlers don't have access to the context, a horrible
5300 kludge works around this for now. All errors that happen during a
5301 pending operation should be catched and reported in ctx->error,
5302 including out-of-core and cancellation. This rounds up neatly a
5303 couple of loose ends, and makes it possible to pass up any errors
5304 in the communication with the backend as well. As a bonus, there
5305 will be a function to access gpgme->wait, so that the operations
5306 can truly be implemented with their _start function.
5308 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5309 error back to the context.
5310 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5312 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5314 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5315 to a value indication that.
5317 * verify.c (add_notation): Set error, not out_of_core.
5318 (finish_sig): Likewise.
5319 (gpgme_op_verify_start): Don't clear out_of_core.
5320 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5321 (gpgme_op_verify): And don't do it here.
5323 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5324 (gpgme_op_trustlist_start): Don't clear out_of_core.
5325 (gpgme_op_trustlist_next): Check error, not out_of_core.
5326 (gpgme_op_trustlist_end): Likewise.
5328 * ops.h (test_and_allocate_result): New macro.
5329 (_gpgme_passphrase_result): Remove prototype.
5330 * delete.c (gpgme_op_delete): Return error from context.
5331 (delete_status_handler): Use macro test_and_allocate_result.
5332 Perform error checking at EOF.
5333 (gpgme_op_delete_start): Release result.
5334 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5335 test_and_allocate_result, and perform error checking here.
5336 (_gpgme_passphrase_result): Function removed.
5337 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5338 (gpgme_op_sign): Just return the error value from the context.
5339 (sign_status_handler): Only progress if no error is set yet. If
5340 we process an EOF, set the resulting error value (if any).
5341 * decrypt.c (_gpgme_decrypt_result): Function removed.
5342 (create_result_struct): Function removed.
5343 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5344 caclulate error on EOF, do not progress with errors.
5345 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5346 (gpgme_op_decrypt): Just return the error value from the context.
5347 * encrypt.c (encrypt_status_handler): Perform the error checking
5349 (gpgme_op_encrypt_start): Do not clear out_of_core.
5350 * export.c (export_status_handler): Return if error is set in context.
5351 (gpgme_op_export_start): Release result.
5352 (gpgme_op_export): Return error from context.
5353 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5355 * genkey.c (genkey_status_handler): Use macro
5356 test_and_allocate_result. Perform error checking at EOF.
5357 (gpgme_op_genkey): Just return the error from context.
5358 * import.c (gpgme_op_import): Return the error from context.
5359 (import_status_handler): Use macro test_and_allocate_result.
5360 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5361 (gpgme_op_keylist_next): Return error of context.
5362 (keylist_colon_handler): Set error instead out_of_code.
5363 (finish_key): Likewise.
5365 * context.h: Remove member out_of_core, add member error.
5366 * gpgme.c (_gpgme_release_result): Clear error flag.
5368 * engine.h (_gpgme_engine_get_error): New prototype.
5369 * engine.c (_gpgme_engine_get_error): New function.
5370 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5372 * engine-gpgsm.c (map_assuan_error): New function.
5373 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5374 use the new function to map error values.
5375 (gpgsm_set_fd): Change return type tp GpgmeError.
5376 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5377 (gpgsm_set_recipients): Likewise. Change type of return value
5378 equivalently. Adjust error values.
5379 (_gpgme_gpgsm_op_import): Likewise.
5380 (_gpgme_gpgsm_op_sign): Likewise.
5381 (struct gpgsm_object_s): New member error.
5382 (gpgsm_status_handler): Set error if error occurs. Determine
5383 error number from ERR line received. If assuan_read_line fails,
5384 terminate the connection.
5386 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5388 * Makefile.am (MOSTLYCLEANFILES): New variable.
5390 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5392 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5393 connection to the server.
5395 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5397 * rungpg.h: Add STATUS_KEY_CREATED.
5399 * progress.c: New file.
5400 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5402 * genkey.c (genkey_status_handler): Use
5403 _gpgme_progress_status_handler. Add check for status.
5404 (struct genkey_result_s): New structure.
5405 (_gpgme_release_genkey_result): New function.
5406 (gpgme_op_genkey): Check for error.
5407 * gpgme.c (_gpgme_release_result): Call
5408 _gpgme_release_genkey_result.
5409 * ops.h (_gpgme_release_genkey_result): Add prototype.
5410 * types.h (GenKeyResult): New type.
5411 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5413 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5415 * gpgme.c (_gpgme_release_result): Call
5416 _gpgme_release_delete_result.
5417 * ops.h (_gpgme_release_delete_result): Add prototype.
5418 * types.h (DeleteResult): New type.
5419 * context.h (gpgme_context_s): Add DeleteResult to member result.
5421 * delete.c (enum delete_problem): New type.
5422 (struct delete_result_s): New structure.
5423 (_gpgme_release_delete_result): New function.
5424 (delete_status_handler): Implement more status codes.
5425 (gpgme_op_delete): Return error on failure.
5427 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5429 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5431 * import.c (struct import_result_s): New structure.
5432 (_gpgme_release_import_result): New function.
5433 (append_xml_impinfo): Likewise.
5434 (import_status_handler): Implement.
5435 * gpgme.c (_gpgme_release_result): Add call to
5436 _gpgme_release_import_result.
5437 * ops.h (_gpgme_release_import_result): Add prototype.
5438 * types.h (ImportResult): New type.
5439 * context.h (gpgme_context_s): Add ImportResult to member result.
5441 * encrypt.c (gpgme_op_encrypt): Code clean up.
5443 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5445 * gpgme.h: Add lots of comment and fix the formatting. Add
5446 gpgme_trustlist_end prototype.
5448 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5450 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5451 gpgme_register_idle to return and accept this type.
5452 * wait.c (gpgme_register_idle): Fix type.
5453 Save and return old value of idle_function.
5455 2002-01-29 Werner Koch <wk@gnupg.org>
5457 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5459 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5462 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5464 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5465 not assuan_pipe_disconnect.
5467 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5468 jnlib (needed by assuan) statically into libgpgme. Linking a
5469 static library into a shared library this way is not portable.
5471 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5473 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5476 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5478 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5479 from off_t to size_t.
5480 * gpgme.h: Likewise.
5482 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5484 * wait.c (_gpgme_wait_on_condition): If the process finished,
5485 reset the pending flag. Also if the operation was cancelled.
5487 (struct proc_s): Rename READY to DONE.
5488 (wait_item_s): Likewise.
5489 (set_process_ready): Rename to ...
5490 (set_process_done): ... this.
5491 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5492 instead set_process_ready.
5493 (_gpgme_wait_on_condition): Likewise.
5494 (do_select): Rename READY to DONE.
5496 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5497 * sign.c (gpgme_op_sign): Likewise.
5498 * import.c (gpgme_op_import): Likewise.
5499 * genkey.c (gpgme_op_genkey): Likewise.
5500 * export.c (gpgme_op_export): Likewise.
5501 * encrypt.c (gpgme_op_encrypt): Likewise.
5502 * delete.c (gpgme_op_delete): Likewise.
5503 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5504 * decrypt.c (gpgme_op_decrypt): Likewise.
5506 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5508 * export.c: Cleanup.
5510 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5512 * trustlist.c: Various source clean ups.
5513 (my_isdigit): Removed.
5514 (gpgme_op_trustlist_end): New function.
5516 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5518 * gpgme.c: Various source clean ups, like renaming C to CTX where
5520 (gpgme_new): Clear R_CTX before starting the work.
5521 (my_isdigit): Removed.
5522 (my_isxdigit): Likewise.
5524 * data.c: Various source clean ups.
5525 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5526 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5527 (gpgme_data_new_from_file): Loop over fread while EINTR.
5528 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5529 be zero. Loop over fread while EINTR.
5531 (my_isdigit): Removed.
5532 (my_isxdigit): Likewise.
5534 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5536 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5537 Pipe_Error where appropriate.
5539 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5541 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5543 * version.c (get_engine_info): Remove prototype.
5545 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5547 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5548 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5550 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5552 * keylist.c (gpgme_op_keylist_end): New function.
5553 * gpgme.h (gpgme_op_keylist_end): New prototype.
5555 * engine.h (gpgme_engine_check_version): Move prototype to ...
5556 * gpgme.h (gpgme_engine_check_version): ... here.
5558 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5560 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5562 * version.c (gpgme_get_engine_info): Reimplemented.
5563 (gpgme_check_engine): Reimplemented.
5564 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5566 * engine.c: Include `io.h'.
5567 (gpgme_engine_get_info): New function.
5568 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5571 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5573 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5574 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5575 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5577 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5578 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5579 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5580 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5581 own function by call to _gpgme_engine_add_child_to_reap_list().
5583 * wait.c: Include `engine.h'.
5584 (run_idle): Call _gpgme_engine_housecleaning(), not
5585 _gpgme_gpg_housecleaning().
5587 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5589 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5590 Initialize the next field of the uid structure.
5591 (gpgme_key_get_as_xml): Do not list last uid first.
5593 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5595 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5596 function [!ENABLE_GPGSM].
5598 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5600 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5601 message_data, not SIG.
5602 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5604 * sign.c (sign_status_handler): Call
5605 _gpgme_passphrase_status_handler early.
5607 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5609 * engine-gpgsm.c: Revert last change.
5611 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5613 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5614 handler when ending this operation, otherwise the wait function
5617 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5619 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5620 (_gpgme_gpgsm_new): Initialize some more members.
5621 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5622 (gpgsm_status_handler): Rework the inline-data processing.
5624 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5626 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5627 list that are not dup'ed, for those the close-on-exec flag is set
5629 * version.c (_gpgme_get_program_version): Remove first entry in
5630 CFD, as the close-on-exec flag is now set for this fd.
5632 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5634 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5635 option to `ENCRYPT'.
5636 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5639 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5641 * engine-gpgsm.c (close_notify_handler): New function.
5642 (_gpgme_gpgsm_new): Manage the file descriptors a
5643 bit differently. Do not set close-on-exec flags.
5644 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5645 to -1, this is done by the close handler.
5646 (_gpgme_gpgsm_op_encrypt): Likewise.
5647 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5648 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5649 (_gpgme_gpgsm_op_sign): Likewise.
5650 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5652 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5653 non-inherited file descriptor index of the pipe.
5655 2001-12-13 Werner Koch <wk@gnupg.org>
5657 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5658 (gpgsm_status_handler): Pass datalines to a colon handler
5659 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5662 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5664 (gpgsm_assuan_simple_command): Removed underscore from
5666 (_gpgme_gpgsm_start): Ditto.
5667 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5668 function by the new assuan_read_line. Removed the use of the
5670 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5671 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5674 * keylist.c (keylist_colon_handler): Handle "crt" records
5675 * key.h (gpgme_key_s): Add an x509 flag.
5676 * key.c (parse_x509_user_id): New.
5677 (_gpgme_key_append_name): Handle x.509 names.
5679 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5681 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5684 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5686 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5687 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5689 (_gpgme_gpgsm_op_sign): Likewise.
5691 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5693 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5696 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5698 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5700 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5702 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5703 Deal with assuan read line returning more than one line (for now).
5705 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5707 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5708 the current protocol definition.
5710 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5712 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5715 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5717 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5718 for now, rungpg.h and status-table.h.
5719 (gpgsm_status_handler): Implement more of the status handler.
5721 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5723 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5724 (_gpgme_engine_op_delete): Likewise.
5725 (_gpgme_engine_op_encrypt): Likewise.
5726 (_gpgme_engine_op_export): Likewise.
5727 (_gpgme_engine_op_genkey): Likewise.
5728 (_gpgme_engine_op_keylist): Likewise.
5729 (_gpgme_engine_op_sign): Likewise.
5730 (_gpgme_engine_op_trustlist): Likewise.
5732 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5733 (gpgsm_assuan_simple_command): Likewise.
5734 (gpgsm_set_recipients): Likewise.
5735 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5736 (_gpgme_gpgsm_op_delete): New function.
5737 (_gpgme_gpgsm_op_export): Likewise.
5738 (_gpgme_gpgsm_op_genkey): Likewise.
5739 (_gpgme_gpgsm_op_sign): Likewise.
5740 (_gpgme_gpgsm_op_keylist): Likewise.
5741 (_gpgme_gpgsm_op_trustlist): Likewise.
5742 (_gpgme_gpgsm_release): Release command.
5743 (_gpgme_gpgsm_op_decrypt): Allocate command.
5744 (_gpgme_gpgsm_op_import): Likewise.
5745 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5747 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5749 * gpgme.h (gpgme_set_protocol): New prototype.
5751 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5753 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5754 (_gpgme_gpgsm_op_import): Likewise.
5756 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5758 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5760 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5762 2001-11-22 Werner Koch <wk@gnupg.org>
5764 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5765 is defined even with an undefined GPGSM_PATH.
5767 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5769 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5770 gpg_outbound_handler): Moved to ...
5771 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5772 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5773 _gpgme_* ones non-static.
5774 * data.c: Include io.h.
5776 * ops.h (_gpgme_data_inbound_handler): New prototype.
5777 (_gpgme_data_outbound_handler): Likewise.
5778 (_gpgme_gpg_spawn): Use these new functions.
5780 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5781 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5782 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5783 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5784 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5785 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5786 Include <rungpg.h> for status handler function.
5788 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5789 input_data, output_fd, output_data, message_fd, message_data, command
5791 (_gpgme_gpgsm_new): Open input, output and message pipes before
5792 connecting to the client. Close server's ends afterwards.
5793 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5794 server process from wait queue.
5795 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5796 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5798 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5799 (_gpgme_engine_set_status_handler): Likewise.
5800 (_gpgme_engine_op_verify): Likewise.
5802 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5804 * context.h: Do not include rungpg.h, but engine.h.
5805 (struct gpgme_context_s): Replace member gpg with engine.
5806 * gpgme.c (gpgme_release): Release engine, not gpg.
5808 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5810 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5811 Make static, change order of arguments, and return an error value.
5812 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5814 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5815 (_gpgme_gpg_op_encrypt): Likewise.
5816 (_gpgme_gpg_op_decrypt): Likewise.
5817 (_gpgme_gpg_op_delete): Likewise.
5818 (_gpgme_gpg_op_export): Likewise.
5819 (_gpgme_gpg_op_genkey): Likewise.
5820 (_gpgme_gpg_op_import): Likewise.
5821 (_gpgme_gpg_op_keylist): Likewise.
5822 (_gpgme_gpg_op_sign): Likewise.
5823 (_gpgme_gpg_op_trustlist): Likewise.
5824 * rungpg.c (_gpgme_gpg_op_verify): New function.
5825 (_gpgme_gpg_op_encrypt): Likewise.
5826 (_gpgme_gpg_op_decrypt): Likewise.
5827 (_gpgme_gpg_op_delete): Likewise.
5828 (_gpgme_gpg_op_export): Likewise.
5829 (_gpgme_gpg_op_genkey): Likewise.
5830 (_gpgme_gpg_op_import): Likewise.
5831 (_gpgme_gpg_op_keylist): Likewise.
5832 (_gpgme_gpg_op_sign): Likewise.
5833 (_gpgme_gpg_op_trustlist): Likewise.
5835 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5836 (_gpgme_engine_set_command_handler): Likewise.
5837 (_gpgme_engine_set_colon_line_handler): Likewise.
5838 (_gpgme_engine_op_decrypt): Likewise.
5839 (_gpgme_engine_op_delete): Likewise.
5840 (_gpgme_engine_op_encrypt): Likewise.
5841 (_gpgme_engine_op_export): Likewise.
5842 (_gpgme_engine_op_genkey): Likewise.
5843 (_gpgme_engine_op_import): Likewise.
5844 (_gpgme_engine_op_keylist): Likewise.
5845 (_gpgme_engine_op_sign): Likewise.
5846 (_gpgme_engine_op_trustlist): Likewise.
5847 (_gpgme_engine_op_verify): Likewise.
5848 (_gpgme_engine_start): Likewise.
5849 * engine.c (_gpgme_engine_set_status_handler): New function.
5850 (_gpgme_engine_set_command_handler): Likewise.
5851 (_gpgme_engine_set_colon_line_handler): Likewise.
5852 (_gpgme_engine_op_decrypt): Likewise.
5853 (_gpgme_engine_op_delete): Likewise.
5854 (_gpgme_engine_op_encrypt): Likewise.
5855 (_gpgme_engine_op_export): Likewise.
5856 (_gpgme_engine_op_genkey): Likewise.
5857 (_gpgme_engine_op_import): Likewise.
5858 (_gpgme_engine_op_keylist): Likewise.
5859 (_gpgme_engine_op_sign): Likewise.
5860 (_gpgme_engine_op_trustlist): Likewise.
5861 (_gpgme_engine_op_verify): Likewise.
5862 (_gpgme_engine_start): Likewise.
5864 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5866 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5867 * decrypt.c (_gpgme_decrypt_start): Likewise.
5868 * passphrase.c (_gpgme_passphrase_start): Likewise.
5869 * keylist.c (gpgme_op_keylist_start): Likewise.
5871 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5873 * types.h: Add types EngineObject and GpgsmObject.
5875 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5876 engine-gpgsm.c, engine.h and engine.c.
5877 * engine.h: New file.
5878 * engine.c: Likewise.
5879 * engine-gpgsm.h: Likewise.
5880 * engine-gpgsm.c: Likewise.
5882 * rungpg.c (_gpgme_gpg_get_version): New function.
5883 (_gpgme_gpg_check_version): Likewise.
5884 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5885 _gpgme_gpg_check_version.
5887 * version.c (compare_versions): Rename to ...
5888 (_gpgme_compare_versions): ... this. Make non-static.
5889 (gpgme_check_version): Use _gpgme_compare_versions rather than
5891 (gpgme_check_engine): Likewise.
5892 * ops.h (_gpgme_get_program_version): Add prototype.
5894 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5896 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5897 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5898 (libgpgme_la_LIBADD): Likewise.
5900 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5902 * version.c: Remove global variables lineno and
5904 (version_handler): Removed.
5905 (_gpgme_get_program_version): New function.
5906 (get_engine_info): Don't use context and version_handler,
5907 but _gpgme_get_program_version.
5908 * ops.h (_gpgme_get_program_version): Add prototype for
5909 _gpgme_get_program_version (we expect to use it elsewhere soon).
5911 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5913 * version.c (get_engine_info): If GnuPG is not available, return
5915 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5917 (_gpgme_get_gpgsm_path): New function.
5918 * w32-util.c (find_program_in_registry): New static function.
5919 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5920 to use find_program_in_registry.
5921 (_gpgme_get_gpgsm_path): New function.
5922 (util.h): Prototype _gpgme_get_gpgsm_path).
5923 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5926 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5928 * decrypt-verify.c: New file.
5929 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5930 * types.h: Add decrypt-verify types.
5932 * context.h: Add result type for decrypt-verify.
5933 * gpgme.h: Add decrypt-verify prototypes.
5935 * decrypt.c (decrypt_status_handler): Renamed to ...
5936 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5937 (_gpgme_decrypt_start): New function, derived from
5938 gpgme_op_decrypt_start.
5939 (gpgme_op_decrypt_start): Reimplement in terms of
5940 _gpgme_decrypt_start.
5941 (_gpgme_decrypt_result): New function to retrieve error value.
5942 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5943 * ops.h: Add prototypes for new functions.
5945 * verify.c (verify_status_handler): Renamed to ...
5946 (_gpgme_verify_status_handler): ... this. Make non-static.
5947 (gpgme_op_verify_start): Use new function name.
5948 (intersect_stati): Renamed to ...
5949 (_gpgme_intersect_stati): ... this. Make non-static.
5950 (gpgme_op_verify): Use new name.
5951 * ops.h: Add prototypes for new functions.
5953 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5955 * passphrase.c: New file.
5956 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5957 * ops.h (_gpgme_passphrase_result): Add prototypes from
5959 * types.h: Likewise.
5960 * context.h: Add member passphrase to result.
5961 * gpgme.c (_gpgme_release_result): Release passphrase member.
5963 * decrypt.c: Some formatting and variable name changes (like
5965 (struct decrypt_result_s): Remove members now found in
5967 (_gpgme_release_decrypt_result): Don't release removed members.
5968 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5969 and don't handle the cases catched there.
5970 (command_handler): Removed.
5971 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5972 _gpgme_passphrase_start which does it.
5973 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
5974 cases covered by it.
5976 * sign.c Some formatting and variable name changes (like
5978 (struct sign_result_s): Remove members now found in
5980 (_gpgme_release_sign_result): Don't release removed members.
5981 (sign_status_handler): Call _gpgme_passphrase_status_handler,
5982 and don't handle the cases catched there.
5983 (command_handler): Removed.
5984 (gpgme_op_sign_start): Don't set command handler, but invoke
5985 _gpgme_passphrase_start which does it.
5986 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
5987 cases covered by it.
5989 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5991 * decrypt.c (command_handler): Fix last change.
5993 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5995 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
5996 Rename R2 to NEXT_RESULT.
5997 (intersect_stati): Rename RES to RESULT.
5998 (gpgme_get_sig_status): Likewise. Do not check return_type, but
5999 the member verify of result.
6000 (gpgme_get_sig_key): Likewise.
6002 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
6003 RESULT is zero, return.
6004 (sign_status_handler, command_handler): Do not check return_type,
6005 but the member sign of result.
6006 (gpgme_op_sign): Likewise. Drop assertion.
6008 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6009 If RESULT is zero, return.
6010 (encrypt_status_handler): Do not check return_type, but the member
6012 (gpgme_op_encrypt): Likewise. Drop assertion.
6014 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6015 (create_result_struct): Do not set result_type.
6016 (command_handler, decrypt_status_handler): Do not check
6017 return_type, but the member decrypt of result.
6018 (gpgme_op_decrypt): Likewise. Drop assertion.
6020 * context.h (enum ResultType): Removed.
6021 (struct gpgme_context_s): Remove member result_type.
6022 (struct result): Replaces union result.
6023 * gpgme.c: Include string.h.
6024 (_gpgme_release_result): Release all members of c->result, which
6025 is now a struct. Zero out all members of the struct afterwards.
6027 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
6029 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6030 Release all members of the list GPG->arglist.
6031 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6033 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6035 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6037 * key.c: Include string.h.
6039 * recipient.c: Likewise.
6041 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6043 * context.h: New member signers_len.
6044 * signers.c (gpgme_signers_clear): Require that signers are
6045 non-NULL with assertion. Use signers_len to determine how much
6046 keys to release. Add documentation.
6047 (gpgme_signers_add): Use signers_len to determine if the buffer is
6048 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6050 (gpgme_signers_enum): Use signers_len to determine if key is
6051 available. Add documentation.
6053 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6055 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6056 ALLOC_CHUNK, not DH->length.
6058 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6060 * gpgme.c (gpgme_set_protocol): Fix last change.
6062 2001-10-15 Werner Koch <wk@gnupg.org>
6064 * gpgme.h (GpgmeProtocol): New.
6065 * gpgme.c (gpgme_set_protocol): New.
6067 2001-09-26 Werner Koch <wk@gnupg.org>
6069 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6070 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6072 2001-09-17 Werner Koch <wk@gnupg.org>
6074 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6075 callers to use this function without a check for tmp_key.
6077 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6078 emptying the queue. Bug reported by Stéphane Corthésy.
6080 2001-09-12 Werner Koch <wk@gnupg.org>
6082 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6084 2001-09-07 Werner Koch <wk@gnupg.org>
6086 * rungpg.h: Add NO_RECP.
6087 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6088 (gpgme_op_encrypt): Better error return.
6090 * verify.c (verify_status_handler): Take on NODATA.
6092 2001-09-03 Werner Koch <wk@gnupg.org>
6094 * rungpg.h: Added STATUS_INV_RECP.
6095 * gpgme.c (_gpgme_release_result): Add support for new
6096 EncryptResult object.
6097 * encrypt.c (append_xml_encinfo): New.
6098 (encrypt_status_handler): Add some status parsing.
6099 (_gpgme_release_encrypt_result): New.
6101 2001-08-29 Werner Koch <wk@gnupg.org>
6103 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6105 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6106 an EOF here. This is probably the reason for a lot of bugs
6107 related to keylisting. It is so obvious. Kudos to Enno Cramer
6108 for pointing that out.
6110 2001-08-28 Werner Koch <wk@gnupg.org>
6112 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6113 (_gpgme_set_op_info): New.
6114 (_gpgme_release_result): Reset the op_info here.
6115 * sign.c (append_xml_siginfo): New.
6116 (sign_status_handler): Store the sig create information.
6118 2001-07-31 Werner Koch <wk@gnupg.org>
6120 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6122 2001-07-30 Werner Koch <wk@gnupg.org>
6124 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6126 * rungpg.c (build_argv): Disable armor comments
6127 * w32-io.c (build_commandline): Need to add quotes here
6129 2001-07-24 Werner Koch <wk@gnupg.org>
6131 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6133 2001-07-23 Werner Koch <wk@gnupg.org>
6135 * util.c: Removed stpcpy() because we use the version from jnlib.
6137 2001-07-19 Werner Koch <wk@gnupg.org>
6139 * mkstatus: Define the collating sequence for sort.
6141 2001-06-26 Werner Koch <wk@gnupg.org>
6143 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6145 2001-06-15 Werner Koch <wk@gnupg.org>
6147 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6148 to Timo for pointing this out.
6150 2001-06-01 Werner Koch <wk@gnupg.org>
6152 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6155 2001-05-28 Werner Koch <wk@gnupg.org>
6157 * version.c (gpgme_check_engine): Stop version number parsing at
6158 the opening angle and not the closing one. By Tommy Reynolds.
6160 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6162 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6163 line, because it gave an error if another operation had been made
6164 before using the same context.
6166 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6167 one line to release the gpg object in the context (if any).
6169 2001-04-26 Werner Koch <wk@gnupg.org>
6171 * key.c, key.h (_gpgme_key_cache_init): New.
6172 (_gpgme_key_cache_add): New.
6173 (_gpgme_key_cache_get): New.
6174 * version.c (do_subsystem_inits): Init the cache.
6175 * keylist.c (finish_key): Put key into the cache
6176 * verify.c (gpgme_get_sig_key): First look into the cache.
6178 2001-04-19 Werner Koch <wk@gnupg.org>
6180 * keylist.c (parse_timestamp): Adjusted for the changed
6181 --fixed-list-mode of gpg 1.0.4h.
6183 2001-04-05 Werner Koch <wk@gnupg.org>
6185 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6187 2001-04-04 Werner Koch <wk@gnupg.org>
6189 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6190 are still bytes pending. Timo found this not easy to track down
6193 2001-04-02 Werner Koch <wk@gnupg.org>
6195 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6196 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6198 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6199 the mode set in the current context. Suggested by Timo.
6201 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6202 can_encrypt. By Timo.
6204 2001-03-30 Werner Koch <wk@gnupg.org>
6206 * debug.c (debug_init): Allow to specify a debug file.
6207 (_gpgme_debug_level): New.
6209 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6210 (_gpgme_io_select): Debug only with level > 2.
6212 2001-03-15 Werner Koch <wk@gnupg.org>
6214 * rungpg.c: Included time.h.
6216 * key.h: New keyflags for capabilities.
6217 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6218 (keylist_colon_handler): Parse them.
6219 * gpgme.h: New attribute values for capabilties.
6220 * key.c (gpgme_key_get_string_attr): Return them.
6221 (capabilities_to_string): New.
6222 (gpgme_key_get_ulong_attr): Return the global caps.
6224 2001-03-14 Werner Koch <wk@gnupg.org>
6226 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6227 Thanks to Jan Oliver Wagner.
6229 2001-03-13 Werner Koch <wk@gnupg.org>
6231 * context.h: Add invalid and revoke flags to user_id structure.
6232 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6233 (keylist_colon_handler): Adjust for that.
6234 (set_userid_flags): New.
6235 (set_mainkey_trust_info): Handle new key invalid flag
6236 (set_subkey_trust_info): Ditto.
6237 * gpgme.h: Add new attributes for key and user ID flags.
6238 * key.c (_gpgme_key_append_name): Init these flags
6239 (gpgme_key_get_as_xml): Print them.
6240 (one_uid_as_xml): New helper for above.
6241 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6242 Return the new attributes. Enhanced, so that subkey information
6243 can be returned now.
6245 2001-02-28 Werner Koch <wk@gnupg.org>
6247 * w32-io.c (destroy_reader): Set stop_me flag.
6248 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6249 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6250 (_gpgme_io_close): Cleanup a writer thread
6251 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6252 waiting which is now possible due to the use of a writer thread.
6254 2001-02-20 Werner Koch <wk@gnupg.org>
6256 * w32-io.c (destroy_reader,kill_reader): New.
6257 (create_reader, reader): Add a new event to stop the thread.
6258 (_gpgme_io_close): Kill the reader thread.
6260 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6261 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6263 * wait.c: Reworked the whole thing.
6264 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6265 (_gpgme_gpg_release): Remove the process from the wait queue.
6267 2001-02-19 Werner Koch <wk@gnupg.org>
6269 * w32-io.c (_gpgme_io_set_close_notify): New.
6270 (_gpgme_io_close): Do the notification.
6272 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6275 * wait.c (remove_process): Don't close the fd here.
6276 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6277 (_gpgme_wait_on_condition): Remove the assert on the queue and
6278 break out if we could not find the queue. The whole thing should
6281 * posix-io.c (_gpgme_io_set_close_notify): New.
6282 (_gpgme_io_close): Do the notification.
6284 * rungpg.c (close_notify_handler): New.
6285 (_gpgme_gpg_new): Register a callback for the fd.
6286 (_gpgme_gpg_set_colon_line_handler): Ditto.
6289 2001-02-13 Werner Koch <wk@gnupg.org>
6291 * rungpg.c (struct reap_s): Replaced pid_t by int.
6293 * types.h: Add ulong typedef.
6295 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6296 (_gpgme_gpg_release): Reap children.
6297 * io.h, posix-io.c (_gpgme_io_kill): New.
6298 * w32-io.c (_gpgme_io_kill): New (dummy).
6300 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6302 * posix-io.c (_gpgme_io_read): Add some debug output.
6303 (_gpgme_io_write): Ditto.
6304 (_gpgme_io_select): Increased the timeout.
6306 2001-02-12 Werner Koch <wk@gnupg.org>
6308 Enhanced the signature verification, so that it can how handle
6309 more than one signature and is able to return more information on
6311 * verify.c (gpgme_get_sig_key): New.
6312 (gpgme_get_sig_status): New.
6314 * gpgme.h: Add stdio.h.
6315 (GpgmeSigStat): New status DIFF.
6317 2001-02-01 Werner Koch <wk@gnupg.org>
6319 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6320 code to all Set/ResetEvent().
6322 * rungpg.c (read_status): Check for end of stream only if we have
6325 2001-01-31 Werner Koch <wk@gnupg.org>
6327 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6328 (propagate_term_results,clear_active_fds): Removed.
6329 (count_active_fds): Renamed to ..
6330 (count_active_and_thawed_fds): .. this and count only thawed fds.
6332 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6335 2001-01-30 Werner Koch <wk@gnupg.org>
6337 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6339 * version.c (get_engine_info): Return better error information.
6341 * posix-util.c, w32-util.c: New.
6342 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6343 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6345 * signers.c (gpgme_signers_add): Ooops, one should test code and
6346 not just write it; the newarr was not assigned. Thanks to José
6347 for pointing this out. Hmmm, still not tested, why should a coder
6350 * w32-io.c: Does now use reader threads, so that we can use
6351 WaitForMultipleObjects.
6352 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6353 Does currently only work for W32.
6355 * debug.c, util.h : New. Changed all fprintfs to use this new
6356 set of debugging functions.
6358 2001-01-23 Werner Koch <wk@gnupg.org>
6360 * data.c (_gpgme_data_release_and_return_string): Fixed string
6363 2001-01-22 Werner Koch <wk@gnupg.org>
6368 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6369 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6371 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6372 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6374 2001-01-05 Werner Koch <wk@gnupg.org>
6376 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6379 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6381 This file is free software; as a special exception the author gives
6382 unlimited permission to copy and/or distribute it, with or without
6383 modifications, as long as this notice is preserved.
6385 This file is distributed in the hope that it will be useful, but
6386 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6387 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.