small stuff

This commit is contained in:
Christian Grothoff 2015-08-06 12:46:15 +02:00
parent 08cdd3d084
commit ee3dffa87d
2 changed files with 37 additions and 37 deletions

View File

@ -109,7 +109,7 @@ PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIs
GNUNET_CRYPTO_rsa_private_key_dup ( dki->denom_priv.rsa_private_key);
}
{/* denom_pub */
copy->denom_pub.rsa_public_key =
copy->denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key);
}
{/* issue */
@ -172,11 +172,11 @@ struct PERF_TALER_MINTDB_Reserve *
PERF_TALER_MINTDB_reserve_copy (const struct PERF_TALER_MINTDB_Reserve *reserve)
{
struct PERF_TALER_MINTDB_Reserve *copy;
GNUNET_assert (NULL !=
GNUNET_assert (NULL !=
(copy = GNUNET_new (struct PERF_TALER_MINTDB_Reserve)));
*copy = *reserve;
return copy;
}
}
/**
@ -211,8 +211,8 @@ PERF_TALER_MINTDB_deposit_init (const struct PERF_TALER_MINTDB_Coin *coin)
"\"BIC\":\"GENODEF1SRL\""
"}";
static uint64_t transaction_id = 0;
struct GNUNET_TIME_Absolute timestamp;
struct GNUNET_TIME_Absolute refund_deadline;
struct GNUNET_TIME_Absolute timestamp;
struct GNUNET_TIME_Absolute refund_deadline;
struct TALER_Amount amount_with_fee;
struct TALER_Amount deposit_fee;
@ -252,10 +252,10 @@ PERF_TALER_MINTDB_deposit_init (const struct PERF_TALER_MINTDB_Coin *coin)
timestamp = GNUNET_TIME_absolute_get ();
refund_deadline = GNUNET_TIME_absolute_get ();
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":1.1",
TALER_string_to_amount (CURRENCY ":1.1",
&amount_with_fee));
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":0.1",
TALER_string_to_amount (CURRENCY ":0.1",
&deposit_fee));
{
deposit->coin.coin_pub = coin->public_info.coin_pub;
@ -289,10 +289,10 @@ PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit)
{
struct TALER_MINTDB_Deposit *copy;
GNUNET_assert (NULL != (copy = GNUNET_new (struct TALER_MINTDB_Deposit)));
copy = GNUNET_new (struct TALER_MINTDB_Deposit);
*copy = *deposit;
json_incref (copy->wire);
copy->coin.denom_pub.rsa_public_key =
copy->coin.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (deposit->coin.denom_pub.rsa_public_key);
copy->coin.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (deposit->coin.denom_sig.rsa_signature);
@ -308,7 +308,7 @@ PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit)
int
PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit)
{
if ( NULL == deposit)
if (NULL == deposit)
return GNUNET_OK;
GNUNET_CRYPTO_rsa_public_key_free (deposit->coin.denom_pub.rsa_public_key);
GNUNET_CRYPTO_rsa_signature_free (deposit->coin.denom_sig.rsa_signature);
@ -345,20 +345,20 @@ PERF_TALER_MINTDB_coin_init (
GNUNET_CRYPTO_eddsa_key_get_public (&coin->priv,
&coin->public_info.coin_pub.eddsa_pub);
GNUNET_assert (NULL !=
(coin->public_info.denom_pub.rsa_public_key =
(coin->public_info.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key)));
GNUNET_assert (NULL !=
(coin->public_info.denom_sig.rsa_signature =
(coin->public_info.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
&coin->public_info.coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP))));
/* blind */
GNUNET_assert (NULL !=
(coin->blind.sig.rsa_signature =
(coin->blind.sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (coin->public_info.denom_sig.rsa_signature)));
GNUNET_assert (NULL !=
(coin->blind.denom_pub.rsa_public_key =
(coin->blind.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key)));
TALER_amount_ntoh (&coin->blind.amount_with_fee,
&dki->issue.properties.value);
@ -370,7 +370,7 @@ PERF_TALER_MINTDB_coin_init (
{
struct {
struct TALER_ReservePublicKeyP reserve_pub;
struct GNUNET_HashCode hash;
struct GNUNET_HashCode hash;
} data;
data.reserve_pub = reserve->reserve.pub;
@ -395,25 +395,25 @@ PERF_TALER_MINTDB_coin_copy (const struct PERF_TALER_MINTDB_Coin *coin)
{
struct PERF_TALER_MINTDB_Coin *copy;
GNUNET_assert (NULL !=
GNUNET_assert (NULL !=
(copy = GNUNET_new (struct PERF_TALER_MINTDB_Coin)));
/* priv */
copy->priv = coin->priv;
/* public_info */
copy->public_info.coin_pub = coin->public_info.coin_pub;
copy->public_info.denom_pub.rsa_public_key =
copy->public_info.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (coin->public_info.denom_pub.rsa_public_key);
GNUNET_assert (NULL != copy->public_info.denom_pub.rsa_public_key);
copy->public_info.denom_sig.rsa_signature =
copy->public_info.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (coin->public_info.denom_sig.rsa_signature);
GNUNET_assert (NULL != coin->public_info.denom_sig.rsa_signature);
/* blind */
copy->blind.sig.rsa_signature =
copy->blind.sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (coin->blind.sig.rsa_signature);
GNUNET_assert (NULL != copy->blind.sig.rsa_signature);
copy->blind.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (coin->blind.denom_pub.rsa_public_key);
GNUNET_CRYPTO_rsa_public_key_dup (coin->blind.denom_pub.rsa_public_key);
GNUNET_assert (NULL != copy->blind.denom_pub.rsa_public_key);
copy->blind.amount_with_fee = coin->blind.amount_with_fee;
copy->blind.withdraw_fee = coin->blind.withdraw_fee;
@ -464,7 +464,7 @@ PERF_TALER_MINTDB_refresh_session_init ()
* @return #GNUNET_OK if the copy was successful, #GNUNET_SYSERR if it wasn't
*/
int
PERF_TALER_MINTDB_refresh_session_copy (struct TALER_MINTDB_RefreshSession *session,
PERF_TALER_MINTDB_refresh_session_copy (struct TALER_MINTDB_RefreshSession *session,
struct TALER_MINTDB_RefreshSession *copy)
{
*copy = *session;
@ -487,9 +487,9 @@ PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refr
/**
* Create a melt operation
*
* @param session the refresh session
* @param session the refresh session
* @param dki the denomination the melted coin uses
* @return a pointer to a #TALER_MINTDB_RefreshMelt
* @return a pointer to a #TALER_MINTDB_RefreshMelt
*/
struct TALER_MINTDB_RefreshMelt *
PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
@ -498,18 +498,18 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
struct TALER_MINTDB_RefreshMelt *melt;
struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_Amount amount;
struct TALER_Amount amount_with_fee;
struct TALER_Amount amount_with_fee;
{
struct
struct
{
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
struct GNUNET_HashCode session;
} to_sign;
to_sign.purpose.purpose = GNUNET_SIGNATURE_PURPOSE_TEST;
to_sign.purpose.purpose = GNUNET_SIGNATURE_PURPOSE_TEST;
to_sign.purpose.size = htonl (sizeof (to_sign));
to_sign.session = *session;
to_sign.session = *session;
GNUNET_CRYPTO_eddsa_sign (&coin->priv,
&to_sign.purpose,
&coin_sig.eddsa_signature);
@ -518,9 +518,9 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
&amount));
GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":0.1",
&amount_with_fee));
melt = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
melt = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
melt->coin.coin_pub = coin->public_info.coin_pub;
melt->coin.denom_sig.rsa_signature =
melt->coin.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (coin->public_info.denom_sig.rsa_signature);
melt->coin.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (coin->public_info.denom_pub.rsa_public_key);
@ -536,7 +536,7 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
/**
* Copies the internals of a #TALER_MINTDB_RefreshMelt
*
*
* @param melt the refresh melt to copy
* @return an copy of @ melt
*/
@ -547,8 +547,8 @@ PERF_TALER_MINTDB_refresh_melt_copy (const struct TALER_MINTDB_RefreshMelt *melt
copy = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
*copy = *melt;
GNUNET_assert (NULL !=
(copy->coin.denom_sig.rsa_signature =
GNUNET_assert (NULL !=
(copy->coin.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (melt->coin.denom_sig.rsa_signature)));
return copy;
@ -570,7 +570,7 @@ PERF_TALER_MINTDB_refresh_melt_free (struct TALER_MINTDB_RefreshMelt *melt)
/**
* Create a #TALER_MINTDB_RefreshCommitCoin
* Create a #TALER_MINTDB_RefreshCommitCoin
*/
struct TALER_MINTDB_RefreshCommitCoin *
PERF_TALER_MINTDB_refresh_commit_coin_init ()

View File

@ -127,8 +127,8 @@ data_copy (const struct PERF_TALER_MINTDB_Data *data, struct PERF_TALER_MINTDB_D
return;
case PERF_TALER_MINTDB_COIN:
copy->data.coin =
PERF_TALER_MINTDB_coin_copy (data->data.coin);
copy->data.coin
= PERF_TALER_MINTDB_coin_copy (data->data.coin);
return;
case PERF_TALER_MINTDB_RESERVE:
@ -941,7 +941,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
.details.get_reserve.label_reserve)));
data = &state->cmd[reserve_index].exposed;
GNUNET_assert (GNUNET_OK ==
(state->plugin->reserve_get (state->plugin->cls,
state->session,