#include "notmuch-client.h"
#if (GMIME_MAJOR_VERSION < 3)
/* Create a GPG context (GMime 2.6) */
-static notmuch_crypto_context_t *
+static GMimeCryptoContext *
create_gpg_context (_notmuch_crypto_t *crypto)
{
- notmuch_crypto_context_t *gpgctx;
+ GMimeCryptoContext *gpgctx;
if (crypto->gpgctx)
return crypto->gpgctx;
}
/* Create a PKCS7 context (GMime 2.6) */
-static notmuch_crypto_context_t *
+static GMimeCryptoContext *
create_pkcs7_context (_notmuch_crypto_t *crypto)
{
- notmuch_crypto_context_t *pkcs7ctx;
+ GMimeCryptoContext *pkcs7ctx;
if (crypto->pkcs7ctx)
return crypto->pkcs7ctx;
}
static const struct {
const char *protocol;
- notmuch_crypto_context_t *(*get_context) (_notmuch_crypto_t *crypto);
+ GMimeCryptoContext *(*get_context) (_notmuch_crypto_t *crypto);
} protocols[] = {
{
.protocol = "application/pgp-signature",
/* for the specified protocol return the context pointer (initializing
* if needed) */
-notmuch_crypto_context_t *
-_notmuch_crypto_get_context (_notmuch_crypto_t *crypto, const char *protocol)
+GMimeCryptoContext *
+_notmuch_crypto_get_gmime_context (_notmuch_crypto_t *crypto, const char *protocol)
{
- notmuch_crypto_context_t *cryptoctx = NULL;
+ GMimeCryptoContext *cryptoctx = NULL;
size_t i;
if (! protocol) {
/* Verify a signed mime node (GMime 2.6) */
static void
node_verify (mime_node_t *node, GMimeObject *part,
- g_mime_3_unused(notmuch_crypto_context_t *cryptoctx))
+ g_mime_3_unused(GMimeCryptoContext *cryptoctx))
{
GError *err = NULL;
/* Decrypt and optionally verify an encrypted mime node (GMime 2.6) */
static void
node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
- g_mime_3_unused(notmuch_crypto_context_t *cryptoctx))
+ g_mime_3_unused(GMimeCryptoContext *cryptoctx))
{
GError *err = NULL;
GMimeDecryptResult *decrypt_result = NULL;
_mime_node_create (mime_node_t *parent, GMimeObject *part)
{
mime_node_t *node = talloc_zero (parent, mime_node_t);
- notmuch_crypto_context_t *cryptoctx = NULL;
+ GMimeCryptoContext *cryptoctx = NULL;
/* Set basic node properties */
node->part = part;
|| (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify)) {
GMimeContentType *content_type = g_mime_object_get_content_type (part);
const char *protocol = g_mime_content_type_get_parameter (content_type, "protocol");
- cryptoctx = _notmuch_crypto_get_context (node->ctx->crypto, protocol);
+ cryptoctx = _notmuch_crypto_get_gmime_context (node->ctx->crypto, protocol);
if (!cryptoctx)
return NULL;
}
#include "gmime-extra.h"
-typedef GMimeCryptoContext notmuch_crypto_context_t;
/* This is automatically included only since gmime 2.6.10 */
#include <gmime/gmime-pkcs7-context.h>
bool verify;
bool decrypt;
#if (GMIME_MAJOR_VERSION < 3)
- notmuch_crypto_context_t* gpgctx;
- notmuch_crypto_context_t* pkcs7ctx;
+ GMimeCryptoContext* gpgctx;
+ GMimeCryptoContext* pkcs7ctx;
const char *gpgpath;
#endif
} _notmuch_crypto_t;
notmuch_exit_if_unsupported_format (void);
#if (GMIME_MAJOR_VERSION <3)
-notmuch_crypto_context_t *
-_notmuch_crypto_get_context (_notmuch_crypto_t *crypto, const char *protocol);
+GMimeCryptoContext *
+_notmuch_crypto_get_gmime_context (_notmuch_crypto_t *crypto, const char *protocol);
#endif
int