NeoMutt  2019-12-07-168-gc45f47
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 332 of file cryptglue.c.

334 {
335 #ifdef USE_AUTOCRYPT
336  if (e->security & SEC_AUTOCRYPT)
337  {
339  return NULL;
340 
341  OptAutocryptGpgme = true;
342  struct Body *result = pgp_gpgme_encrypt_message(a, keylist, sign, from);
343  OptAutocryptGpgme = false;
344 
345  return result;
346  }
347 #endif
348 
349  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
350  return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(a, keylist, sign, from);
351 
352  return NULL;
353 }
WHERE bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
Definition: options.h:32
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define SEC_AUTOCRYPT
Message will be, or was Autocrypt encrypt+signed.
Definition: lib.h:132
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:1572
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:681
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
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 310 of file cryptglue.c.

311 {
313  return CRYPT_MOD_CALL(PGP, find_keys)(addrlist, oppenc_mode);
314 
315  return NULL;
316 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
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:5236
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 358 of file cryptglue.c.

359 {
360  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_import))
361  CRYPT_MOD_CALL(PGP, pgp_invoke_import)(fname);
362 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 398 of file cryptglue.c.

399 {
400  if (CRYPT_MOD_CALL_CHECK(PGP, set_sender))
401  CRYPT_MOD_CALL(PGP, set_sender)(sender);
402 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 321 of file cryptglue.c.

322 {
324  return CRYPT_MOD_CALL(PGP, sign_message)(a, from);
325 
326  return NULL;
327 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1435
+ 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 288 of file cryptglue.c.

289 {
290  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_traditional_encryptsign))
291  return CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign)(a, flags, keylist);
292 
293  return NULL;
294 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 192 of file cryptglue.c.

193 {
194  if (CRYPT_MOD_CALL_CHECK(PGP, valid_passphrase))
195  return CRYPT_MOD_CALL(PGP, valid_passphrase)();
196 
197  return false;
198 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 367 of file cryptglue.c.

368 {
370  return CRYPT_MOD_CALL(PGP, verify_one)(sigbdy, s, tempf);
371 
372  return -1;
373 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
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:2076
+ 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 183 of file cryptglue.c.

184 {
185  if (CRYPT_MOD_CALL_CHECK(PGP, void_passphrase))
186  CRYPT_MOD_CALL(PGP, void_passphrase)();
187 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 493 of file cryptglue.c.

494 {
495  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
496  return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(a, certlist);
497 
498  return NULL;
499 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 471 of file cryptglue.c.

472 {
473  if (CRYPT_MOD_CALL_CHECK(SMIME, find_keys))
474  return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
475 
476  return NULL;
477 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
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:5236
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 504 of file cryptglue.c.

505 {
506  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_invoke_import))
507  CRYPT_MOD_CALL(SMIME, smime_invoke_import)(infile, mailbox);
508 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 535 of file cryptglue.c.

536 {
537  if (CRYPT_MOD_CALL_CHECK(SMIME, set_sender))
538  CRYPT_MOD_CALL(SMIME, set_sender)(sender);
539 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 482 of file cryptglue.c.

483 {
485  return CRYPT_MOD_CALL(SMIME, sign_message)(a, from);
486 
487  return NULL;
488 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1435
+ 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 416 of file cryptglue.c.

417 {
418  if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
419  return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
420 
421  return false;
422 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ 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 513 of file cryptglue.c.

514 {
515  if (CRYPT_MOD_CALL_CHECK(SMIME, verify_one))
516  return CRYPT_MOD_CALL(SMIME, verify_one)(sigbdy, s, tempf);
517 
518  return -1;
519 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
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:2076
+ 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 407 of file cryptglue.c.

408 {
409  if (CRYPT_MOD_CALL_CHECK(SMIME, void_passphrase))
410  CRYPT_MOD_CALL(SMIME, void_passphrase)();
411 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
+ Here is the caller graph for this function: