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 pgp code.
27 #include "crypt-mod.h"
30 static void crypt_mod_pgp_void_passphrase (void)
32 pgp_void_passphrase ();
35 static int crypt_mod_pgp_valid_passphrase (void)
37 return pgp_valid_passphrase ();
40 static int crypt_mod_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c,
43 return pgp_decrypt_mime (a, b, c, d);
45 static void crypt_mod_pgp_application_handler (BODY * m, STATE * s)
47 pgp_application_pgp_handler (m, s);
50 static char *crypt_mod_pgp_findkeys (ADDRESS * to, ADDRESS * cc,
53 return pgp_findKeys (to, cc, bcc);
56 static BODY *crypt_mod_pgp_sign_message (BODY * a)
58 return pgp_sign_message (a);
61 static int crypt_mod_pgp_verify_one (BODY * sigbdy, STATE * s,
64 return pgp_verify_one (sigbdy, s, tempf);
67 static int crypt_mod_pgp_send_menu (HEADER * msg, int *redraw)
69 return pgp_send_menu (msg, redraw);
72 static BODY *crypt_mod_pgp_encrypt_message (BODY * a, char *keylist, int sign)
74 return pgp_encrypt_message (a, keylist, sign);
77 static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
79 return pgp_make_key_attachment (tempf);
82 static int crypt_mod_pgp_check_traditional (FILE * fp, BODY * b,
85 return pgp_check_traditional (fp, b, tagged_only);
88 static BODY *crypt_mod_pgp_traditional_encryptsign (BODY * a, int flags,
91 return pgp_traditional_encryptsign (a, flags, keylist);
94 static void crypt_mod_pgp_encrypted_handler (BODY * m, STATE * s)
96 pgp_encrypted_handler (m, s);
99 static void crypt_mod_pgp_invoke_getkeys (ADDRESS * addr)
101 pgp_invoke_getkeys (addr);
104 static void crypt_mod_pgp_invoke_import (const char *fname)
106 pgp_invoke_import (fname);
109 static void crypt_mod_pgp_extract_keys_from_attachment_list (FILE * fp,
113 pgp_extract_keys_from_attachment_list (fp, tag, top);
116 struct crypt_module_specs crypt_mod_pgp_classic = { APPLICATION_PGP,
119 crypt_mod_pgp_void_passphrase,
120 crypt_mod_pgp_valid_passphrase,
121 crypt_mod_pgp_decrypt_mime,
122 crypt_mod_pgp_application_handler,
123 crypt_mod_pgp_encrypted_handler,
124 crypt_mod_pgp_findkeys,
125 crypt_mod_pgp_sign_message,
126 crypt_mod_pgp_verify_one,
127 crypt_mod_pgp_send_menu,
129 crypt_mod_pgp_encrypt_message,
130 crypt_mod_pgp_make_key_attachment,
131 crypt_mod_pgp_check_traditional,
132 crypt_mod_pgp_traditional_encryptsign,
133 crypt_mod_pgp_invoke_getkeys,
134 crypt_mod_pgp_invoke_import,
135 crypt_mod_pgp_extract_keys_from_attachment_list,
137 NULL, /* smime_getkeys */
138 NULL, /* smime_verify_sender */
139 NULL, /* smime_build_smime_entity */
140 NULL, /* smime_invoke_import */