NeoMutt  2019-12-07
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 "mutt/mutt.h"
#include "cryptglue.h"
#include "crypt_mod.h"
#include "ncrypt.h"
#include "curs_lib.h"
#include "email/lib.h"
#include "autocrypt/autocrypt.h"
#include "globals.h"
#include "ncrypt/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_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)
 Wrapper for CryptModuleSpecs::sign_message() More...
 
struct Bodycrypt_pgp_encrypt_message (struct Email *e, struct Body *a, char *keylist, int sign)
 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)
 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

bool C_CryptUseGpgme
 Config: Use GPGME crypto backend. More...
 
struct CryptModuleSpecs CryptModPgpClassic
 CLI PGP - Implements CryptModuleSpecs. More...
 
struct CryptModuleSpecs CryptModSmimeClassic
 CLI 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 82 of file cryptglue.c.

◆ CRYPT_MOD_CALL

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

Definition at line 88 of file cryptglue.c.

Function Documentation

◆ crypt_init()

void crypt_init ( void  )

Initialise the crypto backends.

This calls CryptModuleSpecs::init()

Definition at line 96 of file cryptglue.c.

97 {
98 #ifdef CRYPT_BACKEND_CLASSIC_PGP
99  if (
100 #ifdef CRYPT_BACKEND_GPGME
101  (!C_CryptUseGpgme)
102 #else
103  1
104 #endif
105  )
107 #endif
108 
109 #ifdef CRYPT_BACKEND_CLASSIC_SMIME
110  if (
111 #ifdef CRYPT_BACKEND_GPGME
112  (!C_CryptUseGpgme)
113 #else
114  1
115 #endif
116  )
118 #endif
119 
120  if (C_CryptUseGpgme)
121  {
122 #ifdef CRYPT_BACKEND_GPGME
125 #else
126  mutt_message(_("\"crypt_use_gpgme\" set"
127  " but not built with GPGME support"));
128  if (mutt_any_key_to_continue(NULL) == -1)
129  mutt_exit(1);
130 #endif
131  }
132 
133 #if defined(CRYPT_BACKEND_CLASSIC_PGP) || \
134  defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
135  if (CRYPT_MOD_CALL_CHECK(PGP, init))
136  CRYPT_MOD_CALL(PGP, init)();
137 
138  if (CRYPT_MOD_CALL_CHECK(SMIME, init))
139  CRYPT_MOD_CALL(SMIME, init)();
140 #endif
141 }
struct CryptModuleSpecs CryptModPgpGpgme
GPGME PGP - Implements CryptModuleSpecs.
#define mutt_message(...)
Definition: logging.h:83
bool C_CryptUseGpgme
Config: Use GPGME crypto backend.
Definition: cryptglue.c:61
#define _(a)
Definition: message.h:28
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
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.
#define CRYPT_MOD_CALL_CHECK(identifier, func)
Definition: cryptglue.c:82
void mutt_exit(int code)
Leave NeoMutt NOW.
Definition: main.c:210
int mutt_any_key_to_continue(const char *s)
Prompt the user to &#39;press any key&#39; and wait.
Definition: curs_lib.c:577
struct CryptModuleSpecs CryptModSmimeGpgme
GPGME SMIME - Implements CryptModuleSpecs.
+ Here is the call graph for this function:
+ 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 149 of file cryptglue.c.

150 {
151  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP))
152  mutt_message(_("Invoking PGP..."));
153  else if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME))
154  mutt_message(_("Invoking S/MIME..."));
155 }
#define mutt_message(...)
Definition: logging.h:83
#define _(a)
Definition: message.h:28
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: ncrypt.h:134
#define WithCrypto
Definition: ncrypt.h:160
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: ncrypt.h:135
+ 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 163 of file cryptglue.c.

164 {
165  if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP) &&
166  crypto_module_lookup(APPLICATION_PGP))
167  {
168  return true;
169  }
170 
171  if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME) &&
172  crypto_module_lookup(APPLICATION_SMIME))
173  {
174  return true;
175  }
176 
177  return false;
178 }
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: ncrypt.h:134
#define WithCrypto
Definition: ncrypt.h:160
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: ncrypt.h:135
+ 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_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_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 203 of file cryptglue.c.

204 {
205 #ifdef USE_AUTOCRYPT
206  if (C_Autocrypt)
207  {
208  OptAutocryptGpgme = true;
209  int result = pgp_gpgme_decrypt_mime(fp_in, fp_out, b, cur);
210  OptAutocryptGpgme = false;
211  if (result == 0)
212  {
213  b->is_autocrypt = true;
214  return result;
215  }
216  }
217 #endif
218 
219  if (CRYPT_MOD_CALL_CHECK(PGP, decrypt_mime))
220  return CRYPT_MOD_CALL(PGP, decrypt_mime)(fp_in, fp_out, b, cur);
221 
222  return -1;
223 }
WHERE bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: globals.h:202
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:32
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
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:2340
#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_application_handler()

int crypt_pgp_application_handler ( struct Body m,
struct State s 
)

