NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
cryptglue.c File Reference

Wrapper around crypto functions. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "cryptglue.h"
#include "crypt_mod.h"
#include "ncrypt/lib.h"
#include "email/lib.h"
#include "crypt_gpgme.h"
#include "options.h"
#include "autocrypt/lib.h"
+ Include dependency graph for cryptglue.c:

Go to the source code of this file.

Macros

#define CRYPT_MOD_CALL_CHECK(identifier, func)
 
#define CRYPT_MOD_CALL(identifier, func)   (*(crypto_module_lookup(APPLICATION_##identifier))->func)
 

Functions

void crypt_init (void)
 Initialise the crypto backends. More...
 
void crypt_cleanup (void)
 Clean up backend. More...
 
void crypt_invoke_message (SecurityFlags type)
 Display an informative message. More...
 
bool crypt_has_module_backend (SecurityFlags type)
 Is there a crypto backend for a given type? More...
 
void crypt_pgp_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase() More...
 
bool crypt_pgp_valid_passphrase (void)
 Wrapper for CryptModuleSpecs::valid_passphrase() More...
 
int crypt_pgp_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 Wrapper for CryptModuleSpecs::decrypt_mime() More...
 
int crypt_pgp_application_handler (struct Body *m, struct State *s)
 Wrapper for CryptModuleSpecs::application_handler() More...
 
int crypt_pgp_encrypted_handler (struct Body *a, struct State *s)
 Wrapper for CryptModuleSpecs::encrypted_handler() More...
 
void crypt_pgp_invoke_getkeys (struct Address *addr)
 Wrapper for CryptModuleSpecs::pgp_invoke_getkeys() More...
 
int crypt_pgp_check_traditional (FILE *fp, struct Body *b, bool just_one)
 Wrapper for CryptModuleSpecs::pgp_check_traditional() More...
 
struct Bodycrypt_pgp_traditional_encryptsign (struct Body *a, int flags, char *keylist)
 Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign() More...
 
struct Bodycrypt_pgp_make_key_attachment (void)
 Wrapper for CryptModuleSpecs::pgp_make_key_attachment() More...
 
