NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
cryptglue.c File Reference
#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "cryptglue.h"
#include "ncrypt/lib.h"
#include "context.h"
#include "crypt_mod.h"
#include "mutt_globals.h"
#include "email/lib.h"
#include "autocrypt/lib.h"
#include "crypt_gpgme.h"
#include "options.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, SecurityFlags 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...
 
SecurityFlags 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...
 
SecurityFlags 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)

Definition at line 81 of file cryptglue.c.

◆ CRYPT_MOD_CALL

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

Definition at line 87 of file cryptglue.c.

Function Documentation

◆ crypt_init()

void crypt_init ( void  )

Initialise the crypto backends.

This calls CryptModuleSpecs::init()

Definition at line 95 of file cryptglue.c.

96 {
97 #ifdef CRYPT_BACKEND_CLASSIC_PGP
98  if (
99 #ifdef CRYPT_BACKEND_GPGME
100  (!C_CryptUseGpgme)
101 #else
102  1
103 #endif
104  )
106 #endif
107 
108 #ifdef CRYPT_BACKEND_CLASSIC_SMIME
109  if (
110 #ifdef CRYPT_BACKEND_GPGME
111  (!C_CryptUseGpgme)
112 #else
113  1
114 #endif
115  )
117 #endif
118 
119 #ifdef CRYPT_BACKEND_GPGME
120  if (C_CryptUseGpgme)
121  {
124  }
125 #endif
126 
127 #if defined(CRYPT_BACKEND_CLASSIC_PGP) || \
128  defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
129  if (CRYPT_MOD_CALL_CHECK(PGP, init))
130  CRYPT_MOD_CALL(PGP, init)();
131 
132  if (CRYPT_MOD_CALL_CHECK(SMIME, init))
133  CRYPT_MOD_CALL(SMIME, init)();
134 #endif
135 }
+ 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 140 of file cryptglue.c.

141 {
142  if (CRYPT_MOD_CALL_CHECK(PGP, cleanup))
143  (CRYPT_MOD_CALL(PGP, cleanup))();
144 
145  if (CRYPT_MOD_CALL_CHECK(SMIME, cleanup))
146  (CRYPT_MOD_CALL(SMIME, cleanup))();
147 }
+ 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 155 of file cryptglue.c.

156 {
157  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP))
158  mutt_message(_("Invoking PGP..."));
159  else if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME))
160  mutt_message(_("Invoking S/MIME..."));
161 }
+ 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 169 of file cryptglue.c.

170 {
171  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP) &&
173  {
174  return true;
175  }
176 
177  if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME) &&
179  {
180  return true;
181  }
182 
183  return false;
184 }
+ 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 189 of file cryptglue.c.

190 {
191  if (CRYPT_MOD_CALL_CHECK(PGP, void_passphrase))
192  CRYPT_MOD_CALL(PGP, void_passphrase)();
193 }
+ 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 198 of file cryptglue.c.

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

210 {
211 #ifdef USE_AUTOCRYPT
212  if (C_Autocrypt)
213  {
214  OptAutocryptGpgme = true;
215  int result = pgp_gpgme_decrypt_mime(fp_in, fp_out, b, cur);
216  OptAutocryptGpgme = false;
217  if (result == 0)
218  {
219  b->is_autocrypt = true;
220  return result;
221  }
222  }
223 #endif
224 
225  if (CRYPT_MOD_CALL_CHECK(PGP, decrypt_mime))
226  return CRYPT_MOD_CALL(PGP, decrypt_mime)(fp_in, fp_out, b, cur);
227 
228  return -1;
229 }
+ 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 236 of file cryptglue.c.

237 {
238  if (CRYPT_MOD_CALL_CHECK(PGP, application_handler))
239  return CRYPT_MOD_CALL(PGP, application_handler)(m, s);
240 
241  return -1;
242 }
+ 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 249 of file cryptglue.c.

