1 2007-11-20 Werner Koch <wk@g10code.com>
3 * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
5 2007-11-12 Marcus Brinkmann <marcus@g10code.de>
7 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
9 2007-10-11 Marcus Brinkmann <marcus@g10code.de>
11 * kdpipeiodevice.cpp: New version from Frank Osterfeld.
13 2007-10-09 Marcus Brinkmann <marcus@g10code.de>
15 * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
18 2007-10-05 Marcus Brinkmann <marcus@g10code.de>
20 * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
23 2007-10-04 Marcus Brinkmann <marcus@g10code.de>
25 * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
26 w32-qt-io.cpp: New versions from Frank Osterfeld.
28 2007-10-02 Marcus Brinkmann <marcus@g10code.de>
30 * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
31 * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
32 (_gpgme_io_dup): Only acquire a reference, do not actually dup.
33 Submitted by Frank Osterfeld.
35 * priv-io.h, engine-gpgsm.c: Add comments.
36 * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
37 * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
39 (_gpgme_io_dup): Acquire a reference. Replace unused
40 implementation by assertion.
42 2007-09-28 Werner Koch <wk@g10code.com>
44 * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
46 (gpgsm_set_fd): Use it.
48 * w32-glib-io.c (find_channel): Add a new primary flag.
49 (_gpgme_io_close): Close channel only if primary.
50 (_gpgme_io_dup): Put newfd into the table as shallow copy.
52 * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
53 * w32-io.c (_gpgme_io_select): Ditto.
54 * w32-glib-io.c (_gpgme_io_select): Ditto.
56 * posix-io.c (_gpgme_io_select): Ditto.
57 * rungpg.c (read_status): Ditto.
58 * wait.c (fd_table_put): Ditto.
60 * rungpg.c (gpg_io_event): Add tracing.
61 (start): Use gpg_io_event for sending the start event.
62 * engine-gpgsm.c (gpgsm_io_event): Add tracing.
63 (start): Use gpgsm_io_event for sending the start event.
64 * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
66 2007-09-28 Marcus Brinkmann <marcus@g10code.de>
68 * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
69 versions from Frank Osterfeld.
71 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
73 * w32-glib-io.c (_gpgme_io_spawn),
74 w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
75 the process handle, return 0.
77 * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
78 * gpgme.c (gpgme_get_protocol_name): Implement support for
79 GPGME_PROTOCOL_UNKNOWN.
81 * kdpipeiodevice.h: Fix last change.
83 * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
84 w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
87 2007-09-25 Marcus Brinkmann <marcus@g10code.de>
89 * conversion.c, keylist.c: Include <sys/types.h>.
91 * kdpipeiodevice.h: Use namespace _gpgme_.
92 * kdpipeiodevice.cpp: Use namespace _gpgme_.
93 [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
94 * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
95 _gpgme_::KDPipeIODevice.
97 2007-09-17 Werner Koch <wk@g10code.com>
99 * rungpg.c (gpg_new): Make robust against undefined ttyname or
102 2007-09-14 Werner Koch <wk@g10code.com>
104 * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
106 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
108 * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
110 2007-09-13 Marcus Brinkmann <marcus@g10code.de>
112 * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
115 2007-09-07 Marcus Brinkmann <marcus@g10code.de>
117 * Makefile.am (libgpgme_qt_la_SOURCES): Move
118 moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
119 another file (it's more like a header file than a cpp file, but
120 automake doesn't know that).
122 * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
123 * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
124 (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
126 * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
127 kdpipeiodevice.moc, w32-qt-io.c: New files.
128 * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
129 (ltlib_gpgme_qt): New variable.
130 (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
131 (libgpgme_qt_la_SOURCES): New variable.
132 (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
133 (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
134 (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
135 (libgpgme_qt_la_LIBADD): New variables.
137 * sema.h (struct critsect_s): Rename "private" to "priv" to make
138 C++ users happy. Change users.
139 * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
140 (_gpgme_sema_cs_destroy): Likewise.
141 * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
142 (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
143 * w32-glib-io.c (gpgme_get_giochannel): Change return type to
145 (gpgme_get_fdptr): New function.
146 * w32-io.c (gpgme_get_fdptr): New function
147 * gpgme.def: Add gpgme_get_fdptr.
149 2007-08-22 Marcus Brinkmann <marcus@g10code.de>
151 * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
152 (writer): Remove superfluous check.
154 2007-08-20 Marcus Brinkmann <marcus@g10code.de>
156 * gpgme.h: Move include of gpg-error.h out of extern "C".
158 2007-08-07 Werner Koch <wk@g10code.com>
160 * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
161 * verify.c (parse_trust): Set Chain_MODEL.
163 2007-08-02 Werner Koch <wk@g10code.com>
165 * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
166 * w32-io.c (_gpgme_io_spawn): Ditto.
167 (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
168 * debug.c (_gpgme_debug): Enable assuan logging.
169 (_gpgme_debug_subsystem_init): New. * version.c
170 (do_subsystem_inits): Disable assuan logging and initialize de
172 (gpgme_check_version): Do not trace before the subsystems are
175 2007-07-17 Marcus Brinkmann <marcus@g10code.de>
177 * debug.c: Include <errno.h> and "debug.h".
178 (_gpgme_debug): Save and restore ERRNO.
180 (_gpgme_debug_buffer): New function.
181 * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
182 gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
183 w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
184 most of these files, add many more tracepoints.
186 2007-07-16 Marcus Brinkmann <marcus@g10code.de>
188 * engine-gpgsm.c (status_handler): Do not send BYE here.
190 * w32-io.c (struct reader_context_s, struct writer_context_s): New
192 (create_reader, create_writer): Initialize C->refcount to 1.
193 (destroy_reader, destroy_writer): Only destroy if C->refcount
195 (find_reader, find_writer, kill_reader, kill_writer): Beautify.
196 * priv-io.h (_gpgme_io_dup): New prototype.
197 * posix-io.c (_gpgme_io_dup): New function.
198 * w32-io.c (_gpgme_io_dup): Likewise.
199 * w32-glib-io.c (_gpgme_io_dup): Likewise.
200 * engine-gpgsm.c (start): Reverting to version 2007-07-10.
202 2007-07-13 Marcus Brinkmann <marcus@g10code.de>
204 * data-user.c (user_read, user_write, user_seek): Set errno and
205 return -1 instead returning the error code directly.
206 * data-compat.c (old_user_seek): Likewise.
207 * gpgme.c (gpgme_sig_notation_add): Return error properly.
209 * Revert the "close_notify_handler" returns int stuff. Always
210 close in the _gpgme_io_close implementations.
211 * engine-gpgsm.c (status_handler): Try to terminate the connection
213 * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
214 (_gpgme_io_write): Likewise.
216 * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
217 to _gpgme_close_notify_handler.
218 (_gpgme_close_notify_handler): New type.
219 (_gpgme_io_dup): Remove prototype.
220 * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
221 type of HANDLER to _gpgme_close_notify_handler_t.
222 (_gpgme_io_close): Do not close the FD if handler returns 0.
223 (_gpgme_io_dup): Remove function.
224 * w32-io.c (notify_table, _gpgme_io_set_close_notify,
225 _gpgme_io_close): Change type of HANDLER to
226 _gpgme_close_notify_handler_t.
227 (_gpgme_io_close): Do not close the FD if handler returns 0.
228 (_gpgme_io_dup): Remove function.
229 * w32-glib-io.c (_gpgme_io_dup): Remove function.
230 (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
231 to _gpgme_close_notify_handler_t.
232 (_gpgme_io_close): Do not close the FD if handler returns 0.
233 * rungpg.c (close_notify_handler): Change return type to int,
235 * engine-gpgsm.c (close_notify_handler): Change return type to
236 int, return 0 for status FD and 1 for all other FDs.
237 (start): Do not duplicate the status FD.
239 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
241 * Makefile.am: Replace implicite rule by suffix rule. Add
244 2007-07-12 Werner Koch <wk@g10code.com>
246 * version.c (do_subsystem_inits) [W32]: Make sure that the socket
247 system has been started.
249 2007-07-10 Marcus Brinkmann <marcus@g10code.de>
251 * priv-io.h (_gpgme_io_dup): New prototype.
252 * posix-io.c (_gpgme_io_dup): New function.
253 * w32-io.c (_gpgme_io_dup): Likewise.
254 * w32-glib-io.c (_gpgme_io_dup): Likewise.
255 * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
257 2007-07-08 Marcus Brinkmann <marcus@g10code.de>
259 * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
260 * funopen.c (funopen): Rename to _gpgme_funopen.
262 2007-04-30 Marcus Brinkmann <marcus@g10code.de>
264 * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
265 * rungpg.c (gpg_new): Likewise.
266 Submitted by Stephen Tether.
268 2007-02-26 Werner Koch <wk@g10code.com>
270 * verify.c (op_data_t): New element PLAINTEXT_SEEN.
271 (_gpgme_verify_status_handler): Return an error if more than one
272 plaintext has been seen.
273 (parse_error): New arg SET_STATUS. Also detect it based on an
274 ERROR status (gpg > 1.4.6).
276 2007-01-26 Werner Koch <wk@g10code.com>
278 * w32-io.c (build_commandline): Fixed stupid quoting bug.
279 * w32-glib-io.c (build_commandline): Ditto.
281 * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
283 * gpgme-config.in: New options --get-gpg and --get-gpgsm.
285 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
287 * data.h (_gpgme_data_get_fd): Add prototype.
288 (gpgme_data_get_fd_cb): New type.
289 (struct _gpgme_data_cbs): New member get_fd.
290 * data.c (_gpgme_data_get_fd): New function.
291 * data-fd.c (fd_get_fd): New function.
292 (fd_cbs): Add fd_get_fd.
293 * data-stream.c (stream_get_fd): New function.
294 (stream_cbs): Add stream_get_fd.
295 * data-mem.c (mem_cbs): Add NULL for get_fd callback.
296 * data-user.c (user_cbs): Likewise.
297 * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
298 short-cut by passing the data descriptor directly.
300 2007-01-17 Marcus Brinkmann <marcus@g10code.de>
302 * w32-io.c (build_commandline): Quote all command line arguments.
303 * w32-glib-io.c (build_commandline): Likewise.
305 2007-01-10 Werner Koch <wk@g10code.com>
307 * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
309 2007-01-08 Werner Koch <wk@g10code.com>
311 * version.c (do_subsystem_inits): Do assuan init only if building
313 * setenv.c: Include assuan-def.h only if building with Assuan
316 * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
318 * engine-gpgsm.c (gpgsm_set_locale): Ditto.
319 * rungpg.c (gpg_set_locale): Ditto.
321 2006-12-17 Marcus Brinkmann <marcus@g10code.de>
323 * gpgme.c (gpgme_set_protocol): Shut down the engine when
325 (gpgme_ctx_set_engine_info): Likewise for engine info.
326 * engine.h (_gpgme_engine_reset): New function prototype.
327 * engine.c (_gpgme_engine_reset): New function.
328 * engine-backend.h (struct engine_ops): New member RESET.
329 * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
330 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
331 [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
332 (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
334 (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
335 * op-support.c (_gpgme_op_reset): Try to use the engine's reset
336 function if available.
337 * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
339 * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
341 * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
342 lc_messages from prototype.
343 (_gpgme_engine_set_locale): New prototype.
344 * engine.c (_gpgme_engine_set_locale): New function.
345 * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
346 * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
347 Remove arguments lc_messages and lc_ctype from member NEW.
348 * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
350 (gpgsm_new): Remove lc_messages and lc_ctype
352 (gpgsm_set_locale): New function.
353 (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
354 * rungpg.c (struct engine_gpg): Add new members lc_messages and
356 (gpg_release): Release lc_messages and lc_ctype if set.
357 (gpg_new): Remove lc_messages and lc_ctype arguments.
358 (gpg_set_locale): New function.
359 (_gpgme_engine_ops_gpg): Add gpg_set_locale.
360 (add_arg): Implement in terms of:
361 (add_arg_ext): New function.
362 (start): Set lc-messages and lc-ctype arguments here.
364 2006-12-03 Marcus Brinkmann <marcus@g10code.de>
366 * engine-gpgsm.c (struct engine_gpgsm): Move members
367 input_fd_server, output_fd_server, message_fd_server to ...
368 (iocb_data): ... here (as server_fd).
369 (close_notify_handler): Reset tags as well.
370 (gpgsm_new): Implement support for descriptor
372 (fd_type_t): New type.
373 (gpgsm_clear_fd): New function. Use it instead of _gpgsm_io_close
374 for unused communication channels.
375 (gpgsm_set_fd): Rewritten to support descriptor passing. All
376 relevant callers adjusted as well (previously of _gpgme_io_close).
378 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
380 * version.c: Include "assuan.h".
381 (do_subsystem_inits): Call assuan_set_assuan_err_source.
383 2006-12-01 Marcus Brinkmann <marcus@g10code.de>
385 * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
386 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
387 libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
389 (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
390 libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
391 libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
392 libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
394 (noinst_LTLIBRARIES): Removed.
395 (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
396 (AM_CFLAGS): New variable.
398 2006-11-30 Marcus Brinkmann <marcus@g10code.de>
400 * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
401 ASSUAN_CONTEXT with assuan_context_t.
403 2006-11-29 Marcus Brinkmann <marcus@g10code.de>
405 * engine-gpgsm.c (gpgsm_new): Check return value of
408 * rungpg.c: Include <unistd.h>.
409 (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
410 --lc-messages. Fixes issue 734.
412 2006-10-24 Marcus Brinkmann <marcus@g10code.de>
414 * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
417 2006-10-23 Marcus Brinkmann <marcus@g10code.de>
419 * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
420 _gpgme_engine_io_event().
422 * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
424 2006-09-25 Marcus Brinkmann <marcus@g10code.de>
426 * data-mem.c (gpgme_data_release_and_get_mem): Release the data
429 2006-09-22 Marcus Brinkmann <marcus@g10code.de>
431 * keylist.c (keylist_colon_handler): Move debug output after
434 2006-07-29 Marcus Brinkmann <marcus@g10code.de>
436 * gpgme-config.in (Options): Add NETLIBS.
437 * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
438 libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
440 * rungpg.c (read_status): Fix comparison disguising as an
443 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
445 * gpgme.c (gpgme_set_locale): Remove conditional on
446 HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
448 2006-07-16 Marcus Brinkmann <marcus@g10code.de>
450 * rungpg.c (read_status): Strip potential carriage return.
451 * genkey.c (get_key_parameter): Skip potential carriage return.
452 * version.c (_gpgme_get_program_version): Strip potential carriage
455 * data.c (gpgme_data_set_file_name): Allow to clear the file name
458 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
460 * keylist.c (gpgme_get_key): Also clone the engine info.
462 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
464 * gpgme-config.in (cflags_pth): Revert accidential removal of
465 pthread support with last change.
467 2006-02-28 Marcus Brinkmann <marcus@g10code.de>
469 * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
470 (_gpgme_io_pipe): Open pipes in binary mode.
472 2006-02-22 Marcus Brinkmann <marcus@g10code.de>
474 * engine.c (gpgme_engine_check_version): Reimplemented to allow
475 checking the version correctly even after changing the engine
476 information. Bug reported by Stéphane Corthésy.
478 * rungpg.c (read_colon_line): Invoke colon preprocess handler if
480 (colon_preprocessor_t): New type.
481 (struct engine_gpg): New member colon.preprocess_fnc.
482 (gpg_keylist_preprocess): New function.
483 * keylist.c (keylist_colon_handler): Allow short key IDs.
485 2006-02-15 Marcus Brinkmann <marcus@g10code.de>
487 * w32-io.c (create_writer): Make C->have_data a manually resetted
489 (writer): Move code from end of if block to beginning, so it
490 is also run the first time.
491 (_gpgme_io_write): Move assert check after error check. Reset
492 the is_empty event, and also do it eagerly.
493 (_gpgme_io_select): Unconditionally wait for the is_empty event.
495 2006-01-26 Werner Koch <wk@g10code.com>
497 * w32-util.c (_gpgme_get_conf_int): New.
498 * posix-util.c (_gpgme_get_conf_int): New.
499 * w32-io.c (get_desired_thread_priority): New.
500 (create_reader, create_writer): Use it here.
502 2006-01-04 Werner Koch <wk@g10code.com>
504 * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
506 * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
507 statements. Disable error return for failed nonblocking call.
509 2006-01-03 Marcus Brinkmann <marcus@g10code.de>
511 * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
514 2005-12-31 Marcus Brinkmann <marcus@g10code.de>
516 * w32-glib-io.c (find_channel): Set channel to unbuffered.
517 (_gpgme_io_select): Fix debug output.
519 2005-12-23 Werner Koch <wk@g10code.com>
521 * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
522 * verify.c (release_op_data, _gpgme_verify_status_handler): Set
525 2005-12-20 Werner Koch <wk@g10code.com>
527 * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
528 and GPGME_STATUS_PKA_TRUST_GOOD.
529 (struct _gpgme_signature): New field pka_trust.
530 * verify.c (_gpgme_verify_status_handler): Set pka_trust.
532 2005-12-06 Werner Koch <wk@g10code.com>
534 * keylist.c (keylist_colon_handler): Store fingerprints of the
535 subkeys. Reset the secret flag of subkeys for stub secret keys.
536 (NR_FIELDS): Bumped up to 16
538 2005-11-27 Marcus Brinkmann <marcus@g10code.de>
540 * engine.c (_gpgme_set_engine_info): Use new_file_name in
541 engine_get_version invocation. Reported by Stéphane Corthésy.
543 2005-11-24 Marcus Brinkmann <marcus@g10code.de>
545 * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
547 2005-11-18 Werner Koch <wk@g10code.com>
549 * w32-glib-io.c: Include glib.h before windows to avoid a symbol
551 (find_channel): Better use g_io_channel_win32_new_fd instead of
552 the autodetection function g_io_channel_unix_new.
553 (_gpgme_io_select): Rewritten. It is now a fully working select
556 2005-11-18 Marcus Brinkmann <marcus@g10code.de>
558 * priv-io.h (_gpgme_io_fd2str): New prototype.
559 * posix-io.c (_gpgme_io_fd2str): New function.
560 * w32-io.c (_gpgme_io_fd2str): New function.
561 * rungpg.c: Use this new function.
562 * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
563 again. Two's company, three's the musketeers.
565 * w32-glib-io.c: Rewrote the file handle code. We don't create
566 system fds for every handle (doesn't work for inherited handles),
567 but we create pseudo fds in a private namespace that designate a
568 handle and potentially a giochannel.
570 2005-11-18 Werner Koch <wk@g10code.com>
572 * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
574 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
576 * w32-glib-io.c: New file.
577 * gpgme.def (gpgme_get_giochannel): Add symbol.
578 * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
580 (ltlib_gpgme_extra): New variable.
581 (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
582 (system_components_not_extra): New variable.
583 (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
584 (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
585 (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
586 (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
587 [BUILD_W32_GLIB]: New variables.
588 * gpgme-config.in (glib): New option.
589 * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
591 2005-11-17 Marcus Brinkmann <marcus@g10code.de>
593 * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
594 * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
595 * posix-io.c (_gpgme_io_kill): Removed.
596 (_gpgme_io_waitpid): Declare static.
598 2005-10-24 Marcus Brinkmann <marcus@g10code.de>
600 * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
602 2005-10-21 Werner Koch <wk@g10code.com>
604 * Makefile.am: Fixed cut+paste problem
606 2005-10-20 Marcus Brinkmann <marcus@g10code.de>
608 * Makefile.am: Build versioninfo.lo, not versioninfo.o. Also, fix
611 2005-10-16 Marcus Brinkmann <marcus@g10code.de>
613 * rungpg.c (gpg_edit): Don't add a key argument if in card edit
616 2005-10-06 Marcus Brinkmann <marcus@g10code.de>
618 * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
621 * gpgme.h (gpgme_free): New prototype.
622 * data-mem.c (gpgme_free): New function.
623 * libgpgme.vers (GPGME_1.1): Add gpgme_free.
624 * gpgme.def: Add gpgme_free.
626 2005-10-02 Marcus Brinkmann <marcus@g10code.de>
628 * util.h (_gpgme_decode_percent_string): Add new argument BINARY
630 * verify.c (parse_notation): Likewise for invocation.
631 * conversion.c (_gpgme_decode_percent_string): Likewise to
632 declaration. If set, do not replace '\0' characters with a
634 * gpgme.h (struct _gpgme_key_sig): New field notations.
635 * ops.h (_gpgme_parse_notation): New prototype.
636 * sig-notation.c (_gpgme_parse_notation): New function.
637 * key.c (gpgme_key_unref): Free all signature notations.
638 * keylist.c (op_data_t): New member tmp_keysig.
639 (finish_key): Clear OPD->tmp_keysig.
640 * gpgme.c (gpgme_set_keylist_mode): Remove check.
641 * rungpg.c (gpg_keylist): Support listing signature notations.
642 (gpg_keylist_ext): Likewise.
644 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
646 * engine.h (_gpgme_set_engine_info): Add prototype.
647 * engine-backend.h (struct engine_ops): Change return type of
648 get_file_name() to const char * to silence gcc warning.
649 * engine.c (engine_get_file_name): Change return type to const
650 char * to silence gcc warning.
651 (gpgme_get_engine_info): Use transitional variable to go from
652 const char * to char * to silence gcc warning.
653 (_gpgme_set_engine_info): Likewise.
654 * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
655 char * to silence gcc warning.
656 (gpgsm_new): Make ARGV a pointer to const char.
657 (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
658 to char * to silence gcc warning.
660 * gpgme.def: Add gpgme_data_set_file_name,
661 gpgme_data_get_file_name, gpgme_sig_notation_clear,
662 gpgme_sig_notation_add and gpgme_sig_notation_get.
663 * libgpgme.vers: Add gpgme_sig_notation_clear,
664 gpgme_sig_notation_add and gpgme_sig_notation_get.
665 * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
666 * context.h (struct gpgme_context): New field sig_notations.
667 * gpgme.h (struct _gpgme_sig_notation): New member value_len and
669 (GPGME_SIG_NOTATION_CRITICAL): New symbol.
670 (gpgme_sig_notation_flags_t): New type.
671 (gpgme_sig_notation_add, gpgme_sig_notation_clear,
672 gpgme_sig_notation_get): New prototypes.
673 * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
675 * sig-notation.c (_gpgme_sig_notation_free): New file.
676 * verify.c (parse_notation): Use support functions.
677 (release_op_data): Likewise.
678 * rungpg.c (append_args_from_sig_notations): New function.
679 (gpg_encrypt_sign, gpg_sign): Call it.
681 2005-09-30 Marcus Brinkmann <marcus@g10code.de>
683 * data.h (struct gpgme_data): New member file_name.
684 * data.c (gpgme_data_set_filename): New function.
685 (_gpgme_data_release): Free DH->filename if necessary.
686 (gpgme_data_get_filename): New function.
687 * rungpg.c (gpg_encrypt): Set filename option.
688 (gpg_encrypt_sign): Likewise.
689 (gpg_sign): Likewise.
690 * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
691 gpgme_data_get_file_name.
693 * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
696 2005-09-29 Marcus Brinkmann <marcus@g10code.de>
698 * gpgme.h (struct _gpgme_key): Add field is_qualified.
699 (struct _gpgme_subkey): Likewise.
700 * keylist.c (set_subkey_capability, set_mainkey_capability): Set
703 2005-09-23 Werner Koch <wk@g10code.com>
705 * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
707 (create_reader, create_writer): Set thread priority higher.
709 2005-09-19 Werner Koch <wk@g10code.com>
711 * w32-io.c (_gpgme_io_pipe): New environment variable to change
712 the size of the pipe buffer.
714 2005-09-13 Werner Koch <wk@g10code.com>
716 * ath.c: Changes to make it work under W32.
718 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
720 * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
721 (ath_pth_src, ath_pthread_src): Removed.
722 (w32_o_files): Replace ath-compat.o with ath.o.
723 (libgpgme_pth_la_CFLAGS): New variable.
724 * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
725 * ath.h (ath_pthread_available, ath_pth_available): Removed.
726 (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
727 (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
728 (_ATH_COMPAT): Macro removed.
729 * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
732 2005-09-12 Marcus Brinkmann <marcus@g10code.de>
734 * keylist.c (release_op_data): Do not free opd->tmp_uid.
736 2005-09-07 Werner Koch <wk@g10code.com>
738 * w32-io.c (build_commandline): Quote argv[0].
740 2005-08-26 Marcus Brinkmann <marcus@g10code.de>
742 * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
744 * edit.c (command_handler): Do not depend on PROCESSED being
747 * engine.h (engine_command_handler_t): Add new argument processed.
748 * ops.h (_gpgme_passphrase_command_handler_internal): Rename
750 (_gpgme_passphrase_command_handler): ... this one.
751 * passphrase.c (_gpgme_passphrase_command_handler_internal):
753 (_gpgme_passphrase_command_handler): ... this one.
754 * edit.c (command_handler): Add new argument processed. Remove
755 local variable with the same name. Always return processed as
757 * rungpg.c (command_handler): Send a newline character if the
760 2005-08-26 Werner Koch <wk@g10code.com>
762 * w32-util.c (read_w32_registry_string): Updated from code used by
763 GnuPG. This allows for expanding strings and features the
764 implicit fallback key.
765 (w32_shgetfolderpath, find_program_at_standard_place): New.
766 (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
767 entry, locate the programs at the standard place.
768 (dlopen, dlsym, dlclose): New, so that we can keep on using what
769 we are accustomed to.
771 * debug.c (debug_init): Use PATHSEP_C so that under W32 a
772 semicolon is used which allows us to create files with drive
775 * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
778 2005-08-19 Werner Koch <wk@g10code.com>
781 * versioninfo.rc.in: New.
782 * Makefile.am: Addes support for building a W32 DLL.
784 * ttyname_r.c (ttyname_r) [W32]: Return error.
785 * ath-compat.c [W32]: select and co are not yet supported; return
787 * data-stream.c (stream_seek): Use ftell if ftello is not available.
789 2005-08-08 Werner Koch <wk@g10code.com>
791 * util.h (stpcpy): Renamed to ..
792 (_gpgme_stpcpy): .. this and made inline. This avoids duplicate
793 definitions when linking statically.
796 2005-07-27 Marcus Brinkmann <marcus@g10code.de>
798 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
799 (struct _gpgme_op_decrypt_result): New member plaintext_filename.
800 (struct _gpgme_op_verify_result): Likewise.
801 * ops.h (_gpgme_parse_plaintext): Add prototype.
802 * op-support.c (_gpgme_parse_plaintext): New function.
803 * decrypt.c (release_op_data): Release
804 OPD->result.plaintext_filename.
805 (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
806 * verify.c (release_op_data): Release
807 OPD->result.plaintext_filename.
808 (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
810 2005-07-26 Marcus Brinkmann <marcus@g10code.de>
812 * keylist.c (gpgme_get_key): Allow key IDs.
814 2005-06-20 Marcus Brinkmann <marcus@g10code.de>
816 * gpgme.m4: Only call GPGME_CONFIG if found.
818 2005-06-03 Marcus Brinkmann <marcus@g10code.de>
820 * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
822 * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
823 (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
825 (_gpgme_decrypt_status_handler): Fix last change.
827 * gpgme.h (struct _gpgme_recipient): New structure.
828 (gpgme_recipient_t): New type.
829 (struct _gpgme_op_decrypt_result): Add member recipients.
830 * decrypt.c (op_data_t): New member last_recipient_p.
831 (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
832 (parse_enc_to): New function.
833 (_gpgme_decrypt_status_handler): Handle status ENC_TO and
836 * wait-global.c (gpgme_wait): Break out of the fd processing loop
838 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
840 2005-06-02 Marcus Brinkmann <marcus@g10code.de>
842 * wait.h (_gpgme_run_io_cb): New prototype.
843 * wait.c (_gpgme_run_io_cb): New function.
844 * wait-global.c (gpgme_wait): Call it.
845 * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
846 * wait-private.c (_gpgme_wait_on_condition): Likewise.
848 2005-06-02 Werner Koch <wk@g10code.com>
850 * passphrase.c (_gpgme_passphrase_status_handler): Take care of
851 GPGME_STATUS_NEED_PASSPHRASE_PIN.
852 (_gpgme_passphrase_command_handler_internal): Also act on the key
853 "passphrase.pin.ask".
855 * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
856 GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
857 GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
858 GPGME_STATUS_BACKUP_KEY_CREATED.
860 2005-05-28 Marcus Brinkmann <marcus@g10code.de>
862 * data-user.c: Include <errno.h>.
864 2005-05-17 Marcus Brinkmann <marcus@g10code.de>
866 * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
869 2005-05-11 Marcus Brinkmann <marcus@g10code.de>
871 * w32-io.c (_gpgme_io_select): Fix loop increment.
873 2005-05-05 Marcus Brinkmann <marcus@g10code.de>
875 * data-user.c (user_release): Only call user hook if provided.
876 (user_seek): Return EBADF if no user hook is provided.
877 (user_read): Likewise.
878 (user_write): Likewise.
880 2005-04-28 Marcus Brinkmann <marcus@g10code.de>
882 * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
883 * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
884 the reset, just for cleanliness, and do not sent it at all if the
885 default is requested.
886 * gpgme.c (gpgme_set_include_certs): Allow to use
887 GPGME_INCLUDE_CERTS_DEFAULT.
889 2005-04-21 Werner Koch <wk@g10code.com>
891 * verify.c (calc_sig_summary): Set the key revoked bit.
893 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
895 * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
896 in the list, not the user-provided CTX.
897 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
899 * wait-global.c (gpgme_wait): If no context is found, and we
900 should not hang, set *status to 0 and return NULL.
901 Reported by Igor Belyi <gpgme@katehok.ac93.org>.
903 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
905 * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
906 * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
907 (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
908 ENOSYS instead EOPNOTSUPP.
909 * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
910 (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
913 2005-03-24 Marcus Brinkmann <marcus@g10code.de>
915 * io.h: Rename to ...
916 * priv-io.h: ... this.
917 * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
918 * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
919 w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
920 Change all includes of "io.h" to "priv-io.h"
922 2005-03-09 Werner Koch <wk@g10code.com>
924 * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
925 cast away type checks.
927 * io.h [W32]: Do not include stdio.h. If it is needed do it at
930 * data.h [W32]: Removed kludge for EOPNOTSUP.
931 * data.c, data-compat.c [W32]: Explicitly test for it here.
933 Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
936 2005-03-07 Timo Schulz <twoaday@g10code.de>
938 * gpgme.h: [_WIN32] Removed ssize_t typedef.
939 * ath.h: [_WIN32] Added some (dummy) types.
940 * io.h: [_WIN32] include stdio.h.
941 * data.h: [_WIN32] Define EOPNOTSUPP.
942 * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
943 * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
945 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
947 * engine.c (_gpgme_set_engine_info): Fix assertion.
949 2004-12-11 Marcus Brinkmann <marcus@g10code.de>
951 * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
953 * ttyname_r.c: New file.
955 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
957 * putc_unlocked.c, funopen.c: I just claim copyright on these
958 files and change their license to LGPL, because they are totally
959 trivial wrapper functions.
960 * isascii.c: Change copyright notice to the one from ctype/ctype.h
961 in the GNU C Library (CVS Head 2004-10-10), where isascii is
962 defined as a macro doing exactly the same as the function in this
964 * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
965 * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
966 * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
967 ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
968 data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
969 data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
970 decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
971 engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
972 export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
973 key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
974 passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
975 rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
976 util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
977 wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
980 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
982 * libgpgme.vers (GPGME_1.1): New version.
983 * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
984 member get_version(). Add arguments FILE_NAME and HOME_DIR to
985 member new(). Change return type of get_file_name and get_version
987 * engine-gpgsm.c (gpgsm_get_version): Change return type to char
988 pointer. Do not cache result.
989 (gpgsm_new): Add file_name and home_dir argument, and use them
990 instead of the defaults, if set.
991 * rungpg.c (struct engine_gpg): New member file_name.
992 (gpg_get_version): Change return type to char pointer, and do not
994 (gpg_release): Free gpg->file_name.
995 (gpg_new): Take new arguments file_name and home_dir. Set the
996 --homedir argument if HOME_DIR is not NULL. Set gpg->file_name.
997 (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
998 * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
1000 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1002 * engine.c: Include <assert.h>.
1003 (gpgme_get_engine_info): Set *INFO within the lock. Move
1004 ENGINE_INFO and ENGINE_INFO_LOCK to ....
1005 (engine_info, engine_info_lock): ... here. New static variables.
1006 (engine_get_version): Add file_name argument to
1007 get_version invocation. Change return type to char pointer.
1008 (gpgme_engine_check_version): Rewritten to free() the return value
1009 of engine_get_version after using it.
1010 (_gpgme_engine_info_release): New function.
1011 (gpgme_get_engine_info): Rewritten.
1012 (_gpgme_engine_info_copy): New function.
1013 (_gpgme_set_engine_info): New function.
1014 (gpgme_set_engine_info): New function.
1015 (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
1017 * gpgme.h (struct _gpgme_engine_info): Change type of file_name
1018 and version to char * (remove the const). New member home_dir.
1019 (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
1020 gpgme_ctx_set_engine_info): New prototypes.
1021 * context.h (struct gpgme_context): New member engine_info.
1022 * gpgme.c (gpgme_new): Allocate CTX->engine_info.
1023 (gpgme_release): Deallocate CTX->engine_info.
1024 (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
1026 * op-support.c (_gpgme_op_reset): Look for correct engine info and
1027 pass it to _gpgme_engine_new.
1028 * version.c (gpgme_check_version): Adjust to
1029 _gpgme_compare_versions returning an int.
1030 (_gpgme_compare_versions): Return an int value, not a const char
1032 * ops.h (_gpgme_compare_versions): Same for prototype.
1034 2004-10-03 Marcus Brinkmann <marcus@g10code.de>
1036 * verify.c (parse_trust): If no reason is provided, set
1037 SIG->validity_reason to 0.
1038 (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
1040 2004-10-22 Marcus Brinkmann <marcus@g10code.de>
1042 * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
1043 (start): Call map_assuan_error on return value of
1046 2004-10-05 Marcus Brinkmann <marcus@g10code.de>
1048 * op-support.c (_gpgme_op_data_lookup): Use char pointer for
1051 2004-09-30 Marcus Brinkmann <marcus@g10code.de>
1053 * gpgme.m4: Implement the --api-version check.
1055 * rungpg.c (read_status): Move the polling of the output data pipe
1056 to just before removing the command fd, from just before adding
1057 it. This avoids buffering problems.
1059 * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
1060 read, to improve debug output.
1062 2004-09-29 Marcus Brinkmann <marcus@g10code.de>
1064 * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
1065 GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
1066 (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
1067 GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
1069 (gpgme_keylist_mode_t): Define as unsigned int.
1070 (gpgme_key_t): Change type of keylist_mode to
1071 gpgme_keylist_mode_t.
1073 2004-09-23 Marcus Brinkmann <marcus@g10code.de>
1075 * data.c (_gpgme_data_outbound_handler): Close the file descriptor
1078 * data-stream.c (stream_seek): Call ftello and return the current
1080 * data.h (struct gpgme_data): Change type of data.mem.offset to
1082 * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
1083 callback. If SEEK_CUR, adjust the offset by the pending buffer
1084 size. Clear pending buffer on success.
1087 2004-09-14 Marcus Brinkmann <marcus@g10code.de>
1089 * gpgme.m4: Add copyright notice.
1091 2004-08-18 Marcus Brinkmann <marcus@g10code.de>
1093 * passphrase.c (_gpgme_passphrase_status_handler): Always run the
1096 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
1098 * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
1100 2004-06-23 Marcus Brinkmann <marcus@g10code.de>
1102 * key.c (_gpgme_key_append_name): Make sure tail points to the
1103 byte following the uid.
1104 (_gpgme_key_add_sig): Likewise. Don't use calloc, but malloc and
1107 2004-06-02 Marcus Brinkmann <marcus@g10code.de>
1109 * libgpgme.vers: Remove C-style comment, which is not supported by
1112 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1114 * gpgme-config.in (Options): Support --api-version.
1116 * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
1118 * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
1119 * verify.c (parse_error): Likewise.
1121 * verify.c (parse_error): Do not skip location of where token.
1123 * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
1124 * verify.c (_gpgme_verify_status_handler): Add handling of
1125 GPGME_STATUS_REVKEYSIG.
1126 (parse_trust): Likewise.
1128 2004-05-21 Marcus Brinkmann <marcus@g10code.de>
1130 * gpgme.h (struct _gpgme_decrypt_result): New fields
1131 wrong_key_usage and _unused.
1132 * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
1133 character after a matched string, as in a protocol error this
1134 could skip over the trailing binary zero.
1135 Handle decrypt.keyusage error notifications.
1137 * gpgme.h (struct _gpgme_key): New member keylist_mode.
1138 * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
1140 2004-04-29 Marcus Brinkmann <marcus@g10code.de>
1142 * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
1143 to unsigned int. Same for member _unused.
1145 * keylist.c (set_mainkey_trust_info): Rewritten.
1146 (set_subkey_capability): Handle 'd' (disabled).
1147 (set_mainkey_capability): Rewritten.
1149 2004-04-22 Marcus Brinkmann <marcus@g10code.de>
1151 * gpgme.m4: Quote first argument to AC_DEFUN.
1153 2004-04-21 Werner Koch <wk@gnupg.org>
1155 * key.c (gpgme_key_unref): Allow passing NULL like free does.
1156 The rule of least surprise.
1158 2004-04-15 Werner Koch <wk@gnupg.org>
1160 * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
1161 unused result.signatures items.
1163 * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
1165 2004-04-08 Werner Koch <wk@gnupg.org>
1167 * verify.c (_gpgme_verify_status_handler): Ignore the error status
1168 if we can't process it.
1169 * decrypt-verify.c (decrypt_verify_status_handler): Backed out
1170 yesterday's hack. It is not any longer required.
1172 2004-04-07 Werner Koch <wk@gnupg.org>
1174 * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
1175 with meaningless error codes from the verify status function.
1177 2004-04-05 Werner Koch <wk@gnupg.org>
1179 * gpgme.h: Add GPGME_STATUS_NEWSIG.
1181 * verify.c (parse_error): Compare only the last part of the where
1183 (prepare_new_sig): New.
1184 (parse_new_sig): Use prepare_new_sig when required.
1185 (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
1187 * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
1188 option. Fixed pattern construction.
1189 (status_handler): Add debugging output.
1191 2004-03-23 Marcus Brinkmann <marcus@g10code.de>
1193 * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
1194 isatty(). Submitted by Bernhard Herzog.
1196 2004-03-11 Marcus Brinkmann <marcus@g10code.de>
1198 * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
1201 * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
1203 * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
1204 GPGSM->assuan_ctx is not NULL. Set it to NULL afterwards.
1206 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
1208 * gpgme-config.in: Do not emit include and lib directory for
1209 prefix "/usr" or "".
1211 2004-03-03 Werner Koch <wk@gnupg.org>
1213 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
1216 2004-02-18 Werner Koch <wk@gnupg.org>
1218 * gpgme-config.in: Ignore setting of --prefix.
1220 2004-02-25 Marcus Brinkmann <marcus@g10code.de>
1222 * rungpg.c (gpg_cancel): New function.
1223 (gpg_release): Call it here.
1224 (_gpgme_engine_ops_gpg): Add it here.
1225 * engine-gpgsm.c (gpgsm_cancel): Fix last change.
1227 2004-02-24 Marcus Brinkmann <marcus@g10code.de>
1229 * gpgme.c (gpgme_cancel): New function.
1230 * engine-backend.h (struct engine_ops): New member cancel.
1231 * engine.h (_gpgme_engine_cancel): New prototype.
1232 * engine.c (_gpgme_engine_cancel): New function.
1233 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
1234 (gpgsm_cancel): New function.
1235 (gpgsm_release): Use it.
1236 * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
1238 2004-02-17 Werner Koch <wk@gnupg.org>
1240 * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
1241 * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
1243 2004-02-15 Werner Koch <wk@gnupg.org>
1245 * memrchr.c (memrchr): Fixed implementation. Problem pointed out
1246 by Adriaan de Groot.
1248 2004-02-01 Marcus Brinkmann <marcus@g10code.de>
1250 * rungpg.c (build_argv): Use --no-comment, not --comment "".
1252 * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
1254 * data-stream.c (stream_seek): Likewise.
1256 2004-01-16 Werner Koch <wk@gnupg.org>
1258 * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
1261 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
1263 * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
1265 2004-01-12 Werner Koch <wk@gnupg.org>
1267 * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
1269 2003-12-25 Marcus Brinkmann <marcus@g10code.de>
1271 * gpgme.h (_GPGME_D_CLASS): Revert this change.
1272 (struct _gpgme_key_sig): For C++ compilers, rename class
1273 member to _obsolete_class. Add new member sig_class.
1274 (struct _gpgme_new_signature): Same here.
1275 * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
1277 * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
1278 setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
1279 * sign.c (parse_sig_created): Set SIG->sig_class.
1281 2003-12-22 Werner Koch <wk@gnupg.org>
1283 * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
1286 2003-11-19 Werner Koch <wk@gnupg.org>
1288 * conversion.c (_gpgme_parse_timestamp): New.
1289 (atoi_1, atoi_2, atoi_4): New.
1290 * keylist.c (parse_timestamp): Removed. Changed all callers to use
1292 * verify.c (parse_valid_sig): Ditto. Repalced the errno check.
1293 * sign.c (parse_sig_created): Ditto.
1295 2003-10-31 Werner Koch <wk@gnupg.org>
1297 * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
1300 2003-10-10 Marcus Brinkmann <marcus@g10code.de>
1302 * genkey.c (get_key_parameter): Make a copy of the key parameters.
1303 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
1305 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
1307 * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
1310 * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
1313 * io.h (_gpgme_io_subsystem_init): New prototype.
1314 * posix-io.c (_gpgme_io_subsystem_init): Add function.
1315 (_gpgme_io_spawn): Do not fixup signal handler here.
1316 * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
1318 * debug.c (debug_init): Drop const qualifier from E.
1320 * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
1322 (ath_connect): Make ADDR argument const.
1323 * ath-pthread.c (ath_connect): Likewise.
1324 * ath-pth.c (ath_connect): Likewise.
1325 * ath-compat.c (ath_connect): Likewise.
1326 * ath.c (ath_connect): Likewise.
1328 * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
1329 [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
1331 * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
1333 * util.h (_gpgme_hextobyte): Likewise for prototype.
1335 * gpgme.h: Remove trailing comma in enum.
1337 * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
1338 <signal.h>, <fcntl.h>, or "unistd.h".
1340 2003-10-02 Marcus Brinkmann <marcus@g10code.de>
1342 * engine-backend.h (struct engine_ops): Add argument TYPE.
1343 * engine.c (_gpgme_engine_op_edit): Likewise.
1344 * engine.h: Likewise.
1345 * rungpg.c (gpg_edit): Likewise. Use it.
1346 * edit.c (edit_start): Likewise. Pass it on.
1347 (gpgme_op_edit_start, gpgme_op_edit): Likewise.
1348 (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
1350 2003-09-30 Marcus Brinkmann <marcus@g10code.de>
1352 * gpgme.h (gpg_strerror_r): Change prototype to match
1353 gpg_strerror_r change.
1354 * error.c (gpg_strerror_r): Likewise, also update implementation.
1356 * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
1357 RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
1358 CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
1360 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
1362 * gpgme.h: Add prototype for gpgme_set_locale.
1364 * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
1365 characteristics and use that instead __inline__.
1367 * context.h (struct gpgme_context): New members lc_ctype and
1369 * gpgme.c: Include <locale.h>.
1370 (def_lc_lock, def_lc_ctype, def_lc_messages): New static
1372 (gpgme_set_locale): New function.
1373 * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
1375 * engine.h (_gpgme_engine_new): Likewise.
1376 * engine-gpgsm.c (gpgsm_new): Likewise.
1377 * rungpg.c (gpg_new): Likewise.
1378 * engine-backend.h (struct engine_ops): Likewise to NEW.
1379 * op-support.c (_gpgme_op_reset): Likewise to invocation of
1382 2003-09-13 Marcus Brinkmann <marcus@g10code.de>
1384 * gpgme.h (gpgme_strerror_r): New prototype.
1385 * error.c (gpgme_strerror_r): New function.
1387 * get-env.c: New file.
1388 * util.h (_gpgme_getenv): Add prototype.
1389 * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
1390 * rungpg.c (build_argv): Use _gpgme_getenv.
1391 * debug.c (debug_init): Likewise.
1392 * engine-gpgsm.c (gpgsm_new): Likewise.
1393 (gpgsm_new): Use ttyname_r.
1394 * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
1396 2003-09-03 Marcus Brinkmann <marcus@g10code.de>
1398 * gpgme-config.in: Use $libdir, not @libdir@, for the echo
1401 * gpgme-config.in: Rewritten.
1402 * gpgme.m4: Rewritten.
1404 2003-08-19 Marcus Brinkmann <marcus@g10code.de>
1406 The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
1407 ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
1408 updated to have better thread support, and the Makefile.am was
1409 changed to reflect that.
1411 * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
1412 * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
1413 value of status_fnc.
1414 * rungpg.c (start): Return SAVED_ERRNO, not errno.
1416 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1418 * rungpg.c (start): Use saved_errno instead errno.
1420 2003-08-18 Marcus Brinkmann <marcus@g10code.de>
1422 * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
1423 * fopencookie.c: File removed.
1425 2003-08-15 Marcus Brinkmann <marcus@g10code.de>
1427 * gpgme-config.in: Put gpg-error related flags after gpgme's.
1429 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
1431 * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
1432 _OBSOLETE_CLASS, add member CLASS with type unsigned int.
1433 * sign.c (parse_sig_created): Also set SIG->_unused_class for
1434 backward compatibility.
1436 2003-08-04 Marcus Brinkmann <marcus@g10code.de>
1438 * verify.c (parse_new_sig): Fix status parsing case.
1440 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
1442 * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
1443 Lower _UNUSED to 23 bits.
1444 (struct _gpgme_key): Likewise.
1445 * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
1446 (set_subkey_capability): Support 'a'.
1448 * keylist.c (gpgme_get_key): Check if there is more than one key
1449 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
1451 * util.h (_gpgme_decode_c_string): Change type of LEN argument to
1453 (_gpgme_decode_percent_string): Likewise.
1454 * conversion.c (_gpgme_decode_c_string): Likewise.
1455 (_gpgme_decode_percent_string): Likewise.
1456 (_gpgme_map_gnupg_error): Change type of I to unsigned int.
1457 * signers.c (gpgme_signers_clear): Likewise.
1458 (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
1459 Use SEQNO instead SEQ.
1460 * wait.c (fd_table_put): Change type of I and J to unsigned int.
1461 * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
1463 (gpgme_wait): Change type of I and IDX to unsigned int.
1464 * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
1465 and I to unsigned int.
1466 * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
1467 int to suppress gcc warning.
1468 (_gpgme_io_set_close_notify): Likewise.
1469 (_gpgme_io_select): Change type of I to unsigned int.
1470 * engine.c (gpgme_get_engine_info): Change type of PROTO to
1472 * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
1475 2003-07-29 Marcus Brinkmann <marcus@g10code.de>
1477 * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
1478 and wrong expression.
1479 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
1480 * encrypt.c (encrypt_sym_status_handler): Likewise.
1481 * sign.c (sign_status_handler): Likewise.
1482 * verify.c (verify_status_handler): Likewise.
1483 * decrypt.c (decrypt_status_handler): Likewise.
1485 * engine.c (gpgme_get_engine_info): Initialize NULL.
1487 2003-07-23 Marcus Brinkmann <marcus@g10code.de>
1489 * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
1490 GPG_ERROR_LIBS when setting the corresponding variables.
1491 Reported by Stéphane Corthésy.
1493 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
1495 * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
1496 the beginning of the block.
1498 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
1500 * data-mem.c (mem_write): Copy original buffer content.
1502 2003-06-22 Marcus Brinkmann <marcus@g10code.de>
1504 * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
1507 2003-06-06 Marcus Brinkmann <marcus@g10code.de>
1509 * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
1510 * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
1513 * op-support.c (_gpgme_parse_inv_userid): Rename to
1514 _gpgme_parse_inv_recp and change to new datatype.
1515 * ops.h (_gpgme_parse_inv_key): Fix prototype.
1516 * gpgme.h (struct _gpgme_invalid_user_id): Rename to
1517 __gpgme_invalid_key. Rename field ID to KEY.
1518 (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
1519 (struct _gpgme_op_encrypt_result): Here, too.
1520 (struct _gpgme_op_sign_result): Likewise.
1521 * encrypt.c (struct op_data): Likewise.
1522 (release_op_data): Likewise.
1523 * sign.c (struct op_data): Likewise.
1524 (release_op_data): Likewise.
1526 * posix-io.c (_gpgme_io_read): Save errno across debug calls.
1527 (_gpgme_io_write): Likewise.
1528 (_gpgme_io_pipe): Likewise.
1529 (_gpgme_io_select): Likewise.
1531 * rungpg.c (struct engine_gpg): Remove arg_error.
1532 (add_arg): Don't set arg_error.
1533 (add_data): Likewise.
1534 (start): Don't check arg_error.
1535 (gpg_new): Check return value of add_arg.
1536 * verify.c (parse_notation): Free allocated memory at error.
1538 2003-06-05 Marcus Brinkmann <marcus@g10code.de>
1540 Everywhere: Use libgpg-error error codes.
1542 * Makefile.am (EXTRA_DIST): Remove mkerrors.
1543 (BUILT_SOURCES): Remove errors.c.
1544 (MOSTLYCLEANFILES): Likewise.
1545 (libgpgme_la_SOURCES): Likewise. Add error.c.
1546 (errors.c): Remove target.
1547 * mkerrors: File removed.
1548 * error.c: New file.
1550 * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
1551 (gpgme_err_code_t, gpgme_err_source_t): New types.
1552 (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
1553 New static inline functions.
1554 (gpgme_strsource, gpgme_err_code_from_errno,
1555 gpgme_err_code_to_errno, gpgme_err_make_from_errno,
1556 gpgme_error_from_errno): New prototypes.
1558 2003-05-29 Marcus Brinkmann <marcus@g10code.de>
1560 * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
1561 (gpgme_op_export): Likewise.
1562 (gpgme_op_export_ext_start): New prototype.
1563 (gpgme_op_export_ext): Likewise.
1564 * engine.h: Likewise for _gpgme_engine_op_export and
1565 _gpgme_engine_op_export_ext.
1566 * engine-backend.h (struct engine_ops): Change second argument of
1567 prototype of export to const char *, and add reserverd int as
1568 third argument. Add prototype for export_ext.
1569 * engine.c (_gpgme_engine_op_export_ext): New function.
1570 (_gpgme_engine_op_export): Change second argument of prototype of
1571 export to const char *, and add reserverd int as third argument.
1572 * rungpg.c (gpg_export): Change second argument of prototype of
1573 export to const char *, and add reserverd int as third argument.
1574 (gpg_export_ext): New function.
1575 (gpg_keylist_ext): Break loop at error.
1576 (_gpgme_engine_ops_gpg): Add gpg_export_ext.
1577 * engine-gpgsm.c (gpgsm_export): Change second argument of
1578 prototype of export to const char *, and add reserverd int as
1580 (gpgsm_export_ext): New function.
1581 (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
1582 * export.c (export_start): Change second argument of prototype of
1583 export to const char *, and add reserverd int as third argument.
1584 (gpgme_op_export_start): Likewise.
1585 (export_ext_start): New function.
1586 (gpgme_op_export_ext_start): Likewise.
1587 (gpgme_op_export_ext): Likewise.
1589 * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
1590 (gpgme_sigsum_t): New type for anonymous enum.
1592 * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
1593 and return an error if RECP is not set.
1595 * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
1596 * user-id.c: Remove file.
1597 * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
1598 * gpgme.h (gpgme_encrypt_flags_t): New type.
1599 (gpgme_op_encrypt_start): Change second parameter to type
1600 gpgme_key_t[], and add third parameter.
1601 (gpgme_op_encrypt): Likewise.
1602 (gpgme_op_encrypt_sign_start): Likewise.
1603 (gpgme_op_encrypt_sign): Likewise.
1604 * encrypt.c (encrypt_start): Likewise.
1605 (gpgme_op_encrypt_start): Likewise.
1606 (gpgme_op_encrypt): Likewise. Pass flags to engine.
1607 * encrypt-sign.c (encrypt_sign_start): Likewise.
1608 (gpgme_op_encrypt_sign_start): Likewise.
1609 (gpgme_op_encrypt_sign): Likewise.
1610 * engine-backend.h (struct engine_ops): Likewise for prototypes of
1611 encrypt and encrypt_sign.
1612 * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
1613 and _gpgme_engine_op_encrypt_sign.
1614 * engine.c (_gpgme_engine_op_encrypt): Likewise.
1615 (_gpgme_engine_op_encrypt_sign): Likewise.
1616 * rungpg.c (gpg_encrypt): Likewise.
1617 (gpg_encrypt_sign): Likewise.
1618 * rungpg.c (gpg_encrypt): Check flags for always trust option.
1619 * engine-gpgsm.c (gpgsm_encrypt): Likewise.
1620 (set_recipients): Rewritten to use keys instead user IDs.
1621 * rungpg.c (append_args_from_recipients): Rewritten to use keys
1623 * encrypt.c (_gpgme_encrypt_status_handler): Change errors
1624 returned to GPGME_Invalid_Key and GPGME_General_Error.
1626 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
1628 * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
1629 (struct gpgsm_object_s): Rename to struct engine_gpgsm.
1630 * rungpg.c: Rename GpgObject to engine_gpg_t.
1631 (struct gpg_object_s): Rename to struct engine_gpg.
1633 * context.h (struct gpgme_context): Change EngineObject to
1635 (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
1636 (ctx_op_data_t): New type.
1637 (struct gpgme_context): Use it.
1638 * ops.h (_gpgme_op_data_lookup): Use new type name.
1639 * op-support.c (_gpgme_op_data_lookup): Likewise.
1640 * engine.c: Rename EngineObject to engine_t in the file. Also
1641 EngineStatusHandler to engine_status_handler_t,
1642 EngineCommandHandler to engine_command_handler_t and
1643 EngineColonLineHandler to engine_colon_line_handler.
1644 * rungpg.c (start): Likewise.
1645 * engine-gpgsm.c: Likewise.
1646 * engine-backend.h (struct engine_ops): Likewise
1647 * engine.h (struct engine_object_s): Rename to struct engine.
1648 (EngineObject): Rename to engine_t. Also everywhere else in the
1650 (EngineStatusHandler): Rename to engine_status_handler_t.
1651 (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
1652 (EngineCommandHandler): Rename to engine_command_handler_t.
1654 * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
1656 * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
1658 * gpgme.h (gpgme_recipients_t): Removed.
1659 (gpgme_recipients_new, gpgme_recipients_release,
1660 gpgme_recipients_add_name,
1661 gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
1662 gpgme_recipients_enum_open, gpgme_recipients_enum_read,
1663 gpgme_recipients_enum_close): Removed.
1664 (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
1665 gpgme_op_encrypt_sign_start, gpgme_op_export_start,
1666 gpgme_op_export): Change second argument to gpgme_user_id_t.
1667 (gpgme_user_ids_release): New prototype.
1668 (gpgme_user_ids_append): Likewise.
1669 * ops.h (_gpgme_recipients_all_valid): Remove.
1670 (_gpgme_user_ids_all_valid): Add.
1671 * context.h (struct gpgme_recipients): Removed.
1672 * user-id.c: New file.
1673 * recipient.c: Removed file.
1674 * rungpg.c (append_args_from_recipients): Change last arg to
1675 gpgme_user_id_t. Reimplement.
1676 (gpg_encrypt): Change second arg to gpgme_user_id_t.
1677 (gpg_encrypt_sign): Likewise.
1678 (gpg_export): Likewise. Rewrite user ID list code.
1679 * engine.c (_gpgme_engine_op_encrypt): Change second arg to
1681 (_gpgme_engine_op_encrypt_sign): Likewise.
1682 (_gpgme_engine_op_export): Likewise.
1683 * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
1684 _gpgme_engine_op_export): Likewise.
1685 * engine-gpgsm.c (set_recipients): Likewise. Rewrite loop code.
1686 (gpgsm_encrypt): Likewise.
1687 (gpgsm_export): Likewise.
1688 * engine-backend.h (struct engine_ops): Likewise for members
1689 ENCRYPT, ENCRYPT_SIGN and EXPORT.
1690 * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
1692 * encrypt.c (encrypt_start): Likewise. Don't check for count of
1694 (gpgme_op_encrypt_start): Likewise.
1695 (gpgme_op_encrypt): Likewise.
1696 * encrypt-sign.c (encrypt_sign_start): Likewise.
1697 (gpgme_op_encrypt_sign): Likewise.
1698 (gpgme_op_encrypt_sign_start): Likewise.
1700 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
1702 * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
1703 * import.c (parse_import_res): Add skipped_new_keys parser.
1705 * op-support.c (_gpgme_parse_inv_userid): Add missing break
1707 * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
1709 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
1711 * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
1712 HOOK to avoid compiler warning. Don't ask, you don't want to know.
1713 (_gpgme_encrypt_status_handler): Likewise.
1714 (_gpgme_op_encrypt_init_result): Likewise.
1715 * decrypt.c (gpgme_op_decrypt_result): Likewise.
1716 (_gpgme_decrypt_status_handler): Likewise.
1717 (_gpgme_op_decrypt_init_result): Likewise.
1718 * verify.c (gpgme_op_verify_result): Likewise.
1719 (_gpgme_verify_status_handler): Likewise.
1720 (_gpgme_op_verify_init_result): Likewise.
1721 * edit.c (edit_status_handler): Likewise.
1722 (command_handler): Likewise.
1723 (edit_start): Likewise.
1724 * genkey.c (gpgme_op_genkey_result): Likewise.
1725 (genkey_status_handler): Likewise.
1726 (genkey_start): Likewise.
1727 * import.c (gpgme_op_import_result): Likewise.
1728 (import_status_handler): Likewise.
1729 (_gpgme_op_import_start): Likewise.
1730 * trustlist.c (gpgme_op_trustlist_next): Likewise.
1731 (_gpgme_op_trustlist_event_cb): Likewise.
1732 (gpgme_op_trustlist_start): Likewise.
1733 * keylist.c (gpgme_op_keylist_result): Likewise.
1734 (keylist_colon_handler): Likewise.
1735 (keylist_status_handler): Likewise.
1736 (_gpgme_op_keylist_event_cb): Likewise.
1737 (gpgme_op_keylist_start): Likewise.
1738 (gpgme_op_keylist_ext_start): Likewise.
1739 (gpgme_op_keylist_next): Likewise.
1740 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
1741 (_gpgme_passphrase_command_handler_internal): Likewise.
1742 * sign.c (gpgme_op_sign_result): Likewise.
1743 (_gpgme_sign_status_handler): Likewise.
1744 (_gpgme_op_sign_init_result): Likewise.
1746 * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
1747 access to pointer type.
1749 2003-05-26 Marcus Brinkmann <marcus@g10code.de>
1751 * engine.h (EngineCommandHandler): Change last argument to int fd.
1752 * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
1754 (gpgme_edit_cb_t): Change last argument to int fd.
1755 * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
1756 * passphrase.c: Include <assert.h>.
1757 (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
1758 (release_op_data): Check values before calling free.
1759 (_gpgme_passphrase_status_handler): Likewise.
1760 (_gpgme_passphrase_command_handler_internal): New function.
1761 (_gpgme_passphrase_command_handler): Rewritten.
1762 * edit.c (edit_status_handler): Pass -1 as fd argument.
1763 (command_handler): Update prototype. New variable processed. Use
1764 it to store return value of
1765 _gpgme_passphrase_command_handler_internal which is now used
1766 instead _gpgme_passphrase_command_handler. Use it also to check
1767 if we should call the user's edit function. Pass fd to user's
1769 * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
1771 (gpg_release): Check value before calling free. Do not release
1773 (command_cb): Function removed.
1774 (command_handler): New function. Thus we don't use a data object
1775 for command handler stuff anymore, but handle it directly. This
1776 allows proper error reporting (cancel of passphrase requests, for
1777 example). Also all callbacks work via direct writes to the file
1778 descriptor (so that passphrases are not kept in insecure memory).
1779 (gpg_set_command_handler): Rewritten to use even more ugly hacks.
1780 (read_status): Check cmd.keyword before calling free. Install
1781 command_handler as the I/O callback handler with GPG as private
1784 * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
1786 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
1787 decrypt_verify_start.
1788 (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
1789 (gpgme_op_decrypt_verify): Likewise.
1790 * verify.c (verify_status_handler): New function that also calls
1791 progress status handler.
1792 (_gpgme_op_verify_start): Set status handler to verify_status_handler.
1793 Rename to (verify_start).
1794 (gpgme_op_verify_start): Call verify_start.
1795 (gpgme_op_verify): Likewise.
1796 * encrypt.c (encrypt_status_handler): New function.
1797 (_gpgme_encrypt_sym_status_handler): Call progress status handler.
1798 Make static. Rename to encrypt_sym_status_handler.
1799 (encrypt_start): Set status handler to encrypt_sym_status_handler
1800 or encrypt_status_handler.
1801 * sign.c (sign_status_handler): New function.
1802 (sign_start): Set status handler to sign_status_handler.
1803 * decrypt.c (decrypt_status_handler): New function that also calls
1804 progress status handler.
1805 (decrypt_start): Set status handler to decrypt_status_handler.
1806 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
1807 * decrypt-verify.c (decrypt_verify_status_handler): Call
1808 _gpgme_progress_status_handler.
1810 * conversion.c (_gpgme_decode_c_string): Add missing break
1813 * recipient.c (gpgme_recipients_add_name_with_validity): Add one
1814 to buffer to allocate.
1816 2003-05-19 Marcus Brinkmann <marcus@g10code.de>
1818 * verify.c (parse_new_sig): Fix ERRSIG case.
1819 Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
1821 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
1823 * gpgme.h: The following types are renamed. The old name is kept
1824 as a deprecated typedef.
1825 (GpgmeCtx): Rename to gpgme_ctx_t.
1826 (GpgmeData): Rename to gpgme_data_t.
1827 (GpgmeRecipients): Rename to gpgme_recipients_t.
1828 (GpgmeError): Rename to gpgme_error_t.
1829 (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
1830 (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
1831 (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
1832 (GpgmeSigStat): Rename to gpgme_sig_stat_t.
1833 (GpgmeSigMode): Rename to gpgme_sig_mode_t.
1834 (GpgmeAttr): Rename to gpgme_attr_t.
1835 (GpgmeValidity): Rename to gpgme_validity_t.
1836 (GpgmeProtocol): Rename to gpgme_protocol_t.
1837 (GpgmeStatusCode): Rename to gpgme_status_code_t.
1838 (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
1839 (GpgmeSubkey): Rename to gpgme_subkey_t.
1840 (GpgmeKeySig): Rename to gpgme_keysig_t.
1841 (GpgmeUserID): Rename to gpgme_user_id_t.
1842 (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
1843 (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
1844 (GpgmeEditCb): Rename to gpgme_edit_cb_t.
1845 (GpgmeIOCb): Rename to gpgme_io_cb_t.
1846 (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
1847 (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
1848 (GpgmeEventIO): Rename to gpgme_event_io_t.
1849 (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
1850 (GpgmeIOCbs): Rename to gpgme_io_cbs.
1851 (gpgme_io_cbs_t): New type.
1852 (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
1853 (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
1854 (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
1855 (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
1856 (GpgmeDataCbs): Rename to gpgme_data_cbs.
1857 (gpgme_data_cbs_t): New type.
1858 (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
1859 (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
1860 (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
1861 (GpgmeNewSignature): Rename to gpgme_new_signature_t.
1862 (GpgmeSignResult): Rename to gpgme_sign_result_t.
1863 (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
1864 (GpgmeSignature): Rename to gpgme_signature_t.
1865 (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
1866 (GpgmeImportStatus): Rename to gpgme_import_status_t.
1867 (GpgmeImportResult): Rename to gpgme_import_result_t.
1868 (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
1869 (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
1870 (GpgmeTrustItem): Rename to gpgme_trust_item_t.
1871 * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
1872 GPGME_No_Recipients, GPGME_Invalid_Recipient and
1873 GPGME_No_Passphrase.
1874 * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
1875 * context.h (struct gpgme_context_s): Rename to struct
1877 (struct gpgme_recipients_s): Rename to gpgme_recipients.
1879 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
1881 * keylist.c (finish_key): Clear OPD->tmp_uid.
1883 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
1885 * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
1886 for NODATA status without signatures.
1888 2003-05-05 Marcus Brinkmann <marcus@g10code.de>
1890 * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
1891 (_gpgme_key_add_sig): Likewise.
1893 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
1895 * context.h (struct gpgme_context_s): Remove member op_info.
1897 * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
1899 * gpgme.h (GpgmeError): Add deprecated values for
1900 GPGME_Invalid_Type and GPGME_Invalid_Mode.
1902 2003-04-30 Marcus Brinkmann <marcus@g10code.de>
1904 * gpgme.h (gpgme_get_op_info): Remove prototype.
1905 * ops.h (_gpgme_set_op_info,
1906 _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
1907 _gpgme_data_append, _gpgme_data_append_string,
1908 _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
1909 _gpgme_data_append_percentstring_for_xml): Likewise.
1910 (_gpgme_progress_status_handler): Change first arg to void *.
1911 * progress.c (_gpgme_progress_status_handler): Likewise.
1912 * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
1913 and <sys/types.h>, but <string.h>.
1914 (_gpgme_data_append): Remove function.
1915 (_gpgme_data_append_string): Likewise.
1916 (_gpgme_data_append_for_xml): Likewise.
1917 (_gpgme_data_append_string_for_xml): Likewise.
1918 (_gpgme_data_append_percentstring_for_xml): Likewise.
1919 * data-mem.c (_gpgme_data_get_as_string): Likewise.
1920 (_gpgme_data_release_and_return_string): Likewise.
1921 * gpgme.c (gpgme_get_op_info): Likewise.
1922 (_gpgme_set_op_info): Likewise.
1924 * gpgme.h (struct _gpgme_key): New structure.
1925 (GpgmeKey): Define using _gpgme_key.
1926 (struct _gpgme_subkey): New structure.
1927 (GpgmeSubKey): New type.
1928 (struct _gpgme_key_sig): New structure.
1929 (GpgmeKeySig): New type.
1930 (struct _gpgme_user_id): New structure.
1931 (GpgmeUserID): New type.
1932 (struct _gpgme_op_keylist_result): New structure.
1933 (GpgmeKeyListResult): New type.
1934 (gpgme_op_keylist_result): New function.
1935 (gpgme_key_get_as_xml): Remove prototype.
1936 * context.h (struct gpgme_context_s): Remove members tmp_key,
1937 tmp_uid, key_cond and key_queue.
1938 (struct key_queue_item_s): Remove structure.
1939 (struct user_id_s): Remove structure.
1940 (struct gpgme_recipients_s): Replace with simple
1942 * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
1943 * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
1944 _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
1945 * rungpg.c (command_cb): Return GpgmeError instead int.
1946 New variable ERR. Use it to hold return value of cmd handler.
1947 (gpg_delete): Access fingerprint of key directly.
1948 (append_args_from_signers): Likewise.
1949 (gpg_edit): Likewise.
1950 (append_args_from_recipients): Use GpgmeUserID for recipient list.
1951 * engine-gpgsm.c: Do not include "key.h".
1952 (gpgsm_delete): Access fingerprint of key directly.
1953 (gpgsm_sign): Likewise.
1954 (set_recipients): Use GpgmeUserID for recipients. Invert invalid
1956 * key.h: File removed.
1957 * key.c: Completely reworked to use exposed GpgmeKey data types.
1958 * keylist.c: Likewise.
1959 * recipient.c: Completely reworked to use GpgmeUserID.
1961 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
1963 * gpgme.h (gpgme_get_key): Remove force_update argument.
1964 * key-cache.c: File removed.
1965 * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
1966 * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
1968 * keylist.c (_gpgme_op_keylist_event_cb): Don't call
1969 _gpgme_key_cache_add.
1970 (gpgme_get_key): New function.
1971 * verify.c (gpgme_get_sig_key): Remove last argument to
1972 gpgme_get_key invocation.
1974 * gpgme.h (struct _gpgme_trust_item): New structure.
1975 (GpgmeTrustItem): New type.
1976 (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
1977 * context.h (struct trust_queue_item_s): Remove structure.
1978 (struct gpgme_context_s): Remove trust_queue member.
1979 * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
1980 * trust-item.c: New file.
1981 * trustlist.c: Do not include <stdio.h> or <time.h>, but
1983 (struct trust_queue_item_s): Change to new type op_data_t.
1984 (trust_status_handler): Change first argument to void *.
1985 (trust_colon_handler): Likewise.
1986 (_gpgme_op_trustlist_event_cb): Use op_data_t type.
1987 (gpgme_op_trustlist_start): Use op_data_t and rework error
1989 (gpgme_op_trustlist_next): Use op_data_t.
1990 (gpgme_trust_item_release): Remove function.
1991 (gpgme_trust_item_get_string_attr): Likewise.
1992 (gpgme_trust_item_get_int_attr): Likewise.
1994 * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
1997 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
1999 * context.h: Remove OPDATA_VERIFY_COLLECTING.
2000 (struct gpgme_context_s): Remove member notation.
2001 * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
2003 * gpgme.h (struct _gpgme_sig_notation): New structure.
2004 (GpgmeSigNotation): New type.
2005 (struct _gpgme_signature): New structure.
2006 (GpgmeSignature): New type.
2007 (struct _gpgme_op_verify_result): New structure.
2008 (GpgmeVerifyResult): New type.
2009 (gpgme_op_verify_result): New prototype.
2010 (gpgme_get_notation): Remove prototype.
2011 * ops.h (_gpgme_op_verify_init_result): New prototype.
2012 (_gpgme_verify_status_handler): Change first argument to void *.
2013 * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
2015 * conversion.c (_gpgme_decode_percent_string): New function.
2016 (gnupg_errors): New static global.
2017 (_gpgme_map_gnupg_error): New function.
2018 * gpgme.c (gpgme_release): Don't release CTX->notation.
2019 (gpgme_get_notation): Remove function.
2020 * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
2021 _gpgme_op_verify_init_result.
2022 * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
2023 do include "gpgme.h".
2024 (struct verify_result): Replace with ...
2025 (op_data_t): ... this type.
2026 (release_verify_result): Remove function.
2027 (release_op_data): New function.
2028 (is_token): Remove function.
2029 (skip_token): Remove function.
2030 (copy_token): Remove function.
2031 (gpgme_op_verify_result): New function.
2032 (calc_sig_summary): Rewritten.
2033 (finish_sig): Remove function.
2034 (parse_new_sig): New function.
2035 (parse_valid_sig): New function.
2036 (parse_notation): New function.
2037 (parse_trust): New function.
2038 (parse_error): New function.
2039 (_gpgme_verify_status_handler): Rewritten. Change first argument
2041 (_gpgme_op_verify_start): Rework error handling. Call
2042 _gpgme_op_verify_init_result.
2043 (gpgme_op_verify): Do not release or clear CTX->notation.
2044 (gpgme_get_sig_status): Rewritten.
2045 (gpgme_get_sig_string_attr): Likewise.
2046 (gpgme_get_sig_ulong_attr): Likewise.
2047 (gpgme_get_sig_key): Likewise.
2049 * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
2050 (GpgmeDecryptResult): New type.
2051 (gpgme_op_decrypt_result): New prototype.
2052 * ops.h (_gpgme_op_decrypt_init_result): New prototype.
2053 (_gpgme_decrypt_status_handler): Fix prototype.
2054 (_gpgme_decrypt_start): Remove prototype.
2055 * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
2056 <string.h> and <assert.h>, "util.h" and "context.h", but
2058 (decrypt_verify_status_handler): Change first argument to void *,
2059 and rework error handling.
2060 (_gpgme_op_decrypt_verify_start): New function.
2061 (gpgme_op_decrypt_verify_start): Rewrite using
2062 _gpgme_op_decrypt_verify_start.
2063 (gpgme_op_decrypt_verify): Likewise.
2064 * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
2065 (struct decrypt_result): Change to typedef op_data_t, rewritten.
2066 (is_token): Remove function.
2067 (release_op_data): New function.
2068 (skip_token): Remove function.
2069 (gpgme_op_decrypt_result): New function.
2070 (_gpgme_decrypt_status_handler): Change first argument to void *.
2071 Rework error handling.
2072 (_gpgme_decrypt_start): Rename to ...
2073 (decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
2074 (_gpgme_op_decrypt_init_result): New function.
2075 (gpgme_op_decrypt_start): Use decrypt_start.
2076 (gpgme_op_decrypt): Likewise.
2078 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
2080 * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
2081 <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
2082 (_gpgme_op_encrypt_sign_start): Rename to ...
2083 (encrypt_sign_start): ... this.
2084 (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
2085 _gpgme_op_encrypt_sign_start.
2086 (gpgme_op_encrypt_sign): Likewise.
2088 * gpgme.h (GpgmeEncryptResult): New data type.
2089 (gpgme_op_encrypt_result): New prototype.
2090 * ops.h (_gpgme_op_encrypt_init_result): New prototype.
2091 (_gpgme_op_encrypt_status_handler): Fix prototype.
2092 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2093 _gpgme_op_encrypt_init_result.
2094 * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
2095 "wait.h". Include <errno.h> and "gpgme.h".
2096 (SKIP_TOKEN_OR_RETURN): Remove macro.
2097 (struct encrypt_result): Rename to ...
2098 (op_data_t): ... new data type. Rewrite for user result data.
2099 (append_xml_encinfo): Remove function.
2100 (release_op_data): New function.
2101 (gpgme_op_encrypt_result): New function.
2102 (_gpgme_op_encrypt_status_handler): Change first argument to void *.
2103 Rewrite result parsing.
2104 (_gpgme_op_encrypt_sym_status_handler): Change first argument to
2106 (_gpgme_op_encrypt_init_result): New function.
2107 (_gpgme_op_encrypt_start): Rename to ...
2108 (encrypt_start): ... this.
2109 (gpgme_op_encrypt_start): Use encrypt_start, not
2110 gpgme_op_encrypt_start.
2111 (gpgme_op_encrypt): Likewise.
2113 * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
2114 GpgmeNewSignature, GpgmeSignResult): New data types.
2115 (gpgme_op_sign_result, gpgme_pubkey_algo_name,
2116 gpgme_hash_algo_name): New prototypes.
2117 * gpgme.c (gpgme_pubkey_algo_name): New function.
2118 (gpgme_hash_algo_name): Likewise.
2119 * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
2121 (_gpgme_op_sign_status_handler): Fix prototype.
2122 * op-support.c: Include <errno.h> and <string.h>.
2123 (_gpgme_parse_inv_userid): New function.
2124 * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
2125 <assert.h> and "util.h".
2126 (SKIP_TOKEN_OR_RETURN): Remove macro.
2127 (struct sign_result): Change to op_data_t type and rework it.
2128 (release_sign_result): Rename to ...
2129 (release_op_data): ... this and rewrite it.
2130 (append_xml_info): Remove function.
2131 (gpgme_op_sign_result): New function.
2132 (parse_sig_created): New function.
2133 (_gpgme_sign_status_handler): Change first argument to void *.
2134 Rewrite the function to use the new result structure and functions.
2135 (_gpgme_op_sign_init_result): New function.
2136 (_gpgme_op_sign_start): Rename to ...
2137 (sign_start): ... this. Call _gpgme_op_sign_init_result.
2138 (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
2139 (gpgme_op_sign): Likewise.
2140 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
2141 _gpgme_op_sign_init_result.
2143 * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
2145 (enum delete_problem): Move into function delete_status_handler.
2146 (delete_status_handler): Change first argument to void *. Parse
2147 delete problem with strtol instead atoi. Return better error
2149 (_gpgme_op_delete_start): Rename to ...
2150 (delete_start): ... this. Rework error handling.
2151 (gpgme_op_delete_start): Use delete_start instead
2152 _gpgme_op_delete_start.
2153 (gpgme_op_delete): Likewise.
2154 * gpgme.h (GpgmeDataType): Removed.
2156 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
2158 * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
2159 * import.c (parse_import_res): Parse unchanged field.
2161 * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
2162 GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
2163 (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
2164 GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
2165 GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
2166 GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
2167 GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
2168 GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
2169 GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
2170 (struct _gpgme_import_status): New structure.
2171 (GpgmeImportStatus): New type.
2172 (struct _gpgme_op_import_result): New structure.
2173 (GpgmeImportResult): New type.
2174 (gpgme_op_import_result): New function.
2175 * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
2176 (struct import_result): Change to type op_data_t.
2177 (release_import_result): Rename to ...
2178 (release_op_data): ... this.
2179 (append_xml_impinfo): Function removed.
2180 (gpgme_op_import_result): New function.
2181 (parse_import): New function.
2182 (parse_import_res): Likewise.
2183 (import_status_handler): Change first argument to void *. Rewrite
2184 to use new functions.
2185 (_gpgme_op_import_start): Rework error handling.
2187 * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
2188 (edit_resut): Change to typedef for op_data_t.
2189 (edit_status_handler): Change first argument to void *.
2190 Rework error handling.
2191 (command_handler): Rework error handling.
2192 (_gpgme_op_edit_start): Rename to ...
2193 (edit_start): ... this. Rework error handling.
2194 (gpgme_op_edit_start): Rewrite using edit_start.
2195 (gpgme_op_edit): Likewise.
2197 * ops.h (_gpgme_passphrase_start): Remove prototype.
2198 * passphrase.c: Do not include <assert.h>, "util.h" or
2199 "debug.h", but "gpgme.h".
2200 (struct passphrase_result): Change to typedef for op_data_t.
2201 (release_passphrase_result): Rename to release_op_data.
2202 (_gpgme_passphrase_status_handler): Change first argument to void *.
2203 Use new op_data_t type.
2204 (_gpgme_passphrase_command_handler): Use new op_data_t type.
2205 (_gpgme_passphrase_start): Remove function.
2206 * decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
2207 not call _gpgme_passphrase_start, but install command handler.
2208 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2209 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2210 * sign.c (_gpgme_op_sign_start): Likewise.
2212 * context.h (struct gpgme_context_s): Remove member initialized,
2213 use_cms and help_data_1. Add member protocol. Make use_armor and
2214 use_textmode bit flags. Make keylist_mode, include_certs,
2215 signers_len and signers_size unsigned.
2216 * gpgme.c (gpgme_new): Initialize CTX->protocol.
2217 (gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
2218 (gpgme_get_protocol): Likewise.
2219 (gpgme_release): Do not release CTX->help_data_1.
2220 * op-support.c (_gpgme_op_reset): Use CTX->protocol.
2222 * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
2224 * data.c: Do not include <assert.h>, but "gpgme.h".
2225 (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
2226 it will go. Do not assert DH.
2227 (_gpgme_data_outbound_handler): Do not assert DH.
2229 * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
2231 (export_status_handler): Change type of first argument to void *.
2232 (_gpgme_op_export_start): Rename to ...
2233 (export_start): ... this. Rework error handling.
2234 (gpgme_op_export_start): Rewritten to use export_start instead
2235 _gpgme_op_export_start.
2236 (gpgme_op_export): Likewise.
2238 * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
2239 (GPGME_No_Recipients, GPGME_Invalid_Recipient,
2240 GPGME_No_Passphrase): New macros.
2242 * key.c (gpgme_key_get_string_attr): Fix validity attribute.
2244 2003-04-24 Marcus Brinkmann <marcus@g10code.de>
2246 * gpgme.h (struct _gpgme_op_genkey_result): New structure.
2247 (GpgmeGenKeyResult): New type.
2248 (gpgme_op_genkey): Drop last argument.
2249 (gpgme_op_genkey_result): New function.
2250 * genkey.c: Do not include "util.h", but "gpgme.h".
2251 (struct genkey_result): Replace with ...
2252 (op_data_t): ... this new type.
2253 (release_genkey_result): Replace with ...
2254 (release_op_data): ... this new function.
2255 (gpgme_op_genkey_result): New function.
2256 (genkey_status_handler): Rewritten using new op_data_t type.
2257 (get_key_parameter): New function.
2258 (_gpgme_op_genkey_start): Renamed to
2259 (genkey_start): ... this and rewritten.
2260 (gpgme_op_genkey_start): Use genkey_start instead
2261 _gpgme_op_genkey_start.
2262 (gpgme_op_genkey): Rewritten. Remove FPR argument.
2264 * context.h (struct gpgme_context_s): Remove member verbosity.
2265 * gpgme.c (gpgme_new): Do not set member verbosity.
2266 * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
2267 * engine.c (_gpgme_engine_set_verbosity): Remove function.
2268 * engine-backend.h (struct engine_ops): Remove set_verbosity.
2269 * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
2270 * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
2271 (gpg_set_verbosity): Remove function.
2272 * decrypt.c (_gpgme_decrypt_start): Don't call
2273 _gpgme_engine_set_verbosity.
2274 * delete.c (_gpgme_op_delete_start): Likewise.
2275 * edit.c (_gpgme_op_edit_start): Likewise.
2276 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2277 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2278 * export.c (_gpgme_op_export_start): Likewise.
2279 * genkey.c (_gpgme_op_genkey_start): Likewise.
2280 * import.c (_gpgme_op_import_start): Likewise.
2281 * keylist.c (gpgme_op_keylist_start): Likewise.
2282 (gpgme_op_keylist_ext_start): Likewise.
2283 * sign.c (_gpgme_op_sign_start): Likewise.
2284 * verify.c (_gpgme_op_verify_start): Likewise.
2286 * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
2287 * key.c (key_cache_initialized, key_cache_size,
2288 key_cache_max_chain_length, ): Removed.
2289 (struct key_cache_item_s, key_cache_lock, key_cache,
2290 key_cache_unused_items, hash_key, _gpgme_key_cache_add,
2291 _gpgme_key_cache_get, gpgme_get_key): Moved to ...
2292 * key-cache.c: ... here. New file.
2293 * key.h (_gpgme_key_cache_init): Remove prototypes.
2294 (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
2296 * version.c: Do not include "key.h".
2297 (do_subsystem_inits): Do not call _gpgme_key_cache_init.
2299 * mkstatus: Strip trailing comma.
2300 * gpgme.h (GpgmeStatus): Pretty print.
2302 * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
2303 GPGME_Bad_Passphrase.
2304 * passphrase.c (_gpgme_passphrase_status_handler): Use
2305 GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
2307 * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
2308 GPGME_No_UserID and GPGME_Invalid_Recipient to
2309 GPGME_Invalid_UserID.
2310 * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
2311 instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
2312 GPGME_Invalid_Recipient.
2313 (_gpgme_op_encrypt_start): Likewise.
2315 * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
2316 * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
2317 * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
2318 * wait-global.c (gpgme_wait): Likewise.
2319 * verify.c (_gpgme_op_verify_start): Likewise.
2320 (gpgme_get_sig_status): Don't check pending flag.
2321 (gpgme_get_sig_string_attr): Likewise.
2322 (gpgme_get_sig_ulong_attr): Likewise.
2323 (gpgme_get_sig_key): Likewise.
2324 * op-support.c (_gpgme_op_reset): Likewise.
2325 * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
2326 (gpgme_op_trustlist_next): Don't check or clear pending flag.
2327 (gpgme_op_trustlist_end): Likewise.
2328 * sign.c (_gpgme_op_sign_start): Likewise.
2329 * context.h (struct gpgme_context_s): Remove member PENDING.
2330 * decrypt.c (_gpgme_decrypt_start): Likewise.
2331 * delete.c (_gpgme_op_delete_start): Likewise.
2332 * edit.c (_gpgme_op_edit_start): Likewise.
2333 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
2334 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
2335 * export.c (_gpgme_op_export_start): Likewise.
2336 * genkey.c (_gpgme_op_genkey_start): Likewise.
2337 * import.c (_gpgme_op_import_start): Likewise.
2338 * key.c (gpgme_get_key): Likewise.
2339 * keylist.c (gpgme_op_keylist_start): Likewise.
2340 (gpgme_op_keylist_ext_start): Likewise.
2341 (gpgme_op_keylist_next): Likewise.
2342 (gpgme_op_keylist_end): Likewise.
2343 * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
2345 2003-02-06 Marcus Brinkmann <marcus@g10code.de>
2347 * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
2348 and add argument for returning the result string.
2349 (gpgme_cancel): Remove prototype.
2350 * gpgme.c (gpgme_cancel): Remove function.
2351 * context.h (struct gpgme_context_s): Remove member cancel.
2352 * passphrase.c (_gpgme_passphrase_command_handler): Call the
2353 passphrase callback in the new way.
2355 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2357 * edit.c (_gpgme_edit_status_handler): Call the progress status
2360 2003-02-05 Marcus Brinkmann <marcus@g10code.de>
2362 * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
2363 I/O handlers left to ...
2364 (_gpgme_user_io_cb_handler): ... here.
2366 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2368 * trustlist.c (trustlist_colon_handler): Release ITEM if name
2369 could not be allocated.
2370 (gpgme_trust_item_release): Only release name if it is allocated.
2371 Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
2373 2003-02-04 Marcus Brinkmann <marcus@g10code.de>
2375 * rungpg.c (read_status): If he status handler returns an error,
2377 (status_handler): If read_status fails, just return the error.
2379 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2381 * engine-gpgsm.c (start): Handle all errors, not only most of
2383 (xtoi_1, xtoi_2): Remove macro.
2384 (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
2386 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
2388 * engine-gpgsm.c (map_assuan_error): Replace
2389 ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
2390 (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
2392 * util.h (DIMof): Remove macro.
2394 * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
2395 _gpgme_data_unread): Prototypes removed.
2397 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2399 * types.h: File removed.
2400 * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
2401 * io.h (struct spawn_fd_item_s): Do not include "types.h".
2403 * context.h: Likewise.
2404 * cengine-gpgsm.h: Likewise.
2405 * engine.h: Include "gpgme.h" instead "types.h". Add prototypes
2406 for EngineStatusHandler, EngineColonLineHandler and
2407 EngineCommandHandler.
2408 (_gpgme_engine_set_status_handler): Change parameter type from
2409 GpgmeStatusHandler to EngineStatusHandler.
2410 (_gpgme_engine_set_command_handler): Change parameter type from
2411 GpgmeCommandHandler to EngineCommandHandler.
2412 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2413 GpgmeColonLineHandler to EngineColonLineHandler.
2414 * engine-backend.h: Include "engine.h" instead "types.h".
2415 (struct engine_ops): Change Gpgme*Handler parameters in members
2416 set_command_handler, set_colon_line_handler and set_status_handler
2418 * engine.c (_gpgme_engine_set_status_handler): Change parameter
2419 type from GpgmeStatusHandler to EngineStatusHandler.
2420 (_gpgme_engine_set_command_handler): Change parameter type from
2421 GpgmeCommandHandler to EngineCommandHandler.
2422 (_gpgme_engine_set_colon_line_handler): Change parameter type from
2423 GpgmeColonLineHandler to EngineColonLineHandler.
2424 * rungpg.c (struct gpg_object_s): Change type of member status.fnc
2425 from GpgmeStatusHandler to EngineStatusHandler. Change type of
2426 member colon.fnc from GpgmeColonLineHandler to
2427 EngineColonLineHandler. Change type of member cmd.fnc from
2428 GpgmeCommandHandler to EngineCommandHandler.
2429 * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
2430 * rungpg.c (gpg_set_status_handler): Change parameter type from
2431 GpgmeStatusHandler to EngineStatusHandler.
2432 * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
2433 (assuan_simple_command): Likewise.
2434 * rungpg.c (gpg_set_colon_line_handler): Change parameter type
2435 from GpgmeColonLineHandler to EngineColonLineHandler.
2436 * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
2437 * rungpg.c (gpg_set_command_handler): Change parameter type from
2438 GpgmeCommandHandler to EngineCommandHandler.
2440 * engine-gpgsm.c (status_handler): Do not close status fd at end
2443 * ops.h (_gpgme_op_data_lookup): Add prototype.
2444 * op-support.c: Include <stdlib.h>.
2445 (_gpgme_op_data_lookup): New function.
2446 * decrypt.c (_gpgme_release_decrypt_result): Function removed.
2447 (struct decrypt_result_s): Rename to ...
2448 (struct decrypt_resul): ... this.
2449 (DecryptResult): New type.
2450 (_gpgme_decrypt_status_handler): Don't use
2451 test_and_allocate_result, but use _gpgme_op_data_lookup to
2452 retrieve result data object.
2453 * sign.c (_gpgme_release_sign_result): Function removed.
2454 (release_sign_result): New function.
2455 (struct sign_result_s): Rename to ...
2456 (struct sign_result): ... this.
2457 (SignResult): New type.
2458 (_gpgme_sign_status_handler): Don't use
2459 test_and_allocate_result, but use _gpgme_op_data_lookup to
2460 retrieve result data object.
2461 * encrypt.c (struct encrypt_result_s): Rename to ...
2462 (struct encrypt_result): ... this.
2463 (_gpgme_release_encrypt_result): Function removed.
2464 (release_encrypt_result): New function.
2465 (_gpgme_encrypt_status_handler): Don't use
2466 test_and_allocate_result, but use _gpgme_op_data_lookup to
2467 retrieve result data object.
2468 * verify.c (struct verify_result_s): Rename to ...
2469 (struct verify_result): ... this. Remove member next.
2470 (VerifyResult): New type.
2471 (_gpgme_release_verify_result): Function removed.
2472 (release_verify_result): New function.
2473 (finish_sig): Change first argument to type VerifyResult. Diddle
2474 the type of the op_data structure.
2475 (add_notation): Change first argument to type VerifyResult.
2476 (_gpgme_verify_status_handler): Don't use
2477 test_and_allocate_result, but use _gpgme_op_data_lookup to
2478 retrieve result data object.
2479 * passphrase.c (struct passphrase_result_s): Rename to ...
2480 (struct passphrase_result): ... this. Remove member next.
2481 (PassphraseResult): New type.
2482 (_gpgme_release_passphrase_result): Function removed.
2483 (release_passphrase_result): New function.
2484 (_gpgme_passphrase_status_handler): Don't use
2485 test_and_allocate_result, but use _gpgme_op_data_lookup to
2486 retrieve result data object.
2487 (_gpgme_passphrase_command_handler): Likewise.
2488 * keylist.c (struct keylist_result_s): Rename to ...
2489 (struct keylist_result): ... this. Remove member next.
2490 (KeylistResult): New type.
2491 (_gpgme_release_keylist_result): Function removed.
2492 (release_keylist_result): New function.
2493 (keylist_status_handler): Don't use
2494 test_and_allocate_result, but use _gpgme_op_data_lookup to
2495 retrieve result data object.
2496 * edit.c (struct edit_result_s): Rename to ...
2497 (struct edit_result): ... this. Remove member next.
2498 (EditResult): New type.
2499 (_gpgme_release_edit_result): Function removed.
2500 (release_edit_result): New function.
2501 (edit_status_handler): Don't use
2502 test_and_allocate_result, but use _gpgme_op_data_lookup to
2503 retrieve result data object.
2504 (command_handler): Likewise.
2505 * types.h (DecryptResult, SignResult, EncryptResult,
2506 PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
2507 KeylistResult, EditResult): Types removed.
2508 * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
2509 (test_and_allocate_result): Remove macro.
2510 (_gpgme_release_decrypt_result): Remove prototype.
2511 (_gpgme_decrypt_result): Remove prototype.
2512 (_gpgme_release_sign_result): Remove prototype.
2513 (_gpgme_release_encrypt_result): Remove prototype.
2514 (_gpgme_release_passphrase_result): Remove prototype.
2515 (_gpgme_release_import_result): Remove prototype.
2516 (_gpgme_release_delete_result): Remove prototype.
2517 (_gpgme_release_genkey_result): Remove prototype.
2518 (_gpgme_release_keylist_result): Remove prototype.
2519 (_gpgme_release_edit_result): Remove prototype.
2520 (_gpgme_release_verify_result): Remove prototype.
2521 * gpgme.c (_gpgme_release_result): Rewritten.
2522 * context.h (enum ctx_op_data_type): New enum.
2523 (struct ctx_op_data): New structure.
2524 (struct gpgme_context_s): Replace the member result with a member
2526 (fail_on_pending_request): Remove macro.
2527 * op-support.c (_gpgme_op_reset): Expand macro
2528 fail_on_pending_request.
2529 * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
2531 2003-01-30 Marcus Brinkmann <marcus@g10code.de>
2533 * types.h (EngineObject): Move typedef to ...
2534 * engine.h: ... here.
2535 * types.h (GpgObject): Move typedef to ...
2536 * rungpg.c: ... here.
2537 * types.h (GpgsmObject): Move typedef to ...
2538 * engine-gpgsm.c: ... here.
2540 * util.h (return_if_fail, return_null_if_fail,
2541 return_val_if_fail): Remove macro.
2542 * gpgme.c (gpgme_cancel): Don't use return_if_fail.
2543 * key.c (gpgme_key_ref): Likewise.
2544 * signers.c (gpgme_signers_enum): Likewise.
2545 (gpgme_signers_clear): Likewise.
2547 * engine-backend.h (struct engine_ops): Rename get_path to
2549 * gpgme.h (struct _gpgme_engine_info): Rename member path to
2551 * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
2552 util.h. Other clean ups.
2553 (parse_version_number): Protect more seriously against
2555 (gpgme_get_engine_info): Move to ...
2556 * engine.c (gpgme_get_engine_info): ... here.
2557 (_gpgme_engine_get_info): Function removed.
2558 (_gpgme_engine_get_path): Make static and rename to ...
2559 (engine_get_file_name): .. this.
2560 (_gpgme_engine_get_version): Make static and rename to ...
2561 (engine_get_version): ... this.
2562 (_gpgme_engine_get_req_version): Make static and rename to ...
2563 (engine_get_req_version): ... this.
2564 * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
2565 _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
2568 * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
2569 * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
2570 (gpgme_get_protocol_name): New function.
2572 * engine-backend.h (struct engine_ops): New member
2573 get_req_version, remove member check_version.
2574 * engine.h (_gpgme_Engine_get_version): New prototype.
2575 * rungpg.c (gpg_get_req_version): New function.
2576 (gpg_check_version): Function removed.
2577 (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
2579 * engine-gpgsm.c (gpgsm_get_req_version): New function.
2580 (gpgsm_check_version): Function removed.
2581 (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
2582 gpgsm_check_version.
2583 * engine.c: Include ops.h.
2584 (_gpgme_engine_get_req_version): New function.
2585 (gpgme_engine_check_version): Rewritten.
2586 * version.c (gpgme_get_engine_info): Rewritten.
2587 * gpgme.h (gpgme_engine_info): New structure.
2588 (GpgmeEngineInfo): New type.
2590 2003-01-29 Marcus Brinkmann <marcus@g10code.de>
2592 * types.h: Remove byte and ulong types.
2593 * util.h (_gpgme_hextobyte): Change prototype to unsigned char
2595 * conversion.c (_gpgme_hextobyte): Change argument to unsigned
2597 (_gpgme_decode_c_string): Likewise, and beautify. Also support a
2598 few more escaped characters. Be more strict about buffer size.
2599 (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
2600 BUF and DST to unsigned char instead byte.
2601 * progress.c (_gpgme_progress_status_handler): Use unsigned char
2603 * debug.c (trim_spaces): Likewise.
2605 * util.h (mk_error): Remove macro.
2606 * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
2607 edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
2608 export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
2609 passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
2610 signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
2611 wait-private (literally everywhere): Expand the mk_error macro.
2613 * context.h (wait_on_request_or_fail): Remove macro.
2615 * context.h (gpgme_context_s): Remove member ERROR.
2616 * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
2617 (GpgmeCommandHandler): Change return type to GpgmeError and add
2618 new argument RESULT.
2619 * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
2620 (GpgmeEventIO): New event GPGME_EVENT_START.
2621 (GpgmeIdleFunc): Remove type.
2622 (gpgme_register_idle): Remove prototype.
2623 * data.c: Include <assert.h>.
2624 (_gpgme_data_inbound_handler): Change return type to GpgmeError.
2625 Return any error instead ignoring it, don't close file descriptor
2627 (_gpgme_data_outbound_handler): Likewise.
2628 * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
2629 (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
2630 Return error instead setting ctx->error. Return success at end of
2632 (gpgme_op_decrypt): Don't work around the old kludge anymore.
2633 * decrypt-verify.c (decrypt_verify_status_handler): Change return
2634 type to GpgmeError. Return possible errors.
2635 * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
2637 (delete_status_handler): Change return type to GpgmeError. Return
2638 error instead setting ctx->error. Return success at end of
2640 * edit.c: Do not include <stdio.h> and <string.h>.
2641 (_gpgme_edit_status_handler): Change type to GpgmeError,
2642 make static and rename to ...
2643 (edit_status_handler): ... this. Return error directly.
2644 (command_handler): Change return type to GpgmeError, add result
2645 argument. Return error directly.
2646 * encrypt.c (status_handler_finish): Remove function.
2647 (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
2648 Return error directly.
2649 (_gpgme_encrypt_sym_status_handler): Likewise.
2650 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2651 * engine-gpgsm.c (close_notify_handler): Do not signal done event
2653 (status_handler): Change return type to GpgmeError. Diddle things
2654 around a bit to return errors directly.
2655 (start): Send start event.
2656 * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
2657 (export_status_handler): Change return type to GpgmeError. Don't
2659 * genkey.c: Do not include <stdio.h> and <assert.h>.
2660 (genkey_status_handler): Change return type to GpgmeError. Don't
2661 check ctx->error. Return errors directly.
2662 * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
2663 (_gpgme_op_event_cb): Function removed.
2664 (_gpgme_op_event_cb_user): Likewise.
2665 * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
2666 (import_status_handler): Change return type to GpgmeError. Don't
2668 * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
2669 Change return type to GpgmeError, return error directly.
2670 * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
2671 wait-private.c and wait-user.c
2672 * ops.h (test_and_allocate_result): Return error instead setting
2674 (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
2675 _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
2676 _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
2677 _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
2678 Change return type to GpgmeError.
2679 (_gpgme_passphease_command_handler): Change return type to
2680 GpgmeError and add new argument RESULT.
2681 * op-support.c: Use new callback functions, and change private
2682 data to ctx everywhere.
2683 * passphrase.c (_gpgme_passphrase_status_handler): Change return
2684 type to GpgmeError, return error directly.
2685 (_gpgme_passphrase_command_handler): Change return type to
2686 GpgmeError, add result argument. Return results accordingly.
2687 * progress.c (_gpgme_progress_status_handler): Change return type
2688 to GpgmeError, return errors directly.
2689 * rungpg.c (status_handler): Change return type to GpgmeError.
2690 Return error directly.
2691 (close_notify_handler): Don't send done event.
2692 (colon_line_handler): Change return type to GpgmeError, return
2694 * rungpg.c (start): Send start event.
2695 * sign.c (_gpgme_sign_status_handler): Change return type to
2696 GpgmeError, return errors directly.
2697 * trustlist.c (trustlist_status_handler): Change return type to
2698 GpgmeError. Return 0.
2699 (trustlist_colon_handler): Change return type GpgmeError. Return
2701 * verify.c (add_notation): Change return type to GpgmeError,
2702 return errors directly.
2703 (_gpgme_verify_status_handler): Likewise.
2704 * wait.h (struct fd_table): Remove lock member.
2705 (struct wait_item_s): Moved here from wait.c.
2706 (struct tag): New structure.
2707 (_gpgme_wait_event_cb): Remove prototype.
2708 (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
2709 _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
2710 _gpgme_wait_user_event_io_cb): New prototypes.
2711 * wait.c: Don't include <stdio.h>.
2712 (ftd_global, ctx_done_list, ctx_done_list_size,
2713 ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
2715 (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
2717 (gpgme_wait): Move to file wait-global.c.
2718 (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
2719 member in wait item and tag.
2720 (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock.
2721 (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
2723 (gpgme_fd_table_init): Don't initialize FDT->lock.
2724 (gpgme_fd_table_deinit): Don't destroy FDT->lock.
2725 (_gpgme_fd_table_put): Make static and rename to ...
2726 (fd_table_put): ... this function. Don't use FDT->lock.
2727 (struct wait_item_s): Move to wait.h.
2728 * wait-global.c: New file.
2729 * wait-private.c: New file.
2730 * wait-user.c: New file.
2732 * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
2733 instead otrust_to_string to calculate validity.
2735 2003-01-19 Miguel Coca <mcoca@gnu.org>
2737 * w32-io.c (_gpgme_io_select): Add missing argument in calls to
2739 * w32-util.c: Include "sema.h".
2740 (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
2743 2003-01-19 Marcus Brinkmann <marcus@g10code.de>
2745 * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
2746 (gpg_start): Rename to ...
2747 (start): ... this function. Change arguments to GpgObject.
2748 (gpg_decrypt): Call start.
2749 (gpg_edit): Likewise.
2750 (gpg_encrypt): Likewise.
2751 (gpg_encrypt_sign): Likewise.
2752 (gpg_export): Likewise.
2753 (gpg_import): Likewise.
2754 (gpg_keylist): Likewise.
2755 (gpg_keylist_ext): Likewise.
2756 (gpg_trustlist): Likewise.
2757 (gpg_verify): Likewise.
2759 * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
2760 (gpgsm_start): Rename to ...
2761 (struct gpgsm_object_s): Remove member command.
2762 (gpgsm_release): Don't free command.
2763 (start): ... this function. Change arguments to GpgsmObject and
2765 (gpgsm_decrypt): Call start.
2766 (gpgsm_delete): Likewise.
2767 (gpgsm_encrypt): Likewise.
2768 (gpgsm_export): Likewise.
2769 (gpgsm_genkey): Likewise.
2770 (gpgsm_import): Likewise.
2771 (gpgsm_keylist): Likewise.
2772 (gpgsm_keylist_ext): Likewise.
2773 (gpgsm_verify): Likewise.
2775 * decrypt.c (_gpgme_decrypt_start): Don't call
2776 _gpgme_engine_start.
2777 * delete.c (_gpgme_op_delete_start): Likewise.
2778 * edit.c (_gpgme_op_edit_start): Likewise.
2779 * encrypt.c (_gpgme_op_encrypt_start):
2780 * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
2781 * export.c (_gpgme_op_export_start): Likewise.
2782 * genkey.c (_gpgme_op_genkey_start): Likewise.
2783 * import.c (_gpgme_op_import_start): Likewise.
2784 * keylist.c (gpgme_op_keylist_ext_start): Likewise.
2785 (gpgme_op_keylist_start): Likewise.
2786 * sign.c (_gpgme_op_sign_start): Likewise.
2787 * trustlist.c (gpgme_op_trustlist_start): Likewise.
2788 * verify.c (_gpgme_op_verify_start): Likewise.
2790 * engine-backend.h (struct engine_ops): Remove member start.
2792 * engine.h (_gpgme_engine_start): Remove prototype.
2793 * engine.c (_gpgme_engine_start): Remove function.
2795 2003-01-06 Werner Koch <wk@gnupg.org>
2797 * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
2798 since gpg 1.3 to denote disabled keys.
2800 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
2802 * data-mem.c: Include <string.h>.
2803 * engine.c: Likewise.
2805 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
2807 * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
2809 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
2811 * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
2813 * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
2815 * verify.c (gpgme_op_verify): Drop R_STAT argument.
2816 (_gpgme_intersect_stati): Function removed.
2817 * ops.h (_gpgme_intersect_stati): Remove prototype.
2819 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
2821 * libgpgme.vers: New file.
2822 * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
2823 (libgpgme_version_script_cmd): New variable.
2824 (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
2825 (libgpgme_la_DEPENDENCIES): New variable.
2827 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
2829 * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
2830 (otrust_to_string): New function.
2831 (gpgme_key_get_as_xml): Use it.
2832 (validity_to_string): New function.
2833 (gpgme_key_get_string_attr): Beautify using above functions.
2834 (gpgme_key_get_ulong_attr): Likewise.
2836 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
2838 * data-mem.c (mem_release): Fix gcc warning.
2839 * data-user.c (user_release): Likewise.
2841 2002-12-06 Marcus Brinkmann <marcus@g10code.de>
2843 * data.h (gpgme_data_release_cb): Change return type to void.
2844 (gpgme_data_read_cb): Change return type to ssize_t.
2845 * data.c (gpgme_data_read): Likewise.
2846 * data-stream.c (stream_read): Likewise.
2847 * data-fd.c (fd_read): Likewise.
2848 * data-mem.c (mem_read): Likewise.
2849 (mem_release): Change return type to void.
2850 * data-user.c (user_read): Change return type to ssize_t.
2851 (user_release): Change return type to void.
2852 * data-compat.c (old_user_read): Change return type to ssize_t.
2853 * gpgme.h (GpgmeDataReadCb): Likewise.
2854 (gpgme_data_read): Likewise.
2855 (GpgmeDataSeekCb): Change return type to off_t.
2857 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
2859 * gpgme.h: Add prototype for gpgme_get_key.
2860 * key.c (gpgme_get_key): New function.
2861 * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
2863 * gpgme.h: Add prototypes for new interfaces
2864 gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
2865 (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
2866 * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
2867 * key.h (struct certsig_s): New members ALGO, NAME_PART,
2868 EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
2870 * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
2871 Use that to determine if allocation is desired or not.
2872 * util.h: Adjust prototype of _gpgme_decode_c_string.
2873 * keylist.c (keylist_colon_handler): Adjust caller of
2874 _gpgme_decode_c_string.
2876 * key.h (struct gpgme_key_s): New member last_uid.
2877 * key.c (_gpgme_key_append_name): Rewritten using
2878 _gpgme_decode_c_string and the last_uid pointer.
2879 (my_isdigit): Macro removed.
2880 (ALLOC_CHUNK): Likewise.
2881 * keylist.c (set_userid_flags): Use last_uid member of KEY.
2883 * context.h (struct user_id_s): New member last_certsig.
2884 * key.h: Add prototype for _gpgme_key_add_certsig.
2885 * key.c (_gpgme_key_add_certsig): New function.
2886 (set_user_id_part): Move function before _gpgme_key_add_certsig.
2887 (parse_user_id): Change first argument to SRC, add new arguments
2888 NAME, EMAIL and COMMENT. Change code to use these arguments
2889 instead going through UID. Move function before
2891 (parse_x509_user_id): Likewise.
2892 (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
2893 and parse_user_id invocation.
2894 (one_certsig_as_xml): New function.
2895 (one_uid_as_xml): Print signatures.
2896 * context.h (struct gpgme_context_s): New member TMP_UID.
2897 * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
2900 * key.c (get_certsig): New function.
2901 (gpgme_key_sig_get_string_attr): Likewise.
2902 (gpgme_key_sig_get_ulong_attr): Likewise.
2904 * keylist.c: Include <ctype.h>.
2905 (my_isdigit): Macro removed.
2906 (set_mainkey_trust_info): Use isdigit, not my_isdigit.
2907 (set_userid_flags): Likewise.
2908 (set_subkey_trust_info): Likewise.
2909 (set_ownertrust): Likewise.
2910 (finish_key): Move function up a bit and remove prototype.
2912 * rungpg.c (gpg_keylist_ext): Correct precedence of signature
2914 (gpg_keylist_ext): Implement signature listing mode.
2916 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
2918 * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
2919 * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
2921 * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
2922 CloseHandle for parent fds.
2924 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
2926 * gpgme.h [_MSC_VER]: Define ssize_t as long.
2928 2002-11-22 Werner Koch <wk@gnupg.org>
2930 * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
2931 setlocale before doing another setlocale.
2933 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
2935 * decrypt.c: Some beautyfication.
2937 * verify.c (_gpgme_verify_status_handler): Treat
2938 GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
2939 Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
2941 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
2943 * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
2944 (struct genkey_result_s): Add new member FPR.
2945 (_gpgme_release_genkey_result): Free RESULT->fpr if set.
2946 (genkey_status_handler): Extract the fingerprint from the status
2948 (gpgme_op_genkey): Add new argument FPR and return the fingerprint
2950 * gpgme.h: Adjust prototype of gpgme_op_genkey.
2952 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
2954 * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
2955 twice, to get fingerprints on subkeys. Suggested by Timo Schulz
2956 <twoaday@freakmail.de>.
2957 (gpg_keylist_ext): Likewise.
2959 2002-11-05 Marcus Brinkmann <marcus@g10code.de>
2961 * import.c (append_xml_impinfo): Use
2962 _gpgme_data_append_string_for_xml rather than
2963 _gpgme_data_append_string for the field content.
2964 Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2966 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
2968 * rungpg.h, engine-gpgsm.h: File removed.
2969 * engine-backend.h: New file.
2970 * Makefile.am (gpgsm_components): New variable, set depending on
2971 automake conditional HAVE_GPGSM.
2972 (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
2973 engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}.
2974 (status-table.h): Depend on gpgme.h, not rungpg.h.
2975 * conversion.c: Include <stdlib.h>.
2976 * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include
2977 "engine-backend.h" instead "engine-gpgsm.h". Reorder some
2978 functions and remove all function prototypes.
2979 (_gpgme_gpgsm_get_version): Make static and rename to ...
2980 (gpgsm_get_version): ... this.
2981 (_gpgme_gpgsm_check_version): Make static and rename to ...
2982 (gpgsm_check_version): ... this.
2983 (_gpgme_gpgsm_new): Make static. Change argument type from
2984 GpgsmObject * to void **. Call gpgsm_release instead
2985 _gpgme_gpgsm_release.
2986 (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
2987 (gpgsm_check_decrypt): ... this.
2988 (_gpgme_gpgsm_op_delete): Make static and rename to ...
2989 (gpgsm_check_delete): ... this.
2990 (_gpgme_gpgsm_set_recipients): Make static and rename to ...
2991 (gpgsm_check_set_recipients): ... this.
2992 (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
2993 (gpgsm_encrypt): ... this.
2994 (_gpgme_gpgsm_op_export): Make static and rename to ...
2995 (gpgsm_export): ... this.
2996 (_gpgme_gpgsm_op_genkey): Make static and rename to ...
2997 (gpgsm_genkey): ... this.
2998 (_gpgme_gpgsm_op_import): Make static and rename to ...
2999 (gpgsm_import): ... this.
3000 (_gpgme_gpgsm_op_keylist): Make static and rename to ...
3001 (gpgsm_keylist): ... this.
3002 (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
3003 (gpgsm_keylist_ext): ... this.
3004 (_gpgme_gpgsm_op_sign): Make static and rename to ...
3005 (gpgsm_sign): ... this.
3006 (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
3007 (gpgsm_trustlist): ... this.
3008 (_gpgme_gpgsm_op_verify): Make static and rename to ...
3009 (gpgsm_verify): ... this.
3010 (gpgsm_status_handler): Rename to ...
3011 (status_handler): ... this.
3012 (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
3013 (gpgsm_set_status_handler): ... this.
3014 (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
3015 (gpgsm_set_colon_line_handler): ... this.
3016 (_gpgme_gpgsm_add_io_cb): Rename to ...
3017 (add_io_cb): ... this.
3018 (_gpgme_gpgsm_start): Make static and rename to ...
3019 (gpgsm_start): ... this.
3020 (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
3021 (gpgsm_set_io_cb): ... this.
3022 (_gpgme_gpgsm_io_event): Make static and rename to ...
3023 (gpgsm_io_event): ... this.
3024 (struct _gpgme_engine_ops_gpgsm): New variable.
3025 [!ENABLE_GPGSM]: Removed.
3026 * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
3027 <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include
3028 <stdlib.h> and "engine-backend.h".
3029 (struct engine_object_s): Rewritten.
3030 (engine_ops): New variable.
3031 * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
3032 _gpgme_engine_check_version, _gpgme_engine_new,
3033 _gpgme_engine_release, _gpgme_engine_set_verbosity,
3034 _gpgme_engine_set_status_handler,
3035 _gpgme_engine_set_command_handler,
3036 _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
3037 _gpgme_engine_op_delete, _gpgme_engine_op_edit,
3038 _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3039 _gpgme_engine_op_export, _gpgme_engine_op_genkey,
3040 _gpgme_engine_op_import, _gpgme_engine_op_keylist,
3041 _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
3042 _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
3043 _gpgme_engine_start, _gpgme_engine_set_io_cbs,
3044 _gpgme_engine_io_event): Reimplement.
3045 * engine.h: Fix a few comments and a variable name in a prototype.
3046 * ops.h: Do not include "rungpg.h".
3047 * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not
3049 * recipient.c: Likewise.
3050 * signers.c: Likewise.
3051 * version.c: Likewise.
3052 * rungpg.c: Likewise. Include "engine-backend.h". Reorder
3053 functions and remove prototypes.
3054 (_gpgme_gpg_get_version): Make static and rename to ...
3055 (gpg_get_version): ... this.
3056 (_gpgme_gpg_check_version): Make static and rename to ...
3057 (gpg_check_version): ... this.
3058 (_gpgme_gpg_new): Make static. Change argument type from
3059 GpgObject * to void **. Call gpg_release instead
3061 (_gpgme_gpg_op_decrypt): Make static and rename to ...
3062 (gpg_check_decrypt): ... this.
3063 (_gpgme_gpg_op_delete): Make static and rename to ...
3064 (gpg_check_delete): ... this.
3065 (_gpgme_gpg_set_recipients): Make static and rename to ...
3066 (gpg_check_set_recipients): ... this.
3067 (_gpgme_gpg_op_encrypt): Make static and rename to ...
3068 (gpg_encrypt): ... this.
3069 (_gpgme_gpg_op_export): Make static and rename to ...
3070 (gpg_export): ... this.
3071 (_gpgme_gpg_op_genkey): Make static and rename to ...
3072 (gpg_genkey): ... this.
3073 (_gpgme_gpg_op_import): Make static and rename to ...
3074 (gpg_import): ... this.
3075 (_gpgme_gpg_op_keylist): Make static and rename to ...
3076 (gpg_keylist): ... this.
3077 (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
3078 (gpg_keylist_ext): ... this.
3079 (_gpgme_gpg_op_sign): Make static and rename to ...
3080 (gpg_sign): ... this.
3081 (_gpgme_gpg_op_trustlist): Make static and rename to ...
3082 (gpg_trustlist): ... this.
3083 (_gpgme_gpg_op_verify): Make static and rename to ...
3084 (gpg_verify): ... this.
3085 (gpg_status_handler): Rename to ...
3086 (status_handler): ... this.
3087 (_gpgme_gpg_set_status_handler): Make static and rename to ...
3088 (gpg_set_status_handler): ... this.
3089 (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
3090 (gpg_set_colon_line_handler): ... this.
3091 (gpgme_gpg_add_io_cb): Rename to ...
3092 (add_io_cb): ... this.
3093 (_gpgme_gpg_start): Make static and rename to ...
3094 (gpg_start): ... this.
3095 (_gpgme_gpg_set_io_cb): Make static and rename to ...
3096 (gpg_set_io_cb): ... this.
3097 (_gpgme_gpg_io_event): Make static and rename to ...
3098 (gpg_io_event): ... this.
3099 (struct _gpgme_engine_ops_gpg): New variable.
3101 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
3103 * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
3106 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
3108 * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
3109 data-compat.c: New file. Really check them in this time, completes
3112 * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
3114 * types.h (GpgmeStatusHandler): ... here.
3115 * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
3117 * types.h (GpgmeColonLineHandler): ... here.
3118 * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
3120 * types.h (GpgmeCommandHandler): ... here.
3121 * engine.h: Don't include "rungpg.h".
3122 (_gpgme_engine_set_status_handler): Change type of
3123 argument from GpgStatusHandler to GpgmeStatusHandler.
3124 (_gpgme_engine_set_colon_line_handler): Change type of
3125 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3126 (_gpgme_engine_set_command_handler): Change type of
3127 argument from GpgCommandHandler to GpgmeCommandHandler.
3128 * engine-gpgsm.h: Don't include "rungpg.h".
3129 (_gpgme_gpgsm_set_status_handler): Change type of
3130 argument from GpgStatusHandler to GpgmeStatusHandler.
3131 (_gpgme_gpgsm_set_colon_line_handler): Change type of
3132 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3133 * engine-gpgsm.c: Do not include "rungpg.h".
3134 (struct gpgsm_object_s): Change type of
3135 status.fnc to GpgmeStatusHandler. Change type of colon.fnc to
3136 GpgmeColonLineHandler.
3137 (gpgsm_assuan_simple_command): Change type of argument from
3138 GpgStatusHandler to GpgmeStatusHandler.
3139 (_gpgme_gpgsm_set_status_handler): Likewise.
3140 (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
3141 GpgColonLineHandler to GpgmeColonLineHandler.
3142 * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
3143 argument from GpgStatusHandler to GpgmeStatusHandler.
3144 (_gpgme_gpg_set_colon_line_handler): Change type of
3145 argument from GpgColonLineHandler to GpgmeColonLineHandler.
3146 (_gpgme_gpg_set_command_handler): Change type of
3147 argument from GpgCommandHandler to GpgmeCommandHandler.
3148 * rungpg.c (struct gpg_object_s): Change type of status.fnc to
3149 GpgmeStatusHandler. Change type of colon.fnc to
3150 GpgmeColonLineHandler. Change type of cmd.fnc to
3151 GpgmeCommandLineHandler.
3152 (_gpgme_gpg_set_status_handler): Change type of argument FNC to
3154 (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
3155 to GpgmeColonLineHandler.
3156 (_gpgme_gpg_set_command_handler): Change type of argument FNC to
3157 GpgmeCommandHandler.
3158 * engine.c (_gpgme_engine_set_status_handler): Change type of
3159 argument FNC to GpgmeStatusHandler.
3160 (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
3161 to GpgmeColonLineHandler.
3162 (_gpgme_engine_set_command_handler): Change type of argument FNC to
3163 GpgmeCommandHandler.
3165 * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
3166 * rungpg.c (struct gpg_object_s): Remove PM.
3167 (pipemode_cb): Prototype removed.
3168 (add_pm_data): Function removed.
3169 (_gpgme_gpg_enable_pipemode): Likewise.
3170 (pipemode_copy): Likewise.
3171 (pipemode_cb): Likewise.
3172 (add_arg): Don't check for pipemode.
3173 (add_data): Likewise.
3174 (_gpgme_gpg_set_status_handler): Likewise.
3175 (_gpgme_gpg_set_colon_line_handler): Likewise.
3176 (_gpgme_gpg_set_command_handler): Likewise.
3177 (_gpgme_gpg_spawn): Likewise.
3178 (_gpgme_gpg_spawn): Don't set PM.active.
3179 (_gpgme_gpg_op_verify): Remove pipemode case.
3180 * verify.c (_gpgme_op_verify_start): Remove pipemode case.
3182 * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3183 _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
3184 _gpgme_gpg_set_simple_line_handler): Prototype removed.
3185 (_gpgme_gpg_set_verbosity): New prototype.
3186 * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
3187 (add_data): ... this.
3188 (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
3189 (_gpgme_gpg_set_command_handler): Likewise.
3190 (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3191 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3192 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3193 _gpgme_gpg_op_verify): Likewise.
3194 (_gpgme_gpg_add_pm_data): Rename to ...
3195 (add_pm_data): ... this.
3196 (_gpgme_gpg_op_verify): Call add_pm_data, not
3197 _gpgme_gpg_add_pm_data.
3198 (_gpgme_gpg_add_arg): Make static and rename to ...
3199 (add_arg): ... this.
3200 (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
3201 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
3202 _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
3203 _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
3204 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3205 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
3206 _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
3207 _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
3209 (_gpgme_gpg_set_verbosity): New function.
3210 (struct gpg_object_s): Remove member simple from colon.
3211 (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
3212 (_gpgme_gpg_set_simple_line_handler): Removed function.
3213 (read_colon_line): Don't check the GPG->colon.simple.
3214 * engine.c (_gpgme_engine_set_verbosity): Call
3215 _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
3217 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3219 * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
3220 _gpgme_strdup, _gpgme_free): Remove prototypes.
3221 (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
3223 * util.c: File removed.
3224 * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
3225 * conversion.c (_gpgme_decode_c_string): Use malloc instead of
3226 xtrymalloc, realloc instead of xtryrealloc, calloc instead of
3227 xtrycalloc, free instead of xfree.
3228 (_gpgme_data_append_percentstring_for_xml): Likewise.
3229 * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
3230 * data-compat.c (gpgme_data_new_from_filepart): Likewise.
3231 * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
3232 _gpgme_data_get_as_string): Likewise.
3233 * debug.c (debug_init): Likewise.
3234 * decrypt.c (_gpgme_release_decrypt_result): Likewise.
3235 * delete.c (_gpgme_release_delete_result): Likewise.
3236 * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
3238 * encrypt.c (_gpgme_release_encrypt_result): Likewise.
3239 * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
3240 _gpgme_engine_release): Likewise.
3241 * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
3242 _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
3243 gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
3244 _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
3245 _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
3246 _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
3247 _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
3248 * genkey.c (_gpgme_release_genkey_result): Likewise.
3249 * gpgme.c (gpgme_new, gpgme_release): Likewise.
3250 * import.c (_gpgme_release_import_result): Likewise.
3251 * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
3252 add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
3253 * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
3254 _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
3255 * ops.h (test_and_allocate_result): Likewise.
3256 * passphrase.c (_gpgme_release_passphrase_result,
3257 _gpgme_passphrase_status_handler,
3258 _gpgme_passphrase_command_handler): Likewise.
3259 * progress.c (_gpgme_progress_status_handler): Likewise.
3260 * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
3261 gpgme_recipients_add_name_with_validity): Likewise.
3262 * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
3263 _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
3264 _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
3265 build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
3267 * sign.c (_gpgme_release_sign_result): Likewise.
3268 * signers.c (_gpgme_signers_add): Likewise.
3269 * trustlist.c (trust_item_new, trustlist_colon_handler,
3270 _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
3271 gpgme_trustitem_release): Likewise.
3272 * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
3273 * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
3275 * w32-io.c (create_reader, create_writer, destroy_reader,
3276 destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
3277 * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
3278 * w32-util.c (read_w32_registry_string): Likewise.
3279 * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
3280 _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
3281 * data-compat.c: Include <stdlib.h>.
3283 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
3285 New data object component:
3287 * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
3288 GpgmeDataReleaseCb): New types.
3289 (struct GpgmeDataCbs): New structure.
3290 (gpgme_data_read): Changed prototype to match that of read() closely.
3291 (gpgme_data_write): Similar for write().
3292 (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
3293 gpgme_data_new_from_stream): New prototypes.
3294 (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
3296 * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
3297 data-stream.c, data-mem.c, data-user.c and data-compat.c.
3298 * data.c: Reimplemented from scratch.
3299 * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
3300 data-user.c): New file.
3301 * context.h (struct gpgme_data_s): Removed.
3302 * conversion.c: Include <errno.h> and <sys/types.h>.
3303 (_gpgme_data_append): New function.
3304 * data.c (_gpgme_data_append_string): Move to ...
3305 * conversion.c (_gpgme_data_append_string): ... here.
3306 * data.c (_gpgme_data_append_for_xml): Move to ...
3307 * conversion.c (_gpgme_data_append_for_xml): ... here.
3308 * data.c (_gpgme_data_append_string_for_xml): Move to ...
3309 * conversion.c (_gpgme_data_append_string_for_xml): ... here.
3310 * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
3311 * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
3313 * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
3315 * types.h (GpgmeDataMode): Type removed.
3317 * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
3318 * edit.c (_gpgme_op_edit_start): Likewise.
3319 * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3320 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3321 * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3322 * export.c (_gpgme_op_export_start): Likewise.
3323 * genkey.c (_gpgme_op_genkey_start): Likewise.
3324 * import.c (_gpgme_op_import_start): Likewise.
3325 * sign.c (_gpgme_op_sign_start): Likewise.
3326 * verify.c (_gpgme_op_verify_start): Likewise.
3328 * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
3329 no recipient if no data was returned.
3330 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3331 no recipient if no data was returned.
3332 * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
3333 no recipient if no data was returned.
3335 * engine.c (_gpgme_engine_op_verify): Add new argument to
3336 differentiate detached from normal signatures.
3337 * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
3338 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise. Don't check
3339 mode of data argument.
3340 * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
3341 * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
3342 (gpgme_op_verify): Likewise for prototype.
3343 * rungpg.c (_gpgme_gpg_op_verify): Likewise.
3344 * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
3345 * verify.c (_gpgme_op_verify_start): Likewise.
3346 (gpgme_op_verify_start): Likewise.
3347 (gpgme_op_verify): Likewise.
3349 * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
3350 direction of data object.
3351 (_gpgme_gpg_add_data): Add new argument INBOUND. Use it to
3352 determine direction of data object.
3353 (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
3354 _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
3355 _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
3356 _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
3357 _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
3359 (build_argv): Use new member INBOUND to determine direction of
3360 file descriptor. Don't check the data type.
3361 * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
3363 * gpgme.c (gpgme_get_op_info): Don't call
3364 _gpgme_data_get_as_string if CTX->op_info is NULL.
3366 * version.c (gpgme_check_engine): Function removed.
3368 2002-09-30 Werner Koch <wk@gnupg.org>
3370 * keylist.c (keylist_colon_handler): Take care when printing a
3371 NULL with the DEBUG.
3373 * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
3374 (gpgsm_status_handler): Run the colon function to indicate EOF.
3375 (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
3377 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
3379 * conversion.c (_gpgme_hextobyte): Prevent superfluous
3380 multiplication with base. Reported by Stéphane Corthésy.
3382 * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
3383 operation type in invocation of _gpgme_op_reset.
3385 2002-09-20 Werner Koch <wk@gnupg.org>
3387 * ath.c: Include sys/time.h if sys/select.h is not available.
3389 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
3391 * keylist.c (keylist_status_handler): Do not call finish_key() here.
3392 (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
3394 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
3396 * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
3397 into gpgme unconditionally.
3398 (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
3400 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3402 * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
3404 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3406 * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
3407 (_gpgme_debug_end): Likewise.
3408 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3410 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3412 * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
3414 * version.c (_gpgme_get_program_version): Likewise.
3415 Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
3417 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
3419 * conversion.c (_gpgme_decode_c_string): Set DESTP before
3422 * conversion.c (_gpgme_decode_c_string): Fix off by one error in
3424 * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
3425 _gpgme_op_edit so its prototype is known early on.
3427 * conversion.c: New file.
3428 * util.h: Add prototypes for _gpgme_decode_c_string and
3430 * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
3432 * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
3433 * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
3434 calls to _gpgme_hextobyte.
3435 (hash_key): Likewise.
3437 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
3439 * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
3440 _gpgme_engine_release, as this will reset pending to zero in the
3441 event done callback on cancelled operations.
3443 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
3445 * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
3446 Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
3448 * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
3449 * rungpg.h: Also to prototype.
3450 * engine.c (_gpgme_engine_op_edit): Likewise.
3451 * engine.h: Likewise.
3452 * edit.c (_gpgme_op_edit_start): Likewise.
3454 2002-08-29 Werner Koch <wk@gnupg.org>
3456 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
3458 * vasprintf.c (va_copy): Define macro if not yet defined.
3460 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
3462 * passphrase.c (_gpgme_passphrase_status_handler): Reset
3463 CTX->result.passphrase->no_passphrase if passphrase is given (good
3464 or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
3466 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
3468 * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
3469 Return 0 on success, -1 on error.
3470 * version.c (_gpgme_get_program_version): Don't wait for the child.
3471 * engine.c (_gpgme_engine_housecleaning): Function removed.
3472 (do_reaping): Likewise.
3473 (_gpgme_engine_add_child_to_reap_list): Likewise.
3474 (struct reap_s): Removed.
3475 (reap_list): Likewise.
3476 (reap_list_lock): Likewise.
3477 * engine.h (_gpgme_engine_io_event): Remove prototypes for
3478 _gpgme_engine_housecleaning and
3479 _gpgme_engine_add_child_to_reap_list.
3480 * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
3481 (struct gpg_object_s): Remove PID member.
3482 (_gpgme_gpg_new): Don't initialize GPG->pid.
3483 (_gpgme_gpg_spawn): Don't set GPG->pid.
3484 * wait.c (run_idle): Removed.
3485 (gpgme_wait): Run idle_function directly.
3487 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
3489 * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
3490 variables encrypt_info and encrypt_info_len.
3491 * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
3492 * posix-sema.c (sema_fatal): Remove function.
3493 All these reported by Stéphane Corthésy.
3495 2002-08-23 Werner Koch <wk@gnupg.org>
3497 * gpgme-config.in: Made --prefix work for --libs.
3499 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
3501 * ath.h: Update list of symbols that get a prefix: Rename the
3502 ath_mutex_*_available symbols to ath_*_available.
3504 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
3506 * stpcpy.c: New file from gnulib.
3507 * Makefile.am (assuan_libobjs): Remove jnlib.
3509 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
3511 * gpgme.h: Add prototype for gpgme_op_import_ext.
3512 * import.c (struct import_result_s): New member `nr_considered'.
3513 Rename `any_imported' to `nr_imported'.
3514 (import_status_handler): Increment nr_imported. Set nr_considered
3516 (gpgme_op_import_ext): New function.
3517 (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
3519 2002-08-20 Werner Koch <wk@gnupg.org>
3521 * gpgme.m4: Replaced with a new and faster version. This does not
3522 anymore try to build test programs. If we really need test
3523 programs, we should add an option to gpgme-config to do so.
3525 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
3527 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
3529 * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
3530 * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
3533 2002-08-19 Werner Koch <wk@gnupg.org>
3535 * decrypt.c (is_token,skip_token): Duplicated from verify.c
3536 (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
3537 (_gpgme_decrypt_status_handler): Create an operation info.
3539 2002-08-14 Werner Koch <wk@gnupg.org>
3541 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
3542 * key.c (gpgme_key_release): Release it. We need to add more code
3544 (_gpgme_key_append_name): Use memset to intialize the struct.
3545 * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
3546 * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
3549 * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
3550 information about the key type (PGP or X.509).
3551 (gpgme_key_get_ulong_attr): Likewise.
3553 * keylist.c (keylist_colon_handler): Include 1 in the check for
3554 valid algorithms so that RSA is usable. Store the issuer name and
3555 serial number also for "crs" records. Parse the expire date for
3557 (set_userid_flags): Put them onto the last appended key.
3559 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
3561 * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
3563 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
3565 * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
3568 The following changes make it possible to flush an inbound data
3569 pipe before invoking a command handler:
3571 * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
3572 _gpgme_io_select. Set timeout of 0 if this is set.
3573 * w32-io.c (_gpgme_io_select): Likewise.
3574 * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
3575 * wait.c (do_select): Add new argument to _gpgme_io_select
3577 * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
3578 linked_data to prototype.
3579 * engine.h (_gpgme_engine_set_command_handler): Likewise.
3580 * engine.c (_gpgme_engine_set_command_handler): Likewise.
3581 * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
3582 argument to _gpgme_engine_set_command_handler.
3583 * rungpg.c (struct gpg_object_s): New members linked_data and
3585 (_gpgme_gpg_new): Initialize those new members.
3586 (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
3587 (build_argv): Handle linked_data in the same hack as cb_data.
3588 (read_status): If linked_data is in use, flush the pipe before
3589 activating the command handler.
3590 * gpgme.h: Add prototypes for gpgme_op_edit_start and
3593 The next changes export the status codes to the user:
3595 * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
3596 all STATUS_ with GPGME_.
3597 * delete.c (delete_status_handler): Likewise.
3598 * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
3599 * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
3600 (_gpgme_encrypt_sym_status_handler): Likewise.
3601 * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3602 * engine-gpgsm.c (parse_status): Likewise.
3603 (gpgsm_status_handler): Likewise.
3604 (gpgsm_set_recipients): Likewise.
3605 * export.c (export_status_handler): Likewise.
3606 * genkey.c (genkey_status_handler): Likewise.
3607 * import.c (append_xml_impinfo): Likewise.
3608 (import_status_handler): Likewise.
3609 * keylist.c (keylist_status_handler): Likewise.
3610 * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
3611 (command_handler): Likewise.
3612 * progress.c (_gpgme_progress_status_handler): Likewise.
3613 * sign.c (_gpgme_sign_status_handler): Likewise.
3614 * trustlist.c (trustlist_status_handler): Likewise.
3615 * verify.c (_gpgme_verify_status_handler): Likewise.
3616 * gpgme.h (GpgmeEditCb): New type.
3617 * rungpg.h (GpgStatusCode): Rename and move to ...
3618 * gpgme.h (GpgmeStatusCode): ... this and here.
3619 * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
3620 * mkstatus: Prefix STATUS with GPGME_.
3621 * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
3623 * ops.h (_gpgme_verify_status_handler,
3624 _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
3625 _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
3626 _gpgme_progress_status_handler): Likewise.
3627 * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
3629 These changes add an edit operation to GPGME:
3631 * context.h (struct gpgme_context_s): New member RESULT.edit. *
3632 ops.h: Add prototype for _gpgme_release_edit_result and
3633 _gpgme_passphrase_command_handler.
3634 * passphrase.c (command_handler): Make non-static and rename to ...
3635 (_gpgme_passphrase_command_handler): ... this.
3636 (_gpgme_passphrase_start): Use new name for command handler.
3637 * types.h: Add EditResult type.
3638 * gpgme.c (_gpgme_release_result): Release EDIT result.
3640 * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
3641 (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
3643 (assuan_libobjs): New variable, set this instead
3645 * engine.h (_gpgme_engine_op_edit): New prototype.
3646 * engine.c (_gpgme_engine_op_edit): New function.
3647 * rungpg.h (_gpgme_gpg_op_edit): New prototype.
3648 * rungpg.c (_gpgme_gpg_op_edit): New function.
3650 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
3652 * delete.c (delete_problem): New case ambigious specification.
3653 (delete_status_handler): Handle new case (poorly).
3655 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
3657 * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
3659 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
3661 * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
3663 * vasprintf.c: Update to more recent libiberty version.
3664 * debug.h: Replace #elsif with #elif.
3666 Submitted by Stéphane Corthésy:
3667 * util.h (vasprintf): Correct prototype.
3668 * encrypt-sign.c: Include <stddef.h>.
3669 (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
3671 * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
3672 * ath-pth.c: Likewise.
3674 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
3676 * wait.c (fdt_global): Make static. Reported by Stéphane
3679 * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
3680 patterns. Reported by Stéphane Corthésy.
3682 * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested
3683 by Stéphane Corthésy.
3684 (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
3685 silence gcc warning.
3687 * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
3689 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
3691 * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
3693 * gpgme.c (_gpgme_op_event_cb_user): New function.
3694 * op-support.c (_gpgme_op_reset): Support a new mode of operation
3695 for private or user event loop. Use new user event callback
3697 * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
3698 * keylist.c (gpgme_op_keylist_start): Likewise.
3700 * rungpg.c (_gpgme_gpg_io_event): New function.
3701 * rungpg.h (_gpgme_gpg_io_event): New prototype.
3702 * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
3703 * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
3704 * engine.c (_gpgme_engine_io_event): New function.
3705 * engine.h (_gpgme_engine_io_event): New prototype.
3706 * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
3707 the real work for the default IO callback routines to ...
3708 (_gpgme_op_keylist_event_cb): ... here. New function.
3709 * trustlist.c (trustlist_colon_handler): Signal
3710 GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ...
3711 (_gpgme_op_trustlist_event_cb): ... here. New function.
3712 * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
3713 and _gpgme_op_trustlist_event_cb when appropriate.
3714 * ops.h (_gpgme_op_keylist_event_cb): New prototype.
3715 (_gpgme_op_trustlist_event_cb): Likewise.
3716 * op-support.c (_gpgme_op_reset): Add comment why we don't use the
3717 user provided event handler directly.
3718 * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
3720 * wait.c (_gpgme_add_io_cb): Likewise.
3721 * wait.h (_gpgme_add_io_cb): Likewise for prototype.
3722 * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
3723 argument. Fix up error handling.
3724 * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
3725 new argument, fix up error handling.
3727 2002-07-03 Werner Koch <wk@gnupg.org>
3729 * encrypt.c (status_handler_finish): New.
3730 (_gpgme_encrypt_status_handler): Moved some code out to the new
3731 function and call this function also in case we get into the
3732 status handler with an error which might happen due to a kludge in
3735 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
3737 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
3738 table (eg use synchronous mode).
3740 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
3742 * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
3743 prototype and change return type to GpgmeError.
3744 (_gpgme_wait_one): New prototype.
3745 * wait.c (gpgme_wait): Replace with the meat from
3746 _gpgme_wait_on_condition here, and remove the support for
3748 (_gpgme_wait_on_condition): Remove HANG argument from prototype
3749 and change return type to GpgmeError. Replace with meat from
3750 _gpgme_wait_one and add support for conditions.
3751 (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
3753 * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
3754 table (eg use synchronous mode).
3755 (gpgme_op_keylist_next): Remove HANG argument from
3756 _gpgme_wait_on_condition. Check its return value.
3757 * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
3758 table (eg use synchronous mode).
3759 (gpgme_op_trustlist_next): Remove HANG argument from
3760 _gpgme_wait_on_condition. Check its return value.
3762 2002-06-27 Marcus Brinkmann <marcus@g10code.de>
3764 * gpgme.h: Fix documentation of key attribute retrieval functions.
3766 2002-06-26 Werner Koch <wk@gnupg.org>
3768 * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
3770 * import.c (append_xml_impinfo): Kludge to print fingerprint
3771 instead of keyid for use with gpgsm.
3772 (import_status_handler): Set a flag to know whether any import
3774 (gpgme_op_import): Reurn -1 if no certificate ewas imported.
3776 2002-06-25 Werner Koch <wk@gnupg.org>
3778 * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
3781 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
3783 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
3785 * export.c (gpgme_op_export): If no data was returned, return
3786 GPGME_No_Recipients.
3788 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
3790 * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
3792 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
3794 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
3795 (parse_status): New function.
3796 (gpgsm_status_handler): Use parse_status.
3797 (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
3798 STATUS_FNC_VALUE and process status messages.
3799 (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
3800 (gpgsm_set_fd): Likewise.
3801 (_gpgme_gpgsm_op_keylist): Likewise.
3802 (_gpgme_gpgsm_op_keylist_ext): Likewise.
3803 (_gpgme_gpgsm_op_sign): Likewise.
3805 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
3807 * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
3809 2002-06-20 Werner Koch <wk@gnupg.org>
3811 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
3813 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
3815 (_gpgme_verify_status_handler): Watch out for wrong key usage.
3816 (gpgme_get_sig_string_attr): Hack to return info on the key
3817 usage. Does now make use of the former RESERVED argument which
3818 has been renamed to WHATIDX.
3819 (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
3821 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
3823 * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
3824 (_gpgme_wait_one): Only set HANG to zero if do_select returned an
3825 error, or there are no more file descriptors to wait on.
3826 (_gpgme_wait_on_condition): Ignore return value from do_select for
3829 2002-06-13 Werner Koch <wk@gnupg.org>
3831 * verify.c (gpgme_op_verify): Make sure that we never access an
3832 unitialized result structure.
3834 2002-06-12 Werner Koch <wk@gnupg.org>
3836 * keylist.c (struct keylist_result_s): New.
3837 (_gpgme_release_keylist_result): Release it here
3838 (keylist_status_handler): Handle truncated.
3839 (append_xml_keylistinfo): New.
3840 * gpgme.c (_gpgme_release_result): and use it here.
3841 * types.h: Declare the new type here.
3842 * context.h (struct gpgme_context_s): Use it here.
3844 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
3846 * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
3847 (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
3848 use our own close notification mechanism without interfering with
3851 2002-06-11 Werner Koch <wk@gnupg.org>
3853 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
3855 * verify.c (calc_sig_summary): New.
3856 (gpgme_get_sig_ulong_attr): And use it here.
3858 2002-06-10 Werner Koch <wk@gnupg.org>
3860 * rungpg.h: Add new status codes TRUNCATED and ERROR.
3861 * verify.c (is_token, copy_token): New.
3862 (_gpgme_verify_status_handler): Use copy_token, handle the new
3863 ERROR status and store the errorcode used withgpgsm and trust
3865 * gpgme.h: New attribute ERRTOK.
3866 * key.c (gpgme_key_get_string_attr): Add dummy case for it.
3867 (gpgme_get_sig_string_attr): Use it here to return the last error.
3869 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
3871 * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
3872 close notification for the status fd to ...
3873 (_gpgme_gpgsm_new): ... here.
3874 * wait.h: Include "sema.h". Remove prototypes of
3875 _gpgme_remove_proc_from_wait_queue and
3876 _gpgme_register_pipe_handler. Add prototypes of
3877 _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
3878 _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
3880 * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
3881 FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables
3882 FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
3883 CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct
3884 proc_s. Replace struct wait_item_s.
3885 (_gpgme_fd_table_init): New function.
3886 (_gpgme_fd_table_deinit): Likewise.
3887 (_gpgme_fd_table_put): Likewise.
3888 (set_process_done): Remove function.
3889 (do_select): Take argument FDT. Use that to decide which fds to
3891 (_gpgme_remove_proc_from_wait_queue): Remove function.
3892 (_gpgme_wait_event_cb): New function.
3893 (_gpgme_wait_one): Likewise.
3894 (_gpgme_register_pipe_hanldler): Remove function.
3895 (_gpgme_add_io_cb): New function.
3896 (_gpgme_remove_io_cb): Likewise.
3897 (_gpgme_freeze_fd): Remove function.
3898 (_gpgme_thaw_fd): Remove function.
3899 * rungpg.c (struct fd_data_map_s): Add new member TAG.
3900 (struct gpg_object_s): Likewise for STATUS and COLON. Add member
3901 IDX to CMD. Add new member IO_CBS.
3902 (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
3903 For each I/O callback, check if it should be unregistered. If all
3904 callbacks have been unregistered, trigger GPGME_EVENT_DONE.
3905 Remove member RUNNING.
3906 (_gpgme_gpg_new): Initialize new members.
3907 (_gpgme_gpg_release): Check PID not RUNNING. Don't call
3908 _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set.
3909 (build_argv): Store away the index instead the file descriptor for
3911 (_gpgme_gpg_add_io_cb): New function.
3912 (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
3914 (gpg_status_handler): Change return type to void, remove PID
3915 argument, close filedescriptor if EOF or error occurs.
3916 (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
3917 Use IO_CBS->remove instead _gpgme_freeze_fd.
3918 (gpg_colon_line_handler): Change return type to void, remove PID
3919 argument, close filedescriptor if EOF or error occurs.
3920 (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
3921 (_gpgme_gpg_set_io_cbs): New function.
3922 * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
3923 _gpgme_gpg_set_io_cbs.
3924 * gpgme.h (GpgmeIOCb): New type.
3925 (GpgmeRegisterIOCb): Likewise.
3926 (GpgmeRemoveIOCb): Likewise.
3927 (GpgmeEventIO): Likewise.
3928 (GpgmeEventIOCb): Likewise.
3929 (struct GpgmeIOCbs): New structure to hold I/O callbacks.
3930 (gpgme_set_op_io_cbs): New prototype.
3931 (gpgme_get_op_io_cbs): Likewise.
3932 * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes
3933 for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from
3934 _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
3935 prototype. Add prototype for _gpgme_op_reset.
3936 Add synchronous argument to _gpgme_decrypt_start prototype.
3937 * io.h: Beautification.
3938 * gpgme.c: Include "wait.h".
3939 (gpgme_new): Initialize FDT.
3940 (gpgme_set_io_cbs): New function.
3941 (gpgme_get_io_cbs): Likewise.
3942 (_gpgme_op_event_cb): Likewise.
3943 * data.c (_gpgme_data_inbound_handler): Change return type to
3944 void. Drop PID argument. Close FD on error and EOF.
3945 (write_mem_data): Don't close FD here ...
3946 (write_cb_data): ... or here ...
3947 (_gpgme_data_outbound_handler): ... but here. Change return type
3948 to void. Drop PID argument.
3949 * context.h: Include "wait.h".
3950 (struct gpgme_context_s): New members FDT and IO_CBS.
3951 * op-support.c: New file.
3952 * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
3953 * ops.h: Add prototype for _gpgme_op_reset().
3954 * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use
3956 (gpgme_op_decrypt_start): Add synchronous argument.
3957 (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead
3959 * delete.c (gpgme_op_delete_start): Rename to ...
3960 (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS.
3961 Use _gpgme_op_reset. Make function static.
3962 (gpgme_op_delete_start): Just a wrapper around
3963 _gpgme_op_delete_start now.
3964 (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one
3966 * encrypt.c: Include "wait.h".
3967 (ggpgme_op_encrypt_start): Rename to ...
3968 (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS.
3969 Use _gpgme_op_reset. Make function static.
3970 (gpgme_op_encrypt_start): Just a wrapper around
3971 _gpgme_op_encrypt_start now.
3972 (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one
3974 * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
3975 (_gpgme_op_encrypt_sign_start): ... this. New argument
3976 SYNCHRONOUS. Use _gpgme_op_reset. Make function static.
3977 (gpgme_op_encrypt_sign_start): Just a wrapper around
3978 _gpgme_op_encrypt_sign_start now.
3979 (gpgme_op_encrypt_sign): Add synchronous argument. Use
3980 _gpgme_wait_one instead gpgme_wait.
3981 * export.c (gpgme_op_export_start): Rename to ...
3982 (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS.
3983 Use _gpgme_op_reset. Make function static.
3984 (gpgme_op_export_start): Just a wrapper around
3985 _gpgme_op_export_start now.
3986 (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one
3988 * genkey.c (gpgme_op_genkey_start): Rename to ...
3989 (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS.
3990 Use _gpgme_op_reset. Make function static.
3991 (gpgme_op_genkey_start): Just a wrapper around
3992 _gpgme_op_genkey_start now.
3993 (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one
3995 * import.c (gpgme_op_import_start): Rename to ...
3996 (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS.
3997 Use _gpgme_op_reset. Make function static.
3998 (gpgme_op_import_start): Just a wrapper around
3999 _gpgme_op_import_start now.
4000 (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one
4002 * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
4003 (gpgme_op_keylist_ext_start): Likewise.
4004 * sign.c (gpgme_op_sign_start): Rename to ...
4005 (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use
4006 _gpgme_op_reset. Make function static.
4007 (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
4009 (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one
4011 * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
4012 * verify.c (gpgme_op_verify_start): Rename to ...
4013 (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS.
4014 Use _gpgme_op_reset. Make function static.
4015 (gpgme_op_verify_start): Just a wrapper around
4016 _gpgme_op_verify_start now.
4017 (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one
4019 * engine-gpgsm.c (iocb_data_t): New type.
4020 (struct gpgsm_object_s): New member status_cb. Replace input_fd
4021 and input_data with input_cb. Replace output_fd and output_data
4022 with output_cb. Replace message_fd and message_data with
4023 message_cb. New member io_cbs.
4024 (_gpgme_gpgsm_new): Initialize all new members (and drop the old
4026 (close_notify_handler): New variable POSSIBLY_DONE. For each I/O
4027 callback, check if it should be unregistered. If all callbacks
4028 have been unregistered, trigger GPGME_EVENT_DONE.
4029 (_gpgme_gpgsm_release): Remove variable PID. Use new variable
4030 names to close the file descriptors.
4031 (_gpgme_gpgsm_op_decrypt): Use new variable names,
4032 (_gpgme_gpgsm_op_encrypt): Likewise.
4033 (_gpgme_gpgsm_op_genkey): Likewise.
4034 (_gpgme_gpgsm_op_import): Likewise.
4035 (_gpgme_gpgsm_op_keylist): Likewise.
4036 (_gpgme_gpgsm_op_keylist_ext): Likewise.
4037 (_gpgme_gpgsm_op_sign): Likewise.
4038 (_gpgme_gpgsm_op_verify): Likewise.
4039 (gpgsm_status_handler): Drop argument PID. Change return type to
4040 void. Close status pipe before returning because of EOF or error.
4041 (_gpgme_gpgsm_add_io_cb): New function.
4042 (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
4044 (_gpgme_gpgsm_set_io_cbs): New function.
4045 * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
4046 * engine.c (_gpgme_engine_set_io_cbs): New function.
4047 * engine.h: New prototype for _gpgme_engine_set_io_cbs.
4049 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
4051 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
4053 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
4055 * key.c: Include <ctype.h>.
4056 (_gpgme_key_append_name): Skip one more char when
4057 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
4058 Handle hexadecimal encodings. Also reported by Marc. Thanks!
4060 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4062 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
4063 * posix-sema.c: Use that prefix here.
4064 * posix-io.c: Include "ath.h".
4065 (_gpgme_io_read): Use _gpgme_ath_read instead read.
4066 (_gpgme_io_write): Use _gpgme_ath_write instead write.
4067 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
4068 (_gpgme_io_select): Use _gpgme_ath_select instead select.
4070 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
4072 * Makefile.am (ath_components): New variable.
4073 (ath_components_pthread): Likewise.
4074 (ath_components_pth): Likewise.
4075 (system_components): Add ath_componentes.
4079 * ath-pthread.c: Likewise.
4080 * ath-pth.c: Likewise.
4081 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
4083 * mutex.h: Remove file.
4085 2002-05-30 Werner Koch <wk@gnupg.org>
4087 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
4088 an issuer with IDX > 0. We don't support altIssuerNames for now.
4090 2002-05-22 Werner Koch <wk@gnupg.org>
4092 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
4093 missing variable definition. Oohh - Marcus was faster.
4095 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
4097 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
4099 2002-05-21 Werner Koch <wk@gnupg.org>
4101 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
4102 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
4104 2002-05-10 Werner Koch <wk@gnupg.org>
4106 * key.h (gpgme_key_s): Add OTRUST.
4107 * keylist.c (set_ownertrust): New.
4108 (keylist_colon_handler): Get the ownertrust value
4109 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
4112 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4114 * w32-util.c: New static variable GET_PATH_LOCK.
4115 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
4116 Take lock while determining path.
4117 (_gpgme_get_gpgsm_path): Likewise.
4118 * version.c (do_subsystem_inits): Set DONE to 1 after
4120 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
4121 while determining engine info.
4122 * rungpg.c (_gpgme_gpg_get_version): New variable
4123 GPG_VERSION_LOCK. Take the lock while determining the program
4125 * posix-io.c: Include "sema.h".
4126 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
4127 while fixing the signals.
4128 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
4129 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
4131 (capabilities_to_string): Make STRINGS very const.
4132 (_gpgme_key_cache_add): Lock the key cache.
4133 (_gpgme_key_cache_get): Likewise.
4134 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
4135 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
4136 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
4138 * engine.c (_gpgme_engine_get_info): New variable
4139 ENGINE_INFO_LOCK. Take lock while determining engine info.
4140 * engine-gpgsm.c: Include "sema.h".
4141 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
4142 lock while getting program version.
4144 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
4146 * debug.h: New file.
4147 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
4148 * util.h: Removed all prototypes and declarations related to
4149 debugging. Include "debug.h".
4151 * debug.c (debug_level): Comment variable and remove superfluous
4154 (_gpgme_debug_enabled): Function removed.
4155 (struct debug_control_s): Definition removed.
4156 (_gpgme_debug_level): Function removed.
4157 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
4158 pritnf-style format specification and a variable number of
4160 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
4161 starts out with "%s" for simplicity.
4162 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
4163 TEXT argument anymore.
4165 * posix-io.c (_gpgme_io_select): Use new level argument for
4166 DEBUG_BEGIN instead explicit if construct.
4168 * debug.c (debug_init): Remove superfluous zero initializer,
4169 remove volatile flag of INITIALIZED. Do not use the
4170 double-checked locking algorithm, it is fundamentally flawed and
4171 will empty your fridge (on a more serious note, despite the
4172 volatile flag it doesn't give you the guarantee you would expect,
4173 for example on a DEC Alpha or an SMP machine. The volatile only
4174 serializes accesses to the volatile variable, but not to the other
4177 2002-05-03 Werner Koch <wk@gnupg.org>
4179 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
4180 output to /dev/null.
4182 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
4183 * gpgme.c (gpgme_get_protocol): New.
4185 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
4186 (gpgme_data_read): Ditto.
4188 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
4189 lines so that a claim can be made without looking up the key.
4190 (gpgme_get_sig_string_attr): New.
4191 (gpgme_get_sig_ulong_attr): New.
4193 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
4195 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
4196 list to align with the status.h file from gnupg.
4198 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
4199 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
4200 these new status codes. Store the expiration time
4202 2002-04-27 Werner Koch <wk@gnupg.org>
4204 * gpgme.h (GpgmeData_Encoding): New.
4205 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
4206 * engine-gpgsm.c (map_input_enc): New. Use it in all local
4207 functions where the INPUT command gets send.
4209 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
4211 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
4212 descriptor only when we don't need it anymore. Close the message
4213 descriptor if we don't need it.
4215 2002-04-26 Werner Koch <wk@gnupg.org>
4217 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
4219 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4221 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
4222 GPG->cmd.cb_data, not xfree.
4224 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
4226 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
4227 ttytype, lc_ctype and lc_messages options in the server.
4229 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
4231 * engine-gpgsm.c (map_assuan_error): Add new error codes.
4233 2002-04-23 Werner Koch <wk@gnupg.org>
4235 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
4236 can_certify to return the requested values.
4238 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
4240 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
4242 (gpgme_get_passphrase_cb): Likewise.
4244 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
4246 * gpgme.c (gpgme_get_passphrase_cb): New function.
4247 (gpgme_get_progress_cb): New function.
4248 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
4249 gpgme_get_progress_cb.
4251 2002-03-28 Werner Koch <wk@gnupg.org>
4253 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
4254 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
4255 * keylist.c (keylist_colon_handler): Store them.
4256 * key.c (gpgme_key_release): Free them.
4257 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
4259 2002-03-26 Werner Koch <wk@gnupg.org>
4261 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
4263 2002-03-21 Werner Koch <wk@gnupg.org>
4265 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
4268 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
4270 * Makefile.am (system_components): New variable, set depending on
4272 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
4273 * syshdr.h: File removed.
4275 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
4276 * posix-sema.c: Likewise.
4277 * posix-util.c: Likewise.
4279 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
4280 * w32-sema.c: Likewise.
4281 * w32-util.c: Likewise.
4283 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
4284 * posix-sema.c: Likewise.
4285 * w32-io.c: Include `io.h', do not include `syshdr.h'
4286 * w32-sema.c: Likewise.
4287 * w32-util.c: Likewise.
4288 * data.c: Do not include `syshdr.h'.
4290 * wait.h: Code cleanup.
4292 * mutex.h: New file.
4293 * posix-sema.c: Implement.
4295 2002-03-08 Werner Koch <wk@gnupg.org>
4297 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
4299 2002-03-07 Werner Koch <wk@gnupg.org>
4301 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
4303 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
4305 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
4306 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
4307 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
4308 as status handler and run _gpgme_passphrase_start.
4309 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
4311 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
4314 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
4316 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4318 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
4319 error No_Passphrase if only a bad passphrase was provided.
4321 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4323 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
4324 GPGME_DATA_MODE_IN, construct a command line that stores the
4326 * verify.c (gpgme_op_verify_start): Accept TEXT being
4327 uninitialized, and in this case interpret SIG as a normal or
4328 cleartext signature and TEXT as a return data object.
4329 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
4331 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
4333 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
4336 2002-02-28 Werner Koch <wk@gnupg.org>
4338 * key.h (subkey_s): New member expires_at.
4339 * keylist.c (keylist_colon_handler): Set it here
4340 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
4342 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4344 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
4345 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
4346 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
4347 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
4348 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
4349 * engine.c (_gpgme_engine_op_keylist_ext): New function.
4350 * keylist.c (gpgme_op_keylist_ext_start): New function.
4352 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
4354 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
4355 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
4356 rename no_recipients to no_valid_recipients.
4357 (_gpgme_encrypt_status_handler): Include error for invalid
4359 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
4360 argument to GpgsmObject. Use that to report back the status about
4363 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
4365 * verify.c (_gpgme_verify_status_handler): Fix the last change.
4367 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4369 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
4370 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
4371 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
4372 (_gpgme_gpg_op_sign): Use that new function.
4373 (_gpgme_gpg_op_encrypt_sign): New function.
4374 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
4375 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
4376 (gpgme_op_encrypt_sign): Likewise.
4377 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
4378 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
4379 (_gpgme_sign_status_handler): Add prototype.
4380 * sign.c (sign_status_handler): Rename to ...
4381 (_gpgme_sign_status_handler): ... this and make non-static.
4382 * encrypt.c (encrypt_status_handler): Rename to ...
4383 (_gpgme_encrypt_status_handler): ... this and make non-static.
4384 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
4385 * sign.c (gpgme_op_sign_start): Likewise.
4387 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4389 * verify.c (_gpgme_verify_status_handler): Parse the args line to
4390 see if the problem is due to a missing key, and report that back
4393 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
4395 * context.h (struct gpgme_context_s): New member include_certs.
4396 * gpgme.h (gpgme_set_include_certs): Add prototype.
4397 (gpgme_get_include_certs): Likewise.
4398 * gpgme.c (gpgme_set_include_certs): New function.
4399 (gpgme_get_include_certs): Likewise.
4400 (gpgme_new): Set include_certs to 1 (the default).
4401 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
4402 and pass it to _gpgme_gpgsm_op_sign.
4403 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
4404 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
4405 include_certs and handle it.
4406 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
4407 * sign.c (gpgme_op_sign_start): Add new argument to
4408 _gpgme_engine_op_sign call.
4410 2002-02-14 Werner Koch <wk@gnupg.org>
4412 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
4414 2002-02-13 Werner Koch <wk@gnupg.org>
4416 * vasprintf.c, fopencookie.c: Add replacement functions.
4417 * util.h: Add prototypes for them.
4419 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
4421 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
4422 reach the end of the function.
4424 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
4426 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
4427 (gpgme_op_genkey_start): Skip newlines after opening tag.
4429 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
4431 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
4433 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
4434 set, and pass them down to the crypto engine.
4435 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
4436 * engine.h: Likewise.
4437 * rungpg.h (_gpgme_gpg_spawn): Likewise.
4438 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
4440 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
4442 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
4445 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
4447 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
4449 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
4452 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
4454 * wait.c (gpgme_wait): Add new argument STATUS, in which the
4455 status of the returned context is returned.
4456 (_gpgme_wait_on_condition): Rework the function a bit, to make it
4457 aware of cancelled processes, and to allow to use gpgme_wait with
4458 CTX being NULL (as documented in the source).
4459 (struct proc_s): New member REPORTED.
4460 * gpgme.h: Fix prototype.
4461 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
4462 * sign.c (gpgme_op_sign): Likewise.
4463 * import.c (gpgme_op_import): Likewise.
4464 * genkey.c (gpgme_op_genkey): Likewise.
4465 * export.c (gpgme_op_export): Likewise.
4466 * encrypt.c (gpgme_op_encrypt): Likewise.
4467 * delete.c (gpgme_op_delete): Likewise.
4468 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
4470 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
4472 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
4474 (gpgme_get_keylist_mode): New function.
4475 (gpgme_new): Set the default for keylist_mode member of CTX.
4477 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
4478 (gpgme_get_keylist_mode): New prototype.
4479 (GPGME_KEYLIST_MODE_LOCAL): New macro.
4480 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
4482 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
4484 This patch has gotten a bit large... mmh. The main thing that
4485 happens here is that error values are now not determined in the
4486 operation function after gpgme_wait completed, but in the status
4487 handler when EOF is received. It should always be the case that
4488 either an error is flagged or EOF is received, so that after a
4489 gpgme_wait you should never have the situation that no error is
4490 flagged and EOF is not received. One problem is that the engine
4491 status handlers don't have access to the context, a horrible
4492 kludge works around this for now. All errors that happen during a
4493 pending operation should be catched and reported in ctx->error,
4494 including out-of-core and cancellation. This rounds up neatly a
4495 couple of loose ends, and makes it possible to pass up any errors
4496 in the communication with the backend as well. As a bonus, there
4497 will be a function to access gpgme->wait, so that the operations
4498 can truly be implemented with their _start function.
4500 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
4501 error back to the context.
4502 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
4504 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
4506 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
4507 to a value indication that.
4509 * verify.c (add_notation): Set error, not out_of_core.
4510 (finish_sig): Likewise.
4511 (gpgme_op_verify_start): Don't clear out_of_core.
4512 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
4513 (gpgme_op_verify): And don't do it here.
4515 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
4516 (gpgme_op_trustlist_start): Don't clear out_of_core.
4517 (gpgme_op_trustlist_next): Check error, not out_of_core.
4518 (gpgme_op_trustlist_end): Likewise.
4520 * ops.h (test_and_allocate_result): New macro.
4521 (_gpgme_passphrase_result): Remove prototype.
4522 * delete.c (gpgme_op_delete): Return error from context.
4523 (delete_status_handler): Use macro test_and_allocate_result.
4524 Perform error checking at EOF.
4525 (gpgme_op_delete_start): Release result.
4526 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
4527 test_and_allocate_result, and perform error checking here.
4528 (_gpgme_passphrase_result): Function removed.
4529 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
4530 (gpgme_op_sign): Just return the error value from the context.
4531 (sign_status_handler): Only progress if no error is set yet. If
4532 we process an EOF, set the resulting error value (if any).
4533 * decrypt.c (_gpgme_decrypt_result): Function removed.
4534 (create_result_struct): Function removed.
4535 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
4536 caclulate error on EOF, do not progress with errors.
4537 (_gpgme_decrypt_start): Do not set out_of_core to zero.
4538 (gpgme_op_decrypt): Just return the error value from the context.
4539 * encrypt.c (encrypt_status_handler): Perform the error checking
4541 (gpgme_op_encrypt_start): Do not clear out_of_core.
4542 * export.c (export_status_handler): Return if error is set in context.
4543 (gpgme_op_export_start): Release result.
4544 (gpgme_op_export): Return error from context.
4545 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
4547 * genkey.c (genkey_status_handler): Use macro
4548 test_and_allocate_result. Perform error checking at EOF.
4549 (gpgme_op_genkey): Just return the error from context.
4550 * import.c (gpgme_op_import): Return the error from context.
4551 (import_status_handler): Use macro test_and_allocate_result.
4552 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
4553 (gpgme_op_keylist_next): Return error of context.
4554 (keylist_colon_handler): Set error instead out_of_code.
4555 (finish_key): Likewise.
4557 * context.h: Remove member out_of_core, add member error.
4558 * gpgme.c (_gpgme_release_result): Clear error flag.
4560 * engine.h (_gpgme_engine_get_error): New prototype.
4561 * engine.c (_gpgme_engine_get_error): New function.
4562 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
4564 * engine-gpgsm.c (map_assuan_error): New function.
4565 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
4566 use the new function to map error values.
4567 (gpgsm_set_fd): Change return type tp GpgmeError.
4568 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
4569 (gpgsm_set_recipients): Likewise. Change type of return value
4570 equivalently. Adjust error values.
4571 (_gpgme_gpgsm_op_import): Likewise.
4572 (_gpgme_gpgsm_op_sign): Likewise.
4573 (struct gpgsm_object_s): New member error.
4574 (gpgsm_status_handler): Set error if error occurs. Determine
4575 error number from ERR line received. If assuan_read_line fails,
4576 terminate the connection.
4578 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
4580 * Makefile.am (MOSTLYCLEANFILES): New variable.
4582 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
4584 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
4585 connection to the server.
4587 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
4589 * rungpg.h: Add STATUS_KEY_CREATED.
4591 * progress.c: New file.
4592 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
4594 * genkey.c (genkey_status_handler): Use
4595 _gpgme_progress_status_handler. Add check for status.
4596 (struct genkey_result_s): New structure.
4597 (_gpgme_release_genkey_result): New function.
4598 (gpgme_op_genkey): Check for error.
4599 * gpgme.c (_gpgme_release_result): Call
4600 _gpgme_release_genkey_result.
4601 * ops.h (_gpgme_release_genkey_result): Add prototype.
4602 * types.h (GenKeyResult): New type.
4603 * context.h (gpgme_context_s): Add GenKeyResult to member result.
4605 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
4607 * gpgme.c (_gpgme_release_result): Call
4608 _gpgme_release_delete_result.
4609 * ops.h (_gpgme_release_delete_result): Add prototype.
4610 * types.h (DeleteResult): New type.
4611 * context.h (gpgme_context_s): Add DeleteResult to member result.
4613 * delete.c (enum delete_problem): New type.
4614 (struct delete_result_s): New structure.
4615 (_gpgme_release_delete_result): New function.
4616 (delete_status_handler): Implement more status codes.
4617 (gpgme_op_delete): Return error on failure.
4619 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
4621 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
4623 * import.c (struct import_result_s): New structure.
4624 (_gpgme_release_import_result): New function.
4625 (append_xml_impinfo): Likewise.
4626 (import_status_handler): Implement.
4627 * gpgme.c (_gpgme_release_result): Add call to
4628 _gpgme_release_import_result.
4629 * ops.h (_gpgme_release_import_result): Add prototype.
4630 * types.h (ImportResult): New type.
4631 * context.h (gpgme_context_s): Add ImportResult to member result.
4633 * encrypt.c (gpgme_op_encrypt): Code clean up.
4635 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
4637 * gpgme.h: Add lots of comment and fix the formatting. Add
4638 gpgme_trustlist_end prototype.
4640 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
4642 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
4643 gpgme_register_idle to return and accept this type.
4644 * wait.c (gpgme_register_idle): Fix type.
4645 Save and return old value of idle_function.
4647 2002-01-29 Werner Koch <wk@gnupg.org>
4649 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
4651 * keylist.c (keylist_colon_handler): Add support for the new "crs"
4654 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
4656 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
4657 not assuan_pipe_disconnect.
4659 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
4660 jnlib (needed by assuan) statically into libgpgme. Linking a
4661 static library into a shared library this way is not portable.
4663 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
4665 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
4668 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
4670 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
4671 from off_t to size_t.
4672 * gpgme.h: Likewise.
4674 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
4676 * wait.c (_gpgme_wait_on_condition): If the process finished,
4677 reset the pending flag. Also if the operation was cancelled.
4679 (struct proc_s): Rename READY to DONE.
4680 (wait_item_s): Likewise.
4681 (set_process_ready): Rename to ...
4682 (set_process_done): ... this.
4683 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
4684 instead set_process_ready.
4685 (_gpgme_wait_on_condition): Likewise.
4686 (do_select): Rename READY to DONE.
4688 * verify.c (gpgme_op_verify): Do not set pending to zero here.
4689 * sign.c (gpgme_op_sign): Likewise.
4690 * import.c (gpgme_op_import): Likewise.
4691 * genkey.c (gpgme_op_genkey): Likewise.
4692 * export.c (gpgme_op_export): Likewise.
4693 * encrypt.c (gpgme_op_encrypt): Likewise.
4694 * delete.c (gpgme_op_delete): Likewise.
4695 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
4696 * decrypt.c (gpgme_op_decrypt): Likewise.
4698 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
4700 * export.c: Cleanup.
4702 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
4704 * trustlist.c: Various source clean ups.
4705 (my_isdigit): Removed.
4706 (gpgme_op_trustlist_end): New function.
4708 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
4710 * gpgme.c: Various source clean ups, like renaming C to CTX where
4712 (gpgme_new): Clear R_CTX before starting the work.
4713 (my_isdigit): Removed.
4714 (my_isxdigit): Likewise.
4716 * data.c: Various source clean ups.
4717 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
4718 (gpgme_data_new_with_read_cb): Similar for READ_CB.
4719 (gpgme_data_new_from_file): Loop over fread while EINTR.
4720 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
4721 be zero. Loop over fread while EINTR.
4723 (my_isdigit): Removed.
4724 (my_isxdigit): Likewise.
4726 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
4728 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
4729 Pipe_Error where appropriate.
4731 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
4733 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
4735 * version.c (get_engine_info): Remove prototype.
4737 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
4739 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
4740 Fill it with the servers fds, and pass it to assuan_pipe_connect.
4742 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
4744 * keylist.c (gpgme_op_keylist_end): New function.
4745 * gpgme.h (gpgme_op_keylist_end): New prototype.
4747 * engine.h (gpgme_engine_check_version): Move prototype to ...
4748 * gpgme.h (gpgme_engine_check_version): ... here.
4750 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
4752 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
4754 * version.c (gpgme_get_engine_info): Reimplemented.
4755 (gpgme_check_engine): Reimplemented.
4756 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
4758 * engine.c: Include `io.h'.
4759 (gpgme_engine_get_info): New function.
4760 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
4763 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
4765 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
4766 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
4767 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
4769 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
4770 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
4771 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
4772 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
4773 own function by call to _gpgme_engine_add_child_to_reap_list().
4775 * wait.c: Include `engine.h'.
4776 (run_idle): Call _gpgme_engine_housecleaning(), not
4777 _gpgme_gpg_housecleaning().
4779 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
4781 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
4782 Initialize the next field of the uid structure.
4783 (gpgme_key_get_as_xml): Do not list last uid first.
4785 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
4787 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
4788 function [!ENABLE_GPGSM].
4790 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
4792 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
4793 message_data, not SIG.
4794 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
4796 * sign.c (sign_status_handler): Call
4797 _gpgme_passphrase_status_handler early.
4799 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
4801 * engine-gpgsm.c: Revert last change.
4803 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
4805 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
4806 handler when ending this operation, otherwise the wait function
4809 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
4811 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
4812 (_gpgme_gpgsm_new): Initialize some more members.
4813 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
4814 (gpgsm_status_handler): Rework the inline-data processing.
4816 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
4818 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
4819 list that are not dup'ed, for those the close-on-exec flag is set
4821 * version.c (_gpgme_get_program_version): Remove first entry in
4822 CFD, as the close-on-exec flag is now set for this fd.
4824 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
4826 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
4827 option to `ENCRYPT'.
4828 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
4831 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
4833 * engine-gpgsm.c (close_notify_handler): New function.
4834 (_gpgme_gpgsm_new): Manage the file descriptors a
4835 bit differently. Do not set close-on-exec flags.
4836 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
4837 to -1, this is done by the close handler.
4838 (_gpgme_gpgsm_op_encrypt): Likewise.
4839 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
4840 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
4841 (_gpgme_gpgsm_op_sign): Likewise.
4842 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
4844 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
4845 non-inherited file descriptor index of the pipe.
4847 2001-12-13 Werner Koch <wk@gnupg.org>
4849 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
4850 (gpgsm_status_handler): Pass datalines to a colon handler
4851 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
4854 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
4856 (gpgsm_assuan_simple_command): Removed underscore from
4858 (_gpgme_gpgsm_start): Ditto.
4859 (gpgsm_assuan_simple_command): Replaced interal Assuan read
4860 function by the new assuan_read_line. Removed the use of the
4862 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
4863 (_gpgme_gpgsm_start): Use the documented way to get an fd from
4866 * keylist.c (keylist_colon_handler): Handle "crt" records
4867 * key.h (gpgme_key_s): Add an x509 flag.
4868 * key.c (parse_x509_user_id): New.
4869 (_gpgme_key_append_name): Handle x.509 names.
4871 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
4873 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
4876 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
4878 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
4879 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
4881 (_gpgme_gpgsm_op_sign): Likewise.
4883 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
4885 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
4888 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
4890 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
4892 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
4894 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
4895 Deal with assuan read line returning more than one line (for now).
4897 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
4899 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
4900 the current protocol definition.
4902 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
4904 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
4907 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4909 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
4910 for now, rungpg.h and status-table.h.
4911 (gpgsm_status_handler): Implement more of the status handler.
4913 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4915 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
4916 (_gpgme_engine_op_delete): Likewise.
4917 (_gpgme_engine_op_encrypt): Likewise.
4918 (_gpgme_engine_op_export): Likewise.
4919 (_gpgme_engine_op_genkey): Likewise.
4920 (_gpgme_engine_op_keylist): Likewise.
4921 (_gpgme_engine_op_sign): Likewise.
4922 (_gpgme_engine_op_trustlist): Likewise.
4924 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
4925 (gpgsm_assuan_simple_command): Likewise.
4926 (gpgsm_set_recipients): Likewise.
4927 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
4928 (_gpgme_gpgsm_op_delete): New function.
4929 (_gpgme_gpgsm_op_export): Likewise.
4930 (_gpgme_gpgsm_op_genkey): Likewise.
4931 (_gpgme_gpgsm_op_sign): Likewise.
4932 (_gpgme_gpgsm_op_keylist): Likewise.
4933 (_gpgme_gpgsm_op_trustlist): Likewise.
4934 (_gpgme_gpgsm_release): Release command.
4935 (_gpgme_gpgsm_op_decrypt): Allocate command.
4936 (_gpgme_gpgsm_op_import): Likewise.
4937 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
4939 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4941 * gpgme.h (gpgme_set_protocol): New prototype.
4943 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4945 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
4946 (_gpgme_gpgsm_op_import): Likewise.
4948 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4950 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
4952 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
4954 2001-11-22 Werner Koch <wk@gnupg.org>
4956 * engine-gpgsm.c: Include more headers so that NULL and mk_error
4957 is defined even with an undefined GPGSM_PATH.
4959 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
4961 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
4962 gpg_outbound_handler): Moved to ...
4963 * data.c (_gpgme_data_inbound_handler, write_mem_data,
4964 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
4965 _gpgme_* ones non-static.
4966 * data.c: Include io.h.
4968 * ops.h (_gpgme_data_inbound_handler): New prototype.
4969 (_gpgme_data_outbound_handler): Likewise.
4970 (_gpgme_gpg_spawn): Use these new functions.
4972 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4973 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
4974 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
4975 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
4976 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
4977 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
4978 Include <rungpg.h> for status handler function.
4980 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
4981 input_data, output_fd, output_data, message_fd, message_data, command
4983 (_gpgme_gpgsm_new): Open input, output and message pipes before
4984 connecting to the client. Close server's ends afterwards.
4985 (_gpgme_gpgsm_release): Close open file descriptors. Remove
4986 server process from wait queue.
4987 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
4988 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
4990 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
4991 (_gpgme_engine_set_status_handler): Likewise.
4992 (_gpgme_engine_op_verify): Likewise.
4994 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
4996 * context.h: Do not include rungpg.h, but engine.h.
4997 (struct gpgme_context_s): Replace member gpg with engine.
4998 * gpgme.c (gpgme_release): Release engine, not gpg.
5000 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
5002 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
5003 Make static, change order of arguments, and return an error value.
5004 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
5006 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
5007 (_gpgme_gpg_op_encrypt): Likewise.
5008 (_gpgme_gpg_op_decrypt): Likewise.
5009 (_gpgme_gpg_op_delete): Likewise.
5010 (_gpgme_gpg_op_export): Likewise.
5011 (_gpgme_gpg_op_genkey): Likewise.
5012 (_gpgme_gpg_op_import): Likewise.
5013 (_gpgme_gpg_op_keylist): Likewise.
5014 (_gpgme_gpg_op_sign): Likewise.
5015 (_gpgme_gpg_op_trustlist): Likewise.
5016 * rungpg.c (_gpgme_gpg_op_verify): New function.
5017 (_gpgme_gpg_op_encrypt): Likewise.
5018 (_gpgme_gpg_op_decrypt): Likewise.
5019 (_gpgme_gpg_op_delete): Likewise.
5020 (_gpgme_gpg_op_export): Likewise.
5021 (_gpgme_gpg_op_genkey): Likewise.
5022 (_gpgme_gpg_op_import): Likewise.
5023 (_gpgme_gpg_op_keylist): Likewise.
5024 (_gpgme_gpg_op_sign): Likewise.
5025 (_gpgme_gpg_op_trustlist): Likewise.
5027 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
5028 (_gpgme_engine_set_command_handler): Likewise.
5029 (_gpgme_engine_set_colon_line_handler): Likewise.
5030 (_gpgme_engine_op_decrypt): Likewise.
5031 (_gpgme_engine_op_delete): Likewise.
5032 (_gpgme_engine_op_encrypt): Likewise.
5033 (_gpgme_engine_op_export): Likewise.
5034 (_gpgme_engine_op_genkey): Likewise.
5035 (_gpgme_engine_op_import): Likewise.
5036 (_gpgme_engine_op_keylist): Likewise.
5037 (_gpgme_engine_op_sign): Likewise.
5038 (_gpgme_engine_op_trustlist): Likewise.
5039 (_gpgme_engine_op_verify): Likewise.
5040 (_gpgme_engine_start): Likewise.
5041 * engine.c (_gpgme_engine_set_status_handler): New function.
5042 (_gpgme_engine_set_command_handler): Likewise.
5043 (_gpgme_engine_set_colon_line_handler): Likewise.
5044 (_gpgme_engine_op_decrypt): Likewise.
5045 (_gpgme_engine_op_delete): Likewise.
5046 (_gpgme_engine_op_encrypt): Likewise.
5047 (_gpgme_engine_op_export): Likewise.
5048 (_gpgme_engine_op_genkey): Likewise.
5049 (_gpgme_engine_op_import): Likewise.
5050 (_gpgme_engine_op_keylist): Likewise.
5051 (_gpgme_engine_op_sign): Likewise.
5052 (_gpgme_engine_op_trustlist): Likewise.
5053 (_gpgme_engine_op_verify): Likewise.
5054 (_gpgme_engine_start): Likewise.
5056 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
5058 * encrypt.c (gpgme_op_encrypt_start): Likewise.
5059 * decrypt.c (_gpgme_decrypt_start): Likewise.
5060 * passphrase.c (_gpgme_passphrase_start): Likewise.
5061 * keylist.c (gpgme_op_keylist_start): Likewise.
5063 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5065 * types.h: Add types EngineObject and GpgsmObject.
5067 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
5068 engine-gpgsm.c, engine.h and engine.c.
5069 * engine.h: New file.
5070 * engine.c: Likewise.
5071 * engine-gpgsm.h: Likewise.
5072 * engine-gpgsm.c: Likewise.
5074 * rungpg.c (_gpgme_gpg_get_version): New function.
5075 (_gpgme_gpg_check_version): Likewise.
5076 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
5077 _gpgme_gpg_check_version.
5079 * version.c (compare_versions): Rename to ...
5080 (_gpgme_compare_versions): ... this. Make non-static.
5081 (gpgme_check_version): Use _gpgme_compare_versions rather than
5083 (gpgme_check_engine): Likewise.
5084 * ops.h (_gpgme_get_program_version): Add prototype.
5086 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5088 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
5089 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
5090 (libgpgme_la_LIBADD): Likewise.
5092 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
5094 * version.c: Remove global variables lineno and
5096 (version_handler): Removed.
5097 (_gpgme_get_program_version): New function.
5098 (get_engine_info): Don't use context and version_handler,
5099 but _gpgme_get_program_version.
5100 * ops.h (_gpgme_get_program_version): Add prototype for
5101 _gpgme_get_program_version (we expect to use it elsewhere soon).
5103 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
5105 * version.c (get_engine_info): If GnuPG is not available, return
5107 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
5109 (_gpgme_get_gpgsm_path): New function.
5110 * w32-util.c (find_program_in_registry): New static function.
5111 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
5112 to use find_program_in_registry.
5113 (_gpgme_get_gpgsm_path): New function.
5114 (util.h): Prototype _gpgme_get_gpgsm_path).
5115 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
5118 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5120 * decrypt-verify.c: New file.
5121 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
5122 * types.h: Add decrypt-verify types.
5124 * context.h: Add result type for decrypt-verify.
5125 * gpgme.h: Add decrypt-verify prototypes.
5127 * decrypt.c (decrypt_status_handler): Renamed to ...
5128 (_gpgme_decrypt_status_handler): ... this. Make non-static.
5129 (_gpgme_decrypt_start): New function, derived from
5130 gpgme_op_decrypt_start.
5131 (gpgme_op_decrypt_start): Reimplement in terms of
5132 _gpgme_decrypt_start.
5133 (_gpgme_decrypt_result): New function to retrieve error value.
5134 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
5135 * ops.h: Add prototypes for new functions.
5137 * verify.c (verify_status_handler): Renamed to ...
5138 (_gpgme_verify_status_handler): ... this. Make non-static.
5139 (gpgme_op_verify_start): Use new function name.
5140 (intersect_stati): Renamed to ...
5141 (_gpgme_intersect_stati): ... this. Make non-static.
5142 (gpgme_op_verify): Use new name.
5143 * ops.h: Add prototypes for new functions.
5145 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
5147 * passphrase.c: New file.
5148 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
5149 * ops.h (_gpgme_passphrase_result): Add prototypes from
5151 * types.h: Likewise.
5152 * context.h: Add member passphrase to result.
5153 * gpgme.c (_gpgme_release_result): Release passphrase member.
5155 * decrypt.c: Some formatting and variable name changes (like
5157 (struct decrypt_result_s): Remove members now found in
5159 (_gpgme_release_decrypt_result): Don't release removed members.
5160 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
5161 and don't handle the cases catched there.
5162 (command_handler): Removed.
5163 (gpgme_op_decrypt_start): Don't set command handler, but invoke
5164 _gpgme_passphrase_start which does it.
5165 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
5166 cases covered by it.
5168 * sign.c Some formatting and variable name changes (like
5170 (struct sign_result_s): Remove members now found in
5172 (_gpgme_release_sign_result): Don't release removed members.
5173 (sign_status_handler): Call _gpgme_passphrase_status_handler,
5174 and don't handle the cases catched there.
5175 (command_handler): Removed.
5176 (gpgme_op_sign_start): Don't set command handler, but invoke
5177 _gpgme_passphrase_start which does it.
5178 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
5179 cases covered by it.
5181 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5183 * decrypt.c (command_handler): Fix last change.
5185 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
5187 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
5188 Rename R2 to NEXT_RESULT.
5189 (intersect_stati): Rename RES to RESULT.
5190 (gpgme_get_sig_status): Likewise. Do not check return_type, but
5191 the member verify of result.
5192 (gpgme_get_sig_key): Likewise.
5194 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
5195 RESULT is zero, return.
5196 (sign_status_handler, command_handler): Do not check return_type,
5197 but the member sign of result.
5198 (gpgme_op_sign): Likewise. Drop assertion.
5200 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
5201 If RESULT is zero, return.
5202 (encrypt_status_handler): Do not check return_type, but the member
5204 (gpgme_op_encrypt): Likewise. Drop assertion.
5206 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
5207 (create_result_struct): Do not set result_type.
5208 (command_handler, decrypt_status_handler): Do not check
5209 return_type, but the member decrypt of result.
5210 (gpgme_op_decrypt): Likewise. Drop assertion.
5212 * context.h (enum ResultType): Removed.
5213 (struct gpgme_context_s): Remove member result_type.
5214 (struct result): Replaces union result.
5215 * gpgme.c: Include string.h.
5216 (_gpgme_release_result): Release all members of c->result, which
5217 is now a struct. Zero out all members of the struct afterwards.
5219 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
5221 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
5222 Release all members of the list GPG->arglist.
5223 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
5225 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
5227 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
5229 * key.c: Include string.h.
5231 * recipient.c: Likewise.
5233 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
5235 * context.h: New member signers_len.
5236 * signers.c (gpgme_signers_clear): Require that signers are
5237 non-NULL with assertion. Use signers_len to determine how much
5238 keys to release. Add documentation.
5239 (gpgme_signers_add): Use signers_len to determine if the buffer is
5240 large enough. Use xtryrealloc rather than xtrymalloc and copying.
5242 (gpgme_signers_enum): Use signers_len to determine if key is
5243 available. Add documentation.
5245 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
5247 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
5248 ALLOC_CHUNK, not DH->length.
5250 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
5252 * gpgme.c (gpgme_set_protocol): Fix last change.
5254 2001-10-15 Werner Koch <wk@gnupg.org>
5256 * gpgme.h (GpgmeProtocol): New.
5257 * gpgme.c (gpgme_set_protocol): New.
5259 2001-09-26 Werner Koch <wk@gnupg.org>
5261 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
5262 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
5264 2001-09-17 Werner Koch <wk@gnupg.org>
5266 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
5267 callers to use this function without a check for tmp_key.
5269 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
5270 emptying the queue. Bug reported by Stéphane Corthésy.
5272 2001-09-12 Werner Koch <wk@gnupg.org>
5274 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
5276 2001-09-07 Werner Koch <wk@gnupg.org>
5278 * rungpg.h: Add NO_RECP.
5279 * encrypt.c (encrypt_status_handler): Take on No_RECP.
5280 (gpgme_op_encrypt): Better error return.
5282 * verify.c (verify_status_handler): Take on NODATA.
5284 2001-09-03 Werner Koch <wk@gnupg.org>
5286 * rungpg.h: Added STATUS_INV_RECP.
5287 * gpgme.c (_gpgme_release_result): Add support for new
5288 EncryptResult object.
5289 * encrypt.c (append_xml_encinfo): New.
5290 (encrypt_status_handler): Add some status parsing.
5291 (_gpgme_release_encrypt_result): New.
5293 2001-08-29 Werner Koch <wk@gnupg.org>
5295 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
5297 * keylist.c (keylist_colon_handler): Do a finish key if we receive
5298 an EOF here. This is probably the reason for a lot of bugs
5299 related to keylisting. It is so obvious. Kudos to Enno Cramer
5300 for pointing that out.
5302 2001-08-28 Werner Koch <wk@gnupg.org>
5304 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
5305 (_gpgme_set_op_info): New.
5306 (_gpgme_release_result): Reset the op_info here.
5307 * sign.c (append_xml_siginfo): New.
5308 (sign_status_handler): Store the sig create information.
5310 2001-07-31 Werner Koch <wk@gnupg.org>
5312 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
5314 2001-07-30 Werner Koch <wk@gnupg.org>
5316 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
5318 * rungpg.c (build_argv): Disable armor comments
5319 * w32-io.c (build_commandline): Need to add quotes here
5321 2001-07-24 Werner Koch <wk@gnupg.org>
5323 * data.c (gpgme_data_read): Add a a way to return the available bytes.
5325 2001-07-23 Werner Koch <wk@gnupg.org>
5327 * util.c: Removed stpcpy() because we use the version from jnlib.
5329 2001-07-19 Werner Koch <wk@gnupg.org>
5331 * mkstatus: Define the collating sequence for sort.
5333 2001-06-26 Werner Koch <wk@gnupg.org>
5335 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
5337 2001-06-15 Werner Koch <wk@gnupg.org>
5339 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
5340 to Timo for pointing this out.
5342 2001-06-01 Werner Koch <wk@gnupg.org>
5344 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
5347 2001-05-28 Werner Koch <wk@gnupg.org>
5349 * version.c (gpgme_check_engine): Stop version number parsing at
5350 the opening angle and not the closing one. By Tommy Reynolds.
5352 2001-05-01 José Carlos García Sogo <jose@jaimedelamo.eu.org>
5354 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
5355 line, because it gave an error if another operation had been made
5356 before using the same context.
5358 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
5359 one line to release the gpg object in the context (if any).
5361 2001-04-26 Werner Koch <wk@gnupg.org>
5363 * key.c, key.h (_gpgme_key_cache_init): New.
5364 (_gpgme_key_cache_add): New.
5365 (_gpgme_key_cache_get): New.
5366 * version.c (do_subsystem_inits): Init the cache.
5367 * keylist.c (finish_key): Put key into the cache
5368 * verify.c (gpgme_get_sig_key): First look into the cache.
5370 2001-04-19 Werner Koch <wk@gnupg.org>
5372 * keylist.c (parse_timestamp): Adjusted for the changed
5373 --fixed-list-mode of gpg 1.0.4h.
5375 2001-04-05 Werner Koch <wk@gnupg.org>
5377 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
5379 2001-04-04 Werner Koch <wk@gnupg.org>
5381 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
5382 are still bytes pending. Timo found this not easy to track down
5385 2001-04-02 Werner Koch <wk@gnupg.org>
5387 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
5388 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
5390 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
5391 the mode set in the current context. Suggested by Timo.
5393 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
5394 can_encrypt. By Timo.
5396 2001-03-30 Werner Koch <wk@gnupg.org>
5398 * debug.c (debug_init): Allow to specify a debug file.
5399 (_gpgme_debug_level): New.
5401 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
5402 (_gpgme_io_select): Debug only with level > 2.
5404 2001-03-15 Werner Koch <wk@gnupg.org>
5406 * rungpg.c: Included time.h.
5408 * key.h: New keyflags for capabilities.
5409 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
5410 (keylist_colon_handler): Parse them.
5411 * gpgme.h: New attribute values for capabilties.
5412 * key.c (gpgme_key_get_string_attr): Return them.
5413 (capabilities_to_string): New.
5414 (gpgme_key_get_ulong_attr): Return the global caps.
5416 2001-03-14 Werner Koch <wk@gnupg.org>
5418 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
5419 Thanks to Jan Oliver Wagner.
5421 2001-03-13 Werner Koch <wk@gnupg.org>
5423 * context.h: Add invalid and revoke flags to user_id structure.
5424 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
5425 (keylist_colon_handler): Adjust for that.
5426 (set_userid_flags): New.
5427 (set_mainkey_trust_info): Handle new key invalid flag
5428 (set_subkey_trust_info): Ditto.
5429 * gpgme.h: Add new attributes for key and user ID flags.
5430 * key.c (_gpgme_key_append_name): Init these flags
5431 (gpgme_key_get_as_xml): Print them.
5432 (one_uid_as_xml): New helper for above.
5433 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
5434 Return the new attributes. Enhanced, so that subkey information
5435 can be returned now.
5437 2001-02-28 Werner Koch <wk@gnupg.org>
5439 * w32-io.c (destroy_reader): Set stop_me flag.
5440 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
5441 (_gpgme_io_write): Use a writer thread to avaoid blocking.
5442 (_gpgme_io_close): Cleanup a writer thread
5443 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
5444 waiting which is now possible due to the use of a writer thread.
5446 2001-02-20 Werner Koch <wk@gnupg.org>
5448 * w32-io.c (destroy_reader,kill_reader): New.
5449 (create_reader, reader): Add a new event to stop the thread.
5450 (_gpgme_io_close): Kill the reader thread.
5452 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
5453 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
5455 * wait.c: Reworked the whole thing.
5456 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
5457 (_gpgme_gpg_release): Remove the process from the wait queue.
5459 2001-02-19 Werner Koch <wk@gnupg.org>
5461 * w32-io.c (_gpgme_io_set_close_notify): New.
5462 (_gpgme_io_close): Do the notification.
5464 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
5467 * wait.c (remove_process): Don't close the fd here.
5468 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
5469 (_gpgme_wait_on_condition): Remove the assert on the queue and
5470 break out if we could not find the queue. The whole thing should
5473 * posix-io.c (_gpgme_io_set_close_notify): New.
5474 (_gpgme_io_close): Do the notification.
5476 * rungpg.c (close_notify_handler): New.
5477 (_gpgme_gpg_new): Register a callback for the fd.
5478 (_gpgme_gpg_set_colon_line_handler): Ditto.
5481 2001-02-13 Werner Koch <wk@gnupg.org>
5483 * rungpg.c (struct reap_s): Replaced pid_t by int.
5485 * types.h: Add ulong typedef.
5487 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
5488 (_gpgme_gpg_release): Reap children.
5489 * io.h, posix-io.c (_gpgme_io_kill): New.
5490 * w32-io.c (_gpgme_io_kill): New (dummy).
5492 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
5494 * posix-io.c (_gpgme_io_read): Add some debug output.
5495 (_gpgme_io_write): Ditto.
5496 (_gpgme_io_select): Increased the timeout.
5498 2001-02-12 Werner Koch <wk@gnupg.org>
5500 Enhanced the signature verification, so that it can how handle
5501 more than one signature and is able to return more information on
5503 * verify.c (gpgme_get_sig_key): New.
5504 (gpgme_get_sig_status): New.
5506 * gpgme.h: Add stdio.h.
5507 (GpgmeSigStat): New status DIFF.
5509 2001-02-01 Werner Koch <wk@gnupg.org>
5511 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
5512 code to all Set/ResetEvent().
5514 * rungpg.c (read_status): Check for end of stream only if we have
5517 2001-01-31 Werner Koch <wk@gnupg.org>
5519 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
5520 (propagate_term_results,clear_active_fds): Removed.
5521 (count_active_fds): Renamed to ..
5522 (count_active_and_thawed_fds): .. this and count only thawed fds.
5524 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
5527 2001-01-30 Werner Koch <wk@gnupg.org>
5529 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
5531 * version.c (get_engine_info): Return better error information.
5533 * posix-util.c, w32-util.c: New.
5534 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
5535 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
5537 * signers.c (gpgme_signers_add): Ooops, one should test code and
5538 not just write it; the newarr was not assigned. Thanks to José
5539 for pointing this out. Hmmm, still not tested, why shoudl a coder
5542 * w32-io.c: Does now use reader threads, so that we can use
5543 WaitForMultipleObjects.
5544 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
5545 Does currently only work for W32.
5547 * debug.c, util.h : New. Changed all fprintfs to use this new
5548 set of debugging functions.
5550 2001-01-23 Werner Koch <wk@gnupg.org>
5552 * data.c (_gpgme_data_release_and_return_string): Fixed string
5555 2001-01-22 Werner Koch <wk@gnupg.org>
5560 * key.c (gpgme_key_ref, gpgme_key_unref): New.
5561 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
5563 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
5564 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
5566 2001-01-05 Werner Koch <wk@gnupg.org>
5568 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
5571 Copyright 2001,2002,2003,2004,2005,2006,2007 g10 Code GmbH
5573 This file is free software; as a special exception the author gives
5574 unlimited permission to copy and/or distribute it, with or without
5575 modifications, as long as this notice is preserved.
5577 This file is distributed in the hope that it will be useful, but
5578 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
5579 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.