NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
crypt_mod.h
Go to the documentation of this file.
1
23
24
#ifndef MUTT_NCRYPT_CRYPT_MOD_H
25
#define MUTT_NCRYPT_CRYPT_MOD_H
26
27
#include <stdbool.h>
28
#include <stdio.h>
29
#include "
mutt/lib.h
"
30
#include "
lib.h
"
31
32
struct
Address
;
33
struct
AddressList;
34
struct
Body
;
35
struct
Email
;
36
struct
Envelope
;
37
struct
Message
;
38
struct
NcryptModuleData
;
39
47
struct
CryptModuleSpecs
48
{
49
int
identifier
;
50
57
void (*
init
)(void);
58
65
void (*
cleanup
)(
struct
NcryptModuleData
*mod_data);
66
73
void (*
void_passphrase
)(void);
74
86
bool (*
valid_passphrase
)(void);
87
100
int (*
decrypt_mime
)(FILE *fp_in, FILE **fp_out,
struct
Body
*b,
struct
Body
**b_dec);
101
112
int (*
application_handler
)(
struct
Body
*b,
struct
State
*state);
113
124
int (*
encrypted_handler
)(
struct
Body
*b,
struct
State
*state);
125
139
char
*(*find_keys)(
const
struct
AddressList *addrlist,
bool
oppenc_mode);
140
151
struct
Body
*(*sign_message)(
struct
Body
*b,
const
struct
AddressList *from);
152
164
int (*
verify_one
)(
struct
Body
*b,
struct
State
*state,
const
char
*tempf);
165
174
SecurityFlags
(*
send_menu
)(
struct
Email
*e);
175
183
void (*
set_sender
)(
const
char
*sender);
184
199
struct
Body
*(*pgp_encrypt_message)(
struct
Body
*b,
char
*keylist,
bool
sign,
const
struct
AddressList *from);
200
209
struct
Body
*(*pgp_make_key_attachment)(void);
210
222
bool (*
pgp_check_traditional
)(FILE *fp,
struct
Body
*b,
bool
just_one);
223
235
struct
Body
*(*pgp_traditional_encryptsign)(
struct
Body
*b,
SecurityFlags
flags,
char
*keylist);
236
244
void (*
pgp_invoke_getkeys
)(
struct
Address
*addr);
245
253
void (*
pgp_invoke_import
)(
const
char
*fname);
254
263
void (*
pgp_extract_key_from_attachment
)(FILE *fp,
struct
Body
*b);
264
272
void (*
smime_getkeys
)(
struct
Envelope
*env);
273
284
int (*
smime_verify_sender
)(
struct
Email
*e,
struct
Message
*msg);
285
296
struct
Body
*(*smime_build_smime_entity)(
struct
Body
*b,
char
*certlist);
297
306
void (*
smime_invoke_import
)(
const
char
*infile,
const
char
*mailbox);
307
};
308
314
struct
CryptModule
315
{
316
const
struct
CryptModuleSpecs
*
specs
;
317
STAILQ_ENTRY
(
CryptModule
) entries;
318
};
319
STAILQ_HEAD
(CryptModuleList,
CryptModule
);
320
321
/* High Level crypto module interface */
322
void
crypto_module_register
(
const
struct
CryptModuleSpecs
*specs);
323
const
struct
CryptModuleSpecs
*
crypto_module_lookup
(
struct
NcryptModuleData
*mod_data,
int
identifier
);
324
325
#endif
/* MUTT_NCRYPT_CRYPT_MOD_H */
crypto_module_lookup
const struct CryptModuleSpecs * crypto_module_lookup(struct NcryptModuleData *mod_data, int identifier)
Lookup a crypto module by name.
Definition
crypt_mod.c:57
crypto_module_register
void crypto_module_register(const struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition
crypt_mod.c:41
lib.h
Convenience wrapper for the library headers.
lib.h
API for encryption/signing of emails.
SecurityFlags
uint16_t SecurityFlags
Definition
lib.h:104
STAILQ_HEAD
#define STAILQ_HEAD(name, type)
Definition
queue.h:312
Address
An email address.
Definition
address.h:35
Body
The body of an email.
Definition
body.h:36
CryptModuleSpecs
Definition
crypt_mod.h:48
CryptModuleSpecs::encrypted_handler
int(* encrypted_handler)(struct Body *b, struct State *state)
Definition
crypt_mod.h:124
CryptModuleSpecs::pgp_invoke_import
void(* pgp_invoke_import)(const char *fname)
Definition
crypt_mod.h:253
CryptModuleSpecs::decrypt_mime
int(* decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Definition
crypt_mod.h:100
CryptModuleSpecs::smime_getkeys
void(* smime_getkeys)(struct Envelope *env)
Definition
crypt_mod.h:272
CryptModuleSpecs::set_sender
void(* set_sender)(const char *sender)
Definition
crypt_mod.h:183
CryptModuleSpecs::pgp_extract_key_from_attachment
void(* pgp_extract_key_from_attachment)(FILE *fp, struct Body *b)
Definition
crypt_mod.h:263
CryptModuleSpecs::init
void(* init)(void)
Definition
crypt_mod.h:57
CryptModuleSpecs::identifier
int identifier
Identifying bit.
Definition
crypt_mod.h:49
CryptModuleSpecs::valid_passphrase
bool(* valid_passphrase)(void)
Definition
crypt_mod.h:86
CryptModuleSpecs::application_handler
int(* application_handler)(struct Body *b, struct State *state)
Definition
crypt_mod.h:112
CryptModuleSpecs::send_menu
SecurityFlags(* send_menu)(struct Email *e)
Definition
crypt_mod.h:174
CryptModuleSpecs::smime_verify_sender
int(* smime_verify_sender)(struct Email *e, struct Message *msg)
Definition
crypt_mod.h:284
CryptModuleSpecs::pgp_check_traditional
bool(* pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one)
Definition
crypt_mod.h:222
CryptModuleSpecs::verify_one
int(* verify_one)(struct Body *b, struct State *state, const char *tempf)
Definition
crypt_mod.h:164
CryptModuleSpecs::void_passphrase
void(* void_passphrase)(void)
Definition
crypt_mod.h:73
CryptModuleSpecs::cleanup
void(* cleanup)(struct NcryptModuleData *mod_data)
Definition
crypt_mod.h:65
CryptModuleSpecs::pgp_invoke_getkeys
void(* pgp_invoke_getkeys)(struct Address *addr)
Definition
crypt_mod.h:244
CryptModuleSpecs::smime_invoke_import
void(* smime_invoke_import)(const char *infile, const char *mailbox)
Definition
crypt_mod.h:306
CryptModule
A crypto plugin module.
Definition
crypt_mod.h:315
CryptModule::specs
const struct CryptModuleSpecs * specs
Crypto module definition.
Definition
crypt_mod.h:316
CryptModule::STAILQ_ENTRY
STAILQ_ENTRY(CryptModule) entries
Linked list.
Email
The envelope/body of an email.
Definition
email.h:39
Envelope
The header of an Email.
Definition
envelope.h:57
Message
A local copy of an email.
Definition
message.h:34
NcryptModuleData
Ncrypt private Module data.
Definition
module_data.h:39
State
Keep track when processing files.
Definition
state.h:54