NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
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 *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, SecurityFlags 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 338 of file cryptglue.c.

340{
341#ifdef USE_AUTOCRYPT
342 if (e->security & SEC_AUTOCRYPT)
343 {
345 return NULL;
346
347 OptAutocryptGpgme = true;
348 struct Body *result = pgp_gpgme_encrypt_message(a, keylist, sign, from);
349 OptAutocryptGpgme = false;
350
351 return result;
352 }
353#endif
354
355 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
356 return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(a, keylist, sign, from);
357
358 return NULL;
359}
int mutt_autocrypt_set_sign_as_default_key(struct Email *e)
Set the Autocrypt default key for signing.
Definition: autocrypt.c:702
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:80
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:86
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:1035
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:87
bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
Definition: options.h:39
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:41
+ 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 316 of file cryptglue.c.

317{
319 return CRYPT_MOD_CALL(PGP, find_keys)(addrlist, oppenc_mode);
320
321 return NULL;
322}
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:3400
+ 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 364 of file cryptglue.c.

365{
366 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_import))
367 CRYPT_MOD_CALL(PGP, pgp_invoke_import)(fname);
368}
+ 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 404 of file cryptglue.c.

405{
406 if (CRYPT_MOD_CALL_CHECK(PGP, set_sender))
407 CRYPT_MOD_CALL(PGP, set_sender)(sender);
408}
+ 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 327 of file cryptglue.c.

328{
330 return CRYPT_MOD_CALL(PGP, sign_message)(a, from);
331
332 return NULL;
333}
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:898
+ 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,
SecurityFlags  flags,
char *  keylist 
)

Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()

Definition at line 294 of file cryptglue.c.

295{
296 if (CRYPT_MOD_CALL_CHECK(PGP, pgp_traditional_encryptsign))
297 return CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign)(a, flags, keylist);
298
299 return NULL;
300}
+ 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 200 of file cryptglue.c.

201{
202 if (CRYPT_MOD_CALL_CHECK(PGP, valid_passphrase))
203 return CRYPT_MOD_CALL(PGP, valid_passphrase)();
204
205 return false;
206}
+ 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 373 of file cryptglue.c.

374{
376 return CRYPT_MOD_CALL(PGP, verify_one)(sigbdy, s, tempf);
377
378 return -1;
379}
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:1537
+ 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 191 of file cryptglue.c.

192{
193 if (CRYPT_MOD_CALL_CHECK(PGP, void_passphrase))
194 CRYPT_MOD_CALL(PGP, void_passphrase)();
195}
+ 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}
+ 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{
478 return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
479
480 return NULL;
481}
+ 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}
+ 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}
+ 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}
+ 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 422 of file cryptglue.c.

423{
424 if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
425 return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
426
427 return false;
428}
+ 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{
520 return CRYPT_MOD_CALL(SMIME, verify_one)(sigbdy, s, tempf);
521
522 return -1;
523}
+ 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 413 of file cryptglue.c.

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