Commit Graph

193 Commits

Author SHA1 Message Date
Marcus Brinkmann
ad264f924b 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* posix-io.c (_gpgme_io_select): Don't use a non-constant struct initializer.
	* version.c (_gpgme_get_program_version): Likewise.
	Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
2002-09-02 12:17:51 +00:00
Marcus Brinkmann
c40f22a7d8 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* conversion.c (_gpgme_decode_c_string): Set DESTP before modifying DEST.
2002-09-01 23:29:55 +00:00
Marcus Brinkmann
d55e88d0bc 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* conversion.c (_gpgme_decode_c_string): Fix off by one error in last change.
	* rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
	_gpgme_op_edit so its prototype is known early on.
2002-09-01 23:08:50 +00:00
Marcus Brinkmann
328bed4901 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* conversion.c: New file.
	* util.h: Add prototypes for _gpgme_decode_c_string and
	_gpgme_hextobyte.
	* keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
	on issuer name.
	* Makefile.am (libgpgme_la_SOURCES): Add conversion.c
	* key.c (_gpgme_key_append_name): Replace calls to hextobyte by
	calls to _gpgme_hextobyte.
	(hash_key): Likewise.
2002-09-01 22:23:56 +00:00
Marcus Brinkmann
1731657df0 2002-09-01 Marcus Brinkmann <marcus@g10code.de>
* op-support.c (_gpgme_op_reset): Set CTX->pending after calling
	_gpgme_engine_release, as this will reset pending to zero in the
	event done callback on cancelled operations.
2002-09-01 19:47:11 +00:00
Marcus Brinkmann
ee97cfaa5d 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
	* rungpg.h: Also to prototype.
	* engine.c (_gpgme_engine_op_edit): Likewise.
	* engine.h: Likewise.
	* edit.c (_gpgme_op_edit_start): Likewise.
2002-08-31 02:34:26 +00:00
Marcus Brinkmann
8e118f2d2c 2002-08-30 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
	Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
2002-08-30 11:00:58 +00:00
Werner Koch
c642b7d54a * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
selection.
* vasprintf.c (va_copy): Define macro if not yet defined.
2002-08-29 11:57:53 +00:00
Marcus Brinkmann
f01df10760 2002-08-29 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (_gpgme_passphrase_status_handler): Reset
	CTX->result.passphrase->no_passphrase if passphrase is given (good
	or bad).  Submitted by Jean DIRAISON <jean.diraison@free.fr>.
2002-08-29 00:30:31 +00:00
Marcus Brinkmann
61aa194762 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
* posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
	Return 0 on success, -1 on error.
	* version.c (_gpgme_get_program_version): Don't wait for the child.
	* engine.c (_gpgme_engine_housecleaning): Function removed.
	(do_reaping): Likewise.
	(_gpgme_engine_add_child_to_reap_list): Likewise.
	(struct reap_s): Removed.
	(reap_list): Likewise.
	(reap_list_lock): Likewise.
	* engine.h (_gpgme_engine_io_event): Remove prototypes for
	_gpgme_engine_housecleaning and
	_gpgme_engine_add_child_to_reap_list.
	* rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
	(struct gpg_object_s): Remove PID member.
	(_gpgme_gpg_new): Don't initialize GPG->pid.
	(_gpgme_gpg_spawn): Don't set GPG->pid.
	* wait.c (run_idle): Removed.
	(gpgme_wait): Run idle_function directly.
2002-08-28 20:31:31 +00:00
Marcus Brinkmann
2ba4dc7998 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
* encrypt-sign.c (encrypt_sign_status_handler): Remove dead
	variables encrypt_info and encrypt_info_len.
	* trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
	* posix-sema.c (sema_fatal): Remove function.
	All these reported by St�phane Corth�sy.
2002-08-28 17:29:32 +00:00
Werner Koch
bcba2d8e2d * gpgme-config.in: Made --prefix work for --libs. 2002-08-23 19:48:30 +00:00
Marcus Brinkmann
5e69581a43 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
* ath.h: Update list of symbols that get a prefix: Rename the
	ath_mutex_*_available symbols to ath_*_available.
