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 classic pgp code.
18 #include "crypt-mod.h"
21 static void crypt_mod_pgp_void_passphrase (void)
23 pgp_void_passphrase ();
26 static int crypt_mod_pgp_valid_passphrase (void)
28 return pgp_valid_passphrase ();
31 static int crypt_mod_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c,
34 return pgp_decrypt_mime (a, b, c, d);
36 static void crypt_mod_pgp_application_handler (BODY * m, STATE * s)
38 pgp_application_pgp_handler (m, s);
41 static char *crypt_mod_pgp_findkeys (ADDRESS * to, ADDRESS * cc,
44 return pgp_findKeys (to, cc, bcc);
47 static BODY *crypt_mod_pgp_sign_message (BODY * a)
49 return pgp_sign_message (a);
52 static int crypt_mod_pgp_verify_one (BODY * sigbdy, STATE * s,
55 return pgp_verify_one (sigbdy, s, tempf);
58 static int crypt_mod_pgp_send_menu (HEADER * msg, int *redraw)
60 return pgp_send_menu (msg, redraw);
63 static BODY *crypt_mod_pgp_encrypt_message (BODY * a, char *keylist, int sign)
65 return pgp_encrypt_message (a, keylist, sign);
68 static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
70 return pgp_make_key_attachment (tempf);
73 static int crypt_mod_pgp_check_traditional (FILE * fp, BODY * b,
76 return pgp_check_traditional (fp, b, tagged_only);
79 static BODY *crypt_mod_pgp_traditional_encryptsign (BODY * a, int flags,
82 return pgp_traditional_encryptsign (a, flags, keylist);
85 static void crypt_mod_pgp_encrypted_handler (BODY * m, STATE * s)
87 pgp_encrypted_handler (m, s);
90 static void crypt_mod_pgp_invoke_getkeys (ADDRESS * addr)
92 pgp_invoke_getkeys (addr);
95 static void crypt_mod_pgp_invoke_import (const char *fname)
97 pgp_invoke_import (fname);
100 static void crypt_mod_pgp_extract_keys_from_attachment_list (FILE * fp,
104 pgp_extract_keys_from_attachment_list (fp, tag, top);
107 struct crypt_module_specs crypt_mod_pgp_classic = { APPLICATION_PGP,
110 crypt_mod_pgp_void_passphrase,
111 crypt_mod_pgp_valid_passphrase,
112 crypt_mod_pgp_decrypt_mime,
113 crypt_mod_pgp_application_handler,
114 crypt_mod_pgp_encrypted_handler,
115 crypt_mod_pgp_findkeys,
116 crypt_mod_pgp_sign_message,
117 crypt_mod_pgp_verify_one,
118 crypt_mod_pgp_send_menu,
120 crypt_mod_pgp_encrypt_message,
121 crypt_mod_pgp_make_key_attachment,
122 crypt_mod_pgp_check_traditional,
123 crypt_mod_pgp_traditional_encryptsign,
124 crypt_mod_pgp_invoke_getkeys,
125 crypt_mod_pgp_invoke_import,
126 crypt_mod_pgp_extract_keys_from_attachment_list,
128 NULL, /* smime_getkeys */
129 NULL, /* smime_verify_sender */
130 NULL, /* smime_build_smime_entity */
131 NULL, /* smime_invoke_import */