- if ((strcasecmp (protocol, "application/pgp-signature") == 0)
- || (strcasecmp (protocol, "application/pgp-encrypted") == 0)) {
- if (!crypto->gpgctx) {
-#ifdef GMIME_ATLEAST_26
- /* TODO: GMimePasswordRequestFunc */
- crypto->gpgctx = g_mime_gpg_context_new (NULL, "gpg");
-#else
- GMimeSession* session = g_object_new (g_mime_session_get_type(), NULL);
- crypto->gpgctx = g_mime_gpg_context_new (session, "gpg");
- g_object_unref (session);
-#endif
- if (crypto->gpgctx) {
-#ifdef GMIME_ATLEAST_26
- g_mime_gpg_context_set_use_agent ((GMimeGpgContext*) crypto->gpgctx, TRUE);
-#endif
- g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) crypto->gpgctx, FALSE);
- } else {
+ if (strcasecmp (protocol, "application/pgp-signature") == 0 ||
+ strcasecmp (protocol, "application/pgp-encrypted") == 0) {
+ if (! crypto->gpgctx) {
+ crypto->gpgctx = create_gpg_context (crypto->gpgpath);
+ if (! crypto->gpgctx)