1 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
3 * op-support.c (_gpgme_op_reset): Instead of last change, only set
4 sub protocol if it is not the default.
6 2009-11-10 Werner Koch <wk@g10code.com>
8 * op-support.c (_gpgme_op_reset): Ignore GPG_ERR_NOT_IMPLEMENTED
9 while setting the sub protocol.
11 * engine-uiserver.c (uiserver_new): Pass fdpassing flag to
12 assuan_socket_connect.
13 (set_recipients): Replace fingerprint by user id.
15 * engine-gpgsm.c (set_recipients): Fix non-terminating loop in
16 case of a missing key.
18 2009-11-10 Marcus Brinkmann <marcus@g10code.de>
20 * gpgme.c (gpgme_new): Set default sub protocol.
21 * gpgme-tool.c: Implement get sub protocol.
23 * gpgme.h.in (gpgme_get_sub_protocol): Add prototype.
24 * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol.
25 * context.h (struct gpgme_context): New member sub_protocol.
26 * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol.
27 (gpgme_get_sub_protocol): New function.
28 * op-support.c (_gpgme_op_reset): Set sub protocol.
30 * Makefile.am (uiserver_components): New variable.
31 (main_sources): Add it.
32 * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
33 implement it. Adjust callers.
34 (gpgme_key_from_uid): New function.
35 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT.
36 (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE,
37 GPGME_ENCRYPT_EXPECT_SIGN.
38 (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions.
39 * libgpgme.vers, gpgme.def: Add new functions.
40 * gpgme.c (gpgme_set_protocol): Add UIServer protocol.
41 (gpgme_set_sub_protocol): New function.
42 (gpgme_get_protocol_name): Add UIServer and default protocol.
43 * assuan-support.c: Return correct error values, implement
45 * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c,
46 w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE
47 arguments. Implement it for POSIX. Adjust all callers.
48 * engine.h, engine-backend.h (_gpgme_engine_set_protocol)
49 (_gpgme_engine_op_decrypt_verify): New prototypes. Adjust all
51 * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer
53 (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New
55 * decrypt-verify.c (decrypt_verify_start): Call
56 _gpgme_engine_op_decrypt_verify.
57 * util.h, posix-util.c,
58 w32-util.c (_gpgme_get_uiserver_socket_path): New function.
59 * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation.
60 * gpgme-tool.c: Some support for UIServer protocol.
61 * engine-uiserver.c: New file.
63 2009-11-09 Marcus Brinkmann <marcus@g10code.de>
65 * engine-gpgsm.c (gpgsm_new): Close server side FDs.
67 2009-11-06 Marcus Brinkmann <marcus@g10code.de>
69 * gpgme-tool.c (struct gpgme_tool): New members write_data and
71 (gt_write_data): New function.
72 (gt_result): Output vfs_mount result.
73 (server_write_data): New function.
74 (gpgme_server): Initialize write_data members.
76 2009-11-05 Marcus Brinkmann <marcus@g10code.de>
78 * engine-g13.c (struct engine_g13): Remove members RESULT_CB and
80 (g13_assuan_simple_command, status_handler): Don't use those anymore.
81 (g13_transact): Remove them from argument list, too.
82 * vfs-mount.c (_gpgme_vfs_mount_status_handler): New function.
83 (_gpgme_op_vfs_mount): Pass it to transact.
85 * engine-assuan.c (llass_new): Update use of assuan_socket_connect.
86 * engine-gpgsm.c (gpgsm_new): Update use of assuan_pipe_connect.
87 * engine-g13.c (g13_new): Likewise.
89 * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
90 * w32-io.c (_gpgme_io_spawn): Implement this flag.
91 * posix-io.c (_gpgme_io_spawn): Likewise.
92 * w32-glib-io.c (_gpgme_io_spawn): Likewise.
93 * assuan-support.c (my_spawn): Set this flag.
95 * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
96 * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
97 * delete.c (gpgme_op_delete_start): Likewise.
98 * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start):
100 * encrypt.c (gpgme_op_encrypt_start): Likewise.
101 * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise.
102 * export.c (gpgme_op_export_start, gpgme_op_export_ext_start)
103 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
104 * genkey.c (gpgme_op_genkey_start): Likewise.
105 * getauditlog.c (gpgme_op_getauditlog_start): Likewise.
106 * import.c (gpgme_op_import_start, gpgme_op_import_keys_start):
108 * opassuan.c (gpgme_op_assuan_transact_start): Likewise.
109 * sign.c (gpgme_op_sign_start): Likewise.
110 * verify.c (gpgme_op_verify_start): Likewise.
111 * vfs-create.c (gpgme_op_vfs_create): Likewise.
112 * vfs-mount.c (gpgme_op_vfs_mount): Likewise.
114 2009-11-04 Marcus Brinkmann <marcus@g10code.de>
116 * ath.h (ath_self): New prototype. Include <stdint.h>
117 * ath.c, ath-pth.c, ath-pthread.c (ath_self): New function.
118 * debug.h: Rewrite most macros to beautify debug output.
119 (_gpgme_debug_buffer): Remove tagname and tag argument.
120 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New prototypes.
121 * debug.c: Include <time.h>. Don't include assuan.h.
122 (frame_nr, FRAME_NR): New thread-specific variable and macro.
123 (debug_init): Do not initialize assuan. Call _gpgme_debug after
124 initialization instead using printf directly.
125 (_gpgme_debug): Do not call debug_init (we now ensure proper
126 initialization by user). Add timestamp and thread/process ID.
127 (_gpgme_debug_buffer): Do not take tagname and tag argument.
128 (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New functions.
129 * version.c (gpgme_check_version_internal, gpgme_check_version):
130 Fix debug string. Do not initialize assuan.
131 * posix-io.c (get_max_fds): Use 0 not NULL (nicer debug output).
133 2009-11-04 Werner Koch <wk@g10code.com>
135 * gpgme-tool.c (register_commands): Add HELP feature.
137 2009-11-03 Werner Koch <wk@g10code.com>
139 * gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
141 2009-11-03 Marcus Brinkmann <marcus@g10code.de>
143 * Makefile.am (main_sources): Change g13.c to vfs-mount.c. Add
145 * vfs-create.c: New file.
146 * g13.c: Renamed to ...
147 * vfs-mount.c: ... this new file.
148 * gpgme.h.in (gpgme_op_vfs_create): New prototype.
149 * gpgme.def, libgpgme.vers: Add gpgme_op_vfs_create.
150 * gpgme-tool.c (gt_vfs_create, cmd_vfs_create): New functions.
151 (register_commands): Add VFS_CREATE and CREAET.
153 2009-11-02 Marcus Brinkmann <marcus@g10code.de>
155 * debug.h (_gpgme_debug_buffer): Make TAG argument const const.
156 * debug.c (_gpgme_debug_buffer): Likewise.
157 * gpgme-tool.c (input_notify, output_notify): Adjust type to new
159 * decrypt.c (gpgme_op_decrypt_result): Remove unused variable.
160 * opassuan.c (gpgme_op_assuan_transact): Fix return value.
162 2009-10-30 Marcus Brinkmann <marcus@g10code.de>
164 * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
165 (gpgme_tool_LDADD): New variable.
166 * gpgme-tool.c: New file.
167 * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
169 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
170 had that gone missing?).
171 (_gpgme_sig_notation_clear): New function without debug output.
172 (gpgme_release): Call it and _gpgme_signers_clear.
173 * signers.c (_gpgme_signers_clear): New function without debug output.
174 * g13.c (gpgme_op_vfs_mount): Add debug output.
175 * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
176 * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
177 * debug.h: Put tag in front of debug lines, should make for nicer
179 * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
180 * engine-g13.c (g13_new): Remove redundant assuan context allocation.
181 * version.c (gpgme_check_version_internal): Delay debug output
182 until after gpgme_check_version was called.
184 2009-10-28 Marcus Brinkmann <marcus@g10code.de>
186 * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
187 edit.c, import.c, export.c: Fix last change in debug output.
189 2009-10-27 Marcus Brinkmann <marcus@g10code.de>
191 * edit.c (gpgme_op_edit_start, gpgme_op_edit)
192 (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
193 * encrypt-sign.c (gpgme_op_encrypt_sign_start)
194 (gpgme_op_encrypt_sign): Likewise.
195 * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
196 (gpgme_op_encrypt_result): Likewise.
197 * export.c (gpgme_op_export_start, gpgme_op_export)
198 (gpgme_op_export_ext_start, gpgme_op_export_ext)
199 (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
200 * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
201 (gpgme_op_genkey_result): Likewise.
202 * getauditlog.c (gpgme_op_getauditlog_start)
203 (gpgme_op_getauditlog): Likewise.
204 * import.c (gpgme_op_import_result, gpgme_op_import_start)
205 (gpgme_op_import): Likewise.
206 * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
207 (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
208 (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
209 * opassuan.c (gpgme_op_assuan_transact_start)
210 (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
211 (gpgme_op_assuan_transact): Likewise.
212 * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
213 * trustlist.c (gpgme_op_trustlist_start)
214 (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
215 * verify.c (gpgme_op_verify_start, gpgme_op_verify)
216 (gpgme_op_verify_result): Likewise.
218 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
220 * gpgme.h.in (struct gpgme_io_event_done_data)
221 (gpgme_io_event_done_data_t): New types.
222 (struct _gpgme_op_assuan_result): Deprecate the err member.
223 (gpgme_op_assuan_result): Deprecate (for now).
224 (gpgme_op_assuan_transact_ext): New prototype.
225 (gpgme_op_assuan_transact): Deprecate.
226 (struct _gpgme_op_g13_result): Replace with ...
227 (struct _gpgme_op_vfs_mount_result): ... this.
228 (gpgme_op_g13_mount): Replace with ...
229 (gpgme_op_vfs_mount): ... this.
230 * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
231 (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
232 (gpgme_op_g13_mount): Remove.
233 * libgpgme.vers: Likewise.
234 * engine-backend.h (struct engine_ops): Remove RESULT_CB and
235 RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
237 * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
239 (_gpgme_wait_one_ext): New prototype.
240 * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
241 * engine-g13.c (g13_cancel_op): New function.
242 (parse_status): Remove declaration.
243 (g13_assuan_simple_command): Do nothing with status lines for now.
244 (status_handler): Update opaque value access.
245 (_gpgme_engine_ops_g13): Add new cancel_op member.
246 * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
247 Handle operational errors.
248 (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
249 * data.c (_gpgme_data_inbound_handler)
250 (_gpgme_data_outbound_handler): Adjust opaque value access.
251 * engine-gpg.c (command_handler, status_handler)
252 (colon_line_handler): Likewise.
253 * engine-gpgsm.c (status_handler): Likewise.
254 * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
255 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
256 * g13.c: Rewritten (and will be rewritten again).
257 * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
258 and result_cb_value parameters from prototype.
259 (_gpgme_engine_cancel_op): New prototype.
260 * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
261 (_gpgme_engine_op_assuan_transact): Remove result_cb and
262 result_cb_value parameter.
263 (_gpgme_engine_cancel_op): New function.
264 * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
265 (struct io_cb_data): New struct to pass opaque data and get a
266 op_err return value. Needed because we can't modify I/O callback
267 handler signature because it is exposed to the user.
268 * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
270 * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
272 * wait-private.c (_gpgme_wait_on_condition): New argument to
273 retrieve the operational result. Handle operational errors in
274 session based protocols.
275 (_gpgme_wait_one_ext): New function.
276 (_gpgme_wait_one): Pass argument in invocation of
277 _gpgme_wait_on_condition.
278 * wait-global.c (struct ctx_list_item): Add member OP_ERR.
279 (ctx_done): New argument OP_ERR.
280 (ctx_wait): New argument OP_ERR.
281 (gpgme_wait_ext): New function based on gpgme_wait but handling
283 (gpgme_wait): Implement in term of gpgme_wait_ext.
284 * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
285 of _gpgme_wait_on_condition.
286 * trustlist.c (gpgme_op_trustlist_next): Pass argument in
287 invocation of _gpgme_wait_on_condition.
288 * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
289 and RESULT_CB_VALUE by LAST_OP_ERR.
290 (_gpgme_engine_assuan_last_op_err): Add this hack function.
291 (llass_cancel_op): New function.
292 (_gpgme_engine_llass_ops): Add cancel_op member.
293 (llass_status_handler): Update opaque value access.
294 (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
295 * opassuan.c: Move compat hacks to the end of file.
296 (opassuan_start): Do not set OPD->result.err.
297 Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
298 (gpgme_op_assuan_transact_ext): New function.
300 * debug.h (DEBUG_GLOBAL): New debug level.
301 * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
302 * data-user.c (gpgme_data_new_from_cbs): Add debug output.
303 * data-fd.c (gpgme_data_new_from_fd): Likewise.
304 * data-stream.c (gpgme_data_new_from_stream): Likewise.
305 * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
306 (gpgme_op_decrypt): Likewise.
307 * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
308 * decrypt-verify.c (gpgme_op_decrypt_verify_start)
309 (gpgme_op_decrypt_verify): Likewise.
310 * sign.c (gpgme_op_sign_result): Fix debug message.
311 * data-mem.c (gpgme_data_new): Improve debug output.
312 * verify.c (parse_trust): Use atoi instead of
313 _gpgme_map_gnupg_error.
314 * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
316 2009-10-22 Marcus Brinkmann <marcus@g10code.de>
318 * Makefile.am: Remove @NETLIBS@ from LIBADDs.
319 (g13_components): New variable.
320 (main_sources): Add $(g13_components).
321 * g13.c, engine-g13.c: New files.
322 * engine.c (engine_ops): Check for assuan for assuan engine, add
324 * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
326 * conversion.c (_gpgme_encode_percent_string): New function.
327 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
328 (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
329 (gpgme_op_g13_mount): New function.
330 * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
331 * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
332 (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
333 * posix-util.c (_gpgme_get_g13_path): New function.
334 * w32-util.c (_gpgme_get_g13_path): New function.
335 * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
337 2009-10-20 Marcus Brinkmann <marcus@g10code.de>
339 * gpgme-config.in (netlibs): Remove.
340 (assuan_cflags, assuan_libs): Add.
342 * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
343 (gpgsm_components): Move engine-assuan.c to ...
344 (assuan_components): ... this new variable.
345 (main_sources): Add this new variable.
346 (AM_CPPFLAGS): Remove $(assuan_cppflags).
347 (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
348 (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
349 (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
350 (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
351 (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
352 (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
353 (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
355 * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
356 _gpgme_io_sendmsg, _gpgme_io_waitpid.
357 * engine-backend.h: Define with [ENABLE_ASSUAN] instead
359 * posix-io.c (_gpgme_io_waitpid): Make non-static.
360 * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
361 _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
362 * engine-gpgsm.c: Don't map assuan error codes. Use
363 assuan_release instead of assuan_disconnect.
364 (map_assuan_error): Remove function.
365 (gpgsm_new): Use new assuan context interface.
366 * engine-assuan.c: Use assuan_release instead of
368 (llass_new): Use new assuan context interface.
370 2009-10-07 <wk@g10code.com>
372 * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
374 2009-08-06 Werner Koch <wk@g10code.com>
376 * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
378 * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
380 * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
381 * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
382 (_gpgme_op_sign_init_result): Factor code out to ...
383 (sign_init_result): .. new. Init new fields.
384 (sign_start): Use sign_init_result.
385 (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
386 Return an error if no signature has been created.
388 2009-07-07 Werner Koch <wk@g10code.com>
390 * engine-gpgsm.c (struct engine_gpgsm): Add fields
391 input_helper_data and input_helper_memory.
392 (close_notify_handler): Release these new fields.
393 (gpgsm_import): Implement the keyarray feature.
395 * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
397 * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
400 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
402 * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
403 [HAVE_STDINT_H]: Include <stdint.h>.
404 (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
405 to (uintptr_t) before casting it to (void*) to silence GCC
408 * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
409 * sign.c (_GPGME_IN_GPGME): Define it.
410 * keylist.c (_GPGME_IN_GPGME): Define it.
412 * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
413 vasprintf and asprintf.
415 * priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
417 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
419 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
420 back! (GPA still uses it...).
422 * gpgme.def: Fix stupid typo.
423 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
425 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
427 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
429 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
430 (_gpgme_io_dup): Never allocate threads here.
431 (find_writer, find_reader): Check return value of thread creation
434 * context.h (CTX_OP_DATA_MAGIC): New macro.
435 (struct ctx_op_data): New member MAGIC.
436 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
437 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
439 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
441 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
443 * gpgme.c (result_ref_lock): New global variable.
444 (gpgme_result_ref, gpgme_result_unref): use it.
446 2009-06-16 Werner Koch <wk@g10code.com>
448 * version.c: Include stdlib.h.
450 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
451 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
452 * data.c (gpgme_data_set_encoding): Adjust for new values.
453 * engine-gpg.c (string_from_data): New.
454 (gpg_import): Implement --fetch-key feature.
456 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
457 * gpgme.def, libgpgme.vers: Add them.
458 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
459 (export_keys_start): New.
461 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
462 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
463 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
465 * export.c (gpgme_export_ext_start, gpgme_op_export)
466 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
467 (export_start): Ditto.
468 * engine.c (_gpgme_engine_op_export): Ditto.
469 * engine-backend.h (struct engine_ops): Ditto.
470 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
471 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
473 (gpg_export, gpg_export_ext): Factor common code out to ..
474 (export_common): .. this.
476 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
477 * gpgme.def, libgpgme.vers: Add them.
478 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
479 (_gpgme_op_import_keys_start): New.
480 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
481 * engine-backend.h (struct engine_ops): Ditto.
482 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
483 * engine-gpg.c (gpg_import): Ditto. Implement it.
485 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
487 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
489 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
491 * context.h (struct ctx_op_data): Add member "references".
492 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
493 (_gpgme_release_result): Use gpgme_result_unref.
494 * op-support.c (_gpgme_op_data_lookup): Initialize references.
496 2009-06-12 Werner Koch <wk@g10code.com>
498 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
499 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
500 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
501 (main): Pass flags for my_spawn.
502 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
504 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
505 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
506 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
507 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
508 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
509 * engine-gpg.c (start): Call spawn with new flag.
511 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
512 _gpgme_allow_set_foreground_window. Change all callers.
513 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
515 2009-06-10 Werner Koch <wk@g10code.com>
517 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
519 2009-06-09 Werner Koch <wk@g10code.com>
521 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
523 * version.c (gpgme_check_version_internal): Make result const.
525 * gpgme.c: Include priv-io.h.
526 (gpgme_io_read, gpgme_io_write): New.
527 * libgpgme.vers (GPGME_1.1): Add them.
530 * Makefile.am (main_sources): Remove gpgme.h.
531 (include_HEADERS): Rename to nodist_include_HEADERS so that a
532 VPATH build won't use the distributed one.
534 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
536 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
538 * gpgme.h.in (gpgme_check_version_internal): New prototype.
539 (gpgme_check_version): New macro, overriding function of the same
541 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
542 * context.h (_gpgme_selftest): New variable declaration.
543 * version.c: Include "context.h".
544 (gpgme_check_version): Set _gpgme_selftest on success.
545 (gpgme_check_version_internal): New function.
546 * gpgme.c (_gpgme_selftest): Define it.
547 (gpgme_new): Check the selftest result.
549 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
551 * gpgme.h.in (gpgme_encrypt_flags_t): Add
552 GPGME_ENCRYPT_NO_ENCRYPT_TO.
553 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
554 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
556 2009-05-14 Werner Koch <wk@g10code.com>
558 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
559 better maintainability and to help debugging.
561 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
563 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
565 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
567 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
568 * w32-io.c (_gpgme_io_connect): Fix stupid error.
570 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
572 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
573 (find_channel): Drop CREATE argument.
574 (new_dummy_channel_from_fd, new_channel_from_fd)
575 (new_channel_from_socket): New functions.
576 (_gpgm_io_fd2str): Implement for sockets.
577 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
579 (_gpgme_io_pipe): Fix for new channel bookkeeping.
580 (_gpgme_io_close, _gpgme_io_dup): Likewise.
581 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
582 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
583 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
584 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
585 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
586 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
587 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
589 2009-03-18 Werner Koch <wk@g10code.com>
591 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
592 * engine-gpgsm.c (gpgsm_keylist): Send new option.
594 2009-03-13 Werner Koch <wk@g10code.com>
596 * gpgme-config.in: Make sure locale is set to C.
598 2009-02-24 Werner Koch <wk@g10code.com>
600 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
601 (gpgme_assuan_result_t): New.
602 (gpgme_op_assuan_result): Change return type.
603 (struct _gpgme_assuan_sendfnc_ctx)
604 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
605 (gpgme_assuan_inquire_cb_t): Changed.
606 * opassuan.c (op_data_t): Make use of a result structure.
607 (gpgme_op_assuan_result): Change return type.
608 (opassuan_start): Use result structure.
610 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
611 (inquire_cb_sendfnc): Remove.
612 (inquire_cb): Change for new callback scheme. Not yet finished.
613 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
615 2009-02-04 Werner Koch <wk@g10code.com>
617 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
619 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
621 2009-02-03 Werner Koch <wk@g10code.com>
623 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
625 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
626 * keylist.c (keylist_colon_handler): Factor common code out to ...
627 (parse_sec_field15): New. Set card number.
629 2009-01-26 Werner Koch <wk@g10code.com>
631 * opassuan.c, dirinfo.c, engine-assuan.c: New.
632 * Makefile.am: Add them.
633 * engine-backend.h: Add _gpgme_engine_ops_assuan.
634 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
636 * Makefile.am (gpgsm_components): Add engine-assuan.c.
637 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
638 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
639 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
640 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
641 * gpgme.c (gpgme_get_protocol_name): Ditto.
642 (gpgme_set_protocol): Support it.
643 * engine.c (gpgme_get_engine_info): Ditto.
644 (engine_ops): Register it.
645 (_gpgme_engine_op_assuan_transact): New.
646 * libgpgme.vers (gpgme_op_assuan_transact_start)
647 (gpgme_op_assuan_transact): New.
648 * gpgme.def (gpgme_op_assuan_transact_start)
649 (gpgme_op_assuan_transact): New.
650 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
651 initialize to NULL for all engines.
652 * engine.c (engine_get_home_dir): New.
653 (gpgme_get_engine_info): Use it.
654 (_gpgme_set_engine_info): Use it.
655 * engine.h (engine_assuan_result_cb_t): New.
656 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
658 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
660 * version.c (gpgme_check_version): Protect trace arg against NULL.
662 2009-01-19 Werner Koch <wk@g10code.com>
664 * rungpg.c: Rename to engine-gpg.c
665 * Makefile.am (main_sources): Ditto.
667 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
669 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
671 2008-11-18 Werner Koch <wk@g10code.com>
673 * version.c (do_subsystem_inits): Always initialize I/O
674 subsystem. Fixes regression from 2007-08-02.
676 * decrypt.c (_gpgme_decrypt_status_handler): Use
677 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
679 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
681 * wait-private.c (_gpgme_wait_on_condition): Remove unused
683 * wait-global.c: Include ops.h to silence gcc warning.
684 (_gpgme_wait_global_event_cb): Pass error value directly.
685 * wait-user.c: Include ops.h to silence gcc warning.
687 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
688 silence gcc warning. Cast argument to execv to silence warning.
689 * w32-io.c (_gpgme_io_spawn): Likewise.
690 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
692 2008-10-24 Werner Koch <wk@g10code.com>
694 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
696 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
698 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
699 string to C coded string.
701 2008-10-20 Werner Koch <wk@g10code.com>
703 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
705 * gpgme.h: Rename to gpgme.h.in.
706 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
708 * posix-io.c: Include sys/uio.h. Fixes bug #818.
710 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
712 * w32-util.c (find_program_in_registry): Don't define.
713 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
714 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
715 registry anymore. It is now no longer possible to overwrite the
716 default location in that way.
718 2008-10-17 Werner Koch <wk@g10code.com>
720 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
721 around a bug in mingw32.
723 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
725 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
726 Submitted by "Daniel Mueller" <daniel@danm.de>
728 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
730 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
732 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
734 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
735 * gpgme.c (_gpgme_cancel_with_err): New function.
736 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
737 * wait-private.c (_gpgme_wait_on_condition): Use
738 _gpgme_cancel_with_err.
739 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
740 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
742 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
744 * rungpg.c (command_handler): Remove I/O callback on error, too.
746 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
748 * gpgme.c (gpgme_cancel_async): Remove unused variable.
750 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
752 * libgpgme.vers: Add gpgme_cancel_async.
753 * gpgme.def: Likewise.
755 * context.h: Include "sema.h".
756 (struct gpgme_context): New members lock and canceled.
757 * gpgme.c (gpgme_new): Initialize lock.
758 (gpgme_release): Destroy lock.
759 (gpgme_cancel_async): New function.
760 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
761 * wait-global.c (gpgme_wait): Check cancel flag before processing
763 * wait-private.c (_gpgme_wait_on_condition): Likewise.
764 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
766 2008-06-26 Werner Koch <wk@g10code.com>
768 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
769 (mkstemp): Need to use GetSystemTimeAsFileTime for better
772 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
774 * gpgme-w32spawn.c: New file.
775 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
777 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
778 (gpgsm_set_locale): Return early if locale value is NULL.
779 * util.h (_gpgme_mkstemp)
780 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
782 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
783 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
785 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
786 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
787 special filename FD rather than stdin.
788 (struct arg_and_data_s): Add member ARG_LOCP.
789 (struct fd_data_map_s): Add member ARG_LOC.
790 (struct engine_gpg): Add member ARG_LOC to status and colon.
791 (_add_arg, add_arg_with_locp): New function.
792 (add_arg_ext): Reimplement in terms of _add_arg.
793 (gpg_new): Remember argument location for status FD.
794 (build_argv): Set argument location if requested. Also set
795 argument location of fd_data_map for data items.
796 (start): Adjust caller of _gpgme_io_spawn.
797 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
799 (_gpgme_io_spawn): Remove parent fd list argument.
800 * posix-io.c (get_max_fds): New function.
801 (_gpgme_io_dup): Add tracing.
802 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
803 fd list to contain all child fds that should be inherited. Close
804 all other file descriptors after fork.
805 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
806 parent fd list. Change meaning of child fd list to contain all
807 child fds that should be inherited. Do not inherit any file
808 descriptors, but DuplicateHandle them. Spawn process through
809 wrapper process. Provide wrapper process with a temporary file
810 containing handle translation data. Return translated handle
812 * w32-io.c (reader): Add more tracing output.
813 (_gpgme_io_read): Likewise.
814 * engine-gpgconf.c (gpgconf_read): Adjust caller of
816 * version.c (_gpgme_get_program_version): Likewise.
818 2008-06-20 Werner Koch <wk@g10code.com>
820 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
821 compatibility with old compilers. Fix amount of memmove. Fix
824 2008-06-19 Werner Koch <wk@g10code.com>
826 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
827 change all callers and provide compatibilty macro.
828 (gpgme_conf_type_t): Add complex types 34..37.
829 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
830 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
832 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
834 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
836 2008-05-09 Werner Koch <wk@g10code.com>
838 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
841 2008-05-07 Werner Koch <wk@g10code.com>
843 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
844 self-explaining string. Needs a proper fix, though.
846 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
848 (gpg_build_keylist_options): .. new. Allow combination of extern
850 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
852 2008-05-06 Werner Koch <wk@g10code.com>
854 * version.c (extract_version_string): New.
855 (_gpgme_get_program_version): Use it to allow for suffixes in the
858 2008-04-28 Werner Koch <wk@g10code.com>
860 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
863 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
865 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
866 Osterfeld, implement blocking select.
868 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
870 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
872 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
874 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
875 Reported by Marc Mutz.
877 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
879 * decrypt.c (release_op_data): Release OPD->result.recipients.
880 * encrypt.c (release_op_data): Release invalid_recipient.
882 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
884 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
886 2008-02-14 Werner Koch <wk@g10code.com>
888 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
889 * posix-io.c (_gpgme_io_spawn): Ditto.
890 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
891 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
892 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
893 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
895 * w32-util.c (_gpgme_allow_set_foregound_window): New.
896 * posix-util.c (_gpgme_allow_set_foregound_window): New.
897 * engine-gpgsm.c (default_inq_cb): New.
898 (gpgsm_new) [W32]: Enable pinentry notifications.
899 (status_handler): Handle inquiries.
901 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
903 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
906 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
908 * engine-gpgsm.c (map_input_enc): Rename to ...
909 (map_data_enc): ... this. Also change all callers.
910 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
911 (gpgsm_sign): Set encoding for output.
913 2008-01-28 Werner Koch <wk@g10code.com>
915 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
917 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
919 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
922 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
924 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
926 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
929 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
931 * Makefile.am (gpgconf_components): New variable.
932 (main_sources): Add gpgconf.c.
933 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
934 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
935 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
936 (gpgme_conf_arg_release, gpgme_conf_opt_change)
937 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
939 * gpgconf.c, engine-gpgconf.c: New files.
940 * engine.h: (_gpgme_engine_op_conf_load,
941 (_gpgme_engine_op_conf_save): New prototypes.
942 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
944 * posix-util.c (_gpgme_get_gpgconf_path): New function.
945 * w32-util.c (_gpgme_get_gpgconf_path): New function.
947 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
949 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
950 * gpgme.def: Add new gpgconf related interfaces.
951 * libgpgme.vers: Likewise.
952 * util.h (_gpgme_get_gpgconf_path): New prototype.
953 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
954 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
955 (struct engine_ops): Add members for conf_load and conf_save.
956 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
957 (_gpgme_engine_op_conf_load,
958 (_gpgme_engine_op_conf_save): New functions.
959 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
961 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
963 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
964 for installation directory. Remove old fallback default.
965 (find_program_in_inst_dir): New function.
967 2007-11-26 Werner Koch <wk@g10code.com>
969 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
970 always reset it before calling start.
971 (gpgsm_new): Clear it.
972 (status_handler): Implement it.
973 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
975 2007-11-23 Werner Koch <wk@g10code.com>
977 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
978 * getauditlog.c (getauditlog_start): Use that flag.
980 2007-11-22 Werner Koch <wk@g10code.com>
982 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
983 * libgpgme.vers: Ditto.
985 * getauditlog.c: New.
986 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
987 * engine-gpgsm.c (gpgsm_getauditlog): New.
988 (_gpgme_engine_ops_gpgsm): Insert new function.
989 (gpgsm_new): Try to enable audit log support.
990 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
992 2007-11-20 Werner Koch <wk@g10code.com>
994 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
996 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
998 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1000 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
1002 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1004 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
1006 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
1009 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
1011 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
1014 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
1016 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
1017 w32-qt-io.cpp: New versions from Frank Osterfeld.
1019 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
1021 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
1022 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
1023 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
1024 Submitted by Frank Osterfeld.
1026 * priv-io.h, engine-gpgsm.c: Add comments.
1027 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
1028 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
1029 even if not primary.
1030 (_gpgme_io_dup): Acquire a reference. Replace unused
1031 implementation by assertion.
1033 2007-09-28 Werner Koch <wk@g10code.com>
1035 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
1036 (gpgsm_new): Set it.
1037 (gpgsm_set_fd): Use it.
1039 * w32-glib-io.c (find_channel): Add a new primary flag.
1040 (_gpgme_io_close): Close channel only if primary.
1041 (_gpgme_io_dup): Put newfd into the table as shallow copy.
1043 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
1044 * w32-io.c (_gpgme_io_select): Ditto.
1045 * w32-glib-io.c (_gpgme_io_select): Ditto.
1047 * posix-io.c (_gpgme_io_select): Ditto.
1048 * rungpg.c (read_status): Ditto.
1049 * wait.c (fd_table_put): Ditto.
1051 * rungpg.c (gpg_io_event): Add tracing.
1052 (start): Use gpg_io_event for sending the start event.
1053 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
1054 (start): Use gpgsm_io_event for sending the start event.
1055 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
1057 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
1059 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
1060 versions from Frank Osterfeld.
1062 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
1064 * w32-glib-io.c (_gpgme_io_spawn),
1065 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
1066 the process handle, return 0.
1068 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
1069 * gpgme.c (gpgme_get_protocol_name): Implement support for
1070 GPGME_PROTOCOL_UNKNOWN.
1072 * kdpipeiodevice.h: Fix last change.
1074 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
1075 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
1078 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
1080 * conversion.c, keylist.c: Include <sys/types.h>.
1082 * kdpipeiodevice.h: Use namespace _gpgme_.
1083 * kdpipeiodevice.cpp: Use namespace _gpgme_.
1084 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
1085 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
1086 _gpgme_::KDPipeIODevice.
1088 2007-09-17 Werner Koch <wk@g10code.com>
1090 * rungpg.c (gpg_new): Make robust against undefined ttyname or
1093 2007-09-14 Werner Koch <wk@g10code.com>
1095 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
1097 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
1099 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
1101 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
1103 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
1106 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
1108 * Makefile.am (libgpgme_qt_la_SOURCES): Move
1109 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
1110 another file (it's more like a header file than a cpp file, but
1111 automake doesn't know that).
1113 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
1114 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
1115 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
1117 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
1118 kdpipeiodevice.moc, w32-qt-io.c: New files.
1119 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
1120 (ltlib_gpgme_qt): New variable.
1121 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
1122 (libgpgme_qt_la_SOURCES): New variable.
1123 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
1124 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
1125 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
1126 (libgpgme_qt_la_LIBADD): New variables.
1128 * sema.h (struct critsect_s): Rename "private" to "priv" to make
1129 C++ users happy. Change users.
1130 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
1131 (_gpgme_sema_cs_destroy): Likewise.
1132 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
1133 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
1134 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
1136 (gpgme_get_fdptr): New function.
1137 * w32-io.c (gpgme_get_fdptr): New function
1138 * gpgme.def: Add gpgme_get_fdptr.
1140 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
1142 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
1143 (writer): Remove superfluous check.
1145 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
1147 * gpgme.h: Move include of gpg-error.h out of extern "C".
1149 2007-08-07 Werner Koch <wk@g10code.com>
1151 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
1152 * verify.c (parse_trust): Set Chain_MODEL.
1154 2007-08-02 Werner Koch <wk@g10code.com>
1156 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1157 * w32-io.c (_gpgme_io_spawn): Ditto.
1158 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1159 * debug.c (_gpgme_debug): Enable assuan logging.
1160 (_gpgme_debug_subsystem_init): New.
1161 * version.c (do_subsystem_inits): Disable assuan logging and
1162 initialize the debug system.
1163 (gpgme_check_version): Do not trace before the subsystems are
1166 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
1168 * debug.c: Include <errno.h> and "debug.h".
1169 (_gpgme_debug): Save and restore ERRNO.
1171 (_gpgme_debug_buffer): New function.
1172 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1173 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1174 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
1175 most of these files, add many more tracepoints.
1177 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
1179 * engine-gpgsm.c (status_handler): Do not send BYE here.
1181 * w32-io.c (struct reader_context_s, struct writer_context_s): New
1183 (create_reader, create_writer): Initialize C->refcount to 1.
1184 (destroy_reader, destroy_writer): Only destroy if C->refcount
1186 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1187 * priv-io.h (_gpgme_io_dup): New prototype.
1188 * posix-io.c (_gpgme_io_dup): New function.
1189 * w32-io.c (_gpgme_io_dup): Likewise.
1190 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1191 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1193 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
1195 * data-user.c (user_read, user_write, user_seek): Set errno and
1196 return -1 instead returning the error code directly.
1197 * data-compat.c (old_user_seek): Likewise.
1198 * gpgme.c (gpgme_sig_notation_add): Return error properly.
1200 * Revert the "close_notify_handler" returns int stuff. Always
1201 close in the _gpgme_io_close implementations.
1202 * engine-gpgsm.c (status_handler): Try to terminate the connection
1204 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1205 (_gpgme_io_write): Likewise.
1207 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1208 to _gpgme_close_notify_handler.
1209 (_gpgme_close_notify_handler): New type.
1210 (_gpgme_io_dup): Remove prototype.
1211 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1212 type of HANDLER to _gpgme_close_notify_handler_t.
1213 (_gpgme_io_close): Do not close the FD if handler returns 0.
1214 (_gpgme_io_dup): Remove function.
1215 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1216 _gpgme_io_close): Change type of HANDLER to
1217 _gpgme_close_notify_handler_t.
1218 (_gpgme_io_close): Do not close the FD if handler returns 0.
1219 (_gpgme_io_dup): Remove function.
1220 * w32-glib-io.c (_gpgme_io_dup): Remove function.
1221 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1222 to _gpgme_close_notify_handler_t.
1223 (_gpgme_io_close): Do not close the FD if handler returns 0.
1224 * rungpg.c (close_notify_handler): Change return type to int,
1226 * engine-gpgsm.c (close_notify_handler): Change return type to
1227 int, return 0 for status FD and 1 for all other FDs.
1228 (start): Do not duplicate the status FD.
1230 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
1232 * Makefile.am: Replace implicite rule by suffix rule. Add
1235 2007-07-12 Werner Koch <wk@g10code.com>
1237 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1238 system has been started.
1240 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
1242 * priv-io.h (_gpgme_io_dup): New prototype.
1243 * posix-io.c (_gpgme_io_dup): New function.
1244 * w32-io.c (_gpgme_io_dup): Likewise.
1245 * w32-glib-io.c (_gpgme_io_dup): Likewise.
1246 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1248 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
1250 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1251 * funopen.c (funopen): Rename to _gpgme_funopen.
1253 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
1255 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1256 * rungpg.c (gpg_new): Likewise.
1257 Submitted by Stephen Tether.
1259 2007-02-26 Werner Koch <wk@g10code.com>
1261 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1262 (_gpgme_verify_status_handler): Return an error if more than one
1263 plaintext has been seen.
1264 (parse_error): New arg SET_STATUS. Also detect it based on an
1265 ERROR status (gpg > 1.4.6).
1267 2007-01-26 Werner Koch <wk@g10code.com>
1269 * w32-io.c (build_commandline): Fixed stupid quoting bug.
1270 * w32-glib-io.c (build_commandline): Ditto.
1272 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1274 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1276 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
1278 * data.h (_gpgme_data_get_fd): Add prototype.
1279 (gpgme_data_get_fd_cb): New type.
1280 (struct _gpgme_data_cbs): New member get_fd.
1281 * data.c (_gpgme_data_get_fd): New function.
1282 * data-fd.c (fd_get_fd): New function.
1283 (fd_cbs): Add fd_get_fd.
1284 * data-stream.c (stream_get_fd): New function.
1285 (stream_cbs): Add stream_get_fd.
1286 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1287 * data-user.c (user_cbs): Likewise.
1288 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1289 short-cut by passing the data descriptor directly.
1291 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
1293 * w32-io.c (build_commandline): Quote all command line arguments.
1294 * w32-glib-io.c (build_commandline): Likewise.
1296 2007-01-10 Werner Koch <wk@g10code.com>
1298 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1300 2007-01-08 Werner Koch <wk@g10code.com>
1302 * version.c (do_subsystem_inits): Do assuan init only if building
1304 * setenv.c: Include assuan-def.h only if building with Assuan
1307 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1309 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1310 * rungpg.c (gpg_set_locale): Ditto.
1312 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
1314 * gpgme.c (gpgme_set_protocol): Shut down the engine when
1315 switching protocols.
1316 (gpgme_ctx_set_engine_info): Likewise for engine info.
1317 * engine.h (_gpgme_engine_reset): New function prototype.
1318 * engine.c (_gpgme_engine_reset): New function.
1319 * engine-backend.h (struct engine_ops): New member RESET.
1320 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1321 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1322 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1323 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1325 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1326 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1327 function if available.
1328 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1330 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1332 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1333 lc_messages from prototype.
1334 (_gpgme_engine_set_locale): New prototype.
1335 * engine.c (_gpgme_engine_set_locale): New function.
1336 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1337 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1338 Remove arguments lc_messages and lc_ctype from member NEW.
1339 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1340 and lc_messages_set.
1341 (gpgsm_new): Remove lc_messages and lc_ctype
1343 (gpgsm_set_locale): New function.
1344 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1345 * rungpg.c (struct engine_gpg): Add new members lc_messages and
1347 (gpg_release): Release lc_messages and lc_ctype if set.
1348 (gpg_new): Remove lc_messages and lc_ctype arguments.
1349 (gpg_set_locale): New function.
1350 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1351 (add_arg): Implement in terms of:
1352 (add_arg_ext): New function.
1353 (start): Set lc-messages and lc-ctype arguments here.
1355 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
1357 * engine-gpgsm.c (struct engine_gpgsm): Move members
1358 input_fd_server, output_fd_server, message_fd_server to ...
1359 (iocb_data): ... here (as server_fd).
1360 (close_notify_handler): Reset tags as well.
1361 (gpgsm_new): Implement support for descriptor
1363 (fd_type_t): New type.
1364 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
1365 for unused communication channels.
1366 (gpgsm_set_fd): Rewritten to support descriptor passing. All
1367 relevant callers adjusted as well (previously of _gpgme_io_close).
1369 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
1371 * version.c: Include "assuan.h".
1372 (do_subsystem_inits): Call assuan_set_assuan_err_source.
1374 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
1376 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1377 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1378 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1380 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1381 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1382 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1383 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1385 (noinst_LTLIBRARIES): Removed.
1386 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1387 (AM_CFLAGS): New variable.
1389 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
1391 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1392 ASSUAN_CONTEXT with assuan_context_t.
1394 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
1396 * engine-gpgsm.c (gpgsm_new): Check return value of
1397 assuan_pipe_connect.
1399 * rungpg.c: Include <unistd.h>.
1400 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1401 --lc-messages. Fixes issue 734.
1403 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
1405 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1408 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
1410 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1411 _gpgme_engine_io_event().
1413 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1415 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1417 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1420 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1422 * keylist.c (keylist_colon_handler): Move debug output after
1425 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1427 * gpgme-config.in (Options): Add NETLIBS.
1428 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1429 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1431 * rungpg.c (read_status): Fix comparison disguising as an
1434 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1436 * gpgme.c (gpgme_set_locale): Remove conditional on
1437 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1439 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1441 * rungpg.c (read_status): Strip potential carriage return.
1442 * genkey.c (get_key_parameter): Skip potential carriage return.
1443 * version.c (_gpgme_get_program_version): Strip potential carriage
1446 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1449 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1451 * keylist.c (gpgme_get_key): Also clone the engine info.
1453 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1455 * gpgme-config.in (cflags_pth): Revert accidential removal of
1456 pthread support with last change.
1458 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1460 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1461 (_gpgme_io_pipe): Open pipes in binary mode.
1463 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1465 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1466 checking the version correctly even after changing the engine
1467 information. Bug reported by Stéphane Corthésy.
1469 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1471 (colon_preprocessor_t): New type.
1472 (struct engine_gpg): New member colon.preprocess_fnc.
1473 (gpg_keylist_preprocess): New function.
1474 * keylist.c (keylist_colon_handler): Allow short key IDs.
1476 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1478 * w32-io.c (create_writer): Make C->have_data a manually resetted
1480 (writer): Move code from end of if block to beginning, so it
1481 is also run the first time.
1482 (_gpgme_io_write): Move assert check after error check. Reset
1483 the is_empty event, and also do it eagerly.
1484 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1486 2006-01-26 Werner Koch <wk@g10code.com>
1488 * w32-util.c (_gpgme_get_conf_int): New.
1489 * posix-util.c (_gpgme_get_conf_int): New.
1490 * w32-io.c (get_desired_thread_priority): New.
1491 (create_reader, create_writer): Use it here.
1493 2006-01-04 Werner Koch <wk@g10code.com>
1495 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1497 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1498 statements. Disable error return for failed nonblocking call.
1500 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1502 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1505 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1507 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1508 (_gpgme_io_select): Fix debug output.
1510 2005-12-23 Werner Koch <wk@g10code.com>
1512 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1513 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1516 2005-12-20 Werner Koch <wk@g10code.com>
1518 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1519 and GPGME_STATUS_PKA_TRUST_GOOD.
1520 (struct _gpgme_signature): New field pka_trust.
1521 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1523 2005-12-06 Werner Koch <wk@g10code.com>
1525 * keylist.c (keylist_colon_handler): Store fingerprints of the
1526 subkeys. Reset the secret flag of subkeys for stub secret keys.
1527 (NR_FIELDS): Bumped up to 16
1529 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1531 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1532 engine_get_version invocation. Reported by Stéphane Corthésy.
1534 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1536 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1538 2005-11-18 Werner Koch <wk@g10code.com>
1540 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1542 (find_channel): Better use g_io_channel_win32_new_fd instead of
1543 the autodetection function g_io_channel_unix_new.
1544 (_gpgme_io_select): Rewritten. It is now a fully working select
1547 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1549 * priv-io.h (_gpgme_io_fd2str): New prototype.
1550 * posix-io.c (_gpgme_io_fd2str): New function.
1551 * w32-io.c (_gpgme_io_fd2str): New function.
1552 * rungpg.c: Use this new function.
1553 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1554 again. Two's company, three's the musketeers.
1556 * w32-glib-io.c: Rewrote the file handle code. We don't create
1557 system fds for every handle (doesn't work for inherited handles),
1558 but we create pseudo fds in a private namespace that designate a
1559 handle and potentially a giochannel.
1561 2005-11-18 Werner Koch <wk@g10code.com>
1563 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1565 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1567 * w32-glib-io.c: New file.
1568 * gpgme.def (gpgme_get_giochannel): Add symbol.
1569 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1571 (ltlib_gpgme_extra): New variable.
1572 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1573 (system_components_not_extra): New variable.
1574 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1575 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1576 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1577 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1578 [BUILD_W32_GLIB]: New variables.
1579 * gpgme-config.in (glib): New option.
1580 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1582 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1584 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1585 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1586 * posix-io.c (_gpgme_io_kill): Removed.
1587 (_gpgme_io_waitpid): Declare static.
1589 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1591 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1593 2005-10-21 Werner Koch <wk@g10code.com>
1595 * Makefile.am: Fixed cut+paste problem
1597 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1599 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1602 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1604 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1607 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1609 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1612 * gpgme.h (gpgme_free): New prototype.
1613 * data-mem.c (gpgme_free): New function.
1614 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1615 * gpgme.def: Add gpgme_free.
1617 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1619 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1621 * verify.c (parse_notation): Likewise for invocation.
1622 * conversion.c (_gpgme_decode_percent_string): Likewise to
1623 declaration. If set, do not replace '\0' characters with a
1625 * gpgme.h (struct _gpgme_key_sig): New field notations.
1626 * ops.h (_gpgme_parse_notation): New prototype.
1627 * sig-notation.c (_gpgme_parse_notation): New function.
1628 * key.c (gpgme_key_unref): Free all signature notations.
1629 * keylist.c (op_data_t): New member tmp_keysig.
1630 (finish_key): Clear OPD->tmp_keysig.
1631 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1632 * rungpg.c (gpg_keylist): Support listing signature notations.
1633 (gpg_keylist_ext): Likewise.
1635 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1637 * engine.h (_gpgme_set_engine_info): Add prototype.
1638 * engine-backend.h (struct engine_ops): Change return type of
1639 get_file_name() to const char * to silence gcc warning.
1640 * engine.c (engine_get_file_name): Change return type to const
1641 char * to silence gcc warning.
1642 (gpgme_get_engine_info): Use transitional variable to go from
1643 const char * to char * to silence gcc warning.
1644 (_gpgme_set_engine_info): Likewise.
1645 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1646 char * to silence gcc warning.
1647 (gpgsm_new): Make ARGV a pointer to const char.
1648 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1649 to char * to silence gcc warning.
1651 * gpgme.def: Add gpgme_data_set_file_name,
1652 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1653 gpgme_sig_notation_add and gpgme_sig_notation_get.
1654 * libgpgme.vers: Add gpgme_sig_notation_clear,
1655 gpgme_sig_notation_add and gpgme_sig_notation_get.
1656 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1657 * context.h (struct gpgme_context): New field sig_notations.
1658 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1660 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1661 (gpgme_sig_notation_flags_t): New type.
1662 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1663 gpgme_sig_notation_get): New prototypes.
1664 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1666 * sig-notation.c (_gpgme_sig_notation_free): New file.
1667 * verify.c (parse_notation): Use support functions.
1668 (release_op_data): Likewise.
1669 * rungpg.c (append_args_from_sig_notations): New function.
1670 (gpg_encrypt_sign, gpg_sign): Call it.
1672 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1674 * data.h (struct gpgme_data): New member file_name.
1675 * data.c (gpgme_data_set_filename): New function.
1676 (_gpgme_data_release): Free DH->filename if necessary.
1677 (gpgme_data_get_filename): New function.
1678 * rungpg.c (gpg_encrypt): Set filename option.
1679 (gpg_encrypt_sign): Likewise.
1680 (gpg_sign): Likewise.
1681 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1682 gpgme_data_get_file_name.
1684 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1687 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1689 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1690 (struct _gpgme_subkey): Likewise.
1691 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1694 2005-09-23 Werner Koch <wk@g10code.com>
1696 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1698 (create_reader, create_writer): Set thread priority higher.
1700 2005-09-19 Werner Koch <wk@g10code.com>
1702 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1703 the size of the pipe buffer.
1705 2005-09-13 Werner Koch <wk@g10code.com>
1707 * ath.c: Changes to make it work under W32.
1709 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1711 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1712 (ath_pth_src, ath_pthread_src): Removed.
1713 (w32_o_files): Replace ath-compat.o with ath.o.
1714 (libgpgme_pth_la_CFLAGS): New variable.
1715 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1716 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1717 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1718 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1719 (_ATH_COMPAT): Macro removed.
1720 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1723 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1725 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1727 2005-09-07 Werner Koch <wk@g10code.com>
1729 * w32-io.c (build_commandline): Quote argv[0].
1731 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1733 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1735 * edit.c (command_handler): Do not depend on PROCESSED being
1738 * engine.h (engine_command_handler_t): Add new argument processed.
1739 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1741 (_gpgme_passphrase_command_handler): ... this one.
1742 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1744 (_gpgme_passphrase_command_handler): ... this one.
1745 * edit.c (command_handler): Add new argument processed. Remove
1746 local variable with the same name. Always return processed as
1748 * rungpg.c (command_handler): Send a newline character if the
1751 2005-08-26 Werner Koch <wk@g10code.com>
1753 * w32-util.c (read_w32_registry_string): Updated from code used by
1754 GnuPG. This allows for expanding strings and features the
1755 implicit fallback key.
1756 (w32_shgetfolderpath, find_program_at_standard_place): New.
1757 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1758 entry, locate the programs at the standard place.
1759 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1760 we are accustomed to.
1762 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1763 semicolon is used which allows us to create files with drive
1766 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1769 2005-08-19 Werner Koch <wk@g10code.com>
1772 * versioninfo.rc.in: New.
1773 * Makefile.am: Addes support for building a W32 DLL.
1775 * ttyname_r.c (ttyname_r) [W32]: Return error.
1776 * ath-compat.c [W32]: select and co are not yet supported; return
1778 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1780 2005-08-08 Werner Koch <wk@g10code.com>
1782 * util.h (stpcpy): Renamed to ..
1783 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1784 definitions when linking statically.
1785 * stpcpy.c: Removed.
1787 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1789 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1790 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1791 (struct _gpgme_op_verify_result): Likewise.
1792 * ops.h (_gpgme_parse_plaintext): Add prototype.
1793 * op-support.c (_gpgme_parse_plaintext): New function.
1794 * decrypt.c (release_op_data): Release
1795 OPD->result.plaintext_filename.
1796 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1797 * verify.c (release_op_data): Release
1798 OPD->result.plaintext_filename.
1799 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1801 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1803 * keylist.c (gpgme_get_key): Allow key IDs.
1805 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1807 * gpgme.m4: Only call GPGME_CONFIG if found.
1809 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1811 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1813 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1814 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1816 (_gpgme_decrypt_status_handler): Fix last change.
1818 * gpgme.h (struct _gpgme_recipient): New structure.
1819 (gpgme_recipient_t): New type.
1820 (struct _gpgme_op_decrypt_result): Add member recipients.
1821 * decrypt.c (op_data_t): New member last_recipient_p.
1822 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1823 (parse_enc_to): New function.
1824 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1827 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1829 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1831 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1833 * wait.h (_gpgme_run_io_cb): New prototype.
1834 * wait.c (_gpgme_run_io_cb): New function.
1835 * wait-global.c (gpgme_wait): Call it.
1836 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1837 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1839 2005-06-02 Werner Koch <wk@g10code.com>
1841 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1842 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1843 (_gpgme_passphrase_command_handler_internal): Also act on the key
1844 "passphrase.pin.ask".
1846 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1847 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1848 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1849 GPGME_STATUS_BACKUP_KEY_CREATED.
1851 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1853 * data-user.c: Include <errno.h>.
1855 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1857 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1860 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1862 * w32-io.c (_gpgme_io_select): Fix loop increment.
1864 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1866 * data-user.c (user_release): Only call user hook if provided.
1867 (user_seek): Return EBADF if no user hook is provided.
1868 (user_read): Likewise.
1869 (user_write): Likewise.
1871 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1873 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1874 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1875 the reset, just for cleanliness, and do not sent it at all if the
1876 default is requested.
1877 * gpgme.c (gpgme_set_include_certs): Allow to use
1878 GPGME_INCLUDE_CERTS_DEFAULT.
1880 2005-04-21 Werner Koch <wk@g10code.com>
1882 * verify.c (calc_sig_summary): Set the key revoked bit.
1884 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1886 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1887 in the list, not the user-provided CTX.
1888 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1890 * wait-global.c (gpgme_wait): If no context is found, and we
1891 should not hang, set *status to 0 and return NULL.
1892 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1894 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1896 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1897 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1898 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1899 ENOSYS instead EOPNOTSUPP.
1900 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1901 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1904 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1906 * io.h: Rename to ...
1907 * priv-io.h: ... this.
1908 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1909 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1910 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1911 Change all includes of "io.h" to "priv-io.h"
1913 2005-03-09 Werner Koch <wk@g10code.com>
1915 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1916 cast away type checks.
1918 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1921 * data.h [W32]: Removed kludge for EOPNOTSUP.
1922 * data.c, data-compat.c [W32]: Explicitly test for it here.
1924 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1927 2005-03-07 Timo Schulz <twoaday@g10code.de>
1929 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1930 * ath.h: [_WIN32] Added some (dummy) types.
1931 * io.h: [_WIN32] include stdio.h.
1932 * data.h: [_WIN32] Define EOPNOTSUPP.
1933 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1934 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1936 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1938 * engine.c (_gpgme_set_engine_info): Fix assertion.
1940 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1942 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1944 * ttyname_r.c: New file.
1946 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1948 * putc_unlocked.c, funopen.c: I just claim copyright on these
1949 files and change their license to LGPL, because they are totally
1950 trivial wrapper functions.
1951 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1952 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1953 defined as a macro doing exactly the same as the function in this
1955 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1956 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1957 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1958 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1959 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1960 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1961 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1962 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1963 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1964 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1965 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1966 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1967 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1968 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1971 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1973 * libgpgme.vers (GPGME_1.1): New version.
1974 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1975 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1976 member new(). Change return type of get_file_name and get_version
1978 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1979 pointer. Do not cache result.
1980 (gpgsm_new): Add file_name and home_dir argument, and use them
1981 instead of the defaults, if set.
1982 * rungpg.c (struct engine_gpg): New member file_name.
1983 (gpg_get_version): Change return type to char pointer, and do not
1985 (gpg_release): Free gpg->file_name.
1986 (gpg_new): Take new arguments file_name and home_dir. Set the
1987 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1988 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1989 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1991 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1993 * engine.c: Include <assert.h>.
1994 (gpgme_get_engine_info): Set *INFO within the lock. Move
1995 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1996 (engine_info, engine_info_lock): ... here. New static variables.
1997 (engine_get_version): Add file_name argument to
1998 get_version invocation. Change return type to char pointer.
1999 (gpgme_engine_check_version): Rewritten to free() the return value
2000 of engine_get_version after using it.
2001 (_gpgme_engine_info_release): New function.
2002 (gpgme_get_engine_info): Rewritten.
2003 (_gpgme_engine_info_copy): New function.
2004 (_gpgme_set_engine_info): New function.
2005 (gpgme_set_engine_info): New function.
2006 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2008 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
2009 and version to char * (remove the const). New member home_dir.
2010 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
2011 gpgme_ctx_set_engine_info): New prototypes.
2012 * context.h (struct gpgme_context): New member engine_info.
2013 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
2014 (gpgme_release): Deallocate CTX->engine_info.
2015 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
2017 * op-support.c (_gpgme_op_reset): Look for correct engine info and
2018 pass it to _gpgme_engine_new.
2019 * version.c (gpgme_check_version): Adjust to
2020 _gpgme_compare_versions returning an int.
2021 (_gpgme_compare_versions): Return an int value, not a const char
2023 * ops.h (_gpgme_compare_versions): Same for prototype.
2025 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
2027 * verify.c (parse_trust): If no reason is provided, set
2028 SIG->validity_reason to 0.
2029 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
2031 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
2033 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
2034 (start): Call map_assuan_error on return value of
2037 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
2039 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
2042 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
2044 * gpgme.m4: Implement the --api-version check.
2046 * rungpg.c (read_status): Move the polling of the output data pipe
2047 to just before removing the command fd, from just before adding
2048 it. This avoids buffering problems.
2050 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
2051 read, to improve debug output.
2053 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
2055 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
2056 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
2057 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
2058 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
2060 (gpgme_keylist_mode_t): Define as unsigned int.
2061 (gpgme_key_t): Change type of keylist_mode to
2062 gpgme_keylist_mode_t.
2064 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
2066 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
2069 * data-stream.c (stream_seek): Call ftello and return the current
2071 * data.h (struct gpgme_data): Change type of data.mem.offset to
2073 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
2074 callback. If SEEK_CUR, adjust the offset by the pending buffer
2075 size. Clear pending buffer on success.
2078 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
2080 * gpgme.m4: Add copyright notice.
2082 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
2084 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
2087 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
2089 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
2091 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
2093 * key.c (_gpgme_key_append_name): Make sure tail points to the
2094 byte following the uid.
2095 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
2098 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
2100 * libgpgme.vers: Remove C-style comment, which is not supported by
2103 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2105 * gpgme-config.in (Options): Support --api-version.
2107 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
2109 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
2110 * verify.c (parse_error): Likewise.
2112 * verify.c (parse_error): Do not skip location of where token.
2114 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
2115 * verify.c (_gpgme_verify_status_handler): Add handling of
2116 GPGME_STATUS_REVKEYSIG.
2117 (parse_trust): Likewise.
2119 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
2121 * gpgme.h (struct _gpgme_decrypt_result): New fields
2122 wrong_key_usage and _unused.
2123 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
2124 character after a matched string, as in a protocol error this
2125 could skip over the trailing binary zero.
2126 Handle decrypt.keyusage error notifications.
2128 * gpgme.h (struct _gpgme_key): New member keylist_mode.
2129 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
2131 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
2133 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
2134 to unsigned int. Same for member _unused.
2136 * keylist.c (set_mainkey_trust_info): Rewritten.
2137 (set_subkey_capability): Handle 'd' (disabled).
2138 (set_mainkey_capability): Rewritten.
2140 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
2142 * gpgme.m4: Quote first argument to AC_DEFUN.
2144 2004-04-21 Werner Koch <wk@gnupg.org>
2146 * key.c (gpgme_key_unref): Allow passing NULL like free does.
2147 The rule of least surprise.
2149 2004-04-15 Werner Koch <wk@gnupg.org>
2151 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
2152 unused result.signatures items.
2154 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
2156 2004-04-08 Werner Koch <wk@gnupg.org>
2158 * verify.c (_gpgme_verify_status_handler): Ignore the error status
2159 if we can't process it.
2160 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2161 yesterday's hack. It is not any longer required.
2163 2004-04-07 Werner Koch <wk@gnupg.org>
2165 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2166 with meaningless error codes from the verify status function.
2168 2004-04-05 Werner Koch <wk@gnupg.org>
2170 * gpgme.h: Add GPGME_STATUS_NEWSIG.
2172 * verify.c (parse_error): Compare only the last part of the where
2174 (prepare_new_sig): New.
2175 (parse_new_sig): Use prepare_new_sig when required.
2176 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2178 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2179 option. Fixed pattern construction.
2180 (status_handler): Add debugging output.
2182 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
2184 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2185 isatty(). Submitted by Bernhard Herzog.
2187 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
2189 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2192 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2194 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2195 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
2197 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
2199 * gpgme-config.in: Do not emit include and lib directory for
2200 prefix "/usr" or "".
2202 2004-03-03 Werner Koch <wk@gnupg.org>
2204 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2207 2004-02-18 Werner Koch <wk@gnupg.org>
2209 * gpgme-config.in: Ignore setting of --prefix.
2211 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
2213 * rungpg.c (gpg_cancel): New function.
2214 (gpg_release): Call it here.
2215 (_gpgme_engine_ops_gpg): Add it here.
2216 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2218 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
2220 * gpgme.c (gpgme_cancel): New function.
2221 * engine-backend.h (struct engine_ops): New member cancel.
2222 * engine.h (_gpgme_engine_cancel): New prototype.
2223 * engine.c (_gpgme_engine_cancel): New function.
2224 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2225 (gpgsm_cancel): New function.
2226 (gpgsm_release): Use it.
2227 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2229 2004-02-17 Werner Koch <wk@gnupg.org>
2231 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2232 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2234 2004-02-15 Werner Koch <wk@gnupg.org>
2236 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
2237 by Adriaan de Groot.
2239 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
2241 * rungpg.c (build_argv): Use --no-comment, not --comment "".
2243 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2245 * data-stream.c (stream_seek): Likewise.
2247 2004-01-16 Werner Koch <wk@gnupg.org>
2249 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2252 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
2254 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2256 2004-01-12 Werner Koch <wk@gnupg.org>
2258 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2260 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
2262 * gpgme.h (_GPGME_D_CLASS): Revert this change.
2263 (struct _gpgme_key_sig): For C++ compilers, rename class
2264 member to _obsolete_class. Add new member sig_class.
2265 (struct _gpgme_new_signature): Same here.
2266 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2268 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2269 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
2270 * sign.c (parse_sig_created): Set SIG->sig_class.
2272 2003-12-22 Werner Koch <wk@gnupg.org>
2274 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2277 2003-11-19 Werner Koch <wk@gnupg.org>
2279 * conversion.c (_gpgme_parse_timestamp): New.
2280 (atoi_1, atoi_2, atoi_4): New.
2281 * keylist.c (parse_timestamp): Removed. Changed all callers to use
2283 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
2284 * sign.c (parse_sig_created): Ditto.
2286 2003-10-31 Werner Koch <wk@gnupg.org>
2288 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2291 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
2293 * genkey.c (get_key_parameter): Make a copy of the key parameters.
2294 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2296 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
2298 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2301 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2304 * io.h (_gpgme_io_subsystem_init): New prototype.
2305 * posix-io.c (_gpgme_io_subsystem_init): Add function.
2306 (_gpgme_io_spawn): Do not fixup signal handler here.
2307 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2309 * debug.c (debug_init): Drop const qualifier from E.
2311 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2313 (ath_connect): Make ADDR argument const.
2314 * ath-pthread.c (ath_connect): Likewise.
2315 * ath-pth.c (ath_connect): Likewise.
2316 * ath-compat.c (ath_connect): Likewise.
2317 * ath.c (ath_connect): Likewise.
2319 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2320 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2322 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2324 * util.h (_gpgme_hextobyte): Likewise for prototype.
2326 * gpgme.h: Remove trailing comma in enum.
2328 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2329 <signal.h>, <fcntl.h>, or "unistd.h".
2331 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
2333 * engine-backend.h (struct engine_ops): Add argument TYPE.
2334 * engine.c (_gpgme_engine_op_edit): Likewise.
2335 * engine.h: Likewise.
2336 * rungpg.c (gpg_edit): Likewise. Use it.
2337 * edit.c (edit_start): Likewise. Pass it on.
2338 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2339 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2341 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
2343 * gpgme.h (gpg_strerror_r): Change prototype to match
2344 gpg_strerror_r change.
2345 * error.c (gpg_strerror_r): Likewise, also update implementation.
2347 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2348 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2349 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2351 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
2353 * gpgme.h: Add prototype for gpgme_set_locale.
2355 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2356 characteristics and use that instead __inline__.
2358 * context.h (struct gpgme_context): New members lc_ctype and
2360 * gpgme.c: Include <locale.h>.
2361 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2363 (gpgme_set_locale): New function.
2364 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2366 * engine.h (_gpgme_engine_new): Likewise.
2367 * engine-gpgsm.c (gpgsm_new): Likewise.
2368 * rungpg.c (gpg_new): Likewise.
2369 * engine-backend.h (struct engine_ops): Likewise to NEW.
2370 * op-support.c (_gpgme_op_reset): Likewise to invocation of
2373 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
2375 * gpgme.h (gpgme_strerror_r): New prototype.
2376 * error.c (gpgme_strerror_r): New function.
2378 * get-env.c: New file.
2379 * util.h (_gpgme_getenv): Add prototype.
2380 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2381 * rungpg.c (build_argv): Use _gpgme_getenv.
2382 * debug.c (debug_init): Likewise.
2383 * engine-gpgsm.c (gpgsm_new): Likewise.
2384 (gpgsm_new): Use ttyname_r.
2385 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2387 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
2389 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2392 * gpgme-config.in: Rewritten.
2393 * gpgme.m4: Rewritten.
2395 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
2397 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2398 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2399 updated to have better thread support, and the Makefile.am was
2400 changed to reflect that.
2402 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2403 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2404 value of status_fnc.
2405 * rungpg.c (start): Return SAVED_ERRNO, not errno.
2407 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2409 * rungpg.c (start): Use saved_errno instead errno.
2411 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
2413 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2414 * fopencookie.c: File removed.
2416 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2418 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2420 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2422 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2423 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2424 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2425 backward compatibility.
2427 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2429 * verify.c (parse_new_sig): Fix status parsing case.
2431 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2433 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2434 Lower _UNUSED to 23 bits.
2435 (struct _gpgme_key): Likewise.
2436 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2437 (set_subkey_capability): Support 'a'.
2439 * keylist.c (gpgme_get_key): Check if there is more than one key
2440 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2442 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2444 (_gpgme_decode_percent_string): Likewise.
2445 * conversion.c (_gpgme_decode_c_string): Likewise.
2446 (_gpgme_decode_percent_string): Likewise.
2447 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2448 * signers.c (gpgme_signers_clear): Likewise.
2449 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2450 Use SEQNO instead SEQ.
2451 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2452 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2454 (gpgme_wait): Change type of I and IDX to unsigned int.
2455 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2456 and I to unsigned int.
2457 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2458 int to suppress gcc warning.
2459 (_gpgme_io_set_close_notify): Likewise.
2460 (_gpgme_io_select): Change type of I to unsigned int.
2461 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2463 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2466 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2468 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2469 and wrong expression.
2470 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2471 * encrypt.c (encrypt_sym_status_handler): Likewise.
2472 * sign.c (sign_status_handler): Likewise.
2473 * verify.c (verify_status_handler): Likewise.
2474 * decrypt.c (decrypt_status_handler): Likewise.
2476 * engine.c (gpgme_get_engine_info): Initialize NULL.
2478 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2480 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2481 GPG_ERROR_LIBS when setting the corresponding variables.
2482 Reported by Stéphane Corthésy.
2484 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2486 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2487 the beginning of the block.
2489 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2491 * data-mem.c (mem_write): Copy original buffer content.
2493 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2495 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2498 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2500 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2501 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2504 * op-support.c (_gpgme_parse_inv_userid): Rename to
2505 _gpgme_parse_inv_recp and change to new datatype.
2506 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2507 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2508 __gpgme_invalid_key. Rename field ID to KEY.
2509 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2510 (struct _gpgme_op_encrypt_result): Here, too.
2511 (struct _gpgme_op_sign_result): Likewise.
2512 * encrypt.c (struct op_data): Likewise.
2513 (release_op_data): Likewise.
2514 * sign.c (struct op_data): Likewise.
2515 (release_op_data): Likewise.
2517 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2518 (_gpgme_io_write): Likewise.
2519 (_gpgme_io_pipe): Likewise.
2520 (_gpgme_io_select): Likewise.
2522 * rungpg.c (struct engine_gpg): Remove arg_error.
2523 (add_arg): Don't set arg_error.
2524 (add_data): Likewise.
2525 (start): Don't check arg_error.
2526 (gpg_new): Check return value of add_arg.
2527 * verify.c (parse_notation): Free allocated memory at error.
2529 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2531 Everywhere: Use libgpg-error error codes.
2533 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2534 (BUILT_SOURCES): Remove errors.c.
2535 (MOSTLYCLEANFILES): Likewise.
2536 (libgpgme_la_SOURCES): Likewise. Add error.c.
2537 (errors.c): Remove target.
2538 * mkerrors: File removed.
2539 * error.c: New file.
2541 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2542 (gpgme_err_code_t, gpgme_err_source_t): New types.
2543 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2544 New static inline functions.
2545 (gpgme_strsource, gpgme_err_code_from_errno,
2546 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2547 gpgme_error_from_errno): New prototypes.
2549 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2551 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2552 (gpgme_op_export): Likewise.
2553 (gpgme_op_export_ext_start): New prototype.
2554 (gpgme_op_export_ext): Likewise.
2555 * engine.h: Likewise for _gpgme_engine_op_export and
2556 _gpgme_engine_op_export_ext.
2557 * engine-backend.h (struct engine_ops): Change second argument of
2558 prototype of export to const char *, and add reserverd int as
2559 third argument. Add prototype for export_ext.
2560 * engine.c (_gpgme_engine_op_export_ext): New function.
2561 (_gpgme_engine_op_export): Change second argument of prototype of
2562 export to const char *, and add reserverd int as third argument.
2563 * rungpg.c (gpg_export): Change second argument of prototype of
2564 export to const char *, and add reserverd int as third argument.
2565 (gpg_export_ext): New function.
2566 (gpg_keylist_ext): Break loop at error.
2567 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2568 * engine-gpgsm.c (gpgsm_export): Change second argument of
2569 prototype of export to const char *, and add reserverd int as
2571 (gpgsm_export_ext): New function.
2572 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2573 * export.c (export_start): Change second argument of prototype of
2574 export to const char *, and add reserverd int as third argument.
2575 (gpgme_op_export_start): Likewise.
2576 (export_ext_start): New function.
2577 (gpgme_op_export_ext_start): Likewise.
2578 (gpgme_op_export_ext): Likewise.
2580 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2581 (gpgme_sigsum_t): New type for anonymous enum.
2583 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2584 and return an error if RECP is not set.
2586 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2587 * user-id.c: Remove file.
2588 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2589 * gpgme.h (gpgme_encrypt_flags_t): New type.
2590 (gpgme_op_encrypt_start): Change second parameter to type
2591 gpgme_key_t[], and add third parameter.
2592 (gpgme_op_encrypt): Likewise.
2593 (gpgme_op_encrypt_sign_start): Likewise.
2594 (gpgme_op_encrypt_sign): Likewise.
2595 * encrypt.c (encrypt_start): Likewise.
2596 (gpgme_op_encrypt_start): Likewise.
2597 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2598 * encrypt-sign.c (encrypt_sign_start): Likewise.
2599 (gpgme_op_encrypt_sign_start): Likewise.
2600 (gpgme_op_encrypt_sign): Likewise.
2601 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2602 encrypt and encrypt_sign.
2603 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2604 and _gpgme_engine_op_encrypt_sign.
2605 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2606 (_gpgme_engine_op_encrypt_sign): Likewise.
2607 * rungpg.c (gpg_encrypt): Likewise.
2608 (gpg_encrypt_sign): Likewise.
2609 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2610 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2611 (set_recipients): Rewritten to use keys instead user IDs.
2612 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2614 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2615 returned to GPGME_Invalid_Key and GPGME_General_Error.
2617 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2619 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2620 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2621 * rungpg.c: Rename GpgObject to engine_gpg_t.
2622 (struct gpg_object_s): Rename to struct engine_gpg.
2624 * context.h (struct gpgme_context): Change EngineObject to
2626 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2627 (ctx_op_data_t): New type.
2628 (struct gpgme_context): Use it.
2629 * ops.h (_gpgme_op_data_lookup): Use new type name.
2630 * op-support.c (_gpgme_op_data_lookup): Likewise.
2631 * engine.c: Rename EngineObject to engine_t in the file. Also
2632 EngineStatusHandler to engine_status_handler_t,
2633 EngineCommandHandler to engine_command_handler_t and
2634 EngineColonLineHandler to engine_colon_line_handler.
2635 * rungpg.c (start): Likewise.
2636 * engine-gpgsm.c: Likewise.
2637 * engine-backend.h (struct engine_ops): Likewise
2638 * engine.h (struct engine_object_s): Rename to struct engine.
2639 (EngineObject): Rename to engine_t. Also everywhere else in the
2641 (EngineStatusHandler): Rename to engine_status_handler_t.
2642 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2643 (EngineCommandHandler): Rename to engine_command_handler_t.
2645 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2647 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2649 * gpgme.h (gpgme_recipients_t): Removed.
2650 (gpgme_recipients_new, gpgme_recipients_release,
2651 gpgme_recipients_add_name,
2652 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2653 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2654 gpgme_recipients_enum_close): Removed.
2655 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2656 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2657 gpgme_op_export): Change second argument to gpgme_user_id_t.
2658 (gpgme_user_ids_release): New prototype.
2659 (gpgme_user_ids_append): Likewise.
2660 * ops.h (_gpgme_recipients_all_valid): Remove.
2661 (_gpgme_user_ids_all_valid): Add.
2662 * context.h (struct gpgme_recipients): Removed.
2663 * user-id.c: New file.
2664 * recipient.c: Removed file.
2665 * rungpg.c (append_args_from_recipients): Change last arg to
2666 gpgme_user_id_t. Reimplement.
2667 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2668 (gpg_encrypt_sign): Likewise.
2669 (gpg_export): Likewise. Rewrite user ID list code.
2670 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2672 (_gpgme_engine_op_encrypt_sign): Likewise.
2673 (_gpgme_engine_op_export): Likewise.
2674 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2675 _gpgme_engine_op_export): Likewise.
2676 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2677 (gpgsm_encrypt): Likewise.
2678 (gpgsm_export): Likewise.
2679 * engine-backend.h (struct engine_ops): Likewise for members
2680 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2681 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2683 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2685 (gpgme_op_encrypt_start): Likewise.
2686 (gpgme_op_encrypt): Likewise.
2687 * encrypt-sign.c (encrypt_sign_start): Likewise.
2688 (gpgme_op_encrypt_sign): Likewise.
2689 (gpgme_op_encrypt_sign_start): Likewise.
2691 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2693 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2694 * import.c (parse_import_res): Add skipped_new_keys parser.
2696 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2698 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2700 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2702 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2703 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2704 (_gpgme_encrypt_status_handler): Likewise.
2705 (_gpgme_op_encrypt_init_result): Likewise.
2706 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2707 (_gpgme_decrypt_status_handler): Likewise.
2708 (_gpgme_op_decrypt_init_result): Likewise.
2709 * verify.c (gpgme_op_verify_result): Likewise.
2710 (_gpgme_verify_status_handler): Likewise.
2711 (_gpgme_op_verify_init_result): Likewise.
2712 * edit.c (edit_status_handler): Likewise.
2713 (command_handler): Likewise.
2714 (edit_start): Likewise.
2715 * genkey.c (gpgme_op_genkey_result): Likewise.
2716 (genkey_status_handler): Likewise.
2717 (genkey_start): Likewise.
2718 * import.c (gpgme_op_import_result): Likewise.
2719 (import_status_handler): Likewise.
2720 (_gpgme_op_import_start): Likewise.
2721 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2722 (_gpgme_op_trustlist_event_cb): Likewise.
2723 (gpgme_op_trustlist_start): Likewise.
2724 * keylist.c (gpgme_op_keylist_result): Likewise.
2725 (keylist_colon_handler): Likewise.
2726 (keylist_status_handler): Likewise.
2727 (_gpgme_op_keylist_event_cb): Likewise.
2728 (gpgme_op_keylist_start): Likewise.
2729 (gpgme_op_keylist_ext_start): Likewise.
2730 (gpgme_op_keylist_next): Likewise.
2731 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2732 (_gpgme_passphrase_command_handler_internal): Likewise.
2733 * sign.c (gpgme_op_sign_result): Likewise.
2734 (_gpgme_sign_status_handler): Likewise.
2735 (_gpgme_op_sign_init_result): Likewise.
2737 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2738 access to pointer type.
2740 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2742 * engine.h (EngineCommandHandler): Change last argument to int fd.
2743 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2745 (gpgme_edit_cb_t): Change last argument to int fd.
2746 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2747 * passphrase.c: Include <assert.h>.
2748 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2749 (release_op_data): Check values before calling free.
2750 (_gpgme_passphrase_status_handler): Likewise.
2751 (_gpgme_passphrase_command_handler_internal): New function.
2752 (_gpgme_passphrase_command_handler): Rewritten.
2753 * edit.c (edit_status_handler): Pass -1 as fd argument.
2754 (command_handler): Update prototype. New variable processed. Use
2755 it to store return value of
2756 _gpgme_passphrase_command_handler_internal which is now used
2757 instead _gpgme_passphrase_command_handler. Use it also to check
2758 if we should call the user's edit function. Pass fd to user's
2760 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2762 (gpg_release): Check value before calling free. Do not release
2764 (command_cb): Function removed.
2765 (command_handler): New function. Thus we don't use a data object
2766 for command handler stuff anymore, but handle it directly. This
2767 allows proper error reporting (cancel of passphrase requests, for
2768 example). Also all callbacks work via direct writes to the file
2769 descriptor (so that passphrases are not kept in insecure memory).
2770 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2771 (read_status): Check cmd.keyword before calling free. Install
2772 command_handler as the I/O callback handler with GPG as private
2775 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2777 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2778 decrypt_verify_start.
2779 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2780 (gpgme_op_decrypt_verify): Likewise.
2781 * verify.c (verify_status_handler): New function that also calls
2782 progress status handler.
2783 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2784 Rename to (verify_start).
2785 (gpgme_op_verify_start): Call verify_start.
2786 (gpgme_op_verify): Likewise.
2787 * encrypt.c (encrypt_status_handler): New function.
2788 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2789 Make static. Rename to encrypt_sym_status_handler.
2790 (encrypt_start): Set status handler to encrypt_sym_status_handler
2791 or encrypt_status_handler.
2792 * sign.c (sign_status_handler): New function.
2793 (sign_start): Set status handler to sign_status_handler.
2794 * decrypt.c (decrypt_status_handler): New function that also calls
2795 progress status handler.
2796 (decrypt_start): Set status handler to decrypt_status_handler.
2797 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2798 * decrypt-verify.c (decrypt_verify_status_handler): Call
2799 _gpgme_progress_status_handler.
2801 * conversion.c (_gpgme_decode_c_string): Add missing break
2804 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2805 to buffer to allocate.
2807 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2809 * verify.c (parse_new_sig): Fix ERRSIG case.
2810 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2812 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2814 * gpgme.h: The following types are renamed. The old name is kept
2815 as a deprecated typedef.
2816 (GpgmeCtx): Rename to gpgme_ctx_t.
2817 (GpgmeData): Rename to gpgme_data_t.
2818 (GpgmeRecipients): Rename to gpgme_recipients_t.
2819 (GpgmeError): Rename to gpgme_error_t.
2820 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2821 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2822 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2823 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2824 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2825 (GpgmeAttr): Rename to gpgme_attr_t.
2826 (GpgmeValidity): Rename to gpgme_validity_t.
2827 (GpgmeProtocol): Rename to gpgme_protocol_t.
2828 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2829 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2830 (GpgmeSubkey): Rename to gpgme_subkey_t.
2831 (GpgmeKeySig): Rename to gpgme_keysig_t.
2832 (GpgmeUserID): Rename to gpgme_user_id_t.
2833 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2834 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2835 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2836 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2837 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2838 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2839 (GpgmeEventIO): Rename to gpgme_event_io_t.
2840 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2841 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2842 (gpgme_io_cbs_t): New type.
2843 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2844 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2845 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2846 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2847 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2848 (gpgme_data_cbs_t): New type.
2849 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2850 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2851 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2852 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2853 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2854 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2855 (GpgmeSignature): Rename to gpgme_signature_t.
2856 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2857 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2858 (GpgmeImportResult): Rename to gpgme_import_result_t.
2859 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2860 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2861 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2862 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2863 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2864 GPGME_No_Passphrase.
2865 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2866 * context.h (struct gpgme_context_s): Rename to struct
2868 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2870 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2872 * keylist.c (finish_key): Clear OPD->tmp_uid.
2874 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2876 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2877 for NODATA status without signatures.
2879 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2881 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2882 (_gpgme_key_add_sig): Likewise.
2884 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2886 * context.h (struct gpgme_context_s): Remove member op_info.
2888 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2890 * gpgme.h (GpgmeError): Add deprecated values for
2891 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2893 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2895 * gpgme.h (gpgme_get_op_info): Remove prototype.
2896 * ops.h (_gpgme_set_op_info,
2897 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2898 _gpgme_data_append, _gpgme_data_append_string,
2899 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2900 _gpgme_data_append_percentstring_for_xml): Likewise.
2901 (_gpgme_progress_status_handler): Change first arg to void *.
2902 * progress.c (_gpgme_progress_status_handler): Likewise.
2903 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2904 and <sys/types.h>, but <string.h>.
2905 (_gpgme_data_append): Remove function.
2906 (_gpgme_data_append_string): Likewise.
2907 (_gpgme_data_append_for_xml): Likewise.
2908 (_gpgme_data_append_string_for_xml): Likewise.
2909 (_gpgme_data_append_percentstring_for_xml): Likewise.
2910 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2911 (_gpgme_data_release_and_return_string): Likewise.
2912 * gpgme.c (gpgme_get_op_info): Likewise.
2913 (_gpgme_set_op_info): Likewise.
2915 * gpgme.h (struct _gpgme_key): New structure.
2916 (GpgmeKey): Define using _gpgme_key.
2917 (struct _gpgme_subkey): New structure.
2918 (GpgmeSubKey): New type.
2919 (struct _gpgme_key_sig): New structure.
2920 (GpgmeKeySig): New type.
2921 (struct _gpgme_user_id): New structure.
2922 (GpgmeUserID): New type.
2923 (struct _gpgme_op_keylist_result): New structure.
2924 (GpgmeKeyListResult): New type.
2925 (gpgme_op_keylist_result): New function.
2926 (gpgme_key_get_as_xml): Remove prototype.
2927 * context.h (struct gpgme_context_s): Remove members tmp_key,
2928 tmp_uid, key_cond and key_queue.
2929 (struct key_queue_item_s): Remove structure.
2930 (struct user_id_s): Remove structure.
2931 (struct gpgme_recipients_s): Replace with simple
2933 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2934 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2935 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2936 * rungpg.c (command_cb): Return GpgmeError instead int.
2937 New variable ERR. Use it to hold return value of cmd handler.
2938 (gpg_delete): Access fingerprint of key directly.
2939 (append_args_from_signers): Likewise.
2940 (gpg_edit): Likewise.
2941 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2942 * engine-gpgsm.c: Do not include "key.h".
2943 (gpgsm_delete): Access fingerprint of key directly.
2944 (gpgsm_sign): Likewise.
2945 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2947 * key.h: File removed.
2948 * key.c: Completely reworked to use exposed GpgmeKey data types.
2949 * keylist.c: Likewise.
2950 * recipient.c: Completely reworked to use GpgmeUserID.
2952 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2954 * gpgme.h (gpgme_get_key): Remove force_update argument.
2955 * key-cache.c: File removed.
2956 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2957 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2959 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2960 _gpgme_key_cache_add.
2961 (gpgme_get_key): New function.
2962 * verify.c (gpgme_get_sig_key): Remove last argument to
2963 gpgme_get_key invocation.
2965 * gpgme.h (struct _gpgme_trust_item): New structure.
2966 (GpgmeTrustItem): New type.
2967 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2968 * context.h (struct trust_queue_item_s): Remove structure.
2969 (struct gpgme_context_s): Remove trust_queue member.
2970 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2971 * trust-item.c: New file.
2972 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2974 (struct trust_queue_item_s): Change to new type op_data_t.
2975 (trust_status_handler): Change first argument to void *.
2976 (trust_colon_handler): Likewise.
2977 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2978 (gpgme_op_trustlist_start): Use op_data_t and rework error
2980 (gpgme_op_trustlist_next): Use op_data_t.
2981 (gpgme_trust_item_release): Remove function.
2982 (gpgme_trust_item_get_string_attr): Likewise.
2983 (gpgme_trust_item_get_int_attr): Likewise.
2985 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2988 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2990 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2991 (struct gpgme_context_s): Remove member notation.
2992 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2994 * gpgme.h (struct _gpgme_sig_notation): New structure.
2995 (GpgmeSigNotation): New type.
2996 (struct _gpgme_signature): New structure.
2997 (GpgmeSignature): New type.
2998 (struct _gpgme_op_verify_result): New structure.
2999 (GpgmeVerifyResult): New type.
3000 (gpgme_op_verify_result): New prototype.
3001 (gpgme_get_notation): Remove prototype.
3002 * ops.h (_gpgme_op_verify_init_result): New prototype.
3003 (_gpgme_verify_status_handler): Change first argument to void *.
3004 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
3006 * conversion.c (_gpgme_decode_percent_string): New function.
3007 (gnupg_errors): New static global.
3008 (_gpgme_map_gnupg_error): New function.
3009 * gpgme.c (gpgme_release): Don't release CTX->notation.
3010 (gpgme_get_notation): Remove function.
3011 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
3012 _gpgme_op_verify_init_result.
3013 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
3014 do include "gpgme.h".
3015 (struct verify_result): Replace with ...
3016 (op_data_t): ... this type.
3017 (release_verify_result): Remove function.
3018 (release_op_data): New function.
3019 (is_token): Remove function.
3020 (skip_token): Remove function.
3021 (copy_token): Remove function.
3022 (gpgme_op_verify_result): New function.
3023 (calc_sig_summary): Rewritten.
3024 (finish_sig): Remove function.
3025 (parse_new_sig): New function.
3026 (parse_valid_sig): New function.
3027 (parse_notation): New function.
3028 (parse_trust): New function.
3029 (parse_error): New function.
3030 (_gpgme_verify_status_handler): Rewritten. Change first argument
3032 (_gpgme_op_verify_start): Rework error handling. Call
3033 _gpgme_op_verify_init_result.
3034 (gpgme_op_verify): Do not release or clear CTX->notation.
3035 (gpgme_get_sig_status): Rewritten.
3036 (gpgme_get_sig_string_attr): Likewise.
3037 (gpgme_get_sig_ulong_attr): Likewise.
3038 (gpgme_get_sig_key): Likewise.
3040 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
3041 (GpgmeDecryptResult): New type.
3042 (gpgme_op_decrypt_result): New prototype.
3043 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
3044 (_gpgme_decrypt_status_handler): Fix prototype.
3045 (_gpgme_decrypt_start): Remove prototype.
3046 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
3047 <string.h> and <assert.h>, "util.h" and "context.h", but
3049 (decrypt_verify_status_handler): Change first argument to void *,
3050 and rework error handling.
3051 (_gpgme_op_decrypt_verify_start): New function.
3052 (gpgme_op_decrypt_verify_start): Rewrite using
3053 _gpgme_op_decrypt_verify_start.
3054 (gpgme_op_decrypt_verify): Likewise.
3055 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
3056 (struct decrypt_result): Change to typedef op_data_t, rewritten.
3057 (is_token): Remove function.
3058 (release_op_data): New function.
3059 (skip_token): Remove function.
3060 (gpgme_op_decrypt_result): New function.
3061 (_gpgme_decrypt_status_handler): Change first argument to void *.
3062 Rework error handling.
3063 (_gpgme_decrypt_start): Rename to ...
3064 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
3065 (_gpgme_op_decrypt_init_result): New function.
3066 (gpgme_op_decrypt_start): Use decrypt_start.
3067 (gpgme_op_decrypt): Likewise.
3069 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
3071 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
3072 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
3073 (_gpgme_op_encrypt_sign_start): Rename to ...
3074 (encrypt_sign_start): ... this.
3075 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
3076 _gpgme_op_encrypt_sign_start.
3077 (gpgme_op_encrypt_sign): Likewise.
3079 * gpgme.h (GpgmeEncryptResult): New data type.
3080 (gpgme_op_encrypt_result): New prototype.
3081 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
3082 (_gpgme_op_encrypt_status_handler): Fix prototype.
3083 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3084 _gpgme_op_encrypt_init_result.
3085 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
3086 "wait.h". Include <errno.h> and "gpgme.h".
3087 (SKIP_TOKEN_OR_RETURN): Remove macro.
3088 (struct encrypt_result): Rename to ...
3089 (op_data_t): ... new data type. Rewrite for user result data.
3090 (append_xml_encinfo): Remove function.
3091 (release_op_data): New function.
3092 (gpgme_op_encrypt_result): New function.
3093 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
3094 Rewrite result parsing.
3095 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
3097 (_gpgme_op_encrypt_init_result): New function.
3098 (_gpgme_op_encrypt_start): Rename to ...
3099 (encrypt_start): ... this.
3100 (gpgme_op_encrypt_start): Use encrypt_start, not
3101 gpgme_op_encrypt_start.
3102 (gpgme_op_encrypt): Likewise.
3104 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
3105 GpgmeNewSignature, GpgmeSignResult): New data types.
3106 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
3107 gpgme_hash_algo_name): New prototypes.
3108 * gpgme.c (gpgme_pubkey_algo_name): New function.
3109 (gpgme_hash_algo_name): Likewise.
3110 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
3112 (_gpgme_op_sign_status_handler): Fix prototype.
3113 * op-support.c: Include <errno.h> and <string.h>.
3114 (_gpgme_parse_inv_userid): New function.
3115 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
3116 <assert.h> and "util.h".
3117 (SKIP_TOKEN_OR_RETURN): Remove macro.
3118 (struct sign_result): Change to op_data_t type and rework it.
3119 (release_sign_result): Rename to ...
3120 (release_op_data): ... this and rewrite it.
3121 (append_xml_info): Remove function.
3122 (gpgme_op_sign_result): New function.
3123 (parse_sig_created): New function.
3124 (_gpgme_sign_status_handler): Change first argument to void *.
3125 Rewrite the function to use the new result structure and functions.
3126 (_gpgme_op_sign_init_result): New function.
3127 (_gpgme_op_sign_start): Rename to ...
3128 (sign_start): ... this. Call _gpgme_op_sign_init_result.
3129 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
3130 (gpgme_op_sign): Likewise.
3131 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3132 _gpgme_op_sign_init_result.
3134 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
3136 (enum delete_problem): Move into function delete_status_handler.
3137 (delete_status_handler): Change first argument to void *. Parse
3138 delete problem with strtol instead atoi. Return better error
3140 (_gpgme_op_delete_start): Rename to ...
3141 (delete_start): ... this. Rework error handling.
3142 (gpgme_op_delete_start): Use delete_start instead
3143 _gpgme_op_delete_start.
3144 (gpgme_op_delete): Likewise.
3145 * gpgme.h (GpgmeDataType): Removed.
3147 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
3149 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
3150 * import.c (parse_import_res): Parse unchanged field.
3152 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
3153 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
3154 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
3155 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
3156 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3157 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3158 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3159 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3160 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3161 (struct _gpgme_import_status): New structure.
3162 (GpgmeImportStatus): New type.
3163 (struct _gpgme_op_import_result): New structure.
3164 (GpgmeImportResult): New type.
3165 (gpgme_op_import_result): New function.
3166 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3167 (struct import_result): Change to type op_data_t.
3168 (release_import_result): Rename to ...
3169 (release_op_data): ... this.
3170 (append_xml_impinfo): Function removed.
3171 (gpgme_op_import_result): New function.
3172 (parse_import): New function.
3173 (parse_import_res): Likewise.
3174 (import_status_handler): Change first argument to void *. Rewrite
3175 to use new functions.
3176 (_gpgme_op_import_start): Rework error handling.
3178 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3179 (edit_resut): Change to typedef for op_data_t.
3180 (edit_status_handler): Change first argument to void *.
3181 Rework error handling.
3182 (command_handler): Rework error handling.
3183 (_gpgme_op_edit_start): Rename to ...
3184 (edit_start): ... this. Rework error handling.
3185 (gpgme_op_edit_start): Rewrite using edit_start.
3186 (gpgme_op_edit): Likewise.
3188 * ops.h (_gpgme_passphrase_start): Remove prototype.
3189 * passphrase.c: Do not include <assert.h>, "util.h" or
3190 "debug.h", but "gpgme.h".
3191 (struct passphrase_result): Change to typedef for op_data_t.
3192 (release_passphrase_result): Rename to release_op_data.
3193 (_gpgme_passphrase_status_handler): Change first argument to void *.
3194 Use new op_data_t type.
3195 (_gpgme_passphrase_command_handler): Use new op_data_t type.
3196 (_gpgme_passphrase_start): Remove function.
3197 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
3198 not call _gpgme_passphrase_start, but install command handler.
3199 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3200 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3201 * sign.c (_gpgme_op_sign_start): Likewise.
3203 * context.h (struct gpgme_context_s): Remove member initialized,
3204 use_cms and help_data_1. Add member protocol. Make use_armor and
3205 use_textmode bit flags. Make keylist_mode, include_certs,
3206 signers_len and signers_size unsigned.
3207 * gpgme.c (gpgme_new): Initialize CTX->protocol.
3208 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
3209 (gpgme_get_protocol): Likewise.
3210 (gpgme_release): Do not release CTX->help_data_1.
3211 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3213 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3215 * data.c: Do not include <assert.h>, but "gpgme.h".
3216 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3217 it will go. Do not assert DH.
3218 (_gpgme_data_outbound_handler): Do not assert DH.
3220 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3222 (export_status_handler): Change type of first argument to void *.
3223 (_gpgme_op_export_start): Rename to ...
3224 (export_start): ... this. Rework error handling.
3225 (gpgme_op_export_start): Rewritten to use export_start instead
3226 _gpgme_op_export_start.
3227 (gpgme_op_export): Likewise.
3229 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3230 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3231 GPGME_No_Passphrase): New macros.
3233 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3235 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
3237 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3238 (GpgmeGenKeyResult): New type.
3239 (gpgme_op_genkey): Drop last argument.
3240 (gpgme_op_genkey_result): New function.
3241 * genkey.c: Do not include "util.h", but "gpgme.h".
3242 (struct genkey_result): Replace with ...
3243 (op_data_t): ... this new type.
3244 (release_genkey_result): Replace with ...
3245 (release_op_data): ... this new function.
3246 (gpgme_op_genkey_result): New function.
3247 (genkey_status_handler): Rewritten using new op_data_t type.
3248 (get_key_parameter): New function.
3249 (_gpgme_op_genkey_start): Renamed to
3250 (genkey_start): ... this and rewritten.
3251 (gpgme_op_genkey_start): Use genkey_start instead
3252 _gpgme_op_genkey_start.
3253 (gpgme_op_genkey): Rewritten. Remove FPR argument.
3255 * context.h (struct gpgme_context_s): Remove member verbosity.
3256 * gpgme.c (gpgme_new): Do not set member verbosity.
3257 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3258 * engine.c (_gpgme_engine_set_verbosity): Remove function.
3259 * engine-backend.h (struct engine_ops): Remove set_verbosity.
3260 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3261 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3262 (gpg_set_verbosity): Remove function.
3263 * decrypt.c (_gpgme_decrypt_start): Don't call
3264 _gpgme_engine_set_verbosity.
3265 * delete.c (_gpgme_op_delete_start): Likewise.
3266 * edit.c (_gpgme_op_edit_start): Likewise.
3267 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3268 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3269 * export.c (_gpgme_op_export_start): Likewise.
3270 * genkey.c (_gpgme_op_genkey_start): Likewise.
3271 * import.c (_gpgme_op_import_start): Likewise.
3272 * keylist.c (gpgme_op_keylist_start): Likewise.
3273 (gpgme_op_keylist_ext_start): Likewise.
3274 * sign.c (_gpgme_op_sign_start): Likewise.
3275 * verify.c (_gpgme_op_verify_start): Likewise.
3277 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3278 * key.c (key_cache_initialized, key_cache_size,
3279 key_cache_max_chain_length, ): Removed.
3280 (struct key_cache_item_s, key_cache_lock, key_cache,
3281 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3282 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3283 * key-cache.c: ... here. New file.
3284 * key.h (_gpgme_key_cache_init): Remove prototypes.
3285 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3287 * version.c: Do not include "key.h".
3288 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3290 * mkstatus: Strip trailing comma.
3291 * gpgme.h (GpgmeStatus): Pretty print.
3293 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3294 GPGME_Bad_Passphrase.
3295 * passphrase.c (_gpgme_passphrase_status_handler): Use
3296 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3298 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3299 GPGME_No_UserID and GPGME_Invalid_Recipient to
3300 GPGME_Invalid_UserID.
3301 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3302 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3303 GPGME_Invalid_Recipient.
3304 (_gpgme_op_encrypt_start): Likewise.
3306 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3307 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3308 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3309 * wait-global.c (gpgme_wait): Likewise.
3310 * verify.c (_gpgme_op_verify_start): Likewise.
3311 (gpgme_get_sig_status): Don't check pending flag.
3312 (gpgme_get_sig_string_attr): Likewise.
3313 (gpgme_get_sig_ulong_attr): Likewise.
3314 (gpgme_get_sig_key): Likewise.
3315 * op-support.c (_gpgme_op_reset): Likewise.
3316 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3317 (gpgme_op_trustlist_next): Don't check or clear pending flag.
3318 (gpgme_op_trustlist_end): Likewise.
3319 * sign.c (_gpgme_op_sign_start): Likewise.
3320 * context.h (struct gpgme_context_s): Remove member PENDING.
3321 * decrypt.c (_gpgme_decrypt_start): Likewise.
3322 * delete.c (_gpgme_op_delete_start): Likewise.
3323 * edit.c (_gpgme_op_edit_start): Likewise.
3324 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3325 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3326 * export.c (_gpgme_op_export_start): Likewise.
3327 * genkey.c (_gpgme_op_genkey_start): Likewise.
3328 * import.c (_gpgme_op_import_start): Likewise.
3329 * key.c (gpgme_get_key): Likewise.
3330 * keylist.c (gpgme_op_keylist_start): Likewise.
3331 (gpgme_op_keylist_ext_start): Likewise.
3332 (gpgme_op_keylist_next): Likewise.
3333 (gpgme_op_keylist_end): Likewise.
3334 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3336 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
3338 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3339 and add argument for returning the result string.
3340 (gpgme_cancel): Remove prototype.
3341 * gpgme.c (gpgme_cancel): Remove function.
3342 * context.h (struct gpgme_context_s): Remove member cancel.
3343 * passphrase.c (_gpgme_passphrase_command_handler): Call the
3344 passphrase callback in the new way.
3346 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3348 * edit.c (_gpgme_edit_status_handler): Call the progress status
3351 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
3353 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3354 I/O handlers left to ...
3355 (_gpgme_user_io_cb_handler): ... here.
3357 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3359 * trustlist.c (trustlist_colon_handler): Release ITEM if name
3360 could not be allocated.
3361 (gpgme_trust_item_release): Only release name if it is allocated.
3362 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3364 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
3366 * rungpg.c (read_status): If he status handler returns an error,
3368 (status_handler): If read_status fails, just return the error.
3370 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3372 * engine-gpgsm.c (start): Handle all errors, not only most of
3374 (xtoi_1, xtoi_2): Remove macro.
3375 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3377 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
3379 * engine-gpgsm.c (map_assuan_error): Replace
3380 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3381 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3383 * util.h (DIMof): Remove macro.
3385 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3386 _gpgme_data_unread): Prototypes removed.
3388 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3390 * types.h: File removed.
3391 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3392 * io.h (struct spawn_fd_item_s): Do not include "types.h".
3394 * context.h: Likewise.
3395 * cengine-gpgsm.h: Likewise.
3396 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
3397 for EngineStatusHandler, EngineColonLineHandler and
3398 EngineCommandHandler.
3399 (_gpgme_engine_set_status_handler): Change parameter type from
3400 GpgmeStatusHandler to EngineStatusHandler.
3401 (_gpgme_engine_set_command_handler): Change parameter type from
3402 GpgmeCommandHandler to EngineCommandHandler.
3403 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3404 GpgmeColonLineHandler to EngineColonLineHandler.
3405 * engine-backend.h: Include "engine.h" instead "types.h".
3406 (struct engine_ops): Change Gpgme*Handler parameters in members
3407 set_command_handler, set_colon_line_handler and set_status_handler
3409 * engine.c (_gpgme_engine_set_status_handler): Change parameter
3410 type from GpgmeStatusHandler to EngineStatusHandler.
3411 (_gpgme_engine_set_command_handler): Change parameter type from
3412 GpgmeCommandHandler to EngineCommandHandler.
3413 (_gpgme_engine_set_colon_line_handler): Change parameter type from
3414 GpgmeColonLineHandler to EngineColonLineHandler.
3415 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3416 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3417 member colon.fnc from GpgmeColonLineHandler to
3418 EngineColonLineHandler. Change type of member cmd.fnc from
3419 GpgmeCommandHandler to EngineCommandHandler.
3420 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3421 * rungpg.c (gpg_set_status_handler): Change parameter type from
3422 GpgmeStatusHandler to EngineStatusHandler.
3423 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3424 (assuan_simple_command): Likewise.
3425 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3426 from GpgmeColonLineHandler to EngineColonLineHandler.
3427 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3428 * rungpg.c (gpg_set_command_handler): Change parameter type from
3429 GpgmeCommandHandler to EngineCommandHandler.
3431 * engine-gpgsm.c (status_handler): Do not close status fd at end
3434 * ops.h (_gpgme_op_data_lookup): Add prototype.
3435 * op-support.c: Include <stdlib.h>.
3436 (_gpgme_op_data_lookup): New function.
3437 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3438 (struct decrypt_result_s): Rename to ...
3439 (struct decrypt_resul): ... this.
3440 (DecryptResult): New type.
3441 (_gpgme_decrypt_status_handler): Don't use
3442 test_and_allocate_result, but use _gpgme_op_data_lookup to
3443 retrieve result data object.
3444 * sign.c (_gpgme_release_sign_result): Function removed.
3445 (release_sign_result): New function.
3446 (struct sign_result_s): Rename to ...
3447 (struct sign_result): ... this.
3448 (SignResult): New type.
3449 (_gpgme_sign_status_handler): Don't use
3450 test_and_allocate_result, but use _gpgme_op_data_lookup to
3451 retrieve result data object.
3452 * encrypt.c (struct encrypt_result_s): Rename to ...
3453 (struct encrypt_result): ... this.
3454 (_gpgme_release_encrypt_result): Function removed.
3455 (release_encrypt_result): New function.
3456 (_gpgme_encrypt_status_handler): Don't use
3457 test_and_allocate_result, but use _gpgme_op_data_lookup to
3458 retrieve result data object.
3459 * verify.c (struct verify_result_s): Rename to ...
3460 (struct verify_result): ... this. Remove member next.
3461 (VerifyResult): New type.
3462 (_gpgme_release_verify_result): Function removed.
3463 (release_verify_result): New function.
3464 (finish_sig): Change first argument to type VerifyResult. Diddle
3465 the type of the op_data structure.
3466 (add_notation): Change first argument to type VerifyResult.
3467 (_gpgme_verify_status_handler): Don't use
3468 test_and_allocate_result, but use _gpgme_op_data_lookup to
3469 retrieve result data object.
3470 * passphrase.c (struct passphrase_result_s): Rename to ...
3471 (struct passphrase_result): ... this. Remove member next.
3472 (PassphraseResult): New type.
3473 (_gpgme_release_passphrase_result): Function removed.
3474 (release_passphrase_result): New function.
3475 (_gpgme_passphrase_status_handler): Don't use
3476 test_and_allocate_result, but use _gpgme_op_data_lookup to
3477 retrieve result data object.
3478 (_gpgme_passphrase_command_handler): Likewise.
3479 * keylist.c (struct keylist_result_s): Rename to ...
3480 (struct keylist_result): ... this. Remove member next.
3481 (KeylistResult): New type.
3482 (_gpgme_release_keylist_result): Function removed.
3483 (release_keylist_result): New function.
3484 (keylist_status_handler): Don't use
3485 test_and_allocate_result, but use _gpgme_op_data_lookup to
3486 retrieve result data object.
3487 * edit.c (struct edit_result_s): Rename to ...
3488 (struct edit_result): ... this. Remove member next.
3489 (EditResult): New type.
3490 (_gpgme_release_edit_result): Function removed.
3491 (release_edit_result): New function.
3492 (edit_status_handler): Don't use
3493 test_and_allocate_result, but use _gpgme_op_data_lookup to
3494 retrieve result data object.
3495 (command_handler): Likewise.
3496 * types.h (DecryptResult, SignResult, EncryptResult,
3497 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3498 KeylistResult, EditResult): Types removed.
3499 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3500 (test_and_allocate_result): Remove macro.
3501 (_gpgme_release_decrypt_result): Remove prototype.
3502 (_gpgme_decrypt_result): Remove prototype.
3503 (_gpgme_release_sign_result): Remove prototype.
3504 (_gpgme_release_encrypt_result): Remove prototype.
3505 (_gpgme_release_passphrase_result): Remove prototype.
3506 (_gpgme_release_import_result): Remove prototype.
3507 (_gpgme_release_delete_result): Remove prototype.
3508 (_gpgme_release_genkey_result): Remove prototype.
3509 (_gpgme_release_keylist_result): Remove prototype.
3510 (_gpgme_release_edit_result): Remove prototype.
3511 (_gpgme_release_verify_result): Remove prototype.
3512 * gpgme.c (_gpgme_release_result): Rewritten.
3513 * context.h (enum ctx_op_data_type): New enum.
3514 (struct ctx_op_data): New structure.
3515 (struct gpgme_context_s): Replace the member result with a member
3517 (fail_on_pending_request): Remove macro.
3518 * op-support.c (_gpgme_op_reset): Expand macro
3519 fail_on_pending_request.
3520 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3522 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3524 * types.h (EngineObject): Move typedef to ...
3525 * engine.h: ... here.
3526 * types.h (GpgObject): Move typedef to ...
3527 * rungpg.c: ... here.
3528 * types.h (GpgsmObject): Move typedef to ...
3529 * engine-gpgsm.c: ... here.
3531 * util.h (return_if_fail, return_null_if_fail,
3532 return_val_if_fail): Remove macro.
3533 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3534 * key.c (gpgme_key_ref): Likewise.
3535 * signers.c (gpgme_signers_enum): Likewise.
3536 (gpgme_signers_clear): Likewise.
3538 * engine-backend.h (struct engine_ops): Rename get_path to
3540 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3542 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3543 util.h. Other clean ups.
3544 (parse_version_number): Protect more seriously against
3546 (gpgme_get_engine_info): Move to ...
3547 * engine.c (gpgme_get_engine_info): ... here.
3548 (_gpgme_engine_get_info): Function removed.
3549 (_gpgme_engine_get_path): Make static and rename to ...
3550 (engine_get_file_name): .. this.
3551 (_gpgme_engine_get_version): Make static and rename to ...
3552 (engine_get_version): ... this.
3553 (_gpgme_engine_get_req_version): Make static and rename to ...
3554 (engine_get_req_version): ... this.
3555 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3556 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3559 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3560 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3561 (gpgme_get_protocol_name): New function.
3563 * engine-backend.h (struct engine_ops): New member
3564 get_req_version, remove member check_version.
3565 * engine.h (_gpgme_Engine_get_version): New prototype.
3566 * rungpg.c (gpg_get_req_version): New function.
3567 (gpg_check_version): Function removed.
3568 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3570 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3571 (gpgsm_check_version): Function removed.
3572 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3573 gpgsm_check_version.
3574 * engine.c: Include ops.h.
3575 (_gpgme_engine_get_req_version): New function.
3576 (gpgme_engine_check_version): Rewritten.
3577 * version.c (gpgme_get_engine_info): Rewritten.
3578 * gpgme.h (gpgme_engine_info): New structure.
3579 (GpgmeEngineInfo): New type.
3581 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3583 * types.h: Remove byte and ulong types.
3584 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3586 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3588 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3589 few more escaped characters. Be more strict about buffer size.
3590 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3591 BUF and DST to unsigned char instead byte.
3592 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3594 * debug.c (trim_spaces): Likewise.
3596 * util.h (mk_error): Remove macro.
3597 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3598 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3599 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3600 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3601 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3602 wait-private (literally everywhere): Expand the mk_error macro.
3604 * context.h (wait_on_request_or_fail): Remove macro.
3606 * context.h (gpgme_context_s): Remove member ERROR.
3607 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3608 (GpgmeCommandHandler): Change return type to GpgmeError and add
3609 new argument RESULT.
3610 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3611 (GpgmeEventIO): New event GPGME_EVENT_START.
3612 (GpgmeIdleFunc): Remove type.
3613 (gpgme_register_idle): Remove prototype.
3614 * data.c: Include <assert.h>.
3615 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3616 Return any error instead ignoring it, don't close file descriptor
3618 (_gpgme_data_outbound_handler): Likewise.
3619 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3620 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3621 Return error instead setting ctx->error. Return success at end of
3623 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3624 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3625 type to GpgmeError. Return possible errors.
3626 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3628 (delete_status_handler): Change return type to GpgmeError. Return
3629 error instead setting ctx->error. Return success at end of
3631 * edit.c: Do not include <stdio.h> and <string.h>.
3632 (_gpgme_edit_status_handler): Change type to GpgmeError,
3633 make static and rename to ...
3634 (edit_status_handler): ... this. Return error directly.
3635 (command_handler): Change return type to GpgmeError, add result
3636 argument. Return error directly.
3637 * encrypt.c (status_handler_finish): Remove function.
3638 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3639 Return error directly.
3640 (_gpgme_encrypt_sym_status_handler): Likewise.
3641 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3642 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3644 (status_handler): Change return type to GpgmeError. Diddle things
3645 around a bit to return errors directly.
3646 (start): Send start event.
3647 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3648 (export_status_handler): Change return type to GpgmeError. Don't
3650 * genkey.c: Do not include <stdio.h> and <assert.h>.
3651 (genkey_status_handler): Change return type to GpgmeError. Don't
3652 check ctx->error. Return errors directly.
3653 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3654 (_gpgme_op_event_cb): Function removed.
3655 (_gpgme_op_event_cb_user): Likewise.
3656 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3657 (import_status_handler): Change return type to GpgmeError. Don't
3659 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3660 Change return type to GpgmeError, return error directly.
3661 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3662 wait-private.c and wait-user.c
3663 * ops.h (test_and_allocate_result): Return error instead setting
3665 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3666 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3667 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3668 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3669 Change return type to GpgmeError.
3670 (_gpgme_passphease_command_handler): Change return type to
3671 GpgmeError and add new argument RESULT.
3672 * op-support.c: Use new callback functions, and change private
3673 data to ctx everywhere.
3674 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3675 type to GpgmeError, return error directly.
3676 (_gpgme_passphrase_command_handler): Change return type to
3677 GpgmeError, add result argument. Return results accordingly.
3678 * progress.c (_gpgme_progress_status_handler): Change return type
3679 to GpgmeError, return errors directly.
3680 * rungpg.c (status_handler): Change return type to GpgmeError.
3681 Return error directly.
3682 (close_notify_handler): Don't send done event.
3683 (colon_line_handler): Change return type to GpgmeError, return
3685 * rungpg.c (start): Send start event.
3686 * sign.c (_gpgme_sign_status_handler): Change return type to
3687 GpgmeError, return errors directly.
3688 * trustlist.c (trustlist_status_handler): Change return type to
3689 GpgmeError. Return 0.
3690 (trustlist_colon_handler): Change return type GpgmeError. Return
3692 * verify.c (add_notation): Change return type to GpgmeError,
3693 return errors directly.
3694 (_gpgme_verify_status_handler): Likewise.
3695 * wait.h (struct fd_table): Remove lock member.
3696 (struct wait_item_s): Moved here from wait.c.
3697 (struct tag): New structure.
3698 (_gpgme_wait_event_cb): Remove prototype.
3699 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3700 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3701 _gpgme_wait_user_event_io_cb): New prototypes.
3702 * wait.c: Don't include <stdio.h>.
3703 (ftd_global, ctx_done_list, ctx_done_list_size,
3704 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3706 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3708 (gpgme_wait): Move to file wait-global.c.
3709 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3710 member in wait item and tag.
3711 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3712 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3714 (gpgme_fd_table_init): Don't initialize FDT->lock.
3715 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3716 (_gpgme_fd_table_put): Make static and rename to ...
3717 (fd_table_put): ... this function. Don't use FDT->lock.
3718 (struct wait_item_s): Move to wait.h.
3719 * wait-global.c: New file.
3720 * wait-private.c: New file.
3721 * wait-user.c: New file.
3723 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3724 instead otrust_to_string to calculate validity.
3726 2003-01-19 Miguel Coca <mcoca@gnu.org>
3728 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3730 * w32-util.c: Include "sema.h".
3731 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3734 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3736 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3737 (gpg_start): Rename to ...
3738 (start): ... this function. Change arguments to GpgObject.
3739 (gpg_decrypt): Call start.
3740 (gpg_edit): Likewise.
3741 (gpg_encrypt): Likewise.
3742 (gpg_encrypt_sign): Likewise.
3743 (gpg_export): Likewise.
3744 (gpg_import): Likewise.
3745 (gpg_keylist): Likewise.
3746 (gpg_keylist_ext): Likewise.
3747 (gpg_trustlist): Likewise.
3748 (gpg_verify): Likewise.
3750 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3751 (gpgsm_start): Rename to ...
3752 (struct gpgsm_object_s): Remove member command.
3753 (gpgsm_release): Don't free command.
3754 (start): ... this function. Change arguments to GpgsmObject and
3756 (gpgsm_decrypt): Call start.
3757 (gpgsm_delete): Likewise.
3758 (gpgsm_encrypt): Likewise.
3759 (gpgsm_export): Likewise.
3760 (gpgsm_genkey): Likewise.
3761 (gpgsm_import): Likewise.
3762 (gpgsm_keylist): Likewise.
3763 (gpgsm_keylist_ext): Likewise.
3764 (gpgsm_verify): Likewise.
3766 * decrypt.c (_gpgme_decrypt_start): Don't call
3767 _gpgme_engine_start.
3768 * delete.c (_gpgme_op_delete_start): Likewise.
3769 * edit.c (_gpgme_op_edit_start): Likewise.
3770 * encrypt.c (_gpgme_op_encrypt_start):
3771 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3772 * export.c (_gpgme_op_export_start): Likewise.
3773 * genkey.c (_gpgme_op_genkey_start): Likewise.
3774 * import.c (_gpgme_op_import_start): Likewise.
3775 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3776 (gpgme_op_keylist_start): Likewise.
3777 * sign.c (_gpgme_op_sign_start): Likewise.
3778 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3779 * verify.c (_gpgme_op_verify_start): Likewise.
3781 * engine-backend.h (struct engine_ops): Remove member start.
3783 * engine.h (_gpgme_engine_start): Remove prototype.
3784 * engine.c (_gpgme_engine_start): Remove function.
3786 2003-01-06 Werner Koch <wk@gnupg.org>
3788 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3789 since gpg 1.3 to denote disabled keys.
3791 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3793 * data-mem.c: Include <string.h>.
3794 * engine.c: Likewise.
3796 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3798 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3800 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3802 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3804 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3806 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3807 (_gpgme_intersect_stati): Function removed.
3808 * ops.h (_gpgme_intersect_stati): Remove prototype.
3810 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3812 * libgpgme.vers: New file.
3813 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3814 (libgpgme_version_script_cmd): New variable.
3815 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3816 (libgpgme_la_DEPENDENCIES): New variable.
3818 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3820 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3821 (otrust_to_string): New function.
3822 (gpgme_key_get_as_xml): Use it.
3823 (validity_to_string): New function.
3824 (gpgme_key_get_string_attr): Beautify using above functions.
3825 (gpgme_key_get_ulong_attr): Likewise.
3827 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3829 * data-mem.c (mem_release): Fix gcc warning.
3830 * data-user.c (user_release): Likewise.
3832 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3834 * data.h (gpgme_data_release_cb): Change return type to void.
3835 (gpgme_data_read_cb): Change return type to ssize_t.
3836 * data.c (gpgme_data_read): Likewise.
3837 * data-stream.c (stream_read): Likewise.
3838 * data-fd.c (fd_read): Likewise.
3839 * data-mem.c (mem_read): Likewise.
3840 (mem_release): Change return type to void.
3841 * data-user.c (user_read): Change return type to ssize_t.
3842 (user_release): Change return type to void.
3843 * data-compat.c (old_user_read): Change return type to ssize_t.
3844 * gpgme.h (GpgmeDataReadCb): Likewise.
3845 (gpgme_data_read): Likewise.
3846 (GpgmeDataSeekCb): Change return type to off_t.
3848 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3850 * gpgme.h: Add prototype for gpgme_get_key.
3851 * key.c (gpgme_get_key): New function.
3852 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3854 * gpgme.h: Add prototypes for new interfaces
3855 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3856 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3857 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3858 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3859 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3861 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3862 Use that to determine if allocation is desired or not.
3863 * util.h: Adjust prototype of _gpgme_decode_c_string.
3864 * keylist.c (keylist_colon_handler): Adjust caller of
3865 _gpgme_decode_c_string.
3867 * key.h (struct gpgme_key_s): New member last_uid.
3868 * key.c (_gpgme_key_append_name): Rewritten using
3869 _gpgme_decode_c_string and the last_uid pointer.
3870 (my_isdigit): Macro removed.
3871 (ALLOC_CHUNK): Likewise.
3872 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3874 * context.h (struct user_id_s): New member last_certsig.
3875 * key.h: Add prototype for _gpgme_key_add_certsig.
3876 * key.c (_gpgme_key_add_certsig): New function.
3877 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3878 (parse_user_id): Change first argument to SRC, add new arguments
3879 NAME, EMAIL and COMMENT. Change code to use these arguments
3880 instead going through UID. Move function before
3882 (parse_x509_user_id): Likewise.
3883 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3884 and parse_user_id invocation.
3885 (one_certsig_as_xml): New function.
3886 (one_uid_as_xml): Print signatures.
3887 * context.h (struct gpgme_context_s): New member TMP_UID.
3888 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3891 * key.c (get_certsig): New function.
3892 (gpgme_key_sig_get_string_attr): Likewise.
3893 (gpgme_key_sig_get_ulong_attr): Likewise.
3895 * keylist.c: Include <ctype.h>.
3896 (my_isdigit): Macro removed.
3897 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3898 (set_userid_flags): Likewise.
3899 (set_subkey_trust_info): Likewise.
3900 (set_ownertrust): Likewise.
3901 (finish_key): Move function up a bit and remove prototype.
3903 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3905 (gpg_keylist_ext): Implement signature listing mode.
3907 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3909 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3910 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3912 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3913 CloseHandle for parent fds.
3915 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3917 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3919 2002-11-22 Werner Koch <wk@gnupg.org>
3921 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3922 setlocale before doing another setlocale.
3924 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3926 * decrypt.c: Some beautyfication.
3928 * verify.c (_gpgme_verify_status_handler): Treat
3929 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3930 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3932 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3934 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3935 (struct genkey_result_s): Add new member FPR.
3936 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3937 (genkey_status_handler): Extract the fingerprint from the status
3939 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3941 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3943 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3945 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3946 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3947 <twoaday@freakmail.de>.
3948 (gpg_keylist_ext): Likewise.
3950 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3952 * import.c (append_xml_impinfo): Use
3953 _gpgme_data_append_string_for_xml rather than
3954 _gpgme_data_append_string for the field content.
3955 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3957 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3959 * rungpg.h, engine-gpgsm.h: File removed.
3960 * engine-backend.h: New file.
3961 * Makefile.am (gpgsm_components): New variable, set depending on
3962 automake conditional HAVE_GPGSM.
3963 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3964 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3965 (status-table.h): Depend on gpgme.h, not rungpg.h.
3966 * conversion.c: Include <stdlib.h>.
3967 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3968 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3969 functions and remove all function prototypes.
3970 (_gpgme_gpgsm_get_version): Make static and rename to ...
3971 (gpgsm_get_version): ... this.
3972 (_gpgme_gpgsm_check_version): Make static and rename to ...
3973 (gpgsm_check_version): ... this.
3974 (_gpgme_gpgsm_new): Make static. Change argument type from
3975 GpgsmObject * to void **. Call gpgsm_release instead
3976 _gpgme_gpgsm_release.
3977 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3978 (gpgsm_check_decrypt): ... this.
3979 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3980 (gpgsm_check_delete): ... this.
3981 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3982 (gpgsm_check_set_recipients): ... this.
3983 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3984 (gpgsm_encrypt): ... this.
3985 (_gpgme_gpgsm_op_export): Make static and rename to ...
3986 (gpgsm_export): ... this.
3987 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3988 (gpgsm_genkey): ... this.
3989 (_gpgme_gpgsm_op_import): Make static and rename to ...
3990 (gpgsm_import): ... this.
3991 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3992 (gpgsm_keylist): ... this.
3993 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3994 (gpgsm_keylist_ext): ... this.
3995 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3996 (gpgsm_sign): ... this.
3997 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3998 (gpgsm_trustlist): ... this.
3999 (_gpgme_gpgsm_op_verify): Make static and rename to ...
4000 (gpgsm_verify): ... this.
4001 (gpgsm_status_handler): Rename to ...
4002 (status_handler): ... this.
4003 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
4004 (gpgsm_set_status_handler): ... this.
4005 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
4006 (gpgsm_set_colon_line_handler): ... this.
4007 (_gpgme_gpgsm_add_io_cb): Rename to ...
4008 (add_io_cb): ... this.
4009 (_gpgme_gpgsm_start): Make static and rename to ...
4010 (gpgsm_start): ... this.
4011 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
4012 (gpgsm_set_io_cb): ... this.
4013 (_gpgme_gpgsm_io_event): Make static and rename to ...
4014 (gpgsm_io_event): ... this.
4015 (struct _gpgme_engine_ops_gpgsm): New variable.
4016 [!ENABLE_GPGSM]: Removed.
4017 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
4018 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
4019 <stdlib.h> and "engine-backend.h".
4020 (struct engine_object_s): Rewritten.
4021 (engine_ops): New variable.
4022 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
4023 _gpgme_engine_check_version, _gpgme_engine_new,
4024 _gpgme_engine_release, _gpgme_engine_set_verbosity,
4025 _gpgme_engine_set_status_handler,
4026 _gpgme_engine_set_command_handler,
4027 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
4028 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
4029 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
4030 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
4031 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
4032 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
4033 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
4034 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
4035 _gpgme_engine_io_event): Reimplement.
4036 * engine.h: Fix a few comments and a variable name in a prototype.
4037 * ops.h: Do not include "rungpg.h".
4038 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
4040 * recipient.c: Likewise.
4041 * signers.c: Likewise.
4042 * version.c: Likewise.
4043 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
4044 functions and remove prototypes.
4045 (_gpgme_gpg_get_version): Make static and rename to ...
4046 (gpg_get_version): ... this.
4047 (_gpgme_gpg_check_version): Make static and rename to ...
4048 (gpg_check_version): ... this.
4049 (_gpgme_gpg_new): Make static. Change argument type from
4050 GpgObject * to void **. Call gpg_release instead
4052 (_gpgme_gpg_op_decrypt): Make static and rename to ...
4053 (gpg_check_decrypt): ... this.
4054 (_gpgme_gpg_op_delete): Make static and rename to ...
4055 (gpg_check_delete): ... this.
4056 (_gpgme_gpg_set_recipients): Make static and rename to ...
4057 (gpg_check_set_recipients): ... this.
4058 (_gpgme_gpg_op_encrypt): Make static and rename to ...
4059 (gpg_encrypt): ... this.
4060 (_gpgme_gpg_op_export): Make static and rename to ...
4061 (gpg_export): ... this.
4062 (_gpgme_gpg_op_genkey): Make static and rename to ...
4063 (gpg_genkey): ... this.
4064 (_gpgme_gpg_op_import): Make static and rename to ...
4065 (gpg_import): ... this.
4066 (_gpgme_gpg_op_keylist): Make static and rename to ...
4067 (gpg_keylist): ... this.
4068 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
4069 (gpg_keylist_ext): ... this.
4070 (_gpgme_gpg_op_sign): Make static and rename to ...
4071 (gpg_sign): ... this.
4072 (_gpgme_gpg_op_trustlist): Make static and rename to ...
4073 (gpg_trustlist): ... this.
4074 (_gpgme_gpg_op_verify): Make static and rename to ...
4075 (gpg_verify): ... this.
4076 (gpg_status_handler): Rename to ...
4077 (status_handler): ... this.
4078 (_gpgme_gpg_set_status_handler): Make static and rename to ...
4079 (gpg_set_status_handler): ... this.
4080 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
4081 (gpg_set_colon_line_handler): ... this.
4082 (gpgme_gpg_add_io_cb): Rename to ...
4083 (add_io_cb): ... this.
4084 (_gpgme_gpg_start): Make static and rename to ...
4085 (gpg_start): ... this.
4086 (_gpgme_gpg_set_io_cb): Make static and rename to ...
4087 (gpg_set_io_cb): ... this.
4088 (_gpgme_gpg_io_event): Make static and rename to ...
4089 (gpg_io_event): ... this.
4090 (struct _gpgme_engine_ops_gpg): New variable.
4092 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
4094 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
4097 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
4099 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
4100 data-compat.c: New file. Really check them in this time, completes
4103 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
4105 * types.h (GpgmeStatusHandler): ... here.
4106 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
4108 * types.h (GpgmeColonLineHandler): ... here.
4109 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
4111 * types.h (GpgmeCommandHandler): ... here.
4112 * engine.h: Don't include "rungpg.h".
4113 (_gpgme_engine_set_status_handler): Change type of
4114 argument from GpgStatusHandler to GpgmeStatusHandler.
4115 (_gpgme_engine_set_colon_line_handler): Change type of
4116 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4117 (_gpgme_engine_set_command_handler): Change type of
4118 argument from GpgCommandHandler to GpgmeCommandHandler.
4119 * engine-gpgsm.h: Don't include "rungpg.h".
4120 (_gpgme_gpgsm_set_status_handler): Change type of
4121 argument from GpgStatusHandler to GpgmeStatusHandler.
4122 (_gpgme_gpgsm_set_colon_line_handler): Change type of
4123 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4124 * engine-gpgsm.c: Do not include "rungpg.h".
4125 (struct gpgsm_object_s): Change type of
4126 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
4127 GpgmeColonLineHandler.
4128 (gpgsm_assuan_simple_command): Change type of argument from
4129 GpgStatusHandler to GpgmeStatusHandler.
4130 (_gpgme_gpgsm_set_status_handler): Likewise.
4131 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
4132 GpgColonLineHandler to GpgmeColonLineHandler.
4133 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
4134 argument from GpgStatusHandler to GpgmeStatusHandler.
4135 (_gpgme_gpg_set_colon_line_handler): Change type of
4136 argument from GpgColonLineHandler to GpgmeColonLineHandler.
4137 (_gpgme_gpg_set_command_handler): Change type of
4138 argument from GpgCommandHandler to GpgmeCommandHandler.
4139 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
4140 GpgmeStatusHandler. Change type of colon.fnc to
4141 GpgmeColonLineHandler. Change type of cmd.fnc to
4142 GpgmeCommandLineHandler.
4143 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
4145 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
4146 to GpgmeColonLineHandler.
4147 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
4148 GpgmeCommandHandler.
4149 * engine.c (_gpgme_engine_set_status_handler): Change type of
4150 argument FNC to GpgmeStatusHandler.
4151 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
4152 to GpgmeColonLineHandler.
4153 (_gpgme_engine_set_command_handler): Change type of argument FNC to
4154 GpgmeCommandHandler.
4156 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4157 * rungpg.c (struct gpg_object_s): Remove PM.
4158 (pipemode_cb): Prototype removed.
4159 (add_pm_data): Function removed.
4160 (_gpgme_gpg_enable_pipemode): Likewise.
4161 (pipemode_copy): Likewise.
4162 (pipemode_cb): Likewise.
4163 (add_arg): Don't check for pipemode.
4164 (add_data): Likewise.
4165 (_gpgme_gpg_set_status_handler): Likewise.
4166 (_gpgme_gpg_set_colon_line_handler): Likewise.
4167 (_gpgme_gpg_set_command_handler): Likewise.
4168 (_gpgme_gpg_spawn): Likewise.
4169 (_gpgme_gpg_spawn): Don't set PM.active.
4170 (_gpgme_gpg_op_verify): Remove pipemode case.
4171 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4173 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4174 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4175 _gpgme_gpg_set_simple_line_handler): Prototype removed.
4176 (_gpgme_gpg_set_verbosity): New prototype.
4177 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4178 (add_data): ... this.
4179 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4180 (_gpgme_gpg_set_command_handler): Likewise.
4181 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4182 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4183 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4184 _gpgme_gpg_op_verify): Likewise.
4185 (_gpgme_gpg_add_pm_data): Rename to ...
4186 (add_pm_data): ... this.
4187 (_gpgme_gpg_op_verify): Call add_pm_data, not
4188 _gpgme_gpg_add_pm_data.
4189 (_gpgme_gpg_add_arg): Make static and rename to ...
4190 (add_arg): ... this.
4191 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4192 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4193 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4194 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4195 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4196 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4197 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4198 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4200 (_gpgme_gpg_set_verbosity): New function.
4201 (struct gpg_object_s): Remove member simple from colon.
4202 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4203 (_gpgme_gpg_set_simple_line_handler): Removed function.
4204 (read_colon_line): Don't check the GPG->colon.simple.
4205 * engine.c (_gpgme_engine_set_verbosity): Call
4206 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4208 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4210 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4211 _gpgme_strdup, _gpgme_free): Remove prototypes.
4212 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4214 * util.c: File removed.
4215 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4216 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4217 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4218 xtrycalloc, free instead of xfree.
4219 (_gpgme_data_append_percentstring_for_xml): Likewise.
4220 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4221 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4222 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4223 _gpgme_data_get_as_string): Likewise.
4224 * debug.c (debug_init): Likewise.
4225 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4226 * delete.c (_gpgme_release_delete_result): Likewise.
4227 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4229 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4230 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4231 _gpgme_engine_release): Likewise.
4232 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4233 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4234 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4235 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4236 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4237 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4238 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4239 * genkey.c (_gpgme_release_genkey_result): Likewise.
4240 * gpgme.c (gpgme_new, gpgme_release): Likewise.
4241 * import.c (_gpgme_release_import_result): Likewise.
4242 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4243 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4244 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4245 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4246 * ops.h (test_and_allocate_result): Likewise.
4247 * passphrase.c (_gpgme_release_passphrase_result,
4248 _gpgme_passphrase_status_handler,
4249 _gpgme_passphrase_command_handler): Likewise.
4250 * progress.c (_gpgme_progress_status_handler): Likewise.
4251 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4252 gpgme_recipients_add_name_with_validity): Likewise.
4253 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4254 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4255 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4256 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4258 * sign.c (_gpgme_release_sign_result): Likewise.
4259 * signers.c (_gpgme_signers_add): Likewise.
4260 * trustlist.c (trust_item_new, trustlist_colon_handler,
4261 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4262 gpgme_trustitem_release): Likewise.
4263 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4264 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4266 * w32-io.c (create_reader, create_writer, destroy_reader,
4267 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4268 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4269 * w32-util.c (read_w32_registry_string): Likewise.
4270 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4271 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4272 * data-compat.c: Include <stdlib.h>.
4274 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
4276 New data object component:
4278 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4279 GpgmeDataReleaseCb): New types.
4280 (struct GpgmeDataCbs): New structure.
4281 (gpgme_data_read): Changed prototype to match that of read() closely.
4282 (gpgme_data_write): Similar for write().
4283 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4284 gpgme_data_new_from_stream): New prototypes.
4285 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4287 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4288 data-stream.c, data-mem.c, data-user.c and data-compat.c.
4289 * data.c: Reimplemented from scratch.
4290 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4291 data-user.c): New file.
4292 * context.h (struct gpgme_data_s): Removed.
4293 * conversion.c: Include <errno.h> and <sys/types.h>.
4294 (_gpgme_data_append): New function.
4295 * data.c (_gpgme_data_append_string): Move to ...
4296 * conversion.c (_gpgme_data_append_string): ... here.
4297 * data.c (_gpgme_data_append_for_xml): Move to ...
4298 * conversion.c (_gpgme_data_append_for_xml): ... here.
4299 * data.c (_gpgme_data_append_string_for_xml): Move to ...
4300 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4301 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4302 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4304 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4306 * types.h (GpgmeDataMode): Type removed.
4308 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4309 * edit.c (_gpgme_op_edit_start): Likewise.
4310 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4311 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4312 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4313 * export.c (_gpgme_op_export_start): Likewise.
4314 * genkey.c (_gpgme_op_genkey_start): Likewise.
4315 * import.c (_gpgme_op_import_start): Likewise.
4316 * sign.c (_gpgme_op_sign_start): Likewise.
4317 * verify.c (_gpgme_op_verify_start): Likewise.
4319 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4320 no recipient if no data was returned.
4321 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4322 no recipient if no data was returned.
4323 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4324 no recipient if no data was returned.
4326 * engine.c (_gpgme_engine_op_verify): Add new argument to
4327 differentiate detached from normal signatures.
4328 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4329 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
4330 mode of data argument.
4331 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4332 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4333 (gpgme_op_verify): Likewise for prototype.
4334 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4335 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4336 * verify.c (_gpgme_op_verify_start): Likewise.
4337 (gpgme_op_verify_start): Likewise.
4338 (gpgme_op_verify): Likewise.
4340 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4341 direction of data object.
4342 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
4343 determine direction of data object.
4344 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4345 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4346 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4347 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4348 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4350 (build_argv): Use new member INBOUND to determine direction of
4351 file descriptor. Don't check the data type.
4352 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4354 * gpgme.c (gpgme_get_op_info): Don't call
4355 _gpgme_data_get_as_string if CTX->op_info is NULL.
4357 * version.c (gpgme_check_engine): Function removed.
4359 2002-09-30 Werner Koch <wk@gnupg.org>
4361 * keylist.c (keylist_colon_handler): Take care when printing a
4362 NULL with the DEBUG.
4364 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4365 (gpgsm_status_handler): Run the colon function to indicate EOF.
4366 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4368 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
4370 * conversion.c (_gpgme_hextobyte): Prevent superfluous
4371 multiplication with base. Reported by Stéphane Corthésy.
4373 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4374 operation type in invocation of _gpgme_op_reset.
4376 2002-09-20 Werner Koch <wk@gnupg.org>
4378 * ath.c: Include sys/time.h if sys/select.h is not available.
4380 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
4382 * keylist.c (keylist_status_handler): Do not call finish_key() here.
4383 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4385 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
4387 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4388 into gpgme unconditionally.
4389 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4391 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4393 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4395 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4397 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4398 (_gpgme_debug_end): Likewise.
4399 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4401 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4403 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4405 * version.c (_gpgme_get_program_version): Likewise.
4406 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4408 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
4410 * conversion.c (_gpgme_decode_c_string): Set DESTP before
4413 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4415 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4416 _gpgme_op_edit so its prototype is known early on.
4418 * conversion.c: New file.
4419 * util.h: Add prototypes for _gpgme_decode_c_string and
4421 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4423 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4424 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4425 calls to _gpgme_hextobyte.
4426 (hash_key): Likewise.
4428 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4430 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4431 _gpgme_engine_release, as this will reset pending to zero in the
4432 event done callback on cancelled operations.
4434 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4436 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4437 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4439 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4440 * rungpg.h: Also to prototype.
4441 * engine.c (_gpgme_engine_op_edit): Likewise.
4442 * engine.h: Likewise.
4443 * edit.c (_gpgme_op_edit_start): Likewise.
4445 2002-08-29 Werner Koch <wk@gnupg.org>
4447 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4449 * vasprintf.c (va_copy): Define macro if not yet defined.
4451 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4453 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4454 CTX->result.passphrase->no_passphrase if passphrase is given (good
4455 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4457 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4459 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4460 Return 0 on success, -1 on error.
4461 * version.c (_gpgme_get_program_version): Don't wait for the child.
4462 * engine.c (_gpgme_engine_housecleaning): Function removed.
4463 (do_reaping): Likewise.
4464 (_gpgme_engine_add_child_to_reap_list): Likewise.
4465 (struct reap_s): Removed.
4466 (reap_list): Likewise.
4467 (reap_list_lock): Likewise.
4468 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4469 _gpgme_engine_housecleaning and
4470 _gpgme_engine_add_child_to_reap_list.
4471 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4472 (struct gpg_object_s): Remove PID member.
4473 (_gpgme_gpg_new): Don't initialize GPG->pid.
4474 (_gpgme_gpg_spawn): Don't set GPG->pid.
4475 * wait.c (run_idle): Removed.
4476 (gpgme_wait): Run idle_function directly.
4478 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4480 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4481 variables encrypt_info and encrypt_info_len.
4482 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4483 * posix-sema.c (sema_fatal): Remove function.
4484 All these reported by Stéphane Corthésy.
4486 2002-08-23 Werner Koch <wk@gnupg.org>
4488 * gpgme-config.in: Made --prefix work for --libs.
4490 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4492 * ath.h: Update list of symbols that get a prefix: Rename the
4493 ath_mutex_*_available symbols to ath_*_available.
4495 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4497 * stpcpy.c: New file from gnulib.
4498 * Makefile.am (assuan_libobjs): Remove jnlib.
4500 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4502 * gpgme.h: Add prototype for gpgme_op_import_ext.
4503 * import.c (struct import_result_s): New member `nr_considered'.
4504 Rename `any_imported' to `nr_imported'.
4505 (import_status_handler): Increment nr_imported. Set nr_considered
4507 (gpgme_op_import_ext): New function.
4508 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4510 2002-08-20 Werner Koch <wk@gnupg.org>
4512 * gpgme.m4: Replaced with a new and faster version. This does not
4513 anymore try to build test programs. If we really need test
4514 programs, we should add an option to gpgme-config to do so.
4516 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4518 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4520 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4521 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4524 2002-08-19 Werner Koch <wk@gnupg.org>
4526 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4527 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4528 (_gpgme_decrypt_status_handler): Create an operation info.
4530 2002-08-14 Werner Koch <wk@gnupg.org>
4532 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4533 * key.c (gpgme_key_release): Release it. We need to add more code
4535 (_gpgme_key_append_name): Use memset to intialize the struct.
4536 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4537 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4540 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4541 information about the key type (PGP or X.509).
4542 (gpgme_key_get_ulong_attr): Likewise.
4544 * keylist.c (keylist_colon_handler): Include 1 in the check for
4545 valid algorithms so that RSA is usable. Store the issuer name and
4546 serial number also for "crs" records. Parse the expire date for
4548 (set_userid_flags): Put them onto the last appended key.
4550 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4552 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4554 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4556 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4559 The following changes make it possible to flush an inbound data
4560 pipe before invoking a command handler:
4562 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4563 _gpgme_io_select. Set timeout of 0 if this is set.
4564 * w32-io.c (_gpgme_io_select): Likewise.
4565 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4566 * wait.c (do_select): Add new argument to _gpgme_io_select
4568 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4569 linked_data to prototype.
4570 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4571 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4572 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4573 argument to _gpgme_engine_set_command_handler.
4574 * rungpg.c (struct gpg_object_s): New members linked_data and
4576 (_gpgme_gpg_new): Initialize those new members.
4577 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4578 (build_argv): Handle linked_data in the same hack as cb_data.
4579 (read_status): If linked_data is in use, flush the pipe before
4580 activating the command handler.
4581 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4584 The next changes export the status codes to the user:
4586 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4587 all STATUS_ with GPGME_.
4588 * delete.c (delete_status_handler): Likewise.
4589 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4590 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4591 (_gpgme_encrypt_sym_status_handler): Likewise.
4592 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4593 * engine-gpgsm.c (parse_status): Likewise.
4594 (gpgsm_status_handler): Likewise.
4595 (gpgsm_set_recipients): Likewise.
4596 * export.c (export_status_handler): Likewise.
4597 * genkey.c (genkey_status_handler): Likewise.
4598 * import.c (append_xml_impinfo): Likewise.
4599 (import_status_handler): Likewise.
4600 * keylist.c (keylist_status_handler): Likewise.
4601 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4602 (command_handler): Likewise.
4603 * progress.c (_gpgme_progress_status_handler): Likewise.
4604 * sign.c (_gpgme_sign_status_handler): Likewise.
4605 * trustlist.c (trustlist_status_handler): Likewise.
4606 * verify.c (_gpgme_verify_status_handler): Likewise.
4607 * gpgme.h (GpgmeEditCb): New type.
4608 * rungpg.h (GpgStatusCode): Rename and move to ...
4609 * gpgme.h (GpgmeStatusCode): ... this and here.
4610 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4611 * mkstatus: Prefix STATUS with GPGME_.
4612 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4614 * ops.h (_gpgme_verify_status_handler,
4615 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4616 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4617 _gpgme_progress_status_handler): Likewise.
4618 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4620 These changes add an edit operation to GPGME:
4622 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4623 ops.h: Add prototype for _gpgme_release_edit_result and
4624 _gpgme_passphrase_command_handler.
4625 * passphrase.c (command_handler): Make non-static and rename to ...
4626 (_gpgme_passphrase_command_handler): ... this.
4627 (_gpgme_passphrase_start): Use new name for command handler.
4628 * types.h: Add EditResult type.
4629 * gpgme.c (_gpgme_release_result): Release EDIT result.
4631 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4632 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4634 (assuan_libobjs): New variable, set this instead
4636 * engine.h (_gpgme_engine_op_edit): New prototype.
4637 * engine.c (_gpgme_engine_op_edit): New function.
4638 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4639 * rungpg.c (_gpgme_gpg_op_edit): New function.
4641 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4643 * delete.c (delete_problem): New case ambigious specification.
4644 (delete_status_handler): Handle new case (poorly).
4646 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4648 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4650 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4652 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4654 * vasprintf.c: Update to more recent libiberty version.
4655 * debug.h: Replace #elsif with #elif.
4657 Submitted by Stéphane Corthésy:
4658 * util.h (vasprintf): Correct prototype.
4659 * encrypt-sign.c: Include <stddef.h>.
4660 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4662 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4663 * ath-pth.c: Likewise.
4665 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4667 * wait.c (fdt_global): Make static. Reported by Stéphane
4670 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4671 patterns. Reported by Stéphane Corthésy.
4673 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4674 by Stéphane Corthésy.
4675 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4676 silence gcc warning.
4678 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4680 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4682 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4684 * gpgme.c (_gpgme_op_event_cb_user): New function.
4685 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4686 for private or user event loop. Use new user event callback
4688 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4689 * keylist.c (gpgme_op_keylist_start): Likewise.
4691 * rungpg.c (_gpgme_gpg_io_event): New function.
4692 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4693 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4694 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4695 * engine.c (_gpgme_engine_io_event): New function.
4696 * engine.h (_gpgme_engine_io_event): New prototype.
4697 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4698 the real work for the default IO callback routines to ...
4699 (_gpgme_op_keylist_event_cb): ... here. New function.
4700 * trustlist.c (trustlist_colon_handler): Signal
4701 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4702 (_gpgme_op_trustlist_event_cb): ... here. New function.
4703 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4704 and _gpgme_op_trustlist_event_cb when appropriate.
4705 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4706 (_gpgme_op_trustlist_event_cb): Likewise.
4707 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4708 user provided event handler directly.
4709 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4711 * wait.c (_gpgme_add_io_cb): Likewise.
4712 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4713 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4714 argument. Fix up error handling.
4715 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4716 new argument, fix up error handling.
4718 2002-07-03 Werner Koch <wk@gnupg.org>
4720 * encrypt.c (status_handler_finish): New.
4721 (_gpgme_encrypt_status_handler): Moved some code out to the new
4722 function and call this function also in case we get into the
4723 status handler with an error which might happen due to a kludge in
4726 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4728 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4729 table (eg use synchronous mode).
4731 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4733 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4734 prototype and change return type to GpgmeError.
4735 (_gpgme_wait_one): New prototype.
4736 * wait.c (gpgme_wait): Replace with the meat from
4737 _gpgme_wait_on_condition here, and remove the support for
4739 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4740 and change return type to GpgmeError. Replace with meat from
4741 _gpgme_wait_one and add support for conditions.
4742 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4744 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4745 table (eg use synchronous mode).
4746 (gpgme_op_keylist_next): Remove HANG argument from
4747 _gpgme_wait_on_condition. Check its return value.
4748 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4749 table (eg use synchronous mode).
4750 (gpgme_op_trustlist_next): Remove HANG argument from
4751 _gpgme_wait_on_condition. Check its return value.
4753 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4755 * gpgme.h: Fix documentation of key attribute retrieval functions.
4757 2002-06-26 Werner Koch <wk@gnupg.org>
4759 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4761 * import.c (append_xml_impinfo): Kludge to print fingerprint
4762 instead of keyid for use with gpgsm.
4763 (import_status_handler): Set a flag to know whether any import
4765 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4767 2002-06-25 Werner Koch <wk@gnupg.org>
4769 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4772 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4774 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4776 * export.c (gpgme_op_export): If no data was returned, return
4777 GPGME_No_Recipients.
4779 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4781 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4783 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4785 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4786 (parse_status): New function.
4787 (gpgsm_status_handler): Use parse_status.
4788 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4789 STATUS_FNC_VALUE and process status messages.
4790 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4791 (gpgsm_set_fd): Likewise.
4792 (_gpgme_gpgsm_op_keylist): Likewise.
4793 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4794 (_gpgme_gpgsm_op_sign): Likewise.
4796 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4798 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4800 2002-06-20 Werner Koch <wk@gnupg.org>
4802 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4804 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4806 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4807 (gpgme_get_sig_string_attr): Hack to return info on the key
4808 usage. Does now make use of the former RESERVED argument which
4809 has been renamed to WHATIDX.
4810 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4812 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4814 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4815 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4816 error, or there are no more file descriptors to wait on.
4817 (_gpgme_wait_on_condition): Ignore return value from do_select for
4820 2002-06-13 Werner Koch <wk@gnupg.org>
4822 * verify.c (gpgme_op_verify): Make sure that we never access an
4823 unitialized result structure.
4825 2002-06-12 Werner Koch <wk@gnupg.org>
4827 * keylist.c (struct keylist_result_s): New.
4828 (_gpgme_release_keylist_result): Release it here
4829 (keylist_status_handler): Handle truncated.
4830 (append_xml_keylistinfo): New.
4831 * gpgme.c (_gpgme_release_result): and use it here.
4832 * types.h: Declare the new type here.
4833 * context.h (struct gpgme_context_s): Use it here.
4835 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4837 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4838 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4839 use our own close notification mechanism without interfering with
4842 2002-06-11 Werner Koch <wk@gnupg.org>
4844 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4846 * verify.c (calc_sig_summary): New.
4847 (gpgme_get_sig_ulong_attr): And use it here.
4849 2002-06-10 Werner Koch <wk@gnupg.org>
4851 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4852 * verify.c (is_token, copy_token): New.
4853 (_gpgme_verify_status_handler): Use copy_token, handle the new
4854 ERROR status and store the errorcode used withgpgsm and trust
4856 * gpgme.h: New attribute ERRTOK.
4857 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4858 (gpgme_get_sig_string_attr): Use it here to return the last error.
4860 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4862 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4863 close notification for the status fd to ...
4864 (_gpgme_gpgsm_new): ... here.
4865 * wait.h: Include "sema.h". Remove prototypes of
4866 _gpgme_remove_proc_from_wait_queue and
4867 _gpgme_register_pipe_handler. Add prototypes of
4868 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4869 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4871 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4872 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4873 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4874 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4875 proc_s. Replace struct wait_item_s.
4876 (_gpgme_fd_table_init): New function.
4877 (_gpgme_fd_table_deinit): Likewise.
4878 (_gpgme_fd_table_put): Likewise.
4879 (set_process_done): Remove function.
4880 (do_select): Take argument FDT. Use that to decide which fds to
4882 (_gpgme_remove_proc_from_wait_queue): Remove function.
4883 (_gpgme_wait_event_cb): New function.
4884 (_gpgme_wait_one): Likewise.
4885 (_gpgme_register_pipe_hanldler): Remove function.
4886 (_gpgme_add_io_cb): New function.
4887 (_gpgme_remove_io_cb): Likewise.
4888 (_gpgme_freeze_fd): Remove function.
4889 (_gpgme_thaw_fd): Remove function.
4890 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4891 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4892 IDX to CMD. Add new member IO_CBS.
4893 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4894 For each I/O callback, check if it should be unregistered. If all
4895 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4896 Remove member RUNNING.
4897 (_gpgme_gpg_new): Initialize new members.
4898 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4899 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4900 (build_argv): Store away the index instead the file descriptor for
4902 (_gpgme_gpg_add_io_cb): New function.
4903 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4905 (gpg_status_handler): Change return type to void, remove PID
4906 argument, close filedescriptor if EOF or error occurs.
4907 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4908 Use IO_CBS->remove instead _gpgme_freeze_fd.
4909 (gpg_colon_line_handler): Change return type to void, remove PID
4910 argument, close filedescriptor if EOF or error occurs.
4911 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4912 (_gpgme_gpg_set_io_cbs): New function.
4913 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4914 _gpgme_gpg_set_io_cbs.
4915 * gpgme.h (GpgmeIOCb): New type.
4916 (GpgmeRegisterIOCb): Likewise.
4917 (GpgmeRemoveIOCb): Likewise.
4918 (GpgmeEventIO): Likewise.
4919 (GpgmeEventIOCb): Likewise.
4920 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4921 (gpgme_set_op_io_cbs): New prototype.
4922 (gpgme_get_op_io_cbs): Likewise.
4923 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4924 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4925 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4926 prototype. Add prototype for _gpgme_op_reset.
4927 Add synchronous argument to _gpgme_decrypt_start prototype.
4928 * io.h: Beautification.
4929 * gpgme.c: Include "wait.h".
4930 (gpgme_new): Initialize FDT.
4931 (gpgme_set_io_cbs): New function.
4932 (gpgme_get_io_cbs): Likewise.
4933 (_gpgme_op_event_cb): Likewise.
4934 * data.c (_gpgme_data_inbound_handler): Change return type to
4935 void. Drop PID argument. Close FD on error and EOF.
4936 (write_mem_data): Don't close FD here ...
4937 (write_cb_data): ... or here ...
4938 (_gpgme_data_outbound_handler): ... but here. Change return type
4939 to void. Drop PID argument.
4940 * context.h: Include "wait.h".
4941 (struct gpgme_context_s): New members FDT and IO_CBS.
4942 * op-support.c: New file.
4943 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4944 * ops.h: Add prototype for _gpgme_op_reset().
4945 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4947 (gpgme_op_decrypt_start): Add synchronous argument.
4948 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4950 * delete.c (gpgme_op_delete_start): Rename to ...
4951 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4952 Use _gpgme_op_reset. Make function static.
4953 (gpgme_op_delete_start): Just a wrapper around
4954 _gpgme_op_delete_start now.
4955 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4957 * encrypt.c: Include "wait.h".
4958 (ggpgme_op_encrypt_start): Rename to ...
4959 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4960 Use _gpgme_op_reset. Make function static.
4961 (gpgme_op_encrypt_start): Just a wrapper around
4962 _gpgme_op_encrypt_start now.
4963 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4965 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4966 (_gpgme_op_encrypt_sign_start): ... this. New argument
4967 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4968 (gpgme_op_encrypt_sign_start): Just a wrapper around
4969 _gpgme_op_encrypt_sign_start now.
4970 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4971 _gpgme_wait_one instead gpgme_wait.
4972 * export.c (gpgme_op_export_start): Rename to ...
4973 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4974 Use _gpgme_op_reset. Make function static.
4975 (gpgme_op_export_start): Just a wrapper around
4976 _gpgme_op_export_start now.
4977 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4979 * genkey.c (gpgme_op_genkey_start): Rename to ...
4980 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4981 Use _gpgme_op_reset. Make function static.
4982 (gpgme_op_genkey_start): Just a wrapper around
4983 _gpgme_op_genkey_start now.
4984 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4986 * import.c (gpgme_op_import_start): Rename to ...
4987 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4988 Use _gpgme_op_reset. Make function static.
4989 (gpgme_op_import_start): Just a wrapper around
4990 _gpgme_op_import_start now.
4991 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4993 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4994 (gpgme_op_keylist_ext_start): Likewise.
4995 * sign.c (gpgme_op_sign_start): Rename to ...
4996 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4997 _gpgme_op_reset. Make function static.
4998 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
5000 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
5002 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
5003 * verify.c (gpgme_op_verify_start): Rename to ...
5004 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
5005 Use _gpgme_op_reset. Make function static.
5006 (gpgme_op_verify_start): Just a wrapper around
5007 _gpgme_op_verify_start now.
5008 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
5010 * engine-gpgsm.c (iocb_data_t): New type.
5011 (struct gpgsm_object_s): New member status_cb. Replace input_fd
5012 and input_data with input_cb. Replace output_fd and output_data
5013 with output_cb. Replace message_fd and message_data with
5014 message_cb. New member io_cbs.
5015 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
5017 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
5018 callback, check if it should be unregistered. If all callbacks
5019 have been unregistered, trigger GPGME_EVENT_DONE.
5020 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
5021 names to close the file descriptors.
5022 (_gpgme_gpgsm_op_decrypt): Use new variable names,
5023 (_gpgme_gpgsm_op_encrypt): Likewise.
5024 (_gpgme_gpgsm_op_genkey): Likewise.
5025 (_gpgme_gpgsm_op_import): Likewise.
5026 (_gpgme_gpgsm_op_keylist): Likewise.
5027 (_gpgme_gpgsm_op_keylist_ext): Likewise.
5028 (_gpgme_gpgsm_op_sign): Likewise.
5029 (_gpgme_gpgsm_op_verify): Likewise.
5030 (gpgsm_status_handler): Drop argument PID. Change return type to
5031 void. Close status pipe before returning because of EOF or error.
5032 (_gpgme_gpgsm_add_io_cb): New function.
5033 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
5035 (_gpgme_gpgsm_set_io_cbs): New function.
5036 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
5037 * engine.c (_gpgme_engine_set_io_cbs): New function.
5038 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
5040 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
5042 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5044 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
5046 * key.c: Include <ctype.h>.
5047 (_gpgme_key_append_name): Skip one more char when
5048 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
5049 Handle hexadecimal encodings. Also reported by Marc. Thanks!
5051 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5053 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
5054 * posix-sema.c: Use that prefix here.
5055 * posix-io.c: Include "ath.h".
5056 (_gpgme_io_read): Use _gpgme_ath_read instead read.
5057 (_gpgme_io_write): Use _gpgme_ath_write instead write.
5058 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
5059 (_gpgme_io_select): Use _gpgme_ath_select instead select.
5061 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
5063 * Makefile.am (ath_components): New variable.
5064 (ath_components_pthread): Likewise.
5065 (ath_components_pth): Likewise.
5066 (system_components): Add ath_componentes.
5070 * ath-pthread.c: Likewise.
5071 * ath-pth.c: Likewise.
5072 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
5074 * mutex.h: Remove file.
5076 2002-05-30 Werner Koch <wk@gnupg.org>
5078 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
5079 an issuer with IDX > 0. We don't support altIssuerNames for now.
5081 2002-05-22 Werner Koch <wk@gnupg.org>
5083 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
5084 missing variable definition. Oohh - Marcus was faster.
5086 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
5088 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
5090 2002-05-21 Werner Koch <wk@gnupg.org>
5092 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
5093 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
5095 2002-05-10 Werner Koch <wk@gnupg.org>
5097 * key.h (gpgme_key_s): Add OTRUST.
5098 * keylist.c (set_ownertrust): New.
5099 (keylist_colon_handler): Get the ownertrust value
5100 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
5103 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5105 * w32-util.c: New static variable GET_PATH_LOCK.
5106 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
5107 Take lock while determining path.
5108 (_gpgme_get_gpgsm_path): Likewise.
5109 * version.c (do_subsystem_inits): Set DONE to 1 after
5111 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
5112 while determining engine info.
5113 * rungpg.c (_gpgme_gpg_get_version): New variable
5114 GPG_VERSION_LOCK. Take the lock while determining the program
5116 * posix-io.c: Include "sema.h".
5117 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
5118 while fixing the signals.
5119 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
5120 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
5122 (capabilities_to_string): Make STRINGS very const.
5123 (_gpgme_key_cache_add): Lock the key cache.
5124 (_gpgme_key_cache_get): Likewise.
5125 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
5126 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
5127 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
5129 * engine.c (_gpgme_engine_get_info): New variable
5130 ENGINE_INFO_LOCK. Take lock while determining engine info.
5131 * engine-gpgsm.c: Include "sema.h".
5132 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
5133 lock while getting program version.
5135 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
5137 * debug.h: New file.
5138 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
5139 * util.h: Removed all prototypes and declarations related to
5140 debugging. Include "debug.h".
5142 * debug.c (debug_level): Comment variable and remove superfluous
5145 (_gpgme_debug_enabled): Function removed.
5146 (struct debug_control_s): Definition removed.
5147 (_gpgme_debug_level): Function removed.
5148 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
5149 pritnf-style format specification and a variable number of
5151 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
5152 starts out with "%s" for simplicity.
5153 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
5154 TEXT argument anymore.
5156 * posix-io.c (_gpgme_io_select): Use new level argument for
5157 DEBUG_BEGIN instead explicit if construct.
5159 * debug.c (debug_init): Remove superfluous zero initializer,
5160 remove volatile flag of INITIALIZED. Do not use the
5161 double-checked locking algorithm, it is fundamentally flawed and
5162 will empty your fridge (on a more serious note, despite the
5163 volatile flag it doesn't give you the guarantee you would expect,
5164 for example on a DEC Alpha or an SMP machine. The volatile only
5165 serializes accesses to the volatile variable, but not to the other
5168 2002-05-03 Werner Koch <wk@gnupg.org>
5170 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5171 output to /dev/null.
5173 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5174 * gpgme.c (gpgme_get_protocol): New.
5176 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5177 (gpgme_data_read): Ditto.
5179 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5180 lines so that a claim can be made without looking up the key.
5181 (gpgme_get_sig_string_attr): New.
5182 (gpgme_get_sig_ulong_attr): New.
5184 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5186 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5187 list to align with the status.h file from gnupg.
5189 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5190 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5191 these new status codes. Store the expiration time
5193 2002-04-27 Werner Koch <wk@gnupg.org>
5195 * gpgme.h (GpgmeData_Encoding): New.
5196 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5197 * engine-gpgsm.c (map_input_enc): New. Use it in all local
5198 functions where the INPUT command gets send.
5200 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
5202 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5203 descriptor only when we don't need it anymore. Close the message
5204 descriptor if we don't need it.
5206 2002-04-26 Werner Koch <wk@gnupg.org>
5208 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5210 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5212 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5213 GPG->cmd.cb_data, not xfree.
5215 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
5217 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5218 ttytype, lc_ctype and lc_messages options in the server.
5220 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
5222 * engine-gpgsm.c (map_assuan_error): Add new error codes.
5224 2002-04-23 Werner Koch <wk@gnupg.org>
5226 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5227 can_certify to return the requested values.
5229 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
5231 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5233 (gpgme_get_passphrase_cb): Likewise.
5235 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
5237 * gpgme.c (gpgme_get_passphrase_cb): New function.
5238 (gpgme_get_progress_cb): New function.
5239 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5240 gpgme_get_progress_cb.
5242 2002-03-28 Werner Koch <wk@gnupg.org>
5244 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5245 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5246 * keylist.c (keylist_colon_handler): Store them.
5247 * key.c (gpgme_key_release): Free them.
5248 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5250 2002-03-26 Werner Koch <wk@gnupg.org>
5252 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5254 2002-03-21 Werner Koch <wk@gnupg.org>
5256 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5259 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
5261 * Makefile.am (system_components): New variable, set depending on
5263 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
5264 * syshdr.h: File removed.
5266 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
5267 * posix-sema.c: Likewise.
5268 * posix-util.c: Likewise.
5270 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5271 * w32-sema.c: Likewise.
5272 * w32-util.c: Likewise.
5274 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5275 * posix-sema.c: Likewise.
5276 * w32-io.c: Include `io.h', do not include `syshdr.h'
5277 * w32-sema.c: Likewise.
5278 * w32-util.c: Likewise.
5279 * data.c: Do not include `syshdr.h'.
5281 * wait.h: Code cleanup.
5283 * mutex.h: New file.
5284 * posix-sema.c: Implement.
5286 2002-03-08 Werner Koch <wk@gnupg.org>
5288 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
5290 2002-03-07 Werner Koch <wk@gnupg.org>
5292 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5294 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
5296 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5297 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5298 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5299 as status handler and run _gpgme_passphrase_start.
5300 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5302 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5305 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5307 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5309 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5310 error No_Passphrase if only a bad passphrase was provided.
5312 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5314 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5315 GPGME_DATA_MODE_IN, construct a command line that stores the
5317 * verify.c (gpgme_op_verify_start): Accept TEXT being
5318 uninitialized, and in this case interpret SIG as a normal or
5319 cleartext signature and TEXT as a return data object.
5320 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5322 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
5324 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5327 2002-02-28 Werner Koch <wk@gnupg.org>
5329 * key.h (subkey_s): New member expires_at.
5330 * keylist.c (keylist_colon_handler): Set it here
5331 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5333 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5335 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5336 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5337 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5338 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5339 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5340 * engine.c (_gpgme_engine_op_keylist_ext): New function.
5341 * keylist.c (gpgme_op_keylist_ext_start): New function.
5343 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
5345 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5346 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5347 rename no_recipients to no_valid_recipients.
5348 (_gpgme_encrypt_status_handler): Include error for invalid
5350 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5351 argument to GpgsmObject. Use that to report back the status about
5354 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
5356 * verify.c (_gpgme_verify_status_handler): Fix the last change.
5358 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5360 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5361 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5362 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5363 (_gpgme_gpg_op_sign): Use that new function.
5364 (_gpgme_gpg_op_encrypt_sign): New function.
5365 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5366 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5367 (gpgme_op_encrypt_sign): Likewise.
5368 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5369 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5370 (_gpgme_sign_status_handler): Add prototype.
5371 * sign.c (sign_status_handler): Rename to ...
5372 (_gpgme_sign_status_handler): ... this and make non-static.
5373 * encrypt.c (encrypt_status_handler): Rename to ...
5374 (_gpgme_encrypt_status_handler): ... this and make non-static.
5375 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5376 * sign.c (gpgme_op_sign_start): Likewise.
5378 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5380 * verify.c (_gpgme_verify_status_handler): Parse the args line to
5381 see if the problem is due to a missing key, and report that back
5384 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
5386 * context.h (struct gpgme_context_s): New member include_certs.
5387 * gpgme.h (gpgme_set_include_certs): Add prototype.
5388 (gpgme_get_include_certs): Likewise.
5389 * gpgme.c (gpgme_set_include_certs): New function.
5390 (gpgme_get_include_certs): Likewise.
5391 (gpgme_new): Set include_certs to 1 (the default).
5392 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5393 and pass it to _gpgme_gpgsm_op_sign.
5394 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5395 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5396 include_certs and handle it.
5397 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5398 * sign.c (gpgme_op_sign_start): Add new argument to
5399 _gpgme_engine_op_sign call.
5401 2002-02-14 Werner Koch <wk@gnupg.org>
5403 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5405 2002-02-13 Werner Koch <wk@gnupg.org>
5407 * vasprintf.c, fopencookie.c: Add replacement functions.
5408 * util.h: Add prototypes for them.
5410 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5412 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5413 reach the end of the function.
5415 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5417 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5418 (gpgme_op_genkey_start): Skip newlines after opening tag.
5420 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5422 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5424 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5425 set, and pass them down to the crypto engine.
5426 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5427 * engine.h: Likewise.
5428 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5429 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5431 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5433 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5436 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5438 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5440 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5443 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5445 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5446 status of the returned context is returned.
5447 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5448 aware of cancelled processes, and to allow to use gpgme_wait with
5449 CTX being NULL (as documented in the source).
5450 (struct proc_s): New member REPORTED.
5451 * gpgme.h: Fix prototype.
5452 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5453 * sign.c (gpgme_op_sign): Likewise.
5454 * import.c (gpgme_op_import): Likewise.
5455 * genkey.c (gpgme_op_genkey): Likewise.
5456 * export.c (gpgme_op_export): Likewise.
5457 * encrypt.c (gpgme_op_encrypt): Likewise.
5458 * delete.c (gpgme_op_delete): Likewise.
5459 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5461 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5463 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5465 (gpgme_get_keylist_mode): New function.
5466 (gpgme_new): Set the default for keylist_mode member of CTX.
5468 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5469 (gpgme_get_keylist_mode): New prototype.
5470 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5471 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5473 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5475 This patch has gotten a bit large... mmh. The main thing that
5476 happens here is that error values are now not determined in the
5477 operation function after gpgme_wait completed, but in the status
5478 handler when EOF is received. It should always be the case that
5479 either an error is flagged or EOF is received, so that after a
5480 gpgme_wait you should never have the situation that no error is
5481 flagged and EOF is not received. One problem is that the engine
5482 status handlers don't have access to the context, a horrible
5483 kludge works around this for now. All errors that happen during a
5484 pending operation should be catched and reported in ctx->error,
5485 including out-of-core and cancellation. This rounds up neatly a
5486 couple of loose ends, and makes it possible to pass up any errors
5487 in the communication with the backend as well. As a bonus, there
5488 will be a function to access gpgme->wait, so that the operations
5489 can truly be implemented with their _start function.
5491 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5492 error back to the context.
5493 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5495 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5497 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5498 to a value indication that.
5500 * verify.c (add_notation): Set error, not out_of_core.
5501 (finish_sig): Likewise.
5502 (gpgme_op_verify_start): Don't clear out_of_core.
5503 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5504 (gpgme_op_verify): And don't do it here.
5506 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5507 (gpgme_op_trustlist_start): Don't clear out_of_core.
5508 (gpgme_op_trustlist_next): Check error, not out_of_core.
5509 (gpgme_op_trustlist_end): Likewise.
5511 * ops.h (test_and_allocate_result): New macro.
5512 (_gpgme_passphrase_result): Remove prototype.
5513 * delete.c (gpgme_op_delete): Return error from context.
5514 (delete_status_handler): Use macro test_and_allocate_result.
5515 Perform error checking at EOF.
5516 (gpgme_op_delete_start): Release result.
5517 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5518 test_and_allocate_result, and perform error checking here.
5519 (_gpgme_passphrase_result): Function removed.
5520 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5521 (gpgme_op_sign): Just return the error value from the context.
5522 (sign_status_handler): Only progress if no error is set yet. If
5523 we process an EOF, set the resulting error value (if any).
5524 * decrypt.c (_gpgme_decrypt_result): Function removed.
5525 (create_result_struct): Function removed.
5526 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5527 caclulate error on EOF, do not progress with errors.
5528 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5529 (gpgme_op_decrypt): Just return the error value from the context.
5530 * encrypt.c (encrypt_status_handler): Perform the error checking
5532 (gpgme_op_encrypt_start): Do not clear out_of_core.
5533 * export.c (export_status_handler): Return if error is set in context.
5534 (gpgme_op_export_start): Release result.
5535 (gpgme_op_export): Return error from context.
5536 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5538 * genkey.c (genkey_status_handler): Use macro
5539 test_and_allocate_result. Perform error checking at EOF.
5540 (gpgme_op_genkey): Just return the error from context.
5541 * import.c (gpgme_op_import): Return the error from context.
5542 (import_status_handler): Use macro test_and_allocate_result.
5543 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5544 (gpgme_op_keylist_next): Return error of context.
5545 (keylist_colon_handler): Set error instead out_of_code.
5546 (finish_key): Likewise.
5548 * context.h: Remove member out_of_core, add member error.
5549 * gpgme.c (_gpgme_release_result): Clear error flag.
5551 * engine.h (_gpgme_engine_get_error): New prototype.
5552 * engine.c (_gpgme_engine_get_error): New function.
5553 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5555 * engine-gpgsm.c (map_assuan_error): New function.
5556 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5557 use the new function to map error values.
5558 (gpgsm_set_fd): Change return type tp GpgmeError.
5559 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5560 (gpgsm_set_recipients): Likewise. Change type of return value
5561 equivalently. Adjust error values.
5562 (_gpgme_gpgsm_op_import): Likewise.
5563 (_gpgme_gpgsm_op_sign): Likewise.
5564 (struct gpgsm_object_s): New member error.
5565 (gpgsm_status_handler): Set error if error occurs. Determine
5566 error number from ERR line received. If assuan_read_line fails,
5567 terminate the connection.
5569 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5571 * Makefile.am (MOSTLYCLEANFILES): New variable.
5573 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5575 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5576 connection to the server.
5578 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5580 * rungpg.h: Add STATUS_KEY_CREATED.
5582 * progress.c: New file.
5583 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5585 * genkey.c (genkey_status_handler): Use
5586 _gpgme_progress_status_handler. Add check for status.
5587 (struct genkey_result_s): New structure.
5588 (_gpgme_release_genkey_result): New function.
5589 (gpgme_op_genkey): Check for error.
5590 * gpgme.c (_gpgme_release_result): Call
5591 _gpgme_release_genkey_result.
5592 * ops.h (_gpgme_release_genkey_result): Add prototype.
5593 * types.h (GenKeyResult): New type.
5594 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5596 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5598 * gpgme.c (_gpgme_release_result): Call
5599 _gpgme_release_delete_result.
5600 * ops.h (_gpgme_release_delete_result): Add prototype.
5601 * types.h (DeleteResult): New type.
5602 * context.h (gpgme_context_s): Add DeleteResult to member result.
5604 * delete.c (enum delete_problem): New type.
5605 (struct delete_result_s): New structure.
5606 (_gpgme_release_delete_result): New function.
5607 (delete_status_handler): Implement more status codes.
5608 (gpgme_op_delete): Return error on failure.
5610 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5612 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5614 * import.c (struct import_result_s): New structure.
5615 (_gpgme_release_import_result): New function.
5616 (append_xml_impinfo): Likewise.
5617 (import_status_handler): Implement.
5618 * gpgme.c (_gpgme_release_result): Add call to
5619 _gpgme_release_import_result.
5620 * ops.h (_gpgme_release_import_result): Add prototype.
5621 * types.h (ImportResult): New type.
5622 * context.h (gpgme_context_s): Add ImportResult to member result.
5624 * encrypt.c (gpgme_op_encrypt): Code clean up.
5626 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5628 * gpgme.h: Add lots of comment and fix the formatting. Add
5629 gpgme_trustlist_end prototype.
5631 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5633 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5634 gpgme_register_idle to return and accept this type.
5635 * wait.c (gpgme_register_idle): Fix type.
5636 Save and return old value of idle_function.
5638 2002-01-29 Werner Koch <wk@gnupg.org>
5640 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5642 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5645 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5647 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5648 not assuan_pipe_disconnect.
5650 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5651 jnlib (needed by assuan) statically into libgpgme. Linking a
5652 static library into a shared library this way is not portable.
5654 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5656 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5659 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5661 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5662 from off_t to size_t.
5663 * gpgme.h: Likewise.
5665 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5667 * wait.c (_gpgme_wait_on_condition): If the process finished,
5668 reset the pending flag. Also if the operation was cancelled.
5670 (struct proc_s): Rename READY to DONE.
5671 (wait_item_s): Likewise.
5672 (set_process_ready): Rename to ...
5673 (set_process_done): ... this.
5674 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5675 instead set_process_ready.
5676 (_gpgme_wait_on_condition): Likewise.
5677 (do_select): Rename READY to DONE.
5679 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5680 * sign.c (gpgme_op_sign): Likewise.
5681 * import.c (gpgme_op_import): Likewise.
5682 * genkey.c (gpgme_op_genkey): Likewise.
5683 * export.c (gpgme_op_export): Likewise.
5684 * encrypt.c (gpgme_op_encrypt): Likewise.
5685 * delete.c (gpgme_op_delete): Likewise.
5686 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5687 * decrypt.c (gpgme_op_decrypt): Likewise.
5689 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5691 * export.c: Cleanup.
5693 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5695 * trustlist.c: Various source clean ups.
5696 (my_isdigit): Removed.
5697 (gpgme_op_trustlist_end): New function.
5699 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5701 * gpgme.c: Various source clean ups, like renaming C to CTX where
5703 (gpgme_new): Clear R_CTX before starting the work.
5704 (my_isdigit): Removed.
5705 (my_isxdigit): Likewise.
5707 * data.c: Various source clean ups.
5708 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5709 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5710 (gpgme_data_new_from_file): Loop over fread while EINTR.
5711 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5712 be zero. Loop over fread while EINTR.
5714 (my_isdigit): Removed.
5715 (my_isxdigit): Likewise.
5717 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5719 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5720 Pipe_Error where appropriate.
5722 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5724 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5726 * version.c (get_engine_info): Remove prototype.
5728 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5730 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5731 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5733 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5735 * keylist.c (gpgme_op_keylist_end): New function.
5736 * gpgme.h (gpgme_op_keylist_end): New prototype.
5738 * engine.h (gpgme_engine_check_version): Move prototype to ...
5739 * gpgme.h (gpgme_engine_check_version): ... here.
5741 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5743 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5745 * version.c (gpgme_get_engine_info): Reimplemented.
5746 (gpgme_check_engine): Reimplemented.
5747 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5749 * engine.c: Include `io.h'.
5750 (gpgme_engine_get_info): New function.
5751 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5754 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5756 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5757 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5758 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5760 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5761 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5762 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5763 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5764 own function by call to _gpgme_engine_add_child_to_reap_list().
5766 * wait.c: Include `engine.h'.
5767 (run_idle): Call _gpgme_engine_housecleaning(), not
5768 _gpgme_gpg_housecleaning().
5770 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5772 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5773 Initialize the next field of the uid structure.
5774 (gpgme_key_get_as_xml): Do not list last uid first.
5776 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5778 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5779 function [!ENABLE_GPGSM].
5781 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5783 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5784 message_data, not SIG.
5785 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5787 * sign.c (sign_status_handler): Call
5788 _gpgme_passphrase_status_handler early.
5790 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5792 * engine-gpgsm.c: Revert last change.
5794 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5796 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5797 handler when ending this operation, otherwise the wait function
5800 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5802 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5803 (_gpgme_gpgsm_new): Initialize some more members.
5804 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5805 (gpgsm_status_handler): Rework the inline-data processing.
5807 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5809 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5810 list that are not dup'ed, for those the close-on-exec flag is set
5812 * version.c (_gpgme_get_program_version): Remove first entry in
5813 CFD, as the close-on-exec flag is now set for this fd.
5815 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5817 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5818 option to `ENCRYPT'.
5819 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5822 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5824 * engine-gpgsm.c (close_notify_handler): New function.
5825 (_gpgme_gpgsm_new): Manage the file descriptors a
5826 bit differently. Do not set close-on-exec flags.
5827 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5828 to -1, this is done by the close handler.
5829 (_gpgme_gpgsm_op_encrypt): Likewise.
5830 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5831 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5832 (_gpgme_gpgsm_op_sign): Likewise.
5833 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5835 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5836 non-inherited file descriptor index of the pipe.
5838 2001-12-13 Werner Koch <wk@gnupg.org>
5840 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5841 (gpgsm_status_handler): Pass datalines to a colon handler
5842 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5845 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5847 (gpgsm_assuan_simple_command): Removed underscore from
5849 (_gpgme_gpgsm_start): Ditto.
5850 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5851 function by the new assuan_read_line. Removed the use of the
5853 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5854 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5857 * keylist.c (keylist_colon_handler): Handle "crt" records
5858 * key.h (gpgme_key_s): Add an x509 flag.
5859 * key.c (parse_x509_user_id): New.
5860 (_gpgme_key_append_name): Handle x.509 names.
5862 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5864 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5867 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5869 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5870 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5872 (_gpgme_gpgsm_op_sign): Likewise.
5874 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5876 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5879 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5881 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5883 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5885 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5886 Deal with assuan read line returning more than one line (for now).
5888 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5890 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5891 the current protocol definition.
5893 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5895 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5898 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5900 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5901 for now, rungpg.h and status-table.h.
5902 (gpgsm_status_handler): Implement more of the status handler.
5904 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5906 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5907 (_gpgme_engine_op_delete): Likewise.
5908 (_gpgme_engine_op_encrypt): Likewise.
5909 (_gpgme_engine_op_export): Likewise.
5910 (_gpgme_engine_op_genkey): Likewise.
5911 (_gpgme_engine_op_keylist): Likewise.
5912 (_gpgme_engine_op_sign): Likewise.
5913 (_gpgme_engine_op_trustlist): Likewise.
5915 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5916 (gpgsm_assuan_simple_command): Likewise.
5917 (gpgsm_set_recipients): Likewise.
5918 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5919 (_gpgme_gpgsm_op_delete): New function.
5920 (_gpgme_gpgsm_op_export): Likewise.
5921 (_gpgme_gpgsm_op_genkey): Likewise.
5922 (_gpgme_gpgsm_op_sign): Likewise.
5923 (_gpgme_gpgsm_op_keylist): Likewise.
5924 (_gpgme_gpgsm_op_trustlist): Likewise.
5925 (_gpgme_gpgsm_release): Release command.
5926 (_gpgme_gpgsm_op_decrypt): Allocate command.
5927 (_gpgme_gpgsm_op_import): Likewise.
5928 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5930 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5932 * gpgme.h (gpgme_set_protocol): New prototype.
5934 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5936 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5937 (_gpgme_gpgsm_op_import): Likewise.
5939 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5941 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5943 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5945 2001-11-22 Werner Koch <wk@gnupg.org>
5947 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5948 is defined even with an undefined GPGSM_PATH.
5950 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5952 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5953 gpg_outbound_handler): Moved to ...
5954 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5955 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5956 _gpgme_* ones non-static.
5957 * data.c: Include io.h.
5959 * ops.h (_gpgme_data_inbound_handler): New prototype.
5960 (_gpgme_data_outbound_handler): Likewise.
5961 (_gpgme_gpg_spawn): Use these new functions.
5963 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5964 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5965 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5966 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5967 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5968 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5969 Include <rungpg.h> for status handler function.
5971 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5972 input_data, output_fd, output_data, message_fd, message_data, command
5974 (_gpgme_gpgsm_new): Open input, output and message pipes before
5975 connecting to the client. Close server's ends afterwards.
5976 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5977 server process from wait queue.
5978 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5979 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5981 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5982 (_gpgme_engine_set_status_handler): Likewise.
5983 (_gpgme_engine_op_verify): Likewise.
5985 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5987 * context.h: Do not include rungpg.h, but engine.h.
5988 (struct gpgme_context_s): Replace member gpg with engine.
5989 * gpgme.c (gpgme_release): Release engine, not gpg.
5991 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5993 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5994 Make static, change order of arguments, and return an error value.
5995 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5997 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5998 (_gpgme_gpg_op_encrypt): Likewise.
5999 (_gpgme_gpg_op_decrypt): Likewise.
6000 (_gpgme_gpg_op_delete): Likewise.
6001 (_gpgme_gpg_op_export): Likewise.
6002 (_gpgme_gpg_op_genkey): Likewise.
6003 (_gpgme_gpg_op_import): Likewise.
6004 (_gpgme_gpg_op_keylist): Likewise.
6005 (_gpgme_gpg_op_sign): Likewise.
6006 (_gpgme_gpg_op_trustlist): Likewise.
6007 * rungpg.c (_gpgme_gpg_op_verify): New function.
6008 (_gpgme_gpg_op_encrypt): Likewise.
6009 (_gpgme_gpg_op_decrypt): Likewise.
6010 (_gpgme_gpg_op_delete): Likewise.
6011 (_gpgme_gpg_op_export): Likewise.
6012 (_gpgme_gpg_op_genkey): Likewise.
6013 (_gpgme_gpg_op_import): Likewise.
6014 (_gpgme_gpg_op_keylist): Likewise.
6015 (_gpgme_gpg_op_sign): Likewise.
6016 (_gpgme_gpg_op_trustlist): Likewise.
6018 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
6019 (_gpgme_engine_set_command_handler): Likewise.
6020 (_gpgme_engine_set_colon_line_handler): Likewise.
6021 (_gpgme_engine_op_decrypt): Likewise.
6022 (_gpgme_engine_op_delete): Likewise.
6023 (_gpgme_engine_op_encrypt): Likewise.
6024 (_gpgme_engine_op_export): Likewise.
6025 (_gpgme_engine_op_genkey): Likewise.
6026 (_gpgme_engine_op_import): Likewise.
6027 (_gpgme_engine_op_keylist): Likewise.
6028 (_gpgme_engine_op_sign): Likewise.
6029 (_gpgme_engine_op_trustlist): Likewise.
6030 (_gpgme_engine_op_verify): Likewise.
6031 (_gpgme_engine_start): Likewise.
6032 * engine.c (_gpgme_engine_set_status_handler): New function.
6033 (_gpgme_engine_set_command_handler): Likewise.
6034 (_gpgme_engine_set_colon_line_handler): Likewise.
6035 (_gpgme_engine_op_decrypt): Likewise.
6036 (_gpgme_engine_op_delete): Likewise.
6037 (_gpgme_engine_op_encrypt): Likewise.
6038 (_gpgme_engine_op_export): Likewise.
6039 (_gpgme_engine_op_genkey): Likewise.
6040 (_gpgme_engine_op_import): Likewise.
6041 (_gpgme_engine_op_keylist): Likewise.
6042 (_gpgme_engine_op_sign): Likewise.
6043 (_gpgme_engine_op_trustlist): Likewise.
6044 (_gpgme_engine_op_verify): Likewise.
6045 (_gpgme_engine_start): Likewise.
6047 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
6049 * encrypt.c (gpgme_op_encrypt_start): Likewise.
6050 * decrypt.c (_gpgme_decrypt_start): Likewise.
6051 * passphrase.c (_gpgme_passphrase_start): Likewise.
6052 * keylist.c (gpgme_op_keylist_start): Likewise.
6054 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6056 * types.h: Add types EngineObject and GpgsmObject.
6058 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
6059 engine-gpgsm.c, engine.h and engine.c.
6060 * engine.h: New file.
6061 * engine.c: Likewise.
6062 * engine-gpgsm.h: Likewise.
6063 * engine-gpgsm.c: Likewise.
6065 * rungpg.c (_gpgme_gpg_get_version): New function.
6066 (_gpgme_gpg_check_version): Likewise.
6067 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
6068 _gpgme_gpg_check_version.
6070 * version.c (compare_versions): Rename to ...
6071 (_gpgme_compare_versions): ... this. Make non-static.
6072 (gpgme_check_version): Use _gpgme_compare_versions rather than
6074 (gpgme_check_engine): Likewise.
6075 * ops.h (_gpgme_get_program_version): Add prototype.
6077 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6079 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
6080 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
6081 (libgpgme_la_LIBADD): Likewise.
6083 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
6085 * version.c: Remove global variables lineno and
6087 (version_handler): Removed.
6088 (_gpgme_get_program_version): New function.
6089 (get_engine_info): Don't use context and version_handler,
6090 but _gpgme_get_program_version.
6091 * ops.h (_gpgme_get_program_version): Add prototype for
6092 _gpgme_get_program_version (we expect to use it elsewhere soon).
6094 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
6096 * version.c (get_engine_info): If GnuPG is not available, return
6098 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
6100 (_gpgme_get_gpgsm_path): New function.
6101 * w32-util.c (find_program_in_registry): New static function.
6102 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
6103 to use find_program_in_registry.
6104 (_gpgme_get_gpgsm_path): New function.
6105 (util.h): Prototype _gpgme_get_gpgsm_path).
6106 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
6109 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6111 * decrypt-verify.c: New file.
6112 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
6113 * types.h: Add decrypt-verify types.
6115 * context.h: Add result type for decrypt-verify.
6116 * gpgme.h: Add decrypt-verify prototypes.
6118 * decrypt.c (decrypt_status_handler): Renamed to ...
6119 (_gpgme_decrypt_status_handler): ... this. Make non-static.
6120 (_gpgme_decrypt_start): New function, derived from
6121 gpgme_op_decrypt_start.
6122 (gpgme_op_decrypt_start): Reimplement in terms of
6123 _gpgme_decrypt_start.
6124 (_gpgme_decrypt_result): New function to retrieve error value.
6125 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
6126 * ops.h: Add prototypes for new functions.
6128 * verify.c (verify_status_handler): Renamed to ...
6129 (_gpgme_verify_status_handler): ... this. Make non-static.
6130 (gpgme_op_verify_start): Use new function name.
6131 (intersect_stati): Renamed to ...
6132 (_gpgme_intersect_stati): ... this. Make non-static.
6133 (gpgme_op_verify): Use new name.
6134 * ops.h: Add prototypes for new functions.
6136 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
6138 * passphrase.c: New file.
6139 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
6140 * ops.h (_gpgme_passphrase_result): Add prototypes from
6142 * types.h: Likewise.
6143 * context.h: Add member passphrase to result.
6144 * gpgme.c (_gpgme_release_result): Release passphrase member.
6146 * decrypt.c: Some formatting and variable name changes (like
6148 (struct decrypt_result_s): Remove members now found in
6150 (_gpgme_release_decrypt_result): Don't release removed members.
6151 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
6152 and don't handle the cases catched there.
6153 (command_handler): Removed.
6154 (gpgme_op_decrypt_start): Don't set command handler, but invoke
6155 _gpgme_passphrase_start which does it.
6156 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6157 cases covered by it.
6159 * sign.c Some formatting and variable name changes (like
6161 (struct sign_result_s): Remove members now found in
6163 (_gpgme_release_sign_result): Don't release removed members.
6164 (sign_status_handler): Call _gpgme_passphrase_status_handler,
6165 and don't handle the cases catched there.
6166 (command_handler): Removed.
6167 (gpgme_op_sign_start): Don't set command handler, but invoke
6168 _gpgme_passphrase_start which does it.
6169 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6170 cases covered by it.
6172 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6174 * decrypt.c (command_handler): Fix last change.
6176 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
6178 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6179 Rename R2 to NEXT_RESULT.
6180 (intersect_stati): Rename RES to RESULT.
6181 (gpgme_get_sig_status): Likewise. Do not check return_type, but
6182 the member verify of result.
6183 (gpgme_get_sig_key): Likewise.
6185 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
6186 RESULT is zero, return.
6187 (sign_status_handler, command_handler): Do not check return_type,
6188 but the member sign of result.
6189 (gpgme_op_sign): Likewise. Drop assertion.
6191 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6192 If RESULT is zero, return.
6193 (encrypt_status_handler): Do not check return_type, but the member
6195 (gpgme_op_encrypt): Likewise. Drop assertion.
6197 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6198 (create_result_struct): Do not set result_type.
6199 (command_handler, decrypt_status_handler): Do not check
6200 return_type, but the member decrypt of result.
6201 (gpgme_op_decrypt): Likewise. Drop assertion.
6203 * context.h (enum ResultType): Removed.
6204 (struct gpgme_context_s): Remove member result_type.
6205 (struct result): Replaces union result.
6206 * gpgme.c: Include string.h.
6207 (_gpgme_release_result): Release all members of c->result, which
6208 is now a struct. Zero out all members of the struct afterwards.
6210 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
6212 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6213 Release all members of the list GPG->arglist.
6214 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6216 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
6218 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6220 * key.c: Include string.h.
6222 * recipient.c: Likewise.
6224 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
6226 * context.h: New member signers_len.
6227 * signers.c (gpgme_signers_clear): Require that signers are
6228 non-NULL with assertion. Use signers_len to determine how much
6229 keys to release. Add documentation.
6230 (gpgme_signers_add): Use signers_len to determine if the buffer is
6231 large enough. Use xtryrealloc rather than xtrymalloc and copying.
6233 (gpgme_signers_enum): Use signers_len to determine if key is
6234 available. Add documentation.
6236 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
6238 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6239 ALLOC_CHUNK, not DH->length.
6241 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
6243 * gpgme.c (gpgme_set_protocol): Fix last change.
6245 2001-10-15 Werner Koch <wk@gnupg.org>
6247 * gpgme.h (GpgmeProtocol): New.
6248 * gpgme.c (gpgme_set_protocol): New.
6250 2001-09-26 Werner Koch <wk@gnupg.org>
6252 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6253 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6255 2001-09-17 Werner Koch <wk@gnupg.org>
6257 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
6258 callers to use this function without a check for tmp_key.
6260 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6261 emptying the queue. Bug reported by Stéphane Corthésy.
6263 2001-09-12 Werner Koch <wk@gnupg.org>
6265 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6267 2001-09-07 Werner Koch <wk@gnupg.org>
6269 * rungpg.h: Add NO_RECP.
6270 * encrypt.c (encrypt_status_handler): Take on No_RECP.
6271 (gpgme_op_encrypt): Better error return.
6273 * verify.c (verify_status_handler): Take on NODATA.
6275 2001-09-03 Werner Koch <wk@gnupg.org>
6277 * rungpg.h: Added STATUS_INV_RECP.
6278 * gpgme.c (_gpgme_release_result): Add support for new
6279 EncryptResult object.
6280 * encrypt.c (append_xml_encinfo): New.
6281 (encrypt_status_handler): Add some status parsing.
6282 (_gpgme_release_encrypt_result): New.
6284 2001-08-29 Werner Koch <wk@gnupg.org>
6286 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
6288 * keylist.c (keylist_colon_handler): Do a finish key if we receive
6289 an EOF here. This is probably the reason for a lot of bugs
6290 related to keylisting. It is so obvious. Kudos to Enno Cramer
6291 for pointing that out.
6293 2001-08-28 Werner Koch <wk@gnupg.org>
6295 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6296 (_gpgme_set_op_info): New.
6297 (_gpgme_release_result): Reset the op_info here.
6298 * sign.c (append_xml_siginfo): New.
6299 (sign_status_handler): Store the sig create information.
6301 2001-07-31 Werner Koch <wk@gnupg.org>
6303 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6305 2001-07-30 Werner Koch <wk@gnupg.org>
6307 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6309 * rungpg.c (build_argv): Disable armor comments
6310 * w32-io.c (build_commandline): Need to add quotes here
6312 2001-07-24 Werner Koch <wk@gnupg.org>
6314 * data.c (gpgme_data_read): Add a a way to return the available bytes.
6316 2001-07-23 Werner Koch <wk@gnupg.org>
6318 * util.c: Removed stpcpy() because we use the version from jnlib.
6320 2001-07-19 Werner Koch <wk@gnupg.org>
6322 * mkstatus: Define the collating sequence for sort.
6324 2001-06-26 Werner Koch <wk@gnupg.org>
6326 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6328 2001-06-15 Werner Koch <wk@gnupg.org>
6330 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6331 to Timo for pointing this out.
6333 2001-06-01 Werner Koch <wk@gnupg.org>
6335 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
6338 2001-05-28 Werner Koch <wk@gnupg.org>
6340 * version.c (gpgme_check_engine): Stop version number parsing at
6341 the opening angle and not the closing one. By Tommy Reynolds.
6343 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
6345 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6346 line, because it gave an error if another operation had been made
6347 before using the same context.
6349 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6350 one line to release the gpg object in the context (if any).
6352 2001-04-26 Werner Koch <wk@gnupg.org>
6354 * key.c, key.h (_gpgme_key_cache_init): New.
6355 (_gpgme_key_cache_add): New.
6356 (_gpgme_key_cache_get): New.
6357 * version.c (do_subsystem_inits): Init the cache.
6358 * keylist.c (finish_key): Put key into the cache
6359 * verify.c (gpgme_get_sig_key): First look into the cache.
6361 2001-04-19 Werner Koch <wk@gnupg.org>
6363 * keylist.c (parse_timestamp): Adjusted for the changed
6364 --fixed-list-mode of gpg 1.0.4h.
6366 2001-04-05 Werner Koch <wk@gnupg.org>
6368 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6370 2001-04-04 Werner Koch <wk@gnupg.org>
6372 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6373 are still bytes pending. Timo found this not easy to track down
6376 2001-04-02 Werner Koch <wk@gnupg.org>
6378 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6379 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6381 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6382 the mode set in the current context. Suggested by Timo.
6384 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6385 can_encrypt. By Timo.
6387 2001-03-30 Werner Koch <wk@gnupg.org>
6389 * debug.c (debug_init): Allow to specify a debug file.
6390 (_gpgme_debug_level): New.
6392 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6393 (_gpgme_io_select): Debug only with level > 2.
6395 2001-03-15 Werner Koch <wk@gnupg.org>
6397 * rungpg.c: Included time.h.
6399 * key.h: New keyflags for capabilities.
6400 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6401 (keylist_colon_handler): Parse them.
6402 * gpgme.h: New attribute values for capabilties.
6403 * key.c (gpgme_key_get_string_attr): Return them.
6404 (capabilities_to_string): New.
6405 (gpgme_key_get_ulong_attr): Return the global caps.
6407 2001-03-14 Werner Koch <wk@gnupg.org>
6409 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6410 Thanks to Jan Oliver Wagner.
6412 2001-03-13 Werner Koch <wk@gnupg.org>
6414 * context.h: Add invalid and revoke flags to user_id structure.
6415 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6416 (keylist_colon_handler): Adjust for that.
6417 (set_userid_flags): New.
6418 (set_mainkey_trust_info): Handle new key invalid flag
6419 (set_subkey_trust_info): Ditto.
6420 * gpgme.h: Add new attributes for key and user ID flags.
6421 * key.c (_gpgme_key_append_name): Init these flags
6422 (gpgme_key_get_as_xml): Print them.
6423 (one_uid_as_xml): New helper for above.
6424 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6425 Return the new attributes. Enhanced, so that subkey information
6426 can be returned now.
6428 2001-02-28 Werner Koch <wk@gnupg.org>
6430 * w32-io.c (destroy_reader): Set stop_me flag.
6431 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6432 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6433 (_gpgme_io_close): Cleanup a writer thread
6434 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6435 waiting which is now possible due to the use of a writer thread.
6437 2001-02-20 Werner Koch <wk@gnupg.org>
6439 * w32-io.c (destroy_reader,kill_reader): New.
6440 (create_reader, reader): Add a new event to stop the thread.
6441 (_gpgme_io_close): Kill the reader thread.
6443 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6444 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6446 * wait.c: Reworked the whole thing.
6447 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6448 (_gpgme_gpg_release): Remove the process from the wait queue.
6450 2001-02-19 Werner Koch <wk@gnupg.org>
6452 * w32-io.c (_gpgme_io_set_close_notify): New.
6453 (_gpgme_io_close): Do the notification.
6455 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6458 * wait.c (remove_process): Don't close the fd here.
6459 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6460 (_gpgme_wait_on_condition): Remove the assert on the queue and
6461 break out if we could not find the queue. The whole thing should
6464 * posix-io.c (_gpgme_io_set_close_notify): New.
6465 (_gpgme_io_close): Do the notification.
6467 * rungpg.c (close_notify_handler): New.
6468 (_gpgme_gpg_new): Register a callback for the fd.
6469 (_gpgme_gpg_set_colon_line_handler): Ditto.
6472 2001-02-13 Werner Koch <wk@gnupg.org>
6474 * rungpg.c (struct reap_s): Replaced pid_t by int.
6476 * types.h: Add ulong typedef.
6478 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6479 (_gpgme_gpg_release): Reap children.
6480 * io.h, posix-io.c (_gpgme_io_kill): New.
6481 * w32-io.c (_gpgme_io_kill): New (dummy).
6483 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6485 * posix-io.c (_gpgme_io_read): Add some debug output.
6486 (_gpgme_io_write): Ditto.
6487 (_gpgme_io_select): Increased the timeout.
6489 2001-02-12 Werner Koch <wk@gnupg.org>
6491 Enhanced the signature verification, so that it can how handle
6492 more than one signature and is able to return more information on
6494 * verify.c (gpgme_get_sig_key): New.
6495 (gpgme_get_sig_status): New.
6497 * gpgme.h: Add stdio.h.
6498 (GpgmeSigStat): New status DIFF.
6500 2001-02-01 Werner Koch <wk@gnupg.org>
6502 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6503 code to all Set/ResetEvent().
6505 * rungpg.c (read_status): Check for end of stream only if we have
6508 2001-01-31 Werner Koch <wk@gnupg.org>
6510 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6511 (propagate_term_results,clear_active_fds): Removed.
6512 (count_active_fds): Renamed to ..
6513 (count_active_and_thawed_fds): .. this and count only thawed fds.
6515 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6518 2001-01-30 Werner Koch <wk@gnupg.org>
6520 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6522 * version.c (get_engine_info): Return better error information.
6524 * posix-util.c, w32-util.c: New.
6525 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6526 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6528 * signers.c (gpgme_signers_add): Ooops, one should test code and
6529 not just write it; the newarr was not assigned. Thanks to José
6530 for pointing this out. Hmmm, still not tested, why should a coder
6533 * w32-io.c: Does now use reader threads, so that we can use
6534 WaitForMultipleObjects.
6535 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6536 Does currently only work for W32.
6538 * debug.c, util.h : New. Changed all fprintfs to use this new
6539 set of debugging functions.
6541 2001-01-23 Werner Koch <wk@gnupg.org>
6543 * data.c (_gpgme_data_release_and_return_string): Fixed string
6546 2001-01-22 Werner Koch <wk@gnupg.org>
6551 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6552 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6554 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6555 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6557 2001-01-05 Werner Koch <wk@gnupg.org>
6559 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6562 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6564 This file is free software; as a special exception the author gives
6565 unlimited permission to copy and/or distribute it, with or without
6566 modifications, as long as this notice is preserved.
6568 This file is distributed in the hope that it will be useful, but
6569 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6570 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.