1997-11-18 15:06:00 +01:00
|
|
|
/* options.h
|
2003-04-15 17:46:13 +02:00
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
|
|
|
* 2003 Free Software Foundation, Inc.
|
1997-11-18 15:06:00 +01:00
|
|
|
*
|
1998-12-23 13:41:40 +01:00
|
|
|
* This file is part of GnuPG.
|
1997-11-18 15:06:00 +01:00
|
|
|
*
|
1998-12-23 13:41:40 +01:00
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
1997-11-18 15:06:00 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
1998-12-23 13:41:40 +01:00
|
|
|
* GnuPG is distributed in the hope that it will be useful,
|
1997-11-18 15:06:00 +01:00
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
*/
|
2002-06-29 15:46:34 +02:00
|
|
|
#ifndef G10_OPTIONS_H
|
|
|
|
#define G10_OPTIONS_H
|
1997-11-18 15:06:00 +01:00
|
|
|
|
1999-05-25 19:56:15 +02:00
|
|
|
#include <types.h>
|
2002-06-29 15:46:34 +02:00
|
|
|
#include "main.h"
|
|
|
|
#include "packet.h"
|
1998-10-16 18:00:17 +02:00
|
|
|
|
|
|
|
#undef ENABLE_COMMENT_PACKETS /* don't create comment packets */
|
|
|
|
|
2002-06-29 15:46:34 +02:00
|
|
|
#ifndef EXTERN_UNLESS_MAIN_MODULE
|
|
|
|
/* Norcraft can't cope with common symbols */
|
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c,
options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c,
signal.c, textfilter.c: Edit all preprocessor instructions to remove
whitespace before the '#'. This is not required by C89, but there are some
compilers out there that don't like it.
2003-05-24 23:50:33 +02:00
|
|
|
#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
|
|
|
|
#define EXTERN_UNLESS_MAIN_MODULE extern
|
|
|
|
#else
|
|
|
|
#define EXTERN_UNLESS_MAIN_MODULE
|
|
|
|
#endif
|
2002-06-29 15:46:34 +02:00
|
|
|
#endif
|
1998-10-16 18:00:17 +02:00
|
|
|
|
2002-06-29 15:46:34 +02:00
|
|
|
EXTERN_UNLESS_MAIN_MODULE
|
1997-11-18 15:06:00 +01:00
|
|
|
struct {
|
|
|
|
int verbose;
|
1998-10-25 20:00:01 +01:00
|
|
|
int quiet;
|
2002-06-29 15:46:34 +02:00
|
|
|
unsigned debug;
|
1997-11-18 15:06:00 +01:00
|
|
|
int armor;
|
|
|
|
int compress;
|
|
|
|
char *outfile;
|
1999-02-25 18:51:55 +01:00
|
|
|
int dry_run;
|
2000-07-14 19:34:53 +02:00
|
|
|
int list_only;
|
1997-12-23 18:30:18 +01:00
|
|
|
int textmode;
|
2002-06-29 15:46:34 +02:00
|
|
|
int expert;
|
|
|
|
int ask_sig_expire;
|
|
|
|
int ask_cert_expire;
|
1997-11-18 15:06:00 +01:00
|
|
|
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 */
|
1998-03-09 22:44:06 +01:00
|
|
|
int with_colons;
|
1999-06-08 13:41:46 +02:00
|
|
|
int with_key_data;
|
2002-06-29 15:46:34 +02:00
|
|
|
int with_fingerprint; /* opt --with-fingerprint active */
|
1997-12-09 13:46:23 +01:00
|
|
|
int fingerprint; /* list fingerprints */
|
|
|
|
int list_sigs; /* list signatures */
|
1997-12-16 20:15:09 +01:00
|
|
|
int no_armor;
|
2002-06-29 15:46:34 +02:00
|
|
|
int list_packets; /* list-packets mode: 1=normal, 2=invoked by command*/
|
1998-01-07 21:47:46 +01:00
|
|
|
int def_cipher_algo;
|
1998-10-18 17:21:22 +02:00
|
|
|
int force_v3_sigs;
|
2002-06-29 15:46:34 +02:00
|
|
|
int force_v4_certs;
|
1999-04-26 17:53:01 +02:00
|
|
|
int force_mdc;
|
2002-06-29 15:46:34 +02:00
|
|
|
int disable_mdc;
|
1998-01-07 21:47:46 +01:00
|
|
|
int def_digest_algo;
|
2002-06-29 15:46:34 +02:00
|
|
|
int cert_digest_algo;
|
1998-05-15 20:49:19 +02:00
|
|
|
int def_compress_algo;
|
1998-07-08 11:29:43 +02:00
|
|
|
const char *def_secret_key;
|
1999-07-13 17:41:14 +02:00
|
|
|
char *def_recipient;
|
|
|
|
int def_recipient_self;
|
2002-06-29 15:46:34 +02:00
|
|
|
int def_cert_check_level;
|
|
|
|
int sk_comments;
|
1999-02-10 17:22:40 +01:00
|
|
|
int no_version;
|
1998-01-25 19:56:33 +01:00
|
|
|
int marginals_needed;
|
|
|
|
int completes_needed;
|
1998-11-13 20:41:41 +01:00
|
|
|
int max_cert_depth;
|
1998-02-17 21:48:52 +01:00
|
|
|
const char *homedir;
|
2002-06-29 15:46:34 +02:00
|
|
|
|
|
|
|
char *display; /* 5 options to be passed to the gpg-agent */
|
|
|
|
char *ttyname;
|
|
|
|
char *ttytype;
|
|
|
|
char *lc_ctype;
|
|
|
|
char *lc_messages;
|
|
|
|
|
1998-04-30 16:06:01 +02:00
|
|
|
int skip_verify;
|
1998-05-29 13:53:54 +02:00
|
|
|
int compress_keys;
|
1998-07-14 19:10:28 +02:00
|
|
|
int compress_sigs;
|
2003-04-26 22:38:16 +02:00
|
|
|
/* TM_CLASSIC must be zero to accomodate trustdbs generated before
|
|
|
|
we started storing the trust model inside the trustdb. */
|
* tdbio.c (create_version_record): Only create new trustdbs with
TM_CLASSIC or TM_PGP.
* trustdb.h, trustdb.c (trust_string, get_ownertrust_string,
get_validity_string, ask_ownertrust, validate_keys), pkclist.c
(do_edit_ownertrust): Rename trust_string to trust_value_to_string for
naming consistency.
* trustdb.h, trustdb.c (string_to_trust_value): New function to translate
a string to a trust value.
* g10.c (main): Use string_to_trust_value here for --force-ownertrust.
* options.h, g10.c (main), trustdb.c (trust_model_string, init_trustdb,
check_trustdb, update_trustdb, get_validity, validate_one_keyblock): An
"OpenPGP" trust model is misleading since there is no official OpenPGP
trust model. Use "PGP" instead.
2003-05-01 23:37:08 +02:00
|
|
|
enum {TM_CLASSIC=0, TM_PGP=1, TM_ALWAYS, TM_AUTO} trust_model;
|
2002-11-07 05:37:27 +01:00
|
|
|
unsigned int force_ownertrust;
|
* packet.h, build-packet.c (build_sig_subpkt), export.c
(do_export_stream), import.c (remove_bad_stuff, import), parse-packet.c
(dump_sig_subpkt, parse_one_sig_subpkt): Remove vestigal code for the old
sig cache subpacket. This wasn't completely harmless as it caused
subpacket 101 to disappear on import and export.
* options.h, armor.c, cipher.c, g10.c, keyedit.c, pkclist.c, sign.c,
encode.c, getkey.c, revoke.c: The current flags for different levels of
PGP-ness are massively complex. This is step one in simplifying them. No
functional change yet, just use a macro to check for compliance level.
* sign.c (sign_file): Fix bug that causes spurious compression preference
warning.
* sign.c (clearsign_file): Fix bug that prevents proper warning message
from appearing when clearsigning in --pgp2 mode with a non-v3 RSA key.
* main.h, misc.c (compliance_option_string, compliance_string,
compliance_failure), pkclist.c (build_pk_list), sign.c (sign_file,
clearsign_file), encode.c (encode_crypt, write_pubkey_enc_from_list): New
functions to put the "this message may not be usable...." warning in one
place.
* options.h, g10.c (main): Part two of the simplification. Use a single
enum to indicate what we are compliant to (1991, 2440, PGPx, etc.)
* g10.c (main): Show errors for failure in export, send-keys, recv-keys,
and refresh-keys.
* options.h, g10.c (main): Give algorithm warnings for algorithms chosen
against the --pgpX and --openpgp rules.
* keydb.h, pkclist.c (algo_available): Make TIGER192 invalid in --openpgp
mode.
* sign.c (sign_file), pkclist.c (algo_available): Allow passing a hint of
0.
2003-05-03 06:07:45 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
|
|
|
|
} compliance;
|
2000-07-14 19:34:53 +02:00
|
|
|
int pgp2_workarounds;
|
|
|
|
unsigned int emulate_bugs; /* bug emulation flags EMUBUG_xxxx */
|
1998-07-31 18:45:58 +02:00
|
|
|
int shm_coprocess;
|
1998-08-11 19:29:34 +02:00
|
|
|
const char *set_filename;
|
|
|
|
const char *comment_string;
|
1998-09-11 07:47:32 +02:00
|
|
|
int throw_keyid;
|
2002-06-29 15:46:34 +02:00
|
|
|
const char *photo_viewer;
|
1998-09-28 21:25:31 +02:00
|
|
|
int s2k_mode;
|
|
|
|
int s2k_digest_algo;
|
|
|
|
int s2k_cipher_algo;
|
2002-06-29 15:46:34 +02:00
|
|
|
int simple_sk_checksum; /* create the deprecated rfc2440 secret
|
|
|
|
key protection*/
|
1998-11-20 18:42:18 +01:00
|
|
|
int not_dash_escaped;
|
1998-12-17 18:36:05 +01:00
|
|
|
int escape_from;
|
1998-11-27 21:40:56 +01:00
|
|
|
int lock_once;
|
2002-07-03 00:13:00 +02:00
|
|
|
char *keyserver_uri;
|
2002-06-29 15:46:34 +02:00
|
|
|
char *keyserver_scheme;
|
|
|
|
char *keyserver_host;
|
|
|
|
char *keyserver_port;
|
2002-07-09 21:40:18 +02:00
|
|
|
char *keyserver_opaque;
|
2002-06-29 15:46:34 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int verbose;
|
|
|
|
int include_revoked;
|
|
|
|
int include_disabled;
|
|
|
|
int include_subkeys;
|
|
|
|
int honor_http_proxy;
|
|
|
|
int broken_http_proxy;
|
|
|
|
int use_temp_files;
|
|
|
|
int keep_temp_files;
|
|
|
|
int fake_v3_keyids;
|
|
|
|
int auto_key_retrieve;
|
2003-03-11 23:12:20 +01:00
|
|
|
int try_dns_srv;
|
2002-07-23 00:26:14 +02:00
|
|
|
unsigned int import_options;
|
* options.h, main.h, export.c (parse_export_options, do_export_stream),
g10.c (main): add new --export-options option. Current flags are
"include-non-rfc", "include-local-sigs", "include-attributes", and
"include-sensitive-revkeys".
* options.h, hkp.c (hkp_export), keyserver.c (parse_keyserver_options,
keyserver_spawn): try passing unknown keyserver options to export options,
and if successful, use them when doing a keyserver --send-key.
* build-packet.c (build_sig_subpkt): We do not generate
SIGSUBPKT_PRIV_VERIFY_CACHE anymore.
2002-07-22 21:07:21 +02:00
|
|
|
unsigned int export_options;
|
2002-06-29 15:46:34 +02:00
|
|
|
STRLIST other;
|
|
|
|
} keyserver_options;
|
|
|
|
int exec_disable;
|
2002-07-24 21:24:08 +02:00
|
|
|
int exec_path_set;
|
2002-07-23 00:26:14 +02:00
|
|
|
unsigned int import_options;
|
* options.h, main.h, export.c (parse_export_options, do_export_stream),
g10.c (main): add new --export-options option. Current flags are
"include-non-rfc", "include-local-sigs", "include-attributes", and
"include-sensitive-revkeys".
* options.h, hkp.c (hkp_export), keyserver.c (parse_keyserver_options,
keyserver_spawn): try passing unknown keyserver options to export options,
and if successful, use them when doing a keyserver --send-key.
* build-packet.c (build_sig_subpkt): We do not generate
SIGSUBPKT_PRIV_VERIFY_CACHE anymore.
2002-07-22 21:07:21 +02:00
|
|
|
unsigned int export_options;
|
* mainproc.c (check_sig_and_print), main.h, keylist.c (show_policy,
show_notation): Collapse the old print_notation_data into show_policy()
and show_notation() so there is only one function to print notations and
policy URLs.
* options.h, main.h, g10.c (main), keyedit.c (print_and_check_one_sig),
keylist.c (list_one, list_keyblock_print), pkclist.c (do_edit_ownertrust),
sign.c (mk_notation_and_policy): New "list-options" and "verify-options"
commands. These replace the existing --show-photos/--no-show-photos,
--show-notation/--no-show-notation,
--show-policy-url/--no-show-policy-url, and --show-keyring options. The
new method is more flexible since a user can specify (for example) showing
photos during sig verification, but not in key listings. The old options
are emulated.
2003-06-01 01:23:19 +02:00
|
|
|
unsigned int list_options;
|
|
|
|
unsigned int verify_options;
|
2002-06-29 15:46:34 +02:00
|
|
|
char *def_preference_list;
|
2002-09-10 10:40:12 +02:00
|
|
|
prefitem_t *personal_cipher_prefs;
|
|
|
|
prefitem_t *personal_digest_prefs;
|
|
|
|
prefitem_t *personal_compress_prefs;
|
2002-06-29 15:46:34 +02:00
|
|
|
int no_perm_warn;
|
2002-07-30 18:48:21 +02:00
|
|
|
int no_mdc_warn;
|
2002-06-29 15:46:34 +02:00
|
|
|
char *temp_dir;
|
1999-02-19 15:54:00 +01:00
|
|
|
int no_encrypt_to;
|
1999-05-19 16:12:26 +02:00
|
|
|
int interactive;
|
2002-06-29 15:46:34 +02:00
|
|
|
STRLIST sig_notation_data;
|
|
|
|
STRLIST cert_notation_data;
|
|
|
|
STRLIST sig_policy_url;
|
|
|
|
STRLIST cert_policy_url;
|
1999-06-01 16:08:57 +02:00
|
|
|
int use_embedded_filename;
|
1999-07-22 20:11:55 +02:00
|
|
|
int allow_non_selfsigned_uid;
|
2000-09-18 16:35:34 +02:00
|
|
|
int allow_freeform_uid;
|
1999-07-26 09:44:46 +02:00
|
|
|
int no_literal;
|
|
|
|
ulong set_filesize;
|
2000-07-14 19:34:53 +02:00
|
|
|
int fast_list_mode;
|
2002-06-29 15:46:34 +02:00
|
|
|
int fixed_list_mode;
|
2000-07-14 19:34:53 +02:00
|
|
|
int ignore_time_conflict;
|
2002-06-29 15:46:34 +02:00
|
|
|
int ignore_valid_from;
|
|
|
|
int ignore_crc_error;
|
2002-08-06 19:57:53 +02:00
|
|
|
int ignore_mdc_error;
|
2000-07-14 19:34:53 +02:00
|
|
|
int command_fd;
|
2002-06-29 15:46:34 +02:00
|
|
|
const char *override_session_key;
|
|
|
|
int show_session_key;
|
2000-08-21 17:54:37 +02:00
|
|
|
int use_agent;
|
2002-06-29 15:46:34 +02:00
|
|
|
const char *gpg_agent_info;
|
2000-09-18 16:35:34 +02:00
|
|
|
int merge_only;
|
|
|
|
int try_all_secrets;
|
2002-06-29 15:46:34 +02:00
|
|
|
int no_expensive_trust_checks;
|
|
|
|
int no_sig_cache;
|
|
|
|
int no_sig_create_check;
|
|
|
|
int no_auto_check_trustdb;
|
|
|
|
int preserve_permissions;
|
|
|
|
int no_homedir_creation;
|
|
|
|
struct groupitem *grouplist;
|
2002-10-04 00:13:04 +02:00
|
|
|
int strict;
|
2002-12-06 01:38:43 +01:00
|
|
|
int mangle_dos_filenames;
|
2003-04-15 17:46:13 +02:00
|
|
|
int enable_progress_filter;
|
1997-11-18 15:06:00 +01:00
|
|
|
} opt;
|
|
|
|
|
|
|
|
|
2000-07-14 19:34:53 +02:00
|
|
|
#define EMUBUG_MDENCODE 4
|
|
|
|
|
1997-11-18 15:06:00 +01:00
|
|
|
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
|
|
|
|
#define DBG_MPI_VALUE 2 /* debug mpi details */
|
|
|
|
#define DBG_CIPHER_VALUE 4 /* debug cipher handling */
|
|
|
|
/* (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 */
|
|
|
|
#define DBG_CACHE_VALUE 64 /* debug the cacheing */
|
|
|
|
#define DBG_MEMSTAT_VALUE 128 /* show memory statistics */
|
1998-01-13 20:04:23 +01:00
|
|
|
#define DBG_TRUST_VALUE 256 /* debug the trustdb */
|
2000-07-14 19:34:53 +02:00
|
|
|
#define DBG_HASHING_VALUE 512 /* debug hashing operations */
|
2002-06-29 15:46:34 +02:00
|
|
|
#define DBG_EXTPROG_VALUE 1024 /* debug external program calls */
|
1997-11-18 15:06:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
#define DBG_PACKET (opt.debug & DBG_PACKET_VALUE)
|
|
|
|
#define DBG_FILTER (opt.debug & DBG_FILTER_VALUE)
|
|
|
|
#define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)
|
1998-01-13 20:04:23 +01:00
|
|
|
#define DBG_TRUST (opt.debug & DBG_TRUST_VALUE)
|
2000-07-14 19:34:53 +02:00
|
|
|
#define DBG_HASHING (opt.debug & DBG_HASHING_VALUE)
|
2002-06-29 15:46:34 +02:00
|
|
|
#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
|
|
|
|
|
* packet.h, build-packet.c (build_sig_subpkt), export.c
(do_export_stream), import.c (remove_bad_stuff, import), parse-packet.c
(dump_sig_subpkt, parse_one_sig_subpkt): Remove vestigal code for the old
sig cache subpacket. This wasn't completely harmless as it caused
subpacket 101 to disappear on import and export.
* options.h, armor.c, cipher.c, g10.c, keyedit.c, pkclist.c, sign.c,
encode.c, getkey.c, revoke.c: The current flags for different levels of
PGP-ness are massively complex. This is step one in simplifying them. No
functional change yet, just use a macro to check for compliance level.
* sign.c (sign_file): Fix bug that causes spurious compression preference
warning.
* sign.c (clearsign_file): Fix bug that prevents proper warning message
from appearing when clearsigning in --pgp2 mode with a non-v3 RSA key.
* main.h, misc.c (compliance_option_string, compliance_string,
compliance_failure), pkclist.c (build_pk_list), sign.c (sign_file,
clearsign_file), encode.c (encode_crypt, write_pubkey_enc_from_list): New
functions to put the "this message may not be usable...." warning in one
place.
* options.h, g10.c (main): Part two of the simplification. Use a single
enum to indicate what we are compliant to (1991, 2440, PGPx, etc.)
* g10.c (main): Show errors for failure in export, send-keys, recv-keys,
and refresh-keys.
* options.h, g10.c (main): Give algorithm warnings for algorithms chosen
against the --pgpX and --openpgp rules.
* keydb.h, pkclist.c (algo_available): Make TIGER192 invalid in --openpgp
mode.
* sign.c (sign_file), pkclist.c (algo_available): Allow passing a hint of
0.
2003-05-03 06:07:45 +02:00
|
|
|
#define GNUPG (opt.compliance==CO_GNUPG)
|
|
|
|
#define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
|
|
|
|
#define RFC2440 (opt.compliance==CO_RFC2440)
|
|
|
|
#define PGP2 (opt.compliance==CO_PGP2)
|
|
|
|
#define PGP6 (opt.compliance==CO_PGP6)
|
|
|
|
#define PGP7 (opt.compliance==CO_PGP7)
|
|
|
|
#define PGP8 (opt.compliance==CO_PGP8)
|
1997-11-18 15:06:00 +01:00
|
|
|
|
2003-06-01 17:36:13 +02:00
|
|
|
/* Various option flags */
|
|
|
|
|
|
|
|
#define IMPORT_ALLOW_LOCAL_SIGS 1
|
|
|
|
#define IMPORT_REPAIR_PKS_SUBKEY_BUG 2
|
|
|
|
#define IMPORT_FAST_IMPORT 4
|
|
|
|
#define IMPORT_SK2PK 8
|
|
|
|
|
|
|
|
#define EXPORT_INCLUDE_NON_RFC 1
|
|
|
|
#define EXPORT_INCLUDE_LOCAL_SIGS 2
|
|
|
|
#define EXPORT_INCLUDE_ATTRIBUTES 4
|
|
|
|
#define EXPORT_INCLUDE_SENSITIVE_REVKEYS 8
|
|
|
|
|
2003-06-03 19:47:58 +02:00
|
|
|
#define LIST_SHOW_PHOTOS 1
|
|
|
|
#define LIST_SHOW_POLICY 2
|
|
|
|
#define LIST_SHOW_NOTATION 4
|
|
|
|
#define LIST_SHOW_KEYRING 8
|
|
|
|
#define LIST_SHOW_VALIDITY 16
|
|
|
|
#define LIST_SHOW_LONG_KEYID 32
|
2003-06-01 17:36:13 +02:00
|
|
|
|
2003-06-05 04:06:12 +02:00
|
|
|
#define VERIFY_SHOW_PHOTOS 1
|
|
|
|
#define VERIFY_SHOW_POLICY 2
|
|
|
|
#define VERIFY_SHOW_NOTATION 4
|
|
|
|
#define VERIFY_SHOW_KEYSERVER 8
|
2003-06-01 17:36:13 +02:00
|
|
|
|
2002-06-29 15:46:34 +02:00
|
|
|
#endif /*G10_OPTIONS_H*/
|