This commit is contained in:
Christian Grothoff 2015-09-21 14:46:25 +02:00
parent 93a84d5e5a
commit c60a746a5d

View File

@ -301,6 +301,7 @@ TMH_DB_execute_reserve_status (struct MHD_Connection *connection,
* @param dki denomination to withdraw * @param dki denomination to withdraw
* @param blinded_msg blinded message to be signed * @param blinded_msg blinded message to be signed
* @param blinded_msg_len number of bytes in @a blinded_msg * @param blinded_msg_len number of bytes in @a blinded_msg
* @param h_blind hash of @a blinded_msg
* @param signature signature over the withdraw request, to be stored in DB * @param signature signature over the withdraw request, to be stored in DB
* @param denom_sig[out] where to write the resulting signature * @param denom_sig[out] where to write the resulting signature
* (used to release memory in case of transaction failure * (used to release memory in case of transaction failure
@ -315,6 +316,7 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, const struct TALER_MINTDB_DenominationKeyIssueInformation *dki,
const char *blinded_msg, const char *blinded_msg,
size_t blinded_msg_len, size_t blinded_msg_len,
const struct GNUNET_HashCode *h_blind,
const struct TALER_ReserveSignatureP *signature, const struct TALER_ReserveSignatureP *signature,
struct TALER_DenominationSignature *denom_sig) struct TALER_DenominationSignature *denom_sig)
{ {
@ -328,7 +330,6 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
struct TALER_Amount balance; struct TALER_Amount balance;
struct TALER_Amount value; struct TALER_Amount value;
struct TALER_Amount fee_withdraw; struct TALER_Amount fee_withdraw;
struct GNUNET_HashCode h_blind;
int res; int res;
/* Check if balance is sufficient */ /* Check if balance is sufficient */
@ -452,7 +453,7 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
collectable.amount_with_fee = amount_required; collectable.amount_with_fee = amount_required;
collectable.withdraw_fee = fee_withdraw; collectable.withdraw_fee = fee_withdraw;
collectable.reserve_pub = *reserve; collectable.reserve_pub = *reserve;
collectable.h_coin_envelope = h_blind; collectable.h_coin_envelope = *h_blind;
collectable.reserve_sig = *signature; collectable.reserve_sig = *signature;
if (GNUNET_OK != if (GNUNET_OK !=
TMH_plugin->insert_withdraw_info (TMH_plugin->cls, TMH_plugin->insert_withdraw_info (TMH_plugin->cls,
@ -505,7 +506,6 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash (blinded_msg, GNUNET_CRYPTO_hash (blinded_msg,
blinded_msg_len, blinded_msg_len,
&h_blind); &h_blind);
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls, if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
TMH_test_mode))) TMH_test_mode)))
{ {
@ -555,8 +555,10 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
dki, dki,
blinded_msg, blinded_msg,
blinded_msg_len, blinded_msg_len,
&h_blind,
signature, signature,
&denom_sig); &denom_sig);
if (NULL != denom_sig.rsa_signature)
GNUNET_CRYPTO_rsa_signature_free (denom_sig.rsa_signature); GNUNET_CRYPTO_rsa_signature_free (denom_sig.rsa_signature);
TMH_KS_release (key_state); TMH_KS_release (key_state);
return res; return res;