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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 This is a crytpo module wrapping the classic smime code.
27 #include "crypt-mod.h"
30 static void crypt_mod_smime_void_passphrase (void)
32 smime_void_passphrase ();
35 static int crypt_mod_smime_valid_passphrase (void)
37 return smime_valid_passphrase ();
40 static int crypt_mod_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c,
43 return smime_decrypt_mime (a, b, c, d);
45 static void crypt_mod_smime_application_handler (BODY * m, STATE * s)
47 smime_application_smime_handler (m, s);
50 static char *crypt_mod_smime_findkeys (ADDRESS * to, ADDRESS * cc,
53 return smime_findKeys (to, cc, bcc);
56 static BODY *crypt_mod_smime_sign_message (BODY * a)
58 return smime_sign_message (a);
61 static int crypt_mod_smime_verify_one (BODY * sigbdy, STATE * s,
64 return smime_verify_one (sigbdy, s, tempf);
67 static int crypt_mod_smime_send_menu (HEADER * msg, int *redraw)
69 return smime_send_menu (msg, redraw);
72 static void crypt_mod_smime_getkeys (ENVELOPE * env)
77 static int crypt_mod_smime_verify_sender (HEADER * h)
79 return smime_verify_sender (h);
82 static BODY *crypt_mod_smime_build_smime_entity (BODY * a, char *certlist)
84 return smime_build_smime_entity (a, certlist);
87 static void crypt_mod_smime_invoke_import (char *infile, char *mailbox)
89 smime_invoke_import (infile, mailbox);
93 struct crypt_module_specs crypt_mod_smime_classic = { APPLICATION_SMIME,
96 crypt_mod_smime_void_passphrase,
97 crypt_mod_smime_valid_passphrase,
98 crypt_mod_smime_decrypt_mime,
99 crypt_mod_smime_application_handler,
100 NULL, /* encrypted_handler */
101 crypt_mod_smime_findkeys,
102 crypt_mod_smime_sign_message,
103 crypt_mod_smime_verify_one,
104 crypt_mod_smime_send_menu,
106 NULL, /* pgp_encrypt_message */
107 NULL, /* pgp_make_key_attachment */
108 NULL, /* pgp_check_traditional */
109 NULL, /* pgp_traditional_encryptsign */
110 NULL, /* pgp_invoke_getkeys */
111 NULL, /* pgp_invoke_import */
112 NULL, /* pgp_extract_keys_from_attachment_list */
114 crypt_mod_smime_getkeys,
115 crypt_mod_smime_verify_sender,
116 crypt_mod_smime_build_smime_entity,
117 crypt_mod_smime_invoke_import,