commit 0aa3ccec0d6097ca0ea7dadb867ffeed979a3b4c
parent faaf0dc757e0cc5589b1bdb15d73e457af0a533e
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
Date: Mon, 1 Apr 2024 23:42:48 +0200
minor change in keys
Diffstat:
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c
@@ -1078,7 +1078,11 @@ helper_rsa_cb (
}
GNUNET_assert (NULL != sm_pub);
check_donation_unit_rsa_sm_pub (sm_pub);
+
hd = GNUNET_new (struct DH_DonationUnitKey);
+ hd->validity_year = GNUNET_TIME_time_to_year (start_time.abs_time);
+ hd->lost = false;
+ hd->value = value;
// hd->start_time = start_time;
// hd->validity_duration = validity_duration;
// hd->h_details.h_rsa = *h_rsa;
@@ -1088,12 +1092,13 @@ helper_rsa_cb (
GNUNET_CRYPTO_bsign_pub_incref (bs_pub);
DONAU_donation_unit_pub_hash (&hd->donation_unit_pub,
&hd->h_donation_unit_pub);
+
qs = DH_plugin->insert_donation_unit (
DH_plugin->cls,
&hd->h_donation_unit_pub,
&hd->donation_unit_pub,
- GNUNET_TIME_time_to_year (start_time.abs_time),
- &value);
+ hd->validity_year,
+ &hd->value);
if (qs < 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to insert donation units\n");
@@ -1179,15 +1184,19 @@ helper_cs_cb (
hd = GNUNET_CONTAINER_multihashmap_get (hs->cs_keys,
&h_cs->hash);
- // if (NULL != hd)
- // {
- // /* should be just an update (revocation!), so update existing entry */
- // hd->validity_duration = validity_duration;
- // return;
- // }
+ if (NULL != hd)
+ {
+ /* should be just an update (revocation!), so update existing entry */
+ hd->lost = false;
+ return;
+ }
GNUNET_assert (NULL != sm_pub);
check_donation_unit_cs_sm_pub (sm_pub);
+
hd = GNUNET_new (struct DH_DonationUnitKey);
+ hd->validity_year = GNUNET_TIME_time_to_year (start_time.abs_time);
+ hd->lost = false;
+ hd->value = value;
// hd->start_time = start_time;
// hd->validity_duration = validity_duration;
// hd->h_details.h_cs = *h_cs;
@@ -1196,12 +1205,13 @@ helper_cs_cb (
= GNUNET_CRYPTO_bsign_pub_incref (bs_pub);
DONAU_donation_unit_pub_hash (&hd->donation_unit_pub,
&hd->h_donation_unit_pub);
+
qs = DH_plugin->insert_donation_unit (
DH_plugin->cls,
&hd->h_donation_unit_pub,
&hd->donation_unit_pub,
- GNUNET_TIME_time_to_year (start_time.abs_time),
- &value);
+ hd->validity_year,
+ &hd->value);
if (qs < 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to insert donation units\n");