minor updates to /test api

This commit is contained in:
Christian Grothoff 2015-04-19 15:10:48 +02:00
parent abe779ab7f
commit 81e8a9b99c
2 changed files with 18 additions and 22 deletions

View File

@ -504,11 +504,7 @@ struct TALER_MintKeySetPS
struct GNUNET_TIME_AbsoluteNBO list_issue_date; struct GNUNET_TIME_AbsoluteNBO list_issue_date;
/** /**
* Hash over the "inner" JSON with the key set. FIXME: The use of * Hash over the various denomination signing keys returned.
* JSON as what is being signed here is a bit of a hack, as the
* result depends on the JSON indentation and being canonical.
* We should consider using a more well-defined binary format to
* sign. (#3739)
*/ */
struct GNUNET_HashCode hc; struct GNUNET_HashCode hc;
}; };

View File

@ -79,12 +79,11 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
&hc); &hc);
TMH_PARSE_release_data (spec); TMH_PARSE_release_data (spec);
json_decref (json); json_decref (json);
json = TALER_json_from_data (&hc, sizeof (struct GNUNET_HashCode)); return TMH_RESPONSE_reply_json_pack (connection,
res = TMH_RESPONSE_reply_json (connection, MHD_HTTP_OK,
json, "{s:o}",
MHD_HTTP_OK); "output",
json_decref (json); TALER_json_from_data (&hc, sizeof (struct GNUNET_HashCode)));
return res;
} }
@ -160,11 +159,11 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
spec[0].destination_size_out); spec[0].destination_size_out);
GNUNET_free (out); GNUNET_free (out);
TMH_PARSE_release_data (spec); TMH_PARSE_release_data (spec);
res = TMH_RESPONSE_reply_json (connection, return TMH_RESPONSE_reply_json_pack (connection,
json, MHD_HTTP_OK,
MHD_HTTP_OK); "{s:o}",
json_decref (json); "output",
return res; json);
} }
@ -221,12 +220,13 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
spec[0].destination_size_out, spec[0].destination_size_out,
NULL, 0); NULL, 0);
TMH_PARSE_release_data (spec); TMH_PARSE_release_data (spec);
json = TALER_json_from_data (&hc, sizeof (struct GNUNET_HashCode)); json = TALER_json_from_data (&hc,
res = TMH_RESPONSE_reply_json (connection, sizeof (struct GNUNET_HashCode));
json, return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK); MHD_HTTP_OK,
json_decref (json); "{s:o}",
return res; "output",
json);
} }