mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Extend TRUST_foo status lines with the trust model.
* g10/trustdb.h (TRUST_FLAG_TOFU_BASED): New. * g10/trustdb.c (trust_model_string): Lowercase the strings. Add arg "model" and change callers to call with OPT.TRUST_MODEL. * g10/tofu.c (tofu_wot_trust_combine): Set TRUST_FLAG_TOFU_BASED. * g10/pkclist.c (write_trust_status): New. (check_signatures_trust): Call new function. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
5cef611858
commit
ae1889320b
4 changed files with 58 additions and 24 deletions
21
g10/tofu.c
21
g10/tofu.c
|
@ -2795,17 +2795,30 @@ tofu_wot_trust_combine (int tofu_base, int wot_base)
|
|||
|
||||
/* Now we only have positive or neutral trust policies. We take
|
||||
the max. */
|
||||
if (tofu == TRUST_ULTIMATE || wot == TRUST_ULTIMATE)
|
||||
if (tofu == TRUST_ULTIMATE)
|
||||
return upper | TRUST_ULTIMATE | TRUST_FLAG_TOFU_BASED;
|
||||
if (wot == TRUST_ULTIMATE)
|
||||
return upper | TRUST_ULTIMATE;
|
||||
if (tofu == TRUST_FULLY || wot == TRUST_FULLY)
|
||||
|
||||
if (tofu == TRUST_FULLY)
|
||||
return upper | TRUST_FULLY | TRUST_FLAG_TOFU_BASED;
|
||||
if (wot == TRUST_FULLY)
|
||||
return upper | TRUST_FULLY;
|
||||
if (tofu == TRUST_MARGINAL || wot == TRUST_MARGINAL)
|
||||
|
||||
if (tofu == TRUST_MARGINAL)
|
||||
return upper | TRUST_MARGINAL | TRUST_FLAG_TOFU_BASED;
|
||||
if (wot == TRUST_MARGINAL)
|
||||
return upper | TRUST_MARGINAL;
|
||||
if (tofu == TRUST_UNDEFINED || wot == TRUST_UNDEFINED)
|
||||
|
||||
if (tofu == TRUST_UNDEFINED)
|
||||
return upper | TRUST_UNDEFINED | TRUST_FLAG_TOFU_BASED;
|
||||
if (wot == TRUST_UNDEFINED)
|
||||
return upper | TRUST_UNDEFINED;
|
||||
|
||||
return upper | TRUST_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
/* Return the validity (TRUST_NEVER, etc.) of the binding
|
||||
<FINGERPRINT, USER_ID>.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue