From 37c268ed6ac44240df35b47c74bb80ccfee8d598 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 18 Apr 2002 11:01:56 +0000 Subject: [PATCH] * trustdb.c (validate_keys): Never schedule a nextcheck into the past. --- g10/ChangeLog | 3 +++ g10/trustdb.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 7cd5f711e..00ae585c9 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,8 @@ 2002-04-18 Werner Koch + * trustdb.c (validate_keys): Never schedule a nextcheck into the + past. + * getkey.c (premerge_public_with_secret): Fixed 0x12345678! syntax for use with secret keys. (lookup): Advance the searchmode after a search FIRST. diff --git a/g10/trustdb.c b/g10/trustdb.c index df49231d1..61d6d14ae 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -1338,8 +1338,9 @@ validate_keys (int interactive) int key_count; int ot_unknown, ot_undefined, ot_never, ot_marginal, ot_full, ot_ultimate; KeyHashTable visited; - u32 next_expire; + u32 start_time, next_expire; + start_time = make_timestamp (); next_expire = 0xffffffff; /* set next expire to the year 2106 */ visited = new_key_hash_table (); /* Fixme: Instead of always building a UTK list, we could just build it @@ -1480,7 +1481,11 @@ validate_keys (int interactive) release_key_hash_table (visited); if (!rc && !quit) /* mark trustDB as checked */ { - if (next_expire == 0xffffffff) + /* If there was an inconsistency in the trustdb it might happen + that the next_expire is set to the past; however at this point + we did checked it and thus we can flag the trustdb with no + schedule required. */ + if (next_expire == 0xffffffff || next_expire < start_time ) tdbio_write_nextcheck (0); else { @@ -1492,3 +1497,5 @@ validate_keys (int interactive) } return rc; } + +