2 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 * 2005 Free Software Foundation, Inc.
5 * This file is part of GnuPG.
7 * GnuPG is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * GnuPG is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include <sys/types.h>
30 #ifndef EXTERN_UNLESS_MAIN_MODULE
31 /* Norcraft can't cope with common symbols */
32 #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
33 #define EXTERN_UNLESS_MAIN_MODULE extern
35 #define EXTERN_UNLESS_MAIN_MODULE
39 EXTERN_UNLESS_MAIN_MODULE
52 const char *def_sig_expire;
54 const char *def_cert_expire;
56 int batch; /* run in batch mode */
57 int answer_yes; /* answer yes on most questions */
58 int answer_no; /* answer no on most questions */
59 int check_sigs; /* check key signatures */
62 int with_fingerprint; /* opt --with-fingerprint active */
63 int fingerprint; /* list fingerprints */
64 int list_sigs; /* list signatures */
66 int list_packets; /* list-packets mode: 1=normal, 2=invoked by command*/
76 int bz2_compress_level;
77 int bz2_decompress_lowmem;
78 const char *def_secret_key;
80 int def_recipient_self;
90 char *display; /* 5 options to be passed to the gpg-agent */
99 /* TM_CLASSIC must be zero to accomodate trustdbs generated before
100 we started storing the trust model inside the trustdb. */
103 TM_CLASSIC=0, TM_PGP=1, TM_EXTERNAL=2, TM_ALWAYS, TM_DIRECT, TM_AUTO
105 int force_ownertrust;
108 CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
112 KF_SHORT, KF_LONG, KF_0xSHORT, KF_0xLONG
114 int pgp2_workarounds;
116 const char *set_filename;
119 const char *photo_viewer;
123 int simple_sk_checksum; /* create the deprecated rfc2440 secret
125 int not_dash_escaped;
128 struct keyserver_spec
140 unsigned int options;
141 unsigned int import_options;
142 unsigned int export_options;
147 unsigned int import_options;
148 unsigned int export_options;
149 unsigned int list_options;
150 unsigned int verify_options;
151 char *def_preference_list;
152 prefitem_t *personal_cipher_prefs;
153 prefitem_t *personal_digest_prefs;
154 prefitem_t *personal_compress_prefs;
160 STRLIST sig_notation_data;
161 STRLIST cert_notation_data;
162 STRLIST sig_policy_url;
163 STRLIST cert_policy_url;
164 STRLIST sig_keyserver_url;
165 STRLIST cert_subpackets;
166 STRLIST sig_subpackets;
167 int use_embedded_filename;
168 int allow_non_selfsigned_uid;
169 int allow_freeform_uid;
174 int ignore_time_conflict;
175 int ignore_valid_from;
176 int ignore_crc_error;
177 int ignore_mdc_error;
179 const char *override_session_key;
180 int show_session_key;
182 const char *gpg_agent_info;
184 int no_expensive_trust_checks;
186 int no_sig_create_check;
187 int no_auto_check_trustdb;
188 int preserve_permissions;
189 int no_homedir_creation;
190 struct groupitem *grouplist;
192 int mangle_dos_filenames;
193 int enable_progress_filter;
194 unsigned int screen_columns;
195 unsigned int screen_lines;
196 byte *show_subpackets;
199 /* If true, let write failures on the status-fd exit the process. */
200 int exit_on_status_write_error;
202 /* If > 0, limit the number of card insertion prompts to this
204 int limit_card_insert_tries;
206 #ifdef ENABLE_CARD_SUPPORT
207 const char *ctapi_driver; /* Library to access the ctAPI. */
208 const char *pcsc_driver; /* Library to access the PC/SC system. */
209 int disable_ccid; /* Disable the use of the internal CCID driver. */
210 #endif /*ENABLE_CARD_SUPPORT*/
212 /* If set, require an 0x19 backsig to be present on signatures made
213 by signing subkeys. If not set, a missing backsig is not an
214 error (but an invalid backsig still is). */
215 int require_backsigs;
219 /* CTRL is used to keep some global variables we currently can't
220 avoid. Future concurrent versions of gpg will put it into a per
221 request structure CTRL. */
222 EXTERN_UNLESS_MAIN_MODULE
224 int in_auto_key_retrieve; /* True if we are doing an
225 auto_key_retrieve. */
228 #define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
229 #define DBG_MPI_VALUE 2 /* debug mpi details */
230 #define DBG_CIPHER_VALUE 4 /* debug cipher handling */
231 /* (may reveal sensitive data) */
232 #define DBG_FILTER_VALUE 8 /* debug internal filter handling */
233 #define DBG_IOBUF_VALUE 16 /* debug iobuf stuff */
234 #define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */
235 #define DBG_CACHE_VALUE 64 /* debug the cacheing */
236 #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */
237 #define DBG_TRUST_VALUE 256 /* debug the trustdb */
238 #define DBG_HASHING_VALUE 512 /* debug hashing operations */
239 #define DBG_EXTPROG_VALUE 1024 /* debug external program calls */
240 #define DBG_CARD_IO_VALUE 2048 /* debug smart card I/O. */
242 #define DBG_PACKET (opt.debug & DBG_PACKET_VALUE)
243 #define DBG_FILTER (opt.debug & DBG_FILTER_VALUE)
244 #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)
245 #define DBG_TRUST (opt.debug & DBG_TRUST_VALUE)
246 #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE)
247 #define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
248 #define DBG_CARD_IO (opt.debug & DBG_CARD_IO_VALUE)
251 #define GNUPG (opt.compliance==CO_GNUPG)
252 #define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
253 #define RFC2440 (opt.compliance==CO_RFC2440)
254 #define PGP2 (opt.compliance==CO_PGP2)
255 #define PGP6 (opt.compliance==CO_PGP6)
256 #define PGP7 (opt.compliance==CO_PGP7)
257 #define PGP8 (opt.compliance==CO_PGP8)
259 /* Various option flags. Note that there should be no common string
260 names between the IMPORT_ and EXPORT_ flags as they can be mixed in
261 the keyserver-options option. */
263 #define IMPORT_LOCAL_SIGS (1<<0)
264 #define IMPORT_REPAIR_PKS_SUBKEY_BUG (1<<1)
265 #define IMPORT_FAST (1<<2)
266 #define IMPORT_SK2PK (1<<3)
267 #define IMPORT_MERGE_ONLY (1<<4)
268 #define IMPORT_CLEAN_SIGS (1<<5)
269 #define IMPORT_CLEAN_UIDS (1<<6)
271 #define EXPORT_LOCAL_SIGS (1<<0)
272 #define EXPORT_ATTRIBUTES (1<<1)
273 #define EXPORT_SENSITIVE_REVKEYS (1<<2)
274 #define EXPORT_MINIMAL (1<<3)
275 #define EXPORT_CLEAN_SIGS (1<<4)
276 #define EXPORT_CLEAN_UIDS (1<<5)
277 #define EXPORT_RESET_SUBKEY_PASSWD (1<<6)
279 #define LIST_SHOW_PHOTOS (1<<0)
280 #define LIST_SHOW_POLICY_URLS (1<<1)
281 #define LIST_SHOW_STD_NOTATIONS (1<<2)
282 #define LIST_SHOW_USER_NOTATIONS (1<<3)
283 #define LIST_SHOW_NOTATIONS (LIST_SHOW_STD_NOTATIONS|LIST_SHOW_USER_NOTATIONS)
284 #define LIST_SHOW_KEYSERVER_URLS (1<<4)
285 #define LIST_SHOW_UID_VALIDITY (1<<5)
286 #define LIST_SHOW_UNUSABLE_UIDS (1<<6)
287 #define LIST_SHOW_UNUSABLE_SUBKEYS (1<<7)
288 #define LIST_SHOW_KEYRING (1<<8)
289 #define LIST_SHOW_SIG_EXPIRE (1<<9)
290 #define LIST_SHOW_SIG_SUBPACKETS (1<<10)
292 #define VERIFY_SHOW_PHOTOS (1<<0)
293 #define VERIFY_SHOW_POLICY_URLS (1<<1)
294 #define VERIFY_SHOW_STD_NOTATIONS (1<<2)
295 #define VERIFY_SHOW_USER_NOTATIONS (1<<3)
296 #define VERIFY_SHOW_NOTATIONS (VERIFY_SHOW_STD_NOTATIONS|VERIFY_SHOW_USER_NOTATIONS)
297 #define VERIFY_SHOW_KEYSERVER_URLS (1<<4)
298 #define VERIFY_SHOW_UID_VALIDITY (1<<5)
299 #define VERIFY_SHOW_UNUSABLE_UIDS (1<<6)
301 #define KEYSERVER_INCLUDE_REVOKED (1<<0)
302 #define KEYSERVER_INCLUDE_SUBKEYS (1<<1)
303 #define KEYSERVER_USE_TEMP_FILES (1<<2)
304 #define KEYSERVER_KEEP_TEMP_FILES (1<<3)
305 #define KEYSERVER_ADD_FAKE_V3 (1<<4)
306 #define KEYSERVER_AUTO_KEY_RETRIEVE (1<<5)
307 #define KEYSERVER_TRY_DNS_SRV (1<<6)
308 #define KEYSERVER_HONOR_KEYSERVER_URL (1<<7)
309 #define KEYSERVER_AUTO_PKA_RETRIEVE (1<<8)
311 #endif /*G10_OPTIONS_H*/