diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-07-31 22:50:16 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-07-31 22:50:21 +0200 |
commit | 1db139a7f3b74b2dc4135ab8b42d625415705d63 (patch) | |
tree | dbbd66f083001bdefc9b029c1f45a5c2cf93697e /src/restclient/anastasis_api_truth_store.c | |
parent | 812423c3872dce704ce9161127c7ebfbb7034fbe (diff) | |
download | anastasis-1db139a7f3b74b2dc4135ab8b42d625415705d63.tar.gz anastasis-1db139a7f3b74b2dc4135ab8b42d625415705d63.tar.bz2 anastasis-1db139a7f3b74b2dc4135ab8b42d625415705d63.zip |
-eliminating some legacy json_pack calls from Anastasis
Diffstat (limited to 'src/restclient/anastasis_api_truth_store.c')
-rw-r--r-- | src/restclient/anastasis_api_truth_store.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/restclient/anastasis_api_truth_store.c b/src/restclient/anastasis_api_truth_store.c index ef6a642..3311bc4 100644 --- a/src/restclient/anastasis_api_truth_store.c +++ b/src/restclient/anastasis_api_truth_store.c @@ -295,25 +295,20 @@ ANASTASIS_truth_store ( { json_t *truth_data; - truth_data = json_pack ("{s:o," /* encrypted KeyShare */ - " s:s," /* type */ - " s:o," /* nonce */ - " s:s," /* truth_mime */ - " s:I}", /* payment years */ - "keyshare_data", - GNUNET_JSON_from_data_auto (encrypted_keyshare), - "type", - type, - "encrypted_truth", - GNUNET_JSON_from_data (encrypted_truth, - encrypted_truth_size), - "truth_mime", - (NULL != truth_mime) - ? truth_mime - : "", - "storage_duration_years", - (json_int_t) payment_years_requested); - GNUNET_assert (NULL != truth_data); + truth_data = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_data_auto ("keyshare_data", + encrypted_keyshare), + GNUNET_JSON_pack_string ("type", + type), + GNUNET_JSON_pack_data_varsize ("encrypted_truth", + encrypted_truth, + encrypted_truth_size), + GNUNET_JSON_pack_string ("truth_mime", + (NULL != truth_mime) + ? truth_mime + : ""), + GNUNET_JSON_pack_uint64 ("storage_duration_years", + payment_years_requested)); json_str = json_dumps (truth_data, JSON_COMPACT); GNUNET_assert (NULL != json_str); |