45#ifndef CRYPT_BACKEND_GPGME
48#if defined(CRYPT_BACKEND_GPGME) || defined(USE_AUTOCRYPT)
63#ifdef CRYPT_BACKEND_CLASSIC_PGP
67#ifdef CRYPT_BACKEND_CLASSIC_SMIME
71#ifdef CRYPT_BACKEND_GPGME
79#define CRYPT_MOD_CALL_CHECK(identifier, func) \
80 (crypto_module_lookup(APPLICATION_##identifier) && \
81 (crypto_module_lookup(APPLICATION_##identifier))->func)
85#define CRYPT_MOD_CALL(identifier, func) \
86 (*(crypto_module_lookup(APPLICATION_##identifier))->func)
95#ifdef CRYPT_BACKEND_GPGME
98#ifdef CRYPT_BACKEND_CLASSIC_PGP
100#ifdef CRYPT_BACKEND_GPGME
109#ifdef CRYPT_BACKEND_CLASSIC_SMIME
111#ifdef CRYPT_BACKEND_GPGME
120#ifdef CRYPT_BACKEND_GPGME
121 if (c_crypt_use_gpgme)
128#if defined(CRYPT_BACKEND_CLASSIC_PGP) || \
129 defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
296 return CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign)(b, flags, keylist);
338 int sign,
const struct AddressList *from)
355 return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(b, keylist, sign, from);
435 return CRYPT_MOD_CALL(SMIME, decrypt_mime)(fp_in, fp_out, b, b_dec);
446 return CRYPT_MOD_CALL(SMIME, application_handler)(b_email, state);
499 return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(b, certlist);
Autocrypt end-to-end encryption.
int mutt_autocrypt_set_sign_as_default_key(struct Email *e)
Set the Autocrypt default key for signing.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
static char * find_keys(const struct AddressList *addrlist, unsigned int app, bool oppenc_mode)
Find keys of the recipients of the message.
static int verify_one(struct Body *b, struct State *state, const char *tempfile, bool is_smime)
Do the actual verification step.
static struct Body * sign_message(struct Body *b, const struct AddressList *from, bool use_smime)
Sign a message.
Wrapper for PGP/SMIME calls to GPGME.
const struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
void crypto_module_register(const struct CryptModuleSpecs *specs)
Register a new crypto module.
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
char * crypt_smime_find_keys(struct AddressList *addrlist, bool oppenc_mode)
Wrapper for CryptModuleSpecs::find_keys()
void crypt_invoke_message(SecurityFlags type)
Display an informative message.
struct Body * crypt_smime_build_smime_entity(struct Body *b, char *certlist)
Wrapper for CryptModuleSpecs::smime_build_smime_entity()
struct Body * crypt_smime_sign_message(struct Body *b, const struct AddressList *from)
Wrapper for CryptModuleSpecs::sign_message()
int crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Wrapper for CryptModuleSpecs::decrypt_mime()
struct Body * crypt_pgp_traditional_encryptsign(struct Body *b, SecurityFlags flags, char *keylist)
Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()
char * crypt_pgp_find_keys(struct AddressList *addrlist, bool oppenc_mode)
Wrapper for CryptModuleSpecs::find_keys()
void crypt_cleanup(void)
Clean up backend.
void crypt_smime_getkeys(struct Envelope *env)
Wrapper for CryptModuleSpecs::smime_getkeys()
struct Body * crypt_pgp_sign_message(struct Body *b, const struct AddressList *from)
Wrapper for CryptModuleSpecs::sign_message()
bool crypt_pgp_check_traditional(FILE *fp, struct Body *b, bool just_one)
Wrapper for CryptModuleSpecs::pgp_check_traditional()
#define CRYPT_MOD_CALL_CHECK(identifier, func)
struct Body * crypt_pgp_make_key_attachment(void)
Wrapper for CryptModuleSpecs::pgp_make_key_attachment()
SecurityFlags crypt_smime_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
SecurityFlags crypt_pgp_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
void crypt_pgp_invoke_getkeys(struct Address *addr)
Wrapper for CryptModuleSpecs::pgp_invoke_getkeys()
bool crypt_smime_valid_passphrase(void)
Wrapper for CryptModuleSpecs::valid_passphrase()
void crypt_pgp_invoke_import(const char *fname)
Wrapper for CryptModuleSpecs::pgp_invoke_import()
void crypt_smime_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
void crypt_pgp_extract_key_from_attachment(FILE *fp, struct Body *b)
Wrapper for CryptModuleSpecs::pgp_extract_key_from_attachment()
void crypt_smime_invoke_import(const char *infile, const char *mailbox)
Wrapper for CryptModuleSpecs::smime_invoke_import()
int crypt_smime_verify_sender(struct Email *e, struct Message *msg)
Wrapper for CryptModuleSpecs::smime_verify_sender()
void crypt_pgp_set_sender(const char *sender)
Wrapper for CryptModuleSpecs::set_sender()
void crypt_smime_set_sender(const char *sender)
Wrapper for CryptModuleSpecs::set_sender()
int crypt_smime_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Wrapper for CryptModuleSpecs::decrypt_mime()
int crypt_smime_verify_one(struct Body *b, struct State *state, const char *tempf)
Wrapper for CryptModuleSpecs::verify_one()
void crypt_init(void)
Initialise the crypto backends.
void crypt_pgp_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
#define CRYPT_MOD_CALL(identifier, func)
bool crypt_pgp_valid_passphrase(void)
Wrapper for CryptModuleSpecs::valid_passphrase()
int crypt_pgp_verify_one(struct Body *b, struct State *state, const char *tempf)
Wrapper for CryptModuleSpecs::verify_one()
struct Body * crypt_pgp_encrypt_message(struct Email *e, struct Body *b, char *keylist, int sign, const struct AddressList *from)
Wrapper for CryptModuleSpecs::pgp_encrypt_message()
Wrapper around crypto functions.
Structs that make up an email.
bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
const struct CryptModuleSpecs CryptModSmimeGpgme
GPGME SMIME - Implements CryptModuleSpecs -.
const struct CryptModuleSpecs CryptModSmimeClassic
CLI SMIME - Implements CryptModuleSpecs -.
const struct CryptModuleSpecs CryptModPgpGpgme
GPGME PGP - Implements CryptModuleSpecs -.
const struct CryptModuleSpecs CryptModPgpClassic
CLI PGP - Implements CryptModuleSpecs -.
int pgp_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -.
int pgp_gpgme_encrypted_handler(struct Body *b, struct State *state)
Manage a PGP or S/MIME encrypted MIME part - Implements CryptModuleSpecs::encrypted_handler() -.
struct Body * pgp_gpgme_encrypt_message(struct Body *b, char *keylist, bool sign, const struct AddressList *from)
PGP encrypt an email - Implements CryptModuleSpecs::pgp_encrypt_message() -.
int crypt_pgp_application_handler(struct Body *b_email, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
int crypt_smime_application_handler(struct Body *b_email, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
int crypt_pgp_encrypted_handler(struct Body *b_email, struct State *state)
Wrapper for CryptModuleSpecs::encrypted_handler() - Implements handler_t -.
#define mutt_message(...)
Convenience wrapper for the gui headers.
Convenience wrapper for the library headers.
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
int(* encrypted_handler)(struct Body *b, struct State *state)
int(* decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
bool(* valid_passphrase)(void)
int(* application_handler)(struct Body *b, struct State *state)
bool(* pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one)
void(* void_passphrase)(void)
void(* pgp_invoke_getkeys)(struct Address *addr)
The envelope/body of an email.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
A local copy of an email.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Keep track when processing files.