1447{
1449 struct ListNode *crypt_hook = NULL;
1450 const char *keyid = NULL;
1451 char *keylist = NULL;
1452 size_t keylist_size = 0;
1453 size_t keylist_used = 0;
1457 char buf[1024] = { 0 };
1458 bool key_selected;
1460
1463 {
1464 key_selected = false;
1467 do
1468 {
1469 p = a;
1470 k_info = NULL;
1471
1472 if (crypt_hook)
1473 {
1474 keyid = crypt_hook->
data;
1477 if (!oppenc_mode && c_crypt_confirm_hook)
1478 {
1479 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid, p->
mailbox);
1481 }
1483 {
1485 {
1487 keyid += 2;
1488 goto bypass_selection;
1489 }
1490
1491
1494 {
1497 }
1498 else if (!oppenc_mode)
1499 {
1501 }
1502 }
1504 {
1505 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1506 {
1508 continue;
1509 }
1510 }
1512 {
1516 return NULL;
1517 }
1518 }
1519
1520 if (!k_info)
1521 {
1524 }
1525
1526 if (!k_info && !oppenc_mode)
1527 {
1528 snprintf(buf,
sizeof(buf),
_(
"Enter keyID for %s: "), p->
mailbox);
1530 }
1531
1532 if (!k_info)
1533 {
1537 return NULL;
1538 }
1539
1541
1542 bypass_selection:
1545 sprintf(keylist + keylist_used, "%s0x%s", keylist_used ? " " : "", keyid);
1547
1548 key_selected = true;
1549
1552
1553 if (crypt_hook)
1555
1556 } while (crypt_hook);
1557
1559 }
1560 return keylist;
1561}
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.
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, 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.
char * mailbox
Mailbox and host address.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Information about a PGP key.