From ed84b0f787a48fe2cfdd55b3acf70ca6b4732291 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 6 Mar 2007 20:44:41 +0000 Subject: [PATCH] Support for a global gpgconf configuration file. --- NEWS | 3 + agent/ChangeLog | 4 + agent/gpg-agent.c | 11 +- doc/ChangeLog | 4 + doc/Makefile.am | 3 +- doc/examples/gpgconf.conf | 59 ++ doc/gpg-agent.texi | 2 +- doc/tools.texi | 30 + doc/vuln-announce-2007-multiple-message.txt | 145 +++++ tools/ChangeLog | 15 + tools/gpgconf-comp.c | 653 ++++++++++++++++---- tools/gpgconf.c | 34 +- tools/gpgconf.h | 4 + 13 files changed, 848 insertions(+), 119 deletions(-) create mode 100644 doc/examples/gpgconf.conf create mode 100644 doc/vuln-announce-2007-multiple-message.txt diff --git a/NEWS b/NEWS index 5de504387..59d46332f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ Noteworthy changes in version 2.0.3 * New --verify-option show-primary-uid-only. + * gpgconf may now read a global configuration file to select which + options are changeable by a frontend. + Noteworthy changes in version 2.0.2 (2007-01-31) ------------------------------------------------ diff --git a/agent/ChangeLog b/agent/ChangeLog index e78d2dc5c..cc1ae2d53 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,7 @@ +2007-03-06 Werner Koch + + * gpg-agent.c (main) : Add entries for all ttl options. + 2007-02-20 Werner Koch * call-pinentry.c (start_pinentry): Fix for OS X to allow loading diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index c88e22cc1..5da308797 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -168,6 +168,7 @@ static ARGPARSE_OPTS opts[] = { #define DEFAULT_CACHE_TTL (10*60) /* 10 minutes */ #define DEFAULT_CACHE_TTL_SSH (30*60) /* 30 minutes */ #define MAX_CACHE_TTL (120*60) /* 2 hours */ +#define MAX_CACHE_TTL_SSH (120*60) /* 2 hours */ #define MIN_PASSPHRASE_LEN (8) @@ -408,7 +409,7 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) opt.def_cache_ttl = DEFAULT_CACHE_TTL; opt.def_cache_ttl_ssh = DEFAULT_CACHE_TTL_SSH; opt.max_cache_ttl = MAX_CACHE_TTL; - opt.max_cache_ttl_ssh = MAX_CACHE_TTL; + opt.max_cache_ttl_ssh = MAX_CACHE_TTL_SSH; opt.min_passphrase_len = MIN_PASSPHRASE_LEN; opt.ignore_cache_for_signing = 0; opt.allow_mark_trusted = 0; @@ -775,6 +776,14 @@ main (int argc, char **argv ) GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME ); printf ("default-cache-ttl:%lu:%d:\n", GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, DEFAULT_CACHE_TTL ); + printf ("default-cache-ttl-ssh:%lu:%d:\n", + GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, DEFAULT_CACHE_TTL_SSH ); + printf ("max-cache-ttl:%lu:%d:\n", + GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MAX_CACHE_TTL ); + printf ("max-cache-ttl-ssh:%lu:%d:\n", + GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MAX_CACHE_TTL_SSH ); + printf ("min-passphrase-len:%lu:%d:\n", + GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MIN_PASSPHRASE_LEN ); printf ("no-grab:%lu:\n", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); printf ("ignore-cache-for-signing:%lu:\n", diff --git a/doc/ChangeLog b/doc/ChangeLog index aff5149c6..799906988 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-03-06 Werner Koch + + * examples/gpgconf.conf: New. + 2007-03-04 David Shaw * gpg.texi (GPG Esoteric Options): Document diff --git a/doc/Makefile.am b/doc/Makefile.am index c93df6fad..9614b222b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -19,7 +19,8 @@ ## Process this file with automake to produce Makefile.in -examples = examples/README examples/scd-event examples/trustlist.txt +examples = examples/README examples/scd-event examples/trustlist.txt \ + examples/gpgconf.conf EXTRA_DIST = DETAILS HACKING TRANSLATE OpenPGP KEYSERVER samplekeys.asc \ gnupg-badge-openpgp.eps gnupg-badge-openpgp.jpg \ diff --git a/doc/examples/gpgconf.conf b/doc/examples/gpgconf.conf new file mode 100644 index 000000000..194ed7938 --- /dev/null +++ b/doc/examples/gpgconf.conf @@ -0,0 +1,59 @@ +# gpgconf.conf - configuration for gpgconf +#---------------------------------------------------------------------- +# This file is read by gpgconf(1) to setup defaults for all or +# specified users and groups. It may be used to change the hardwired +# defaults in gpgconf and to enforce certain values for the various +# GnuPG related configuration files. +# +# Empty lines and comment lines, indicated by a hash mark as first non +# white space character, are ignored. The line is separated by white +# space into fields. The first field is used to match the user or +# group and must start at the first column, the file is processes +# sequential until a matching rle is found. A rule may contain +# several lines, continuation lines are indicated by a indenting them. +# +# Syntax of a line: +# |WS