From 76cd64a5baf6057b199c01f7999b327f1f4a87bc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 16 Dec 2016 16:00:15 +0100 Subject: [PATCH] gpgconf: New command --apply-profile. * tools/gpgconf.c (aApplyProfile): New. (opts): New command --apply-profile. (main): Implement that command. * tools/gpgconf-comp.c (option_check_validity): Add arg VERBATIM. (change_options_program): Ditto. (change_one_value): Ditto. (gc_component_change_options): Ditto. (gc_apply_profile): New. -- Here is an example for a profile --8<---------------cut here---------------start------------->8--- # foo.prf - Sample profile [gpg] compliance de-vs default-new-key-algo brainpoolP256r1+brainpoolP256r1 [gpgsm] enable-crl-checks [gpg-agent] default-cache-ttl 900 max-cache-ttl [] 3600 no-allow-mark-trusted no-allow-external-cache enforce-passphrase-constraints min-passphrase-len 9 min-passphrase-nonalpha 0 [dirmngr] keyserver hkp://keys.gnupg.net allow-ocsp --8<---------------cut here---------------end--------------->8--- Note that flags inside of brackets are allowed after the option name. The only defined flag for now is "[default]". In case the value starts with a bracket, it is possible to insert "[]" as a nop-flag. Signed-off-by: Werner Koch --- doc/Makefile.am | 4 +- doc/examples/gpgconf.conf | 8 +- doc/tools.texi | 9 ++ tools/gpgconf-comp.c | 291 ++++++++++++++++++++++++++++++++++---- tools/gpgconf.c | 13 +- tools/gpgconf.h | 6 +- 6 files changed, 293 insertions(+), 38 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 563853036..0c2f2c9dc 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -40,6 +40,8 @@ helpfiles = help.txt help.be.txt help.ca.txt help.cs.txt \ help.pt_BR.txt help.ro.txt help.ru.txt help.sk.txt \ help.sv.txt help.tr.txt help.zh_CN.txt help.zh_TW.txt +profiles = + EXTRA_DIST = samplekeys.asc mksamplekeys com-certs.pem qualified.txt \ gnupg-logo.eps gnupg-logo.pdf gnupg-logo.png gnupg-logo-tr.png \ gnupg-module-overview.png gnupg-module-overview.pdf \ @@ -54,7 +56,7 @@ BUILT_SOURCES = gnupg-module-overview.png gnupg-module-overview.pdf \ info_TEXINFOS = gnupg.texi -dist_pkgdata_DATA = $(helpfiles) +dist_pkgdata_DATA = $(helpfiles) $(profiles) nobase_dist_doc_DATA = FAQ DETAILS HACKING DCO TRANSLATE OpenPGP KEYSERVER \ $(examples) diff --git a/doc/examples/gpgconf.conf b/doc/examples/gpgconf.conf index ec8685acb..f40160249 100644 --- a/doc/examples/gpgconf.conf +++ b/doc/examples/gpgconf.conf @@ -8,7 +8,7 @@ # 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 +# group and must start at the first column, the file is processed # sequential until a matching rule is found. A rule may contain # several lines; continuation lines are indicated by a indenting them. # @@ -23,7 +23,7 @@ # * - Matches any user. # All other variants are not defined and reserved for future use. # -# and