core: Support exporting secret keys.
* src/export.c (export_start): Set command handler for passphrase interaction for the case when it's secret keys. (export_ext_start): Likewise. -- GnuPG-bug-id: 5046 Co-authored-by: Louis Dupré Bertoni Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
7139afc5cd
commit
3382ecb17e
16
src/export.c
16
src/export.c
@ -163,6 +163,14 @@ export_start (gpgme_ctx_t ctx, int synchronous, const char *pattern,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (ctx->passphrase_cb)
|
||||
{
|
||||
err = _gpgme_engine_set_command_handler
|
||||
(ctx->engine, _gpgme_passphrase_command_handler, ctx);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
_gpgme_engine_set_status_handler (ctx->engine, export_status_handler, ctx);
|
||||
|
||||
return _gpgme_engine_op_export (ctx->engine, pattern, mode, keydata,
|
||||
@ -258,6 +266,14 @@ export_ext_start (gpgme_ctx_t ctx, int synchronous, const char *pattern[],
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (ctx->passphrase_cb)
|
||||
{
|
||||
err = _gpgme_engine_set_command_handler
|
||||
(ctx->engine, _gpgme_passphrase_command_handler, ctx);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
_gpgme_engine_set_status_handler (ctx->engine, export_status_handler, ctx);
|
||||
|
||||
return _gpgme_engine_op_export_ext (ctx->engine, pattern, mode, keydata,
|
||||
|
Loading…
Reference in New Issue
Block a user