From 9dd7d3d580fa4afde9e5d56be0b40bd3d9ad08ac Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 6 Oct 2018 15:05:03 +0200 Subject: fix #5434 (no more salt in exchange wire replies) --- src/backend/taler-merchant-httpd.c | 18 ++++++++++++++---- .../.config/taler/exchange/account-2.json | 3 +-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 213e115d..9fbec955 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -777,8 +777,18 @@ wireformat_iterator_cb (void *cls, } else /* need to generate JSON */ { - j = TALER_JSON_wire_signature_make (payto, - NULL); + struct GNUNET_HashCode salt; + char *salt_str; + + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, + &salt, + sizeof (salt)); + salt_str = GNUNET_STRINGS_data_to_string_alloc (&salt, + sizeof (salt)); + j = json_pack ("{s:s, s:s}", + "url", payto, + "salt", salt_str); + GNUNET_free (salt_str); if (0 != json_dump_file (j, fn, JSON_COMPACT | JSON_SORT_KEYS)) @@ -796,8 +806,8 @@ wireformat_iterator_cb (void *cls, GNUNET_free (fn); if (GNUNET_OK != - TALER_JSON_wire_signature_hash (j, - &h_wire)) + TALER_JSON_merchant_wire_signature_hash (j, + &h_wire)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to hash wire input\n"); diff --git a/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json b/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json index ec23adee..e8a000bf 100644 --- a/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json +++ b/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json @@ -1,5 +1,4 @@ { "url": "payto://x-taler-bank/localhost:8082/2", - "salt": "AX69JV6JVW31AHK24RFH5907T1MVTB901TQD7E9ATFKVM1J734MN62GA3TMSRMCYKJPB7A7G2R5S658216EVM90CNNM7V7V2K6BDR3R", - "master_sig": "C9NT2J22X2Q33FH8GT04ASQSDB60TGZQP61J0D2HDJ52J4X0N7T5K2ZGPTYKGF48XA729CJ8BZ84E006DK15691XXFRF0THNMQSZP0G" + "master_sig": "RDPWNT0CDATHWRY99W7G3E2Y1GYAABTE25J8GHKPGXV07TM89W1502BG5Q82FQY0JR4HSABJC6RG92PA93QGTKWM85W64TE9CCVW63R" } \ No newline at end of file -- cgit v1.2.3