2 * Copyright (C) 2004 g10 Code GmbH
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 This is a crytpo module wrapping the gpgme based smime code.
27 #ifdef CRYPT_BACKEND_GPGME
29 #include "crypt-mod.h"
30 #include "crypt-gpgme.h"
32 static void crypt_mod_smime_init (void)
37 static void crypt_mod_smime_void_passphrase (void)
39 /* Handled by gpg-agent. */
42 static int crypt_mod_smime_valid_passphrase (void)
44 /* Handled by gpg-agent. */
48 static int crypt_mod_smime_decrypt_mime (FILE *a, FILE **b, BODY *c, BODY **d)
50 return smime_gpgme_decrypt_mime (a, b, c, d);
53 static int crypt_mod_smime_application_handler (BODY *m, STATE *s)
55 return smime_gpgme_application_handler (m, s);
58 static char *crypt_mod_smime_findkeys (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc)
60 return smime_gpgme_findkeys (to, cc, bcc);
63 static BODY *crypt_mod_smime_sign_message (BODY *a)
65 return smime_gpgme_sign_message (a);
68 static int crypt_mod_smime_verify_one (BODY *sigbdy, STATE *s, const char *tempf)
70 return smime_gpgme_verify_one (sigbdy, s, tempf);
73 static int crypt_mod_smime_send_menu (HEADER *msg, int *redraw)
75 return smime_gpgme_send_menu (msg, redraw);
78 static BODY *crypt_mod_smime_build_smime_entity (BODY *a, char *certlist)
80 return smime_gpgme_build_smime_entity (a, certlist);
83 static int crypt_mod_smime_verify_sender (HEADER *h)
85 return smime_gpgme_verify_sender (h);
88 struct crypt_module_specs crypt_mod_smime_gpgme =
92 crypt_mod_smime_void_passphrase,
93 crypt_mod_smime_valid_passphrase,
94 crypt_mod_smime_decrypt_mime,
95 crypt_mod_smime_application_handler,
96 NULL, /* encrypted_handler */
97 crypt_mod_smime_findkeys,
98 crypt_mod_smime_sign_message,
99 crypt_mod_smime_verify_one,
100 crypt_mod_smime_send_menu,
103 NULL, /* pgp_encrypt_message */
104 NULL, /* pgp_make_key_attachment */
105 NULL, /* pgp_check_traditional */
106 NULL, /* pgp_traditional_encryptsign */
107 NULL, /* pgp_invoke_getkeys */
108 NULL, /* pgp_invoke_import */
109 NULL, /* pgp_extract_keys_from_attachment_list */
111 NULL, /* smime_getkeys */
112 crypt_mod_smime_verify_sender,
113 crypt_mod_smime_build_smime_entity,
114 NULL, /* smime_invoke_import */