adapations to GNUnet API change

This commit is contained in:
Christian Grothoff 2020-04-11 21:06:30 +02:00
parent 88bb7f4428
commit 44272bf1ce
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
8 changed files with 15 additions and 42 deletions

View File

@ -481,12 +481,9 @@ create_signkey_issue_priv (
struct GNUNET_TIME_Absolute end, struct GNUNET_TIME_Absolute end,
struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *pi) struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *pi)
{ {
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct TALER_ExchangeSigningKeyValidityPS *issue = &pi->issue; struct TALER_ExchangeSigningKeyValidityPS *issue = &pi->issue;
priv = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&pi->signkey_priv.eddsa_priv);
pi->signkey_priv.eddsa_priv = *priv;
GNUNET_free (priv);
issue->master_public_key = master_public_key; issue->master_public_key = master_public_key;
issue->start = GNUNET_TIME_absolute_hton (start); issue->start = GNUNET_TIME_absolute_hton (start);
issue->expire = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (start, issue->expire = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (start,

View File

@ -114,7 +114,6 @@ main (int argc,
void *enc; void *enc;
size_t enc_size; size_t enc_size;
struct TALER_EXCHANGEDB_DenominationKey dki_read; struct TALER_EXCHANGEDB_DenominationKey dki_read;
struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
struct TALER_MasterPrivateKeyP master_priv; struct TALER_MasterPrivateKeyP master_priv;
struct TALER_MasterPublicKeyP master_pub; struct TALER_MasterPublicKeyP master_pub;
void *enc_read; void *enc_read;
@ -136,11 +135,9 @@ main (int argc,
tmpfile = NULL; tmpfile = NULL;
dki.denom_priv.rsa_private_key = NULL; dki.denom_priv.rsa_private_key = NULL;
dki_read.denom_priv.rsa_private_key = NULL; dki_read.denom_priv.rsa_private_key = NULL;
pk = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&master_priv.eddsa_priv);
master_priv.eddsa_priv = *pk; GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
GNUNET_CRYPTO_eddsa_key_get_public (pk,
&master_pub.eddsa_pub); &master_pub.eddsa_pub);
GNUNET_free (pk);
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&dki.issue, &dki.issue,
sizeof (struct sizeof (struct

View File

@ -53,7 +53,7 @@ main (int argc,
struct TALER_EXCHANGEDB_AggregateFees *af; struct TALER_EXCHANGEDB_AggregateFees *af;
struct TALER_EXCHANGEDB_AggregateFees *n; struct TALER_EXCHANGEDB_AggregateFees *n;
struct TALER_MasterPublicKeyP master_pub; struct TALER_MasterPublicKeyP master_pub;
struct GNUNET_CRYPTO_EddsaPrivateKey *priv; struct GNUNET_CRYPTO_EddsaPrivateKey priv;
char *tmpdir; char *tmpdir;
char *tmpfile = NULL; char *tmpfile = NULL;
int ret; int ret;
@ -67,8 +67,8 @@ main (int argc,
tmpdir = GNUNET_DISK_mkdtemp ("test_exchangedb_fees"); tmpdir = GNUNET_DISK_mkdtemp ("test_exchangedb_fees");
if (NULL == tmpdir) if (NULL == tmpdir)
return 77; /* skip test */ return 77; /* skip test */
priv = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&priv);
GNUNET_CRYPTO_eddsa_key_get_public (priv, GNUNET_CRYPTO_eddsa_key_get_public (&priv,
&master_pub.eddsa_pub); &master_pub.eddsa_pub);
cfg = GNUNET_CONFIGURATION_create (); cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg, GNUNET_CONFIGURATION_set_value_string (cfg,
@ -91,7 +91,7 @@ main (int argc,
TALER_string_to_amount ("EUR:1.0", TALER_string_to_amount ("EUR:1.0",
&af->closing_fee)); &af->closing_fee));
sign_af (af, sign_af (af,
priv); &priv);
n = GNUNET_new (struct TALER_EXCHANGEDB_AggregateFees); n = GNUNET_new (struct TALER_EXCHANGEDB_AggregateFees);
n->start_date = GNUNET_TIME_year_to_time (year + 1); n->start_date = GNUNET_TIME_year_to_time (year + 1);
n->end_date = GNUNET_TIME_year_to_time (year + 2); n->end_date = GNUNET_TIME_year_to_time (year + 2);
@ -102,7 +102,7 @@ main (int argc,
TALER_string_to_amount ("EUR:0.1", TALER_string_to_amount ("EUR:0.1",
&n->closing_fee)); &n->closing_fee));
sign_af (n, sign_af (n,
priv); &priv);
af->next = n; af->next = n;
if (GNUNET_OK != if (GNUNET_OK !=
@ -148,7 +148,6 @@ main (int argc,
(void) GNUNET_DISK_directory_remove (tmpdir); (void) GNUNET_DISK_directory_remove (tmpdir);
GNUNET_free (tmpdir); GNUNET_free (tmpdir);
GNUNET_free (priv);
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
return ret; return ret;
} }

View File

@ -29,7 +29,6 @@ main (int argc,
const char *const argv[]) const char *const argv[])
{ {
struct TALER_MasterPublicKeyP master_pub; struct TALER_MasterPublicKeyP master_pub;
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct TALER_MasterPrivateKeyP master_priv; struct TALER_MasterPrivateKeyP master_priv;
json_t *wire; json_t *wire;
const char *payto = "payto://x-taler-bank/42"; const char *payto = "payto://x-taler-bank/42";
@ -40,9 +39,7 @@ main (int argc,
GNUNET_log_setup ("test-json-wire", GNUNET_log_setup ("test-json-wire",
"WARNING", "WARNING",
NULL); NULL);
priv = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&master_priv.eddsa_priv);
master_priv.eddsa_priv = *priv;
GNUNET_free (priv);
GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
&master_pub.eddsa_pub); &master_pub.eddsa_pub);
wire = TALER_JSON_exchange_wire_signature_make (payto, wire = TALER_JSON_exchange_wire_signature_make (payto,

View File

@ -565,12 +565,8 @@ TALER_EXCHANGE_refresh_prepare (
/* build up coins */ /* build up coins */
for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++) for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++)
{ {
struct GNUNET_CRYPTO_EcdhePrivateKey *tpk; GNUNET_CRYPTO_ecdhe_key_create (
&md.melted_coin.transfer_priv[i].ecdhe_priv);
tpk = GNUNET_CRYPTO_ecdhe_key_create ();
md.melted_coin.transfer_priv[i].ecdhe_priv = *tpk;
GNUNET_free (tpk);
GNUNET_CRYPTO_ecdhe_key_get_public ( GNUNET_CRYPTO_ecdhe_key_get_public (
&md.melted_coin.transfer_priv[i].ecdhe_priv, &md.melted_coin.transfer_priv[i].ecdhe_priv,
&rce[i].transfer_pub.ecdhe_pub); &rce[i].transfer_pub.ecdhe_pub);

View File

@ -357,11 +357,7 @@ admin_add_incoming_run (void *cls,
{ {
/* No referenced reserve, no instance to take priv /* No referenced reserve, no instance to take priv
* from, no explicit subject given: create new key! */ * from, no explicit subject given: create new key! */
struct GNUNET_CRYPTO_EddsaPrivateKey *priv; GNUNET_CRYPTO_eddsa_key_create (&fts->reserve_priv.eddsa_priv);
priv = GNUNET_CRYPTO_eddsa_key_create ();
fts->reserve_priv.eddsa_priv = *priv;
GNUNET_free (priv);
} }
} }
GNUNET_CRYPTO_eddsa_key_get_public (&fts->reserve_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&fts->reserve_priv.eddsa_priv,

View File

@ -581,7 +581,6 @@ TALER_TESTING_cmd_deposit (const char *label,
{ {
struct DepositState *ds; struct DepositState *ds;
json_t *wire_details; json_t *wire_details;
struct GNUNET_CRYPTO_EddsaPrivateKey *merchant_priv;
wire_details = TALER_TESTING_make_wire_details (target_account_payto); wire_details = TALER_TESTING_make_wire_details (target_account_payto);
ds = GNUNET_new (struct DepositState); ds = GNUNET_new (struct DepositState);
@ -591,9 +590,7 @@ TALER_TESTING_cmd_deposit (const char *label,
ds->contract_terms = json_loads (contract_terms, ds->contract_terms = json_loads (contract_terms,
JSON_REJECT_DUPLICATES, JSON_REJECT_DUPLICATES,
NULL); NULL);
merchant_priv = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&ds->merchant_priv.eddsa_priv);
ds->merchant_priv.eddsa_priv = *merchant_priv;
GNUNET_free (merchant_priv);
if (NULL == ds->contract_terms) if (NULL == ds->contract_terms)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,

View File

@ -32,10 +32,8 @@
static int static int
test_high_level (void) test_high_level (void)
{ {
struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
struct TALER_CoinSpendPrivateKeyP coin_priv; struct TALER_CoinSpendPrivateKeyP coin_priv;
struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_CoinSpendPublicKeyP coin_pub;
struct GNUNET_CRYPTO_EcdhePrivateKey *pk2;
struct TALER_TransferPrivateKeyP trans_priv; struct TALER_TransferPrivateKeyP trans_priv;
struct TALER_TransferPublicKeyP trans_pub; struct TALER_TransferPublicKeyP trans_pub;
struct TALER_TransferSecretP secret; struct TALER_TransferSecretP secret;
@ -43,14 +41,10 @@ test_high_level (void)
struct TALER_PlanchetSecretsP fc1; struct TALER_PlanchetSecretsP fc1;
struct TALER_PlanchetSecretsP fc2; struct TALER_PlanchetSecretsP fc2;
pk = GNUNET_CRYPTO_eddsa_key_create (); GNUNET_CRYPTO_eddsa_key_create (&coin_priv.eddsa_priv);
coin_priv.eddsa_priv = *pk;
GNUNET_free (pk);
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv.eddsa_priv,
&coin_pub.eddsa_pub); &coin_pub.eddsa_pub);
pk2 = GNUNET_CRYPTO_ecdhe_key_create (); GNUNET_CRYPTO_ecdhe_key_create (&trans_priv.ecdhe_priv);
trans_priv.ecdhe_priv = *pk2;
GNUNET_free (pk2);
GNUNET_CRYPTO_ecdhe_key_get_public (&trans_priv.ecdhe_priv, GNUNET_CRYPTO_ecdhe_key_get_public (&trans_priv.ecdhe_priv,
&trans_pub.ecdhe_pub); &trans_pub.ecdhe_pub);
TALER_link_derive_transfer_secret (&coin_priv, TALER_link_derive_transfer_secret (&coin_priv,