/**
* smime_get_candidates - Find keys matching a string
- * @param search String to match
- * @param public If true, only get the public keys
+ * @param search String to match
+ * @param only_public_key If true, only get the public keys
* @retval ptr Matching key
*/
-static struct SmimeKey *smime_get_candidates(char *search, bool public)
+static struct SmimeKey *smime_get_candidates(char *search, bool only_public_key)
{
char index_file[PATH_MAX];
char buf[1024];
struct SmimeKey **results_end = &results;
snprintf(index_file, sizeof(index_file), "%s/.index",
- public ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys));
+ only_public_key ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys));
FILE *fp = mutt_file_fopen(index_file, "r");
if (!fp)
/**
* smime_get_key_by_hash - Find a key by its hash
- * @param hash Hash to find
- * @param public If true, only get the public keys
+ * @param hash Hash to find
+ * @param only_public_key If true, only get the public keys
* @retval ptr Matching key
*
* Returns the first matching key record, without prompting or checking of
* abilities or trust.
*/
-static struct SmimeKey *smime_get_key_by_hash(char *hash, bool public)
+static struct SmimeKey *smime_get_key_by_hash(char *hash, bool only_public_key)
{
struct SmimeKey *match = NULL;
- struct SmimeKey *results = smime_get_candidates(hash, public);
+ struct SmimeKey *results = smime_get_candidates(hash, only_public_key);
for (struct SmimeKey *result = results; result; result = result->next)
{
if (mutt_str_strcasecmp(hash, result->hash) == 0)
/**
* smime_get_key_by_addr - Find an SIME key by address
- * @param mailbox Email address to match
- * @param abilities Abilities to match, see #KeyFlags
- * @param public If true, only get the public keys
- * @param may_ask If true, the user may be asked to select a key
+ * @param mailbox Email address to match
+ * @param abilities Abilities to match, see #KeyFlags
+ * @param only_public_key If true, only get the public keys
+ * @param may_ask If true, the user may be asked to select a key
* @retval ptr Matching key
*/
static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities,
- bool public, bool may_ask)
+ bool only_public_key, bool may_ask)
{
if (!mailbox)
return NULL;
struct SmimeKey *return_key = NULL;
bool multi_trusted_matches = false;
- results = smime_get_candidates(mailbox, public);
+ results = smime_get_candidates(mailbox, only_public_key);
for (result = results; result; result = result->next)
{
if (abilities && !(result->flags & abilities))
/**
* smime_get_key_by_str - Find an SMIME key by string
- * @param str String to match
- * @param abilities Abilities to match, see #KeyFlags
- * @param public If true, only get the public keys
+ * @param str String to match
+ * @param abilities Abilities to match, see #KeyFlags
+ * @param only_public_key If true, only get the public keys
* @retval ptr Matching key
*/
-static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool public)
+static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool only_public_key)
{
if (!str)
return NULL;
struct SmimeKey *match = NULL;
struct SmimeKey *return_key = NULL;
- results = smime_get_candidates(str, public);
+ results = smime_get_candidates(str, only_public_key);
for (result = results; result; result = result->next)
{
if (abilities && !(result->flags & abilities))
/**
* smime_ask_for_key - Ask the user to select a key
- * @param prompt Prompt to show the user
- * @param abilities Abilities to match, see #KeyFlags
- * @param public If true, only get the public keys
+ * @param prompt Prompt to show the user
+ * @param abilities Abilities to match, see #KeyFlags
+ * @param only_public_key If true, only get the public keys
* @retval ptr Selected SMIME key
*/
-static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool public)
+static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool only_public_key)
{
struct SmimeKey *key = NULL;
char resp[128];
if (mutt_get_field(prompt, resp, sizeof(resp), MUTT_CLEAR) != 0)
return NULL;
- key = smime_get_key_by_str(resp, abilities, public);
+ key = smime_get_key_by_str(resp, abilities, only_public_key);
if (key)
return key;