commit 65d08ff221caa2a432551624c189ebf93332ee4a
parent 4986535c6a73e3b6f632aa502ccf1abd5c0fd116
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Fri, 17 Jul 2026 19:17:35 +0200
fix expiration logic
Diffstat:
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/donaudb/test_donaudb.c b/src/donaudb/test_donaudb.c
@@ -175,7 +175,7 @@ static void
run (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
- struct GNUNET_TIME_Timestamp now;
+ unsigned int year;
// Charity information
json_t *charities;
@@ -352,10 +352,14 @@ run (void *cls)
/* test insert signing key */
RND_BLK (&donau_pub);
- now = GNUNET_TIME_timestamp_get ();
- sk_meta.expire_legal = now;
- sk_meta.expire_sign = now;
- sk_meta.valid_from = now;
+ year = GNUNET_TIME_get_current_year ();
+ sk_meta.expire_legal = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_year_to_time (year + 5));
+ sk_meta.expire_sign = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_year_to_time (year + 1));
+ sk_meta.valid_from = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_year_to_time (year));
+
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
DONAUDB_insert_signing_key (ctx,
diff --git a/src/lib/donau_api_handle.c b/src/lib/donau_api_handle.c
@@ -921,6 +921,7 @@ DONAU_keys_from_json (const json_t *j)
&compat))
{
GNUNET_break (0);
+ GNUNET_free (keys);
return NULL;
}
keys->rc = 1;