char * crypt_pgp_find_keys (struct AddressList *addrlist, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys() More...
 
struct Bodycrypt_pgp_sign_message (struct Body *a, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message() More...
 
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...
 
void crypt_pgp_invoke_import (const char *fname)
 Wrapper for CryptModuleSpecs::pgp_invoke_import() More...
 
int crypt_pgp_verify_one (struct Body *sigbdy, struct State *s, const char *tempf)
 Wrapper for CryptModuleSpecs::verify_one() More...
 
int crypt_pgp_send_menu (struct Email *e)
 Wrapper for CryptModuleSpecs::send_menu() More...
 
void crypt_pgp_extract_key_from_attachment (FILE *fp, struct Body *top)
 Wrapper for CryptModuleSpecs::pgp_extract_key_from_attachment() More...
 
void crypt_pgp_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender() More...
 
void crypt_smime_void_passphrase (void)
 Wrapper for CryptModuleSpecs::void_passphrase() More...
 
bool crypt_smime_valid_passphrase (void)
 Wrapper for CryptModuleSpecs::valid_passphrase() More...
 
int crypt_smime_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 Wrapper for CryptModuleSpecs::decrypt_mime() More...
 
int crypt_smime_application_handler (struct Body *m, struct State *s)
 Wrapper for CryptModuleSpecs::application_handler() More...
 
void crypt_smime_getkeys (struct Envelope *env)
 Wrapper for CryptModuleSpecs::smime_getkeys() More...
 
int crypt_smime_verify_sender (struct Mailbox *m, struct Email *e)
 Wrapper for CryptModuleSpecs::smime_verify_sender() More...
 
char * crypt_smime_find_keys (struct AddressList *addrlist, bool oppenc_mode)
 Wrapper for CryptModuleSpecs::find_keys() More...
 
struct Bodycrypt_smime_sign_message (struct Body *a, const struct AddressList *from)
 Wrapper for CryptModuleSpecs::sign_message() More...
 
struct Bodycrypt_smime_build_smime_entity (struct Body *a, char *certlist)
 Wrapper for CryptModuleSpecs::smime_build_smime_entity() More...
 
void crypt_smime_invoke_import (const char *infile, const char *mailbox)
 Wrapper for CryptModuleSpecs::smime_invoke_import() More...
 
int crypt_smime_verify_one (struct Body *sigbdy, struct State *s, const char *tempf)
 Wrapper for CryptModuleSpecs::verify_one() More...
 
int crypt_smime_send_menu (struct Email *e)
 Wrapper for CryptModuleSpecs::send_menu() More...
 
void crypt_smime_set_sender (const char *sender)
 Wrapper for CryptModuleSpecs::set_sender() More...
 

Variables

struct CryptModuleSpecs CryptModPgpClassic
 CLI PGP - Implements CryptModuleSpecs. More...
 
struct CryptModuleSpecs CryptModSmimeClassic
 CLI SMIME - Implements CryptModuleSpecs. More...
 
struct CryptModuleSpecs CryptModPgpGpgme
 GPGME PGP - Implements CryptModuleSpecs. More...
 
struct CryptModuleSpecs CryptModSmimeGpgme
 GPGME SMIME - Implements CryptModuleSpecs. More...
 

Detailed Description

Wrapper around crypto functions.

Authors
  • Werner Koch
  • g10 Code GmbH
  • 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.c.

Macro Definition Documentation

◆ CRYPT_MOD_CALL_CHECK

#define CRYPT_MOD_CALL_CHECK (   identifier,
  func 
)
Value:
(crypto_module_lookup(APPLICATION_##identifier) && \
(crypto_module_lookup(APPLICATION_##identifier))->func)
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65

Definition at line 79 of file cryptglue.c.

◆ CRYPT_MOD_CALL

#define CRYPT_MOD_CALL (   identifier,
  func 
)    (*(crypto_module_lookup(APPLICATION_##identifier))->func)

Definition at line 85 of file cryptglue.c.

Function Documentation

◆ crypt_init()

void crypt_init ( void  )

Initialise the crypto backends.

This calls CryptModuleSpecs::init()

Definition at line 93 of file cryptglue.c.

94 {
95 #ifdef CRYPT_BACKEND_CLASSIC_PGP
96  if (
97 #ifdef CRYPT_BACKEND_GPGME
99 #else
100  1
101 #endif
102  )
104 #endif
105 
106 #ifdef CRYPT_BACKEND_CLASSIC_SMIME
107  if (
108 #ifdef CRYPT_BACKEND_GPGME
109  (!C_CryptUseGpgme)
110 #else
111  1
112 #endif
113  )
115 #endif
116 
117 #ifdef CRYPT_BACKEND_GPGME
118  if (C_CryptUseGpgme)
119  {
122  }
123 #endif
124 
125 #if defined(CRYPT_BACKEND_CLASSIC_PGP) || \
126  defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
127  if (CRYPT_MOD_CALL_CHECK(PGP, init))
128  CRYPT_MOD_CALL(PGP, init)();
129 
130  if (CRYPT_MOD_CALL_CHECK(SMIME, init))
131  CRYPT_MOD_CALL(SMIME, init)();
132 #endif
133 }
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:85
bool C_CryptUseGpgme
Config: Use GPGME crypto backend.
Definition: config.c:68
void crypto_module_register(struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition: crypt_mod.c:51
struct CryptModuleSpecs CryptModSmimeClassic
CLI SMIME - Implements CryptModuleSpecs.
struct CryptModuleSpecs CryptModPgpClassic
CLI PGP - Implements CryptModuleSpecs.
struct CryptModuleSpecs CryptModPgpGpgme
GPGME PGP - Implements CryptModuleSpecs.
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:79
struct CryptModuleSpecs CryptModSmimeGpgme
GPGME SMIME - Implements CryptModuleSpecs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_cleanup()

void crypt_cleanup ( void  )

Clean up backend.

Definition at line 138 of file cryptglue.c.

139 {
140  if (CRYPT_MOD_CALL_CHECK(PGP, cleanup))
141  (CRYPT_MOD_CALL(PGP, cleanup))();
142 
143  if (CRYPT_MOD_CALL_CHECK(SMIME, cleanup))
144  (CRYPT_MOD_CALL(SMIME, cleanup))();
145 }
#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_invoke_message()

void crypt_invoke_message ( SecurityFlags  type)

Display an informative message.

Parameters
typeCrypto type, see SecurityFlags

Show a message that a backend will be invoked.

Definition at line 153 of file cryptglue.c.

154 {
155  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP))
156  mutt_message(_("Invoking PGP..."));
157  else if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME))
158  mutt_message(_("Invoking S/MIME..."));
159 }
#define WithCrypto
Definition: lib.h:118
#define mutt_message(...)
Definition: logging.h:83
#define _(a)
Definition: message.h:28
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:93
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:92
+ Here is the caller graph for this function:

◆ crypt_has_module_backend()

bool crypt_has_module_backend ( SecurityFlags  type)

Is there a crypto backend for a given type?

Parameters
typeCrypto type, see SecurityFlags
Return values
trueBackend is present
falseBackend is not present

Definition at line 167 of file cryptglue.c.

168 {
169  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP) &&
170  crypto_module_lookup(APPLICATION_PGP))
171  {
172  return true;
173  }
174 
175  if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME) &&
176  crypto_module_lookup(APPLICATION_SMIME))
177  {
178  return true;
179  }
180 
181  return false;
182 }
#define WithCrypto
Definition: lib.h:118
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:93
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:92
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65
+ 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_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_decrypt_mime()