Wrapper for CryptModuleSpecs::application_handler()

Implements handler_t

Definition at line 230 of file cryptglue.c.

231 {
232  if (CRYPT_MOD_CALL_CHECK(PGP, application_handler))
233  return CRYPT_MOD_CALL(PGP, application_handler)(m, s);
234 
235  return -1;
236 }
#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_encrypted_handler()

int crypt_pgp_encrypted_handler ( struct Body a,
struct State s 
)

Wrapper for CryptModuleSpecs::encrypted_handler()

Implements handler_t

Definition at line 243 of file cryptglue.c.

244 {
245 #ifdef USE_AUTOCRYPT
246  if (C_Autocrypt)
247  {
248  OptAutocryptGpgme = true;
249  int result = pgp_gpgme_encrypted_handler(a, s);
250  OptAutocryptGpgme = false;
251  if (result == 0)
252  {
253  a->is_autocrypt = true;
254  return result;
255  }
256  }
257 #endif
258 
259  if (CRYPT_MOD_CALL_CHECK(PGP, encrypted_handler))
260  return CRYPT_MOD_CALL(PGP, encrypted_handler)(a, s);
261 
262  return -1;
263 }
WHERE bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: globals.h:202
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:32
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
Implements CryptModuleSpecs::encrypted_handler()
Definition: crypt_gpgme.c:3184
#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_getkeys()

void crypt_pgp_invoke_getkeys ( struct Address addr)

Wrapper for CryptModuleSpecs::pgp_invoke_getkeys()

Definition at line 268 of file cryptglue.c.

269 {
270  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_getkeys))
271  CRYPT_MOD_CALL(PGP, pgp_invoke_getkeys)(addr);
272 }
#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_check_traditional()

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

Wrapper for CryptModuleSpecs::pgp_check_traditional()

Definition at line 277 of file cryptglue.c.

278 {
279  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_check_traditional))
280  return CRYPT_MOD_CALL(PGP, pgp_check_traditional)(fp, b, just_one);
281 
282  return 0;
283 }
#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_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_make_key_attachment()

struct Body* crypt_pgp_make_key_attachment ( void  )

Wrapper for CryptModuleSpecs::pgp_make_key_attachment()

Definition at line 299 of file cryptglue.c.

300 {
301  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_make_key_attachment))
302  return CRYPT_MOD_CALL(PGP, pgp_make_key_attachment)();
303 
304  return NULL;
305 }
#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_find_keys()

char* crypt_pgp_find_keys ( struct AddressList *  addrlist,
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:5156
#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_sign_message()

struct Body* crypt_pgp_sign_message ( struct Body a)

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 321 of file cryptglue.c.

322 {
324  return CRYPT_MOD_CALL(PGP, sign_message)(a);
325 
326  return NULL;
327 }
static struct Body * sign_message(struct Body *a, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1405
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#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_encrypt_message()

struct Body* crypt_pgp_encrypt_message ( struct Email e,
struct Body a,
char *  keylist,
int  sign 
)

Wrapper for CryptModuleSpecs::pgp_encrypt_message()

Definition at line 332 of file cryptglue.c.

333 {
334 #ifdef USE_AUTOCRYPT
335  if (e->security & SEC_AUTOCRYPT)
336  {
338  return NULL;
339 
340  OptAutocryptGpgme = true;
341  struct Body *result = pgp_gpgme_encrypt_message(a, keylist, sign);
342  OptAutocryptGpgme = false;
343 
344  return result;
345  }
346 #endif
347 
348  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
349  return CRYPT_MOD_CALL(PGP, pgp_encrypt_message)(a, keylist, sign);
350 
351  return NULL;
352 }
#define SEC_AUTOCRYPT
Message will be, or was Autocrypt encrypt+signed.
Definition: ncrypt.h:131
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
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:674
#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/ncrypt.h pgplib.h, smime.h
Definition: email.h:39
struct Body * pgp_gpgme_encrypt_message(struct Body *a, char *keylist, bool sign)
Implements CryptModuleSpecs::pgp_encrypt_message()
Definition: crypt_gpgme.c:1542
+ 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 357 of file cryptglue.c.

358 {
359  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_invoke_import))
360  CRYPT_MOD_CALL(PGP, pgp_invoke_import)(fname);
361 }
#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 366 of file cryptglue.c.

367 {
369  return CRYPT_MOD_CALL(PGP, verify_one)(sigbdy, s, tempf);
370 
371  return -1;
372 }
#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:2037
+ 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 377 of file cryptglue.c.

378 {
379  if (CRYPT_MOD_CALL_CHECK(PGP, send_menu))
380  return CRYPT_MOD_CALL(PGP, send_menu)(e);
381 
382  return 0;
383 }
#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_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 388 of file cryptglue.c.

389 {
390  if (CRYPT_MOD_CALL_CHECK(PGP, pgp_extract_key_from_attachment))
391  CRYPT_MOD_CALL(PGP, pgp_extract_key_from_attachment)(fp, top);
392 }
#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 397 of file cryptglue.c.

