Commit Graph

585 Commits

Author SHA1 Message Date
Marcus Brinkmann
8e65687b46 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
* data-mem.c: Include <string.h>.
	* engine.c: Likewise.
2003-01-06 14:07:56 +00:00
Marcus Brinkmann
617ca7e7b8 2003-01-06 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
2003-01-05 23:37:14 +00:00
Marcus Brinkmann
b6e5bb310e doc/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Verify): Drop R_STAT argument in gpgme_op_verify.
	* gpgme.texi (Decrypt and Verify): Likewise for
	gpgme_op_decrypt_verify.

gpgme/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
	argument.
	* decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
	argument.
	* verify.c (gpgme_op_verify): Drop R_STAT argument.
	(_gpgme_intersect_stati): Function removed.
	* ops.h (_gpgme_intersect_stati): Remove prototype.

tests/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgsm/t-verify.c (main): Adjust caller of gpgme_op_verify.
	* gpg/t-verify.c (main): Likewise.
	* gpg/t-decrypt-verify.c (main): Likewise for
	gpgme_op_decrypt_verify.
2002-12-24 13:08:56 +00:00
Marcus Brinkmann
1491938785 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
* libgpgme.vers: New file.
	* Makefile.am (EXTRA_DIST): Add libgpgme.vers.
	(libgpgme_version_script_cmd): New variable.
	(libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
	(libgpgme_la_DEPENDENCIES): New variable.
2002-12-23 23:47:27 +00:00
Marcus Brinkmann
1bf2a7b4a2 2002-12-24 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: New conditional HAVE_LD_VERSION_SCRIPT.
	Call AC_CANONICAL_HOST, use host instead target.

gpgme/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* libgpgme.vers: New file.
	* Makefile.am (EXTRA_DIST): Add libgpgme.vers.
	(libgpgme_version_script_cmd): New variable.
	(libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
	(libgpgme_la_DEPENDENCIES): New variable.
2002-12-23 23:45:28 +00:00
Marcus Brinkmann
768098eb93 Fix last change. 2002-12-23 23:44:22 +00:00
Marcus Brinkmann
15de808fea 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
* key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
	(otrust_to_string): New function.
	(gpgme_key_get_as_xml): Use it.
	(validity_to_string): New function.
	(gpgme_key_get_string_attr): Beautify using above functions.
	(gpgme_key_get_ulong_attr): Likewise.
2002-12-23 22:31:03 +00:00
Marcus Brinkmann
1ab62dbcba 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
* data-mem.c (mem_release): Fix gcc warning.
	* data-user.c (user_release): Likewise.
2002-12-23 17:47:01 +00:00
Marcus Brinkmann
6a772bd6bc doc/
2002-12-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Memory Based Data Buffers): New subsection.
	(File Based Data Buffers): Likewise.
	(Callback Based Data Buffers): Likewise.
	(Manipulating Data Buffers): Update interfaces.  Add
	gpgme_data_seek.
	* gpgme.texi (Engine Version Check): Remove gpgme_chec_engine.

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

	* data.h (gpgme_data_release_cb): Change return type to void.
	(gpgme_data_read_cb): Change return type to ssize_t.
	* data.c (gpgme_data_read): Likewise.
	* data-stream.c (stream_read): Likewise.
	* data-fd.c (fd_read): Likewise.
	* data-mem.c (mem_read): Likewise.
	(mem_release): Change return type to void.
	* data-user.c (user_read): Change return type to ssize_t.
	(user_release): Change return type to void.
	* data-compat.c (old_user_read): Change return type to ssize_t.
	* gpgme.h (GpgmeDataReadCb): Likewise.
	(gpgme_data_read): Likewise.
	(GpgmeDataSeekCb): Change return type to off_t.
2002-12-06 22:06:25 +00:00
Marcus Brinkmann
1b495c5140 2002-12-04 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h: Add prototype for gpgme_get_key.
	* key.c (gpgme_get_key): New function.
	* verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.

	* gpgme.h: Add prototypes for new interfaces
	gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
	(enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
	* gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
	* key.h (struct certsig_s): New members ALGO, NAME_PART,
	EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.

	* conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
	Use that to determine if allocation is desired or not.
	* util.h: Adjust prototype of _gpgme_decode_c_string.
	* keylist.c (keylist_colon_handler): Adjust caller of
	_gpgme_decode_c_string.

	* key.h (struct gpgme_key_s): New member last_uid.
	* key.c (_gpgme_key_append_name): Rewritten using
	_gpgme_decode_c_string and the last_uid pointer.
	(my_isdigit): Macro removed.
	(ALLOC_CHUNK): Likewise.
	* keylist.c (set_userid_flags): Use last_uid member of KEY.

	* context.h (struct user_id_s): New member last_certsig.
	* key.h: Add prototype for _gpgme_key_add_certsig.
	* key.c (_gpgme_key_add_certsig): New function.
	(set_user_id_part): Move function before _gpgme_key_add_certsig.
	(parse_user_id): Change first argument to SRC, add new arguments
	NAME, EMAIL and COMMENT.  Change code to use these arguments
	instead going through UID.  Move function before
	_gpgme_add_certsig.
	(parse_x509_user_id): Likewise.
	(_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
	and parse_user_id invocation.
	(one_certsig_as_xml): New function.
	(one_uid_as_xml): Print signatures.
	* context.h (struct gpgme_context_s): New member TMP_UID.
	* keylist.c (keylist_colon_handler): Rewritten, implement "sig"
	record entries.

	* key.c (get_certsig): New function.
	(gpgme_key_sig_get_string_attr): Likewise.
	(gpgme_key_sig_get_ulong_attr): Likewise.

	* keylist.c: Include <ctype.h>.
	(my_isdigit): Macro removed.
	(set_mainkey_trust_info): Use isdigit, not my_isdigit.
	(set_userid_flags): Likewise.
	(set_subkey_trust_info): Likewise.
	(set_ownertrust): Likewise.
	(finish_key): Move function up a bit and remove prototype.

	* rungpg.c (gpg_keylist_ext): Correct precedence of signature
	listing mode.
	(gpg_keylist_ext): Implement signature listing mode.
2002-12-04 16:28:34 +00:00
Marcus Brinkmann
856c4398c6 2002-11-25 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
	* posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
	for parent fds.
	* w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
	CloseHandle for parent fds.
2002-11-25 21:12:46 +00:00
Marcus Brinkmann
bc06e0cb8e 2002-11-22 Werner Koch <wk@gnupg.org>
* engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
	setlocale before doing another setlocale.
2002-11-22 17:45:55 +00:00
Marcus Brinkmann
80e77635cf 2002-11-22 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h [_MSC_VER]: Define ssize_t as long.
2002-11-22 17:38:31 +00:00
Marcus Brinkmann
5047222b11 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
* decrypt.c: Some beautyfication.
2002-11-21 13:48:41 +00:00
Marcus Brinkmann
80801660a9 2002-11-21 Marcus Brinkmann <marcus@g10code.de>
* verify.c (_gpgme_verify_status_handler): Treat
	GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
	Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
2002-11-21 11:21:40 +00:00
Marcus Brinkmann
dfc32a5441 doc/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Generating Keys): Document new argument to
	gpgme_op_genkey.

gpgme/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
	(struct genkey_result_s): Add new member FPR.
	(_gpgme_release_genkey_result): Free RESULT->fpr if set.
	(genkey_status_handler): Extract the fingerprint from the status
	line.
	(gpgme_op_genkey): Add new argument FPR and return the fingerprint
	in it.
	* gpgme.h: Adjust prototype of gpgme_op_genkey.

tests/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-genkey.c (main): Add missing argument to gpgme_op_genkey
	invocation.
CVSk: ----------------------------------------------------------------------
2002-11-19 16:41:17 +00:00
Marcus Brinkmann
a1bf7a10b4 2002-11-19 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
	twice, to get fingerprints on subkeys.  Suggested by Timo Schulz
	<twoaday@freakmail.de>.
	(gpg_keylist_ext): Likewise.
2002-11-19 09:33:20 +00:00
Marcus Brinkmann
b8ae2150c3 Fix email address. 2002-11-05 15:20:43 +00:00
Marcus Brinkmann
94d230c8b4 2002-11-05 Marcus Brinkmann <marcus@gnu.org>
* import.c (append_xml_impinfo): Use
	_gpgme_data_append_string_for_xml rather than
	_gpgme_data_append_string for the field content.
	Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2002-11-05 12:04:07 +00:00
Marcus Brinkmann
3a6381133a 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
* rungpg.h, engine-gpgsm.h: File removed.
	* engine-backend.h: New file.
	* Makefile.am (gpgsm_components): New variable, set depending on
	automake conditional HAVE_GPGSM.
	(libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
	engine-gpgsm.h.  Replace engine-gpgsm.c with ${gpgsm_components}.
	(status-table.h): Depend on gpgme.h, not rungpg.h.
	* conversion.c: Include <stdlib.h>.
	* engine-gpgsm.c: Do not set ENABLE_GPGSM here.  Include
	"engine-backend.h" instead "engine-gpgsm.h".  Reorder some
	functions and remove all function prototypes.
	(_gpgme_gpgsm_get_version): Make static and rename to ...
	(gpgsm_get_version): ... this.
	(_gpgme_gpgsm_check_version): Make static and rename to ...
	(gpgsm_check_version): ... this.
	(_gpgme_gpgsm_new): Make static.  Change argument type from
	GpgsmObject * to void **.  Call gpgsm_release instead
	_gpgme_gpgsm_release.
	(_gpgme_gpgsm_op_decrypt): Make static and rename to ...
	(gpgsm_check_decrypt): ... this.
	(_gpgme_gpgsm_op_delete): Make static and rename to ...
	(gpgsm_check_delete): ... this.
	(_gpgme_gpgsm_set_recipients): Make static and rename to ...
	(gpgsm_check_set_recipients): ... this.
	(_gpgme_gpgsm_op_encrypt): Make static and rename to ...
	(gpgsm_encrypt): ... this.
	(_gpgme_gpgsm_op_export): Make static and rename to ...
	(gpgsm_export): ... this.
	(_gpgme_gpgsm_op_genkey): Make static and rename to ...
	(gpgsm_genkey): ... this.
	(_gpgme_gpgsm_op_import): Make static and rename to ...
	(gpgsm_import): ... this.
	(_gpgme_gpgsm_op_keylist): Make static and rename to ...
	(gpgsm_keylist): ... this.
	(_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
	(gpgsm_keylist_ext): ... this.
	(_gpgme_gpgsm_op_sign): Make static and rename to ...
	(gpgsm_sign): ... this.
	(_gpgme_gpgsm_op_trustlist): Make static and rename to ...
	(gpgsm_trustlist): ... this.
	(_gpgme_gpgsm_op_verify): Make static and rename to ...
	(gpgsm_verify): ... this.
	(gpgsm_status_handler): Rename to ...
	(status_handler): ... this.
	(_gpgme_gpgsm_set_status_handler): Make static and rename to ...
	(gpgsm_set_status_handler): ... this.
	(_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
	(gpgsm_set_colon_line_handler): ... this.
	(_gpgme_gpgsm_add_io_cb): Rename to ...
	(add_io_cb): ... this.
	(_gpgme_gpgsm_start): Make static and rename to ...
	(gpgsm_start): ... this.
	(_gpgme_gpgsm_set_io_cb): Make static and rename to ...
	(gpgsm_set_io_cb): ... this.
	(_gpgme_gpgsm_io_event): Make static and rename to ...
	(gpgsm_io_event): ... this.
	(struct _gpgme_engine_ops_gpgsm): New variable.
	[!ENABLE_GPGSM]: Removed.
	* engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
	<assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h".  Include
	<stdlib.h> and "engine-backend.h".
	(struct engine_object_s): Rewritten.
	(engine_ops): New variable.
	* engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
	_gpgme_engine_check_version, _gpgme_engine_new,
	_gpgme_engine_release, _gpgme_engine_set_verbosity,
	_gpgme_engine_set_status_handler,
	_gpgme_engine_set_command_handler,
	_gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
	_gpgme_engine_op_delete, _gpgme_engine_op_edit,
	_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
	_gpgme_engine_op_export, _gpgme_engine_op_genkey,
	_gpgme_engine_op_import, _gpgme_engine_op_keylist,
	_gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
	_gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
	_gpgme_engine_start, _gpgme_engine_set_io_cbs,
	_gpgme_engine_io_event): Reimplement.
	* engine.h: Fix a few comments and a variable name in a prototype.
	* ops.h: Do not include "rungpg.h".
	* passphrase.c: Include config.h only if [HAVE_CONFIG_H].  Do not
	include "rungpg.h".
	* recipient.c: Likewise.
	* signers.c: Likewise.
	* version.c: Likewise.
	* rungpg.c: Likewise.  Include "engine-backend.h".  Reorder
	functions and remove prototypes.
	(_gpgme_gpg_get_version): Make static and rename to ...
	(gpg_get_version): ... this.
	(_gpgme_gpg_check_version): Make static and rename to ...
	(gpg_check_version): ... this.
	(_gpgme_gpg_new): Make static.  Change argument type from
	GpgObject * to void **.  Call gpg_release instead
	_gpgme_gpg_release.
	(_gpgme_gpg_op_decrypt): Make static and rename to ...
	(gpg_check_decrypt): ... this.
	(_gpgme_gpg_op_delete): Make static and rename to ...
	(gpg_check_delete): ... this.
	(_gpgme_gpg_set_recipients): Make static and rename to ...
	(gpg_check_set_recipients): ... this.
	(_gpgme_gpg_op_encrypt): Make static and rename to ...
	(gpg_encrypt): ... this.
	(_gpgme_gpg_op_export): Make static and rename to ...
	(gpg_export): ... this.
	(_gpgme_gpg_op_genkey): Make static and rename to ...
	(gpg_genkey): ... this.
	(_gpgme_gpg_op_import): Make static and rename to ...
	(gpg_import): ... this.
	(_gpgme_gpg_op_keylist): Make static and rename to ...
	(gpg_keylist): ... this.
	(_gpgme_gpg_op_keylist_ext): Make static and rename to ...
	(gpg_keylist_ext): ... this.
	(_gpgme_gpg_op_sign): Make static and rename to ...
	(gpg_sign): ... this.
	(_gpgme_gpg_op_trustlist): Make static and rename to ...
	(gpg_trustlist): ... this.
	(_gpgme_gpg_op_verify): Make static and rename to ...
	(gpg_verify): ... this.
	(gpg_status_handler): Rename to ...
	(status_handler): ... this.
	(_gpgme_gpg_set_status_handler): Make static and rename to ...
	(gpg_set_status_handler): ... this.
	(_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
	(gpg_set_colon_line_handler): ... this.
	(gpgme_gpg_add_io_cb): Rename to ...
	(add_io_cb): ... this.
	(_gpgme_gpg_start): Make static and rename to ...
	(gpg_start): ... this.
	(_gpgme_gpg_set_io_cb): Make static and rename to ...
	(gpg_set_io_cb): ... this.
	(_gpgme_gpg_io_event): Make static and rename to ...
	(gpg_io_event): ... this.
	(struct _gpgme_engine_ops_gpg): New variable.
2002-10-12 00:33:05 +00:00
Marcus Brinkmann
7ad91c720c 2002-10-10 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
	missing argument.
2002-10-10 11:34:56 +00:00
Marcus Brinkmann
412ccb3b47 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
* data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
	data-compat.c: New file.  Really check them in this time, completes
	2002-10-08 change.
2002-10-09 12:26:00 +00:00
Marcus Brinkmann
dba1515d9c 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
* rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
	and move to ...
	* types.h (GpgmeStatusHandler): ... here.
	* rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
	and move to ...
	* types.h (GpgmeColonLineHandler): ... here.
	* rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
	and move to ...
	* types.h (GpgmeCommandHandler): ... here.
	* engine.h: Don't include "rungpg.h".
	(_gpgme_engine_set_status_handler): Change type of
	argument from GpgStatusHandler to GpgmeStatusHandler.
	(_gpgme_engine_set_colon_line_handler): Change type of
	argument from GpgColonLineHandler to GpgmeColonLineHandler.
	(_gpgme_engine_set_command_handler): Change type of
	argument from GpgCommandHandler to GpgmeCommandHandler.
	* engine-gpgsm.h: Don't include "rungpg.h".
	(_gpgme_gpgsm_set_status_handler): Change type of
	argument from GpgStatusHandler to GpgmeStatusHandler.
	(_gpgme_gpgsm_set_colon_line_handler): Change type of
	argument from GpgColonLineHandler to GpgmeColonLineHandler.
	* engine-gpgsm.c: Do not include "rungpg.h".
	(struct gpgsm_object_s): Change type of
	status.fnc to GpgmeStatusHandler.  Change type of colon.fnc to
	GpgmeColonLineHandler.
	(gpgsm_assuan_simple_command): Change type of argument from
	GpgStatusHandler to GpgmeStatusHandler.
	(_gpgme_gpgsm_set_status_handler): Likewise.
	(_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
	GpgColonLineHandler to GpgmeColonLineHandler.
	* rungpg.h (_gpgme_gpg_set_status_handler): Change type of
	argument from GpgStatusHandler to GpgmeStatusHandler.
	(_gpgme_gpg_set_colon_line_handler): Change type of
	argument from GpgColonLineHandler to GpgmeColonLineHandler.
	(_gpgme_gpg_set_command_handler): Change type of
	argument from GpgCommandHandler to GpgmeCommandHandler.
	* rungpg.c (struct gpg_object_s): Change type of status.fnc to
	GpgmeStatusHandler.  Change type of colon.fnc to
	GpgmeColonLineHandler.  Change type of cmd.fnc to
	GpgmeCommandLineHandler.
	(_gpgme_gpg_set_status_handler): Change type of argument FNC to
	GpgmeStatusHandler.
	(_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
	to GpgmeColonLineHandler.
	(_gpgme_gpg_set_command_handler): Change type of argument FNC to
	GpgmeCommandHandler.
	* engine.c (_gpgme_engine_set_status_handler): Change type of
	argument FNC to GpgmeStatusHandler.
	(_gpgme_engine_set_colon_line_handler): Change type of argument FNC
	to GpgmeColonLineHandler.
	(_gpgme_engine_set_command_handler): Change type of argument FNC to
	GpgmeCommandHandler.
2002-10-09 12:23:33 +00:00
Marcus Brinkmann
291b5c78f4 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
* rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
	* rungpg.c (struct gpg_object_s): Remove PM.
	(pipemode_cb): Prototype removed.
	(add_pm_data): Function removed.
	(_gpgme_gpg_enable_pipemode): Likewise.
	(pipemode_copy): Likewise.
	(pipemode_cb): Likewise.
	(add_arg): Don't check for pipemode.
	(add_data): Likewise.
	(_gpgme_gpg_set_status_handler): Likewise.
	(_gpgme_gpg_set_colon_line_handler): Likewise.
	(_gpgme_gpg_set_command_handler): Likewise.
	(_gpgme_gpg_spawn): Likewise.
	(_gpgme_gpg_spawn): Don't set PM.active.
	(_gpgme_gpg_op_verify): Remove pipemode case.
	* verify.c (_gpgme_op_verify_start): Remove pipemode case.
2002-10-09 11:57:17 +00:00
Marcus Brinkmann
8646a29754 2002-10-09 Marcus Brinkmann <marcus@g10code.de>
* rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
	_gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
	_gpgme_gpg_set_simple_line_handler): Prototype removed.
	(_gpgme_gpg_set_verbosity): New prototype.
	* rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
	(add_data): ... this.
	(_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
	(_gpgme_gpg_set_command_handler): Likewise.
	(_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
	_gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
	_gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
	_gpgme_gpg_op_verify): Likewise.
	(_gpgme_gpg_add_pm_data): Rename to ...
	(add_pm_data): ... this.
	(_gpgme_gpg_op_verify): Call add_pm_data, not
	_gpgme_gpg_add_pm_data.
	(_gpgme_gpg_add_arg): Make static and rename to ...
	(add_arg): ... this.
	(_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
	_gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
	_gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
	_gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
	_gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
	_gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
	_gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
	_gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
	_gpgme_gpg_add_arg.
	(_gpgme_gpg_set_verbosity): New function.
	(struct gpg_object_s): Remove member simple from colon.
	(_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
	(_gpgme_gpg_set_simple_line_handler): Removed function.
	(read_colon_line): Don't check the GPG->colon.simple.
	* engine.c (_gpgme_engine_set_verbosity): Call
	_gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
2002-10-09 09:50:41 +00:00
Marcus Brinkmann
7385627265 2002-10-08 Marcus Brinkmann <marcus@g10code.de>
* util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
	_gpgme_strdup, _gpgme_free): Remove prototypes.
	(xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
	macros.
	* util.c: File removed.
	* Makefile.am (libgpgme_la_SOURCES): Remove util.h.
	* conversion.c (_gpgme_decode_c_string): Use malloc instead of
	xtrymalloc, realloc instead of xtryrealloc, calloc instead of
	xtrycalloc, free instead of xfree.
	(_gpgme_data_append_percentstring_for_xml): Likewise.
	* data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
	* data-compat.c (gpgme_data_new_from_filepart): Likewise.
	* data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
	_gpgme_data_get_as_string): Likewise.
	* debug.c (debug_init): Likewise.
	* decrypt.c (_gpgme_release_decrypt_result): Likewise.
	* delete.c (_gpgme_release_delete_result): Likewise.
	* edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
	Likewise.
	* encrypt.c (_gpgme_release_encrypt_result): Likewise.
	* engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
	_gpgme_engine_release): Likewise.
	* engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
	_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
	gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
	_gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
	_gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
	_gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
	_gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
	* genkey.c (_gpgme_release_genkey_result): Likewise.
	* gpgme.c (gpgme_new, gpgme_release): Likewise.
	* import.c (_gpgme_release_import_result): Likewise.
	* key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
	add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
	* keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
	_gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
	* ops.h (test_and_allocate_result): Likewise.
	* passphrase.c (_gpgme_release_passphrase_result,
	_gpgme_passphrase_status_handler,
	_gpgme_passphrase_command_handler): Likewise.
	* progress.c (_gpgme_progress_status_handler): Likewise.
	* recipient.c (gpgme_recipients_new, gpgme_recipients_release,
	gpgme_recipients_add_name_with_validity): Likewise.
	* rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
	_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
	_gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
	build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
	Likewise.
	* sign.c (_gpgme_release_sign_result): Likewise.
	* signers.c (_gpgme_signers_add): Likewise.
	* trustlist.c (trust_item_new, trustlist_colon_handler,
	_gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
	gpgme_trustitem_release): Likewise.
	* verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
	* version.c (gpgme_get_engine_info, _gpgme_get_program_version):
	Likewise.
	* w32-io.c (create_reader, create_writer, destroy_reader,
	destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
	* w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
	* w32-util.c (read_w32_registry_string): Likewise.
	* wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
	_gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
	* data-compat.c: Include <stdlib.h>.
2002-10-09 01:08:21 +00:00
Marcus Brinkmann
0447e0dd6d gpgme/
2002-10-08  Marcus Brinkmann  <marcus@g10code.de>

	New data object component:

	* gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
	GpgmeDataReleaseCb): New types.
	(struct GpgmeDataCbs): New structure.
	(gpgme_data_read): Changed prototype to match that of read() closely.
	(gpgme_data_write): Similar for write().
	(gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
	gpgme_data_new_from_stream): New prototypes.
	(gpgme_data_get_type, gpgme_check_engine): Prototype removed.

	* Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
	data-stream.c, data-mem.c, data-user.c and data-compat.c.
	* data.c: Reimplemented from scratch.
	* (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
	data-user.c): New file.
	* context.h (struct gpgme_data_s): Removed.
	* conversion.c: Include <errno.h> and <sys/types.h>.
	(_gpgme_data_append): New function.
	* data.c (_gpgme_data_append_string): Move to ...
	* conversion.c (_gpgme_data_append_string): ... here.
	* data.c (_gpgme_data_append_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_for_xml): ... here.
	* data.c (_gpgme_data_append_string_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_string_for_xml): ... here.
	* data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.

	* ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
	removed.
	* types.h (GpgmeDataMode): Type removed.

	* decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
	* edit.c (_gpgme_op_edit_start): Likewise.
	* encrypt.c (_gpgme_op_encrypt_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* export.c (_gpgme_op_export_start): Likewise.
	* genkey.c (_gpgme_op_genkey_start): Likewise.
	* import.c (_gpgme_op_import_start): Likewise.
	* sign.c (_gpgme_op_sign_start): Likewise.
	* verify.c (_gpgme_op_verify_start): Likewise.

	* encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.

	* engine.c (_gpgme_engine_op_verify): Add new argument to
	differentiate detached from normal signatures.
	* engine.h (_gpgme_engine_op_verify): Likewise for prototype.
	* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.  Don't check
	mode of data argument.
	* engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
	* gpgme.h (gpgme_op_verify_start): Likewise for prototype.
	(gpgme_op_verify): Likewise for prototype.
	* rungpg.c (_gpgme_gpg_op_verify): Likewise.
	* rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
	* verify.c (_gpgme_op_verify_start): Likewise.
	(gpgme_op_verify_start): Likewise.
	(gpgme_op_verify): Likewise.

	* rungpg.c (struct arg_and_data_s): New member INBOUND to hold
	direction of data object.
	(_gpgme_gpg_add_data): Add new argument INBOUND.  Use it to
	determine direction of data object.
	(_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
	_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
	_gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
	_gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
	_gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
	invocation.
	(build_argv): Use new member INBOUND to determine direction of
	file descriptor.  Don't check the data type.
	* rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.

	* gpgme.c (gpgme_get_op_info): Don't call
	_gpgme_data_get_as_string if CTX->op_info is NULL.

	* version.c (gpgme_check_engine): Function removed.


tests/
2002-10-09  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt.c (print_data): Update to new gpgme_data_read
	interface, and use gpgme_engine_check_version instead
	gpgme_check_version.
	* gpg/t-decrypt-verify.c (print_data): Likewise.
	* gpg/t-edit.c (main): Likewise.
	* gpg/t-encrypt.c (print_data): Likewise.
	* gpg/t-encrypt-sign.c (print_data): Likewise.
	* gpg/t-encrypt-sym.c (print_data): Likewise.
	* gpg/t-eventloop.c (print_data): Likewise.
	* gpg/t-export.c (print_data): Likewise.
	* gpg/t-sign.c (print_data): Likewise.
	* gpg/t-signers.c (print_data): Likewise.
	* gpgsm/t-decrypt.c (print_data): Likewise.
	* gpgsm/t-encrypt.c (print_data): Likewise.
	* gpgsm/t-export.c (print_data): Likewise.
	* gpgsm/t-sign.c (print_data): Likewise.
	* gpg/t-verify.c (main): Likewise for gpgme_op_verify.
	* gpgsm/t-verify.c (main): Likewise for gpgme_op_verify.
	* t-data.c (read_once_test): Likewise.
	(write_test): Update for new behaviour of data objects.
	(main): Remove type test.
2002-10-09 00:16:38 +00:00
Werner Koch
55474920ce typo 2002-09-30 08:04:16 +00:00
Werner Koch
57add1098d * keylist.c (keylist_colon_handler): Take care when printing a
NULL with the DEBUG.

* engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
(gpgsm_status_handler): Run the colon function to indicate.
(_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
2002-09-30 08:03:27 +00:00
Marcus Brinkmann
056bb3b587 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
* conversion.c (_gpgme_hextobyte): Prevent superfluous
	multiplication with base.  Reported by St�phane Corth�sy.

	* keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
	operation type in invocation of _gpgme_op_reset.
2002-09-28 20:08:01 +00:00
Werner Koch
7937658bb7 * ath.c: Include sys/time.h if sys/select.h is not available.
* configure.ac (AC_CHECK_HEADERS): Check for sys/select.h.
2002-09-20 10:44:22 +00:00
Marcus Brinkmann
1dda423fa5 2002-09-13 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (keylist_status_handler): Do not call finish_key() here.
	(gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
2002-09-13 20:54:52 +00:00
Marcus Brinkmann
c34b1e06e7 Regenerated. 2002-09-13 20:54:31 +00:00
Marcus Brinkmann
20707b1928 2002-09-03 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
	into gpgme unconditionally.
	(libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
2002-09-03 11:26:01 +00:00
Marcus Brinkmann
442f2fe541 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
2002-09-02 12:38:43 +00:00
Marcus Brinkmann
1b40ede2c5 2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* debug.c (_gpgme_debug_add): Test *LINE, not LINE.
	(_gpgme_debug_end): Likewise.
	Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
2002-09-02 12:29:53 +00:00
Marcus Brinkmann
f0bb43f3da Wrap the lines nicer. 2002-09-02 12:19:15 +00:00
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
1fcc363243 * vasprintf.c (va_copy): Define macro if not yet defined. 2002-08-29 11:58:22 +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
Marcus Brinkmann
9fe6c4f30d Fixed a missing update in the fix to the update conflict ;)
(STATUS_EOF -> GPGME_STATUS_EOF).
2002-08-02 10:43:58 +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
Werner Koch
458a133794 auto updated version number. 2002-07-02 09:07:52 +00:00
Werner Koch
1caf8a12ab typo fix in comment. 2002-07-02 08:53:31 +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
Marcus Brinkmann
b024a61d89 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
* acinclude.m4: Fix Pth check so that it doesn't error out if pth
	is not found.

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

	* ath.h: Enable the _gpgme_ prefix.  Fix all those prefix macros.
	* posix-sema.c: Use that prefix here.
	* posix-io.c: Include "ath.h".
	(_gpgme_io_read): Use _gpgme_ath_read instead read.
	(_gpgme_io_write): Use _gpgme_ath_write instead write.
	(_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
	(_gpgme_io_select): Use _gpgme_ath_select instead select.
2002-06-02 20:43:04 +00:00
Marcus Brinkmann
ae0d104de2 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Add checks for Pth and pthreads.
	* acinclude.m4: Add slightly hacked check for pth (seems to be an
	autoconf version problem).

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

	* Makefile.am (ath_components): New variable.
	(ath_components_pthread): Likewise.
	(ath_components_pth): Likewise.
	(system_components): Add ath_componentes.

	* ath.h: New file.
	* ath.c: Likewise.
	* ath-pthread.c: Likewise.
	* ath-pth.c: Likewise.
	* posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
	interface.
	* mutex.h: Remove file.
2002-06-02 19:19:25 +00:00
Werner Koch
e282d78413 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
an issuer with IDX > 0.  We don't support altIssuerNames for now.
2002-05-30 09:06:45 +00:00
Werner Koch
4f3be85e5a * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
missing variable definition.  Oohh - Marcus was faster.
2002-05-22 06:35:07 +00:00
Marcus Brinkmann
cec2c916bb 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
* engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
2002-05-22 01:22:57 +00:00
Werner Koch
1721e91c88 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
(_gpgme_gpgsm_op_keylist_ext):  Pass the keylist mode to gpgsm.

* configure.ac (NEED_GPGSM_VERSION): We need gpgsm 0.3.7.
2002-05-21 15:14:35 +00:00
Werner Koch
fe2e3af237 * key.h (gpgme_key_s): Add OTRUST.
* keylist.c (set_ownertrust): New.
(keylist_colon_handler): Get the ownertrust value
* key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
Return that value.
2002-05-10 10:42:45 +00:00
Marcus Brinkmann
4e0d4d7cf3 doc/
2002-05-09  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Overview): Replace note about thread-safeness.
	(Multi Threading): New section.

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

	* w32-util.c: New static variable GET_PATH_LOCK.
	(_gpgme_get_gpg_path): Remove superfluous NULL initializer.
	Take lock while determining path.
	(_gpgme_get_gpgsm_path): Likewise.
	* version.c (do_subsystem_inits): Set DONE to 1 after
	initialization.
	(gpgme_get_engine_info): New variable ENGINE_INFO_LOCK.  Take lock
	while determining engine info.
	* rungpg.c (_gpgme_gpg_get_version): New variable
	GPG_VERSION_LOCK.  Take the lock while determining the program
	version.
	* posix-io.c: Include "sema.h".
	(_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK.  Take the lock
	while fixing the signals.
	(_gpgme_io_select): Make READFDS and WRITEFDS non-static.
	* key.c: Include "sema.h".  New globals KEY_CACHE_LOCK and
	KEY_REF_LOCK.
	(capabilities_to_string): Make STRINGS very const.
	(_gpgme_key_cache_add): Lock the key cache.
	(_gpgme_key_cache_get): Likewise.
	(gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
	* import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
	IMPORT_RES_FIELDS very const.  Make FIELD and FIELD_NAME a litle
	const.
	* engine.c (_gpgme_engine_get_info): New variable
	ENGINE_INFO_LOCK.  Take lock while determining engine info.
	* engine-gpgsm.c: Include "sema.h".
	(_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK.  Take
	lock while getting program version.
2002-05-09 03:38:12 +00:00
Marcus Brinkmann
51e6cf89ed 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
* debug.h: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add debug.h.
	* util.h: Removed all prototypes and declarations related to
	debugging.  Include "debug.h".

	* debug.c (debug_level): Comment variable and remove superfluous
	zero initializer.
	(errfp): Likewise.
	(_gpgme_debug_enabled): Function removed.
	(struct debug_control_s): Definition removed.
	(_gpgme_debug_level): Function removed.
	(_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
	pritnf-style format specification and a variable number of
	arguments.
	(_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
	starts out with "%s" for simplicity.
	(_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
	TEXT argument anymore.

	* posix-io.c (_gpgme_io_select): Use new level argument for
	DEBUG_BEGIN instead explicit if construct.

	* debug.c (debug_init): Remove superfluous zero initializer,
	remove volatile flag of INITIALIZED.  Do not use the
	double-checked locking algorithm, it is fundamentally flawed and
	will empty your fridge (on a more serious note, despite the
	volatile flag it doesn't give you the guarantee you would expect,
	for example on a DEC Alpha or an SMP machine.  The volatile only
	serializes accesses to the volatile variable, but not to the other
	variables).
2002-05-08 04:04:12 +00:00
Marcus Brinkmann
5d03d9b7eb 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
* debug.h: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add debug.h.
	* util.h: Removed all prototypes and declarations related to
	debugging.  Include "debug.h".

	* debug.c (debug_level): Comment variable and remove superfluous
	zero initializer.
	(errfp): Likewise.
	(_gpgme_debug_enabled): Function removed.
	(struct debug_control_s): Definition removed.
	(_gpgme_debug_level): Function removed.
	(_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
	pritnf-style format specification and a variable number of
	arguments.
	(_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
	starts out with "%s" for simplicity.
	(_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
	TEXT argument anymore.

	* posix-io.c (_gpgme_io_select): Use new level argument for
	DEBUG_BEGIN instead explicit if construct.

	* debug.c (debug_init): Remove superfluous zero initializer,
	remove volatile flag of INITIALIZED.  Do not use the
	double-checked locking algorithm, it is fundamentally flawed and
	will empty your fridge (on a more serious note, despite the
	volatile flag it doesn't give you the guarantee you would expect,
	for example on a DEC Alpha or an SMP machine.  The volatile only
	serializes accesses to the volatile variable, but not to the other
	variables).
2002-05-08 03:57:42 +00:00
Werner Koch
203a4778b6 released 0.3.6 2002-05-03 19:49:04 +00:00
Werner Koch
506ae14290 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
output to /dev/null.

* verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
* gpgme.c (gpgme_get_protocol): New.

* data.c (gpgme_data_write): Changed type of BUFFER to void*.
(gpgme_data_read): Ditto.

* verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
lines so that a claim can be made without looking up the key.
(gpgme_get_sig_string_attr): New.
(gpgme_get_sig_ulong_attr): New.

* gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.

* gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
* verify.c (_gpgme_verify_status_handler, finish_sig): Handle
these new status codes.  Store the expiration time
2002-05-03 18:20:06 +00:00
Werner Koch
f14bf86fee * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
lines so that a claim can be made without looking up the key.
(gpgme_get_sig_string_attr): New.
(gpgme_get_sig_ulong_attr): New.

* gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.

* rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
list to align with the status.h file from gnupg.

* gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
* verify.c (_gpgme_verify_status_handler, finish_sig): Handle
these new status codes.  Store the expiration time
2002-05-03 14:06:56 +00:00
Werner Koch
1ac21c55c8 * gpgme.h (GpgmeData_Encoding): New.
* data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
* engine-gpgsm.c (map_input_enc): New. Use it in all local
functions where the INPUT command gets send.
2002-04-27 12:16:48 +00:00
Marcus Brinkmann
40717c3184 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
	descriptor only when we don't need it anymore.  Close the message
	descriptor if we don't need it.
2002-04-27 12:11:52 +00:00
Werner Koch
ffc9f44932 * Makefile.am: Create libtool libraries.
* Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.

* Makefile.am: Create libtool libraries
2002-04-26 12:38:27 +00:00
Marcus Brinkmann
9b28b6b209 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
	GPG->cmd.cb_data, not xfree.
2002-04-25 00:36:03 +00:00
Marcus Brinkmann
f5e05f759f 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
	ttytype, lc_ctype and lc_messages options in the server.
2002-04-24 22:46:25 +00:00
Marcus Brinkmann
a07ede17a2 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (map_assuan_error): Add new error codes.
2002-04-24 02:21:12 +00:00
Werner Koch
43da549e6a * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
can_certify to return the requested values.
2002-04-23 09:06:22 +00:00
Marcus Brinkmann
09635ef2e6 doc/
2002-04-23  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Passphrase Callback): Document that either return
	argument can be NULL.
	(Progress Meter Callback): Likewise.

gpgme/
2002-04-23  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.c (gpgme_get_progress_cb): Allow either return parameter
	to be NULL.
	(gpgme_get_passphrase_cb): Likewise.
2002-04-22 22:06:09 +00:00
Marcus Brinkmann
025866092e doc/
2002-04-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Passphrase Callback): Fix small typo.  Document the
	new function gpgme_get_passphrase_cb.
	(Progress Meter Callback): Document the new function
	gpgme_get_progress_cb.

gpgme/
2002-04-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.c (gpgme_get_passphrase_cb): New function.
	(gpgme_get_progress_cb): New function.
	* gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
	gpgme_get_progress_cb.
2002-04-22 21:58:26 +00:00
Marcus Brinkmann
990e6924d1 2002-04-05 Marcus Brinkmann <marcus@g10code.de>
* acconfig.h: File removed.
	* configure.ac (NEED_GPG_VERSION): Add description.
	(NEED_GPGSM_VERSION): Likewise.
	(HAVE_DOSISH_SYSTEM): Likewise.
	(HAVE_DRIVE_LETTERS): Likewise.
	(GPG_PATH): Likewise.
	(GPGSM_PATH): Likewise.
	* acinclude.m4 (GNUPG_CHECK_TYPEDEF): Likewise.
2002-04-04 23:31:11 +00:00
Werner Koch
d31ded8699 *** empty log message *** 2002-04-01 08:51:06 +00:00
Werner Koch
aa20d6a45a * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
* key.h (gpgme_key_s): Add issuer and chaining elements for X509.
* keylist.c (keylist_colon_handler): Store them.
* key.c	(gpgme_key_release): Free them.
(gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
2002-03-28 17:43:02 +00:00
Werner Koch
dd2cb388a9 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h 2002-03-26 10:15:22 +00:00
Werner Koch
30cacfe62c * util.h (struct) [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t
are defined.
2002-03-21 19:48:12 +00:00
Marcus Brinkmann
6cee0a4f3f 2002-03-17 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Add automake conditional HAVE_DOSISH_SYSTEM.

gpgme/
2002-03-18  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (system_components): New variable, set depending on
	HAVE_DOSISH_SYSTEM.
	(libgpgme_la_SOURCES): Use system_components.  Remove `syshdr.h'.
	* syshdr.h: File removed.

	* posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard.  Clean up source.
	* posix-sema.c: Likewise.
	* posix-util.c: Likewise.

	* w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
	* w32-sema.c: Likewise.
	* w32-util.c: Likewise.

	* posix-io.c: Include `unistd.h', do not include `syshdr.h'.
	* posix-sema.c: Likewise.
	* w32-io.c: Include `io.h', do not include `syshdr.h'
	* w32-sema.c: Likewise.
	* w32-util.c: Likewise.
	* data.c: Do not include `syshdr.h'.
	* wait.c: Likewise.
	* wait.h: Code cleanup.

	* mutex.h: New file.
	* posix-sema.c: Implement.
2002-03-18 00:04:06 +00:00
Werner Koch
cb95583ffe removed all the .cvsignre files - they should be local 2002-03-10 18:41:02 +00:00
Werner Koch
d901ebf3b9 Minor doc fixes 2002-03-10 18:35:33 +00:00
Werner Koch
a86b6932a9 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype. 2002-03-07 19:49:40 +00:00
Marcus Brinkmann
748aa18dc6 doc/
2002-03-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Encrypting a Plaintext): Document symmetric
	encryption.

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

	* encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
	(gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
	is null, and if it is set, use _gpgme_encrypt_sym_status_handler
	as status handler and run _gpgme_passphrase_start.
	* rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
	encryption.
	* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
	return error value.

	* rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.

tests/
2002-03-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-encrypt-sym.c: New file.
	* gpg/Makefile.am (TESTS): Add t-encrypt-sym.
2002-03-06 01:40:25 +00:00
Werner Koch
6616ce295f * configure.ac: Bumbed version to 0.3.4-cvs to continue development. 2002-03-04 11:39:52 +00:00
Werner Koch
bcd5749348 * gpg/Makefile.am (DISTCLEANFILES): Added.
* configure.ac: Bumbed LT version numbers to (7,1,0), requires
gpgsm 0.3.1.
2002-03-04 11:16:11 +00:00
Marcus Brinkmann
3c9959368e doc/
2002-03-03  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Information About Keys): Document GPGME_ATTR_EXPIRE.

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

	* passphrase.c (_gpgme_passphrase_status_handler): Also set the
	error No_Passphrase if only a bad passphrase was provided.
2002-03-03 17:37:34 +00:00
Marcus Brinkmann
7d0eebf41a doc/
2002-03-03  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Verify): Document verification of normal and
	cleartext signatures.

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

	* rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
	GPGME_DATA_MODE_IN, construct a command line that stores the
	plaintext in TEXT.
	* verify.c (gpgme_op_verify_start): Accept TEXT being
	uninitialized, and in this case interpret SIG as a normal or
	cleartext signature and TEXT as a return data object.
	* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.

tests/
2002-03-03  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-verify.c (main): Add a few more sanity checks, and a check
	for normal signatures.
2002-03-03 16:46:33 +00:00
Marcus Brinkmann
a38a8c4daa 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
	Add stub function.
2002-03-03 14:50:29 +00:00
Werner Koch
0857c5cfdd * key.h (subkey_s): New member expires_at.
* keylist.c (keylist_colon_handler): Set it here
* key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
2002-02-28 09:53:56 +00:00
Werner Koch
fccdbcf211 Removed the gpgme_set_signature_algorithm stuff. We can't add a
function to our API without discussion the consequences of.  By design
the signature algorithm is a property of the signer's key and can't be
set arbitrary.  The library is named GnuPG Made Easy so we should not
burden the user with an API to select stuff which can only be done by
the backend.  Changes in gpgme require support by the backend.  If we
have the requirement to implement it, it will be done as a global
configuration option for signers or as meta-data asscociated with a
certificates for recipients. I habe not found this as a requirement of
the Aegypten project.
2002-02-28 07:29:08 +00:00
Matthias Kalle Dalheimer
44edbc7d41 select the signature algorithm - dummy in gpgme.c 2002-02-27 20:59:20 +00:00
Marcus Brinkmann
da2cd9aa44 doc/
2002-02-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Listing Keys): Document gpgme_op_keylist_ext_start.

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

	* rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
	* rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
	* engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
	* engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
	* engine.h (_gpgme_engine_op_keylist_ext): New prototype.
	* engine.c (_gpgme_engine_op_keylist_ext): New function.
	* keylist.c (gpgme_op_keylist_ext_start): New function.
2002-02-27 00:59:31 +00:00
Marcus Brinkmann
31b2a458ff doc/
2002-02-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Encrypting a Plaintext): Document
	GPGME_Invalid_Recipients.
	(Error Values): Likewise.

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

	* gpgme.h: Add new error code GPGME_Invalid_Recipient.
	* encrypt.c (struct encrypt_result_s): New member invalid_recipients,
	rename no_recipients to no_valid_recipients.
	(_gpgme_encrypt_status_handler): Include error for invalid
	recipients.
	* engine-gpgsm.c (gpgsm_set_recipients): Change type of first
	argument to GpgsmObject.  Use that to report back the status about
	the recipients.
2002-02-26 23:39:58 +00:00
Marcus Brinkmann
00d2d15d81 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
* verify.c (_gpgme_verify_status_handler): Fix the last change.
2002-02-26 22:41:31 +00:00
Marcus Brinkmann
c22974f99f doc/
2002-02-26  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Encrypting a Plaintext): Document
	gpgme_op_encrypt_sign and gpgme_op_encrypt_sign_start.

gpgme/
2002-02-25  Marcus Brinkmann  <marcus@g10code.de>

	* engine.c (_gpgme_engine_op_encrypt_sign): New function.
	* engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
	* rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
	(_gpgme_gpg_op_sign): Use that new function.
	(_gpgme_gpg_op_encrypt_sign): New function.
	* rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
	* gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
	(gpgme_op_encrypt_sign): Likewise.
	* Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
	* ops.h (_gpgme_encrypt_status_handler): Add prototype.
	(_gpgme_sign_status_handler): Add prototype.
	* sign.c (sign_status_handler): Rename to ...
	(_gpgme_sign_status_handler): ... this and make non-static.
	* encrypt.c (encrypt_status_handler): Rename to ...
	(_gpgme_encrypt_status_handler): ... this and make non-static.
	* encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
	* sign.c (gpgme_op_sign_start): Likewise.

tests/
2002-02-26  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-encrypt-sign.c: New file.
	* gpg/Makefile.am (TESTS): Add t-encrypt-sign.
2002-02-26 00:08:09 +00:00
Marcus Brinkmann
d75d6fb262 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
* verify.c (_gpgme_verify_status_handler): Parse the args line to
	see if the problem is due to a missing key, and report that back
	to the user.
2002-02-25 19:08:51 +00:00
Marcus Brinkmann
98bee1303f doc/
2002-02-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Creating a Signature): Add a note about
	certifications to include.
	(Included Certifications): New section.

gpgme/
2002-02-25  Marcus Brinkmann  <marcus@g10code.de>

	* context.h (struct gpgme_context_s): New member include_certs.
	* gpgme.h (gpgme_set_include_certs): Add prototype.
	(gpgme_get_include_certs): Likewise.
	* gpgme.c (gpgme_set_include_certs): New function.
	(gpgme_get_include_certs): Likewise.
	(gpgme_new): Set include_certs to 1 (the default).
	* engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
	and pass it to _gpgme_gpgsm_op_sign.
	* engine.h (_gpgme_engine_op_sign): Likewise for prototype.
	* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
	include_certs and handle it.
	* engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
	* sign.c (gpgme_op_sign_start): Add new argument to
	_gpgme_engine_op_sign call.
2002-02-25 18:31:07 +00:00
Werner Koch
9eb5c192b3 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing. 2002-02-14 12:43:28 +00:00
Werner Koch
822e098fed * vasprintf.c, fopencookie.c: Add replacement functions.
* util.h: Add prototypes for them.
2002-02-13 14:59:50 +00:00
Marcus Brinkmann
10750fcfd9 2002-02-12 Marcus Brinkmann <marcus@g10code.de>
* configure.ac (AC_INIT): Bump version to 0.3.3.
	* jnlib/Makefile.am: Rever to older version that includes xmalloc
	but not dotlock and some other files.  Reported by St�phane
	Corth�sy.

tests/
2002-02-12  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/Makefile.am (CLEANFILES): New target.
	(distclean-local): Rename to ...
	(clean-local): ... this.
2002-02-12 22:08:10 +00:00
Marcus Brinkmann
cfa8bcd174 2002-02-10 Marcus Brinkmann <marcus@g10code.de>
* Released 0.3.2.

	* configure.ac (AC_INIT): Bump version to 0.3.2.
	* jnlib/libjnlibconfig.h: Revert to older version that doesn't
	expect libgcrypt.  Reported by Jose Carlos Garcia Sogo
	<jsogo@debian.org>.
2002-02-09  Marcus Brinkmann  <marcus@g10code.de>
2002-02-10 13:31:36 +00:00
Marcus Brinkmann
55cd54f02b Update as edited by configure. 2002-02-09 01:04:12 +00:00
Marcus Brinkmann
69bafd50b5 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
	reach the end of the function.
2002-02-09 00:58:22 +00:00
Marcus Brinkmann
82b7dc1d29 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
* genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
	(gpgme_op_genkey_start): Skip newlines after opening tag.

	* engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
2002-02-09 00:06:32 +00:00
Marcus Brinkmann
f0a45d0c20 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
* genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
	set, and pass them down to the crypto engine.
	* engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
	* engine.h: Likewise.
	* rungpg.h (_gpgme_gpg_spawn): Likewise.
	* engine.c (_gpgme_engine_op_genkey): Likewise.  Use those
	arguments.
	* rungpg.c (_gpgme_gpg_op_genkey): Likewise.  Complain if those
	arguments are set.
	* engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise.  Implement
	function.

	* engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
2002-02-08 22:43:44 +00:00
Marcus Brinkmann
92d18cde9e Add 2002 as copyright year for files changed recently without updating the
year.
2002-02-06 01:41:15 +00:00
Marcus Brinkmann
0bd08bafd9 Some minor source code cleanup. 2002-02-06 01:40:48 +00:00
Marcus Brinkmann
2cb125ccf6 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
	mode (for now).
2002-02-06 01:34:52 +00:00
Marcus Brinkmann
4d40fcd82e Fill in some missing repetitive "Likewise." explanations. 2002-02-06 01:21:41 +00:00
Marcus Brinkmann
69ab559a7b doc/
2002-02-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Waiting For Completion): Adjust doc to changes in
	the code.

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

	* wait.c (gpgme_wait): Add new argument STATUS, in which the
	status of the returned context is returned.
	(_gpgme_wait_on_condition): Rework the function a bit, to make it
	aware of cancelled processes, and to allow to use gpgme_wait with
	CTX being NULL (as documented in the source).
	(struct proc_s): New member REPORTED.
	* gpgme.h: Fix prototype.
	* verify.c (gpgme_op_verify): Fix use of gpgme_wait.
	* sign.c (gpgme_op_sign):
	* import.c (gpgme_op_import):
	* genkey.c (gpgme_op_genkey):
	* export.c (gpgme_op_export):
	* encrypt.c (gpgme_op_encrypt):
	* delete.c (gpgme_op_delete):
	* decrypt-verify.c (gpgme_op_decrypt_verify):
2002-02-06 01:20:49 +00:00
Marcus Brinkmann
4fa3008950 doc/
2002-02-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Key Listing Mode): Update documentation.

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

	* gpgme.c (gpgme_set_keylist_mode): Possibly return an error
	value.
	(gpgme_get_keylist_mode): New function.
	(gpgme_new): Set the default for keylist_mode member of CTX.

	* gpgme.h (gpgme_set_keylist_mode): Fix prototype.
	(gpgme_get_keylist_mode): New prototype.
	(GPGME_KEYLIST_MODE_LOCAL): New macro.
	(GPGME_KEYLIST_MODE_EXTERN): Likewise..
2002-02-06 00:08:47 +00:00
Marcus Brinkmann
1f5180f4b0 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
This patch has gotten a bit large... mmh.  The main thing that
	happens here is that error values are now not determined in the
	operation function after gpgme_wait completed, but in the status
	handler when EOF is received.  It should always be the case that
	either an error is flagged or EOF is received, so that after a
	gpgme_wait you should never have the situation that no error is
	flagged and EOF is not received.  One problem is that the engine
	status handlers don't have access to the context, a horrible
	kludge works around this for now.  All errors that happen during a
	pending operation should be catched and reported in ctx->error,
	including out-of-core and cancellation.  This rounds up neatly a
	couple of loose ends, and makes it possible to pass up any errors
	in the communication with the backend as well.  As a bonus, there
	will be a function to access gpgme->wait, so that the operations
	can truly be implemented with their _start function.

	* engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
	error back to the context.
	* rungpg.c (gpg_status_handler): Same horrible kludge applied here.

	* engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.

	* wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
	to a value indication that.

	* verify.c (add_notation): Set error, not out_of_core.
	(finish_sig): Likewise.
	(gpgme_op_verify_start): Don't clear out_of_core.
	(_gpgme_verify_status_handler): At EOF, clean up the notation data.
	(gpgme_op_verify): And don't do it here.

	* trustlist.c (trustlist_status_handler): Check error, not out_of_core.
	(gpgme_op_trustlist_start): Don't clear out_of_core.
	(gpgme_op_trustlist_next): Check error, not out_of_core.
	(gpgme_op_trustlist_end): Likewise.

	* ops.h (test_and_allocate_result): New macro.
	(_gpgme_passphrase_result): Remove prototype.
	* delete.c (gpgme_op_delete): Return error from context.
	(delete_status_handler): Use macro test_and_allocate_result.
	Perform error checking at EOF.
	(gpgme_op_delete_start): Release result.
	* passphrase.c (_gpgme_passphrase_status_handler): Use macro
	test_and_allocate_result, and perform error checking here.
	(_gpgme_passphrase_result): Function removed.
	* sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
	(gpgme_op_sign): Just return the error value from the context.
	(sign_status_handler): Only progress if no error is set yet.  If
	we process an EOF, set the resulting error value (if any).
	* decrypt.c (_gpgme_decrypt_result): Function removed.
	(create_result_struct): Function removed.
	(_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
	caclulate error on EOF, do not progress with errors.
	(_gpgme_decrypt_start): Do not set out_of_core to zero.
	(gpgme_op_decrypt): Just return the error value from the context.
	* encrypt.c (encrypt_status_handler): Perform the error checking
	here.
	(gpgme_op_encrypt_start): Do not clear out_of_core.
	* export.c (export_status_handler): Return if error is set in context.
	(gpgme_op_export_start): Release result.
	(gpgme_op_export): Return error from context.
	* decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
	the context.
	* genkey.c (genkey_status_handler): Use macro
	test_and_allocate_result.  Perform error checking at EOF.
	(gpgme_op_genkey): Just return the error from context.
	* import.c (gpgme_op_import): Return the error from context.
	(import_status_handler): Use macro test_and_allocate_result.
	* keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
	(gpgme_op_keylist_next): Return error of context.
	(keylist_colon_handler): Set error instead out_of_code.
	(finish_key): Likewise.

	* context.h: Remove member out_of_core, add member error.
	* gpgme.c (_gpgme_release_result): Clear error flag.

	* engine.h (_gpgme_engine_get_error): New prototype.
	* engine.c (_gpgme_engine_get_error): New function.
	* engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.

	* engine-gpgsm.c (map_assuan_error): New function.
	(gpgsm_assuan_simple_command): Change return type to GpgmeError,
	use the new function to map error values.
	(gpgsm_set_fd): Change return type tp GpgmeError.
	(_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
	(gpgsm_set_recipients): Likewise.  Change type of return value
	equivalently.  Adjust error values.
	(_gpgme_gpgsm_op_import): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
	(struct gpgsm_object_s): New member error.
	(gpgsm_status_handler): Set error if error occurs.  Determine
	error number from ERR line received.  If assuan_read_line fails,
	terminate the connection.
2002-02-02 03:52:59 +00:00
Marcus Brinkmann
92bbc39616 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (MOSTLYCLEANFILES): New variable.
2002-02-01 20:28:59 +00:00
Marcus Brinkmann
3139e2b91a 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
	connection to the server.
2002-02-01 18:10:19 +00:00
Marcus Brinkmann
ebd6ac7b7d Really add this file. 2002-01-31 15:27:49 +00:00
Marcus Brinkmann
129da707d1 doc/
2002-01-31  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Generating Keys): Document error at creation
	failure.

gpgme/
2002-01-31  Marcus Brinkmann  <marcus@g10code.de>

	* rungpg.h: Add STATUS_KEY_CREATED.

	* progress.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add progress.c.

	* genkey.c (genkey_status_handler): Use
	_gpgme_progress_status_handler.  Add check for status.
	(struct genkey_result_s): New structure.
	(_gpgme_release_genkey_result): New function.
	(gpgme_op_genkey): Check for error.
	* gpgme.c (_gpgme_release_result): Call
	_gpgme_release_genkey_result.
	* ops.h (_gpgme_release_genkey_result): Add prototype.
	* types.h (GenKeyResult): New type.
	* context.h (gpgme_context_s): Add GenKeyResult to member result.
2002-01-31 00:31:44 +00:00
Marcus Brinkmann
9f622905cc 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c (_gpgme_release_result): Call
	_gpgme_release_delete_result.
	* ops.h (_gpgme_release_delete_result): Add prototype.
	* types.h (DeleteResult): New type.
	* context.h (gpgme_context_s): Add DeleteResult to member result.

	* delete.c (enum delete_problem): New type.
	(struct delete_result_s): New structure.
	(_gpgme_release_delete_result): New function.
	(delete_status_handler): Implement more status codes.
	(gpgme_op_delete): Return error on failure.

	* import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
2002-01-30 22:45:22 +00:00
Marcus Brinkmann
088c044792 doc/
2002-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Importing Keys): Add reference to gpgme_get_op_info.

gpgme/
2002-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* import.c (struct import_result_s): New structure.
	(_gpgme_release_import_result): New function.
	(append_xml_impinfo): Likewise.
	(import_status_handler): Implement.
	* gpgme.c (_gpgme_release_result): Add call to
	_gpgme_release_import_result.
	* ops.h (_gpgme_release_impoer_result): Add prototype.
	* types.h (ImportResult): New type.
	* context.h (gpgme_context_s): Add ImportResult to member result.

	* encrypt.c (gpgme_op_encrypt): Code clean up.

tests/
2002-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-import.c (print_op_info): New function.
	(main): Use it.
2002-01-30 21:52:32 +00:00
Marcus Brinkmann
785991aa9a doc/
2002-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi: Add all the gpgme_op_*_start functions.
	Fill the concept index with many, many entries.

gpgme/
2002-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: Add lots of comment and fix the formatting.  Add
	gpgme_trustlist_end prototype.
2002-01-30 01:17:30 +00:00
Marcus Brinkmann
89dd219f8d Add copyright year. 2002-01-29 22:59:15 +00:00
Marcus Brinkmann
1513ffd323 doc/
2002-01-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Run Control): New section.
	(Verify): Docuent gpgme_get_notation.
	(More Information): New section describing gpgme_get_op_info.

gpgme/
2002-01-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: Add new type GpgmeIdleFunc.  Change type of
	gpgme_register_idle to return and accept this type.
	* wait.c (gpgme_register_idle): Fix type.
	Save and return old value of idle_function.
2002-01-29 22:58:25 +00:00
Werner Koch
1c0317ca79 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
* keylist.c (keylist_colon_handler): Add support for the new "crs"
record type.
2002-01-29 10:04:41 +00:00
Marcus Brinkmann
498ba7818c 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
	not assuan_pipe_disconnect.

	* Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
	jnlib (needed by assuan) statically into libgpgme.  Linking a
	static library into a shared library this way is not portable.
2002-01-22 16:36:08 +00:00
Marcus Brinkmann
1e1fb4724c doc/
2002-01-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Passphrase callback): Change GpgmePassphraseCb's
	R_HD type from void* to void**.

gpgme/
2002-01-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
	void**.

tests/
2002-01-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-signers.c (passphrase_cb): Change type of r_hd to void**.
	* gpg/t-sign.c (passphrase_cb): Likewise.
	* gpg/t-decrypt-verify.c (passphrase_cb): Likewise.
	* gpg/t-decrypt.c (passphrase_cb): Likewise.
2002-01-22 15:32:44 +00:00
Marcus Brinkmann
8270a38b05 doc/
2002-01-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Creating data buffers): Change
	gpgme_data_new_from_filepart's LENGTH type from off_t to size_t.

gpgme/
2002-01-22  Marcus Brinkmann  <marcus@g10code.de>

	* data.c (gpgme_data_new_from_filepart): Change type of LENGTH
	from off_t to size_t.
	* gpgme.h: Likewise.
2002-01-22 15:21:42 +00:00
Marcus Brinkmann
6f7d1bc770 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
* wait.c (_gpgme_wait_on_condition): If the process finished,
	reset the pending flag.  Also if the operation was cancelled.

	(struct proc_s): Rename READY to DONE.
	(wait_item_s): Likewise.
	(set_process_ready): Rename to ...
	(set_process_done): ... this.
	(_gpgme_remove_proc_from_wait_queue): Call set_process_done
	instead set_process_ready.
	(_gpgme_wait_on_condition): Likewise.
	(do_select): Rename READY to DONE.

	* verify.c (gpgme_op_verify): Do not set pending to zero here.
	* sign.c (gpgme_op_sign): Likewise.
	* import.c (gpgme_op_import): Likewise.
	* genkey.c (gpgme_op_genkey): Likewise.
	* export.c (gpgme_op_export): Likewise.
	* encrypt.c (gpgme_op_encrypt): Likewise.
	* delete.c (gpgme_op_delete): Likewise.
	* decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
	* decrypt.c (gpgme_op_decrypt): Likewise.
2002-01-22 15:11:53 +00:00
Marcus Brinkmann
8ea8c8832d 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
* export.c: Cleanup.
2002-01-22 14:24:38 +00:00
Marcus Brinkmann
2bd5bd9bd0 Update all these funny copright notices. 2002-01-16 00:46:20 +00:00
Marcus Brinkmann
f3d11ead88 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
* trustlist.c: Various source clean ups.
	(my_isdigit): Removed.
	(gpgme_op_trustlist_end): New function.
2002-01-16 00:44:11 +00:00
Marcus Brinkmann
d83e746a07 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c: Various source clean ups, like renaming C to CTX where
	appropriate.
	(gpgme_new): Clear R_CTX before starting the work.
	(my_isdigit): Removed.
	(my_isxdigit): Likewise.

	* data.c: Various source clean ups.
	(gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
	(gpgme_data_new_with_read_cb): Similar for READ_CB.
	(gpgme_data_new_from_file): Loop over fread while EINTR.
	(gpgme_data_new_from_filepart): Rediddled a bit.  Allow LENGTH to
	be zero.  Loop over fread while EINTR.

	(my_isdigit): Removed.
	(my_isxdigit): Likewise.
2002-01-15 19:58:41 +00:00
Marcus Brinkmann
d088ff5626 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
	Pipe_Error where appropriate.
2001-12-21 01:41:12 +00:00
Marcus Brinkmann
a087259977 gpgme/
2001-12-19  Marcus Brinkmann  <marcus@g10code.de>

	* engine.c: Include `string.h'.  Reported by St�phane Corth�sy.

	* version.c (get_engine_info): Remove prototype.

tests/
2001-12-19  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt-verify.c: Don't include `mcheck.h'.  Reported by
	St�phane Corth�sy.
2001-12-19 17:46:02 +00:00
Marcus Brinkmann
530bad57ce Revert cruft from last check in. 2001-12-19 17:26:54 +00:00
Werner Koch
bb902af3a3 configure has fixed the version number, better checkin so that we are
sure that everyone uses the right version even if configure is not run.
2001-12-19 13:01:17 +00:00
Werner Koch
a3fcd4e06c updated .cvsignore files 2001-12-19 12:44:02 +00:00
Marcus Brinkmann
a299997103 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
	Fill it with the servers fds, and pass it to assuan_pipe_connect.
2001-12-19 00:24:17 +00:00
Marcus Brinkmann
98faded2e3 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
* autogen.sh (libtool_vers): Bump to 1.4.

	* configure.ac (LIBGPGME_LT_CURRENT): Increment.
	(LIBGPGME_LT_AGE): Likewise.
	Improve comment.
	Fix wrong comment character.
2001-12-18 23:32:08 +00:00
Marcus Brinkmann
7ce2fb718a 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_op_keylist_end): New function.
	* gpgme.h (gpgme_op_keylist_end): New prototype.

	* engine.h (gpgme_engine_check_version): Move prototype to ...
	* gpgme.h (gpgme_engine_check_version): ... here.

	* genkey.c (gpgme_op_genkey_start): Remove unused variable.
2001-12-18 22:54:49 +00:00
Marcus Brinkmann
a3d0634e97 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
* version.c (gpgme_get_engine_info): Reimplemented.
	(gpgme_check_engine): Reimplemented.
	(_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.

	* engine.c: Include `io.h'.
	(gpgme_engine_get_info): New function.
	* engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
	Add prototype.
2001-12-18 22:21:06 +00:00
Marcus Brinkmann
6d7f9eb4ff 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
	* engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
	Include `time.h', `sys/types.h', `assert.h', and `sema.h'.

	* rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
	(do_reaping, _gpgme_gpg_housecleaning): Moved to ...
	* engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
	* rungpg.c (_gpgme_gpg_release): Replace code that is now in its
	own function by call to _gpgme_engine_add_child_to_reap_list().

	* wait.c: Include `engine.h'.
	(run_idle): Call _gpgme_engine_housecleaning(), not
	_gpgme_gpg_housecleaning().
2001-12-18 21:02:35 +00:00
Marcus Brinkmann
247eecaab9 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
* key.c (_gpgme_key_append_name): Append, not prepend, the uid.
	Initialize the next field of the uid structure.
	(gpgme_key_get_as_xml): Do not list last uid first.
2001-12-18 19:54:00 +00:00
Marcus Brinkmann
d1384aabc5 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
	function [!ENABLE_GPGSM].
2001-12-17 17:08:32 +00:00
Marcus Brinkmann
21b09f74e6 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
	message_data, not SIG.
	(_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.

	* sign.c (sign_status_handler): Call
	_gpgme_passphrase_status_handler early.

2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
2001-12-14 22:32:31 +00:00
Marcus Brinkmann
6493b00042 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
	message_data, not SIG.
2001-12-14 22:02:43 +00:00
Marcus Brinkmann
63ac7b34b4 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c: Revert last change.
2001-12-14 20:20:12 +00:00
Marcus Brinkmann
a54c0a05b5 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* configure.ac (GPG): Substitute this variable.
	(GPGSM): Likewise.

tests/
CVS2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/Makefile.am (GPG): Set to @GPG_PATH@.
	(./pubring.gpg): Use $(GPG) instead gpg.
	(./secring.gpg): Likewise.

	* gpgsm/t-import.c (main): Remove third test case.
	* gpgsm/Makefile.am (GPGSM): Set to @GPGSM@.
	(all-local): New target.
	(./pubcerts.kbx): Likewise.
	* gpgsm/t-encrypt.c: New file.
	* gpgsm/Makefile.am (TESTS): Add t-encrypt.
2001-12-14 15:35:29 +00:00
Marcus Brinkmann
22bdb71f6a 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
	handler when ending this operation, otherwise the wait function
	will sit on it.
2001-12-14 14:43:38 +00:00
Marcus Brinkmann
0913218bcc gpgme/
2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
	(_gpgme_gpgsm_new): Initialize some more members.
	(_gpgme_gpgsm_release): Free the colon line handler's attic line.
	(gpgsm_status_handler): Rework the inline-data processing.

tests/
2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpgsm/t-keylist.c: New file.
	* gpgsm/Makefile.am (TESTS): Add t-keylist.
2001-12-14 00:49:38 +00:00
Marcus Brinkmann
f2232e8bc2 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
	list that are not dup'ed, for those the close-on-exec flag is set
	now.
	* version.c (_gpgme_get_program_version): Remove first entry in
	CFD, as the close-on-exec flag is now set for this fd.
2001-12-13 22:36:03 +00:00
Marcus Brinkmann
77a72c0d5e 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
	option to `ENCRYPT'.
	* engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
	successfully.
2001-12-13 22:12:06 +00:00
Marcus Brinkmann
4a55249ee6 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (close_notify_handler): New function.
	(_gpgme_gpgsm_new): Manage the file descriptors a
	bit differently.  Do not set close-on-exec flags.
	(_gpgme_gpgsm_op_decrypt): Do not set message_fd
	to -1, this is done by the close handler.
	(_gpgme_gpgsm_op_encrypt): Likewise.
	(_gpgme_gpgsm_op_import): Likewise (also for output_fd).
	(_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_verify): Likewise, but for output_fd.

	* posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
	non-inherited file descriptor index of the pipe.
2001-12-13 22:02:08 +00:00
Werner Koch
3634edf055 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
(gpgsm_status_handler): Pass datalines to a colon handler
* engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
handler for gpgsm.

* engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
pattern.
(gpgsm_assuan_simple_command): Removed underscore from
assuan_write_line.
(_gpgme_gpgsm_start): Ditto.
(gpgsm_assuan_simple_command): Replaced interal Assuan read
function by the new assuan_read_line.  Removed the use of the
internal header.
(gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
(_gpgme_gpgsm_start): Use the documented way to get an fd from
assuan.
2001-12-13 17:37:18 +00:00
Werner Koch
0b11af59c7 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
pattern.
(gpgsm_assuan_simple_command): Removed underscore from
assuan_write_line.
(_gpgme_gpgsm_start): Ditto.
* keylist.c (keylist_colon_handler): Handle "crt" records
* key.h (gpgme_key_s): Add an x509 flag.
* key.c (parse_x509_user_id): New.
(_gpgme_key_append_name): Handle x.509 names.

However, it does not yet work.
2001-12-13 15:05:35 +00:00
Marcus Brinkmann
8cd3d96f2d 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Make it work with current
	version of assuan.
2001-12-05 20:38:50 +00:00
Marcus Brinkmann
62d0374e72 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
	(_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
	output descriptor.
	(_gpgme_gpgsm_op_sign): Likewise.
2001-12-05 20:37:37 +00:00
Marcus Brinkmann
ba1e19e10b Add .cvsignore files. Suggested by Jan-Oliver Wagner <jan@intevation.de>. 2001-12-05 19:50:45 +00:00
Marcus Brinkmann
e9ece11e83 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
	occurs.
2001-12-05 13:23:59 +00:00
Marcus Brinkmann
a8c76a0f83 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
2001-11-26 11:41:17 +00:00
Marcus Brinkmann
a22eef99a2 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
	Deal with assuan read line returning more than one line (for now).
2001-11-24 19:31:26 +00:00
Marcus Brinkmann
8c3726d634 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
	the current protocol definition.
2001-11-23 11:52:09 +00:00
Marcus Brinkmann
662f9b185b 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
	ends of the pipe.
2001-11-23 00:48:51 +00:00
Marcus Brinkmann
d1ded512c4 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c: Include stdlib.h and string.h.  Also include,
	for now, rungpg.h and status-table.h.
	(gpgsm_status_handler): Implement more of the status handler.
2001-11-22 21:27:41 +00:00
Marcus Brinkmann
884de0606b 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
	(_gpgme_engine_op_delete): Likewise.
	(_gpgme_engine_op_encrypt): Likewise.
	(_gpgme_engine_op_export): Likewise.
	(_gpgme_engine_op_genkey): Likewise.
	(_gpgme_engine_op_keylist): Likewise.
	(_gpgme_engine_op_sign): Likewise.
	(_gpgme_engine_op_trustlist): Likewise.

	* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
	(gpgsm_assuan_simple_command): Likewise.
	(gpgsm_set_recipients): Likewise.
	(gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
	(_gpgme_gpgsm_op_delete): New function.
	(_gpgme_gpgsm_op_export): Likewise.
	(_gpgme_gpgsm_op_genkey): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_keylist): Likewise.
	(_gpgme_gpgsm_op_trustlist): Likewise.
	(_gpgme_gpgsm_release): Release command.
	(_gpgme_gpgsm_op_decrypt): Allocate command.
	(_gpgme_gpgsm_op_import): Likewise.
	(gpgsm_status_handler): Also treat `ERR' strings as EOF.
2001-11-22 20:48:37 +00:00
Marcus Brinkmann
8993173dfb 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (gpgme_set_protocol): New prototype.

2001-11-22  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (libgpgsmplug_la_LIBADD): New variable.
	(libgpgsmplug_la_LDFLAGS): Likewise.
	(libgpgsmplug_la_SOURCES): Likewise.
	(lib_LTLIBRARIES): Add libgpgsmplug.la.
	(INCLUDES): Include the local gpgme.h.

	* gpgmeplug.c (signMessage): Set protocol.
	(GPGMEPLUG_PROTOCOL) [!GPGMEPLUG_PROTOCOL]: Set
	GPGMEPLUG_PROTOCOL.
	* gpgsmplug.c: New file.
2001-11-22 18:48:53 +00:00
Marcus Brinkmann
6290f74605 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
	(_gpgme_gpgsm_op_import): Likewise.
2001-11-22 15:22:27 +00:00
Marcus Brinkmann
c23a9b5e74 2001-11-22 Marcus Brinkmann <marcus@gnu.org>
* engine-gpgsm.c: Shuffle around header inclusion a bit, to still
	keep them seperate.
	(_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
2001-11-22 13:47:46 +00:00
Werner Koch
9ece643cba * engine-gpgsm.c: Include more headers so that NULL and mk_error
is defined even with an undefined GPGSM_PATH.
2001-11-22 10:29:52 +00:00
Marcus Brinkmann
679d5c2b49 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
	gpg_outbound_handler): Moved to ...
	* data.c (_gpgme_data_inbound_handler, write_mem_data,
	write_cb_data, _gpgme_data_outbound_handler): ... here.  Make the
	_gpgme_* ones non-static.
	* data.c: Include io.h.

	* ops.h (_gpgme_data_inbound_handler): New prototype.
	(_gpgme_data_outbound_handler): Likewise.
	(_gpgme_gpg_spawn): Use these new functions.

	* engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
	_gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
	_gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
	_gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
	_gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
	_gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
	Include <rungpg.h> for status handler function.

	* engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
	input_data, output_fd, output_data, message_fd, message_data, command
	and status.
	(_gpgme_gpgsm_new): Open input, output and message pipes before
	connecting to the client.  Close server's ends afterwards.
	(_gpgme_gpgsm_release): Close open file descriptors.  Remove
	server process from wait queue.
	(_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
	_gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.

	* engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
	(_gpgme_engine_set_status_handler): Likewise.
	(_gpgme_engine_op_verify): Likewise.
2001-11-22 03:08:58 +00:00
Marcus Brinkmann
da95ecfc2c 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
* context.h: Do not include rungpg.h, but engine.h.
	(struct gpgme_context_s): Replace member gpg with engine.
	* gpgme.c (gpgme_release): Release engine, not gpg.

	* recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
	moved ...
	* rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
	Make static, change order of arguments, and return an error value.
	* ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.

	* rungpg.h (_gpgme_gpg_op_verify): Add prototype.
	(_gpgme_gpg_op_encrypt): Likewise.
	(_gpgme_gpg_op_decrypt): Likewise.
	(_gpgme_gpg_op_delete): Likewise.
	(_gpgme_gpg_op_export): Likewise.
	(_gpgme_gpg_op_genkey): Likewise.
	(_gpgme_gpg_op_import): Likewise.
	(_gpgme_gpg_op_keylist): Likewise.
	(_gpgme_gpg_op_sign): Likewise.
	(_gpgme_gpg_op_trustlist): Likewise.
	* rungpg.c (_gpgme_gpg_op_verify): New function.
	(_gpgme_gpg_op_encrypt): Likewise.
	(_gpgme_gpg_op_decrypt): Likewise.
	(_gpgme_gpg_op_delete): Likewise.
	(_gpgme_gpg_op_export): Likewise.
	(_gpgme_gpg_op_genkey): Likewise.
	(_gpgme_gpg_op_import): Likewise.
	(_gpgme_gpg_op_keylist): Likewise.
	(_gpgme_gpg_op_sign): Likewise.
	(_gpgme_gpg_op_trustlist): Likewise.

	* engine.h (_gpgme_engine_set_status_handler): Add prototype.
	(_gpgme_engine_set_command_handler): Likewise.
	(_gpgme_engine_set_colon_line_handler): Likewise.
	(_gpgme_engine_op_decrypt): Likewise.
	(_gpgme_engine_op_delete): Likewise.
	(_gpgme_engine_op_encrypt): Likewise.
	(_gpgme_engine_op_export): Likewise.
	(_gpgme_engine_op_genkey): Likewise.
	(_gpgme_engine_op_import): Likewise.
	(_gpgme_engine_op_keylist): Likewise.
	(_gpgme_engine_op_sign): Likewise.
	(_gpgme_engine_op_trustlist): Likewise.
	(_gpgme_engine_op_verify): Likewise.
	(_gpgme_engine_start): Likewise.
	* engine.c (_gpgme_engine_set_status_handler): New function.
	(_gpgme_engine_set_command_handler): Likewise.
	(_gpgme_engine_set_colon_line_handler): Likewise.
	(_gpgme_engine_op_decrypt): Likewise.
	(_gpgme_engine_op_delete): Likewise.
	(_gpgme_engine_op_encrypt): Likewise.
	(_gpgme_engine_op_export): Likewise.
	(_gpgme_engine_op_genkey): Likewise.
	(_gpgme_engine_op_import): Likewise.
	(_gpgme_engine_op_keylist): Likewise.
	(_gpgme_engine_op_sign): Likewise.
	(_gpgme_engine_op_trustlist): Likewise.
	(_gpgme_engine_op_verify): Likewise.
	(_gpgme_engine_start): Likewise.

	* verify.c (gpgme_op_verify_start): Reimplement in terms of above
	functions.
	* encrypt.c (gpgme_op_encrypt_start): Likewise.
	* decrypt.c (_gpgme_decrypt_start): Likewise.
	* passphrase.c (_gpgme_passphrase_start): Likewise.
	* keylist.c (gpgme_op_keylist_start): Likewise.
2001-11-21 03:40:17 +00:00
Marcus Brinkmann
38c00b4b32 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
* types.h: Add types EngineObject and GpgsmObject.

	* Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
	engine-gpgsm.c, engine.h and engine.c.
	* engine.h: New file.
	* engine.c: Likewise.
	* engine-gpgsm.h: Likewise.
	* engine-gpgsm.c: Likewise.

	* rungpg.c (_gpgme_gpg_get_version): New function.
	(_gpgme_gpg_check_version): Likewise.
	* rungpg.h: Add prototypes for _gpgme_gpg_get_version and
	_gpgme_gpg_check_version.

	* version.c (compare_versions): Rename to ...
	(_gpgme_compare_versions): ... this.  Make non-static.
	(gpgme_check_version): Use _gpgme_compare_versions rather than
	compare_versions.
	(gpgme_check_engine): Likewise.
	* ops.h (_gpgme_get_program_version): Add prototype.
2001-11-20 06:04:15 +00:00
Marcus Brinkmann
4d3ab72fe5 remove some CVS conflict cruft 2001-11-20 06:03:02 +00:00
Marcus Brinkmann
ad428df905 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
* types.h: Add types EngineObject and GpgsmObject.

	* Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
	engine-gpgsm.c, engine.h and engine.c.
	* engine.h: New file.
	* engine.c: Likewise.
	* engine-gpgsm.h: Likewise.
	* engine-gpgsm.c: Likewise.

	* rungpg.c (_gpgme_gpg_get_version): New function.
	(_gpgme_gpg_check_version): Likewise.
	* rungpg.h: Add prototypes for _gpgme_gpg_get_version and
	_gpgme_gpg_check_version.

	* version.c (compare_versions): Rename to ...
	(_gpgme_compare_versions): ... this.  Make non-static.
	(gpgme_check_version): Use _gpgme_compare_versions rather than
	compare_versions.
	(gpgme_check_engine): Likewise.
	* ops.h (_gpgme_get_program_version): Add prototype.
2001-11-20 06:01:24 +00:00
Marcus Brinkmann
a441158cc7 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (SUBDIRS): Support building the assuan library
	(currently if GPGSM_PATH is set)..
	* configure.ac: Support building the assuan library.
	* assuan: New directory, populated with the Assuan library
	(copied from the newpg repository).

gpgme/
2001-11-20  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
	(AM_CPPFLAGS): New directive [BUILD_ASSUAN].
	(libgpgme_la_LIBADD): Likewise.
2001-11-20 05:27:46 +00:00
Marcus Brinkmann
bf2b24ae11 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
* version.c: Remove global variables lineno and
	tmp_engine_version.
	(version_handler): Removed.
	(_gpgme_get_program_version): New function.
	(get_engine_info): Don't use context and version_handler,
	but _gpgme_get_program_version.
	* ops.h (_gpgme_get_program_version): Add prototype for
	_gpgme_get_program_version (we expect to use it elsewhere soon).
2001-11-20 04:02:38 +00:00
Marcus Brinkmann
1a9da605ad 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
* configure.in: Renamed to ...
	* configure.ac: ... this.  Update to autoconf 2.52.  Lots of small
	changes in the transition.  Support --with-gpg=PATH and
	--with-gpgsm=PATH options.  Check if test suites can be run.
	* acconfig.h: Add GPGSM_PATH.
	* Makefile.am: New variable `tests', set to `tests' if
	RUN_GPG_TESTS.
	(SUBDIRS): Replace string `tests' with variable `tests'.

gpgme/
2001-11-18  Marcus Brinkmann  <marcus@g10code.de>

	* configure.in: Renamed to ...
	* configure.ac: ... this.  Update to autoconf 2.52.  Lots of small
	changes in the transition.  Support --with-gpg=PATH and
	--with-gpgsm=PATH options.  Check if test suites can be run.
	* acconfig.h: Add GPGSM_PATH.
	* Makefile.am: New variable `tests', set to `tests' if
	RUN_GPG_TESTS.
	(SUBDIRS): Replace string `tests' with variable `tests'.
2001-11-18 03:31:31 +00:00
Marcus Brinkmann
d65c4b72d9 gpgme/
2001-11-16  Marcus Brinkmann  <marcus@g10code.de>

	* decrypt-verify.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
	* types.h: Add decrypt-verify types.
	* ops.h: Likewise.
	* context.h: Add result type for decrypt-verify.
	* gpgme.h: Add decrypt-verify prototypes.

	* decrypt.c (decrypt_status_handler): Renamed to ...
	(_gpgme_decrypt_status_handler): ... this.  Make non-static.
	(_gpgme_decrypt_start): New function, derived from
	gpgme_op_decrypt_start.
	(gpgme_op_decrypt_start): Reimplement in terms of
	_gpgme_decrypt_start.
	(_gpgme_decrypt_result): New function to retrieve error value.
	(gpgme_op_decrypt): Use _gpgme_decrypt_result.
	* ops.h: Add prototypes for new functions.

	* verify.c (verify_status_handler): Renamed to ...
	(_gpgme_verify_status_handler): ... this.  Make non-static.
	(gpgme_op_verify_start): Use new function name.
	(intersect_stati): Renamed to ...
	(_gpgme_intersect_stati): ... this.  Make non-static.
	(gpgme_op_verify): Use new name.
	* ops.h: Add prototypes for new functions.

tests/
2001-11-16  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (TESTS): Add t-decrypt-verify.
	* t-decrypt-verify.c: New file.
	* cipher-2.asc: Likewise.
2001-11-16 01:37:06 +00:00
Marcus Brinkmann
550bc31b44 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
	* ops.h (_gpgme_passphrase_result): Add prototypes from
	passphrase.c.
	* types.h: Likewise.
	* context.h: Add member passphrase to result.
	* gpgme.c (_gpgme_release_result): Release passphrase member.

	* decrypt.c: Some formatting and variable name changes (like
	CTX instead C).
	(struct decrypt_result_s): Remove members now found in
	passphrase result.
	(_gpgme_release_decrypt_result): Don't release removed members.
	(decrypt_status_handler): Call _gpgme_passphrase_status_handler,
	and don't handle the cases catched there.
	(command_handler): Removed.
	(gpgme_op_decrypt_start): Don't set command handler, but invoke
	_gpgme_passphrase_start which does it.
	(gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
	cases covered by it.

	* sign.c Some formatting and variable name changes (like
	CTX instead C).
	(struct sign_result_s): Remove members now found in
	passphrase result.
	(_gpgme_release_sign_result): Don't release removed members.
	(sign_status_handler): Call _gpgme_passphrase_status_handler,
	and don't handle the cases catched there.
	(command_handler): Removed.
	(gpgme_op_sign_start): Don't set command handler, but invoke
	_gpgme_passphrase_start which does it.
	(gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
	cases covered by it.
2001-11-16 00:20:11 +00:00
Marcus Brinkmann
4374f7c57f 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
* decrypt.c (command_handler): Fix last change.
2001-11-15 21:57:31 +00:00
Marcus Brinkmann
9144124a61 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
* verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
	Rename R2 to NEXT_RESULT.
	(intersect_stati): Rename RES to RESULT.
	(gpgme_get_sig_status): Likewise.  Do not check return_type, but
	the member verify of result.
	(gpgme_get_sig_key): Likewise.

	* sign.c (_gpgme_release_sign_result): Rename RES to RESULT.  If
	RESULT is zero, return.
	(sign_status_handler, command_handler): Do not check return_type,
	but the member sign of result.
	(gpgme_op_sign): Likewise.  Drop assertion.

	* encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
	If RESULT is zero, return.
	(encrypt_status_handler): Do not check return_type, but the member
	encrypt of result.
	(gpgme_op_encrypt): Likewise.  Drop assertion.

	* decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
	(create_result_struct): Do not set result_type.
	(command_handler, decrypt_status_handler): Do not check
	return_type, but the member decrypt of result.
	(gpgme_op_decrypt): Likewise.  Drop assertion.

	* context.h (enum ResultType): Removed.
	(struct gpgme_context_s): Remove member result_type.
	(struct result): Replaces union result.
	* gpgme.c: Include string.h.
	(_gpgme_release_result): Release all members of c->result, which
	is now a struct.  Zero out all members of the struct afterwards.
2001-11-15 21:32:09 +00:00
Marcus Brinkmann
49a25a82e2 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
	Release all members of the list GPG->arglist.
	Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
2001-11-11 18:54:57 +00:00
Marcus Brinkmann
1ecdde3ced gpgme/
2001-11-02  Marcus Brinkmann  <marcus@g10code.de>

	* rungpg.c (pipemode_copy): Change type of NBYTES to size_t.

	* key.c: Include string.h.
	* data.c: Likewise.
	* recipient.c: Likewise.

tests/
2001-11-02  Marcus Brinkmann  <marcus@g10code.de>

	* t-data.c: Include stddef.h.
	(read_once_test): Change type of READ to size_t.
	(read_test): Likewise.
	(write_test): Likewise.
2001-11-02 15:51:15 +00:00
Marcus Brinkmann
deaea7bdec Fix formatting. 2001-10-29 00:08:43 +00:00
Marcus Brinkmann
c3e7053489 gpgme/
2001-10-29  Marcus Brinkmann  <marcus@g10code.de>

	* context.h: New member signers_len.  * signers.c
	(gpgme_signers_clear): Require that signers are non-NULL with
	assertion.  Use signers_len to determine how much keys to release.
	Add documentation.
	(gpgme_signers_add): Use signers_len to determine if the buffer is
	large enough.  Use xtryrealloc rather than xtrymalloc and copying.
	Add documentation.
	(gpgme_signers_enum): Use signers_len to determine if key is
	available.  Add documentation.

tests/
2001-10-29  Marcus Brinkmann  <marcus@g10code.de>

	* t-signers.c: New file.
	* Makefile.am (TESTS): Add t-signers.
2001-10-29 00:08:14 +00:00
Marcus Brinkmann
2e9b689299 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
* data.c (_gpgme_data_append): Check if LENGTH is smaller than
	ALLOC_CHUNK, not DH->length.
2001-10-22 14:18:08 +00:00
Marcus Brinkmann
96a64f6b80 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c (gpgme_set_protocol): Fix last change.
2001-10-17 19:13:11 +00:00
Werner Koch
9e7db481a6 New API to switch to S/MIME. There is no code yet behind it. 2001-10-15 12:19:14 +00:00
Werner Koch
ab7fa2c460 oops - have to thank someone else 2001-09-17 10:40:36 +00:00
Werner Koch
b4eddd3042 Fixed a keylisting bug 2001-09-17 10:36:05 +00:00
Werner Koch
0bc8c1c7e1 Added more doc entries and prepared for 0.2.3 2001-09-17 08:25:36 +00:00
Werner Koch
92ca22fe6b added new status messages 2001-09-07 12:47:33 +00:00
Werner Koch
5b3d8162b4 Some changes 2001-09-03 18:41:53 +00:00
Werner Koch
5ad992b6aa Fixed long standing listing bug. 2001-08-29 10:46:49 +00:00
Werner Koch
6c7ce7551d Typo fixes and new gpgme_get_op_info 2001-08-28 11:11:10 +00:00
Werner Koch
ec8c9d9494 A couple of minor changes and a short README for Gpgcom 2001-07-31 15:21:58 +00:00
Werner Koch
c898d18ad8 Timos fixes 2001-06-16 11:08:32 +00:00
Werner Koch
c3850ce332 Ready to release 0.2.2 2001-06-12 07:37:15 +00:00
Werner Koch
4c76d6dce1 Changes by Jose and Tommy. 2001-05-28 17:35:10 +00:00
Werner Koch
1a3db20121 Adjusted for changes --fixed-list-mode in 1.0.4h 2001-04-19 12:18:40 +00:00
Werner Koch
bf6779bf74 Release 0.2.1 2001-04-02 08:40:32 +00:00
Werner Koch
5b561c2f11 Give access to key capabilities 2001-03-15 13:09:41 +00:00
Werner Koch
10b3a86f83 Fixed syntax error 2001-03-14 13:51:30 +00:00
Werner Koch
ca12983e7c Add a few key flags - needs the lates CVS gpg 2001-03-13 20:17:22 +00:00
Werner Koch
be28316c35 Use a writer thread under W32 (arggg) 2001-02-28 10:18:38 +00:00
Werner Koch
72af6e5349 Reworked the process code. 2001-02-20 13:31:56 +00:00
Werner Koch
7bd07d62f3 FD are now released and a major bug has been fixed.
The W32 version does not compile at the meoment.
2001-02-19 17:22:38 +00:00
Werner Koch
04e0ea083a W32 fixes 2001-02-14 19:42:49 +00:00
Werner Koch
962bb6af10 reap off gpg processes 2001-02-13 15:00:31 +00:00
Werner Koch
a3b341ff45 Add some debugging code 2001-02-13 12:46:19 +00:00
Werner Koch
06dae7fcf3 Multiple signatures can now be verified. 2001-02-12 15:23:29 +00:00
Werner Koch
6bbbad60f2 Possible fix for NT and segv fix. 2001-02-01 09:25:56 +00:00
Werner Koch
1648829c39 Fixed W32 bugs and one major bug which swallowed up some output. 2001-01-31 12:39:53 +00:00
Werner Koch
1316aed172 Made gpgme_cancel work - at least a little bit. 2001-01-30 18:03:21 +00:00
Werner Koch
6e9b15d7ed Fixed version string and W32 spawn function 2001-01-30 17:36:03 +00:00
Werner Koch
3a8df5d469 slash/backslash conversion 2001-01-30 17:11:38 +00:00
Werner Koch
9db5d05376 Lookup the path in the Registry 2001-01-30 16:00:50 +00:00
Werner Koch
75cd8aeaa8 Removed files which are build by scripts 2001-01-30 14:46:01 +00:00
Werner Koch
b88be99c6d Maybe the signers code does work now 2001-01-30 14:18:16 +00:00
Werner Koch
83dd53ffe1 Ugly kludge to avoid blocking in W32's _gpgme_io_write 2001-01-30 12:06:29 +00:00
Werner Koch
e318473836 Add better debug printing. Use reader threads for W32 2001-01-30 11:01:41 +00:00
Werner Koch
f2be414251 Some new but untested functions 2001-01-22 20:22:41 +00:00
Werner Koch
38b1b13114 Does now compile under MingW32/CPD 0.3 2001-01-18 09:11:49 +00:00
Werner Koch
96f67a5fdc Release 0.1.4 2001-01-11 11:56:34 +00:00
Werner Koch
d6cd1f97ca More changes and and some new functions 2001-01-08 20:40:25 +00:00
Werner Koch
c74adbc096 Add 2 missing files and other changes 2000-12-29 10:34:34 +00:00
Werner Koch
6b4ca13dd4 Add progress CB and subkey listing 2000-12-19 10:07:32 +00:00
Werner Koch
a92ecd4470 Add key generation 2000-12-18 20:54:43 +00:00
Werner Koch
715cf2aed3 Add key import and export facility 2000-12-14 14:45:35 +00:00
Werner Koch
edcc338a59 Add a passphrase callback and minor changes to the interface 2000-12-12 13:31:25 +00:00
Werner Koch
874f12ea70 Okay, it runs at least on Windows 95 2000-12-06 12:17:10 +00:00
Werner Koch
b7a7d9b9cc Now we are able to compile the W32 stuff - don't now whether it works; I have
no Windoze box here.
2000-11-23 15:28:15 +00:00
Werner Koch
6bf05e9c06 Added some comments and prepared for W32 support 2000-11-22 17:10:48 +00:00
Werner Koch
f9a167c516 Does some basic tasks. 2000-11-20 20:17:36 +00:00
Werner Koch
fabce92fe3 configuration changes 2000-11-17 21:20:53 +00:00
Werner Koch
08eaf1cea1 Released 0.0.0 2000-11-16 17:26:53 +00:00
Werner Koch
3868237d95 Added sign functionality 2000-11-16 14:53:52 +00:00
Werner Koch
7f8c3532e7 Added decryption 2000-11-16 13:15:48 +00:00
Werner Koch
529b82f638 Notation stuff added 2000-11-15 21:36:48 +00:00
Werner Koch
e047a8a263 Reanmed public functions 2000-11-13 13:25:22 +00:00
Werner Koch
f14941f072 keylist does now return objects. 2000-11-10 20:56:02 +00:00
Werner Koch
cbb513962a Started with --list-key 2000-11-10 17:50:24 +00:00
Werner Koch
36966ea498 Add verify function 2000-11-09 16:35:35 +00:00
Werner Koch
b9bf49968b Just a backup for now 2000-11-07 13:32:38 +00:00
Werner Koch
957169e5d4 *** empty log message *** 2000-10-27 17:46:09 +00:00
Werner Koch
30ee22c7d2 First prototypes 2000-10-27 17:26:12 +00:00
Werner Koch
77fa0ec399 Starting project 'GnuPG Made Easy' 2000-10-27 14:55:24 +00:00