gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: implement 'lost' field for #7883


From: gnunet
Subject: [taler-exchange] branch master updated: implement 'lost' field for #7883
Date: Tue, 11 Jul 2023 20:36:55 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a5451527 implement 'lost' field for #7883
a5451527 is described below

commit a5451527cb26d876388567dc26113a83e0b79e15
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 11 20:36:52 2023 +0200

    implement 'lost' field for #7883
---
 doc/prebuilt                             |  2 +-
 src/exchange/taler-exchange-httpd_keys.c | 18 +++++++++++++++++-
 src/include/taler_exchange_service.h     |  7 +++++++
 src/lib/exchange_api_handle.c            |  4 ++++
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/doc/prebuilt b/doc/prebuilt
index fa4729db..66e99d09 160000
--- a/doc/prebuilt
+++ b/doc/prebuilt
@@ -1 +1 @@
-Subproject commit fa4729db5637c82d5fc6f5bb7021f6c350c8c5a6
+Subproject commit 66e99d09d4351bb6e6c5fd442f14ec7cf1363a81
diff --git a/src/exchange/taler-exchange-httpd_keys.c 
b/src/exchange/taler-exchange-httpd_keys.c
index d1d8edc2..2c705829 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2960,8 +2960,18 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
         /* Now that we have found/created the right group, add the
            denomination to the list */
         {
+          struct HelperDenomination *hd;
           struct GNUNET_JSON_PackSpec key_spec;
-
+          bool private_key_lost;
+
+          hd = GNUNET_CONTAINER_multihashmap_get (ksh->helpers->denom_keys,
+                                                  &dk->h_denom_pub.hash);
+          private_key_lost
+            = (NULL == hd) ||
+              GNUNET_TIME_absolute_is_past (
+                GNUNET_TIME_absolute_add (
+                  hd->start_time.abs_time,
+                  hd->validity_duration));
           switch (meta.cipher)
           {
           case TALER_DENOMINATION_RSA:
@@ -2984,6 +2994,12 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
           entry = GNUNET_JSON_PACK (
             GNUNET_JSON_pack_data_auto ("master_sig",
                                         &dk->master_sig),
+            GNUNET_JSON_pack_allow_null (
+              private_key_lost
+              ? GNUNET_JSON_pack_bool ("lost",
+                                       true)
+              : GNUNET_JSON_pack_string ("dummy",
+                                         NULL)),
             GNUNET_JSON_pack_timestamp ("stamp_start",
                                         dk->meta.start),
             GNUNET_JSON_pack_timestamp ("stamp_expire_withdraw",
diff --git a/src/include/taler_exchange_service.h 
b/src/include/taler_exchange_service.h
index ac4bc6c3..befe9719 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -120,6 +120,13 @@ struct TALER_EXCHANGE_DenomPublicKey
    */
   struct TALER_DenomFeeSet fees;
 
+  /**
+   * Set to true if the private denomination key has been
+   * lost by the exchange and thus the key cannot be
+   * used for withdrawing at this time.
+   */
+  bool lost;
+
   /**
    * Set to true if this denomination key has been
    * revoked by the exchange.
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 996e6273..6d1e7b69 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -246,6 +246,10 @@ parse_json_denomkey_partially (
                                 &denom_key->valid_from),
     GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
                                 &denom_key->expire_legal),
+    GNUNET_JSON_spec_mark_optional (
+      GNUNET_JSON_spec_bool ("lost",
+                             &denom_key->lost),
+      NULL),
     TALER_JSON_spec_denom_pub_cipher (NULL,
                                       cipher,
                                       &denom_key->key),

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]