250 {
251 #ifdef USE_AUTOCRYPT
252  if (C_Autocrypt)
253  {
254  OptAutocryptGpgme = true;
255  int result = pgp_gpgme_encrypted_handler(a, s);
256  OptAutocryptGpgme = false;
257  if (result == 0)
258  {
259  a->is_autocrypt = true;
260  return result;
261  }
262  }
263 #endif
264 
265  if (CRYPT_MOD_CALL_CHECK(PGP, encrypted_handler))
266  return CRYPT_MOD_CALL(PGP, encrypted_handler)(a, s);
267 
268  return -1;
269 }
+ 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 274 of file cryptglue.c.

275 {
276  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_getkeys))
277  CRYPT_MOD_CALL(PGP, pgp_invoke_getkeys)(addr);
278 }
+ 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 283 of file cryptglue.c.

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

struct Body* crypt_pgp_make_key_attachment ( void  )

Wrapper for CryptModuleSpecs::pgp_make_key_attachment()

Definition at line 305 of file cryptglue.c.

306 {
307  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_make_key_attachment))
308  return CRYPT_MOD_CALL(PGP, pgp_make_key_attachment)();
309 
310  return NULL;
311 }
+ 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 316 of file cryptglue.c.

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

328 {
330  return CRYPT_MOD_CALL(PGP, sign_message)(a, from);
331 
332  return NULL;
333 }
+ 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 338 of file cryptglue.c.

340 {
341 #ifdef USE_AUTOCRYPT
342  if (e->security & SEC_AUTOCRYPT)
343  {
344  struct Mailbox *m = ctx_mailbox(Context);
346  return NULL;
347 
348  OptAutocryptGpgme = true;
349  struct Body *result = pgp_gpgme_encrypt_message(a, keylist, sign, from);
350  OptAutocryptGpgme = false;
351 
352  return result;
353  }
354 #endif
355 
356  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
357  return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(a, keylist, sign, from);
358 
359  return NULL;
360 }
+ 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 365 of file cryptglue.c.

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

375 {
377  return CRYPT_MOD_CALL(PGP, verify_one)(sigbdy, s, tempf);
378 
379  return -1;
380 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_pgp_send_menu()

SecurityFlags crypt_pgp_send_menu ( struct Email e)

Wrapper for CryptModuleSpecs::send_menu()

Definition at line 385 of file cryptglue.c.

386 {
387  if (CRYPT_MOD_CALL_CHECK(PGP, send_menu))
388  return CRYPT_MOD_CALL(PGP, send_menu)(e);
389 
390  return 0;
391 }
+ 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 396 of file cryptglue.c.

397 {
398  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_extract_key_from_attachment))
399  CRYPT_MOD_CALL(PGP, pgp_extract_key_from_attachment)(fp, top);
400 }
+ 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 405 of file cryptglue.c.

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

415 {
416  if (CRYPT_MOD_CALL_CHECK(SMIME, void_passphrase))
417  CRYPT_MOD_CALL(SMIME, void_passphrase)();
418 }
+ 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 423 of file cryptglue.c.

424 {
425  if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
426  return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
427 
428  return false;
429 }
+ 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 434 of file cryptglue.c.

435 {
436  if (CRYPT_MOD_CALL_CHECK(SMIME, decrypt_mime))
437  return CRYPT_MOD_CALL(SMIME, decrypt_mime)(fp_in, fp_out, b, cur);
438 
439  return -1;
440 }
+ 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 447 of file cryptglue.c.

448 {
449  if (CRYPT_MOD_CALL_CHECK(SMIME, application_handler))
450  return CRYPT_MOD_CALL(SMIME, application_handler)(m, s);
451 
452  return -1;
453 }
+ 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 458 of file cryptglue.c.

459 {
460  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_getkeys))
461  CRYPT_MOD_CALL(SMIME, smime_getkeys)(env);
462 }
+ 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 467 of file cryptglue.c.

468 {
469  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_verify_sender))
470  return CRYPT_MOD_CALL(SMIME, smime_verify_sender)(m, e);
471 
472  return 1;
473 }
+ 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 478 of file cryptglue.c.

479 {
480  if (CRYPT_MOD_CALL_CHECK(SMIME, find_keys))
481  return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
482 
483  return NULL;
484 }
+ 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 489 of file cryptglue.c.

