示例#1
0
文件: cryptglue.c 项目: 0xAX/muttx
/* This routine attempts to find the keyids of the recipients of a
   message.  It returns NULL if any of the keys can not be found.
   If oppenc_mode is true, only keys that can be determined without
   prompting will be used.  */
char *crypt_smime_findkeys(struct address *adrlist, int oppenc_mode)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, findkeys))
		return (CRYPT_MOD_CALL(SMIME, findkeys))(adrlist, oppenc_mode);

	return NULL;
}
示例#2
0
文件: cryptglue.c 项目: 0xAX/muttx
/* fixme: Needs documentation. */
struct body *crypt_smime_sign_message(struct body *a)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, sign_message))
		return (CRYPT_MOD_CALL(SMIME, sign_message))(a);

	return NULL;
}
示例#3
0
文件: cryptglue.c 项目: 0xAX/muttx
/* MIME handler for the application/smime content-type. */
int crypt_smime_application_smime_handler(struct body *m, STATE *s)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, application_handler))
		return (CRYPT_MOD_CALL(SMIME, application_handler))(m, s);

	return -1;
}
示例#4
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Check that the sender matches. */
int crypt_smime_verify_sender(struct header *h)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, smime_verify_sender))
		return (CRYPT_MOD_CALL(SMIME, smime_verify_sender))(h);

	return 1;
}
示例#5
0
文件: cryptglue.c 项目: 0xAX/muttx
int crypt_smime_valid_passphrase(void)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, valid_passphrase))
		return (CRYPT_MOD_CALL(SMIME, valid_passphrase))();

	return 0;
}
示例#6
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Decrypt am S/MIME message. */
int crypt_smime_decrypt_mime(FILE *a, FILE **b, struct body *c, struct body **d)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, decrypt_mime))
		return (CRYPT_MOD_CALL(SMIME, decrypt_mime))(a, b, c, d);

	return -1;
}
示例#7
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Warning: A is no longer freed in this routine, you need to free it
   later.  This is necessary for $fcc_attach. */
struct body *crypt_pgp_encrypt_message(struct body *a, char *keylist, int sign)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, pgp_encrypt_message))
		return (CRYPT_MOD_CALL(PGP, pgp_encrypt_message))(a, keylist, sign);

	return NULL;
}
示例#8
0
文件: cryptglue.c 项目: 0xAX/muttx
int crypt_smime_send_menu(struct header *msg, int *redraw)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, send_menu))
		return (CRYPT_MOD_CALL(SMIME, send_menu))(msg, redraw);

	return 0;
}
示例#9
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Generate a PGP public key attachment. */
struct body *crypt_pgp_make_key_attachment(char *tempf)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, pgp_make_key_attachment))
		return (CRYPT_MOD_CALL(PGP, pgp_make_key_attachment))(tempf);

	return NULL;
}
示例#10
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Create a new body with a PGP signed message from A. */
struct body *crypt_pgp_sign_message(struct body *a)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, sign_message))
		return (CRYPT_MOD_CALL(PGP, sign_message))(a);

	return NULL;
}
示例#11
0
文件: cryptglue.c 项目: 0xAX/muttx
/* fixme: needs documentation. */
struct body *crypt_pgp_traditional_encryptsign(struct body *a, int flags, char *keylist)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, pgp_traditional_encryptsign))
		return (CRYPT_MOD_CALL(PGP, pgp_traditional_encryptsign))(a, flags, keylist);

	return NULL;
}
示例#12
0
文件: cryptglue.c 项目: 0xAX/muttx
/* Check for a traditional PGP message in body B. */
int crypt_pgp_check_traditional(FILE *fp, struct body *b, int tagged_only)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, pgp_check_traditional))
		return (CRYPT_MOD_CALL(PGP, pgp_check_traditional))(fp, b, tagged_only);

	return 0;
}
示例#13
0
文件: cryptglue.c 项目: 0xAX/muttx
/* MIME handler for an PGP/MIME encrypted message. */
int crypt_pgp_encrypted_handler(struct body *a, STATE *s)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, encrypted_handler))
		return (CRYPT_MOD_CALL(PGP, encrypted_handler))(a, s);

	return -1;
}
示例#14
0
文件: cryptglue.c 项目: 0xAX/muttx
/* MIME handler for the application/pgp content-type. */
int crypt_pgp_application_pgp_handler(struct body *m, STATE *s)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, application_handler))
		return (CRYPT_MOD_CALL(PGP, application_handler))(m, s);

	return -1;
}
示例#15
0
文件: cryptglue.c 项目: 0xAX/muttx
int crypt_pgp_send_menu(struct header *msg, int *redraw)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, send_menu))
		return (CRYPT_MOD_CALL(PGP, send_menu))(msg, redraw);

	return 0;
}
示例#16
0
文件: cryptglue.c 项目: 0xAX/muttx
/* fixme: needs documentation */
int crypt_smime_verify_one(struct body *sigbdy, STATE *s, const char *tempf)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, verify_one))
		return (CRYPT_MOD_CALL(SMIME, verify_one))(sigbdy, s, tempf);

	return -1;
}
示例#17
0
文件: cryptglue.c 项目: 0xAX/muttx
/* fixme: needs documentation. */
struct body *crypt_smime_build_smime_entity(struct body *a, char *certlist)
{
	if (CRYPT_MOD_CALL_CHECK(SMIME, smime_build_smime_entity))
		return (CRYPT_MOD_CALL(SMIME, smime_build_smime_entity))(a, certlist);

