]> granicus.if.org Git - neomutt/commitdiff
Start autocrypt gpgme
authorKevin McCarthy <kevin@8t8.us>
Sun, 7 Jul 2019 21:37:52 +0000 (14:37 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 19 Aug 2019 23:14:27 +0000 (00:14 +0100)
Add a basic init function.

Bump up the required gpgme version to 1.8.0 if autocrypt is enabled.

Co-authored-by: Richard Russon <rich@flatcap.org>
Makefile.autosetup
autocrypt/autocrypt.c
autocrypt/autocrypt_gpgme.c [new file with mode: 0644]
autocrypt/autocrypt_private.h

index f3ade963097bee9d974466e49ccbb694b41a923d..b33cda8c8408cb87d084fa96ae398823d13a6e74 100644 (file)
@@ -98,6 +98,7 @@ ALLOBJS+=     $(NEOMUTTOBJS)
 LIBAUTOCRYPT=  libautocrypt.a
 LIBAUTOCRYPTOBJS=      autocrypt/autocrypt.o \
                        autocrypt/autocrypt_db.o \
+                       autocrypt/autocrypt_gpgme.o \
                        autocrypt/autocrypt_schema.o
 CLEANFILES+=   $(LIBAUTOCRYPT) $(LIBAUTOCRYPTOBJS)
 MUTTLIBS+=     $(LIBAUTOCRYPT)
index fa8ff9187103b39669d65a7c40679cbb7ed6880e..d9f3b99be621e181cc177ff475732fd332904f0a 100644 (file)
@@ -70,15 +70,12 @@ int mutt_autocrypt_init(int can_create)
   if (autocrypt_dir_init(can_create))
     goto bail;
 
+  if (mutt_autocrypt_gpgme_init())
+    goto bail;
+
   if (mutt_autocrypt_db_init(can_create))
     goto bail;
 
-  /* mutt_autocrypt_gpgme_init()
-   *   - init gpgme
-   *   - create key if doesn't exist
-   *     - perhaps should query account table and if empty do that?
-   */
-  mutt_debug(LL_DEBUG1, "In mutt_autocrypt_init()\n");
   return 0;
 
 bail:
@@ -90,5 +87,4 @@ bail:
 void mutt_autocrypt_cleanup(void)
 {
   mutt_autocrypt_db_close();
-  mutt_debug(LL_DEBUG1, "In mutt_autocrypt_cleanup()\n");
 }
diff --git a/autocrypt/autocrypt_gpgme.c b/autocrypt/autocrypt_gpgme.c
new file mode 100644 (file)
index 0000000..e9381da
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * XXX
+ *
+ * @authors
+ * Copyright (C) 2019 Kevin J. McCarthy <kevin@8t8.us>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include "autocrypt_private.h"
+#include "mutt.h"
+#include "autocrypt.h"
+#include "ncrypt/crypt_gpgme.h"
+
+int mutt_autocrypt_gpgme_init(void)
+{
+  pgp_gpgme_init();
+  return 0;
+}
index 56a45aa8beffeb050a7ab2e48aa70f5d5680428d..f43a996a584aa4cf4fe99a38555615b4e53be0df 100644 (file)
@@ -29,4 +29,6 @@ void mutt_autocrypt_db_close(void);
 int mutt_autocrypt_schema_init(void);
 int mutt_autocrypt_schema_update(void);
 
+int mutt_autocrypt_gpgme_init(void);
+
 #endif /* MUTT_AUTOCRYPT_AUTOCRYPT_PRIVATE_H */