From f9993de92437501c6e65dc595da6ec68d3573881 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Apr 10 2018 12:08:04 +0000 Subject: crypto: Set pinentry-mode to LOOPBACK We need to be able to supply the passphrase to gpgme. When using the default passphrase, the user is prompted and our callback isn't called. From the gpgme documentation: For GnuPG >= 2.1 this option is required to be set to GPGME_PINENTRY_MODE_LOOPBACK to enable the passphrase callback mechanism in GPGME through gpgme_set_passphrase_cb. --- diff --git a/lib/crypto.c b/lib/crypto.c index 6831682..4b9006a 100644 --- a/lib/crypto.c +++ b/lib/crypto.c @@ -664,6 +664,7 @@ init_gpgme (gpgme_ctx_t *res, const char *passphrase, GError **error) error_from_gpgme (error, e); goto err_ctx; } + gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_LOOPBACK); gpgme_set_passphrase_cb (ctx, gpgme_passphrase_cb, (void *)passphrase); *res = ctx; return 0;