aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-12 22:43:04 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-12 22:43:04 +0100
commit8bed4152fe86eb96bdef74a845059f210fba5612 (patch)
treef07ee0e76c900ddf037723cdc19ec2e07b7e0d9e /src/lib/exchange_api_handle.c
parent0847e16ea5d338c4281963d2efa0bd94c37bd188 (diff)
allow empty signkeys array
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 78d1fcfd7..3d386e09f 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -535,6 +535,9 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
NULL, NULL))
{
GNUNET_break_op (0);
+ json_dumpf (auditor_obj,
+ stderr,
+ JSON_INDENT (2));
return GNUNET_SYSERR;
}
auditor->auditor_url = GNUNET_strdup (auditor_url);
@@ -862,17 +865,19 @@ decode_keys_json (const json_t *resp_obj,
json_object_get (resp_obj,
"signkeys")));
EXITIF (JSON_ARRAY != json_typeof (sign_keys_array));
- EXITIF (0 == (key_data->num_sign_keys =
- json_array_size (sign_keys_array)));
- key_data->sign_keys
- = GNUNET_new_array (key_data->num_sign_keys,
- struct TALER_EXCHANGE_SigningPublicKey);
- json_array_foreach (sign_keys_array, index, sign_key_obj) {
- EXITIF (GNUNET_SYSERR ==
- parse_json_signkey (&key_data->sign_keys[index],
- check_sig,
- sign_key_obj,
- &key_data->master_pub));
+ if (0 != (key_data->num_sign_keys =
+ json_array_size (sign_keys_array)))
+ {
+ key_data->sign_keys
+ = GNUNET_new_array (key_data->num_sign_keys,
+ struct TALER_EXCHANGE_SigningPublicKey);
+ json_array_foreach (sign_keys_array, index, sign_key_obj) {
+ EXITIF (GNUNET_SYSERR ==
+ parse_json_signkey (&key_data->sign_keys[index],
+ check_sig,
+ sign_key_obj,
+ &key_data->master_pub));
+ }
}
}