1469{
1471 struct ListNode *crypt_hook = NULL;
1472 const char *keyid = NULL;
1473 char *keylist = NULL;
1474 size_t keylist_size = 0;
1475 size_t keylist_used = 0;
1479 char buf[1024] = { 0 };
1480 bool key_selected;
1482
1486 {
1487 key_selected = false;
1490 do
1491 {
1492 p = a;
1493 k_info = NULL;
1494
1495 if (crypt_hook)
1496 {
1497 keyid = crypt_hook->
data;
1499 if (!oppenc_mode && c_crypt_confirm_hook)
1500 {
1501 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid,
1504 }
1506 {
1508 {
1510 keyid += 2;
1511 goto bypass_selection;
1512 }
1513
1514
1517 {
1520 }
1521 else if (!oppenc_mode)
1522 {
1524 }
1525 }
1527 {
1528 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1529 {
1531 continue;
1532 }
1533 }
1535 {
1539 return NULL;
1540 }
1541 }
1542
1543 if (!k_info)
1544 {
1547 }
1548
1549 if (!k_info && !oppenc_mode)
1550 {
1553 }
1554
1555 if (!k_info)
1556 {
1560 return NULL;
1561 }
1562
1564
1565 bypass_selection:
1568 sprintf(keylist + keylist_used, "%s0x%s", keylist_used ? " " : "", keyid);
1570
1571 key_selected = true;
1572
1575
1576 if (crypt_hook)
1578
1579 } while (crypt_hook);
1580
1582 }
1583 return keylist;
1584}
void mutt_addrlist_qualify(struct AddressList *al, const char *host)
Expand local names in an Address list using a hostname.
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
bool crypt_is_numerical_keyid(const char *s)
Is this a numerical keyid.
void pgp_class_invoke_getkeys(struct Address *addr)
Implements CryptModuleSpecs::pgp_invoke_getkeys() -.
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
#define KEYFLAG_CANENCRYPT
Key is suitable for encryption.
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
struct PgpKeyInfo * pgp_ask_for_key(char *tag, const char *whatfor, KeyFlags abilities, enum PgpRing keyring)
Ask the user for a PGP key.
struct PgpKeyInfo * pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, enum PgpRing keyring, bool oppenc_mode)
Find a PGP key by address.
struct PgpKeyInfo * pgp_getkeybystr(const char *cp, KeyFlags abilities, enum PgpRing keyring)
Find a PGP key by string.
@ PGP_PUBRING
Public keys.
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
QuadOption
Possible values for a quad-option.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
#define TAILQ_FOREACH(var, head, field)
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FIRST(head)
#define TAILQ_FIRST(head)
#define TAILQ_HEAD_INITIALIZER(head)
#define STAILQ_NEXT(elm, field)
const char * mutt_fqdn(bool may_hide_host, const struct ConfigSubset *sub)
Get the Fully-Qualified Domain Name.
struct Buffer * mailbox
Mailbox and host address.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Information about a PGP key.