1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-28 22:49:59 +01:00

g10: Always trust ultimately trusted keys.

* g10/tofu.c (get_trust): Always return TRUST_ULTIMATE for ultimately
trusted keys.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
This commit is contained in:
Neal H. Walfield 2016-08-31 13:53:36 +02:00
parent 5b48960a8a
commit 28c235ae75

View File

@ -1543,30 +1543,30 @@ get_trust (tofu_dbs_t dbs, PKT_public_key *pk,
&& _tofu_GET_TRUST_ERROR != TRUST_ULTIMATE); && _tofu_GET_TRUST_ERROR != TRUST_ULTIMATE);
policy = get_policy (dbs, fingerprint, email, &conflict); policy = get_policy (dbs, fingerprint, email, &conflict);
if (policy == TOFU_POLICY_AUTO || policy == TOFU_POLICY_NONE) {
{ /* See if the key is ultimately trusted. If so, we're done. */ /* See if the key is ultimately trusted. If so, we're done. */
u32 kid[2]; u32 kid[2];
keyid_from_pk (pk, kid); keyid_from_pk (pk, kid);
if (tdb_keyid_is_utk (kid)) if (tdb_keyid_is_utk (kid))
{ {
if (policy == TOFU_POLICY_NONE) if (policy == TOFU_POLICY_NONE)
{ {
if (record_binding (dbs, fingerprint, email, user_id, if (record_binding (dbs, fingerprint, email, user_id,
TOFU_POLICY_AUTO, 0) != 0) TOFU_POLICY_AUTO, 0) != 0)
{ {
log_error (_("error setting TOFU binding's trust level" log_error (_("error setting TOFU binding's trust level"
" to %s\n"), "auto"); " to %s\n"), "auto");
trust_level = _tofu_GET_TRUST_ERROR; trust_level = _tofu_GET_TRUST_ERROR;
goto out; goto out;
} }
} }
trust_level = TRUST_ULTIMATE; trust_level = TRUST_ULTIMATE;
goto out; goto out;
} }
} }
if (policy == TOFU_POLICY_AUTO) if (policy == TOFU_POLICY_AUTO)
{ {