NeoMutt  2024-10-02-7-gd3e66a
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c File Reference

Config used by libncrypt. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "expando/lib.h"
#include "pgp.h"
#include "pgplib.h"
#include "smime.h"
+ Include dependency graph for config.c:

Go to the source code of this file.

Functions

struct ExpandoNodeparse_pgp_date (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
bool config_init_ncrypt (struct ConfigSet *cs)
 Register ncrypt config variables - Implements module_init_config_t -.
 

Variables

static const struct Mapping SortKeyMethods []
 Sort methods for encryption keys.
 
static const struct ExpandoDefinition PgpEntryFormatDef []
 Expando definitions.
 
static struct ConfigDef NcryptVars []
 Config definitions for the encryption library.
 
static struct ConfigDef NcryptVarsGpgme []
 GPGME Config definitions for the encryption library.
 
static const struct ExpandoDefinition PgpCommandFormatDef []
 Expando definitions.
 
static const struct ExpandoDefinition SmimeCommandFormatDef []
 Expando definitions.
 
static struct ConfigDef NcryptVarsPgp []
 PGP Config definitions for the encryption library.
 
static struct ConfigDef NcryptVarsSmime []
 SMIME Config definitions for the encryption library.
 

Detailed Description

Config used by libncrypt.

Authors
  • Aditya De Saha
  • Richard Russon
  • наб
  • Tóth János

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 config.c.

Variable Documentation

◆ SortKeyMethods

const struct Mapping SortKeyMethods[]
static
Initial value:
= {
{ "address", SORT_ADDRESS },
{ "date", SORT_DATE },
{ "keyid", SORT_KEYID },
{ "trust", SORT_TRUST },
{ NULL, 0 },
}
@ SORT_TRUST
Sort by encryption key's trust level.
Definition: sort2.h:48
@ SORT_KEYID
Sort by the encryption key's ID.
Definition: sort2.h:47
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:35
@ SORT_ADDRESS
Sort by email address.
Definition: sort2.h:46

Sort methods for encryption keys.

Definition at line 46 of file config.c.

◆ PgpEntryFormatDef

const struct ExpandoDefinition PgpEntryFormatDef[]
static
Initial value:
= {
{ "a", "key-algorithm", ED_PGP_KEY, ED_PGK_KEY_ALGORITHM, E_TYPE_STRING, NULL },
{ "A", "pkey-algorithm", ED_PGP_KEY, ED_PGK_PKEY_ALGORITHM, E_TYPE_STRING, NULL },
{ "c", "key-capabilities", ED_PGP_KEY, ED_PGK_KEY_CAPABILITIES, E_TYPE_STRING, NULL },
{ "C", "pkey-capabilities", ED_PGP_KEY, ED_PGK_PKEY_CAPABILITIES, E_TYPE_STRING, NULL },
{ "f", "key-flags", ED_PGP_KEY, ED_PGK_KEY_FLAGS, E_TYPE_STRING, NULL },
{ "F", "pkey-flags", ED_PGP_KEY, ED_PGK_PKEY_FLAGS, E_TYPE_STRING, NULL },
{ "i", "key-fingerprint", ED_PGP_KEY, ED_PGK_KEY_FINGERPRINT, E_TYPE_STRING, NULL },
{ "I", "pkey-fingerprint", ED_PGP_KEY, ED_PGK_PKEY_FINGERPRINT, E_TYPE_STRING, NULL },
{ "k", "key-id", ED_PGP_KEY, ED_PGK_KEY_ID, E_TYPE_STRING, NULL },
{ "K", "pkey-id", ED_PGP_KEY, ED_PGK_PKEY_ID, E_TYPE_STRING, NULL },
{ "l", "key-length", ED_PGP_KEY, ED_PGK_KEY_LENGTH, E_TYPE_NUMBER, NULL },
{ "L", "pkey-length", ED_PGP_KEY, ED_PGK_PKEY_LENGTH, E_TYPE_NUMBER, NULL },
{ "n", "number", ED_PGP, ED_PGP_NUMBER, E_TYPE_NUMBER, NULL },
{ "p", "protocol", ED_PGP, ED_PGK_PROTOCOL, E_TYPE_STRING, NULL },
{ "t", "trust", ED_PGP, ED_PGP_TRUST, E_TYPE_STRING, NULL },
{ "u", "user-id", ED_PGP, ED_PGP_USER_ID, E_TYPE_STRING, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ E_TYPE_STRING
Data is a string.
Definition: definition.h:37
@ E_TYPE_NUMBER
Data is numeric.
Definition: definition.h:38
@ ED_PGP
Pgp ED_PGP_ ExpandoDataPgp.
Definition: domain.h:51
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_PGP_KEY
Pgp_Key ED_PGK_ ExpandoDataPgpKey.
Definition: domain.h:53
struct ExpandoNode * node_padding_parse(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:235
struct ExpandoNode * parse_pgp_date(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: config.c:62
@ ED_PGP_NUMBER
PgpEntry.num.
Definition: private.h:51
@ ED_PGP_USER_ID
PgpUid.addr.
Definition: private.h:53
@ ED_PGP_TRUST
PgpUid, TrustFlags.
Definition: private.h:52
@ ED_PGK_KEY_CAPABILITIES
PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:69
@ ED_PGK_KEY_FINGERPRINT
PgpKeyInfo.fingerprint.
Definition: pgplib.h:70
@ ED_PGK_PKEY_LENGTH
pgp_principal_key(), PgpKeyInfo.keylen
Definition: pgplib.h:79
@ ED_PGK_PKEY_ALGORITHM
pgp_principal_key(), PgpKeyInfo.algorithm
Definition: pgplib.h:74
@ ED_PGK_DATE
PgpKeyInfo.gen_time.
Definition: pgplib.h:67
@ ED_PGK_PKEY_FINGERPRINT
pgp_principal_key(), PgpKeyInfo.fingerprint
Definition: pgplib.h:76
@ ED_PGK_KEY_ID
PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:72
@ ED_PGK_PROTOCOL
PgpKeyInfo.
Definition: pgplib.h:80
@ ED_PGK_PKEY_CAPABILITIES
pgp_principal_key(), PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:75
@ ED_PGK_KEY_FLAGS
PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:71
@ ED_PGK_PKEY_ID
pgp_principal_key(), PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:78
@ ED_PGK_KEY_ALGORITHM
PgpKeyInfo.algorithm.
Definition: pgplib.h:68
@ ED_PGK_KEY_LENGTH
PgpKeyInfo.keylen.
Definition: pgplib.h:73
@ ED_PGK_PKEY_FLAGS
pgp_principal_key(), PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:77
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:36
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:37
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:38

Expando definitions.

Config:

  • $pgp_entry_format

Definition at line 80 of file config.c.

◆ NcryptVars

struct ConfigDef NcryptVars[]
static

Config definitions for the encryption library.

Definition at line 109 of file config.c.

◆ NcryptVarsGpgme

struct ConfigDef NcryptVarsGpgme[]
static
Initial value:
= {
{ "crypt_use_gpgme", DT_BOOL|D_ON_STARTUP, true, 0, NULL,
"Use GPGME crypto backend"
},
{ "crypt_use_pka", DT_BOOL, false, 0, NULL,
"Use GPGME to use PKA (lookup PGP keys using DNS)"
},
{ NULL },
}
@ DT_BOOL
boolean option
Definition: types.h:32
#define D_ON_STARTUP
May only be set at startup.
Definition: types.h:79

GPGME Config definitions for the encryption library.

Definition at line 220 of file config.c.

◆ PgpCommandFormatDef

const struct ExpandoDefinition PgpCommandFormatDef[]
static
Initial value:
= {
{ "a", "sign-as", ED_PGP_CMD, ED_PGC_SIGN_AS, E_TYPE_STRING, NULL },
{ "f", "file-message", ED_PGP_CMD, ED_PGC_FILE_MESSAGE, E_TYPE_STRING, NULL },
{ "p", "need-pass", ED_PGP_CMD, ED_PGC_NEED_PASS, E_TYPE_NUMBER, NULL },
{ "r", "key-ids", ED_PGP_CMD, ED_PGC_KEY_IDS, E_TYPE_STRING, NULL },
{ "s", "file-signature", ED_PGP_CMD, ED_PGC_FILE_SIGNATURE, E_TYPE_STRING, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ ED_PGP_CMD
Pgp Command ED_PGC_ ExpandoDataPgpCmd.
Definition: domain.h:52
@ ED_PGC_KEY_IDS
PgpCommandContext.ids.
Definition: pgp.h:60
@ ED_PGC_FILE_SIGNATURE
PgpCommandContext.sig_fname.
Definition: pgp.h:59
@ ED_PGC_NEED_PASS
PgpCommandContext.need_passphrase.
Definition: pgp.h:61
@ ED_PGC_SIGN_AS
PgpCommandContext.signas.
Definition: pgp.h:62
@ ED_PGC_FILE_MESSAGE
PgpCommandContext.fname.
Definition: pgp.h:58

Expando definitions.

Config:

  • $pgp_clear_sign_command
  • $pgp_decode_command
  • $pgp_decrypt_command
  • $pgp_encrypt_only_command
  • $pgp_encrypt_sign_command
  • $pgp_export_command
  • $pgp_get_keys_command
  • $pgp_import_command
  • $pgp_list_pubring_command
  • $pgp_list_secring_command
  • $pgp_sign_command
  • $pgp_verify_command
  • $pgp_verify_key_command

Definition at line 252 of file config.c.

◆ SmimeCommandFormatDef

const struct ExpandoDefinition SmimeCommandFormatDef[]
static
Initial value:
= {
{ "a", "algorithm", ED_SMIME_CMD, ED_SMI_ALGORITHM, E_TYPE_STRING, NULL },
{ "c", "certificate-ids", ED_SMIME_CMD, ED_SMI_CERTIFICATE_IDS, E_TYPE_STRING, NULL },
{ "C", "certificate-path", ED_GLOBAL, ED_GLO_CERTIFICATE_PATH, E_TYPE_STRING, NULL },
{ "d", "digest-algorithm", ED_SMIME_CMD, ED_SMI_DIGEST_ALGORITHM, E_TYPE_STRING, NULL },
{ "f", "message-file", ED_SMIME_CMD, ED_SMI_MESSAGE_FILE, E_TYPE_STRING, NULL },
{ "i", "intermediate-ids", ED_SMIME_CMD, ED_SMI_INTERMEDIATE_IDS, E_TYPE_STRING, NULL },
{ "k", "key", ED_SMIME_CMD, ED_SMI_KEY, E_TYPE_STRING, NULL },
{ "s", "signature-file", ED_SMIME_CMD, ED_SMI_SIGNATURE_FILE, E_TYPE_STRING, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ ED_SMIME_CMD
Smime Command ED_SMI_ ExpandoDataSmimeCmd.
Definition: domain.h:55
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition: smime.h:79
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition: smime.h:74
@ ED_SMI_SIGNATURE_FILE
SmimeCommandContext.sig_fname.
Definition: smime.h:80
@ ED_SMI_DIGEST_ALGORITHM
SmimeCommandContext.digestalg.
Definition: smime.h:76
@ ED_SMI_CERTIFICATE_IDS
SmimeCommandContext.certificates.
Definition: smime.h:75
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition: smime.h:78
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition: smime.h:77
@ ED_GLO_CERTIFICATE_PATH
Path of Smime certificates.
Definition: uid.h:34

Expando definitions.

Config:

  • $smime_decrypt_command
  • $smime_encrypt_command
  • $smime_get_cert_command
  • $smime_get_cert_email_command
  • $smime_get_signer_cert_command
  • $smime_import_cert_command
  • $smime_pk7out_command
  • $smime_sign_command
  • $smime_verify_command
  • $smime_verify_opaque_command

Definition at line 280 of file config.c.

◆ NcryptVarsPgp

struct ConfigDef NcryptVarsPgp[]
static

PGP Config definitions for the encryption library.

Definition at line 299 of file config.c.

◆ NcryptVarsSmime

struct ConfigDef NcryptVarsSmime[]
static

SMIME Config definitions for the encryption library.

Definition at line 369 of file config.c.