From f543631aae3e52f010173926b646dba1e2b14ab9 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 14 Apr 2015 18:39:26 -0400 Subject: [PATCH] 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. --- src/genkey.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/genkey.c b/src/genkey.c index fd6685ef..17009bde 100644 --- a/src/genkey.c +++ b/src/genkey.c @@ -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); + 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, ctx->use_armor, pubkey, seckey); }