2003-10-02 Marcus Brinkmann <marcus@g10code.de>
* engine-backend.h (struct engine_ops): Add argument TYPE. * engine.c (_gpgme_engine_op_edit): Likewise. * engine.h: Likewise. * rungpg.c (gpg_edit): Likewise. Use it. * edit.c (edit_start): Likewise. Pass it on. (gpgme_op_edit_start, gpgme_op_edit): Likewise. (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
This commit is contained in:
parent
2f91a25865
commit
91f217b4b2
@ -1,3 +1,14 @@
|
|||||||
|
2003-10-02 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* engine-backend.h (struct engine_ops): Add argument TYPE.
|
||||||
|
* engine.c (_gpgme_engine_op_edit): Likewise.
|
||||||
|
* engine.h: Likewise.
|
||||||
|
* rungpg.c (gpg_edit): Likewise. Use it.
|
||||||
|
* edit.c (edit_start): Likewise. Pass it on.
|
||||||
|
(gpgme_op_edit_start, gpgme_op_edit): Likewise.
|
||||||
|
(gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
|
||||||
|
|
||||||
|
|
||||||
2003-09-30 Marcus Brinkmann <marcus@g10code.de>
|
2003-09-30 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* gpgme.h (gpg_strerror_r): Change prototype to match
|
* gpgme.h (gpg_strerror_r): Change prototype to match
|
||||||
|
30
gpgme/edit.c
30
gpgme/edit.c
@ -93,7 +93,7 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
|
|||||||
|
|
||||||
|
|
||||||
static gpgme_error_t
|
static gpgme_error_t
|
||||||
edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
|
edit_start (gpgme_ctx_t ctx, int synchronous, int type, gpgme_key_t key,
|
||||||
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
||||||
{
|
{
|
||||||
gpgme_error_t err;
|
gpgme_error_t err;
|
||||||
@ -122,7 +122,7 @@ edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
|
|||||||
|
|
||||||
_gpgme_engine_set_status_handler (ctx->engine, edit_status_handler, ctx);
|
_gpgme_engine_set_status_handler (ctx->engine, edit_status_handler, ctx);
|
||||||
|
|
||||||
return _gpgme_engine_op_edit (ctx->engine, key, out, ctx);
|
return _gpgme_engine_op_edit (ctx->engine, type, key, out, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ gpgme_error_t
|
|||||||
gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
|
gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
||||||
{
|
{
|
||||||
return edit_start (ctx, 0, key, fnc, fnc_value, out);
|
return edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +140,29 @@ gpgme_error_t
|
|||||||
gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
|
gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
||||||
{
|
{
|
||||||
gpgme_error_t err = edit_start (ctx, 1, key, fnc, fnc_value, out);
|
gpgme_error_t err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
|
||||||
|
if (!err)
|
||||||
|
err = _gpgme_wait_one (ctx);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gpgme_error_t
|
||||||
|
gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
|
gpgme_edit_cb_t fnc, void *fnc_value,
|
||||||
|
gpgme_data_t out)
|
||||||
|
{
|
||||||
|
return edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Edit the card for the key KEY. Send status and command requests to
|
||||||
|
FNC and output of edit commands to OUT. */
|
||||||
|
gpgme_error_t
|
||||||
|
gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
|
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
|
||||||
|
{
|
||||||
|
gpgme_error_t err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = _gpgme_wait_one (ctx);
|
err = _gpgme_wait_one (ctx);
|
||||||
return err;
|
return err;
|
||||||
|
@ -49,8 +49,8 @@ struct engine_ops
|
|||||||
gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
|
gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
|
||||||
gpgme_data_t plain);
|
gpgme_data_t plain);
|
||||||
gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
|
gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
|
||||||
gpgme_error_t (*edit) (void *engine, gpgme_key_t key, gpgme_data_t out,
|
gpgme_error_t (*edit) (void *engine, int type, gpgme_key_t key,
|
||||||
gpgme_ctx_t ctx /* FIXME */);
|
gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
|
||||||
gpgme_error_t (*encrypt) (void *engine, gpgme_key_t recp[],
|
gpgme_error_t (*encrypt) (void *engine, gpgme_key_t recp[],
|
||||||
gpgme_encrypt_flags_t flags,
|
gpgme_encrypt_flags_t flags,
|
||||||
gpgme_data_t plain, gpgme_data_t ciph,
|
gpgme_data_t plain, gpgme_data_t ciph,
|
||||||
|
@ -284,8 +284,8 @@ _gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
|
|||||||
|
|
||||||
|
|
||||||
gpgme_error_t
|
gpgme_error_t
|
||||||
_gpgme_engine_op_edit (engine_t engine, gpgme_key_t key, gpgme_data_t out,
|
_gpgme_engine_op_edit (engine_t engine, int type, gpgme_key_t key,
|
||||||
gpgme_ctx_t ctx /* FIXME */)
|
gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */)
|
||||||
{
|
{
|
||||||
if (!engine)
|
if (!engine)
|
||||||
return gpg_error (GPG_ERR_INV_VALUE);
|
return gpg_error (GPG_ERR_INV_VALUE);
|
||||||
@ -293,7 +293,7 @@ _gpgme_engine_op_edit (engine_t engine, gpgme_key_t key, gpgme_data_t out,
|
|||||||
if (!engine->ops->edit)
|
if (!engine->ops->edit)
|
||||||
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
|
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
|
||||||
|
|
||||||
return (*engine->ops->edit) (engine->engine, key, out, ctx);
|
return (*engine->ops->edit) (engine->engine, type, key, out, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ gpgme_error_t _gpgme_engine_op_decrypt (engine_t engine,
|
|||||||
gpgme_data_t plain);
|
gpgme_data_t plain);
|
||||||
gpgme_error_t _gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
|
gpgme_error_t _gpgme_engine_op_delete (engine_t engine, gpgme_key_t key,
|
||||||
int allow_secret);
|
int allow_secret);
|
||||||
gpgme_error_t _gpgme_engine_op_edit (engine_t engine, gpgme_key_t key,
|
gpgme_error_t _gpgme_engine_op_edit (engine_t engine, int type,
|
||||||
gpgme_data_t out,
|
gpgme_key_t key, gpgme_data_t out,
|
||||||
gpgme_ctx_t ctx /* FIXME */);
|
gpgme_ctx_t ctx /* FIXME */);
|
||||||
gpgme_error_t _gpgme_engine_op_encrypt (engine_t engine,
|
gpgme_error_t _gpgme_engine_op_encrypt (engine_t engine,
|
||||||
gpgme_key_t recp[],
|
gpgme_key_t recp[],
|
||||||
|
@ -1349,6 +1349,15 @@ gpgme_error_t gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
|
|||||||
gpgme_edit_cb_t fnc, void *fnc_value,
|
gpgme_edit_cb_t fnc, void *fnc_value,
|
||||||
gpgme_data_t out);
|
gpgme_data_t out);
|
||||||
|
|
||||||
|
/* Edit the card for the key KEY. Send status and command requests to
|
||||||
|
FNC and output of edit commands to OUT. */
|
||||||
|
gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
|
gpgme_edit_cb_t fnc, void *fnc_value,
|
||||||
|
gpgme_data_t out);
|
||||||
|
gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
|
||||||
|
gpgme_edit_cb_t fnc, void *fnc_value,
|
||||||
|
gpgme_data_t out);
|
||||||
|
|
||||||
|
|
||||||
/* Key management functions. */
|
/* Key management functions. */
|
||||||
struct _gpgme_op_keylist_result
|
struct _gpgme_op_keylist_result
|
||||||
|
@ -1224,7 +1224,7 @@ append_args_from_signers (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */)
|
|||||||
|
|
||||||
|
|
||||||
static gpgme_error_t
|
static gpgme_error_t
|
||||||
gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out,
|
gpg_edit (void *engine, int type, gpgme_key_t key, gpgme_data_t out,
|
||||||
gpgme_ctx_t ctx /* FIXME */)
|
gpgme_ctx_t ctx /* FIXME */)
|
||||||
{
|
{
|
||||||
engine_gpg_t gpg = engine;
|
engine_gpg_t gpg = engine;
|
||||||
@ -1234,7 +1234,7 @@ gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out,
|
|||||||
if (!err)
|
if (!err)
|
||||||
err = append_args_from_signers (gpg, ctx);
|
err = append_args_from_signers (gpg, ctx);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = add_arg (gpg, "--edit-key");
|
err = add_arg (gpg, type == 0 ? "--edit-key" : "--card-edit");
|
||||||
if (!err)
|
if (!err)
|
||||||
err = add_data (gpg, out, 1, 1);
|
err = add_data (gpg, out, 1, 1);
|
||||||
if (!err)
|
if (!err)
|
||||||
|
Loading…
Reference in New Issue
Block a user