chiark / gitweb /
gpg: Fix searching for mail addresses in keyrings.
[gnupg2.git] / debian / patches / 0023-gpg-If-there-is-a-TOFU-conflict-elide-the-too-few-me.patch
1 From: "Neal H. Walfield" <neal@g10code.com>
2 Date: Thu, 2 Feb 2017 13:26:17 +0100
3 Subject: gpg: If there is a TOFU conflict, elide the too few message warning.
4
5 * g10/tofu.c (tofu_get_validity): If there was a conflict, don't also
6 print out a warning about too few messages.
7
8 Signed-off-by: Neal H. Walfield <neal@g10code.com>
9 (cherry picked from commit a08c781739e7561093f32b732c4991f2bd817ec2)
10 ---
11  g10/tofu.c | 4 +++-
12  1 file changed, 3 insertions(+), 1 deletion(-)
13
14 diff --git a/g10/tofu.c b/g10/tofu.c
15 index fc03c5a7d..41bdd5f30 100644
16 --- a/g10/tofu.c
17 +++ b/g10/tofu.c
18 @@ -3694,6 +3694,7 @@ tofu_get_validity (ctrl_t ctrl, PKT_public_key *pk, strlist_t user_id_list,
19    int bindings = 0;
20    int bindings_valid = 0;
21    int need_warning = 0;
22 +  int had_conflict = 0;
23  
24    dbs = opendbs (ctrl);
25    if (! dbs)
26 @@ -3762,6 +3763,7 @@ tofu_get_validity (ctrl_t ctrl, PKT_public_key *pk, strlist_t user_id_list,
27                 * key.  */
28                log_assert (conflict_set);
29  
30 +              had_conflict = 1;
31                for (iter = conflict_set; iter; iter = iter->next)
32                  show_statistics (dbs, iter->d, email,
33                                   TOFU_POLICY_ASK, NULL, 1, now);
34 @@ -3794,7 +3796,7 @@ tofu_get_validity (ctrl_t ctrl, PKT_public_key *pk, strlist_t user_id_list,
35        xfree (email);
36      }
37  
38 -  if (need_warning)
39 +  if (need_warning && ! had_conflict)
40      show_warning (fingerprint, user_id_list);
41  
42   die: