95 {
N_(
"Exit"), OP_EXIT },
96 {
N_(
"Select"), OP_GENERIC_SELECT_ENTRY },
97 {
N_(
"Check key"), OP_VERIFY_KEY },
98 {
N_(
"Help"), OP_HELP },
111 struct PgpUid const *s = *(
struct PgpUid const *
const *) a;
112 struct PgpUid const *t = *(
struct PgpUid const *
const *) b;
113 const bool sort_reverse = *(
bool *) sdata;
122 return sort_reverse ? -rc : rc;
130 struct PgpUid const *s = *(
struct PgpUid const *
const *) a;
131 struct PgpUid const *t = *(
struct PgpUid const *
const *) b;
132 const bool sort_reverse = *(
bool *) sdata;
141 return sort_reverse ? -rc : rc;
149 struct PgpUid const *s = *(
struct PgpUid const *
const *) a;
150 struct PgpUid const *t = *(
struct PgpUid const *
const *) b;
151 const bool sort_reverse = *(
bool *) sdata;
160 return sort_reverse ? -rc : rc;
168 struct PgpUid const *s = *(
struct PgpUid const *
const *) a;
169 struct PgpUid const *t = *(
struct PgpUid const *
const *) b;
170 const bool sort_reverse = *(
bool *) sdata;
199 return sort_reverse ? -rc : rc;
274 char op,
const char *src,
const char *prec,
275 const char *if_str,
const char *else_str,
278 char fmt[128] = { 0 };
286 if (isupper((
unsigned char) op))
296 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
297 snprintf(buf, buflen, fmt, key->
algorithm);
303 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
314 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
315 snprintf(buf, buflen, fmt,
pgp_flags(kflags));
325 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
332 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
333 snprintf(buf, buflen, fmt, key->
keylen);
339 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
340 snprintf(buf, buflen, fmt, entry->
num);
346 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
349 else if (!(uid->
trust & 0x03))
358 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
359 snprintf(buf, buflen, fmt,
NONULL(uid->
addr));
365 bool use_c_locale =
false;
370 const char *cp = src;
378 while ((len > 0) && (*cp !=
']'))
413 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
414 snprintf(buf, buflen, fmt, buf2);
448 entry.
uid = key_table[line];
449 entry.
num = line + 1;
510 if (ev_w->
win != win_menu)
533 struct PgpUid **key_table = NULL;
534 struct Menu *menu = NULL;
535 char buf[1024] = { 0 };
537 bool unusable =
false;
550 for (a = kp->address; a; a = a->
next)
568 if ((i == 0) && unusable)
570 mutt_error(
_(
"All matching keys are expired, revoked, or disabled"));
604 menu->
mdata = key_table;
617 snprintf(buf,
sizeof(buf),
_(
"PGP keys matching \"%s\""), s);
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
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.
@ FR_UNKNOWN
Unknown function.
static char pgp_flags(KeyFlags flags)
Turn PGP key flags into a string.
static const struct Mapping PgpHelp[]
Help Bar for the PGP key selection dialog.
static const char TrustFlags[]
Characters used to show the trust level for PGP keys.
static char * pgp_key_abilities(KeyFlags flags)
Turn PGP key abilities into a string.
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
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 -.
struct PgpKeyInfo * dlg_pgp(struct PgpKeyInfo *keys, struct Address *p, const char *s)
Let the user select a key to use -.
#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 -.
static int pgp_sort_trust(const void *a, const void *b, void *sdata)
Compare two keys by their trust levels - Implements sort_t -.
static int pgp_sort_keyid(const void *a, const void *b, void *sdata)
Compare two keys by their IDs - Implements sort_t -.
static int pgp_sort_date(const void *a, const void *b, void *sdata)
Compare two keys by their dates - Implements sort_t -.
static int pgp_sort_address(const void *a, const void *b, void *sdata)
Compare two keys by their addresses - Implements sort_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.
#define GETCH_NO_FLAGS
No flags are set.
@ 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.
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
size_t mutt_date_localtime_format_locale(char *buf, size_t buflen, const char *format, time_t t, locale_t loc)
Format localtime using a given locale.
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_set_focus(struct MuttWindow *win)
Set the Window focus.
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_pgp()
@ 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.
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 mutt_qsort_r(void *base, size_t nmemb, size_t size, sort_t compar, void *sdata)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
int(* sort_t)(const void *a, const void *b, void *sdata)
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.
Assorted sorting methods.
#define mutt_numeric_cmp(a, b)
struct Buffer * mailbox
Mailbox and host address.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
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 ConfigSubset * sub
Inherited config items.
locale_t time_c_locale
Current locale but LC_TIME=C.
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.