From 19d12be3cea5b4ee8153287a2f2442913a5e07a1 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 25 Aug 2016 09:26:36 +0200 Subject: gpg: New option --with-tofu-info. * g10/gpg.c (oWithTofuInfo): New. (opts): Add --with-tofu-info. (main): Set opt.with_tofu_info. * g10/options.h (struct opt): Add field WITH_TOFU_INFO. * g10/tofu.c (show_statistics): Add optional arg OUTFP and enter special mode if not NULL. Change all callers. (tofu_write_tfs_record): New. * g10/keylist.c (list_keyblock_colon): Do not print the tofu policy as part of the "uid" record. Print a new "tfs" record if the new option is set. * tests/openpgp/tofu.scm (getpolicy): Change from UID to TFS record. -- A separate option is required to avoid slowing down key listings. Foer example the current code takes for a keylisting in tofu+pgp mode 17 seconds while it takes more than 5 minutes if the option is used. Signed-off-by: Werner Koch --- tests/openpgp/tofu.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/openpgp/tofu.scm b/tests/openpgp/tofu.scm index 2b302baaa..448c253c9 100755 --- a/tests/openpgp/tofu.scm +++ b/tests/openpgp/tofu.scm @@ -46,11 +46,11 @@ ;; This function only supports keys with a single user id. (define (getpolicy keyid format . args) (let ((policy - (list-ref (assoc "uid" (gpg-with-colons + (list-ref (assoc "tfs" (gpg-with-colons `(--tofu-db-format ,format - --trust-model=tofu + --trust-model=tofu --with-tofu-info ,@args - --list-keys ,keyid))) 17))) + --list-keys ,keyid))) 5))) (unless (member policy '("auto" "good" "unknown" "bad" "ask")) (error "Bad policy:" policy)) policy)) -- cgit v1.2.3