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.
14 #include <lib-lib/lib-lib.h>
16 #ifdef CRYPT_BACKEND_GPGME
18 #include <lib-crypt/crypt-mod.h>
19 #include "crypt-gpgme.h"
21 static void crypt_mod_smime_init (void)
26 static void crypt_mod_smime_void_passphrase (void)
28 /* Handled by gpg-agent. */
31 static int crypt_mod_smime_valid_passphrase (void)
33 /* Handled by gpg-agent. */
37 static int crypt_mod_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c,
40 return smime_gpgme_decrypt_mime (a, b, c, d);
43 static int crypt_mod_smime_application_handler (BODY * m, STATE * s)
45 return smime_gpgme_application_handler (m, s);
48 static char *crypt_mod_smime_findkeys (address_t * to, address_t * cc,
51 return smime_gpgme_findkeys (to, cc, bcc);
54 static BODY *crypt_mod_smime_sign_message (BODY * a)
56 return smime_gpgme_sign_message (a);
59 static int crypt_mod_smime_verify_one (BODY * sigbdy, STATE * s,
62 return smime_gpgme_verify_one (sigbdy, s, tempf);
65 static int crypt_mod_smime_send_menu (HEADER * msg, int *redraw)
67 return smime_gpgme_send_menu (msg, redraw);
70 static BODY *crypt_mod_smime_build_smime_entity (BODY * a, char *certlist)
72 return smime_gpgme_build_smime_entity (a, certlist);
75 static int crypt_mod_smime_verify_sender (HEADER * h)
77 return smime_gpgme_verify_sender (h);
80 struct crypt_module_specs crypt_mod_smime_gpgme = { APPLICATION_SMIME,
83 crypt_mod_smime_void_passphrase,
84 crypt_mod_smime_valid_passphrase,
85 crypt_mod_smime_decrypt_mime,
86 crypt_mod_smime_application_handler,
87 NULL, /* encrypted_handler */
88 crypt_mod_smime_findkeys,
89 crypt_mod_smime_sign_message,
90 crypt_mod_smime_verify_one,
91 crypt_mod_smime_send_menu,
93 NULL, /* pgp_encrypt_message */
94 NULL, /* pgp_make_key_attachment */
95 NULL, /* pgp_check_traditional */
96 NULL, /* pgp_traditional_encryptsign */
97 NULL, /* pgp_invoke_getkeys */
98 NULL, /* pgp_invoke_import */
99 NULL, /* pgp_extract_keys_from_attachment_list */
101 NULL, /* smime_getkeys */
102 crypt_mod_smime_verify_sender,
103 crypt_mod_smime_build_smime_entity,
104 NULL, /* smime_invoke_import */