sort json keys; free string

This commit is contained in:
Özgür Kesim 2022-10-03 11:07:31 +02:00
parent a423fdb1d0
commit e1d6c8eb3e
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7

View File

@ -656,7 +656,7 @@ print_transcript (uint32_t highestprice)
// Add signature of seller to H(auction, bidders, signatures, transscript, result) // Add signature of seller to H(auction, bidders, signatures, transscript, result)
{ {
struct GNUNET_CRYPTO_EddsaSignature sig; 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, GNUNET_CRYPTO_hash(root_js,
strlen(root_js), strlen(root_js),
@ -673,6 +673,8 @@ print_transcript (uint32_t highestprice)
root, root,
"sig", "sig",
GNUNET_JSON_from_data_auto(&sig))); GNUNET_JSON_from_data_auto(&sig)));
free(root_js);
} }
printf ("%s\n", json_dumps (root, JSON_INDENT (2))); printf ("%s\n", json_dumps (root, JSON_INDENT (2)));