}
}
-/* Initialization. */
-static void init_gpgme (void)
+static void init_pgp (void)
{
- /* Make sure that gpg-agent is running. */
- if (! getenv ("GPG_AGENT_INFO"))
- {
- mutt_error (_("\nUsing GPGME backend, although no gpg-agent is running"));
- if (mutt_any_key_to_continue (NULL) == -1)
- mutt_exit(1);
- }
+ if (gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP) != GPG_ERR_NO_ERROR)
+ {
+ mutt_error (_("GPGME: OpenPGP protocol not available"));
+ if (mutt_any_key_to_continue (NULL) == -1)
+ mutt_exit(1);
+ }
+}
+
+static void init_smime (void)
+{
+ if (gpgme_engine_check_version (GPGME_PROTOCOL_CMS) != GPG_ERR_NO_ERROR)
+ {
+ mutt_error (_("GPGME: CMS protocol not available"));
+ if (mutt_any_key_to_continue (NULL) == -1)
+ mutt_exit(1);
+ }
}
void pgp_gpgme_init (void)
{
- init_common();
- init_gpgme ();
+ init_common ();
+ init_pgp ();
}
void smime_gpgme_init (void)
{
- init_common();
+ init_common ();
+ init_smime ();
}
static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime)
/*
** .pp
** If \fIset\fP, mutt will use a possibly-running \fCgpg-agent(1)\fP process.
+ ** Note that as of version 2.1, GnuPG no longer exports GPG_AGENT_INFO, so
+ ** mutt no longer verifies if the agent is running.
** (PGP only)
*/
{ "pgp_verify_command", DT_STR, R_NONE, UL &PgpVerifyCommand, 0},
{
char *tty;
- if (!option (OPTUSEGPGAGENT) || !getenv ("GPG_AGENT_INFO"))
+ /* GnuPG 2.1 no longer exports GPG_AGENT_INFO */
+ if (!option (OPTUSEGPGAGENT))
return 0;
if ((tty = ttyname(0)))