NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
cryptglue.h File Reference

Wrapper around crypto functions. More...

#include <stdbool.h>
#include "lib.h"
+ Include dependency graph for cryptglue.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct Bodycrypt_pgp_encrypt_message (struct Email *e, struct Body *b, char *keylist, int sign, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::pgp_encrypt_message()
 
char * crypt_pgp_find_keys (struct AddressList *al, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys()
 
void crypt_pgp_invoke_import (const char *fname)
 Wrapper for CryptModuleSpecs::pgp_invoke_import()
 
void crypt_pgp_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender()
 
struct Bodycrypt_pgp_sign_message (struct Body *b, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message()
 
struct Bodycrypt_pgp_traditional_encryptsign (struct Body *b, SecurityFlags flags, char *keylist)
 Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()
 
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()
 
void crypt_pgp_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase()
 
struct Bodycrypt_smime_build_smime_entity (struct Body *b, char *certlist)
 Wrapper for CryptModuleSpecs::smime_build_smime_entity()
 
char * crypt_smime_find_keys (struct AddressList *al, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys()
 
void crypt_smime_invoke_import (const char *infile, const char *mailbox)
 Wrapper for CryptModuleSpecs::smime_invoke_import()
 
void crypt_smime_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender()
 
struct Bodycrypt_smime_sign_message (struct Body *b, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message()
 
bool crypt_smime_valid_passphrase (void)
 Wrapper for CryptModuleSpecs::valid_passphrase()
 
int crypt_smime_verify_one (struct Body *b, struct State *state, const char *tempf)
 Wrapper for CryptModuleSpecs::verify_one()
 
void crypt_smime_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase()
 

Detailed Description

Wrapper around crypto functions.

Authors
  • Richard Russon
  • Pietro Cerutti

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, see http://www.gnu.org/licenses/.

Definition in file cryptglue.h.

Function Documentation

◆ crypt_pgp_encrypt_message()

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()

Definition at line 337 of file cryptglue.c.

339{
340#ifdef USE_AUTOCRYPT
341 if (e->security & SEC_AUTOCRYPT)
342 {
344 return NULL;
345
346 OptAutocryptGpgme = true;
347 struct Body *result = pgp_gpgme_encrypt_message(b, keylist, sign, from);
348 OptAutocryptGpgme = false;
349
350 return result;
351 }
352#endif
353
354 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
355 return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(b, keylist, sign, from);
356
357 return NULL;
358}
int mutt_autocrypt_set_sign_as_default_key(struct Email *e)
Set the Autocrypt default key for signing.
Definition: autocrypt.c:697
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
Definition: globals.c:59
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() -.
Definition: crypt_gpgme.c:1043
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:87
The body of an email.
Definition: body.h:36
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_find_keys()

char * crypt_pgp_find_keys ( struct AddressList *  al,
bool  oppenc_mode 
)

Wrapper for CryptModuleSpecs::find_keys()

Definition at line 315 of file cryptglue.c.

316{
318 return CRYPT_MOD_CALL(PGP, find_keys)(addrlist, oppenc_mode);
319
320 return NULL;
321}
static char * find_keys(const struct AddressList *addrlist, unsigned int app, bool oppenc_mode)
Find keys of the recipients of the message.
Definition: crypt_gpgme.c:3534
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_invoke_import()

void crypt_pgp_invoke_import ( const char *  fname)

Wrapper for CryptModuleSpecs::pgp_invoke_import()

Definition at line 363 of file cryptglue.c.

364{
365 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_import))
366 CRYPT_MOD_CALL(PGP, pgp_invoke_import)(fname);
367}
+ Here is the caller graph for this function:

◆ crypt_pgp_set_sender()

void crypt_pgp_set_sender ( const char *  sender)

Wrapper for CryptModuleSpecs::set_sender()

Definition at line 403 of file cryptglue.c.

404{
405 if (CRYPT_MOD_CALL_CHECK(PGP, set_sender))
406 CRYPT_MOD_CALL(PGP, set_sender)(sender);
407}
+ Here is the caller graph for this function:

◆ crypt_pgp_sign_message()

struct Body * crypt_pgp_sign_message ( struct Body b,
const struct AddressList *  from 
)

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 326 of file cryptglue.c.

327{
329 return CRYPT_MOD_CALL(PGP, sign_message)(b, from);
330
331 return NULL;
332}
static struct Body * sign_message(struct Body *b, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:906
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_traditional_encryptsign()

struct Body * crypt_pgp_traditional_encryptsign ( struct Body b,
SecurityFlags  flags,
char *  keylist 
)

Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()

Definition at line 293 of file cryptglue.c.

294{
295 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_traditional_encryptsign))
296 return CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign)(b, flags, keylist);
297
298 return NULL;
299}
+ Here is the caller graph for this function:

◆ crypt_pgp_valid_passphrase()

bool crypt_pgp_valid_passphrase ( void  )

Wrapper for CryptModuleSpecs::valid_passphrase()

Definition at line 199 of file cryptglue.c.

200{
201 if (CRYPT_MOD_CALL_CHECK(PGP, valid_passphrase))
202 return CRYPT_MOD_CALL(PGP, valid_passphrase)();
203
204 return false;
205}
+ Here is the caller graph for this function:

◆ crypt_pgp_verify_one()

int crypt_pgp_verify_one ( struct Body b,
struct State state,
const char *  tempf 
)

Wrapper for CryptModuleSpecs::verify_one()

Definition at line 372 of file cryptglue.c.

373{
375 return CRYPT_MOD_CALL(PGP, verify_one)(b, state, tempf);
376
377 return -1;
378}
static int verify_one(struct Body *b, struct State *state, const char *tempfile, bool is_smime)
Do the actual verification step.
Definition: crypt_gpgme.c:1581
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_void_passphrase()

void crypt_pgp_void_passphrase ( void  )

Wrapper for CryptModuleSpecs::void_passphrase()

Definition at line 190 of file cryptglue.c.

191{
192 if (CRYPT_MOD_CALL_CHECK(PGP, void_passphrase))
193 CRYPT_MOD_CALL(PGP, void_passphrase)();
194}
+ Here is the caller graph for this function:

◆ crypt_smime_build_smime_entity()

struct Body * crypt_smime_build_smime_entity ( struct Body b,
char *  certlist 
)

Wrapper for CryptModuleSpecs::smime_build_smime_entity()

Definition at line 496 of file cryptglue.c.

497{
498 if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
499 return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(b, certlist);
500
501 return NULL;
502}
+ Here is the caller graph for this function:

◆ crypt_smime_find_keys()

char * crypt_smime_find_keys ( struct AddressList *  al,
bool  oppenc_mode 
)

Wrapper for CryptModuleSpecs::find_keys()

Definition at line 474 of file cryptglue.c.

475{
477 return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
478
479 return NULL;
480}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_smime_invoke_import()

void crypt_smime_invoke_import ( const char *  infile,
const char *  mailbox 
)

Wrapper for CryptModuleSpecs::smime_invoke_import()

Definition at line 507 of file cryptglue.c.

508{
509 if (CRYPT_MOD_CALL_CHECK(SMIME, smime_invoke_import))
510 CRYPT_MOD_CALL(SMIME, smime_invoke_import)(infile, mailbox);
511}
+ Here is the caller graph for this function:

◆ crypt_smime_set_sender()

void crypt_smime_set_sender ( const char *  sender)

Wrapper for CryptModuleSpecs::set_sender()

Definition at line 538 of file cryptglue.c.

539{
540 if (CRYPT_MOD_CALL_CHECK(SMIME, set_sender))
541 CRYPT_MOD_CALL(SMIME, set_sender)(sender);
542}
+ Here is the caller graph for this function:

◆ crypt_smime_sign_message()

struct Body * crypt_smime_sign_message ( struct Body b,
const struct AddressList *  from 
)

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 485 of file cryptglue.c.

486{
488 return CRYPT_MOD_CALL(SMIME, sign_message)(b, from);
489
490 return NULL;
491}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_smime_valid_passphrase()

bool crypt_smime_valid_passphrase ( void  )

Wrapper for CryptModuleSpecs::valid_passphrase()

Definition at line 421 of file cryptglue.c.

422{
423 if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
424 return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
425
426 return false;
427}
+ Here is the caller graph for this function:

◆ crypt_smime_verify_one()

int crypt_smime_verify_one ( struct Body b,
struct State state,
const char *  tempf 
)

Wrapper for CryptModuleSpecs::verify_one()

Definition at line 516 of file cryptglue.c.

517{
519 return CRYPT_MOD_CALL(SMIME, verify_one)(b, state, tempf);
520
521 return -1;
522}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_smime_void_passphrase()

void crypt_smime_void_passphrase ( void  )

Wrapper for CryptModuleSpecs::void_passphrase()

Definition at line 412 of file cryptglue.c.

413{
414 if (CRYPT_MOD_CALL_CHECK(SMIME, void_passphrase))
415 CRYPT_MOD_CALL(SMIME, void_passphrase)();
416}
+ Here is the caller graph for this function: