NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
private.h File Reference
#include "config.h"
#include <stdbool.h>
+ Include dependency graph for private.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct SmimeKeydlg_select_smime_key (struct SmimeKey *keys, char *query)
 Get the user to select a key. More...
 
struct PgpKeyInfodlg_select_pgp_key (struct PgpKeyInfo *keys, struct Address *p, const char *s)
 Let the user select a key to use. More...
 
struct CryptKeyInfodlg_select_gpgme_key (struct CryptKeyInfo *keys, struct Address *p, const char *s, unsigned int app, int *forced_valid)
 Get the user to select a key. More...
 

Variables

bool C_CryptUsePka
 Config: Use GPGME to use PKA (lookup PGP keys using DNS) More...
 
bool C_CryptConfirmHook
 Config: Prompt the user to confirm keys before use. More...
 
bool C_CryptOpportunisticEncryptStrongKeys
 Config: Enable encryption only when strong a key is available. More...
 
bool C_CryptProtectedHeadersWrite
 Config: Generate protected header (Memory Hole) for signed and encrypted emails. More...
 
bool C_PgpIgnoreSubkeys
 Config: Only use the principal PGP key. More...
 
bool C_PgpLongIds
 Config: Display long PGP key IDs to the user. More...
 
bool C_PgpShowUnusable
 Config: Show non-usable keys in the key selection. More...
 
bool C_PgpAutoInline
 Config: Use old-style inline PGP messages (not recommended) More...
 
char * C_PgpDefaultKey
 Config: Default key to use for PGP operations. More...
 
char * C_PgpEntryFormat
 Config: printf-like format string for the PGP key selection menu. More...
 
char * C_SmimeDefaultKey
 Config: Default key for SMIME operations. More...
 
char * C_CryptProtectedHeadersSubject
 Config: Use this as the subject for encrypted emails. More...
 
struct AddressC_EnvelopeFromAddress
 Config: Manually set the sender for outgoing messages. More...
 
bool C_CryptTimestamp
 Config: Add a timestamp to PGP or SMIME output to prevent spoofing. More...
 
unsigned char C_PgpEncryptSelf
 
unsigned char C_PgpMimeAuto
 Config: Prompt the user to use MIME if inline PGP fails. More...
 
bool C_PgpRetainableSigs
 Config: Create nested multipart/signed or encrypted messages. More...
 
bool C_PgpSelfEncrypt
 Config: Encrypted messages will also be encrypted to $pgp_default_key too. More...
 
