mutt stable branch with some hacks
at jcs 109 lines 4.1 kB view raw
1/* 2 * Copyright (C) 1996-1997 Michael R. Elkins <me@mutt.org> 3 * Copyright (C) 1999-2003 Thomas Roessler <roessler@does-not-exist.org> 4 * Copyright (C) 2004 g10 Code GmbH 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 */ 20 21#ifdef CRYPT_BACKEND_CLASSIC_PGP 22 23#include "mutt_crypt.h" 24#include "pgplib.h" 25 26 27/* prototypes */ 28 29int pgp_use_gpg_agent(void); 30 31int pgp_check_traditional (FILE *, BODY *, int); 32BODY *pgp_decrypt_part (BODY *, STATE *, FILE *, BODY *); 33BODY *pgp_make_key_attachment (void); 34const char *pgp_micalg (const char *fname); 35 36char *_pgp_keyid (pgp_key_t); 37char *pgp_keyid (pgp_key_t); 38char *pgp_short_keyid (pgp_key_t); 39char *pgp_long_keyid (pgp_key_t); 40char *pgp_fingerprint (pgp_key_t k); 41char *pgp_fpr_or_lkeyid (pgp_key_t k); 42 43 44int mutt_check_pgp (HEADER * h); 45 46int pgp_decrypt_mime (FILE *, FILE **, BODY *, BODY **); 47 48/* int pgp_string_matches_hint (const char *s, LIST * hints); */ 49 50/* pgp_key_t gpg_get_candidates (struct pgp_vinfo *, pgp_ring_t, LIST *); */ 51pgp_key_t pgp_ask_for_key (char *, char *, short, pgp_ring_t); 52pgp_key_t pgp_get_candidates (pgp_ring_t, LIST *); 53pgp_key_t pgp_getkeybyaddr (ADDRESS *, short, pgp_ring_t, int); 54pgp_key_t pgp_getkeybystr (char *, short, pgp_ring_t); 55 56char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode); 57 58void pgp_forget_passphrase (void); 59int pgp_application_pgp_handler (BODY *, STATE *); 60int pgp_encrypted_handler (BODY *, STATE *); 61void pgp_extract_keys_from_attachment_list (FILE * fp, int tag, BODY * top); 62void pgp_void_passphrase (void); 63int pgp_valid_passphrase (void); 64 65 66/* The PGP invocation interface - not really beautiful. */ 67 68pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr, 69 int pgpinfd, int pgpoutfd, int pgperrfd, 70 const char *fname, short need_passphrase); 71pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr, 72 int pgpinfd, int pgpoutfd, int pgperrfd, 73 const char *fname, const char *sig_fname); 74pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, 75 int pgpinfd, int pgpoutfd, int pgperrfd, 76 const char *fname); 77pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr, 78 int pgpinfd, int pgpoutfd, int pgperrfd, 79 const char *fname); 80pid_t pgp_invoke_encrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, 81 int pgpinfd, int pgpoutfd, int pgperrfd, 82 const char *fname, const char *uids, int sign); 83pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr, 84 int pgpinfd, int pgpoutfd, int pgperrfd, 85 const char *uids); 86pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, 87 int pgpinfd, int pgpoutfd, int pgperrfd, 88 const char *uids); 89pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, 90 int pgpinfd, int pgpoutfd, int pgperrfd, 91 pgp_ring_t keyring, LIST *hints); 92pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr, 93 int pgpinfd, int pgpoutfd, int pgperrfd, 94 const char *fname, const char *uids, int flags); 95 96 97void pgp_invoke_import (const char *fname); 98void pgp_invoke_getkeys (ADDRESS *); 99 100 101/* private ? */ 102int pgp_verify_one (BODY *, STATE *, const char *); 103BODY *pgp_traditional_encryptsign (BODY *, int, char *); 104BODY *pgp_encrypt_message (BODY *, char *, int); 105BODY *pgp_sign_message (BODY *); 106 107int pgp_send_menu (HEADER *msg); 108 109#endif /* CRYPT_BACKEND_CLASSIC_PGP */