aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/exchange-tools/taler-exchange-keyup.c5
-rw-r--r--src/exchangedb/test_exchangedb_denomkeys.c7
-rw-r--r--src/exchangedb/test_exchangedb_fees.c11
-rw-r--r--src/json/test_json_wire.c5
-rw-r--r--src/lib/exchange_api_refresh_common.c8
-rw-r--r--src/testing/testing_api_cmd_bank_admin_add_incoming.c6
-rw-r--r--src/testing/testing_api_cmd_deposit.c5
-rw-r--r--src/util/test_crypto.c10
8 files changed, 15 insertions, 42 deletions
diff --git a/src/exchange-tools/taler-exchange-keyup.c b/src/exchange-tools/taler-exchange-keyup.c
index 5472f5e0e..0f5f66a8d 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -481,12 +481,9 @@ create_signkey_issue_priv (
struct GNUNET_TIME_Absolute end,
struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *pi)
{
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct TALER_ExchangeSigningKeyValidityPS *issue = &pi->issue;
- priv = GNUNET_CRYPTO_eddsa_key_create ();
- pi->signkey_priv.eddsa_priv = *priv;
- GNUNET_free (priv);
+ GNUNET_CRYPTO_eddsa_key_create (&pi->signkey_priv.eddsa_priv);
issue->master_public_key = master_public_key;
issue->start = GNUNET_TIME_absolute_hton (start);
issue->expire = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (start,
diff --git a/src/exchangedb/test_exchangedb_denomkeys.c b/src/exchangedb/test_exchangedb_denomkeys.c
index 12add14da..1acb61dde 100644
--- a/src/exchangedb/test_exchangedb_denomkeys.c
+++ b/src/exchangedb/test_exchangedb_denomkeys.c
@@ -114,7 +114,6 @@ main (int argc,
void *enc;
size_t enc_size;
struct TALER_EXCHANGEDB_DenominationKey dki_read;
- struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
struct TALER_MasterPrivateKeyP master_priv;
struct TALER_MasterPublicKeyP master_pub;
void *enc_read;
@@ -136,11 +135,9 @@ main (int argc,
tmpfile = NULL;
dki.denom_priv.rsa_private_key = NULL;
dki_read.denom_priv.rsa_private_key = NULL;
- pk = GNUNET_CRYPTO_eddsa_key_create ();
- master_priv.eddsa_priv = *pk;
- GNUNET_CRYPTO_eddsa_key_get_public (pk,
+ GNUNET_CRYPTO_eddsa_key_create (&master_priv.eddsa_priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
&master_pub.eddsa_pub);
- GNUNET_free (pk);
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&dki.issue,
sizeof (struct
diff --git a/src/exchangedb/test_exchangedb_fees.c b/src/exchangedb/test_exchangedb_fees.c
index 55f34bd6f..f86dfe5c5 100644
--- a/src/exchangedb/test_exchangedb_fees.c
+++ b/src/exchangedb/test_exchangedb_fees.c
@@ -53,7 +53,7 @@ main (int argc,
struct TALER_EXCHANGEDB_AggregateFees *af;
struct TALER_EXCHANGEDB_AggregateFees *n;
struct TALER_MasterPublicKeyP master_pub;
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
+ struct GNUNET_CRYPTO_EddsaPrivateKey priv;
char *tmpdir;
char *tmpfile = NULL;
int ret;
@@ -67,8 +67,8 @@ main (int argc,
tmpdir = GNUNET_DISK_mkdtemp ("test_exchangedb_fees");
if (NULL == tmpdir)
return 77; /* skip test */
- priv = GNUNET_CRYPTO_eddsa_key_create ();
- GNUNET_CRYPTO_eddsa_key_get_public (priv,
+ GNUNET_CRYPTO_eddsa_key_create (&priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (&priv,
&master_pub.eddsa_pub);
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg,
@@ -91,7 +91,7 @@ main (int argc,
TALER_string_to_amount ("EUR:1.0",
&af->closing_fee));
sign_af (af,
- priv);
+ &priv);
n = GNUNET_new (struct TALER_EXCHANGEDB_AggregateFees);
n->start_date = GNUNET_TIME_year_to_time (year + 1);
n->end_date = GNUNET_TIME_year_to_time (year + 2);
@@ -102,7 +102,7 @@ main (int argc,
TALER_string_to_amount ("EUR:0.1",
&n->closing_fee));
sign_af (n,
- priv);
+ &priv);
af->next = n;
if (GNUNET_OK !=
@@ -148,7 +148,6 @@ main (int argc,
(void) GNUNET_DISK_directory_remove (tmpdir);
GNUNET_free (tmpdir);
- GNUNET_free (priv);
GNUNET_CONFIGURATION_destroy (cfg);
return ret;
}
diff --git a/src/json/test_json_wire.c b/src/json/test_json_wire.c
index 3b2123e26..2725173b2 100644
--- a/src/json/test_json_wire.c
+++ b/src/json/test_json_wire.c
@@ -29,7 +29,6 @@ main (int argc,
const char *const argv[])
{
struct TALER_MasterPublicKeyP master_pub;
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct TALER_MasterPrivateKeyP master_priv;
json_t *wire;
const char *payto = "payto://x-taler-bank/42";
@@ -40,9 +39,7 @@ main (int argc,
GNUNET_log_setup ("test-json-wire",
"WARNING",
NULL);
- priv = GNUNET_CRYPTO_eddsa_key_create ();
- master_priv.eddsa_priv = *priv;
- GNUNET_free (priv);
+ GNUNET_CRYPTO_eddsa_key_create (&master_priv.eddsa_priv);
GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
&master_pub.eddsa_pub);
wire = TALER_JSON_exchange_wire_signature_make (payto,
diff --git a/src/lib/exchange_api_refresh_common.c b/src/lib/exchange_api_refresh_common.c
index 92217c5e8..3aa72e541 100644
--- a/src/lib/exchange_api_refresh_common.c
+++ b/src/lib/exchange_api_refresh_common.c
@@ -565,12 +565,8 @@ TALER_EXCHANGE_refresh_prepare (
/* build up coins */
for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++)
{
- struct GNUNET_CRYPTO_EcdhePrivateKey *tpk;
-
- tpk = GNUNET_CRYPTO_ecdhe_key_create ();
- md.melted_coin.transfer_priv[i].ecdhe_priv = *tpk;
- GNUNET_free (tpk);
-
+ GNUNET_CRYPTO_ecdhe_key_create (
+ &md.melted_coin.transfer_priv[i].ecdhe_priv);
GNUNET_CRYPTO_ecdhe_key_get_public (
&md.melted_coin.transfer_priv[i].ecdhe_priv,
&rce[i].transfer_pub.ecdhe_pub);
diff --git a/src/testing/testing_api_cmd_bank_admin_add_incoming.c b/src/testing/testing_api_cmd_bank_admin_add_incoming.c
index 04e6839d1..6ab287f66 100644
--- a/src/testing/testing_api_cmd_bank_admin_add_incoming.c
+++ b/src/testing/testing_api_cmd_bank_admin_add_incoming.c
@@ -357,11 +357,7 @@ admin_add_incoming_run (void *cls,
{
/* No referenced reserve, no instance to take priv
* from, no explicit subject given: create new key! */
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
-
- priv = GNUNET_CRYPTO_eddsa_key_create ();
- fts->reserve_priv.eddsa_priv = *priv;
- GNUNET_free (priv);
+ GNUNET_CRYPTO_eddsa_key_create (&fts->reserve_priv.eddsa_priv);
}
}
GNUNET_CRYPTO_eddsa_key_get_public (&fts->reserve_priv.eddsa_priv,
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
index c251aada3..9468e7acb 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -581,7 +581,6 @@ TALER_TESTING_cmd_deposit (const char *label,
{
struct DepositState *ds;
json_t *wire_details;
- struct GNUNET_CRYPTO_EddsaPrivateKey *merchant_priv;
wire_details = TALER_TESTING_make_wire_details (target_account_payto);
ds = GNUNET_new (struct DepositState);
@@ -591,9 +590,7 @@ TALER_TESTING_cmd_deposit (const char *label,
ds->contract_terms = json_loads (contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- merchant_priv = GNUNET_CRYPTO_eddsa_key_create ();
- ds->merchant_priv.eddsa_priv = *merchant_priv;
- GNUNET_free (merchant_priv);
+ GNUNET_CRYPTO_eddsa_key_create (&ds->merchant_priv.eddsa_priv);
if (NULL == ds->contract_terms)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index de10e567d..8135dfe35 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -32,10 +32,8 @@
static int
test_high_level (void)
{
- struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
struct TALER_CoinSpendPrivateKeyP coin_priv;
struct TALER_CoinSpendPublicKeyP coin_pub;
- struct GNUNET_CRYPTO_EcdhePrivateKey *pk2;
struct TALER_TransferPrivateKeyP trans_priv;
struct TALER_TransferPublicKeyP trans_pub;
struct TALER_TransferSecretP secret;
@@ -43,14 +41,10 @@ test_high_level (void)
struct TALER_PlanchetSecretsP fc1;
struct TALER_PlanchetSecretsP fc2;
- pk = GNUNET_CRYPTO_eddsa_key_create ();
- coin_priv.eddsa_priv = *pk;
- GNUNET_free (pk);
+ GNUNET_CRYPTO_eddsa_key_create (&coin_priv.eddsa_priv);
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv.eddsa_priv,
&coin_pub.eddsa_pub);
- pk2 = GNUNET_CRYPTO_ecdhe_key_create ();
- trans_priv.ecdhe_priv = *pk2;
- GNUNET_free (pk2);
+ GNUNET_CRYPTO_ecdhe_key_create (&trans_priv.ecdhe_priv);
GNUNET_CRYPTO_ecdhe_key_get_public (&trans_priv.ecdhe_priv,
&trans_pub.ecdhe_pub);
TALER_link_derive_transfer_secret (&coin_priv,