From: Pierre Habouzit Date: Mon, 2 Apr 2007 22:37:44 +0000 (+0200) Subject: drop even more glue. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=6d2a5b1e45ea9606d27a23c068bd4e8e5f94f341;p=apps%2Fmadmutt.git drop even more glue. Signed-off-by: Pierre Habouzit --- diff --git a/lib-crypt/Makefile.am b/lib-crypt/Makefile.am index ab296ba..eaefdb9 100644 --- a/lib-crypt/Makefile.am +++ b/lib-crypt/Makefile.am @@ -3,8 +3,8 @@ noinst_LIBRARIES = libcrypt.a libcrypt_a_SOURCES = crypt.h crypt-mod.h \ crypt.c crypt-mod.c \ cryptglue.c \ - crypt-gpgme.h crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c + crypt-gpgme.h crypt-gpgme.c -noinst_HEADERS = smime.h crypt.h crypt-mod.h crypt-gpgme.h +noinst_HEADERS = crypt.h crypt-mod.h crypt-gpgme.h -include $(top_builddir)/tools/cflags.mk diff --git a/lib-crypt/crypt-mod-pgp-gpgme.c b/lib-crypt/crypt-mod-pgp-gpgme.c deleted file mode 100644 index da506f2..0000000 --- a/lib-crypt/crypt-mod-pgp-gpgme.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright notice from original mutt: - * Copyright (C) 2004 g10 Code GmbH - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -/* This is a crytpo module wrapping the gpgme based pgp code. */ - -#include - -#include -#include "crypt-gpgme.h" - -struct crypt_module_specs crypt_mod_pgp_gpgme = { APPLICATION_PGP, - { - /* Common. */ - pgp_gpgme_init, - pgp_gpgme_decrypt_mime, - pgp_gpgme_application_handler, - pgp_gpgme_encrypted_handler, - pgp_gpgme_findkeys, - pgp_gpgme_sign_message, - pgp_gpgme_verify_one, - pgp_gpgme_send_menu, - - /* PGP specific. */ - pgp_gpgme_encrypt_message, - NULL, /* pgp_make_key_attachment, */ - pgp_gpgme_check_traditional, - NULL, /* pgp_traditional_encryptsign */ - NULL, /* pgp_invoke_getkeys */ - pgp_gpgme_invoke_import, /* pgp_invoke_import */ - pgp_gpgme_from_attachment_list, - /* pgp_extract_keys_from_attachment_list */ - - NULL, /* smime_getkeys */ - NULL, /* smime_verify_sender */ - NULL, /* smime_build_smime_entity */ - NULL, /* smime_invoke_import */ - } -}; diff --git a/lib-crypt/crypt-mod-smime-gpgme.c b/lib-crypt/crypt-mod-smime-gpgme.c deleted file mode 100644 index 5396b28..0000000 --- a/lib-crypt/crypt-mod-smime-gpgme.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright notice from original mutt: - * Copyright (C) 2004 g10 Code GmbH - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -/* - This is a crytpo module wrapping the gpgme based smime code. - */ - -#include - -#include -#include "crypt-gpgme.h" - -static void crypt_mod_smime_init (void) -{ - smime_gpgme_init (); -} - -static int crypt_mod_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c, - BODY ** d) -{ - return smime_gpgme_decrypt_mime (a, b, c, d); -} - -static int crypt_mod_smime_application_handler (BODY * m, STATE * s) -{ - return smime_gpgme_application_handler (m, s); -} - -static char *crypt_mod_smime_findkeys (address_t * to, address_t * cc, - address_t * bcc) -{ - return smime_gpgme_findkeys (to, cc, bcc); -} - -static BODY *crypt_mod_smime_sign_message (BODY * a) -{ - return smime_gpgme_sign_message (a); -} - -static int crypt_mod_smime_verify_one (BODY * sigbdy, STATE * s, - const char *tempf) -{ - return smime_gpgme_verify_one (sigbdy, s, tempf); -} - -static int crypt_mod_smime_send_menu (HEADER * msg, int *redraw) -{ - return smime_gpgme_send_menu (msg, redraw); -} - -static BODY *crypt_mod_smime_build_smime_entity (BODY * a, char *certlist) -{ - return smime_gpgme_build_smime_entity (a, certlist); -} - -static int crypt_mod_smime_verify_sender (HEADER * h) -{ - return smime_gpgme_verify_sender (h); -} - -struct crypt_module_specs crypt_mod_smime_gpgme = { APPLICATION_SMIME, - { - crypt_mod_smime_init, - crypt_mod_smime_decrypt_mime, - crypt_mod_smime_application_handler, - NULL, /* encrypted_handler */ - crypt_mod_smime_findkeys, - crypt_mod_smime_sign_message, - crypt_mod_smime_verify_one, - crypt_mod_smime_send_menu, - - NULL, /* pgp_encrypt_message */ - NULL, /* pgp_make_key_attachment */ - NULL, /* pgp_check_traditional */ - NULL, /* pgp_traditional_encryptsign */ - NULL, /* pgp_invoke_getkeys */ - NULL, /* pgp_invoke_import */ - NULL, /* pgp_extract_keys_from_attachment_list */ - - NULL, /* smime_getkeys */ - crypt_mod_smime_verify_sender, - crypt_mod_smime_build_smime_entity, - NULL, /* smime_invoke_import */ - } -}; diff --git a/lib-crypt/cryptglue.c b/lib-crypt/cryptglue.c index 046e777..742c4a0 100644 --- a/lib-crypt/cryptglue.c +++ b/lib-crypt/cryptglue.c @@ -24,13 +24,61 @@ #include "mutt.h" #include "crypt.h" #include "crypt-mod.h" - -/* - Generic -*/ - -extern struct crypt_module_specs crypt_mod_pgp_gpgme; -extern struct crypt_module_specs crypt_mod_smime_gpgme; +#include "crypt-gpgme.h" + +static struct crypt_module_specs crypt_mod_smime_gpgme = { APPLICATION_SMIME, + { + smime_gpgme_init, + smime_gpgme_decrypt_mime, + smime_gpgme_application_handler, + NULL, /* encrypted_handler */ + smime_gpgme_findkeys, + smime_gpgme_sign_message, + smime_gpgme_verify_one, + smime_gpgme_send_menu, + + NULL, /* pgp_encrypt_message */ + NULL, /* pgp_make_key_attachment */ + NULL, /* pgp_check_traditional */ + NULL, /* pgp_traditional_encryptsign */ + NULL, /* pgp_invoke_getkeys */ + NULL, /* pgp_invoke_import */ + NULL, /* pgp_extract_keys_from_attachment_list */ + + NULL, /* smime_getkeys */ + smime_gpgme_verify_sender, + smime_gpgme_build_smime_entity, + NULL, /* smime_invoke_import */ + } +}; + +static struct crypt_module_specs crypt_mod_pgp_gpgme = { APPLICATION_PGP, + { + pgp_gpgme_init, + pgp_gpgme_decrypt_mime, + pgp_gpgme_application_handler, + pgp_gpgme_encrypted_handler, + pgp_gpgme_findkeys, + pgp_gpgme_sign_message, + pgp_gpgme_verify_one, + pgp_gpgme_send_menu, + + /* PGP specific. */ + pgp_gpgme_encrypt_message, + NULL, /* pgp_make_key_attachment, */ + pgp_gpgme_check_traditional, + NULL, /* pgp_traditional_encryptsign */ + NULL, /* pgp_invoke_getkeys */ + pgp_gpgme_invoke_import, /* pgp_invoke_import */ + pgp_gpgme_from_attachment_list, + /* pgp_extract_keys_from_attachment_list */ + + NULL, /* smime_getkeys */ + NULL, /* smime_verify_sender */ + NULL, /* smime_build_smime_entity */ + NULL, /* smime_invoke_import */ + } +}; void crypt_init (void) {