int crypt_pgp_decrypt_mime ( FILE *  fp_in,
FILE **  fp_out,
struct Body b,
struct Body **  cur 
)

Wrapper for CryptModuleSpecs::decrypt_mime()

Definition at line 207 of file cryptglue.c.

208 {
209 #ifdef USE_AUTOCRYPT
210  if (C_Autocrypt)
211  {
212  OptAutocryptGpgme = true;
213  int result = pgp_gpgme_decrypt_mime(fp_in, fp_out, b, cur);
214  OptAutocryptGpgme = false;
215  if (result == 0)
216  {
217  b->is_autocrypt = true;
218  return result;
219  }
220  }
221 #endif
222 
223  if (CRYPT_MOD_CALL_CHECK(PGP, decrypt_mime))
224  return CRYPT_MOD_CALL(PGP, decrypt_mime)(fp_in, fp_out, b, cur);
225 
226  return -1;
227 }
bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: config.c:37
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
Definition: body.h:79
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
int pgp_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Implements CryptModuleSpecs::decrypt_mime()
Definition: crypt_gpgme.c:2381
#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_application_handler()

int crypt_pgp_application_handler ( struct Body m,
struct State s 
)

Wrapper for CryptModuleSpecs::application_handler()

Implements handler_t

Definition at line 234 of file cryptglue.c.

235 {
236  if (CRYPT_MOD_CALL_CHECK(PGP, application_handler))
237  return CRYPT_MOD_CALL(PGP, application_handler)(m, s);
238 
239  return -1;
240 }
#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_encrypted_handler()

int crypt_pgp_encrypted_handler ( struct Body a,
struct State s 
)

Wrapper for CryptModuleSpecs::encrypted_handler()

Implements handler_t

Definition at line 247 of file cryptglue.c.

248 {
249 #ifdef USE_AUTOCRYPT
250  if (C_Autocrypt)
251  {
252  OptAutocryptGpgme = true;
253  int result = pgp_gpgme_encrypted_handler(a, s);
254  OptAutocryptGpgme = false;
255  if (result == 0)
256  {
257  a->is_autocrypt = true;
258  return result;
259  }
260  }
261 #endif
262 
263  if (CRYPT_MOD_CALL_CHECK(PGP, encrypted_handler))
264  return CRYPT_MOD_CALL(PGP, encrypted_handler)(a, s);
265 
266  return -1;
267 }
bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: config.c:37
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
Definition: body.h:79
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
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
Implements CryptModuleSpecs::encrypted_handler()
Definition: crypt_gpgme.c:3229
#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_getkeys()

void crypt_pgp_invoke_getkeys ( struct Address addr)

Wrapper for CryptModuleSpecs::pgp_invoke_getkeys()

Definition at line 272 of file cryptglue.c.

273 {
274  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_getkeys))
275  CRYPT_MOD_CALL(PGP, pgp_invoke_getkeys)(addr);
276 }
#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_check_traditional()

int crypt_pgp_check_traditional ( FILE *  fp,
struct Body b,
bool  just_one 
)

Wrapper for CryptModuleSpecs::pgp_check_traditional()

Definition at line 281 of file cryptglue.c.

282 {
283  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_check_traditional))
284  return CRYPT_MOD_CALL(PGP, pgp_check_traditional)(fp, b, just_one);
285 
286  return 0;
287 }
#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_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_make_key_attachment()

struct Body* crypt_pgp_make_key_attachment ( void  )

