* src/engine-backend.h (engine_ops): Change prototype of genkey.
* src/engine-gpgsm.c (gpgsm_genkey): Change accordingly.
* src/engine-gpg.c (gpg_genkey): Change it to a dispatcher.
(gpg_createkey_from_param): New for the old functionality.
(gpg_createkey_legacy): New. Stub for now.
(gpg_createkey): New.
(gpg_addkey): New. Stub for now.
(gpg_adduid): New. Stub for now.
* src/engine.c (_gpgme_engine_op_genkey): Add new args.
* src/genkey.c (op_data_t): Add field ERROR_CODE.
(parse_error): New.
(genkey_status_handler): Parse ERROR status line.
(genkey_start): Use NULL/0 for the new args.
(createkey_start): New.
(gpgme_op_createkey_start, gpgme_op_createkey): New.
* src/gpgme.def, src/libgpgme.vers: Add gpgme_op_createkey_start and
gpgme_op_createkey.
* src/gpgme.h.in (_gpgme_op_genkey_result): Add fields PUBKEY and
SECKEY.
(GPGME_CREATE_SIGN): New.
(GPGME_CREATE_ENCR): New.
(GPGME_CREATE_CERT): New.
(GPGME_CREATE_AUTH): New.
(GPGME_CREATE_NOPASSWD): New.
(GPGME_CREATE_SELFSIGNED): New.
(GPGME_CREATE_NOSTORE): New.
(GPGME_CREATE_WANTPUB): New.
(GPGME_CREATE_WANTSEC): New.
(GPGME_CREATE_FORCE): New.
* tests/run-genkey.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add it.
--
This function uses the new --quick-gen-key API of gpg. A limited
compatibility mode to use older gpg versions and gpgsm will eventually
be provided. Not all flags are currently implemented.
./run-genkey --unprotected --force test@example.com
Create a new standard key with the given user id. --force is used to
allow creating more than one key with that user id in the keyring.
./run-genkey --unprotected --force \
test@example.com default default 2145826800
Creates a new standard key with an expiration date of 2037-12-31.
./run-genkey --unprotected --force \
test@example.com future-default default 2145826800
Create a standard key using the fugure default algorithms.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/gpgme.h.in (gpgme_set_ctx_flag): New prototype.
* src/gpgme.c (gpgme_set_ctx_flag): New.
* src/gpgme.def, src/libgpgme.vers: Add new function.
* src/context.h (struct gpgme_context): Add FULL_STATUS.
* src/decrypt.c (_gpgme_decrypt_status_handler): Do not call the
status callback if FULL_STATUS is set.
* src/genkey.c (genkey_status_handler): Ditto.
* src/passphrase.c (_gpgme_passphrase_status_handler): Ditto.
* src/sign.c (_gpgme_sign_status_handler): Ditto.
* src/engine-backend.h (struct engine_ops): Add SET_STATUS_CB and add
adjust all definitions of that variable.
* src/engine.c (_gpgme_engine_set_status_cb): New.
* src/op-support.c (_gpgme_op_reset): Call this function.
* src/engine-gpg.c (struct engine_gpg): Add fields MON_CB and
MON_CB_VALUE.
(gpg_set_status_cb): New.
(_gpgme_engine_ops_gpg): Register that function.
(read_status): Call the monitor callback.
* src/engine-gpgsm.c (struct engine_gpgsm): Add fields MON_CB and
MON_CB_VALUE.
(_gpgme_engine_ops_gpgsm): Register that function.
(gpgsm_assuan_simple_command): Change first arg to be an engine
context and adjust call callers. Call the monitor callback.
* src/engine-uiserver.c (struct engine_uiserver): Add fields MON_CB
and MON_CB_VALUE.
(_gpgme_engine_ops_uiserver): Register that function.
(uiserver_assuan_simple_command): Change first arg to be an engine
context and adjust call callers. Call the monitor callback.
* tests/run-verify.c (status_cb): New.
(print_result): Print algo names.
(main): Add option --status.
--
This new feature is mainly intended for bug tracking. Having access
to the raw status lines might also be useful for applications, though.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/gpgme.h.in (gpgme_set_status_cb): New.
(gpgme_get_status_cb): New.
(gpgme_status_cb_t): New.
* src/gpgme.c (gpgme_set_status_cb): New.
(gpgme_get_status_cb): New.
* src/context.h (status_cb): New.
(status_cb_value): New.
* src/gpgme.def: Export new symbols.
* src/libgpgme.vers: Ditto.
* doc/gpgme.texi: Document these new functions.
--
This callback function is used to forward status messages from gpg back
to the client.
* doc/gpgme.texi: Document offline mode.
* src/context.h (gpgme_context): Add offline.
* src/engine-backend.h (keylist, keylist_ext): Add engine_flags.
* src/engine.c, src/engine.h (_gpgme_engine_op_keylist): Ditto.
(_gpgme_engine_op_keylist_ext): Ditto.
* src/engine.h (GPGME_ENGINE_FLAG_OFFLINE): New.
* src/engine-gpg.c (gpg_keylist, gpg_keylist_ext): Ditto.
* src/engine-gpgsm.c (gpgsm_keylist): Handle engine_flags.
(gpgsm_keylist_ext): Ditto.
* src/gpgme.c (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.def (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.h.in (gpgme_set_offline, gpgme_get_offline): New.
* src/libgpgme.vers (gpgme_set_offline, gpgme_get_offline): New.
* src/keylist.c (gpgme_op_keylist_start): Set offline flag.
(gpgme_op_keylist_ext_start): Ditto.
* tests/run-keylist.c (show_usage, main): Add offline argument.
--
The offline engine option was introduced with gpgsm 2.1.6
it is mainly useful for a full keylisting that includes
the certificate validation but does not depend on external
information that could take an indefinite amount of time to
collect.
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
* src/gpgme.h.in (gpgme_data_type_t): New.
(gpgme_data_identify): New prototype.
* src/data-identify.c: New.
* src/parsetlv.c, src/parsetlv.h: New. Take from gpa.
* src/libgpgme.vers, src/gpgme.def: Add gpgme_data_identify.
* src/gpgme-tool.c (status): Add STATUS_IDENTIFY_RESULT.
(gt_identify): New.
(cmd_identify): New.
(hlp_passwd): Move close to cmd_passwd.
--
It is often useful to have a way to identify the data which needs
processing. This is such a common task that it makes sense to
implement this in gpgme to avoid diverging implementations.
* src/gpgme.c (gpgme_io_read): New.
--
This is a writen style variant for gpgme_io_write. It is often easier
to use this one in passphrase and edit callbacks.
* src/gpgme.c (gpgme_set_global_flag): New.
* src/gpgme.h.in (gpgme_set_global_flag): New.
* src/gpgme.def, src/libgpgme.vers: Add new public function.
* src/debug.c (envvar_override): New.:
(_gpgme_debug_set_debug_envvar): New.
(debug_init): Take ENVVAR_OVERRIDE in account.
--
On Android envvars can't be used, thus we need another way to enable
GPGME debugging. The new function allows this and may be used in the
future to implement similar things.
* gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
* libgpgme.vers: Likewise.
* gpgme.h.in (gpgme_error_from_errno): Fix return type to
gpgme_error_t.
(gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
(gpgme_error_from_syserror): New inline function (why are
gpgme_err_make_from_errno and gpgme_error_from_errno not inline
functions?).
* error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
(gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
* configure.ac (NEED_GPG_VERSION_DEFAULT): Bump to 1.4.0 as 1.3.0
was development versions only.
tests/
2009-10-26 Marcus Brinkmann <marcus@g10code.de>
* opassuan/t-command.c: Update to new interface.
src/
2009-10-26 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h.in (struct gpgme_io_event_done_data)
(gpgme_io_event_done_data_t): New types.
(struct _gpgme_op_assuan_result): Deprecate the err member.
(gpgme_op_assuan_result): Deprecate (for now).
(gpgme_op_assuan_transact_ext): New prototype.
(gpgme_op_assuan_transact): Deprecate.
(struct _gpgme_op_g13_result): Replace with ...
(struct _gpgme_op_vfs_mount_result): ... this.
(gpgme_op_g13_mount): Replace with ...
(gpgme_op_vfs_mount): ... this.
* gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
(gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
(gpgme_op_g13_mount): Remove.
* libgpgme.vers: Likewise.
* engine-backend.h (struct engine_ops): Remove RESULT_CB and
RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP
member.
* ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
OP_ERR argument.
(_gpgme_wait_one_ext): New prototype.
* context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
* engine-g13.c (g13_cancel_op): New function.
(parse_status): Remove declaration.
(g13_assuan_simple_command): Do nothing with status lines for now.
(status_handler): Update opaque value access.
(_gpgme_engine_ops_g13): Add new cancel_op member.
* gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
Handle operational errors.
(gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
* data.c (_gpgme_data_inbound_handler)
(_gpgme_data_outbound_handler): Adjust opaque value access.
* engine-gpg.c (command_handler, status_handler)
(colon_line_handler): Likewise.
* engine-gpgsm.c (status_handler): Likewise.
* engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
* engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
* g13.c: Rewritten (and will be rewritten again).
* engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
and result_cb_value parameters from prototype.
(_gpgme_engine_cancel_op): New prototype.
* engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
(_gpgme_engine_op_assuan_transact): Remove result_cb and
result_cb_value parameter.
(_gpgme_engine_cancel_op): New function.
* wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
(struct io_cb_data): New struct to pass opaque data and get a
op_err return value. Needed because we can't modify I/O callback
handler signature because it is exposed to the user.
* wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle
operational errors.
* wait-user.c (_gpgme_user_io_cb_handler): Handle operational
errors.
* wait-private.c (_gpgme_wait_on_condition): New argument to
retrieve the operational result. Handle operational errors in
session based protocols.
(_gpgme_wait_one_ext): New function.
(_gpgme_wait_one): Pass argument in invocation of
_gpgme_wait_on_condition.
* wait-global.c (struct ctx_list_item): Add member OP_ERR.
(ctx_done): New argument OP_ERR.
(ctx_wait): New argument OP_ERR.
(gpgme_wait_ext): New function based on gpgme_wait but handling
operational errors.
(gpgme_wait): Implement in term of gpgme_wait_ext.
* keylist.c (gpgme_op_keylist_next): Pass argument in invocation
of _gpgme_wait_on_condition.
* trustlist.c (gpgme_op_trustlist_next): Pass argument in
invocation of _gpgme_wait_on_condition.
* engine-assuan.c (struct engine_llass): Replace members RESULT_CB
and RESULT_CB_VALUE by LAST_OP_ERR.
(_gpgme_engine_assuan_last_op_err): Add this hack function.
(llass_cancel_op): New function.
(_gpgme_engine_llass_ops): Add cancel_op member.
(llass_status_handler): Update opaque value access.
(llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
* opassuan.c: Move compat hacks to the end of file.
(opassuan_start): Do not set OPD->result.err.
Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
(gpgme_op_assuan_transact_ext): New function.
2009-05-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Library Version Check): Document selftest error.
(Creating Contexts): Likewise.
src/
2009-05-28 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h.in (gpgme_check_version_internal): New prototype.
(gpgme_check_version): New macro, overriding function of the same
name.
* libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
* context.h (_gpgme_selftest): New variable declaration.
* version.c: Include "context.h".
(gpgme_check_version): Set _gpgme_selftest on success.
(gpgme_check_version_internal): New function.
* gpgme.c (_gpgme_selftest): Define it.
(gpgme_new): Check the selftest result.