NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stddef.h>
31 #include <config/lib.h>
32 #include <stdbool.h>
33 
34 static struct ConfigDef ConnVars[] = {
35 // clang-format off
36 #ifdef USE_SSL
37  { "certificate_file", DT_PATH|DT_PATH_FILE, IP "~/.mutt_certificates", 0, NULL,
38  "File containing trusted certificates"
39  },
40 #endif
41  { "connect_timeout", DT_NUMBER, 30, 0, NULL,
42  "Timeout for making network connections (-1 to wait indefinitely)"
43  },
44 #ifdef USE_SSL_OPENSSL
45  { "entropy_file", DT_PATH|DT_PATH_FILE, 0, 0, NULL,
46  "(ssl) File/device containing random data to initialise SSL"
47  },
48 #endif
49  { "preconnect", DT_STRING, 0, 0, NULL,
50  "(socket) External command to run prior to opening a socket"
51  },
52 #ifdef USE_SSL
53 #ifdef USE_SSL_GNUTLS
54  { "ssl_ca_certificates_file", DT_PATH|DT_PATH_FILE, 0, 0, NULL,
55  "File containing trusted CA certificates"
56  },
57 #endif
58  { "ssl_ciphers", DT_STRING, 0, 0, NULL,
59  "Ciphers to use when using SSL"
60  },
61  { "ssl_client_cert", DT_PATH|DT_PATH_FILE, 0, 0, NULL,
62  "File containing client certificates"
63  },
64  { "ssl_force_tls", DT_BOOL, false, 0, NULL,
65  "(ssl) Require TLS encryption for all connections"
66  },
67 #ifdef USE_SSL_GNUTLS
68  { "ssl_min_dh_prime_bits", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
69  "Minimum keysize for Diffie-Hellman key exchange"
70  },
71 #endif
72  { "ssl_starttls", DT_QUAD, MUTT_YES, 0, NULL,
73  "(ssl) Use STARTTLS on servers advertising the capability"
74  },
75 #ifdef USE_SSL_OPENSSL
76  { "ssl_use_sslv2", DT_BOOL, false, 0, NULL,
77  "(ssl) INSECURE: Use SSLv2 for authentication"
78  },
79 #endif
80  { "ssl_use_sslv3", DT_BOOL, false, 0, NULL,
81  "(ssl) INSECURE: Use SSLv3 for authentication"
82  },
83  { "ssl_use_tlsv1", DT_BOOL, false, 0, NULL,
84  "(ssl) Use TLSv1 for authentication"
85  },
86  { "ssl_use_tlsv1_1", DT_BOOL, false, 0, NULL,
87  "(ssl) Use TLSv1.1 for authentication"
88  },
89  { "ssl_use_tlsv1_2", DT_BOOL, true, 0, NULL,
90  "(ssl) Use TLSv1.2 for authentication"
91  },
92  { "ssl_use_tlsv1_3", DT_BOOL, true, 0, NULL,
93  "(ssl) Use TLSv1.3 for authentication"
94  },
95 #ifdef USE_SSL_OPENSSL
96  { "ssl_use_system_certs", DT_BOOL, true, 0, NULL,
97  "(ssl) Use CA certificates in the system-wide store"
98  },
99 #endif
100  { "ssl_verify_dates", DT_BOOL, true, 0, NULL,
101  "(ssl) Verify the dates on the server certificate"
102  },
103  { "ssl_verify_host", DT_BOOL, true, 0, NULL,
104  "(ssl) Verify the server's hostname against the certificate"
105  },
106 #ifdef USE_SSL_OPENSSL
107 #ifdef HAVE_SSL_PARTIAL_CHAIN
108  { "ssl_verify_partial_chains", DT_BOOL, false, 0, NULL,
109  "(ssl) Allow verification using partial certificate chains"
110  },
111 #endif
112 #endif
113 #endif
114  { "tunnel", DT_STRING|DT_COMMAND, 0, 0, NULL,
115  "Shell command to establish a tunnel"
116  },
117  { "tunnel_is_secure", DT_BOOL, true, 0, NULL,
118  "Assume a tunneled connection is secure"
119  },
120 #ifdef HAVE_GETADDRINFO
121  { "use_ipv6", DT_BOOL, true, 0, NULL,
122  "Lookup IPv6 addresses when making connections"
123  },
124 #endif
125 
126  { "ssl_usesystemcerts", DT_SYNONYM, IP "ssl_use_system_certs", },
127 
128  { NULL },
129  // clang-format on
130 };
131 
135 bool config_init_conn(struct ConfigSet *cs)
136 {
137  return cs_register_variables(cs, ConnVars, 0);
138 }
Container for lots of config items.
Definition: set.h:259
#define IP
Definition: set.h:54
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Definition: set.h:63
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:37
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], uint32_t flags)
Register a set of config items.
Definition: set.c:276
#define DT_PATH_FILE
Path is a file.
Definition: types.h:54
#define DT_STRING
a string
Definition: types.h:41
#define DT_PATH
a path to a file/directory
Definition: types.h:36
bool config_init_conn(struct ConfigSet *cs)
Register conn config variables - Implements module_init_config_t -.
Definition: config.c:135
#define DT_COMMAND
A command.
Definition: types.h:50
#define DT_SYNONYM
synonym for another variable
Definition: types.h:42
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30
User answered &#39;Yes&#39;, or assume &#39;Yes&#39;.
Definition: quad.h:39