2002-08-20 23:15:03 +00:00
Marcus Brinkmann
166fbcc9ef 2002-08-21 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (SUBDIRS): Remove jnlib.
	* configure.ac: Don't check for unsigned short or unsigned long.
	Don't check for memicmp, strlwr, strtoul, memmove, stricmp.
	Make stpcpy a replaced function.
	Don't define HAVE_JNLIB_LOGGING.
	Don't generate jnlib/Makefile.

gpgme/
2002-08-21  Marcus Brinkmann  <marcus@g10code.de>

	* stpcpy.c: New file from gnulib.
	* Makefile.am (assuan_libobjs): Remove jnlib.
2002-08-20 22:42:48 +00:00
Werner Koch
b3901634c3 Replaced with a new and faster version. This does not anymore try to
build test programs.  If we really need test programs, we should add
an option to gpgme-config to do so.
2002-08-20 16:11:46 +00:00
Marcus Brinkmann
bfbe265613 doc/
2002-08-20  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Importing Keys): Document gpgme_op_import_ext.

gpgme/
2002-08-20  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: Add prototype for gpgme_op_import_ext.
	* import.c (struct import_result_s): New member `nr_considered'.
	Rename `any_imported' to `nr_imported'.
	(import_status_handler): Increment nr_imported.  Set nr_considered
	if appropriate.
	(gpgme_op_import_ext): New function.
	(gpgme_op_import): Implement in terms of gpgme_op_import_ext.
2002-08-20 13:38:40 +00:00
Werner Koch
009390ddb1 * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s. 2002-08-20 11:59:38 +00:00
Marcus Brinkmann
d50bc6abc1 2002-08-20 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
	* encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
	handling.
2002-08-20 11:01:43 +00:00
Werner Koch
337119d9b2 * decrypt.c (is_token,skip_token): Duplicated from verify.c
(gpgme_op_decrypt): Hack to properly return Decryption_Failed..
(_gpgme_decrypt_status_handler): Create an operation info.
2002-08-19 16:55:08 +00:00
Werner Koch
a8782e4ed7 * key.h (struct certsig_s): New. Use it in gpgme_key_s.
* key.c (gpgme_key_release): Release it. We need to add more code
of course.
(_gpgme_key_append_name): Use memset to intialize the struct.
* gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
* rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
non the list mode.

* key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
information about the key type (PGP or X.509).
(gpgme_key_get_ulong_attr): Likewise.