490 {
492  return CRYPT_MOD_CALL(SMIME, sign_message)(a, from);
493 
494  return NULL;
495 }
+ 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 500 of file cryptglue.c.

501 {
502  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
503  return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(a, certlist);
504 
505  return NULL;
506 }
+ 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 511 of file cryptglue.c.

512 {
513  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_invoke_import))
514  CRYPT_MOD_CALL(SMIME, smime_invoke_import)(infile, mailbox);
515 }
+ 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 520 of file cryptglue.c.

521 {
522  if (CRYPT_MOD_CALL_CHECK(SMIME, verify_one))
523  return CRYPT_MOD_CALL(SMIME, verify_one)(sigbdy, s, tempf);
524 
525  return -1;
526 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_smime_send_menu()

SecurityFlags crypt_smime_send_menu ( struct Email e)

Wrapper for CryptModuleSpecs::send_menu()

Definition at line 531 of file cryptglue.c.

532 {
533  if (CRYPT_MOD_CALL_CHECK(SMIME, send_menu))
534  return CRYPT_MOD_CALL(SMIME, send_menu)(e);
535 
536  return 0;
537 }
+ 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 542 of file cryptglue.c.

543 {
544  if (CRYPT_MOD_CALL_CHECK(SMIME, set_sender))
545  CRYPT_MOD_CALL(SMIME, set_sender)(sender);
546 }
+ 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.

crypto_module_register
void crypto_module_register(struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition: crypt_mod.c:51
verify_one
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
_
#define _(a)
Definition: message.h:28
Mailbox
A mailbox.
Definition: mailbox.h:81
APPLICATION_SMIME
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:98
ctx_mailbox
struct Mailbox * ctx_mailbox(struct Context *ctx)
wrapper to get the mailbox in a Context, or NULL
Definition: context.c:429
Body
The body of an email.
Definition: body.h:34
Body::is_autocrypt
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
Definition: body.h:79
OptAutocryptGpgme
WHERE bool OptAutocryptGpgme
(pseudo) use Autocrypt context inside ncrypt/crypt_gpgme.c
Definition: options.h:33
Context
The "current" mailbox.
Definition: context.h:38
pgp_gpgme_encrypted_handler
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
Implements CryptModuleSpecs::encrypted_handler()
Definition: crypt_gpgme.c:3044
C_Autocrypt
bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: config.c:37
mutt_autocrypt_set_sign_as_default_key
int mutt_autocrypt_set_sign_as_default_key(struct Mailbox *m, struct Email *e)
Set the Autocrypt default key for signing.
Definition: autocrypt.c:697
CryptModSmimeGpgme
struct CryptModuleSpecs CryptModSmimeGpgme
GPGME SMIME - Implements CryptModuleSpecs.
Definition: crypt_mod_smime_gpgme.c:59
C_CryptUseGpgme
bool C_CryptUseGpgme
Config: Use GPGME crypto backend.
Definition: config.c:81
APPLICATION_PGP
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:97
crypto_module_lookup
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65
CRYPT_MOD_CALL
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:87
Email::security
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:39
WithCrypto
#define WithCrypto
Definition: lib.h:123
pgp_gpgme_encrypt_message
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
CryptModSmimeClassic
struct CryptModuleSpecs CryptModSmimeClassic
CLI SMIME - Implements CryptModuleSpecs.
Definition: crypt_mod_smime_classic.c:57
find_keys
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:3798
CryptModPgpClassic
struct CryptModuleSpecs CryptModPgpClassic
CLI PGP - Implements CryptModuleSpecs.
Definition: crypt_mod_pgp_classic.c:43
mutt_message
#define mutt_message(...)
Definition: logging.h:83
pgp_gpgme_decrypt_mime
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:2194
CryptModPgpGpgme
struct CryptModuleSpecs CryptModPgpGpgme
GPGME PGP - Implements CryptModuleSpecs.
Definition: crypt_mod_pgp_gpgme.c:59
SEC_AUTOCRYPT
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:94
CRYPT_MOD_CALL_CHECK
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:81
sign_message
static struct Body * sign_message(struct Body *a, const struct AddressList *from, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1245