bool C_PgpStrictEnc
 Config: Encode PGP signed messages with quoted-printable (don't unset) More...
 
unsigned char C_SmimeEncryptSelf
 
bool C_SmimeSelfEncrypt
 Config: Encrypted messages will also be encrypt to $smime_default_key too. More...
 
bool C_CryptUseGpgme
 Config: Use GPGME crypto backend. More...
 
bool C_PgpCheckExit
 Config: Check the exit code of PGP subprocess. More...
 
bool C_PgpCheckGpgDecryptStatusFd
 Config: File descriptor used for status info. More...
 
struct RegexC_PgpDecryptionOkay
 Config: Text indicating a successful decryption. More...
 
struct RegexC_PgpGoodSign
 Config: Text indicating a good signature. More...
 
long C_PgpTimeout
 Config: Time in seconds to cache a passphrase. More...
 
bool C_PgpUseGpgAgent
 Config: Use a PGP agent for caching passwords. More...
 
char * C_PgpClearSignCommand
 Config: (pgp) External command to inline-sign a message. More...
 
char * C_PgpDecodeCommand
 Config: (pgp) External command to decode a PGP attachment. More...
 
char * C_PgpDecryptCommand
 Config: (pgp) External command to decrypt a PGP message. More...
 
char * C_PgpEncryptOnlyCommand
 Config: (pgp) External command to encrypt, but not sign a message. More...
 
char * C_PgpEncryptSignCommand
 Config: (pgp) External command to encrypt and sign a message. More...
 
char * C_PgpExportCommand
 Config: (pgp) External command to export a public key from the user's keyring. More...
 
char * C_PgpGetKeysCommand
 Config: (pgp) External command to download a key for an email address. More...
 
char * C_PgpImportCommand
 Config: (pgp) External command to import a key into the user's keyring. More...
 
char * C_PgpListPubringCommand
 Config: (pgp) External command to list the public keys in a user's keyring. More...
 
char * C_PgpListSecringCommand
 Config: (pgp) External command to list the private keys in a user's keyring. More...
 
char * C_PgpSignCommand
 Config: (pgp) External command to create a detached PGP signature. More...
 
char * C_PgpVerifyCommand
 Config: (pgp) External command to verify PGP signatures. More...
 
char * C_PgpVerifyKeyCommand
 Config: (pgp) External command to verify key information. More...
 
short C_PgpSortKeys
 Config: Sort order for PGP keys. More...
 
bool C_SmimeAskCertLabel
 Config: Prompt the user for a label for SMIME certificates. More...
 
char * C_SmimeCaLocation
 Config: File containing trusted certificates. More...
 
char * C_SmimeCertificates
 Config: File containing user's public certificates. More...
 
char * C_SmimeDecryptCommand
 Config: (smime) External command to decrypt an SMIME message. More...
 
bool C_SmimeDecryptUseDefaultKey
 Config: Use the default key for decryption. More...
 
char * C_SmimeEncryptCommand
 Config: (smime) External command to encrypt a message. More...
 
char * C_SmimeGetCertCommand
 Config: (smime) External command to extract a certificate from a message. More...
 
char * C_SmimeGetCertEmailCommand
 Config: (smime) External command to get a certificate for an email. More...
 
char * C_SmimeGetSignerCertCommand
 Config: (smime) External command to extract a certificate from an email. More...
 
char * C_SmimeImportCertCommand
 Config: (smime) External command to import a certificate. More...
 
char * C_SmimeKeys
 Config: File containing user's private certificates. More...
 
char * C_SmimePk7outCommand
 Config: (smime) External command to extract a public certificate. More...
 
char * C_SmimeSignCommand
 Config: (smime) External command to sign a message. More...
 
char * C_SmimeSignDigestAlg
 Config: Digest algorithm. More...
 
long C_SmimeTimeout
 Config: Time in seconds to cache a passphrase. More...
 
char * C_SmimeVerifyCommand
 Config: (smime) External command to verify a signed message. More...
 
char * C_SmimeVerifyOpaqueCommand
 Config: (smime) External command to verify a signature. More...
 

Detailed Description

Shared constants/structs that are private to libconn

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file private.h.

Function Documentation

◆ dlg_select_smime_key()

struct SmimeKey* dlg_select_smime_key ( struct SmimeKey keys,
char *  query 
)

Get the user to select a key.

Parameters
keysList of keys to select from
queryString to match
Return values
ptrKey selected by user

Definition at line 157 of file dlgsmime.c.

158 {
159  struct SmimeKey **table = NULL;
160  int table_size = 0;
161  int table_index = 0;
162  struct SmimeKey *key = NULL;
163  struct SmimeKey *selected_key = NULL;
164  char buf[1024];
165  char title[256];
166  struct Menu *menu = NULL;
167  const char *s = "";
168  bool done = false;
169 
170  for (table_index = 0, key = keys; key; key = key->next)
171  {
172  if (table_index == table_size)
173  {
174  table_size += 5;
175  mutt_mem_realloc(&table, sizeof(struct SmimeKey *) * table_size);
176  }
177 
178  table[table_index++] = key;
179  }
180 
181  snprintf(title, sizeof(title), _("S/MIME certificates matching \"%s\""), query);
182 
183  menu = mutt_menu_new(MENU_SMIME);
185  dlg->help_data = SmimeHelp;
186  dlg->help_menu = MENU_SMIME;
187 
188  menu->max = table_index;
190  menu->mdata = table;
191  menu->title = title;
193  /* sorting keys might be done later - TODO */
194 
196 
197  done = false;
198  while (!done)
199  {
200  switch (mutt_menu_loop(menu))
201  {
202  case OP_GENERIC_SELECT_ENTRY:
203  if (table[menu->current]->trust != 't')
204  {
205  switch (table[menu->current]->trust)
206  {
207  case 'e':
208  case 'i':
209  case 'r':
210  s = _("ID is expired/disabled/revoked. Do you really want to use "
211  "the key?");
212  break;
213  case 'u':
214  s = _("ID has undefined validity. Do you really want to use the "
215  "key?");
216  break;
217  case 'v':
218  s = _("ID is not trusted. Do you really want to use the key?");
219  break;
220  }
221 
222  snprintf(buf, sizeof(buf), "%s", s);
223 
224  if (mutt_yesorno(buf, MUTT_NO) != MUTT_YES)
225  {
227  break;
228  }
229  }
230 
231  selected_key = table[menu->current];
232  done = true;
233  break;
234  case OP_EXIT:
235  done = true;
236  break;
237  }
238  }
239 
240  mutt_menu_pop_current(menu);
241  mutt_menu_free(&menu);
243  FREE(&table);
244 
245  return selected_key;
246 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlg_select_pgp_key()

struct PgpKeyInfo* dlg_select_pgp_key ( struct PgpKeyInfo keys,
struct Address p,
const char *  s 
)

Let the user select a key to use.

Parameters
keysList of PGP keys
pAddress to match
sString to match
Return values
ptrSelected PGP key

Definition at line 469 of file dlgpgp.c.

471 {
472  struct PgpUid **key_table = NULL;
473  struct Menu *menu = NULL;
474  int i;
475  bool done = false;
476  char buf[1024], tmpbuf[256];
477  struct PgpKeyInfo *kp = NULL;
478  struct PgpUid *a = NULL;
479  struct Buffer *tempfile = NULL;
480 
481  bool unusable = false;
482 
483  int keymax = 0;
484 
485  for (i = 0, kp = keys; kp; kp = kp->next)
486  {
487  if (!C_PgpShowUnusable && (kp->flags & KEYFLAG_CANTUSE))
488  {
489  unusable = true;
490  continue;
491  }
492 
493  for (a = kp->address; a; a = a->next)
494  {
495  if (!C_PgpShowUnusable && (a->flags & KEYFLAG_CANTUSE))
496  {
497  unusable = true;
498  continue;
499  }
500 
501  if (i == keymax)
502  {
503  keymax += 5;
504  mutt_mem_realloc(&key_table, sizeof(struct PgpUid *) * keymax);
505  }
506 
507  key_table[i++] = a;
508  }
509  }
510 
511  if ((i == 0) && unusable)
512  {
513  mutt_error(_("All matching keys are expired, revoked, or disabled"));
514  return NULL;
515  }
516 
517  int (*f)(const void *, const void *);
518  switch (C_PgpSortKeys & SORT_MASK)
519  {
520  case SORT_ADDRESS:
522  break;
523  case SORT_DATE:
525  break;
526  case SORT_KEYID:
528  break;
529  case SORT_TRUST:
530  default:
532  break;
533  }
534  qsort(key_table, i, sizeof(struct PgpUid *), f);
535 
536  menu = mutt_menu_new(MENU_PGP);
537  struct MuttWindow *dlg = dialog_create_simple_index(menu, WT_DLG_PGP);
538  dlg->help_data = PgpHelp;
539  dlg->help_menu = MENU_PGP;
540 
541  menu->max = i;
542  menu->make_entry = pgp_make_entry;
543  menu->mdata = key_table;
545 
546  if (p)
547  snprintf(buf, sizeof(buf), _("PGP keys matching <%s>"), p->mailbox);
548  else
549  snprintf(buf, sizeof(buf), _("PGP keys matching \"%s\""), s);
550 
551  menu->title = buf;
552 
553  kp = NULL;
554 
556 
557  while (!done)
558  {
559  switch (mutt_menu_loop(menu))
560  {
561  case OP_VERIFY_KEY:
562  {
563  FILE *fp_null = fopen("/dev/null", "w");
564  if (!fp_null)
565  {
566  mutt_perror(_("Can't open /dev/null"));
567  break;
568  }
569  tempfile = mutt_buffer_pool_get();
570  mutt_buffer_mktemp(tempfile);
571  FILE *fp_tmp = mutt_file_fopen(mutt_buffer_string(tempfile), "w");
572  if (!fp_tmp)
573  {
574  mutt_perror(_("Can't create temporary file"));
575  mutt_file_fclose(&fp_null);
576  mutt_buffer_pool_release(&tempfile);
577  break;
578  }
579 
580  mutt_message(_("Invoking PGP..."));
581 
582  snprintf(tmpbuf, sizeof(tmpbuf), "0x%s",
583  pgp_fpr_or_lkeyid(pgp_principal_key(key_table[menu->current]->parent)));
584 
585  pid_t pid = pgp_invoke_verify_key(NULL, NULL, NULL, -1, fileno(fp_tmp),
586  fileno(fp_null), tmpbuf);
587  if (pid == -1)
588  {
589  mutt_perror(_("Can't create filter"));
590  unlink(mutt_buffer_string(tempfile));
591  mutt_file_fclose(&fp_tmp);
592  mutt_file_fclose(&fp_null);
593  }
594 
595  filter_wait(pid);
596  mutt_file_fclose(&fp_tmp);
597  mutt_file_fclose(&fp_null);
599  char title[1024];
600  snprintf(title, sizeof(title), _("Key ID: 0x%s"),
601  pgp_keyid(pgp_principal_key(key_table[menu->current]->parent)));
602  mutt_do_pager(title, mutt_buffer_string(tempfile), MUTT_PAGER_NO_FLAGS, NULL);
603  mutt_buffer_pool_release(&tempfile);
604  menu->redraw = REDRAW_FULL;
605  break;
606  }
607 
608  case OP_VIEW_ID:
609 
610  mutt_message("%s", NONULL(key_table[menu->current]->addr));
611  break;
612 
613  case OP_GENERIC_SELECT_ENTRY:
614 
615  /* XXX make error reporting more verbose */
616 
617  if (OptPgpCheckTrust)
618  {
619  if (!pgp_key_is_valid(key_table[menu->current]->parent))
620  {
621  mutt_error(_("This key can't be used: expired/disabled/revoked"));
622  break;
623  }
624  }
625 
626  if (OptPgpCheckTrust && (!pgp_id_is_valid(key_table[menu->current]) ||
627  !pgp_id_is_strong(key_table[menu->current])))
628  {
629  const char *str = "";
630  char buf2[1024];
631 
632  if (key_table[menu->current]->flags & KEYFLAG_CANTUSE)
633  {
634  str = _("ID is expired/disabled/revoked. Do you really want to use "
635  "the key?");
636  }
637  else
638  {
639  switch (key_table[menu->current]->trust & 0x03)
640  {
641  case 0:
642  str = _("ID has undefined validity. Do you really want to use "
643  "the key?");
644  break;
645  case 1:
646  str = _("ID is not valid. Do you really want to use the key?");
647  break;
648  case 2:
649  str = _("ID is only marginally valid. Do you really want to "
650  "use the key?");
651  break;
652  }
653  }
654 
655  snprintf(buf2, sizeof(buf2), "%s", str);
656 
657  if (mutt_yesorno(buf2, MUTT_NO) != MUTT_YES)
658  {
660  break;
661  }
662  }
663 
664  kp = key_table[menu->current]->parent;
665  done = true;
666  break;
667 
668  case OP_EXIT:
669 
670  kp = NULL;
671  done = true;
672  break;
673  }
674  }
675 
676  mutt_menu_pop_current(menu);
677  mutt_menu_free(&menu);
679  FREE(&key_table);
680 
681  return kp;
682 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlg_select_gpgme_key()

struct CryptKeyInfo* dlg_select_gpgme_key ( struct CryptKeyInfo keys,
struct Address p,
const char *  s,
unsigned int  app,
int *  forced_valid 
)

Get the user to select a key.

Parameters
[in]keysList of keys to select from
[in]pAddress to match
[in]sReal name to display
[in]appFlags, e.g. APPLICATION_PGP
[out]forced_validSet to true if user overrode key's validity
Return values
ptrKey selected by user

Display a menu to select a key from the array of keys.

Definition at line 1196 of file dlggpgme.c.

1199 {
1200  int keymax;
1201  int i;
1202  bool done = false;
1203  char buf[1024];
1204  struct CryptKeyInfo *k = NULL;
1205  int (*f)(const void *, const void *);
1206  enum MenuType menu_to_use = MENU_GENERIC;
1207  bool unusable = false;
1208 
1209  *forced_valid = 0;
1210 
1211  /* build the key table */
1212  keymax = 0;
1213  i = 0;
1214  struct CryptKeyInfo **key_table = NULL;
1215  for (k = keys; k; k = k->next)
1216  {
1217  if (!C_PgpShowUnusable && (k->flags & KEYFLAG_CANTUSE))
1218  {
1219  unusable = true;
1220  continue;
1221  }
1222 
1223  if (i == keymax)
1224  {
1225  keymax += 20;
1226  mutt_mem_realloc(&key_table, sizeof(struct CryptKeyInfo *) * keymax);
1227  }
1228 
1229  key_table[i++] = k;
1230  }
1231 
1232  if (!i && unusable)
1233  {
1234  mutt_error(_("All matching keys are marked expired/revoked"));
1235  return NULL;
1236  }
1237 
1238  switch (C_PgpSortKeys & SORT_MASK)
1239  {
1240  case SORT_ADDRESS:
1242  break;
1243  case SORT_DATE:
1245  break;
1246  case SORT_KEYID:
1248  break;
1249  case SORT_TRUST:
1250  default:
1252  break;
1253  }
1254  qsort(key_table, i, sizeof(struct CryptKeyInfo *), f);
1255 
1256  if (app & APPLICATION_PGP)
1257  menu_to_use = MENU_KEY_SELECT_PGP;
1258  else if (app & APPLICATION_SMIME)
1259  menu_to_use = MENU_KEY_SELECT_SMIME;
1260 
1261  struct Menu *menu = mutt_menu_new(menu_to_use);
1263  dlg->help_data = GpgmeHelp;
1264  dlg->help_menu = menu_to_use;
1265 
1266  menu->max = i;
1267  menu->make_entry = crypt_make_entry;
1268  menu->mdata = key_table;
1269  mutt_menu_push_current(menu);
1270 
1271  {
1272  const char *ts = NULL;
1273 
1274  if ((app & APPLICATION_PGP) && (app & APPLICATION_SMIME))
1275  ts = _("PGP and S/MIME keys matching");
1276  else if ((app & APPLICATION_PGP))
1277  ts = _("PGP keys matching");
1278  else if ((app & APPLICATION_SMIME))
1279  ts = _("S/MIME keys matching");
1280  else
1281  ts = _("keys matching");
1282 
1283  if (p)
1284  {
1285  /* L10N: 1$s is one of the previous four entries.
1286  %2$s is an address.
1287  e.g. "S/MIME keys matching <me@mutt.org>" */
1288  snprintf(buf, sizeof(buf), _("%s <%s>"), ts, p->mailbox);
1289  }
1290  else
1291  {
1292  /* L10N: e.g. 'S/MIME keys matching "Michael Elkins".' */
1293  snprintf(buf, sizeof(buf), _("%s \"%s\""), ts, s);
1294  }
1295  menu->title = buf;
1296  }
1297 
1298  mutt_clear_error();
1299  k = NULL;
1300  while (!done)
1301  {
1302  *forced_valid = 0;
1303  switch (mutt_menu_loop(menu))
1304  {
1305  case OP_VERIFY_KEY:
1306  verify_key(key_table[menu->current]);
1307  menu->redraw = REDRAW_FULL;
1308  break;
1309 
1310  case OP_VIEW_ID:
1311  mutt_message("%s", key_table[menu->current]->uid);
1312  break;
1313 
1314  case OP_GENERIC_SELECT_ENTRY:
1315  /* FIXME make error reporting more verbose - this should be
1316  * easy because GPGME provides more information */
1317  if (OptPgpCheckTrust)
1318  {
1319  if (!crypt_key_is_valid(key_table[menu->current]))
1320  {
1321  mutt_error(_("This key can't be used: "
1322  "expired/disabled/revoked"));
1323  break;
1324  }
1325  }
1326 
1327  if (OptPgpCheckTrust && (!crypt_id_is_valid(key_table[menu->current]) ||
1328  !crypt_id_is_strong(key_table[menu->current])))
1329  {
1330  const char *warn_s = NULL;
1331  char buf2[1024];
1332 
1333  if (key_table[menu->current]->flags & KEYFLAG_CANTUSE)
1334  {
1335  warn_s = _("ID is expired/disabled/revoked. Do you really want to "
1336  "use the key?");
1337  }
1338  else
1339  {
1340  warn_s = "??";
1341  switch (key_table[menu->current]->validity)
1342  {
1343  case GPGME_VALIDITY_NEVER:
1344  warn_s =
1345  _("ID is not valid. Do you really want to use the key?");
1346  break;
1347  case GPGME_VALIDITY_MARGINAL:
1348  warn_s = _("ID is only marginally valid. Do you really want to "
1349  "use the key?");
1350  break;
1351  case GPGME_VALIDITY_FULL:
1352  case GPGME_VALIDITY_ULTIMATE:
1353  break;
1354  case GPGME_VALIDITY_UNKNOWN:
1355  case GPGME_VALIDITY_UNDEFINED:
1356  warn_s = _("ID has undefined validity. Do you really want to "
1357  "use the key?");
1358  break;
1359  }
1360  }
1361 
1362  snprintf(buf2, sizeof(buf2), "%s", warn_s);
1363 
1364  if (mutt_yesorno(buf2, MUTT_NO) != MUTT_YES)
1365  {
1366  mutt_clear_error();
1367  break;
1368  }
1369 
1370  /* A '!' is appended to a key in find_keys() when forced_valid is
1371  * set. Prior to GPGME 1.11.0, encrypt_gpgme_object() called
1372  * create_recipient_set() which interpreted the '!' to mean set
1373  * GPGME_VALIDITY_FULL for the key.
1374  *
1375  * Starting in GPGME 1.11.0, we now use a '\n' delimited recipient
1376  * string, which is passed directly to the gpgme_op_encrypt_ext()
1377  * function. This allows to use the original meaning of '!' to
1378  * force a subkey use. */
1379 #if (GPGME_VERSION_NUMBER < 0x010b00) /* GPGME < 1.11.0 */
1380  *forced_valid = 1;
1381 #endif
1382  }
1383 
1384  k = crypt_copy_key(key_table[menu->current]);
1385  done = true;
1386  break;
1387 
1388  case OP_EXIT:
1389  k = NULL;
1390  done = true;
1391  break;
1392  }
1393  }
1394 
1395  mutt_menu_pop_current(menu);
1396  mutt_menu_free(&menu);
1398  FREE(&key_table);
1399 
1400  return k;
1401 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_CryptUsePka

bool C_CryptUsePka

Config: Use GPGME to use PKA (lookup PGP keys using DNS)

Definition at line 51 of file config.c.

◆ C_CryptConfirmHook

bool C_CryptConfirmHook

Config: Prompt the user to confirm keys before use.

Definition at line 53 of file config.c.

◆ C_CryptOpportunisticEncryptStrongKeys

bool C_CryptOpportunisticEncryptStrongKeys

Config: Enable encryption only when strong a key is available.

Definition at line 55 of file config.c.

◆ C_CryptProtectedHeadersWrite

bool C_CryptProtectedHeadersWrite

Config: Generate protected header (Memory Hole) for signed and encrypted emails.

Definition at line 58 of file config.c.

◆ C_PgpIgnoreSubkeys

bool C_PgpIgnoreSubkeys

Config: Only use the principal PGP key.

Definition at line 60 of file config.c.

◆ C_PgpLongIds

bool C_PgpLongIds

Config: Display long PGP key IDs to the user.

Definition at line 61 of file config.c.

◆ C_PgpShowUnusable

bool C_PgpShowUnusable

Config: Show non-usable keys in the key selection.

Definition at line 62 of file config.c.

◆ C_PgpAutoInline

bool C_PgpAutoInline

Config: Use old-style inline PGP messages (not recommended)

Definition at line 63 of file config.c.

◆ C_PgpDefaultKey

char* C_PgpDefaultKey

Config: Default key to use for PGP operations.

Definition at line 64 of file config.c.

◆ C_PgpEntryFormat

char* C_PgpEntryFormat

Config: printf-like format string for the PGP key selection menu.

Definition at line 66 of file config.c.

◆ C_SmimeDefaultKey

char* C_SmimeDefaultKey

Config: Default key for SMIME operations.

Definition at line 67 of file config.c.

◆ C_CryptProtectedHeadersSubject

char* C_CryptProtectedHeadersSubject

Config: Use this as the subject for encrypted emails.

Definition at line 70 of file config.c.

◆ C_EnvelopeFromAddress

struct Address* C_EnvelopeFromAddress

Config: Manually set the sender for outgoing messages.

Definition at line 71 of file config.c.

◆ C_CryptTimestamp

bool C_CryptTimestamp

Config: Add a timestamp to PGP or SMIME output to prevent spoofing.

Definition at line 72 of file config.c.

◆ C_PgpEncryptSelf

unsigned char C_PgpEncryptSelf

Definition at line 73 of file config.c.

◆ C_PgpMimeAuto

unsigned char C_PgpMimeAuto

Config: Prompt the user to use MIME if inline PGP fails.

Definition at line 74 of file config.c.

◆ C_PgpRetainableSigs

bool C_PgpRetainableSigs

Config: Create nested multipart/signed or encrypted messages.

Definition at line 75 of file config.c.

◆ C_PgpSelfEncrypt

bool C_PgpSelfEncrypt

Config: Encrypted messages will also be encrypted to $pgp_default_key too.

Definition at line 76 of file config.c.

◆ C_PgpStrictEnc

bool C_PgpStrictEnc

Config: Encode PGP signed messages with quoted-printable (don't unset)

Definition at line 77 of file config.c.

◆ C_SmimeEncryptSelf

unsigned char C_SmimeEncryptSelf

Definition at line 78 of file config.c.

◆ C_SmimeSelfEncrypt

bool C_SmimeSelfEncrypt

Config: Encrypted messages will also be encrypt to $smime_default_key too.

Definition at line 79 of file config.c.

◆ C_CryptUseGpgme

bool C_CryptUseGpgme

Config: Use GPGME crypto backend.

Definition at line 81 of file config.c.

◆ C_PgpCheckExit

bool C_PgpCheckExit

Config: Check the exit code of PGP subprocess.

Definition at line 83 of file config.c.

◆ C_PgpCheckGpgDecryptStatusFd

bool C_PgpCheckGpgDecryptStatusFd

Config: File descriptor used for status info.

Definition at line 84 of file config.c.

◆ C_PgpDecryptionOkay

struct Regex* C_PgpDecryptionOkay

Config: Text indicating a successful decryption.

Definition at line 85 of file config.c.

◆ C_PgpGoodSign

struct Regex* C_PgpGoodSign

Config: Text indicating a good signature.

Definition at line 86 of file config.c.

◆ C_PgpTimeout

long C_PgpTimeout

Config: Time in seconds to cache a passphrase.

Definition at line 87 of file config.c.

◆ C_PgpUseGpgAgent

bool C_PgpUseGpgAgent

Config: Use a PGP agent for caching passwords.

Definition at line 88 of file config.c.

◆ C_PgpClearSignCommand

char* C_PgpClearSignCommand

Config: (pgp) External command to inline-sign a message.

Definition at line 89 of file config.c.

◆ C_PgpDecodeCommand

char* C_PgpDecodeCommand

Config: (pgp) External command to decode a PGP attachment.

Definition at line 90 of file config.c.

◆ C_PgpDecryptCommand

char* C_PgpDecryptCommand

Config: (pgp) External command to decrypt a PGP message.

Definition at line 91 of file config.c.

◆ C_PgpEncryptOnlyCommand

char* C_PgpEncryptOnlyCommand

Config: (pgp) External command to encrypt, but not sign a message.

Definition at line 92 of file config.c.

◆ C_PgpEncryptSignCommand

char* C_PgpEncryptSignCommand

Config: (pgp) External command to encrypt and sign a message.

Definition at line 93 of file config.c.

◆ C_PgpExportCommand

char* C_PgpExportCommand

Config: (pgp) External command to export a public key from the user's keyring.

Definition at line 94 of file config.c.

◆ C_PgpGetKeysCommand

char* C_PgpGetKeysCommand

Config: (pgp) External command to download a key for an email address.

Definition at line 95 of file config.c.

◆ C_PgpImportCommand

char* C_PgpImportCommand

Config: (pgp) External command to import a key into the user's keyring.

Definition at line 96 of file config.c.

◆ C_PgpListPubringCommand

char* C_PgpListPubringCommand

Config: (pgp) External command to list the public keys in a user's keyring.

Definition at line 97 of file config.c.

◆ C_PgpListSecringCommand

char* C_PgpListSecringCommand

Config: (pgp) External command to list the private keys in a user's keyring.

Definition at line 98 of file config.c.

◆ C_PgpSignCommand

char* C_PgpSignCommand

Config: (pgp) External command to create a detached PGP signature.

Definition at line 99 of file config.c.

◆ C_PgpVerifyCommand

char* C_PgpVerifyCommand

Config: (pgp) External command to verify PGP signatures.

Definition at line 100 of file config.c.

◆ C_PgpVerifyKeyCommand

char* C_PgpVerifyKeyCommand

Config: (pgp) External command to verify key information.

Definition at line 101 of file config.c.

◆ C_PgpSortKeys

short C_PgpSortKeys

Config: Sort order for PGP keys.

Definition at line 102 of file config.c.

◆ C_SmimeAskCertLabel

bool C_SmimeAskCertLabel

Config: Prompt the user for a label for SMIME certificates.

Definition at line 103 of file config.c.

◆ C_SmimeCaLocation

char* C_SmimeCaLocation

Config: File containing trusted certificates.

Definition at line 104 of file config.c.

◆ C_SmimeCertificates

char* C_SmimeCertificates

Config: File containing user's public certificates.

Definition at line 105 of file config.c.

◆ C_SmimeDecryptCommand

char* C_SmimeDecryptCommand

Config: (smime) External command to decrypt an SMIME message.

Definition at line 106 of file config.c.

◆ C_SmimeDecryptUseDefaultKey

bool C_SmimeDecryptUseDefaultKey

Config: Use the default key for decryption.

Definition at line 107 of file config.c.

◆ C_SmimeEncryptCommand

char* C_SmimeEncryptCommand

Config: (smime) External command to encrypt a message.

Definition at line 108 of file config.c.

◆ C_SmimeGetCertCommand

char* C_SmimeGetCertCommand

Config: (smime) External command to extract a certificate from a message.

Definition at line 109 of file config.c.

◆ C_SmimeGetCertEmailCommand

char* C_SmimeGetCertEmailCommand

Config: (smime) External command to get a certificate for an email.

Definition at line 110 of file config.c.

◆ C_SmimeGetSignerCertCommand

char* C_SmimeGetSignerCertCommand

Config: (smime) External command to extract a certificate from an email.

Definition at line 111 of file config.c.

◆ C_SmimeImportCertCommand

char* C_SmimeImportCertCommand

Config: (smime) External command to import a certificate.

Definition at line 112 of file config.c.

◆ C_SmimeKeys

char* C_SmimeKeys

Config: File containing user's private certificates.

Definition at line 113 of file config.c.

◆ C_SmimePk7outCommand

char* C_SmimePk7outCommand

Config: (smime) External command to extract a public certificate.

Definition at line 114 of file config.c.

◆ C_SmimeSignCommand

char* C_SmimeSignCommand

Config: (smime) External command to sign a message.

Definition at line 115 of file config.c.

◆ C_SmimeSignDigestAlg

char* C_SmimeSignDigestAlg

Config: Digest algorithm.

Definition at line 116 of file config.c.

◆ C_SmimeTimeout

long C_SmimeTimeout

Config: Time in seconds to cache a passphrase.

Definition at line 117 of file config.c.

◆ C_SmimeVerifyCommand

char* C_SmimeVerifyCommand

Config: (smime) External command to verify a signed message.

Definition at line 118 of file config.c.

◆ C_SmimeVerifyOpaqueCommand

char* C_SmimeVerifyOpaqueCommand

Config: (smime) External command to verify a signature.

Definition at line 119 of file config.c.

MENU_GENERIC
@ MENU_GENERIC
Generic selection list.
Definition: keymap.h:79
dialog_create_simple_index
struct MuttWindow * dialog_create_simple_index(struct Menu *menu, enum WindowType type)
Create a simple index Dialog.
Definition: dialog.c:165
CryptKeyInfo::flags
KeyFlags flags
global and per uid flags (for convenience)
Definition: crypt_gpgme.h:49
pgp_compare_keyid_qsort
static int pgp_compare_keyid_qsort(const void *a, const void *b)
Compare key IDs.
Definition: dlgpgp.c:166
_
#define _(a)
Definition: message.h:28
NONULL
#define NONULL(x)
Definition: string2.h:37
APPLICATION_SMIME
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:98
pgp_make_entry
static void pgp_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the pgp key list - Implements Menu::make_entry()
Definition: dlgpgp.c:449
Buffer
String manipulation buffer.
Definition: buffer.h:33
mutt_file_fclose
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:153
crypt_crypt_compare_keyid_qsort
static int crypt_crypt_compare_keyid_qsort(const void *a, const void *b)
Compare the IDs of two keys.
Definition: dlggpgme.c:194
SmimeKey
An SIME key.
Definition: smime.h:43
PgpKeyInfo::flags
KeyFlags flags
Definition: pgplib.h:51
MENU_PGP
@ MENU_PGP
PGP encryption menu.
Definition: keymap.h:84
SmimeKey::next
struct SmimeKey * next
Definition: smime.h:51
mutt_buffer_mktemp
#define mutt_buffer_mktemp(buf)
Definition: muttlib.h:77
MuttWindow
A division of the screen.
Definition: mutt_window.h:115
pgp_keyid
char * pgp_keyid(struct PgpKeyInfo *k)
Get the ID of the main (parent) key.
Definition: pgp.c:192
MUTT_YES
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:40
mutt_file_fopen
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
Definition: file.c:589
FREE
#define FREE(x)
Definition: memory.h:40
mutt_perror
#define mutt_perror(...)
Definition: logging.h:85
WT_DLG_CRYPT_GPGME
@ WT_DLG_CRYPT_GPGME
Crypt-GPGME Dialog, dlg_select_gpgme_key()
Definition: mutt_window.h:80
mutt_menu_new
struct Menu * mutt_menu_new(enum MenuType type)
Create a new Menu.
Definition: menu.c:956
SORT_MASK
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:80
MuttWindow::help_menu
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:134
Menu::make_entry
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Format a item for a menu.
Definition: mutt_menu.h:88
mutt_buffer_pool_release
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
crypt_key_is_valid
static bool crypt_key_is_valid(struct CryptKeyInfo *k)
Is the key valid.
Definition: dlggpgme.c:127
WT_DLG_PGP
@ WT_DLG_PGP
Pgp Dialog, dlg_select_pgp_key()
Definition: mutt_window.h:85
C_PgpShowUnusable
bool C_PgpShowUnusable
Config: Show non-usable keys in the key selection.
Definition: config.c:62
SmimeHelp
static const struct Mapping SmimeHelp[]
Help Bar for the Smime key selection dialog.
Definition: dlgsmime.c:46
pgp_fpr_or_lkeyid
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
Definition: pgp.c:222
mutt_menu_push_current
void mutt_menu_push_current(struct Menu *menu)
Add a new Menu to the stack.
Definition: menu.c:1015
mutt_buffer_pool_get
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
smime_make_entry
static void smime_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the smime key list - Implements Menu::make_entry()
Definition: dlgsmime.c:84
mutt_do_pager
int mutt_do_pager(const char *banner, const char *tempfile, PagerFlags do_color, struct Pager *info)
Display some page-able text to the user.
Definition: curs_lib.c:691
MENU_KEY_SELECT_PGP
@ MENU_KEY_SELECT_PGP
Select a PGP key.
Definition: keymap.h:87
PgpHelp
static const struct Mapping PgpHelp[]
Help Bar for the PGP key selection dialog.
Definition: dlgpgp.c:51
PgpUid::flags
int flags
Definition: pgplib.h:38
APPLICATION_PGP
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:97
KEYFLAG_CANTUSE
#define KEYFLAG_CANTUSE
Definition: lib.h:146
REDRAW_FULL
#define REDRAW_FULL
Redraw everything.
Definition: mutt_menu.h:45
MUTT_PAGER_NO_FLAGS
#define MUTT_PAGER_NO_FLAGS
No flags are set.
Definition: lib.h:42
mutt_clear_error
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:113
crypt_id_is_valid
int crypt_id_is_valid(struct CryptKeyInfo *key)
Is key ID valid.
Definition: crypt_gpgme.c:518
PgpUid::parent
struct PgpKeyInfo * parent
Definition: pgplib.h:39
Menu::keys
char * keys
Keys used in the prompt.
Definition: mutt_menu.h:72
verify_key
static void verify_key(struct CryptKeyInfo *key)
Show detailed information about the selected key.
Definition: dlggpgme.c:829
pgp_compare_date_qsort
static int pgp_compare_date_qsort(const void *a, const void *b)
Compare the dates of two PGP keys.
Definition: dlgpgp.c:133
crypt_copy_key
struct CryptKeyInfo * crypt_copy_key(struct CryptKeyInfo *key)
Return a copy of KEY.
Definition: crypt_gpgme.c:442
mutt_mem_realloc
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
PgpKeyInfo::address
struct PgpUid * address
Definition: pgplib.h:50
MUTT_NO
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:39
Menu::title
const char * title
Title of this menu.
Definition: mutt_menu.h:54
MENU_SMIME
@ MENU_SMIME
SMIME encryption menu.
Definition: keymap.h:85
PgpUid::next
struct PgpUid * next
Definition: pgplib.h:40
mutt_buffer_string
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
pgp_id_is_strong
bool pgp_id_is_strong(struct PgpUid *uid)
Is a PGP key strong?
Definition: pgpkey.c:126
SORT_KEYID
@ SORT_KEYID
Sort by the encryption key's ID.
Definition: sort2.h:57
MuttWindow::help_data
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:135
SORT_ADDRESS
@ SORT_ADDRESS
Sort by email address.
Definition: sort2.h:56
filter_wait
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
Definition: filter.c:217
mutt_menu_loop
int mutt_menu_loop(struct Menu *menu)
Menu event loop.
Definition: menu.c:1309
Address::mailbox
char * mailbox
Mailbox and host address.
Definition: address.h:37
mutt_menu_pop_current
void mutt_menu_pop_current(struct Menu *menu)
Remove a Menu from the stack.
Definition: menu.c:1027
pgp_principal_key
struct PgpKeyInfo * pgp_principal_key(struct PgpKeyInfo *key)
Get the main (parent) PGP key.
Definition: pgpkey.c:98
WT_DLG_SMIME
@ WT_DLG_SMIME
Smime Dialog, dlg_select_smime_key()
Definition: mutt_window.h:89
OptPgpCheckTrust
WHERE bool OptPgpCheckTrust
(pseudo) used by dlg_select_pgp_key()
Definition: options.h:49
pgp_id_is_valid
bool pgp_id_is_valid(struct PgpUid *uid)
Is a PGP key valid.
Definition: pgpkey.c:139
Menu::mdata
void * mdata
Extra data for the current menu.
Definition: mutt_menu.h:55
pgp_key_is_valid
bool pgp_key_is_valid(struct PgpKeyInfo *k)
Is a PGP key valid?
Definition: pgpkey.c:110
Menu::max
int max
Number of entries in the menu.
Definition: mutt_menu.h:57
crypt_id_is_strong
bool crypt_id_is_strong(struct CryptKeyInfo *key)
Is the key strong.
Definition: crypt_gpgme.c:483
MenuType
MenuType
Types of GUI selections.
Definition: keymap.h:72
PgpKeyInfo
Information about a PGP key.
Definition: pgplib.h:46
Menu::redraw
MuttRedrawFlags redraw
When to redraw the screen.
Definition: mutt_menu.h:58
crypt_compare_date_qsort
static int crypt_compare_date_qsort(const void *a, const void *b)
Compare the dates of two keys.
Definition: dlggpgme.c:235
pgp_compare_trust_qsort
static int pgp_compare_trust_qsort(const void *a, const void *b)
Compare the trust levels of two PGP keys.
Definition: dlgpgp.c:215
CryptKeyInfo::next
struct CryptKeyInfo * next
Definition: crypt_gpgme.h:45
GpgmeHelp
static const struct Mapping GpgmeHelp[]
Help Bar for the GPGME key selection dialog.
Definition: dlggpgme.c:62
MENU_KEY_SELECT_SMIME
@ MENU_KEY_SELECT_SMIME
Select a SMIME key.
Definition: keymap.h:88
dialog_destroy_simple_index
void dialog_destroy_simple_index(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: dialog.c:209
Menu::current
int current
Current entry.
Definition: mutt_menu.h:56
pgp_invoke_verify_key
pid_t pgp_invoke_verify_key(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *uids)
Use PGP to verify a key.
Definition: pgpinvoke.c:497
pgp_compare_address_qsort
static int pgp_compare_address_qsort(const void *a, const void *b)
Compare the addresses of two PGP keys.
Definition: dlgpgp.c:100
PgpKeyInfo::next
struct PgpKeyInfo * next
Definition: pgplib.h:57
SORT_TRUST
@ SORT_TRUST
Sort by encryption key's trust level.
Definition: sort2.h:58
mutt_yesorno
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
Definition: curs_lib.c:380
mutt_message
#define mutt_message(...)
Definition: logging.h:83
crypt_compare_trust_qsort
static int crypt_compare_trust_qsort(const void *a, const void *b)
Compare the trust levels of two keys.
Definition: dlggpgme.c:298
CryptKeyInfo
A stored PGP key.
Definition: crypt_gpgme.h:43
SORT_DATE
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:45
PgpUid
PGP User ID.
Definition: pgplib.h:34
Menu
GUI selectable list of items.
Definition: mutt_menu.h:52
C_PgpSortKeys
short C_PgpSortKeys
Config: Sort order for PGP keys.
Definition: config.c:102
crypt_make_entry
static void crypt_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the key selection list - Implements Menu::make_entry()
Definition: dlggpgme.c:1172
crypt_compare_address_qsort
static int crypt_compare_address_qsort(const void *a, const void *b)
Compare the addresses of two keys.
Definition: dlggpgme.c:161
mutt_menu_free
void mutt_menu_free(struct Menu **ptr)
Destroy a menu.
Definition: menu.c:972
mutt_error
#define mutt_error(...)
Definition: logging.h:84