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>
LIBAUTOCRYPT= libautocrypt.a
LIBAUTOCRYPTOBJS= autocrypt/autocrypt.o \
autocrypt/autocrypt_db.o \
+ autocrypt/autocrypt_gpgme.o \
autocrypt/autocrypt_schema.o
CLEANFILES+= $(LIBAUTOCRYPT) $(LIBAUTOCRYPTOBJS)
MUTTLIBS+= $(LIBAUTOCRYPT)
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:
void mutt_autocrypt_cleanup(void)
{
mutt_autocrypt_db_close();
- mutt_debug(LL_DEBUG1, "In mutt_autocrypt_cleanup()\n");
}
--- /dev/null
+/**
+ * @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;
+}
int mutt_autocrypt_schema_init(void);
int mutt_autocrypt_schema_update(void);
+int mutt_autocrypt_gpgme_init(void);
+
#endif /* MUTT_AUTOCRYPT_AUTOCRYPT_PRIVATE_H */