2003-06-05 09:14:21 +02:00
|
|
|
/* options.h
|
2007-10-25 11:06:21 +02:00
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
2011-01-10 14:30:17 +01:00
|
|
|
* 2007, 2010, 2011 Free Software Foundation, Inc.
|
2015-11-03 23:15:27 +01:00
|
|
|
* Copyright (C) 2015 g10 Code GmbH
|
2003-06-05 09:14:21 +02:00
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-04 21:49:40 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-06-05 09:14:21 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GnuPG 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
|
2016-11-05 12:02:19 +01:00
|
|
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
2003-06-05 09:14:21 +02:00
|
|
|
*/
|
|
|
|
#ifndef G10_OPTIONS_H
|
|
|
|
#define G10_OPTIONS_H
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#include <sys/types.h>
|
2017-03-07 12:21:23 +01:00
|
|
|
#include "../common/types.h"
|
2016-08-11 21:31:12 +02:00
|
|
|
#include <stdint.h>
|
2003-06-05 09:14:21 +02:00
|
|
|
#include "main.h"
|
|
|
|
#include "packet.h"
|
2015-10-21 20:24:27 +02:00
|
|
|
#include "tofu.h"
|
2009-07-07 12:02:41 +02:00
|
|
|
#include "../common/session-env.h"
|
2017-05-31 14:33:45 +02:00
|
|
|
#include "../common/compliance.h"
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
|
2021-05-26 14:28:26 +02:00
|
|
|
/* Object to hold information pertaining to a keyserver; it also
|
|
|
|
allows building a list of keyservers. For historic reasons this is
|
|
|
|
not a strlist_t. */
|
|
|
|
struct keyserver_spec
|
|
|
|
{
|
|
|
|
struct keyserver_spec *next;
|
|
|
|
char *uri;
|
|
|
|
};
|
2011-01-10 14:30:17 +01:00
|
|
|
typedef struct keyserver_spec *keyserver_spec_t;
|
|
|
|
|
|
|
|
|
|
|
|
/* Global options for GPG. */
|
2003-06-05 09:14:21 +02:00
|
|
|
EXTERN_UNLESS_MAIN_MODULE
|
2006-04-19 13:26:11 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int verbose;
|
|
|
|
int quiet;
|
|
|
|
unsigned debug;
|
|
|
|
int armor;
|
|
|
|
char *outfile;
|
2010-11-23 19:46:41 +01:00
|
|
|
estream_t outfp; /* Hack, sometimes used in place of outfile. */
|
2006-04-19 13:26:11 +02:00
|
|
|
off_t max_output;
|
2016-08-11 21:31:12 +02:00
|
|
|
|
|
|
|
/* If > 0 a hint with the expected number of input data bytes. This
|
|
|
|
* is not necessary an exact number but intended to be used for
|
|
|
|
* progress info and to decide on how to allocate buffers. */
|
|
|
|
uint64_t input_size_hint;
|
|
|
|
|
2018-01-23 19:08:16 +01:00
|
|
|
/* The AEAD chunk size expressed as a power of 2. */
|
|
|
|
int chunk_size;
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
int dry_run;
|
2014-11-28 09:44:19 +01:00
|
|
|
int autostart;
|
2006-04-19 13:26:11 +02:00
|
|
|
int list_only;
|
2016-07-13 13:31:12 +02:00
|
|
|
int mimemode;
|
2006-04-19 13:26:11 +02:00
|
|
|
int textmode;
|
|
|
|
int expert;
|
|
|
|
const char *def_sig_expire;
|
|
|
|
int ask_sig_expire;
|
|
|
|
const char *def_cert_expire;
|
|
|
|
int ask_cert_expire;
|
|
|
|
int batch; /* run in batch mode */
|
|
|
|
int answer_yes; /* answer yes on most questions */
|
|
|
|
int answer_no; /* answer no on most questions */
|
|
|
|
int check_sigs; /* check key signatures */
|
|
|
|
int with_colons;
|
|
|
|
int with_key_data;
|
2015-02-23 17:54:05 +01:00
|
|
|
int with_icao_spelling; /* Print ICAO spelling with fingerprints. */
|
2010-10-08 13:11:08 +02:00
|
|
|
int with_fingerprint; /* Option --with-fingerprint active. */
|
2016-06-06 16:55:03 +02:00
|
|
|
int with_subkey_fingerprint; /* Option --with-subkey-fingerprint active. */
|
2010-10-08 13:11:08 +02:00
|
|
|
int with_keygrip; /* Option --with-keygrip active. */
|
2017-10-17 21:10:19 +02:00
|
|
|
int with_key_screening;/* Option --with-key-screening active. */
|
2016-08-25 09:26:36 +02:00
|
|
|
int with_tofu_info; /* Option --with-tofu_info active. */
|
2014-06-03 21:35:59 +02:00
|
|
|
int with_secret; /* Option --with-secret active. */
|
2016-04-27 08:34:29 +02:00
|
|
|
int with_wkd_hash; /* Option --with-wkd-hash. */
|
2017-07-20 17:27:48 +02:00
|
|
|
int with_key_origin; /* Option --with-key-origin. */
|
2006-04-19 13:26:11 +02:00
|
|
|
int fingerprint; /* list fingerprints */
|
|
|
|
int list_sigs; /* list signatures */
|
|
|
|
int no_armor;
|
2016-06-28 08:56:48 +02:00
|
|
|
int list_packets; /* Option --list-packets active. */
|
2006-04-19 13:26:11 +02:00
|
|
|
int def_cipher_algo;
|
2018-01-10 11:42:38 +01:00
|
|
|
int def_aead_algo;
|
2006-04-19 13:26:11 +02:00
|
|
|
int force_mdc;
|
|
|
|
int disable_mdc;
|
2018-01-10 17:07:11 +01:00
|
|
|
int force_aead;
|
2006-04-19 13:26:11 +02:00
|
|
|
int def_digest_algo;
|
|
|
|
int cert_digest_algo;
|
|
|
|
int compress_algo;
|
|
|
|
int compress_level;
|
|
|
|
int bz2_compress_level;
|
|
|
|
int bz2_decompress_lowmem;
|
2015-11-03 23:15:27 +01:00
|
|
|
strlist_t def_secret_key;
|
2006-04-19 13:26:11 +02:00
|
|
|
char *def_recipient;
|
|
|
|
int def_recipient_self;
|
2010-10-13 17:57:08 +02:00
|
|
|
strlist_t secret_keys_to_try;
|
|
|
|
|
2016-08-18 10:08:34 +02:00
|
|
|
/* A list of mail addresses (addr-spec) provided by the user with
|
|
|
|
* the option --sender. */
|
|
|
|
strlist_t sender_list;
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
int def_cert_level;
|
|
|
|
int min_cert_level;
|
|
|
|
int ask_cert_level;
|
2013-11-27 09:20:02 +01:00
|
|
|
int emit_version; /* 0 = none,
|
|
|
|
1 = major only,
|
|
|
|
2 = major and minor,
|
|
|
|
3 = full version,
|
|
|
|
4 = full version plus OS string. */
|
2006-04-19 13:26:11 +02:00
|
|
|
int marginals_needed;
|
|
|
|
int completes_needed;
|
|
|
|
int max_cert_depth;
|
2011-02-04 12:57:53 +01:00
|
|
|
const char *agent_program;
|
2019-09-09 14:34:09 +02:00
|
|
|
const char *keyboxd_program;
|
2014-03-12 18:24:52 +01:00
|
|
|
const char *dirmngr_program;
|
2017-08-08 11:43:22 +02:00
|
|
|
int disable_dirmngr;
|
2009-07-07 12:02:41 +02:00
|
|
|
|
2016-12-02 19:43:36 +01:00
|
|
|
const char *def_new_key_algo;
|
|
|
|
|
2009-07-07 12:02:41 +02:00
|
|
|
/* Options to be passed to the gpg-agent */
|
|
|
|
session_env_t session_env;
|
2006-04-19 13:26:11 +02:00
|
|
|
char *lc_ctype;
|
|
|
|
char *lc_messages;
|
|
|
|
|
|
|
|
int skip_verify;
|
2009-11-23 20:18:04 +01:00
|
|
|
int skip_hidden_recipients;
|
2014-08-12 10:36:30 +02:00
|
|
|
|
2016-08-05 14:40:36 +02:00
|
|
|
/* TM_CLASSIC must be zero to accommodate trustdbsg generated before
|
2006-04-19 13:26:11 +02:00
|
|
|
we started storing the trust model inside the trustdb. */
|
|
|
|
enum
|
|
|
|
{
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
TM_CLASSIC=0, TM_PGP=1, TM_EXTERNAL=2,
|
|
|
|
TM_ALWAYS, TM_DIRECT, TM_AUTO, TM_TOFU, TM_TOFU_PGP
|
2006-04-19 13:26:11 +02:00
|
|
|
} trust_model;
|
2015-10-21 20:24:27 +02:00
|
|
|
enum tofu_policy tofu_default_policy;
|
2006-04-19 13:26:11 +02:00
|
|
|
int force_ownertrust;
|
2017-05-31 14:33:45 +02:00
|
|
|
enum gnupg_compliance_mode compliance;
|
2006-04-19 13:26:11 +02:00
|
|
|
enum
|
|
|
|
{
|
2016-06-06 16:00:50 +02:00
|
|
|
KF_DEFAULT, KF_NONE, KF_SHORT, KF_LONG, KF_0xSHORT, KF_0xLONG
|
2006-04-19 13:26:11 +02:00
|
|
|
} keyid_format;
|
|
|
|
const char *set_filename;
|
2006-10-02 13:54:35 +02:00
|
|
|
strlist_t comments;
|
2014-12-03 11:28:10 +01:00
|
|
|
int throw_keyids;
|
2006-04-19 13:26:11 +02:00
|
|
|
const char *photo_viewer;
|
|
|
|
int s2k_mode;
|
|
|
|
int s2k_digest_algo;
|
|
|
|
int s2k_cipher_algo;
|
2006-10-13 06:06:24 +02:00
|
|
|
unsigned char s2k_count; /* This is the encoded form, not the raw
|
|
|
|
count */
|
2006-04-19 13:26:11 +02:00
|
|
|
int not_dash_escaped;
|
|
|
|
int escape_from;
|
|
|
|
int lock_once;
|
2011-01-10 14:30:17 +01:00
|
|
|
keyserver_spec_t keyserver; /* The list of configured keyservers. */
|
2006-04-19 13:26:11 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int options;
|
2003-06-05 09:14:21 +02:00
|
|
|
unsigned int import_options;
|
|
|
|
unsigned int export_options;
|
2015-04-21 19:29:53 +02:00
|
|
|
char *http_proxy;
|
2006-04-19 13:26:11 +02:00
|
|
|
} keyserver_options;
|
|
|
|
int exec_disable;
|
|
|
|
int exec_path_set;
|
|
|
|
unsigned int import_options;
|
|
|
|
unsigned int export_options;
|
|
|
|
unsigned int list_options;
|
|
|
|
unsigned int verify_options;
|
2006-06-27 16:30:59 +02:00
|
|
|
const char *def_preference_list;
|
|
|
|
const char *def_keyserver_url;
|
2006-04-19 13:26:11 +02:00
|
|
|
prefitem_t *personal_cipher_prefs;
|
2018-01-10 11:42:38 +01:00
|
|
|
prefitem_t *personal_aead_prefs;
|
2006-04-19 13:26:11 +02:00
|
|
|
prefitem_t *personal_digest_prefs;
|
|
|
|
prefitem_t *personal_compress_prefs;
|
2015-10-23 23:46:57 +02:00
|
|
|
struct weakhash *weak_digests;
|
2006-04-19 13:26:11 +02:00
|
|
|
int no_perm_warn;
|
|
|
|
char *temp_dir;
|
|
|
|
int no_encrypt_to;
|
2015-11-03 23:39:46 +01:00
|
|
|
int encrypt_to_default_key;
|
2006-04-19 13:26:11 +02:00
|
|
|
int interactive;
|
|
|
|
struct notation *sig_notations;
|
|
|
|
struct notation *cert_notations;
|
2006-10-02 13:54:35 +02:00
|
|
|
strlist_t sig_policy_url;
|
|
|
|
strlist_t cert_policy_url;
|
|
|
|
strlist_t sig_keyserver_url;
|
|
|
|
strlist_t cert_subpackets;
|
|
|
|
strlist_t sig_subpackets;
|
2006-04-19 13:26:11 +02:00
|
|
|
int allow_non_selfsigned_uid;
|
|
|
|
int allow_freeform_uid;
|
|
|
|
int no_literal;
|
|
|
|
ulong set_filesize;
|
|
|
|
int fast_list_mode;
|
2014-02-05 10:37:59 +01:00
|
|
|
int legacy_list_mode;
|
2006-04-19 13:26:11 +02:00
|
|
|
int ignore_time_conflict;
|
|
|
|
int ignore_valid_from;
|
|
|
|
int ignore_crc_error;
|
|
|
|
int ignore_mdc_error;
|
|
|
|
int command_fd;
|
|
|
|
const char *override_session_key;
|
|
|
|
int show_session_key;
|
2006-10-04 18:45:04 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
const char *gpg_agent_info;
|
|
|
|
int try_all_secrets;
|
|
|
|
int no_expensive_trust_checks;
|
|
|
|
int no_sig_cache;
|
|
|
|
int no_auto_check_trustdb;
|
|
|
|
int preserve_permissions;
|
|
|
|
int no_homedir_creation;
|
|
|
|
struct groupitem *grouplist;
|
|
|
|
int mangle_dos_filenames;
|
|
|
|
int enable_progress_filter;
|
|
|
|
unsigned int screen_columns;
|
|
|
|
unsigned int screen_lines;
|
|
|
|
byte *show_subpackets;
|
|
|
|
int rfc2440_text;
|
2021-11-18 20:44:14 +01:00
|
|
|
unsigned int min_rsa_length; /* Used for compliance checks. */
|
2006-04-19 13:26:11 +02:00
|
|
|
|
|
|
|
/* If true, let write failures on the status-fd exit the process. */
|
|
|
|
int exit_on_status_write_error;
|
|
|
|
|
|
|
|
/* If > 0, limit the number of card insertion prompts to this
|
|
|
|
value. */
|
2011-02-04 12:57:53 +01:00
|
|
|
int limit_card_insert_tries;
|
2006-04-19 13:26:11 +02:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
/* If set, require an 0x19 backsig to be present on signatures
|
|
|
|
made by signing subkeys. If not set, a missing backsig is not
|
|
|
|
an error (but an invalid backsig still is). */
|
|
|
|
unsigned int require_cross_cert:1;
|
2006-04-28 16:31:29 +02:00
|
|
|
|
|
|
|
unsigned int use_embedded_filename:1;
|
|
|
|
unsigned int utf8_filename:1;
|
|
|
|
unsigned int dsa2:1;
|
2021-02-10 14:31:34 +01:00
|
|
|
unsigned int allow_old_cipher_algos:1;
|
2014-03-17 17:54:36 +01:00
|
|
|
unsigned int allow_weak_digest_algos:1;
|
2019-11-07 10:36:17 +01:00
|
|
|
unsigned int allow_weak_key_signatures:1;
|
2021-10-13 17:25:28 +02:00
|
|
|
unsigned int override_compliance_check:1;
|
2014-10-09 22:54:15 +02:00
|
|
|
unsigned int large_rsa:1;
|
2016-06-13 11:24:09 +02:00
|
|
|
unsigned int disable_signer_uid:1;
|
2020-03-13 13:28:35 +01:00
|
|
|
unsigned int include_key_block:1;
|
2020-03-14 18:04:47 +01:00
|
|
|
unsigned int auto_key_import:1;
|
2018-04-11 20:35:40 +02:00
|
|
|
/* Flag to enable experimental features from RFC4880bis. */
|
2016-06-20 22:19:23 +02:00
|
|
|
unsigned int rfc4880bis:1;
|
2019-05-17 13:40:24 +02:00
|
|
|
/* Hack: --output is not given but OUTFILE was temporary set to "-". */
|
|
|
|
unsigned int dummy_outfile:1;
|
2019-08-21 10:19:16 +02:00
|
|
|
/* Force the use of the OpenPGP card and do not allow the use of
|
|
|
|
* another card. */
|
|
|
|
unsigned int use_only_openpgp_card:1;
|
2020-02-13 14:01:07 +01:00
|
|
|
unsigned int full_timestrings:1;
|
2021-03-11 11:27:07 +01:00
|
|
|
/* Force signing keys even if a key signature already exists. */
|
|
|
|
unsigned int force_sign_key:1;
|
2021-03-15 10:47:19 +01:00
|
|
|
/* On key generation do not set the ownertrust. */
|
|
|
|
unsigned int no_auto_trust_new_key:1;
|
2021-04-13 14:25:16 +02:00
|
|
|
/* The next flag is set internally iff IMPORT_SELF_SIGS_ONLY has
|
|
|
|
* been set by the user and is not the default value. */
|
|
|
|
unsigned int expl_import_self_sigs_only:1;
|
2021-04-26 14:15:21 +02:00
|
|
|
/* The next flag is set internally iff IMPORT_CLEAN has
|
|
|
|
* been set by the user and is not the default value. */
|
|
|
|
unsigned int expl_import_clean:1;
|
2022-03-08 10:13:44 +01:00
|
|
|
/* Fail if an operation can't be done in the requested compliance
|
|
|
|
* mode. */
|
|
|
|
unsigned int require_compliance:1;
|
2006-04-19 13:26:11 +02:00
|
|
|
} flags;
|
|
|
|
|
|
|
|
/* Linked list of ways to find a key if the key isn't on the local
|
|
|
|
keyring. */
|
|
|
|
struct akl
|
|
|
|
{
|
2008-04-08 13:04:16 +02:00
|
|
|
enum {
|
|
|
|
AKL_NODEFAULT,
|
|
|
|
AKL_LOCAL,
|
2011-02-04 12:57:53 +01:00
|
|
|
AKL_CERT,
|
|
|
|
AKL_PKA,
|
2015-10-06 20:31:43 +02:00
|
|
|
AKL_DANE,
|
2016-04-27 08:34:29 +02:00
|
|
|
AKL_WKD,
|
2008-04-08 13:04:16 +02:00
|
|
|
AKL_LDAP,
|
2020-12-17 18:18:52 +01:00
|
|
|
AKL_NTDS,
|
2008-04-08 13:04:16 +02:00
|
|
|
AKL_KEYSERVER,
|
|
|
|
AKL_SPEC
|
|
|
|
} type;
|
2011-01-10 14:30:17 +01:00
|
|
|
keyserver_spec_t spec;
|
2006-04-19 13:26:11 +02:00
|
|
|
struct akl *next;
|
|
|
|
} *auto_key_locate;
|
|
|
|
|
2017-07-13 17:28:32 +02:00
|
|
|
/* The value of --key-origin. See parse_key_origin(). */
|
|
|
|
int key_origin;
|
2017-07-24 21:07:03 +02:00
|
|
|
char *key_origin_url;
|
2017-07-13 17:28:32 +02:00
|
|
|
|
2010-01-08 20:18:49 +01:00
|
|
|
int passphrase_repeat;
|
2013-02-07 20:37:58 +01:00
|
|
|
int pinentry_mode;
|
2018-03-23 09:06:20 +01:00
|
|
|
int request_origin;
|
2015-11-05 12:20:42 +01:00
|
|
|
|
|
|
|
int unwrap_encryption;
|
2015-11-06 13:14:57 +01:00
|
|
|
int only_sign_text_ids;
|
2018-04-11 20:35:40 +02:00
|
|
|
|
|
|
|
int no_symkey_cache; /* Disable the cache used for --symmetric. */
|
2019-09-09 14:34:09 +02:00
|
|
|
|
|
|
|
int use_keyboxd; /* Use the external keyboxd as storage backend. */
|
2006-04-19 13:26:11 +02:00
|
|
|
} opt;
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
/* CTRL is used to keep some global variables we currently can't
|
|
|
|
avoid. Future concurrent versions of gpg will put it into a per
|
|
|
|
request structure CTRL. */
|
|
|
|
EXTERN_UNLESS_MAIN_MODULE
|
|
|
|
struct {
|
|
|
|
int in_auto_key_retrieve; /* True if we are doing an
|
|
|
|
auto_key_retrieve. */
|
2009-10-19 11:18:46 +02:00
|
|
|
/* Hack to store the last error. We currently need it because the
|
|
|
|
proc_packet machinery is not able to reliabale return error
|
|
|
|
codes. Thus for the --server purposes we store some of the error
|
|
|
|
codes here. FIXME! */
|
|
|
|
gpg_error_t lasterr;
|
2019-08-23 12:50:41 +02:00
|
|
|
|
|
|
|
/* Kludge to silence some warnings using --secret-key-list. */
|
|
|
|
int silence_parse_warnings;
|
2006-04-19 13:26:11 +02:00
|
|
|
} glo_ctrl;
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
|
|
|
|
#define DBG_MPI_VALUE 2 /* debug mpi details */
|
2015-04-06 13:07:09 +02:00
|
|
|
#define DBG_CRYPTO_VALUE 4 /* debug crypto handling */
|
2003-06-05 09:14:21 +02:00
|
|
|
/* (may reveal sensitive data) */
|
|
|
|
#define DBG_FILTER_VALUE 8 /* debug internal filter handling */
|
|
|
|
#define DBG_IOBUF_VALUE 16 /* debug iobuf stuff */
|
|
|
|
#define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */
|
2015-04-06 13:27:26 +02:00
|
|
|
#define DBG_CACHE_VALUE 64 /* debug the caching */
|
2003-06-05 09:14:21 +02:00
|
|
|
#define DBG_MEMSTAT_VALUE 128 /* show memory statistics */
|
|
|
|
#define DBG_TRUST_VALUE 256 /* debug the trustdb */
|
|
|
|
#define DBG_HASHING_VALUE 512 /* debug hashing operations */
|
2015-04-06 13:42:17 +02:00
|
|
|
#define DBG_IPC_VALUE 1024 /* debug assuan communication */
|
2013-01-07 16:51:24 +01:00
|
|
|
#define DBG_CLOCK_VALUE 4096
|
2016-06-13 11:24:09 +02:00
|
|
|
#define DBG_LOOKUP_VALUE 8192 /* debug the key lookup */
|
2015-04-06 13:42:17 +02:00
|
|
|
#define DBG_EXTPROG_VALUE 16384 /* debug external program calls */
|
2006-12-21 20:40:00 +01:00
|
|
|
|
|
|
|
/* Tests for the debugging flags. */
|
2003-06-05 09:14:21 +02:00
|
|
|
#define DBG_PACKET (opt.debug & DBG_PACKET_VALUE)
|
2016-10-07 07:54:38 +02:00
|
|
|
#define DBG_MPI (opt.debug & DBG_MPI_VALUE)
|
2015-04-06 13:07:09 +02:00
|
|
|
#define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE)
|
2003-06-05 09:14:21 +02:00
|
|
|
#define DBG_FILTER (opt.debug & DBG_FILTER_VALUE)
|
|
|
|
#define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)
|
|
|
|
#define DBG_TRUST (opt.debug & DBG_TRUST_VALUE)
|
|
|
|
#define DBG_HASHING (opt.debug & DBG_HASHING_VALUE)
|
2015-04-06 13:42:17 +02:00
|
|
|
#define DBG_IPC (opt.debug & DBG_IPC_VALUE)
|
2013-01-07 16:51:24 +01:00
|
|
|
#define DBG_CLOCK (opt.debug & DBG_CLOCK_VALUE)
|
2015-04-06 13:27:26 +02:00
|
|
|
#define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE)
|
2015-04-06 13:42:17 +02:00
|
|
|
#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2016-10-07 07:54:38 +02:00
|
|
|
/* FIXME: We need to check why we did not put this into opt. */
|
2006-04-19 13:26:11 +02:00
|
|
|
#define DBG_MEMORY memory_debug_mode
|
|
|
|
#define DBG_MEMSTAT memory_stat_debug_mode
|
|
|
|
|
|
|
|
EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode;
|
|
|
|
EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode;
|
|
|
|
|
|
|
|
|
gpg: Remove cipher.h and put algo ids into a common file.
* common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t)
(compress_algo_t): New.
* agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h.
* g10/cipher.h (DEK): Move to ...
* g10/dek.h: new file.
* g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA)
(PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC)
(PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT)
(PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to
* g10/packet.h: here.
* g10/cipher.h: Remove. Remove from all files.
* g10/filter.h, g10/packet.h: Include dek.h.
* g10/Makefile.am (common_source): Remove cipher.h. Add dek.h.
Signed-off-by: Werner Koch <wk@gnupg.org>
2014-01-29 20:35:05 +01:00
|
|
|
/* Compatibility flags. */
|
2016-11-15 17:50:03 +01:00
|
|
|
#define GNUPG (opt.compliance==CO_GNUPG || opt.compliance==CO_DE_VS)
|
2003-06-05 09:14:21 +02:00
|
|
|
#define RFC2440 (opt.compliance==CO_RFC2440)
|
2007-10-25 11:06:21 +02:00
|
|
|
#define RFC4880 (opt.compliance==CO_RFC4880)
|
2003-06-05 09:14:21 +02:00
|
|
|
#define PGP7 (opt.compliance==CO_PGP7)
|
|
|
|
#define PGP8 (opt.compliance==CO_PGP8)
|
2018-05-29 13:01:12 +02:00
|
|
|
#define PGPX (PGP7 || PGP8)
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
/* Various option flags. Note that there should be no common string
|
|
|
|
names between the IMPORT_ and EXPORT_ flags as they can be mixed in
|
|
|
|
the keyserver-options option. */
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#define IMPORT_LOCAL_SIGS (1<<0)
|
|
|
|
#define IMPORT_REPAIR_PKS_SUBKEY_BUG (1<<1)
|
|
|
|
#define IMPORT_FAST (1<<2)
|
2016-06-23 19:25:53 +02:00
|
|
|
#define IMPORT_SHOW (1<<3)
|
2006-04-19 13:26:11 +02:00
|
|
|
#define IMPORT_MERGE_ONLY (1<<4)
|
|
|
|
#define IMPORT_MINIMAL (1<<5)
|
|
|
|
#define IMPORT_CLEAN (1<<6)
|
2013-10-04 13:44:39 +02:00
|
|
|
#define IMPORT_NO_SECKEY (1<<7)
|
2014-11-12 09:56:40 +01:00
|
|
|
#define IMPORT_KEEP_OWNERTTRUST (1<<8)
|
2016-06-24 13:11:37 +02:00
|
|
|
#define IMPORT_EXPORT (1<<9)
|
2017-01-23 10:12:18 +01:00
|
|
|
#define IMPORT_RESTORE (1<<10)
|
2017-06-13 15:35:01 +02:00
|
|
|
#define IMPORT_REPAIR_KEYS (1<<11)
|
2017-08-04 17:03:03 +02:00
|
|
|
#define IMPORT_DRY_RUN (1<<12)
|
2019-07-01 15:14:59 +02:00
|
|
|
#define IMPORT_SELF_SIGS_ONLY (1<<14)
|
2020-08-25 10:33:57 +02:00
|
|
|
#define IMPORT_COLLAPSE_UIDS (1<<15)
|
|
|
|
#define IMPORT_COLLAPSE_SUBKEYS (1<<16)
|
2020-09-24 16:47:10 +02:00
|
|
|
#define IMPORT_BULK (1<<17)
|
2003-07-16 15:45:15 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#define EXPORT_LOCAL_SIGS (1<<0)
|
|
|
|
#define EXPORT_ATTRIBUTES (1<<1)
|
|
|
|
#define EXPORT_SENSITIVE_REVKEYS (1<<2)
|
|
|
|
#define EXPORT_RESET_SUBKEY_PASSWD (1<<3)
|
|
|
|
#define EXPORT_MINIMAL (1<<4)
|
|
|
|
#define EXPORT_CLEAN (1<<5)
|
2016-07-07 17:02:58 +02:00
|
|
|
#define EXPORT_DANE_FORMAT (1<<7)
|
2017-01-23 10:12:18 +01:00
|
|
|
#define EXPORT_BACKUP (1<<10)
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#define LIST_SHOW_PHOTOS (1<<0)
|
|
|
|
#define LIST_SHOW_POLICY_URLS (1<<1)
|
|
|
|
#define LIST_SHOW_STD_NOTATIONS (1<<2)
|
|
|
|
#define LIST_SHOW_USER_NOTATIONS (1<<3)
|
|
|
|
#define LIST_SHOW_NOTATIONS (LIST_SHOW_STD_NOTATIONS|LIST_SHOW_USER_NOTATIONS)
|
|
|
|
#define LIST_SHOW_KEYSERVER_URLS (1<<4)
|
|
|
|
#define LIST_SHOW_UID_VALIDITY (1<<5)
|
|
|
|
#define LIST_SHOW_UNUSABLE_UIDS (1<<6)
|
|
|
|
#define LIST_SHOW_UNUSABLE_SUBKEYS (1<<7)
|
|
|
|
#define LIST_SHOW_KEYRING (1<<8)
|
|
|
|
#define LIST_SHOW_SIG_EXPIRE (1<<9)
|
|
|
|
#define LIST_SHOW_SIG_SUBPACKETS (1<<10)
|
2014-08-12 10:36:30 +02:00
|
|
|
#define LIST_SHOW_USAGE (1<<11)
|
2018-12-04 12:32:28 +01:00
|
|
|
#define LIST_SHOW_ONLY_FPR_MBOX (1<<12)
|
2020-10-27 17:10:48 +01:00
|
|
|
#define LIST_SORT_SIGS (1<<13)
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#define VERIFY_SHOW_PHOTOS (1<<0)
|
|
|
|
#define VERIFY_SHOW_POLICY_URLS (1<<1)
|
|
|
|
#define VERIFY_SHOW_STD_NOTATIONS (1<<2)
|
|
|
|
#define VERIFY_SHOW_USER_NOTATIONS (1<<3)
|
|
|
|
#define VERIFY_SHOW_NOTATIONS (VERIFY_SHOW_STD_NOTATIONS|VERIFY_SHOW_USER_NOTATIONS)
|
|
|
|
#define VERIFY_SHOW_KEYSERVER_URLS (1<<4)
|
|
|
|
#define VERIFY_SHOW_UID_VALIDITY (1<<5)
|
|
|
|
#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6)
|
2007-02-26 21:24:29 +01:00
|
|
|
#define VERIFY_SHOW_PRIMARY_UID_ONLY (1<<9)
|
2003-09-23 19:48:33 +02:00
|
|
|
|
2015-04-21 10:15:04 +02:00
|
|
|
#define KEYSERVER_HTTP_PROXY (1<<0)
|
|
|
|
#define KEYSERVER_TIMEOUT (1<<1)
|
2006-04-19 13:26:11 +02:00
|
|
|
#define KEYSERVER_ADD_FAKE_V3 (1<<2)
|
|
|
|
#define KEYSERVER_AUTO_KEY_RETRIEVE (1<<3)
|
|
|
|
#define KEYSERVER_HONOR_KEYSERVER_URL (1<<4)
|
2003-06-05 09:14:21 +02:00
|
|
|
|
gpg: Remove cipher.h and put algo ids into a common file.
* common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t)
(compress_algo_t): New.
* agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h.
* g10/cipher.h (DEK): Move to ...
* g10/dek.h: new file.
* g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA)
(PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC)
(PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT)
(PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to
* g10/packet.h: here.
* g10/cipher.h: Remove. Remove from all files.
* g10/filter.h, g10/packet.h: Include dek.h.
* g10/Makefile.am (common_source): Remove cipher.h. Add dek.h.
Signed-off-by: Werner Koch <wk@gnupg.org>
2014-01-29 20:35:05 +01:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
#endif /*G10_OPTIONS_H*/
|