X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_crypt.h;h=2b9434c03f36a7f281980ad46f09a19dacca3f29;hp=5e3f6174ae99da957c5756542a57b3979047a963;hb=10b7d54ecaa5c54622bf1239b57fa2e3359db0e1;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/mutt_crypt.h b/mutt_crypt.h index 5e3f617..2b9434c 100644 --- a/mutt_crypt.h +++ b/mutt_crypt.h @@ -1,20 +1,11 @@ /* + * Copyright notice from original mutt: * Copyright (C) 2003 Werner Koch * Copyright (C) 2004 g10code 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. */ /* @@ -25,7 +16,9 @@ #ifndef MUTT_CRYPT_H #define MUTT_CRYPT_H -#include "mutt.h" /* Need this to declare BODY, ADDRESS. STATE etc. */ +#include "mutt.h" /* Need this to declare BODY, address_t. STATE etc. */ +#include "state.h" + /* FIXME: They should be pointer to anonymous structures for better information hiding. */ @@ -57,24 +50,6 @@ #define SMIMEBADSIGN (APPLICATION_SMIME | BADSIGN) #define SMIMEOPAQUE (APPLICATION_SMIME | SIGNOPAQUE) - -/* WITHCRYPTO actually replaces ifdefs so make the code more readable. - Because it is defined as a constant and known at compile time, the - compiler can do dead code elimination and thus it behaves - effectively as a conditional compile directive. It is set to false - if no crypto backend is configures or to a bit vector denoting the - configured backends. */ -#if (defined(CRYPT_BACKEND_CLASSIC_PGP) && defined(CRYPT_BACKEND_CLASSIC_SMIME)) || defined (CRYPT_BACKEND_GPGME) -# define WithCrypto (APPLICATION_PGP | APPLICATION_SMIME) -#elif defined(CRYPT_BACKEND_CLASSIC_PGP) -# define WithCrypto APPLICATION_PGP -#elif defined(CRYPT_BACKEND_CLASSIC_SMIME) -# define WithCrypto APPLICATION_SMIME -#else -# define WithCrypto 0 -#endif - - #define KEYFLAG_CANSIGN (1 << 0) #define KEYFLAG_CANENCRYPT (1 << 1) #define KEYFLAG_ISX509 (1 << 2) @@ -116,7 +91,7 @@ int mutt_is_application_pgp (BODY *); int mutt_is_application_smime (BODY *); -void mutt_signed_handler (BODY *, STATE *); +int mutt_signed_handler (BODY *, STATE *); int mutt_parse_crypt_hdr (char *, int); @@ -128,7 +103,7 @@ void convert_to_7bit (BODY *); /*-- crypt.c --*/ /* Print the current time. */ -void crypt_current_time (STATE * s, char *app_name); +void crypt_current_time (STATE * s, const char *app_name); /* Check out the type of encryption used and set the cached status values if there are any. */ @@ -170,13 +145,13 @@ int crypt_pgp_valid_passphrase (void); 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); /* 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); /* fixme: needs documentation. */ -void crypt_pgp_invoke_getkeys (ADDRESS * addr); +void crypt_pgp_invoke_getkeys (address_t * addr); /* Ask for a PGP key. */ pgp_key_t crypt_pgp_ask_for_key (char *tag, char *whatfor, @@ -196,7 +171,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); /* Create a new body with a PGP signed message from A. */ BODY *crypt_pgp_sign_message (BODY * a); @@ -233,7 +208,7 @@ int crypt_smime_valid_passphrase (void); 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); /* fixme: Needs documentation. */ void crypt_smime_getkeys (ENVELOPE * env); @@ -246,7 +221,7 @@ char *crypt_smime_ask_for_key (char *prompt, char *mailbox, short public); /* 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); /* fixme: Needs documentation. */ BODY *crypt_smime_sign_message (BODY * a);