gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (65062e43 -> fc79dd23)


From: gnunet
Subject: [taler-exchange] branch master updated (65062e43 -> fc79dd23)
Date: Tue, 10 Mar 2020 15:28:57 +0100

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

grothoff pushed a change to branch master
in repository exchange.

    from 65062e43 no longer create tables on startup of exchange 
aggregator/httpd
     new f6684c1a actually look at recoup/revocations in libtalerexchange and 
expose the result to clients; make exchange API follow specification
     new fc79dd23 fix typo, remove obsolete option, initialize mpub

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/exchange-tools/taler-exchange-keyup.c    |  6 ++--
 src/exchange/taler-exchange-httpd_keystate.c | 16 ++++++++---
 src/include/taler_exchange_service.h         |  6 ++++
 src/lib/exchange_api_handle.c                | 42 ++++++++++++++++++++++++++--
 src/testing/testing_api_helpers_exchange.c   |  1 -
 5 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/src/exchange-tools/taler-exchange-keyup.c 
b/src/exchange-tools/taler-exchange-keyup.c
index b589214c..b10a139a 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -606,7 +606,7 @@ get_denomination_type_params (const char *ct,
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_time (kcfg,
                                            ct,
-                                           "DURATION_WIDHTRAW",
+                                           "DURATION_WITHDRAW",
                                            &params->duration_withdraw))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
@@ -772,7 +772,7 @@ create_denomkey_issue (
   GNUNET_assert (NULL != dki->denom_priv.rsa_private_key);
   dki->denom_pub.rsa_public_key
     = GNUNET_CRYPTO_rsa_private_key_get_public (
-        dki->denom_priv.rsa_private_key);
+    dki->denom_priv.rsa_private_key);
   GNUNET_CRYPTO_rsa_public_key_hash (dki->denom_pub.rsa_public_key,
                                      &dki->issue.properties.denom_hash);
   dki->issue.properties.master = master_public_key;
@@ -1236,6 +1236,8 @@ run (void *cls,
     global_ret = 1;
     return;
   }
+  GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
+                                      &master_public_key.eddsa_pub);
 
   if (NULL != auditorrequestfile)
   {
diff --git a/src/exchange/taler-exchange-httpd_keystate.c 
b/src/exchange/taler-exchange-httpd_keystate.c
index 75e20ad0..af0920c5 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -909,10 +909,18 @@ revocations_iter (void *cls,
     handle_signal (SIGTERM);
     return GNUNET_SYSERR;
   }
-  GNUNET_assert (0 ==
-                 json_array_append_new (rfc->recoup_array,
-                                        GNUNET_JSON_from_data_auto (
-                                          denom_hash)));
+
+  {
+    json_t *obj;
+
+    obj = json_pack ("{s:o}",
+                     "h_denom_pub",
+                     GNUNET_JSON_from_data_auto (denom_hash));
+    GNUNET_assert (NULL != obj);
+    GNUNET_assert (0 ==
+                   json_array_append_new (rfc->recoup_array,
+                                          obj));
+  }
   return GNUNET_OK;
 }
 
diff --git a/src/include/taler_exchange_service.h 
b/src/include/taler_exchange_service.h
index 311175e4..47847ce5 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -153,6 +153,12 @@ struct TALER_EXCHANGE_DenomPublicKey
    * The applicable fee to refund a coin of this denomination
    */
   struct TALER_Amount fee_refund;
+
+  /**
+   * Set to #GNUNET_YES if this denomination key has been
+   * revoked by the exchange.
+   */
+  int revoked;
 };
 
 
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index ce6ef2e2..3ec3e30b 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -216,7 +216,7 @@ struct TALER_EXCHANGE_Handle
   enum ExchangeHandleState state;
 
   /**
-   * If GNUNET_YES, use fake now given by the user, in
+   * If #GNUNET_YES, use fake now given by the user, in
    * request of "/keys".
    */
   int with_now;
@@ -977,6 +977,7 @@ decode_keys_json (const json_t *resp_obj,
                                     dk.valid_from);
     };
   }
+
   /* parse the auditor information */
   {
     json_t *auditors_array;
@@ -1038,6 +1039,43 @@ decode_keys_json (const json_t *resp_obj,
     };
   }
 
+  /* parse the revocation/recoup information */
+  {
+    json_t *recoup_array;
+    json_t *recoup_info;
+    unsigned int index;
+
+    EXITIF (NULL == (recoup_array =
+                       json_object_get (resp_obj,
+                                        "recoup")));
+    EXITIF (JSON_ARRAY != json_typeof (recoup_array));
+
+    json_array_foreach (recoup_array, index, recoup_info) {
+      struct GNUNET_HashCode h_denom_pub;
+      struct GNUNET_JSON_Specification spec[] = {
+        GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
+                                     &h_denom_pub),
+        GNUNET_JSON_spec_end ()
+      };
+
+      EXITIF (GNUNET_OK !=
+              GNUNET_JSON_parse (recoup_info,
+                                 spec,
+                                 NULL, NULL));
+      for (unsigned int j = 0;
+           j<key_data->num_denom_keys;
+           j++)
+      {
+        if (0 == GNUNET_memcmp (&h_denom_pub,
+                                &key_data->denom_keys[j].h_key))
+        {
+          key_data->denom_keys[j].revoked = GNUNET_YES;
+          break;
+        }
+      }
+    };
+  }
+
   if (check_sig)
   {
     struct TALER_ExchangeKeySetPS ks;
@@ -1259,7 +1297,7 @@ keys_completed_cb (void *cls,
     for (unsigned int i = 0; i<kd_old.num_denom_keys; i++)
       kd.denom_keys[i].key.rsa_public_key
         = GNUNET_CRYPTO_rsa_public_key_dup (
-            kd_old.denom_keys[i].key.rsa_public_key);
+        kd_old.denom_keys[i].key.rsa_public_key);
 
     kd.num_auditors = kd_old.num_auditors;
     kd.auditors = GNUNET_new_array (kd.num_auditors,
diff --git a/src/testing/testing_api_helpers_exchange.c 
b/src/testing/testing_api_helpers_exchange.c
index 911bc6f0..967a4efb 100644
--- a/src/testing/testing_api_helpers_exchange.c
+++ b/src/testing/testing_api_helpers_exchange.c
@@ -763,7 +763,6 @@ TALER_TESTING_setup_with_exchange_cfg (void *cls,
                                        "taler-exchange-httpd",
                                        "taler-exchange-httpd",
                                        "-c", setup_ctx->config_filename,
-                                       "-i",
                                        NULL);
 
   if (GNUNET_OK !=

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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