1997-11-18 15:06:00 +01:00
|
|
|
/* options.h
|
2004-02-23 19:35:05 +01:00
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
|
|
|
|
* 2004 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
|
|
|
|
2004-02-23 19:35:05 +01:00
|
|
|
#include <sys/types.h>
|
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, hkp.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-22 05:00:23 +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
|
2004-02-24 23:00:03 +01:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int verbose;
|
|
|
|
int quiet;
|
|
|
|
unsigned debug;
|
|
|
|
int armor;
|
|
|
|
int compress;
|
|
|
|
char *outfile;
|
|
|
|
off_t max_output;
|
|
|
|
int dry_run;
|
|
|
|
int list_only;
|
|
|
|
int textmode;
|
|
|
|
int expert;
|
|
|
|
int ask_sig_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;
|
|
|
|
int with_fingerprint; /* opt --with-fingerprint active */
|
|
|
|
int fingerprint; /* list fingerprints */
|
|
|
|
int list_sigs; /* list signatures */
|
|
|
|
int no_armor;
|
|
|
|
int list_packets; /* list-packets mode: 1=normal, 2=invoked by command*/
|
|
|
|
int def_cipher_algo;
|
|
|
|
int force_v3_sigs;
|
|
|
|
int force_v4_certs;
|
|
|
|
int force_mdc;
|
|
|
|
int disable_mdc;
|
|
|
|
int def_digest_algo;
|
|
|
|
int cert_digest_algo;
|
|
|
|
int def_compress_algo;
|
2004-03-25 23:53:54 +01:00
|
|
|
int bz2_decompress_lowmem;
|
2004-02-24 23:00:03 +01:00
|
|
|
const char *def_secret_key;
|
|
|
|
char *def_recipient;
|
|
|
|
int def_recipient_self;
|
|
|
|
int def_cert_level;
|
|
|
|
int min_cert_level;
|
|
|
|
int ask_cert_level;
|
|
|
|
int sk_comments;
|
|
|
|
int no_version;
|
|
|
|
int marginals_needed;
|
|
|
|
int completes_needed;
|
|
|
|
int max_cert_depth;
|
|
|
|
const char *homedir;
|
2002-06-29 15:46:34 +02:00
|
|
|
|
2004-02-24 23:00:03 +01:00
|
|
|
char *display; /* 5 options to be passed to the gpg-agent */
|
|
|
|
char *ttyname;
|
|
|
|
char *ttytype;
|
|
|
|
char *lc_ctype;
|
|
|
|
char *lc_messages;
|
2002-06-29 15:46:34 +02:00
|
|
|
|
2004-02-24 23:00:03 +01:00
|
|
|
int skip_verify;
|
|
|
|
int compress_keys;
|
|
|
|
int compress_sigs;
|
|
|
|
int always_trust;
|
|
|
|
enum
|
2002-06-29 15:46:34 +02:00
|
|
|
{
|
2004-02-24 23:00:03 +01:00
|
|
|
CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
|
|
|
|
} compliance;
|
|
|
|
int pgp2_workarounds;
|
|
|
|
unsigned int emulate_bugs; /* bug emulation flags EMUBUG_xxxx */
|
|
|
|
int shm_coprocess;
|
|
|
|
const char *set_filename;
|
|
|
|
const char *comment_string;
|
|
|
|
int throw_keyid;
|
|
|
|
int show_photos;
|
|
|
|
const char *photo_viewer;
|
|
|
|
int s2k_mode;
|
|
|
|
int s2k_digest_algo;
|
|
|
|
int s2k_cipher_algo;
|
|
|
|
int simple_sk_checksum; /* create the deprecated rfc2440 secret
|
|
|
|
key protection*/
|
|
|
|
int not_dash_escaped;
|
|
|
|
int escape_from;
|
|
|
|
int lock_once;
|
|
|
|
char *keyserver_uri;
|
|
|
|
char *keyserver_scheme;
|
|
|
|
char *keyserver_host;
|
|
|
|
char *keyserver_port;
|
|
|
|
char *keyserver_opaque;
|
|
|
|
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;
|
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;
|
2004-02-24 23:00:03 +01:00
|
|
|
STRLIST other;
|
|
|
|
} keyserver_options;
|
|
|
|
int exec_disable;
|
|
|
|
int exec_path_set;
|
|
|
|
unsigned int import_options;
|
|
|
|
unsigned int export_options;
|
|
|
|
char *def_preference_list;
|
|
|
|
prefitem_t *personal_cipher_prefs;
|
|
|
|
prefitem_t *personal_digest_prefs;
|
|
|
|
prefitem_t *personal_compress_prefs;
|
|
|
|
int no_perm_warn;
|
|
|
|
int no_mdc_warn;
|
|
|
|
char *temp_dir;
|
|
|
|
int no_encrypt_to;
|
|
|
|
int interactive;
|
|
|
|
STRLIST sig_notation_data;
|
|
|
|
STRLIST cert_notation_data;
|
|
|
|
int show_notation;
|
|
|
|
STRLIST sig_policy_url;
|
|
|
|
STRLIST cert_policy_url;
|
|
|
|
int show_policy_url;
|
|
|
|
int use_embedded_filename;
|
|
|
|
int allow_non_selfsigned_uid;
|
|
|
|
int allow_freeform_uid;
|
|
|
|
int no_literal;
|
|
|
|
ulong set_filesize;
|
|
|
|
int fast_list_mode;
|
|
|
|
int fixed_list_mode;
|
|
|
|
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;
|
|
|
|
int use_agent;
|
|
|
|
const char *gpg_agent_info;
|
|
|
|
int merge_only;
|
|
|
|
int try_all_secrets;
|
|
|
|
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;
|
|
|
|
int show_keyring;
|
|
|
|
struct groupitem *grouplist;
|
|
|
|
int mangle_dos_filenames;
|
|
|
|
int enable_progress_filter;
|
1997-11-18 15:06:00 +01:00
|
|
|
} opt;
|
|
|
|
|
|
|
|
|
2004-03-01 21:00:39 +01: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. */
|
|
|
|
|
|
|
|
} ctrl;
|
|
|
|
|
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)
|
|
|
|
|
2003-05-03 05:17:00 +02:00
|
|
|
#define GNUPG (opt.compliance==CO_GNUPG)
|
* 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), 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.)
2003-05-02 23:41:43 +02:00
|
|
|
#define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
|
|
|
|
#define RFC2440 (opt.compliance==CO_RFC2440)
|
2003-05-03 05:17:00 +02:00
|
|
|
#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
|
|
|
|
2002-06-29 15:46:34 +02:00
|
|
|
#endif /*G10_OPTIONS_H*/
|