* the only operation needed.
*/
if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
- handler = crypt_pgp_application_pgp_handler;
+ handler = crypt_pgp_application_handler;
else if (ReflowText &&
(mutt_str_strcasecmp("flowed",
mutt_param_get(&b->parameter, "format")) == 0))
plaintext = true;
}
else if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
- handler = crypt_pgp_application_pgp_handler;
+ handler = crypt_pgp_application_handler;
else if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(b))
- handler = crypt_smime_application_smime_handler;
+ handler = crypt_smime_application_handler;
}
/* only respect disposition == attachment if we're not
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
- *keylist = crypt_pgp_findkeys(addrlist, oppenc_mode);
+ *keylist = crypt_pgp_find_keys(addrlist, oppenc_mode);
if (!*keylist)
{
mutt_addr_free(&addrlist);
}
if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
- *keylist = crypt_smime_findkeys(addrlist, oppenc_mode);
+ *keylist = crypt_smime_find_keys(addrlist, oppenc_mode);
if (!*keylist)
{
mutt_addr_free(&addrlist);
}
/**
- * pgp_gpgme_findkeys - Implements CryptModuleSpecs::findkeys()
+ * pgp_gpgme_find_keys - Implements CryptModuleSpecs::find_keys()
*/
-char *pgp_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode)
+char *pgp_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode)
{
return find_keys(addrlist, APPLICATION_PGP, oppenc_mode);
}
/**
- * smime_gpgme_findkeys - Implements CryptModuleSpecs::findkeys()
+ * smime_gpgme_find_keys - Implements CryptModuleSpecs::find_keys()
*/
-char *smime_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode)
+char *smime_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode)
{
return find_keys(addrlist, APPLICATION_SMIME, oppenc_mode);
}
-#ifdef HAVE_GPGME_OP_EXPORT_KEYS
+/**
+ * pgp_gpgme_make_key_attachment - Implements CryptModuleSpecs::pgp_make_key_attachment()
+ */
struct Body *pgp_gpgme_make_key_attachment(char *tempf)
{
+#ifdef HAVE_GPGME_OP_EXPORT_KEYS
gpgme_ctx_t context = NULL;
gpgme_key_t export_keys[2];
gpgme_data_t keydata = NULL;
gpgme_release(context);
return att;
-}
+#else
+ return NULL;
#endif
+}
/**
* init_common - Initialise code common to PGP and SMIME parts of GPGME
}
/**
- * mutt_gpgme_set_sender - Implements CryptModuleSpecs::set_sender()
+ * pgp_gpgme_set_sender - Implements CryptModuleSpecs::set_sender()
*/
-void mutt_gpgme_set_sender(const char *sender)
+void pgp_gpgme_set_sender(const char *sender)
{
mutt_debug(2, "setting to: %s\n", sender);
FREE(¤t_sender);
struct Header;
struct State;
-void mutt_gpgme_set_sender(const char *sender);
+void pgp_gpgme_set_sender(const char *sender);
int pgp_gpgme_application_handler(struct Body *m, struct State *s);
int pgp_gpgme_check_traditional(FILE *fp, struct Body *b, int just_one);
int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s);
struct Body *pgp_gpgme_encrypt_message(struct Body *a, char *keylist, int sign);
-char * pgp_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode);
+char * pgp_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
void pgp_gpgme_init(void);
void pgp_gpgme_invoke_import(const char *fname);
struct Body *pgp_gpgme_make_key_attachment(char *tempf);
int smime_gpgme_application_handler(struct Body *a, struct State *s);
struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist);
int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
-char * smime_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode);
+char * smime_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
void smime_gpgme_init(void);
int smime_gpgme_send_menu(struct Header *msg);
struct Body *smime_gpgme_sign_message(struct Body *a);
*/
int (*encrypted_handler)(struct Body *m, struct State *s);
/**
- * findkeys - Find the keyids of the recipients of a message
+ * find_keys - Find the keyids of the recipients of a message
* @param addrlist Address List
* @param oppenc_mode If true, use opportunistic encryption
* @retval ptr Space-separated string of keys
* If oppenc_mode is true, only keys that can be determined without prompting
* will be used.
*/
- char * (*findkeys)(struct Address *addrlist, bool oppenc_mode);
+ char * (*find_keys)(struct Address *addrlist, bool oppenc_mode);
/**
* sign_message - Cryptographically sign the Body of a message
* @param a Body of the message
APPLICATION_PGP,
NULL, /* init */
- pgp_void_passphrase,
- pgp_valid_passphrase,
- pgp_decrypt_mime,
- pgp_application_pgp_handler,
- pgp_encrypted_handler,
- pgp_find_keys,
- pgp_sign_message,
- pgp_verify_one,
- pgp_send_menu,
+ pgp_class_void_passphrase,
+ pgp_class_valid_passphrase,
+ pgp_class_decrypt_mime,
+ pgp_class_application_handler,
+ pgp_class_encrypted_handler,
+ pgp_class_find_keys,
+ pgp_class_sign_message,
+ pgp_class_verify_one,
+ pgp_class_send_menu,
NULL, /* set_sender */
- pgp_encrypt_message,
- pgp_make_key_attachment,
- pgp_check_traditional,
- pgp_traditional_encryptsign,
- pgp_invoke_getkeys,
- pgp_invoke_import,
- pgp_extract_keys_from_attachment_list,
+ pgp_class_encrypt_message,
+ pgp_class_make_key_attachment,
+ pgp_class_check_traditional,
+ pgp_class_traditional_encryptsign,
+ pgp_class_invoke_getkeys,
+ pgp_class_invoke_import,
+ pgp_class_extract_keys_from_attachment_list,
NULL, /* smime_getkeys */
NULL, /* smime_verify_sender */
#include "ncrypt.h"
/**
- * crypt_mod_pgp_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
+ * pgp_gpgme_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
*
* This is handled by gpg-agent.
*/
-static void crypt_mod_pgp_void_passphrase(void)
+static void pgp_gpgme_void_passphrase(void)
{
}
/**
- * crypt_mod_pgp_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
+ * pgp_gpgme_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
*
* This is handled by gpg-agent.
*/
-static int crypt_mod_pgp_valid_passphrase(void)
+static int pgp_gpgme_valid_passphrase(void)
{
return 1;
}
-/**
- * crypt_mod_pgp_make_key_attachment - Implements CryptModuleSpecs::pgp_make_key_attachment()
- */
-static struct Body *crypt_mod_pgp_make_key_attachment(char *tempf)
-{
-#ifdef HAVE_GPGME_OP_EXPORT_KEYS
- return pgp_gpgme_make_key_attachment(tempf);
-#else
- return NULL;
-#endif
-}
-
// clang-format off
struct CryptModuleSpecs crypt_mod_pgp_gpgme = {
APPLICATION_PGP,
pgp_gpgme_init,
- crypt_mod_pgp_void_passphrase,
- crypt_mod_pgp_valid_passphrase,
+ pgp_gpgme_void_passphrase,
+ pgp_gpgme_valid_passphrase,
pgp_gpgme_decrypt_mime,
pgp_gpgme_application_handler,
pgp_gpgme_encrypted_handler,
- pgp_gpgme_findkeys,
+ pgp_gpgme_find_keys,
pgp_gpgme_sign_message,
pgp_gpgme_verify_one,
pgp_gpgme_send_menu,
- mutt_gpgme_set_sender,
+ pgp_gpgme_set_sender,
pgp_gpgme_encrypt_message,
- crypt_mod_pgp_make_key_attachment,
+ pgp_gpgme_make_key_attachment,
pgp_gpgme_check_traditional,
NULL, /* pgp_traditional_encryptsign */
NULL, /* pgp_invoke_getkeys */
APPLICATION_SMIME,
NULL, /* init */
- smime_void_passphrase,
- smime_valid_passphrase,
- smime_decrypt_mime,
- smime_application_smime_handler,
+ smime_class_void_passphrase,
+ smime_class_valid_passphrase,
+ smime_class_decrypt_mime,
+ smime_class_application_handler,
NULL, /* encrypted_handler */
- smime_find_keys,
- smime_sign_message,
- smime_verify_one,
- smime_send_menu,
+ smime_class_find_keys,
+ smime_class_sign_message,
+ smime_class_verify_one,
+ smime_class_send_menu,
NULL, /* set_sender */
NULL, /* pgp_encrypt_message */
NULL, /* pgp_invoke_import */
NULL, /* pgp_extract_keys_from_attachment_list */
- smime_getkeys,
- smime_verify_sender,
- smime_build_smime_entity,
- smime_invoke_import,
+ smime_class_getkeys,
+ smime_class_verify_sender,
+ smime_class_build_smime_entity,
+ smime_class_invoke_import,
};
// clang-format on
#include "ncrypt.h"
/**
- * crypt_mod_smime_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
+ * smime_gpgme_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
*
* This is handled by gpg-agent.
*/
-static void crypt_mod_smime_void_passphrase(void)
+static void smime_gpgme_void_passphrase(void)
{
}
/**
- * crypt_mod_smime_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
+ * smime_gpgme_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
*
* This is handled by gpg-agent.
*/
-static int crypt_mod_smime_valid_passphrase(void)
+static int smime_gpgme_valid_passphrase(void)
{
return 1;
}
APPLICATION_SMIME,
smime_gpgme_init,
- crypt_mod_smime_void_passphrase,
- crypt_mod_smime_valid_passphrase,
+ smime_gpgme_void_passphrase,
+ smime_gpgme_valid_passphrase,
smime_gpgme_decrypt_mime,
smime_gpgme_application_handler,
NULL, /* encrypted_handler */
- smime_gpgme_findkeys,
+ smime_gpgme_find_keys,
smime_gpgme_sign_message,
smime_gpgme_verify_one,
smime_gpgme_send_menu,
struct Header;
struct State;
-/*
-
- Generic
-
-*/
-
#ifdef CRYPT_BACKEND_CLASSIC_PGP
extern struct CryptModuleSpecs crypt_mod_pgp_classic;
#endif
}
/**
- * crypt_pgp_application_pgp_handler - MIME handler for the pgp content-type
+ * crypt_pgp_application_handler - MIME handler for the pgp content-type
*/
-int crypt_pgp_application_pgp_handler(struct Body *m, struct State *s)
+int crypt_pgp_application_handler(struct Body *m, struct State *s)
{
if (CRYPT_MOD_CALL_CHECK(PGP, application_handler))
return (CRYPT_MOD_CALL(PGP, application_handler))(m, s);
}
/**
- * crypt_pgp_findkeys - Find the keyids of the recipients of the message
+ * crypt_pgp_find_keys - Find the keyids of the recipients of the 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_pgp_findkeys(struct Address *addrlist, bool oppenc_mode)
+char *crypt_pgp_find_keys(struct Address *addrlist, bool oppenc_mode)
{
- if (CRYPT_MOD_CALL_CHECK(PGP, findkeys))
- return (CRYPT_MOD_CALL(PGP, findkeys))(addrlist, oppenc_mode);
+ if (CRYPT_MOD_CALL_CHECK(PGP, find_keys))
+ return (CRYPT_MOD_CALL(PGP, find_keys))(addrlist, oppenc_mode);
return NULL;
}
}
/**
- * crypt_smime_application_smime_handler - Handler for application/smime
+ * crypt_smime_application_handler - Handler for application/smime
*/
-int crypt_smime_application_smime_handler(struct Body *m, struct State *s)
+int crypt_smime_application_handler(struct Body *m, struct State *s)
{
if (CRYPT_MOD_CALL_CHECK(SMIME, application_handler))
return (CRYPT_MOD_CALL(SMIME, application_handler))(m, s);
}
/**
- * crypt_smime_findkeys - Find the keyids of the recipients of the message
+ * crypt_smime_find_keys - Find the keyids of the recipients of the 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 *addrlist, bool oppenc_mode)
+char *crypt_smime_find_keys(struct Address *addrlist, bool oppenc_mode)
{
- if (CRYPT_MOD_CALL_CHECK(SMIME, findkeys))
- return (CRYPT_MOD_CALL(SMIME, findkeys))(addrlist, oppenc_mode);
+ if (CRYPT_MOD_CALL_CHECK(SMIME, find_keys))
+ return (CRYPT_MOD_CALL(SMIME, find_keys))(addrlist, oppenc_mode);
return NULL;
}
struct State;
struct Body *crypt_pgp_encrypt_message(struct Body *a, char *keylist, int sign);
-char * crypt_pgp_findkeys(struct Address *addrlist, bool oppenc_mode);
+char * crypt_pgp_find_keys(struct Address *addrlist, bool oppenc_mode);
void crypt_pgp_invoke_import(const char *fname);
void crypt_pgp_set_sender(const char *sender);
struct Body *crypt_pgp_sign_message(struct Body *a);
void crypt_pgp_void_passphrase(void);
struct Body *crypt_smime_build_smime_entity(struct Body *a, char *certlist);
-char * crypt_smime_findkeys(struct Address *addrlist, bool oppenc_mode);
+char * crypt_smime_find_keys(struct Address *addrlist, bool oppenc_mode);
void crypt_smime_invoke_import(char *infile, char *mailbox);
void crypt_smime_set_sender(const char *sender);
struct Body *crypt_smime_sign_message(struct Body *a);
int crypt_has_module_backend(int type);
void crypt_init(void);
void crypt_invoke_message(int type);
-int crypt_pgp_application_pgp_handler(struct Body *m, struct State *s);
+int crypt_pgp_application_handler(struct Body *m, struct State *s);
int crypt_pgp_check_traditional(FILE *fp, struct Body *b, int just_one);
int crypt_pgp_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d);
int crypt_pgp_encrypted_handler(struct Body *a, struct State *s);
void crypt_pgp_invoke_getkeys(struct Address *addr);
struct Body *crypt_pgp_make_key_attachment(char *tempf);
int crypt_pgp_send_menu(struct Header *msg);
-int crypt_smime_application_smime_handler(struct Body *m, struct State *s);
+int crypt_smime_application_handler(struct Body *m, struct State *s);
int crypt_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d);
void crypt_smime_getkeys(struct Envelope *env);
int crypt_smime_send_menu(struct Header *msg);
time_t PgpExptime = 0; /* when does the cached passphrase expire? */
/**
- * pgp_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
+ * pgp_class_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
*/
-void pgp_void_passphrase(void)
+void pgp_class_void_passphrase(void)
{
memset(PgpPass, 0, sizeof(PgpPass));
PgpExptime = 0;
}
/**
- * pgp_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
+ * pgp_class_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
*/
-int pgp_valid_passphrase(void)
+int pgp_class_valid_passphrase(void)
{
time_t now = time(NULL);
return 1;
}
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
if (mutt_get_password(_("Enter PGP passphrase:"), PgpPass, sizeof(PgpPass)) == 0)
{
}
/**
- * pgp_application_pgp_handler - Implements CryptModuleSpecs::application_handler()
+ * pgp_class_application_handler - Implements CryptModuleSpecs::application_handler()
*/
-int pgp_application_pgp_handler(struct Body *m, struct State *s)
+int pgp_class_application_handler(struct Body *m, struct State *s)
{
bool could_not_decrypt = false;
int needpass = -1;
{
if (needpass)
{
- if (!pgp_valid_passphrase())
- pgp_void_passphrase();
+ if (!pgp_class_valid_passphrase())
+ pgp_class_void_passphrase();
if (pgp_use_gpg_agent())
*PgpPass = 0;
fprintf(pgpin, "%s\n", PgpPass);
if (!clearsign && (!pgpout || c == EOF))
{
could_not_decrypt = true;
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
}
if (could_not_decrypt && !(s->flags & MUTT_DISPLAY))
}
/**
- * pgp_check_traditional - Implements CryptModuleSpecs::pgp_check_traditional()
+ * pgp_class_check_traditional - Implements CryptModuleSpecs::pgp_check_traditional()
*/
-int pgp_check_traditional(FILE *fp, struct Body *b, int just_one)
+int pgp_class_check_traditional(FILE *fp, struct Body *b, int just_one)
{
int rc = 0;
int r;
for (; b; b = b->next)
{
if (!just_one && is_multipart(b))
- rc = pgp_check_traditional(fp, b->parts, 0) || rc;
+ rc = pgp_class_check_traditional(fp, b->parts, 0) || rc;
else if (b->type == TYPETEXT)
{
r = mutt_is_application_pgp(b);
}
/**
- * pgp_verify_one - Implements CryptModuleSpecs::verify_one()
+ * pgp_class_verify_one - Implements CryptModuleSpecs::verify_one()
*/
-int pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
+int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
{
char sigfile[PATH_MAX], pgperrfile[PATH_MAX];
FILE *pgpout = NULL, *pgperr = NULL;
mutt_file_fclose(&tempfp);
- pgp_invoke_import(tempfname);
+ pgp_class_invoke_import(tempfname);
mutt_any_key_to_continue(NULL);
mutt_file_unlink(tempfname);
}
/**
- * pgp_extract_keys_from_attachment_list - Implements CryptModuleSpecs::pgp_extract_keys_from_attachment_list()
+ * pgp_class_extract_keys_from_attachment_list - Implements CryptModuleSpecs::pgp_extract_keys_from_attachment_list()
*/
-void pgp_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top)
+void pgp_class_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top)
{
if (!fp)
{
if (pgp_check_decryption_okay(pgperr) < 0)
{
mutt_error(_("Decryption failed"));
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
mutt_file_fclose(&pgperr);
return NULL;
}
if (fgetc(fpout) == EOF)
{
mutt_error(_("Decryption failed"));
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
return NULL;
}
}
/**
- * pgp_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
+ * pgp_class_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
*/
-int pgp_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
{
char tempfile[PATH_MAX];
struct State s;
}
/**
- * pgp_encrypted_handler - Implements CryptModuleSpecs::encrypted_handler()
+ * pgp_class_encrypted_handler - Implements CryptModuleSpecs::encrypted_handler()
*/
-int pgp_encrypted_handler(struct Body *a, struct State *s)
+int pgp_class_encrypted_handler(struct Body *a, struct State *s)
{
char tempfile[PATH_MAX];
FILE *fpin = NULL;
{
mutt_error(_("Could not decrypt PGP message"));
/* void the passphrase, even if it's not necessarily the problem */
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
rc = -1;
}
*/
/**
- * pgp_sign_message - Implements CryptModuleSpecs::sign_message()
+ * pgp_class_sign_message - Implements CryptModuleSpecs::sign_message()
*/
-struct Body *pgp_sign_message(struct Body *a)
+struct Body *pgp_class_sign_message(struct Body *a)
{
struct Body *t = NULL;
char buffer[LONG_STRING];
{
unlink(sigfile);
/* most likely error is a bad passphrase, so automatically forget it */
- pgp_void_passphrase();
+ pgp_class_void_passphrase();
return NULL; /* fatal error while signing */
}
}
/**
- * pgp_find_keys - Implements CryptModuleSpecs::findkeys()
+ * pgp_class_find_keys - Implements CryptModuleSpecs::find_keys()
*/
-char *pgp_find_keys(struct Address *addrlist, bool oppenc_mode)
+char *pgp_class_find_keys(struct Address *addrlist, bool oppenc_mode)
{
struct ListHead crypt_hook_list = STAILQ_HEAD_INITIALIZER(crypt_hook_list);
struct ListNode *crypt_hook = NULL;
if (!k_info)
{
- pgp_invoke_getkeys(q);
+ pgp_class_invoke_getkeys(q);
k_info = pgp_getkeybyaddr(q, KEYFLAG_CANENCRYPT, PGP_PUBRING, oppenc_mode);
}
}
/**
- * pgp_encrypt_message - Implements CryptModuleSpecs::pgp_encrypt_message()
+ * pgp_class_encrypt_message - Implements CryptModuleSpecs::pgp_encrypt_message()
*
* @warning "a" is no longer freed in this routine, you need to free it later.
* This is necessary for $fcc_attach.
*/
-struct Body *pgp_encrypt_message(struct Body *a, char *keylist, int sign)
+struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, int sign)
{
char buf[LONG_STRING];
char tempfile[PATH_MAX], pgperrfile[PATH_MAX];
{
/* fatal error while trying to encrypt message */
if (sign)
- pgp_void_passphrase(); /* just in case */
+ pgp_class_void_passphrase(); /* just in case */
unlink(tempfile);
return NULL;
}
}
/**
- * pgp_traditional_encryptsign - Implements CryptModuleSpecs::pgp_traditional_encryptsign()
+ * pgp_class_traditional_encryptsign - Implements CryptModuleSpecs::pgp_traditional_encryptsign()
*/
-struct Body *pgp_traditional_encryptsign(struct Body *a, int flags, char *keylist)
+struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char *keylist)
{
struct Body *b = NULL;
if (empty)
{
if (flags & SIGN)
- pgp_void_passphrase(); /* just in case */
+ pgp_class_void_passphrase(); /* just in case */
unlink(pgpoutfile);
return NULL;
}
}
/**
- * pgp_send_menu - Implements CryptModuleSpecs::send_menu()
+ * pgp_class_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int pgp_send_menu(struct Header *msg)
+int pgp_class_send_menu(struct Header *msg)
{
struct PgpKeyInfo *p = NULL;
char *prompt = NULL, *letters = NULL, *choices = NULL;
bool pgp_use_gpg_agent(void);
-int pgp_check_traditional(FILE *fp, struct Body *b, int just_one);
+int pgp_class_check_traditional(FILE *fp, struct Body *b, int just_one);
char *pgp_this_keyid(struct PgpKeyInfo *k);
char *pgp_keyid(struct PgpKeyInfo *k);
char *pgp_long_keyid(struct PgpKeyInfo * k);
char *pgp_fpr_or_lkeyid(struct PgpKeyInfo * k);
-int pgp_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
-char *pgp_find_keys(struct Address *addrlist, bool oppenc_mode);
+char *pgp_class_find_keys(struct Address *addrlist, bool oppenc_mode);
-int pgp_application_pgp_handler(struct Body *m, struct State *s);
-int pgp_encrypted_handler(struct Body *a, struct State *s);
-void pgp_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top);
-void pgp_void_passphrase(void);
-int pgp_valid_passphrase(void);
+int pgp_class_application_handler(struct Body *m, struct State *s);
+int pgp_class_encrypted_handler(struct Body *a, struct State *s);
+void pgp_class_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top);
+void pgp_class_void_passphrase(void);
+int pgp_class_valid_passphrase(void);
-int pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
-struct Body *pgp_traditional_encryptsign(struct Body *a, int flags, char *keylist);
-struct Body *pgp_encrypt_message(struct Body *a, char *keylist, int sign);
-struct Body *pgp_sign_message(struct Body *a);
+int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
+struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char *keylist);
+struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, int sign);
+struct Body *pgp_class_sign_message(struct Body *a);
-int pgp_send_menu(struct Header *msg);
+int pgp_class_send_menu(struct Header *msg);
#endif /* CRYPT_BACKEND_CLASSIC_PGP */
}
/**
- * pgp_invoke_import - Implements CryptModuleSpecs::pgp_invoke_import()
+ * pgp_class_invoke_import - Implements CryptModuleSpecs::pgp_invoke_import()
*/
-void pgp_invoke_import(const char *fname)
+void pgp_class_invoke_import(const char *fname)
{
char tmp_fname[PATH_MAX + SHORT_STRING];
char cmd[HUGE_STRING];
}
/**
- * pgp_invoke_getkeys - Implements CryptModuleSpecs::pgp_invoke_getkeys()
+ * pgp_class_invoke_getkeys - Implements CryptModuleSpecs::pgp_invoke_getkeys()
*/
-void pgp_invoke_getkeys(struct Address *addr)
+void pgp_class_invoke_getkeys(struct Address *addr)
{
char buf[PATH_MAX];
char tmp[LONG_STRING];
/* The PGP invocation interface */
-void pgp_invoke_import(const char *fname);
-void pgp_invoke_getkeys(struct Address *addr);
+void pgp_class_invoke_import(const char *fname);
+void pgp_class_invoke_getkeys(struct Address *addr);
pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, short need_passphrase);
pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname);
}
/**
- * pgp_make_key_attachment - Implements CryptModuleSpecs::pgp_make_key_attachment()
+ * pgp_class_make_key_attachment - Implements CryptModuleSpecs::pgp_make_key_attachment()
*/
-struct Body *pgp_make_key_attachment(char *tempf)
+struct Body *pgp_class_make_key_attachment(char *tempf)
{
struct Body *att = NULL;
char buf[LONG_STRING];
PGP_SECRING, /**< Secret keys */
};
-struct Body *pgp_make_key_attachment(char *tempf);
+struct Body *pgp_class_make_key_attachment(char *tempf);
struct PgpKeyInfo *pgp_ask_for_key(char *tag, char *whatfor, short abilities, enum PgpRing keyring);
struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, short abilities, enum PgpRing keyring, bool oppenc_mode);
*/
/**
- * smime_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
+ * smime_class_void_passphrase - Implements CryptModuleSpecs::void_passphrase()
*/
-void smime_void_passphrase(void)
+void smime_class_void_passphrase(void)
{
memset(SmimePass, 0, sizeof(SmimePass));
SmimeExptime = 0;
}
/**
- * smime_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
+ * smime_class_valid_passphrase - Implements CryptModuleSpecs::valid_passphrase()
*/
-int smime_valid_passphrase(void)
+int smime_class_valid_passphrase(void)
{
time_t now = time(NULL);
return 1;
}
- smime_void_passphrase();
+ smime_class_void_passphrase();
if (mutt_get_password(_("Enter S/MIME passphrase:"), SmimePass, sizeof(SmimePass)) == 0)
{
return;
}
else
- smime_void_passphrase();
+ smime_class_void_passphrase();
snprintf(SmimeKeyToUse, sizeof(SmimeKeyToUse), "%s/%s", NONULL(SmimeKeys), k);
snprintf(SmimeCertToUse, sizeof(SmimeCertToUse), "%s/%s", NONULL(SmimeCertificates), k);
if (mutt_str_strcasecmp(k, SmimeDefaultKey) != 0)
- smime_void_passphrase();
+ smime_class_void_passphrase();
smime_free_key(&key);
return;
return;
}
- smime_void_passphrase();
+ smime_class_void_passphrase();
}
snprintf(SmimeKeyToUse, sizeof(SmimeKeyToUse), "%s/%s", NONULL(SmimeKeys),
}
/**
- * smime_getkeys - Implements CryptModuleSpecs::smime_getkeys()
+ * smime_class_getkeys - Implements CryptModuleSpecs::smime_getkeys()
*/
-void smime_getkeys(struct Envelope *env)
+void smime_class_getkeys(struct Envelope *env)
{
struct Address *t = NULL;
bool found = false;
}
/**
- * smime_find_keys - Implements CryptModuleSpecs::findkeys()
+ * smime_class_find_keys - Implements CryptModuleSpecs::find_keys()
*/
-char *smime_find_keys(struct Address *addrlist, bool oppenc_mode)
+char *smime_class_find_keys(struct Address *addrlist, bool oppenc_mode)
{
struct SmimeKey *key = NULL;
char *keyID = NULL, *keylist = NULL;
}
/**
- * smime_invoke_import - Implements CryptModuleSpecs::smime_invoke_import()
+ * smime_class_invoke_import - Implements CryptModuleSpecs::smime_invoke_import()
*/
-void smime_invoke_import(char *infile, char *mailbox)
+void smime_class_invoke_import(char *infile, char *mailbox)
{
char tmpfname[PATH_MAX], *certfile = NULL, buf[STRING];
FILE *smimein = NULL;
}
/**
- * smime_verify_sender - Implements CryptModuleSpecs::smime_verify_sender()
+ * smime_class_verify_sender - Implements CryptModuleSpecs::smime_verify_sender()
*/
-int smime_verify_sender(struct Header *h)
+int smime_class_verify_sender(struct Header *h)
{
char *mbox = NULL, *certfile = NULL, tempfname[PATH_MAX];
int retval = 1;
}
/**
- * smime_build_smime_entity - Implements CryptModuleSpecs::smime_build_smime_entity()
+ * smime_class_build_smime_entity - Implements CryptModuleSpecs::smime_build_smime_entity()
*/
-struct Body *smime_build_smime_entity(struct Body *a, char *certlist)
+struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist)
{
char buf[LONG_STRING], certfile[PATH_MAX];
char tempfile[PATH_MAX], smimeerrfile[PATH_MAX];
}
/**
- * smime_sign_message - Implements CryptModuleSpecs::sign_message()
+ * smime_class_sign_message - Implements CryptModuleSpecs::sign_message()
*/
-struct Body *smime_sign_message(struct Body *a)
+struct Body *smime_class_sign_message(struct Body *a)
{
char buffer[LONG_STRING];
char signedfile[PATH_MAX], filetosign[PATH_MAX];
}
/**
- * smime_verify_one - Implements CryptModuleSpecs::verify_one()
+ * smime_class_verify_one - Implements CryptModuleSpecs::verify_one()
*/
-int smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
+int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
{
char signedfile[PATH_MAX], smimeerrfile[PATH_MAX];
FILE *smimeout = NULL;
if (type & ENCRYPT)
{
- if (!smime_valid_passphrase())
- smime_void_passphrase();
+ if (!smime_class_valid_passphrase())
+ smime_class_void_passphrase();
fputs(SmimePass, smimein);
fputc('\n', smimein);
}
}
/**
- * smime_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
+ * smime_class_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
*/
-int smime_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
{
char tempfile[PATH_MAX];
struct State s;
}
/**
- * smime_application_smime_handler - Implements CryptModuleSpecs::application_handler()
+ * smime_class_application_handler - Implements CryptModuleSpecs::application_handler()
*/
-int smime_application_smime_handler(struct Body *m, struct State *s)
+int smime_class_application_handler(struct Body *m, struct State *s)
{
return smime_handle_entity(m, s, NULL) ? 0 : -1;
}
/**
- * smime_send_menu - Implements CryptModuleSpecs::send_menu()
+ * smime_class_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int smime_send_menu(struct Header *msg)
+int smime_class_send_menu(struct Header *msg)
{
struct SmimeKey *key = NULL;
char *prompt = NULL, *letters = NULL, *choices = NULL;
struct SmimeKey *next;
};
-int smime_application_smime_handler(struct Body *m, struct State *s);
-struct Body *smime_build_smime_entity(struct Body *a, char *certlist);
-int smime_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
-char * smime_find_keys(struct Address *addrlist, bool oppenc_mode);
-void smime_getkeys(struct Envelope *env);
-void smime_invoke_import(char *infile, char *mailbox);
-int smime_send_menu(struct Header *msg);
-struct Body *smime_sign_message(struct Body *a);
-int smime_valid_passphrase(void);
-int smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
-int smime_verify_sender(struct Header *h);
-void smime_void_passphrase(void);
+int smime_class_application_handler(struct Body *m, struct State *s);
+struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist);
+int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+char * smime_class_find_keys(struct Address *addrlist, bool oppenc_mode);
+void smime_class_getkeys(struct Envelope *env);
+void smime_class_invoke_import(char *infile, char *mailbox);
+int smime_class_send_menu(struct Header *msg);
+struct Body *smime_class_sign_message(struct Body *a);
+int smime_class_valid_passphrase(void);
+int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
+int smime_class_verify_sender(struct Header *h);
+void smime_class_void_passphrase(void);
#endif