X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=cryptglue.c;h=d76fa4468b4fc2d577dcc1043813bc5e76cc2de0;hp=28e8492ce173b38a745f94e5558d8686dc2a7d6d;hb=0ac011f8eb41bab7808881ebf9802b4eb252fe3b;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/cryptglue.c b/cryptglue.c index 28e8492..d76fa44 100644 --- a/cryptglue.c +++ b/cryptglue.c @@ -1,20 +1,11 @@ /* + * Copyright notice from original mutt: * Copyright (C) 2003 Werner Koch * Copyright (C) 2004 g10 Code GmbH * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ /* @@ -32,9 +23,12 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "mutt_crypt.h" + #include "crypt-mod.h" /* @@ -43,13 +37,8 @@ */ -#ifdef CRYPT_BACKEND_CLASSIC_PGP extern struct crypt_module_specs crypt_mod_pgp_classic; -#endif - -#ifdef CRYPT_BACKEND_CLASSIC_SMIME extern struct crypt_module_specs crypt_mod_smime_classic; -#endif #ifdef CRYPT_BACKEND_GPGME extern struct crypt_module_specs crypt_mod_pgp_gpgme; @@ -58,7 +47,6 @@ extern struct crypt_module_specs crypt_mod_smime_gpgme; void crypt_init (void) { -#ifdef CRYPT_BACKEND_CLASSIC_PGP if ( #ifdef CRYPT_BACKEND_GPGME (!option (OPTCRYPTUSEGPGME)) @@ -67,9 +55,7 @@ void crypt_init (void) #endif ) crypto_module_register (&crypt_mod_pgp_classic); -#endif -#ifdef CRYPT_BACKEND_CLASSIC_SMIME if ( #ifdef CRYPT_BACKEND_GPGME (!option (OPTCRYPTUSEGPGME)) @@ -78,7 +64,6 @@ void crypt_init (void) #endif ) crypto_module_register (&crypt_mod_smime_classic); -#endif if (option (OPTCRYPTUSEGPGME)) { #ifdef CRYPT_BACKEND_GPGME @@ -105,11 +90,11 @@ void crypt_init (void) /* Show a message that a backend will be invoked. */ void crypt_invoke_message (int type) { - if ((WithCrypto & APPLICATION_PGP) && (type & APPLICATION_PGP)) { + if (type & APPLICATION_PGP) { mutt_message _("Invoking PGP..."); } - else if ((WithCrypto & APPLICATION_SMIME) && (type & APPLICATION_SMIME)) { - mutt_message _("Invoking SMIME..."); + else if (type & APPLICATION_SMIME) { + mutt_message _("Invoking S/MIME..."); } } @@ -148,21 +133,23 @@ int crypt_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c, BODY ** d) } /* MIME handler for the application/pgp content-type. */ -void crypt_pgp_application_pgp_handler (BODY * m, STATE * s) +int crypt_pgp_application_pgp_handler (BODY * m, STATE * s) { if (CRYPT_MOD_CALL_CHECK (PGP, application_handler)) - (CRYPT_MOD_CALL (PGP, application_handler)) (m, s); + return (CRYPT_MOD_CALL (PGP, application_handler)) (m, s); + return (-1); } /* MIME handler for an PGP/MIME encrypted message. */ -void crypt_pgp_encrypted_handler (BODY * a, STATE * s) +int crypt_pgp_encrypted_handler (BODY * a, STATE * s) { if (CRYPT_MOD_CALL_CHECK (PGP, encrypted_handler)) - (CRYPT_MOD_CALL (PGP, encrypted_handler)) (a, s); + return (CRYPT_MOD_CALL (PGP, encrypted_handler)) (a, s); + return (-1); } /* fixme: needs documentation. */ -void crypt_pgp_invoke_getkeys (ADDRESS * addr) +void crypt_pgp_invoke_getkeys (address_t * addr) { if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_getkeys)) (CRYPT_MOD_CALL (PGP, pgp_invoke_getkeys)) (addr); @@ -198,7 +185,7 @@ BODY *crypt_pgp_make_key_attachment (char *tempf) /* This routine attempts to find the keyids of the recipients of a message. It returns NULL if any of the keys can not be found. */ -char *crypt_pgp_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) +char *crypt_pgp_findkeys (address_t * to, address_t * cc, address_t * bcc) { if (CRYPT_MOD_CALL_CHECK (PGP, findkeys)) return (CRYPT_MOD_CALL (PGP, findkeys)) (to, cc, bcc); @@ -294,17 +281,19 @@ int crypt_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c, BODY ** d) } /* MIME handler for the application/smime content-type. */ -void crypt_smime_application_smime_handler (BODY * m, STATE * s) +int crypt_smime_application_smime_handler (BODY * m, STATE * s) { if (CRYPT_MOD_CALL_CHECK (SMIME, application_handler)) - (CRYPT_MOD_CALL (SMIME, application_handler)) (m, s); + return (CRYPT_MOD_CALL (SMIME, application_handler)) (m, s); + return (-1); } /* MIME handler for an PGP/MIME encrypted message. */ -void crypt_smime_encrypted_handler (BODY * a, STATE * s) +int crypt_smime_encrypted_handler (BODY * a, STATE * s) { if (CRYPT_MOD_CALL_CHECK (SMIME, encrypted_handler)) - (CRYPT_MOD_CALL (SMIME, encrypted_handler)) (a, s); + return (CRYPT_MOD_CALL (SMIME, encrypted_handler)) (a, s); + return (-1); } /* fixme: Needs documentation. */ @@ -325,7 +314,7 @@ int crypt_smime_verify_sender (HEADER * h) /* This routine attempts to find the keyids of the recipients of a message. It returns NULL if any of the keys can not be found. */ -char *crypt_smime_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) +char *crypt_smime_findkeys (address_t * to, address_t * cc, address_t * bcc) { if (CRYPT_MOD_CALL_CHECK (SMIME, findkeys)) return (CRYPT_MOD_CALL (SMIME, findkeys)) (to, cc, bcc);