summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/taler-merchant-httpd_auditors.c3
-rw-r--r--src/backend/taler-merchant-httpd_contract.c12
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c5
-rw-r--r--src/backend/taler-merchant-httpd_pay.c5
-rw-r--r--src/backend/taler-merchant-httpd_util.c3
-rw-r--r--src/lib/merchant_api_pay.c12
6 files changed, 14 insertions, 26 deletions
diff --git a/src/backend/taler-merchant-httpd_auditors.c b/src/backend/taler-merchant-httpd_auditors.c
index 0b583fd4..4b4bd646 100644
--- a/src/backend/taler-merchant-httpd_auditors.c
+++ b/src/backend/taler-merchant-httpd_auditors.c
@@ -210,8 +210,7 @@ TMH_AUDITORS_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
json_array_append_new (j_auditors,
json_pack ("{s:s, s:o, s:s}",
"name", auditors[cnt].name,
- "auditor_pub", GNUNET_JSON_from_data (&auditors[cnt].public_key,
- sizeof (struct TALER_AuditorPublicKeyP)),
+ "auditor_pub", GNUNET_JSON_from_data_auto (&auditors[cnt].public_key),
"uri", auditors[cnt].uri));
return nauditors;
}
diff --git a/src/backend/taler-merchant-httpd_contract.c b/src/backend/taler-merchant-httpd_contract.c
index 9d159583..af18ce11 100644
--- a/src/backend/taler-merchant-httpd_contract.c
+++ b/src/backend/taler-merchant-httpd_contract.c
@@ -220,12 +220,10 @@ MH_handler_contract (struct TMH_RequestHandler *rh,
j_auditors);
json_object_set_new (jcontract,
"H_wire",
- GNUNET_JSON_from_data (&h_wire,
- sizeof (h_wire)));
+ GNUNET_JSON_from_data_auto (&h_wire));
json_object_set_new (jcontract,
"merchant_pub",
- GNUNET_JSON_from_data (&pubkey,
- sizeof (pubkey)));
+ GNUNET_JSON_from_data_auto (&pubkey));
/* create contract signature */
contract.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_CONTRACT);
@@ -247,10 +245,8 @@ MH_handler_contract (struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
"{s:O, s:O, s:O}",
"contract", jcontract,
- "merchant_sig", GNUNET_JSON_from_data (&contract_sig,
- sizeof (contract_sig)),
- "H_contract", GNUNET_JSON_from_data (&contract.h_contract,
- sizeof (contract.h_contract)));
+ "merchant_sig", GNUNET_JSON_from_data_auto (&contract_sig),
+ "H_contract", GNUNET_JSON_from_data_auto (&contract.h_contract));
GNUNET_JSON_parse_free (spec);
json_decref (root);
return res;
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c
index 9a292365..0501784a 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -534,9 +534,8 @@ TMH_EXCHANGES_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
if (GNUNET_YES != exchange->trusted)
continue;
j_exchange = json_pack ("{s:s, s:o}",
- "url", exchange->uri,
- "master_pub", GNUNET_JSON_from_data (&exchange->master_pub,
- sizeof (struct TALER_MasterPublicKeyP)));
+ "url", exchange->uri,
+ "master_pub", GNUNET_JSON_from_data_auto (&exchange->master_pub));
json_array_append_new (trusted_exchanges,
j_exchange);
}
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
index eb9fd506..bd8dc742 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -234,7 +234,7 @@ resume_pay_with_response (struct PayContext *pc,
/**
* Convert denomination key to its base32 representation
- *
+ *
* @param dk denomination key to convert
* @return 0-terminated base32 encoding of @a dk, to be deallocated
*/
@@ -325,8 +325,7 @@ deposit_cb (void *cls,
eproof = json_copy ((json_t *) proof);
json_object_set (eproof,
"coin_pub",
- GNUNET_JSON_from_data (&dc->coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP)));
+ GNUNET_JSON_from_data_auto (&dc->coin_pub));
resume_pay_with_response (pc,
http_status,
TMH_RESPONSE_make_json (eproof));
diff --git a/src/backend/taler-merchant-httpd_util.c b/src/backend/taler-merchant-httpd_util.c
index 800e41ab..9d62722c 100644
--- a/src/backend/taler-merchant-httpd_util.c
+++ b/src/backend/taler-merchant-httpd_util.c
@@ -99,8 +99,7 @@ MH_handler_hash_contract (struct TMH_RequestHandler *rh,
res = TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:O}",
- "hash", GNUNET_JSON_from_data (&hc,
- sizeof (hc)));
+ "hash", GNUNET_JSON_from_data_auto (&hc));
json_decref (root);
return res;
}
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c
index 713607ee..5c579c71 100644
--- a/src/lib/merchant_api_pay.c
+++ b/src/lib/merchant_api_pay.c
@@ -457,12 +457,10 @@ TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx,
" s:o, s:o," /* denom_pub / ub_sig */
" s:o}", /* coin_sig */
"f", TALER_JSON_from_amount (&pc->amount_with_fee),
- "coin_pub", GNUNET_JSON_from_data (&pc->coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP)),
+ "coin_pub", GNUNET_JSON_from_data_auto (&pc->coin_pub),
"denom_pub", GNUNET_JSON_from_rsa_public_key (pc->denom_pub.rsa_public_key),
"ub_sig", GNUNET_JSON_from_rsa_signature (pc->denom_sig.rsa_signature),
- "coin_sig", GNUNET_JSON_from_data (&pc->coin_sig,
- sizeof (struct TALER_CoinSpendSignatureP))
+ "coin_sig", GNUNET_JSON_from_data_auto (&pc->coin_sig)
);
json_array_append (j_coins,
j_coin);
@@ -541,8 +539,7 @@ TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx,
" s:o, s:s," /* refund_deadline, exchange */
" s:o, s:o," /* coins, max_fee */
" s:o, s:o}",/* amount, signature */
- "H_contract", GNUNET_JSON_from_data (h_contract,
- sizeof (struct GNUNET_HashCode)),
+ "H_contract", GNUNET_JSON_from_data_auto (h_contract),
"transaction_id", (json_int_t) transaction_id,
"timestamp", GNUNET_JSON_from_time_abs (timestamp),
"refund_deadline", GNUNET_JSON_from_time_abs (refund_deadline),
@@ -550,8 +547,7 @@ TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx,
"coins", j_coins,
"max_fee", TALER_JSON_from_amount (max_fee),
"amount", TALER_JSON_from_amount (amount),
- "merchant_sig", GNUNET_JSON_from_data (merchant_sig,
- sizeof (struct TALER_MerchantSignatureP)));
+ "merchant_sig", GNUNET_JSON_from_data_auto (merchant_sig));
if (0 != execution_deadline.abs_value_us)
{