diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-20 12:41:44 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-20 12:41:50 +0100 |
commit | 303f105985bd31f23d3b1ba9c86b77a23f142abf (patch) | |
tree | 93afaced896eff448e8ba2e88a86485c02c9543a /src/util/taler-exchange-secmod-eddsa.c | |
parent | 2c8bd158d9b9eb7be15dc91a869b8afd834f7bd1 (diff) | |
download | exchange-303f105985bd31f23d3b1ba9c86b77a23f142abf.tar.xz |
-code cleanup
Diffstat (limited to 'src/util/taler-exchange-secmod-eddsa.c')
-rw-r--r-- | src/util/taler-exchange-secmod-eddsa.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c index a231c9f9a..043e0000a 100644 --- a/src/util/taler-exchange-secmod-eddsa.c +++ b/src/util/taler-exchange-secmod-eddsa.c @@ -281,6 +281,14 @@ handle_sign_request (struct TES_Client *client, if (0 != key->rc) break; /* do later */ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Removing past key %s (expired %s ago)\n", + key->filename, + GNUNET_STRINGS_relative_time_to_string ( + GNUNET_TIME_absolute_get_duration ( + GNUNET_TIME_absolute_add (key->anchor, + duration)), + GNUNET_YES)); GNUNET_CONTAINER_DLL_remove (keys_head, keys_tail, key); @@ -710,6 +718,14 @@ update_keys (void *cls) key_gen++; wake = true; } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Removing past key %s (expired %s ago)\n", + keys_head->filename, + GNUNET_STRINGS_relative_time_to_string ( + GNUNET_TIME_absolute_get_duration ( + GNUNET_TIME_absolute_add (keys_head->anchor, + duration)), + GNUNET_YES)); purge_key (keys_head); } GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock)); @@ -1063,7 +1079,15 @@ run (void *cls, GNUNET_DISK_directory_scan (keydir, &import_key, NULL); - + if ( (NULL != keys_head) && + (GNUNET_TIME_absolute_is_future (keys_head->anchor)) ) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Existing anchor is in the future. Refusing to start\n"); + global_ret = EXIT_FAILURE; + GNUNET_SCHEDULER_shutdown (); + return; + } /* start job to keep keys up-to-date; MUST be run before the #listen_task, hence with priority. */ keygen_task = GNUNET_SCHEDULER_add_with_priority ( |