1 2009-06-18 Marcus Brinkmann <marcus@g10code.de>
3 * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
4 back! (GPA still uses it...).
6 * gpgme.def: Fix stupid typo.
7 * w32-io.c (_gpgme_io_pipe): Add missing declaration.
9 * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
11 * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
13 (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
14 (_gpgme_io_dup): Never allocate threads here.
15 (find_writer, find_reader): Check return value of thread creation
18 * context.h (CTX_OP_DATA_MAGIC): New macro.
19 (struct ctx_op_data): New member MAGIC.
20 * op-support.c (_gpgme_op_data_lookup): Initialize magic.
21 * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
23 2009-06-16 Marcus Brinkmann <marcus@g10code.de>
25 * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
27 * gpgme.c (result_ref_lock): New global variable.
28 (gpgme_result_ref, gpgme_result_unref): use it.
30 2009-06-16 Werner Koch <wk@g10code.com>
32 * version.c: Include stdlib.h.
34 * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
35 GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
36 * data.c (gpgme_data_set_encoding): Adjust for new values.
37 * engine-gpg.c (string_from_data): New.
38 (gpg_import): Implement --fetch-key feature.
40 * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
41 * gpgme.def, libgpgme.vers: Add them.
42 * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
43 (export_keys_start): New.
45 * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
46 (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
47 (gpgme_op_export_ext): Change arg RESERVED to MODE of new
49 * export.c (gpgme_export_ext_start, gpgme_op_export)
50 (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
51 (export_start): Ditto.
52 * engine.c (_gpgme_engine_op_export): Ditto.
53 * engine-backend.h (struct engine_ops): Ditto.
54 * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
55 * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement
57 (gpg_export, gpg_export_ext): Factor common code out to ..
58 (export_common): .. this.
60 * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
61 * gpgme.def, libgpgme.vers: Add them.
62 * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
63 (_gpgme_op_import_keys_start): New.
64 * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
65 * engine-backend.h (struct engine_ops): Ditto.
66 * engine-gpgsm.c (gpgsm_import): Ditto. Not functional.
67 * engine-gpg.c (gpg_import): Ditto. Implement it.
69 2009-06-15 Marcus Brinkmann <marcus@g10code.de>
71 * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
73 * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
75 * context.h (struct ctx_op_data): Add member "references".
76 * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
77 (_gpgme_release_result): Use gpgme_result_unref.
78 * op-support.c (_gpgme_op_data_lookup): Initialize references.
80 2009-06-12 Werner Koch <wk@g10code.com>
82 * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
83 flags. Add new arg R_FLAGS. Fix segv on file w/o LF.
84 (translate_handles): Add new arg R_FLAGS. Avoid possible segv.
85 (main): Pass flags for my_spawn.
86 (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
88 * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
89 * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
90 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
91 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
92 * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
93 * engine-gpg.c (start): Call spawn with new flag.
95 * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
96 _gpgme_allow_set_foreground_window. Change all callers.
97 * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
99 2009-06-10 Werner Koch <wk@g10code.com>
101 * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
103 2009-06-09 Werner Koch <wk@g10code.com>
105 * engine-gpg.c (gpg_io_event): Test for cmd.fd.
107 * version.c (gpgme_check_version_internal): Make result const.
109 * gpgme.c: Include priv-io.h.
110 (gpgme_io_read, gpgme_io_write): New.
111 * libgpgme.vers (GPGME_1.1): Add them.
114 * Makefile.am (main_sources): Remove gpgme.h.
115 (include_HEADERS): Rename to nodist_include_HEADERS so that a
116 VPATH build won't use the distributed one.
118 * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
120 2009-05-28 Marcus Brinkmann <marcus@g10code.de>
122 * gpgme.h.in (gpgme_check_version_internal): New prototype.
123 (gpgme_check_version): New macro, overriding function of the same
125 * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
126 * context.h (_gpgme_selftest): New variable declaration.
127 * version.c: Include "context.h".
128 (gpgme_check_version): Set _gpgme_selftest on success.
129 (gpgme_check_version_internal): New function.
130 * gpgme.c (_gpgme_selftest): Define it.
131 (gpgme_new): Check the selftest result.
133 2009-05-18 Marcus Brinkmann <marcus@g10code.de>
135 * gpgme.h.in (gpgme_encrypt_flags_t): Add
136 GPGME_ENCRYPT_NO_ENCRYPT_TO.
137 * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
138 GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
140 2009-05-14 Werner Koch <wk@g10code.com>
142 * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
143 better maintainability and to help debugging.
145 2009-05-05 Marcus Brinkmann <marcus@g10code.de>
147 * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
149 2009-04-15 Marcus Brinkmann <marcus@g10code.de>
151 * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
152 * w32-io.c (_gpgme_io_connect): Fix stupid error.
154 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
156 * w32-glib-io.c (giochannel_table): New members used, fd, socket.
157 (find_channel): Drop CREATE argument.
158 (new_dummy_channel_from_fd, new_channel_from_fd)
159 (new_channel_from_socket): New functions.
160 (_gpgm_io_fd2str): Implement for sockets.
161 (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
163 (_gpgme_io_pipe): Fix for new channel bookkeeping.
164 (_gpgme_io_close, _gpgme_io_dup): Likewise.
165 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
166 * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
167 (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
168 * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
169 * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
170 (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
171 * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
173 2009-03-18 Werner Koch <wk@g10code.com>
175 * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
176 * engine-gpgsm.c (gpgsm_keylist): Send new option.
178 2009-03-13 Werner Koch <wk@g10code.com>
180 * gpgme-config.in: Make sure locale is set to C.
182 2009-02-24 Werner Koch <wk@g10code.com>
184 * gpgme.h.in (struct _gpgme_op_assuan_result): New.
185 (gpgme_assuan_result_t): New.
186 (gpgme_op_assuan_result): Change return type.
187 (struct _gpgme_assuan_sendfnc_ctx)
188 (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
189 (gpgme_assuan_inquire_cb_t): Changed.
190 * opassuan.c (op_data_t): Make use of a result structure.
191 (gpgme_op_assuan_result): Change return type.
192 (opassuan_start): Use result structure.
194 * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
195 (inquire_cb_sendfnc): Remove.
196 (inquire_cb): Change for new callback scheme. Not yet finished.
197 (llass_status_handler): Allow sending a CANCEL from the inquire CB.
199 2009-02-04 Werner Koch <wk@g10code.com>
201 * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
203 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
205 2009-02-03 Werner Koch <wk@g10code.com>
207 * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
209 * key.c (gpgme_key_unref): Release field CARD_NUMBER.
210 * keylist.c (keylist_colon_handler): Factor common code out to ...
211 (parse_sec_field15): New. Set card number.
213 2009-01-26 Werner Koch <wk@g10code.com>
215 * opassuan.c, dirinfo.c, engine-assuan.c: New.
216 * Makefile.am: Add them.
217 * engine-backend.h: Add _gpgme_engine_ops_assuan.
218 (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all
220 * Makefile.am (gpgsm_components): Add engine-assuan.c.
221 * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
222 (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
223 (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
224 (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
225 * gpgme.c (gpgme_get_protocol_name): Ditto.
226 (gpgme_set_protocol): Support it.
227 * engine.c (gpgme_get_engine_info): Ditto.
228 (engine_ops): Register it.
229 (_gpgme_engine_op_assuan_transact): New.
230 * libgpgme.vers (gpgme_op_assuan_transact_start)
231 (gpgme_op_assuan_transact): New.
232 * gpgme.def (gpgme_op_assuan_transact_start)
233 (gpgme_op_assuan_transact): New.
234 * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
235 initialize to NULL for all engines.
236 * engine.c (engine_get_home_dir): New.
237 (gpgme_get_engine_info): Use it.
238 (_gpgme_set_engine_info): Use it.
239 * engine.h (engine_assuan_result_cb_t): New.
240 * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
242 * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
244 * version.c (gpgme_check_version): Protect trace arg against NULL.
246 2009-01-19 Werner Koch <wk@g10code.com>
248 * rungpg.c: Rename to engine-gpg.c
249 * Makefile.am (main_sources): Ditto.
251 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
253 * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
255 2008-11-18 Werner Koch <wk@g10code.com>
257 * version.c (do_subsystem_inits): Always initialize I/O
258 subsystem. Fixes regression from 2007-08-02.
260 * decrypt.c (_gpgme_decrypt_status_handler): Use
261 _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
263 2008-10-30 Marcus Brinkmann <marcus@g10code.de>
265 * wait-private.c (_gpgme_wait_on_condition): Remove unused
267 * wait-global.c: Include ops.h to silence gcc warning.
268 (_gpgme_wait_global_event_cb): Pass error value directly.
269 * wait-user.c: Include ops.h to silence gcc warning.
271 * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
272 silence gcc warning. Cast argument to execv to silence warning.
273 * w32-io.c (_gpgme_io_spawn): Likewise.
274 * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
276 2008-10-24 Werner Koch <wk@g10code.com>
278 * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
280 2008-10-23 Marcus Brinkmann <marcus@g10code.de>
282 * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
283 string to C coded string.
285 2008-10-20 Werner Koch <wk@g10code.com>
287 * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
289 * gpgme.h: Rename to gpgme.h.in.
290 * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
292 * posix-io.c: Include sys/uio.h. Fixes bug #818.
294 2008-10-18 Marcus Brinkmann <marcus@g10code.com>
296 * w32-util.c (find_program_in_registry): Don't define.
297 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
298 (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
299 registry anymore. It is now no longer possible to overwrite the
300 default location in that way.
302 2008-10-17 Werner Koch <wk@g10code.com>
304 * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
305 around a bug in mingw32.
307 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
309 * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
310 Submitted by "Daniel Mueller" <daniel@danm.de>
312 2008-09-16 Marcus Brinkmann <marcus@g10code.com>
314 * rungpg.c (gpg_new): Don't use errno with ttyname_r.
316 2008-08-11 Marcus Brinkmann <marcus@g10code.com>
318 * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
319 * gpgme.c (_gpgme_cancel_with_err): New function.
320 (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
321 * wait-private.c (_gpgme_wait_on_condition): Use
322 _gpgme_cancel_with_err.
323 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
324 * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
326 2008-08-08 Marcus Brinkmann <marcus@g10code.com>
328 * rungpg.c (command_handler): Remove I/O callback on error, too.
330 2008-06-29 Marcus Brinkmann <marcus@g10code.com>
332 * gpgme.c (gpgme_cancel_async): Remove unused variable.
334 2008-06-27 Marcus Brinkmann <marcus@g10code.de>
336 * libgpgme.vers: Add gpgme_cancel_async.
337 * gpgme.def: Likewise.
339 * context.h: Include "sema.h".
340 (struct gpgme_context): New members lock and canceled.
341 * gpgme.c (gpgme_new): Initialize lock.
342 (gpgme_release): Destroy lock.
343 (gpgme_cancel_async): New function.
344 * op-support.c (_gpgme_op_reset): Reset the canceled flag.
345 * wait-global.c (gpgme_wait): Check cancel flag before processing
347 * wait-private.c (_gpgme_wait_on_condition): Likewise.
348 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
350 2008-06-26 Werner Koch <wk@g10code.com>
352 * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
353 (mkstemp): Need to use GetSystemTimeAsFileTime for better
356 2008-06-25 Marcus Brinkmann <marcus@g10code.de>
358 * gpgme-w32spawn.c: New file.
359 * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
361 * engine-gpgsm.c (gpgsm_new): Use server translated handles.
362 (gpgsm_set_locale): Return early if locale value is NULL.
363 * util.h (_gpgme_mkstemp)
364 (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
366 * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
367 (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
369 * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
370 (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
371 special filename FD rather than stdin.
372 (struct arg_and_data_s): Add member ARG_LOCP.
373 (struct fd_data_map_s): Add member ARG_LOC.
374 (struct engine_gpg): Add member ARG_LOC to status and colon.
375 (_add_arg, add_arg_with_locp): New function.
376 (add_arg_ext): Reimplement in terms of _add_arg.
377 (gpg_new): Remember argument location for status FD.
378 (build_argv): Set argument location if requested. Also set
379 argument location of fd_data_map for data items.
380 (start): Adjust caller of _gpgme_io_spawn.
381 * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
383 (_gpgme_io_spawn): Remove parent fd list argument.
384 * posix-io.c (get_max_fds): New function.
385 (_gpgme_io_dup): Add tracing.
386 (_gpgme_io_spawn): Remove parent fd list. Change meaning of child
387 fd list to contain all child fds that should be inherited. Close
388 all other file descriptors after fork.
389 * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
390 parent fd list. Change meaning of child fd list to contain all
391 child fds that should be inherited. Do not inherit any file
392 descriptors, but DuplicateHandle them. Spawn process through
393 wrapper process. Provide wrapper process with a temporary file
394 containing handle translation data. Return translated handle
396 * w32-io.c (reader): Add more tracing output.
397 (_gpgme_io_read): Likewise.
398 * engine-gpgconf.c (gpgconf_read): Adjust caller of
400 * version.c (_gpgme_get_program_version): Likewise.
402 2008-06-20 Werner Koch <wk@g10code.com>
404 * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
405 compatibility with old compilers. Fix amount of memmove. Fix
408 2008-06-19 Werner Koch <wk@g10code.com>
410 * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
411 change all callers and provide compatibilty macro.
412 (gpgme_conf_type_t): Add complex types 34..37.
413 * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
414 (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
416 2008-06-19 Marcus Brinkmann <marcus@g10code.de>
418 * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
420 2008-05-09 Werner Koch <wk@g10code.com>
422 * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
425 2008-05-07 Werner Koch <wk@g10code.com>
427 * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
428 self-explaining string. Needs a proper fix, though.
430 * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
432 (gpg_build_keylist_options): .. new. Allow combination of extern
434 (gpg_new): DFT_TTYNAME is an array, thus check the first character.
436 2008-05-06 Werner Koch <wk@g10code.com>
438 * version.c (extract_version_string): New.
439 (_gpgme_get_program_version): Use it to allow for suffixes in the
442 2008-04-28 Werner Koch <wk@g10code.com>
444 * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
447 2008-04-22 Marcus Brinkmann <marcus@g10code.de>
449 * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
450 Osterfeld, implement blocking select.
452 2008-03-11 Marcus Brinkmann <marcus@g10code.de>
454 * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
456 2008-03-06 Marcus Brinkmann <marcus@g10code.de>
458 * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
459 Reported by Marc Mutz.
461 2008-03-05 Marcus Brinkmann <marcus@g10code.de>
463 * decrypt.c (release_op_data): Release OPD->result.recipients.
464 * encrypt.c (release_op_data): Release invalid_recipient.
466 2008-02-15 Marcus Brinkmann <marcus@g10code.de>
468 * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
470 2008-02-14 Werner Koch <wk@g10code.com>
472 * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
473 * posix-io.c (_gpgme_io_spawn): Ditto.
474 * w32-glib-io.c (_gpgme_io_spawn): Ditto.
475 * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
476 * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
477 * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
479 * w32-util.c (_gpgme_allow_set_foregound_window): New.
480 * posix-util.c (_gpgme_allow_set_foregound_window): New.
481 * engine-gpgsm.c (default_inq_cb): New.
482 (gpgsm_new) [W32]: Enable pinentry notifications.
483 (status_handler): Handle inquiries.
485 2008-01-30 Marcus Brinkmann <marcus@g10code.de>
487 * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
490 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
492 * engine-gpgsm.c (map_input_enc): Rename to ...
493 (map_data_enc): ... this. Also change all callers.
494 (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
495 (gpgsm_sign): Set encoding for output.
497 2008-01-28 Werner Koch <wk@g10code.com>
499 * keylist.c (gpgme_get_key): Skip duplicated keys. Fixes bug 876.
501 2008-01-14 Marcus Brinkmann <marcus@g10code.de>
503 * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
506 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
508 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
510 * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
513 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
515 * Makefile.am (gpgconf_components): New variable.
516 (main_sources): Add gpgconf.c.
517 * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
518 (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
519 (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
520 (gpgme_conf_arg_release, gpgme_conf_opt_change)
521 (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
523 * gpgconf.c, engine-gpgconf.c: New files.
524 * engine.h: (_gpgme_engine_op_conf_load,
525 (_gpgme_engine_op_conf_save): New prototypes.
526 * op-support.c (_gpgme_op_reset): Ignore not implemented locale
528 * posix-util.c (_gpgme_get_gpgconf_path): New function.
529 * w32-util.c (_gpgme_get_gpgconf_path): New function.
531 (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
533 (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
534 * gpgme.def: Add new gpgconf related interfaces.
535 * libgpgme.vers: Likewise.
536 * util.h (_gpgme_get_gpgconf_path): New prototype.
537 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
538 * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
539 (struct engine_ops): Add members for conf_load and conf_save.
540 * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
541 (_gpgme_engine_op_conf_load,
542 (_gpgme_engine_op_conf_save): New functions.
543 (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
545 2007-11-28 Marcus Brinkmann <marcus@g10code.de>
547 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
548 for installation directory. Remove old fallback default.
549 (find_program_in_inst_dir): New function.
551 2007-11-26 Werner Koch <wk@g10code.com>
553 * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
554 always reset it before calling start.
555 (gpgsm_new): Clear it.
556 (status_handler): Implement it.
557 (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
559 2007-11-23 Werner Koch <wk@g10code.com>
561 * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
562 * getauditlog.c (getauditlog_start): Use that flag.
564 2007-11-22 Werner Koch <wk@g10code.com>
566 * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
567 * libgpgme.vers: Ditto.
569 * getauditlog.c: New.
570 * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
571 * engine-gpgsm.c (gpgsm_getauditlog): New.
572 (_gpgme_engine_ops_gpgsm): Insert new function.
573 (gpgsm_new): Try to enable audit log support.
574 * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
576 2007-11-20 Werner Koch <wk@g10code.com>
578 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
580 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
582 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
584 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
586 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
588 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
590 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
593 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
595 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
598 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
600 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
601 w32-qt-io.cpp: New versions from Frank Osterfeld.
603 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
605 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
606 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
607 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
608 Submitted by Frank Osterfeld.
610 * priv-io.h, engine-gpgsm.c: Add comments.
611 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
612 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
614 (_gpgme_io_dup): Acquire a reference. Replace unused
615 implementation by assertion.
617 2007-09-28 Werner Koch <wk@g10code.com>
619 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
621 (gpgsm_set_fd): Use it.
623 * w32-glib-io.c (find_channel): Add a new primary flag.
624 (_gpgme_io_close): Close channel only if primary.
625 (_gpgme_io_dup): Put newfd into the table as shallow copy.
627 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
628 * w32-io.c (_gpgme_io_select): Ditto.
629 * w32-glib-io.c (_gpgme_io_select): Ditto.
631 * posix-io.c (_gpgme_io_select): Ditto.
632 * rungpg.c (read_status): Ditto.
633 * wait.c (fd_table_put): Ditto.
635 * rungpg.c (gpg_io_event): Add tracing.
636 (start): Use gpg_io_event for sending the start event.
637 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
638 (start): Use gpgsm_io_event for sending the start event.
639 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
641 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
643 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
644 versions from Frank Osterfeld.
646 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
648 * w32-glib-io.c (_gpgme_io_spawn),
649 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
650 the process handle, return 0.
652 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
653 * gpgme.c (gpgme_get_protocol_name): Implement support for
654 GPGME_PROTOCOL_UNKNOWN.
656 * kdpipeiodevice.h: Fix last change.
658 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
659 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
662 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
664 * conversion.c, keylist.c: Include <sys/types.h>.
666 * kdpipeiodevice.h: Use namespace _gpgme_.
667 * kdpipeiodevice.cpp: Use namespace _gpgme_.
668 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
669 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
670 _gpgme_::KDPipeIODevice.
672 2007-09-17 Werner Koch <wk@g10code.com>
674 * rungpg.c (gpg_new): Make robust against undefined ttyname or
677 2007-09-14 Werner Koch <wk@g10code.com>
679 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
681 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
683 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
685 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
687 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
690 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
692 * Makefile.am (libgpgme_qt_la_SOURCES): Move
693 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
694 another file (it's more like a header file than a cpp file, but
695 automake doesn't know that).
697 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
698 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
699 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
701 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
702 kdpipeiodevice.moc, w32-qt-io.c: New files.
703 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
704 (ltlib_gpgme_qt): New variable.
705 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
706 (libgpgme_qt_la_SOURCES): New variable.
707 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
708 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
709 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
710 (libgpgme_qt_la_LIBADD): New variables.
712 * sema.h (struct critsect_s): Rename "private" to "priv" to make
713 C++ users happy. Change users.
714 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
715 (_gpgme_sema_cs_destroy): Likewise.
716 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
717 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
718 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
720 (gpgme_get_fdptr): New function.
721 * w32-io.c (gpgme_get_fdptr): New function
722 * gpgme.def: Add gpgme_get_fdptr.
724 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
726 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
727 (writer): Remove superfluous check.
729 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
731 * gpgme.h: Move include of gpg-error.h out of extern "C".
733 2007-08-07 Werner Koch <wk@g10code.com>
735 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
736 * verify.c (parse_trust): Set Chain_MODEL.
738 2007-08-02 Werner Koch <wk@g10code.com>
740 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
741 * w32-io.c (_gpgme_io_spawn): Ditto.
742 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
743 * debug.c (_gpgme_debug): Enable assuan logging.
744 (_gpgme_debug_subsystem_init): New.
745 * version.c (do_subsystem_inits): Disable assuan logging and
746 initialize the debug system.
747 (gpgme_check_version): Do not trace before the subsystems are
750 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
752 * debug.c: Include <errno.h> and "debug.h".
753 (_gpgme_debug): Save and restore ERRNO.
755 (_gpgme_debug_buffer): New function.
756 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
757 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
758 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
759 most of these files, add many more tracepoints.
761 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
763 * engine-gpgsm.c (status_handler): Do not send BYE here.
765 * w32-io.c (struct reader_context_s, struct writer_context_s): New
767 (create_reader, create_writer): Initialize C->refcount to 1.
768 (destroy_reader, destroy_writer): Only destroy if C->refcount
770 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
771 * priv-io.h (_gpgme_io_dup): New prototype.
772 * posix-io.c (_gpgme_io_dup): New function.
773 * w32-io.c (_gpgme_io_dup): Likewise.
774 * w32-glib-io.c (_gpgme_io_dup): Likewise.
775 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
777 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
779 * data-user.c (user_read, user_write, user_seek): Set errno and
780 return -1 instead returning the error code directly.
781 * data-compat.c (old_user_seek): Likewise.
782 * gpgme.c (gpgme_sig_notation_add): Return error properly.
784 * Revert the "close_notify_handler" returns int stuff. Always
785 close in the _gpgme_io_close implementations.
786 * engine-gpgsm.c (status_handler): Try to terminate the connection
788 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
789 (_gpgme_io_write): Likewise.
791 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
792 to _gpgme_close_notify_handler.
793 (_gpgme_close_notify_handler): New type.
794 (_gpgme_io_dup): Remove prototype.
795 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
796 type of HANDLER to _gpgme_close_notify_handler_t.
797 (_gpgme_io_close): Do not close the FD if handler returns 0.
798 (_gpgme_io_dup): Remove function.
799 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
800 _gpgme_io_close): Change type of HANDLER to
801 _gpgme_close_notify_handler_t.
802 (_gpgme_io_close): Do not close the FD if handler returns 0.
803 (_gpgme_io_dup): Remove function.
804 * w32-glib-io.c (_gpgme_io_dup): Remove function.
805 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
806 to _gpgme_close_notify_handler_t.
807 (_gpgme_io_close): Do not close the FD if handler returns 0.
808 * rungpg.c (close_notify_handler): Change return type to int,
810 * engine-gpgsm.c (close_notify_handler): Change return type to
811 int, return 0 for status FD and 1 for all other FDs.
812 (start): Do not duplicate the status FD.
814 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
816 * Makefile.am: Replace implicite rule by suffix rule. Add
819 2007-07-12 Werner Koch <wk@g10code.com>
821 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
822 system has been started.
824 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
826 * priv-io.h (_gpgme_io_dup): New prototype.
827 * posix-io.c (_gpgme_io_dup): New function.
828 * w32-io.c (_gpgme_io_dup): Likewise.
829 * w32-glib-io.c (_gpgme_io_dup): Likewise.
830 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
832 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
834 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
835 * funopen.c (funopen): Rename to _gpgme_funopen.
837 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
839 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
840 * rungpg.c (gpg_new): Likewise.
841 Submitted by Stephen Tether.
843 2007-02-26 Werner Koch <wk@g10code.com>
845 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
846 (_gpgme_verify_status_handler): Return an error if more than one
847 plaintext has been seen.
848 (parse_error): New arg SET_STATUS. Also detect it based on an
849 ERROR status (gpg > 1.4.6).
851 2007-01-26 Werner Koch <wk@g10code.com>
853 * w32-io.c (build_commandline): Fixed stupid quoting bug.
854 * w32-glib-io.c (build_commandline): Ditto.
856 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
858 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
860 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
862 * data.h (_gpgme_data_get_fd): Add prototype.
863 (gpgme_data_get_fd_cb): New type.
864 (struct _gpgme_data_cbs): New member get_fd.
865 * data.c (_gpgme_data_get_fd): New function.
866 * data-fd.c (fd_get_fd): New function.
867 (fd_cbs): Add fd_get_fd.
868 * data-stream.c (stream_get_fd): New function.
869 (stream_cbs): Add stream_get_fd.
870 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
871 * data-user.c (user_cbs): Likewise.
872 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
873 short-cut by passing the data descriptor directly.
875 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
877 * w32-io.c (build_commandline): Quote all command line arguments.
878 * w32-glib-io.c (build_commandline): Likewise.
880 2007-01-10 Werner Koch <wk@g10code.com>
882 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
884 2007-01-08 Werner Koch <wk@g10code.com>
886 * version.c (do_subsystem_inits): Do assuan init only if building
888 * setenv.c: Include assuan-def.h only if building with Assuan
891 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
893 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
894 * rungpg.c (gpg_set_locale): Ditto.
896 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
898 * gpgme.c (gpgme_set_protocol): Shut down the engine when
900 (gpgme_ctx_set_engine_info): Likewise for engine info.
901 * engine.h (_gpgme_engine_reset): New function prototype.
902 * engine.c (_gpgme_engine_reset): New function.
903 * engine-backend.h (struct engine_ops): New member RESET.
904 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
905 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
906 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
907 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
909 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
910 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
911 function if available.
912 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
914 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
916 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
917 lc_messages from prototype.
918 (_gpgme_engine_set_locale): New prototype.
919 * engine.c (_gpgme_engine_set_locale): New function.
920 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
921 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
922 Remove arguments lc_messages and lc_ctype from member NEW.
923 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
925 (gpgsm_new): Remove lc_messages and lc_ctype
927 (gpgsm_set_locale): New function.
928 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
929 * rungpg.c (struct engine_gpg): Add new members lc_messages and
931 (gpg_release): Release lc_messages and lc_ctype if set.
932 (gpg_new): Remove lc_messages and lc_ctype arguments.
933 (gpg_set_locale): New function.
934 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
935 (add_arg): Implement in terms of:
936 (add_arg_ext): New function.
937 (start): Set lc-messages and lc-ctype arguments here.
939 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
941 * engine-gpgsm.c (struct engine_gpgsm): Move members
942 input_fd_server, output_fd_server, message_fd_server to ...
943 (iocb_data): ... here (as server_fd).
944 (close_notify_handler): Reset tags as well.
945 (gpgsm_new): Implement support for descriptor
947 (fd_type_t): New type.
948 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
949 for unused communication channels.
950 (gpgsm_set_fd): Rewritten to support descriptor passing. All
951 relevant callers adjusted as well (previously of _gpgme_io_close).
953 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
955 * version.c: Include "assuan.h".
956 (do_subsystem_inits): Call assuan_set_assuan_err_source.
958 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
960 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
961 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
962 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
964 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
965 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
966 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
967 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
969 (noinst_LTLIBRARIES): Removed.
970 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
971 (AM_CFLAGS): New variable.
973 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
975 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
976 ASSUAN_CONTEXT with assuan_context_t.
978 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
980 * engine-gpgsm.c (gpgsm_new): Check return value of
983 * rungpg.c: Include <unistd.h>.
984 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
985 --lc-messages. Fixes issue 734.
987 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
989 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
992 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
994 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
995 _gpgme_engine_io_event().
997 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
999 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
1001 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1004 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
1006 * keylist.c (keylist_colon_handler): Move debug output after
1009 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
1011 * gpgme-config.in (Options): Add NETLIBS.
1012 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1013 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1015 * rungpg.c (read_status): Fix comparison disguising as an
1018 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1020 * gpgme.c (gpgme_set_locale): Remove conditional on
1021 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1023 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
1025 * rungpg.c (read_status): Strip potential carriage return.
1026 * genkey.c (get_key_parameter): Skip potential carriage return.
1027 * version.c (_gpgme_get_program_version): Strip potential carriage
1030 * data.c (gpgme_data_set_file_name): Allow to clear the file name
1033 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
1035 * keylist.c (gpgme_get_key): Also clone the engine info.
1037 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
1039 * gpgme-config.in (cflags_pth): Revert accidential removal of
1040 pthread support with last change.
1042 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
1044 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1045 (_gpgme_io_pipe): Open pipes in binary mode.
1047 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
1049 * engine.c (gpgme_engine_check_version): Reimplemented to allow
1050 checking the version correctly even after changing the engine
1051 information. Bug reported by Stéphane Corthésy.
1053 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1055 (colon_preprocessor_t): New type.
1056 (struct engine_gpg): New member colon.preprocess_fnc.
1057 (gpg_keylist_preprocess): New function.
1058 * keylist.c (keylist_colon_handler): Allow short key IDs.
1060 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
1062 * w32-io.c (create_writer): Make C->have_data a manually resetted
1064 (writer): Move code from end of if block to beginning, so it
1065 is also run the first time.
1066 (_gpgme_io_write): Move assert check after error check. Reset
1067 the is_empty event, and also do it eagerly.
1068 (_gpgme_io_select): Unconditionally wait for the is_empty event.
1070 2006-01-26 Werner Koch <wk@g10code.com>
1072 * w32-util.c (_gpgme_get_conf_int): New.
1073 * posix-util.c (_gpgme_get_conf_int): New.
1074 * w32-io.c (get_desired_thread_priority): New.
1075 (create_reader, create_writer): Use it here.
1077 2006-01-04 Werner Koch <wk@g10code.com>
1079 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1081 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1082 statements. Disable error return for failed nonblocking call.
1084 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
1086 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1089 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
1091 * w32-glib-io.c (find_channel): Set channel to unbuffered.
1092 (_gpgme_io_select): Fix debug output.
1094 2005-12-23 Werner Koch <wk@g10code.com>
1096 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1097 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1100 2005-12-20 Werner Koch <wk@g10code.com>
1102 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1103 and GPGME_STATUS_PKA_TRUST_GOOD.
1104 (struct _gpgme_signature): New field pka_trust.
1105 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1107 2005-12-06 Werner Koch <wk@g10code.com>
1109 * keylist.c (keylist_colon_handler): Store fingerprints of the
1110 subkeys. Reset the secret flag of subkeys for stub secret keys.
1111 (NR_FIELDS): Bumped up to 16
1113 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
1115 * engine.c (_gpgme_set_engine_info): Use new_file_name in
1116 engine_get_version invocation. Reported by Stéphane Corthésy.
1118 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
1120 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1122 2005-11-18 Werner Koch <wk@g10code.com>
1124 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1126 (find_channel): Better use g_io_channel_win32_new_fd instead of
1127 the autodetection function g_io_channel_unix_new.
1128 (_gpgme_io_select): Rewritten. It is now a fully working select
1131 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
1133 * priv-io.h (_gpgme_io_fd2str): New prototype.
1134 * posix-io.c (_gpgme_io_fd2str): New function.
1135 * w32-io.c (_gpgme_io_fd2str): New function.
1136 * rungpg.c: Use this new function.
1137 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1138 again. Two's company, three's the musketeers.
1140 * w32-glib-io.c: Rewrote the file handle code. We don't create
1141 system fds for every handle (doesn't work for inherited handles),
1142 but we create pseudo fds in a private namespace that designate a
1143 handle and potentially a giochannel.
1145 2005-11-18 Werner Koch <wk@g10code.com>
1147 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1149 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1151 * w32-glib-io.c: New file.
1152 * gpgme.def (gpgme_get_giochannel): Add symbol.
1153 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1155 (ltlib_gpgme_extra): New variable.
1156 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1157 (system_components_not_extra): New variable.
1158 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1159 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1160 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1161 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1162 [BUILD_W32_GLIB]: New variables.
1163 * gpgme-config.in (glib): New option.
1164 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1166 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
1168 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1169 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1170 * posix-io.c (_gpgme_io_kill): Removed.
1171 (_gpgme_io_waitpid): Declare static.
1173 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
1175 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1177 2005-10-21 Werner Koch <wk@g10code.com>
1179 * Makefile.am: Fixed cut+paste problem
1181 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
1183 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
1186 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
1188 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1191 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
1193 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1196 * gpgme.h (gpgme_free): New prototype.
1197 * data-mem.c (gpgme_free): New function.
1198 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1199 * gpgme.def: Add gpgme_free.
1201 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
1203 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1205 * verify.c (parse_notation): Likewise for invocation.
1206 * conversion.c (_gpgme_decode_percent_string): Likewise to
1207 declaration. If set, do not replace '\0' characters with a
1209 * gpgme.h (struct _gpgme_key_sig): New field notations.
1210 * ops.h (_gpgme_parse_notation): New prototype.
1211 * sig-notation.c (_gpgme_parse_notation): New function.
1212 * key.c (gpgme_key_unref): Free all signature notations.
1213 * keylist.c (op_data_t): New member tmp_keysig.
1214 (finish_key): Clear OPD->tmp_keysig.
1215 * gpgme.c (gpgme_set_keylist_mode): Remove check.
1216 * rungpg.c (gpg_keylist): Support listing signature notations.
1217 (gpg_keylist_ext): Likewise.
1219 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
1221 * engine.h (_gpgme_set_engine_info): Add prototype.
1222 * engine-backend.h (struct engine_ops): Change return type of
1223 get_file_name() to const char * to silence gcc warning.
1224 * engine.c (engine_get_file_name): Change return type to const
1225 char * to silence gcc warning.
1226 (gpgme_get_engine_info): Use transitional variable to go from
1227 const char * to char * to silence gcc warning.
1228 (_gpgme_set_engine_info): Likewise.
1229 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1230 char * to silence gcc warning.
1231 (gpgsm_new): Make ARGV a pointer to const char.
1232 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1233 to char * to silence gcc warning.
1235 * gpgme.def: Add gpgme_data_set_file_name,
1236 gpgme_data_get_file_name, gpgme_sig_notation_clear,
1237 gpgme_sig_notation_add and gpgme_sig_notation_get.
1238 * libgpgme.vers: Add gpgme_sig_notation_clear,
1239 gpgme_sig_notation_add and gpgme_sig_notation_get.
1240 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1241 * context.h (struct gpgme_context): New field sig_notations.
1242 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1244 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1245 (gpgme_sig_notation_flags_t): New type.
1246 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1247 gpgme_sig_notation_get): New prototypes.
1248 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1250 * sig-notation.c (_gpgme_sig_notation_free): New file.
1251 * verify.c (parse_notation): Use support functions.
1252 (release_op_data): Likewise.
1253 * rungpg.c (append_args_from_sig_notations): New function.
1254 (gpg_encrypt_sign, gpg_sign): Call it.
1256 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
1258 * data.h (struct gpgme_data): New member file_name.
1259 * data.c (gpgme_data_set_filename): New function.
1260 (_gpgme_data_release): Free DH->filename if necessary.
1261 (gpgme_data_get_filename): New function.
1262 * rungpg.c (gpg_encrypt): Set filename option.
1263 (gpg_encrypt_sign): Likewise.
1264 (gpg_sign): Likewise.
1265 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1266 gpgme_data_get_file_name.
1268 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1271 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
1273 * gpgme.h (struct _gpgme_key): Add field is_qualified.
1274 (struct _gpgme_subkey): Likewise.
1275 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1278 2005-09-23 Werner Koch <wk@g10code.com>
1280 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1282 (create_reader, create_writer): Set thread priority higher.
1284 2005-09-19 Werner Koch <wk@g10code.com>
1286 * w32-io.c (_gpgme_io_pipe): New environment variable to change
1287 the size of the pipe buffer.
1289 2005-09-13 Werner Koch <wk@g10code.com>
1291 * ath.c: Changes to make it work under W32.
1293 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1295 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1296 (ath_pth_src, ath_pthread_src): Removed.
1297 (w32_o_files): Replace ath-compat.o with ath.o.
1298 (libgpgme_pth_la_CFLAGS): New variable.
1299 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1300 * ath.h (ath_pthread_available, ath_pth_available): Removed.
1301 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1302 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1303 (_ATH_COMPAT): Macro removed.
1304 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1307 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
1309 * keylist.c (release_op_data): Do not free opd->tmp_uid.
1311 2005-09-07 Werner Koch <wk@g10code.com>
1313 * w32-io.c (build_commandline): Quote argv[0].
1315 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
1317 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1319 * edit.c (command_handler): Do not depend on PROCESSED being
1322 * engine.h (engine_command_handler_t): Add new argument processed.
1323 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1325 (_gpgme_passphrase_command_handler): ... this one.
1326 * passphrase.c (_gpgme_passphrase_command_handler_internal):
1328 (_gpgme_passphrase_command_handler): ... this one.
1329 * edit.c (command_handler): Add new argument processed. Remove
1330 local variable with the same name. Always return processed as
1332 * rungpg.c (command_handler): Send a newline character if the
1335 2005-08-26 Werner Koch <wk@g10code.com>
1337 * w32-util.c (read_w32_registry_string): Updated from code used by
1338 GnuPG. This allows for expanding strings and features the
1339 implicit fallback key.
1340 (w32_shgetfolderpath, find_program_at_standard_place): New.
1341 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1342 entry, locate the programs at the standard place.
1343 (dlopen, dlsym, dlclose): New, so that we can keep on using what
1344 we are accustomed to.
1346 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1347 semicolon is used which allows us to create files with drive
1350 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1353 2005-08-19 Werner Koch <wk@g10code.com>
1356 * versioninfo.rc.in: New.
1357 * Makefile.am: Addes support for building a W32 DLL.
1359 * ttyname_r.c (ttyname_r) [W32]: Return error.
1360 * ath-compat.c [W32]: select and co are not yet supported; return
1362 * data-stream.c (stream_seek): Use ftell if ftello is not available.
1364 2005-08-08 Werner Koch <wk@g10code.com>
1366 * util.h (stpcpy): Renamed to ..
1367 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
1368 definitions when linking statically.
1369 * stpcpy.c: Removed.
1371 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
1373 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1374 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1375 (struct _gpgme_op_verify_result): Likewise.
1376 * ops.h (_gpgme_parse_plaintext): Add prototype.
1377 * op-support.c (_gpgme_parse_plaintext): New function.
1378 * decrypt.c (release_op_data): Release
1379 OPD->result.plaintext_filename.
1380 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1381 * verify.c (release_op_data): Release
1382 OPD->result.plaintext_filename.
1383 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1385 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
1387 * keylist.c (gpgme_get_key): Allow key IDs.
1389 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
1391 * gpgme.m4: Only call GPGME_CONFIG if found.
1393 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
1395 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1397 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1398 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1400 (_gpgme_decrypt_status_handler): Fix last change.
1402 * gpgme.h (struct _gpgme_recipient): New structure.
1403 (gpgme_recipient_t): New type.
1404 (struct _gpgme_op_decrypt_result): Add member recipients.
1405 * decrypt.c (op_data_t): New member last_recipient_p.
1406 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
1407 (parse_enc_to): New function.
1408 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
1411 * wait-global.c (gpgme_wait): Break out of the fd processing loop
1413 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1415 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
1417 * wait.h (_gpgme_run_io_cb): New prototype.
1418 * wait.c (_gpgme_run_io_cb): New function.
1419 * wait-global.c (gpgme_wait): Call it.
1420 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1421 * wait-private.c (_gpgme_wait_on_condition): Likewise.
1423 2005-06-02 Werner Koch <wk@g10code.com>
1425 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
1426 GPGME_STATUS_NEED_PASSPHRASE_PIN.
1427 (_gpgme_passphrase_command_handler_internal): Also act on the key
1428 "passphrase.pin.ask".
1430 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
1431 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
1432 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
1433 GPGME_STATUS_BACKUP_KEY_CREATED.
1435 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
1437 * data-user.c: Include <errno.h>.
1439 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
1441 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
1444 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
1446 * w32-io.c (_gpgme_io_select): Fix loop increment.
1448 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
1450 * data-user.c (user_release): Only call user hook if provided.
1451 (user_seek): Return EBADF if no user hook is provided.
1452 (user_read): Likewise.
1453 (user_write): Likewise.
1455 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
1457 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
1458 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
1459 the reset, just for cleanliness, and do not sent it at all if the
1460 default is requested.
1461 * gpgme.c (gpgme_set_include_certs): Allow to use
1462 GPGME_INCLUDE_CERTS_DEFAULT.
1464 2005-04-21 Werner Koch <wk@g10code.com>
1466 * verify.c (calc_sig_summary): Set the key revoked bit.
1468 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
1470 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
1471 in the list, not the user-provided CTX.
1472 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1474 * wait-global.c (gpgme_wait): If no context is found, and we
1475 should not hang, set *status to 0 and return NULL.
1476 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
1478 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1480 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
1481 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1482 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
1483 ENOSYS instead EOPNOTSUPP.
1484 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
1485 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
1488 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
1490 * io.h: Rename to ...
1491 * priv-io.h: ... this.
1492 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
1493 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
1494 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
1495 Change all includes of "io.h" to "priv-io.h"
1497 2005-03-09 Werner Koch <wk@g10code.com>
1499 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
1500 cast away type checks.
1502 * io.h [W32]: Do not include stdio.h. If it is needed do it at
1505 * data.h [W32]: Removed kludge for EOPNOTSUP.
1506 * data.c, data-compat.c [W32]: Explicitly test for it here.
1508 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
1511 2005-03-07 Timo Schulz <twoaday@g10code.de>
1513 * gpgme.h: [_WIN32] Removed ssize_t typedef.
1514 * ath.h: [_WIN32] Added some (dummy) types.
1515 * io.h: [_WIN32] include stdio.h.
1516 * data.h: [_WIN32] Define EOPNOTSUPP.
1517 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
1518 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
1520 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
1522 * engine.c (_gpgme_set_engine_info): Fix assertion.
1524 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
1526 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
1528 * ttyname_r.c: New file.
1530 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1532 * putc_unlocked.c, funopen.c: I just claim copyright on these
1533 files and change their license to LGPL, because they are totally
1534 trivial wrapper functions.
1535 * isascii.c: Change copyright notice to the one from ctype/ctype.h
1536 in the GNU C Library (CVS Head 2004-10-10), where isascii is
1537 defined as a macro doing exactly the same as the function in this
1539 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
1540 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
1541 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
1542 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
1543 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
1544 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
1545 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
1546 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
1547 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
1548 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
1549 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
1550 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
1551 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
1552 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
1555 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
1557 * libgpgme.vers (GPGME_1.1): New version.
1558 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
1559 member get_version(). Add arguments FILE_NAME and HOME_DIR to
1560 member new(). Change return type of get_file_name and get_version
1562 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
1563 pointer. Do not cache result.
1564 (gpgsm_new): Add file_name and home_dir argument, and use them
1565 instead of the defaults, if set.
1566 * rungpg.c (struct engine_gpg): New member file_name.
1567 (gpg_get_version): Change return type to char pointer, and do not
1569 (gpg_release): Free gpg->file_name.
1570 (gpg_new): Take new arguments file_name and home_dir. Set the
1571 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
1572 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
1573 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1575 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1577 * engine.c: Include <assert.h>.
1578 (gpgme_get_engine_info): Set *INFO within the lock. Move
1579 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1580 (engine_info, engine_info_lock): ... here. New static variables.
1581 (engine_get_version): Add file_name argument to
1582 get_version invocation. Change return type to char pointer.
1583 (gpgme_engine_check_version): Rewritten to free() the return value
1584 of engine_get_version after using it.
1585 (_gpgme_engine_info_release): New function.
1586 (gpgme_get_engine_info): Rewritten.
1587 (_gpgme_engine_info_copy): New function.
1588 (_gpgme_set_engine_info): New function.
1589 (gpgme_set_engine_info): New function.
1590 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1592 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1593 and version to char * (remove the const). New member home_dir.
1594 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1595 gpgme_ctx_set_engine_info): New prototypes.
1596 * context.h (struct gpgme_context): New member engine_info.
1597 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1598 (gpgme_release): Deallocate CTX->engine_info.
1599 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1601 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1602 pass it to _gpgme_engine_new.
1603 * version.c (gpgme_check_version): Adjust to
1604 _gpgme_compare_versions returning an int.
1605 (_gpgme_compare_versions): Return an int value, not a const char
1607 * ops.h (_gpgme_compare_versions): Same for prototype.
1609 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1611 * verify.c (parse_trust): If no reason is provided, set
1612 SIG->validity_reason to 0.
1613 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1615 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1617 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1618 (start): Call map_assuan_error on return value of
1621 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1623 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1626 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1628 * gpgme.m4: Implement the --api-version check.
1630 * rungpg.c (read_status): Move the polling of the output data pipe
1631 to just before removing the command fd, from just before adding
1632 it. This avoids buffering problems.
1634 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1635 read, to improve debug output.
1637 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1639 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1640 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1641 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1642 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1644 (gpgme_keylist_mode_t): Define as unsigned int.
1645 (gpgme_key_t): Change type of keylist_mode to
1646 gpgme_keylist_mode_t.
1648 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1650 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1653 * data-stream.c (stream_seek): Call ftello and return the current
1655 * data.h (struct gpgme_data): Change type of data.mem.offset to
1657 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1658 callback. If SEEK_CUR, adjust the offset by the pending buffer
1659 size. Clear pending buffer on success.
1662 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1664 * gpgme.m4: Add copyright notice.
1666 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1668 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1671 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1673 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1675 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1677 * key.c (_gpgme_key_append_name): Make sure tail points to the
1678 byte following the uid.
1679 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1682 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1684 * libgpgme.vers: Remove C-style comment, which is not supported by
1687 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1689 * gpgme-config.in (Options): Support --api-version.
1691 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1693 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1694 * verify.c (parse_error): Likewise.
1696 * verify.c (parse_error): Do not skip location of where token.
1698 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1699 * verify.c (_gpgme_verify_status_handler): Add handling of
1700 GPGME_STATUS_REVKEYSIG.
1701 (parse_trust): Likewise.
1703 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1705 * gpgme.h (struct _gpgme_decrypt_result): New fields
1706 wrong_key_usage and _unused.
1707 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1708 character after a matched string, as in a protocol error this
1709 could skip over the trailing binary zero.
1710 Handle decrypt.keyusage error notifications.
1712 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1713 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1715 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1717 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1718 to unsigned int. Same for member _unused.
1720 * keylist.c (set_mainkey_trust_info): Rewritten.
1721 (set_subkey_capability): Handle 'd' (disabled).
1722 (set_mainkey_capability): Rewritten.
1724 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1726 * gpgme.m4: Quote first argument to AC_DEFUN.
1728 2004-04-21 Werner Koch <wk@gnupg.org>
1730 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1731 The rule of least surprise.
1733 2004-04-15 Werner Koch <wk@gnupg.org>
1735 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1736 unused result.signatures items.
1738 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1740 2004-04-08 Werner Koch <wk@gnupg.org>
1742 * verify.c (_gpgme_verify_status_handler): Ignore the error status
1743 if we can't process it.
1744 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
1745 yesterday's hack. It is not any longer required.
1747 2004-04-07 Werner Koch <wk@gnupg.org>
1749 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
1750 with meaningless error codes from the verify status function.
1752 2004-04-05 Werner Koch <wk@gnupg.org>
1754 * gpgme.h: Add GPGME_STATUS_NEWSIG.
1756 * verify.c (parse_error): Compare only the last part of the where
1758 (prepare_new_sig): New.
1759 (parse_new_sig): Use prepare_new_sig when required.
1760 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
1762 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
1763 option. Fixed pattern construction.
1764 (status_handler): Add debugging output.
1766 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
1768 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
1769 isatty(). Submitted by Bernhard Herzog.
1771 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
1773 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
1776 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
1778 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
1779 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
1781 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
1783 * gpgme-config.in: Do not emit include and lib directory for
1784 prefix "/usr" or "".
1786 2004-03-03 Werner Koch <wk@gnupg.org>
1788 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
1791 2004-02-18 Werner Koch <wk@gnupg.org>
1793 * gpgme-config.in: Ignore setting of --prefix.
1795 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
1797 * rungpg.c (gpg_cancel): New function.
1798 (gpg_release): Call it here.
1799 (_gpgme_engine_ops_gpg): Add it here.
1800 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
1802 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
1804 * gpgme.c (gpgme_cancel): New function.
1805 * engine-backend.h (struct engine_ops): New member cancel.
1806 * engine.h (_gpgme_engine_cancel): New prototype.
1807 * engine.c (_gpgme_engine_cancel): New function.
1808 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
1809 (gpgsm_cancel): New function.
1810 (gpgsm_release): Use it.
1811 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
1813 2004-02-17 Werner Koch <wk@gnupg.org>
1815 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
1816 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
1818 2004-02-15 Werner Koch <wk@gnupg.org>
1820 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
1821 by Adriaan de Groot.
1823 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
1825 * rungpg.c (build_argv): Use --no-comment, not --comment "".
1827 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
1829 * data-stream.c (stream_seek): Likewise.
1831 2004-01-16 Werner Koch <wk@gnupg.org>
1833 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
1836 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
1838 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
1840 2004-01-12 Werner Koch <wk@gnupg.org>
1842 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
1844 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
1846 * gpgme.h (_GPGME_D_CLASS): Revert this change.
1847 (struct _gpgme_key_sig): For C++ compilers, rename class
1848 member to _obsolete_class. Add new member sig_class.
1849 (struct _gpgme_new_signature): Same here.
1850 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
1852 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
1853 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
1854 * sign.c (parse_sig_created): Set SIG->sig_class.
1856 2003-12-22 Werner Koch <wk@gnupg.org>
1858 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
1861 2003-11-19 Werner Koch <wk@gnupg.org>
1863 * conversion.c (_gpgme_parse_timestamp): New.
1864 (atoi_1, atoi_2, atoi_4): New.
1865 * keylist.c (parse_timestamp): Removed. Changed all callers to use
1867 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
1868 * sign.c (parse_sig_created): Ditto.
1870 2003-10-31 Werner Koch <wk@gnupg.org>
1872 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
1875 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
1877 * genkey.c (get_key_parameter): Make a copy of the key parameters.
1878 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
1880 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
1882 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
1885 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
1888 * io.h (_gpgme_io_subsystem_init): New prototype.
1889 * posix-io.c (_gpgme_io_subsystem_init): Add function.
1890 (_gpgme_io_spawn): Do not fixup signal handler here.
1891 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
1893 * debug.c (debug_init): Drop const qualifier from E.
1895 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
1897 (ath_connect): Make ADDR argument const.
1898 * ath-pthread.c (ath_connect): Likewise.
1899 * ath-pth.c (ath_connect): Likewise.
1900 * ath-compat.c (ath_connect): Likewise.
1901 * ath.c (ath_connect): Likewise.
1903 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
1904 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
1906 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
1908 * util.h (_gpgme_hextobyte): Likewise for prototype.
1910 * gpgme.h: Remove trailing comma in enum.
1912 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
1913 <signal.h>, <fcntl.h>, or "unistd.h".
1915 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
1917 * engine-backend.h (struct engine_ops): Add argument TYPE.
1918 * engine.c (_gpgme_engine_op_edit): Likewise.
1919 * engine.h: Likewise.
1920 * rungpg.c (gpg_edit): Likewise. Use it.
1921 * edit.c (edit_start): Likewise. Pass it on.
1922 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
1923 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
1925 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
1927 * gpgme.h (gpg_strerror_r): Change prototype to match
1928 gpg_strerror_r change.
1929 * error.c (gpg_strerror_r): Likewise, also update implementation.
1931 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
1932 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
1933 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
1935 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
1937 * gpgme.h: Add prototype for gpgme_set_locale.
1939 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
1940 characteristics and use that instead __inline__.
1942 * context.h (struct gpgme_context): New members lc_ctype and
1944 * gpgme.c: Include <locale.h>.
1945 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
1947 (gpgme_set_locale): New function.
1948 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
1950 * engine.h (_gpgme_engine_new): Likewise.
1951 * engine-gpgsm.c (gpgsm_new): Likewise.
1952 * rungpg.c (gpg_new): Likewise.
1953 * engine-backend.h (struct engine_ops): Likewise to NEW.
1954 * op-support.c (_gpgme_op_reset): Likewise to invocation of
1957 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
1959 * gpgme.h (gpgme_strerror_r): New prototype.
1960 * error.c (gpgme_strerror_r): New function.
1962 * get-env.c: New file.
1963 * util.h (_gpgme_getenv): Add prototype.
1964 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
1965 * rungpg.c (build_argv): Use _gpgme_getenv.
1966 * debug.c (debug_init): Likewise.
1967 * engine-gpgsm.c (gpgsm_new): Likewise.
1968 (gpgsm_new): Use ttyname_r.
1969 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
1971 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
1973 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
1976 * gpgme-config.in: Rewritten.
1977 * gpgme.m4: Rewritten.
1979 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
1981 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
1982 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
1983 updated to have better thread support, and the Makefile.am was
1984 changed to reflect that.
1986 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
1987 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
1988 value of status_fnc.
1989 * rungpg.c (start): Return SAVED_ERRNO, not errno.
1991 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1993 * rungpg.c (start): Use saved_errno instead errno.
1995 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1997 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
1998 * fopencookie.c: File removed.
2000 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
2002 * gpgme-config.in: Put gpg-error related flags after gpgme's.
2004 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
2006 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2007 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2008 * sign.c (parse_sig_created): Also set SIG->_unused_class for
2009 backward compatibility.
2011 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
2013 * verify.c (parse_new_sig): Fix status parsing case.
2015 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
2017 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2018 Lower _UNUSED to 23 bits.
2019 (struct _gpgme_key): Likewise.
2020 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2021 (set_subkey_capability): Support 'a'.
2023 * keylist.c (gpgme_get_key): Check if there is more than one key
2024 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2026 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2028 (_gpgme_decode_percent_string): Likewise.
2029 * conversion.c (_gpgme_decode_c_string): Likewise.
2030 (_gpgme_decode_percent_string): Likewise.
2031 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2032 * signers.c (gpgme_signers_clear): Likewise.
2033 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2034 Use SEQNO instead SEQ.
2035 * wait.c (fd_table_put): Change type of I and J to unsigned int.
2036 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2038 (gpgme_wait): Change type of I and IDX to unsigned int.
2039 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2040 and I to unsigned int.
2041 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2042 int to suppress gcc warning.
2043 (_gpgme_io_set_close_notify): Likewise.
2044 (_gpgme_io_select): Change type of I to unsigned int.
2045 * engine.c (gpgme_get_engine_info): Change type of PROTO to
2047 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2050 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
2052 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2053 and wrong expression.
2054 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2055 * encrypt.c (encrypt_sym_status_handler): Likewise.
2056 * sign.c (sign_status_handler): Likewise.
2057 * verify.c (verify_status_handler): Likewise.
2058 * decrypt.c (decrypt_status_handler): Likewise.
2060 * engine.c (gpgme_get_engine_info): Initialize NULL.
2062 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
2064 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2065 GPG_ERROR_LIBS when setting the corresponding variables.
2066 Reported by Stéphane Corthésy.
2068 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
2070 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2071 the beginning of the block.
2073 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2075 * data-mem.c (mem_write): Copy original buffer content.
2077 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
2079 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2082 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
2084 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2085 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2088 * op-support.c (_gpgme_parse_inv_userid): Rename to
2089 _gpgme_parse_inv_recp and change to new datatype.
2090 * ops.h (_gpgme_parse_inv_key): Fix prototype.
2091 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2092 __gpgme_invalid_key. Rename field ID to KEY.
2093 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2094 (struct _gpgme_op_encrypt_result): Here, too.
2095 (struct _gpgme_op_sign_result): Likewise.
2096 * encrypt.c (struct op_data): Likewise.
2097 (release_op_data): Likewise.
2098 * sign.c (struct op_data): Likewise.
2099 (release_op_data): Likewise.
2101 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2102 (_gpgme_io_write): Likewise.
2103 (_gpgme_io_pipe): Likewise.
2104 (_gpgme_io_select): Likewise.
2106 * rungpg.c (struct engine_gpg): Remove arg_error.
2107 (add_arg): Don't set arg_error.
2108 (add_data): Likewise.
2109 (start): Don't check arg_error.
2110 (gpg_new): Check return value of add_arg.
2111 * verify.c (parse_notation): Free allocated memory at error.
2113 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
2115 Everywhere: Use libgpg-error error codes.
2117 * Makefile.am (EXTRA_DIST): Remove mkerrors.
2118 (BUILT_SOURCES): Remove errors.c.
2119 (MOSTLYCLEANFILES): Likewise.
2120 (libgpgme_la_SOURCES): Likewise. Add error.c.
2121 (errors.c): Remove target.
2122 * mkerrors: File removed.
2123 * error.c: New file.
2125 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2126 (gpgme_err_code_t, gpgme_err_source_t): New types.
2127 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2128 New static inline functions.
2129 (gpgme_strsource, gpgme_err_code_from_errno,
2130 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2131 gpgme_error_from_errno): New prototypes.
2133 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
2135 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2136 (gpgme_op_export): Likewise.
2137 (gpgme_op_export_ext_start): New prototype.
2138 (gpgme_op_export_ext): Likewise.
2139 * engine.h: Likewise for _gpgme_engine_op_export and
2140 _gpgme_engine_op_export_ext.
2141 * engine-backend.h (struct engine_ops): Change second argument of
2142 prototype of export to const char *, and add reserverd int as
2143 third argument. Add prototype for export_ext.
2144 * engine.c (_gpgme_engine_op_export_ext): New function.
2145 (_gpgme_engine_op_export): Change second argument of prototype of
2146 export to const char *, and add reserverd int as third argument.
2147 * rungpg.c (gpg_export): Change second argument of prototype of
2148 export to const char *, and add reserverd int as third argument.
2149 (gpg_export_ext): New function.
2150 (gpg_keylist_ext): Break loop at error.
2151 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2152 * engine-gpgsm.c (gpgsm_export): Change second argument of
2153 prototype of export to const char *, and add reserverd int as
2155 (gpgsm_export_ext): New function.
2156 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2157 * export.c (export_start): Change second argument of prototype of
2158 export to const char *, and add reserverd int as third argument.
2159 (gpgme_op_export_start): Likewise.
2160 (export_ext_start): New function.
2161 (gpgme_op_export_ext_start): Likewise.
2162 (gpgme_op_export_ext): Likewise.
2164 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2165 (gpgme_sigsum_t): New type for anonymous enum.
2167 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2168 and return an error if RECP is not set.
2170 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2171 * user-id.c: Remove file.
2172 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2173 * gpgme.h (gpgme_encrypt_flags_t): New type.
2174 (gpgme_op_encrypt_start): Change second parameter to type
2175 gpgme_key_t[], and add third parameter.
2176 (gpgme_op_encrypt): Likewise.
2177 (gpgme_op_encrypt_sign_start): Likewise.
2178 (gpgme_op_encrypt_sign): Likewise.
2179 * encrypt.c (encrypt_start): Likewise.
2180 (gpgme_op_encrypt_start): Likewise.
2181 (gpgme_op_encrypt): Likewise. Pass flags to engine.
2182 * encrypt-sign.c (encrypt_sign_start): Likewise.
2183 (gpgme_op_encrypt_sign_start): Likewise.
2184 (gpgme_op_encrypt_sign): Likewise.
2185 * engine-backend.h (struct engine_ops): Likewise for prototypes of
2186 encrypt and encrypt_sign.
2187 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2188 and _gpgme_engine_op_encrypt_sign.
2189 * engine.c (_gpgme_engine_op_encrypt): Likewise.
2190 (_gpgme_engine_op_encrypt_sign): Likewise.
2191 * rungpg.c (gpg_encrypt): Likewise.
2192 (gpg_encrypt_sign): Likewise.
2193 * rungpg.c (gpg_encrypt): Check flags for always trust option.
2194 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2195 (set_recipients): Rewritten to use keys instead user IDs.
2196 * rungpg.c (append_args_from_recipients): Rewritten to use keys
2198 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2199 returned to GPGME_Invalid_Key and GPGME_General_Error.
2201 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
2203 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2204 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2205 * rungpg.c: Rename GpgObject to engine_gpg_t.
2206 (struct gpg_object_s): Rename to struct engine_gpg.
2208 * context.h (struct gpgme_context): Change EngineObject to
2210 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2211 (ctx_op_data_t): New type.
2212 (struct gpgme_context): Use it.
2213 * ops.h (_gpgme_op_data_lookup): Use new type name.
2214 * op-support.c (_gpgme_op_data_lookup): Likewise.
2215 * engine.c: Rename EngineObject to engine_t in the file. Also
2216 EngineStatusHandler to engine_status_handler_t,
2217 EngineCommandHandler to engine_command_handler_t and
2218 EngineColonLineHandler to engine_colon_line_handler.
2219 * rungpg.c (start): Likewise.
2220 * engine-gpgsm.c: Likewise.
2221 * engine-backend.h (struct engine_ops): Likewise
2222 * engine.h (struct engine_object_s): Rename to struct engine.
2223 (EngineObject): Rename to engine_t. Also everywhere else in the
2225 (EngineStatusHandler): Rename to engine_status_handler_t.
2226 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2227 (EngineCommandHandler): Rename to engine_command_handler_t.
2229 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2231 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2233 * gpgme.h (gpgme_recipients_t): Removed.
2234 (gpgme_recipients_new, gpgme_recipients_release,
2235 gpgme_recipients_add_name,
2236 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2237 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2238 gpgme_recipients_enum_close): Removed.
2239 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2240 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2241 gpgme_op_export): Change second argument to gpgme_user_id_t.
2242 (gpgme_user_ids_release): New prototype.
2243 (gpgme_user_ids_append): Likewise.
2244 * ops.h (_gpgme_recipients_all_valid): Remove.
2245 (_gpgme_user_ids_all_valid): Add.
2246 * context.h (struct gpgme_recipients): Removed.
2247 * user-id.c: New file.
2248 * recipient.c: Removed file.
2249 * rungpg.c (append_args_from_recipients): Change last arg to
2250 gpgme_user_id_t. Reimplement.
2251 (gpg_encrypt): Change second arg to gpgme_user_id_t.
2252 (gpg_encrypt_sign): Likewise.
2253 (gpg_export): Likewise. Rewrite user ID list code.
2254 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2256 (_gpgme_engine_op_encrypt_sign): Likewise.
2257 (_gpgme_engine_op_export): Likewise.
2258 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2259 _gpgme_engine_op_export): Likewise.
2260 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
2261 (gpgsm_encrypt): Likewise.
2262 (gpgsm_export): Likewise.
2263 * engine-backend.h (struct engine_ops): Likewise for members
2264 ENCRYPT, ENCRYPT_SIGN and EXPORT.
2265 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2267 * encrypt.c (encrypt_start): Likewise. Don't check for count of
2269 (gpgme_op_encrypt_start): Likewise.
2270 (gpgme_op_encrypt): Likewise.
2271 * encrypt-sign.c (encrypt_sign_start): Likewise.
2272 (gpgme_op_encrypt_sign): Likewise.
2273 (gpgme_op_encrypt_sign_start): Likewise.
2275 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2277 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2278 * import.c (parse_import_res): Add skipped_new_keys parser.
2280 * op-support.c (_gpgme_parse_inv_userid): Add missing break
2282 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2284 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
2286 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2287 HOOK to avoid compiler warning. Don't ask, you don't want to know.
2288 (_gpgme_encrypt_status_handler): Likewise.
2289 (_gpgme_op_encrypt_init_result): Likewise.
2290 * decrypt.c (gpgme_op_decrypt_result): Likewise.
2291 (_gpgme_decrypt_status_handler): Likewise.
2292 (_gpgme_op_decrypt_init_result): Likewise.
2293 * verify.c (gpgme_op_verify_result): Likewise.
2294 (_gpgme_verify_status_handler): Likewise.
2295 (_gpgme_op_verify_init_result): Likewise.
2296 * edit.c (edit_status_handler): Likewise.
2297 (command_handler): Likewise.
2298 (edit_start): Likewise.
2299 * genkey.c (gpgme_op_genkey_result): Likewise.
2300 (genkey_status_handler): Likewise.
2301 (genkey_start): Likewise.
2302 * import.c (gpgme_op_import_result): Likewise.
2303 (import_status_handler): Likewise.
2304 (_gpgme_op_import_start): Likewise.
2305 * trustlist.c (gpgme_op_trustlist_next): Likewise.
2306 (_gpgme_op_trustlist_event_cb): Likewise.
2307 (gpgme_op_trustlist_start): Likewise.
2308 * keylist.c (gpgme_op_keylist_result): Likewise.
2309 (keylist_colon_handler): Likewise.
2310 (keylist_status_handler): Likewise.
2311 (_gpgme_op_keylist_event_cb): Likewise.
2312 (gpgme_op_keylist_start): Likewise.
2313 (gpgme_op_keylist_ext_start): Likewise.
2314 (gpgme_op_keylist_next): Likewise.
2315 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2316 (_gpgme_passphrase_command_handler_internal): Likewise.
2317 * sign.c (gpgme_op_sign_result): Likewise.
2318 (_gpgme_sign_status_handler): Likewise.
2319 (_gpgme_op_sign_init_result): Likewise.
2321 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2322 access to pointer type.
2324 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
2326 * engine.h (EngineCommandHandler): Change last argument to int fd.
2327 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2329 (gpgme_edit_cb_t): Change last argument to int fd.
2330 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2331 * passphrase.c: Include <assert.h>.
2332 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2333 (release_op_data): Check values before calling free.
2334 (_gpgme_passphrase_status_handler): Likewise.
2335 (_gpgme_passphrase_command_handler_internal): New function.
2336 (_gpgme_passphrase_command_handler): Rewritten.
2337 * edit.c (edit_status_handler): Pass -1 as fd argument.
2338 (command_handler): Update prototype. New variable processed. Use
2339 it to store return value of
2340 _gpgme_passphrase_command_handler_internal which is now used
2341 instead _gpgme_passphrase_command_handler. Use it also to check
2342 if we should call the user's edit function. Pass fd to user's
2344 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2346 (gpg_release): Check value before calling free. Do not release
2348 (command_cb): Function removed.
2349 (command_handler): New function. Thus we don't use a data object
2350 for command handler stuff anymore, but handle it directly. This
2351 allows proper error reporting (cancel of passphrase requests, for
2352 example). Also all callbacks work via direct writes to the file
2353 descriptor (so that passphrases are not kept in insecure memory).
2354 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2355 (read_status): Check cmd.keyword before calling free. Install
2356 command_handler as the I/O callback handler with GPG as private
2359 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2361 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2362 decrypt_verify_start.
2363 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2364 (gpgme_op_decrypt_verify): Likewise.
2365 * verify.c (verify_status_handler): New function that also calls
2366 progress status handler.
2367 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2368 Rename to (verify_start).
2369 (gpgme_op_verify_start): Call verify_start.
2370 (gpgme_op_verify): Likewise.
2371 * encrypt.c (encrypt_status_handler): New function.
2372 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2373 Make static. Rename to encrypt_sym_status_handler.
2374 (encrypt_start): Set status handler to encrypt_sym_status_handler
2375 or encrypt_status_handler.
2376 * sign.c (sign_status_handler): New function.
2377 (sign_start): Set status handler to sign_status_handler.
2378 * decrypt.c (decrypt_status_handler): New function that also calls
2379 progress status handler.
2380 (decrypt_start): Set status handler to decrypt_status_handler.
2381 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2382 * decrypt-verify.c (decrypt_verify_status_handler): Call
2383 _gpgme_progress_status_handler.
2385 * conversion.c (_gpgme_decode_c_string): Add missing break
2388 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2389 to buffer to allocate.
2391 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
2393 * verify.c (parse_new_sig): Fix ERRSIG case.
2394 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2396 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2398 * gpgme.h: The following types are renamed. The old name is kept
2399 as a deprecated typedef.
2400 (GpgmeCtx): Rename to gpgme_ctx_t.
2401 (GpgmeData): Rename to gpgme_data_t.
2402 (GpgmeRecipients): Rename to gpgme_recipients_t.
2403 (GpgmeError): Rename to gpgme_error_t.
2404 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
2405 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
2406 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
2407 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
2408 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
2409 (GpgmeAttr): Rename to gpgme_attr_t.
2410 (GpgmeValidity): Rename to gpgme_validity_t.
2411 (GpgmeProtocol): Rename to gpgme_protocol_t.
2412 (GpgmeStatusCode): Rename to gpgme_status_code_t.
2413 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
2414 (GpgmeSubkey): Rename to gpgme_subkey_t.
2415 (GpgmeKeySig): Rename to gpgme_keysig_t.
2416 (GpgmeUserID): Rename to gpgme_user_id_t.
2417 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
2418 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
2419 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
2420 (GpgmeIOCb): Rename to gpgme_io_cb_t.
2421 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
2422 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
2423 (GpgmeEventIO): Rename to gpgme_event_io_t.
2424 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
2425 (GpgmeIOCbs): Rename to gpgme_io_cbs.
2426 (gpgme_io_cbs_t): New type.
2427 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
2428 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
2429 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
2430 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
2431 (GpgmeDataCbs): Rename to gpgme_data_cbs.
2432 (gpgme_data_cbs_t): New type.
2433 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
2434 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
2435 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
2436 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
2437 (GpgmeSignResult): Rename to gpgme_sign_result_t.
2438 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
2439 (GpgmeSignature): Rename to gpgme_signature_t.
2440 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
2441 (GpgmeImportStatus): Rename to gpgme_import_status_t.
2442 (GpgmeImportResult): Rename to gpgme_import_result_t.
2443 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
2444 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
2445 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
2446 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
2447 GPGME_No_Recipients, GPGME_Invalid_Recipient and
2448 GPGME_No_Passphrase.
2449 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
2450 * context.h (struct gpgme_context_s): Rename to struct
2452 (struct gpgme_recipients_s): Rename to gpgme_recipients.
2454 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2456 * keylist.c (finish_key): Clear OPD->tmp_uid.
2458 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
2460 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
2461 for NODATA status without signatures.
2463 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
2465 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
2466 (_gpgme_key_add_sig): Likewise.
2468 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
2470 * context.h (struct gpgme_context_s): Remove member op_info.
2472 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
2474 * gpgme.h (GpgmeError): Add deprecated values for
2475 GPGME_Invalid_Type and GPGME_Invalid_Mode.
2477 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
2479 * gpgme.h (gpgme_get_op_info): Remove prototype.
2480 * ops.h (_gpgme_set_op_info,
2481 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
2482 _gpgme_data_append, _gpgme_data_append_string,
2483 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
2484 _gpgme_data_append_percentstring_for_xml): Likewise.
2485 (_gpgme_progress_status_handler): Change first arg to void *.
2486 * progress.c (_gpgme_progress_status_handler): Likewise.
2487 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
2488 and <sys/types.h>, but <string.h>.
2489 (_gpgme_data_append): Remove function.
2490 (_gpgme_data_append_string): Likewise.
2491 (_gpgme_data_append_for_xml): Likewise.
2492 (_gpgme_data_append_string_for_xml): Likewise.
2493 (_gpgme_data_append_percentstring_for_xml): Likewise.
2494 * data-mem.c (_gpgme_data_get_as_string): Likewise.
2495 (_gpgme_data_release_and_return_string): Likewise.
2496 * gpgme.c (gpgme_get_op_info): Likewise.
2497 (_gpgme_set_op_info): Likewise.
2499 * gpgme.h (struct _gpgme_key): New structure.
2500 (GpgmeKey): Define using _gpgme_key.
2501 (struct _gpgme_subkey): New structure.
2502 (GpgmeSubKey): New type.
2503 (struct _gpgme_key_sig): New structure.
2504 (GpgmeKeySig): New type.
2505 (struct _gpgme_user_id): New structure.
2506 (GpgmeUserID): New type.
2507 (struct _gpgme_op_keylist_result): New structure.
2508 (GpgmeKeyListResult): New type.
2509 (gpgme_op_keylist_result): New function.
2510 (gpgme_key_get_as_xml): Remove prototype.
2511 * context.h (struct gpgme_context_s): Remove members tmp_key,
2512 tmp_uid, key_cond and key_queue.
2513 (struct key_queue_item_s): Remove structure.
2514 (struct user_id_s): Remove structure.
2515 (struct gpgme_recipients_s): Replace with simple
2517 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
2518 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
2519 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
2520 * rungpg.c (command_cb): Return GpgmeError instead int.
2521 New variable ERR. Use it to hold return value of cmd handler.
2522 (gpg_delete): Access fingerprint of key directly.
2523 (append_args_from_signers): Likewise.
2524 (gpg_edit): Likewise.
2525 (append_args_from_recipients): Use GpgmeUserID for recipient list.
2526 * engine-gpgsm.c: Do not include "key.h".
2527 (gpgsm_delete): Access fingerprint of key directly.
2528 (gpgsm_sign): Likewise.
2529 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
2531 * key.h: File removed.
2532 * key.c: Completely reworked to use exposed GpgmeKey data types.
2533 * keylist.c: Likewise.
2534 * recipient.c: Completely reworked to use GpgmeUserID.
2536 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
2538 * gpgme.h (gpgme_get_key): Remove force_update argument.
2539 * key-cache.c: File removed.
2540 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
2541 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
2543 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
2544 _gpgme_key_cache_add.
2545 (gpgme_get_key): New function.
2546 * verify.c (gpgme_get_sig_key): Remove last argument to
2547 gpgme_get_key invocation.
2549 * gpgme.h (struct _gpgme_trust_item): New structure.
2550 (GpgmeTrustItem): New type.
2551 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
2552 * context.h (struct trust_queue_item_s): Remove structure.
2553 (struct gpgme_context_s): Remove trust_queue member.
2554 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
2555 * trust-item.c: New file.
2556 * trustlist.c: Do not include <stdio.h> or <time.h>, but
2558 (struct trust_queue_item_s): Change to new type op_data_t.
2559 (trust_status_handler): Change first argument to void *.
2560 (trust_colon_handler): Likewise.
2561 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
2562 (gpgme_op_trustlist_start): Use op_data_t and rework error
2564 (gpgme_op_trustlist_next): Use op_data_t.
2565 (gpgme_trust_item_release): Remove function.
2566 (gpgme_trust_item_get_string_attr): Likewise.
2567 (gpgme_trust_item_get_int_attr): Likewise.
2569 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
2572 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
2574 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2575 (struct gpgme_context_s): Remove member notation.
2576 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2578 * gpgme.h (struct _gpgme_sig_notation): New structure.
2579 (GpgmeSigNotation): New type.
2580 (struct _gpgme_signature): New structure.
2581 (GpgmeSignature): New type.
2582 (struct _gpgme_op_verify_result): New structure.
2583 (GpgmeVerifyResult): New type.
2584 (gpgme_op_verify_result): New prototype.
2585 (gpgme_get_notation): Remove prototype.
2586 * ops.h (_gpgme_op_verify_init_result): New prototype.
2587 (_gpgme_verify_status_handler): Change first argument to void *.
2588 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2590 * conversion.c (_gpgme_decode_percent_string): New function.
2591 (gnupg_errors): New static global.
2592 (_gpgme_map_gnupg_error): New function.
2593 * gpgme.c (gpgme_release): Don't release CTX->notation.
2594 (gpgme_get_notation): Remove function.
2595 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2596 _gpgme_op_verify_init_result.
2597 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2598 do include "gpgme.h".
2599 (struct verify_result): Replace with ...
2600 (op_data_t): ... this type.
2601 (release_verify_result): Remove function.
2602 (release_op_data): New function.
2603 (is_token): Remove function.
2604 (skip_token): Remove function.
2605 (copy_token): Remove function.
2606 (gpgme_op_verify_result): New function.
2607 (calc_sig_summary): Rewritten.
2608 (finish_sig): Remove function.
2609 (parse_new_sig): New function.
2610 (parse_valid_sig): New function.
2611 (parse_notation): New function.
2612 (parse_trust): New function.
2613 (parse_error): New function.
2614 (_gpgme_verify_status_handler): Rewritten. Change first argument
2616 (_gpgme_op_verify_start): Rework error handling. Call
2617 _gpgme_op_verify_init_result.
2618 (gpgme_op_verify): Do not release or clear CTX->notation.
2619 (gpgme_get_sig_status): Rewritten.
2620 (gpgme_get_sig_string_attr): Likewise.
2621 (gpgme_get_sig_ulong_attr): Likewise.
2622 (gpgme_get_sig_key): Likewise.
2624 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2625 (GpgmeDecryptResult): New type.
2626 (gpgme_op_decrypt_result): New prototype.
2627 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2628 (_gpgme_decrypt_status_handler): Fix prototype.
2629 (_gpgme_decrypt_start): Remove prototype.
2630 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2631 <string.h> and <assert.h>, "util.h" and "context.h", but
2633 (decrypt_verify_status_handler): Change first argument to void *,
2634 and rework error handling.
2635 (_gpgme_op_decrypt_verify_start): New function.
2636 (gpgme_op_decrypt_verify_start): Rewrite using
2637 _gpgme_op_decrypt_verify_start.
2638 (gpgme_op_decrypt_verify): Likewise.
2639 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2640 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2641 (is_token): Remove function.
2642 (release_op_data): New function.
2643 (skip_token): Remove function.
2644 (gpgme_op_decrypt_result): New function.
2645 (_gpgme_decrypt_status_handler): Change first argument to void *.
2646 Rework error handling.
2647 (_gpgme_decrypt_start): Rename to ...
2648 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2649 (_gpgme_op_decrypt_init_result): New function.
2650 (gpgme_op_decrypt_start): Use decrypt_start.
2651 (gpgme_op_decrypt): Likewise.
2653 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2655 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2656 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2657 (_gpgme_op_encrypt_sign_start): Rename to ...
2658 (encrypt_sign_start): ... this.
2659 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2660 _gpgme_op_encrypt_sign_start.
2661 (gpgme_op_encrypt_sign): Likewise.
2663 * gpgme.h (GpgmeEncryptResult): New data type.
2664 (gpgme_op_encrypt_result): New prototype.
2665 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2666 (_gpgme_op_encrypt_status_handler): Fix prototype.
2667 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2668 _gpgme_op_encrypt_init_result.
2669 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2670 "wait.h". Include <errno.h> and "gpgme.h".
2671 (SKIP_TOKEN_OR_RETURN): Remove macro.
2672 (struct encrypt_result): Rename to ...
2673 (op_data_t): ... new data type. Rewrite for user result data.
2674 (append_xml_encinfo): Remove function.
2675 (release_op_data): New function.
2676 (gpgme_op_encrypt_result): New function.
2677 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2678 Rewrite result parsing.
2679 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2681 (_gpgme_op_encrypt_init_result): New function.
2682 (_gpgme_op_encrypt_start): Rename to ...
2683 (encrypt_start): ... this.
2684 (gpgme_op_encrypt_start): Use encrypt_start, not
2685 gpgme_op_encrypt_start.
2686 (gpgme_op_encrypt): Likewise.
2688 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2689 GpgmeNewSignature, GpgmeSignResult): New data types.
2690 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2691 gpgme_hash_algo_name): New prototypes.
2692 * gpgme.c (gpgme_pubkey_algo_name): New function.
2693 (gpgme_hash_algo_name): Likewise.
2694 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2696 (_gpgme_op_sign_status_handler): Fix prototype.
2697 * op-support.c: Include <errno.h> and <string.h>.
2698 (_gpgme_parse_inv_userid): New function.
2699 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2700 <assert.h> and "util.h".
2701 (SKIP_TOKEN_OR_RETURN): Remove macro.
2702 (struct sign_result): Change to op_data_t type and rework it.
2703 (release_sign_result): Rename to ...
2704 (release_op_data): ... this and rewrite it.
2705 (append_xml_info): Remove function.
2706 (gpgme_op_sign_result): New function.
2707 (parse_sig_created): New function.
2708 (_gpgme_sign_status_handler): Change first argument to void *.
2709 Rewrite the function to use the new result structure and functions.
2710 (_gpgme_op_sign_init_result): New function.
2711 (_gpgme_op_sign_start): Rename to ...
2712 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2713 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2714 (gpgme_op_sign): Likewise.
2715 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2716 _gpgme_op_sign_init_result.
2718 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2720 (enum delete_problem): Move into function delete_status_handler.
2721 (delete_status_handler): Change first argument to void *. Parse
2722 delete problem with strtol instead atoi. Return better error
2724 (_gpgme_op_delete_start): Rename to ...
2725 (delete_start): ... this. Rework error handling.
2726 (gpgme_op_delete_start): Use delete_start instead
2727 _gpgme_op_delete_start.
2728 (gpgme_op_delete): Likewise.
2729 * gpgme.h (GpgmeDataType): Removed.
2731 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2733 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2734 * import.c (parse_import_res): Parse unchanged field.
2736 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2737 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2738 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2739 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2740 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
2741 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
2742 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
2743 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
2744 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
2745 (struct _gpgme_import_status): New structure.
2746 (GpgmeImportStatus): New type.
2747 (struct _gpgme_op_import_result): New structure.
2748 (GpgmeImportResult): New type.
2749 (gpgme_op_import_result): New function.
2750 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
2751 (struct import_result): Change to type op_data_t.
2752 (release_import_result): Rename to ...
2753 (release_op_data): ... this.
2754 (append_xml_impinfo): Function removed.
2755 (gpgme_op_import_result): New function.
2756 (parse_import): New function.
2757 (parse_import_res): Likewise.
2758 (import_status_handler): Change first argument to void *. Rewrite
2759 to use new functions.
2760 (_gpgme_op_import_start): Rework error handling.
2762 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
2763 (edit_resut): Change to typedef for op_data_t.
2764 (edit_status_handler): Change first argument to void *.
2765 Rework error handling.
2766 (command_handler): Rework error handling.
2767 (_gpgme_op_edit_start): Rename to ...
2768 (edit_start): ... this. Rework error handling.
2769 (gpgme_op_edit_start): Rewrite using edit_start.
2770 (gpgme_op_edit): Likewise.
2772 * ops.h (_gpgme_passphrase_start): Remove prototype.
2773 * passphrase.c: Do not include <assert.h>, "util.h" or
2774 "debug.h", but "gpgme.h".
2775 (struct passphrase_result): Change to typedef for op_data_t.
2776 (release_passphrase_result): Rename to release_op_data.
2777 (_gpgme_passphrase_status_handler): Change first argument to void *.
2778 Use new op_data_t type.
2779 (_gpgme_passphrase_command_handler): Use new op_data_t type.
2780 (_gpgme_passphrase_start): Remove function.
2781 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
2782 not call _gpgme_passphrase_start, but install command handler.
2783 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2784 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2785 * sign.c (_gpgme_op_sign_start): Likewise.
2787 * context.h (struct gpgme_context_s): Remove member initialized,
2788 use_cms and help_data_1. Add member protocol. Make use_armor and
2789 use_textmode bit flags. Make keylist_mode, include_certs,
2790 signers_len and signers_size unsigned.
2791 * gpgme.c (gpgme_new): Initialize CTX->protocol.
2792 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
2793 (gpgme_get_protocol): Likewise.
2794 (gpgme_release): Do not release CTX->help_data_1.
2795 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
2797 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
2799 * data.c: Do not include <assert.h>, but "gpgme.h".
2800 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
2801 it will go. Do not assert DH.
2802 (_gpgme_data_outbound_handler): Do not assert DH.
2804 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
2806 (export_status_handler): Change type of first argument to void *.
2807 (_gpgme_op_export_start): Rename to ...
2808 (export_start): ... this. Rework error handling.
2809 (gpgme_op_export_start): Rewritten to use export_start instead
2810 _gpgme_op_export_start.
2811 (gpgme_op_export): Likewise.
2813 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
2814 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
2815 GPGME_No_Passphrase): New macros.
2817 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
2819 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
2821 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
2822 (GpgmeGenKeyResult): New type.
2823 (gpgme_op_genkey): Drop last argument.
2824 (gpgme_op_genkey_result): New function.
2825 * genkey.c: Do not include "util.h", but "gpgme.h".
2826 (struct genkey_result): Replace with ...
2827 (op_data_t): ... this new type.
2828 (release_genkey_result): Replace with ...
2829 (release_op_data): ... this new function.
2830 (gpgme_op_genkey_result): New function.
2831 (genkey_status_handler): Rewritten using new op_data_t type.
2832 (get_key_parameter): New function.
2833 (_gpgme_op_genkey_start): Renamed to
2834 (genkey_start): ... this and rewritten.
2835 (gpgme_op_genkey_start): Use genkey_start instead
2836 _gpgme_op_genkey_start.
2837 (gpgme_op_genkey): Rewritten. Remove FPR argument.
2839 * context.h (struct gpgme_context_s): Remove member verbosity.
2840 * gpgme.c (gpgme_new): Do not set member verbosity.
2841 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
2842 * engine.c (_gpgme_engine_set_verbosity): Remove function.
2843 * engine-backend.h (struct engine_ops): Remove set_verbosity.
2844 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
2845 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
2846 (gpg_set_verbosity): Remove function.
2847 * decrypt.c (_gpgme_decrypt_start): Don't call
2848 _gpgme_engine_set_verbosity.
2849 * delete.c (_gpgme_op_delete_start): Likewise.
2850 * edit.c (_gpgme_op_edit_start): Likewise.
2851 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2852 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2853 * export.c (_gpgme_op_export_start): Likewise.
2854 * genkey.c (_gpgme_op_genkey_start): Likewise.
2855 * import.c (_gpgme_op_import_start): Likewise.
2856 * keylist.c (gpgme_op_keylist_start): Likewise.
2857 (gpgme_op_keylist_ext_start): Likewise.
2858 * sign.c (_gpgme_op_sign_start): Likewise.
2859 * verify.c (_gpgme_op_verify_start): Likewise.
2861 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
2862 * key.c (key_cache_initialized, key_cache_size,
2863 key_cache_max_chain_length, ): Removed.
2864 (struct key_cache_item_s, key_cache_lock, key_cache,
2865 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
2866 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
2867 * key-cache.c: ... here. New file.
2868 * key.h (_gpgme_key_cache_init): Remove prototypes.
2869 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
2871 * version.c: Do not include "key.h".
2872 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
2874 * mkstatus: Strip trailing comma.
2875 * gpgme.h (GpgmeStatus): Pretty print.
2877 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
2878 GPGME_Bad_Passphrase.
2879 * passphrase.c (_gpgme_passphrase_status_handler): Use
2880 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
2882 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
2883 GPGME_No_UserID and GPGME_Invalid_Recipient to
2884 GPGME_Invalid_UserID.
2885 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
2886 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
2887 GPGME_Invalid_Recipient.
2888 (_gpgme_op_encrypt_start): Likewise.
2890 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
2891 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
2892 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
2893 * wait-global.c (gpgme_wait): Likewise.
2894 * verify.c (_gpgme_op_verify_start): Likewise.
2895 (gpgme_get_sig_status): Don't check pending flag.
2896 (gpgme_get_sig_string_attr): Likewise.
2897 (gpgme_get_sig_ulong_attr): Likewise.
2898 (gpgme_get_sig_key): Likewise.
2899 * op-support.c (_gpgme_op_reset): Likewise.
2900 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
2901 (gpgme_op_trustlist_next): Don't check or clear pending flag.
2902 (gpgme_op_trustlist_end): Likewise.
2903 * sign.c (_gpgme_op_sign_start): Likewise.
2904 * context.h (struct gpgme_context_s): Remove member PENDING.
2905 * decrypt.c (_gpgme_decrypt_start): Likewise.
2906 * delete.c (_gpgme_op_delete_start): Likewise.
2907 * edit.c (_gpgme_op_edit_start): Likewise.
2908 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2909 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2910 * export.c (_gpgme_op_export_start): Likewise.
2911 * genkey.c (_gpgme_op_genkey_start): Likewise.
2912 * import.c (_gpgme_op_import_start): Likewise.
2913 * key.c (gpgme_get_key): Likewise.
2914 * keylist.c (gpgme_op_keylist_start): Likewise.
2915 (gpgme_op_keylist_ext_start): Likewise.
2916 (gpgme_op_keylist_next): Likewise.
2917 (gpgme_op_keylist_end): Likewise.
2918 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
2920 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
2922 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
2923 and add argument for returning the result string.
2924 (gpgme_cancel): Remove prototype.
2925 * gpgme.c (gpgme_cancel): Remove function.
2926 * context.h (struct gpgme_context_s): Remove member cancel.
2927 * passphrase.c (_gpgme_passphrase_command_handler): Call the
2928 passphrase callback in the new way.
2930 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2932 * edit.c (_gpgme_edit_status_handler): Call the progress status
2935 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
2937 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
2938 I/O handlers left to ...
2939 (_gpgme_user_io_cb_handler): ... here.
2941 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2943 * trustlist.c (trustlist_colon_handler): Release ITEM if name
2944 could not be allocated.
2945 (gpgme_trust_item_release): Only release name if it is allocated.
2946 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
2948 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2950 * rungpg.c (read_status): If he status handler returns an error,
2952 (status_handler): If read_status fails, just return the error.
2954 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2956 * engine-gpgsm.c (start): Handle all errors, not only most of
2958 (xtoi_1, xtoi_2): Remove macro.
2959 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
2961 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2963 * engine-gpgsm.c (map_assuan_error): Replace
2964 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
2965 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
2967 * util.h (DIMof): Remove macro.
2969 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
2970 _gpgme_data_unread): Prototypes removed.
2972 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2974 * types.h: File removed.
2975 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
2976 * io.h (struct spawn_fd_item_s): Do not include "types.h".
2978 * context.h: Likewise.
2979 * cengine-gpgsm.h: Likewise.
2980 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
2981 for EngineStatusHandler, EngineColonLineHandler and
2982 EngineCommandHandler.
2983 (_gpgme_engine_set_status_handler): Change parameter type from
2984 GpgmeStatusHandler to EngineStatusHandler.
2985 (_gpgme_engine_set_command_handler): Change parameter type from
2986 GpgmeCommandHandler to EngineCommandHandler.
2987 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2988 GpgmeColonLineHandler to EngineColonLineHandler.
2989 * engine-backend.h: Include "engine.h" instead "types.h".
2990 (struct engine_ops): Change Gpgme*Handler parameters in members
2991 set_command_handler, set_colon_line_handler and set_status_handler
2993 * engine.c (_gpgme_engine_set_status_handler): Change parameter
2994 type from GpgmeStatusHandler to EngineStatusHandler.
2995 (_gpgme_engine_set_command_handler): Change parameter type from
2996 GpgmeCommandHandler to EngineCommandHandler.
2997 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2998 GpgmeColonLineHandler to EngineColonLineHandler.
2999 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3000 from GpgmeStatusHandler to EngineStatusHandler. Change type of
3001 member colon.fnc from GpgmeColonLineHandler to
3002 EngineColonLineHandler. Change type of member cmd.fnc from
3003 GpgmeCommandHandler to EngineCommandHandler.
3004 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3005 * rungpg.c (gpg_set_status_handler): Change parameter type from
3006 GpgmeStatusHandler to EngineStatusHandler.
3007 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3008 (assuan_simple_command): Likewise.
3009 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3010 from GpgmeColonLineHandler to EngineColonLineHandler.
3011 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3012 * rungpg.c (gpg_set_command_handler): Change parameter type from
3013 GpgmeCommandHandler to EngineCommandHandler.
3015 * engine-gpgsm.c (status_handler): Do not close status fd at end
3018 * ops.h (_gpgme_op_data_lookup): Add prototype.
3019 * op-support.c: Include <stdlib.h>.
3020 (_gpgme_op_data_lookup): New function.
3021 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3022 (struct decrypt_result_s): Rename to ...
3023 (struct decrypt_resul): ... this.
3024 (DecryptResult): New type.
3025 (_gpgme_decrypt_status_handler): Don't use
3026 test_and_allocate_result, but use _gpgme_op_data_lookup to
3027 retrieve result data object.
3028 * sign.c (_gpgme_release_sign_result): Function removed.
3029 (release_sign_result): New function.
3030 (struct sign_result_s): Rename to ...
3031 (struct sign_result): ... this.
3032 (SignResult): New type.
3033 (_gpgme_sign_status_handler): Don't use
3034 test_and_allocate_result, but use _gpgme_op_data_lookup to
3035 retrieve result data object.
3036 * encrypt.c (struct encrypt_result_s): Rename to ...
3037 (struct encrypt_result): ... this.
3038 (_gpgme_release_encrypt_result): Function removed.
3039 (release_encrypt_result): New function.
3040 (_gpgme_encrypt_status_handler): Don't use
3041 test_and_allocate_result, but use _gpgme_op_data_lookup to
3042 retrieve result data object.
3043 * verify.c (struct verify_result_s): Rename to ...
3044 (struct verify_result): ... this. Remove member next.
3045 (VerifyResult): New type.
3046 (_gpgme_release_verify_result): Function removed.
3047 (release_verify_result): New function.
3048 (finish_sig): Change first argument to type VerifyResult. Diddle
3049 the type of the op_data structure.
3050 (add_notation): Change first argument to type VerifyResult.
3051 (_gpgme_verify_status_handler): Don't use
3052 test_and_allocate_result, but use _gpgme_op_data_lookup to
3053 retrieve result data object.
3054 * passphrase.c (struct passphrase_result_s): Rename to ...
3055 (struct passphrase_result): ... this. Remove member next.
3056 (PassphraseResult): New type.
3057 (_gpgme_release_passphrase_result): Function removed.
3058 (release_passphrase_result): New function.
3059 (_gpgme_passphrase_status_handler): Don't use
3060 test_and_allocate_result, but use _gpgme_op_data_lookup to
3061 retrieve result data object.
3062 (_gpgme_passphrase_command_handler): Likewise.
3063 * keylist.c (struct keylist_result_s): Rename to ...
3064 (struct keylist_result): ... this. Remove member next.
3065 (KeylistResult): New type.
3066 (_gpgme_release_keylist_result): Function removed.
3067 (release_keylist_result): New function.
3068 (keylist_status_handler): Don't use
3069 test_and_allocate_result, but use _gpgme_op_data_lookup to
3070 retrieve result data object.
3071 * edit.c (struct edit_result_s): Rename to ...
3072 (struct edit_result): ... this. Remove member next.
3073 (EditResult): New type.
3074 (_gpgme_release_edit_result): Function removed.
3075 (release_edit_result): New function.
3076 (edit_status_handler): Don't use
3077 test_and_allocate_result, but use _gpgme_op_data_lookup to
3078 retrieve result data object.
3079 (command_handler): Likewise.
3080 * types.h (DecryptResult, SignResult, EncryptResult,
3081 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3082 KeylistResult, EditResult): Types removed.
3083 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3084 (test_and_allocate_result): Remove macro.
3085 (_gpgme_release_decrypt_result): Remove prototype.
3086 (_gpgme_decrypt_result): Remove prototype.
3087 (_gpgme_release_sign_result): Remove prototype.
3088 (_gpgme_release_encrypt_result): Remove prototype.
3089 (_gpgme_release_passphrase_result): Remove prototype.
3090 (_gpgme_release_import_result): Remove prototype.
3091 (_gpgme_release_delete_result): Remove prototype.
3092 (_gpgme_release_genkey_result): Remove prototype.
3093 (_gpgme_release_keylist_result): Remove prototype.
3094 (_gpgme_release_edit_result): Remove prototype.
3095 (_gpgme_release_verify_result): Remove prototype.
3096 * gpgme.c (_gpgme_release_result): Rewritten.
3097 * context.h (enum ctx_op_data_type): New enum.
3098 (struct ctx_op_data): New structure.
3099 (struct gpgme_context_s): Replace the member result with a member
3101 (fail_on_pending_request): Remove macro.
3102 * op-support.c (_gpgme_op_reset): Expand macro
3103 fail_on_pending_request.
3104 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3106 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
3108 * types.h (EngineObject): Move typedef to ...
3109 * engine.h: ... here.
3110 * types.h (GpgObject): Move typedef to ...
3111 * rungpg.c: ... here.
3112 * types.h (GpgsmObject): Move typedef to ...
3113 * engine-gpgsm.c: ... here.
3115 * util.h (return_if_fail, return_null_if_fail,
3116 return_val_if_fail): Remove macro.
3117 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3118 * key.c (gpgme_key_ref): Likewise.
3119 * signers.c (gpgme_signers_enum): Likewise.
3120 (gpgme_signers_clear): Likewise.
3122 * engine-backend.h (struct engine_ops): Rename get_path to
3124 * gpgme.h (struct _gpgme_engine_info): Rename member path to
3126 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3127 util.h. Other clean ups.
3128 (parse_version_number): Protect more seriously against
3130 (gpgme_get_engine_info): Move to ...
3131 * engine.c (gpgme_get_engine_info): ... here.
3132 (_gpgme_engine_get_info): Function removed.
3133 (_gpgme_engine_get_path): Make static and rename to ...
3134 (engine_get_file_name): .. this.
3135 (_gpgme_engine_get_version): Make static and rename to ...
3136 (engine_get_version): ... this.
3137 (_gpgme_engine_get_req_version): Make static and rename to ...
3138 (engine_get_req_version): ... this.
3139 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3140 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3143 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3144 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3145 (gpgme_get_protocol_name): New function.
3147 * engine-backend.h (struct engine_ops): New member
3148 get_req_version, remove member check_version.
3149 * engine.h (_gpgme_Engine_get_version): New prototype.
3150 * rungpg.c (gpg_get_req_version): New function.
3151 (gpg_check_version): Function removed.
3152 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3154 * engine-gpgsm.c (gpgsm_get_req_version): New function.
3155 (gpgsm_check_version): Function removed.
3156 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3157 gpgsm_check_version.
3158 * engine.c: Include ops.h.
3159 (_gpgme_engine_get_req_version): New function.
3160 (gpgme_engine_check_version): Rewritten.
3161 * version.c (gpgme_get_engine_info): Rewritten.
3162 * gpgme.h (gpgme_engine_info): New structure.
3163 (GpgmeEngineInfo): New type.
3165 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
3167 * types.h: Remove byte and ulong types.
3168 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3170 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3172 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
3173 few more escaped characters. Be more strict about buffer size.
3174 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3175 BUF and DST to unsigned char instead byte.
3176 * progress.c (_gpgme_progress_status_handler): Use unsigned char
3178 * debug.c (trim_spaces): Likewise.
3180 * util.h (mk_error): Remove macro.
3181 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3182 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3183 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3184 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3185 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3186 wait-private (literally everywhere): Expand the mk_error macro.
3188 * context.h (wait_on_request_or_fail): Remove macro.
3190 * context.h (gpgme_context_s): Remove member ERROR.
3191 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3192 (GpgmeCommandHandler): Change return type to GpgmeError and add
3193 new argument RESULT.
3194 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3195 (GpgmeEventIO): New event GPGME_EVENT_START.
3196 (GpgmeIdleFunc): Remove type.
3197 (gpgme_register_idle): Remove prototype.
3198 * data.c: Include <assert.h>.
3199 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3200 Return any error instead ignoring it, don't close file descriptor
3202 (_gpgme_data_outbound_handler): Likewise.
3203 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3204 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3205 Return error instead setting ctx->error. Return success at end of
3207 (gpgme_op_decrypt): Don't work around the old kludge anymore.
3208 * decrypt-verify.c (decrypt_verify_status_handler): Change return
3209 type to GpgmeError. Return possible errors.
3210 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3212 (delete_status_handler): Change return type to GpgmeError. Return
3213 error instead setting ctx->error. Return success at end of
3215 * edit.c: Do not include <stdio.h> and <string.h>.
3216 (_gpgme_edit_status_handler): Change type to GpgmeError,
3217 make static and rename to ...
3218 (edit_status_handler): ... this. Return error directly.
3219 (command_handler): Change return type to GpgmeError, add result
3220 argument. Return error directly.
3221 * encrypt.c (status_handler_finish): Remove function.
3222 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3223 Return error directly.
3224 (_gpgme_encrypt_sym_status_handler): Likewise.
3225 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3226 * engine-gpgsm.c (close_notify_handler): Do not signal done event
3228 (status_handler): Change return type to GpgmeError. Diddle things
3229 around a bit to return errors directly.
3230 (start): Send start event.
3231 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3232 (export_status_handler): Change return type to GpgmeError. Don't
3234 * genkey.c: Do not include <stdio.h> and <assert.h>.
3235 (genkey_status_handler): Change return type to GpgmeError. Don't
3236 check ctx->error. Return errors directly.
3237 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3238 (_gpgme_op_event_cb): Function removed.
3239 (_gpgme_op_event_cb_user): Likewise.
3240 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3241 (import_status_handler): Change return type to GpgmeError. Don't
3243 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3244 Change return type to GpgmeError, return error directly.
3245 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3246 wait-private.c and wait-user.c
3247 * ops.h (test_and_allocate_result): Return error instead setting
3249 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3250 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3251 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3252 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3253 Change return type to GpgmeError.
3254 (_gpgme_passphease_command_handler): Change return type to
3255 GpgmeError and add new argument RESULT.
3256 * op-support.c: Use new callback functions, and change private
3257 data to ctx everywhere.
3258 * passphrase.c (_gpgme_passphrase_status_handler): Change return
3259 type to GpgmeError, return error directly.
3260 (_gpgme_passphrase_command_handler): Change return type to
3261 GpgmeError, add result argument. Return results accordingly.
3262 * progress.c (_gpgme_progress_status_handler): Change return type
3263 to GpgmeError, return errors directly.
3264 * rungpg.c (status_handler): Change return type to GpgmeError.
3265 Return error directly.
3266 (close_notify_handler): Don't send done event.
3267 (colon_line_handler): Change return type to GpgmeError, return
3269 * rungpg.c (start): Send start event.
3270 * sign.c (_gpgme_sign_status_handler): Change return type to
3271 GpgmeError, return errors directly.
3272 * trustlist.c (trustlist_status_handler): Change return type to
3273 GpgmeError. Return 0.
3274 (trustlist_colon_handler): Change return type GpgmeError. Return
3276 * verify.c (add_notation): Change return type to GpgmeError,
3277 return errors directly.
3278 (_gpgme_verify_status_handler): Likewise.
3279 * wait.h (struct fd_table): Remove lock member.
3280 (struct wait_item_s): Moved here from wait.c.
3281 (struct tag): New structure.
3282 (_gpgme_wait_event_cb): Remove prototype.
3283 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3284 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3285 _gpgme_wait_user_event_io_cb): New prototypes.
3286 * wait.c: Don't include <stdio.h>.
3287 (ftd_global, ctx_done_list, ctx_done_list_size,
3288 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3290 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3292 (gpgme_wait): Move to file wait-global.c.
3293 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3294 member in wait item and tag.
3295 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
3296 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3298 (gpgme_fd_table_init): Don't initialize FDT->lock.
3299 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3300 (_gpgme_fd_table_put): Make static and rename to ...
3301 (fd_table_put): ... this function. Don't use FDT->lock.
3302 (struct wait_item_s): Move to wait.h.
3303 * wait-global.c: New file.
3304 * wait-private.c: New file.
3305 * wait-user.c: New file.
3307 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3308 instead otrust_to_string to calculate validity.
3310 2003-01-19 Miguel Coca <mcoca@gnu.org>
3312 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3314 * w32-util.c: Include "sema.h".
3315 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3318 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
3320 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3321 (gpg_start): Rename to ...
3322 (start): ... this function. Change arguments to GpgObject.
3323 (gpg_decrypt): Call start.
3324 (gpg_edit): Likewise.
3325 (gpg_encrypt): Likewise.
3326 (gpg_encrypt_sign): Likewise.
3327 (gpg_export): Likewise.
3328 (gpg_import): Likewise.
3329 (gpg_keylist): Likewise.
3330 (gpg_keylist_ext): Likewise.
3331 (gpg_trustlist): Likewise.
3332 (gpg_verify): Likewise.
3334 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3335 (gpgsm_start): Rename to ...
3336 (struct gpgsm_object_s): Remove member command.
3337 (gpgsm_release): Don't free command.
3338 (start): ... this function. Change arguments to GpgsmObject and
3340 (gpgsm_decrypt): Call start.
3341 (gpgsm_delete): Likewise.
3342 (gpgsm_encrypt): Likewise.
3343 (gpgsm_export): Likewise.
3344 (gpgsm_genkey): Likewise.
3345 (gpgsm_import): Likewise.
3346 (gpgsm_keylist): Likewise.
3347 (gpgsm_keylist_ext): Likewise.
3348 (gpgsm_verify): Likewise.
3350 * decrypt.c (_gpgme_decrypt_start): Don't call
3351 _gpgme_engine_start.
3352 * delete.c (_gpgme_op_delete_start): Likewise.
3353 * edit.c (_gpgme_op_edit_start): Likewise.
3354 * encrypt.c (_gpgme_op_encrypt_start):
3355 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
3356 * export.c (_gpgme_op_export_start): Likewise.
3357 * genkey.c (_gpgme_op_genkey_start): Likewise.
3358 * import.c (_gpgme_op_import_start): Likewise.
3359 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3360 (gpgme_op_keylist_start): Likewise.
3361 * sign.c (_gpgme_op_sign_start): Likewise.
3362 * trustlist.c (gpgme_op_trustlist_start): Likewise.
3363 * verify.c (_gpgme_op_verify_start): Likewise.
3365 * engine-backend.h (struct engine_ops): Remove member start.
3367 * engine.h (_gpgme_engine_start): Remove prototype.
3368 * engine.c (_gpgme_engine_start): Remove function.
3370 2003-01-06 Werner Koch <wk@gnupg.org>
3372 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3373 since gpg 1.3 to denote disabled keys.
3375 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3377 * data-mem.c: Include <string.h>.
3378 * engine.c: Likewise.
3380 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
3382 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3384 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3386 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3388 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3390 * verify.c (gpgme_op_verify): Drop R_STAT argument.
3391 (_gpgme_intersect_stati): Function removed.
3392 * ops.h (_gpgme_intersect_stati): Remove prototype.
3394 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
3396 * libgpgme.vers: New file.
3397 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3398 (libgpgme_version_script_cmd): New variable.
3399 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3400 (libgpgme_la_DEPENDENCIES): New variable.
3402 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3404 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
3405 (otrust_to_string): New function.
3406 (gpgme_key_get_as_xml): Use it.
3407 (validity_to_string): New function.
3408 (gpgme_key_get_string_attr): Beautify using above functions.
3409 (gpgme_key_get_ulong_attr): Likewise.
3411 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
3413 * data-mem.c (mem_release): Fix gcc warning.
3414 * data-user.c (user_release): Likewise.
3416 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
3418 * data.h (gpgme_data_release_cb): Change return type to void.
3419 (gpgme_data_read_cb): Change return type to ssize_t.
3420 * data.c (gpgme_data_read): Likewise.
3421 * data-stream.c (stream_read): Likewise.
3422 * data-fd.c (fd_read): Likewise.
3423 * data-mem.c (mem_read): Likewise.
3424 (mem_release): Change return type to void.
3425 * data-user.c (user_read): Change return type to ssize_t.
3426 (user_release): Change return type to void.
3427 * data-compat.c (old_user_read): Change return type to ssize_t.
3428 * gpgme.h (GpgmeDataReadCb): Likewise.
3429 (gpgme_data_read): Likewise.
3430 (GpgmeDataSeekCb): Change return type to off_t.
3432 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
3434 * gpgme.h: Add prototype for gpgme_get_key.
3435 * key.c (gpgme_get_key): New function.
3436 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
3438 * gpgme.h: Add prototypes for new interfaces
3439 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
3440 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
3441 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
3442 * key.h (struct certsig_s): New members ALGO, NAME_PART,
3443 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
3445 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
3446 Use that to determine if allocation is desired or not.
3447 * util.h: Adjust prototype of _gpgme_decode_c_string.
3448 * keylist.c (keylist_colon_handler): Adjust caller of
3449 _gpgme_decode_c_string.
3451 * key.h (struct gpgme_key_s): New member last_uid.
3452 * key.c (_gpgme_key_append_name): Rewritten using
3453 _gpgme_decode_c_string and the last_uid pointer.
3454 (my_isdigit): Macro removed.
3455 (ALLOC_CHUNK): Likewise.
3456 * keylist.c (set_userid_flags): Use last_uid member of KEY.
3458 * context.h (struct user_id_s): New member last_certsig.
3459 * key.h: Add prototype for _gpgme_key_add_certsig.
3460 * key.c (_gpgme_key_add_certsig): New function.
3461 (set_user_id_part): Move function before _gpgme_key_add_certsig.
3462 (parse_user_id): Change first argument to SRC, add new arguments
3463 NAME, EMAIL and COMMENT. Change code to use these arguments
3464 instead going through UID. Move function before
3466 (parse_x509_user_id): Likewise.
3467 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
3468 and parse_user_id invocation.
3469 (one_certsig_as_xml): New function.
3470 (one_uid_as_xml): Print signatures.
3471 * context.h (struct gpgme_context_s): New member TMP_UID.
3472 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
3475 * key.c (get_certsig): New function.
3476 (gpgme_key_sig_get_string_attr): Likewise.
3477 (gpgme_key_sig_get_ulong_attr): Likewise.
3479 * keylist.c: Include <ctype.h>.
3480 (my_isdigit): Macro removed.
3481 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
3482 (set_userid_flags): Likewise.
3483 (set_subkey_trust_info): Likewise.
3484 (set_ownertrust): Likewise.
3485 (finish_key): Move function up a bit and remove prototype.
3487 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
3489 (gpg_keylist_ext): Implement signature listing mode.
3491 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
3493 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
3494 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
3496 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
3497 CloseHandle for parent fds.
3499 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
3501 * gpgme.h [_MSC_VER]: Define ssize_t as long.
3503 2002-11-22 Werner Koch <wk@gnupg.org>
3505 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
3506 setlocale before doing another setlocale.
3508 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
3510 * decrypt.c: Some beautyfication.
3512 * verify.c (_gpgme_verify_status_handler): Treat
3513 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
3514 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
3516 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3518 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
3519 (struct genkey_result_s): Add new member FPR.
3520 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
3521 (genkey_status_handler): Extract the fingerprint from the status
3523 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
3525 * gpgme.h: Adjust prototype of gpgme_op_genkey.
3527 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
3529 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
3530 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
3531 <twoaday@freakmail.de>.
3532 (gpg_keylist_ext): Likewise.
3534 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
3536 * import.c (append_xml_impinfo): Use
3537 _gpgme_data_append_string_for_xml rather than
3538 _gpgme_data_append_string for the field content.
3539 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
3541 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3543 * rungpg.h, engine-gpgsm.h: File removed.
3544 * engine-backend.h: New file.
3545 * Makefile.am (gpgsm_components): New variable, set depending on
3546 automake conditional HAVE_GPGSM.
3547 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
3548 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
3549 (status-table.h): Depend on gpgme.h, not rungpg.h.
3550 * conversion.c: Include <stdlib.h>.
3551 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
3552 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
3553 functions and remove all function prototypes.
3554 (_gpgme_gpgsm_get_version): Make static and rename to ...
3555 (gpgsm_get_version): ... this.
3556 (_gpgme_gpgsm_check_version): Make static and rename to ...
3557 (gpgsm_check_version): ... this.
3558 (_gpgme_gpgsm_new): Make static. Change argument type from
3559 GpgsmObject * to void **. Call gpgsm_release instead
3560 _gpgme_gpgsm_release.
3561 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
3562 (gpgsm_check_decrypt): ... this.
3563 (_gpgme_gpgsm_op_delete): Make static and rename to ...
3564 (gpgsm_check_delete): ... this.
3565 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
3566 (gpgsm_check_set_recipients): ... this.
3567 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
3568 (gpgsm_encrypt): ... this.
3569 (_gpgme_gpgsm_op_export): Make static and rename to ...
3570 (gpgsm_export): ... this.
3571 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
3572 (gpgsm_genkey): ... this.
3573 (_gpgme_gpgsm_op_import): Make static and rename to ...
3574 (gpgsm_import): ... this.
3575 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3576 (gpgsm_keylist): ... this.
3577 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3578 (gpgsm_keylist_ext): ... this.
3579 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3580 (gpgsm_sign): ... this.
3581 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3582 (gpgsm_trustlist): ... this.
3583 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3584 (gpgsm_verify): ... this.
3585 (gpgsm_status_handler): Rename to ...
3586 (status_handler): ... this.
3587 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3588 (gpgsm_set_status_handler): ... this.
3589 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3590 (gpgsm_set_colon_line_handler): ... this.
3591 (_gpgme_gpgsm_add_io_cb): Rename to ...
3592 (add_io_cb): ... this.
3593 (_gpgme_gpgsm_start): Make static and rename to ...
3594 (gpgsm_start): ... this.
3595 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3596 (gpgsm_set_io_cb): ... this.
3597 (_gpgme_gpgsm_io_event): Make static and rename to ...
3598 (gpgsm_io_event): ... this.
3599 (struct _gpgme_engine_ops_gpgsm): New variable.
3600 [!ENABLE_GPGSM]: Removed.
3601 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3602 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3603 <stdlib.h> and "engine-backend.h".
3604 (struct engine_object_s): Rewritten.
3605 (engine_ops): New variable.
3606 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3607 _gpgme_engine_check_version, _gpgme_engine_new,
3608 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3609 _gpgme_engine_set_status_handler,
3610 _gpgme_engine_set_command_handler,
3611 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3612 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3613 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3614 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3615 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3616 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3617 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3618 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3619 _gpgme_engine_io_event): Reimplement.
3620 * engine.h: Fix a few comments and a variable name in a prototype.
3621 * ops.h: Do not include "rungpg.h".
3622 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3624 * recipient.c: Likewise.
3625 * signers.c: Likewise.
3626 * version.c: Likewise.
3627 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3628 functions and remove prototypes.
3629 (_gpgme_gpg_get_version): Make static and rename to ...
3630 (gpg_get_version): ... this.
3631 (_gpgme_gpg_check_version): Make static and rename to ...
3632 (gpg_check_version): ... this.
3633 (_gpgme_gpg_new): Make static. Change argument type from
3634 GpgObject * to void **. Call gpg_release instead
3636 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3637 (gpg_check_decrypt): ... this.
3638 (_gpgme_gpg_op_delete): Make static and rename to ...
3639 (gpg_check_delete): ... this.
3640 (_gpgme_gpg_set_recipients): Make static and rename to ...
3641 (gpg_check_set_recipients): ... this.
3642 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3643 (gpg_encrypt): ... this.
3644 (_gpgme_gpg_op_export): Make static and rename to ...
3645 (gpg_export): ... this.
3646 (_gpgme_gpg_op_genkey): Make static and rename to ...
3647 (gpg_genkey): ... this.
3648 (_gpgme_gpg_op_import): Make static and rename to ...
3649 (gpg_import): ... this.
3650 (_gpgme_gpg_op_keylist): Make static and rename to ...
3651 (gpg_keylist): ... this.
3652 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3653 (gpg_keylist_ext): ... this.
3654 (_gpgme_gpg_op_sign): Make static and rename to ...
3655 (gpg_sign): ... this.
3656 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3657 (gpg_trustlist): ... this.
3658 (_gpgme_gpg_op_verify): Make static and rename to ...
3659 (gpg_verify): ... this.
3660 (gpg_status_handler): Rename to ...
3661 (status_handler): ... this.
3662 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3663 (gpg_set_status_handler): ... this.
3664 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3665 (gpg_set_colon_line_handler): ... this.
3666 (gpgme_gpg_add_io_cb): Rename to ...
3667 (add_io_cb): ... this.
3668 (_gpgme_gpg_start): Make static and rename to ...
3669 (gpg_start): ... this.
3670 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3671 (gpg_set_io_cb): ... this.
3672 (_gpgme_gpg_io_event): Make static and rename to ...
3673 (gpg_io_event): ... this.
3674 (struct _gpgme_engine_ops_gpg): New variable.
3676 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3678 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3681 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3683 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3684 data-compat.c: New file. Really check them in this time, completes
3687 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3689 * types.h (GpgmeStatusHandler): ... here.
3690 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3692 * types.h (GpgmeColonLineHandler): ... here.
3693 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3695 * types.h (GpgmeCommandHandler): ... here.
3696 * engine.h: Don't include "rungpg.h".
3697 (_gpgme_engine_set_status_handler): Change type of
3698 argument from GpgStatusHandler to GpgmeStatusHandler.
3699 (_gpgme_engine_set_colon_line_handler): Change type of
3700 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3701 (_gpgme_engine_set_command_handler): Change type of
3702 argument from GpgCommandHandler to GpgmeCommandHandler.
3703 * engine-gpgsm.h: Don't include "rungpg.h".
3704 (_gpgme_gpgsm_set_status_handler): Change type of
3705 argument from GpgStatusHandler to GpgmeStatusHandler.
3706 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3707 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3708 * engine-gpgsm.c: Do not include "rungpg.h".
3709 (struct gpgsm_object_s): Change type of
3710 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3711 GpgmeColonLineHandler.
3712 (gpgsm_assuan_simple_command): Change type of argument from
3713 GpgStatusHandler to GpgmeStatusHandler.
3714 (_gpgme_gpgsm_set_status_handler): Likewise.
3715 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3716 GpgColonLineHandler to GpgmeColonLineHandler.
3717 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3718 argument from GpgStatusHandler to GpgmeStatusHandler.
3719 (_gpgme_gpg_set_colon_line_handler): Change type of
3720 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3721 (_gpgme_gpg_set_command_handler): Change type of
3722 argument from GpgCommandHandler to GpgmeCommandHandler.
3723 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3724 GpgmeStatusHandler. Change type of colon.fnc to
3725 GpgmeColonLineHandler. Change type of cmd.fnc to
3726 GpgmeCommandLineHandler.
3727 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3729 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3730 to GpgmeColonLineHandler.
3731 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3732 GpgmeCommandHandler.
3733 * engine.c (_gpgme_engine_set_status_handler): Change type of
3734 argument FNC to GpgmeStatusHandler.
3735 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3736 to GpgmeColonLineHandler.
3737 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3738 GpgmeCommandHandler.
3740 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
3741 * rungpg.c (struct gpg_object_s): Remove PM.
3742 (pipemode_cb): Prototype removed.
3743 (add_pm_data): Function removed.
3744 (_gpgme_gpg_enable_pipemode): Likewise.
3745 (pipemode_copy): Likewise.
3746 (pipemode_cb): Likewise.
3747 (add_arg): Don't check for pipemode.
3748 (add_data): Likewise.
3749 (_gpgme_gpg_set_status_handler): Likewise.
3750 (_gpgme_gpg_set_colon_line_handler): Likewise.
3751 (_gpgme_gpg_set_command_handler): Likewise.
3752 (_gpgme_gpg_spawn): Likewise.
3753 (_gpgme_gpg_spawn): Don't set PM.active.
3754 (_gpgme_gpg_op_verify): Remove pipemode case.
3755 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
3757 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3758 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
3759 _gpgme_gpg_set_simple_line_handler): Prototype removed.
3760 (_gpgme_gpg_set_verbosity): New prototype.
3761 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
3762 (add_data): ... this.
3763 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
3764 (_gpgme_gpg_set_command_handler): Likewise.
3765 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3766 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3767 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3768 _gpgme_gpg_op_verify): Likewise.
3769 (_gpgme_gpg_add_pm_data): Rename to ...
3770 (add_pm_data): ... this.
3771 (_gpgme_gpg_op_verify): Call add_pm_data, not
3772 _gpgme_gpg_add_pm_data.
3773 (_gpgme_gpg_add_arg): Make static and rename to ...
3774 (add_arg): ... this.
3775 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
3776 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
3777 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
3778 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
3779 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3780 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
3781 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
3782 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
3784 (_gpgme_gpg_set_verbosity): New function.
3785 (struct gpg_object_s): Remove member simple from colon.
3786 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
3787 (_gpgme_gpg_set_simple_line_handler): Removed function.
3788 (read_colon_line): Don't check the GPG->colon.simple.
3789 * engine.c (_gpgme_engine_set_verbosity): Call
3790 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
3792 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3794 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
3795 _gpgme_strdup, _gpgme_free): Remove prototypes.
3796 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
3798 * util.c: File removed.
3799 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
3800 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
3801 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
3802 xtrycalloc, free instead of xfree.
3803 (_gpgme_data_append_percentstring_for_xml): Likewise.
3804 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
3805 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
3806 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
3807 _gpgme_data_get_as_string): Likewise.
3808 * debug.c (debug_init): Likewise.
3809 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
3810 * delete.c (_gpgme_release_delete_result): Likewise.
3811 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
3813 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
3814 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
3815 _gpgme_engine_release): Likewise.
3816 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
3817 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
3818 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
3819 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
3820 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
3821 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
3822 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
3823 * genkey.c (_gpgme_release_genkey_result): Likewise.
3824 * gpgme.c (gpgme_new, gpgme_release): Likewise.
3825 * import.c (_gpgme_release_import_result): Likewise.
3826 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
3827 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
3828 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
3829 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
3830 * ops.h (test_and_allocate_result): Likewise.
3831 * passphrase.c (_gpgme_release_passphrase_result,
3832 _gpgme_passphrase_status_handler,
3833 _gpgme_passphrase_command_handler): Likewise.
3834 * progress.c (_gpgme_progress_status_handler): Likewise.
3835 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
3836 gpgme_recipients_add_name_with_validity): Likewise.
3837 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
3838 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3839 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
3840 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
3842 * sign.c (_gpgme_release_sign_result): Likewise.
3843 * signers.c (_gpgme_signers_add): Likewise.
3844 * trustlist.c (trust_item_new, trustlist_colon_handler,
3845 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
3846 gpgme_trustitem_release): Likewise.
3847 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
3848 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
3850 * w32-io.c (create_reader, create_writer, destroy_reader,
3851 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
3852 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
3853 * w32-util.c (read_w32_registry_string): Likewise.
3854 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
3855 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
3856 * data-compat.c: Include <stdlib.h>.
3858 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3860 New data object component:
3862 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
3863 GpgmeDataReleaseCb): New types.
3864 (struct GpgmeDataCbs): New structure.
3865 (gpgme_data_read): Changed prototype to match that of read() closely.
3866 (gpgme_data_write): Similar for write().
3867 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
3868 gpgme_data_new_from_stream): New prototypes.
3869 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
3871 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
3872 data-stream.c, data-mem.c, data-user.c and data-compat.c.
3873 * data.c: Reimplemented from scratch.
3874 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
3875 data-user.c): New file.
3876 * context.h (struct gpgme_data_s): Removed.
3877 * conversion.c: Include <errno.h> and <sys/types.h>.
3878 (_gpgme_data_append): New function.
3879 * data.c (_gpgme_data_append_string): Move to ...
3880 * conversion.c (_gpgme_data_append_string): ... here.
3881 * data.c (_gpgme_data_append_for_xml): Move to ...
3882 * conversion.c (_gpgme_data_append_for_xml): ... here.
3883 * data.c (_gpgme_data_append_string_for_xml): Move to ...
3884 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
3885 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
3886 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
3888 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
3890 * types.h (GpgmeDataMode): Type removed.
3892 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
3893 * edit.c (_gpgme_op_edit_start): Likewise.
3894 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3895 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3896 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3897 * export.c (_gpgme_op_export_start): Likewise.
3898 * genkey.c (_gpgme_op_genkey_start): Likewise.
3899 * import.c (_gpgme_op_import_start): Likewise.
3900 * sign.c (_gpgme_op_sign_start): Likewise.
3901 * verify.c (_gpgme_op_verify_start): Likewise.
3903 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
3904 no recipient if no data was returned.
3905 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3906 no recipient if no data was returned.
3907 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3908 no recipient if no data was returned.
3910 * engine.c (_gpgme_engine_op_verify): Add new argument to
3911 differentiate detached from normal signatures.
3912 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
3913 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
3914 mode of data argument.
3915 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
3916 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
3917 (gpgme_op_verify): Likewise for prototype.
3918 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
3919 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
3920 * verify.c (_gpgme_op_verify_start): Likewise.
3921 (gpgme_op_verify_start): Likewise.
3922 (gpgme_op_verify): Likewise.
3924 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
3925 direction of data object.
3926 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
3927 determine direction of data object.
3928 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
3929 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3930 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3931 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3932 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
3934 (build_argv): Use new member INBOUND to determine direction of
3935 file descriptor. Don't check the data type.
3936 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
3938 * gpgme.c (gpgme_get_op_info): Don't call
3939 _gpgme_data_get_as_string if CTX->op_info is NULL.
3941 * version.c (gpgme_check_engine): Function removed.
3943 2002-09-30 Werner Koch <wk@gnupg.org>
3945 * keylist.c (keylist_colon_handler): Take care when printing a
3946 NULL with the DEBUG.
3948 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
3949 (gpgsm_status_handler): Run the colon function to indicate EOF.
3950 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
3952 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
3954 * conversion.c (_gpgme_hextobyte): Prevent superfluous
3955 multiplication with base. Reported by Stéphane Corthésy.
3957 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
3958 operation type in invocation of _gpgme_op_reset.
3960 2002-09-20 Werner Koch <wk@gnupg.org>
3962 * ath.c: Include sys/time.h if sys/select.h is not available.
3964 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
3966 * keylist.c (keylist_status_handler): Do not call finish_key() here.
3967 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
3969 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
3971 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
3972 into gpgme unconditionally.
3973 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
3975 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3977 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
3979 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3981 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
3982 (_gpgme_debug_end): Likewise.
3983 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3985 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3987 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
3989 * version.c (_gpgme_get_program_version): Likewise.
3990 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3992 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3994 * conversion.c (_gpgme_decode_c_string): Set DESTP before
3997 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
3999 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4000 _gpgme_op_edit so its prototype is known early on.
4002 * conversion.c: New file.
4003 * util.h: Add prototypes for _gpgme_decode_c_string and
4005 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4007 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4008 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4009 calls to _gpgme_hextobyte.
4010 (hash_key): Likewise.
4012 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
4014 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4015 _gpgme_engine_release, as this will reset pending to zero in the
4016 event done callback on cancelled operations.
4018 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
4020 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4021 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4023 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4024 * rungpg.h: Also to prototype.
4025 * engine.c (_gpgme_engine_op_edit): Likewise.
4026 * engine.h: Likewise.
4027 * edit.c (_gpgme_op_edit_start): Likewise.
4029 2002-08-29 Werner Koch <wk@gnupg.org>
4031 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4033 * vasprintf.c (va_copy): Define macro if not yet defined.
4035 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
4037 * passphrase.c (_gpgme_passphrase_status_handler): Reset
4038 CTX->result.passphrase->no_passphrase if passphrase is given (good
4039 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4041 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
4043 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4044 Return 0 on success, -1 on error.
4045 * version.c (_gpgme_get_program_version): Don't wait for the child.
4046 * engine.c (_gpgme_engine_housecleaning): Function removed.
4047 (do_reaping): Likewise.
4048 (_gpgme_engine_add_child_to_reap_list): Likewise.
4049 (struct reap_s): Removed.
4050 (reap_list): Likewise.
4051 (reap_list_lock): Likewise.
4052 * engine.h (_gpgme_engine_io_event): Remove prototypes for
4053 _gpgme_engine_housecleaning and
4054 _gpgme_engine_add_child_to_reap_list.
4055 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4056 (struct gpg_object_s): Remove PID member.
4057 (_gpgme_gpg_new): Don't initialize GPG->pid.
4058 (_gpgme_gpg_spawn): Don't set GPG->pid.
4059 * wait.c (run_idle): Removed.
4060 (gpgme_wait): Run idle_function directly.
4062 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4064 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4065 variables encrypt_info and encrypt_info_len.
4066 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4067 * posix-sema.c (sema_fatal): Remove function.
4068 All these reported by Stéphane Corthésy.
4070 2002-08-23 Werner Koch <wk@gnupg.org>
4072 * gpgme-config.in: Made --prefix work for --libs.
4074 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4076 * ath.h: Update list of symbols that get a prefix: Rename the
4077 ath_mutex_*_available symbols to ath_*_available.
4079 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
4081 * stpcpy.c: New file from gnulib.
4082 * Makefile.am (assuan_libobjs): Remove jnlib.
4084 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4086 * gpgme.h: Add prototype for gpgme_op_import_ext.
4087 * import.c (struct import_result_s): New member `nr_considered'.
4088 Rename `any_imported' to `nr_imported'.
4089 (import_status_handler): Increment nr_imported. Set nr_considered
4091 (gpgme_op_import_ext): New function.
4092 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4094 2002-08-20 Werner Koch <wk@gnupg.org>
4096 * gpgme.m4: Replaced with a new and faster version. This does not
4097 anymore try to build test programs. If we really need test
4098 programs, we should add an option to gpgme-config to do so.
4100 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4102 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
4104 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4105 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4108 2002-08-19 Werner Koch <wk@gnupg.org>
4110 * decrypt.c (is_token,skip_token): Duplicated from verify.c
4111 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4112 (_gpgme_decrypt_status_handler): Create an operation info.
4114 2002-08-14 Werner Koch <wk@gnupg.org>
4116 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
4117 * key.c (gpgme_key_release): Release it. We need to add more code
4119 (_gpgme_key_append_name): Use memset to intialize the struct.
4120 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4121 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4124 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4125 information about the key type (PGP or X.509).
4126 (gpgme_key_get_ulong_attr): Likewise.
4128 * keylist.c (keylist_colon_handler): Include 1 in the check for
4129 valid algorithms so that RSA is usable. Store the issuer name and
4130 serial number also for "crs" records. Parse the expire date for
4132 (set_userid_flags): Put them onto the last appended key.
4134 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
4136 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4138 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
4140 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4143 The following changes make it possible to flush an inbound data
4144 pipe before invoking a command handler:
4146 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4147 _gpgme_io_select. Set timeout of 0 if this is set.
4148 * w32-io.c (_gpgme_io_select): Likewise.
4149 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4150 * wait.c (do_select): Add new argument to _gpgme_io_select
4152 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4153 linked_data to prototype.
4154 * engine.h (_gpgme_engine_set_command_handler): Likewise.
4155 * engine.c (_gpgme_engine_set_command_handler): Likewise.
4156 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4157 argument to _gpgme_engine_set_command_handler.
4158 * rungpg.c (struct gpg_object_s): New members linked_data and
4160 (_gpgme_gpg_new): Initialize those new members.
4161 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4162 (build_argv): Handle linked_data in the same hack as cb_data.
4163 (read_status): If linked_data is in use, flush the pipe before
4164 activating the command handler.
4165 * gpgme.h: Add prototypes for gpgme_op_edit_start and
4168 The next changes export the status codes to the user:
4170 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4171 all STATUS_ with GPGME_.
4172 * delete.c (delete_status_handler): Likewise.
4173 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4174 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4175 (_gpgme_encrypt_sym_status_handler): Likewise.
4176 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4177 * engine-gpgsm.c (parse_status): Likewise.
4178 (gpgsm_status_handler): Likewise.
4179 (gpgsm_set_recipients): Likewise.
4180 * export.c (export_status_handler): Likewise.
4181 * genkey.c (genkey_status_handler): Likewise.
4182 * import.c (append_xml_impinfo): Likewise.
4183 (import_status_handler): Likewise.
4184 * keylist.c (keylist_status_handler): Likewise.
4185 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4186 (command_handler): Likewise.
4187 * progress.c (_gpgme_progress_status_handler): Likewise.
4188 * sign.c (_gpgme_sign_status_handler): Likewise.
4189 * trustlist.c (trustlist_status_handler): Likewise.
4190 * verify.c (_gpgme_verify_status_handler): Likewise.
4191 * gpgme.h (GpgmeEditCb): New type.
4192 * rungpg.h (GpgStatusCode): Rename and move to ...
4193 * gpgme.h (GpgmeStatusCode): ... this and here.
4194 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4195 * mkstatus: Prefix STATUS with GPGME_.
4196 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4198 * ops.h (_gpgme_verify_status_handler,
4199 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4200 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4201 _gpgme_progress_status_handler): Likewise.
4202 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4204 These changes add an edit operation to GPGME:
4206 * context.h (struct gpgme_context_s): New member RESULT.edit. *
4207 ops.h: Add prototype for _gpgme_release_edit_result and
4208 _gpgme_passphrase_command_handler.
4209 * passphrase.c (command_handler): Make non-static and rename to ...
4210 (_gpgme_passphrase_command_handler): ... this.
4211 (_gpgme_passphrase_start): Use new name for command handler.
4212 * types.h: Add EditResult type.
4213 * gpgme.c (_gpgme_release_result): Release EDIT result.
4215 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4216 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4218 (assuan_libobjs): New variable, set this instead
4220 * engine.h (_gpgme_engine_op_edit): New prototype.
4221 * engine.c (_gpgme_engine_op_edit): New function.
4222 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4223 * rungpg.c (_gpgme_gpg_op_edit): New function.
4225 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
4227 * delete.c (delete_problem): New case ambigious specification.
4228 (delete_status_handler): Handle new case (poorly).
4230 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4232 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4234 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4236 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4238 * vasprintf.c: Update to more recent libiberty version.
4239 * debug.h: Replace #elsif with #elif.
4241 Submitted by Stéphane Corthésy:
4242 * util.h (vasprintf): Correct prototype.
4243 * encrypt-sign.c: Include <stddef.h>.
4244 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4246 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4247 * ath-pth.c: Likewise.
4249 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
4251 * wait.c (fdt_global): Make static. Reported by Stéphane
4254 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4255 patterns. Reported by Stéphane Corthésy.
4257 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
4258 by Stéphane Corthésy.
4259 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4260 silence gcc warning.
4262 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4264 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
4266 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4268 * gpgme.c (_gpgme_op_event_cb_user): New function.
4269 * op-support.c (_gpgme_op_reset): Support a new mode of operation
4270 for private or user event loop. Use new user event callback
4272 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4273 * keylist.c (gpgme_op_keylist_start): Likewise.
4275 * rungpg.c (_gpgme_gpg_io_event): New function.
4276 * rungpg.h (_gpgme_gpg_io_event): New prototype.
4277 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4278 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4279 * engine.c (_gpgme_engine_io_event): New function.
4280 * engine.h (_gpgme_engine_io_event): New prototype.
4281 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4282 the real work for the default IO callback routines to ...
4283 (_gpgme_op_keylist_event_cb): ... here. New function.
4284 * trustlist.c (trustlist_colon_handler): Signal
4285 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
4286 (_gpgme_op_trustlist_event_cb): ... here. New function.
4287 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4288 and _gpgme_op_trustlist_event_cb when appropriate.
4289 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4290 (_gpgme_op_trustlist_event_cb): Likewise.
4291 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4292 user provided event handler directly.
4293 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4295 * wait.c (_gpgme_add_io_cb): Likewise.
4296 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4297 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4298 argument. Fix up error handling.
4299 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4300 new argument, fix up error handling.
4302 2002-07-03 Werner Koch <wk@gnupg.org>
4304 * encrypt.c (status_handler_finish): New.
4305 (_gpgme_encrypt_status_handler): Moved some code out to the new
4306 function and call this function also in case we get into the
4307 status handler with an error which might happen due to a kludge in
4310 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4312 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4313 table (eg use synchronous mode).
4315 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
4317 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4318 prototype and change return type to GpgmeError.
4319 (_gpgme_wait_one): New prototype.
4320 * wait.c (gpgme_wait): Replace with the meat from
4321 _gpgme_wait_on_condition here, and remove the support for
4323 (_gpgme_wait_on_condition): Remove HANG argument from prototype
4324 and change return type to GpgmeError. Replace with meat from
4325 _gpgme_wait_one and add support for conditions.
4326 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4328 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4329 table (eg use synchronous mode).
4330 (gpgme_op_keylist_next): Remove HANG argument from
4331 _gpgme_wait_on_condition. Check its return value.
4332 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4333 table (eg use synchronous mode).
4334 (gpgme_op_trustlist_next): Remove HANG argument from
4335 _gpgme_wait_on_condition. Check its return value.
4337 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
4339 * gpgme.h: Fix documentation of key attribute retrieval functions.
4341 2002-06-26 Werner Koch <wk@gnupg.org>
4343 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4345 * import.c (append_xml_impinfo): Kludge to print fingerprint
4346 instead of keyid for use with gpgsm.
4347 (import_status_handler): Set a flag to know whether any import
4349 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4351 2002-06-25 Werner Koch <wk@gnupg.org>
4353 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4356 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4358 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4360 * export.c (gpgme_op_export): If no data was returned, return
4361 GPGME_No_Recipients.
4363 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
4365 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4367 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4369 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4370 (parse_status): New function.
4371 (gpgsm_status_handler): Use parse_status.
4372 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4373 STATUS_FNC_VALUE and process status messages.
4374 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4375 (gpgsm_set_fd): Likewise.
4376 (_gpgme_gpgsm_op_keylist): Likewise.
4377 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4378 (_gpgme_gpgsm_op_sign): Likewise.
4380 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
4382 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4384 2002-06-20 Werner Koch <wk@gnupg.org>
4386 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4388 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4390 (_gpgme_verify_status_handler): Watch out for wrong key usage.
4391 (gpgme_get_sig_string_attr): Hack to return info on the key
4392 usage. Does now make use of the former RESERVED argument which
4393 has been renamed to WHATIDX.
4394 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4396 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
4398 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4399 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4400 error, or there are no more file descriptors to wait on.
4401 (_gpgme_wait_on_condition): Ignore return value from do_select for
4404 2002-06-13 Werner Koch <wk@gnupg.org>
4406 * verify.c (gpgme_op_verify): Make sure that we never access an
4407 unitialized result structure.
4409 2002-06-12 Werner Koch <wk@gnupg.org>
4411 * keylist.c (struct keylist_result_s): New.
4412 (_gpgme_release_keylist_result): Release it here
4413 (keylist_status_handler): Handle truncated.
4414 (append_xml_keylistinfo): New.
4415 * gpgme.c (_gpgme_release_result): and use it here.
4416 * types.h: Declare the new type here.
4417 * context.h (struct gpgme_context_s): Use it here.
4419 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
4421 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
4422 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
4423 use our own close notification mechanism without interfering with
4426 2002-06-11 Werner Koch <wk@gnupg.org>
4428 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
4430 * verify.c (calc_sig_summary): New.
4431 (gpgme_get_sig_ulong_attr): And use it here.
4433 2002-06-10 Werner Koch <wk@gnupg.org>
4435 * rungpg.h: Add new status codes TRUNCATED and ERROR.
4436 * verify.c (is_token, copy_token): New.
4437 (_gpgme_verify_status_handler): Use copy_token, handle the new
4438 ERROR status and store the errorcode used withgpgsm and trust
4440 * gpgme.h: New attribute ERRTOK.
4441 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
4442 (gpgme_get_sig_string_attr): Use it here to return the last error.
4444 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
4446 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
4447 close notification for the status fd to ...
4448 (_gpgme_gpgsm_new): ... here.
4449 * wait.h: Include "sema.h". Remove prototypes of
4450 _gpgme_remove_proc_from_wait_queue and
4451 _gpgme_register_pipe_handler. Add prototypes of
4452 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
4453 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
4455 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
4456 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
4457 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
4458 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
4459 proc_s. Replace struct wait_item_s.
4460 (_gpgme_fd_table_init): New function.
4461 (_gpgme_fd_table_deinit): Likewise.
4462 (_gpgme_fd_table_put): Likewise.
4463 (set_process_done): Remove function.
4464 (do_select): Take argument FDT. Use that to decide which fds to
4466 (_gpgme_remove_proc_from_wait_queue): Remove function.
4467 (_gpgme_wait_event_cb): New function.
4468 (_gpgme_wait_one): Likewise.
4469 (_gpgme_register_pipe_hanldler): Remove function.
4470 (_gpgme_add_io_cb): New function.
4471 (_gpgme_remove_io_cb): Likewise.
4472 (_gpgme_freeze_fd): Remove function.
4473 (_gpgme_thaw_fd): Remove function.
4474 * rungpg.c (struct fd_data_map_s): Add new member TAG.
4475 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
4476 IDX to CMD. Add new member IO_CBS.
4477 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
4478 For each I/O callback, check if it should be unregistered. If all
4479 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
4480 Remove member RUNNING.
4481 (_gpgme_gpg_new): Initialize new members.
4482 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
4483 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
4484 (build_argv): Store away the index instead the file descriptor for
4486 (_gpgme_gpg_add_io_cb): New function.
4487 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
4489 (gpg_status_handler): Change return type to void, remove PID
4490 argument, close filedescriptor if EOF or error occurs.
4491 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
4492 Use IO_CBS->remove instead _gpgme_freeze_fd.
4493 (gpg_colon_line_handler): Change return type to void, remove PID
4494 argument, close filedescriptor if EOF or error occurs.
4495 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
4496 (_gpgme_gpg_set_io_cbs): New function.
4497 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
4498 _gpgme_gpg_set_io_cbs.
4499 * gpgme.h (GpgmeIOCb): New type.
4500 (GpgmeRegisterIOCb): Likewise.
4501 (GpgmeRemoveIOCb): Likewise.
4502 (GpgmeEventIO): Likewise.
4503 (GpgmeEventIOCb): Likewise.
4504 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
4505 (gpgme_set_op_io_cbs): New prototype.
4506 (gpgme_get_op_io_cbs): Likewise.
4507 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
4508 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
4509 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
4510 prototype. Add prototype for _gpgme_op_reset.
4511 Add synchronous argument to _gpgme_decrypt_start prototype.
4512 * io.h: Beautification.
4513 * gpgme.c: Include "wait.h".
4514 (gpgme_new): Initialize FDT.
4515 (gpgme_set_io_cbs): New function.
4516 (gpgme_get_io_cbs): Likewise.
4517 (_gpgme_op_event_cb): Likewise.
4518 * data.c (_gpgme_data_inbound_handler): Change return type to
4519 void. Drop PID argument. Close FD on error and EOF.
4520 (write_mem_data): Don't close FD here ...
4521 (write_cb_data): ... or here ...
4522 (_gpgme_data_outbound_handler): ... but here. Change return type
4523 to void. Drop PID argument.
4524 * context.h: Include "wait.h".
4525 (struct gpgme_context_s): New members FDT and IO_CBS.
4526 * op-support.c: New file.
4527 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
4528 * ops.h: Add prototype for _gpgme_op_reset().
4529 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
4531 (gpgme_op_decrypt_start): Add synchronous argument.
4532 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
4534 * delete.c (gpgme_op_delete_start): Rename to ...
4535 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
4536 Use _gpgme_op_reset. Make function static.
4537 (gpgme_op_delete_start): Just a wrapper around
4538 _gpgme_op_delete_start now.
4539 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
4541 * encrypt.c: Include "wait.h".
4542 (ggpgme_op_encrypt_start): Rename to ...
4543 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
4544 Use _gpgme_op_reset. Make function static.
4545 (gpgme_op_encrypt_start): Just a wrapper around
4546 _gpgme_op_encrypt_start now.
4547 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
4549 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
4550 (_gpgme_op_encrypt_sign_start): ... this. New argument
4551 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
4552 (gpgme_op_encrypt_sign_start): Just a wrapper around
4553 _gpgme_op_encrypt_sign_start now.
4554 (gpgme_op_encrypt_sign): Add synchronous argument. Use
4555 _gpgme_wait_one instead gpgme_wait.
4556 * export.c (gpgme_op_export_start): Rename to ...
4557 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
4558 Use _gpgme_op_reset. Make function static.
4559 (gpgme_op_export_start): Just a wrapper around
4560 _gpgme_op_export_start now.
4561 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
4563 * genkey.c (gpgme_op_genkey_start): Rename to ...
4564 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
4565 Use _gpgme_op_reset. Make function static.
4566 (gpgme_op_genkey_start): Just a wrapper around
4567 _gpgme_op_genkey_start now.
4568 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
4570 * import.c (gpgme_op_import_start): Rename to ...
4571 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
4572 Use _gpgme_op_reset. Make function static.
4573 (gpgme_op_import_start): Just a wrapper around
4574 _gpgme_op_import_start now.
4575 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4577 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4578 (gpgme_op_keylist_ext_start): Likewise.
4579 * sign.c (gpgme_op_sign_start): Rename to ...
4580 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4581 _gpgme_op_reset. Make function static.
4582 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4584 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4586 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4587 * verify.c (gpgme_op_verify_start): Rename to ...
4588 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4589 Use _gpgme_op_reset. Make function static.
4590 (gpgme_op_verify_start): Just a wrapper around
4591 _gpgme_op_verify_start now.
4592 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4594 * engine-gpgsm.c (iocb_data_t): New type.
4595 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4596 and input_data with input_cb. Replace output_fd and output_data
4597 with output_cb. Replace message_fd and message_data with
4598 message_cb. New member io_cbs.
4599 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4601 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4602 callback, check if it should be unregistered. If all callbacks
4603 have been unregistered, trigger GPGME_EVENT_DONE.
4604 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4605 names to close the file descriptors.
4606 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4607 (_gpgme_gpgsm_op_encrypt): Likewise.
4608 (_gpgme_gpgsm_op_genkey): Likewise.
4609 (_gpgme_gpgsm_op_import): Likewise.
4610 (_gpgme_gpgsm_op_keylist): Likewise.
4611 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4612 (_gpgme_gpgsm_op_sign): Likewise.
4613 (_gpgme_gpgsm_op_verify): Likewise.
4614 (gpgsm_status_handler): Drop argument PID. Change return type to
4615 void. Close status pipe before returning because of EOF or error.
4616 (_gpgme_gpgsm_add_io_cb): New function.
4617 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4619 (_gpgme_gpgsm_set_io_cbs): New function.
4620 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4621 * engine.c (_gpgme_engine_set_io_cbs): New function.
4622 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4624 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4626 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4628 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4630 * key.c: Include <ctype.h>.
4631 (_gpgme_key_append_name): Skip one more char when
4632 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4633 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4635 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4637 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4638 * posix-sema.c: Use that prefix here.
4639 * posix-io.c: Include "ath.h".
4640 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4641 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4642 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4643 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4645 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4647 * Makefile.am (ath_components): New variable.
4648 (ath_components_pthread): Likewise.
4649 (ath_components_pth): Likewise.
4650 (system_components): Add ath_componentes.
4654 * ath-pthread.c: Likewise.
4655 * ath-pth.c: Likewise.
4656 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4658 * mutex.h: Remove file.
4660 2002-05-30 Werner Koch <wk@gnupg.org>
4662 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4663 an issuer with IDX > 0. We don't support altIssuerNames for now.
4665 2002-05-22 Werner Koch <wk@gnupg.org>
4667 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4668 missing variable definition. Oohh - Marcus was faster.
4670 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4672 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4674 2002-05-21 Werner Koch <wk@gnupg.org>
4676 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4677 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4679 2002-05-10 Werner Koch <wk@gnupg.org>
4681 * key.h (gpgme_key_s): Add OTRUST.
4682 * keylist.c (set_ownertrust): New.
4683 (keylist_colon_handler): Get the ownertrust value
4684 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4687 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4689 * w32-util.c: New static variable GET_PATH_LOCK.
4690 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4691 Take lock while determining path.
4692 (_gpgme_get_gpgsm_path): Likewise.
4693 * version.c (do_subsystem_inits): Set DONE to 1 after
4695 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4696 while determining engine info.
4697 * rungpg.c (_gpgme_gpg_get_version): New variable
4698 GPG_VERSION_LOCK. Take the lock while determining the program
4700 * posix-io.c: Include "sema.h".
4701 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4702 while fixing the signals.
4703 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4704 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4706 (capabilities_to_string): Make STRINGS very const.
4707 (_gpgme_key_cache_add): Lock the key cache.
4708 (_gpgme_key_cache_get): Likewise.
4709 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4710 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4711 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4713 * engine.c (_gpgme_engine_get_info): New variable
4714 ENGINE_INFO_LOCK. Take lock while determining engine info.
4715 * engine-gpgsm.c: Include "sema.h".
4716 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4717 lock while getting program version.
4719 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4721 * debug.h: New file.
4722 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4723 * util.h: Removed all prototypes and declarations related to
4724 debugging. Include "debug.h".
4726 * debug.c (debug_level): Comment variable and remove superfluous
4729 (_gpgme_debug_enabled): Function removed.
4730 (struct debug_control_s): Definition removed.
4731 (_gpgme_debug_level): Function removed.
4732 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4733 pritnf-style format specification and a variable number of
4735 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4736 starts out with "%s" for simplicity.
4737 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4738 TEXT argument anymore.
4740 * posix-io.c (_gpgme_io_select): Use new level argument for
4741 DEBUG_BEGIN instead explicit if construct.
4743 * debug.c (debug_init): Remove superfluous zero initializer,
4744 remove volatile flag of INITIALIZED. Do not use the
4745 double-checked locking algorithm, it is fundamentally flawed and
4746 will empty your fridge (on a more serious note, despite the
4747 volatile flag it doesn't give you the guarantee you would expect,
4748 for example on a DEC Alpha or an SMP machine. The volatile only
4749 serializes accesses to the volatile variable, but not to the other
4752 2002-05-03 Werner Koch <wk@gnupg.org>
4754 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
4755 output to /dev/null.
4757 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
4758 * gpgme.c (gpgme_get_protocol): New.
4760 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
4761 (gpgme_data_read): Ditto.
4763 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
4764 lines so that a claim can be made without looking up the key.
4765 (gpgme_get_sig_string_attr): New.
4766 (gpgme_get_sig_ulong_attr): New.
4768 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
4770 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
4771 list to align with the status.h file from gnupg.
4773 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
4774 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
4775 these new status codes. Store the expiration time
4777 2002-04-27 Werner Koch <wk@gnupg.org>
4779 * gpgme.h (GpgmeData_Encoding): New.
4780 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
4781 * engine-gpgsm.c (map_input_enc): New. Use it in all local
4782 functions where the INPUT command gets send.
4784 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
4786 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
4787 descriptor only when we don't need it anymore. Close the message
4788 descriptor if we don't need it.
4790 2002-04-26 Werner Koch <wk@gnupg.org>
4792 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
4794 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4796 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
4797 GPG->cmd.cb_data, not xfree.
4799 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4801 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
4802 ttytype, lc_ctype and lc_messages options in the server.
4804 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
4806 * engine-gpgsm.c (map_assuan_error): Add new error codes.
4808 2002-04-23 Werner Koch <wk@gnupg.org>
4810 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
4811 can_certify to return the requested values.
4813 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
4815 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
4817 (gpgme_get_passphrase_cb): Likewise.
4819 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
4821 * gpgme.c (gpgme_get_passphrase_cb): New function.
4822 (gpgme_get_progress_cb): New function.
4823 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
4824 gpgme_get_progress_cb.
4826 2002-03-28 Werner Koch <wk@gnupg.org>
4828 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
4829 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
4830 * keylist.c (keylist_colon_handler): Store them.
4831 * key.c (gpgme_key_release): Free them.
4832 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
4834 2002-03-26 Werner Koch <wk@gnupg.org>
4836 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
4838 2002-03-21 Werner Koch <wk@gnupg.org>
4840 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
4843 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
4845 * Makefile.am (system_components): New variable, set depending on
4847 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
4848 * syshdr.h: File removed.
4850 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
4851 * posix-sema.c: Likewise.
4852 * posix-util.c: Likewise.
4854 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
4855 * w32-sema.c: Likewise.
4856 * w32-util.c: Likewise.
4858 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
4859 * posix-sema.c: Likewise.
4860 * w32-io.c: Include `io.h', do not include `syshdr.h'
4861 * w32-sema.c: Likewise.
4862 * w32-util.c: Likewise.
4863 * data.c: Do not include `syshdr.h'.
4865 * wait.h: Code cleanup.
4867 * mutex.h: New file.
4868 * posix-sema.c: Implement.
4870 2002-03-08 Werner Koch <wk@gnupg.org>
4872 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
4874 2002-03-07 Werner Koch <wk@gnupg.org>
4876 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
4878 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
4880 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
4881 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
4882 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
4883 as status handler and run _gpgme_passphrase_start.
4884 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
4886 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
4889 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
4891 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4893 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
4894 error No_Passphrase if only a bad passphrase was provided.
4896 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4898 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
4899 GPGME_DATA_MODE_IN, construct a command line that stores the
4901 * verify.c (gpgme_op_verify_start): Accept TEXT being
4902 uninitialized, and in this case interpret SIG as a normal or
4903 cleartext signature and TEXT as a return data object.
4904 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
4906 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4908 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
4911 2002-02-28 Werner Koch <wk@gnupg.org>
4913 * key.h (subkey_s): New member expires_at.
4914 * keylist.c (keylist_colon_handler): Set it here
4915 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
4917 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4919 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
4920 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
4921 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
4922 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
4923 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
4924 * engine.c (_gpgme_engine_op_keylist_ext): New function.
4925 * keylist.c (gpgme_op_keylist_ext_start): New function.
4927 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4929 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
4930 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
4931 rename no_recipients to no_valid_recipients.
4932 (_gpgme_encrypt_status_handler): Include error for invalid
4934 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
4935 argument to GpgsmObject. Use that to report back the status about
4938 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
4940 * verify.c (_gpgme_verify_status_handler): Fix the last change.
4942 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4944 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
4945 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
4946 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
4947 (_gpgme_gpg_op_sign): Use that new function.
4948 (_gpgme_gpg_op_encrypt_sign): New function.
4949 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
4950 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
4951 (gpgme_op_encrypt_sign): Likewise.
4952 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
4953 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
4954 (_gpgme_sign_status_handler): Add prototype.
4955 * sign.c (sign_status_handler): Rename to ...
4956 (_gpgme_sign_status_handler): ... this and make non-static.
4957 * encrypt.c (encrypt_status_handler): Rename to ...
4958 (_gpgme_encrypt_status_handler): ... this and make non-static.
4959 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
4960 * sign.c (gpgme_op_sign_start): Likewise.
4962 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4964 * verify.c (_gpgme_verify_status_handler): Parse the args line to
4965 see if the problem is due to a missing key, and report that back
4968 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4970 * context.h (struct gpgme_context_s): New member include_certs.
4971 * gpgme.h (gpgme_set_include_certs): Add prototype.
4972 (gpgme_get_include_certs): Likewise.
4973 * gpgme.c (gpgme_set_include_certs): New function.
4974 (gpgme_get_include_certs): Likewise.
4975 (gpgme_new): Set include_certs to 1 (the default).
4976 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
4977 and pass it to _gpgme_gpgsm_op_sign.
4978 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
4979 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
4980 include_certs and handle it.
4981 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
4982 * sign.c (gpgme_op_sign_start): Add new argument to
4983 _gpgme_engine_op_sign call.
4985 2002-02-14 Werner Koch <wk@gnupg.org>
4987 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
4989 2002-02-13 Werner Koch <wk@gnupg.org>
4991 * vasprintf.c, fopencookie.c: Add replacement functions.
4992 * util.h: Add prototypes for them.
4994 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
4996 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
4997 reach the end of the function.
4999 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
5001 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5002 (gpgme_op_genkey_start): Skip newlines after opening tag.
5004 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5006 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
5008 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5009 set, and pass them down to the crypto engine.
5010 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5011 * engine.h: Likewise.
5012 * rungpg.h (_gpgme_gpg_spawn): Likewise.
5013 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
5015 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
5017 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
5020 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5022 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5024 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5027 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5029 * wait.c (gpgme_wait): Add new argument STATUS, in which the
5030 status of the returned context is returned.
5031 (_gpgme_wait_on_condition): Rework the function a bit, to make it
5032 aware of cancelled processes, and to allow to use gpgme_wait with
5033 CTX being NULL (as documented in the source).
5034 (struct proc_s): New member REPORTED.
5035 * gpgme.h: Fix prototype.
5036 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5037 * sign.c (gpgme_op_sign): Likewise.
5038 * import.c (gpgme_op_import): Likewise.
5039 * genkey.c (gpgme_op_genkey): Likewise.
5040 * export.c (gpgme_op_export): Likewise.
5041 * encrypt.c (gpgme_op_encrypt): Likewise.
5042 * delete.c (gpgme_op_delete): Likewise.
5043 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5045 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
5047 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5049 (gpgme_get_keylist_mode): New function.
5050 (gpgme_new): Set the default for keylist_mode member of CTX.
5052 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5053 (gpgme_get_keylist_mode): New prototype.
5054 (GPGME_KEYLIST_MODE_LOCAL): New macro.
5055 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5057 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
5059 This patch has gotten a bit large... mmh. The main thing that
5060 happens here is that error values are now not determined in the
5061 operation function after gpgme_wait completed, but in the status
5062 handler when EOF is received. It should always be the case that
5063 either an error is flagged or EOF is received, so that after a
5064 gpgme_wait you should never have the situation that no error is
5065 flagged and EOF is not received. One problem is that the engine
5066 status handlers don't have access to the context, a horrible
5067 kludge works around this for now. All errors that happen during a
5068 pending operation should be catched and reported in ctx->error,
5069 including out-of-core and cancellation. This rounds up neatly a
5070 couple of loose ends, and makes it possible to pass up any errors
5071 in the communication with the backend as well. As a bonus, there
5072 will be a function to access gpgme->wait, so that the operations
5073 can truly be implemented with their _start function.
5075 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5076 error back to the context.
5077 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5079 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5081 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5082 to a value indication that.
5084 * verify.c (add_notation): Set error, not out_of_core.
5085 (finish_sig): Likewise.
5086 (gpgme_op_verify_start): Don't clear out_of_core.
5087 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5088 (gpgme_op_verify): And don't do it here.
5090 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5091 (gpgme_op_trustlist_start): Don't clear out_of_core.
5092 (gpgme_op_trustlist_next): Check error, not out_of_core.
5093 (gpgme_op_trustlist_end): Likewise.
5095 * ops.h (test_and_allocate_result): New macro.
5096 (_gpgme_passphrase_result): Remove prototype.
5097 * delete.c (gpgme_op_delete): Return error from context.
5098 (delete_status_handler): Use macro test_and_allocate_result.
5099 Perform error checking at EOF.
5100 (gpgme_op_delete_start): Release result.
5101 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5102 test_and_allocate_result, and perform error checking here.
5103 (_gpgme_passphrase_result): Function removed.
5104 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5105 (gpgme_op_sign): Just return the error value from the context.
5106 (sign_status_handler): Only progress if no error is set yet. If
5107 we process an EOF, set the resulting error value (if any).
5108 * decrypt.c (_gpgme_decrypt_result): Function removed.
5109 (create_result_struct): Function removed.
5110 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5111 caclulate error on EOF, do not progress with errors.
5112 (_gpgme_decrypt_start): Do not set out_of_core to zero.
5113 (gpgme_op_decrypt): Just return the error value from the context.
5114 * encrypt.c (encrypt_status_handler): Perform the error checking
5116 (gpgme_op_encrypt_start): Do not clear out_of_core.
5117 * export.c (export_status_handler): Return if error is set in context.
5118 (gpgme_op_export_start): Release result.
5119 (gpgme_op_export): Return error from context.
5120 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5122 * genkey.c (genkey_status_handler): Use macro
5123 test_and_allocate_result. Perform error checking at EOF.
5124 (gpgme_op_genkey): Just return the error from context.
5125 * import.c (gpgme_op_import): Return the error from context.
5126 (import_status_handler): Use macro test_and_allocate_result.
5127 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5128 (gpgme_op_keylist_next): Return error of context.
5129 (keylist_colon_handler): Set error instead out_of_code.
5130 (finish_key): Likewise.
5132 * context.h: Remove member out_of_core, add member error.
5133 * gpgme.c (_gpgme_release_result): Clear error flag.
5135 * engine.h (_gpgme_engine_get_error): New prototype.
5136 * engine.c (_gpgme_engine_get_error): New function.
5137 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5139 * engine-gpgsm.c (map_assuan_error): New function.
5140 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5141 use the new function to map error values.
5142 (gpgsm_set_fd): Change return type tp GpgmeError.
5143 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5144 (gpgsm_set_recipients): Likewise. Change type of return value
5145 equivalently. Adjust error values.
5146 (_gpgme_gpgsm_op_import): Likewise.
5147 (_gpgme_gpgsm_op_sign): Likewise.
5148 (struct gpgsm_object_s): New member error.
5149 (gpgsm_status_handler): Set error if error occurs. Determine
5150 error number from ERR line received. If assuan_read_line fails,
5151 terminate the connection.
5153 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5155 * Makefile.am (MOSTLYCLEANFILES): New variable.
5157 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
5159 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5160 connection to the server.
5162 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
5164 * rungpg.h: Add STATUS_KEY_CREATED.
5166 * progress.c: New file.
5167 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5169 * genkey.c (genkey_status_handler): Use
5170 _gpgme_progress_status_handler. Add check for status.
5171 (struct genkey_result_s): New structure.
5172 (_gpgme_release_genkey_result): New function.
5173 (gpgme_op_genkey): Check for error.
5174 * gpgme.c (_gpgme_release_result): Call
5175 _gpgme_release_genkey_result.
5176 * ops.h (_gpgme_release_genkey_result): Add prototype.
5177 * types.h (GenKeyResult): New type.
5178 * context.h (gpgme_context_s): Add GenKeyResult to member result.
5180 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5182 * gpgme.c (_gpgme_release_result): Call
5183 _gpgme_release_delete_result.
5184 * ops.h (_gpgme_release_delete_result): Add prototype.
5185 * types.h (DeleteResult): New type.
5186 * context.h (gpgme_context_s): Add DeleteResult to member result.
5188 * delete.c (enum delete_problem): New type.
5189 (struct delete_result_s): New structure.
5190 (_gpgme_release_delete_result): New function.
5191 (delete_status_handler): Implement more status codes.
5192 (gpgme_op_delete): Return error on failure.
5194 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5196 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5198 * import.c (struct import_result_s): New structure.
5199 (_gpgme_release_import_result): New function.
5200 (append_xml_impinfo): Likewise.
5201 (import_status_handler): Implement.
5202 * gpgme.c (_gpgme_release_result): Add call to
5203 _gpgme_release_import_result.
5204 * ops.h (_gpgme_release_import_result): Add prototype.
5205 * types.h (ImportResult): New type.
5206 * context.h (gpgme_context_s): Add ImportResult to member result.
5208 * encrypt.c (gpgme_op_encrypt): Code clean up.
5210 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
5212 * gpgme.h: Add lots of comment and fix the formatting. Add
5213 gpgme_trustlist_end prototype.
5215 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
5217 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
5218 gpgme_register_idle to return and accept this type.
5219 * wait.c (gpgme_register_idle): Fix type.
5220 Save and return old value of idle_function.
5222 2002-01-29 Werner Koch <wk@gnupg.org>
5224 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5226 * keylist.c (keylist_colon_handler): Add support for the new "crs"
5229 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5231 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5232 not assuan_pipe_disconnect.
5234 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5235 jnlib (needed by assuan) statically into libgpgme. Linking a
5236 static library into a shared library this way is not portable.
5238 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5240 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5243 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5245 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5246 from off_t to size_t.
5247 * gpgme.h: Likewise.
5249 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5251 * wait.c (_gpgme_wait_on_condition): If the process finished,
5252 reset the pending flag. Also if the operation was cancelled.
5254 (struct proc_s): Rename READY to DONE.
5255 (wait_item_s): Likewise.
5256 (set_process_ready): Rename to ...
5257 (set_process_done): ... this.
5258 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5259 instead set_process_ready.
5260 (_gpgme_wait_on_condition): Likewise.
5261 (do_select): Rename READY to DONE.
5263 * verify.c (gpgme_op_verify): Do not set pending to zero here.
5264 * sign.c (gpgme_op_sign): Likewise.
5265 * import.c (gpgme_op_import): Likewise.
5266 * genkey.c (gpgme_op_genkey): Likewise.
5267 * export.c (gpgme_op_export): Likewise.
5268 * encrypt.c (gpgme_op_encrypt): Likewise.
5269 * delete.c (gpgme_op_delete): Likewise.
5270 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5271 * decrypt.c (gpgme_op_decrypt): Likewise.
5273 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
5275 * export.c: Cleanup.
5277 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
5279 * trustlist.c: Various source clean ups.
5280 (my_isdigit): Removed.
5281 (gpgme_op_trustlist_end): New function.
5283 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
5285 * gpgme.c: Various source clean ups, like renaming C to CTX where
5287 (gpgme_new): Clear R_CTX before starting the work.
5288 (my_isdigit): Removed.
5289 (my_isxdigit): Likewise.
5291 * data.c: Various source clean ups.
5292 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5293 (gpgme_data_new_with_read_cb): Similar for READ_CB.
5294 (gpgme_data_new_from_file): Loop over fread while EINTR.
5295 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
5296 be zero. Loop over fread while EINTR.
5298 (my_isdigit): Removed.
5299 (my_isxdigit): Likewise.
5301 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
5303 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5304 Pipe_Error where appropriate.
5306 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5308 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
5310 * version.c (get_engine_info): Remove prototype.
5312 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
5314 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5315 Fill it with the servers fds, and pass it to assuan_pipe_connect.
5317 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5319 * keylist.c (gpgme_op_keylist_end): New function.
5320 * gpgme.h (gpgme_op_keylist_end): New prototype.
5322 * engine.h (gpgme_engine_check_version): Move prototype to ...
5323 * gpgme.h (gpgme_engine_check_version): ... here.
5325 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5327 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5329 * version.c (gpgme_get_engine_info): Reimplemented.
5330 (gpgme_check_engine): Reimplemented.
5331 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5333 * engine.c: Include `io.h'.
5334 (gpgme_engine_get_info): New function.
5335 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5338 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5340 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5341 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5342 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5344 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5345 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5346 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5347 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5348 own function by call to _gpgme_engine_add_child_to_reap_list().
5350 * wait.c: Include `engine.h'.
5351 (run_idle): Call _gpgme_engine_housecleaning(), not
5352 _gpgme_gpg_housecleaning().
5354 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
5356 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5357 Initialize the next field of the uid structure.
5358 (gpgme_key_get_as_xml): Do not list last uid first.
5360 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
5362 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5363 function [!ENABLE_GPGSM].
5365 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5367 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5368 message_data, not SIG.
5369 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5371 * sign.c (sign_status_handler): Call
5372 _gpgme_passphrase_status_handler early.
5374 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5376 * engine-gpgsm.c: Revert last change.
5378 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5380 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5381 handler when ending this operation, otherwise the wait function
5384 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
5386 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5387 (_gpgme_gpgsm_new): Initialize some more members.
5388 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5389 (gpgsm_status_handler): Rework the inline-data processing.
5391 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5393 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5394 list that are not dup'ed, for those the close-on-exec flag is set
5396 * version.c (_gpgme_get_program_version): Remove first entry in
5397 CFD, as the close-on-exec flag is now set for this fd.
5399 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5401 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5402 option to `ENCRYPT'.
5403 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
5406 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
5408 * engine-gpgsm.c (close_notify_handler): New function.
5409 (_gpgme_gpgsm_new): Manage the file descriptors a
5410 bit differently. Do not set close-on-exec flags.
5411 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
5412 to -1, this is done by the close handler.
5413 (_gpgme_gpgsm_op_encrypt): Likewise.
5414 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
5415 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
5416 (_gpgme_gpgsm_op_sign): Likewise.
5417 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
5419 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
5420 non-inherited file descriptor index of the pipe.
5422 2001-12-13 Werner Koch <wk@gnupg.org>
5424 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
5425 (gpgsm_status_handler): Pass datalines to a colon handler
5426 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
5429 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
5431 (gpgsm_assuan_simple_command): Removed underscore from
5433 (_gpgme_gpgsm_start): Ditto.
5434 (gpgsm_assuan_simple_command): Replaced interal Assuan read
5435 function by the new assuan_read_line. Removed the use of the
5437 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
5438 (_gpgme_gpgsm_start): Use the documented way to get an fd from
5441 * keylist.c (keylist_colon_handler): Handle "crt" records
5442 * key.h (gpgme_key_s): Add an x509 flag.
5443 * key.c (parse_x509_user_id): New.
5444 (_gpgme_key_append_name): Handle x.509 names.
5446 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5448 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
5451 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5453 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
5454 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
5456 (_gpgme_gpgsm_op_sign): Likewise.
5458 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
5460 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
5463 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
5465 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
5467 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
5469 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
5470 Deal with assuan read line returning more than one line (for now).
5472 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5474 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
5475 the current protocol definition.
5477 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
5479 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
5482 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5484 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
5485 for now, rungpg.h and status-table.h.
5486 (gpgsm_status_handler): Implement more of the status handler.
5488 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5490 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
5491 (_gpgme_engine_op_delete): Likewise.
5492 (_gpgme_engine_op_encrypt): Likewise.
5493 (_gpgme_engine_op_export): Likewise.
5494 (_gpgme_engine_op_genkey): Likewise.
5495 (_gpgme_engine_op_keylist): Likewise.
5496 (_gpgme_engine_op_sign): Likewise.
5497 (_gpgme_engine_op_trustlist): Likewise.
5499 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
5500 (gpgsm_assuan_simple_command): Likewise.
5501 (gpgsm_set_recipients): Likewise.
5502 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
5503 (_gpgme_gpgsm_op_delete): New function.
5504 (_gpgme_gpgsm_op_export): Likewise.
5505 (_gpgme_gpgsm_op_genkey): Likewise.
5506 (_gpgme_gpgsm_op_sign): Likewise.
5507 (_gpgme_gpgsm_op_keylist): Likewise.
5508 (_gpgme_gpgsm_op_trustlist): Likewise.
5509 (_gpgme_gpgsm_release): Release command.
5510 (_gpgme_gpgsm_op_decrypt): Allocate command.
5511 (_gpgme_gpgsm_op_import): Likewise.
5512 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
5514 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5516 * gpgme.h (gpgme_set_protocol): New prototype.
5518 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5520 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
5521 (_gpgme_gpgsm_op_import): Likewise.
5523 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5525 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
5527 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
5529 2001-11-22 Werner Koch <wk@gnupg.org>
5531 * engine-gpgsm.c: Include more headers so that NULL and mk_error
5532 is defined even with an undefined GPGSM_PATH.
5534 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
5536 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
5537 gpg_outbound_handler): Moved to ...
5538 * data.c (_gpgme_data_inbound_handler, write_mem_data,
5539 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
5540 _gpgme_* ones non-static.
5541 * data.c: Include io.h.
5543 * ops.h (_gpgme_data_inbound_handler): New prototype.
5544 (_gpgme_data_outbound_handler): Likewise.
5545 (_gpgme_gpg_spawn): Use these new functions.
5547 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
5548 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
5549 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
5550 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
5551 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
5552 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
5553 Include <rungpg.h> for status handler function.
5555 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
5556 input_data, output_fd, output_data, message_fd, message_data, command
5558 (_gpgme_gpgsm_new): Open input, output and message pipes before
5559 connecting to the client. Close server's ends afterwards.
5560 (_gpgme_gpgsm_release): Close open file descriptors. Remove
5561 server process from wait queue.
5562 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
5563 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
5565 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
5566 (_gpgme_engine_set_status_handler): Likewise.
5567 (_gpgme_engine_op_verify): Likewise.
5569 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
5571 * context.h: Do not include rungpg.h, but engine.h.
5572 (struct gpgme_context_s): Replace member gpg with engine.
5573 * gpgme.c (gpgme_release): Release engine, not gpg.
5575 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5577 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5578 Make static, change order of arguments, and return an error value.
5579 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5581 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5582 (_gpgme_gpg_op_encrypt): Likewise.
5583 (_gpgme_gpg_op_decrypt): Likewise.
5584 (_gpgme_gpg_op_delete): Likewise.
5585 (_gpgme_gpg_op_export): Likewise.
5586 (_gpgme_gpg_op_genkey): Likewise.
5587 (_gpgme_gpg_op_import): Likewise.
5588 (_gpgme_gpg_op_keylist): Likewise.
5589 (_gpgme_gpg_op_sign): Likewise.
5590 (_gpgme_gpg_op_trustlist): Likewise.
5591 * rungpg.c (_gpgme_gpg_op_verify): New function.
5592 (_gpgme_gpg_op_encrypt): Likewise.
5593 (_gpgme_gpg_op_decrypt): Likewise.
5594 (_gpgme_gpg_op_delete): Likewise.
5595 (_gpgme_gpg_op_export): Likewise.
5596 (_gpgme_gpg_op_genkey): Likewise.
5597 (_gpgme_gpg_op_import): Likewise.
5598 (_gpgme_gpg_op_keylist): Likewise.
5599 (_gpgme_gpg_op_sign): Likewise.
5600 (_gpgme_gpg_op_trustlist): Likewise.
5602 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5603 (_gpgme_engine_set_command_handler): Likewise.
5604 (_gpgme_engine_set_colon_line_handler): Likewise.
5605 (_gpgme_engine_op_decrypt): Likewise.
5606 (_gpgme_engine_op_delete): Likewise.
5607 (_gpgme_engine_op_encrypt): Likewise.
5608 (_gpgme_engine_op_export): Likewise.
5609 (_gpgme_engine_op_genkey): Likewise.
5610 (_gpgme_engine_op_import): Likewise.
5611 (_gpgme_engine_op_keylist): Likewise.
5612 (_gpgme_engine_op_sign): Likewise.
5613 (_gpgme_engine_op_trustlist): Likewise.
5614 (_gpgme_engine_op_verify): Likewise.
5615 (_gpgme_engine_start): Likewise.
5616 * engine.c (_gpgme_engine_set_status_handler): New function.
5617 (_gpgme_engine_set_command_handler): Likewise.
5618 (_gpgme_engine_set_colon_line_handler): Likewise.
5619 (_gpgme_engine_op_decrypt): Likewise.
5620 (_gpgme_engine_op_delete): Likewise.
5621 (_gpgme_engine_op_encrypt): Likewise.
5622 (_gpgme_engine_op_export): Likewise.
5623 (_gpgme_engine_op_genkey): Likewise.
5624 (_gpgme_engine_op_import): Likewise.
5625 (_gpgme_engine_op_keylist): Likewise.
5626 (_gpgme_engine_op_sign): Likewise.
5627 (_gpgme_engine_op_trustlist): Likewise.
5628 (_gpgme_engine_op_verify): Likewise.
5629 (_gpgme_engine_start): Likewise.
5631 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5633 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5634 * decrypt.c (_gpgme_decrypt_start): Likewise.
5635 * passphrase.c (_gpgme_passphrase_start): Likewise.
5636 * keylist.c (gpgme_op_keylist_start): Likewise.
5638 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5640 * types.h: Add types EngineObject and GpgsmObject.
5642 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5643 engine-gpgsm.c, engine.h and engine.c.
5644 * engine.h: New file.
5645 * engine.c: Likewise.
5646 * engine-gpgsm.h: Likewise.
5647 * engine-gpgsm.c: Likewise.
5649 * rungpg.c (_gpgme_gpg_get_version): New function.
5650 (_gpgme_gpg_check_version): Likewise.
5651 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5652 _gpgme_gpg_check_version.
5654 * version.c (compare_versions): Rename to ...
5655 (_gpgme_compare_versions): ... this. Make non-static.
5656 (gpgme_check_version): Use _gpgme_compare_versions rather than
5658 (gpgme_check_engine): Likewise.
5659 * ops.h (_gpgme_get_program_version): Add prototype.
5661 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5663 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5664 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5665 (libgpgme_la_LIBADD): Likewise.
5667 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5669 * version.c: Remove global variables lineno and
5671 (version_handler): Removed.
5672 (_gpgme_get_program_version): New function.
5673 (get_engine_info): Don't use context and version_handler,
5674 but _gpgme_get_program_version.
5675 * ops.h (_gpgme_get_program_version): Add prototype for
5676 _gpgme_get_program_version (we expect to use it elsewhere soon).
5678 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5680 * version.c (get_engine_info): If GnuPG is not available, return
5682 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5684 (_gpgme_get_gpgsm_path): New function.
5685 * w32-util.c (find_program_in_registry): New static function.
5686 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5687 to use find_program_in_registry.
5688 (_gpgme_get_gpgsm_path): New function.
5689 (util.h): Prototype _gpgme_get_gpgsm_path).
5690 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5693 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5695 * decrypt-verify.c: New file.
5696 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5697 * types.h: Add decrypt-verify types.
5699 * context.h: Add result type for decrypt-verify.
5700 * gpgme.h: Add decrypt-verify prototypes.
5702 * decrypt.c (decrypt_status_handler): Renamed to ...
5703 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5704 (_gpgme_decrypt_start): New function, derived from
5705 gpgme_op_decrypt_start.
5706 (gpgme_op_decrypt_start): Reimplement in terms of
5707 _gpgme_decrypt_start.
5708 (_gpgme_decrypt_result): New function to retrieve error value.
5709 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5710 * ops.h: Add prototypes for new functions.
5712 * verify.c (verify_status_handler): Renamed to ...
5713 (_gpgme_verify_status_handler): ... this. Make non-static.
5714 (gpgme_op_verify_start): Use new function name.
5715 (intersect_stati): Renamed to ...
5716 (_gpgme_intersect_stati): ... this. Make non-static.
5717 (gpgme_op_verify): Use new name.
5718 * ops.h: Add prototypes for new functions.
5720 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5722 * passphrase.c: New file.
5723 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5724 * ops.h (_gpgme_passphrase_result): Add prototypes from
5726 * types.h: Likewise.
5727 * context.h: Add member passphrase to result.
5728 * gpgme.c (_gpgme_release_result): Release passphrase member.
5730 * decrypt.c: Some formatting and variable name changes (like
5732 (struct decrypt_result_s): Remove members now found in
5734 (_gpgme_release_decrypt_result): Don't release removed members.
5735 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5736 and don't handle the cases catched there.
5737 (command_handler): Removed.
5738 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5739 _gpgme_passphrase_start which does it.
5740 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
5741 cases covered by it.
5743 * sign.c Some formatting and variable name changes (like
5745 (struct sign_result_s): Remove members now found in
5747 (_gpgme_release_sign_result): Don't release removed members.
5748 (sign_status_handler): Call _gpgme_passphrase_status_handler,
5749 and don't handle the cases catched there.
5750 (command_handler): Removed.
5751 (gpgme_op_sign_start): Don't set command handler, but invoke
5752 _gpgme_passphrase_start which does it.
5753 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
5754 cases covered by it.
5756 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5758 * decrypt.c (command_handler): Fix last change.
5760 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5762 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
5763 Rename R2 to NEXT_RESULT.
5764 (intersect_stati): Rename RES to RESULT.
5765 (gpgme_get_sig_status): Likewise. Do not check return_type, but
5766 the member verify of result.
5767 (gpgme_get_sig_key): Likewise.
5769 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
5770 RESULT is zero, return.
5771 (sign_status_handler, command_handler): Do not check return_type,
5772 but the member sign of result.
5773 (gpgme_op_sign): Likewise. Drop assertion.
5775 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
5776 If RESULT is zero, return.
5777 (encrypt_status_handler): Do not check return_type, but the member
5779 (gpgme_op_encrypt): Likewise. Drop assertion.
5781 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
5782 (create_result_struct): Do not set result_type.
5783 (command_handler, decrypt_status_handler): Do not check
5784 return_type, but the member decrypt of result.
5785 (gpgme_op_decrypt): Likewise. Drop assertion.
5787 * context.h (enum ResultType): Removed.
5788 (struct gpgme_context_s): Remove member result_type.
5789 (struct result): Replaces union result.
5790 * gpgme.c: Include string.h.
5791 (_gpgme_release_result): Release all members of c->result, which
5792 is now a struct. Zero out all members of the struct afterwards.
5794 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
5796 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
5797 Release all members of the list GPG->arglist.
5798 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
5800 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
5802 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
5804 * key.c: Include string.h.
5806 * recipient.c: Likewise.
5808 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
5810 * context.h: New member signers_len.
5811 * signers.c (gpgme_signers_clear): Require that signers are
5812 non-NULL with assertion. Use signers_len to determine how much
5813 keys to release. Add documentation.
5814 (gpgme_signers_add): Use signers_len to determine if the buffer is
5815 large enough. Use xtryrealloc rather than xtrymalloc and copying.
5817 (gpgme_signers_enum): Use signers_len to determine if key is
5818 available. Add documentation.
5820 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
5822 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
5823 ALLOC_CHUNK, not DH->length.
5825 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
5827 * gpgme.c (gpgme_set_protocol): Fix last change.
5829 2001-10-15 Werner Koch <wk@gnupg.org>
5831 * gpgme.h (GpgmeProtocol): New.
5832 * gpgme.c (gpgme_set_protocol): New.
5834 2001-09-26 Werner Koch <wk@gnupg.org>
5836 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
5837 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
5839 2001-09-17 Werner Koch <wk@gnupg.org>
5841 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
5842 callers to use this function without a check for tmp_key.
5844 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
5845 emptying the queue. Bug reported by Stéphane Corthésy.
5847 2001-09-12 Werner Koch <wk@gnupg.org>
5849 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
5851 2001-09-07 Werner Koch <wk@gnupg.org>
5853 * rungpg.h: Add NO_RECP.
5854 * encrypt.c (encrypt_status_handler): Take on No_RECP.
5855 (gpgme_op_encrypt): Better error return.
5857 * verify.c (verify_status_handler): Take on NODATA.
5859 2001-09-03 Werner Koch <wk@gnupg.org>
5861 * rungpg.h: Added STATUS_INV_RECP.
5862 * gpgme.c (_gpgme_release_result): Add support for new
5863 EncryptResult object.
5864 * encrypt.c (append_xml_encinfo): New.
5865 (encrypt_status_handler): Add some status parsing.
5866 (_gpgme_release_encrypt_result): New.
5868 2001-08-29 Werner Koch <wk@gnupg.org>
5870 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
5872 * keylist.c (keylist_colon_handler): Do a finish key if we receive
5873 an EOF here. This is probably the reason for a lot of bugs
5874 related to keylisting. It is so obvious. Kudos to Enno Cramer
5875 for pointing that out.
5877 2001-08-28 Werner Koch <wk@gnupg.org>
5879 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
5880 (_gpgme_set_op_info): New.
5881 (_gpgme_release_result): Reset the op_info here.
5882 * sign.c (append_xml_siginfo): New.
5883 (sign_status_handler): Store the sig create information.
5885 2001-07-31 Werner Koch <wk@gnupg.org>
5887 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
5889 2001-07-30 Werner Koch <wk@gnupg.org>
5891 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
5893 * rungpg.c (build_argv): Disable armor comments
5894 * w32-io.c (build_commandline): Need to add quotes here
5896 2001-07-24 Werner Koch <wk@gnupg.org>
5898 * data.c (gpgme_data_read): Add a a way to return the available bytes.
5900 2001-07-23 Werner Koch <wk@gnupg.org>
5902 * util.c: Removed stpcpy() because we use the version from jnlib.
5904 2001-07-19 Werner Koch <wk@gnupg.org>
5906 * mkstatus: Define the collating sequence for sort.
5908 2001-06-26 Werner Koch <wk@gnupg.org>
5910 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
5912 2001-06-15 Werner Koch <wk@gnupg.org>
5914 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
5915 to Timo for pointing this out.
5917 2001-06-01 Werner Koch <wk@gnupg.org>
5919 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
5922 2001-05-28 Werner Koch <wk@gnupg.org>
5924 * version.c (gpgme_check_engine): Stop version number parsing at
5925 the opening angle and not the closing one. By Tommy Reynolds.
5927 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
5929 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
5930 line, because it gave an error if another operation had been made
5931 before using the same context.
5933 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
5934 one line to release the gpg object in the context (if any).
5936 2001-04-26 Werner Koch <wk@gnupg.org>
5938 * key.c, key.h (_gpgme_key_cache_init): New.
5939 (_gpgme_key_cache_add): New.
5940 (_gpgme_key_cache_get): New.
5941 * version.c (do_subsystem_inits): Init the cache.
5942 * keylist.c (finish_key): Put key into the cache
5943 * verify.c (gpgme_get_sig_key): First look into the cache.
5945 2001-04-19 Werner Koch <wk@gnupg.org>
5947 * keylist.c (parse_timestamp): Adjusted for the changed
5948 --fixed-list-mode of gpg 1.0.4h.
5950 2001-04-05 Werner Koch <wk@gnupg.org>
5952 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
5954 2001-04-04 Werner Koch <wk@gnupg.org>
5956 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
5957 are still bytes pending. Timo found this not easy to track down
5960 2001-04-02 Werner Koch <wk@gnupg.org>
5962 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
5963 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
5965 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
5966 the mode set in the current context. Suggested by Timo.
5968 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
5969 can_encrypt. By Timo.
5971 2001-03-30 Werner Koch <wk@gnupg.org>
5973 * debug.c (debug_init): Allow to specify a debug file.
5974 (_gpgme_debug_level): New.
5976 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
5977 (_gpgme_io_select): Debug only with level > 2.
5979 2001-03-15 Werner Koch <wk@gnupg.org>
5981 * rungpg.c: Included time.h.
5983 * key.h: New keyflags for capabilities.
5984 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
5985 (keylist_colon_handler): Parse them.
5986 * gpgme.h: New attribute values for capabilties.
5987 * key.c (gpgme_key_get_string_attr): Return them.
5988 (capabilities_to_string): New.
5989 (gpgme_key_get_ulong_attr): Return the global caps.
5991 2001-03-14 Werner Koch <wk@gnupg.org>
5993 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
5994 Thanks to Jan Oliver Wagner.
5996 2001-03-13 Werner Koch <wk@gnupg.org>
5998 * context.h: Add invalid and revoke flags to user_id structure.
5999 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6000 (keylist_colon_handler): Adjust for that.
6001 (set_userid_flags): New.
6002 (set_mainkey_trust_info): Handle new key invalid flag
6003 (set_subkey_trust_info): Ditto.
6004 * gpgme.h: Add new attributes for key and user ID flags.
6005 * key.c (_gpgme_key_append_name): Init these flags
6006 (gpgme_key_get_as_xml): Print them.
6007 (one_uid_as_xml): New helper for above.
6008 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6009 Return the new attributes. Enhanced, so that subkey information
6010 can be returned now.
6012 2001-02-28 Werner Koch <wk@gnupg.org>
6014 * w32-io.c (destroy_reader): Set stop_me flag.
6015 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6016 (_gpgme_io_write): Use a writer thread to avaoid blocking.
6017 (_gpgme_io_close): Cleanup a writer thread
6018 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6019 waiting which is now possible due to the use of a writer thread.
6021 2001-02-20 Werner Koch <wk@gnupg.org>
6023 * w32-io.c (destroy_reader,kill_reader): New.
6024 (create_reader, reader): Add a new event to stop the thread.
6025 (_gpgme_io_close): Kill the reader thread.
6027 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
6028 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6030 * wait.c: Reworked the whole thing.
6031 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6032 (_gpgme_gpg_release): Remove the process from the wait queue.
6034 2001-02-19 Werner Koch <wk@gnupg.org>
6036 * w32-io.c (_gpgme_io_set_close_notify): New.
6037 (_gpgme_io_close): Do the notification.
6039 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6042 * wait.c (remove_process): Don't close the fd here.
6043 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6044 (_gpgme_wait_on_condition): Remove the assert on the queue and
6045 break out if we could not find the queue. The whole thing should
6048 * posix-io.c (_gpgme_io_set_close_notify): New.
6049 (_gpgme_io_close): Do the notification.
6051 * rungpg.c (close_notify_handler): New.
6052 (_gpgme_gpg_new): Register a callback for the fd.
6053 (_gpgme_gpg_set_colon_line_handler): Ditto.
6056 2001-02-13 Werner Koch <wk@gnupg.org>
6058 * rungpg.c (struct reap_s): Replaced pid_t by int.
6060 * types.h: Add ulong typedef.
6062 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6063 (_gpgme_gpg_release): Reap children.
6064 * io.h, posix-io.c (_gpgme_io_kill): New.
6065 * w32-io.c (_gpgme_io_kill): New (dummy).
6067 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6069 * posix-io.c (_gpgme_io_read): Add some debug output.
6070 (_gpgme_io_write): Ditto.
6071 (_gpgme_io_select): Increased the timeout.
6073 2001-02-12 Werner Koch <wk@gnupg.org>
6075 Enhanced the signature verification, so that it can how handle
6076 more than one signature and is able to return more information on
6078 * verify.c (gpgme_get_sig_key): New.
6079 (gpgme_get_sig_status): New.
6081 * gpgme.h: Add stdio.h.
6082 (GpgmeSigStat): New status DIFF.
6084 2001-02-01 Werner Koch <wk@gnupg.org>
6086 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
6087 code to all Set/ResetEvent().
6089 * rungpg.c (read_status): Check for end of stream only if we have
6092 2001-01-31 Werner Koch <wk@gnupg.org>
6094 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6095 (propagate_term_results,clear_active_fds): Removed.
6096 (count_active_fds): Renamed to ..
6097 (count_active_and_thawed_fds): .. this and count only thawed fds.
6099 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6102 2001-01-30 Werner Koch <wk@gnupg.org>
6104 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6106 * version.c (get_engine_info): Return better error information.
6108 * posix-util.c, w32-util.c: New.
6109 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6110 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6112 * signers.c (gpgme_signers_add): Ooops, one should test code and
6113 not just write it; the newarr was not assigned. Thanks to José
6114 for pointing this out. Hmmm, still not tested, why should a coder
6117 * w32-io.c: Does now use reader threads, so that we can use
6118 WaitForMultipleObjects.
6119 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6120 Does currently only work for W32.
6122 * debug.c, util.h : New. Changed all fprintfs to use this new
6123 set of debugging functions.
6125 2001-01-23 Werner Koch <wk@gnupg.org>
6127 * data.c (_gpgme_data_release_and_return_string): Fixed string
6130 2001-01-22 Werner Koch <wk@gnupg.org>
6135 * key.c (gpgme_key_ref, gpgme_key_unref): New.
6136 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6138 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6139 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6141 2001-01-05 Werner Koch <wk@gnupg.org>
6143 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6146 Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6148 This file is free software; as a special exception the author gives
6149 unlimited permission to copy and/or distribute it, with or without
6150 modifications, as long as this notice is preserved.
6152 This file is distributed in the hope that it will be useful, but
6153 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6154 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.