NeoMutt  2020-08-21-74-g346364
Teaching an old dog new tricks
DOXYGEN
cryptglue.h File Reference

Wrapper around crypto functions. More...

#include <stdbool.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 *a, char *keylist, int sign, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::pgp_encrypt_message() More...
 
char * crypt_pgp_find_keys (struct AddressList *al, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys() More...
 
void crypt_pgp_invoke_import (const char *fname)
 Wrapper for CryptModuleSpecs::pgp_invoke_import() More...
 
void crypt_pgp_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender() More...
 
struct Bodycrypt_pgp_sign_message (struct Body *a, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message() More...
 
struct Bodycrypt_pgp_traditional_encryptsign (struct Body *a, int flags, char *keylist)
 Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign() More...
 
bool crypt_pgp_valid_passphrase (void)
 Wrapper for CryptModuleSpecs::valid_passphrase() More...
 
int crypt_pgp_verify_one (struct Body *sigbdy, struct State *s, const char *tempf)
 Wrapper for CryptModuleSpecs::verify_one() More...
 
void crypt_pgp_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase() More...
 
struct Bodycrypt_smime_build_smime_entity (struct Body *a, char *certlist)
 Wrapper for CryptModuleSpecs::smime_build_smime_entity() More...
 
char * crypt_smime_find_keys (struct AddressList *al, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys() More...
 
void crypt_smime_invoke_import (const char *infile, const char *mailbox)
 Wrapper for CryptModuleSpecs::smime_invoke_import() More...
 
void crypt_smime_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender() More...
 
struct Bodycrypt_smime_sign_message (struct Body *a, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message() More...
 
bool crypt_smime_valid_passphrase (void)
 Wrapper for CryptModuleSpecs::valid_passphrase() More...
 
int crypt_smime_verify_one (struct Body *sigbdy, struct State *s, const char *tempf)
 Wrapper for CryptModuleSpecs::verify_one() More...
 
void crypt_smime_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase() More...
 

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 a,
char *  keylist,
int  sign,
const struct AddressList *  from 
)

Wrapper for CryptModuleSpecs::pgp_encrypt_message()

Definition at line 336 of file cryptglue.c.

338 {
339 #ifdef USE_AUTOCRYPT
340  if (e->security & SEC_AUTOCRYPT)
341  {
343  return NULL;
344 
345  OptAutocryptGpgme = true;
346  struct Body *result = pgp_gpgme_encrypt_message(a, keylist, sign, from);
347  OptAutocryptGpgme = false;
348 
349  return result;
350  }
351 #endif
352 
353  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
354  return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(a, keylist, sign, from);
355 
356  return NULL;
357 }
WHERE bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
Definition: options.h:33
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:94
struct Body * pgp_gpgme_encrypt_message(struct Body *a, char *keylist, bool sign, const struct AddressList *from)
Implements CryptModuleSpecs::pgp_encrypt_message()
Definition: crypt_gpgme.c:1382
The body of an email.
Definition: body.h:34
int mutt_autocrypt_set_sign_as_default_key(struct Email *e)
Set the Autocrypt default key for signing.
Definition: autocrypt.c:685
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
Definition: email.h:39
+ 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 314 of file cryptglue.c.

315 {
317  return CRYPT_MOD_CALL(PGP, find_keys)(addrlist, oppenc_mode);
318 
319  return NULL;
320 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
static char * find_keys(struct AddressList *addrlist, unsigned int app, bool oppenc_mode)
Find keys of the recipients of the message.
Definition: crypt_gpgme.c:3794
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 362 of file cryptglue.c.

363 {
364  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_import))
365  CRYPT_MOD_CALL(PGP, pgp_invoke_import)(fname);
366 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 402 of file cryptglue.c.

403 {
404  if (CRYPT_MOD_CALL_CHECK(PGP, set_sender))
405  CRYPT_MOD_CALL(PGP, set_sender)(sender);
406 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function:

◆ crypt_pgp_sign_message()

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

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 325 of file cryptglue.c.

326 {
328  return CRYPT_MOD_CALL(PGP, sign_message)(a, from);
329 
330  return NULL;
331 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1245
+ 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 a,
int  flags,
char *  keylist 
)

Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()

Definition at line 292 of file cryptglue.c.

293 {
294  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_traditional_encryptsign))
295  return CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign)(a, flags, keylist);
296 
297  return NULL;
298 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 196 of file cryptglue.c.

197 {
198  if (CRYPT_MOD_CALL_CHECK(PGP, valid_passphrase))
199  return CRYPT_MOD_CALL(PGP, valid_passphrase)();
200 
201  return false;
202 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function:

◆ crypt_pgp_verify_one()

int crypt_pgp_verify_one ( struct Body sigbdy,
struct State s,
const char *  tempf 
)

Wrapper for CryptModuleSpecs::verify_one()

Definition at line 371 of file cryptglue.c.

372 {
374  return CRYPT_MOD_CALL(PGP, verify_one)(sigbdy, s, tempf);
375 
376  return -1;
377 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
static int verify_one(struct Body *sigbdy, struct State *s, const char *tempfile, bool is_smime)
Do the actual verification step.
Definition: crypt_gpgme.c:1888
+ 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 187 of file cryptglue.c.

188 {
189  if (CRYPT_MOD_CALL_CHECK(PGP, void_passphrase))
190  CRYPT_MOD_CALL(PGP, void_passphrase)();
191 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function:

◆ crypt_smime_build_smime_entity()

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

Wrapper for CryptModuleSpecs::smime_build_smime_entity()

Definition at line 497 of file cryptglue.c.

498 {
499  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
500  return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(a, certlist);
501 
502  return NULL;
503 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 475 of file cryptglue.c.

476 {
477  if (CRYPT_MOD_CALL_CHECK(SMIME, find_keys))
478  return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
479 
480  return NULL;
481 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
static char * find_keys(struct AddressList *addrlist, unsigned int app, bool oppenc_mode)
Find keys of the recipients of the message.
Definition: crypt_gpgme.c:3794
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 508 of file cryptglue.c.

509 {
510  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_invoke_import))
511  CRYPT_MOD_CALL(SMIME, smime_invoke_import)(infile, mailbox);
512 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ 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 539 of file cryptglue.c.

540 {
541  if (CRYPT_MOD_CALL_CHECK(SMIME, set_sender))
542  CRYPT_MOD_CALL(SMIME, set_sender)(sender);
543 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function:

◆ crypt_smime_sign_message()

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

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 486 of file cryptglue.c.

487 {
489  return CRYPT_MOD_CALL(SMIME, sign_message)(a, from);
490 
491  return NULL;
492 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1245
+ 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 420 of file cryptglue.c.

421 {
422  if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
423  return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
424 
425  return false;
426 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function:

◆ crypt_smime_verify_one()

int crypt_smime_verify_one ( struct Body sigbdy,
struct State s,
const char *  tempf 
)

Wrapper for CryptModuleSpecs::verify_one()

Definition at line 517 of file cryptglue.c.

518 {
519  if (CRYPT_MOD_CALL_CHECK(SMIME, verify_one))
520  return CRYPT_MOD_CALL(SMIME, verify_one)(sigbdy, s, tempf);
521 
522  return -1;
523 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
static int verify_one(struct Body *sigbdy, struct State *s, const char *tempfile, bool is_smime)
Do the actual verification step.
Definition: crypt_gpgme.c:1888
+ 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 411 of file cryptglue.c.

412 {
413  if (CRYPT_MOD_CALL_CHECK(SMIME, void_passphrase))
414  CRYPT_MOD_CALL(SMIME, void_passphrase)();
415 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
+ Here is the caller graph for this function: