1 2009-11-02 Marcus Brinkmann <marcus@g10code.de>
3 * opassuan.c (gpgme_op_assuan_transact): Fix return value.
5 2009-10-30 Marcus Brinkmann <marcus@g10code.de>
7 * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
8 (gpgme_tool_LDADD): New variable.
9 * gpgme-tool.c: New file.
10 * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
12 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
13 had that gone missing?).
14 (_gpgme_sig_notation_clear): New function without debug output.
15 (gpgme_release): Call it and _gpgme_signers_clear.
16 * signers.c (_gpgme_signers_clear): New function without debug output.
17 * g13.c (gpgme_op_vfs_mount): Add debug output.
18 * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
19 * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
20 * debug.h: Put tag in front of debug lines, should make for nicer
22 * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
23 * engine-g13.c (g13_new): Remove redundant assuan context allocation.
24 * version.c (gpgme_check_version_internal): Delay debug output
25 until after gpgme_check_version was called.
27 2009-10-28 Marcus Brinkmann <marcus@g10code.de>
29 * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
30 edit.c, import.c, export.c: Fix last change in debug output.
32 2009-10-27 Marcus Brinkmann <marcus@g10code.de>
34 * edit.c (gpgme_op_edit_start, gpgme_op_edit)
35 (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
36 * encrypt-sign.c (gpgme_op_encrypt_sign_start)
37 (gpgme_op_encrypt_sign): Likewise.
38 * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
39 (gpgme_op_encrypt_result): Likewise.
40 * export.c (gpgme_op_export_start, gpgme_op_export)
41 (gpgme_op_export_ext_start, gpgme_op_export_ext)
42 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
43 * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
44 (gpgme_op_genkey_result): Likewise.
45 * getauditlog.c (gpgme_op_getauditlog_start)
46 (gpgme_op_getauditlog): Likewise.
47 * import.c (gpgme_op_import_result, gpgme_op_import_start)
48 (gpgme_op_import): Likewise.
49 * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
50 (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
51 (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
52 * opassuan.c (gpgme_op_assuan_transact_start)
53 (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
54 (gpgme_op_assuan_transact): Likewise.
55 * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
56 * trustlist.c (gpgme_op_trustlist_start)
57 (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
58 * verify.c (gpgme_op_verify_start, gpgme_op_verify)
59 (gpgme_op_verify_result): Likewise.
61 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
63 * gpgme.h.in (struct gpgme_io_event_done_data)
64 (gpgme_io_event_done_data_t): New types.
65 (struct _gpgme_op_assuan_result): Deprecate the err member.
66 (gpgme_op_assuan_result): Deprecate (for now).
67 (gpgme_op_assuan_transact_ext): New prototype.
68 (gpgme_op_assuan_transact): Deprecate.
69 (struct _gpgme_op_g13_result): Replace with ...
70 (struct _gpgme_op_vfs_mount_result): ... this.
71 (gpgme_op_g13_mount): Replace with ...
72 (gpgme_op_vfs_mount): ... this.
73 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
74 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
75 (gpgme_op_g13_mount): Remove.
76 * libgpgme.vers: Likewise.
77 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
78 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
80 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
82 (_gpgme_wait_one_ext): New prototype.
83 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
84 * engine-g13.c (g13_cancel_op): New function.
85 (parse_status): Remove declaration.
86 (g13_assuan_simple_command): Do nothing with status lines for now.
87 (status_handler): Update opaque value access.
88 (_gpgme_engine_ops_g13): Add new cancel_op member.
89 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
90 Handle operational errors.
91 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
92 * data.c (_gpgme_data_inbound_handler)
93 (_gpgme_data_outbound_handler): Adjust opaque value access.
94 * engine-gpg.c (command_handler, status_handler)
95 (colon_line_handler): Likewise.
96 * engine-gpgsm.c (status_handler): Likewise.
97 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
98 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
99 * g13.c: Rewritten (and will be rewritten again).
100 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
101 and result_cb_value parameters from prototype.
102 (_gpgme_engine_cancel_op): New prototype.
103 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
104 (_gpgme_engine_op_assuan_transact): Remove result_cb and
105 result_cb_value parameter.
106 (_gpgme_engine_cancel_op): New function.
107 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
108 (struct io_cb_data): New struct to pass opaque data and get a
109 op_err return value. Needed because we can't modify I/O callback
110 handler signature because it is exposed to the user.
111 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
113 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
115 * wait-private.c (_gpgme_wait_on_condition): New argument to
116 retrieve the operational result. Handle operational errors in
117 session based protocols.
118 (_gpgme_wait_one_ext): New function.
119 (_gpgme_wait_one): Pass argument in invocation of
120 _gpgme_wait_on_condition.
121 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
122 (ctx_done): New argument OP_ERR.
123 (ctx_wait): New argument OP_ERR.
124 (gpgme_wait_ext): New function based on gpgme_wait but handling
126 (gpgme_wait): Implement in term of gpgme_wait_ext.
127 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
128 of _gpgme_wait_on_condition.
129 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
130 invocation of _gpgme_wait_on_condition.
131 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
132 and RESULT_CB_VALUE by LAST_OP_ERR.
133 (_gpgme_engine_assuan_last_op_err): Add this hack function.
134 (llass_cancel_op): New function.
135 (_gpgme_engine_llass_ops): Add cancel_op member.
136 (llass_status_handler): Update opaque value access.
137 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
138 * opassuan.c: Move compat hacks to the end of file.
139 (opassuan_start): Do not set OPD->result.err.
140 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
141 (gpgme_op_assuan_transact_ext): New function.
143 * debug.h (DEBUG_GLOBAL): New debug level.
144 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
145 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
146 * data-fd.c (gpgme_data_new_from_fd): Likewise.
147 * data-stream.c (gpgme_data_new_from_stream): Likewise.
148 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
149 (gpgme_op_decrypt): Likewise.
150 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
151 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
152 (gpgme_op_decrypt_verify): Likewise.
153 * sign.c (gpgme_op_sign_result): Fix debug message.
154 * data-mem.c (gpgme_data_new): Improve debug output.
155 * verify.c (parse_trust): Use atoi instead of
156 _gpgme_map_gnupg_error.
157 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
159 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
161 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
162 (g13_components): New variable.
163 (main_sources): Add $(g13_components).
164 * g13.c, engine-g13.c: New files.
165 * engine.c (engine_ops): Check for assuan for assuan engine, add
167 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
169 * conversion.c (_gpgme_encode_percent_string): New function.
170 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
171 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
172 (gpgme_op_g13_mount): New function.
173 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
174 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
175 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
176 * posix-util.c (_gpgme_get_g13_path): New function.
177 * w32-util.c (_gpgme_get_g13_path): New function.
178 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
180 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
182 * gpgme-config.in (netlibs): Remove.
183 (assuan_cflags, assuan_libs): Add.
185 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
186 (gpgsm_components): Move engine-assuan.c to ...
187 (assuan_components): ... this new variable.
188 (main_sources): Add this new variable.
189 (AM_CPPFLAGS): Remove $(assuan_cppflags).
190 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
191 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
192 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
193 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
194 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
195 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
196 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
198 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
199 _gpgme_io_sendmsg, _gpgme_io_waitpid.
200 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
202 * posix-io.c (_gpgme_io_waitpid): Make non-static.
203 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
204 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
205 * engine-gpgsm.c: Don't map assuan error codes. Use
206 assuan_release instead of assuan_disconnect.
207 (map_assuan_error): Remove function.
208 (gpgsm_new): Use new assuan context interface.
209 * engine-assuan.c: Use assuan_release instead of
211 (llass_new): Use new assuan context interface.
213 2009-10-07 <wk@g10code.com>
215 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
217 2009-08-06 Werner Koch <wk@g10code.com>
219 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
221 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
223 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
224 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
225 (_gpgme_op_sign_init_result): Factor code out to ...
226 (sign_init_result): .. new. Init new fields.
227 (sign_start): Use sign_init_result.
228 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
229 Return an error if no signature has been created.
231 2009-07-07 Werner Koch <wk@g10code.com>
233 * engine-gpgsm.c (struct engine_gpgsm): Add fields
234 input_helper_data and input_helper_memory.
235 (close_notify_handler): Release these new fields.
236 (gpgsm_import): Implement the keyarray feature.
238 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
240 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
243 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
245 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
246 [HAVE_STDINT_H]: Include <stdint.h>.
247 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
248 to (uintptr_t) before casting it to (void*) to silence GCC
251 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
252 * sign.c (_GPGME_IN_GPGME): Define it.
253 * keylist.c (_GPGME_IN_GPGME): Define it.
255 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
256 vasprintf and asprintf.
258 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
260 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
262 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
263 back! (GPA still uses it...).
265 * gpgme.def: Fix stupid typo.
266 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
268 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
270 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
272 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
273 (_gpgme_io_dup): Never allocate threads here.
274 (find_writer, find_reader): Check return value of thread creation
277 * context.h (CTX_OP_DATA_MAGIC): New macro.
278 (struct ctx_op_data): New member MAGIC.
279 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
280 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
282 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
284 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
286 * gpgme.c (result_ref_lock): New global variable.
287 (gpgme_result_ref, gpgme_result_unref): use it.
289 2009-06-16 Werner Koch <wk@g10code.com>
291 * version.c: Include stdlib.h.
293 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
294 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
295 * data.c (gpgme_data_set_encoding): Adjust for new values.
296 * engine-gpg.c (string_from_data): New.
297 (gpg_import): Implement --fetch-key feature.
299 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
300 * gpgme.def, libgpgme.vers: Add them.
301 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
302 (export_keys_start): New.
304 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
305 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
306 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
308 * export.c (gpgme_export_ext_start, gpgme_op_export)
309 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
310 (export_start): Ditto.
311 * engine.c (_gpgme_engine_op_export): Ditto.
312 * engine-backend.h (struct engine_ops): Ditto.
313 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
314 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
316 (gpg_export, gpg_export_ext): Factor common code out to ..
317 (export_common): .. this.
319 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
320 * gpgme.def, libgpgme.vers: Add them.
321 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
322 (_gpgme_op_import_keys_start): New.
323 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
324 * engine-backend.h (struct engine_ops): Ditto.
325 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
326 * engine-gpg.c (gpg_import): Ditto. Implement it.
328 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
330 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
332 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
334 * context.h (struct ctx_op_data): Add member "references".
335 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
336 (_gpgme_release_result): Use gpgme_result_unref.
337 * op-support.c (_gpgme_op_data_lookup): Initialize references.
339 2009-06-12 Werner Koch <wk@g10code.com>
341 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
342 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
343 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
344 (main): Pass flags for my_spawn.
345 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
347 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
348 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
349 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
350 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
351 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
352 * engine-gpg.c (start): Call spawn with new flag.
354 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
355 _gpgme_allow_set_foreground_window. Change all callers.
356 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
358 2009-06-10 Werner Koch <wk@g10code.com>
360 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
362 2009-06-09 Werner Koch <wk@g10code.com>
364 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
366 * version.c (gpgme_check_version_internal): Make result const.
368 * gpgme.c: Include priv-io.h.
369 (gpgme_io_read, gpgme_io_write): New.
370 * libgpgme.vers (GPGME_1.1): Add them.
373 * Makefile.am (main_sources): Remove gpgme.h.
374 (include_HEADERS): Rename to nodist_include_HEADERS so that a
375 VPATH build won't use the distributed one.
377 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
379 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
381 * gpgme.h.in (gpgme_check_version_internal): New prototype.
382 (gpgme_check_version): New macro, overriding function of the same
384 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
385 * context.h (_gpgme_selftest): New variable declaration.
386 * version.c: Include "context.h".
387 (gpgme_check_version): Set _gpgme_selftest on success.
388 (gpgme_check_version_internal): New function.
389 * gpgme.c (_gpgme_selftest): Define it.
390 (gpgme_new): Check the selftest result.
392 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
394 * gpgme.h.in (gpgme_encrypt_flags_t): Add
395 GPGME_ENCRYPT_NO_ENCRYPT_TO.
396 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
397 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
399 2009-05-14 Werner Koch <wk@g10code.com>
401 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
402 better maintainability and to help debugging.
404 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
406 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
408 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
410 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
411 * w32-io.c (_gpgme_io_connect): Fix stupid error.
413 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
415 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
416 (find_channel): Drop CREATE argument.
417 (new_dummy_channel_from_fd, new_channel_from_fd)
418 (new_channel_from_socket): New functions.
419 (_gpgm_io_fd2str): Implement for sockets.
420 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
422 (_gpgme_io_pipe): Fix for new channel bookkeeping.
423 (_gpgme_io_close, _gpgme_io_dup): Likewise.
424 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
425 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
426 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
427 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
428 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
429 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
430 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
432 2009-03-18 Werner Koch <wk@g10code.com>
434 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
435 * engine-gpgsm.c (gpgsm_keylist): Send new option.
437 2009-03-13 Werner Koch <wk@g10code.com>
439 * gpgme-config.in: Make sure locale is set to C.
441 2009-02-24 Werner Koch <wk@g10code.com>
443 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
444 (gpgme_assuan_result_t): New.
445 (gpgme_op_assuan_result): Change return type.
446 (struct _gpgme_assuan_sendfnc_ctx)
447 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
448 (gpgme_assuan_inquire_cb_t): Changed.
449 * opassuan.c (op_data_t): Make use of a result structure.
450 (gpgme_op_assuan_result): Change return type.
451 (opassuan_start): Use result structure.
453 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
454 (inquire_cb_sendfnc): Remove.
455 (inquire_cb): Change for new callback scheme. Not yet finished.
456 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
458 2009-02-04 Werner Koch <wk@g10code.com>
460 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
462 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
464 2009-02-03 Werner Koch <wk@g10code.com>
466 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
468 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
469 * keylist.c (keylist_colon_handler): Factor common code out to ...
470 (parse_sec_field15): New. Set card number.
472 2009-01-26 Werner Koch <wk@g10code.com>
474 * opassuan.c, dirinfo.c, engine-assuan.c: New.
475 * Makefile.am: Add them.
476 * engine-backend.h: Add _gpgme_engine_ops_assuan.
477 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
479 * Makefile.am (gpgsm_components): Add engine-assuan.c.
480 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
481 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
482 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
483 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
484 * gpgme.c (gpgme_get_protocol_name): Ditto.
485 (gpgme_set_protocol): Support it.
486 * engine.c (gpgme_get_engine_info): Ditto.
487 (engine_ops): Register it.
488 (_gpgme_engine_op_assuan_transact): New.
489 * libgpgme.vers (gpgme_op_assuan_transact_start)
490 (gpgme_op_assuan_transact): New.
491 * gpgme.def (gpgme_op_assuan_transact_start)
492 (gpgme_op_assuan_transact): New.
493 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
494 initialize to NULL for all engines.
495 * engine.c (engine_get_home_dir): New.
496 (gpgme_get_engine_info): Use it.
497 (_gpgme_set_engine_info): Use it.
498 * engine.h (engine_assuan_result_cb_t): New.
499 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
501 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
503 * version.c (gpgme_check_version): Protect trace arg against NULL.
505 2009-01-19 Werner Koch <wk@g10code.com>
507 * rungpg.c: Rename to engine-gpg.c
508 * Makefile.am (main_sources): Ditto.
510 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
512 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
514 2008-11-18 Werner Koch <wk@g10code.com>
516 * version.c (do_subsystem_inits): Always initialize I/O
517 subsystem. Fixes regression from 2007-08-02.
519 * decrypt.c (_gpgme_decrypt_status_handler): Use
520 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
522 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
524 * wait-private.c (_gpgme_wait_on_condition): Remove unused
526 * wait-global.c: Include ops.h to silence gcc warning.
527 (_gpgme_wait_global_event_cb): Pass error value directly.
528 * wait-user.c: Include ops.h to silence gcc warning.
530 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
531 silence gcc warning. Cast argument to execv to silence warning.
532 * w32-io.c (_gpgme_io_spawn): Likewise.
533 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
535 2008-10-24 Werner Koch <wk@g10code.com>
537 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
539 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
541 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
542 string to C coded string.
544 2008-10-20 Werner Koch <wk@g10code.com>
546 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
548 * gpgme.h: Rename to gpgme.h.in.
549 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
551 * posix-io.c: Include sys/uio.h. Fixes bug #818.
553 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
555 * w32-util.c (find_program_in_registry): Don't define.
556 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
557 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
558 registry anymore. It is now no longer possible to overwrite the
559 default location in that way.
561 2008-10-17 Werner Koch <wk@g10code.com>
563 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
564 around a bug in mingw32.
566 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
568 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
569 Submitted by "Daniel Mueller" <daniel@danm.de>
571 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
573 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
575 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
577 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
578 * gpgme.c (_gpgme_cancel_with_err): New function.
579 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
580 * wait-private.c (_gpgme_wait_on_condition): Use
581 _gpgme_cancel_with_err.
582 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
583 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
585 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
587 * rungpg.c (command_handler): Remove I/O callback on error, too.
589 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
591 * gpgme.c (gpgme_cancel_async): Remove unused variable.
593 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
595 * libgpgme.vers: Add gpgme_cancel_async.
596 * gpgme.def: Likewise.
598 * context.h: Include "sema.h".
599 (struct gpgme_context): New members lock and canceled.
600 * gpgme.c (gpgme_new): Initialize lock.
601 (gpgme_release): Destroy lock.
602 (gpgme_cancel_async): New function.
603 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
604 * wait-global.c (gpgme_wait): Check cancel flag before processing
606 * wait-private.c (_gpgme_wait_on_condition): Likewise.
607 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
609 2008-06-26 Werner Koch <wk@g10code.com>
611 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
612 (mkstemp): Need to use GetSystemTimeAsFileTime for better
615 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
617 * gpgme-w32spawn.c: New file.
618 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
620 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
621 (gpgsm_set_locale): Return early if locale value is NULL.
622 * util.h (_gpgme_mkstemp)
623 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
625 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
626 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
628 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
629 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
630 special filename FD rather than stdin.
631 (struct arg_and_data_s): Add member ARG_LOCP.
632 (struct fd_data_map_s): Add member ARG_LOC.
633 (struct engine_gpg): Add member ARG_LOC to status and colon.
634 (_add_arg, add_arg_with_locp): New function.
635 (add_arg_ext): Reimplement in terms of _add_arg.
636 (gpg_new): Remember argument location for status FD.
637 (build_argv): Set argument location if requested. Also set
638 argument location of fd_data_map for data items.
639 (start): Adjust caller of _gpgme_io_spawn.
640 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
642 (_gpgme_io_spawn): Remove parent fd list argument.
643 * posix-io.c (get_max_fds): New function.
644 (_gpgme_io_dup): Add tracing.
645 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
646 fd list to contain all child fds that should be inherited. Close
647 all other file descriptors after fork.
648 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
649 parent fd list. Change meaning of child fd list to contain all
650 child fds that should be inherited. Do not inherit any file
651 descriptors, but DuplicateHandle them. Spawn process through
652 wrapper process. Provide wrapper process with a temporary file
653 containing handle translation data. Return translated handle
655 * w32-io.c (reader): Add more tracing output.
656 (_gpgme_io_read): Likewise.
657 * engine-gpgconf.c (gpgconf_read): Adjust caller of
659 * version.c (_gpgme_get_program_version): Likewise.
661 2008-06-20 Werner Koch <wk@g10code.com>
663 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
664 compatibility with old compilers. Fix amount of memmove. Fix
667 2008-06-19 Werner Koch <wk@g10code.com>
669 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
670 change all callers and provide compatibilty macro.
671 (gpgme_conf_type_t): Add complex types 34..37.
672 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
673 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
675 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
677 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
679 2008-05-09 Werner Koch <wk@g10code.com>
681 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
684 2008-05-07 Werner Koch <wk@g10code.com>
686 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
687 self-explaining string. Needs a proper fix, though.
689 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
691 (gpg_build_keylist_options): .. new. Allow combination of extern
693 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
695 2008-05-06 Werner Koch <wk@g10code.com>
697 * version.c (extract_version_string): New.
698 (_gpgme_get_program_version): Use it to allow for suffixes in the
701 2008-04-28 Werner Koch <wk@g10code.com>
703 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
706 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
708 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
709 Osterfeld, implement blocking select.
711 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
713 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
715 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
717 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
718 Reported by Marc Mutz.
720 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
722 * decrypt.c (release_op_data): Release OPD->result.recipients.
723 * encrypt.c (release_op_data): Release invalid_recipient.
725 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
727 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
729 2008-02-14 Werner Koch <wk@g10code.com>
731 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
732 * posix-io.c (_gpgme_io_spawn): Ditto.
733 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
734 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
735 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
736 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
738 * w32-util.c (_gpgme_allow_set_foregound_window): New.
739 * posix-util.c (_gpgme_allow_set_foregound_window): New.
740 * engine-gpgsm.c (default_inq_cb): New.
741 (gpgsm_new) [W32]: Enable pinentry notifications.
742 (status_handler): Handle inquiries.
744 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
746 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
749 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
751 * engine-gpgsm.c (map_input_enc): Rename to ...
752 (map_data_enc): ... this. Also change all callers.
753 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
754 (gpgsm_sign): Set encoding for output.
756 2008-01-28 Werner Koch <wk@g10code.com>
758 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
760 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
762 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
765 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
767 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
769 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
772 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
774 * Makefile.am (gpgconf_components): New variable.
775 (main_sources): Add gpgconf.c.
776 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
777 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
778 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
779 (gpgme_conf_arg_release, gpgme_conf_opt_change)
780 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
782 * gpgconf.c, engine-gpgconf.c: New files.
783 * engine.h: (_gpgme_engine_op_conf_load,
784 (_gpgme_engine_op_conf_save): New prototypes.
785 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
787 * posix-util.c (_gpgme_get_gpgconf_path): New function.
788 * w32-util.c (_gpgme_get_gpgconf_path): New function.
790 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
792 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
793 * gpgme.def: Add new gpgconf related interfaces.
794 * libgpgme.vers: Likewise.
795 * util.h (_gpgme_get_gpgconf_path): New prototype.
796 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
797 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
798 (struct engine_ops): Add members for conf_load and conf_save.
799 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
800 (_gpgme_engine_op_conf_load,
801 (_gpgme_engine_op_conf_save): New functions.
802 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
804 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
806 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
807 for installation directory. Remove old fallback default.
808 (find_program_in_inst_dir): New function.
810 2007-11-26 Werner Koch <wk@g10code.com>
812 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
813 always reset it before calling start.
814 (gpgsm_new): Clear it.
815 (status_handler): Implement it.
816 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
818 2007-11-23 Werner Koch <wk@g10code.com>
820 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
821 * getauditlog.c (getauditlog_start): Use that flag.
823 2007-11-22 Werner Koch <wk@g10code.com>
825 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
826 * libgpgme.vers: Ditto.
828 * getauditlog.c: New.
829 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
830 * engine-gpgsm.c (gpgsm_getauditlog): New.
831 (_gpgme_engine_ops_gpgsm): Insert new function.
832 (gpgsm_new): Try to enable audit log support.
833 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
835 2007-11-20 Werner Koch <wk@g10code.com>
837 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
839 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
841 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
843 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
845 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
847 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
849 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
852 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
854 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
857 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
859 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
860 w32-qt-io.cpp: New versions from Frank Osterfeld.
862 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
864 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
865 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
866 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
867 Submitted by Frank Osterfeld.
869 * priv-io.h, engine-gpgsm.c: Add comments.
870 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
871 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
873 (_gpgme_io_dup): Acquire a reference. Replace unused
874 implementation by assertion.
876 2007-09-28 Werner Koch <wk@g10code.com>
878 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
880 (gpgsm_set_fd): Use it.
882 * w32-glib-io.c (find_channel): Add a new primary flag.
883 (_gpgme_io_close): Close channel only if primary.
884 (_gpgme_io_dup): Put newfd into the table as shallow copy.
886 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
887 * w32-io.c (_gpgme_io_select): Ditto.
888 * w32-glib-io.c (_gpgme_io_select): Ditto.
890 * posix-io.c (_gpgme_io_select): Ditto.
891 * rungpg.c (read_status): Ditto.
892 * wait.c (fd_table_put): Ditto.
894 * rungpg.c (gpg_io_event): Add tracing.
895 (start): Use gpg_io_event for sending the start event.
896 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
897 (start): Use gpgsm_io_event for sending the start event.
898 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
900 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
902 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
903 versions from Frank Osterfeld.
905 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
907 * w32-glib-io.c (_gpgme_io_spawn),
908 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
909 the process handle, return 0.
911 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
912 * gpgme.c (gpgme_get_protocol_name): Implement support for
913 GPGME_PROTOCOL_UNKNOWN.
915 * kdpipeiodevice.h: Fix last change.
917 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
918 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
921 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
923 * conversion.c, keylist.c: Include <sys/types.h>.
925 * kdpipeiodevice.h: Use namespace _gpgme_.
926 * kdpipeiodevice.cpp: Use namespace _gpgme_.
927 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
928 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
929 _gpgme_::KDPipeIODevice.
931 2007-09-17 Werner Koch <wk@g10code.com>
933 * rungpg.c (gpg_new): Make robust against undefined ttyname or
936 2007-09-14 Werner Koch <wk@g10code.com>
938 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
940 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
942 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
944 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
946 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
949 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
951 * Makefile.am (libgpgme_qt_la_SOURCES): Move
952 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
953 another file (it's more like a header file than a cpp file, but
954 automake doesn't know that).
956 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
957 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
958 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
960 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
961 kdpipeiodevice.moc, w32-qt-io.c: New files.
962 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
963 (ltlib_gpgme_qt): New variable.
964 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
965 (libgpgme_qt_la_SOURCES): New variable.
966 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
967 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
968 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
969 (libgpgme_qt_la_LIBADD): New variables.
971 * sema.h (struct critsect_s): Rename "private" to "priv" to make
972 C++ users happy. Change users.
973 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
974 (_gpgme_sema_cs_destroy): Likewise.
975 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
976 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
977 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
979 (gpgme_get_fdptr): New function.
980 * w32-io.c (gpgme_get_fdptr): New function
981 * gpgme.def: Add gpgme_get_fdptr.
983 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
985 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
986 (writer): Remove superfluous check.
988 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
990 * gpgme.h: Move include of gpg-error.h out of extern "C".
992 2007-08-07 Werner Koch <wk@g10code.com>
994 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
995 * verify.c (parse_trust): Set Chain_MODEL.
997 2007-08-02 Werner Koch <wk@g10code.com>
999 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1000 * w32-io.c (_gpgme_io_spawn): Ditto.
1001 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1002 * debug.c (_gpgme_debug): Enable assuan logging.
1003 (_gpgme_debug_subsystem_init): New.
1004 * version.c (do_subsystem_inits): Disable assuan logging and
1005 initialize the debug system.
1006 (gpgme_check_version): Do not trace before the subsystems are
1009 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
1011 * debug.c: Include <errno.h> and "debug.h".
1012 (_gpgme_debug): Save and restore ERRNO.
1014 (_gpgme_debug_buffer): New function.
1015 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1016 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1017 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
1018 most of these files, add many more tracepoints.
1020 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
1022 * engine-gpgsm.c (status_handler): Do not send BYE here.
1024 * w32-io.c (struct reader_context_s, struct writer_context_s): New
1026 (create_reader, create_writer): Initialize C->refcount to 1.
1027 (destroy_reader, destroy_writer): Only destroy if C->refcount
1029 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1030 * priv-io.h (_gpgme_io_dup): New prototype.
1031 * posix-io.c (_gpgme_io_dup): New function.
1032 * w32-io.c (_gpgme_io_dup): Likewise.
1033 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1034 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1036 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
1038 * data-user.c (user_read, user_write, user_seek): Set errno and
1039 return -1 instead returning the error code directly.
1040 * data-compat.c (old_user_seek): Likewise.
1041 * gpgme.c (gpgme_sig_notation_add): Return error properly.
1043 * Revert the "close_notify_handler" returns int stuff. Always
1044 close in the _gpgme_io_close implementations.
1045 * engine-gpgsm.c (status_handler): Try to terminate the connection
1047 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1048 (_gpgme_io_write): Likewise.
1050 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1051 to _gpgme_close_notify_handler.
1052 (_gpgme_close_notify_handler): New type.
1053 (_gpgme_io_dup): Remove prototype.
1054 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1055 type of HANDLER to _gpgme_close_notify_handler_t.
1056 (_gpgme_io_close): Do not close the FD if handler returns 0.
1057 (_gpgme_io_dup): Remove function.
1058 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1059 _gpgme_io_close): Change type of HANDLER to
1060 _gpgme_close_notify_handler_t.
1061 (_gpgme_io_close): Do not close the FD if handler returns 0.
1062 (_gpgme_io_dup): Remove function.
1063 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1064 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1065 to _gpgme_close_notify_handler_t.
1066 (_gpgme_io_close): Do not close the FD if handler returns 0.
1067 * rungpg.c (close_notify_handler): Change return type to int,
1069 * engine-gpgsm.c (close_notify_handler): Change return type to
1070 int, return 0 for status FD and 1 for all other FDs.
1071 (start): Do not duplicate the status FD.
1073 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1075 * Makefile.am: Replace implicite rule by suffix rule. Add
1078 2007-07-12 Werner Koch <wk@g10code.com>
1080 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1081 system has been started.
1083 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1085 * priv-io.h (_gpgme_io_dup): New prototype.
1086 * posix-io.c (_gpgme_io_dup): New function.
1087 * w32-io.c (_gpgme_io_dup): Likewise.
1088 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1089 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1091 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1093 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1094 * funopen.c (funopen): Rename to _gpgme_funopen.
1096 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1098 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1099 * rungpg.c (gpg_new): Likewise.
1100 Submitted by Stephen Tether.
1102 2007-02-26 Werner Koch <wk@g10code.com>
1104 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1105 (_gpgme_verify_status_handler): Return an error if more than one
1106 plaintext has been seen.
1107 (parse_error): New arg SET_STATUS. Also detect it based on an
1108 ERROR status (gpg > 1.4.6).
1110 2007-01-26 Werner Koch <wk@g10code.com>
1112 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1113 * w32-glib-io.c (build_commandline): Ditto.
1115 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1117 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1119 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1121 * data.h (_gpgme_data_get_fd): Add prototype.
1122 (gpgme_data_get_fd_cb): New type.
1123 (struct _gpgme_data_cbs): New member get_fd.
1124 * data.c (_gpgme_data_get_fd): New function.
1125 * data-fd.c (fd_get_fd): New function.
1126 (fd_cbs): Add fd_get_fd.
1127 * data-stream.c (stream_get_fd): New function.
1128 (stream_cbs): Add stream_get_fd.
1129 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1130 * data-user.c (user_cbs): Likewise.
1131 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1132 short-cut by passing the data descriptor directly.
1134 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1136 * w32-io.c (build_commandline): Quote all command line arguments.
1137 * w32-glib-io.c (build_commandline): Likewise.
1139 2007-01-10 Werner Koch <wk@g10code.com>
1141 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1143 2007-01-08 Werner Koch <wk@g10code.com>
1145 * version.c (do_subsystem_inits): Do assuan init only if building
1147 * setenv.c: Include assuan-def.h only if building with Assuan
1150 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1152 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1153 * rungpg.c (gpg_set_locale): Ditto.
1155 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1157 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1158 switching protocols.
1159 (gpgme_ctx_set_engine_info): Likewise for engine info.
1160 * engine.h (_gpgme_engine_reset): New function prototype.
1161 * engine.c (_gpgme_engine_reset): New function.
1162 * engine-backend.h (struct engine_ops): New member RESET.
1163 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1164 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1165 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1166 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1168 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1169 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1170 function if available.
1171 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1173 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1175 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1176 lc_messages from prototype.
1177 (_gpgme_engine_set_locale): New prototype.
1178 * engine.c (_gpgme_engine_set_locale): New function.
1179 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1180 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1181 Remove arguments lc_messages and lc_ctype from member NEW.
1182 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1183 and lc_messages_set.
1184 (gpgsm_new): Remove lc_messages and lc_ctype
1186 (gpgsm_set_locale): New function.
1187 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1188 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1190 (gpg_release): Release lc_messages and lc_ctype if set.
1191 (gpg_new): Remove lc_messages and lc_ctype arguments.
1192 (gpg_set_locale): New function.
1193 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1194 (add_arg): Implement in terms of:
1195 (add_arg_ext): New function.
1196 (start): Set lc-messages and lc-ctype arguments here.
1198 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1200 * engine-gpgsm.c (struct engine_gpgsm): Move members
1201 input_fd_server, output_fd_server, message_fd_server to ...
1202 (iocb_data): ... here (as server_fd).
1203 (close_notify_handler): Reset tags as well.
1204 (gpgsm_new): Implement support for descriptor
1206 (fd_type_t): New type.
1207 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1208 for unused communication channels.
1209 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1210 relevant callers adjusted as well (previously of _gpgme_io_close).
1212 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1214 * version.c: Include "assuan.h".
1215 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1217 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1219 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1220 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1221 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1223 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1224 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1225 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1226 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1228 (noinst_LTLIBRARIES): Removed.
1229 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1230 (AM_CFLAGS): New variable.
1232 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1234 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1235 ASSUAN_CONTEXT with assuan_context_t.
1237 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1239 * engine-gpgsm.c (gpgsm_new): Check return value of
1240 assuan_pipe_connect.
1242 * rungpg.c: Include <unistd.h>.
1243 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1244 --lc-messages. Fixes issue 734.
1246 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1248 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1251 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1253 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1254 _gpgme_engine_io_event().
1256 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1258 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1260 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1263 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1265 * keylist.c (keylist_colon_handler): Move debug output after
1268 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1270 * gpgme-config.in (Options): Add NETLIBS.
1271 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1272 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1274 * rungpg.c (read_status): Fix comparison disguising as an
1277 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1279 * gpgme.c (gpgme_set_locale): Remove conditional on
1280 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1282 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1284 * rungpg.c (read_status): Strip potential carriage return.
1285 * genkey.c (get_key_parameter): Skip potential carriage return.
1286 * version.c (_gpgme_get_program_version): Strip potential carriage
1289 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1292 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1294 * keylist.c (gpgme_get_key): Also clone the engine info.
1296 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1298 * gpgme-config.in (cflags_pth): Revert accidential removal of
1299 pthread support with last change.
1301 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1303 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1304 (_gpgme_io_pipe): Open pipes in binary mode.
1306 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1308 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1309 checking the version correctly even after changing the engine
1310 information. Bug reported by Stéphane Corthésy.
1312 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1314 (colon_preprocessor_t): New type.
1315 (struct engine_gpg): New member colon.preprocess_fnc.
1316 (gpg_keylist_preprocess): New function.
1317 * keylist.c (keylist_colon_handler): Allow short key IDs.
1319 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1321 * w32-io.c (create_writer): Make C->have_data a manually resetted
1323 (writer): Move code from end of if block to beginning, so it
1324 is also run the first time.
1325 (_gpgme_io_write): Move assert check after error check. Reset
1326 the is_empty event, and also do it eagerly.
1327 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1329 2006-01-26 Werner Koch <wk@g10code.com>
1331 * w32-util.c (_gpgme_get_conf_int): New.
1332 * posix-util.c (_gpgme_get_conf_int): New.
1333 * w32-io.c (get_desired_thread_priority): New.
1334 (create_reader, create_writer): Use it here.
1336 2006-01-04 Werner Koch <wk@g10code.com>
1338 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1340 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1341 statements. Disable error return for failed nonblocking call.
1343 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1345 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1348 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1350 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1351 (_gpgme_io_select): Fix debug output.
1353 2005-12-23 Werner Koch <wk@g10code.com>
1355 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1356 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1359 2005-12-20 Werner Koch <wk@g10code.com>
1361 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1362 and GPGME_STATUS_PKA_TRUST_GOOD.
1363 (struct _gpgme_signature): New field pka_trust.
1364 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1366 2005-12-06 Werner Koch <wk@g10code.com>
1368 * keylist.c (keylist_colon_handler): Store fingerprints of the
1369 subkeys. Reset the secret flag of subkeys for stub secret keys.
1370 (NR_FIELDS): Bumped up to 16
1372 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1374 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1375 engine_get_version invocation. Reported by Stéphane Corthésy.
1377 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1379 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1381 2005-11-18 Werner Koch <wk@g10code.com>
1383 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1385 (find_channel): Better use g_io_channel_win32_new_fd instead of
1386 the autodetection function g_io_channel_unix_new.
1387 (_gpgme_io_select): Rewritten. It is now a fully working select
1390 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1392 * priv-io.h (_gpgme_io_fd2str): New prototype.
1393 * posix-io.c (_gpgme_io_fd2str): New function.
1394 * w32-io.c (_gpgme_io_fd2str): New function.
1395 * rungpg.c: Use this new function.
1396 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1397 again. Two's company, three's the musketeers.
1399 * w32-glib-io.c: Rewrote the file handle code. We don't create
1400 system fds for every handle (doesn't work for inherited handles),
1401 but we create pseudo fds in a private namespace that designate a
1402 handle and potentially a giochannel.
1404 2005-11-18 Werner Koch <wk@g10code.com>
1406 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1408 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1410 * w32-glib-io.c: New file.
1411 * gpgme.def (gpgme_get_giochannel): Add symbol.
1412 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1414 (ltlib_gpgme_extra): New variable.
1415 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1416 (system_components_not_extra): New variable.
1417 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1418 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1419 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1420 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1421 [BUILD_W32_GLIB]: New variables.
1422 * gpgme-config.in (glib): New option.
1423 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1425 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1427 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1428 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1429 * posix-io.c (_gpgme_io_kill): Removed.
1430 (_gpgme_io_waitpid): Declare static.
1432 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1434 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1436 2005-10-21 Werner Koch <wk@g10code.com>
1438 * Makefile.am: Fixed cut+paste problem
1440 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1442 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1445 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1447 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1450 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1452 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1455 * gpgme.h (gpgme_free): New prototype.
1456 * data-mem.c (gpgme_free): New function.
1457 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1458 * gpgme.def: Add gpgme_free.
1460 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1462 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1464 * verify.c (parse_notation): Likewise for invocation.
1465 * conversion.c (_gpgme_decode_percent_string): Likewise to
1466 declaration. If set, do not replace '\0' characters with a
1468 * gpgme.h (struct _gpgme_key_sig): New field notations.
1469 * ops.h (_gpgme_parse_notation): New prototype.
1470 * sig-notation.c (_gpgme_parse_notation): New function.
1471 * key.c (gpgme_key_unref): Free all signature notations.
1472 * keylist.c (op_data_t): New member tmp_keysig.
1473 (finish_key): Clear OPD->tmp_keysig.
1474 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1475 * rungpg.c (gpg_keylist): Support listing signature notations.
1476 (gpg_keylist_ext): Likewise.
1478 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1480 * engine.h (_gpgme_set_engine_info): Add prototype.
1481 * engine-backend.h (struct engine_ops): Change return type of
1482 get_file_name() to const char * to silence gcc warning.
1483 * engine.c (engine_get_file_name): Change return type to const
1484 char * to silence gcc warning.
1485 (gpgme_get_engine_info): Use transitional variable to go from
1486 const char * to char * to silence gcc warning.
1487 (_gpgme_set_engine_info): Likewise.
1488 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1489 char * to silence gcc warning.
1490 (gpgsm_new): Make ARGV a pointer to const char.
1491 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1492 to char * to silence gcc warning.
1494 * gpgme.def: Add gpgme_data_set_file_name,
1495 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1496 gpgme_sig_notation_add and gpgme_sig_notation_get.
1497 * libgpgme.vers: Add gpgme_sig_notation_clear,
1498 gpgme_sig_notation_add and gpgme_sig_notation_get.
1499 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1500 * context.h (struct gpgme_context): New field sig_notations.
1501 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1503 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1504 (gpgme_sig_notation_flags_t): New type.
1505 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1506 gpgme_sig_notation_get): New prototypes.
1507 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1509 * sig-notation.c (_gpgme_sig_notation_free): New file.
1510 * verify.c (parse_notation): Use support functions.
1511 (release_op_data): Likewise.
1512 * rungpg.c (append_args_from_sig_notations): New function.
1513 (gpg_encrypt_sign, gpg_sign): Call it.
1515 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1517 * data.h (struct gpgme_data): New member file_name.
1518 * data.c (gpgme_data_set_filename): New function.
1519 (_gpgme_data_release): Free DH->filename if necessary.
1520 (gpgme_data_get_filename): New function.
1521 * rungpg.c (gpg_encrypt): Set filename option.
1522 (gpg_encrypt_sign): Likewise.
1523 (gpg_sign): Likewise.
1524 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1525 gpgme_data_get_file_name.
1527 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1530 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1532 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1533 (struct _gpgme_subkey): Likewise.
1534 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1537 2005-09-23 Werner Koch <wk@g10code.com>
1539 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1541 (create_reader, create_writer): Set thread priority higher.
1543 2005-09-19 Werner Koch <wk@g10code.com>
1545 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1546 the size of the pipe buffer.
1548 2005-09-13 Werner Koch <wk@g10code.com>
1550 * ath.c: Changes to make it work under W32.
1552 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1554 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1555 (ath_pth_src, ath_pthread_src): Removed.
1556 (w32_o_files): Replace ath-compat.o with ath.o.
1557 (libgpgme_pth_la_CFLAGS): New variable.
1558 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1559 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1560 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1561 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1562 (_ATH_COMPAT): Macro removed.
1563 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1566 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1568 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1570 2005-09-07 Werner Koch <wk@g10code.com>
1572 * w32-io.c (build_commandline): Quote argv[0].
1574 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1576 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1578 * edit.c (command_handler): Do not depend on PROCESSED being
1581 * engine.h (engine_command_handler_t): Add new argument processed.
1582 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1584 (_gpgme_passphrase_command_handler): ... this one.
1585 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1587 (_gpgme_passphrase_command_handler): ... this one.
1588 * edit.c (command_handler): Add new argument processed. Remove
1589 local variable with the same name. Always return processed as
1591 * rungpg.c (command_handler): Send a newline character if the
1594 2005-08-26 Werner Koch <wk@g10code.com>
1596 * w32-util.c (read_w32_registry_string): Updated from code used by
1597 GnuPG. This allows for expanding strings and features the
1598 implicit fallback key.
1599 (w32_shgetfolderpath, find_program_at_standard_place): New.
1600 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1601 entry, locate the programs at the standard place.
1602 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1603 we are accustomed to.
1605 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1606 semicolon is used which allows us to create files with drive
1609 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1612 2005-08-19 Werner Koch <wk@g10code.com>
1615 * versioninfo.rc.in: New.
1616 * Makefile.am: Addes support for building a W32 DLL.
1618 * ttyname_r.c (ttyname_r) [W32]: Return error.
1619 * ath-compat.c [W32]: select and co are not yet supported; return
1621 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1623 2005-08-08 Werner Koch <wk@g10code.com>
1625 * util.h (stpcpy): Renamed to ..
1626 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1627 definitions when linking statically.
1628 * stpcpy.c: Removed.
1630 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1632 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1633 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1634 (struct _gpgme_op_verify_result): Likewise.
1635 * ops.h (_gpgme_parse_plaintext): Add prototype.
1636 * op-support.c (_gpgme_parse_plaintext): New function.
1637 * decrypt.c (release_op_data): Release
1638 OPD->result.plaintext_filename.
1639 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1640 * verify.c (release_op_data): Release
1641 OPD->result.plaintext_filename.
1642 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1644 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1646 * keylist.c (gpgme_get_key): Allow key IDs.
1648 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1650 * gpgme.m4: Only call GPGME_CONFIG if found.
1652 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1654 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1656 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1657 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1659 (_gpgme_decrypt_status_handler): Fix last change.
1661 * gpgme.h (struct _gpgme_recipient): New structure.
1662 (gpgme_recipient_t): New type.
1663 (struct _gpgme_op_decrypt_result): Add member recipients.
1664 * decrypt.c (op_data_t): New member last_recipient_p.
1665 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1666 (parse_enc_to): New function.
1667 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1670 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1672 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1674 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1676 * wait.h (_gpgme_run_io_cb): New prototype.
1677 * wait.c (_gpgme_run_io_cb): New function.
1678 * wait-global.c (gpgme_wait): Call it.
1679 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1680 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1682 2005-06-02 Werner Koch <wk@g10code.com>
1684 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1685 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1686 (_gpgme_passphrase_command_handler_internal): Also act on the key
1687 "passphrase.pin.ask".
1689 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1690 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1691 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1692 GPGME_STATUS_BACKUP_KEY_CREATED.
1694 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1696 * data-user.c: Include <errno.h>.
1698 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1700 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1703 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1705 * w32-io.c (_gpgme_io_select): Fix loop increment.
1707 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1709 * data-user.c (user_release): Only call user hook if provided.
1710 (user_seek): Return EBADF if no user hook is provided.
1711 (user_read): Likewise.
1712 (user_write): Likewise.
1714 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1716 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1717 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1718 the reset, just for cleanliness, and do not sent it at all if the
1719 default is requested.
1720 * gpgme.c (gpgme_set_include_certs): Allow to use
1721 GPGME_INCLUDE_CERTS_DEFAULT.
1723 2005-04-21 Werner Koch <wk@g10code.com>
1725 * verify.c (calc_sig_summary): Set the key revoked bit.
1727 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1729 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1730 in the list, not the user-provided CTX.
1731 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1733 * wait-global.c (gpgme_wait): If no context is found, and we
1734 should not hang, set *status to 0 and return NULL.
1735 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1737 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1739 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1740 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1741 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1742 ENOSYS instead EOPNOTSUPP.
1743 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1744 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1747 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1749 * io.h: Rename to ...
1750 * priv-io.h: ... this.
1751 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1752 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1753 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1754 Change all includes of "io.h" to "priv-io.h"
1756 2005-03-09 Werner Koch <wk@g10code.com>
1758 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1759 cast away type checks.
1761 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1764 * data.h [W32]: Removed kludge for EOPNOTSUP.
1765 * data.c, data-compat.c [W32]: Explicitly test for it here.
1767 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1770 2005-03-07 Timo Schulz <twoaday@g10code.de>
1772 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1773 * ath.h: [_WIN32] Added some (dummy) types.
1774 * io.h: [_WIN32] include stdio.h.
1775 * data.h: [_WIN32] Define EOPNOTSUPP.
1776 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1777 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1779 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1781 * engine.c (_gpgme_set_engine_info): Fix assertion.
1783 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1785 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1787 * ttyname_r.c: New file.
1789 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1791 * putc_unlocked.c, funopen.c: I just claim copyright on these
1792 files and change their license to LGPL, because they are totally
1793 trivial wrapper functions.
1794 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1795 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1796 defined as a macro doing exactly the same as the function in this
1798 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1799 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1800 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1801 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1802 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1803 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1804 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1805 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1806 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1807 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1808 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1809 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1810 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1811 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1814 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1816 * libgpgme.vers (GPGME_1.1): New version.
1817 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1818 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1819 member new(). Change return type of get_file_name and get_version
1821 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1822 pointer. Do not cache result.
1823 (gpgsm_new): Add file_name and home_dir argument, and use them
1824 instead of the defaults, if set.
1825 * rungpg.c (struct engine_gpg): New member file_name.
1826 (gpg_get_version): Change return type to char pointer, and do not
1828 (gpg_release): Free gpg->file_name.
1829 (gpg_new): Take new arguments file_name and home_dir. Set the
1830 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1831 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1832 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1834 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1836 * engine.c: Include <assert.h>.
1837 (gpgme_get_engine_info): Set *INFO within the lock. Move
1838 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1839 (engine_info, engine_info_lock): ... here. New static variables.
1840 (engine_get_version): Add file_name argument to
1841 get_version invocation. Change return type to char pointer.
1842 (gpgme_engine_check_version): Rewritten to free() the return value
1843 of engine_get_version after using it.
1844 (_gpgme_engine_info_release): New function.
1845 (gpgme_get_engine_info): Rewritten.
1846 (_gpgme_engine_info_copy): New function.
1847 (_gpgme_set_engine_info): New function.
1848 (gpgme_set_engine_info): New function.
1849 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1851 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1852 and version to char * (remove the const). New member home_dir.
1853 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1854 gpgme_ctx_set_engine_info): New prototypes.
1855 * context.h (struct gpgme_context): New member engine_info.
1856 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1857 (gpgme_release): Deallocate CTX->engine_info.
1858 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1860 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1861 pass it to _gpgme_engine_new.
1862 * version.c (gpgme_check_version): Adjust to
1863 _gpgme_compare_versions returning an int.
1864 (_gpgme_compare_versions): Return an int value, not a const char
1866 * ops.h (_gpgme_compare_versions): Same for prototype.
1868 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1870 * verify.c (parse_trust): If no reason is provided, set
1871 SIG->validity_reason to 0.
1872 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1874 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1876 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1877 (start): Call map_assuan_error on return value of
1880 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1882 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1885 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1887 * gpgme.m4: Implement the --api-version check.
1889 * rungpg.c (read_status): Move the polling of the output data pipe
1890 to just before removing the command fd, from just before adding
1891 it. This avoids buffering problems.
1893 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1894 read, to improve debug output.
1896 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1898 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1899 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1900 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1901 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1903 (gpgme_keylist_mode_t): Define as unsigned int.
1904 (gpgme_key_t): Change type of keylist_mode to
1905 gpgme_keylist_mode_t.
1907 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1909 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1912 * data-stream.c (stream_seek): Call ftello and return the current
1914 * data.h (struct gpgme_data): Change type of data.mem.offset to
1916 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1917 callback. If SEEK_CUR, adjust the offset by the pending buffer
1918 size. Clear pending buffer on success.
1921 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1923 * gpgme.m4: Add copyright notice.
1925 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1927 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1930 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1932 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1934 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1936 * key.c (_gpgme_key_append_name): Make sure tail points to the
1937 byte following the uid.
1938 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1941 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1943 * libgpgme.vers: Remove C-style comment, which is not supported by
1946 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1948 * gpgme-config.in (Options): Support --api-version.
1950 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1952 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1953 * verify.c (parse_error): Likewise.
1955 * verify.c (parse_error): Do not skip location of where token.
1957 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1958 * verify.c (_gpgme_verify_status_handler): Add handling of
1959 GPGME_STATUS_REVKEYSIG.
1960 (parse_trust): Likewise.
1962 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1964 * gpgme.h (struct _gpgme_decrypt_result): New fields
1965 wrong_key_usage and _unused.
1966 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1967 character after a matched string, as in a protocol error this
1968 could skip over the trailing binary zero.
1969 Handle decrypt.keyusage error notifications.
1971 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1972 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1974 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1976 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1977 to unsigned int. Same for member _unused.
1979 * keylist.c (set_mainkey_trust_info): Rewritten.
1980 (set_subkey_capability): Handle 'd' (disabled).
1981 (set_mainkey_capability): Rewritten.
1983 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1985 * gpgme.m4: Quote first argument to AC_DEFUN.
1987 2004-04-21 Werner Koch <wk@gnupg.org>
1989 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1990 The rule of least surprise.
1992 2004-04-15 Werner Koch <wk@gnupg.org>
1994 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1995 unused result.signatures items.
1997 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1999 2004-04-08 Werner Koch <wk@gnupg.org>
2001 * verify.c (_gpgme_verify_status_handler): Ignore the error status
2002 if we can't process it.
2003 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2004 yesterday's hack. It is not any longer required.
2006 2004-04-07 Werner Koch <wk@gnupg.org>
2008 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2009 with meaningless error codes from the verify status function.
2011 2004-04-05 Werner Koch <wk@gnupg.org>
2013 * gpgme.h: Add GPGME_STATUS_NEWSIG.
2015 * verify.c (parse_error): Compare only the last part of the where
2017 (prepare_new_sig): New.
2018 (parse_new_sig): Use prepare_new_sig when required.
2019 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2021 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2022 option. Fixed pattern construction.
2023 (status_handler): Add debugging output.
2025 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
2027 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2028 isatty(). Submitted by Bernhard Herzog.
2030 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
2032 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2035 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2037 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2038 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
2040 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
2042 * gpgme-config.in: Do not emit include and lib directory for
2043 prefix "/usr" or "".
2045 2004-03-03 Werner Koch <wk@gnupg.org>
2047 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2050 2004-02-18 Werner Koch <wk@gnupg.org>
2052 * gpgme-config.in: Ignore setting of --prefix.
2054 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
2056 * rungpg.c (gpg_cancel): New function.
2057 (gpg_release): Call it here.
2058 (_gpgme_engine_ops_gpg): Add it here.
2059 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2061 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2063 * gpgme.c (gpgme_cancel): New function.
2064 * engine-backend.h (struct engine_ops): New member cancel.
2065 * engine.h (_gpgme_engine_cancel): New prototype.
2066 * engine.c (_gpgme_engine_cancel): New function.
2067 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2068 (gpgsm_cancel): New function.
2069 (gpgsm_release): Use it.
2070 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2072 2004-02-17 Werner Koch <wk@gnupg.org>
2074 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2075 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2077 2004-02-15 Werner Koch <wk@gnupg.org>
2079 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2080 by Adriaan de Groot.
2082 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2084 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2086 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2088 * data-stream.c (stream_seek): Likewise.
2090 2004-01-16 Werner Koch <wk@gnupg.org>
2092 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2095 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2097 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2099 2004-01-12 Werner Koch <wk@gnupg.org>
2101 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2103 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2105 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2106 (struct _gpgme_key_sig): For C++ compilers, rename class
2107 member to _obsolete_class. Add new member sig_class.
2108 (struct _gpgme_new_signature): Same here.
2109 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2111 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2112 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2113 * sign.c (parse_sig_created): Set SIG->sig_class.
2115 2003-12-22 Werner Koch <wk@gnupg.org>
2117 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2120 2003-11-19 Werner Koch <wk@gnupg.org>
2122 * conversion.c (_gpgme_parse_timestamp): New.
2123 (atoi_1, atoi_2, atoi_4): New.
2124 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2126 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2127 * sign.c (parse_sig_created): Ditto.
2129 2003-10-31 Werner Koch <wk@gnupg.org>
2131 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2134 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2136 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2137 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2139 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2141 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2144 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2147 * io.h (_gpgme_io_subsystem_init): New prototype.
2148 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2149 (_gpgme_io_spawn): Do not fixup signal handler here.
2150 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2152 * debug.c (debug_init): Drop const qualifier from E.
2154 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2156 (ath_connect): Make ADDR argument const.
2157 * ath-pthread.c (ath_connect): Likewise.
2158 * ath-pth.c (ath_connect): Likewise.
2159 * ath-compat.c (ath_connect): Likewise.
2160 * ath.c (ath_connect): Likewise.
2162 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2163 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2165 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2167 * util.h (_gpgme_hextobyte): Likewise for prototype.
2169 * gpgme.h: Remove trailing comma in enum.
2171 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2172 <signal.h>, <fcntl.h>, or "unistd.h".
2174 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2176 * engine-backend.h (struct engine_ops): Add argument TYPE.
2177 * engine.c (_gpgme_engine_op_edit): Likewise.
2178 * engine.h: Likewise.
2179 * rungpg.c (gpg_edit): Likewise. Use it.
2180 * edit.c (edit_start): Likewise. Pass it on.
2181 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2182 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2184 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2186 * gpgme.h (gpg_strerror_r): Change prototype to match
2187 gpg_strerror_r change.
2188 * error.c (gpg_strerror_r): Likewise, also update implementation.
2190 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2191 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2192 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2194 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2196 * gpgme.h: Add prototype for gpgme_set_locale.
2198 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2199 characteristics and use that instead __inline__.
2201 * context.h (struct gpgme_context): New members lc_ctype and
2203 * gpgme.c: Include <locale.h>.
2204 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2206 (gpgme_set_locale): New function.
2207 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2209 * engine.h (_gpgme_engine_new): Likewise.
2210 * engine-gpgsm.c (gpgsm_new): Likewise.
2211 * rungpg.c (gpg_new): Likewise.
2212 * engine-backend.h (struct engine_ops): Likewise to NEW.
2213 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2216 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2218 * gpgme.h (gpgme_strerror_r): New prototype.
2219 * error.c (gpgme_strerror_r): New function.
2221 * get-env.c: New file.
2222 * util.h (_gpgme_getenv): Add prototype.
2223 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2224 * rungpg.c (build_argv): Use _gpgme_getenv.
2225 * debug.c (debug_init): Likewise.
2226 * engine-gpgsm.c (gpgsm_new): Likewise.
2227 (gpgsm_new): Use ttyname_r.
2228 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2230 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2232 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2235 * gpgme-config.in: Rewritten.
2236 * gpgme.m4: Rewritten.
2238 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2240 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2241 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2242 updated to have better thread support, and the Makefile.am was
2243 changed to reflect that.
2245 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2246 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2247 value of status_fnc.
2248 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2250 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2252 * rungpg.c (start): Use saved_errno instead errno.
2254 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2256 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2257 * fopencookie.c: File removed.
2259 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2261 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2263 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2265 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2266 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2267 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2268 backward compatibility.
2270 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2272 * verify.c (parse_new_sig): Fix status parsing case.
2274 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2276 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2277 Lower _UNUSED to 23 bits.
2278 (struct _gpgme_key): Likewise.
2279 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2280 (set_subkey_capability): Support 'a'.
2282 * keylist.c (gpgme_get_key): Check if there is more than one key
2283 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2285 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2287 (_gpgme_decode_percent_string): Likewise.
2288 * conversion.c (_gpgme_decode_c_string): Likewise.
2289 (_gpgme_decode_percent_string): Likewise.
2290 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2291 * signers.c (gpgme_signers_clear): Likewise.
2292 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2293 Use SEQNO instead SEQ.
2294 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2295 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2297 (gpgme_wait): Change type of I and IDX to unsigned int.
2298 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2299 and I to unsigned int.
2300 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2301 int to suppress gcc warning.
2302 (_gpgme_io_set_close_notify): Likewise.
2303 (_gpgme_io_select): Change type of I to unsigned int.
2304 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2306 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2309 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2311 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2312 and wrong expression.
2313 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2314 * encrypt.c (encrypt_sym_status_handler): Likewise.
2315 * sign.c (sign_status_handler): Likewise.
2316 * verify.c (verify_status_handler): Likewise.
2317 * decrypt.c (decrypt_status_handler): Likewise.
2319 * engine.c (gpgme_get_engine_info): Initialize NULL.
2321 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2323 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2324 GPG_ERROR_LIBS when setting the corresponding variables.
2325 Reported by Stéphane Corthésy.
2327 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2329 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2330 the beginning of the block.
2332 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2334 * data-mem.c (mem_write): Copy original buffer content.
2336 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2338 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2341 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2343 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2344 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2347 * op-support.c (_gpgme_parse_inv_userid): Rename to
2348 _gpgme_parse_inv_recp and change to new datatype.
2349 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2350 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2351 __gpgme_invalid_key. Rename field ID to KEY.
2352 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2353 (struct _gpgme_op_encrypt_result): Here, too.
2354 (struct _gpgme_op_sign_result): Likewise.
2355 * encrypt.c (struct op_data): Likewise.
2356 (release_op_data): Likewise.
2357 * sign.c (struct op_data): Likewise.
2358 (release_op_data): Likewise.
2360 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2361 (_gpgme_io_write): Likewise.
2362 (_gpgme_io_pipe): Likewise.
2363 (_gpgme_io_select): Likewise.
2365 * rungpg.c (struct engine_gpg): Remove arg_error.
2366 (add_arg): Don't set arg_error.
2367 (add_data): Likewise.
2368 (start): Don't check arg_error.
2369 (gpg_new): Check return value of add_arg.
2370 * verify.c (parse_notation): Free allocated memory at error.
2372 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2374 Everywhere: Use libgpg-error error codes.
2376 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2377 (BUILT_SOURCES): Remove errors.c.
2378 (MOSTLYCLEANFILES): Likewise.
2379 (libgpgme_la_SOURCES): Likewise. Add error.c.
2380 (errors.c): Remove target.
2381 * mkerrors: File removed.
2382 * error.c: New file.
2384 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2385 (gpgme_err_code_t, gpgme_err_source_t): New types.
2386 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2387 New static inline functions.
2388 (gpgme_strsource, gpgme_err_code_from_errno,
2389 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2390 gpgme_error_from_errno): New prototypes.
2392 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2394 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2395 (gpgme_op_export): Likewise.
2396 (gpgme_op_export_ext_start): New prototype.
2397 (gpgme_op_export_ext): Likewise.
2398 * engine.h: Likewise for _gpgme_engine_op_export and
2399 _gpgme_engine_op_export_ext.
2400 * engine-backend.h (struct engine_ops): Change second argument of
2401 prototype of export to const char *, and add reserverd int as
2402 third argument. Add prototype for export_ext.
2403 * engine.c (_gpgme_engine_op_export_ext): New function.
2404 (_gpgme_engine_op_export): Change second argument of prototype of
2405 export to const char *, and add reserverd int as third argument.
2406 * rungpg.c (gpg_export): Change second argument of prototype of
2407 export to const char *, and add reserverd int as third argument.
2408 (gpg_export_ext): New function.
2409 (gpg_keylist_ext): Break loop at error.
2410 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2411 * engine-gpgsm.c (gpgsm_export): Change second argument of
2412 prototype of export to const char *, and add reserverd int as
2414 (gpgsm_export_ext): New function.
2415 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2416 * export.c (export_start): Change second argument of prototype of
2417 export to const char *, and add reserverd int as third argument.
2418 (gpgme_op_export_start): Likewise.
2419 (export_ext_start): New function.
2420 (gpgme_op_export_ext_start): Likewise.
2421 (gpgme_op_export_ext): Likewise.
2423 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2424 (gpgme_sigsum_t): New type for anonymous enum.
2426 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2427 and return an error if RECP is not set.
2429 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2430 * user-id.c: Remove file.
2431 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2432 * gpgme.h (gpgme_encrypt_flags_t): New type.
2433 (gpgme_op_encrypt_start): Change second parameter to type
2434 gpgme_key_t[], and add third parameter.
2435 (gpgme_op_encrypt): Likewise.
2436 (gpgme_op_encrypt_sign_start): Likewise.
2437 (gpgme_op_encrypt_sign): Likewise.
2438 * encrypt.c (encrypt_start): Likewise.
2439 (gpgme_op_encrypt_start): Likewise.
2440 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2441 * encrypt-sign.c (encrypt_sign_start): Likewise.
2442 (gpgme_op_encrypt_sign_start): Likewise.
2443 (gpgme_op_encrypt_sign): Likewise.
2444 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2445 encrypt and encrypt_sign.
2446 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2447 and _gpgme_engine_op_encrypt_sign.
2448 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2449 (_gpgme_engine_op_encrypt_sign): Likewise.
2450 * rungpg.c (gpg_encrypt): Likewise.
2451 (gpg_encrypt_sign): Likewise.
2452 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2453 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2454 (set_recipients): Rewritten to use keys instead user IDs.
2455 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2457 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2458 returned to GPGME_Invalid_Key and GPGME_General_Error.
2460 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2462 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2463 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2464 * rungpg.c: Rename GpgObject to engine_gpg_t.
2465 (struct gpg_object_s): Rename to struct engine_gpg.
2467 * context.h (struct gpgme_context): Change EngineObject to
2469 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2470 (ctx_op_data_t): New type.
2471 (struct gpgme_context): Use it.
2472 * ops.h (_gpgme_op_data_lookup): Use new type name.
2473 * op-support.c (_gpgme_op_data_lookup): Likewise.
2474 * engine.c: Rename EngineObject to engine_t in the file. Also
2475 EngineStatusHandler to engine_status_handler_t,
2476 EngineCommandHandler to engine_command_handler_t and
2477 EngineColonLineHandler to engine_colon_line_handler.
2478 * rungpg.c (start): Likewise.
2479 * engine-gpgsm.c: Likewise.
2480 * engine-backend.h (struct engine_ops): Likewise
2481 * engine.h (struct engine_object_s): Rename to struct engine.
2482 (EngineObject): Rename to engine_t. Also everywhere else in the
2484 (EngineStatusHandler): Rename to engine_status_handler_t.
2485 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2486 (EngineCommandHandler): Rename to engine_command_handler_t.
2488 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2490 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2492 * gpgme.h (gpgme_recipients_t): Removed.
2493 (gpgme_recipients_new, gpgme_recipients_release,
2494 gpgme_recipients_add_name,
2495 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2496 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2497 gpgme_recipients_enum_close): Removed.
2498 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2499 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2500 gpgme_op_export): Change second argument to gpgme_user_id_t.
2501 (gpgme_user_ids_release): New prototype.
2502 (gpgme_user_ids_append): Likewise.
2503 * ops.h (_gpgme_recipients_all_valid): Remove.
2504 (_gpgme_user_ids_all_valid): Add.
2505 * context.h (struct gpgme_recipients): Removed.
2506 * user-id.c: New file.
2507 * recipient.c: Removed file.
2508 * rungpg.c (append_args_from_recipients): Change last arg to
2509 gpgme_user_id_t. Reimplement.
2510 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2511 (gpg_encrypt_sign): Likewise.
2512 (gpg_export): Likewise. Rewrite user ID list code.
2513 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2515 (_gpgme_engine_op_encrypt_sign): Likewise.
2516 (_gpgme_engine_op_export): Likewise.
2517 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2518 _gpgme_engine_op_export): Likewise.
2519 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2520 (gpgsm_encrypt): Likewise.
2521 (gpgsm_export): Likewise.
2522 * engine-backend.h (struct engine_ops): Likewise for members
2523 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2524 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2526 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2528 (gpgme_op_encrypt_start): Likewise.
2529 (gpgme_op_encrypt): Likewise.
2530 * encrypt-sign.c (encrypt_sign_start): Likewise.
2531 (gpgme_op_encrypt_sign): Likewise.
2532 (gpgme_op_encrypt_sign_start): Likewise.
2534 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2536 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2537 * import.c (parse_import_res): Add skipped_new_keys parser.
2539 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2541 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2543 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2545 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2546 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2547 (_gpgme_encrypt_status_handler): Likewise.
2548 (_gpgme_op_encrypt_init_result): Likewise.
2549 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2550 (_gpgme_decrypt_status_handler): Likewise.
2551 (_gpgme_op_decrypt_init_result): Likewise.
2552 * verify.c (gpgme_op_verify_result): Likewise.
2553 (_gpgme_verify_status_handler): Likewise.
2554 (_gpgme_op_verify_init_result): Likewise.
2555 * edit.c (edit_status_handler): Likewise.
2556 (command_handler): Likewise.
2557 (edit_start): Likewise.
2558 * genkey.c (gpgme_op_genkey_result): Likewise.
2559 (genkey_status_handler): Likewise.
2560 (genkey_start): Likewise.
2561 * import.c (gpgme_op_import_result): Likewise.
2562 (import_status_handler): Likewise.
2563 (_gpgme_op_import_start): Likewise.
2564 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2565 (_gpgme_op_trustlist_event_cb): Likewise.
2566 (gpgme_op_trustlist_start): Likewise.
2567 * keylist.c (gpgme_op_keylist_result): Likewise.
2568 (keylist_colon_handler): Likewise.
2569 (keylist_status_handler): Likewise.
2570 (_gpgme_op_keylist_event_cb): Likewise.
2571 (gpgme_op_keylist_start): Likewise.
2572 (gpgme_op_keylist_ext_start): Likewise.
2573 (gpgme_op_keylist_next): Likewise.
2574 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2575 (_gpgme_passphrase_command_handler_internal): Likewise.
2576 * sign.c (gpgme_op_sign_result): Likewise.
2577 (_gpgme_sign_status_handler): Likewise.
2578 (_gpgme_op_sign_init_result): Likewise.
2580 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2581 access to pointer type.
2583 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2585 * engine.h (EngineCommandHandler): Change last argument to int fd.
2586 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2588 (gpgme_edit_cb_t): Change last argument to int fd.
2589 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2590 * passphrase.c: Include <assert.h>.
2591 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2592 (release_op_data): Check values before calling free.
2593 (_gpgme_passphrase_status_handler): Likewise.
2594 (_gpgme_passphrase_command_handler_internal): New function.
2595 (_gpgme_passphrase_command_handler): Rewritten.
2596 * edit.c (edit_status_handler): Pass -1 as fd argument.
2597 (command_handler): Update prototype. New variable processed. Use
2598 it to store return value of
2599 _gpgme_passphrase_command_handler_internal which is now used
2600 instead _gpgme_passphrase_command_handler. Use it also to check
2601 if we should call the user's edit function. Pass fd to user's
2603 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2605 (gpg_release): Check value before calling free. Do not release
2607 (command_cb): Function removed.
2608 (command_handler): New function. Thus we don't use a data object
2609 for command handler stuff anymore, but handle it directly. This
2610 allows proper error reporting (cancel of passphrase requests, for
2611 example). Also all callbacks work via direct writes to the file
2612 descriptor (so that passphrases are not kept in insecure memory).
2613 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2614 (read_status): Check cmd.keyword before calling free. Install
2615 command_handler as the I/O callback handler with GPG as private
2618 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2620 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2621 decrypt_verify_start.
2622 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2623 (gpgme_op_decrypt_verify): Likewise.
2624 * verify.c (verify_status_handler): New function that also calls
2625 progress status handler.
2626 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2627 Rename to (verify_start).
2628 (gpgme_op_verify_start): Call verify_start.
2629 (gpgme_op_verify): Likewise.
2630 * encrypt.c (encrypt_status_handler): New function.
2631 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2632 Make static. Rename to encrypt_sym_status_handler.
2633 (encrypt_start): Set status handler to encrypt_sym_status_handler
2634 or encrypt_status_handler.
2635 * sign.c (sign_status_handler): New function.
2636 (sign_start): Set status handler to sign_status_handler.
2637 * decrypt.c (decrypt_status_handler): New function that also calls
2638 progress status handler.
2639 (decrypt_start): Set status handler to decrypt_status_handler.
2640 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2641 * decrypt-verify.c (decrypt_verify_status_handler): Call
2642 _gpgme_progress_status_handler.
2644 * conversion.c (_gpgme_decode_c_string): Add missing break
2647 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2648 to buffer to allocate.
2650 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2652 * verify.c (parse_new_sig): Fix ERRSIG case.
2653 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2655 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2657 * gpgme.h: The following types are renamed. The old name is kept
2658 as a deprecated typedef.
2659 (GpgmeCtx): Rename to gpgme_ctx_t.
2660 (GpgmeData): Rename to gpgme_data_t.
2661 (GpgmeRecipients): Rename to gpgme_recipients_t.
2662 (GpgmeError): Rename to gpgme_error_t.
2663 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2664 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2665 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2666 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2667 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2668 (GpgmeAttr): Rename to gpgme_attr_t.
2669 (GpgmeValidity): Rename to gpgme_validity_t.
2670 (GpgmeProtocol): Rename to gpgme_protocol_t.
2671 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2672 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2673 (GpgmeSubkey): Rename to gpgme_subkey_t.
2674 (GpgmeKeySig): Rename to gpgme_keysig_t.
2675 (GpgmeUserID): Rename to gpgme_user_id_t.
2676 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2677 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2678 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2679 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2680 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2681 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2682 (GpgmeEventIO): Rename to gpgme_event_io_t.
2683 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2684 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2685 (gpgme_io_cbs_t): New type.
2686 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2687 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2688 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2689 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2690 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2691 (gpgme_data_cbs_t): New type.
2692 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2693 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2694 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2695 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2696 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2697 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2698 (GpgmeSignature): Rename to gpgme_signature_t.
2699 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2700 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2701 (GpgmeImportResult): Rename to gpgme_import_result_t.
2702 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2703 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2704 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2705 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2706 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2707 GPGME_No_Passphrase.
2708 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2709 * context.h (struct gpgme_context_s): Rename to struct
2711 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2713 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2715 * keylist.c (finish_key): Clear OPD->tmp_uid.
2717 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2719 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2720 for NODATA status without signatures.
2722 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2724 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2725 (_gpgme_key_add_sig): Likewise.
2727 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2729 * context.h (struct gpgme_context_s): Remove member op_info.
2731 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2733 * gpgme.h (GpgmeError): Add deprecated values for
2734 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2736 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2738 * gpgme.h (gpgme_get_op_info): Remove prototype.
2739 * ops.h (_gpgme_set_op_info,
2740 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2741 _gpgme_data_append, _gpgme_data_append_string,
2742 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2743 _gpgme_data_append_percentstring_for_xml): Likewise.
2744 (_gpgme_progress_status_handler): Change first arg to void *.
2745 * progress.c (_gpgme_progress_status_handler): Likewise.
2746 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2747 and <sys/types.h>, but <string.h>.
2748 (_gpgme_data_append): Remove function.
2749 (_gpgme_data_append_string): Likewise.
2750 (_gpgme_data_append_for_xml): Likewise.
2751 (_gpgme_data_append_string_for_xml): Likewise.
2752 (_gpgme_data_append_percentstring_for_xml): Likewise.
2753 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2754 (_gpgme_data_release_and_return_string): Likewise.
2755 * gpgme.c (gpgme_get_op_info): Likewise.
2756 (_gpgme_set_op_info): Likewise.
2758 * gpgme.h (struct _gpgme_key): New structure.
2759 (GpgmeKey): Define using _gpgme_key.
2760 (struct _gpgme_subkey): New structure.
2761 (GpgmeSubKey): New type.
2762 (struct _gpgme_key_sig): New structure.
2763 (GpgmeKeySig): New type.
2764 (struct _gpgme_user_id): New structure.
2765 (GpgmeUserID): New type.
2766 (struct _gpgme_op_keylist_result): New structure.
2767 (GpgmeKeyListResult): New type.
2768 (gpgme_op_keylist_result): New function.
2769 (gpgme_key_get_as_xml): Remove prototype.
2770 * context.h (struct gpgme_context_s): Remove members tmp_key,
2771 tmp_uid, key_cond and key_queue.
2772 (struct key_queue_item_s): Remove structure.
2773 (struct user_id_s): Remove structure.
2774 (struct gpgme_recipients_s): Replace with simple
2776 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2777 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2778 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2779 * rungpg.c (command_cb): Return GpgmeError instead int.
2780 New variable ERR. Use it to hold return value of cmd handler.
2781 (gpg_delete): Access fingerprint of key directly.
2782 (append_args_from_signers): Likewise.
2783 (gpg_edit): Likewise.
2784 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2785 * engine-gpgsm.c: Do not include "key.h".
2786 (gpgsm_delete): Access fingerprint of key directly.
2787 (gpgsm_sign): Likewise.
2788 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2790 * key.h: File removed.
2791 * key.c: Completely reworked to use exposed GpgmeKey data types.
2792 * keylist.c: Likewise.
2793 * recipient.c: Completely reworked to use GpgmeUserID.
2795 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2797 * gpgme.h (gpgme_get_key): Remove force_update argument.
2798 * key-cache.c: File removed.
2799 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2800 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2802 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2803 _gpgme_key_cache_add.
2804 (gpgme_get_key): New function.
2805 * verify.c (gpgme_get_sig_key): Remove last argument to
2806 gpgme_get_key invocation.
2808 * gpgme.h (struct _gpgme_trust_item): New structure.
2809 (GpgmeTrustItem): New type.
2810 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2811 * context.h (struct trust_queue_item_s): Remove structure.
2812 (struct gpgme_context_s): Remove trust_queue member.
2813 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2814 * trust-item.c: New file.
2815 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2817 (struct trust_queue_item_s): Change to new type op_data_t.
2818 (trust_status_handler): Change first argument to void *.
2819 (trust_colon_handler): Likewise.
2820 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2821 (gpgme_op_trustlist_start): Use op_data_t and rework error
2823 (gpgme_op_trustlist_next): Use op_data_t.
2824 (gpgme_trust_item_release): Remove function.
2825 (gpgme_trust_item_get_string_attr): Likewise.
2826 (gpgme_trust_item_get_int_attr): Likewise.
2828 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2831 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2833 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2834 (struct gpgme_context_s): Remove member notation.
2835 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2837 * gpgme.h (struct _gpgme_sig_notation): New structure.
2838 (GpgmeSigNotation): New type.
2839 (struct _gpgme_signature): New structure.
2840 (GpgmeSignature): New type.
2841 (struct _gpgme_op_verify_result): New structure.
2842 (GpgmeVerifyResult): New type.
2843 (gpgme_op_verify_result): New prototype.
2844 (gpgme_get_notation): Remove prototype.
2845 * ops.h (_gpgme_op_verify_init_result): New prototype.
2846 (_gpgme_verify_status_handler): Change first argument to void *.
2847 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2849 * conversion.c (_gpgme_decode_percent_string): New function.
2850 (gnupg_errors): New static global.
2851 (_gpgme_map_gnupg_error): New function.
2852 * gpgme.c (gpgme_release): Don't release CTX->notation.
2853 (gpgme_get_notation): Remove function.
2854 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2855 _gpgme_op_verify_init_result.
2856 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2857 do include "gpgme.h".
2858 (struct verify_result): Replace with ...
2859 (op_data_t): ... this type.
2860 (release_verify_result): Remove function.
2861 (release_op_data): New function.
2862 (is_token): Remove function.
2863 (skip_token): Remove function.
2864 (copy_token): Remove function.
2865 (gpgme_op_verify_result): New function.
2866 (calc_sig_summary): Rewritten.
2867 (finish_sig): Remove function.
2868 (parse_new_sig): New function.
2869 (parse_valid_sig): New function.
2870 (parse_notation): New function.
2871 (parse_trust): New function.
2872 (parse_error): New function.
2873 (_gpgme_verify_status_handler): Rewritten. Change first argument
2875 (_gpgme_op_verify_start): Rework error handling. Call
2876 _gpgme_op_verify_init_result.
2877 (gpgme_op_verify): Do not release or clear CTX->notation.
2878 (gpgme_get_sig_status): Rewritten.
2879 (gpgme_get_sig_string_attr): Likewise.
2880 (gpgme_get_sig_ulong_attr): Likewise.
2881 (gpgme_get_sig_key): Likewise.
2883 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2884 (GpgmeDecryptResult): New type.
2885 (gpgme_op_decrypt_result): New prototype.
2886 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2887 (_gpgme_decrypt_status_handler): Fix prototype.
2888 (_gpgme_decrypt_start): Remove prototype.
2889 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2890 <string.h> and <assert.h>, "util.h" and "context.h", but
2892 (decrypt_verify_status_handler): Change first argument to void *,
2893 and rework error handling.
2894 (_gpgme_op_decrypt_verify_start): New function.
2895 (gpgme_op_decrypt_verify_start): Rewrite using
2896 _gpgme_op_decrypt_verify_start.
2897 (gpgme_op_decrypt_verify): Likewise.
2898 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2899 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2900 (is_token): Remove function.
2901 (release_op_data): New function.
2902 (skip_token): Remove function.
2903 (gpgme_op_decrypt_result): New function.
2904 (_gpgme_decrypt_status_handler): Change first argument to void *.
2905 Rework error handling.
2906 (_gpgme_decrypt_start): Rename to ...
2907 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2908 (_gpgme_op_decrypt_init_result): New function.
2909 (gpgme_op_decrypt_start): Use decrypt_start.
2910 (gpgme_op_decrypt): Likewise.
2912 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2914 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2915 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2916 (_gpgme_op_encrypt_sign_start): Rename to ...
2917 (encrypt_sign_start): ... this.
2918 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2919 _gpgme_op_encrypt_sign_start.
2920 (gpgme_op_encrypt_sign): Likewise.
2922 * gpgme.h (GpgmeEncryptResult): New data type.
2923 (gpgme_op_encrypt_result): New prototype.
2924 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2925 (_gpgme_op_encrypt_status_handler): Fix prototype.
2926 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2927 _gpgme_op_encrypt_init_result.
2928 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2929 "wait.h". Include <errno.h> and "gpgme.h".
2930 (SKIP_TOKEN_OR_RETURN): Remove macro.
2931 (struct encrypt_result): Rename to ...
2932 (op_data_t): ... new data type. Rewrite for user result data.
2933 (append_xml_encinfo): Remove function.
2934 (release_op_data): New function.
2935 (gpgme_op_encrypt_result): New function.
2936 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2937 Rewrite result parsing.
2938 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2940 (_gpgme_op_encrypt_init_result): New function.
2941 (_gpgme_op_encrypt_start): Rename to ...
2942 (encrypt_start): ... this.
2943 (gpgme_op_encrypt_start): Use encrypt_start, not
2944 gpgme_op_encrypt_start.
2945 (gpgme_op_encrypt): Likewise.
2947 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2948 GpgmeNewSignature, GpgmeSignResult): New data types.
2949 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2950 gpgme_hash_algo_name): New prototypes.
2951 * gpgme.c (gpgme_pubkey_algo_name): New function.
2952 (gpgme_hash_algo_name): Likewise.
2953 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2955 (_gpgme_op_sign_status_handler): Fix prototype.
2956 * op-support.c: Include <errno.h> and <string.h>.
2957 (_gpgme_parse_inv_userid): New function.
2958 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2959 <assert.h> and "util.h".
2960 (SKIP_TOKEN_OR_RETURN): Remove macro.
2961 (struct sign_result): Change to op_data_t type and rework it.
2962 (release_sign_result): Rename to ...
2963 (release_op_data): ... this and rewrite it.
2964 (append_xml_info): Remove function.
2965 (gpgme_op_sign_result): New function.
2966 (parse_sig_created): New function.
2967 (_gpgme_sign_status_handler): Change first argument to void *.
2968 Rewrite the function to use the new result structure and functions.
2969 (_gpgme_op_sign_init_result): New function.
2970 (_gpgme_op_sign_start): Rename to ...
2971 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2972 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2973 (gpgme_op_sign): Likewise.
2974 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2975 _gpgme_op_sign_init_result.
2977 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2979 (enum delete_problem): Move into function delete_status_handler.
2980 (delete_status_handler): Change first argument to void *. Parse
2981 delete problem with strtol instead atoi. Return better error
2983 (_gpgme_op_delete_start): Rename to ...
2984 (delete_start): ... this. Rework error handling.
2985 (gpgme_op_delete_start): Use delete_start instead
2986 _gpgme_op_delete_start.
2987 (gpgme_op_delete): Likewise.
2988 * gpgme.h (GpgmeDataType): Removed.
2990 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2992 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2993 * import.c (parse_import_res): Parse unchanged field.
2995 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2996 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2997 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2998 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2999 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3000 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3001 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3002 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3003 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3004 (struct _gpgme_import_status): New structure.
3005 (GpgmeImportStatus): New type.
3006 (struct _gpgme_op_import_result): New structure.
3007 (GpgmeImportResult): New type.
3008 (gpgme_op_import_result): New function.
3009 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3010 (struct import_result): Change to type op_data_t.
3011 (release_import_result): Rename to ...
3012 (release_op_data): ... this.
3013 (append_xml_impinfo): Function removed.
3014 (gpgme_op_import_result): New function.
3015 (parse_import): New function.
3016 (parse_import_res): Likewise.
3017 (import_status_handler): Change first argument to void *. Rewrite
3018 to use new functions.
3019 (_gpgme_op_import_start): Rework error handling.
3021 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3022 (edit_resut): Change to typedef for op_data_t.
3023 (edit_status_handler): Change first argument to void *.
3024 Rework error handling.
3025 (command_handler): Rework error handling.
3026 (_gpgme_op_edit_start): Rename to ...
3027 (edit_start): ... this. Rework error handling.
3028 (gpgme_op_edit_start): Rewrite using edit_start.
3029 (gpgme_op_edit): Likewise.
3031 * ops.h (_gpgme_passphrase_start): Remove prototype.
3032 * passphrase.c: Do not include <assert.h>, "util.h" or
3033 "debug.h", but "gpgme.h".
3034 (struct passphrase_result): Change to typedef for op_data_t.
3035 (release_passphrase_result): Rename to release_op_data.
3036 (_gpgme_passphrase_status_handler): Change first argument to void *.
3037 Use new op_data_t type.
3038 (_gpgme_passphrase_command_handler): Use new op_data_t type.
3039 (_gpgme_passphrase_start): Remove function.
3040 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
3041 not call _gpgme_passphrase_start, but install command handler.
3042 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3043 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3044 * sign.c (_gpgme_op_sign_start): Likewise.
3046 * context.h (struct gpgme_context_s): Remove member initialized,
3047 use_cms and help_data_1. Add member protocol. Make use_armor and
3048 use_textmode bit flags. Make keylist_mode, include_certs,
3049 signers_len and signers_size unsigned.
3050 * gpgme.c (gpgme_new): Initialize CTX->protocol.
3051 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
3052 (gpgme_get_protocol): Likewise.
3053 (gpgme_release): Do not release CTX->help_data_1.
3054 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3056 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3058 * data.c: Do not include <assert.h>, but "gpgme.h".
3059 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3060 it will go. Do not assert DH.
3061 (_gpgme_data_outbound_handler): Do not assert DH.
3063 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3065 (export_status_handler): Change type of first argument to void *.
3066 (_gpgme_op_export_start): Rename to ...
3067 (export_start): ... this. Rework error handling.
3068 (gpgme_op_export_start): Rewritten to use export_start instead
3069 _gpgme_op_export_start.
3070 (gpgme_op_export): Likewise.
3072 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3073 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3074 GPGME_No_Passphrase): New macros.
3076 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3078 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3080 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3081 (GpgmeGenKeyResult): New type.
3082 (gpgme_op_genkey): Drop last argument.
3083 (gpgme_op_genkey_result): New function.
3084 * genkey.c: Do not include "util.h", but "gpgme.h".
3085 (struct genkey_result): Replace with ...
3086 (op_data_t): ... this new type.
3087 (release_genkey_result): Replace with ...
3088 (release_op_data): ... this new function.
3089 (gpgme_op_genkey_result): New function.
3090 (genkey_status_handler): Rewritten using new op_data_t type.
3091 (get_key_parameter): New function.
3092 (_gpgme_op_genkey_start): Renamed to
3093 (genkey_start): ... this and rewritten.
3094 (gpgme_op_genkey_start): Use genkey_start instead
3095 _gpgme_op_genkey_start.
3096 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3098 * context.h (struct gpgme_context_s): Remove member verbosity.
3099 * gpgme.c (gpgme_new): Do not set member verbosity.
3100 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3101 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3102 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3103 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3104 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3105 (gpg_set_verbosity): Remove function.
3106 * decrypt.c (_gpgme_decrypt_start): Don't call
3107 _gpgme_engine_set_verbosity.
3108 * delete.c (_gpgme_op_delete_start): Likewise.
3109 * edit.c (_gpgme_op_edit_start): Likewise.
3110 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3111 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3112 * export.c (_gpgme_op_export_start): Likewise.
3113 * genkey.c (_gpgme_op_genkey_start): Likewise.
3114 * import.c (_gpgme_op_import_start): Likewise.
3115 * keylist.c (gpgme_op_keylist_start): Likewise.
3116 (gpgme_op_keylist_ext_start): Likewise.
3117 * sign.c (_gpgme_op_sign_start): Likewise.
3118 * verify.c (_gpgme_op_verify_start): Likewise.
3120 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3121 * key.c (key_cache_initialized, key_cache_size,
3122 key_cache_max_chain_length, ): Removed.
3123 (struct key_cache_item_s, key_cache_lock, key_cache,
3124 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3125 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3126 * key-cache.c: ... here. New file.
3127 * key.h (_gpgme_key_cache_init): Remove prototypes.
3128 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3130 * version.c: Do not include "key.h".
3131 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3133 * mkstatus: Strip trailing comma.
3134 * gpgme.h (GpgmeStatus): Pretty print.
3136 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3137 GPGME_Bad_Passphrase.
3138 * passphrase.c (_gpgme_passphrase_status_handler): Use
3139 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3141 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3142 GPGME_No_UserID and GPGME_Invalid_Recipient to
3143 GPGME_Invalid_UserID.
3144 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3145 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3146 GPGME_Invalid_Recipient.
3147 (_gpgme_op_encrypt_start): Likewise.
3149 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3150 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3151 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3152 * wait-global.c (gpgme_wait): Likewise.
3153 * verify.c (_gpgme_op_verify_start): Likewise.
3154 (gpgme_get_sig_status): Don't check pending flag.
3155 (gpgme_get_sig_string_attr): Likewise.
3156 (gpgme_get_sig_ulong_attr): Likewise.
3157 (gpgme_get_sig_key): Likewise.
3158 * op-support.c (_gpgme_op_reset): Likewise.
3159 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3160 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3161 (gpgme_op_trustlist_end): Likewise.
3162 * sign.c (_gpgme_op_sign_start): Likewise.
3163 * context.h (struct gpgme_context_s): Remove member PENDING.
3164 * decrypt.c (_gpgme_decrypt_start): Likewise.
3165 * delete.c (_gpgme_op_delete_start): Likewise.
3166 * edit.c (_gpgme_op_edit_start): Likewise.
3167 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3168 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3169 * export.c (_gpgme_op_export_start): Likewise.
3170 * genkey.c (_gpgme_op_genkey_start): Likewise.
3171 * import.c (_gpgme_op_import_start): Likewise.
3172 * key.c (gpgme_get_key): Likewise.
3173 * keylist.c (gpgme_op_keylist_start): Likewise.
3174 (gpgme_op_keylist_ext_start): Likewise.
3175 (gpgme_op_keylist_next): Likewise.
3176 (gpgme_op_keylist_end): Likewise.
3177 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3179 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3181 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3182 and add argument for returning the result string.
3183 (gpgme_cancel): Remove prototype.
3184 * gpgme.c (gpgme_cancel): Remove function.
3185 * context.h (struct gpgme_context_s): Remove member cancel.
3186 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3187 passphrase callback in the new way.
3189 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3191 * edit.c (_gpgme_edit_status_handler): Call the progress status
3194 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3196 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3197 I/O handlers left to ...
3198 (_gpgme_user_io_cb_handler): ... here.
3200 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3202 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3203 could not be allocated.
3204 (gpgme_trust_item_release): Only release name if it is allocated.
3205 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3207 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3209 * rungpg.c (read_status): If he status handler returns an error,
3211 (status_handler): If read_status fails, just return the error.
3213 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3215 * engine-gpgsm.c (start): Handle all errors, not only most of
3217 (xtoi_1, xtoi_2): Remove macro.
3218 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3220 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3222 * engine-gpgsm.c (map_assuan_error): Replace
3223 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3224 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3226 * util.h (DIMof): Remove macro.
3228 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3229 _gpgme_data_unread): Prototypes removed.
3231 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3233 * types.h: File removed.
3234 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3235 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3237 * context.h: Likewise.
3238 * cengine-gpgsm.h: Likewise.
3239 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3240 for EngineStatusHandler, EngineColonLineHandler and
3241 EngineCommandHandler.
3242 (_gpgme_engine_set_status_handler): Change parameter type from
3243 GpgmeStatusHandler to EngineStatusHandler.
3244 (_gpgme_engine_set_command_handler): Change parameter type from
3245 GpgmeCommandHandler to EngineCommandHandler.
3246 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3247 GpgmeColonLineHandler to EngineColonLineHandler.
3248 * engine-backend.h: Include "engine.h" instead "types.h".
3249 (struct engine_ops): Change Gpgme*Handler parameters in members
3250 set_command_handler, set_colon_line_handler and set_status_handler
3252 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3253 type from GpgmeStatusHandler to EngineStatusHandler.
3254 (_gpgme_engine_set_command_handler): Change parameter type from
3255 GpgmeCommandHandler to EngineCommandHandler.
3256 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3257 GpgmeColonLineHandler to EngineColonLineHandler.
3258 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3259 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3260 member colon.fnc from GpgmeColonLineHandler to
3261 EngineColonLineHandler. Change type of member cmd.fnc from
3262 GpgmeCommandHandler to EngineCommandHandler.
3263 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3264 * rungpg.c (gpg_set_status_handler): Change parameter type from
3265 GpgmeStatusHandler to EngineStatusHandler.
3266 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3267 (assuan_simple_command): Likewise.
3268 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3269 from GpgmeColonLineHandler to EngineColonLineHandler.
3270 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3271 * rungpg.c (gpg_set_command_handler): Change parameter type from
3272 GpgmeCommandHandler to EngineCommandHandler.
3274 * engine-gpgsm.c (status_handler): Do not close status fd at end
3277 * ops.h (_gpgme_op_data_lookup): Add prototype.
3278 * op-support.c: Include <stdlib.h>.
3279 (_gpgme_op_data_lookup): New function.
3280 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3281 (struct decrypt_result_s): Rename to ...
3282 (struct decrypt_resul): ... this.
3283 (DecryptResult): New type.
3284 (_gpgme_decrypt_status_handler): Don't use
3285 test_and_allocate_result, but use _gpgme_op_data_lookup to
3286 retrieve result data object.
3287 * sign.c (_gpgme_release_sign_result): Function removed.
3288 (release_sign_result): New function.
3289 (struct sign_result_s): Rename to ...
3290 (struct sign_result): ... this.
3291 (SignResult): New type.
3292 (_gpgme_sign_status_handler): Don't use
3293 test_and_allocate_result, but use _gpgme_op_data_lookup to
3294 retrieve result data object.
3295 * encrypt.c (struct encrypt_result_s): Rename to ...
3296 (struct encrypt_result): ... this.
3297 (_gpgme_release_encrypt_result): Function removed.
3298 (release_encrypt_result): New function.
3299 (_gpgme_encrypt_status_handler): Don't use
3300 test_and_allocate_result, but use _gpgme_op_data_lookup to
3301 retrieve result data object.
3302 * verify.c (struct verify_result_s): Rename to ...
3303 (struct verify_result): ... this. Remove member next.
3304 (VerifyResult): New type.
3305 (_gpgme_release_verify_result): Function removed.
3306 (release_verify_result): New function.
3307 (finish_sig): Change first argument to type VerifyResult. Diddle
3308 the type of the op_data structure.
3309 (add_notation): Change first argument to type VerifyResult.
3310 (_gpgme_verify_status_handler): Don't use
3311 test_and_allocate_result, but use _gpgme_op_data_lookup to
3312 retrieve result data object.
3313 * passphrase.c (struct passphrase_result_s): Rename to ...
3314 (struct passphrase_result): ... this. Remove member next.
3315 (PassphraseResult): New type.
3316 (_gpgme_release_passphrase_result): Function removed.
3317 (release_passphrase_result): New function.
3318 (_gpgme_passphrase_status_handler): Don't use
3319 test_and_allocate_result, but use _gpgme_op_data_lookup to
3320 retrieve result data object.
3321 (_gpgme_passphrase_command_handler): Likewise.
3322 * keylist.c (struct keylist_result_s): Rename to ...
3323 (struct keylist_result): ... this. Remove member next.
3324 (KeylistResult): New type.
3325 (_gpgme_release_keylist_result): Function removed.
3326 (release_keylist_result): New function.
3327 (keylist_status_handler): Don't use
3328 test_and_allocate_result, but use _gpgme_op_data_lookup to
3329 retrieve result data object.
3330 * edit.c (struct edit_result_s): Rename to ...
3331 (struct edit_result): ... this. Remove member next.
3332 (EditResult): New type.
3333 (_gpgme_release_edit_result): Function removed.
3334 (release_edit_result): New function.
3335 (edit_status_handler): Don't use
3336 test_and_allocate_result, but use _gpgme_op_data_lookup to
3337 retrieve result data object.
3338 (command_handler): Likewise.
3339 * types.h (DecryptResult, SignResult, EncryptResult,
3340 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3341 KeylistResult, EditResult): Types removed.
3342 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3343 (test_and_allocate_result): Remove macro.
3344 (_gpgme_release_decrypt_result): Remove prototype.
3345 (_gpgme_decrypt_result): Remove prototype.
3346 (_gpgme_release_sign_result): Remove prototype.
3347 (_gpgme_release_encrypt_result): Remove prototype.
3348 (_gpgme_release_passphrase_result): Remove prototype.
3349 (_gpgme_release_import_result): Remove prototype.
3350 (_gpgme_release_delete_result): Remove prototype.
3351 (_gpgme_release_genkey_result): Remove prototype.
3352 (_gpgme_release_keylist_result): Remove prototype.
3353 (_gpgme_release_edit_result): Remove prototype.
3354 (_gpgme_release_verify_result): Remove prototype.
3355 * gpgme.c (_gpgme_release_result): Rewritten.
3356 * context.h (enum ctx_op_data_type): New enum.
3357 (struct ctx_op_data): New structure.
3358 (struct gpgme_context_s): Replace the member result with a member
3360 (fail_on_pending_request): Remove macro.
3361 * op-support.c (_gpgme_op_reset): Expand macro
3362 fail_on_pending_request.
3363 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3365 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3367 * types.h (EngineObject): Move typedef to ...
3368 * engine.h: ... here.
3369 * types.h (GpgObject): Move typedef to ...
3370 * rungpg.c: ... here.
3371 * types.h (GpgsmObject): Move typedef to ...
3372 * engine-gpgsm.c: ... here.
3374 * util.h (return_if_fail, return_null_if_fail,
3375 return_val_if_fail): Remove macro.
3376 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3377 * key.c (gpgme_key_ref): Likewise.
3378 * signers.c (gpgme_signers_enum): Likewise.
3379 (gpgme_signers_clear): Likewise.
3381 * engine-backend.h (struct engine_ops): Rename get_path to
3383 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3385 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3386 util.h. Other clean ups.
3387 (parse_version_number): Protect more seriously against
3389 (gpgme_get_engine_info): Move to ...
3390 * engine.c (gpgme_get_engine_info): ... here.
3391 (_gpgme_engine_get_info): Function removed.
3392 (_gpgme_engine_get_path): Make static and rename to ...
3393 (engine_get_file_name): .. this.
3394 (_gpgme_engine_get_version): Make static and rename to ...
3395 (engine_get_version): ... this.
3396 (_gpgme_engine_get_req_version): Make static and rename to ...
3397 (engine_get_req_version): ... this.
3398 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3399 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3402 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3403 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3404 (gpgme_get_protocol_name): New function.
3406 * engine-backend.h (struct engine_ops): New member
3407 get_req_version, remove member check_version.
3408 * engine.h (_gpgme_Engine_get_version): New prototype.
3409 * rungpg.c (gpg_get_req_version): New function.
3410 (gpg_check_version): Function removed.
3411 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3413 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3414 (gpgsm_check_version): Function removed.
3415 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3416 gpgsm_check_version.
3417 * engine.c: Include ops.h.
3418 (_gpgme_engine_get_req_version): New function.
3419 (gpgme_engine_check_version): Rewritten.
3420 * version.c (gpgme_get_engine_info): Rewritten.
3421 * gpgme.h (gpgme_engine_info): New structure.
3422 (GpgmeEngineInfo): New type.
3424 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3426 * types.h: Remove byte and ulong types.
3427 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3429 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3431 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3432 few more escaped characters. Be more strict about buffer size.
3433 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3434 BUF and DST to unsigned char instead byte.
3435 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3437 * debug.c (trim_spaces): Likewise.
3439 * util.h (mk_error): Remove macro.
3440 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3441 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3442 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3443 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3444 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3445 wait-private (literally everywhere): Expand the mk_error macro.
3447 * context.h (wait_on_request_or_fail): Remove macro.
3449 * context.h (gpgme_context_s): Remove member ERROR.
3450 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3451 (GpgmeCommandHandler): Change return type to GpgmeError and add
3452 new argument RESULT.
3453 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3454 (GpgmeEventIO): New event GPGME_EVENT_START.
3455 (GpgmeIdleFunc): Remove type.
3456 (gpgme_register_idle): Remove prototype.
3457 * data.c: Include <assert.h>.
3458 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3459 Return any error instead ignoring it, don't close file descriptor
3461 (_gpgme_data_outbound_handler): Likewise.
3462 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3463 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3464 Return error instead setting ctx->error. Return success at end of
3466 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3467 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3468 type to GpgmeError. Return possible errors.
3469 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3471 (delete_status_handler): Change return type to GpgmeError. Return
3472 error instead setting ctx->error. Return success at end of
3474 * edit.c: Do not include <stdio.h> and <string.h>.
3475 (_gpgme_edit_status_handler): Change type to GpgmeError,
3476 make static and rename to ...
3477 (edit_status_handler): ... this. Return error directly.
3478 (command_handler): Change return type to GpgmeError, add result
3479 argument. Return error directly.
3480 * encrypt.c (status_handler_finish): Remove function.
3481 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3482 Return error directly.
3483 (_gpgme_encrypt_sym_status_handler): Likewise.
3484 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3485 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3487 (status_handler): Change return type to GpgmeError. Diddle things
3488 around a bit to return errors directly.
3489 (start): Send start event.
3490 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3491 (export_status_handler): Change return type to GpgmeError. Don't
3493 * genkey.c: Do not include <stdio.h> and <assert.h>.
3494 (genkey_status_handler): Change return type to GpgmeError. Don't
3495 check ctx->error. Return errors directly.
3496 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3497 (_gpgme_op_event_cb): Function removed.
3498 (_gpgme_op_event_cb_user): Likewise.
3499 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3500 (import_status_handler): Change return type to GpgmeError. Don't
3502 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3503 Change return type to GpgmeError, return error directly.
3504 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3505 wait-private.c and wait-user.c
3506 * ops.h (test_and_allocate_result): Return error instead setting
3508 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3509 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3510 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3511 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3512 Change return type to GpgmeError.
3513 (_gpgme_passphease_command_handler): Change return type to
3514 GpgmeError and add new argument RESULT.
3515 * op-support.c: Use new callback functions, and change private
3516 data to ctx everywhere.
3517 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3518 type to GpgmeError, return error directly.
3519 (_gpgme_passphrase_command_handler): Change return type to
3520 GpgmeError, add result argument. Return results accordingly.
3521 * progress.c (_gpgme_progress_status_handler): Change return type
3522 to GpgmeError, return errors directly.
3523 * rungpg.c (status_handler): Change return type to GpgmeError.
3524 Return error directly.
3525 (close_notify_handler): Don't send done event.
3526 (colon_line_handler): Change return type to GpgmeError, return
3528 * rungpg.c (start): Send start event.
3529 * sign.c (_gpgme_sign_status_handler): Change return type to
3530 GpgmeError, return errors directly.
3531 * trustlist.c (trustlist_status_handler): Change return type to
3532 GpgmeError. Return 0.
3533 (trustlist_colon_handler): Change return type GpgmeError. Return
3535 * verify.c (add_notation): Change return type to GpgmeError,
3536 return errors directly.
3537 (_gpgme_verify_status_handler): Likewise.
3538 * wait.h (struct fd_table): Remove lock member.
3539 (struct wait_item_s): Moved here from wait.c.
3540 (struct tag): New structure.
3541 (_gpgme_wait_event_cb): Remove prototype.
3542 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3543 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3544 _gpgme_wait_user_event_io_cb): New prototypes.
3545 * wait.c: Don't include <stdio.h>.
3546 (ftd_global, ctx_done_list, ctx_done_list_size,
3547 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3549 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3551 (gpgme_wait): Move to file wait-global.c.
3552 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3553 member in wait item and tag.
3554 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3555 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3557 (gpgme_fd_table_init): Don't initialize FDT->lock.
3558 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3559 (_gpgme_fd_table_put): Make static and rename to ...
3560 (fd_table_put): ... this function. Don't use FDT->lock.
3561 (struct wait_item_s): Move to wait.h.
3562 * wait-global.c: New file.
3563 * wait-private.c: New file.
3564 * wait-user.c: New file.
3566 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3567 instead otrust_to_string to calculate validity.
3569 2003-01-19 Miguel Coca <mcoca@gnu.org>
3571 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3573 * w32-util.c: Include "sema.h".
3574 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3577 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3579 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3580 (gpg_start): Rename to ...
3581 (start): ... this function. Change arguments to GpgObject.
3582 (gpg_decrypt): Call start.
3583 (gpg_edit): Likewise.
3584 (gpg_encrypt): Likewise.
3585 (gpg_encrypt_sign): Likewise.
3586 (gpg_export): Likewise.
3587 (gpg_import): Likewise.
3588 (gpg_keylist): Likewise.
3589 (gpg_keylist_ext): Likewise.
3590 (gpg_trustlist): Likewise.
3591 (gpg_verify): Likewise.
3593 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3594 (gpgsm_start): Rename to ...
3595 (struct gpgsm_object_s): Remove member command.
3596 (gpgsm_release): Don't free command.
3597 (start): ... this function. Change arguments to GpgsmObject and
3599 (gpgsm_decrypt): Call start.
3600 (gpgsm_delete): Likewise.
3601 (gpgsm_encrypt): Likewise.
3602 (gpgsm_export): Likewise.
3603 (gpgsm_genkey): Likewise.
3604 (gpgsm_import): Likewise.
3605 (gpgsm_keylist): Likewise.
3606 (gpgsm_keylist_ext): Likewise.
3607 (gpgsm_verify): Likewise.
3609 * decrypt.c (_gpgme_decrypt_start): Don't call
3610 _gpgme_engine_start.
3611 * delete.c (_gpgme_op_delete_start): Likewise.
3612 * edit.c (_gpgme_op_edit_start): Likewise.
3613 * encrypt.c (_gpgme_op_encrypt_start):
3614 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3615 * export.c (_gpgme_op_export_start): Likewise.
3616 * genkey.c (_gpgme_op_genkey_start): Likewise.
3617 * import.c (_gpgme_op_import_start): Likewise.
3618 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3619 (gpgme_op_keylist_start): Likewise.
3620 * sign.c (_gpgme_op_sign_start): Likewise.
3621 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3622 * verify.c (_gpgme_op_verify_start): Likewise.
3624 * engine-backend.h (struct engine_ops): Remove member start.
3626 * engine.h (_gpgme_engine_start): Remove prototype.
3627 * engine.c (_gpgme_engine_start): Remove function.
3629 2003-01-06 Werner Koch <wk@gnupg.org>
3631 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3632 since gpg 1.3 to denote disabled keys.
3634 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3636 * data-mem.c: Include <string.h>.
3637 * engine.c: Likewise.
3639 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3641 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3643 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3645 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3647 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3649 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3650 (_gpgme_intersect_stati): Function removed.
3651 * ops.h (_gpgme_intersect_stati): Remove prototype.
3653 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3655 * libgpgme.vers: New file.
3656 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3657 (libgpgme_version_script_cmd): New variable.
3658 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3659 (libgpgme_la_DEPENDENCIES): New variable.
3661 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3663 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3664 (otrust_to_string): New function.
3665 (gpgme_key_get_as_xml): Use it.
3666 (validity_to_string): New function.
3667 (gpgme_key_get_string_attr): Beautify using above functions.
3668 (gpgme_key_get_ulong_attr): Likewise.
3670 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3672 * data-mem.c (mem_release): Fix gcc warning.
3673 * data-user.c (user_release): Likewise.
3675 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3677 * data.h (gpgme_data_release_cb): Change return type to void.
3678 (gpgme_data_read_cb): Change return type to ssize_t.
3679 * data.c (gpgme_data_read): Likewise.
3680 * data-stream.c (stream_read): Likewise.
3681 * data-fd.c (fd_read): Likewise.
3682 * data-mem.c (mem_read): Likewise.
3683 (mem_release): Change return type to void.
3684 * data-user.c (user_read): Change return type to ssize_t.
3685 (user_release): Change return type to void.
3686 * data-compat.c (old_user_read): Change return type to ssize_t.
3687 * gpgme.h (GpgmeDataReadCb): Likewise.
3688 (gpgme_data_read): Likewise.
3689 (GpgmeDataSeekCb): Change return type to off_t.
3691 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3693 * gpgme.h: Add prototype for gpgme_get_key.
3694 * key.c (gpgme_get_key): New function.
3695 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3697 * gpgme.h: Add prototypes for new interfaces
3698 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3699 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3700 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3701 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3702 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3704 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3705 Use that to determine if allocation is desired or not.
3706 * util.h: Adjust prototype of _gpgme_decode_c_string.
3707 * keylist.c (keylist_colon_handler): Adjust caller of
3708 _gpgme_decode_c_string.
3710 * key.h (struct gpgme_key_s): New member last_uid.
3711 * key.c (_gpgme_key_append_name): Rewritten using
3712 _gpgme_decode_c_string and the last_uid pointer.
3713 (my_isdigit): Macro removed.
3714 (ALLOC_CHUNK): Likewise.
3715 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3717 * context.h (struct user_id_s): New member last_certsig.
3718 * key.h: Add prototype for _gpgme_key_add_certsig.
3719 * key.c (_gpgme_key_add_certsig): New function.
3720 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3721 (parse_user_id): Change first argument to SRC, add new arguments
3722 NAME, EMAIL and COMMENT. Change code to use these arguments
3723 instead going through UID. Move function before
3725 (parse_x509_user_id): Likewise.
3726 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3727 and parse_user_id invocation.
3728 (one_certsig_as_xml): New function.
3729 (one_uid_as_xml): Print signatures.
3730 * context.h (struct gpgme_context_s): New member TMP_UID.
3731 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3734 * key.c (get_certsig): New function.
3735 (gpgme_key_sig_get_string_attr): Likewise.
3736 (gpgme_key_sig_get_ulong_attr): Likewise.
3738 * keylist.c: Include <ctype.h>.
3739 (my_isdigit): Macro removed.
3740 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3741 (set_userid_flags): Likewise.
3742 (set_subkey_trust_info): Likewise.
3743 (set_ownertrust): Likewise.
3744 (finish_key): Move function up a bit and remove prototype.
3746 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3748 (gpg_keylist_ext): Implement signature listing mode.
3750 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3752 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3753 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3755 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3756 CloseHandle for parent fds.
3758 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3760 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3762 2002-11-22 Werner Koch <wk@gnupg.org>
3764 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3765 setlocale before doing another setlocale.
3767 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3769 * decrypt.c: Some beautyfication.
3771 * verify.c (_gpgme_verify_status_handler): Treat
3772 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3773 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3775 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3777 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3778 (struct genkey_result_s): Add new member FPR.
3779 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3780 (genkey_status_handler): Extract the fingerprint from the status
3782 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3784 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3786 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3788 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3789 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3790 <twoaday@freakmail.de>.
3791 (gpg_keylist_ext): Likewise.
3793 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3795 * import.c (append_xml_impinfo): Use
3796 _gpgme_data_append_string_for_xml rather than
3797 _gpgme_data_append_string for the field content.
3798 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3800 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3802 * rungpg.h, engine-gpgsm.h: File removed.
3803 * engine-backend.h: New file.
3804 * Makefile.am (gpgsm_components): New variable, set depending on
3805 automake conditional HAVE_GPGSM.
3806 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3807 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3808 (status-table.h): Depend on gpgme.h, not rungpg.h.
3809 * conversion.c: Include <stdlib.h>.
3810 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3811 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3812 functions and remove all function prototypes.
3813 (_gpgme_gpgsm_get_version): Make static and rename to ...
3814 (gpgsm_get_version): ... this.
3815 (_gpgme_gpgsm_check_version): Make static and rename to ...
3816 (gpgsm_check_version): ... this.
3817 (_gpgme_gpgsm_new): Make static. Change argument type from
3818 GpgsmObject * to void **. Call gpgsm_release instead
3819 _gpgme_gpgsm_release.
3820 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3821 (gpgsm_check_decrypt): ... this.
3822 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3823 (gpgsm_check_delete): ... this.
3824 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3825 (gpgsm_check_set_recipients): ... this.
3826 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3827 (gpgsm_encrypt): ... this.
3828 (_gpgme_gpgsm_op_export): Make static and rename to ...
3829 (gpgsm_export): ... this.
3830 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3831 (gpgsm_genkey): ... this.
3832 (_gpgme_gpgsm_op_import): Make static and rename to ...
3833 (gpgsm_import): ... this.
3834 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3835 (gpgsm_keylist): ... this.
3836 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3837 (gpgsm_keylist_ext): ... this.
3838 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3839 (gpgsm_sign): ... this.
3840 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3841 (gpgsm_trustlist): ... this.
3842 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3843 (gpgsm_verify): ... this.
3844 (gpgsm_status_handler): Rename to ...
3845 (status_handler): ... this.
3846 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3847 (gpgsm_set_status_handler): ... this.
3848 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3849 (gpgsm_set_colon_line_handler): ... this.
3850 (_gpgme_gpgsm_add_io_cb): Rename to ...
3851 (add_io_cb): ... this.
3852 (_gpgme_gpgsm_start): Make static and rename to ...
3853 (gpgsm_start): ... this.
3854 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3855 (gpgsm_set_io_cb): ... this.
3856 (_gpgme_gpgsm_io_event): Make static and rename to ...
3857 (gpgsm_io_event): ... this.
3858 (struct _gpgme_engine_ops_gpgsm): New variable.
3859 [!ENABLE_GPGSM]: Removed.
3860 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3861 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3862 <stdlib.h> and "engine-backend.h".
3863 (struct engine_object_s): Rewritten.
3864 (engine_ops): New variable.
3865 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3866 _gpgme_engine_check_version, _gpgme_engine_new,
3867 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3868 _gpgme_engine_set_status_handler,
3869 _gpgme_engine_set_command_handler,
3870 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3871 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3872 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3873 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3874 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3875 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3876 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3877 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3878 _gpgme_engine_io_event): Reimplement.
3879 * engine.h: Fix a few comments and a variable name in a prototype.
3880 * ops.h: Do not include "rungpg.h".
3881 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3883 * recipient.c: Likewise.
3884 * signers.c: Likewise.
3885 * version.c: Likewise.
3886 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3887 functions and remove prototypes.
3888 (_gpgme_gpg_get_version): Make static and rename to ...
3889 (gpg_get_version): ... this.
3890 (_gpgme_gpg_check_version): Make static and rename to ...
3891 (gpg_check_version): ... this.
3892 (_gpgme_gpg_new): Make static. Change argument type from
3893 GpgObject * to void **. Call gpg_release instead
3895 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3896 (gpg_check_decrypt): ... this.
3897 (_gpgme_gpg_op_delete): Make static and rename to ...
3898 (gpg_check_delete): ... this.
3899 (_gpgme_gpg_set_recipients): Make static and rename to ...
3900 (gpg_check_set_recipients): ... this.
3901 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3902 (gpg_encrypt): ... this.
3903 (_gpgme_gpg_op_export): Make static and rename to ...
3904 (gpg_export): ... this.
3905 (_gpgme_gpg_op_genkey): Make static and rename to ...
3906 (gpg_genkey): ... this.
3907 (_gpgme_gpg_op_import): Make static and rename to ...
3908 (gpg_import): ... this.
3909 (_gpgme_gpg_op_keylist): Make static and rename to ...
3910 (gpg_keylist): ... this.
3911 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3912 (gpg_keylist_ext): ... this.
3913 (_gpgme_gpg_op_sign): Make static and rename to ...
3914 (gpg_sign): ... this.
3915 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3916 (gpg_trustlist): ... this.
3917 (_gpgme_gpg_op_verify): Make static and rename to ...
3918 (gpg_verify): ... this.
3919 (gpg_status_handler): Rename to ...
3920 (status_handler): ... this.
3921 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3922 (gpg_set_status_handler): ... this.
3923 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3924 (gpg_set_colon_line_handler): ... this.
3925 (gpgme_gpg_add_io_cb): Rename to ...
3926 (add_io_cb): ... this.
3927 (_gpgme_gpg_start): Make static and rename to ...
3928 (gpg_start): ... this.
3929 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3930 (gpg_set_io_cb): ... this.
3931 (_gpgme_gpg_io_event): Make static and rename to ...
3932 (gpg_io_event): ... this.
3933 (struct _gpgme_engine_ops_gpg): New variable.
3935 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3937 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3940 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3942 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3943 data-compat.c: New file. Really check them in this time, completes
3946 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3948 * types.h (GpgmeStatusHandler): ... here.
3949 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3951 * types.h (GpgmeColonLineHandler): ... here.
3952 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3954 * types.h (GpgmeCommandHandler): ... here.
3955 * engine.h: Don't include "rungpg.h".
3956 (_gpgme_engine_set_status_handler): Change type of
3957 argument from GpgStatusHandler to GpgmeStatusHandler.
3958 (_gpgme_engine_set_colon_line_handler): Change type of
3959 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3960 (_gpgme_engine_set_command_handler): Change type of
3961 argument from GpgCommandHandler to GpgmeCommandHandler.
3962 * engine-gpgsm.h: Don't include "rungpg.h".
3963 (_gpgme_gpgsm_set_status_handler): Change type of
3964 argument from GpgStatusHandler to GpgmeStatusHandler.
3965 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3966 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3967 * engine-gpgsm.c: Do not include "rungpg.h".
3968 (struct gpgsm_object_s): Change type of
3969 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3970 GpgmeColonLineHandler.
3971 (gpgsm_assuan_simple_command): Change type of argument from
3972 GpgStatusHandler to GpgmeStatusHandler.
3973 (_gpgme_gpgsm_set_status_handler): Likewise.
3974 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3975 GpgColonLineHandler to GpgmeColonLineHandler.
3976 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3977 argument from GpgStatusHandler to GpgmeStatusHandler.
3978 (_gpgme_gpg_set_colon_line_handler): Change type of
3979 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3980 (_gpgme_gpg_set_command_handler): Change type of
3981 argument from GpgCommandHandler to GpgmeCommandHandler.
3982 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3983 GpgmeStatusHandler. Change type of colon.fnc to
3984 GpgmeColonLineHandler. Change type of cmd.fnc to
3985 GpgmeCommandLineHandler.
3986 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3988 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3989 to GpgmeColonLineHandler.
3990 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3991 GpgmeCommandHandler.
3992 * engine.c (_gpgme_engine_set_status_handler): Change type of
3993 argument FNC to GpgmeStatusHandler.
3994 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3995 to GpgmeColonLineHandler.
3996 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3997 GpgmeCommandHandler.
3999 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4000 * rungpg.c (struct gpg_object_s): Remove PM.
4001 (pipemode_cb): Prototype removed.
4002 (add_pm_data): Function removed.
4003 (_gpgme_gpg_enable_pipemode): Likewise.
4004 (pipemode_copy): Likewise.
4005 (pipemode_cb): Likewise.
4006 (add_arg): Don't check for pipemode.
4007 (add_data): Likewise.
4008 (_gpgme_gpg_set_status_handler): Likewise.
4009 (_gpgme_gpg_set_colon_line_handler): Likewise.
4010 (_gpgme_gpg_set_command_handler): Likewise.
4011 (_gpgme_gpg_spawn): Likewise.
4012 (_gpgme_gpg_spawn): Don't set PM.active.
4013 (_gpgme_gpg_op_verify): Remove pipemode case.
4014 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4016 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4017 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4018 _gpgme_gpg_set_simple_line_handler): Prototype removed.
4019 (_gpgme_gpg_set_verbosity): New prototype.
4020 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4021 (add_data): ... this.
4022 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4023 (_gpgme_gpg_set_command_handler): Likewise.
4024 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4025 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4026 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4027 _gpgme_gpg_op_verify): Likewise.
4028 (_gpgme_gpg_add_pm_data): Rename to ...
4029 (add_pm_data): ... this.
4030 (_gpgme_gpg_op_verify): Call add_pm_data, not
4031 _gpgme_gpg_add_pm_data.
4032 (_gpgme_gpg_add_arg): Make static and rename to ...
4033 (add_arg): ... this.
4034 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4035 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4036 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4037 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4038 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4039 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4040 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4041 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4043 (_gpgme_gpg_set_verbosity): New function.
4044 (struct gpg_object_s): Remove member simple from colon.
4045 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4046 (_gpgme_gpg_set_simple_line_handler): Removed function.
4047 (read_colon_line): Don't check the GPG->colon.simple.
4048 * engine.c (_gpgme_engine_set_verbosity): Call
4049 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4051 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4053 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4054 _gpgme_strdup, _gpgme_free): Remove prototypes.
4055 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4057 * util.c: File removed.
4058 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4059 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4060 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4061 xtrycalloc, free instead of xfree.
4062 (_gpgme_data_append_percentstring_for_xml): Likewise.
4063 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4064 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4065 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4066 _gpgme_data_get_as_string): Likewise.
4067 * debug.c (debug_init): Likewise.
4068 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4069 * delete.c (_gpgme_release_delete_result): Likewise.
4070 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4072 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4073 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4074 _gpgme_engine_release): Likewise.
4075 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4076 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4077 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4078 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4079 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4080 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4081 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4082 * genkey.c (_gpgme_release_genkey_result): Likewise.
4083 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4084 * import.c (_gpgme_release_import_result): Likewise.
4085 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4086 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4087 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4088 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4089 * ops.h (test_and_allocate_result): Likewise.
4090 * passphrase.c (_gpgme_release_passphrase_result,
4091 _gpgme_passphrase_status_handler,
4092 _gpgme_passphrase_command_handler): Likewise.
4093 * progress.c (_gpgme_progress_status_handler): Likewise.
4094 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4095 gpgme_recipients_add_name_with_validity): Likewise.
4096 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4097 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4098 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4099 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4101 * sign.c (_gpgme_release_sign_result): Likewise.
4102 * signers.c (_gpgme_signers_add): Likewise.
4103 * trustlist.c (trust_item_new, trustlist_colon_handler,
4104 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4105 gpgme_trustitem_release): Likewise.
4106 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4107 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4109 * w32-io.c (create_reader, create_writer, destroy_reader,
4110 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4111 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4112 * w32-util.c (read_w32_registry_string): Likewise.
4113 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4114 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4115 * data-compat.c: Include <stdlib.h>.
4117 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4119 New data object component:
4121 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4122 GpgmeDataReleaseCb): New types.
4123 (struct GpgmeDataCbs): New structure.
4124 (gpgme_data_read): Changed prototype to match that of read() closely.
4125 (gpgme_data_write): Similar for write().
4126 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4127 gpgme_data_new_from_stream): New prototypes.
4128 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4130 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4131 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4132 * data.c: Reimplemented from scratch.
4133 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4134 data-user.c): New file.
4135 * context.h (struct gpgme_data_s): Removed.
4136 * conversion.c: Include <errno.h> and <sys/types.h>.
4137 (_gpgme_data_append): New function.
4138 * data.c (_gpgme_data_append_string): Move to ...
4139 * conversion.c (_gpgme_data_append_string): ... here.
4140 * data.c (_gpgme_data_append_for_xml): Move to ...
4141 * conversion.c (_gpgme_data_append_for_xml): ... here.
4142 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4143 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4144 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4145 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4147 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4149 * types.h (GpgmeDataMode): Type removed.
4151 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4152 * edit.c (_gpgme_op_edit_start): Likewise.
4153 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4154 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4155 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4156 * export.c (_gpgme_op_export_start): Likewise.
4157 * genkey.c (_gpgme_op_genkey_start): Likewise.
4158 * import.c (_gpgme_op_import_start): Likewise.
4159 * sign.c (_gpgme_op_sign_start): Likewise.
4160 * verify.c (_gpgme_op_verify_start): Likewise.
4162 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4163 no recipient if no data was returned.
4164 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4165 no recipient if no data was returned.
4166 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4167 no recipient if no data was returned.
4169 * engine.c (_gpgme_engine_op_verify): Add new argument to
4170 differentiate detached from normal signatures.
4171 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4172 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4173 mode of data argument.
4174 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4175 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4176 (gpgme_op_verify): Likewise for prototype.
4177 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4178 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4179 * verify.c (_gpgme_op_verify_start): Likewise.
4180 (gpgme_op_verify_start): Likewise.
4181 (gpgme_op_verify): Likewise.
4183 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4184 direction of data object.
4185 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4186 determine direction of data object.
4187 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4188 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4189 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4190 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4191 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4193 (build_argv): Use new member INBOUND to determine direction of
4194 file descriptor. Don't check the data type.
4195 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4197 * gpgme.c (gpgme_get_op_info): Don't call
4198 _gpgme_data_get_as_string if CTX->op_info is NULL.
4200 * version.c (gpgme_check_engine): Function removed.
4202 2002-09-30 Werner Koch <wk@gnupg.org>
4204 * keylist.c (keylist_colon_handler): Take care when printing a
4205 NULL with the DEBUG.
4207 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4208 (gpgsm_status_handler): Run the colon function to indicate EOF.
4209 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4211 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4213 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4214 multiplication with base. Reported by Stéphane Corthésy.
4216 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4217 operation type in invocation of _gpgme_op_reset.
4219 2002-09-20 Werner Koch <wk@gnupg.org>
4221 * ath.c: Include sys/time.h if sys/select.h is not available.
4223 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4225 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4226 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4228 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4230 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4231 into gpgme unconditionally.
4232 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4234 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4236 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4238 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4240 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4241 (_gpgme_debug_end): Likewise.
4242 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4244 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4246 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4248 * version.c (_gpgme_get_program_version): Likewise.
4249 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4251 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4253 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4256 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4258 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4259 _gpgme_op_edit so its prototype is known early on.
4261 * conversion.c: New file.
4262 * util.h: Add prototypes for _gpgme_decode_c_string and
4264 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4266 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4267 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4268 calls to _gpgme_hextobyte.
4269 (hash_key): Likewise.
4271 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4273 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4274 _gpgme_engine_release, as this will reset pending to zero in the
4275 event done callback on cancelled operations.
4277 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4279 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4280 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4282 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4283 * rungpg.h: Also to prototype.
4284 * engine.c (_gpgme_engine_op_edit): Likewise.
4285 * engine.h: Likewise.
4286 * edit.c (_gpgme_op_edit_start): Likewise.
4288 2002-08-29 Werner Koch <wk@gnupg.org>
4290 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4292 * vasprintf.c (va_copy): Define macro if not yet defined.
4294 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4296 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4297 CTX->result.passphrase->no_passphrase if passphrase is given (good
4298 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4300 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4302 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4303 Return 0 on success, -1 on error.
4304 * version.c (_gpgme_get_program_version): Don't wait for the child.
4305 * engine.c (_gpgme_engine_housecleaning): Function removed.
4306 (do_reaping): Likewise.
4307 (_gpgme_engine_add_child_to_reap_list): Likewise.
4308 (struct reap_s): Removed.
4309 (reap_list): Likewise.
4310 (reap_list_lock): Likewise.
4311 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4312 _gpgme_engine_housecleaning and
4313 _gpgme_engine_add_child_to_reap_list.
4314 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4315 (struct gpg_object_s): Remove PID member.
4316 (_gpgme_gpg_new): Don't initialize GPG->pid.
4317 (_gpgme_gpg_spawn): Don't set GPG->pid.
4318 * wait.c (run_idle): Removed.
4319 (gpgme_wait): Run idle_function directly.
4321 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4323 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4324 variables encrypt_info and encrypt_info_len.
4325 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4326 * posix-sema.c (sema_fatal): Remove function.
4327 All these reported by Stéphane Corthésy.
4329 2002-08-23 Werner Koch <wk@gnupg.org>
4331 * gpgme-config.in: Made --prefix work for --libs.
4333 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4335 * ath.h: Update list of symbols that get a prefix: Rename the
4336 ath_mutex_*_available symbols to ath_*_available.
4338 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4340 * stpcpy.c: New file from gnulib.
4341 * Makefile.am (assuan_libobjs): Remove jnlib.
4343 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4345 * gpgme.h: Add prototype for gpgme_op_import_ext.
4346 * import.c (struct import_result_s): New member `nr_considered'.
4347 Rename `any_imported' to `nr_imported'.
4348 (import_status_handler): Increment nr_imported. Set nr_considered
4350 (gpgme_op_import_ext): New function.
4351 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4353 2002-08-20 Werner Koch <wk@gnupg.org>
4355 * gpgme.m4: Replaced with a new and faster version. This does not
4356 anymore try to build test programs. If we really need test
4357 programs, we should add an option to gpgme-config to do so.
4359 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4361 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4363 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4364 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4367 2002-08-19 Werner Koch <wk@gnupg.org>
4369 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4370 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4371 (_gpgme_decrypt_status_handler): Create an operation info.
4373 2002-08-14 Werner Koch <wk@gnupg.org>
4375 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4376 * key.c (gpgme_key_release): Release it. We need to add more code
4378 (_gpgme_key_append_name): Use memset to intialize the struct.
4379 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4380 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4383 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4384 information about the key type (PGP or X.509).
4385 (gpgme_key_get_ulong_attr): Likewise.
4387 * keylist.c (keylist_colon_handler): Include 1 in the check for
4388 valid algorithms so that RSA is usable. Store the issuer name and
4389 serial number also for "crs" records. Parse the expire date for
4391 (set_userid_flags): Put them onto the last appended key.
4393 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4395 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4397 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4399 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4402 The following changes make it possible to flush an inbound data
4403 pipe before invoking a command handler:
4405 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4406 _gpgme_io_select. Set timeout of 0 if this is set.
4407 * w32-io.c (_gpgme_io_select): Likewise.
4408 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4409 * wait.c (do_select): Add new argument to _gpgme_io_select
4411 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4412 linked_data to prototype.
4413 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4414 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4415 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4416 argument to _gpgme_engine_set_command_handler.
4417 * rungpg.c (struct gpg_object_s): New members linked_data and
4419 (_gpgme_gpg_new): Initialize those new members.
4420 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4421 (build_argv): Handle linked_data in the same hack as cb_data.
4422 (read_status): If linked_data is in use, flush the pipe before
4423 activating the command handler.
4424 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4427 The next changes export the status codes to the user:
4429 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4430 all STATUS_ with GPGME_.
4431 * delete.c (delete_status_handler): Likewise.
4432 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4433 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4434 (_gpgme_encrypt_sym_status_handler): Likewise.
4435 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4436 * engine-gpgsm.c (parse_status): Likewise.
4437 (gpgsm_status_handler): Likewise.
4438 (gpgsm_set_recipients): Likewise.
4439 * export.c (export_status_handler): Likewise.
4440 * genkey.c (genkey_status_handler): Likewise.
4441 * import.c (append_xml_impinfo): Likewise.
4442 (import_status_handler): Likewise.
4443 * keylist.c (keylist_status_handler): Likewise.
4444 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4445 (command_handler): Likewise.
4446 * progress.c (_gpgme_progress_status_handler): Likewise.
4447 * sign.c (_gpgme_sign_status_handler): Likewise.
4448 * trustlist.c (trustlist_status_handler): Likewise.
4449 * verify.c (_gpgme_verify_status_handler): Likewise.
4450 * gpgme.h (GpgmeEditCb): New type.
4451 * rungpg.h (GpgStatusCode): Rename and move to ...
4452 * gpgme.h (GpgmeStatusCode): ... this and here.
4453 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4454 * mkstatus: Prefix STATUS with GPGME_.
4455 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4457 * ops.h (_gpgme_verify_status_handler,
4458 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4459 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4460 _gpgme_progress_status_handler): Likewise.
4461 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4463 These changes add an edit operation to GPGME:
4465 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4466 ops.h: Add prototype for _gpgme_release_edit_result and
4467 _gpgme_passphrase_command_handler.
4468 * passphrase.c (command_handler): Make non-static and rename to ...
4469 (_gpgme_passphrase_command_handler): ... this.
4470 (_gpgme_passphrase_start): Use new name for command handler.
4471 * types.h: Add EditResult type.
4472 * gpgme.c (_gpgme_release_result): Release EDIT result.
4474 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4475 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4477 (assuan_libobjs): New variable, set this instead
4479 * engine.h (_gpgme_engine_op_edit): New prototype.
4480 * engine.c (_gpgme_engine_op_edit): New function.
4481 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4482 * rungpg.c (_gpgme_gpg_op_edit): New function.
4484 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4486 * delete.c (delete_problem): New case ambigious specification.
4487 (delete_status_handler): Handle new case (poorly).
4489 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4491 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4493 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4495 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4497 * vasprintf.c: Update to more recent libiberty version.
4498 * debug.h: Replace #elsif with #elif.
4500 Submitted by Stéphane Corthésy:
4501 * util.h (vasprintf): Correct prototype.
4502 * encrypt-sign.c: Include <stddef.h>.
4503 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4505 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4506 * ath-pth.c: Likewise.
4508 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4510 * wait.c (fdt_global): Make static. Reported by Stéphane
4513 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4514 patterns. Reported by Stéphane Corthésy.
4516 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4517 by Stéphane Corthésy.
4518 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4519 silence gcc warning.
4521 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4523 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4525 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4527 * gpgme.c (_gpgme_op_event_cb_user): New function.
4528 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4529 for private or user event loop. Use new user event callback
4531 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4532 * keylist.c (gpgme_op_keylist_start): Likewise.
4534 * rungpg.c (_gpgme_gpg_io_event): New function.
4535 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4536 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4537 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4538 * engine.c (_gpgme_engine_io_event): New function.
4539 * engine.h (_gpgme_engine_io_event): New prototype.
4540 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4541 the real work for the default IO callback routines to ...
4542 (_gpgme_op_keylist_event_cb): ... here. New function.
4543 * trustlist.c (trustlist_colon_handler): Signal
4544 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4545 (_gpgme_op_trustlist_event_cb): ... here. New function.
4546 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4547 and _gpgme_op_trustlist_event_cb when appropriate.
4548 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4549 (_gpgme_op_trustlist_event_cb): Likewise.
4550 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4551 user provided event handler directly.
4552 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4554 * wait.c (_gpgme_add_io_cb): Likewise.
4555 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4556 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4557 argument. Fix up error handling.
4558 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4559 new argument, fix up error handling.
4561 2002-07-03 Werner Koch <wk@gnupg.org>
4563 * encrypt.c (status_handler_finish): New.
4564 (_gpgme_encrypt_status_handler): Moved some code out to the new
4565 function and call this function also in case we get into the
4566 status handler with an error which might happen due to a kludge in
4569 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4571 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4572 table (eg use synchronous mode).
4574 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4576 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4577 prototype and change return type to GpgmeError.
4578 (_gpgme_wait_one): New prototype.
4579 * wait.c (gpgme_wait): Replace with the meat from
4580 _gpgme_wait_on_condition here, and remove the support for
4582 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4583 and change return type to GpgmeError. Replace with meat from
4584 _gpgme_wait_one and add support for conditions.
4585 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4587 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4588 table (eg use synchronous mode).
4589 (gpgme_op_keylist_next): Remove HANG argument from
4590 _gpgme_wait_on_condition. Check its return value.
4591 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4592 table (eg use synchronous mode).
4593 (gpgme_op_trustlist_next): Remove HANG argument from
4594 _gpgme_wait_on_condition. Check its return value.
4596 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4598 * gpgme.h: Fix documentation of key attribute retrieval functions.
4600 2002-06-26 Werner Koch <wk@gnupg.org>
4602 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4604 * import.c (append_xml_impinfo): Kludge to print fingerprint
4605 instead of keyid for use with gpgsm.
4606 (import_status_handler): Set a flag to know whether any import
4608 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4610 2002-06-25 Werner Koch <wk@gnupg.org>
4612 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4615 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4617 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4619 * export.c (gpgme_op_export): If no data was returned, return
4620 GPGME_No_Recipients.
4622 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4624 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4626 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4628 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4629 (parse_status): New function.
4630 (gpgsm_status_handler): Use parse_status.
4631 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4632 STATUS_FNC_VALUE and process status messages.
4633 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4634 (gpgsm_set_fd): Likewise.
4635 (_gpgme_gpgsm_op_keylist): Likewise.
4636 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4637 (_gpgme_gpgsm_op_sign): Likewise.
4639 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4641 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4643 2002-06-20 Werner Koch <wk@gnupg.org>
4645 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4647 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4649 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4650 (gpgme_get_sig_string_attr): Hack to return info on the key
4651 usage. Does now make use of the former RESERVED argument which
4652 has been renamed to WHATIDX.
4653 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4655 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4657 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4658 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4659 error, or there are no more file descriptors to wait on.
4660 (_gpgme_wait_on_condition): Ignore return value from do_select for
4663 2002-06-13 Werner Koch <wk@gnupg.org>
4665 * verify.c (gpgme_op_verify): Make sure that we never access an
4666 unitialized result structure.
4668 2002-06-12 Werner Koch <wk@gnupg.org>
4670 * keylist.c (struct keylist_result_s): New.
4671 (_gpgme_release_keylist_result): Release it here
4672 (keylist_status_handler): Handle truncated.
4673 (append_xml_keylistinfo): New.
4674 * gpgme.c (_gpgme_release_result): and use it here.
4675 * types.h: Declare the new type here.
4676 * context.h (struct gpgme_context_s): Use it here.
4678 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4680 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4681 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4682 use our own close notification mechanism without interfering with
4685 2002-06-11 Werner Koch <wk@gnupg.org>
4687 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4689 * verify.c (calc_sig_summary): New.
4690 (gpgme_get_sig_ulong_attr): And use it here.
4692 2002-06-10 Werner Koch <wk@gnupg.org>
4694 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4695 * verify.c (is_token, copy_token): New.
4696 (_gpgme_verify_status_handler): Use copy_token, handle the new
4697 ERROR status and store the errorcode used withgpgsm and trust
4699 * gpgme.h: New attribute ERRTOK.
4700 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4701 (gpgme_get_sig_string_attr): Use it here to return the last error.
4703 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4705 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4706 close notification for the status fd to ...
4707 (_gpgme_gpgsm_new): ... here.
4708 * wait.h: Include "sema.h". Remove prototypes of
4709 _gpgme_remove_proc_from_wait_queue and
4710 _gpgme_register_pipe_handler. Add prototypes of
4711 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4712 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4714 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4715 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4716 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4717 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4718 proc_s. Replace struct wait_item_s.
4719 (_gpgme_fd_table_init): New function.
4720 (_gpgme_fd_table_deinit): Likewise.
4721 (_gpgme_fd_table_put): Likewise.
4722 (set_process_done): Remove function.
4723 (do_select): Take argument FDT. Use that to decide which fds to
4725 (_gpgme_remove_proc_from_wait_queue): Remove function.
4726 (_gpgme_wait_event_cb): New function.
4727 (_gpgme_wait_one): Likewise.
4728 (_gpgme_register_pipe_hanldler): Remove function.
4729 (_gpgme_add_io_cb): New function.
4730 (_gpgme_remove_io_cb): Likewise.
4731 (_gpgme_freeze_fd): Remove function.
4732 (_gpgme_thaw_fd): Remove function.
4733 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4734 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4735 IDX to CMD. Add new member IO_CBS.
4736 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4737 For each I/O callback, check if it should be unregistered. If all
4738 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4739 Remove member RUNNING.
4740 (_gpgme_gpg_new): Initialize new members.
4741 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4742 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4743 (build_argv): Store away the index instead the file descriptor for
4745 (_gpgme_gpg_add_io_cb): New function.
4746 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4748 (gpg_status_handler): Change return type to void, remove PID
4749 argument, close filedescriptor if EOF or error occurs.
4750 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4751 Use IO_CBS->remove instead _gpgme_freeze_fd.
4752 (gpg_colon_line_handler): Change return type to void, remove PID
4753 argument, close filedescriptor if EOF or error occurs.
4754 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4755 (_gpgme_gpg_set_io_cbs): New function.
4756 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4757 _gpgme_gpg_set_io_cbs.
4758 * gpgme.h (GpgmeIOCb): New type.
4759 (GpgmeRegisterIOCb): Likewise.
4760 (GpgmeRemoveIOCb): Likewise.
4761 (GpgmeEventIO): Likewise.
4762 (GpgmeEventIOCb): Likewise.
4763 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4764 (gpgme_set_op_io_cbs): New prototype.
4765 (gpgme_get_op_io_cbs): Likewise.
4766 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4767 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4768 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4769 prototype. Add prototype for _gpgme_op_reset.
4770 Add synchronous argument to _gpgme_decrypt_start prototype.
4771 * io.h: Beautification.
4772 * gpgme.c: Include "wait.h".
4773 (gpgme_new): Initialize FDT.
4774 (gpgme_set_io_cbs): New function.
4775 (gpgme_get_io_cbs): Likewise.
4776 (_gpgme_op_event_cb): Likewise.
4777 * data.c (_gpgme_data_inbound_handler): Change return type to
4778 void. Drop PID argument. Close FD on error and EOF.
4779 (write_mem_data): Don't close FD here ...
4780 (write_cb_data): ... or here ...
4781 (_gpgme_data_outbound_handler): ... but here. Change return type
4782 to void. Drop PID argument.
4783 * context.h: Include "wait.h".
4784 (struct gpgme_context_s): New members FDT and IO_CBS.
4785 * op-support.c: New file.
4786 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4787 * ops.h: Add prototype for _gpgme_op_reset().
4788 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4790 (gpgme_op_decrypt_start): Add synchronous argument.
4791 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4793 * delete.c (gpgme_op_delete_start): Rename to ...
4794 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4795 Use _gpgme_op_reset. Make function static.
4796 (gpgme_op_delete_start): Just a wrapper around
4797 _gpgme_op_delete_start now.
4798 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4800 * encrypt.c: Include "wait.h".
4801 (ggpgme_op_encrypt_start): Rename to ...
4802 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4803 Use _gpgme_op_reset. Make function static.
4804 (gpgme_op_encrypt_start): Just a wrapper around
4805 _gpgme_op_encrypt_start now.
4806 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4808 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4809 (_gpgme_op_encrypt_sign_start): ... this. New argument
4810 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4811 (gpgme_op_encrypt_sign_start): Just a wrapper around
4812 _gpgme_op_encrypt_sign_start now.
4813 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4814 _gpgme_wait_one instead gpgme_wait.
4815 * export.c (gpgme_op_export_start): Rename to ...
4816 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4817 Use _gpgme_op_reset. Make function static.
4818 (gpgme_op_export_start): Just a wrapper around
4819 _gpgme_op_export_start now.
4820 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4822 * genkey.c (gpgme_op_genkey_start): Rename to ...
4823 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4824 Use _gpgme_op_reset. Make function static.
4825 (gpgme_op_genkey_start): Just a wrapper around
4826 _gpgme_op_genkey_start now.
4827 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4829 * import.c (gpgme_op_import_start): Rename to ...
4830 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4831 Use _gpgme_op_reset. Make function static.
4832 (gpgme_op_import_start): Just a wrapper around
4833 _gpgme_op_import_start now.
4834 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4836 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4837 (gpgme_op_keylist_ext_start): Likewise.
4838 * sign.c (gpgme_op_sign_start): Rename to ...
4839 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4840 _gpgme_op_reset. Make function static.
4841 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4843 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4845 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4846 * verify.c (gpgme_op_verify_start): Rename to ...
4847 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4848 Use _gpgme_op_reset. Make function static.
4849 (gpgme_op_verify_start): Just a wrapper around
4850 _gpgme_op_verify_start now.
4851 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4853 * engine-gpgsm.c (iocb_data_t): New type.
4854 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4855 and input_data with input_cb. Replace output_fd and output_data
4856 with output_cb. Replace message_fd and message_data with
4857 message_cb. New member io_cbs.
4858 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4860 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4861 callback, check if it should be unregistered. If all callbacks
4862 have been unregistered, trigger GPGME_EVENT_DONE.
4863 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4864 names to close the file descriptors.
4865 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4866 (_gpgme_gpgsm_op_encrypt): Likewise.
4867 (_gpgme_gpgsm_op_genkey): Likewise.
4868 (_gpgme_gpgsm_op_import): Likewise.
4869 (_gpgme_gpgsm_op_keylist): Likewise.
4870 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4871 (_gpgme_gpgsm_op_sign): Likewise.
4872 (_gpgme_gpgsm_op_verify): Likewise.
4873 (gpgsm_status_handler): Drop argument PID. Change return type to
4874 void. Close status pipe before returning because of EOF or error.
4875 (_gpgme_gpgsm_add_io_cb): New function.
4876 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4878 (_gpgme_gpgsm_set_io_cbs): New function.
4879 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4880 * engine.c (_gpgme_engine_set_io_cbs): New function.
4881 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4883 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4885 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4887 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4889 * key.c: Include <ctype.h>.
4890 (_gpgme_key_append_name): Skip one more char when
4891 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4892 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4894 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4896 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4897 * posix-sema.c: Use that prefix here.
4898 * posix-io.c: Include "ath.h".
4899 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4900 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4901 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4902 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4904 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4906 * Makefile.am (ath_components): New variable.
4907 (ath_components_pthread): Likewise.
4908 (ath_components_pth): Likewise.
4909 (system_components): Add ath_componentes.
4913 * ath-pthread.c: Likewise.
4914 * ath-pth.c: Likewise.
4915 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4917 * mutex.h: Remove file.
4919 2002-05-30 Werner Koch <wk@gnupg.org>
4921 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4922 an issuer with IDX > 0. We don't support altIssuerNames for now.
4924 2002-05-22 Werner Koch <wk@gnupg.org>
4926 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4927 missing variable definition. Oohh - Marcus was faster.
4929 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4931 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4933 2002-05-21 Werner Koch <wk@gnupg.org>
4935 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4936 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4938 2002-05-10 Werner Koch <wk@gnupg.org>
4940 * key.h (gpgme_key_s): Add OTRUST.
4941 * keylist.c (set_ownertrust): New.
4942 (keylist_colon_handler): Get the ownertrust value
4943 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4946 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4948 * w32-util.c: New static variable GET_PATH_LOCK.
4949 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4950 Take lock while determining path.
4951 (_gpgme_get_gpgsm_path): Likewise.
4952 * version.c (do_subsystem_inits): Set DONE to 1 after
4954 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4955 while determining engine info.
4956 * rungpg.c (_gpgme_gpg_get_version): New variable
4957 GPG_VERSION_LOCK. Take the lock while determining the program
4959 * posix-io.c: Include "sema.h".
4960 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4961 while fixing the signals.
4962 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4963 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4965 (capabilities_to_string): Make STRINGS very const.
4966 (_gpgme_key_cache_add): Lock the key cache.
4967 (_gpgme_key_cache_get): Likewise.
4968 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4969 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4970 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4972 * engine.c (_gpgme_engine_get_info): New variable
4973 ENGINE_INFO_LOCK. Take lock while determining engine info.
4974 * engine-gpgsm.c: Include "sema.h".
4975 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4976 lock while getting program version.
4978 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4980 * debug.h: New file.
4981 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4982 * util.h: Removed all prototypes and declarations related to
4983 debugging. Include "debug.h".
4985 * debug.c (debug_level): Comment variable and remove superfluous
4988 (_gpgme_debug_enabled): Function removed.
4989 (struct debug_control_s): Definition removed.
4990 (_gpgme_debug_level): Function removed.
4991 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4992 pritnf-style format specification and a variable number of
4994 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4995 starts out with "%s" for simplicity.
4996 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4997 TEXT argument anymore.
4999 * posix-io.c (_gpgme_io_select): Use new level argument for
5000 DEBUG_BEGIN instead explicit if construct.
5002 * debug.c (debug_init): Remove superfluous zero initializer,
5003 remove volatile flag of INITIALIZED. Do not use the
5004 double-checked locking algorithm, it is fundamentally flawed and
5005 will empty your fridge (on a more serious note, despite the
5006 volatile flag it doesn't give you the guarantee you would expect,
5007 for example on a DEC Alpha or an SMP machine. The volatile only
5008 serializes accesses to the volatile variable, but not to the other
5011 2002-05-03 Werner Koch <wk@gnupg.org>
5013 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5014 output to /dev/null.
5016 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5017 * gpgme.c (gpgme_get_protocol): New.
5019 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5020 (gpgme_data_read): Ditto.
5022 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5023 lines so that a claim can be made without looking up the key.
5024 (gpgme_get_sig_string_attr): New.
5025 (gpgme_get_sig_ulong_attr): New.
5027 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5029 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5030 list to align with the status.h file from gnupg.
5032 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5033 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5034 these new status codes. Store the expiration time
5036 2002-04-27 Werner Koch <wk@gnupg.org>
5038 * gpgme.h (GpgmeData_Encoding): New.
5039 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5040 * engine-gpgsm.c (map_input_enc): New. Use it in all local
5041 functions where the INPUT command gets send.
5043 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
5045 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5046 descriptor only when we don't need it anymore. Close the message
5047 descriptor if we don't need it.
5049 2002-04-26 Werner Koch <wk@gnupg.org>
5051 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5053 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5055 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5056 GPG->cmd.cb_data, not xfree.
5058 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5060 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5061 ttytype, lc_ctype and lc_messages options in the server.
5063 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5065 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5067 2002-04-23 Werner Koch <wk@gnupg.org>
5069 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5070 can_certify to return the requested values.
5072 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5074 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5076 (gpgme_get_passphrase_cb): Likewise.
5078 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5080 * gpgme.c (gpgme_get_passphrase_cb): New function.
5081 (gpgme_get_progress_cb): New function.
5082 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5083 gpgme_get_progress_cb.
5085 2002-03-28 Werner Koch <wk@gnupg.org>
5087 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5088 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5089 * keylist.c (keylist_colon_handler): Store them.
5090 * key.c (gpgme_key_release): Free them.
5091 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5093 2002-03-26 Werner Koch <wk@gnupg.org>
5095 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5097 2002-03-21 Werner Koch <wk@gnupg.org>
5099 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5102 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5104 * Makefile.am (system_components): New variable, set depending on
5106 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5107 * syshdr.h: File removed.
5109 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5110 * posix-sema.c: Likewise.
5111 * posix-util.c: Likewise.
5113 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5114 * w32-sema.c: Likewise.
5115 * w32-util.c: Likewise.
5117 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5118 * posix-sema.c: Likewise.
5119 * w32-io.c: Include `io.h', do not include `syshdr.h'
5120 * w32-sema.c: Likewise.
5121 * w32-util.c: Likewise.
5122 * data.c: Do not include `syshdr.h'.
5124 * wait.h: Code cleanup.
5126 * mutex.h: New file.
5127 * posix-sema.c: Implement.
5129 2002-03-08 Werner Koch <wk@gnupg.org>
5131 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5133 2002-03-07 Werner Koch <wk@gnupg.org>
5135 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5137 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5139 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5140 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5141 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5142 as status handler and run _gpgme_passphrase_start.
5143 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5145 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5148 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5150 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5152 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5153 error No_Passphrase if only a bad passphrase was provided.
5155 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5157 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5158 GPGME_DATA_MODE_IN, construct a command line that stores the
5160 * verify.c (gpgme_op_verify_start): Accept TEXT being
5161 uninitialized, and in this case interpret SIG as a normal or
5162 cleartext signature and TEXT as a return data object.
5163 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5165 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5167 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5170 2002-02-28 Werner Koch <wk@gnupg.org>
5172 * key.h (subkey_s): New member expires_at.
5173 * keylist.c (keylist_colon_handler): Set it here
5174 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5176 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5178 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5179 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5180 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5181 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5182 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5183 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5184 * keylist.c (gpgme_op_keylist_ext_start): New function.
5186 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5188 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5189 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5190 rename no_recipients to no_valid_recipients.
5191 (_gpgme_encrypt_status_handler): Include error for invalid
5193 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5194 argument to GpgsmObject. Use that to report back the status about
5197 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5199 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5201 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5203 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5204 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5205 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5206 (_gpgme_gpg_op_sign): Use that new function.
5207 (_gpgme_gpg_op_encrypt_sign): New function.
5208 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5209 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5210 (gpgme_op_encrypt_sign): Likewise.
5211 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5212 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5213 (_gpgme_sign_status_handler): Add prototype.
5214 * sign.c (sign_status_handler): Rename to ...
5215 (_gpgme_sign_status_handler): ... this and make non-static.
5216 * encrypt.c (encrypt_status_handler): Rename to ...
5217 (_gpgme_encrypt_status_handler): ... this and make non-static.
5218 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5219 * sign.c (gpgme_op_sign_start): Likewise.
5221 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5223 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5224 see if the problem is due to a missing key, and report that back
5227 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5229 * context.h (struct gpgme_context_s): New member include_certs.
5230 * gpgme.h (gpgme_set_include_certs): Add prototype.
5231 (gpgme_get_include_certs): Likewise.
5232 * gpgme.c (gpgme_set_include_certs): New function.
5233 (gpgme_get_include_certs): Likewise.
5234 (gpgme_new): Set include_certs to 1 (the default).
5235 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5236 and pass it to _gpgme_gpgsm_op_sign.
5237 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5238 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5239 include_certs and handle it.
5240 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5241 * sign.c (gpgme_op_sign_start): Add new argument to
5242 _gpgme_engine_op_sign call.
5244 2002-02-14 Werner Koch <wk@gnupg.org>
5246 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5248 2002-02-13 Werner Koch <wk@gnupg.org>
5250 * vasprintf.c, fopencookie.c: Add replacement functions.
5251 * util.h: Add prototypes for them.
5253 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5255 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5256 reach the end of the function.
5258 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5260 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5261 (gpgme_op_genkey_start): Skip newlines after opening tag.
5263 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5265 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5267 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5268 set, and pass them down to the crypto engine.
5269 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5270 * engine.h: Likewise.
5271 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5272 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5274 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5276 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5279 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5281 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5283 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5286 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5288 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5289 status of the returned context is returned.
5290 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5291 aware of cancelled processes, and to allow to use gpgme_wait with
5292 CTX being NULL (as documented in the source).
5293 (struct proc_s): New member REPORTED.
5294 * gpgme.h: Fix prototype.
5295 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5296 * sign.c (gpgme_op_sign): Likewise.
5297 * import.c (gpgme_op_import): Likewise.
5298 * genkey.c (gpgme_op_genkey): Likewise.
5299 * export.c (gpgme_op_export): Likewise.
5300 * encrypt.c (gpgme_op_encrypt): Likewise.
5301 * delete.c (gpgme_op_delete): Likewise.
5302 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5304 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5306 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5308 (gpgme_get_keylist_mode): New function.
5309 (gpgme_new): Set the default for keylist_mode member of CTX.
5311 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5312 (gpgme_get_keylist_mode): New prototype.
5313 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5314 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5316 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5318 This patch has gotten a bit large... mmh. The main thing that
5319 happens here is that error values are now not determined in the
5320 operation function after gpgme_wait completed, but in the status
5321 handler when EOF is received. It should always be the case that
5322 either an error is flagged or EOF is received, so that after a
5323 gpgme_wait you should never have the situation that no error is
5324 flagged and EOF is not received. One problem is that the engine
5325 status handlers don't have access to the context, a horrible
5326 kludge works around this for now. All errors that happen during a
5327 pending operation should be catched and reported in ctx->error,
5328 including out-of-core and cancellation. This rounds up neatly a
5329 couple of loose ends, and makes it possible to pass up any errors
5330 in the communication with the backend as well. As a bonus, there
5331 will be a function to access gpgme->wait, so that the operations
5332 can truly be implemented with their _start function.
5334 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5335 error back to the context.
5336 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5338 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5340 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5341 to a value indication that.
5343 * verify.c (add_notation): Set error, not out_of_core.
5344 (finish_sig): Likewise.
5345 (gpgme_op_verify_start): Don't clear out_of_core.
5346 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5347 (gpgme_op_verify): And don't do it here.
5349 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5350 (gpgme_op_trustlist_start): Don't clear out_of_core.
5351 (gpgme_op_trustlist_next): Check error, not out_of_core.
5352 (gpgme_op_trustlist_end): Likewise.
5354 * ops.h (test_and_allocate_result): New macro.
5355 (_gpgme_passphrase_result): Remove prototype.
5356 * delete.c (gpgme_op_delete): Return error from context.
5357 (delete_status_handler): Use macro test_and_allocate_result.
5358 Perform error checking at EOF.
5359 (gpgme_op_delete_start): Release result.
5360 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5361 test_and_allocate_result, and perform error checking here.
5362 (_gpgme_passphrase_result): Function removed.
5363 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5364 (gpgme_op_sign): Just return the error value from the context.
5365 (sign_status_handler): Only progress if no error is set yet. If
5366 we process an EOF, set the resulting error value (if any).
5367 * decrypt.c (_gpgme_decrypt_result): Function removed.
5368 (create_result_struct): Function removed.
5369 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5370 caclulate error on EOF, do not progress with errors.
5371 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5372 (gpgme_op_decrypt): Just return the error value from the context.
5373 * encrypt.c (encrypt_status_handler): Perform the error checking
5375 (gpgme_op_encrypt_start): Do not clear out_of_core.
5376 * export.c (export_status_handler): Return if error is set in context.
5377 (gpgme_op_export_start): Release result.
5378 (gpgme_op_export): Return error from context.
5379 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5381 * genkey.c (genkey_status_handler): Use macro
5382 test_and_allocate_result. Perform error checking at EOF.
5383 (gpgme_op_genkey): Just return the error from context.
5384 * import.c (gpgme_op_import): Return the error from context.
5385 (import_status_handler): Use macro test_and_allocate_result.
5386 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5387 (gpgme_op_keylist_next): Return error of context.
5388 (keylist_colon_handler): Set error instead out_of_code.
5389 (finish_key): Likewise.
5391 * context.h: Remove member out_of_core, add member error.
5392 * gpgme.c (_gpgme_release_result): Clear error flag.
5394 * engine.h (_gpgme_engine_get_error): New prototype.
5395 * engine.c (_gpgme_engine_get_error): New function.
5396 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5398 * engine-gpgsm.c (map_assuan_error): New function.
5399 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5400 use the new function to map error values.
5401 (gpgsm_set_fd): Change return type tp GpgmeError.
5402 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5403 (gpgsm_set_recipients): Likewise. Change type of return value
5404 equivalently. Adjust error values.
5405 (_gpgme_gpgsm_op_import): Likewise.
5406 (_gpgme_gpgsm_op_sign): Likewise.
5407 (struct gpgsm_object_s): New member error.
5408 (gpgsm_status_handler): Set error if error occurs. Determine
5409 error number from ERR line received. If assuan_read_line fails,
5410 terminate the connection.
5412 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5414 * Makefile.am (MOSTLYCLEANFILES): New variable.
5416 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5418 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5419 connection to the server.
5421 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5423 * rungpg.h: Add STATUS_KEY_CREATED.
5425 * progress.c: New file.
5426 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5428 * genkey.c (genkey_status_handler): Use
5429 _gpgme_progress_status_handler. Add check for status.
5430 (struct genkey_result_s): New structure.
5431 (_gpgme_release_genkey_result): New function.
5432 (gpgme_op_genkey): Check for error.
5433 * gpgme.c (_gpgme_release_result): Call
5434 _gpgme_release_genkey_result.
5435 * ops.h (_gpgme_release_genkey_result): Add prototype.
5436 * types.h (GenKeyResult): New type.
5437 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5439 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5441 * gpgme.c (_gpgme_release_result): Call
5442 _gpgme_release_delete_result.
5443 * ops.h (_gpgme_release_delete_result): Add prototype.
5444 * types.h (DeleteResult): New type.
5445 * context.h (gpgme_context_s): Add DeleteResult to member result.
5447 * delete.c (enum delete_problem): New type.
5448 (struct delete_result_s): New structure.
5449 (_gpgme_release_delete_result): New function.
5450 (delete_status_handler): Implement more status codes.
5451 (gpgme_op_delete): Return error on failure.
5453 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5455 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5457 * import.c (struct import_result_s): New structure.
5458 (_gpgme_release_import_result): New function.
5459 (append_xml_impinfo): Likewise.
5460 (import_status_handler): Implement.
5461 * gpgme.c (_gpgme_release_result): Add call to
5462 _gpgme_release_import_result.
5463 * ops.h (_gpgme_release_import_result): Add prototype.
5464 * types.h (ImportResult): New type.
5465 * context.h (gpgme_context_s): Add ImportResult to member result.
5467 * encrypt.c (gpgme_op_encrypt): Code clean up.
5469 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5471 * gpgme.h: Add lots of comment and fix the formatting. Add
5472 gpgme_trustlist_end prototype.
5474 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5476 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5477 gpgme_register_idle to return and accept this type.
5478 * wait.c (gpgme_register_idle): Fix type.
5479 Save and return old value of idle_function.
5481 2002-01-29 Werner Koch <wk@gnupg.org>
5483 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5485 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5488 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5490 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5491 not assuan_pipe_disconnect.
5493 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5494 jnlib (needed by assuan) statically into libgpgme. Linking a
5495 static library into a shared library this way is not portable.
5497 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5499 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5502 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5504 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5505 from off_t to size_t.
5506 * gpgme.h: Likewise.
5508 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5510 * wait.c (_gpgme_wait_on_condition): If the process finished,
5511 reset the pending flag. Also if the operation was cancelled.
5513 (struct proc_s): Rename READY to DONE.
5514 (wait_item_s): Likewise.
5515 (set_process_ready): Rename to ...
5516 (set_process_done): ... this.
5517 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5518 instead set_process_ready.
5519 (_gpgme_wait_on_condition): Likewise.
5520 (do_select): Rename READY to DONE.
5522 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5523 * sign.c (gpgme_op_sign): Likewise.
5524 * import.c (gpgme_op_import): Likewise.
5525 * genkey.c (gpgme_op_genkey): Likewise.
5526 * export.c (gpgme_op_export): Likewise.
5527 * encrypt.c (gpgme_op_encrypt): Likewise.
5528 * delete.c (gpgme_op_delete): Likewise.
5529 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5530 * decrypt.c (gpgme_op_decrypt): Likewise.
5532 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5534 * export.c: Cleanup.
5536 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5538 * trustlist.c: Various source clean ups.
5539 (my_isdigit): Removed.
5540 (gpgme_op_trustlist_end): New function.
5542 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5544 * gpgme.c: Various source clean ups, like renaming C to CTX where
5546 (gpgme_new): Clear R_CTX before starting the work.
5547 (my_isdigit): Removed.
5548 (my_isxdigit): Likewise.
5550 * data.c: Various source clean ups.
5551 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5552 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5553 (gpgme_data_new_from_file): Loop over fread while EINTR.
5554 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5555 be zero. Loop over fread while EINTR.
5557 (my_isdigit): Removed.
5558 (my_isxdigit): Likewise.
5560 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5562 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5563 Pipe_Error where appropriate.
5565 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5567 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5569 * version.c (get_engine_info): Remove prototype.
5571 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5573 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5574 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5576 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5578 * keylist.c (gpgme_op_keylist_end): New function.
5579 * gpgme.h (gpgme_op_keylist_end): New prototype.
5581 * engine.h (gpgme_engine_check_version): Move prototype to ...
5582 * gpgme.h (gpgme_engine_check_version): ... here.
5584 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5586 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5588 * version.c (gpgme_get_engine_info): Reimplemented.
5589 (gpgme_check_engine): Reimplemented.
5590 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5592 * engine.c: Include `io.h'.
5593 (gpgme_engine_get_info): New function.
5594 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5597 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5599 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5600 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5601 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5603 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5604 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5605 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5606 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5607 own function by call to _gpgme_engine_add_child_to_reap_list().
5609 * wait.c: Include `engine.h'.
5610 (run_idle): Call _gpgme_engine_housecleaning(), not
5611 _gpgme_gpg_housecleaning().
5613 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5615 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5616 Initialize the next field of the uid structure.
5617 (gpgme_key_get_as_xml): Do not list last uid first.
5619 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5621 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5622 function [!ENABLE_GPGSM].
5624 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5626 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5627 message_data, not SIG.
5628 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5630 * sign.c (sign_status_handler): Call
5631 _gpgme_passphrase_status_handler early.
5633 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5635 * engine-gpgsm.c: Revert last change.
5637 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5639 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5640 handler when ending this operation, otherwise the wait function
5643 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5645 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5646 (_gpgme_gpgsm_new): Initialize some more members.
5647 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5648 (gpgsm_status_handler): Rework the inline-data processing.
5650 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5652 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5653 list that are not dup'ed, for those the close-on-exec flag is set
5655 * version.c (_gpgme_get_program_version): Remove first entry in
5656 CFD, as the close-on-exec flag is now set for this fd.
5658 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5660 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5661 option to `ENCRYPT'.
5662 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5665 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5667 * engine-gpgsm.c (close_notify_handler): New function.
5668 (_gpgme_gpgsm_new): Manage the file descriptors a
5669 bit differently. Do not set close-on-exec flags.
5670 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5671 to -1, this is done by the close handler.
5672 (_gpgme_gpgsm_op_encrypt): Likewise.
5673 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5674 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5675 (_gpgme_gpgsm_op_sign): Likewise.
5676 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5678 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5679 non-inherited file descriptor index of the pipe.
5681 2001-12-13 Werner Koch <wk@gnupg.org>
5683 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5684 (gpgsm_status_handler): Pass datalines to a colon handler
5685 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5688 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5690 (gpgsm_assuan_simple_command): Removed underscore from
5692 (_gpgme_gpgsm_start): Ditto.
5693 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5694 function by the new assuan_read_line. Removed the use of the
5696 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5697 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5700 * keylist.c (keylist_colon_handler): Handle "crt" records
5701 * key.h (gpgme_key_s): Add an x509 flag.
5702 * key.c (parse_x509_user_id): New.
5703 (_gpgme_key_append_name): Handle x.509 names.
5705 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5707 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5710 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5712 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5713 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5715 (_gpgme_gpgsm_op_sign): Likewise.
5717 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5719 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5722 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5724 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5726 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5728 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5729 Deal with assuan read line returning more than one line (for now).
5731 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5733 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5734 the current protocol definition.
5736 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5738 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5741 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5743 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5744 for now, rungpg.h and status-table.h.
5745 (gpgsm_status_handler): Implement more of the status handler.
5747 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5749 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5750 (_gpgme_engine_op_delete): Likewise.
5751 (_gpgme_engine_op_encrypt): Likewise.
5752 (_gpgme_engine_op_export): Likewise.
5753 (_gpgme_engine_op_genkey): Likewise.
5754 (_gpgme_engine_op_keylist): Likewise.
5755 (_gpgme_engine_op_sign): Likewise.
5756 (_gpgme_engine_op_trustlist): Likewise.
5758 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5759 (gpgsm_assuan_simple_command): Likewise.
5760 (gpgsm_set_recipients): Likewise.
5761 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5762 (_gpgme_gpgsm_op_delete): New function.
5763 (_gpgme_gpgsm_op_export): Likewise.
5764 (_gpgme_gpgsm_op_genkey): Likewise.
5765 (_gpgme_gpgsm_op_sign): Likewise.
5766 (_gpgme_gpgsm_op_keylist): Likewise.
5767 (_gpgme_gpgsm_op_trustlist): Likewise.
5768 (_gpgme_gpgsm_release): Release command.
5769 (_gpgme_gpgsm_op_decrypt): Allocate command.
5770 (_gpgme_gpgsm_op_import): Likewise.
5771 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5773 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5775 * gpgme.h (gpgme_set_protocol): New prototype.
5777 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5779 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5780 (_gpgme_gpgsm_op_import): Likewise.
5782 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5784 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5786 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5788 2001-11-22 Werner Koch <wk@gnupg.org>
5790 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5791 is defined even with an undefined GPGSM_PATH.
5793 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5795 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5796 gpg_outbound_handler): Moved to ...
5797 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5798 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5799 _gpgme_* ones non-static.
5800 * data.c: Include io.h.
5802 * ops.h (_gpgme_data_inbound_handler): New prototype.
5803 (_gpgme_data_outbound_handler): Likewise.
5804 (_gpgme_gpg_spawn): Use these new functions.
5806 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5807 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5808 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5809 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5810 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5811 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5812 Include <rungpg.h> for status handler function.
5814 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5815 input_data, output_fd, output_data, message_fd, message_data, command
5817 (_gpgme_gpgsm_new): Open input, output and message pipes before
5818 connecting to the client. Close server's ends afterwards.
5819 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5820 server process from wait queue.
5821 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5822 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5824 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5825 (_gpgme_engine_set_status_handler): Likewise.
5826 (_gpgme_engine_op_verify): Likewise.
5828 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5830 * context.h: Do not include rungpg.h, but engine.h.
5831 (struct gpgme_context_s): Replace member gpg with engine.
5832 * gpgme.c (gpgme_release): Release engine, not gpg.
5834 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5836 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5837 Make static, change order of arguments, and return an error value.
5838 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5840 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5841 (_gpgme_gpg_op_encrypt): Likewise.
5842 (_gpgme_gpg_op_decrypt): Likewise.
5843 (_gpgme_gpg_op_delete): Likewise.
5844 (_gpgme_gpg_op_export): Likewise.
5845 (_gpgme_gpg_op_genkey): Likewise.
5846 (_gpgme_gpg_op_import): Likewise.
5847 (_gpgme_gpg_op_keylist): Likewise.
5848 (_gpgme_gpg_op_sign): Likewise.
5849 (_gpgme_gpg_op_trustlist): Likewise.
5850 * rungpg.c (_gpgme_gpg_op_verify): New function.
5851 (_gpgme_gpg_op_encrypt): Likewise.
5852 (_gpgme_gpg_op_decrypt): Likewise.
5853 (_gpgme_gpg_op_delete): Likewise.
5854 (_gpgme_gpg_op_export): Likewise.
5855 (_gpgme_gpg_op_genkey): Likewise.
5856 (_gpgme_gpg_op_import): Likewise.
5857 (_gpgme_gpg_op_keylist): Likewise.
5858 (_gpgme_gpg_op_sign): Likewise.
5859 (_gpgme_gpg_op_trustlist): Likewise.
5861 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5862 (_gpgme_engine_set_command_handler): Likewise.
5863 (_gpgme_engine_set_colon_line_handler): Likewise.
5864 (_gpgme_engine_op_decrypt): Likewise.
5865 (_gpgme_engine_op_delete): Likewise.
5866 (_gpgme_engine_op_encrypt): Likewise.
5867 (_gpgme_engine_op_export): Likewise.
5868 (_gpgme_engine_op_genkey): Likewise.
5869 (_gpgme_engine_op_import): Likewise.
5870 (_gpgme_engine_op_keylist): Likewise.
5871 (_gpgme_engine_op_sign): Likewise.
5872 (_gpgme_engine_op_trustlist): Likewise.
5873 (_gpgme_engine_op_verify): Likewise.
5874 (_gpgme_engine_start): Likewise.
5875 * engine.c (_gpgme_engine_set_status_handler): New function.
5876 (_gpgme_engine_set_command_handler): Likewise.
5877 (_gpgme_engine_set_colon_line_handler): Likewise.
5878 (_gpgme_engine_op_decrypt): Likewise.
5879 (_gpgme_engine_op_delete): Likewise.
5880 (_gpgme_engine_op_encrypt): Likewise.
5881 (_gpgme_engine_op_export): Likewise.
5882 (_gpgme_engine_op_genkey): Likewise.
5883 (_gpgme_engine_op_import): Likewise.
5884 (_gpgme_engine_op_keylist): Likewise.
5885 (_gpgme_engine_op_sign): Likewise.
5886 (_gpgme_engine_op_trustlist): Likewise.
5887 (_gpgme_engine_op_verify): Likewise.
5888 (_gpgme_engine_start): Likewise.
5890 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5892 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5893 * decrypt.c (_gpgme_decrypt_start): Likewise.
5894 * passphrase.c (_gpgme_passphrase_start): Likewise.
5895 * keylist.c (gpgme_op_keylist_start): Likewise.
5897 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5899 * types.h: Add types EngineObject and GpgsmObject.
5901 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5902 engine-gpgsm.c, engine.h and engine.c.
5903 * engine.h: New file.
5904 * engine.c: Likewise.
5905 * engine-gpgsm.h: Likewise.
5906 * engine-gpgsm.c: Likewise.
5908 * rungpg.c (_gpgme_gpg_get_version): New function.
5909 (_gpgme_gpg_check_version): Likewise.
5910 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5911 _gpgme_gpg_check_version.
5913 * version.c (compare_versions): Rename to ...
5914 (_gpgme_compare_versions): ... this. Make non-static.
5915 (gpgme_check_version): Use _gpgme_compare_versions rather than
5917 (gpgme_check_engine): Likewise.
5918 * ops.h (_gpgme_get_program_version): Add prototype.
5920 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5922 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5923 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5924 (libgpgme_la_LIBADD): Likewise.
5926 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5928 * version.c: Remove global variables lineno and
5930 (version_handler): Removed.
5931 (_gpgme_get_program_version): New function.
5932 (get_engine_info): Don't use context and version_handler,
5933 but _gpgme_get_program_version.
5934 * ops.h (_gpgme_get_program_version): Add prototype for
5935 _gpgme_get_program_version (we expect to use it elsewhere soon).
5937 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5939 * version.c (get_engine_info): If GnuPG is not available, return
5941 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5943 (_gpgme_get_gpgsm_path): New function.
5944 * w32-util.c (find_program_in_registry): New static function.
5945 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5946 to use find_program_in_registry.
5947 (_gpgme_get_gpgsm_path): New function.
5948 (util.h): Prototype _gpgme_get_gpgsm_path).
5949 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5952 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5954 * decrypt-verify.c: New file.
5955 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5956 * types.h: Add decrypt-verify types.
5958 * context.h: Add result type for decrypt-verify.
5959 * gpgme.h: Add decrypt-verify prototypes.
5961 * decrypt.c (decrypt_status_handler): Renamed to ...
5962 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5963 (_gpgme_decrypt_start): New function, derived from
5964 gpgme_op_decrypt_start.
5965 (gpgme_op_decrypt_start): Reimplement in terms of
5966 _gpgme_decrypt_start.
5967 (_gpgme_decrypt_result): New function to retrieve error value.
5968 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5969 * ops.h: Add prototypes for new functions.
5971 * verify.c (verify_status_handler): Renamed to ...
5972 (_gpgme_verify_status_handler): ... this. Make non-static.
5973 (gpgme_op_verify_start): Use new function name.
5974 (intersect_stati): Renamed to ...
5975 (_gpgme_intersect_stati): ... this. Make non-static.
5976 (gpgme_op_verify): Use new name.
5977 * ops.h: Add prototypes for new functions.
5979 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5981 * passphrase.c: New file.
5982 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5983 * ops.h (_gpgme_passphrase_result): Add prototypes from
5985 * types.h: Likewise.
5986 * context.h: Add member passphrase to result.
5987 * gpgme.c (_gpgme_release_result): Release passphrase member.
5989 * decrypt.c: Some formatting and variable name changes (like
5991 (struct decrypt_result_s): Remove members now found in
5993 (_gpgme_release_decrypt_result): Don't release removed members.
5994 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5995 and don't handle the cases catched there.
5996 (command_handler): Removed.
5997 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5998 _gpgme_passphrase_start which does it.
5999 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6000 cases covered by it.
6002 * sign.c Some formatting and variable name changes (like
6004 (struct sign_result_s): Remove members now found in
6006 (_gpgme_release_sign_result): Don't release removed members.
6007 (sign_status_handler): Call _gpgme_passphrase_status_handler,
6008 and don't handle the cases catched there.
6009 (command_handler): Removed.
6010 (gpgme_op_sign_start): Don't set command handler, but invoke
6011 _gpgme_passphrase_start which does it.
6012 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6013 cases covered by it.
6015 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6017 * decrypt.c (command_handler): Fix last change.
6019 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6021 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6022 Rename R2 to NEXT_RESULT.
6023 (intersect_stati): Rename RES to RESULT.
6024 (gpgme_get_sig_status): Likewise. Do not check return_type, but
6025 the member verify of result.
6026 (gpgme_get_sig_key): Likewise.
6028 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
6029 RESULT is zero, return.
6030 (sign_status_handler, command_handler): Do not check return_type,
6031 but the member sign of result.
6032 (gpgme_op_sign): Likewise. Drop assertion.
6034 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6035 If RESULT is zero, return.
6036 (encrypt_status_handler): Do not check return_type, but the member
6038 (gpgme_op_encrypt): Likewise. Drop assertion.
6040 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6041 (create_result_struct): Do not set result_type.
6042 (command_handler, decrypt_status_handler): Do not check
6043 return_type, but the member decrypt of result.
6044 (gpgme_op_decrypt): Likewise. Drop assertion.
6046 * context.h (enum ResultType): Removed.
6047 (struct gpgme_context_s): Remove member result_type.
6048 (struct result): Replaces union result.
6049 * gpgme.c: Include string.h.
6050 (_gpgme_release_result): Release all members of c->result, which
6051 is now a struct. Zero out all members of the struct afterwards.
6053 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
6055 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6056 Release all members of the list GPG->arglist.
6057 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6059 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6061 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6063 * key.c: Include string.h.
6065 * recipient.c: Likewise.
6067 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6069 * context.h: New member signers_len.
6070 * signers.c (gpgme_signers_clear): Require that signers are
6071 non-NULL with assertion. Use signers_len to determine how much
6072 keys to release. Add documentation.
6073 (gpgme_signers_add): Use signers_len to determine if the buffer is
6074 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6076 (gpgme_signers_enum): Use signers_len to determine if key is
6077 available. Add documentation.
6079 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6081 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6082 ALLOC_CHUNK, not DH->length.
6084 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6086 * gpgme.c (gpgme_set_protocol): Fix last change.
6088 2001-10-15 Werner Koch <wk@gnupg.org>
6090 * gpgme.h (GpgmeProtocol): New.
6091 * gpgme.c (gpgme_set_protocol): New.
6093 2001-09-26 Werner Koch <wk@gnupg.org>
6095 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6096 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6098 2001-09-17 Werner Koch <wk@gnupg.org>
6100 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6101 callers to use this function without a check for tmp_key.
6103 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6104 emptying the queue. Bug reported by Stéphane Corthésy.
6106 2001-09-12 Werner Koch <wk@gnupg.org>
6108 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6110 2001-09-07 Werner Koch <wk@gnupg.org>
6112 * rungpg.h: Add NO_RECP.
6113 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6114 (gpgme_op_encrypt): Better error return.
6116 * verify.c (verify_status_handler): Take on NODATA.
6118 2001-09-03 Werner Koch <wk@gnupg.org>
6120 * rungpg.h: Added STATUS_INV_RECP.
6121 * gpgme.c (_gpgme_release_result): Add support for new
6122 EncryptResult object.
6123 * encrypt.c (append_xml_encinfo): New.
6124 (encrypt_status_handler): Add some status parsing.
6125 (_gpgme_release_encrypt_result): New.
6127 2001-08-29 Werner Koch <wk@gnupg.org>
6129 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6131 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6132 an EOF here. This is probably the reason for a lot of bugs
6133 related to keylisting. It is so obvious. Kudos to Enno Cramer
6134 for pointing that out.
6136 2001-08-28 Werner Koch <wk@gnupg.org>
6138 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6139 (_gpgme_set_op_info): New.
6140 (_gpgme_release_result): Reset the op_info here.
6141 * sign.c (append_xml_siginfo): New.
6142 (sign_status_handler): Store the sig create information.
6144 2001-07-31 Werner Koch <wk@gnupg.org>
6146 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6148 2001-07-30 Werner Koch <wk@gnupg.org>
6150 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6152 * rungpg.c (build_argv): Disable armor comments
6153 * w32-io.c (build_commandline): Need to add quotes here
6155 2001-07-24 Werner Koch <wk@gnupg.org>
6157 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6159 2001-07-23 Werner Koch <wk@gnupg.org>
6161 * util.c: Removed stpcpy() because we use the version from jnlib.
6163 2001-07-19 Werner Koch <wk@gnupg.org>
6165 * mkstatus: Define the collating sequence for sort.
6167 2001-06-26 Werner Koch <wk@gnupg.org>
6169 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6171 2001-06-15 Werner Koch <wk@gnupg.org>
6173 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6174 to Timo for pointing this out.
6176 2001-06-01 Werner Koch <wk@gnupg.org>
6178 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6181 2001-05-28 Werner Koch <wk@gnupg.org>
6183 * version.c (gpgme_check_engine): Stop version number parsing at
6184 the opening angle and not the closing one. By Tommy Reynolds.
6186 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6188 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6189 line, because it gave an error if another operation had been made
6190 before using the same context.
6192 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6193 one line to release the gpg object in the context (if any).
6195 2001-04-26 Werner Koch <wk@gnupg.org>
6197 * key.c, key.h (_gpgme_key_cache_init): New.
6198 (_gpgme_key_cache_add): New.
6199 (_gpgme_key_cache_get): New.
6200 * version.c (do_subsystem_inits): Init the cache.
6201 * keylist.c (finish_key): Put key into the cache
6202 * verify.c (gpgme_get_sig_key): First look into the cache.
6204 2001-04-19 Werner Koch <wk@gnupg.org>
6206 * keylist.c (parse_timestamp): Adjusted for the changed
6207 --fixed-list-mode of gpg 1.0.4h.
6209 2001-04-05 Werner Koch <wk@gnupg.org>
6211 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6213 2001-04-04 Werner Koch <wk@gnupg.org>
6215 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6216 are still bytes pending. Timo found this not easy to track down
6219 2001-04-02 Werner Koch <wk@gnupg.org>
6221 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6222 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6224 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6225 the mode set in the current context. Suggested by Timo.
6227 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6228 can_encrypt. By Timo.
6230 2001-03-30 Werner Koch <wk@gnupg.org>
6232 * debug.c (debug_init): Allow to specify a debug file.
6233 (_gpgme_debug_level): New.
6235 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6236 (_gpgme_io_select): Debug only with level > 2.
6238 2001-03-15 Werner Koch <wk@gnupg.org>
6240 * rungpg.c: Included time.h.
6242 * key.h: New keyflags for capabilities.
6243 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6244 (keylist_colon_handler): Parse them.
6245 * gpgme.h: New attribute values for capabilties.
6246 * key.c (gpgme_key_get_string_attr): Return them.
6247 (capabilities_to_string): New.
6248 (gpgme_key_get_ulong_attr): Return the global caps.
6250 2001-03-14 Werner Koch <wk@gnupg.org>
6252 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6253 Thanks to Jan Oliver Wagner.
6255 2001-03-13 Werner Koch <wk@gnupg.org>
6257 * context.h: Add invalid and revoke flags to user_id structure.
6258 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6259 (keylist_colon_handler): Adjust for that.
6260 (set_userid_flags): New.
6261 (set_mainkey_trust_info): Handle new key invalid flag
6262 (set_subkey_trust_info): Ditto.
6263 * gpgme.h: Add new attributes for key and user ID flags.
6264 * key.c (_gpgme_key_append_name): Init these flags
6265 (gpgme_key_get_as_xml): Print them.
6266 (one_uid_as_xml): New helper for above.
6267 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6268 Return the new attributes. Enhanced, so that subkey information
6269 can be returned now.
6271 2001-02-28 Werner Koch <wk@gnupg.org>
6273 * w32-io.c (destroy_reader): Set stop_me flag.
6274 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6275 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6276 (_gpgme_io_close): Cleanup a writer thread
6277 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6278 waiting which is now possible due to the use of a writer thread.
6280 2001-02-20 Werner Koch <wk@gnupg.org>
6282 * w32-io.c (destroy_reader,kill_reader): New.
6283 (create_reader, reader): Add a new event to stop the thread.
6284 (_gpgme_io_close): Kill the reader thread.
6286 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6287 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6289 * wait.c: Reworked the whole thing.
6290 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6291 (_gpgme_gpg_release): Remove the process from the wait queue.
6293 2001-02-19 Werner Koch <wk@gnupg.org>
6295 * w32-io.c (_gpgme_io_set_close_notify): New.
6296 (_gpgme_io_close): Do the notification.
6298 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6301 * wait.c (remove_process): Don't close the fd here.
6302 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6303 (_gpgme_wait_on_condition): Remove the assert on the queue and
6304 break out if we could not find the queue. The whole thing should
6307 * posix-io.c (_gpgme_io_set_close_notify): New.
6308 (_gpgme_io_close): Do the notification.
6310 * rungpg.c (close_notify_handler): New.
6311 (_gpgme_gpg_new): Register a callback for the fd.
6312 (_gpgme_gpg_set_colon_line_handler): Ditto.
6315 2001-02-13 Werner Koch <wk@gnupg.org>
6317 * rungpg.c (struct reap_s): Replaced pid_t by int.
6319 * types.h: Add ulong typedef.
6321 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6322 (_gpgme_gpg_release): Reap children.
6323 * io.h, posix-io.c (_gpgme_io_kill): New.
6324 * w32-io.c (_gpgme_io_kill): New (dummy).
6326 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6328 * posix-io.c (_gpgme_io_read): Add some debug output.
6329 (_gpgme_io_write): Ditto.
6330 (_gpgme_io_select): Increased the timeout.
6332 2001-02-12 Werner Koch <wk@gnupg.org>
6334 Enhanced the signature verification, so that it can how handle
6335 more than one signature and is able to return more information on
6337 * verify.c (gpgme_get_sig_key): New.
6338 (gpgme_get_sig_status): New.
6340 * gpgme.h: Add stdio.h.
6341 (GpgmeSigStat): New status DIFF.
6343 2001-02-01 Werner Koch <wk@gnupg.org>
6345 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6346 code to all Set/ResetEvent().
6348 * rungpg.c (read_status): Check for end of stream only if we have
6351 2001-01-31 Werner Koch <wk@gnupg.org>
6353 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6354 (propagate_term_results,clear_active_fds): Removed.
6355 (count_active_fds): Renamed to ..
6356 (count_active_and_thawed_fds): .. this and count only thawed fds.
6358 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6361 2001-01-30 Werner Koch <wk@gnupg.org>
6363 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6365 * version.c (get_engine_info): Return better error information.
6367 * posix-util.c, w32-util.c: New.
6368 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6369 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6371 * signers.c (gpgme_signers_add): Ooops, one should test code and
6372 not just write it; the newarr was not assigned. Thanks to José
6373 for pointing this out. Hmmm, still not tested, why should a coder
6376 * w32-io.c: Does now use reader threads, so that we can use
6377 WaitForMultipleObjects.
6378 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6379 Does currently only work for W32.
6381 * debug.c, util.h : New. Changed all fprintfs to use this new
6382 set of debugging functions.
6384 2001-01-23 Werner Koch <wk@gnupg.org>
6386 * data.c (_gpgme_data_release_and_return_string): Fixed string
6389 2001-01-22 Werner Koch <wk@gnupg.org>
6394 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6395 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6397 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6398 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6400 2001-01-05 Werner Koch <wk@gnupg.org>
6402 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6405 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6407 This file is free software; as a special exception the author gives
6408 unlimited permission to copy and/or distribute it, with or without
6409 modifications, as long as this notice is preserved.
6411 This file is distributed in the hope that it will be useful, but
6412 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6413 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.