96 {
N_(
"Exit"), OP_EXIT },
97 {
N_(
"Select"), OP_GENERIC_SELECT_ENTRY },
98 {
N_(
"Check key"), OP_VERIFY_KEY },
99 {
N_(
"Help"), OP_HELP },
125 struct PgpUid const *
const *s = (
struct PgpUid const *
const *) a;
126 struct PgpUid const *
const *t = (
struct PgpUid const *
const *) b;
160 struct PgpUid const *
const *s = (
struct PgpUid const *
const *) a;
161 struct PgpUid const *
const *t = (
struct PgpUid const *
const *) b;
163 int r = ((*s)->parent->gen_time - (*t)->parent->gen_time);
194 struct PgpUid const *
const *s = (
struct PgpUid const *
const *) a;
195 struct PgpUid const *
const *t = (
struct PgpUid const *
const *) b;
231 struct PgpUid const *
const *s = (
struct PgpUid const *
const *) a;
232 struct PgpUid const *
const *t = (
struct PgpUid const *
const *) b;
238 r = ((*s)->trust - (*t)->trust);
241 r = ((*s)->parent->keylen - (*t)->parent->keylen);
244 r = ((*s)->parent->gen_time - (*t)->parent->gen_time);
340 char op,
const char *src,
const char *prec,
341 const char *if_str,
const char *else_str,
344 char fmt[128] = { 0 };
352 if (isupper((
unsigned char) op))
362 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
363 snprintf(buf, buflen, fmt, key->
algorithm);
369 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
378 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
379 snprintf(buf, buflen, fmt,
pgp_flags(kflags));
387 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
394 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
395 snprintf(buf, buflen, fmt, key->
keylen);
401 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
402 snprintf(buf, buflen, fmt, entry->
num);
408 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
411 else if (!(uid->
trust & 0x03))
420 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
421 snprintf(buf, buflen, fmt,
NONULL(uid->
addr));
428 bool do_locales =
true;
433 const char *cp = src;
441 while ((len > 0) && (*cp !=
']'))
467 setlocale(LC_TIME,
"C");
470 setlocale(LC_TIME,
"");
472 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
473 snprintf(buf, buflen, fmt, buf2);
507 entry.
uid = key_table[line];
508 entry.
num = line + 1;
569 if (ev_w->
win != win_menu)
589 struct Address *p,
const char *s)
591 struct PgpUid **key_table = NULL;
592 struct Menu *menu = NULL;
593 char buf[1024] = { 0 };
595 bool unusable =
false;
608 for (a = kp->address; a; a = a->
next)
626 if ((i == 0) && unusable)
628 mutt_error(
_(
"All matching keys are expired, revoked, or disabled"));
632 int (*f)(
const void *,
const void *);
650 qsort(key_table, i,
sizeof(
struct PgpUid *), f);
657 menu->
mdata = key_table;
668 snprintf(buf,
sizeof(buf),
_(
"PGP keys matching <%s>"), p->
mailbox);
670 snprintf(buf,
sizeof(buf),
_(
"PGP keys matching \"%s\""), s);
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
@ FR_UNKNOWN
Unknown function.
static int pgp_compare_address_qsort(const void *a, const void *b)
Compare the addresses of two PGP keys.
static int pgp_compare_key_date(const void *a, const void *b)
Compare Key dates for sorting.
static int pgp_compare_keyid_qsort(const void *a, const void *b)
Compare key IDs.
static int pgp_compare_date_qsort(const void *a, const void *b)
Compare the dates of two PGP keys.
static const char trust_flags[]
struct PgpKeyInfo * dlg_select_pgp_key(struct PgpKeyInfo *keys, struct Address *p, const char *s)
Let the user select a key to use.
static int pgp_compare_keyid(const void *a, const void *b)
Compare Key IDs and addresses for sorting.
static int pgp_compare_key_trust(const void *a, const void *b)
Compare the trust of keys for sorting.
static char pgp_flags(KeyFlags flags)
Turn PGP key flags into a string.
static int pgp_compare_trust_qsort(const void *a, const void *b)
Compare the trust levels of two PGP keys.
static const struct Mapping PgpHelp[]
Help Bar for the PGP key selection dialog.
static char * pgp_key_abilities(KeyFlags flags)
Turn PGP key abilities into a string.
static int pgp_compare_key_address(const void *a, const void *b)
Compare Key addresses and IDs for sorting.
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
int pgp_function_dispatcher(struct MuttWindow *win, int op)
Perform a Pgp function - Implements function_dispatcher_t -.
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
static const char * pgp_entry_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format an entry on the PGP key selection menu - Implements format_t -.
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
#define mutt_debug(LEVEL,...)
static int pgp_key_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
static int pgp_key_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Convenience wrapper for the gui headers.
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
int km_dokey(enum MenuType mtype)
Determine what a keypress should do.
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Convenience wrapper for the library headers.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
int mutt_istr_cmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
@ WT_DLG_PGP
Pgp Dialog, dlg_select_pgp_key()
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
@ NT_WINDOW_DELETE
Window is about to be deleted.
Some miscellaneous functions.
#define KEYFLAG_EXPIRED
Key is expired.
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
#define KEYFLAG_RESTRICTIONS
#define KEYFLAG_ABILITIES
#define KEYFLAG_CANENCRYPT
Key is suitable for encryption.
#define KEYFLAG_PREFER_SIGNING
Key's owner prefers signing.
#define KEYFLAG_CRITICAL
Key is marked critical.
#define KEYFLAG_DISABLED
Key is marked disabled.
#define KEYFLAG_REVOKED
Key is revoked.
#define KEYFLAG_PREFER_ENCRYPTION
Key's owner prefers encryption.
#define KEYFLAG_CANSIGN
Key is suitable for signing.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
const char * opcodes_get_name(int op)
Get the name of an opcode.
All user-callable functions.
char * pgp_this_keyid(struct PgpKeyInfo *k)
Get the ID of this key.
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
PGP sign, encrypt, check routines.
struct PgpKeyInfo * pgp_principal_key(struct PgpKeyInfo *key)
Get the main (parent) PGP key.
PGP key management routines.
Misc PGP helper routines.
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
#define SORT_MASK
Mask for the sort id.
@ SORT_TRUST
Sort by encryption key's trust level.
@ SORT_KEYID
Sort by the encryption key's ID.
@ SORT_DATE
Sort by the date the email was sent.
@ SORT_ADDRESS
Sort by email address.
#define SORT_REVERSE
Reverse the order of the sort.
char * mailbox
Mailbox and host address.
const char * name
Name of config item that changed.
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
Mapping between user-readable string and a constant.
struct WindowState state
Current state of the Window.
void * wdata
Private data.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Container for Accounts, Notifications.
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
Data passed to a notification function.
void * event_data
Data from notify_send()
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
void * global_data
Data from notify_observer_add()
Data to pass to the Pgp Functions.
struct PgpUid ** key_table
Array of Keys.
struct Menu * menu
Pgp Menu.
bool done
Should we close the Dialog?
struct PgpKeyInfo * key
Selected Key.
An entry in a PGP key menu.
Information about a PGP key.
struct PgpKeyInfo * parent
Parent key.
struct PgpUid * next
Linked list.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_PGP
PGP encryption menu.