	return NULL;
}
示例#18
0
文件: cryptglue.c 项目: 0xAX/muttx
int crypt_pgp_valid_passphrase(void)
{
	if (CRYPT_MOD_CALL_CHECK(PGP, valid_passphrase))
		return (CRYPT_MOD_CALL(PGP, valid_passphrase))();

	return 0;
}
示例#19
0
/**
 * crypt_init - Initialise the crypto backends
 *
 * This calls CryptModuleSpecs::init()
 */
void crypt_init(void)
{
#ifdef CRYPT_BACKEND_CLASSIC_PGP
  if (
#ifdef CRYPT_BACKEND_GPGME
      (!C_CryptUseGpgme)
#else
      1
#endif
  )
    crypto_module_register(&CryptModPgpClassic);
#endif

#ifdef CRYPT_BACKEND_CLASSIC_SMIME
  if (
#ifdef CRYPT_BACKEND_GPGME
      (!C_CryptUseGpgme)
#else
      1
#endif
  )
    crypto_module_register(&CryptModSmimeClassic);
#endif

  if (C_CryptUseGpgme)
  {
#ifdef CRYPT_BACKEND_GPGME
    crypto_module_register(&CryptModPgpGpgme);
    crypto_module_register(&CryptModSmimeGpgme);
#else
    mutt_message(_("\"crypt_use_gpgme\" set"
                   " but not built with GPGME support"));
    if (mutt_any_key_to_continue(NULL) == -1)
      mutt_exit(1);
#endif
  }

#if defined(CRYPT_BACKEND_CLASSIC_PGP) ||                                      \
    defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
  if (CRYPT_MOD_CALL_CHECK(PGP, init))
    CRYPT_MOD_CALL(PGP, init)();

  if (CRYPT_MOD_CALL_CHECK(SMIME, init))
    CRYPT_MOD_CALL(SMIME, init)();
#endif
}
示例#20
0
void crypt_init (void)
{
#ifdef CRYPT_BACKEND_CLASSIC_PGP
  if (
#ifdef CRYPT_BACKEND_GPGME
      (! option (OPTCRYPTUSEGPGME))
#else
       1
#endif
      )
    crypto_module_register (&crypt_mod_pgp_classic);
#endif

#ifdef CRYPT_BACKEND_CLASSIC_SMIME
  if (
#ifdef CRYPT_BACKEND_GPGME
      (! option (OPTCRYPTUSEGPGME))
#else
       1
#endif
      )
    crypto_module_register (&crypt_mod_smime_classic);
#endif

  if (option (OPTCRYPTUSEGPGME))
    {
#ifdef CRYPT_BACKEND_GPGME
      crypto_module_register (&crypt_mod_pgp_gpgme);
      crypto_module_register (&crypt_mod_smime_gpgme);
#else
      mutt_message (_("\"crypt_use_gpgme\" set"
                      " but not built with GPGME support."));
      if (mutt_any_key_to_continue (NULL) == -1)
	mutt_exit(1);
#endif
    }

#if defined CRYPT_BACKEND_CLASSIC_PGP || defined CRYPT_BACKEND_CLASSIC_SMIME || defined CRYPT_BACKEND_GPGME
  if (CRYPT_MOD_CALL_CHECK (PGP, init))
    (CRYPT_MOD_CALL (PGP, init)) ();

  if (CRYPT_MOD_CALL_CHECK (SMIME, init))
    (CRYPT_MOD_CALL (SMIME, init)) ();
#endif
}
示例#21
0
文件: cryptglue.c 项目: 0xAX/muttx
void crypt_init(void)
{
	int ret;

	ret = register_gpgme();

	if (!ret)
	{
		register_pgp_classic();
		register_smime_classic();
	}

#ifdef HAS_ONE_CRYPTO_BACKEND
	if (CRYPT_MOD_CALL_CHECK(PGP, init))
		(CRYPT_MOD_CALL(PGP, init))();

	if (CRYPT_MOD_CALL_CHECK(SMIME, init))
		(CRYPT_MOD_CALL(SMIME, init))();
#endif
}
示例#22
0
void crypt_smime_set_sender (const char *sender)
{
  if (CRYPT_MOD_CALL_CHECK (SMIME, set_sender))
    (CRYPT_MOD_CALL (SMIME, set_sender)) (sender);
}
示例#23
0
/* Add a certificate and update index file (externally). */
void crypt_smime_invoke_import (char *infile, char *mailbox)
{
  if (CRYPT_MOD_CALL_CHECK (SMIME, smime_invoke_import))
    (CRYPT_MOD_CALL (SMIME, smime_invoke_import)) (infile, mailbox);
}
示例#24
0
/* fixme: Needs documentation. */
void crypt_smime_getkeys (ENVELOPE *env)
{
  if (CRYPT_MOD_CALL_CHECK (SMIME, smime_getkeys))
    (CRYPT_MOD_CALL (SMIME, smime_getkeys)) (env);
}
示例#25
0
/* MIME handler for an PGP/MIME encrypted message. */
void crypt_smime_encrypted_handler (BODY *a, STATE *s)
{
  if (CRYPT_MOD_CALL_CHECK (SMIME, encrypted_handler))
    (CRYPT_MOD_CALL (SMIME, encrypted_handler)) (a, s);
}
示例#26
0
/* Reset an SMIME passphrase */
void crypt_smime_void_passphrase (void)
{
  if (CRYPT_MOD_CALL_CHECK (SMIME, void_passphrase))
    (CRYPT_MOD_CALL (SMIME, void_passphrase)) ();
}
示例#27
0
void crypt_pgp_set_sender (const char *sender)
{
  if (CRYPT_MOD_CALL_CHECK (PGP, set_sender))
    (CRYPT_MOD_CALL (PGP, set_sender)) (sender);
}
示例#28
0
/* fixme: needs documentation */
void crypt_pgp_extract_keys_from_attachment_list (FILE *fp, int tag, BODY *top)
{
  if (CRYPT_MOD_CALL_CHECK (PGP, pgp_extract_keys_from_attachment_list))
    (CRYPT_MOD_CALL (PGP, pgp_extract_keys_from_attachment_list)) (fp, tag, top);
}
示例#29
0
/* Invoke the PGP command to import a key. */
void crypt_pgp_invoke_import (const char *fname)
{
  if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_import))
    (CRYPT_MOD_CALL (PGP, pgp_invoke_import)) (fname);
}
示例#30
0
/* fixme: needs documentation. */
void crypt_pgp_invoke_getkeys (ADDRESS *addr)
{
  if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_getkeys))
    (CRYPT_MOD_CALL (PGP, pgp_invoke_getkeys)) (addr);
}