Wrapper for CryptModuleSpecs::pgp_make_key_attachment()

Definition at line 303 of file cryptglue.c.

304 {
305  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_make_key_attachment))
306  return CRYPT_MOD_CALL(PGP, pgp_make_key_attachment)();
307 
308  return NULL;
309 }
#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_find_keys()

char* crypt_pgp_find_keys ( struct AddressList *  addrlist,
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:5239
#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_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:1432
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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:89
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:1569
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:661
#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_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_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:2075
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_send_menu()

int crypt_pgp_send_menu ( struct Email e)

Wrapper for CryptModuleSpecs::send_menu()

Definition at line 382 of file cryptglue.c.

383 {
384  if (CRYPT_MOD_CALL_CHECK(PGP, send_menu))
385  return CRYPT_MOD_CALL(PGP, send_menu)(e);
386 
387  return 0;
388 }
#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_extract_key_from_attachment()

void crypt_pgp_extract_key_from_attachment ( FILE *  fp,
struct Body top 
)

Wrapper for CryptModuleSpecs::pgp_extract_key_from_attachment()

Definition at line 393 of file cryptglue.c.

394 {
395  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_extract_key_from_attachment))
396  CRYPT_MOD_CALL(PGP, pgp_extract_key_from_attachment)(fp, top);
397 }
#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_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:

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

int crypt_smime_decrypt_mime ( FILE *  fp_in,
FILE **  fp_out,
struct Body b,
struct Body **  cur 
)

Wrapper for CryptModuleSpecs::decrypt_mime()

Definition at line 431 of file cryptglue.c.

432 {
433  if (CRYPT_MOD_CALL_CHECK(SMIME, decrypt_mime))
434  return CRYPT_MOD_CALL(SMIME, decrypt_mime)(fp_in, fp_out, b, cur);
435 
436  return -1;
437 }
#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_application_handler()

int crypt_smime_application_handler ( struct Body m,
struct State s 
)

Wrapper for CryptModuleSpecs::application_handler()

Implements handler_t

Definition at line 444 of file cryptglue.c.

445 {
446  if (CRYPT_MOD_CALL_CHECK(SMIME, application_handler))
447  return CRYPT_MOD_CALL(SMIME, application_handler)(m, s);
448 
449  return -1;
450 }
#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_getkeys()

void crypt_smime_getkeys ( struct Envelope env)

Wrapper for CryptModuleSpecs::smime_getkeys()

Definition at line 455 of file cryptglue.c.

456 {
457  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_getkeys))
458  CRYPT_MOD_CALL(SMIME, smime_getkeys)(env);
459 }
#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_sender()

int crypt_smime_verify_sender ( struct Mailbox m,
struct Email e 
)

Wrapper for CryptModuleSpecs::smime_verify_sender()

Definition at line 464 of file cryptglue.c.

465 {
466  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_verify_sender))
467  return CRYPT_MOD_CALL(SMIME, smime_verify_sender)(m, e);
468 
469  return 1;
470 }
#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 *  addrlist,
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:5239
#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_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:1432
+ Here is the call graph for this function:
+ 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_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_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:2075
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_smime_send_menu()

int crypt_smime_send_menu ( struct Email e)

Wrapper for CryptModuleSpecs::send_menu()

Definition at line 528 of file cryptglue.c.

529 {
530  if (CRYPT_MOD_CALL_CHECK(SMIME, send_menu))
531  return CRYPT_MOD_CALL(SMIME, send_menu)(e);
532 
533  return 0;
534 }
#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:

Variable Documentation

◆ CryptModPgpClassic

struct CryptModuleSpecs CryptModPgpClassic

CLI PGP - Implements CryptModuleSpecs.

Definition at line 43 of file crypt_mod_pgp_classic.c.

◆ CryptModSmimeClassic

struct CryptModuleSpecs CryptModSmimeClassic

CLI SMIME - Implements CryptModuleSpecs.

Definition at line 57 of file crypt_mod_smime_classic.c.

◆ CryptModPgpGpgme

struct CryptModuleSpecs CryptModPgpGpgme

GPGME PGP - Implements CryptModuleSpecs.

Definition at line 59 of file crypt_mod_pgp_gpgme.c.

◆ CryptModSmimeGpgme

struct CryptModuleSpecs CryptModSmimeGpgme

GPGME SMIME - Implements CryptModuleSpecs.

Definition at line 59 of file crypt_mod_smime_gpgme.c.