398 {
399  if (CRYPT_MOD_CALL_CHECK(PGP, set_sender))
400  CRYPT_MOD_CALL(PGP, set_sender)(sender);
401 }
#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_void_passphrase()

void crypt_smime_void_passphrase ( void  )

Wrapper for CryptModuleSpecs::void_passphrase()

Definition at line 406 of file cryptglue.c.

407 {
408  if (CRYPT_MOD_CALL_CHECK(SMIME, void_passphrase))
409  CRYPT_MOD_CALL(SMIME, void_passphrase)();
410 }
#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_valid_passphrase()

bool crypt_smime_valid_passphrase ( void  )

Wrapper for CryptModuleSpecs::valid_passphrase()

Definition at line 415 of file cryptglue.c.

416 {
417  if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
418  return CRYPT_MOD_CALL(SMIME, valid_passphrase)();
419 
420  return false;
421 }
#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_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 426 of file cryptglue.c.

427 {
428  if (CRYPT_MOD_CALL_CHECK(SMIME, decrypt_mime))
429  return CRYPT_MOD_CALL(SMIME, decrypt_mime)(fp_in, fp_out, b, cur);
430 
431  return -1;
432 }
#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_application_handler()

int crypt_smime_application_handler ( struct Body m,
struct State s 
)

Wrapper for CryptModuleSpecs::application_handler()

Implements handler_t

Definition at line 439 of file cryptglue.c.

440 {
441  if (CRYPT_MOD_CALL_CHECK(SMIME, application_handler))
442  return CRYPT_MOD_CALL(SMIME, application_handler)(m, s);
443 
444  return -1;
445 }
#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_getkeys()

void crypt_smime_getkeys ( struct Envelope env)

Wrapper for CryptModuleSpecs::smime_getkeys()

Definition at line 450 of file cryptglue.c.

451 {
452  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_getkeys))
453  CRYPT_MOD_CALL(SMIME, smime_getkeys)(env);
454 }
#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_sender()

int crypt_smime_verify_sender ( struct Mailbox m,
struct Email e 
)

Wrapper for CryptModuleSpecs::smime_verify_sender()

Definition at line 459 of file cryptglue.c.

460 {
461  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_verify_sender))
462  return CRYPT_MOD_CALL(SMIME, smime_verify_sender)(m, e);
463 
464  return 1;
465 }
#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 *  addrlist,
bool  oppenc_mode 
)

Wrapper for CryptModuleSpecs::find_keys()

Definition at line 470 of file cryptglue.c.

471 {
472  if (CRYPT_MOD_CALL_CHECK(SMIME, find_keys))
473  return CRYPT_MOD_CALL(SMIME, find_keys)(addrlist, oppenc_mode);
474 
475  return NULL;
476 }
#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:5156
#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_sign_message()

struct Body* crypt_smime_sign_message ( struct Body a)

Wrapper for CryptModuleSpecs::sign_message()

Definition at line 481 of file cryptglue.c.

482 {
484  return CRYPT_MOD_CALL(SMIME, sign_message)(a);
485 
486  return NULL;
487 }
static struct Body * sign_message(struct Body *a, bool use_smime)
Sign a message.
Definition: crypt_gpgme.c:1405
#define CRYPT_MOD_CALL(identifier, func)
Definition: cryptglue.c:88
#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_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 492 of file cryptglue.c.

493 {
494  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
495  return CRYPT_MOD_CALL(SMIME, smime_build_smime_entity)(a, certlist);
496 
497  return NULL;
498 }
#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_invoke_import()

void crypt_smime_invoke_import ( const char *  infile,
const char *  mailbox 
)

Wrapper for CryptModuleSpecs::smime_invoke_import()

Definition at line 503 of file cryptglue.c.

504 {
505  if (CRYPT_MOD_CALL_CHECK(SMIME, smime_invoke_import))
506  CRYPT_MOD_CALL(SMIME, smime_invoke_import)(infile, mailbox);
507 }
#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 512 of file cryptglue.c.

513 {
514  if (CRYPT_MOD_CALL_CHECK(SMIME, verify_one))
515  return CRYPT_MOD_CALL(SMIME, verify_one)(sigbdy, s, tempf);
516 
517  return -1;
518 }
#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:2037
+ 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 523 of file cryptglue.c.

524 {
525  if (CRYPT_MOD_CALL_CHECK(SMIME, send_menu))
526  return CRYPT_MOD_CALL(SMIME, send_menu)(e);
527 
528  return 0;
529 }
#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 534 of file cryptglue.c.

535 {
536  if (CRYPT_MOD_CALL_CHECK(SMIME, set_sender))
537  CRYPT_MOD_CALL(SMIME, set_sender)(sender);
538 }
#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:

Variable Documentation

◆ C_CryptUseGpgme

bool C_CryptUseGpgme

Config: Use GPGME crypto backend.

Definition at line 61 of file cryptglue.c.

◆ 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 41 of file crypt_mod_smime_classic.c.