2003-04-29 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Trust Item Management): Add data members of
GpgmeTrustItem type.
(Information About Trust Items): Add note about obsoleteness.
(Manipulating Trust Items): Add gpgme_trust_item_ref and
gpgme_trust_item_unref.
gpgme/
2003-04-29 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_trust_item): New structure.
(GpgmeTrustItem): New type.
(gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
* context.h (struct trust_queue_item_s): Remove structure.
(struct gpgme_context_s): Remove trust_queue member.
* Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
* trust-item.c: New file.
* trustlist.c: Do not include <stdio.h> or <time.h>, but
"gpgme.h".
(struct trust_queue_item_s): Change to new type op_data_t.
(trust_status_handler): Change first argument to void *.
(trust_colon_handler): Likewise.
(_gpgme_op_trustlist_event_cb): Use op_data_t type.
(gpgme_op_trustlist_start): Use op_data_t and rework error
handling.
(gpgme_op_trustlist_next): Use op_data_t.
(gpgme_trust_item_release): Remove function.
(gpgme_trust_item_get_string_attr): Likewise.
(gpgme_trust_item_get_int_attr): Likewise.
tests/
2003-04-29 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-trustlist.c: Rewritten.
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Verify): Rewritten to take into account new and
deprecated functions and data types.
gpgme/
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_sig_notation): New structure.
(GpgmeSigNotation): New type.
(struct _gpgme_signature): New structure.
(GpgmeSignature): New type.
(struct _gpgme_op_verify_result): New structure.
(GpgmeVerifyResult): New type.
(gpgme_op_verify_result): New prototype.
(gpgme_get_notation): Remove prototype.
* ops.h (_gpgme_op_verify_init_result): New prototype.
(_gpgme_verify_status_handler): Change first argument to void *.
* util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
New prototypes.
* conversion.c (_gpgme_decode_percent_string): New function.
(gnupg_errors): New static global.
(_gpgme_map_gnupg_error): New function.
* gpgme.c (gpgme_release): Don't release CTX->notation.
(gpgme_get_notation): Remove function.
* decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
_gpgme_op_verify_init_result.
* verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
do include "gpgme.h".
(struct verify_result): Replace with ...
(op_data_t): ... this type.
(release_verify_result): Remove function.
(release_op_data): New function.
(is_token): Remove function.
(skip_token): Remove function.
(copy_token): Remove function.
(gpgme_op_verify_result): New function.
(calc_sig_summary): Rewritten.
(finish_sig): Remove function.
(parse_new_sig): New function.
(parse_valid_sig): New function.
(parse_notation): New function.
(parse_trust): New function.
(parse_error): New function.
(_gpgme_verify_status_handler): Rewritten. Change first argument
to void *.
(_gpgme_op_verify_start): Rework error handling. Call
_gpgme_op_verify_init_result.
(gpgme_op_verify): Do not release or clear CTX->notation.
(gpgme_get_sig_status): Rewritten.
(gpgme_get_sig_string_attr): Likewise.
(gpgme_get_sig_ulong_attr): Likewise.
(gpgme_get_sig_key): Likewise.
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Decrypt): Descript gpgme_op_decrypt_result and
GpgmeDecryptResult.
gpgme
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_op_decrypt_result): New structure.
(GpgmeDecryptResult): New type.
(gpgme_op_decrypt_result): New prototype.
* ops.h (_gpgme_op_decrypt_init_result): New prototype.
(_gpgme_decrypt_status_handler): Fix prototype.
(_gpgme_decrypt_start): Remove prototype.
* decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
<string.h> and <assert.h>, "util.h" and "context.h", but
"gpgme.h".
(decrypt_verify_status_handler): Change first argument to void *,
and rework error handling.
(_gpgme_op_decrypt_verify_start): New function.
(gpgme_op_decrypt_verify_start): Rewrite using
_gpgme_op_decrypt_verify_start.
(gpgme_op_decrypt_verify): Likewise.
* decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
(struct decrypt_result): Change to typedef op_data_t, rewritten.
(is_token): Remove function.
(release_op_data): New function.
(skip_token): Remove function.
(gpgme_op_decrypt_result): New function.
(_gpgme_decrypt_status_handler): Change first argument to void *.
Rework error handling.
(_gpgme_decrypt_start): Rename to ...
(decrypt_start): ... this. Call _gpgme_op_decrypt_init_result.
(_gpgme_op_decrypt_init_result): New function.
(gpgme_op_decrypt_start): Use decrypt_start.
(gpgme_op_decrypt): Likewise.
tests/
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-decrypt.c: Rewritten.
* encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
<stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
(_gpgme_op_encrypt_sign_start): Rename to ...
(encrypt_sign_start): ... this.
(gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
_gpgme_op_encrypt_sign_start.
(gpgme_op_encrypt_sign): Likewise.
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Encrypting a Plaintext): Add info about
GpgmeEncryptResult and gpgme_op_encrypt_result.
gpgme/
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (GpgmeEncryptResult): New data type.
(gpgme_op_encrypt_result): New prototype.
* ops.h (_gpgme_op_encrypt_init_result): New prototype.
(_gpgme_op_encrypt_status_handler): Fix prototype.
* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
_gpgme_op_encrypt_init_result.
* encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
"wait.h". Include <errno.h> and "gpgme.h".
(SKIP_TOKEN_OR_RETURN): Remove macro.
(struct encrypt_result): Rename to ...
(op_data_t): ... new data type. Rewrite for user result data.
(append_xml_encinfo): Remove function.
(release_op_data): New function.
(gpgme_op_encrypt_result): New function.
(_gpgme_op_encrypt_status_handler): Change first argument to void *.
Rewrite result parsing.
(_gpgme_op_encrypt_sym_status_handler): Change first argument to
void *.
(_gpgme_op_encrypt_init_result): New function.
(_gpgme_op_encrypt_start): Rename to ...
(encrypt_start): ... this.
(gpgme_op_encrypt_start): Use encrypt_start, not
gpgme_op_encrypt_start.
(gpgme_op_encrypt): Likewise.
tests/
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-sign.c: Rewritten.
* gpgsm/t-sign.c: Rewritten.
* gpg/t-encrypt.c: Check for invalid recipients.
* gpgsm/t-encrypt.c: Likewise.
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Creating a Signature): Add info about
GpgmeNewSignature, GpgmeSignResult and gpgme_op_sign_result.
(Crypto Operations): Add GpgmeInvalidUserID.
(Algorithms): New chapter.
gpgme/
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
GpgmeNewSignature, GpgmeSignResult): New data types.
(gpgme_op_sign_result, gpgme_pubkey_algo_name,
gpgme_hash_algo_name): New prototypes.
* gpgme.c (gpgme_pubkey_algo_name): New function.
(gpgme_hash_algo_name): Likewise.
* ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
prototype.
(_gpgme_op_sign_status_handler): Fix prototype.
* op-support.c: Include <errno.h> and <string.h>.
(_gpgme_parse_inv_userid): New function.
* sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
<assert.h> and "util.h".
(SKIP_TOKEN_OR_RETURN): Remove macro.
(struct sign_result): Change to op_data_t type and rework it.
(release_sign_result): Rename to ...
(release_op_data): ... this and rewrite it.
(append_xml_info): Remove function.
(gpgme_op_sign_result): New function.
(parse_sig_created): New function.
(_gpgme_sign_status_handler): Change first argument to void *.
Rewrite the function to use the new result structure and functions.
(_gpgme_op_sign_init_result): New function.
(_gpgme_op_sign_start): Rename to ...
(sign_start): ... this. Call _gpgme_op_sign_init_result.
(gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
(gpgme_op_sign): Likewise.
2003-04-25 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Importing Keys): Add documentation for
GpgmeImportStatus, GpgmeImportResult and gpgme_op_import_result.
gpgme/
2003-04-25 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
(GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
GPGME_Bad_Signature, GPGME_No_Public_Key): New error codes.
(struct _gpgme_import_status): New structure.
(GpgmeImportStatus): New type.
(struct _gpgme_op_import_result): New structure.
(GpgmeImportResult): New type.
(gpgme_op_import_result): New function.
* import.c: Include <errno.h> and "gpgme.h", but not "util.h".
(struct import_result): Change to type op_data_t.
(release_import_result): Rename to ...
(release_op_data): ... this.
(append_xml_impinfo): Function removed.
(gpgme_op_import_result): New function.
(parse_import): New function.
(parse_import_res): Likewise.
(import_status_handler): Change first argument to void *. Rewrite
to use new functions.
(_gpgme_op_import_start): Rework error handling.
* edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
(edit_resut): Change to typedef for op_data_t.
(edit_status_handler): Change first argument to void *.
Rework error handling.
(command_handler): Rework error handling.
(_gpgme_op_edit_start): Rename to ...
(edit_start): ... this. Rework error handling.
(gpgme_op_edit_start): Rewrite using edit_start.
(gpgme_op_edit): Likewise.
* ops.h (_gpgme_passphrase_start): Remove prototype.
* passphrase.c: Do not include <assert.h>, "util.h" or
"debug.h", but "gpgme.h".
(struct passphrase_result): Change to typedef for op_data_t.
(release_passphrase_result): Rename to release_op_data.
(_gpgme_passphrase_status_handler): Change first argument to void *.
Use new op_data_t type.
(_gpgme_passphrase_command_handler): Use new op_data_t type.
(_gpgme_passphrase_start): Remove function.
* decrypt.c (_gpgme_decrypt_start): Rewrite error handling. Do
not call _gpgme_passphrase_start, but install command handler.
* encrypt.c (_gpgme_op_encrypt_start): Likewise.
* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
* sign.c (_gpgme_op_sign_start): Likewise.
* context.h (struct gpgme_context_s): Remove member initialized,
use_cms and help_data_1. Add member protocol. Make use_armor and
use_textmode bit flags. Make keylist_mode, include_certs,
signers_len and signers_size unsigned.
* gpgme.c (gpgme_new): Initialize CTX->protocol.
(gpgme_set_protocol): Do not check CTX. Use CTX->protocol.
(gpgme_get_protocol): Likewise.
(gpgme_release): Do not release CTX->help_data_1.
* op-support.c (_gpgme_op_reset): Use CTX->protocol.
* data.c: Do not include <assert.h>, but "gpgme.h".
(_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
it will go. Do not assert DH.
(_gpgme_data_outbound_handler): Do not assert DH.
* export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
"gpgme.h".
(export_status_handler): Change type of first argument to void *.
(_gpgme_op_export_start): Rename to ...
(export_start): ... this. Rework error handling.
(gpgme_op_export_start): Rewritten to use export_start instead
_gpgme_op_export_start.
(gpgme_op_export): Likewise.
2003-04-24 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Generating Keys): Document changed gpgme_op_genkey
and new gpgme_op_genkey_result function. Document
GpgmeGenKeyResult data type.
gpgme/
2003-04-24 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_op_genkey_result): New structure.
(GpgmeGenKeyResult): New type.
(gpgme_op_genkey): Drop last argument.
(gpgme_op_genkey_result): New function.
* genkey.c: Do not include "util.h", but "gpgme.h".
(struct genkey_result): Replace with ...
(op_data_t): ... this new type.
(release_genkey_result): Replace with ...
(release_op_data): ... this new function.
(gpgme_op_genkey_result): New function.
(genkey_status_handler): Rewritten using new op_data_t type.
(get_key_parameter): New function.
(_gpgme_op_genkey_start): Renamed to
(genkey_start): ... this and rewritten.
(gpgme_op_genkey_start): Use genkey_start instead
_gpgme_op_genkey_start.
(gpgme_op_genkey): Rewritten. Remove FPR argument.
tests/
2003-04-24 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-genkey.c: Rewritten to match new semantics.
2003-02-06 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Cancelling an Operation): Removed.
(Passphrase Callback): Document new type for GpgmePassphraseCb.
gpgme/
2003-02-06 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
and add argument for returning the result string.
(gpgme_cancel): Remove prototype.
* gpgme.c (gpgme_cancel): Remove function.
* context.h (struct gpgme_context_s): Remove member cancel.
* passphrase.c (_gpgme_passphrase_command_handler): Call the
passphrase callback in the new way.
tests/
2003-02-06 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-decrypt.c (passphrase_cb): Fix to new prototype.
* gpg/t-decrypt-verify.c (passphrase_cb): Likewise.
* gpg/t-edit.c (passphrase_cb): Likewise.
* gpg/t-encrypt-sign.c (passphrase_cb): Likewise.
* gpg/t-encrypt-sym.c (passphrase_cb): Likewise.
* gpg/t-sign.c (passphrase_cb): Likewise.
* gpg/t-signers.c (passphrase_cb): Likewise.
* trustlist.c (trustlist_colon_handler): Release ITEM if name
could not be allocated.
(gpgme_trust_item_release): Only release name if it is allocated.
Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
* engine-gpgsm.c (start): Handle all errors, not only most of
them.
(xtoi_1, xtoi_2): Remove macro.
(status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
* types.h: File removed.
* Makefile.am (libgpgme_la_SOURCES): Remove types.h.
* io.h (struct spawn_fd_item_s): Do not include "types.h".
* key.h: Likewise.
* context.h: Likewise.
* cengine-gpgsm.h: Likewise.
* engine.h: Include "gpgme.h" instead "types.h". Add prototypes
for EngineStatusHandler, EngineColonLineHandler and
EngineCommandHandler.
(_gpgme_engine_set_status_handler): Change parameter type from
GpgmeStatusHandler to EngineStatusHandler.
(_gpgme_engine_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.
(_gpgme_engine_set_colon_line_handler): Change parameter type from
GpgmeColonLineHandler to EngineColonLineHandler.
* engine-backend.h: Include "engine.h" instead "types.h".
(struct engine_ops): Change Gpgme*Handler parameters in members
set_command_handler, set_colon_line_handler and set_status_handler
to Engine*Handler.
* engine.c (_gpgme_engine_set_status_handler): Change parameter
type from GpgmeStatusHandler to EngineStatusHandler.
(_gpgme_engine_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.
(_gpgme_engine_set_colon_line_handler): Change parameter type from
GpgmeColonLineHandler to EngineColonLineHandler.
* rungpg.c (struct gpg_object_s): Change type of member status.fnc
from GpgmeStatusHandler to EngineStatusHandler. Change type of
member colon.fnc from GpgmeColonLineHandler to
EngineColonLineHandler. Change type of member cmd.fnc from
GpgmeCommandHandler to EngineCommandHandler.
* engine-gpgsm.c (struct gpgsm_object_s): Likewise.
* rungpg.c (gpg_set_status_handler): Change parameter type from
GpgmeStatusHandler to EngineStatusHandler.
* engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
(assuan_simple_command): Likewise.
* rungpg.c (gpg_set_colon_line_handler): Change parameter type
from GpgmeColonLineHandler to EngineColonLineHandler.
* engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
* rungpg.c (gpg_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.
* engine-gpgsm.c (status_handler): Do not close status fd at end
of function.
* ops.h (_gpgme_op_data_lookup): Add prototype.
* op-support.c: Include <stdlib.h>.
(_gpgme_op_data_lookup): New function.
* decrypt.c (_gpgme_release_decrypt_result): Function removed.
(struct decrypt_result_s): Rename to ...
(struct decrypt_resul): ... this.
(DecryptResult): New type.
(_gpgme_decrypt_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
* sign.c (_gpgme_release_sign_result): Function removed.
(release_sign_result): New function.
(struct sign_result_s): Rename to ...
(struct sign_result): ... this.
(SignResult): New type.
(_gpgme_sign_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
* encrypt.c (struct encrypt_result_s): Rename to ...
(struct encrypt_result): ... this.
(_gpgme_release_encrypt_result): Function removed.
(release_encrypt_result): New function.
(_gpgme_encrypt_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
* verify.c (struct verify_result_s): Rename to ...
(struct verify_result): ... this. Remove member next.
(VerifyResult): New type.
(_gpgme_release_verify_result): Function removed.
(release_verify_result): New function.
(finish_sig): Change first argument to type VerifyResult. Diddle
the type of the op_data structure.
(add_notation): Change first argument to type VerifyResult.
(_gpgme_verify_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
* passphrase.c (struct passphrase_result_s): Rename to ...
(struct passphrase_result): ... this. Remove member next.
(PassphraseResult): New type.
(_gpgme_release_passphrase_result): Function removed.
(release_passphrase_result): New function.
(_gpgme_passphrase_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
(_gpgme_passphrase_command_handler): Likewise.
* keylist.c (struct keylist_result_s): Rename to ...
(struct keylist_result): ... this. Remove member next.
(KeylistResult): New type.
(_gpgme_release_keylist_result): Function removed.
(release_keylist_result): New function.
(keylist_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
* edit.c (struct edit_result_s): Rename to ...
(struct edit_result): ... this. Remove member next.
(EditResult): New type.
(_gpgme_release_edit_result): Function removed.
(release_edit_result): New function.
(edit_status_handler): Don't use
test_and_allocate_result, but use _gpgme_op_data_lookup to
retrieve result data object.
(command_handler): Likewise.
* types.h (DecryptResult, SignResult, EncryptResult,
PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
KeylistResult, EditResult): Types removed.
* ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
(test_and_allocate_result): Remove macro.
(_gpgme_release_decrypt_result): Remove prototype.
(_gpgme_decrypt_result): Remove prototype.
(_gpgme_release_sign_result): Remove prototype.
(_gpgme_release_encrypt_result): Remove prototype.
(_gpgme_release_passphrase_result): Remove prototype.
(_gpgme_release_import_result): Remove prototype.
(_gpgme_release_delete_result): Remove prototype.
(_gpgme_release_genkey_result): Remove prototype.
(_gpgme_release_keylist_result): Remove prototype.
(_gpgme_release_edit_result): Remove prototype.
(_gpgme_release_verify_result): Remove prototype.
* gpgme.c (_gpgme_release_result): Rewritten.
* context.h (enum ctx_op_data_type): New enum.
(struct ctx_op_data): New structure.
(struct gpgme_context_s): Replace the member result with a member
op_data.
(fail_on_pending_request): Remove macro.
* op-support.c (_gpgme_op_reset): Expand macro
fail_on_pending_request.
* util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".