aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-11-07 19:07:45 +0000
committerWerner Koch <[email protected]>2023-11-07 19:38:27 +0000
commit387ee7dcbd77d19687af967901ed4818cbdb8b3c (patch)
tree3fc63cd303b2d07454794064e4e6528df2dbf42c /g10/trustdb.c
parentdoc: Use the em dash to mark a break in a sentence. (diff)
parentw32: Use utf8 for the asctimestamp function. (diff)
downloadgnupg-387ee7dcbd77d19687af967901ed4818cbdb8b3c.tar.gz
gnupg-387ee7dcbd77d19687af967901ed4818cbdb8b3c.zip
Merge branch 'STABLE-BRANCH-2-4'
* common/b64dec.c (b64decode): Move to ... * common/miscellaneous.c: here. * common/t-b64.c: Re-inroduce and keep only the b64decode test code.
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 051a534f9..e846abe82 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -730,7 +730,7 @@ tdb_check_or_update (ctrl_t ctrl)
if (opt.interactive)
update_trustdb (ctrl);
else if (!opt.no_auto_check_trustdb)
- check_trustdb (ctrl);
+ check_trustdb (ctrl);
}
}
@@ -983,6 +983,7 @@ update_min_ownertrust (ctrl_t ctrl, u32 *kid, unsigned int new_trust)
/*
* Clear the ownertrust and min_ownertrust values.
+ * Also schedule a revalidation if a stale validity record exists.
*
* Return: True if a change actually happened.
*/
@@ -1016,6 +1017,26 @@ tdb_clear_ownertrusts (ctrl_t ctrl, PKT_public_key *pk)
do_sync ();
return 1;
}
+ else
+ {
+ /* Check whether we have a stale RECTYPE_VALID for that key
+ * and if its validity ist set, schedule a revalidation. */
+ ulong recno = rec.r.trust.validlist;
+ while (recno)
+ {
+ read_record (recno, &rec, RECTYPE_VALID);
+ if (rec.r.valid.validity)
+ break;
+ recno = rec.r.valid.next;
+ }
+ if (recno)
+ {
+ if (DBG_TRUST)
+ log_debug ("stale validity value detected"
+ " - scheduling check\n");
+ tdb_revalidation_mark (ctrl);
+ }
+ }
}
else if (gpg_err_code (err) != GPG_ERR_NOT_FOUND)
{