* keylist.c (keylist_colon_handler): Include 1 in the check for
valid algorithms so that RSA is usable.  Store the issuer name and
serial number also for "crs" records.  Parse the expire date for
subkeys.
(set_userid_flags): Put them onto the last appended key.
2002-08-14 14:01:09 +00:00
Werner Koch
b94497bf1f Fixed an update conflict. 2002-08-01 10:16:21 +00:00
Marcus Brinkmann
4530913bc5 2002-07-29 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
2002-07-29 11:01:53 +00:00
Marcus Brinkmann
f12433c1e4 2002-07-28 Marcus Brinkmann <marcus@g10code.de>
* data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
	instead an error.

	The following changes make it possible to flush an inbound data
	pipe before invoking a command handler:

	* posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
	_gpgme_io_select.  Set timeout of 0 if this is set.
	* w32-io.c (_gpgme_io_select): Likewise.
	* io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
	* wait.c (do_select): Add new argument to _gpgme_io_select
	invocation.
	* rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
	linked_data to prototype.
	* engine.h (_gpgme_engine_set_command_handler): Likewise.
	* engine.c (_gpgme_engine_set_command_handler): Likewise.
	* passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
	argument to _gpgme_engine_set_command_handler.
	* rungpg.c (struct gpg_object_s): New members linked_data and
	linked_idx in CMD.
	(_gpgme_gpg_new): Initialize those new members.
	(_gpgme_gpg_set_command_handler): Accept new argument linked_data.
	(build_argv): Handle linked_data in the same hack as cb_data.
	(read_status): If linked_data is in use, flush the pipe before
	activating the command handler.
	* gpgme.h: Add prototypes for gpgme_op_edit_start and
	gpgme_op_edit.

	The next changes export the status codes to the user:

	* decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
	all STATUS_ with GPGME_.
	* delete.c (delete_status_handler): Likewise.
	* decrypt-verify.c (decrypt_verify_status_handler): Likewise.
	* encrypt.c (_gpgme_encrypt_status_handler): Likewise.
	(_gpgme_encrypt_sym_status_handler): Likewise.
	* encrypt-sign.c (encrypt_sign_status_handler): Likewise.
	* engine-gpgsm.c (parse_status): Likewise.
	(gpgsm_status_handler): Likewise.
	(gpgsm_set_recipients): Likewise.
	* export.c (export_status_handler): Likewise.
	* genkey.c (genkey_status_handler): Likewise.
	* import.c (append_xml_impinfo): Likewise.
	(import_status_handler): Likewise.
	* keylist.c (keylist_status_handler): Likewise.
	* passphrase.c (_gpgme_passphrase_status_handler): Likewise.
	(command_handler): Likewise.
	* progress.c (_gpgme_progress_status_handler): Likewise.
	* sign.c (_gpgme_sign_status_handler): Likewise.
	* trustlist.c (trustlist_status_handler): Likewise.
	* verify.c (_gpgme_verify_status_handler): Likewise.
	* gpgme.h (GpgmeEditCb): New type.
	* rungpg.h (GpgStatusCode): Rename and move to ...
	* gpgme.h (GpgmeStatusCode): ... this and here.
	* Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
	* mkstatus: Prefix STATUS with GPGME_.
	* rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
	accordingly.
	* ops.h (_gpgme_verify_status_handler,
	_gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
	_gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
	_gpgme_progress_status_handler): Likewise.
	* rungpg.c (struct gpg_object_s): Likewise for CMD.code.

	These changes add an edit operation to GPGME:

	* context.h (struct gpgme_context_s): New member RESULT.edit.  *
	ops.h: Add prototype for _gpgme_release_edit_result and
	_gpgme_passphrase_command_handler.
	* passphrase.c (command_handler): Make non-static and rename to ...
	(_gpgme_passphrase_command_handler): ... this.
	(_gpgme_passphrase_start): Use new name for command handler.
	* types.h: Add EditResult type.
	* gpgme.c (_gpgme_release_result): Release EDIT result.
	* edit.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add edit.c.
	(libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
	assuan_libobjs.
	(assuan_libobjs): New variable, set this instead
	libgpgme_la_LIBADD.
	* engine.h (_gpgme_engine_op_edit): New prototype.
	* engine.c (_gpgme_engine_op_edit): New function.
	* rungpg.h (_gpgme_gpg_op_edit): New prototype.
	* rungpg.c (_gpgme_gpg_op_edit): New function.
2002-07-28 18:41:02 +00:00
Marcus Brinkmann
1aef493b8d 2002-07-27 Marcus Brinkmann <marcus@g10code.de>
* delete.c (delete_problem): New case ambigious specification.
	(delete_status_handler): Handle new case (poorly).
2002-07-27 14:24:07 +00:00
Marcus Brinkmann
1ffa0534ea 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
2002-07-25 18:44:57 +00:00
Marcus Brinkmann
b295bab058 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
	fopencookie.
	* vasprintf.c: Update to more recent libiberty version.
	* debug.h: Replace #elsif with #elif.

	Submitted by St�phane Corth�sy:
	* util.h (vasprintf): Correct prototype.
	* encrypt-sign.c: Include <stddef.h>.
	(encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
	size_t.
	* ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
	* ath-pth.c: Likewise.
2002-07-25 17:51:42 +00:00
Marcus Brinkmann
8359ecc707 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
2002-07-25 16:08:14 +00:00
Marcus Brinkmann
eecc18a736 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* key.c (gpgme_key_get_as_xml): Add OTRUST attribute.  Requested
	by St�phane Corth�sy.
	(gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
	silence gcc warning.
2002-07-25 16:01:55 +00:00
Marcus Brinkmann
b4d7702369 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
	patterns.  Reported by St�phane Corth�sy.
2002-07-25 15:45:40 +00:00
Marcus Brinkmann
4ef64980fb 2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* wait.c (fdt_global): Make static.  Reported by St�phane
	Corth�sy.
2002-07-25 15:33:03 +00:00
Marcus Brinkmann
b92c8f057c 2002-07-03 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.

	* gpgme.c (_gpgme_op_event_cb_user): New function.
	* op-support.c (_gpgme_op_reset): Support a new mode of operation
	for private or user event loop.  Use new user event callback
	wrapper.
	* trustlist.c (gpgme_op_trustlist_start): Use this new mode.
	* keylist.c (gpgme_op_keylist_start): Likewise.

	* rungpg.c (_gpgme_gpg_io_event): New function.
	* rungpg.h (_gpgme_gpg_io_event): New prototype.
	* engine-gpgsm.c (_gpgme_gpg_io_event): New function.
	* engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
	* engine.c (_gpgme_engine_io_event): New function.
	* engine.h (_gpgme_engine_io_event): New prototype.
	* keylist.c (finish_key): Call _gpgme_engine_io_event, and move
	the real work for the default IO callback routines to ...
	(_gpgme_op_keylist_event_cb): ... here.  New function.
	* trustlist.c (trustlist_colon_handler): Signal
	GPGME_EVENT_NEXT_TRUSTITEM.  Move queue manipulation to ...
	(_gpgme_op_trustlist_event_cb): ... here.  New function.
	* gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
	and _gpgme_op_trustlist_event_cb when appropriate.
	* ops.h (_gpgme_op_keylist_event_cb): New prototype.
	(_gpgme_op_trustlist_event_cb): Likewise.
	* op-support.c (_gpgme_op_reset): Add comment why we don't use the
	user provided event handler directly.
	* gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
	a pointer argument.
	* wait.c (_gpgme_add_io_cb): Likewise.
	* wait.h (_gpgme_add_io_cb): Likewise for prototype.
	* rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
	argument.  Fix up error handling.
	* engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
	new argument, fix up error handling.
2002-07-03 01:57:03 +00:00
Marcus Brinkmann
406ec04563 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
	table (eg use synchronous mode).
2002-06-28 12:02:43 +00:00
Marcus Brinkmann
3ccd2790b3 2002-06-28 Marcus Brinkmann <marcus@g10code.de>
* ops.h (_gpgme_wait_on_condition): Remove HANG argument from
	prototype and change return type to GpgmeError.
	(_gpgme_wait_one): New prototype.
	* wait.c (gpgme_wait): Replace with the meat from
	_gpgme_wait_on_condition here, and remove the support for
	conditions.
	(_gpgme_wait_on_condition): Remove HANG argument from prototype
	and change return type to GpgmeError.  Replace with meat from
	_gpgme_wait_one and add support for conditions.
	(_gpgme_wait_one): Just call _gpgme_wait_on_condition without
	condition.
	* keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
	table (eg use synchronous mode).
	(gpgme_op_keylist_next): Remove HANG argument from
	_gpgme_wait_on_condition.  Check its return value.
	* trustlist.c (gpgme_op_trustlist_start): Always use our own FD
	table (eg use synchronous mode).
	(gpgme_op_trustlist_next): Remove HANG argument from
	_gpgme_wait_on_condition.  Check its return value.
2002-06-28 01:11:20 +00:00
Marcus Brinkmann
e0d89a9a15 doc/
2002-06-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Information About Keys): Fix documentation for IDX.
	(Information About Trust Items): Likewise.

gpgme/
2002-06-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: Fix documentation of key attribute retrieval functions.
2002-06-27 16:34:10 +00:00
Werner Koch
06cd423a8b * gpgsm/t-import.c (print_op_info): New.
(main): Print operation info.

* engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.

* import.c (append_xml_impinfo): Kludge to print fingerprint
instead of keyid for use with gpgsm.
(import_status_handler): Set a flag to know whether any import
occured.
(gpgme_op_import): Reurn -1 if no certificate ewas imported.

* gpgme.texi (Importing Keys): Document the return value -1 of
gpgme_op_import.
2002-06-26 12:49:59 +00:00
Werner Koch
5df644f5cc * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
function arguments.
2002-06-25 18:50:23 +00:00
Marcus Brinkmann
3ea78f5a20 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
	listed in RECP.
	* export.c (gpgme_op_export): If no data was returned, return
	GPGME_No_Recipients.
2002-06-25 12:10:27 +00:00
Marcus Brinkmann
ea042a1fa9 2002-06-25 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
2002-06-25 11:14:44 +00:00
Marcus Brinkmann
2ded628d4d 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
	(parse_status): New function.
	(gpgsm_status_handler): Use parse_status.
	(gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
	STATUS_FNC_VALUE and process status messages.
	(gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
	(gpgsm_set_fd): Likewise.
	(_gpgme_gpgsm_op_keylist): Likewise.
	(_gpgme_gpgsm_op_keylist_ext): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
2002-06-21 19:16:16 +00:00
Marcus Brinkmann
a8f087da34 2002-06-21 Marcus Brinkmann <marcus@g10code.de>
* wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
2002-06-21 15:28:56 +00:00
Werner Koch
1211f36b15 * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty. 2002-06-20 13:45:50 +00:00
Werner Koch
45d99504f5 * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
(skip_token): New.
(_gpgme_verify_status_handler): Watch out for wrong key usage.
(gpgme_get_sig_string_attr): Hack to return info on the key
usage.  Does now make use of the former RESERVED argument which
has been renamed to WHATIDX.
(gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.

* gpgme.texi (Verify): Explain the new whatidx variable.
2002-06-20 12:13:44 +00:00
Marcus Brinkmann
ccde48c08d 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
* wait.c (do_select): Return -1 on error, and 0 if nothing to run.
	(_gpgme_wait_one): Only set HANG to zero if do_select returned an
	error, or there are no more file descriptors to wait on.
	(_gpgme_wait_on_condition): Ignore return value from do_select for
	now.
2002-06-14 20:06:35 +00:00
Werner Koch
276e401c42 * verify.c (gpgme_op_verify): Make sure that we never access an
unitialized result structure.
2002-06-13 08:45:32 +00:00
Werner Koch
61c97e9fa9 tests/
* gpgsm/t-keylist.c (doit): Print operation info if available.
gpgme/
* keylist.c (struct keylist_result_s): New.
(_gpgme_release_keylist_result): Release it here
(keylist_status_handler): Handle truncated.
(append_xml_keylistinfo): New.
* gpgme.c (_gpgme_release_result): and use it here.
* types.h: Declare the new type here.
* context.h (struct gpgme_context_s): Use it here.
2002-06-12 14:34:15 +00:00
Marcus Brinkmann
14f16305b0 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
	(_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
	use our own close notification mechanism without interfering with
	assuan.
2002-06-11 18:12:19 +00:00
Werner Koch
6b89172051 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
constants.
* verify.c (calc_sig_summary): New.
(gpgme_get_sig_ulong_attr): And use it here.
2002-06-11 15:33:08 +00:00
Marcus Brinkmann
5b75138331 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
	close notification for the status fd to ...
	(_gpgme_gpgsm_new): ... here.
	* wait.h: Include "sema.h".  Remove prototypes of
	_gpgme_remove_proc_from_wait_queue and
	_gpgme_register_pipe_handler.  Add prototypes of
	_gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
	_gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
	_gpgme_wait_one..
	* wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
	FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK.  New global variables
	FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
	CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK.  Remove struct
	proc_s.  Replace struct wait_item_s.
	(_gpgme_fd_table_init): New function.
	(_gpgme_fd_table_deinit): Likewise.
	(_gpgme_fd_table_put): Likewise.
	(set_process_done): Remove function.
	(do_select): Take argument FDT.  Use that to decide which fds to
	select on.
	(_gpgme_remove_proc_from_wait_queue): Remove function.
	(_gpgme_wait_event_cb): New function.
	(_gpgme_wait_one): Likewise.
	(_gpgme_register_pipe_hanldler): Remove function.
	(_gpgme_add_io_cb): New function.
	(_gpgme_remove_io_cb): Likewise.
	(_gpgme_freeze_fd): Remove function.
	(_gpgme_thaw_fd): Remove function.
	* rungpg.c (struct fd_data_map_s): Add new member TAG.
	(struct gpg_object_s): Likewise for STATUS and COLON.  Add member
	IDX to CMD.  Add new member IO_CBS.
	(close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
	For each I/O callback, check if it should be unregistered.  If all
	callbacks have been unregistered, trigger GPGME_EVENT_DONE.
	Remove member RUNNING.
	(_gpgme_gpg_new): Initialize new members.
	(_gpgme_gpg_release): Check PID not RUNNING.  Don't call
	_gpgme_remove_proc_from_wait_queue.  Close GPG->CMD.FD if set.
	(build_argv): Store away the index instead the file descriptor for
	CMD.
	(_gpgme_gpg_add_io_cb): New function.
	(_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
	callbacks.
	(gpg_status_handler): Change return type to void, remove PID
	argument, close filedescriptor if EOF or error occurs.
	(read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
	Use IO_CBS->remove instead _gpgme_freeze_fd.
	(gpg_colon_line_handler): Change return type to void, remove PID
	argument, close filedescriptor if EOF or error occurs.
	(command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
	(_gpgme_gpg_set_io_cbs): New function.
	* rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
	_gpgme_gpg_set_io_cbs.
	* gpgme.h (GpgmeIOCb): New type.
	(GpgmeRegisterIOCb): Likewise.
	(GpgmeRemoveIOCb): Likewise.
	(GpgmeEventIO): Likewise.
	(GpgmeEventIOCb): Likewise.
	(struct GpgmeIOCbs): New structure to hold I/O callbacks.
	(gpgme_set_op_io_cbs): New prototype.
	(gpgme_get_op_io_cbs): Likewise.
	* ops.h: New prototype for _gpgme_op_event_cb.  Remove prototypes
	for _gpgme_freeze_fd and _gpgme_thaw_fd.  Remove PID argument from
	_gpgme_data_inbound_handler and _gpgme_data_outbound_handler
	prototype.  Add prototype for _gpgme_op_reset.
	Add synchronous argument to _gpgme_decrypt_start prototype.
	* io.h: Beautification.
	* gpgme.c: Include "wait.h".
	(gpgme_new): Initialize FDT.
	(gpgme_set_io_cbs): New function.
	(gpgme_get_io_cbs): Likewise.
	(_gpgme_op_event_cb): Likewise.
	* data.c (_gpgme_data_inbound_handler): Change return type to
	void.  Drop PID argument.  Close FD on error and EOF.
	(write_mem_data): Don't close FD here ...
	(write_cb_data): ... or here ...
	(_gpgme_data_outbound_handler): ... but here.  Change return type
	to void.  Drop PID argument.
	* context.h: Include "wait.h".
	(struct gpgme_context_s): New members FDT and IO_CBS.
	* op-support.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
	* ops.h: Add prototype for _gpgme_op_reset().
	* decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS.  Use
	_gpgme_op_reset.
	(gpgme_op_decrypt_start): Add synchronous argument.
	(gpgme_op_decrypt): Likewise.  Use _gpgme_wait_one instead
	gpgme_wait.
	* delete.c (gpgme_op_delete_start): Rename to ...
	(_gpgme_op_delete_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_delete_start): Just a wrapper around
	_gpgme_op_delete_start now.
	(gpgme_op_delete): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* encrypt.c: Include "wait.h".
	(ggpgme_op_encrypt_start): Rename to ...
	(_gpgme_op_encrypt_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_encrypt_start): Just a wrapper around
	_gpgme_op_encrypt_start now.
	(gpgme_op_encrypt): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
	(_gpgme_op_encrypt_sign_start): ... this.  New argument
	SYNCHRONOUS.  Use _gpgme_op_reset.  Make function static.
	(gpgme_op_encrypt_sign_start): Just a wrapper around
	_gpgme_op_encrypt_sign_start now.
	(gpgme_op_encrypt_sign): Add synchronous argument.  Use
	_gpgme_wait_one instead gpgme_wait.
	* export.c (gpgme_op_export_start): Rename to ...
	(_gpgme_op_export_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_export_start): Just a wrapper around
	_gpgme_op_export_start now.
	(gpgme_op_export): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* genkey.c (gpgme_op_genkey_start): Rename to ...
	(_gpgme_op_genkey_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_genkey_start): Just a wrapper around
	_gpgme_op_genkey_start now.
	(gpgme_op_genkey): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* import.c (gpgme_op_import_start): Rename to ...
	(_gpgme_op_import_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_import_start): Just a wrapper around
	_gpgme_op_import_start now.
	(gpgme_op_import): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
	(gpgme_op_keylist_ext_start): Likewise.
	* sign.c (gpgme_op_sign_start): Rename to ...
	(_gpgme_op_sign_start): ... this.  New argument SYNCHRONOUS.  Use
	_gpgme_op_reset.  Make function static.
	(gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
	now.
	(gpgme_op_sign): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
	* verify.c (gpgme_op_verify_start): Rename to ...
	(_gpgme_op_verify_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_verify_start): Just a wrapper around
	_gpgme_op_verify_start now.
	(gpgme_op_verify): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* engine-gpgsm.c (iocb_data_t): New type.
	(struct gpgsm_object_s): New member status_cb.  Replace input_fd
	and input_data with input_cb.  Replace output_fd and output_data
	with output_cb.  Replace message_fd and message_data with
	message_cb.  New member io_cbs.
	(_gpgme_gpgsm_new): Initialize all new members (and drop the old
	ones).
	(close_notify_handler): New variable POSSIBLY_DONE.  For each I/O
	callback, check if it should be unregistered.  If all callbacks
	have been unregistered, trigger GPGME_EVENT_DONE.
	(_gpgme_gpgsm_release): Remove variable PID.  Use new variable
	names to close the file descriptors.
	(_gpgme_gpgsm_op_decrypt): Use new variable names,
	(_gpgme_gpgsm_op_encrypt): Likewise.
	(_gpgme_gpgsm_op_genkey): Likewise.
	(_gpgme_gpgsm_op_import): Likewise.
	(_gpgme_gpgsm_op_keylist): Likewise.
	(_gpgme_gpgsm_op_keylist_ext): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_verify): Likewise.
	(gpgsm_status_handler): Drop argument PID.  Change return type to
	void.  Close status pipe before returning because of EOF or error.
	(_gpgme_gpgsm_add_io_cb): New function.
	(_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
	callback function.
	(_gpgme_gpgsm_set_io_cbs): New function.
	* engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
	* engine.c (_gpgme_engine_set_io_cbs): New function.
	* engine.h: New prototype for _gpgme_engine_set_io_cbs.
2002-06-10 14:13:55 +00:00
Marcus Brinkmann
4816ac107a 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
2002-06-04 10:40:34 +00:00
Marcus Brinkmann
7892a2a64f 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
* key.c: Include <ctype.h>.
	(_gpgme_key_append_name): Skip one more char when
	processing escaped char.  Submitted by Marc Mutz <mutz@kde.org>.
	Handle hexadecimal encodings.  Also reported by Marc.  Thanks!
2002-06-02 23:09:16 +00:00