Fix logic in decode_keys_json re: age_restriction
The client now consumes denoms[] and age_restricted_denoms[], unconditionally.
This commit is contained in:
parent
cdc5bc8ff6
commit
a2b9f090a3
@ -866,26 +866,18 @@ decode_keys_json (const json_t *resp_obj,
|
||||
denom_keys_array = json_object_get (resp_obj,
|
||||
hive[s].name);
|
||||
|
||||
EXITIF (NULL == denom_keys_array &&
|
||||
! hive[s].is_optional_age_restriction);
|
||||
|
||||
if (NULL == denom_keys_array &&
|
||||
hive[s].is_optional_age_restriction)
|
||||
if (NULL == denom_keys_array)
|
||||
continue;
|
||||
|
||||
/* if "age_restricted_denoms" exists, age-restriction better be enabled
|
||||
* (that is: mask non-zero) */
|
||||
EXITIF (NULL != denom_keys_array &&
|
||||
hive[s].is_optional_age_restriction &&
|
||||
0 == key_data->age_mask.mask);
|
||||
|
||||
EXITIF (JSON_ARRAY != json_typeof (denom_keys_array));
|
||||
|
||||
json_array_foreach (denom_keys_array, index, denom_key_obj) {
|
||||
struct TALER_EXCHANGE_DenomPublicKey dk;
|
||||
bool found = false;
|
||||
|
||||
have_age_restricted_denom = true;
|
||||
/* mark that we have at least one age restricted denomination, needed
|
||||
* for the hash calculation and signature verification below. */
|
||||
have_age_restricted_denom |= hive[s].is_optional_age_restriction;
|
||||
|
||||
memset (&dk,
|
||||
0,
|
||||
@ -897,15 +889,6 @@ decode_keys_json (const json_t *resp_obj,
|
||||
&key_data->master_pub,
|
||||
hive[s].hc));
|
||||
|
||||
/* Mark age restriction according where we got this denomination from,
|
||||
* "denoms" or "age_restricted_denoms" */
|
||||
if (hive[s].is_optional_age_restriction)
|
||||
{
|
||||
// dk.age_restricted = true;
|
||||
// dk.age_mask.mask = key_data->age_mask.mask;
|
||||
GNUNET_assert (0 != key_data->age_mask.mask);
|
||||
}
|
||||
|
||||
for (unsigned int j = 0;
|
||||
j<key_data->num_denom_keys;
|
||||
j++)
|
||||
|
Loading…
Reference in New Issue
Block a user