aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-08-09 18:42:38 +0200
committerChristian Grothoff <christian@grothoff.org>2015-08-09 18:42:38 +0200
commit30959d1380ed79d71baee10ec547027b4911c760 (patch)
tree6565c3a2e036d00a1aa258acc81b534bcfe81a4a
parenta7d36ed906da0b9603799cdd07e30ea1ffbd49b5 (diff)
fix array dimensions to match server expecations, fix server to report location of parse errors more precisely
-rw-r--r--src/mint-lib/mint_api_refresh.c34
-rw-r--r--src/mint/taler-mint-httpd_refresh.c2
2 files changed, 27 insertions, 9 deletions
diff --git a/src/mint-lib/mint_api_refresh.c b/src/mint-lib/mint_api_refresh.c
index e5e9b291b..294ca06e9 100644
--- a/src/mint-lib/mint_api_refresh.c
+++ b/src/mint-lib/mint_api_refresh.c
@@ -1438,11 +1438,15 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
json_array_append (melt_coins,
melted_coin_to_json (&md->melt_session_hash,
mc));
+ }
- /* now transfer_pubs */
+ /* now transfer_pubs */
+ for (j=0;j<TALER_CNC_KAPPA;j++)
+ {
tmp = json_array ();
- for (j=0;j<TALER_CNC_KAPPA;j++)
+ for (i=0;i<md->num_melted_coins;i++)
{
+ const struct MeltedCoin *mc = &md->melted_coins[i];
struct TALER_TransferPublicKeyP transfer_pub;
GNUNET_CRYPTO_ecdhe_key_get_public (&mc->transfer_priv[j].ecdhe_priv,
@@ -1453,11 +1457,15 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
}
json_array_append (transfer_pubs,
tmp);
+ }
- /* now secret_encs */
+ /* now secret_encs */
+ for (j=0;j<TALER_CNC_KAPPA;j++)
+ {
tmp = json_array ();
- for (j=0;j<TALER_CNC_KAPPA;j++)
+ for (i=0;i<md->num_melted_coins;i++)
{
+ const struct MeltedCoin *mc = &md->melted_coins[i];
struct TALER_EncryptedLinkSecretP els;
struct TALER_TransferSecretP trans_sec;
@@ -1475,16 +1483,20 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
json_array_append (secret_encs,
tmp);
}
+
+ /* now new_denoms */
for (i=0;i<md->num_fresh_coins;i++)
{
- /* now new_denoms */
json_array_append (new_denoms,
TALER_json_from_rsa_public_key
(md->fresh_pks[i].rsa_public_key));
+ }
- /* now link_encs */
+ /* now link_encs */
+ for (j=0;j<TALER_CNC_KAPPA;j++)
+ {
tmp = json_array ();
- for (j=0;j<TALER_CNC_KAPPA;j++)
+ for (i=0;i<md->num_fresh_coins;i++)
{
const struct FreshCoin *fc = &md->fresh_coins[j][i];
struct TALER_RefreshLinkDecrypted rld;
@@ -1508,10 +1520,13 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
}
json_array_append (link_encs,
tmp);
+ }
- /* now coin_evs */
+ /* now coin_evs */
+ for (j=0;j<TALER_CNC_KAPPA;j++)
+ {
tmp = json_array ();
- for (j=0;j<TALER_CNC_KAPPA;j++)
+ for (i=0;i<md->num_fresh_coins;i++)
{
const struct FreshCoin *fc = &md->fresh_coins[j][i];
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -1536,6 +1551,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
json_array_append (coin_evs,
tmp);
}
+
/* finally, assemble main JSON request from constitutent arrays */
melt_obj = json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o}",
"new_denoms", new_denoms,
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c
index 687fb998d..d870f3a33 100644
--- a/src/mint/taler-mint-httpd_refresh.c
+++ b/src/mint/taler-mint-httpd_refresh.c
@@ -700,6 +700,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
JSON_ARRAY, &coin_detail);
if (GNUNET_OK != res)
{
+ GNUNET_break_op (0);
TMH_PARSE_release_data (spec);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
@@ -711,6 +712,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
JSON_ARRAY, &coin_detail);
if (GNUNET_OK != res)
{
+ GNUNET_break_op (0);
TMH_PARSE_release_data (spec);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}