aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_refresh.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-27 18:35:17 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-27 18:35:17 +0100
commitc3731d0df7e03561c7da777b5f75ba53206a38b5 (patch)
tree751e00e70f0fde8a7c11faf6fd0a46ed2aaad361 /src/mint/taler-mint-httpd_refresh.c
parent16817ef0d12ee1b51203f96b0dd3708c1dae3509 (diff)
implementing varsize link data
Diffstat (limited to 'src/mint/taler-mint-httpd_refresh.c')
-rw-r--r--src/mint/taler-mint-httpd_refresh.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c
index 40737ae31..42a224f32 100644
--- a/src/mint/taler-mint-httpd_refresh.c
+++ b/src/mint/taler-mint-httpd_refresh.c
@@ -541,6 +541,9 @@ TALER_MINT_handler_refresh_commit (struct RequestHandler *rh,
sizeof (struct RefreshCommitCoin));
for (j = 0; j < num_newcoins; j++)
{
+ char *link_end;
+ size_t link_enc_size;
+
res = GNUNET_MINT_parse_navigate_json (connection, root,
JNAV_FIELD, "coin_evs",
JNAV_INDEX, (int) i,
@@ -565,9 +568,9 @@ TALER_MINT_handler_refresh_commit (struct RequestHandler *rh,
JNAV_FIELD, "link_encs",
JNAV_INDEX, (int) i,
JNAV_INDEX, (int) j,
- JNAV_RET_DATA,
- commit_coin[i][j].link_enc,
- TALER_REFRESH_LINK_LENGTH);
+ JNAV_RET_DATA_VAR,
+ &link_enc,
+ &link_enc_size);
if (GNUNET_OK != res)
{
// FIXME: return 'internal error'?
@@ -575,13 +578,13 @@ TALER_MINT_handler_refresh_commit (struct RequestHandler *rh,
GNUNET_CRYPTO_hash_context_abort (hash_context);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
+ // FIXME: convert link_enc / link_enc_size to
+ // commit_coin[i][j].refresh_link!
+
GNUNET_CRYPTO_hash_context_read (hash_context,
commit_coin[i][j].link_enc,
TALER_REFRESH_LINK_LENGTH);
- commit_coin[i][j].cnc_index = i;
- commit_coin[i][j].newcoin_index = j;
- commit_coin[i][j].session_pub = refresh_session_pub;
}
}
@@ -617,8 +620,8 @@ TALER_MINT_handler_refresh_commit (struct RequestHandler *rh,
JNAV_INDEX, (int) i,
JNAV_INDEX, (int) j,
JNAV_RET_DATA,
- commit_link[i][j].shared_secret_enc,
- TALER_REFRESH_SHARED_SECRET_LENGTH);
+ &commit_link[i][j].shared_secret,
+ sizeof (struct GNUNET_HashCode));
if (GNUNET_OK != res)
{
@@ -628,13 +631,8 @@ TALER_MINT_handler_refresh_commit (struct RequestHandler *rh,
}
GNUNET_CRYPTO_hash_context_read (hash_context,
- commit_link[i][j].shared_secret_enc,
- TALER_REFRESH_SHARED_SECRET_LENGTH);
-
- commit_link[i][j].cnc_index = i;
- commit_link[i][j].oldcoin_index = j;
- commit_link[i][j].session_pub = refresh_session_pub;
-
+ &commit_link[i][j].shared_secret,
+ sizeof (struct GNUNET_HashCode));
}
}
GNUNET_CRYPTO_hash_context_finish (hash_context, &commit_hash);