[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: fixing the hard issues
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: fixing the hard issues |
Date: |
Fri, 12 Jan 2024 16:10:30 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository donau.
The following commit(s) were added to refs/heads/master by this push:
new 8d3b831 fixing the hard issues
8d3b831 is described below
commit 8d3b831c5bed4159c0a5329723a4924a67a9a363
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jan 12 16:10:27 2024 +0100
fixing the hard issues
---
contrib/gana | 2 +-
src/include/donau_json_lib.h | 12 ++++----
src/lib/donau_api_handle.c | 72 ++++++++++++++++++++++++--------------------
3 files changed, 46 insertions(+), 40 deletions(-)
diff --git a/contrib/gana b/contrib/gana
index 40f6cf1..8368009 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 40f6cf1015231663064eda98aa1e403cddd7b970
+Subproject commit 836800945d80db9c0160a10a84edc1a086339187
diff --git a/src/include/donau_json_lib.h b/src/include/donau_json_lib.h
index 51b1d3a..b5acb3f 100644
--- a/src/include/donau_json_lib.h
+++ b/src/include/donau_json_lib.h
@@ -18,8 +18,8 @@
* @brief helper functions for JSON processing using libjansson
* @author Lukas Matyja
*/
-#ifndef TALER_JSON_LIB_H_
-#define TALER_JSON_LIB_H_
+#ifndef DONAU_JSON_LIB_H_
+#define DONAU_JSON_LIB_H_
#include <jansson.h>
#include <gnunet/gnunet_json_lib.h>
@@ -56,8 +56,8 @@ DONAU_JSON_spec_donation_unit_pub_cipher (
*/
struct GNUNET_JSON_Specification
DONAU_JSON_spec_donation_unit_group (const char *field,
- const char *currency,
- struct DONAU_DonationUnitGroup *group);
+ const char *currency,
+ struct DONAU_DonationUnitGroup *group);
/**
* Generate packer instruction for a JSON field of type
@@ -69,6 +69,6 @@ DONAU_JSON_spec_donation_unit_group (const char *field,
*/
struct GNUNET_JSON_PackSpec
DONAU_JSON_pack_uint32 (const char *name,
- uint64_t num);
+ uint64_t num);
-#endif
\ No newline at end of file
+#endif
diff --git a/src/lib/donau_api_handle.c b/src/lib/donau_api_handle.c
index db23973..cb0fc10 100644
--- a/src/lib/donau_api_handle.c
+++ b/src/lib/donau_api_handle.c
@@ -68,7 +68,7 @@
* how long do we assume the reply to be valid at least?
*/
#define MINIMUM_EXPIRATION GNUNET_TIME_relative_multiply ( \
- GNUNET_TIME_UNIT_MINUTES, 2)
+ GNUNET_TIME_UNIT_MINUTES, 2)
/**
@@ -118,16 +118,16 @@ struct DONAU_GetKeysHandle
#define EXITIF(cond) \
- do { \
- if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
- } while (0)
+ do { \
+ if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
+ } while (0)
/**
* Parse a donau's signing key encoded in JSON.
*
* @param[out] sign_key where to return the result
* @param sign_key_obj json to parse
- * @return #GNUNET_OK if all is fine, #GNUNET_SYSERR if @a sign_key_obj
+ * @return #GNUNET_OK if all is fine, #GNUNET_SYSERR if @a sign_key_obj
* is malformed.
*/
static enum GNUNET_GenericReturnValue
@@ -138,7 +138,7 @@ parse_json_signkey (struct
DONAU_SigningPublicKeyAndValidity *sign_key,
GNUNET_JSON_spec_fixed_auto ("key",
&sign_key->key),
GNUNET_JSON_spec_uint32 ("year",
- &sign_key->year),
+ &sign_key->year),
GNUNET_JSON_spec_end ()
};
@@ -153,6 +153,7 @@ parse_json_signkey (struct
DONAU_SigningPublicKeyAndValidity *sign_key,
return GNUNET_OK;
}
+
/**
* Compare two donation unit keys.
*
@@ -184,6 +185,7 @@ donation_units_cmp (const struct
DONAU_DonationUnitInformation *donation_unit1,
&tmp2);
}
+
/**
* Decode the JSON in @a resp_obj from the /keys response
* and store the data in the @a key_data.
@@ -267,7 +269,7 @@ decode_keys_json (const json_t *resp_obj,
&sign_keys_array),
GNUNET_JSON_spec_string (
"currency",
- ¤cy), //&key_data->currency instead?
+ ¤cy), // &key_data->currency instead?
GNUNET_JSON_spec_array_const (
"donation_units_group",
&donation_units_by_group),
@@ -334,7 +336,7 @@ decode_keys_json (const json_t *resp_obj,
json_t *group_obj;
unsigned int group_idx;
- json_array_foreach (donation_units_by_group,
+ json_array_foreach (donation_units_by_group,
group_idx, group_obj)
{
/* First, parse { cipher, value} of the current
@@ -342,9 +344,9 @@ decode_keys_json (const json_t *resp_obj,
struct DONAU_DonationUnitGroup group = {0}; // what must be given to be
a part of a group?
const json_t *donation_unit_keys_array;
struct GNUNET_JSON_Specification group_spec[] = {
- // DONAU_JSON_spec_donation_unit_group (NULL,
- // key_data->currency,
- // &group),
+ DONAU_JSON_spec_donation_unit_group (NULL,
+ key_data->currency,
+ &group),
GNUNET_JSON_spec_array_const ("donation_units",
&donation_unit_keys_array),
GNUNET_JSON_spec_end ()
@@ -359,9 +361,9 @@ decode_keys_json (const json_t *resp_obj,
NULL));
/* Now, parse the individual donation units */
- json_array_foreach (donation_unit_keys_array,
- index,
- donation_unit_key_obj)
+ json_array_foreach (donation_unit_keys_array,
+ index,
+ donation_unit_key_obj)
{
/* Set the common fields from the group for this particular
donation unit. Required to make the validity check inside
@@ -372,20 +374,20 @@ decode_keys_json (const json_t *resp_obj,
bool found = false;
struct GNUNET_JSON_Specification kspec[] = {
- GNUNET_JSON_spec_uint32("year", &dk.year),
- // DONAU_JSON_spec_donation_unit_pub_cipher (NULL,
- // group.cipher,
- // &dk->key),
+ GNUNET_JSON_spec_uint32 ("year", &dk.year),
+ DONAU_JSON_spec_donation_unit_pub_cipher (NULL,
+ group.cipher,
+ &dk.key),
GNUNET_JSON_spec_end ()
};
if (GNUNET_OK !=
GNUNET_JSON_parse (donation_unit_key_obj,
- kspec,
- NULL, NULL))
+ kspec,
+ NULL, NULL))
{
GNUNET_break_op (0);
- EXITIF(1);
+ EXITIF (1);
}
for (unsigned int j = 0;
@@ -393,7 +395,7 @@ decode_keys_json (const json_t *resp_obj,
j++)
{
if (0 == donation_units_cmp (&dk,
-
&key_data->donation_unit_keys[j]))
+ &key_data->donation_unit_keys[j]))
{
found = true;
break;
@@ -407,14 +409,16 @@ decode_keys_json (const json_t *resp_obj,
continue;
}
- if (key_data->donation_unit_keys_size ==
key_data->num_donation_unit_keys)
+ if (key_data->donation_unit_keys_size ==
+ key_data->num_donation_unit_keys)
GNUNET_array_grow (key_data->donation_unit_keys,
key_data->donation_unit_keys_size,
key_data->donation_unit_keys_size * 2 + 2);
key_data->donation_unit_keys[key_data->num_donation_unit_keys++] = dk;
- TALER_LOG_DEBUG ("Adding donation unit key that is valid for the year
%d\n",
- dk.year);
+ TALER_LOG_DEBUG (
+ "Adding donation unit key that is valid for the year %d\n",
+ dk.year);
}; /* end of json_array_foreach over donation units */
@@ -570,7 +574,7 @@ struct DONAU_GetKeysHandle *
DONAU_get_keys (
struct GNUNET_CURL_Context *ctx,
const char *url,
- //struct DONAU_Keys *last_keys, -> temporarily removed
+ // struct DONAU_Keys *last_keys, -> temporarily removed
DONAU_GetKeysCallback cert_cb,
void *cert_cb_cls)
{
@@ -645,7 +649,7 @@ DONAU_get_donation_unit_key (
for (unsigned int i = 0; i<keys->num_donation_unit_keys; i++)
if (0 ==
DONAU_donation_unit_pub_cmp (pk,
- &keys->donation_unit_keys[i].key))
+ &keys->donation_unit_keys[i].key))
return &keys->donation_unit_keys[i];
return NULL;
}
@@ -660,7 +664,7 @@ DONAU_copy_donation_unit_key (
copy = GNUNET_new (struct DONAU_DonationUnitInformation);
*copy = *key;
DONAU_donation_unit_pub_deep_copy (©->key, // only increments rc, still
same pointer
- &key->key);
+ &key->key);
return copy;
}
@@ -682,7 +686,8 @@ DONAU_get_donation_unit_key_by_hash (
for (unsigned int i = 0; i<keys->num_donation_unit_keys; i++)
// memcmp needs two pointer of the same type
if (0 == GNUNET_memcmp (&hc->hash,
-
&keys->donation_unit_keys[i].key.bsign_pub_key->pub_key_hash))
+ &keys->donation_unit_keys[i].key.bsign_pub_key->
+ pub_key_hash))
return &keys->donation_unit_keys[i];
return NULL;
}
@@ -852,7 +857,7 @@ DONAU_keys_to_json (const struct DONAU_Keys *kd)
GNUNET_JSON_pack_data_auto ("key",
&sk->key),
GNUNET_JSON_pack_uint64 ("year",
- sk->year));
+ sk->year));
GNUNET_assert (NULL != signkey);
GNUNET_assert (0 ==
json_array_append_new (signkeys,
@@ -868,7 +873,8 @@ DONAU_keys_to_json (const struct DONAU_Keys *kd)
false);
for (unsigned int i = 0; i<kd->num_donation_unit_keys; i++)
{
- const struct DONAU_DonationUnitInformation *dk =
&kd->donation_unit_keys[i];
+ const struct DONAU_DonationUnitInformation *dk =
+ &kd->donation_unit_keys[i];
struct DONAU_DonationUnitGroup meta = {
.cipher = dk->key.bsign_pub_key->cipher,
.value = dk->value
@@ -880,7 +886,7 @@ DONAU_keys_to_json (const struct DONAU_Keys *kd)
// get hash of meta data
DONAU_donation_unit_group_get_key (&meta,
- &key);
+ &key);
gd = GNUNET_CONTAINER_multihashmap_get (dbg,
&key);
@@ -921,7 +927,7 @@ DONAU_keys_to_json (const struct DONAU_Keys *kd)
}
donation_unit = GNUNET_JSON_PACK (
GNUNET_JSON_pack_uint64 ("year",
- dk->year),
+ dk->year),
key_spec
);
// add entry into the donation unit group
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-donau] branch master updated: fixing the hard issues,
gnunet <=