2003-05-29 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Exporting Keys): Change and document prototypes.
Add new gpgme_op_export_ext and gpgme_op_export_ext_start
variants.
(Selecting Recipients): Section removed.
(Encrypting a Plaintext): Change prototypes and document the
changes.
gpgme/
2003-05-29 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (gpgme_op_export_start): Change second arg to const char *.
(gpgme_op_export): Likewise.
(gpgme_op_export_ext_start): New prototype.
(gpgme_op_export_ext): Likewise.
* engine.h: Likewise for _gpgme_engine_op_export and
_gpgme_engine_op_export_ext.
* engine-backend.h (struct engine_ops): Change second argument of
prototype of export to const char *, and add reserverd int as
third argument. Add prototype for export_ext.
* engine.c (_gpgme_engine_op_export_ext): New function.
(_gpgme_engine_op_export): Change second argument of prototype of
export to const char *, and add reserverd int as third argument.
* rungpg.c (gpg_export): Change second argument of prototype of
export to const char *, and add reserverd int as third argument.
(gpg_export_ext): New function.
(gpg_keylist_ext): Break loop at error.
(_gpgme_engine_ops_gpg): Add gpg_export_ext.
* engine-gpgsm.c (gpgsm_export): Change second argument of
prototype of export to const char *, and add reserverd int as
third argument.
(gpgsm_export_ext): New function.
(_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
* export.c (export_start): Change second argument of prototype of
export to const char *, and add reserverd int as third argument.
(gpgme_op_export_start): Likewise.
(export_ext_start): New function.
(gpgme_op_export_ext_start): Likewise.
(gpgme_op_export_ext): Likewise.
* gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
(gpgme_sigsum_t): New type for anonymous enum.
* encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
and return an error if RECP is not set.
* Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
* user-id.c: Remove file.
* ops.h: Remove prototype for _gpgme_user_ids_all_valid.
* gpgme.h (gpgme_encrypt_flags_t): New type.
(gpgme_op_encrypt_start): Change second parameter to type
gpgme_key_t[], and add third parameter.
(gpgme_op_encrypt): Likewise.
(gpgme_op_encrypt_sign_start): Likewise.
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (encrypt_start): Likewise.
(gpgme_op_encrypt_start): Likewise.
(gpgme_op_encrypt): Likewise. Pass flags to engine.
* encrypt-sign.c (encrypt_sign_start): Likewise.
(gpgme_op_encrypt_sign_start): Likewise.
(gpgme_op_encrypt_sign): Likewise.
* engine-backend.h (struct engine_ops): Likewise for prototypes of
encrypt and encrypt_sign.
* engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
and _gpgme_engine_op_encrypt_sign.
* engine.c (_gpgme_engine_op_encrypt): Likewise.
(_gpgme_engine_op_encrypt_sign): Likewise.
* rungpg.c (gpg_encrypt): Likewise.
(gpg_encrypt_sign): Likewise.
* rungpg.c (gpg_encrypt): Check flags for always trust option.
* engine-gpgsm.c (gpgsm_encrypt): Likewise.
(set_recipients): Rewritten to use keys instead user IDs.
* rungpg.c (append_args_from_recipients): Rewritten to use keys
instead user IDs.
* encrypt.c (_gpgme_encrypt_status_handler): Change errors
returned to GPGME_Invalid_Key and GPGME_General_Error.
tests/
2003-05-29 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-encrypt-sym.c (main): Adapt to new syntax.
* gpg/t-encrypt.c (main): Likewise.
* gpg/t-eventloop.c (main): Likewise.
* gpg/t-encrypt-sign.c (main): Likewise.
* gpgsm/t-export.c (main): Likewise.
* gpgsm/t-encrypt.c (main): Likewise.
* context.h (struct gpgme_context): Change EngineObject to
engine_object_t.
(enum ctx_op_data_type): Rename to ctx_op_data_id_t.
(ctx_op_data_t): New type.
(struct gpgme_context): Use it.
* ops.h (_gpgme_op_data_lookup): Use new type name.
* op-support.c (_gpgme_op_data_lookup): Likewise.
* engine.c: Rename EngineObject to engine_t in the file. Also
EngineStatusHandler to engine_status_handler_t,
EngineCommandHandler to engine_command_handler_t and
EngineColonLineHandler to engine_colon_line_handler.
* rungpg.c (start): Likewise.
* engine-gpgsm.c: Likewise.
* engine-backend.h (struct engine_ops): Likewise
* engine.h (struct engine_object_s): Rename to struct engine.
(EngineObject): Rename to engine_t. Also everywhere else in the
file.
(EngineStatusHandler): Rename to engine_status_handler_t.
(EngineColonLineHandler): Rename to engine_colon_line_handler_t.
(EngineCommandHandler): Rename to engine_command_handler_t.
* engine-gpgsm.c (gpgsm_export): Fix bug in last change.
* gpg/Makefile.am (TESTS): Order t-keylist and t-keylist-sig after
t-import.
* gpg/t-edit.c (edit_fnc): Work around gpg 1.2.2 bug by resetting
primary uid after setting expiration date.
* gpg/t-keylist.c: Change order of user IDs.
* gpg/t-keylist-sig.c: Likewise.
* gpg/t-import.c: Add support for gpg in CVS.
2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Passphrase Callback): Document new prototype.
gpgme/
2003-05-26 Marcus Brinkmann <marcus@g10code.de>
* engine.h (EngineCommandHandler): Change last argument to int fd.
* gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
description and fd.
(gpgme_edit_cb_t): Change last argument to int fd.
* ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
* passphrase.c: Include <assert.h>.
(op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
(release_op_data): Check values before calling free.
(_gpgme_passphrase_status_handler): Likewise.
(_gpgme_passphrase_command_handler_internal): New function.
(_gpgme_passphrase_command_handler): Rewritten.
* edit.c (edit_status_handler): Pass -1 as fd argument.
(command_handler): Update prototype. New variable processed. Use
it to store return value of
_gpgme_passphrase_command_handler_internal which is now used
instead _gpgme_passphrase_command_handler. Use it also to check
if we should call the user's edit function. Pass fd to user's
edit function.
* rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
void *.
(gpg_release): Check value before calling free. Do not release
cmd.cb_data.
(command_cb): Function removed.
(command_handler): New function. Thus we don't use a data object
for command handler stuff anymore, but handle it directly. This
allows proper error reporting (cancel of passphrase requests, for
example). Also all callbacks work via direct writes to the file
descriptor (so that passphrases are not kept in insecure memory).
(gpg_set_command_handler): Rewritten to use even more ugly hacks.
(read_status): Check cmd.keyword before calling free. Install
command_handler as the I/O callback handler with GPG as private
data.
tests/
2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* (t-decrypt-verify.c, t-decrypt.c, t-edit.c, t-encrypt-sign.c,
t-encrypt-sym.c, t-sign.c, t-signers.c): Include <unistd.h>.
(passphrase_cb): Rewritten.
* t-edit.c (edit_fnc): Rewritten.
* configure.ac (NEED_GPG_VERSION): Bump up to 1.2.2.
gpgme/
2003-05-26 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (gpg_new): Add --enable-progress-filter to gpg
invocation.
* decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
decrypt_verify_start.
(gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
(gpgme_op_decrypt_verify): Likewise.
* verify.c (verify_status_handler): New function that also calls
progress status handler.
(_gpgme_op_verify_start): Set status handler to verify_status_handler.
Rename to (verify_start).
(gpgme_op_verify_start): Call verify_start.
(gpgme_op_verify): Likewise.
* encrypt.c (encrypt_status_handler): New function.
(_gpgme_encrypt_sym_status_handler): Call progress status handler.
Make static. Rename to encrypt_sym_status_handler.
(encrypt_start): Set status handler to encrypt_sym_status_handler
or encrypt_status_handler.
* sign.c (sign_status_handler): New function.
(sign_start): Set status handler to sign_status_handler.
* decrypt.c (decrypt_status_handler): New function that also calls
progress status handler.
(decrypt_start): Set status handler to decrypt_status_handler.
* encrypt-sign.c (encrypt_sign_status_handler): Likewise.
* decrypt-verify.c (decrypt_verify_status_handler): Call
_gpgme_progress_status_handler.
In all files, replace the Gpgme* type names with the new gpgme_*
type names.
doc/
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Header): Remove Gpgme as namespace prefix. Add
_GPGME to namespace prefix.
* gpgme.texi (Multi Threading): Add note about link order.
gpgme/
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h: The following types are renamed. The old name is kept
as a deprecated typedef.
(GpgmeCtx): Rename to gpgme_ctx_t.
(GpgmeData): Rename to gpgme_data_t.
(GpgmeRecipients): Rename to gpgme_recipients_t.
(GpgmeError): Rename to gpgme_error_t.
(GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
(GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
(GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
(GpgmeSigStat): Rename to gpgme_sig_stat_t.
(GpgmeSigMode): Rename to gpgme_sig_mode_t.
(GpgmeAttr): Rename to gpgme_attr_t.
(GpgmeValidity): Rename to gpgme_validity_t.
(GpgmeProtocol): Rename to gpgme_protocol_t.
(GpgmeStatusCode): Rename to gpgme_status_code_t.
(GpgmeEngineInfo): Rename to gpgme_engine_info_t.
(GpgmeSubkey): Rename to gpgme_subkey_t.
(GpgmeKeySig): Rename to gpgme_keysig_t.
(GpgmeUserID): Rename to gpgme_user_id_t.
(GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
(GpgmeProgressCb): Rename to gpgme_progress_cb_t.
(GpgmeEditCb): Rename to gpgme_edit_cb_t.
(GpgmeIOCb): Rename to gpgme_io_cb_t.
(GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
(GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
(GpgmeEventIO): Rename to gpgme_event_io_t.
(GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
(GpgmeIOCbs): Rename to gpgme_io_cbs.
(gpgme_io_cbs_t): New type.
(GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
(GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
(GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
(GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
(GpgmeDataCbs): Rename to gpgme_data_cbs.
(gpgme_data_cbs_t): New type.
(GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
(GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
(GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
(GpgmeNewSignature): Rename to gpgme_new_signature_t.
(GpgmeSignResult): Rename to gpgme_sign_result_t.
(GpgmeSigNotation): Rename to gpgme_sig_notation_t.
(GpgmeSignature): Rename to gpgme_signature_t.
(GpgmeVerifyResult): Rename to gpgme_verify_result_t.
(GpgmeImportStatus): Rename to gpgme_import_status_t.
(GpgmeImportResult): Rename to gpgme_import_result_t.
(GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
(GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
(GpgmeTrustItem): Rename to gpgme_trust_item_t.
* gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
GPGME_No_Recipients, GPGME_Invalid_Recipient and
GPGME_No_Passphrase.
* data.h (struct gpgme_data_s): Rename to struct gpgme_data.
* context.h (struct gpgme_context_s): Rename to struct
gpgme_context.
(struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-04-30 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Key Listing Mode): Add GPGME_KEYLIST_MODE_SIGS.
(Manipulating Keys): Add obsoleteness note.
(Key Signatures): Likewise.
(Information About Keys): Likewise.
(Key Management): Add new data types GpgmeSubkey, GpgmeKeySig,
GpgmeUserID, and all the information about GpgmeKey.
gpgme/
2003-04-30 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_key): New structure.
(GpgmeKey): Define using _gpgme_key.
(struct _gpgme_subkey): New structure.
(GpgmeSubKey): New type.
(struct _gpgme_key_sig): New structure.
(GpgmeKeySig): New type.
(struct _gpgme_user_id): New structure.
(GpgmeUserID): New type.
(struct _gpgme_op_keylist_result): New structure.
(GpgmeKeyListResult): New type.
(gpgme_op_keylist_result): New function.
(gpgme_key_get_as_xml): Remove prototype.
* context.h (struct gpgme_context_s): Remove members tmp_key,
tmp_uid, key_cond and key_queue.
(struct key_queue_item_s): Remove structure.
(struct user_id_s): Remove structure.
(struct gpgme_recipients_s): Replace with simple
GpgmeUserID list.
* gpgme.c (gpgme_release): Do not release CTX->tmp_key.
* ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
_gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
* rungpg.c (command_cb): Return GpgmeError instead int.
New variable ERR. Use it to hold return value of cmd handler.
(gpg_delete): Access fingerprint of key directly.
(append_args_from_signers): Likewise.
(gpg_edit): Likewise.
(append_args_from_recipients): Use GpgmeUserID for recipient list.
* engine-gpgsm.c: Do not include "key.h".
(gpgsm_delete): Access fingerprint of key directly.
(gpgsm_sign): Likewise.
(set_recipients): Use GpgmeUserID for recipients. Invert invalid
user ID flag.
* key.h: File removed.
* key.c: Completely reworked to use exposed GpgmeKey data types.
* keylist.c: Likewise.
* recipient.c: Completely reworked to use GpgmeUserID.
tests/
2003-04-30 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-keylist.c: Rewritten.
* gpgsm/t-keylist.c (main): Rewritten.
* gpg/t-edit.c (main): Do not use gpgme_key_get_as_xml. Use
gpgme_key_unref instead gpgme_key_release.
* gpg/t-signers.c (main): Use gpgme_key_unref instead
gpgme_key_release.