Make use of user passphrase handler during passwd.
authorBen Kibbey <bjk@luxsci.net>
Wed, 28 Oct 2015 22:16:27 +0000 (18:16 -0400)
committerBen Kibbey <bjk@luxsci.net>
Thu, 29 Oct 2015 22:05:10 +0000 (18:05 -0400)
* src/passwd.c (passwd_start): set engine passphrase command handler.

--
This allows for inquiring a passphrase when changing a passphrase rather
than requiring a pinentry.

src/passwd.c

index ff30df0..c34f357 100644 (file)
@@ -148,6 +148,14 @@ passwd_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
 
   _gpgme_engine_set_status_handler (ctx->engine, passwd_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_passwd (ctx->engine, key, flags);
 }