Make use of user passphrase handler during genkey.

* src/genkey.c (genkey_start): set engine passphrase command handler.

This allows for inquiring a new passphrase during key generation rather
than requiring a pinentry.
This commit is contained in:
Ben Kibbey 2015-04-14 18:39:26 -04:00
parent 7dcb654281
commit f543631aae

View File

@ -186,6 +186,14 @@ genkey_start (gpgme_ctx_t ctx, int synchronous, const char *parms,
_gpgme_engine_set_status_handler (ctx->engine, genkey_status_handler, ctx); _gpgme_engine_set_status_handler (ctx->engine, genkey_status_handler, ctx);
if (ctx->passphrase_cb)
{
err = _gpgme_engine_set_command_handler
(ctx->engine, _gpgme_passphrase_command_handler, ctx, NULL);
if (err)
return err;
}
return _gpgme_engine_op_genkey (ctx->engine, opd->key_parameter, return _gpgme_engine_op_genkey (ctx->engine, opd->key_parameter,
ctx->use_armor, pubkey, seckey); ctx->use_armor, pubkey, seckey);
} }