From e1d6c8eb3e3d4ba1d6003b03560e7c50067edead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Mon, 3 Oct 2022 11:07:31 +0200 Subject: [PATCH] sort json keys; free string --- test_brandt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test_brandt.c b/test_brandt.c index 0a25569..98ba06d 100644 --- a/test_brandt.c +++ b/test_brandt.c @@ -656,7 +656,7 @@ print_transcript (uint32_t highestprice) // Add signature of seller to H(auction, bidders, signatures, transscript, result) { struct GNUNET_CRYPTO_EddsaSignature sig; - char *root_js = json_dumps(root, JSON_COMPACT); + char *root_js = json_dumps(root, JSON_COMPACT|JSON_SORT_KEYS); GNUNET_CRYPTO_hash(root_js, strlen(root_js), @@ -673,6 +673,8 @@ print_transcript (uint32_t highestprice) root, "sig", GNUNET_JSON_from_data_auto(&sig))); + + free(root_js); } printf ("%s\n", json_dumps (root, JSON_INDENT (2)));