1 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
3 * gpgme.def: Fix stupid typo.
4 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
6 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
8 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
10 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
11 (_gpgme_io_dup): Never allocate threads here.
12 (find_writer, find_reader): Check return value of thread creation
15 * context.h (CTX_OP_DATA_MAGIC): New macro.
16 (struct ctx_op_data): New member MAGIC.
17 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
18 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
20 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
22 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
24 * gpgme.c (result_ref_lock): New global variable.
25 (gpgme_result_ref, gpgme_result_unref): use it.
27 2009-06-16 Werner Koch <wk@g10code.com>
29 * version.c: Include stdlib.h.
31 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
32 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
33 * data.c (gpgme_data_set_encoding): Adjust for new values.
34 * engine-gpg.c (string_from_data): New.
35 (gpg_import): Implement --fetch-key feature.
37 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
38 * gpgme.def, libgpgme.vers: Add them.
39 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
40 (export_keys_start): New.
42 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
43 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
44 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
46 * export.c (gpgme_export_ext_start, gpgme_op_export)
47 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
48 (export_start): Ditto.
49 * engine.c (_gpgme_engine_op_export): Ditto.
50 * engine-backend.h (struct engine_ops): Ditto.
51 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
52 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
54 (gpg_export, gpg_export_ext): Factor common code out to ..
55 (export_common): .. this.
57 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
58 * gpgme.def, libgpgme.vers: Add them.
59 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
60 (_gpgme_op_import_keys_start): New.
61 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
62 * engine-backend.h (struct engine_ops): Ditto.
63 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
64 * engine-gpg.c (gpg_import): Ditto. Implement it.
66 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
68 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
70 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
72 * context.h (struct ctx_op_data): Add member "references".
73 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
74 (_gpgme_release_result): Use gpgme_result_unref.
75 * op-support.c (_gpgme_op_data_lookup): Initialize references.
77 2009-06-12 Werner Koch <wk@g10code.com>
79 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
80 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
81 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
82 (main): Pass flags for my_spawn.
83 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
85 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
86 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
87 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
88 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
89 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
90 * engine-gpg.c (start): Call spawn with new flag.
92 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
93 _gpgme_allow_set_foreground_window. Change all callers.
94 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
96 2009-06-10 Werner Koch <wk@g10code.com>
98 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
100 2009-06-09 Werner Koch <wk@g10code.com>
102 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
104 * version.c (gpgme_check_version_internal): Make result const.
106 * gpgme.c: Include priv-io.h.
107 (gpgme_io_read, gpgme_io_write): New.
108 * libgpgme.vers (GPGME_1.1): Add them.
111 * Makefile.am (main_sources): Remove gpgme.h.
112 (include_HEADERS): Rename to nodist_include_HEADERS so that a
113 VPATH build won't use the distributed one.
115 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
117 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
119 * gpgme.h.in (gpgme_check_version_internal): New prototype.
120 (gpgme_check_version): New macro, overriding function of the same
122 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
123 * context.h (_gpgme_selftest): New variable declaration.
124 * version.c: Include "context.h".
125 (gpgme_check_version): Set _gpgme_selftest on success.
126 (gpgme_check_version_internal): New function.
127 * gpgme.c (_gpgme_selftest): Define it.
128 (gpgme_new): Check the selftest result.
130 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
132 * gpgme.h.in (gpgme_encrypt_flags_t): Add
133 GPGME_ENCRYPT_NO_ENCRYPT_TO.
134 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
135 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
137 2009-05-14 Werner Koch <wk@g10code.com>
139 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
140 better maintainability and to help debugging.
142 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
144 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
146 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
148 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
149 * w32-io.c (_gpgme_io_connect): Fix stupid error.
151 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
153 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
154 (find_channel): Drop CREATE argument.
155 (new_dummy_channel_from_fd, new_channel_from_fd)
156 (new_channel_from_socket): New functions.
157 (_gpgm_io_fd2str): Implement for sockets.
158 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
160 (_gpgme_io_pipe): Fix for new channel bookkeeping.
161 (_gpgme_io_close, _gpgme_io_dup): Likewise.
162 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
163 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
164 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
165 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
166 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
167 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
168 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
170 2009-03-18 Werner Koch <wk@g10code.com>
172 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
173 * engine-gpgsm.c (gpgsm_keylist): Send new option.
175 2009-03-13 Werner Koch <wk@g10code.com>
177 * gpgme-config.in: Make sure locale is set to C.
179 2009-02-24 Werner Koch <wk@g10code.com>
181 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
182 (gpgme_assuan_result_t): New.
183 (gpgme_op_assuan_result): Change return type.
184 (struct _gpgme_assuan_sendfnc_ctx)
185 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
186 (gpgme_assuan_inquire_cb_t): Changed.
187 * opassuan.c (op_data_t): Make use of a result structure.
188 (gpgme_op_assuan_result): Change return type.
189 (opassuan_start): Use result structure.
191 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
192 (inquire_cb_sendfnc): Remove.
193 (inquire_cb): Change for new callback scheme. Not yet finished.
194 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
196 2009-02-04 Werner Koch <wk@g10code.com>
198 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
200 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
202 2009-02-03 Werner Koch <wk@g10code.com>
204 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
206 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
207 * keylist.c (keylist_colon_handler): Factor common code out to ...
208 (parse_sec_field15): New. Set card number.
210 2009-01-26 Werner Koch <wk@g10code.com>
212 * opassuan.c, dirinfo.c, engine-assuan.c: New.
213 * Makefile.am: Add them.
214 * engine-backend.h: Add _gpgme_engine_ops_assuan.
215 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
217 * Makefile.am (gpgsm_components): Add engine-assuan.c.
218 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
219 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
220 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
221 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
222 * gpgme.c (gpgme_get_protocol_name): Ditto.
223 (gpgme_set_protocol): Support it.
224 * engine.c (gpgme_get_engine_info): Ditto.
225 (engine_ops): Register it.
226 (_gpgme_engine_op_assuan_transact): New.
227 * libgpgme.vers (gpgme_op_assuan_transact_start)
228 (gpgme_op_assuan_transact): New.
229 * gpgme.def (gpgme_op_assuan_transact_start)
230 (gpgme_op_assuan_transact): New.
231 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
232 initialize to NULL for all engines.
233 * engine.c (engine_get_home_dir): New.
234 (gpgme_get_engine_info): Use it.
235 (_gpgme_set_engine_info): Use it.
236 * engine.h (engine_assuan_result_cb_t): New.
237 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
239 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
241 * version.c (gpgme_check_version): Protect trace arg against NULL.
243 2009-01-19 Werner Koch <wk@g10code.com>
245 * rungpg.c: Rename to engine-gpg.c
246 * Makefile.am (main_sources): Ditto.
248 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
250 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
252 2008-11-18 Werner Koch <wk@g10code.com>
254 * version.c (do_subsystem_inits): Always initialize I/O
255 subsystem. Fixes regression from 2007-08-02.
257 * decrypt.c (_gpgme_decrypt_status_handler): Use
258 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
260 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
262 * wait-private.c (_gpgme_wait_on_condition): Remove unused
264 * wait-global.c: Include ops.h to silence gcc warning.
265 (_gpgme_wait_global_event_cb): Pass error value directly.
266 * wait-user.c: Include ops.h to silence gcc warning.
268 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
269 silence gcc warning. Cast argument to execv to silence warning.
270 * w32-io.c (_gpgme_io_spawn): Likewise.
271 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
273 2008-10-24 Werner Koch <wk@g10code.com>
275 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
277 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
279 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
280 string to C coded string.
282 2008-10-20 Werner Koch <wk@g10code.com>
284 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
286 * gpgme.h: Rename to gpgme.h.in.
287 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
289 * posix-io.c: Include sys/uio.h. Fixes bug #818.
291 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
293 * w32-util.c (find_program_in_registry): Don't define.
294 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
295 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
296 registry anymore. It is now no longer possible to overwrite the
297 default location in that way.
299 2008-10-17 Werner Koch <wk@g10code.com>
301 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
302 around a bug in mingw32.
304 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
306 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
307 Submitted by "Daniel Mueller" <daniel@danm.de>
309 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
311 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
313 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
315 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
316 * gpgme.c (_gpgme_cancel_with_err): New function.
317 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
318 * wait-private.c (_gpgme_wait_on_condition): Use
319 _gpgme_cancel_with_err.
320 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
321 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
323 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
325 * rungpg.c (command_handler): Remove I/O callback on error, too.
327 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
329 * gpgme.c (gpgme_cancel_async): Remove unused variable.
331 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
333 * libgpgme.vers: Add gpgme_cancel_async.
334 * gpgme.def: Likewise.
336 * context.h: Include "sema.h".
337 (struct gpgme_context): New members lock and canceled.
338 * gpgme.c (gpgme_new): Initialize lock.
339 (gpgme_release): Destroy lock.
340 (gpgme_cancel_async): New function.
341 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
342 * wait-global.c (gpgme_wait): Check cancel flag before processing
344 * wait-private.c (_gpgme_wait_on_condition): Likewise.
345 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
347 2008-06-26 Werner Koch <wk@g10code.com>
349 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
350 (mkstemp): Need to use GetSystemTimeAsFileTime for better
353 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
355 * gpgme-w32spawn.c: New file.
356 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
358 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
359 (gpgsm_set_locale): Return early if locale value is NULL.
360 * util.h (_gpgme_mkstemp)
361 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
363 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
364 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
366 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
367 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
368 special filename FD rather than stdin.
369 (struct arg_and_data_s): Add member ARG_LOCP.
370 (struct fd_data_map_s): Add member ARG_LOC.
371 (struct engine_gpg): Add member ARG_LOC to status and colon.
372 (_add_arg, add_arg_with_locp): New function.
373 (add_arg_ext): Reimplement in terms of _add_arg.
374 (gpg_new): Remember argument location for status FD.
375 (build_argv): Set argument location if requested. Also set
376 argument location of fd_data_map for data items.
377 (start): Adjust caller of _gpgme_io_spawn.
378 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
380 (_gpgme_io_spawn): Remove parent fd list argument.
381 * posix-io.c (get_max_fds): New function.
382 (_gpgme_io_dup): Add tracing.
383 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
384 fd list to contain all child fds that should be inherited. Close
385 all other file descriptors after fork.
386 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
387 parent fd list. Change meaning of child fd list to contain all
388 child fds that should be inherited. Do not inherit any file
389 descriptors, but DuplicateHandle them. Spawn process through
390 wrapper process. Provide wrapper process with a temporary file
391 containing handle translation data. Return translated handle
393 * w32-io.c (reader): Add more tracing output.
394 (_gpgme_io_read): Likewise.
395 * engine-gpgconf.c (gpgconf_read): Adjust caller of
397 * version.c (_gpgme_get_program_version): Likewise.
399 2008-06-20 Werner Koch <wk@g10code.com>
401 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
402 compatibility with old compilers. Fix amount of memmove. Fix
405 2008-06-19 Werner Koch <wk@g10code.com>
407 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
408 change all callers and provide compatibilty macro.
409 (gpgme_conf_type_t): Add complex types 34..37.
410 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
411 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
413 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
415 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
417 2008-05-09 Werner Koch <wk@g10code.com>
419 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
422 2008-05-07 Werner Koch <wk@g10code.com>
424 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
425 self-explaining string. Needs a proper fix, though.
427 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
429 (gpg_build_keylist_options): .. new. Allow combination of extern
431 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
433 2008-05-06 Werner Koch <wk@g10code.com>
435 * version.c (extract_version_string): New.
436 (_gpgme_get_program_version): Use it to allow for suffixes in the
439 2008-04-28 Werner Koch <wk@g10code.com>
441 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
444 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
446 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
447 Osterfeld, implement blocking select.
449 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
451 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
453 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
455 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
456 Reported by Marc Mutz.
458 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
460 * decrypt.c (release_op_data): Release OPD->result.recipients.
461 * encrypt.c (release_op_data): Release invalid_recipient.
463 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
465 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
467 2008-02-14 Werner Koch <wk@g10code.com>
469 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
470 * posix-io.c (_gpgme_io_spawn): Ditto.
471 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
472 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
473 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
474 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
476 * w32-util.c (_gpgme_allow_set_foregound_window): New.
477 * posix-util.c (_gpgme_allow_set_foregound_window): New.
478 * engine-gpgsm.c (default_inq_cb): New.
479 (gpgsm_new) [W32]: Enable pinentry notifications.
480 (status_handler): Handle inquiries.
482 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
484 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
487 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
489 * engine-gpgsm.c (map_input_enc): Rename to ...
490 (map_data_enc): ... this. Also change all callers.
491 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
492 (gpgsm_sign): Set encoding for output.
494 2008-01-28 Werner Koch <wk@g10code.com>
496 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
498 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
500 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
503 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
505 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
507 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
510 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
512 * Makefile.am (gpgconf_components): New variable.
513 (main_sources): Add gpgconf.c.
514 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
515 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
516 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
517 (gpgme_conf_arg_release, gpgme_conf_opt_change)
518 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
520 * gpgconf.c, engine-gpgconf.c: New files.
521 * engine.h: (_gpgme_engine_op_conf_load,
522 (_gpgme_engine_op_conf_save): New prototypes.
523 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
525 * posix-util.c (_gpgme_get_gpgconf_path): New function.
526 * w32-util.c (_gpgme_get_gpgconf_path): New function.
528 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
530 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
531 * gpgme.def: Add new gpgconf related interfaces.
532 * libgpgme.vers: Likewise.
533 * util.h (_gpgme_get_gpgconf_path): New prototype.
534 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
535 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
536 (struct engine_ops): Add members for conf_load and conf_save.
537 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
538 (_gpgme_engine_op_conf_load,
539 (_gpgme_engine_op_conf_save): New functions.
540 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
542 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
544 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
545 for installation directory. Remove old fallback default.
546 (find_program_in_inst_dir): New function.
548 2007-11-26 Werner Koch <wk@g10code.com>
550 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
551 always reset it before calling start.
552 (gpgsm_new): Clear it.
553 (status_handler): Implement it.
554 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
556 2007-11-23 Werner Koch <wk@g10code.com>
558 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
559 * getauditlog.c (getauditlog_start): Use that flag.
561 2007-11-22 Werner Koch <wk@g10code.com>
563 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
564 * libgpgme.vers: Ditto.
566 * getauditlog.c: New.
567 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
568 * engine-gpgsm.c (gpgsm_getauditlog): New.
569 (_gpgme_engine_ops_gpgsm): Insert new function.
570 (gpgsm_new): Try to enable audit log support.
571 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
573 2007-11-20 Werner Koch <wk@g10code.com>
575 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
577 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
579 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
581 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
583 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
585 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
587 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
590 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
592 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
595 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
597 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
598 w32-qt-io.cpp: New versions from Frank Osterfeld.
600 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
602 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
603 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
604 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
605 Submitted by Frank Osterfeld.
607 * priv-io.h, engine-gpgsm.c: Add comments.
608 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
609 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
611 (_gpgme_io_dup): Acquire a reference. Replace unused
612 implementation by assertion.
614 2007-09-28 Werner Koch <wk@g10code.com>
616 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
618 (gpgsm_set_fd): Use it.
620 * w32-glib-io.c (find_channel): Add a new primary flag.
621 (_gpgme_io_close): Close channel only if primary.
622 (_gpgme_io_dup): Put newfd into the table as shallow copy.
624 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
625 * w32-io.c (_gpgme_io_select): Ditto.
626 * w32-glib-io.c (_gpgme_io_select): Ditto.
628 * posix-io.c (_gpgme_io_select): Ditto.
629 * rungpg.c (read_status): Ditto.
630 * wait.c (fd_table_put): Ditto.
632 * rungpg.c (gpg_io_event): Add tracing.
633 (start): Use gpg_io_event for sending the start event.
634 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
635 (start): Use gpgsm_io_event for sending the start event.
636 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
638 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
640 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
641 versions from Frank Osterfeld.
643 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
645 * w32-glib-io.c (_gpgme_io_spawn),
646 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
647 the process handle, return 0.
649 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
650 * gpgme.c (gpgme_get_protocol_name): Implement support for
651 GPGME_PROTOCOL_UNKNOWN.
653 * kdpipeiodevice.h: Fix last change.
655 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
656 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
659 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
661 * conversion.c, keylist.c: Include <sys/types.h>.
663 * kdpipeiodevice.h: Use namespace _gpgme_.
664 * kdpipeiodevice.cpp: Use namespace _gpgme_.
665 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
666 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
667 _gpgme_::KDPipeIODevice.
669 2007-09-17 Werner Koch <wk@g10code.com>
671 * rungpg.c (gpg_new): Make robust against undefined ttyname or
674 2007-09-14 Werner Koch <wk@g10code.com>
676 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
678 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
680 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
682 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
684 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
687 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
689 * Makefile.am (libgpgme_qt_la_SOURCES): Move
690 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
691 another file (it's more like a header file than a cpp file, but
692 automake doesn't know that).
694 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
695 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
696 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
698 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
699 kdpipeiodevice.moc, w32-qt-io.c: New files.
700 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
701 (ltlib_gpgme_qt): New variable.
702 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
703 (libgpgme_qt_la_SOURCES): New variable.
704 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
705 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
706 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
707 (libgpgme_qt_la_LIBADD): New variables.
709 * sema.h (struct critsect_s): Rename "private" to "priv" to make
710 C++ users happy. Change users.
711 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
712 (_gpgme_sema_cs_destroy): Likewise.
713 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
714 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
715 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
717 (gpgme_get_fdptr): New function.
718 * w32-io.c (gpgme_get_fdptr): New function
719 * gpgme.def: Add gpgme_get_fdptr.
721 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
723 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
724 (writer): Remove superfluous check.
726 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
728 * gpgme.h: Move include of gpg-error.h out of extern "C".
730 2007-08-07 Werner Koch <wk@g10code.com>
732 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
733 * verify.c (parse_trust): Set Chain_MODEL.
735 2007-08-02 Werner Koch <wk@g10code.com>
737 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
738 * w32-io.c (_gpgme_io_spawn): Ditto.
739 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
740 * debug.c (_gpgme_debug): Enable assuan logging.
741 (_gpgme_debug_subsystem_init): New.
742 * version.c (do_subsystem_inits): Disable assuan logging and
743 initialize the debug system.
744 (gpgme_check_version): Do not trace before the subsystems are
747 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
749 * debug.c: Include <errno.h> and "debug.h".
750 (_gpgme_debug): Save and restore ERRNO.
752 (_gpgme_debug_buffer): New function.
753 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
754 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
755 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
756 most of these files, add many more tracepoints.
758 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
760 * engine-gpgsm.c (status_handler): Do not send BYE here.
762 * w32-io.c (struct reader_context_s, struct writer_context_s): New
764 (create_reader, create_writer): Initialize C->refcount to 1.
765 (destroy_reader, destroy_writer): Only destroy if C->refcount
767 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
768 * priv-io.h (_gpgme_io_dup): New prototype.
769 * posix-io.c (_gpgme_io_dup): New function.
770 * w32-io.c (_gpgme_io_dup): Likewise.
771 * w32-glib-io.c (_gpgme_io_dup): Likewise.
772 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
774 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
776 * data-user.c (user_read, user_write, user_seek): Set errno and
777 return -1 instead returning the error code directly.
778 * data-compat.c (old_user_seek): Likewise.
779 * gpgme.c (gpgme_sig_notation_add): Return error properly.
781 * Revert the "close_notify_handler" returns int stuff. Always
782 close in the _gpgme_io_close implementations.
783 * engine-gpgsm.c (status_handler): Try to terminate the connection
785 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
786 (_gpgme_io_write): Likewise.
788 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
789 to _gpgme_close_notify_handler.
790 (_gpgme_close_notify_handler): New type.
791 (_gpgme_io_dup): Remove prototype.
792 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
793 type of HANDLER to _gpgme_close_notify_handler_t.
794 (_gpgme_io_close): Do not close the FD if handler returns 0.
795 (_gpgme_io_dup): Remove function.
796 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
797 _gpgme_io_close): Change type of HANDLER to
798 _gpgme_close_notify_handler_t.
799 (_gpgme_io_close): Do not close the FD if handler returns 0.
800 (_gpgme_io_dup): Remove function.
801 * w32-glib-io.c (_gpgme_io_dup): Remove function.
802 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
803 to _gpgme_close_notify_handler_t.
804 (_gpgme_io_close): Do not close the FD if handler returns 0.
805 * rungpg.c (close_notify_handler): Change return type to int,
807 * engine-gpgsm.c (close_notify_handler): Change return type to
808 int, return 0 for status FD and 1 for all other FDs.
809 (start): Do not duplicate the status FD.
811 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
813 * Makefile.am: Replace implicite rule by suffix rule. Add
816 2007-07-12 Werner Koch <wk@g10code.com>
818 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
819 system has been started.
821 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
823 * priv-io.h (_gpgme_io_dup): New prototype.
824 * posix-io.c (_gpgme_io_dup): New function.
825 * w32-io.c (_gpgme_io_dup): Likewise.
826 * w32-glib-io.c (_gpgme_io_dup): Likewise.
827 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
829 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
831 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
832 * funopen.c (funopen): Rename to _gpgme_funopen.
834 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
836 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
837 * rungpg.c (gpg_new): Likewise.
838 Submitted by Stephen Tether.
840 2007-02-26 Werner Koch <wk@g10code.com>
842 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
843 (_gpgme_verify_status_handler): Return an error if more than one
844 plaintext has been seen.
845 (parse_error): New arg SET_STATUS. Also detect it based on an
846 ERROR status (gpg > 1.4.6).
848 2007-01-26 Werner Koch <wk@g10code.com>
850 * w32-io.c (build_commandline): Fixed stupid quoting bug.
851 * w32-glib-io.c (build_commandline): Ditto.
853 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
855 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
857 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
859 * data.h (_gpgme_data_get_fd): Add prototype.
860 (gpgme_data_get_fd_cb): New type.
861 (struct _gpgme_data_cbs): New member get_fd.
862 * data.c (_gpgme_data_get_fd): New function.
863 * data-fd.c (fd_get_fd): New function.
864 (fd_cbs): Add fd_get_fd.
865 * data-stream.c (stream_get_fd): New function.
866 (stream_cbs): Add stream_get_fd.
867 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
868 * data-user.c (user_cbs): Likewise.
869 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
870 short-cut by passing the data descriptor directly.
872 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
874 * w32-io.c (build_commandline): Quote all command line arguments.
875 * w32-glib-io.c (build_commandline): Likewise.
877 2007-01-10 Werner Koch <wk@g10code.com>
879 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
881 2007-01-08 Werner Koch <wk@g10code.com>
883 * version.c (do_subsystem_inits): Do assuan init only if building
885 * setenv.c: Include assuan-def.h only if building with Assuan
888 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
890 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
891 * rungpg.c (gpg_set_locale): Ditto.
893 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
895 * gpgme.c (gpgme_set_protocol): Shut down the engine when
897 (gpgme_ctx_set_engine_info): Likewise for engine info.
898 * engine.h (_gpgme_engine_reset): New function prototype.
899 * engine.c (_gpgme_engine_reset): New function.
900 * engine-backend.h (struct engine_ops): New member RESET.
901 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
902 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
903 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
904 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
906 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
907 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
908 function if available.
909 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
911 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
913 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
914 lc_messages from prototype.
915 (_gpgme_engine_set_locale): New prototype.
916 * engine.c (_gpgme_engine_set_locale): New function.
917 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
918 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
919 Remove arguments lc_messages and lc_ctype from member NEW.
920 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
922 (gpgsm_new): Remove lc_messages and lc_ctype
924 (gpgsm_set_locale): New function.
925 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
926 * rungpg.c (struct engine_gpg): Add new members lc_messages and
928 (gpg_release): Release lc_messages and lc_ctype if set.
929 (gpg_new): Remove lc_messages and lc_ctype arguments.
930 (gpg_set_locale): New function.
931 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
932 (add_arg): Implement in terms of:
933 (add_arg_ext): New function.
934 (start): Set lc-messages and lc-ctype arguments here.
936 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
938 * engine-gpgsm.c (struct engine_gpgsm): Move members
939 input_fd_server, output_fd_server, message_fd_server to ...
940 (iocb_data): ... here (as server_fd).
941 (close_notify_handler): Reset tags as well.
942 (gpgsm_new): Implement support for descriptor
944 (fd_type_t): New type.
945 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
946 for unused communication channels.
947 (gpgsm_set_fd): Rewritten to support descriptor passing. All
948 relevant callers adjusted as well (previously of _gpgme_io_close).
950 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
952 * version.c: Include "assuan.h".
953 (do_subsystem_inits): Call assuan_set_assuan_err_source.
955 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
957 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
958 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
959 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
961 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
962 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
963 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
964 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
966 (noinst_LTLIBRARIES): Removed.
967 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
968 (AM_CFLAGS): New variable.
970 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
972 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
973 ASSUAN_CONTEXT with assuan_context_t.
975 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
977 * engine-gpgsm.c (gpgsm_new): Check return value of
980 * rungpg.c: Include <unistd.h>.
981 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
982 --lc-messages. Fixes issue 734.
984 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
986 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
989 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
991 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
992 _gpgme_engine_io_event().
994 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
996 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
998 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1001 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1003 * keylist.c (keylist_colon_handler): Move debug output after
1006 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1008 * gpgme-config.in (Options): Add NETLIBS.
1009 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1010 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1012 * rungpg.c (read_status): Fix comparison disguising as an
1015 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1017 * gpgme.c (gpgme_set_locale): Remove conditional on
1018 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1020 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1022 * rungpg.c (read_status): Strip potential carriage return.
1023 * genkey.c (get_key_parameter): Skip potential carriage return.
1024 * version.c (_gpgme_get_program_version): Strip potential carriage
1027 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1030 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1032 * keylist.c (gpgme_get_key): Also clone the engine info.
1034 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1036 * gpgme-config.in (cflags_pth): Revert accidential removal of
1037 pthread support with last change.
1039 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1041 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1042 (_gpgme_io_pipe): Open pipes in binary mode.
1044 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1046 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1047 checking the version correctly even after changing the engine
1048 information. Bug reported by Stéphane Corthésy.
1050 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1052 (colon_preprocessor_t): New type.
1053 (struct engine_gpg): New member colon.preprocess_fnc.
1054 (gpg_keylist_preprocess): New function.
1055 * keylist.c (keylist_colon_handler): Allow short key IDs.
1057 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1059 * w32-io.c (create_writer): Make C->have_data a manually resetted
1061 (writer): Move code from end of if block to beginning, so it
1062 is also run the first time.
1063 (_gpgme_io_write): Move assert check after error check. Reset
1064 the is_empty event, and also do it eagerly.
1065 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1067 2006-01-26 Werner Koch <wk@g10code.com>
1069 * w32-util.c (_gpgme_get_conf_int): New.
1070 * posix-util.c (_gpgme_get_conf_int): New.
1071 * w32-io.c (get_desired_thread_priority): New.
1072 (create_reader, create_writer): Use it here.
1074 2006-01-04 Werner Koch <wk@g10code.com>
1076 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1078 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1079 statements. Disable error return for failed nonblocking call.
1081 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1083 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1086 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1088 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1089 (_gpgme_io_select): Fix debug output.
1091 2005-12-23 Werner Koch <wk@g10code.com>
1093 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1094 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1097 2005-12-20 Werner Koch <wk@g10code.com>
1099 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1100 and GPGME_STATUS_PKA_TRUST_GOOD.
1101 (struct _gpgme_signature): New field pka_trust.
1102 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1104 2005-12-06 Werner Koch <wk@g10code.com>
1106 * keylist.c (keylist_colon_handler): Store fingerprints of the
1107 subkeys. Reset the secret flag of subkeys for stub secret keys.
1108 (NR_FIELDS): Bumped up to 16
1110 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1112 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1113 engine_get_version invocation. Reported by Stéphane Corthésy.
1115 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1117 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1119 2005-11-18 Werner Koch <wk@g10code.com>
1121 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1123 (find_channel): Better use g_io_channel_win32_new_fd instead of
1124 the autodetection function g_io_channel_unix_new.
1125 (_gpgme_io_select): Rewritten. It is now a fully working select
1128 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1130 * priv-io.h (_gpgme_io_fd2str): New prototype.
1131 * posix-io.c (_gpgme_io_fd2str): New function.
1132 * w32-io.c (_gpgme_io_fd2str): New function.
1133 * rungpg.c: Use this new function.
1134 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1135 again. Two's company, three's the musketeers.
1137 * w32-glib-io.c: Rewrote the file handle code. We don't create
1138 system fds for every handle (doesn't work for inherited handles),
1139 but we create pseudo fds in a private namespace that designate a
1140 handle and potentially a giochannel.
1142 2005-11-18 Werner Koch <wk@g10code.com>
1144 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1146 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1148 * w32-glib-io.c: New file.
1149 * gpgme.def (gpgme_get_giochannel): Add symbol.
1150 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1152 (ltlib_gpgme_extra): New variable.
1153 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1154 (system_components_not_extra): New variable.
1155 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1156 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1157 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1158 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1159 [BUILD_W32_GLIB]: New variables.
1160 * gpgme-config.in (glib): New option.
1161 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1163 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1165 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1166 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1167 * posix-io.c (_gpgme_io_kill): Removed.
1168 (_gpgme_io_waitpid): Declare static.
1170 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1172 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1174 2005-10-21 Werner Koch <wk@g10code.com>
1176 * Makefile.am: Fixed cut+paste problem
1178 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1180 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1183 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1185 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1188 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1190 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1193 * gpgme.h (gpgme_free): New prototype.
1194 * data-mem.c (gpgme_free): New function.
1195 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1196 * gpgme.def: Add gpgme_free.
1198 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1200 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1202 * verify.c (parse_notation): Likewise for invocation.
1203 * conversion.c (_gpgme_decode_percent_string): Likewise to
1204 declaration. If set, do not replace '\0' characters with a
1206 * gpgme.h (struct _gpgme_key_sig): New field notations.
1207 * ops.h (_gpgme_parse_notation): New prototype.
1208 * sig-notation.c (_gpgme_parse_notation): New function.
1209 * key.c (gpgme_key_unref): Free all signature notations.
1210 * keylist.c (op_data_t): New member tmp_keysig.
1211 (finish_key): Clear OPD->tmp_keysig.
1212 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1213 * rungpg.c (gpg_keylist): Support listing signature notations.
1214 (gpg_keylist_ext): Likewise.
1216 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1218 * engine.h (_gpgme_set_engine_info): Add prototype.
1219 * engine-backend.h (struct engine_ops): Change return type of
1220 get_file_name() to const char * to silence gcc warning.
1221 * engine.c (engine_get_file_name): Change return type to const
1222 char * to silence gcc warning.
1223 (gpgme_get_engine_info): Use transitional variable to go from
1224 const char * to char * to silence gcc warning.
1225 (_gpgme_set_engine_info): Likewise.
1226 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1227 char * to silence gcc warning.
1228 (gpgsm_new): Make ARGV a pointer to const char.
1229 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1230 to char * to silence gcc warning.
1232 * gpgme.def: Add gpgme_data_set_file_name,
1233 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1234 gpgme_sig_notation_add and gpgme_sig_notation_get.
1235 * libgpgme.vers: Add gpgme_sig_notation_clear,
1236 gpgme_sig_notation_add and gpgme_sig_notation_get.
1237 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1238 * context.h (struct gpgme_context): New field sig_notations.
1239 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1241 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1242 (gpgme_sig_notation_flags_t): New type.
1243 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1244 gpgme_sig_notation_get): New prototypes.
1245 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1247 * sig-notation.c (_gpgme_sig_notation_free): New file.
1248 * verify.c (parse_notation): Use support functions.
1249 (release_op_data): Likewise.
1250 * rungpg.c (append_args_from_sig_notations): New function.
1251 (gpg_encrypt_sign, gpg_sign): Call it.
1253 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1255 * data.h (struct gpgme_data): New member file_name.
1256 * data.c (gpgme_data_set_filename): New function.
1257 (_gpgme_data_release): Free DH->filename if necessary.
1258 (gpgme_data_get_filename): New function.
1259 * rungpg.c (gpg_encrypt): Set filename option.
1260 (gpg_encrypt_sign): Likewise.
1261 (gpg_sign): Likewise.
1262 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1263 gpgme_data_get_file_name.
1265 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1268 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1270 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1271 (struct _gpgme_subkey): Likewise.
1272 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1275 2005-09-23 Werner Koch <wk@g10code.com>
1277 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1279 (create_reader, create_writer): Set thread priority higher.
1281 2005-09-19 Werner Koch <wk@g10code.com>
1283 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1284 the size of the pipe buffer.
1286 2005-09-13 Werner Koch <wk@g10code.com>
1288 * ath.c: Changes to make it work under W32.
1290 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1292 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1293 (ath_pth_src, ath_pthread_src): Removed.
1294 (w32_o_files): Replace ath-compat.o with ath.o.
1295 (libgpgme_pth_la_CFLAGS): New variable.
1296 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1297 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1298 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1299 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1300 (_ATH_COMPAT): Macro removed.
1301 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1304 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1306 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1308 2005-09-07 Werner Koch <wk@g10code.com>
1310 * w32-io.c (build_commandline): Quote argv[0].
1312 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1314 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1316 * edit.c (command_handler): Do not depend on PROCESSED being
1319 * engine.h (engine_command_handler_t): Add new argument processed.
1320 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1322 (_gpgme_passphrase_command_handler): ... this one.
1323 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1325 (_gpgme_passphrase_command_handler): ... this one.
1326 * edit.c (command_handler): Add new argument processed. Remove
1327 local variable with the same name. Always return processed as
1329 * rungpg.c (command_handler): Send a newline character if the
1332 2005-08-26 Werner Koch <wk@g10code.com>
1334 * w32-util.c (read_w32_registry_string): Updated from code used by
1335 GnuPG. This allows for expanding strings and features the
1336 implicit fallback key.
1337 (w32_shgetfolderpath, find_program_at_standard_place): New.
1338 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1339 entry, locate the programs at the standard place.
1340 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1341 we are accustomed to.
1343 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1344 semicolon is used which allows us to create files with drive
1347 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1350 2005-08-19 Werner Koch <wk@g10code.com>
1353 * versioninfo.rc.in: New.
1354 * Makefile.am: Addes support for building a W32 DLL.
1356 * ttyname_r.c (ttyname_r) [W32]: Return error.
1357 * ath-compat.c [W32]: select and co are not yet supported; return
1359 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1361 2005-08-08 Werner Koch <wk@g10code.com>
1363 * util.h (stpcpy): Renamed to ..
1364 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1365 definitions when linking statically.
1366 * stpcpy.c: Removed.
1368 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1370 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1371 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1372 (struct _gpgme_op_verify_result): Likewise.
1373 * ops.h (_gpgme_parse_plaintext): Add prototype.
1374 * op-support.c (_gpgme_parse_plaintext): New function.
1375 * decrypt.c (release_op_data): Release
1376 OPD->result.plaintext_filename.
1377 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1378 * verify.c (release_op_data): Release
1379 OPD->result.plaintext_filename.
1380 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1382 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1384 * keylist.c (gpgme_get_key): Allow key IDs.
1386 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1388 * gpgme.m4: Only call GPGME_CONFIG if found.
1390 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1392 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1394 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1395 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1397 (_gpgme_decrypt_status_handler): Fix last change.
1399 * gpgme.h (struct _gpgme_recipient): New structure.
1400 (gpgme_recipient_t): New type.
1401 (struct _gpgme_op_decrypt_result): Add member recipients.
1402 * decrypt.c (op_data_t): New member last_recipient_p.
1403 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1404 (parse_enc_to): New function.
1405 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1408 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1410 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1412 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1414 * wait.h (_gpgme_run_io_cb): New prototype.
1415 * wait.c (_gpgme_run_io_cb): New function.
1416 * wait-global.c (gpgme_wait): Call it.
1417 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1418 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1420 2005-06-02 Werner Koch <wk@g10code.com>
1422 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1423 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1424 (_gpgme_passphrase_command_handler_internal): Also act on the key
1425 "passphrase.pin.ask".
1427 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1428 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1429 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1430 GPGME_STATUS_BACKUP_KEY_CREATED.
1432 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1434 * data-user.c: Include <errno.h>.
1436 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1438 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1441 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1443 * w32-io.c (_gpgme_io_select): Fix loop increment.
1445 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1447 * data-user.c (user_release): Only call user hook if provided.
1448 (user_seek): Return EBADF if no user hook is provided.
1449 (user_read): Likewise.
1450 (user_write): Likewise.
1452 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1454 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1455 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1456 the reset, just for cleanliness, and do not sent it at all if the
1457 default is requested.
1458 * gpgme.c (gpgme_set_include_certs): Allow to use
1459 GPGME_INCLUDE_CERTS_DEFAULT.
1461 2005-04-21 Werner Koch <wk@g10code.com>
1463 * verify.c (calc_sig_summary): Set the key revoked bit.
1465 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1467 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1468 in the list, not the user-provided CTX.
1469 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1471 * wait-global.c (gpgme_wait): If no context is found, and we
1472 should not hang, set *status to 0 and return NULL.
1473 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1475 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1477 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1478 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1479 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1480 ENOSYS instead EOPNOTSUPP.
1481 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1482 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1485 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1487 * io.h: Rename to ...
1488 * priv-io.h: ... this.
1489 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1490 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1491 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1492 Change all includes of "io.h" to "priv-io.h"
1494 2005-03-09 Werner Koch <wk@g10code.com>
1496 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1497 cast away type checks.
1499 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1502 * data.h [W32]: Removed kludge for EOPNOTSUP.
1503 * data.c, data-compat.c [W32]: Explicitly test for it here.
1505 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1508 2005-03-07 Timo Schulz <twoaday@g10code.de>
1510 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1511 * ath.h: [_WIN32] Added some (dummy) types.
1512 * io.h: [_WIN32] include stdio.h.
1513 * data.h: [_WIN32] Define EOPNOTSUPP.
1514 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1515 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1517 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1519 * engine.c (_gpgme_set_engine_info): Fix assertion.
1521 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1523 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1525 * ttyname_r.c: New file.
1527 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1529 * putc_unlocked.c, funopen.c: I just claim copyright on these
1530 files and change their license to LGPL, because they are totally
1531 trivial wrapper functions.
1532 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1533 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1534 defined as a macro doing exactly the same as the function in this
1536 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1537 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1538 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1539 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1540 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1541 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1542 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1543 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1544 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1545 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1546 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1547 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1548 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1549 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1552 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1554 * libgpgme.vers (GPGME_1.1): New version.
1555 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1556 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1557 member new(). Change return type of get_file_name and get_version
1559 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1560 pointer. Do not cache result.
1561 (gpgsm_new): Add file_name and home_dir argument, and use them
1562 instead of the defaults, if set.
1563 * rungpg.c (struct engine_gpg): New member file_name.
1564 (gpg_get_version): Change return type to char pointer, and do not
1566 (gpg_release): Free gpg->file_name.
1567 (gpg_new): Take new arguments file_name and home_dir. Set the
1568 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1569 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1570 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1572 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1574 * engine.c: Include <assert.h>.
1575 (gpgme_get_engine_info): Set *INFO within the lock. Move
1576 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1577 (engine_info, engine_info_lock): ... here. New static variables.
1578 (engine_get_version): Add file_name argument to
1579 get_version invocation. Change return type to char pointer.
1580 (gpgme_engine_check_version): Rewritten to free() the return value
1581 of engine_get_version after using it.
1582 (_gpgme_engine_info_release): New function.
1583 (gpgme_get_engine_info): Rewritten.
1584 (_gpgme_engine_info_copy): New function.
1585 (_gpgme_set_engine_info): New function.
1586 (gpgme_set_engine_info): New function.
1587 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1589 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1590 and version to char * (remove the const). New member home_dir.
1591 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1592 gpgme_ctx_set_engine_info): New prototypes.
1593 * context.h (struct gpgme_context): New member engine_info.
1594 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1595 (gpgme_release): Deallocate CTX->engine_info.
1596 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1598 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1599 pass it to _gpgme_engine_new.
1600 * version.c (gpgme_check_version): Adjust to
1601 _gpgme_compare_versions returning an int.
1602 (_gpgme_compare_versions): Return an int value, not a const char
1604 * ops.h (_gpgme_compare_versions): Same for prototype.
1606 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1608 * verify.c (parse_trust): If no reason is provided, set
1609 SIG->validity_reason to 0.
1610 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1612 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1614 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1615 (start): Call map_assuan_error on return value of
1618 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1620 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1623 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1625 * gpgme.m4: Implement the --api-version check.
1627 * rungpg.c (read_status): Move the polling of the output data pipe
1628 to just before removing the command fd, from just before adding
1629 it. This avoids buffering problems.
1631 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1632 read, to improve debug output.
1634 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1636 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1637 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1638 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1639 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1641 (gpgme_keylist_mode_t): Define as unsigned int.
1642 (gpgme_key_t): Change type of keylist_mode to
1643 gpgme_keylist_mode_t.
1645 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1647 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1650 * data-stream.c (stream_seek): Call ftello and return the current
1652 * data.h (struct gpgme_data): Change type of data.mem.offset to
1654 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1655 callback. If SEEK_CUR, adjust the offset by the pending buffer
1656 size. Clear pending buffer on success.
1659 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1661 * gpgme.m4: Add copyright notice.
1663 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1665 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1668 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1670 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1672 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1674 * key.c (_gpgme_key_append_name): Make sure tail points to the
1675 byte following the uid.
1676 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1679 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1681 * libgpgme.vers: Remove C-style comment, which is not supported by
1684 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1686 * gpgme-config.in (Options): Support --api-version.
1688 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1690 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1691 * verify.c (parse_error): Likewise.
1693 * verify.c (parse_error): Do not skip location of where token.
1695 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1696 * verify.c (_gpgme_verify_status_handler): Add handling of
1697 GPGME_STATUS_REVKEYSIG.
1698 (parse_trust): Likewise.
1700 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1702 * gpgme.h (struct _gpgme_decrypt_result): New fields
1703 wrong_key_usage and _unused.
1704 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1705 character after a matched string, as in a protocol error this
1706 could skip over the trailing binary zero.
1707 Handle decrypt.keyusage error notifications.
1709 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1710 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1712 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1714 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1715 to unsigned int. Same for member _unused.
1717 * keylist.c (set_mainkey_trust_info): Rewritten.
1718 (set_subkey_capability): Handle 'd' (disabled).
1719 (set_mainkey_capability): Rewritten.
1721 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1723 * gpgme.m4: Quote first argument to AC_DEFUN.
1725 2004-04-21 Werner Koch <wk@gnupg.org>
1727 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1728 The rule of least surprise.
1730 2004-04-15 Werner Koch <wk@gnupg.org>
1732 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1733 unused result.signatures items.
1735 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1737 2004-04-08 Werner Koch <wk@gnupg.org>
1739 * verify.c (_gpgme_verify_status_handler): Ignore the error status
1740 if we can't process it.
1741 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
1742 yesterday's hack. It is not any longer required.
1744 2004-04-07 Werner Koch <wk@gnupg.org>
1746 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
1747 with meaningless error codes from the verify status function.
1749 2004-04-05 Werner Koch <wk@gnupg.org>
1751 * gpgme.h: Add GPGME_STATUS_NEWSIG.
1753 * verify.c (parse_error): Compare only the last part of the where
1755 (prepare_new_sig): New.
1756 (parse_new_sig): Use prepare_new_sig when required.
1757 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
1759 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
1760 option. Fixed pattern construction.
1761 (status_handler): Add debugging output.
1763 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
1765 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
1766 isatty(). Submitted by Bernhard Herzog.
1768 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
1770 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
1773 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
1775 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
1776 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
1778 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
1780 * gpgme-config.in: Do not emit include and lib directory for
1781 prefix "/usr" or "".
1783 2004-03-03 Werner Koch <wk@gnupg.org>
1785 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
1788 2004-02-18 Werner Koch <wk@gnupg.org>
1790 * gpgme-config.in: Ignore setting of --prefix.
1792 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
1794 * rungpg.c (gpg_cancel): New function.
1795 (gpg_release): Call it here.
1796 (_gpgme_engine_ops_gpg): Add it here.
1797 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
1799 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
1801 * gpgme.c (gpgme_cancel): New function.
1802 * engine-backend.h (struct engine_ops): New member cancel.
1803 * engine.h (_gpgme_engine_cancel): New prototype.
1804 * engine.c (_gpgme_engine_cancel): New function.
1805 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
1806 (gpgsm_cancel): New function.
1807 (gpgsm_release): Use it.
1808 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
1810 2004-02-17 Werner Koch <wk@gnupg.org>
1812 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
1813 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
1815 2004-02-15 Werner Koch <wk@gnupg.org>
1817 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
1818 by Adriaan de Groot.
1820 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
1822 * rungpg.c (build_argv): Use --no-comment, not --comment "".
1824 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
1826 * data-stream.c (stream_seek): Likewise.
1828 2004-01-16 Werner Koch <wk@gnupg.org>
1830 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
1833 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
1835 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
1837 2004-01-12 Werner Koch <wk@gnupg.org>
1839 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
1841 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
1843 * gpgme.h (_GPGME_D_CLASS): Revert this change.
1844 (struct _gpgme_key_sig): For C++ compilers, rename class
1845 member to _obsolete_class. Add new member sig_class.
1846 (struct _gpgme_new_signature): Same here.
1847 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
1849 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
1850 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
1851 * sign.c (parse_sig_created): Set SIG->sig_class.
1853 2003-12-22 Werner Koch <wk@gnupg.org>
1855 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
1858 2003-11-19 Werner Koch <wk@gnupg.org>
1860 * conversion.c (_gpgme_parse_timestamp): New.
1861 (atoi_1, atoi_2, atoi_4): New.
1862 * keylist.c (parse_timestamp): Removed. Changed all callers to use
1864 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
1865 * sign.c (parse_sig_created): Ditto.
1867 2003-10-31 Werner Koch <wk@gnupg.org>
1869 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
1872 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
1874 * genkey.c (get_key_parameter): Make a copy of the key parameters.
1875 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
1877 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
1879 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
1882 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
1885 * io.h (_gpgme_io_subsystem_init): New prototype.
1886 * posix-io.c (_gpgme_io_subsystem_init): Add function.
1887 (_gpgme_io_spawn): Do not fixup signal handler here.
1888 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
1890 * debug.c (debug_init): Drop const qualifier from E.
1892 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
1894 (ath_connect): Make ADDR argument const.
1895 * ath-pthread.c (ath_connect): Likewise.
1896 * ath-pth.c (ath_connect): Likewise.
1897 * ath-compat.c (ath_connect): Likewise.
1898 * ath.c (ath_connect): Likewise.
1900 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
1901 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
1903 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
1905 * util.h (_gpgme_hextobyte): Likewise for prototype.
1907 * gpgme.h: Remove trailing comma in enum.
1909 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
1910 <signal.h>, <fcntl.h>, or "unistd.h".
1912 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
1914 * engine-backend.h (struct engine_ops): Add argument TYPE.
1915 * engine.c (_gpgme_engine_op_edit): Likewise.
1916 * engine.h: Likewise.
1917 * rungpg.c (gpg_edit): Likewise. Use it.
1918 * edit.c (edit_start): Likewise. Pass it on.
1919 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
1920 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
1922 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
1924 * gpgme.h (gpg_strerror_r): Change prototype to match
1925 gpg_strerror_r change.
1926 * error.c (gpg_strerror_r): Likewise, also update implementation.
1928 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
1929 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
1930 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
1932 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
1934 * gpgme.h: Add prototype for gpgme_set_locale.
1936 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
1937 characteristics and use that instead __inline__.
1939 * context.h (struct gpgme_context): New members lc_ctype and
1941 * gpgme.c: Include <locale.h>.
1942 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
1944 (gpgme_set_locale): New function.
1945 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
1947 * engine.h (_gpgme_engine_new): Likewise.
1948 * engine-gpgsm.c (gpgsm_new): Likewise.
1949 * rungpg.c (gpg_new): Likewise.
1950 * engine-backend.h (struct engine_ops): Likewise to NEW.
1951 * op-support.c (_gpgme_op_reset): Likewise to invocation of
1954 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
1956 * gpgme.h (gpgme_strerror_r): New prototype.
1957 * error.c (gpgme_strerror_r): New function.
1959 * get-env.c: New file.
1960 * util.h (_gpgme_getenv): Add prototype.
1961 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
1962 * rungpg.c (build_argv): Use _gpgme_getenv.
1963 * debug.c (debug_init): Likewise.
1964 * engine-gpgsm.c (gpgsm_new): Likewise.
1965 (gpgsm_new): Use ttyname_r.
1966 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
1968 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
1970 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
1973 * gpgme-config.in: Rewritten.
1974 * gpgme.m4: Rewritten.
1976 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
1978 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
1979 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
1980 updated to have better thread support, and the Makefile.am was
1981 changed to reflect that.
1983 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
1984 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
1985 value of status_fnc.
1986 * rungpg.c (start): Return SAVED_ERRNO, not errno.
1988 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1990 * rungpg.c (start): Use saved_errno instead errno.
1992 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1994 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
1995 * fopencookie.c: File removed.
1997 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
1999 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2001 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2003 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2004 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2005 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2006 backward compatibility.
2008 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2010 * verify.c (parse_new_sig): Fix status parsing case.
2012 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2014 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2015 Lower _UNUSED to 23 bits.
2016 (struct _gpgme_key): Likewise.
2017 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2018 (set_subkey_capability): Support 'a'.
2020 * keylist.c (gpgme_get_key): Check if there is more than one key
2021 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2023 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2025 (_gpgme_decode_percent_string): Likewise.
2026 * conversion.c (_gpgme_decode_c_string): Likewise.
2027 (_gpgme_decode_percent_string): Likewise.
2028 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2029 * signers.c (gpgme_signers_clear): Likewise.
2030 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2031 Use SEQNO instead SEQ.
2032 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2033 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2035 (gpgme_wait): Change type of I and IDX to unsigned int.
2036 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2037 and I to unsigned int.
2038 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2039 int to suppress gcc warning.
2040 (_gpgme_io_set_close_notify): Likewise.
2041 (_gpgme_io_select): Change type of I to unsigned int.
2042 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2044 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2047 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2049 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2050 and wrong expression.
2051 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2052 * encrypt.c (encrypt_sym_status_handler): Likewise.
2053 * sign.c (sign_status_handler): Likewise.
2054 * verify.c (verify_status_handler): Likewise.
2055 * decrypt.c (decrypt_status_handler): Likewise.
2057 * engine.c (gpgme_get_engine_info): Initialize NULL.
2059 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2061 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2062 GPG_ERROR_LIBS when setting the corresponding variables.
2063 Reported by Stéphane Corthésy.
2065 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2067 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2068 the beginning of the block.
2070 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2072 * data-mem.c (mem_write): Copy original buffer content.
2074 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2076 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2079 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2081 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2082 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2085 * op-support.c (_gpgme_parse_inv_userid): Rename to
2086 _gpgme_parse_inv_recp and change to new datatype.
2087 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2088 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2089 __gpgme_invalid_key. Rename field ID to KEY.
2090 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2091 (struct _gpgme_op_encrypt_result): Here, too.
2092 (struct _gpgme_op_sign_result): Likewise.
2093 * encrypt.c (struct op_data): Likewise.
2094 (release_op_data): Likewise.
2095 * sign.c (struct op_data): Likewise.
2096 (release_op_data): Likewise.
2098 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2099 (_gpgme_io_write): Likewise.
2100 (_gpgme_io_pipe): Likewise.
2101 (_gpgme_io_select): Likewise.
2103 * rungpg.c (struct engine_gpg): Remove arg_error.
2104 (add_arg): Don't set arg_error.
2105 (add_data): Likewise.
2106 (start): Don't check arg_error.
2107 (gpg_new): Check return value of add_arg.
2108 * verify.c (parse_notation): Free allocated memory at error.
2110 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2112 Everywhere: Use libgpg-error error codes.
2114 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2115 (BUILT_SOURCES): Remove errors.c.
2116 (MOSTLYCLEANFILES): Likewise.
2117 (libgpgme_la_SOURCES): Likewise. Add error.c.
2118 (errors.c): Remove target.
2119 * mkerrors: File removed.
2120 * error.c: New file.
2122 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2123 (gpgme_err_code_t, gpgme_err_source_t): New types.
2124 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2125 New static inline functions.
2126 (gpgme_strsource, gpgme_err_code_from_errno,
2127 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2128 gpgme_error_from_errno): New prototypes.
2130 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2132 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2133 (gpgme_op_export): Likewise.
2134 (gpgme_op_export_ext_start): New prototype.
2135 (gpgme_op_export_ext): Likewise.
2136 * engine.h: Likewise for _gpgme_engine_op_export and
2137 _gpgme_engine_op_export_ext.
2138 * engine-backend.h (struct engine_ops): Change second argument of
2139 prototype of export to const char *, and add reserverd int as
2140 third argument. Add prototype for export_ext.
2141 * engine.c (_gpgme_engine_op_export_ext): New function.
2142 (_gpgme_engine_op_export): Change second argument of prototype of
2143 export to const char *, and add reserverd int as third argument.
2144 * rungpg.c (gpg_export): Change second argument of prototype of
2145 export to const char *, and add reserverd int as third argument.
2146 (gpg_export_ext): New function.
2147 (gpg_keylist_ext): Break loop at error.
2148 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2149 * engine-gpgsm.c (gpgsm_export): Change second argument of
2150 prototype of export to const char *, and add reserverd int as
2152 (gpgsm_export_ext): New function.
2153 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2154 * export.c (export_start): Change second argument of prototype of
2155 export to const char *, and add reserverd int as third argument.
2156 (gpgme_op_export_start): Likewise.
2157 (export_ext_start): New function.
2158 (gpgme_op_export_ext_start): Likewise.
2159 (gpgme_op_export_ext): Likewise.
2161 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2162 (gpgme_sigsum_t): New type for anonymous enum.
2164 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2165 and return an error if RECP is not set.
2167 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2168 * user-id.c: Remove file.
2169 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2170 * gpgme.h (gpgme_encrypt_flags_t): New type.
2171 (gpgme_op_encrypt_start): Change second parameter to type
2172 gpgme_key_t[], and add third parameter.
2173 (gpgme_op_encrypt): Likewise.
2174 (gpgme_op_encrypt_sign_start): Likewise.
2175 (gpgme_op_encrypt_sign): Likewise.
2176 * encrypt.c (encrypt_start): Likewise.
2177 (gpgme_op_encrypt_start): Likewise.
2178 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2179 * encrypt-sign.c (encrypt_sign_start): Likewise.
2180 (gpgme_op_encrypt_sign_start): Likewise.
2181 (gpgme_op_encrypt_sign): Likewise.
2182 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2183 encrypt and encrypt_sign.
2184 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2185 and _gpgme_engine_op_encrypt_sign.
2186 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2187 (_gpgme_engine_op_encrypt_sign): Likewise.
2188 * rungpg.c (gpg_encrypt): Likewise.
2189 (gpg_encrypt_sign): Likewise.
2190 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2191 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2192 (set_recipients): Rewritten to use keys instead user IDs.
2193 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2195 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2196 returned to GPGME_Invalid_Key and GPGME_General_Error.
2198 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2200 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2201 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2202 * rungpg.c: Rename GpgObject to engine_gpg_t.
2203 (struct gpg_object_s): Rename to struct engine_gpg.
2205 * context.h (struct gpgme_context): Change EngineObject to
2207 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2208 (ctx_op_data_t): New type.
2209 (struct gpgme_context): Use it.
2210 * ops.h (_gpgme_op_data_lookup): Use new type name.
2211 * op-support.c (_gpgme_op_data_lookup): Likewise.
2212 * engine.c: Rename EngineObject to engine_t in the file. Also
2213 EngineStatusHandler to engine_status_handler_t,
2214 EngineCommandHandler to engine_command_handler_t and
2215 EngineColonLineHandler to engine_colon_line_handler.
2216 * rungpg.c (start): Likewise.
2217 * engine-gpgsm.c: Likewise.
2218 * engine-backend.h (struct engine_ops): Likewise
2219 * engine.h (struct engine_object_s): Rename to struct engine.
2220 (EngineObject): Rename to engine_t. Also everywhere else in the
2222 (EngineStatusHandler): Rename to engine_status_handler_t.
2223 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2224 (EngineCommandHandler): Rename to engine_command_handler_t.
2226 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2228 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2230 * gpgme.h (gpgme_recipients_t): Removed.
2231 (gpgme_recipients_new, gpgme_recipients_release,
2232 gpgme_recipients_add_name,
2233 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2234 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2235 gpgme_recipients_enum_close): Removed.
2236 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2237 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2238 gpgme_op_export): Change second argument to gpgme_user_id_t.
2239 (gpgme_user_ids_release): New prototype.
2240 (gpgme_user_ids_append): Likewise.
2241 * ops.h (_gpgme_recipients_all_valid): Remove.
2242 (_gpgme_user_ids_all_valid): Add.
2243 * context.h (struct gpgme_recipients): Removed.
2244 * user-id.c: New file.
2245 * recipient.c: Removed file.
2246 * rungpg.c (append_args_from_recipients): Change last arg to
2247 gpgme_user_id_t. Reimplement.
2248 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2249 (gpg_encrypt_sign): Likewise.
2250 (gpg_export): Likewise. Rewrite user ID list code.
2251 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2253 (_gpgme_engine_op_encrypt_sign): Likewise.
2254 (_gpgme_engine_op_export): Likewise.
2255 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2256 _gpgme_engine_op_export): Likewise.
2257 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2258 (gpgsm_encrypt): Likewise.
2259 (gpgsm_export): Likewise.
2260 * engine-backend.h (struct engine_ops): Likewise for members
2261 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2262 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2264 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2266 (gpgme_op_encrypt_start): Likewise.
2267 (gpgme_op_encrypt): Likewise.
2268 * encrypt-sign.c (encrypt_sign_start): Likewise.
2269 (gpgme_op_encrypt_sign): Likewise.
2270 (gpgme_op_encrypt_sign_start): Likewise.
2272 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2274 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2275 * import.c (parse_import_res): Add skipped_new_keys parser.
2277 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2279 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2281 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2283 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2284 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2285 (_gpgme_encrypt_status_handler): Likewise.
2286 (_gpgme_op_encrypt_init_result): Likewise.
2287 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2288 (_gpgme_decrypt_status_handler): Likewise.
2289 (_gpgme_op_decrypt_init_result): Likewise.
2290 * verify.c (gpgme_op_verify_result): Likewise.
2291 (_gpgme_verify_status_handler): Likewise.
2292 (_gpgme_op_verify_init_result): Likewise.
2293 * edit.c (edit_status_handler): Likewise.
2294 (command_handler): Likewise.
2295 (edit_start): Likewise.
2296 * genkey.c (gpgme_op_genkey_result): Likewise.
2297 (genkey_status_handler): Likewise.
2298 (genkey_start): Likewise.
2299 * import.c (gpgme_op_import_result): Likewise.
2300 (import_status_handler): Likewise.
2301 (_gpgme_op_import_start): Likewise.
2302 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2303 (_gpgme_op_trustlist_event_cb): Likewise.
2304 (gpgme_op_trustlist_start): Likewise.
2305 * keylist.c (gpgme_op_keylist_result): Likewise.
2306 (keylist_colon_handler): Likewise.
2307 (keylist_status_handler): Likewise.
2308 (_gpgme_op_keylist_event_cb): Likewise.
2309 (gpgme_op_keylist_start): Likewise.
2310 (gpgme_op_keylist_ext_start): Likewise.
2311 (gpgme_op_keylist_next): Likewise.
2312 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2313 (_gpgme_passphrase_command_handler_internal): Likewise.
2314 * sign.c (gpgme_op_sign_result): Likewise.
2315 (_gpgme_sign_status_handler): Likewise.
2316 (_gpgme_op_sign_init_result): Likewise.
2318 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2319 access to pointer type.
2321 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2323 * engine.h (EngineCommandHandler): Change last argument to int fd.
2324 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2326 (gpgme_edit_cb_t): Change last argument to int fd.
2327 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2328 * passphrase.c: Include <assert.h>.
2329 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2330 (release_op_data): Check values before calling free.
2331 (_gpgme_passphrase_status_handler): Likewise.
2332 (_gpgme_passphrase_command_handler_internal): New function.
2333 (_gpgme_passphrase_command_handler): Rewritten.
2334 * edit.c (edit_status_handler): Pass -1 as fd argument.
2335 (command_handler): Update prototype. New variable processed. Use
2336 it to store return value of
2337 _gpgme_passphrase_command_handler_internal which is now used
2338 instead _gpgme_passphrase_command_handler. Use it also to check
2339 if we should call the user's edit function. Pass fd to user's
2341 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2343 (gpg_release): Check value before calling free. Do not release
2345 (command_cb): Function removed.
2346 (command_handler): New function. Thus we don't use a data object
2347 for command handler stuff anymore, but handle it directly. This
2348 allows proper error reporting (cancel of passphrase requests, for
2349 example). Also all callbacks work via direct writes to the file
2350 descriptor (so that passphrases are not kept in insecure memory).
2351 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2352 (read_status): Check cmd.keyword before calling free. Install
2353 command_handler as the I/O callback handler with GPG as private
2356 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2358 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2359 decrypt_verify_start.
2360 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2361 (gpgme_op_decrypt_verify): Likewise.
2362 * verify.c (verify_status_handler): New function that also calls
2363 progress status handler.
2364 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2365 Rename to (verify_start).
2366 (gpgme_op_verify_start): Call verify_start.
2367 (gpgme_op_verify): Likewise.
2368 * encrypt.c (encrypt_status_handler): New function.
2369 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2370 Make static. Rename to encrypt_sym_status_handler.
2371 (encrypt_start): Set status handler to encrypt_sym_status_handler
2372 or encrypt_status_handler.
2373 * sign.c (sign_status_handler): New function.
2374 (sign_start): Set status handler to sign_status_handler.
2375 * decrypt.c (decrypt_status_handler): New function that also calls
2376 progress status handler.
2377 (decrypt_start): Set status handler to decrypt_status_handler.
2378 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2379 * decrypt-verify.c (decrypt_verify_status_handler): Call
2380 _gpgme_progress_status_handler.
2382 * conversion.c (_gpgme_decode_c_string): Add missing break
2385 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2386 to buffer to allocate.
2388 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2390 * verify.c (parse_new_sig): Fix ERRSIG case.
2391 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2393 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2395 * gpgme.h: The following types are renamed. The old name is kept
2396 as a deprecated typedef.
2397 (GpgmeCtx): Rename to gpgme_ctx_t.
2398 (GpgmeData): Rename to gpgme_data_t.
2399 (GpgmeRecipients): Rename to gpgme_recipients_t.
2400 (GpgmeError): Rename to gpgme_error_t.
2401 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2402 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2403 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2404 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2405 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2406 (GpgmeAttr): Rename to gpgme_attr_t.
2407 (GpgmeValidity): Rename to gpgme_validity_t.
2408 (GpgmeProtocol): Rename to gpgme_protocol_t.
2409 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2410 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2411 (GpgmeSubkey): Rename to gpgme_subkey_t.
2412 (GpgmeKeySig): Rename to gpgme_keysig_t.
2413 (GpgmeUserID): Rename to gpgme_user_id_t.
2414 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2415 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2416 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2417 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2418 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2419 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2420 (GpgmeEventIO): Rename to gpgme_event_io_t.
2421 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2422 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2423 (gpgme_io_cbs_t): New type.
2424 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2425 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2426 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2427 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2428 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2429 (gpgme_data_cbs_t): New type.
2430 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2431 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2432 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2433 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2434 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2435 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2436 (GpgmeSignature): Rename to gpgme_signature_t.
2437 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2438 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2439 (GpgmeImportResult): Rename to gpgme_import_result_t.
2440 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2441 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2442 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2443 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2444 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2445 GPGME_No_Passphrase.
2446 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2447 * context.h (struct gpgme_context_s): Rename to struct
2449 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2451 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2453 * keylist.c (finish_key): Clear OPD->tmp_uid.
2455 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2457 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2458 for NODATA status without signatures.
2460 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2462 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2463 (_gpgme_key_add_sig): Likewise.
2465 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2467 * context.h (struct gpgme_context_s): Remove member op_info.
2469 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2471 * gpgme.h (GpgmeError): Add deprecated values for
2472 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2474 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2476 * gpgme.h (gpgme_get_op_info): Remove prototype.
2477 * ops.h (_gpgme_set_op_info,
2478 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2479 _gpgme_data_append, _gpgme_data_append_string,
2480 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2481 _gpgme_data_append_percentstring_for_xml): Likewise.
2482 (_gpgme_progress_status_handler): Change first arg to void *.
2483 * progress.c (_gpgme_progress_status_handler): Likewise.
2484 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2485 and <sys/types.h>, but <string.h>.
2486 (_gpgme_data_append): Remove function.
2487 (_gpgme_data_append_string): Likewise.
2488 (_gpgme_data_append_for_xml): Likewise.
2489 (_gpgme_data_append_string_for_xml): Likewise.
2490 (_gpgme_data_append_percentstring_for_xml): Likewise.
2491 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2492 (_gpgme_data_release_and_return_string): Likewise.
2493 * gpgme.c (gpgme_get_op_info): Likewise.
2494 (_gpgme_set_op_info): Likewise.
2496 * gpgme.h (struct _gpgme_key): New structure.
2497 (GpgmeKey): Define using _gpgme_key.
2498 (struct _gpgme_subkey): New structure.
2499 (GpgmeSubKey): New type.
2500 (struct _gpgme_key_sig): New structure.
2501 (GpgmeKeySig): New type.
2502 (struct _gpgme_user_id): New structure.
2503 (GpgmeUserID): New type.
2504 (struct _gpgme_op_keylist_result): New structure.
2505 (GpgmeKeyListResult): New type.
2506 (gpgme_op_keylist_result): New function.
2507 (gpgme_key_get_as_xml): Remove prototype.
2508 * context.h (struct gpgme_context_s): Remove members tmp_key,
2509 tmp_uid, key_cond and key_queue.
2510 (struct key_queue_item_s): Remove structure.
2511 (struct user_id_s): Remove structure.
2512 (struct gpgme_recipients_s): Replace with simple
2514 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2515 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2516 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2517 * rungpg.c (command_cb): Return GpgmeError instead int.
2518 New variable ERR. Use it to hold return value of cmd handler.
2519 (gpg_delete): Access fingerprint of key directly.
2520 (append_args_from_signers): Likewise.
2521 (gpg_edit): Likewise.
2522 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2523 * engine-gpgsm.c: Do not include "key.h".
2524 (gpgsm_delete): Access fingerprint of key directly.
2525 (gpgsm_sign): Likewise.
2526 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2528 * key.h: File removed.
2529 * key.c: Completely reworked to use exposed GpgmeKey data types.
2530 * keylist.c: Likewise.
2531 * recipient.c: Completely reworked to use GpgmeUserID.
2533 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2535 * gpgme.h (gpgme_get_key): Remove force_update argument.
2536 * key-cache.c: File removed.
2537 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2538 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2540 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2541 _gpgme_key_cache_add.
2542 (gpgme_get_key): New function.
2543 * verify.c (gpgme_get_sig_key): Remove last argument to
2544 gpgme_get_key invocation.
2546 * gpgme.h (struct _gpgme_trust_item): New structure.
2547 (GpgmeTrustItem): New type.
2548 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2549 * context.h (struct trust_queue_item_s): Remove structure.
2550 (struct gpgme_context_s): Remove trust_queue member.
2551 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2552 * trust-item.c: New file.
2553 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2555 (struct trust_queue_item_s): Change to new type op_data_t.
2556 (trust_status_handler): Change first argument to void *.
2557 (trust_colon_handler): Likewise.
2558 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2559 (gpgme_op_trustlist_start): Use op_data_t and rework error
2561 (gpgme_op_trustlist_next): Use op_data_t.
2562 (gpgme_trust_item_release): Remove function.
2563 (gpgme_trust_item_get_string_attr): Likewise.
2564 (gpgme_trust_item_get_int_attr): Likewise.
2566 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2569 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2571 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2572 (struct gpgme_context_s): Remove member notation.
2573 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2575 * gpgme.h (struct _gpgme_sig_notation): New structure.
2576 (GpgmeSigNotation): New type.
2577 (struct _gpgme_signature): New structure.
2578 (GpgmeSignature): New type.
2579 (struct _gpgme_op_verify_result): New structure.
2580 (GpgmeVerifyResult): New type.
2581 (gpgme_op_verify_result): New prototype.
2582 (gpgme_get_notation): Remove prototype.
2583 * ops.h (_gpgme_op_verify_init_result): New prototype.
2584 (_gpgme_verify_status_handler): Change first argument to void *.
2585 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2587 * conversion.c (_gpgme_decode_percent_string): New function.
2588 (gnupg_errors): New static global.
2589 (_gpgme_map_gnupg_error): New function.
2590 * gpgme.c (gpgme_release): Don't release CTX->notation.
2591 (gpgme_get_notation): Remove function.
2592 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2593 _gpgme_op_verify_init_result.
2594 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2595 do include "gpgme.h".
2596 (struct verify_result): Replace with ...
2597 (op_data_t): ... this type.
2598 (release_verify_result): Remove function.
2599 (release_op_data): New function.
2600 (is_token): Remove function.
2601 (skip_token): Remove function.
2602 (copy_token): Remove function.
2603 (gpgme_op_verify_result): New function.
2604 (calc_sig_summary): Rewritten.
2605 (finish_sig): Remove function.
2606 (parse_new_sig): New function.
2607 (parse_valid_sig): New function.
2608 (parse_notation): New function.
2609 (parse_trust): New function.
2610 (parse_error): New function.
2611 (_gpgme_verify_status_handler): Rewritten. Change first argument
2613 (_gpgme_op_verify_start): Rework error handling. Call
2614 _gpgme_op_verify_init_result.
2615 (gpgme_op_verify): Do not release or clear CTX->notation.
2616 (gpgme_get_sig_status): Rewritten.
2617 (gpgme_get_sig_string_attr): Likewise.
2618 (gpgme_get_sig_ulong_attr): Likewise.
2619 (gpgme_get_sig_key): Likewise.
2621 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2622 (GpgmeDecryptResult): New type.
2623 (gpgme_op_decrypt_result): New prototype.
2624 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2625 (_gpgme_decrypt_status_handler): Fix prototype.
2626 (_gpgme_decrypt_start): Remove prototype.
2627 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2628 <string.h> and <assert.h>, "util.h" and "context.h", but
2630 (decrypt_verify_status_handler): Change first argument to void *,
2631 and rework error handling.
2632 (_gpgme_op_decrypt_verify_start): New function.
2633 (gpgme_op_decrypt_verify_start): Rewrite using
2634 _gpgme_op_decrypt_verify_start.
2635 (gpgme_op_decrypt_verify): Likewise.
2636 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2637 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2638 (is_token): Remove function.
2639 (release_op_data): New function.
2640 (skip_token): Remove function.
2641 (gpgme_op_decrypt_result): New function.
2642 (_gpgme_decrypt_status_handler): Change first argument to void *.
2643 Rework error handling.
2644 (_gpgme_decrypt_start): Rename to ...
2645 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2646 (_gpgme_op_decrypt_init_result): New function.
2647 (gpgme_op_decrypt_start): Use decrypt_start.
2648 (gpgme_op_decrypt): Likewise.
2650 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2652 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2653 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2654 (_gpgme_op_encrypt_sign_start): Rename to ...
2655 (encrypt_sign_start): ... this.
2656 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2657 _gpgme_op_encrypt_sign_start.
2658 (gpgme_op_encrypt_sign): Likewise.
2660 * gpgme.h (GpgmeEncryptResult): New data type.
2661 (gpgme_op_encrypt_result): New prototype.
2662 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2663 (_gpgme_op_encrypt_status_handler): Fix prototype.
2664 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2665 _gpgme_op_encrypt_init_result.
2666 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2667 "wait.h". Include <errno.h> and "gpgme.h".
2668 (SKIP_TOKEN_OR_RETURN): Remove macro.
2669 (struct encrypt_result): Rename to ...
2670 (op_data_t): ... new data type. Rewrite for user result data.
2671 (append_xml_encinfo): Remove function.
2672 (release_op_data): New function.
2673 (gpgme_op_encrypt_result): New function.
2674 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2675 Rewrite result parsing.
2676 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2678 (_gpgme_op_encrypt_init_result): New function.
2679 (_gpgme_op_encrypt_start): Rename to ...
2680 (encrypt_start): ... this.
2681 (gpgme_op_encrypt_start): Use encrypt_start, not
2682 gpgme_op_encrypt_start.
2683 (gpgme_op_encrypt): Likewise.
2685 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2686 GpgmeNewSignature, GpgmeSignResult): New data types.
2687 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2688 gpgme_hash_algo_name): New prototypes.
2689 * gpgme.c (gpgme_pubkey_algo_name): New function.
2690 (gpgme_hash_algo_name): Likewise.
2691 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2693 (_gpgme_op_sign_status_handler): Fix prototype.
2694 * op-support.c: Include <errno.h> and <string.h>.
2695 (_gpgme_parse_inv_userid): New function.
2696 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2697 <assert.h> and "util.h".
2698 (SKIP_TOKEN_OR_RETURN): Remove macro.
2699 (struct sign_result): Change to op_data_t type and rework it.
2700 (release_sign_result): Rename to ...
2701 (release_op_data): ... this and rewrite it.
2702 (append_xml_info): Remove function.
2703 (gpgme_op_sign_result): New function.
2704 (parse_sig_created): New function.
2705 (_gpgme_sign_status_handler): Change first argument to void *.
2706 Rewrite the function to use the new result structure and functions.
2707 (_gpgme_op_sign_init_result): New function.
2708 (_gpgme_op_sign_start): Rename to ...
2709 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2710 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2711 (gpgme_op_sign): Likewise.
2712 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2713 _gpgme_op_sign_init_result.
2715 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2717 (enum delete_problem): Move into function delete_status_handler.
2718 (delete_status_handler): Change first argument to void *. Parse
2719 delete problem with strtol instead atoi. Return better error
2721 (_gpgme_op_delete_start): Rename to ...
2722 (delete_start): ... this. Rework error handling.
2723 (gpgme_op_delete_start): Use delete_start instead
2724 _gpgme_op_delete_start.
2725 (gpgme_op_delete): Likewise.
2726 * gpgme.h (GpgmeDataType): Removed.
2728 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2730 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2731 * import.c (parse_import_res): Parse unchanged field.
2733 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2734 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2735 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2736 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2737 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
2738 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
2739 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
2740 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
2741 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
2742 (struct _gpgme_import_status): New structure.
2743 (GpgmeImportStatus): New type.
2744 (struct _gpgme_op_import_result): New structure.
2745 (GpgmeImportResult): New type.
2746 (gpgme_op_import_result): New function.
2747 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
2748 (struct import_result): Change to type op_data_t.
2749 (release_import_result): Rename to ...
2750 (release_op_data): ... this.
2751 (append_xml_impinfo): Function removed.
2752 (gpgme_op_import_result): New function.
2753 (parse_import): New function.
2754 (parse_import_res): Likewise.
2755 (import_status_handler): Change first argument to void *. Rewrite
2756 to use new functions.
2757 (_gpgme_op_import_start): Rework error handling.
2759 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
2760 (edit_resut): Change to typedef for op_data_t.
2761 (edit_status_handler): Change first argument to void *.
2762 Rework error handling.
2763 (command_handler): Rework error handling.
2764 (_gpgme_op_edit_start): Rename to ...
2765 (edit_start): ... this. Rework error handling.
2766 (gpgme_op_edit_start): Rewrite using edit_start.
2767 (gpgme_op_edit): Likewise.
2769 * ops.h (_gpgme_passphrase_start): Remove prototype.
2770 * passphrase.c: Do not include <assert.h>, "util.h" or
2771 "debug.h", but "gpgme.h".
2772 (struct passphrase_result): Change to typedef for op_data_t.
2773 (release_passphrase_result): Rename to release_op_data.
2774 (_gpgme_passphrase_status_handler): Change first argument to void *.
2775 Use new op_data_t type.
2776 (_gpgme_passphrase_command_handler): Use new op_data_t type.
2777 (_gpgme_passphrase_start): Remove function.
2778 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
2779 not call _gpgme_passphrase_start, but install command handler.
2780 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2781 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2782 * sign.c (_gpgme_op_sign_start): Likewise.
2784 * context.h (struct gpgme_context_s): Remove member initialized,
2785 use_cms and help_data_1. Add member protocol. Make use_armor and
2786 use_textmode bit flags. Make keylist_mode, include_certs,
2787 signers_len and signers_size unsigned.
2788 * gpgme.c (gpgme_new): Initialize CTX->protocol.
2789 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
2790 (gpgme_get_protocol): Likewise.
2791 (gpgme_release): Do not release CTX->help_data_1.
2792 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
2794 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
2796 * data.c: Do not include <assert.h>, but "gpgme.h".
2797 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
2798 it will go. Do not assert DH.
2799 (_gpgme_data_outbound_handler): Do not assert DH.
2801 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
2803 (export_status_handler): Change type of first argument to void *.
2804 (_gpgme_op_export_start): Rename to ...
2805 (export_start): ... this. Rework error handling.
2806 (gpgme_op_export_start): Rewritten to use export_start instead
2807 _gpgme_op_export_start.
2808 (gpgme_op_export): Likewise.
2810 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
2811 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
2812 GPGME_No_Passphrase): New macros.
2814 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
2816 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
2818 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
2819 (GpgmeGenKeyResult): New type.
2820 (gpgme_op_genkey): Drop last argument.
2821 (gpgme_op_genkey_result): New function.
2822 * genkey.c: Do not include "util.h", but "gpgme.h".
2823 (struct genkey_result): Replace with ...
2824 (op_data_t): ... this new type.
2825 (release_genkey_result): Replace with ...
2826 (release_op_data): ... this new function.
2827 (gpgme_op_genkey_result): New function.
2828 (genkey_status_handler): Rewritten using new op_data_t type.
2829 (get_key_parameter): New function.
2830 (_gpgme_op_genkey_start): Renamed to
2831 (genkey_start): ... this and rewritten.
2832 (gpgme_op_genkey_start): Use genkey_start instead
2833 _gpgme_op_genkey_start.
2834 (gpgme_op_genkey): Rewritten. Remove FPR argument.
2836 * context.h (struct gpgme_context_s): Remove member verbosity.
2837 * gpgme.c (gpgme_new): Do not set member verbosity.
2838 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
2839 * engine.c (_gpgme_engine_set_verbosity): Remove function.
2840 * engine-backend.h (struct engine_ops): Remove set_verbosity.
2841 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
2842 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
2843 (gpg_set_verbosity): Remove function.
2844 * decrypt.c (_gpgme_decrypt_start): Don't call
2845 _gpgme_engine_set_verbosity.
2846 * delete.c (_gpgme_op_delete_start): Likewise.
2847 * edit.c (_gpgme_op_edit_start): Likewise.
2848 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2849 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2850 * export.c (_gpgme_op_export_start): Likewise.
2851 * genkey.c (_gpgme_op_genkey_start): Likewise.
2852 * import.c (_gpgme_op_import_start): Likewise.
2853 * keylist.c (gpgme_op_keylist_start): Likewise.
2854 (gpgme_op_keylist_ext_start): Likewise.
2855 * sign.c (_gpgme_op_sign_start): Likewise.
2856 * verify.c (_gpgme_op_verify_start): Likewise.
2858 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
2859 * key.c (key_cache_initialized, key_cache_size,
2860 key_cache_max_chain_length, ): Removed.
2861 (struct key_cache_item_s, key_cache_lock, key_cache,
2862 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
2863 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
2864 * key-cache.c: ... here. New file.
2865 * key.h (_gpgme_key_cache_init): Remove prototypes.
2866 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
2868 * version.c: Do not include "key.h".
2869 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
2871 * mkstatus: Strip trailing comma.
2872 * gpgme.h (GpgmeStatus): Pretty print.
2874 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
2875 GPGME_Bad_Passphrase.
2876 * passphrase.c (_gpgme_passphrase_status_handler): Use
2877 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
2879 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
2880 GPGME_No_UserID and GPGME_Invalid_Recipient to
2881 GPGME_Invalid_UserID.
2882 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
2883 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
2884 GPGME_Invalid_Recipient.
2885 (_gpgme_op_encrypt_start): Likewise.
2887 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
2888 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
2889 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
2890 * wait-global.c (gpgme_wait): Likewise.
2891 * verify.c (_gpgme_op_verify_start): Likewise.
2892 (gpgme_get_sig_status): Don't check pending flag.
2893 (gpgme_get_sig_string_attr): Likewise.
2894 (gpgme_get_sig_ulong_attr): Likewise.
2895 (gpgme_get_sig_key): Likewise.
2896 * op-support.c (_gpgme_op_reset): Likewise.
2897 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
2898 (gpgme_op_trustlist_next): Don't check or clear pending flag.
2899 (gpgme_op_trustlist_end): Likewise.
2900 * sign.c (_gpgme_op_sign_start): Likewise.
2901 * context.h (struct gpgme_context_s): Remove member PENDING.
2902 * decrypt.c (_gpgme_decrypt_start): Likewise.
2903 * delete.c (_gpgme_op_delete_start): Likewise.
2904 * edit.c (_gpgme_op_edit_start): Likewise.
2905 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2906 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2907 * export.c (_gpgme_op_export_start): Likewise.
2908 * genkey.c (_gpgme_op_genkey_start): Likewise.
2909 * import.c (_gpgme_op_import_start): Likewise.
2910 * key.c (gpgme_get_key): Likewise.
2911 * keylist.c (gpgme_op_keylist_start): Likewise.
2912 (gpgme_op_keylist_ext_start): Likewise.
2913 (gpgme_op_keylist_next): Likewise.
2914 (gpgme_op_keylist_end): Likewise.
2915 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
2917 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
2919 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
2920 and add argument for returning the result string.
2921 (gpgme_cancel): Remove prototype.
2922 * gpgme.c (gpgme_cancel): Remove function.
2923 * context.h (struct gpgme_context_s): Remove member cancel.
2924 * passphrase.c (_gpgme_passphrase_command_handler): Call the
2925 passphrase callback in the new way.
2927 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2929 * edit.c (_gpgme_edit_status_handler): Call the progress status
2932 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
2934 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
2935 I/O handlers left to ...
2936 (_gpgme_user_io_cb_handler): ... here.
2938 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2940 * trustlist.c (trustlist_colon_handler): Release ITEM if name
2941 could not be allocated.
2942 (gpgme_trust_item_release): Only release name if it is allocated.
2943 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
2945 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2947 * rungpg.c (read_status): If he status handler returns an error,
2949 (status_handler): If read_status fails, just return the error.
2951 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2953 * engine-gpgsm.c (start): Handle all errors, not only most of
2955 (xtoi_1, xtoi_2): Remove macro.
2956 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
2958 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2960 * engine-gpgsm.c (map_assuan_error): Replace
2961 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
2962 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
2964 * util.h (DIMof): Remove macro.
2966 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
2967 _gpgme_data_unread): Prototypes removed.
2969 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2971 * types.h: File removed.
2972 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
2973 * io.h (struct spawn_fd_item_s): Do not include "types.h".
2975 * context.h: Likewise.
2976 * cengine-gpgsm.h: Likewise.
2977 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
2978 for EngineStatusHandler, EngineColonLineHandler and
2979 EngineCommandHandler.
2980 (_gpgme_engine_set_status_handler): Change parameter type from
2981 GpgmeStatusHandler to EngineStatusHandler.
2982 (_gpgme_engine_set_command_handler): Change parameter type from
2983 GpgmeCommandHandler to EngineCommandHandler.
2984 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2985 GpgmeColonLineHandler to EngineColonLineHandler.
2986 * engine-backend.h: Include "engine.h" instead "types.h".
2987 (struct engine_ops): Change Gpgme*Handler parameters in members
2988 set_command_handler, set_colon_line_handler and set_status_handler
2990 * engine.c (_gpgme_engine_set_status_handler): Change parameter
2991 type from GpgmeStatusHandler to EngineStatusHandler.
2992 (_gpgme_engine_set_command_handler): Change parameter type from
2993 GpgmeCommandHandler to EngineCommandHandler.
2994 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2995 GpgmeColonLineHandler to EngineColonLineHandler.
2996 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
2997 from GpgmeStatusHandler to EngineStatusHandler. Change type of
2998 member colon.fnc from GpgmeColonLineHandler to
2999 EngineColonLineHandler. Change type of member cmd.fnc from
3000 GpgmeCommandHandler to EngineCommandHandler.
3001 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3002 * rungpg.c (gpg_set_status_handler): Change parameter type from
3003 GpgmeStatusHandler to EngineStatusHandler.
3004 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3005 (assuan_simple_command): Likewise.
3006 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3007 from GpgmeColonLineHandler to EngineColonLineHandler.
3008 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3009 * rungpg.c (gpg_set_command_handler): Change parameter type from
3010 GpgmeCommandHandler to EngineCommandHandler.
3012 * engine-gpgsm.c (status_handler): Do not close status fd at end
3015 * ops.h (_gpgme_op_data_lookup): Add prototype.
3016 * op-support.c: Include <stdlib.h>.
3017 (_gpgme_op_data_lookup): New function.
3018 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3019 (struct decrypt_result_s): Rename to ...
3020 (struct decrypt_resul): ... this.
3021 (DecryptResult): New type.
3022 (_gpgme_decrypt_status_handler): Don't use
3023 test_and_allocate_result, but use _gpgme_op_data_lookup to
3024 retrieve result data object.
3025 * sign.c (_gpgme_release_sign_result): Function removed.
3026 (release_sign_result): New function.
3027 (struct sign_result_s): Rename to ...
3028 (struct sign_result): ... this.
3029 (SignResult): New type.
3030 (_gpgme_sign_status_handler): Don't use
3031 test_and_allocate_result, but use _gpgme_op_data_lookup to
3032 retrieve result data object.
3033 * encrypt.c (struct encrypt_result_s): Rename to ...
3034 (struct encrypt_result): ... this.
3035 (_gpgme_release_encrypt_result): Function removed.
3036 (release_encrypt_result): New function.
3037 (_gpgme_encrypt_status_handler): Don't use
3038 test_and_allocate_result, but use _gpgme_op_data_lookup to
3039 retrieve result data object.
3040 * verify.c (struct verify_result_s): Rename to ...
3041 (struct verify_result): ... this. Remove member next.
3042 (VerifyResult): New type.
3043 (_gpgme_release_verify_result): Function removed.
3044 (release_verify_result): New function.
3045 (finish_sig): Change first argument to type VerifyResult. Diddle
3046 the type of the op_data structure.
3047 (add_notation): Change first argument to type VerifyResult.
3048 (_gpgme_verify_status_handler): Don't use
3049 test_and_allocate_result, but use _gpgme_op_data_lookup to
3050 retrieve result data object.
3051 * passphrase.c (struct passphrase_result_s): Rename to ...
3052 (struct passphrase_result): ... this. Remove member next.
3053 (PassphraseResult): New type.
3054 (_gpgme_release_passphrase_result): Function removed.
3055 (release_passphrase_result): New function.
3056 (_gpgme_passphrase_status_handler): Don't use
3057 test_and_allocate_result, but use _gpgme_op_data_lookup to
3058 retrieve result data object.
3059 (_gpgme_passphrase_command_handler): Likewise.
3060 * keylist.c (struct keylist_result_s): Rename to ...
3061 (struct keylist_result): ... this. Remove member next.
3062 (KeylistResult): New type.
3063 (_gpgme_release_keylist_result): Function removed.
3064 (release_keylist_result): New function.
3065 (keylist_status_handler): Don't use
3066 test_and_allocate_result, but use _gpgme_op_data_lookup to
3067 retrieve result data object.
3068 * edit.c (struct edit_result_s): Rename to ...
3069 (struct edit_result): ... this. Remove member next.
3070 (EditResult): New type.
3071 (_gpgme_release_edit_result): Function removed.
3072 (release_edit_result): New function.
3073 (edit_status_handler): Don't use
3074 test_and_allocate_result, but use _gpgme_op_data_lookup to
3075 retrieve result data object.
3076 (command_handler): Likewise.
3077 * types.h (DecryptResult, SignResult, EncryptResult,
3078 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3079 KeylistResult, EditResult): Types removed.
3080 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3081 (test_and_allocate_result): Remove macro.
3082 (_gpgme_release_decrypt_result): Remove prototype.
3083 (_gpgme_decrypt_result): Remove prototype.
3084 (_gpgme_release_sign_result): Remove prototype.
3085 (_gpgme_release_encrypt_result): Remove prototype.
3086 (_gpgme_release_passphrase_result): Remove prototype.
3087 (_gpgme_release_import_result): Remove prototype.
3088 (_gpgme_release_delete_result): Remove prototype.
3089 (_gpgme_release_genkey_result): Remove prototype.
3090 (_gpgme_release_keylist_result): Remove prototype.
3091 (_gpgme_release_edit_result): Remove prototype.
3092 (_gpgme_release_verify_result): Remove prototype.
3093 * gpgme.c (_gpgme_release_result): Rewritten.
3094 * context.h (enum ctx_op_data_type): New enum.
3095 (struct ctx_op_data): New structure.
3096 (struct gpgme_context_s): Replace the member result with a member
3098 (fail_on_pending_request): Remove macro.
3099 * op-support.c (_gpgme_op_reset): Expand macro
3100 fail_on_pending_request.
3101 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3103 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3105 * types.h (EngineObject): Move typedef to ...
3106 * engine.h: ... here.
3107 * types.h (GpgObject): Move typedef to ...
3108 * rungpg.c: ... here.
3109 * types.h (GpgsmObject): Move typedef to ...
3110 * engine-gpgsm.c: ... here.
3112 * util.h (return_if_fail, return_null_if_fail,
3113 return_val_if_fail): Remove macro.
3114 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3115 * key.c (gpgme_key_ref): Likewise.
3116 * signers.c (gpgme_signers_enum): Likewise.
3117 (gpgme_signers_clear): Likewise.
3119 * engine-backend.h (struct engine_ops): Rename get_path to
3121 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3123 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3124 util.h. Other clean ups.
3125 (parse_version_number): Protect more seriously against
3127 (gpgme_get_engine_info): Move to ...
3128 * engine.c (gpgme_get_engine_info): ... here.
3129 (_gpgme_engine_get_info): Function removed.
3130 (_gpgme_engine_get_path): Make static and rename to ...
3131 (engine_get_file_name): .. this.
3132 (_gpgme_engine_get_version): Make static and rename to ...
3133 (engine_get_version): ... this.
3134 (_gpgme_engine_get_req_version): Make static and rename to ...
3135 (engine_get_req_version): ... this.
3136 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3137 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3140 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3141 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3142 (gpgme_get_protocol_name): New function.
3144 * engine-backend.h (struct engine_ops): New member
3145 get_req_version, remove member check_version.
3146 * engine.h (_gpgme_Engine_get_version): New prototype.
3147 * rungpg.c (gpg_get_req_version): New function.
3148 (gpg_check_version): Function removed.
3149 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3151 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3152 (gpgsm_check_version): Function removed.
3153 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3154 gpgsm_check_version.
3155 * engine.c: Include ops.h.
3156 (_gpgme_engine_get_req_version): New function.
3157 (gpgme_engine_check_version): Rewritten.
3158 * version.c (gpgme_get_engine_info): Rewritten.
3159 * gpgme.h (gpgme_engine_info): New structure.
3160 (GpgmeEngineInfo): New type.
3162 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3164 * types.h: Remove byte and ulong types.
3165 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3167 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3169 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3170 few more escaped characters. Be more strict about buffer size.
3171 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3172 BUF and DST to unsigned char instead byte.
3173 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3175 * debug.c (trim_spaces): Likewise.
3177 * util.h (mk_error): Remove macro.
3178 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3179 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3180 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3181 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3182 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3183 wait-private (literally everywhere): Expand the mk_error macro.
3185 * context.h (wait_on_request_or_fail): Remove macro.
3187 * context.h (gpgme_context_s): Remove member ERROR.
3188 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3189 (GpgmeCommandHandler): Change return type to GpgmeError and add
3190 new argument RESULT.
3191 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3192 (GpgmeEventIO): New event GPGME_EVENT_START.
3193 (GpgmeIdleFunc): Remove type.
3194 (gpgme_register_idle): Remove prototype.
3195 * data.c: Include <assert.h>.
3196 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3197 Return any error instead ignoring it, don't close file descriptor
3199 (_gpgme_data_outbound_handler): Likewise.
3200 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3201 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3202 Return error instead setting ctx->error. Return success at end of
3204 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3205 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3206 type to GpgmeError. Return possible errors.
3207 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3209 (delete_status_handler): Change return type to GpgmeError. Return
3210 error instead setting ctx->error. Return success at end of
3212 * edit.c: Do not include <stdio.h> and <string.h>.
3213 (_gpgme_edit_status_handler): Change type to GpgmeError,
3214 make static and rename to ...
3215 (edit_status_handler): ... this. Return error directly.
3216 (command_handler): Change return type to GpgmeError, add result
3217 argument. Return error directly.
3218 * encrypt.c (status_handler_finish): Remove function.
3219 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3220 Return error directly.
3221 (_gpgme_encrypt_sym_status_handler): Likewise.
3222 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3223 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3225 (status_handler): Change return type to GpgmeError. Diddle things
3226 around a bit to return errors directly.
3227 (start): Send start event.
3228 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3229 (export_status_handler): Change return type to GpgmeError. Don't
3231 * genkey.c: Do not include <stdio.h> and <assert.h>.
3232 (genkey_status_handler): Change return type to GpgmeError. Don't
3233 check ctx->error. Return errors directly.
3234 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3235 (_gpgme_op_event_cb): Function removed.
3236 (_gpgme_op_event_cb_user): Likewise.
3237 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3238 (import_status_handler): Change return type to GpgmeError. Don't
3240 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3241 Change return type to GpgmeError, return error directly.
3242 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3243 wait-private.c and wait-user.c
3244 * ops.h (test_and_allocate_result): Return error instead setting
3246 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3247 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3248 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3249 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3250 Change return type to GpgmeError.
3251 (_gpgme_passphease_command_handler): Change return type to
3252 GpgmeError and add new argument RESULT.
3253 * op-support.c: Use new callback functions, and change private
3254 data to ctx everywhere.
3255 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3256 type to GpgmeError, return error directly.
3257 (_gpgme_passphrase_command_handler): Change return type to
3258 GpgmeError, add result argument. Return results accordingly.
3259 * progress.c (_gpgme_progress_status_handler): Change return type
3260 to GpgmeError, return errors directly.
3261 * rungpg.c (status_handler): Change return type to GpgmeError.
3262 Return error directly.
3263 (close_notify_handler): Don't send done event.
3264 (colon_line_handler): Change return type to GpgmeError, return
3266 * rungpg.c (start): Send start event.
3267 * sign.c (_gpgme_sign_status_handler): Change return type to
3268 GpgmeError, return errors directly.
3269 * trustlist.c (trustlist_status_handler): Change return type to
3270 GpgmeError. Return 0.
3271 (trustlist_colon_handler): Change return type GpgmeError. Return
3273 * verify.c (add_notation): Change return type to GpgmeError,
3274 return errors directly.
3275 (_gpgme_verify_status_handler): Likewise.
3276 * wait.h (struct fd_table): Remove lock member.
3277 (struct wait_item_s): Moved here from wait.c.
3278 (struct tag): New structure.
3279 (_gpgme_wait_event_cb): Remove prototype.
3280 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3281 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3282 _gpgme_wait_user_event_io_cb): New prototypes.
3283 * wait.c: Don't include <stdio.h>.
3284 (ftd_global, ctx_done_list, ctx_done_list_size,
3285 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3287 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3289 (gpgme_wait): Move to file wait-global.c.
3290 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3291 member in wait item and tag.
3292 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3293 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3295 (gpgme_fd_table_init): Don't initialize FDT->lock.
3296 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3297 (_gpgme_fd_table_put): Make static and rename to ...
3298 (fd_table_put): ... this function. Don't use FDT->lock.
3299 (struct wait_item_s): Move to wait.h.
3300 * wait-global.c: New file.
3301 * wait-private.c: New file.
3302 * wait-user.c: New file.
3304 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3305 instead otrust_to_string to calculate validity.
3307 2003-01-19 Miguel Coca <mcoca@gnu.org>
3309 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3311 * w32-util.c: Include "sema.h".
3312 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3315 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3317 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3318 (gpg_start): Rename to ...
3319 (start): ... this function. Change arguments to GpgObject.
3320 (gpg_decrypt): Call start.
3321 (gpg_edit): Likewise.
3322 (gpg_encrypt): Likewise.
3323 (gpg_encrypt_sign): Likewise.
3324 (gpg_export): Likewise.
3325 (gpg_import): Likewise.
3326 (gpg_keylist): Likewise.
3327 (gpg_keylist_ext): Likewise.
3328 (gpg_trustlist): Likewise.
3329 (gpg_verify): Likewise.
3331 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3332 (gpgsm_start): Rename to ...
3333 (struct gpgsm_object_s): Remove member command.
3334 (gpgsm_release): Don't free command.
3335 (start): ... this function. Change arguments to GpgsmObject and
3337 (gpgsm_decrypt): Call start.
3338 (gpgsm_delete): Likewise.
3339 (gpgsm_encrypt): Likewise.
3340 (gpgsm_export): Likewise.
3341 (gpgsm_genkey): Likewise.
3342 (gpgsm_import): Likewise.
3343 (gpgsm_keylist): Likewise.
3344 (gpgsm_keylist_ext): Likewise.
3345 (gpgsm_verify): Likewise.
3347 * decrypt.c (_gpgme_decrypt_start): Don't call
3348 _gpgme_engine_start.
3349 * delete.c (_gpgme_op_delete_start): Likewise.
3350 * edit.c (_gpgme_op_edit_start): Likewise.
3351 * encrypt.c (_gpgme_op_encrypt_start):
3352 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3353 * export.c (_gpgme_op_export_start): Likewise.
3354 * genkey.c (_gpgme_op_genkey_start): Likewise.
3355 * import.c (_gpgme_op_import_start): Likewise.
3356 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3357 (gpgme_op_keylist_start): Likewise.
3358 * sign.c (_gpgme_op_sign_start): Likewise.
3359 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3360 * verify.c (_gpgme_op_verify_start): Likewise.
3362 * engine-backend.h (struct engine_ops): Remove member start.
3364 * engine.h (_gpgme_engine_start): Remove prototype.
3365 * engine.c (_gpgme_engine_start): Remove function.
3367 2003-01-06 Werner Koch <wk@gnupg.org>
3369 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3370 since gpg 1.3 to denote disabled keys.
3372 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3374 * data-mem.c: Include <string.h>.
3375 * engine.c: Likewise.
3377 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3379 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3381 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3383 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3385 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3387 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3388 (_gpgme_intersect_stati): Function removed.
3389 * ops.h (_gpgme_intersect_stati): Remove prototype.
3391 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3393 * libgpgme.vers: New file.
3394 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3395 (libgpgme_version_script_cmd): New variable.
3396 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3397 (libgpgme_la_DEPENDENCIES): New variable.
3399 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3401 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3402 (otrust_to_string): New function.
3403 (gpgme_key_get_as_xml): Use it.
3404 (validity_to_string): New function.
3405 (gpgme_key_get_string_attr): Beautify using above functions.
3406 (gpgme_key_get_ulong_attr): Likewise.
3408 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3410 * data-mem.c (mem_release): Fix gcc warning.
3411 * data-user.c (user_release): Likewise.
3413 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3415 * data.h (gpgme_data_release_cb): Change return type to void.
3416 (gpgme_data_read_cb): Change return type to ssize_t.
3417 * data.c (gpgme_data_read): Likewise.
3418 * data-stream.c (stream_read): Likewise.
3419 * data-fd.c (fd_read): Likewise.
3420 * data-mem.c (mem_read): Likewise.
3421 (mem_release): Change return type to void.
3422 * data-user.c (user_read): Change return type to ssize_t.
3423 (user_release): Change return type to void.
3424 * data-compat.c (old_user_read): Change return type to ssize_t.
3425 * gpgme.h (GpgmeDataReadCb): Likewise.
3426 (gpgme_data_read): Likewise.
3427 (GpgmeDataSeekCb): Change return type to off_t.
3429 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3431 * gpgme.h: Add prototype for gpgme_get_key.
3432 * key.c (gpgme_get_key): New function.
3433 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3435 * gpgme.h: Add prototypes for new interfaces
3436 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3437 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3438 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3439 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3440 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3442 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3443 Use that to determine if allocation is desired or not.
3444 * util.h: Adjust prototype of _gpgme_decode_c_string.
3445 * keylist.c (keylist_colon_handler): Adjust caller of
3446 _gpgme_decode_c_string.
3448 * key.h (struct gpgme_key_s): New member last_uid.
3449 * key.c (_gpgme_key_append_name): Rewritten using
3450 _gpgme_decode_c_string and the last_uid pointer.
3451 (my_isdigit): Macro removed.
3452 (ALLOC_CHUNK): Likewise.
3453 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3455 * context.h (struct user_id_s): New member last_certsig.
3456 * key.h: Add prototype for _gpgme_key_add_certsig.
3457 * key.c (_gpgme_key_add_certsig): New function.
3458 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3459 (parse_user_id): Change first argument to SRC, add new arguments
3460 NAME, EMAIL and COMMENT. Change code to use these arguments
3461 instead going through UID. Move function before
3463 (parse_x509_user_id): Likewise.
3464 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3465 and parse_user_id invocation.
3466 (one_certsig_as_xml): New function.
3467 (one_uid_as_xml): Print signatures.
3468 * context.h (struct gpgme_context_s): New member TMP_UID.
3469 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3472 * key.c (get_certsig): New function.
3473 (gpgme_key_sig_get_string_attr): Likewise.
3474 (gpgme_key_sig_get_ulong_attr): Likewise.
3476 * keylist.c: Include <ctype.h>.
3477 (my_isdigit): Macro removed.
3478 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3479 (set_userid_flags): Likewise.
3480 (set_subkey_trust_info): Likewise.
3481 (set_ownertrust): Likewise.
3482 (finish_key): Move function up a bit and remove prototype.
3484 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3486 (gpg_keylist_ext): Implement signature listing mode.
3488 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3490 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3491 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3493 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3494 CloseHandle for parent fds.
3496 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3498 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3500 2002-11-22 Werner Koch <wk@gnupg.org>
3502 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3503 setlocale before doing another setlocale.
3505 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3507 * decrypt.c: Some beautyfication.
3509 * verify.c (_gpgme_verify_status_handler): Treat
3510 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3511 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3513 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3515 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3516 (struct genkey_result_s): Add new member FPR.
3517 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3518 (genkey_status_handler): Extract the fingerprint from the status
3520 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3522 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3524 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3526 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3527 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3528 <twoaday@freakmail.de>.
3529 (gpg_keylist_ext): Likewise.
3531 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3533 * import.c (append_xml_impinfo): Use
3534 _gpgme_data_append_string_for_xml rather than
3535 _gpgme_data_append_string for the field content.
3536 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3538 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3540 * rungpg.h, engine-gpgsm.h: File removed.
3541 * engine-backend.h: New file.
3542 * Makefile.am (gpgsm_components): New variable, set depending on
3543 automake conditional HAVE_GPGSM.
3544 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3545 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3546 (status-table.h): Depend on gpgme.h, not rungpg.h.
3547 * conversion.c: Include <stdlib.h>.
3548 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3549 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3550 functions and remove all function prototypes.
3551 (_gpgme_gpgsm_get_version): Make static and rename to ...
3552 (gpgsm_get_version): ... this.
3553 (_gpgme_gpgsm_check_version): Make static and rename to ...
3554 (gpgsm_check_version): ... this.
3555 (_gpgme_gpgsm_new): Make static. Change argument type from
3556 GpgsmObject * to void **. Call gpgsm_release instead
3557 _gpgme_gpgsm_release.
3558 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3559 (gpgsm_check_decrypt): ... this.
3560 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3561 (gpgsm_check_delete): ... this.
3562 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3563 (gpgsm_check_set_recipients): ... this.
3564 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3565 (gpgsm_encrypt): ... this.
3566 (_gpgme_gpgsm_op_export): Make static and rename to ...
3567 (gpgsm_export): ... this.
3568 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3569 (gpgsm_genkey): ... this.
3570 (_gpgme_gpgsm_op_import): Make static and rename to ...
3571 (gpgsm_import): ... this.
3572 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3573 (gpgsm_keylist): ... this.
3574 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3575 (gpgsm_keylist_ext): ... this.
3576 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3577 (gpgsm_sign): ... this.
3578 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3579 (gpgsm_trustlist): ... this.
3580 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3581 (gpgsm_verify): ... this.
3582 (gpgsm_status_handler): Rename to ...
3583 (status_handler): ... this.
3584 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3585 (gpgsm_set_status_handler): ... this.
3586 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3587 (gpgsm_set_colon_line_handler): ... this.
3588 (_gpgme_gpgsm_add_io_cb): Rename to ...
3589 (add_io_cb): ... this.
3590 (_gpgme_gpgsm_start): Make static and rename to ...
3591 (gpgsm_start): ... this.
3592 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3593 (gpgsm_set_io_cb): ... this.
3594 (_gpgme_gpgsm_io_event): Make static and rename to ...
3595 (gpgsm_io_event): ... this.
3596 (struct _gpgme_engine_ops_gpgsm): New variable.
3597 [!ENABLE_GPGSM]: Removed.
3598 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3599 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3600 <stdlib.h> and "engine-backend.h".
3601 (struct engine_object_s): Rewritten.
3602 (engine_ops): New variable.
3603 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3604 _gpgme_engine_check_version, _gpgme_engine_new,
3605 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3606 _gpgme_engine_set_status_handler,
3607 _gpgme_engine_set_command_handler,
3608 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3609 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3610 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3611 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3612 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3613 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3614 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3615 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3616 _gpgme_engine_io_event): Reimplement.
3617 * engine.h: Fix a few comments and a variable name in a prototype.
3618 * ops.h: Do not include "rungpg.h".
3619 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3621 * recipient.c: Likewise.
3622 * signers.c: Likewise.
3623 * version.c: Likewise.
3624 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3625 functions and remove prototypes.
3626 (_gpgme_gpg_get_version): Make static and rename to ...
3627 (gpg_get_version): ... this.
3628 (_gpgme_gpg_check_version): Make static and rename to ...
3629 (gpg_check_version): ... this.
3630 (_gpgme_gpg_new): Make static. Change argument type from
3631 GpgObject * to void **. Call gpg_release instead
3633 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3634 (gpg_check_decrypt): ... this.
3635 (_gpgme_gpg_op_delete): Make static and rename to ...
3636 (gpg_check_delete): ... this.
3637 (_gpgme_gpg_set_recipients): Make static and rename to ...
3638 (gpg_check_set_recipients): ... this.
3639 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3640 (gpg_encrypt): ... this.
3641 (_gpgme_gpg_op_export): Make static and rename to ...
3642 (gpg_export): ... this.
3643 (_gpgme_gpg_op_genkey): Make static and rename to ...
3644 (gpg_genkey): ... this.
3645 (_gpgme_gpg_op_import): Make static and rename to ...
3646 (gpg_import): ... this.
3647 (_gpgme_gpg_op_keylist): Make static and rename to ...
3648 (gpg_keylist): ... this.
3649 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3650 (gpg_keylist_ext): ... this.
3651 (_gpgme_gpg_op_sign): Make static and rename to ...
3652 (gpg_sign): ... this.
3653 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3654 (gpg_trustlist): ... this.
3655 (_gpgme_gpg_op_verify): Make static and rename to ...
3656 (gpg_verify): ... this.
3657 (gpg_status_handler): Rename to ...
3658 (status_handler): ... this.
3659 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3660 (gpg_set_status_handler): ... this.
3661 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3662 (gpg_set_colon_line_handler): ... this.
3663 (gpgme_gpg_add_io_cb): Rename to ...
3664 (add_io_cb): ... this.
3665 (_gpgme_gpg_start): Make static and rename to ...
3666 (gpg_start): ... this.
3667 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3668 (gpg_set_io_cb): ... this.
3669 (_gpgme_gpg_io_event): Make static and rename to ...
3670 (gpg_io_event): ... this.
3671 (struct _gpgme_engine_ops_gpg): New variable.
3673 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3675 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3678 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3680 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3681 data-compat.c: New file. Really check them in this time, completes
3684 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3686 * types.h (GpgmeStatusHandler): ... here.
3687 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3689 * types.h (GpgmeColonLineHandler): ... here.
3690 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3692 * types.h (GpgmeCommandHandler): ... here.
3693 * engine.h: Don't include "rungpg.h".
3694 (_gpgme_engine_set_status_handler): Change type of
3695 argument from GpgStatusHandler to GpgmeStatusHandler.
3696 (_gpgme_engine_set_colon_line_handler): Change type of
3697 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3698 (_gpgme_engine_set_command_handler): Change type of
3699 argument from GpgCommandHandler to GpgmeCommandHandler.
3700 * engine-gpgsm.h: Don't include "rungpg.h".
3701 (_gpgme_gpgsm_set_status_handler): Change type of
3702 argument from GpgStatusHandler to GpgmeStatusHandler.
3703 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3704 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3705 * engine-gpgsm.c: Do not include "rungpg.h".
3706 (struct gpgsm_object_s): Change type of
3707 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3708 GpgmeColonLineHandler.
3709 (gpgsm_assuan_simple_command): Change type of argument from
3710 GpgStatusHandler to GpgmeStatusHandler.
3711 (_gpgme_gpgsm_set_status_handler): Likewise.
3712 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3713 GpgColonLineHandler to GpgmeColonLineHandler.
3714 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3715 argument from GpgStatusHandler to GpgmeStatusHandler.
3716 (_gpgme_gpg_set_colon_line_handler): Change type of
3717 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3718 (_gpgme_gpg_set_command_handler): Change type of
3719 argument from GpgCommandHandler to GpgmeCommandHandler.
3720 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3721 GpgmeStatusHandler. Change type of colon.fnc to
3722 GpgmeColonLineHandler. Change type of cmd.fnc to
3723 GpgmeCommandLineHandler.
3724 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3726 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3727 to GpgmeColonLineHandler.
3728 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3729 GpgmeCommandHandler.
3730 * engine.c (_gpgme_engine_set_status_handler): Change type of
3731 argument FNC to GpgmeStatusHandler.
3732 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3733 to GpgmeColonLineHandler.
3734 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3735 GpgmeCommandHandler.
3737 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
3738 * rungpg.c (struct gpg_object_s): Remove PM.
3739 (pipemode_cb): Prototype removed.
3740 (add_pm_data): Function removed.
3741 (_gpgme_gpg_enable_pipemode): Likewise.
3742 (pipemode_copy): Likewise.
3743 (pipemode_cb): Likewise.
3744 (add_arg): Don't check for pipemode.
3745 (add_data): Likewise.
3746 (_gpgme_gpg_set_status_handler): Likewise.
3747 (_gpgme_gpg_set_colon_line_handler): Likewise.
3748 (_gpgme_gpg_set_command_handler): Likewise.
3749 (_gpgme_gpg_spawn): Likewise.
3750 (_gpgme_gpg_spawn): Don't set PM.active.
3751 (_gpgme_gpg_op_verify): Remove pipemode case.
3752 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
3754 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3755 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
3756 _gpgme_gpg_set_simple_line_handler): Prototype removed.
3757 (_gpgme_gpg_set_verbosity): New prototype.
3758 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
3759 (add_data): ... this.
3760 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
3761 (_gpgme_gpg_set_command_handler): Likewise.
3762 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3763 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3764 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3765 _gpgme_gpg_op_verify): Likewise.
3766 (_gpgme_gpg_add_pm_data): Rename to ...
3767 (add_pm_data): ... this.
3768 (_gpgme_gpg_op_verify): Call add_pm_data, not
3769 _gpgme_gpg_add_pm_data.
3770 (_gpgme_gpg_add_arg): Make static and rename to ...
3771 (add_arg): ... this.
3772 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
3773 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
3774 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
3775 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
3776 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3777 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
3778 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
3779 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
3781 (_gpgme_gpg_set_verbosity): New function.
3782 (struct gpg_object_s): Remove member simple from colon.
3783 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
3784 (_gpgme_gpg_set_simple_line_handler): Removed function.
3785 (read_colon_line): Don't check the GPG->colon.simple.
3786 * engine.c (_gpgme_engine_set_verbosity): Call
3787 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
3789 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3791 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
3792 _gpgme_strdup, _gpgme_free): Remove prototypes.
3793 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
3795 * util.c: File removed.
3796 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
3797 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
3798 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
3799 xtrycalloc, free instead of xfree.
3800 (_gpgme_data_append_percentstring_for_xml): Likewise.
3801 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
3802 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
3803 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
3804 _gpgme_data_get_as_string): Likewise.
3805 * debug.c (debug_init): Likewise.
3806 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
3807 * delete.c (_gpgme_release_delete_result): Likewise.
3808 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
3810 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
3811 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
3812 _gpgme_engine_release): Likewise.
3813 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
3814 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
3815 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
3816 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
3817 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
3818 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
3819 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
3820 * genkey.c (_gpgme_release_genkey_result): Likewise.
3821 * gpgme.c (gpgme_new, gpgme_release): Likewise.
3822 * import.c (_gpgme_release_import_result): Likewise.
3823 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
3824 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
3825 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
3826 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
3827 * ops.h (test_and_allocate_result): Likewise.
3828 * passphrase.c (_gpgme_release_passphrase_result,
3829 _gpgme_passphrase_status_handler,
3830 _gpgme_passphrase_command_handler): Likewise.
3831 * progress.c (_gpgme_progress_status_handler): Likewise.
3832 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
3833 gpgme_recipients_add_name_with_validity): Likewise.
3834 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
3835 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3836 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
3837 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
3839 * sign.c (_gpgme_release_sign_result): Likewise.
3840 * signers.c (_gpgme_signers_add): Likewise.
3841 * trustlist.c (trust_item_new, trustlist_colon_handler,
3842 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
3843 gpgme_trustitem_release): Likewise.
3844 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
3845 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
3847 * w32-io.c (create_reader, create_writer, destroy_reader,
3848 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
3849 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
3850 * w32-util.c (read_w32_registry_string): Likewise.
3851 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
3852 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
3853 * data-compat.c: Include <stdlib.h>.
3855 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3857 New data object component:
3859 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
3860 GpgmeDataReleaseCb): New types.
3861 (struct GpgmeDataCbs): New structure.
3862 (gpgme_data_read): Changed prototype to match that of read() closely.
3863 (gpgme_data_write): Similar for write().
3864 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
3865 gpgme_data_new_from_stream): New prototypes.
3866 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
3868 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
3869 data-stream.c, data-mem.c, data-user.c and data-compat.c.
3870 * data.c: Reimplemented from scratch.
3871 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
3872 data-user.c): New file.
3873 * context.h (struct gpgme_data_s): Removed.
3874 * conversion.c: Include <errno.h> and <sys/types.h>.
3875 (_gpgme_data_append): New function.
3876 * data.c (_gpgme_data_append_string): Move to ...
3877 * conversion.c (_gpgme_data_append_string): ... here.
3878 * data.c (_gpgme_data_append_for_xml): Move to ...
3879 * conversion.c (_gpgme_data_append_for_xml): ... here.
3880 * data.c (_gpgme_data_append_string_for_xml): Move to ...
3881 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
3882 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
3883 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
3885 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
3887 * types.h (GpgmeDataMode): Type removed.
3889 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
3890 * edit.c (_gpgme_op_edit_start): Likewise.
3891 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3892 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3893 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3894 * export.c (_gpgme_op_export_start): Likewise.
3895 * genkey.c (_gpgme_op_genkey_start): Likewise.
3896 * import.c (_gpgme_op_import_start): Likewise.
3897 * sign.c (_gpgme_op_sign_start): Likewise.
3898 * verify.c (_gpgme_op_verify_start): Likewise.
3900 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
3901 no recipient if no data was returned.
3902 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3903 no recipient if no data was returned.
3904 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3905 no recipient if no data was returned.
3907 * engine.c (_gpgme_engine_op_verify): Add new argument to
3908 differentiate detached from normal signatures.
3909 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
3910 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
3911 mode of data argument.
3912 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
3913 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
3914 (gpgme_op_verify): Likewise for prototype.
3915 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
3916 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
3917 * verify.c (_gpgme_op_verify_start): Likewise.
3918 (gpgme_op_verify_start): Likewise.
3919 (gpgme_op_verify): Likewise.
3921 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
3922 direction of data object.
3923 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
3924 determine direction of data object.
3925 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
3926 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3927 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3928 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3929 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
3931 (build_argv): Use new member INBOUND to determine direction of
3932 file descriptor. Don't check the data type.
3933 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
3935 * gpgme.c (gpgme_get_op_info): Don't call
3936 _gpgme_data_get_as_string if CTX->op_info is NULL.
3938 * version.c (gpgme_check_engine): Function removed.
3940 2002-09-30 Werner Koch <wk@gnupg.org>
3942 * keylist.c (keylist_colon_handler): Take care when printing a
3943 NULL with the DEBUG.
3945 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
3946 (gpgsm_status_handler): Run the colon function to indicate EOF.
3947 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
3949 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
3951 * conversion.c (_gpgme_hextobyte): Prevent superfluous
3952 multiplication with base. Reported by Stéphane Corthésy.
3954 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
3955 operation type in invocation of _gpgme_op_reset.
3957 2002-09-20 Werner Koch <wk@gnupg.org>
3959 * ath.c: Include sys/time.h if sys/select.h is not available.
3961 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
3963 * keylist.c (keylist_status_handler): Do not call finish_key() here.
3964 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
3966 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
3968 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
3969 into gpgme unconditionally.
3970 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
3972 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3974 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
3976 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3978 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
3979 (_gpgme_debug_end): Likewise.
3980 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3982 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3984 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
3986 * version.c (_gpgme_get_program_version): Likewise.
3987 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3989 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3991 * conversion.c (_gpgme_decode_c_string): Set DESTP before
3994 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
3996 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
3997 _gpgme_op_edit so its prototype is known early on.
3999 * conversion.c: New file.
4000 * util.h: Add prototypes for _gpgme_decode_c_string and
4002 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4004 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4005 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4006 calls to _gpgme_hextobyte.
4007 (hash_key): Likewise.
4009 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4011 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4012 _gpgme_engine_release, as this will reset pending to zero in the
4013 event done callback on cancelled operations.
4015 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4017 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4018 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4020 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4021 * rungpg.h: Also to prototype.
4022 * engine.c (_gpgme_engine_op_edit): Likewise.
4023 * engine.h: Likewise.
4024 * edit.c (_gpgme_op_edit_start): Likewise.
4026 2002-08-29 Werner Koch <wk@gnupg.org>
4028 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4030 * vasprintf.c (va_copy): Define macro if not yet defined.
4032 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4034 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4035 CTX->result.passphrase->no_passphrase if passphrase is given (good
4036 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4038 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4040 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4041 Return 0 on success, -1 on error.
4042 * version.c (_gpgme_get_program_version): Don't wait for the child.
4043 * engine.c (_gpgme_engine_housecleaning): Function removed.
4044 (do_reaping): Likewise.
4045 (_gpgme_engine_add_child_to_reap_list): Likewise.
4046 (struct reap_s): Removed.
4047 (reap_list): Likewise.
4048 (reap_list_lock): Likewise.
4049 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4050 _gpgme_engine_housecleaning and
4051 _gpgme_engine_add_child_to_reap_list.
4052 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4053 (struct gpg_object_s): Remove PID member.
4054 (_gpgme_gpg_new): Don't initialize GPG->pid.
4055 (_gpgme_gpg_spawn): Don't set GPG->pid.
4056 * wait.c (run_idle): Removed.
4057 (gpgme_wait): Run idle_function directly.
4059 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4061 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4062 variables encrypt_info and encrypt_info_len.
4063 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4064 * posix-sema.c (sema_fatal): Remove function.
4065 All these reported by Stéphane Corthésy.
4067 2002-08-23 Werner Koch <wk@gnupg.org>
4069 * gpgme-config.in: Made --prefix work for --libs.
4071 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4073 * ath.h: Update list of symbols that get a prefix: Rename the
4074 ath_mutex_*_available symbols to ath_*_available.
4076 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4078 * stpcpy.c: New file from gnulib.
4079 * Makefile.am (assuan_libobjs): Remove jnlib.
4081 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4083 * gpgme.h: Add prototype for gpgme_op_import_ext.
4084 * import.c (struct import_result_s): New member `nr_considered'.
4085 Rename `any_imported' to `nr_imported'.
4086 (import_status_handler): Increment nr_imported. Set nr_considered
4088 (gpgme_op_import_ext): New function.
4089 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4091 2002-08-20 Werner Koch <wk@gnupg.org>
4093 * gpgme.m4: Replaced with a new and faster version. This does not
4094 anymore try to build test programs. If we really need test
4095 programs, we should add an option to gpgme-config to do so.
4097 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4099 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4101 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4102 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4105 2002-08-19 Werner Koch <wk@gnupg.org>
4107 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4108 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4109 (_gpgme_decrypt_status_handler): Create an operation info.
4111 2002-08-14 Werner Koch <wk@gnupg.org>
4113 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4114 * key.c (gpgme_key_release): Release it. We need to add more code
4116 (_gpgme_key_append_name): Use memset to intialize the struct.
4117 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4118 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4121 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4122 information about the key type (PGP or X.509).
4123 (gpgme_key_get_ulong_attr): Likewise.
4125 * keylist.c (keylist_colon_handler): Include 1 in the check for
4126 valid algorithms so that RSA is usable. Store the issuer name and
4127 serial number also for "crs" records. Parse the expire date for
4129 (set_userid_flags): Put them onto the last appended key.
4131 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4133 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4135 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4137 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4140 The following changes make it possible to flush an inbound data
4141 pipe before invoking a command handler:
4143 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4144 _gpgme_io_select. Set timeout of 0 if this is set.
4145 * w32-io.c (_gpgme_io_select): Likewise.
4146 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4147 * wait.c (do_select): Add new argument to _gpgme_io_select
4149 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4150 linked_data to prototype.
4151 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4152 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4153 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4154 argument to _gpgme_engine_set_command_handler.
4155 * rungpg.c (struct gpg_object_s): New members linked_data and
4157 (_gpgme_gpg_new): Initialize those new members.
4158 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4159 (build_argv): Handle linked_data in the same hack as cb_data.
4160 (read_status): If linked_data is in use, flush the pipe before
4161 activating the command handler.
4162 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4165 The next changes export the status codes to the user:
4167 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4168 all STATUS_ with GPGME_.
4169 * delete.c (delete_status_handler): Likewise.
4170 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4171 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4172 (_gpgme_encrypt_sym_status_handler): Likewise.
4173 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4174 * engine-gpgsm.c (parse_status): Likewise.
4175 (gpgsm_status_handler): Likewise.
4176 (gpgsm_set_recipients): Likewise.
4177 * export.c (export_status_handler): Likewise.
4178 * genkey.c (genkey_status_handler): Likewise.
4179 * import.c (append_xml_impinfo): Likewise.
4180 (import_status_handler): Likewise.
4181 * keylist.c (keylist_status_handler): Likewise.
4182 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4183 (command_handler): Likewise.
4184 * progress.c (_gpgme_progress_status_handler): Likewise.
4185 * sign.c (_gpgme_sign_status_handler): Likewise.
4186 * trustlist.c (trustlist_status_handler): Likewise.
4187 * verify.c (_gpgme_verify_status_handler): Likewise.
4188 * gpgme.h (GpgmeEditCb): New type.
4189 * rungpg.h (GpgStatusCode): Rename and move to ...
4190 * gpgme.h (GpgmeStatusCode): ... this and here.
4191 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4192 * mkstatus: Prefix STATUS with GPGME_.
4193 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4195 * ops.h (_gpgme_verify_status_handler,
4196 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4197 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4198 _gpgme_progress_status_handler): Likewise.
4199 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4201 These changes add an edit operation to GPGME:
4203 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4204 ops.h: Add prototype for _gpgme_release_edit_result and
4205 _gpgme_passphrase_command_handler.
4206 * passphrase.c (command_handler): Make non-static and rename to ...
4207 (_gpgme_passphrase_command_handler): ... this.
4208 (_gpgme_passphrase_start): Use new name for command handler.
4209 * types.h: Add EditResult type.
4210 * gpgme.c (_gpgme_release_result): Release EDIT result.
4212 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4213 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4215 (assuan_libobjs): New variable, set this instead
4217 * engine.h (_gpgme_engine_op_edit): New prototype.
4218 * engine.c (_gpgme_engine_op_edit): New function.
4219 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4220 * rungpg.c (_gpgme_gpg_op_edit): New function.
4222 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4224 * delete.c (delete_problem): New case ambigious specification.
4225 (delete_status_handler): Handle new case (poorly).
4227 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4229 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4231 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4233 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4235 * vasprintf.c: Update to more recent libiberty version.
4236 * debug.h: Replace #elsif with #elif.
4238 Submitted by Stéphane Corthésy:
4239 * util.h (vasprintf): Correct prototype.
4240 * encrypt-sign.c: Include <stddef.h>.
4241 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4243 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4244 * ath-pth.c: Likewise.
4246 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4248 * wait.c (fdt_global): Make static. Reported by Stéphane
4251 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4252 patterns. Reported by Stéphane Corthésy.
4254 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4255 by Stéphane Corthésy.
4256 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4257 silence gcc warning.
4259 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4261 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4263 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4265 * gpgme.c (_gpgme_op_event_cb_user): New function.
4266 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4267 for private or user event loop. Use new user event callback
4269 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4270 * keylist.c (gpgme_op_keylist_start): Likewise.
4272 * rungpg.c (_gpgme_gpg_io_event): New function.
4273 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4274 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4275 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4276 * engine.c (_gpgme_engine_io_event): New function.
4277 * engine.h (_gpgme_engine_io_event): New prototype.
4278 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4279 the real work for the default IO callback routines to ...
4280 (_gpgme_op_keylist_event_cb): ... here. New function.
4281 * trustlist.c (trustlist_colon_handler): Signal
4282 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4283 (_gpgme_op_trustlist_event_cb): ... here. New function.
4284 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4285 and _gpgme_op_trustlist_event_cb when appropriate.
4286 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4287 (_gpgme_op_trustlist_event_cb): Likewise.
4288 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4289 user provided event handler directly.
4290 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4292 * wait.c (_gpgme_add_io_cb): Likewise.
4293 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4294 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4295 argument. Fix up error handling.
4296 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4297 new argument, fix up error handling.
4299 2002-07-03 Werner Koch <wk@gnupg.org>
4301 * encrypt.c (status_handler_finish): New.
4302 (_gpgme_encrypt_status_handler): Moved some code out to the new
4303 function and call this function also in case we get into the
4304 status handler with an error which might happen due to a kludge in
4307 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4309 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4310 table (eg use synchronous mode).
4312 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4314 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4315 prototype and change return type to GpgmeError.
4316 (_gpgme_wait_one): New prototype.
4317 * wait.c (gpgme_wait): Replace with the meat from
4318 _gpgme_wait_on_condition here, and remove the support for
4320 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4321 and change return type to GpgmeError. Replace with meat from
4322 _gpgme_wait_one and add support for conditions.
4323 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4325 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4326 table (eg use synchronous mode).
4327 (gpgme_op_keylist_next): Remove HANG argument from
4328 _gpgme_wait_on_condition. Check its return value.
4329 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4330 table (eg use synchronous mode).
4331 (gpgme_op_trustlist_next): Remove HANG argument from
4332 _gpgme_wait_on_condition. Check its return value.
4334 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4336 * gpgme.h: Fix documentation of key attribute retrieval functions.
4338 2002-06-26 Werner Koch <wk@gnupg.org>
4340 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4342 * import.c (append_xml_impinfo): Kludge to print fingerprint
4343 instead of keyid for use with gpgsm.
4344 (import_status_handler): Set a flag to know whether any import
4346 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4348 2002-06-25 Werner Koch <wk@gnupg.org>
4350 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4353 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4355 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4357 * export.c (gpgme_op_export): If no data was returned, return
4358 GPGME_No_Recipients.
4360 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4362 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4364 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4366 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4367 (parse_status): New function.
4368 (gpgsm_status_handler): Use parse_status.
4369 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4370 STATUS_FNC_VALUE and process status messages.
4371 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4372 (gpgsm_set_fd): Likewise.
4373 (_gpgme_gpgsm_op_keylist): Likewise.
4374 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4375 (_gpgme_gpgsm_op_sign): Likewise.
4377 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4379 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4381 2002-06-20 Werner Koch <wk@gnupg.org>
4383 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4385 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4387 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4388 (gpgme_get_sig_string_attr): Hack to return info on the key
4389 usage. Does now make use of the former RESERVED argument which
4390 has been renamed to WHATIDX.
4391 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4393 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4395 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4396 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4397 error, or there are no more file descriptors to wait on.
4398 (_gpgme_wait_on_condition): Ignore return value from do_select for
4401 2002-06-13 Werner Koch <wk@gnupg.org>
4403 * verify.c (gpgme_op_verify): Make sure that we never access an
4404 unitialized result structure.
4406 2002-06-12 Werner Koch <wk@gnupg.org>
4408 * keylist.c (struct keylist_result_s): New.
4409 (_gpgme_release_keylist_result): Release it here
4410 (keylist_status_handler): Handle truncated.
4411 (append_xml_keylistinfo): New.
4412 * gpgme.c (_gpgme_release_result): and use it here.
4413 * types.h: Declare the new type here.
4414 * context.h (struct gpgme_context_s): Use it here.
4416 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4418 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4419 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4420 use our own close notification mechanism without interfering with
4423 2002-06-11 Werner Koch <wk@gnupg.org>
4425 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4427 * verify.c (calc_sig_summary): New.
4428 (gpgme_get_sig_ulong_attr): And use it here.
4430 2002-06-10 Werner Koch <wk@gnupg.org>
4432 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4433 * verify.c (is_token, copy_token): New.
4434 (_gpgme_verify_status_handler): Use copy_token, handle the new
4435 ERROR status and store the errorcode used withgpgsm and trust
4437 * gpgme.h: New attribute ERRTOK.
4438 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4439 (gpgme_get_sig_string_attr): Use it here to return the last error.
4441 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4443 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4444 close notification for the status fd to ...
4445 (_gpgme_gpgsm_new): ... here.
4446 * wait.h: Include "sema.h". Remove prototypes of
4447 _gpgme_remove_proc_from_wait_queue and
4448 _gpgme_register_pipe_handler. Add prototypes of
4449 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4450 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4452 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4453 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4454 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4455 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4456 proc_s. Replace struct wait_item_s.
4457 (_gpgme_fd_table_init): New function.
4458 (_gpgme_fd_table_deinit): Likewise.
4459 (_gpgme_fd_table_put): Likewise.
4460 (set_process_done): Remove function.
4461 (do_select): Take argument FDT. Use that to decide which fds to
4463 (_gpgme_remove_proc_from_wait_queue): Remove function.
4464 (_gpgme_wait_event_cb): New function.
4465 (_gpgme_wait_one): Likewise.
4466 (_gpgme_register_pipe_hanldler): Remove function.
4467 (_gpgme_add_io_cb): New function.
4468 (_gpgme_remove_io_cb): Likewise.
4469 (_gpgme_freeze_fd): Remove function.
4470 (_gpgme_thaw_fd): Remove function.
4471 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4472 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4473 IDX to CMD. Add new member IO_CBS.
4474 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4475 For each I/O callback, check if it should be unregistered. If all
4476 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4477 Remove member RUNNING.
4478 (_gpgme_gpg_new): Initialize new members.
4479 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4480 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4481 (build_argv): Store away the index instead the file descriptor for
4483 (_gpgme_gpg_add_io_cb): New function.
4484 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4486 (gpg_status_handler): Change return type to void, remove PID
4487 argument, close filedescriptor if EOF or error occurs.
4488 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4489 Use IO_CBS->remove instead _gpgme_freeze_fd.
4490 (gpg_colon_line_handler): Change return type to void, remove PID
4491 argument, close filedescriptor if EOF or error occurs.
4492 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4493 (_gpgme_gpg_set_io_cbs): New function.
4494 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4495 _gpgme_gpg_set_io_cbs.
4496 * gpgme.h (GpgmeIOCb): New type.
4497 (GpgmeRegisterIOCb): Likewise.
4498 (GpgmeRemoveIOCb): Likewise.
4499 (GpgmeEventIO): Likewise.
4500 (GpgmeEventIOCb): Likewise.
4501 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4502 (gpgme_set_op_io_cbs): New prototype.
4503 (gpgme_get_op_io_cbs): Likewise.
4504 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4505 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4506 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4507 prototype. Add prototype for _gpgme_op_reset.
4508 Add synchronous argument to _gpgme_decrypt_start prototype.
4509 * io.h: Beautification.
4510 * gpgme.c: Include "wait.h".
4511 (gpgme_new): Initialize FDT.
4512 (gpgme_set_io_cbs): New function.
4513 (gpgme_get_io_cbs): Likewise.
4514 (_gpgme_op_event_cb): Likewise.
4515 * data.c (_gpgme_data_inbound_handler): Change return type to
4516 void. Drop PID argument. Close FD on error and EOF.
4517 (write_mem_data): Don't close FD here ...
4518 (write_cb_data): ... or here ...
4519 (_gpgme_data_outbound_handler): ... but here. Change return type
4520 to void. Drop PID argument.
4521 * context.h: Include "wait.h".
4522 (struct gpgme_context_s): New members FDT and IO_CBS.
4523 * op-support.c: New file.
4524 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4525 * ops.h: Add prototype for _gpgme_op_reset().
4526 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4528 (gpgme_op_decrypt_start): Add synchronous argument.
4529 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4531 * delete.c (gpgme_op_delete_start): Rename to ...
4532 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4533 Use _gpgme_op_reset. Make function static.
4534 (gpgme_op_delete_start): Just a wrapper around
4535 _gpgme_op_delete_start now.
4536 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4538 * encrypt.c: Include "wait.h".
4539 (ggpgme_op_encrypt_start): Rename to ...
4540 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4541 Use _gpgme_op_reset. Make function static.
4542 (gpgme_op_encrypt_start): Just a wrapper around
4543 _gpgme_op_encrypt_start now.
4544 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4546 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4547 (_gpgme_op_encrypt_sign_start): ... this. New argument
4548 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4549 (gpgme_op_encrypt_sign_start): Just a wrapper around
4550 _gpgme_op_encrypt_sign_start now.
4551 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4552 _gpgme_wait_one instead gpgme_wait.
4553 * export.c (gpgme_op_export_start): Rename to ...
4554 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4555 Use _gpgme_op_reset. Make function static.
4556 (gpgme_op_export_start): Just a wrapper around
4557 _gpgme_op_export_start now.
4558 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4560 * genkey.c (gpgme_op_genkey_start): Rename to ...
4561 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4562 Use _gpgme_op_reset. Make function static.
4563 (gpgme_op_genkey_start): Just a wrapper around
4564 _gpgme_op_genkey_start now.
4565 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4567 * import.c (gpgme_op_import_start): Rename to ...
4568 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4569 Use _gpgme_op_reset. Make function static.
4570 (gpgme_op_import_start): Just a wrapper around
4571 _gpgme_op_import_start now.
4572 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4574 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4575 (gpgme_op_keylist_ext_start): Likewise.
4576 * sign.c (gpgme_op_sign_start): Rename to ...
4577 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4578 _gpgme_op_reset. Make function static.
4579 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4581 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4583 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4584 * verify.c (gpgme_op_verify_start): Rename to ...
4585 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4586 Use _gpgme_op_reset. Make function static.
4587 (gpgme_op_verify_start): Just a wrapper around
4588 _gpgme_op_verify_start now.
4589 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4591 * engine-gpgsm.c (iocb_data_t): New type.
4592 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4593 and input_data with input_cb. Replace output_fd and output_data
4594 with output_cb. Replace message_fd and message_data with
4595 message_cb. New member io_cbs.
4596 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4598 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4599 callback, check if it should be unregistered. If all callbacks
4600 have been unregistered, trigger GPGME_EVENT_DONE.
4601 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4602 names to close the file descriptors.
4603 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4604 (_gpgme_gpgsm_op_encrypt): Likewise.
4605 (_gpgme_gpgsm_op_genkey): Likewise.
4606 (_gpgme_gpgsm_op_import): Likewise.
4607 (_gpgme_gpgsm_op_keylist): Likewise.
4608 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4609 (_gpgme_gpgsm_op_sign): Likewise.
4610 (_gpgme_gpgsm_op_verify): Likewise.
4611 (gpgsm_status_handler): Drop argument PID. Change return type to
4612 void. Close status pipe before returning because of EOF or error.
4613 (_gpgme_gpgsm_add_io_cb): New function.
4614 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4616 (_gpgme_gpgsm_set_io_cbs): New function.
4617 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4618 * engine.c (_gpgme_engine_set_io_cbs): New function.
4619 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4621 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4623 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4625 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4627 * key.c: Include <ctype.h>.
4628 (_gpgme_key_append_name): Skip one more char when
4629 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4630 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4632 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4634 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4635 * posix-sema.c: Use that prefix here.
4636 * posix-io.c: Include "ath.h".
4637 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4638 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4639 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4640 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4642 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4644 * Makefile.am (ath_components): New variable.
4645 (ath_components_pthread): Likewise.
4646 (ath_components_pth): Likewise.
4647 (system_components): Add ath_componentes.
4651 * ath-pthread.c: Likewise.
4652 * ath-pth.c: Likewise.
4653 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4655 * mutex.h: Remove file.
4657 2002-05-30 Werner Koch <wk@gnupg.org>
4659 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4660 an issuer with IDX > 0. We don't support altIssuerNames for now.
4662 2002-05-22 Werner Koch <wk@gnupg.org>
4664 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4665 missing variable definition. Oohh - Marcus was faster.
4667 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4669 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4671 2002-05-21 Werner Koch <wk@gnupg.org>
4673 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4674 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4676 2002-05-10 Werner Koch <wk@gnupg.org>
4678 * key.h (gpgme_key_s): Add OTRUST.
4679 * keylist.c (set_ownertrust): New.
4680 (keylist_colon_handler): Get the ownertrust value
4681 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4684 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4686 * w32-util.c: New static variable GET_PATH_LOCK.
4687 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4688 Take lock while determining path.
4689 (_gpgme_get_gpgsm_path): Likewise.
4690 * version.c (do_subsystem_inits): Set DONE to 1 after
4692 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4693 while determining engine info.
4694 * rungpg.c (_gpgme_gpg_get_version): New variable
4695 GPG_VERSION_LOCK. Take the lock while determining the program
4697 * posix-io.c: Include "sema.h".
4698 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4699 while fixing the signals.
4700 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4701 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4703 (capabilities_to_string): Make STRINGS very const.
4704 (_gpgme_key_cache_add): Lock the key cache.
4705 (_gpgme_key_cache_get): Likewise.
4706 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4707 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4708 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4710 * engine.c (_gpgme_engine_get_info): New variable
4711 ENGINE_INFO_LOCK. Take lock while determining engine info.
4712 * engine-gpgsm.c: Include "sema.h".
4713 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4714 lock while getting program version.
4716 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4718 * debug.h: New file.
4719 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4720 * util.h: Removed all prototypes and declarations related to
4721 debugging. Include "debug.h".
4723 * debug.c (debug_level): Comment variable and remove superfluous
4726 (_gpgme_debug_enabled): Function removed.
4727 (struct debug_control_s): Definition removed.
4728 (_gpgme_debug_level): Function removed.
4729 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4730 pritnf-style format specification and a variable number of
4732 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4733 starts out with "%s" for simplicity.
4734 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4735 TEXT argument anymore.
4737 * posix-io.c (_gpgme_io_select): Use new level argument for
4738 DEBUG_BEGIN instead explicit if construct.
4740 * debug.c (debug_init): Remove superfluous zero initializer,
4741 remove volatile flag of INITIALIZED. Do not use the
4742 double-checked locking algorithm, it is fundamentally flawed and
4743 will empty your fridge (on a more serious note, despite the
4744 volatile flag it doesn't give you the guarantee you would expect,
4745 for example on a DEC Alpha or an SMP machine. The volatile only
4746 serializes accesses to the volatile variable, but not to the other
4749 2002-05-03 Werner Koch <wk@gnupg.org>
4751 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
4752 output to /dev/null.
4754 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
4755 * gpgme.c (gpgme_get_protocol): New.
4757 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
4758 (gpgme_data_read): Ditto.
4760 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
4761 lines so that a claim can be made without looking up the key.
4762 (gpgme_get_sig_string_attr): New.
4763 (gpgme_get_sig_ulong_attr): New.
4765 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
4767 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
4768 list to align with the status.h file from gnupg.
4770 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
4771 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
4772 these new status codes. Store the expiration time
4774 2002-04-27 Werner Koch <wk@gnupg.org>
4776 * gpgme.h (GpgmeData_Encoding): New.
4777 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
4778 * engine-gpgsm.c (map_input_enc): New. Use it in all local
4779 functions where the INPUT command gets send.
4781 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
4783 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
4784 descriptor only when we don't need it anymore. Close the message
4785 descriptor if we don't need it.
4787 2002-04-26 Werner Koch <wk@gnupg.org>
4789 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
4791 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4793 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
4794 GPG->cmd.cb_data, not xfree.
4796 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4798 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
4799 ttytype, lc_ctype and lc_messages options in the server.
4801 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
4803 * engine-gpgsm.c (map_assuan_error): Add new error codes.
4805 2002-04-23 Werner Koch <wk@gnupg.org>
4807 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
4808 can_certify to return the requested values.
4810 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
4812 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
4814 (gpgme_get_passphrase_cb): Likewise.
4816 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
4818 * gpgme.c (gpgme_get_passphrase_cb): New function.
4819 (gpgme_get_progress_cb): New function.
4820 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
4821 gpgme_get_progress_cb.
4823 2002-03-28 Werner Koch <wk@gnupg.org>
4825 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
4826 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
4827 * keylist.c (keylist_colon_handler): Store them.
4828 * key.c (gpgme_key_release): Free them.
4829 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
4831 2002-03-26 Werner Koch <wk@gnupg.org>
4833 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
4835 2002-03-21 Werner Koch <wk@gnupg.org>
4837 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
4840 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
4842 * Makefile.am (system_components): New variable, set depending on
4844 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
4845 * syshdr.h: File removed.
4847 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
4848 * posix-sema.c: Likewise.
4849 * posix-util.c: Likewise.
4851 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
4852 * w32-sema.c: Likewise.
4853 * w32-util.c: Likewise.
4855 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
4856 * posix-sema.c: Likewise.
4857 * w32-io.c: Include `io.h', do not include `syshdr.h'
4858 * w32-sema.c: Likewise.
4859 * w32-util.c: Likewise.
4860 * data.c: Do not include `syshdr.h'.
4862 * wait.h: Code cleanup.
4864 * mutex.h: New file.
4865 * posix-sema.c: Implement.
4867 2002-03-08 Werner Koch <wk@gnupg.org>
4869 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
4871 2002-03-07 Werner Koch <wk@gnupg.org>
4873 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
4875 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
4877 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
4878 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
4879 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
4880 as status handler and run _gpgme_passphrase_start.
4881 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
4883 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
4886 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
4888 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4890 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
4891 error No_Passphrase if only a bad passphrase was provided.
4893 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4895 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
4896 GPGME_DATA_MODE_IN, construct a command line that stores the
4898 * verify.c (gpgme_op_verify_start): Accept TEXT being
4899 uninitialized, and in this case interpret SIG as a normal or
4900 cleartext signature and TEXT as a return data object.
4901 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
4903 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4905 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
4908 2002-02-28 Werner Koch <wk@gnupg.org>
4910 * key.h (subkey_s): New member expires_at.
4911 * keylist.c (keylist_colon_handler): Set it here
4912 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
4914 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4916 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
4917 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
4918 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
4919 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
4920 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
4921 * engine.c (_gpgme_engine_op_keylist_ext): New function.
4922 * keylist.c (gpgme_op_keylist_ext_start): New function.
4924 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4926 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
4927 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
4928 rename no_recipients to no_valid_recipients.
4929 (_gpgme_encrypt_status_handler): Include error for invalid
4931 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
4932 argument to GpgsmObject. Use that to report back the status about
4935 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
4937 * verify.c (_gpgme_verify_status_handler): Fix the last change.
4939 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4941 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
4942 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
4943 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
4944 (_gpgme_gpg_op_sign): Use that new function.
4945 (_gpgme_gpg_op_encrypt_sign): New function.
4946 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
4947 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
4948 (gpgme_op_encrypt_sign): Likewise.
4949 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
4950 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
4951 (_gpgme_sign_status_handler): Add prototype.
4952 * sign.c (sign_status_handler): Rename to ...
4953 (_gpgme_sign_status_handler): ... this and make non-static.
4954 * encrypt.c (encrypt_status_handler): Rename to ...
4955 (_gpgme_encrypt_status_handler): ... this and make non-static.
4956 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
4957 * sign.c (gpgme_op_sign_start): Likewise.
4959 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4961 * verify.c (_gpgme_verify_status_handler): Parse the args line to
4962 see if the problem is due to a missing key, and report that back
4965 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4967 * context.h (struct gpgme_context_s): New member include_certs.
4968 * gpgme.h (gpgme_set_include_certs): Add prototype.
4969 (gpgme_get_include_certs): Likewise.
4970 * gpgme.c (gpgme_set_include_certs): New function.
4971 (gpgme_get_include_certs): Likewise.
4972 (gpgme_new): Set include_certs to 1 (the default).
4973 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
4974 and pass it to _gpgme_gpgsm_op_sign.
4975 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
4976 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
4977 include_certs and handle it.
4978 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
4979 * sign.c (gpgme_op_sign_start): Add new argument to
4980 _gpgme_engine_op_sign call.
4982 2002-02-14 Werner Koch <wk@gnupg.org>
4984 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
4986 2002-02-13 Werner Koch <wk@gnupg.org>
4988 * vasprintf.c, fopencookie.c: Add replacement functions.
4989 * util.h: Add prototypes for them.
4991 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
4993 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
4994 reach the end of the function.
4996 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
4998 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
4999 (gpgme_op_genkey_start): Skip newlines after opening tag.
5001 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5003 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5005 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5006 set, and pass them down to the crypto engine.
5007 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5008 * engine.h: Likewise.
5009 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5010 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5012 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5014 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5017 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5019 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5021 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5024 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5026 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5027 status of the returned context is returned.
5028 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5029 aware of cancelled processes, and to allow to use gpgme_wait with
5030 CTX being NULL (as documented in the source).
5031 (struct proc_s): New member REPORTED.
5032 * gpgme.h: Fix prototype.
5033 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5034 * sign.c (gpgme_op_sign): Likewise.
5035 * import.c (gpgme_op_import): Likewise.
5036 * genkey.c (gpgme_op_genkey): Likewise.
5037 * export.c (gpgme_op_export): Likewise.
5038 * encrypt.c (gpgme_op_encrypt): Likewise.
5039 * delete.c (gpgme_op_delete): Likewise.
5040 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5042 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5044 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5046 (gpgme_get_keylist_mode): New function.
5047 (gpgme_new): Set the default for keylist_mode member of CTX.
5049 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5050 (gpgme_get_keylist_mode): New prototype.
5051 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5052 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5054 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5056 This patch has gotten a bit large... mmh. The main thing that
5057 happens here is that error values are now not determined in the
5058 operation function after gpgme_wait completed, but in the status
5059 handler when EOF is received. It should always be the case that
5060 either an error is flagged or EOF is received, so that after a
5061 gpgme_wait you should never have the situation that no error is
5062 flagged and EOF is not received. One problem is that the engine
5063 status handlers don't have access to the context, a horrible
5064 kludge works around this for now. All errors that happen during a
5065 pending operation should be catched and reported in ctx->error,
5066 including out-of-core and cancellation. This rounds up neatly a
5067 couple of loose ends, and makes it possible to pass up any errors
5068 in the communication with the backend as well. As a bonus, there
5069 will be a function to access gpgme->wait, so that the operations
5070 can truly be implemented with their _start function.
5072 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5073 error back to the context.
5074 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5076 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5078 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5079 to a value indication that.
5081 * verify.c (add_notation): Set error, not out_of_core.
5082 (finish_sig): Likewise.
5083 (gpgme_op_verify_start): Don't clear out_of_core.
5084 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5085 (gpgme_op_verify): And don't do it here.
5087 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5088 (gpgme_op_trustlist_start): Don't clear out_of_core.
5089 (gpgme_op_trustlist_next): Check error, not out_of_core.
5090 (gpgme_op_trustlist_end): Likewise.
5092 * ops.h (test_and_allocate_result): New macro.
5093 (_gpgme_passphrase_result): Remove prototype.
5094 * delete.c (gpgme_op_delete): Return error from context.
5095 (delete_status_handler): Use macro test_and_allocate_result.
5096 Perform error checking at EOF.
5097 (gpgme_op_delete_start): Release result.
5098 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5099 test_and_allocate_result, and perform error checking here.
5100 (_gpgme_passphrase_result): Function removed.
5101 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5102 (gpgme_op_sign): Just return the error value from the context.
5103 (sign_status_handler): Only progress if no error is set yet. If
5104 we process an EOF, set the resulting error value (if any).
5105 * decrypt.c (_gpgme_decrypt_result): Function removed.
5106 (create_result_struct): Function removed.
5107 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5108 caclulate error on EOF, do not progress with errors.
5109 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5110 (gpgme_op_decrypt): Just return the error value from the context.
5111 * encrypt.c (encrypt_status_handler): Perform the error checking
5113 (gpgme_op_encrypt_start): Do not clear out_of_core.
5114 * export.c (export_status_handler): Return if error is set in context.
5115 (gpgme_op_export_start): Release result.
5116 (gpgme_op_export): Return error from context.
5117 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5119 * genkey.c (genkey_status_handler): Use macro
5120 test_and_allocate_result. Perform error checking at EOF.
5121 (gpgme_op_genkey): Just return the error from context.
5122 * import.c (gpgme_op_import): Return the error from context.
5123 (import_status_handler): Use macro test_and_allocate_result.
5124 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5125 (gpgme_op_keylist_next): Return error of context.
5126 (keylist_colon_handler): Set error instead out_of_code.
5127 (finish_key): Likewise.
5129 * context.h: Remove member out_of_core, add member error.
5130 * gpgme.c (_gpgme_release_result): Clear error flag.
5132 * engine.h (_gpgme_engine_get_error): New prototype.
5133 * engine.c (_gpgme_engine_get_error): New function.
5134 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5136 * engine-gpgsm.c (map_assuan_error): New function.
5137 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5138 use the new function to map error values.
5139 (gpgsm_set_fd): Change return type tp GpgmeError.
5140 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5141 (gpgsm_set_recipients): Likewise. Change type of return value
5142 equivalently. Adjust error values.
5143 (_gpgme_gpgsm_op_import): Likewise.
5144 (_gpgme_gpgsm_op_sign): Likewise.
5145 (struct gpgsm_object_s): New member error.
5146 (gpgsm_status_handler): Set error if error occurs. Determine
5147 error number from ERR line received. If assuan_read_line fails,
5148 terminate the connection.
5150 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5152 * Makefile.am (MOSTLYCLEANFILES): New variable.
5154 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5156 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5157 connection to the server.
5159 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5161 * rungpg.h: Add STATUS_KEY_CREATED.
5163 * progress.c: New file.
5164 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5166 * genkey.c (genkey_status_handler): Use
5167 _gpgme_progress_status_handler. Add check for status.
5168 (struct genkey_result_s): New structure.
5169 (_gpgme_release_genkey_result): New function.
5170 (gpgme_op_genkey): Check for error.
5171 * gpgme.c (_gpgme_release_result): Call
5172 _gpgme_release_genkey_result.
5173 * ops.h (_gpgme_release_genkey_result): Add prototype.
5174 * types.h (GenKeyResult): New type.
5175 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5177 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5179 * gpgme.c (_gpgme_release_result): Call
5180 _gpgme_release_delete_result.
5181 * ops.h (_gpgme_release_delete_result): Add prototype.
5182 * types.h (DeleteResult): New type.
5183 * context.h (gpgme_context_s): Add DeleteResult to member result.
5185 * delete.c (enum delete_problem): New type.
5186 (struct delete_result_s): New structure.
5187 (_gpgme_release_delete_result): New function.
5188 (delete_status_handler): Implement more status codes.
5189 (gpgme_op_delete): Return error on failure.
5191 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5193 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5195 * import.c (struct import_result_s): New structure.
5196 (_gpgme_release_import_result): New function.
5197 (append_xml_impinfo): Likewise.
5198 (import_status_handler): Implement.
5199 * gpgme.c (_gpgme_release_result): Add call to
5200 _gpgme_release_import_result.
5201 * ops.h (_gpgme_release_import_result): Add prototype.
5202 * types.h (ImportResult): New type.
5203 * context.h (gpgme_context_s): Add ImportResult to member result.
5205 * encrypt.c (gpgme_op_encrypt): Code clean up.
5207 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5209 * gpgme.h: Add lots of comment and fix the formatting. Add
5210 gpgme_trustlist_end prototype.
5212 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5214 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5215 gpgme_register_idle to return and accept this type.
5216 * wait.c (gpgme_register_idle): Fix type.
5217 Save and return old value of idle_function.
5219 2002-01-29 Werner Koch <wk@gnupg.org>
5221 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5223 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5226 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5228 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5229 not assuan_pipe_disconnect.
5231 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5232 jnlib (needed by assuan) statically into libgpgme. Linking a
5233 static library into a shared library this way is not portable.
5235 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5237 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5240 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5242 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5243 from off_t to size_t.
5244 * gpgme.h: Likewise.
5246 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5248 * wait.c (_gpgme_wait_on_condition): If the process finished,
5249 reset the pending flag. Also if the operation was cancelled.
5251 (struct proc_s): Rename READY to DONE.
5252 (wait_item_s): Likewise.
5253 (set_process_ready): Rename to ...
5254 (set_process_done): ... this.
5255 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5256 instead set_process_ready.
5257 (_gpgme_wait_on_condition): Likewise.
5258 (do_select): Rename READY to DONE.
5260 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5261 * sign.c (gpgme_op_sign): Likewise.
5262 * import.c (gpgme_op_import): Likewise.
5263 * genkey.c (gpgme_op_genkey): Likewise.
5264 * export.c (gpgme_op_export): Likewise.
5265 * encrypt.c (gpgme_op_encrypt): Likewise.
5266 * delete.c (gpgme_op_delete): Likewise.
5267 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5268 * decrypt.c (gpgme_op_decrypt): Likewise.
5270 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5272 * export.c: Cleanup.
5274 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5276 * trustlist.c: Various source clean ups.
5277 (my_isdigit): Removed.
5278 (gpgme_op_trustlist_end): New function.
5280 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5282 * gpgme.c: Various source clean ups, like renaming C to CTX where
5284 (gpgme_new): Clear R_CTX before starting the work.
5285 (my_isdigit): Removed.
5286 (my_isxdigit): Likewise.
5288 * data.c: Various source clean ups.
5289 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5290 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5291 (gpgme_data_new_from_file): Loop over fread while EINTR.
5292 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5293 be zero. Loop over fread while EINTR.
5295 (my_isdigit): Removed.
5296 (my_isxdigit): Likewise.
5298 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5300 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5301 Pipe_Error where appropriate.
5303 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5305 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5307 * version.c (get_engine_info): Remove prototype.
5309 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5311 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5312 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5314 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5316 * keylist.c (gpgme_op_keylist_end): New function.
5317 * gpgme.h (gpgme_op_keylist_end): New prototype.
5319 * engine.h (gpgme_engine_check_version): Move prototype to ...
5320 * gpgme.h (gpgme_engine_check_version): ... here.
5322 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5324 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5326 * version.c (gpgme_get_engine_info): Reimplemented.
5327 (gpgme_check_engine): Reimplemented.
5328 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5330 * engine.c: Include `io.h'.
5331 (gpgme_engine_get_info): New function.
5332 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5335 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5337 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5338 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5339 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5341 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5342 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5343 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5344 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5345 own function by call to _gpgme_engine_add_child_to_reap_list().
5347 * wait.c: Include `engine.h'.
5348 (run_idle): Call _gpgme_engine_housecleaning(), not
5349 _gpgme_gpg_housecleaning().
5351 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5353 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5354 Initialize the next field of the uid structure.
5355 (gpgme_key_get_as_xml): Do not list last uid first.
5357 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5359 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5360 function [!ENABLE_GPGSM].
5362 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5364 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5365 message_data, not SIG.
5366 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5368 * sign.c (sign_status_handler): Call
5369 _gpgme_passphrase_status_handler early.
5371 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5373 * engine-gpgsm.c: Revert last change.
5375 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5377 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5378 handler when ending this operation, otherwise the wait function
5381 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5383 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5384 (_gpgme_gpgsm_new): Initialize some more members.
5385 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5386 (gpgsm_status_handler): Rework the inline-data processing.
5388 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5390 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5391 list that are not dup'ed, for those the close-on-exec flag is set
5393 * version.c (_gpgme_get_program_version): Remove first entry in
5394 CFD, as the close-on-exec flag is now set for this fd.
5396 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5398 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5399 option to `ENCRYPT'.
5400 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5403 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5405 * engine-gpgsm.c (close_notify_handler): New function.
5406 (_gpgme_gpgsm_new): Manage the file descriptors a
5407 bit differently. Do not set close-on-exec flags.
5408 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5409 to -1, this is done by the close handler.
5410 (_gpgme_gpgsm_op_encrypt): Likewise.
5411 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5412 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5413 (_gpgme_gpgsm_op_sign): Likewise.
5414 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5416 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5417 non-inherited file descriptor index of the pipe.
5419 2001-12-13 Werner Koch <wk@gnupg.org>
5421 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5422 (gpgsm_status_handler): Pass datalines to a colon handler
5423 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5426 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5428 (gpgsm_assuan_simple_command): Removed underscore from
5430 (_gpgme_gpgsm_start): Ditto.
5431 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5432 function by the new assuan_read_line. Removed the use of the
5434 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5435 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5438 * keylist.c (keylist_colon_handler): Handle "crt" records
5439 * key.h (gpgme_key_s): Add an x509 flag.
5440 * key.c (parse_x509_user_id): New.
5441 (_gpgme_key_append_name): Handle x.509 names.
5443 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5445 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5448 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5450 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5451 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5453 (_gpgme_gpgsm_op_sign): Likewise.
5455 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5457 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5460 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5462 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5464 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5466 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5467 Deal with assuan read line returning more than one line (for now).
5469 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5471 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5472 the current protocol definition.
5474 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5476 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5479 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5481 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5482 for now, rungpg.h and status-table.h.
5483 (gpgsm_status_handler): Implement more of the status handler.
5485 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5487 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5488 (_gpgme_engine_op_delete): Likewise.
5489 (_gpgme_engine_op_encrypt): Likewise.
5490 (_gpgme_engine_op_export): Likewise.
5491 (_gpgme_engine_op_genkey): Likewise.
5492 (_gpgme_engine_op_keylist): Likewise.
5493 (_gpgme_engine_op_sign): Likewise.
5494 (_gpgme_engine_op_trustlist): Likewise.
5496 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5497 (gpgsm_assuan_simple_command): Likewise.
5498 (gpgsm_set_recipients): Likewise.
5499 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5500 (_gpgme_gpgsm_op_delete): New function.
5501 (_gpgme_gpgsm_op_export): Likewise.
5502 (_gpgme_gpgsm_op_genkey): Likewise.
5503 (_gpgme_gpgsm_op_sign): Likewise.
5504 (_gpgme_gpgsm_op_keylist): Likewise.
5505 (_gpgme_gpgsm_op_trustlist): Likewise.
5506 (_gpgme_gpgsm_release): Release command.
5507 (_gpgme_gpgsm_op_decrypt): Allocate command.
5508 (_gpgme_gpgsm_op_import): Likewise.
5509 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5511 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5513 * gpgme.h (gpgme_set_protocol): New prototype.
5515 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5517 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5518 (_gpgme_gpgsm_op_import): Likewise.
5520 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5522 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5524 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5526 2001-11-22 Werner Koch <wk@gnupg.org>
5528 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5529 is defined even with an undefined GPGSM_PATH.
5531 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5533 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5534 gpg_outbound_handler): Moved to ...
5535 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5536 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5537 _gpgme_* ones non-static.
5538 * data.c: Include io.h.
5540 * ops.h (_gpgme_data_inbound_handler): New prototype.
5541 (_gpgme_data_outbound_handler): Likewise.
5542 (_gpgme_gpg_spawn): Use these new functions.
5544 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5545 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5546 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5547 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5548 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5549 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5550 Include <rungpg.h> for status handler function.
5552 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5553 input_data, output_fd, output_data, message_fd, message_data, command
5555 (_gpgme_gpgsm_new): Open input, output and message pipes before
5556 connecting to the client. Close server's ends afterwards.
5557 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5558 server process from wait queue.
5559 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5560 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5562 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5563 (_gpgme_engine_set_status_handler): Likewise.
5564 (_gpgme_engine_op_verify): Likewise.
5566 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5568 * context.h: Do not include rungpg.h, but engine.h.
5569 (struct gpgme_context_s): Replace member gpg with engine.
5570 * gpgme.c (gpgme_release): Release engine, not gpg.
5572 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5574 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5575 Make static, change order of arguments, and return an error value.
5576 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5578 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5579 (_gpgme_gpg_op_encrypt): Likewise.
5580 (_gpgme_gpg_op_decrypt): Likewise.
5581 (_gpgme_gpg_op_delete): Likewise.
5582 (_gpgme_gpg_op_export): Likewise.
5583 (_gpgme_gpg_op_genkey): Likewise.
5584 (_gpgme_gpg_op_import): Likewise.
5585 (_gpgme_gpg_op_keylist): Likewise.
5586 (_gpgme_gpg_op_sign): Likewise.
5587 (_gpgme_gpg_op_trustlist): Likewise.
5588 * rungpg.c (_gpgme_gpg_op_verify): New function.
5589 (_gpgme_gpg_op_encrypt): Likewise.
5590 (_gpgme_gpg_op_decrypt): Likewise.
5591 (_gpgme_gpg_op_delete): Likewise.
5592 (_gpgme_gpg_op_export): Likewise.
5593 (_gpgme_gpg_op_genkey): Likewise.
5594 (_gpgme_gpg_op_import): Likewise.
5595 (_gpgme_gpg_op_keylist): Likewise.
5596 (_gpgme_gpg_op_sign): Likewise.
5597 (_gpgme_gpg_op_trustlist): Likewise.
5599 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5600 (_gpgme_engine_set_command_handler): Likewise.
5601 (_gpgme_engine_set_colon_line_handler): Likewise.
5602 (_gpgme_engine_op_decrypt): Likewise.
5603 (_gpgme_engine_op_delete): Likewise.
5604 (_gpgme_engine_op_encrypt): Likewise.
5605 (_gpgme_engine_op_export): Likewise.
5606 (_gpgme_engine_op_genkey): Likewise.
5607 (_gpgme_engine_op_import): Likewise.
5608 (_gpgme_engine_op_keylist): Likewise.
5609 (_gpgme_engine_op_sign): Likewise.
5610 (_gpgme_engine_op_trustlist): Likewise.
5611 (_gpgme_engine_op_verify): Likewise.
5612 (_gpgme_engine_start): Likewise.
5613 * engine.c (_gpgme_engine_set_status_handler): New function.
5614 (_gpgme_engine_set_command_handler): Likewise.
5615 (_gpgme_engine_set_colon_line_handler): Likewise.
5616 (_gpgme_engine_op_decrypt): Likewise.
5617 (_gpgme_engine_op_delete): Likewise.
5618 (_gpgme_engine_op_encrypt): Likewise.
5619 (_gpgme_engine_op_export): Likewise.
5620 (_gpgme_engine_op_genkey): Likewise.
5621 (_gpgme_engine_op_import): Likewise.
5622 (_gpgme_engine_op_keylist): Likewise.
5623 (_gpgme_engine_op_sign): Likewise.
5624 (_gpgme_engine_op_trustlist): Likewise.
5625 (_gpgme_engine_op_verify): Likewise.
5626 (_gpgme_engine_start): Likewise.
5628 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5630 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5631 * decrypt.c (_gpgme_decrypt_start): Likewise.
5632 * passphrase.c (_gpgme_passphrase_start): Likewise.
5633 * keylist.c (gpgme_op_keylist_start): Likewise.
5635 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5637 * types.h: Add types EngineObject and GpgsmObject.
5639 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5640 engine-gpgsm.c, engine.h and engine.c.
5641 * engine.h: New file.
5642 * engine.c: Likewise.
5643 * engine-gpgsm.h: Likewise.
5644 * engine-gpgsm.c: Likewise.
5646 * rungpg.c (_gpgme_gpg_get_version): New function.
5647 (_gpgme_gpg_check_version): Likewise.
5648 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5649 _gpgme_gpg_check_version.
5651 * version.c (compare_versions): Rename to ...
5652 (_gpgme_compare_versions): ... this. Make non-static.
5653 (gpgme_check_version): Use _gpgme_compare_versions rather than
5655 (gpgme_check_engine): Likewise.
5656 * ops.h (_gpgme_get_program_version): Add prototype.
5658 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5660 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5661 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5662 (libgpgme_la_LIBADD): Likewise.
5664 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5666 * version.c: Remove global variables lineno and
5668 (version_handler): Removed.
5669 (_gpgme_get_program_version): New function.
5670 (get_engine_info): Don't use context and version_handler,
5671 but _gpgme_get_program_version.
5672 * ops.h (_gpgme_get_program_version): Add prototype for
5673 _gpgme_get_program_version (we expect to use it elsewhere soon).
5675 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5677 * version.c (get_engine_info): If GnuPG is not available, return
5679 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5681 (_gpgme_get_gpgsm_path): New function.
5682 * w32-util.c (find_program_in_registry): New static function.
5683 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5684 to use find_program_in_registry.
5685 (_gpgme_get_gpgsm_path): New function.
5686 (util.h): Prototype _gpgme_get_gpgsm_path).
5687 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5690 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5692 * decrypt-verify.c: New file.
5693 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5694 * types.h: Add decrypt-verify types.
5696 * context.h: Add result type for decrypt-verify.
5697 * gpgme.h: Add decrypt-verify prototypes.
5699 * decrypt.c (decrypt_status_handler): Renamed to ...
5700 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5701 (_gpgme_decrypt_start): New function, derived from
5702 gpgme_op_decrypt_start.
5703 (gpgme_op_decrypt_start): Reimplement in terms of
5704 _gpgme_decrypt_start.
5705 (_gpgme_decrypt_result): New function to retrieve error value.
5706 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5707 * ops.h: Add prototypes for new functions.
5709 * verify.c (verify_status_handler): Renamed to ...
5710 (_gpgme_verify_status_handler): ... this. Make non-static.
5711 (gpgme_op_verify_start): Use new function name.
5712 (intersect_stati): Renamed to ...
5713 (_gpgme_intersect_stati): ... this. Make non-static.
5714 (gpgme_op_verify): Use new name.
5715 * ops.h: Add prototypes for new functions.
5717 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5719 * passphrase.c: New file.
5720 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5721 * ops.h (_gpgme_passphrase_result): Add prototypes from
5723 * types.h: Likewise.
5724 * context.h: Add member passphrase to result.
5725 * gpgme.c (_gpgme_release_result): Release passphrase member.
5727 * decrypt.c: Some formatting and variable name changes (like
5729 (struct decrypt_result_s): Remove members now found in
5731 (_gpgme_release_decrypt_result): Don't release removed members.
5732 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5733 and don't handle the cases catched there.
5734 (command_handler): Removed.
5735 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5736 _gpgme_passphrase_start which does it.
5737 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
5738 cases covered by it.
5740 * sign.c Some formatting and variable name changes (like
5742 (struct sign_result_s): Remove members now found in
5744 (_gpgme_release_sign_result): Don't release removed members.
5745 (sign_status_handler): Call _gpgme_passphrase_status_handler,
5746 and don't handle the cases catched there.
5747 (command_handler): Removed.
5748 (gpgme_op_sign_start): Don't set command handler, but invoke
5749 _gpgme_passphrase_start which does it.
5750 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
5751 cases covered by it.
5753 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5755 * decrypt.c (command_handler): Fix last change.
5757 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5759 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
5760 Rename R2 to NEXT_RESULT.
5761 (intersect_stati): Rename RES to RESULT.
5762 (gpgme_get_sig_status): Likewise. Do not check return_type, but
5763 the member verify of result.
5764 (gpgme_get_sig_key): Likewise.
5766 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
5767 RESULT is zero, return.
5768 (sign_status_handler, command_handler): Do not check return_type,
5769 but the member sign of result.
5770 (gpgme_op_sign): Likewise. Drop assertion.
5772 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
5773 If RESULT is zero, return.
5774 (encrypt_status_handler): Do not check return_type, but the member
5776 (gpgme_op_encrypt): Likewise. Drop assertion.
5778 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
5779 (create_result_struct): Do not set result_type.
5780 (command_handler, decrypt_status_handler): Do not check
5781 return_type, but the member decrypt of result.
5782 (gpgme_op_decrypt): Likewise. Drop assertion.
5784 * context.h (enum ResultType): Removed.
5785 (struct gpgme_context_s): Remove member result_type.
5786 (struct result): Replaces union result.
5787 * gpgme.c: Include string.h.
5788 (_gpgme_release_result): Release all members of c->result, which
5789 is now a struct. Zero out all members of the struct afterwards.
5791 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
5793 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
5794 Release all members of the list GPG->arglist.
5795 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
5797 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
5799 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
5801 * key.c: Include string.h.
5803 * recipient.c: Likewise.
5805 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
5807 * context.h: New member signers_len.
5808 * signers.c (gpgme_signers_clear): Require that signers are
5809 non-NULL with assertion. Use signers_len to determine how much
5810 keys to release. Add documentation.
5811 (gpgme_signers_add): Use signers_len to determine if the buffer is
5812 large enough. Use xtryrealloc rather than xtrymalloc and copying.
5814 (gpgme_signers_enum): Use signers_len to determine if key is
5815 available. Add documentation.
5817 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
5819 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
5820 ALLOC_CHUNK, not DH->length.
5822 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
5824 * gpgme.c (gpgme_set_protocol): Fix last change.
5826 2001-10-15 Werner Koch <wk@gnupg.org>
5828 * gpgme.h (GpgmeProtocol): New.
5829 * gpgme.c (gpgme_set_protocol): New.
5831 2001-09-26 Werner Koch <wk@gnupg.org>
5833 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
5834 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
5836 2001-09-17 Werner Koch <wk@gnupg.org>
5838 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
5839 callers to use this function without a check for tmp_key.
5841 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
5842 emptying the queue. Bug reported by Stéphane Corthésy.
5844 2001-09-12 Werner Koch <wk@gnupg.org>
5846 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
5848 2001-09-07 Werner Koch <wk@gnupg.org>
5850 * rungpg.h: Add NO_RECP.
5851 * encrypt.c (encrypt_status_handler): Take on No_RECP.
5852 (gpgme_op_encrypt): Better error return.
5854 * verify.c (verify_status_handler): Take on NODATA.
5856 2001-09-03 Werner Koch <wk@gnupg.org>
5858 * rungpg.h: Added STATUS_INV_RECP.
5859 * gpgme.c (_gpgme_release_result): Add support for new
5860 EncryptResult object.
5861 * encrypt.c (append_xml_encinfo): New.
5862 (encrypt_status_handler): Add some status parsing.
5863 (_gpgme_release_encrypt_result): New.
5865 2001-08-29 Werner Koch <wk@gnupg.org>
5867 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
5869 * keylist.c (keylist_colon_handler): Do a finish key if we receive
5870 an EOF here. This is probably the reason for a lot of bugs
5871 related to keylisting. It is so obvious. Kudos to Enno Cramer
5872 for pointing that out.
5874 2001-08-28 Werner Koch <wk@gnupg.org>
5876 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
5877 (_gpgme_set_op_info): New.
5878 (_gpgme_release_result): Reset the op_info here.
5879 * sign.c (append_xml_siginfo): New.
5880 (sign_status_handler): Store the sig create information.
5882 2001-07-31 Werner Koch <wk@gnupg.org>
5884 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
5886 2001-07-30 Werner Koch <wk@gnupg.org>
5888 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
5890 * rungpg.c (build_argv): Disable armor comments
5891 * w32-io.c (build_commandline): Need to add quotes here
5893 2001-07-24 Werner Koch <wk@gnupg.org>
5895 * data.c (gpgme_data_read): Add a a way to return the available bytes.
5897 2001-07-23 Werner Koch <wk@gnupg.org>
5899 * util.c: Removed stpcpy() because we use the version from jnlib.
5901 2001-07-19 Werner Koch <wk@gnupg.org>
5903 * mkstatus: Define the collating sequence for sort.
5905 2001-06-26 Werner Koch <wk@gnupg.org>
5907 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
5909 2001-06-15 Werner Koch <wk@gnupg.org>
5911 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
5912 to Timo for pointing this out.
5914 2001-06-01 Werner Koch <wk@gnupg.org>
5916 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
5919 2001-05-28 Werner Koch <wk@gnupg.org>
5921 * version.c (gpgme_check_engine): Stop version number parsing at
5922 the opening angle and not the closing one. By Tommy Reynolds.
5924 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
5926 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
5927 line, because it gave an error if another operation had been made
5928 before using the same context.
5930 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
5931 one line to release the gpg object in the context (if any).
5933 2001-04-26 Werner Koch <wk@gnupg.org>
5935 * key.c, key.h (_gpgme_key_cache_init): New.
5936 (_gpgme_key_cache_add): New.
5937 (_gpgme_key_cache_get): New.
5938 * version.c (do_subsystem_inits): Init the cache.
5939 * keylist.c (finish_key): Put key into the cache
5940 * verify.c (gpgme_get_sig_key): First look into the cache.
5942 2001-04-19 Werner Koch <wk@gnupg.org>
5944 * keylist.c (parse_timestamp): Adjusted for the changed
5945 --fixed-list-mode of gpg 1.0.4h.
5947 2001-04-05 Werner Koch <wk@gnupg.org>
5949 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
5951 2001-04-04 Werner Koch <wk@gnupg.org>
5953 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
5954 are still bytes pending. Timo found this not easy to track down
5957 2001-04-02 Werner Koch <wk@gnupg.org>
5959 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
5960 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
5962 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
5963 the mode set in the current context. Suggested by Timo.
5965 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
5966 can_encrypt. By Timo.
5968 2001-03-30 Werner Koch <wk@gnupg.org>
5970 * debug.c (debug_init): Allow to specify a debug file.
5971 (_gpgme_debug_level): New.
5973 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
5974 (_gpgme_io_select): Debug only with level > 2.
5976 2001-03-15 Werner Koch <wk@gnupg.org>
5978 * rungpg.c: Included time.h.
5980 * key.h: New keyflags for capabilities.
5981 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
5982 (keylist_colon_handler): Parse them.
5983 * gpgme.h: New attribute values for capabilties.
5984 * key.c (gpgme_key_get_string_attr): Return them.
5985 (capabilities_to_string): New.
5986 (gpgme_key_get_ulong_attr): Return the global caps.
5988 2001-03-14 Werner Koch <wk@gnupg.org>
5990 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
5991 Thanks to Jan Oliver Wagner.
5993 2001-03-13 Werner Koch <wk@gnupg.org>
5995 * context.h: Add invalid and revoke flags to user_id structure.
5996 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
5997 (keylist_colon_handler): Adjust for that.
5998 (set_userid_flags): New.
5999 (set_mainkey_trust_info): Handle new key invalid flag
6000 (set_subkey_trust_info): Ditto.
6001 * gpgme.h: Add new attributes for key and user ID flags.
6002 * key.c (_gpgme_key_append_name): Init these flags
6003 (gpgme_key_get_as_xml): Print them.
6004 (one_uid_as_xml): New helper for above.
6005 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6006 Return the new attributes. Enhanced, so that subkey information
6007 can be returned now.
6009 2001-02-28 Werner Koch <wk@gnupg.org>
6011 * w32-io.c (destroy_reader): Set stop_me flag.
6012 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6013 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6014 (_gpgme_io_close): Cleanup a writer thread
6015 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6016 waiting which is now possible due to the use of a writer thread.
6018 2001-02-20 Werner Koch <wk@gnupg.org>
6020 * w32-io.c (destroy_reader,kill_reader): New.
6021 (create_reader, reader): Add a new event to stop the thread.
6022 (_gpgme_io_close): Kill the reader thread.
6024 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6025 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6027 * wait.c: Reworked the whole thing.
6028 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6029 (_gpgme_gpg_release): Remove the process from the wait queue.
6031 2001-02-19 Werner Koch <wk@gnupg.org>
6033 * w32-io.c (_gpgme_io_set_close_notify): New.
6034 (_gpgme_io_close): Do the notification.
6036 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6039 * wait.c (remove_process): Don't close the fd here.
6040 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6041 (_gpgme_wait_on_condition): Remove the assert on the queue and
6042 break out if we could not find the queue. The whole thing should
6045 * posix-io.c (_gpgme_io_set_close_notify): New.
6046 (_gpgme_io_close): Do the notification.
6048 * rungpg.c (close_notify_handler): New.
6049 (_gpgme_gpg_new): Register a callback for the fd.
6050 (_gpgme_gpg_set_colon_line_handler): Ditto.
6053 2001-02-13 Werner Koch <wk@gnupg.org>
6055 * rungpg.c (struct reap_s): Replaced pid_t by int.
6057 * types.h: Add ulong typedef.
6059 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6060 (_gpgme_gpg_release): Reap children.
6061 * io.h, posix-io.c (_gpgme_io_kill): New.
6062 * w32-io.c (_gpgme_io_kill): New (dummy).
6064 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6066 * posix-io.c (_gpgme_io_read): Add some debug output.
6067 (_gpgme_io_write): Ditto.
6068 (_gpgme_io_select): Increased the timeout.
6070 2001-02-12 Werner Koch <wk@gnupg.org>
6072 Enhanced the signature verification, so that it can how handle
6073 more than one signature and is able to return more information on
6075 * verify.c (gpgme_get_sig_key): New.
6076 (gpgme_get_sig_status): New.
6078 * gpgme.h: Add stdio.h.
6079 (GpgmeSigStat): New status DIFF.
6081 2001-02-01 Werner Koch <wk@gnupg.org>
6083 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6084 code to all Set/ResetEvent().
6086 * rungpg.c (read_status): Check for end of stream only if we have
6089 2001-01-31 Werner Koch <wk@gnupg.org>
6091 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6092 (propagate_term_results,clear_active_fds): Removed.
6093 (count_active_fds): Renamed to ..
6094 (count_active_and_thawed_fds): .. this and count only thawed fds.
6096 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6099 2001-01-30 Werner Koch <wk@gnupg.org>
6101 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6103 * version.c (get_engine_info): Return better error information.
6105 * posix-util.c, w32-util.c: New.
6106 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6107 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6109 * signers.c (gpgme_signers_add): Ooops, one should test code and
6110 not just write it; the newarr was not assigned. Thanks to José
6111 for pointing this out. Hmmm, still not tested, why should a coder
6114 * w32-io.c: Does now use reader threads, so that we can use
6115 WaitForMultipleObjects.
6116 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6117 Does currently only work for W32.
6119 * debug.c, util.h : New. Changed all fprintfs to use this new
6120 set of debugging functions.
6122 2001-01-23 Werner Koch <wk@gnupg.org>
6124 * data.c (_gpgme_data_release_and_return_string): Fixed string
6127 2001-01-22 Werner Koch <wk@gnupg.org>
6132 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6133 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6135 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6136 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6138 2001-01-05 Werner Koch <wk@gnupg.org>
6140 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6143 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6145 This file is free software; as a special exception the author gives
6146 unlimited permission to copy and/or distribute it, with or without
6147 modifications, as long as this notice is preserved.
6149 This file is distributed in the hope that it will be useful, but
6150 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6151 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.