96 {
N_(
"Exit"), OP_EXIT },
97 {
N_(
"Select"), OP_GENERIC_SELECT_ENTRY },
98 {
N_(
"Check key"), OP_VERIFY_KEY },
99 {
N_(
"Help"), OP_HELP },
193 unsigned long ts = 0, tt = 0;
195 if ((*s)->kobj->subkeys && ((*s)->kobj->subkeys->timestamp > 0))
196 ts = (*s)->
kobj->subkeys->timestamp;
197 if ((*t)->kobj->subkeys && ((*t)->kobj->subkeys->timestamp > 0))
198 tt = (*t)->kobj->subkeys->timestamp;
238 unsigned long ts = 0, tt = 0;
250 if ((*s)->kobj->subkeys)
251 ts = (*s)->kobj->subkeys->length;
252 if ((*t)->kobj->subkeys)
253 tt = (*t)->kobj->subkeys->length;
257 if ((*s)->kobj->subkeys && ((*s)->kobj->subkeys->timestamp > 0))
258 ts = (*s)->kobj->subkeys->timestamp;
259 if ((*t)->kobj->subkeys && ((*t)->kobj->subkeys->timestamp > 0))
260 tt = (*t)->kobj->subkeys->timestamp;
364 char op,
const char *src,
const char *prec,
365 const char *if_str,
const char *else_str,
368 char fmt[128] = { 0 };
385 const char *s = NULL;
386 snprintf(fmt,
sizeof(fmt),
"%%%s.3s", prec);
387 if (key->
kobj->subkeys)
388 s = gpgme_pubkey_algo_name(key->
kobj->subkeys->pubkey_algo);
391 snprintf(buf, buflen, fmt, s);
398 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
408 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
420 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
430 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
438 snprintf(fmt,
sizeof(fmt),
"%%%slu", prec);
440 if (key->
kobj->subkeys)
441 val = key->
kobj->subkeys->length;
444 snprintf(buf, buflen, fmt, val);
451 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
452 snprintf(buf, buflen, fmt, entry->
num);
457 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
458 snprintf(buf, buflen, fmt, gpgme_get_protocol_name(key->
kobj->protocol));
472 case GPGME_VALIDITY_FULL:
475 case GPGME_VALIDITY_MARGINAL:
478 case GPGME_VALIDITY_NEVER:
481 case GPGME_VALIDITY_ULTIMATE:
484 case GPGME_VALIDITY_UNDEFINED:
487 case GPGME_VALIDITY_UNKNOWN:
493 snprintf(fmt,
sizeof(fmt),
"%%%sc", prec);
494 snprintf(buf, buflen, fmt, *s);
501 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
502 snprintf(buf, buflen, fmt, key->
uid);
509 bool do_locales =
true;
510 struct tm tm = { 0 };
514 const char *cp = src;
521 size_t len = buflen - 1;
522 while ((len > 0) && (*cp !=
']'))
547 if (key->
kobj->subkeys && (key->
kobj->subkeys->timestamp > 0))
553 setlocale(LC_TIME,
"C");
554 strftime(buf2,
sizeof(buf2), buf, &tm);
556 setlocale(LC_TIME,
"");
558 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
559 snprintf(buf, buflen, fmt, buf2);
594 entry.
key = key_table[line];
595 entry.
num = line + 1;
655 if (ev_w->
win != win_menu)
679 struct Address *p,
const char *s,
680 unsigned int app,
bool *forced_valid)
684 int (*f)(
const void *,
const void *);
686 bool unusable =
false;
712 mutt_error(
_(
"All matching keys are marked expired/revoked"));
745 menu->
mdata = key_table;
756 const char *ts = NULL;
759 ts =
_(
"PGP and S/MIME keys matching");
761 ts =
_(
"PGP keys matching");
763 ts =
_(
"S/MIME keys matching");
765 ts =
_(
"keys matching");
767 char buf[1024] = { 0 };
773 snprintf(buf,
sizeof(buf),
_(
"%s <%s>"), ts, p->
mailbox);
778 snprintf(buf,
sizeof(buf),
_(
"%s \"%s\""), ts, 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.
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.
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
@ FR_UNKNOWN
Unknown function.
static int crypt_compare_date_qsort(const void *a, const void *b)
Compare the dates of two keys.
static char crypt_flags(KeyFlags flags)
Parse the key flags into a single character.
static char * crypt_key_abilities(KeyFlags flags)
Parse key flags into a string.
static int crypt_compare_key_trust(const void *a, const void *b)
Compare the trust of keys for sorting.
static int crypt_compare_key_date(const void *a, const void *b)
Compare Key creation dates and addresses for sorting.
static int crypt_compare_key_address(const void *a, const void *b)
Compare Key addresses and IDs for sorting.
static int crypt_compare_keyid(const void *a, const void *b)
Compare Key IDs and addresses for sorting.
struct CryptKeyInfo * dlg_select_gpgme_key(struct CryptKeyInfo *keys, struct Address *p, const char *s, unsigned int app, bool *forced_valid)
Get the user to select a key.
static int crypt_compare_keyid_qsort(const void *a, const void *b)
Compare the IDs of two keys.
static int crypt_compare_address_qsort(const void *a, const void *b)
Compare the addresses of two keys.
static int crypt_compare_trust_qsort(const void *a, const void *b)
Compare the trust levels of two keys.
static const struct Mapping GpgmeHelp[]
Help Bar for the GPGME key selection dialog.
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 -.
static const char * crypt_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 a string for the 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 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 -.
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_CRYPT_GPGME
Crypt-GPGME Dialog, dlg_select_gpgme_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.
#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_ABILITIES
#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.
@ 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.
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.
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.
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.
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()
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
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.