diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-11-21 10:01:31 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2021-11-21 10:01:31 +0100 |
commit | 1caeaec2573c33bc62966b58a703ee3f0fab5e70 (patch) | |
tree | 5f5e60d63560610588491380409fc169c0710340 | |
parent | ae2ce4aaeed35fd077cac016795f069b35189756 (diff) |
fix #7099
m--------- | contrib/gana | 0 | ||||
-rw-r--r-- | src/util/taler-exchange-secmod-eddsa.c | 23 |
2 files changed, 16 insertions, 7 deletions
diff --git a/contrib/gana b/contrib/gana -Subproject 597e273cc73122ba5cd0023f37b43b4f3784fe0 +Subproject 478c0bd987c8c1135e5691c31abaa3f4ddce6f2 diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c index 043e0000a..c8d283770 100644 --- a/src/util/taler-exchange-secmod-eddsa.c +++ b/src/util/taler-exchange-secmod-eddsa.c @@ -655,10 +655,16 @@ create_key (void) static struct GNUNET_TIME_Absolute key_action_time (void) { - if (NULL == keys_head) + struct Key *nxt; + + nxt = keys_head; + while ( (NULL != nxt) && + (nxt->purge) ) + nxt = nxt->next; + if (NULL == nxt) return GNUNET_TIME_UNIT_ZERO_ABS; return GNUNET_TIME_absolute_min ( - GNUNET_TIME_absolute_add (keys_head->anchor, + GNUNET_TIME_absolute_add (nxt->anchor, duration), GNUNET_TIME_absolute_subtract ( GNUNET_TIME_absolute_subtract ( @@ -678,6 +684,7 @@ static void update_keys (void *cls) { bool wake = false; + struct Key *nxt; (void) cls; keygen_task = NULL; @@ -707,10 +714,11 @@ update_keys (void *cls) return; } } + nxt = keys_head; /* remove expired keys */ - while ( (NULL != keys_head) && + while ( (NULL != nxt) && GNUNET_TIME_absolute_is_past ( - GNUNET_TIME_absolute_add (keys_head->anchor, + GNUNET_TIME_absolute_add (nxt->anchor, duration))) { if (! wake) @@ -720,13 +728,14 @@ update_keys (void *cls) } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Removing past key %s (expired %s ago)\n", - keys_head->filename, + nxt->filename, GNUNET_STRINGS_relative_time_to_string ( GNUNET_TIME_absolute_get_duration ( - GNUNET_TIME_absolute_add (keys_head->anchor, + GNUNET_TIME_absolute_add (nxt->anchor, duration)), GNUNET_YES)); - purge_key (keys_head); + purge_key (nxt); + nxt = nxt->next; } GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock)); if (wake) |