]> granicus.if.org Git - neomutt/commitdiff
gpgme: guard mail-key on presence of gpgme_op_export_keys
authorBrendan Cully <brendan@kublai.com>
Sat, 31 Jan 2015 19:21:52 +0000 (11:21 -0800)
committerBrendan Cully <brendan@kublai.com>
Sat, 31 Jan 2015 19:21:52 +0000 (11:21 -0800)
This function is too new to be assumed present.

configure.ac
crypt-gpgme.c
crypt-mod-pgp-gpgme.c

index 09aef1ca6cdec46c9da254122915f74a0a5780bc..c867af17fc77465a7a8449ce4fd16318109be131 100644 (file)
@@ -138,6 +138,11 @@ if test x"$enable_gpgme" = xyes; then
       #needed to get GPGME_LIBS and al correctly
       AM_PATH_GPGME(1.0.0, AC_DEFINE(CRYPT_BACKEND_GPGME, 1,
                     [Define if you use GPGME to support OpenPGP]))
+      dnl AC_CHECK_FUNCS([gpgme_op_export_keys])
+      saved_LIBS="$LIBS"
+      LIBS="$LIBS $GPGME_LIBS"
+      AC_CHECK_FUNCS([gpgme_op_export_keys])
+      LIBS="$saved_LIBS"
       MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS crypt-gpgme.o crypt-mod-pgp-gpgme.o crypt-mod-smime-gpgme.o"
    fi
 else
index 875b580b4682b4e31830b90a2bf0c0153b9c4c56..86df88d9052c115078fd84bb03185a670501870b 100644 (file)
@@ -4469,6 +4469,7 @@ char *smime_gpgme_findkeys (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc)
   return find_keys (to, cc, bcc, APPLICATION_SMIME);
 }
 
+#ifdef HAVE_GPGME_OP_EXPORT_KEYS
 BODY *pgp_gpgme_make_key_attachment (char *tempf)
 {
   crypt_key_t *key = NULL;
@@ -4525,6 +4526,7 @@ bail:
 
   return att;
 }
+#endif
 
 /*
  * Implementation of `init'.
index 1dced503d5bdabd5c12795ef43a91fe4aac91e40..2b41fbccb656bdf2ab9ee246cc8da015ab01638a 100644 (file)
@@ -95,10 +95,12 @@ static BODY *crypt_mod_pgp_encrypt_message (BODY *a, char *keylist, int sign)
   return pgp_gpgme_encrypt_message (a, keylist, sign);
 }
 
+#ifdef HAVE_GPGPME_OP_EXPORT_KEYS
 static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
 {
   return pgp_gpgme_make_key_attachment (tempf);
 }
+#endif
 
 static void crypt_mod_pgp_set_sender (const char *sender)
 {
@@ -123,7 +125,11 @@ struct crypt_module_specs crypt_mod_pgp_gpgme =
 
       /* PGP specific.  */
       crypt_mod_pgp_encrypt_message,
+#ifdef HAVE_GPGME_OP_EXPORT_KEYS
       crypt_mod_pgp_make_key_attachment,
+#else
+      NULL,
+#endif
       crypt_mod_pgp_check_traditional,
       NULL,                    /* pgp_traditional_encryptsign  */
       NULL, /* pgp_invoke_getkeys  */