98 {
N_(
"Exit"), OP_EXIT },
99 {
N_(
"Select"), OP_GENERIC_SELECT_ENTRY },
100 {
N_(
"Check key"), OP_VERIFY_KEY },
101 {
N_(
"Help"), OP_HELP },
113 const bool sort_reverse = *(
bool *) sdata;
122 return sort_reverse ? -rc : rc;
132 const bool sort_reverse = *(
bool *) sdata;
141 return sort_reverse ? -rc : rc;
151 const bool sort_reverse = *(
bool *) sdata;
153 unsigned long ts = 0;
154 unsigned long tt = 0;
157 if (s->
kobj->subkeys && (s->
kobj->subkeys->timestamp > 0))
158 ts = s->
kobj->subkeys->timestamp;
159 if (t->
kobj->subkeys && (t->
kobj->subkeys->timestamp > 0))
160 tt = t->
kobj->subkeys->timestamp;
177 return sort_reverse ? -rc : rc;
187 const bool sort_reverse = *(
bool *) sdata;
189 unsigned long ts = 0;
190 unsigned long tt = 0;
203 if (s->
kobj->subkeys)
204 ts = s->
kobj->subkeys->length;
205 if (t->
kobj->subkeys)
206 tt = t->
kobj->subkeys->length;
215 if (s->
kobj->subkeys && (s->
kobj->subkeys->timestamp > 0))
216 ts = s->
kobj->subkeys->timestamp;
217 if (t->
kobj->subkeys && (t->
kobj->subkeys->timestamp > 0))
218 tt = t->
kobj->subkeys->timestamp;
232 return sort_reverse ? -rc : rc;
294 return key->
kobj->subkeys->timestamp;
309 const char *text = node->
text;
310 bool use_c_locale =
false;
317 struct tm tm = { 0 };
318 if (key->
kobj->subkeys && (key->
kobj->subkeys->timestamp > 0))
327 char tmp[128] = { 0 };
334 strftime(tmp,
sizeof(tmp), text, &tm);
364 const char *s = gpgme_get_protocol_name(key->
kobj->protocol);
388 case GPGME_VALIDITY_FULL:
391 case GPGME_VALIDITY_MARGINAL:
394 case GPGME_VALIDITY_NEVER:
397 case GPGME_VALIDITY_ULTIMATE:
400 case GPGME_VALIDITY_UNDEFINED:
403 case GPGME_VALIDITY_UNKNOWN:
424 const char *s = key->
uid;
439 const char *s = NULL;
440 if (key->
kobj->subkeys)
441 s = gpgme_pubkey_algo_name(key->
kobj->subkeys->pubkey_algo);
522 return key->
kobj->subkeys ? key->
kobj->subkeys->length : 0;
538 entry.
key = key_table[line];
539 entry.
num = line + 1;
606 if (ev_w->
win != win_menu)
630 const char *s,
unsigned int app,
bool *forced_valid)
636 bool unusable =
false;
662 mutt_error(
_(
"All matching keys are marked expired/revoked"));
700 menu->
mdata = key_table;
710 const char *ts = NULL;
713 ts =
_(
"PGP and S/MIME keys matching");
715 ts =
_(
"PGP keys matching");
717 ts =
_(
"S/MIME keys matching");
719 ts =
_(
"keys matching");
721 char buf[1024] = { 0 };
732 snprintf(buf,
sizeof(buf),
_(
"%s \"%s\""), ts, s);
799 { -1, -1, NULL, NULL },
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
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.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
const char * crypt_fpr_or_lkeyid(struct CryptKeyInfo *k)
Find the fingerprint of a key.
const char * crypt_keyid(struct CryptKeyInfo *k)
Find the ID for the key.
Wrapper for PGP/SMIME calls to GPGME.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
@ FR_UNKNOWN
Unknown function.
static char * crypt_key_abilities(KeyFlags flags)
Parse key flags into a string.
const struct ExpandoRenderData PgpEntryGpgmeRenderData[]
Callbacks for GPGME Key Expandos.
static char * crypt_flags(KeyFlags flags)
Parse the key flags into a single character.
static const struct Mapping GpgmeHelp[]
Help Bar for the GPGME key selection dialog.
@ ED_PGP
Pgp ED_PGP_ ExpandoDataPgp.
@ ED_PGP_KEY
Pgp_Key ED_PGK_ ExpandoDataPgpKey.
int expando_filter(const struct Expando *exp, const struct ExpandoRenderData *rdata, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Render an Expando and run the result through a filter.
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 gpgme_function_dispatcher(struct MuttWindow *win, int op)
Perform a Gpgme function - Implements function_dispatcher_t -.
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - 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 -.
long pgp_entry_gpgme_date_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
GPGME: Date of the key - Implements ExpandoRenderData::get_number() -.
long pgp_entry_gpgme_n_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
GPGME: Index number - Implements ExpandoRenderData::get_number() -.
long pgp_entry_gpgme_l_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
GPGME: Key length - Implements ExpandoRenderData::get_number() -.
void pgp_entry_gpgme_k(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Key id - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_p(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Protocol - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_date(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Date of the key - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_t(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Trust/validity - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_i(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Key fingerprint - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_a(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Key Algorithm - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_u(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: User id - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_c(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Key Capabilities - Implements ExpandoRenderData::get_string() -.
void pgp_entry_gpgme_f(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
GPGME: Key Flags - Implements ExpandoRenderData::get_string() -.
struct CryptKeyInfo * dlg_gpgme(struct CryptKeyInfo *keys, struct Address *p, const char *s, unsigned int app, bool *forced_valid)
Get the user to select a key -.
#define mutt_debug(LEVEL,...)
static int gpgme_key_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
static int gpgme_key_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
static int crypt_sort_trust(const void *a, const void *b, void *sdata)
Compare two keys by their trust levels - Implements sort_t -.
static int crypt_sort_address(const void *a, const void *b, void *sdata)
Compare two keys by their addresses - Implements sort_t -.
static int crypt_sort_date(const void *a, const void *b, void *sdata)
Compare two keys by their dates - Implements sort_t -.
static int crypt_sort_keyid(const void *a, const void *b, void *sdata)
Compare two keys by their IDs - 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.
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
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_GPGME
GPGME Dialog, dlg_gpgme()
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
@ NT_WINDOW_DELETE
Window is about to be deleted.
#define KEYFLAG_EXPIRED
Key is expired.
#define KEYFLAG_ISX509
Key is an X.509 key.
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define KEYFLAG_RESTRICTIONS
#define KEYFLAG_CANENCRYPT
Key is suitable for encryption.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
#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.
@ ED_PGP_NUMBER
PgpEntry.num.
@ ED_PGP_USER_ID
PgpUid.addr.
@ ED_PGP_TRUST
PgpUid, TrustFlags.
@ 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.
Misc PGP helper routines.
@ ED_PGK_KEY_CAPABILITIES
PgpKeyInfo.flags, pgp_key_abilities()
@ ED_PGK_KEY_FINGERPRINT
PgpKeyInfo.fingerprint.
@ ED_PGK_PKEY_LENGTH
pgp_principal_key(), PgpKeyInfo.keylen
@ ED_PGK_PKEY_ALGORITHM
pgp_principal_key(), PgpKeyInfo.algorithm
@ ED_PGK_DATE
PgpKeyInfo.gen_time.
@ ED_PGK_PKEY_FINGERPRINT
pgp_principal_key(), PgpKeyInfo.fingerprint
@ ED_PGK_KEY_ID
PgpKeyInfo, pgp_this_keyid()
@ ED_PGK_PROTOCOL
PgpKeyInfo.
@ ED_PGK_PKEY_CAPABILITIES
pgp_principal_key(), PgpKeyInfo.flags, pgp_key_abilities()
@ ED_PGK_KEY_FLAGS
PgpKeyInfo.kflags, pgp_flags()
@ ED_PGK_PKEY_ID
pgp_principal_key(), PgpKeyInfo, pgp_this_keyid()
@ ED_PGK_KEY_ALGORITHM
PgpKeyInfo.algorithm.
@ ED_PGK_KEY_LENGTH
PgpKeyInfo.keylen.
@ ED_PGK_PKEY_FLAGS
pgp_principal_key(), PgpKeyInfo.kflags, pgp_flags()
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)
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
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.
String manipulation buffer.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
An entry in the Select-Key menu.
struct CryptKeyInfo * key
Key.
gpgme_validity_t validity
uid validity (cached for convenience)
KeyFlags flags
global and per uid flags (for convenience)
struct CryptKeyInfo * next
Linked list.
const char * uid
and for convenience point to this user ID
const char * name
Name of config item that changed.
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
const char * text
Node-specific text.
Data to pass to the Gpgme Functions.
bool * forced_valid
User insists on out-of-date key.
struct CryptKeyInfo * key
Selected Key.
struct CryptKeyInfo ** key_table
Array of Keys.
bool done
Should we close the Dialog?
struct Menu * menu
Gpgme Menu.
Mapping between user-readable string and a constant.
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()
MenuType
Types of GUI selections.
@ MENU_KEY_SELECT_PGP
Select a PGP key.
@ MENU_KEY_SELECT_SMIME
Select a SMIME key.
@ MENU_GENERIC
Generic selection list.