2 * Copyright notice from original mutt:
3 * Copyright (C) 2004 g10 Code GmbH
5 * This file is part of mutt-ng, see http://www.muttng.org/.
6 * It's licensed under the GNU General Public License,
7 * please see the file GPL in the top level source directory.
11 This is a crytpo module wrapping the gpgme based smime code.
18 #ifdef CRYPT_BACKEND_GPGME
20 #include "crypt-mod.h"
21 #include "crypt-gpgme.h"
23 static void crypt_mod_smime_init (void)
28 static void crypt_mod_smime_void_passphrase (void)
30 /* Handled by gpg-agent. */
33 static int crypt_mod_smime_valid_passphrase (void)
35 /* Handled by gpg-agent. */
39 static int crypt_mod_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c,
42 return smime_gpgme_decrypt_mime (a, b, c, d);
45 static int crypt_mod_smime_application_handler (BODY * m, STATE * s)
47 return smime_gpgme_application_handler (m, s);
50 static char *crypt_mod_smime_findkeys (ADDRESS * to, ADDRESS * cc,
53 return smime_gpgme_findkeys (to, cc, bcc);
56 static BODY *crypt_mod_smime_sign_message (BODY * a)
58 return smime_gpgme_sign_message (a);
61 static int crypt_mod_smime_verify_one (BODY * sigbdy, STATE * s,
64 return smime_gpgme_verify_one (sigbdy, s, tempf);
67 static int crypt_mod_smime_send_menu (HEADER * msg, int *redraw)
69 return smime_gpgme_send_menu (msg, redraw);
72 static BODY *crypt_mod_smime_build_smime_entity (BODY * a, char *certlist)
74 return smime_gpgme_build_smime_entity (a, certlist);
77 static int crypt_mod_smime_verify_sender (HEADER * h)
79 return smime_gpgme_verify_sender (h);
82 struct crypt_module_specs crypt_mod_smime_gpgme = { APPLICATION_SMIME,
85 crypt_mod_smime_void_passphrase,
86 crypt_mod_smime_valid_passphrase,
87 crypt_mod_smime_decrypt_mime,
88 crypt_mod_smime_application_handler,
89 NULL, /* encrypted_handler */
90 crypt_mod_smime_findkeys,
91 crypt_mod_smime_sign_message,
92 crypt_mod_smime_verify_one,
93 crypt_mod_smime_send_menu,
95 NULL, /* pgp_encrypt_message */
96 NULL, /* pgp_make_key_attachment */
97 NULL, /* pgp_check_traditional */
98 NULL, /* pgp_traditional_encryptsign */
99 NULL, /* pgp_invoke_getkeys */
100 NULL, /* pgp_invoke_import */
101 NULL, /* pgp_extract_keys_from_attachment_list */
103 NULL, /* smime_getkeys */
104 crypt_mod_smime_verify_sender,
105 crypt_mod_smime_build_smime_entity,
106 NULL, /* smime_invoke_import */