add private keys (undsigned) to the transcript
This commit is contained in:
parent
e1d6c8eb3e
commit
09af66c165
@ -502,7 +502,8 @@ tr_start (void *auction_closure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct some_sig {
|
struct some_sig
|
||||||
|
{
|
||||||
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
|
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
|
||||||
struct GNUNET_HashCode hc GNUNET_PACKED;
|
struct GNUNET_HashCode hc GNUNET_PACKED;
|
||||||
};
|
};
|
||||||
@ -535,12 +536,14 @@ print_transcript (uint32_t highestprice)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auction = json_pack ("{s:{s:o}, s:{s:o}, s:i, s:b, s:o, s:s, s:s}",
|
auction = json_pack ("{s:{s:o}, s:{s:o}, s:i, s:b, s:o, s:s, s:s}",
|
||||||
"time_start", "t_s", json_integer (ad->time_start.abs_value_us / 1000LL),
|
"time_start", "t_s", json_integer (
|
||||||
"time_round", "d_us", json_integer (ad->time_round.rel_value_us),
|
ad->time_start.abs_value_us / 1000LL),
|
||||||
|
"time_round", "d_us", json_integer (
|
||||||
|
ad->time_round.rel_value_us),
|
||||||
"type", ad->m,
|
"type", ad->m,
|
||||||
"public", ad->outcome_public == 0 ? json_false () : json_true (),
|
"is_public", ad->outcome_public == 0 ? json_false () : json_true (),
|
||||||
"prices", prices,
|
"prices", prices,
|
||||||
"payto", "payto://some/iban",
|
"payto_uri", "payto://some/iban",
|
||||||
"pubkey", GNUNET_CRYPTO_eddsa_public_key_to_string (
|
"pubkey", GNUNET_CRYPTO_eddsa_public_key_to_string (
|
||||||
&tcase.pub[tcase.n]));
|
&tcase.pub[tcase.n]));
|
||||||
GNUNET_assert (auction);
|
GNUNET_assert (auction);
|
||||||
@ -653,7 +656,7 @@ print_transcript (uint32_t highestprice)
|
|||||||
|
|
||||||
GNUNET_assert (root);
|
GNUNET_assert (root);
|
||||||
|
|
||||||
// Add signature of seller to H(auction, bidders, signatures, transscript, result)
|
// Add signature of seller to H(auction, bidders, signatures, transcript, result)
|
||||||
{
|
{
|
||||||
struct GNUNET_CRYPTO_EddsaSignature sig;
|
struct GNUNET_CRYPTO_EddsaSignature sig;
|
||||||
char *root_js = json_dumps (root, JSON_COMPACT | JSON_SORT_KEYS);
|
char *root_js = json_dumps (root, JSON_COMPACT | JSON_SORT_KEYS);
|
||||||
@ -677,11 +680,32 @@ print_transcript (uint32_t highestprice)
|
|||||||
free (root_js);
|
free (root_js);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("%s\n", json_dumps (root, JSON_INDENT (2)));
|
// After signing the transcript, add private key material, too, so it
|
||||||
|
// can be used in integration tests.
|
||||||
|
{
|
||||||
|
json_t *keys = json_array ();
|
||||||
|
GNUNET_assert (keys);
|
||||||
|
|
||||||
json_decref (root);
|
for (size_t b = 0; b <= /* = is important */ tcase.n; b++)
|
||||||
|
{
|
||||||
|
char *ps = GNUNET_CRYPTO_eddsa_private_key_to_string (&tcase.prv[b]);
|
||||||
|
GNUNET_assert (-1 !=
|
||||||
|
json_array_append_new (keys,
|
||||||
|
json_string (ps)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
json_object_set_new (
|
||||||
|
root,
|
||||||
|
"NOTSIGNED_keys",
|
||||||
|
keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf ("\n%s\n", json_dumps (root, JSON_INDENT (2)));
|
||||||
|
json_decref (root);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
replay_transcript (void *arg)
|
replay_transcript (void *arg)
|
||||||
{
|
{
|
||||||
@ -713,8 +737,6 @@ replay_transcript (void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test a specific auction setup.
|
* Test a specific auction setup.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user