-fix indentation
This commit is contained in:
parent
8ecb693990
commit
0619d6d345
@ -143,7 +143,7 @@ TMH_DB_execute_deposit (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->start (TMH_plugin->cls,
|
TMH_plugin->start (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
@ -169,7 +169,7 @@ TMH_DB_execute_deposit (struct MHD_Connection *connection,
|
|||||||
&value))
|
&value))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
ret = TMH_RESPONSE_reply_deposit_insufficient_funds (connection,
|
ret = TMH_RESPONSE_reply_deposit_insufficient_funds (connection,
|
||||||
tl);
|
tl);
|
||||||
TMH_plugin->free_coin_transaction_list (TMH_plugin->cls,
|
TMH_plugin->free_coin_transaction_list (TMH_plugin->cls,
|
||||||
@ -192,7 +192,7 @@ TMH_DB_execute_deposit (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->commit (TMH_plugin->cls,
|
TMH_plugin->commit (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("/deposit transaction commit failed\n");
|
TALER_LOG_WARNING ("/deposit transaction commit failed\n");
|
||||||
return TMH_RESPONSE_reply_commit_error (connection);
|
return TMH_RESPONSE_reply_commit_error (connection);
|
||||||
@ -310,7 +310,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
if (GNUNET_YES == res)
|
if (GNUNET_YES == res)
|
||||||
{
|
{
|
||||||
res = TMH_RESPONSE_reply_withdraw_sign_success (connection,
|
res = TMH_RESPONSE_reply_withdraw_sign_success (connection,
|
||||||
&collectable);
|
&collectable);
|
||||||
GNUNET_CRYPTO_rsa_signature_free (collectable.sig.rsa_signature);
|
GNUNET_CRYPTO_rsa_signature_free (collectable.sig.rsa_signature);
|
||||||
GNUNET_CRYPTO_rsa_public_key_free (collectable.denom_pub.rsa_public_key);
|
GNUNET_CRYPTO_rsa_public_key_free (collectable.denom_pub.rsa_public_key);
|
||||||
return res;
|
return res;
|
||||||
@ -332,7 +332,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->start (TMH_plugin->cls,
|
TMH_plugin->start (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
@ -345,7 +345,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
if (NULL == rh)
|
if (NULL == rh)
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
return TMH_RESPONSE_reply_arg_unknown (connection,
|
return TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
"reserve_pub");
|
"reserve_pub");
|
||||||
@ -363,7 +363,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
&fee_withdraw))
|
&fee_withdraw))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
@ -422,7 +422,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
res = TMH_RESPONSE_reply_withdraw_sign_insufficient_funds (connection,
|
res = TMH_RESPONSE_reply_withdraw_sign_insufficient_funds (connection,
|
||||||
rh);
|
rh);
|
||||||
TMH_plugin->free_reserve_history (TMH_plugin->cls,
|
TMH_plugin->free_reserve_history (TMH_plugin->cls,
|
||||||
@ -441,9 +441,9 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_error (connection,
|
return TMH_RESPONSE_reply_internal_error (connection,
|
||||||
"Internal error");
|
"Internal error");
|
||||||
}
|
}
|
||||||
collectable.sig.rsa_signature = sig;
|
collectable.sig.rsa_signature = sig;
|
||||||
collectable.denom_pub = *denomination_pub;
|
collectable.denom_pub = *denomination_pub;
|
||||||
@ -454,26 +454,26 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
|
|||||||
collectable.reserve_sig = *signature;
|
collectable.reserve_sig = *signature;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_collectable_blindcoin (TMH_plugin->cls,
|
TMH_plugin->insert_collectable_blindcoin (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
&h_blind,
|
&h_blind,
|
||||||
amount_required,
|
amount_required,
|
||||||
&collectable))
|
&collectable))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_CRYPTO_rsa_signature_free (sig);
|
GNUNET_CRYPTO_rsa_signature_free (sig);
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->commit (TMH_plugin->cls,
|
TMH_plugin->commit (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("/withdraw/sign transaction commit failed\n");
|
TALER_LOG_WARNING ("/withdraw/sign transaction commit failed\n");
|
||||||
return TMH_RESPONSE_reply_commit_error (connection);
|
return TMH_RESPONSE_reply_commit_error (connection);
|
||||||
}
|
}
|
||||||
res = TMH_RESPONSE_reply_withdraw_sign_success (connection,
|
res = TMH_RESPONSE_reply_withdraw_sign_success (connection,
|
||||||
&collectable);
|
&collectable);
|
||||||
GNUNET_CRYPTO_rsa_signature_free (sig);
|
GNUNET_CRYPTO_rsa_signature_free (sig);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -516,7 +516,7 @@ refresh_accept_melts (struct MHD_Connection *connection,
|
|||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_arg_unknown (connection,
|
TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
"denom_pub"))
|
"denom_pub"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
|
|
||||||
TALER_amount_ntoh (&coin_value,
|
TALER_amount_ntoh (&coin_value,
|
||||||
&dki->value);
|
&dki->value);
|
||||||
@ -552,7 +552,7 @@ refresh_accept_melts (struct MHD_Connection *connection,
|
|||||||
tl,
|
tl,
|
||||||
coin_details->melt_amount_with_fee,
|
coin_details->melt_amount_with_fee,
|
||||||
coin_residual))
|
coin_residual))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
TMH_plugin->free_coin_transaction_list (TMH_plugin->cls,
|
TMH_plugin->free_coin_transaction_list (TMH_plugin->cls,
|
||||||
tl);
|
tl);
|
||||||
return res;
|
return res;
|
||||||
@ -618,13 +618,13 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
if (NULL ==
|
if (NULL ==
|
||||||
(session = TMH_plugin->get_session (TMH_plugin->cls,
|
(session = TMH_plugin->get_session (TMH_plugin->cls,
|
||||||
GNUNET_NO)))
|
GNUNET_NO)))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->start (TMH_plugin->cls,
|
TMH_plugin->start (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
@ -636,7 +636,7 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
if (GNUNET_YES == res)
|
if (GNUNET_YES == res)
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
res = TMH_RESPONSE_reply_refresh_melt_success (connection,
|
res = TMH_RESPONSE_reply_refresh_melt_success (connection,
|
||||||
session_hash,
|
session_hash,
|
||||||
refresh_session.noreveal_index);
|
refresh_session.noreveal_index);
|
||||||
@ -645,7 +645,7 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
if (GNUNET_SYSERR == res)
|
if (GNUNET_SYSERR == res)
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,7 +663,7 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
|
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,10 +672,10 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
/* store requested new denominations */
|
/* store requested new denominations */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_refresh_order (TMH_plugin->cls,
|
TMH_plugin->insert_refresh_order (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
num_new_denoms,
|
num_new_denoms,
|
||||||
denom_pubs))
|
denom_pubs))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
@ -686,14 +686,14 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_refresh_commit_coins (TMH_plugin->cls,
|
TMH_plugin->insert_refresh_commit_coins (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
i,
|
i,
|
||||||
num_new_denoms,
|
num_new_denoms,
|
||||||
commit_coin[i]))
|
commit_coin[i]))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -701,14 +701,14 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_refresh_commit_links (TMH_plugin->cls,
|
TMH_plugin->insert_refresh_commit_links (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
i,
|
i,
|
||||||
coin_count,
|
coin_count,
|
||||||
commit_link[i]))
|
commit_link[i]))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -718,16 +718,16 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
refresh_session.num_oldcoins = coin_count;
|
refresh_session.num_oldcoins = coin_count;
|
||||||
refresh_session.num_newcoins = num_new_denoms;
|
refresh_session.num_newcoins = num_new_denoms;
|
||||||
refresh_session.noreveal_index
|
refresh_session.noreveal_index
|
||||||
= GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG,
|
= GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG,
|
||||||
TALER_CNC_KAPPA);
|
TALER_CNC_KAPPA);
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
(res = TMH_plugin->create_refresh_session (TMH_plugin->cls,
|
(res = TMH_plugin->create_refresh_session (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
&refresh_session)))
|
&refresh_session)))
|
||||||
{
|
{
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
session);
|
session);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,14 +735,14 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->commit (TMH_plugin->cls,
|
TMH_plugin->commit (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("/refresh/melt transaction commit failed\n");
|
TALER_LOG_WARNING ("/refresh/melt transaction commit failed\n");
|
||||||
return TMH_RESPONSE_reply_commit_error (connection);
|
return TMH_RESPONSE_reply_commit_error (connection);
|
||||||
}
|
}
|
||||||
return TMH_RESPONSE_reply_refresh_melt_success (connection,
|
return TMH_RESPONSE_reply_refresh_melt_success (connection,
|
||||||
session_hash,
|
session_hash,
|
||||||
refresh_session.noreveal_index);
|
refresh_session.noreveal_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -788,16 +788,16 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
sizeof (struct TALER_MINTDB_RefreshCommitLinkP));
|
sizeof (struct TALER_MINTDB_RefreshCommitLinkP));
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->get_refresh_commit_links (TMH_plugin->cls,
|
TMH_plugin->get_refresh_commit_links (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
off,
|
off,
|
||||||
num_oldcoins,
|
num_oldcoins,
|
||||||
commit_links))
|
commit_links))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (commit_links);
|
GNUNET_free (commit_links);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < num_oldcoins; j++)
|
for (j = 0; j < num_oldcoins; j++)
|
||||||
@ -818,11 +818,11 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
GNUNET_free (commit_links);
|
GNUNET_free (commit_links);
|
||||||
/* FIXME: return more specific error with original signature (#3712) */
|
/* FIXME: return more specific error with original signature (#3712) */
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
||||||
off,
|
off,
|
||||||
j,
|
j,
|
||||||
"transfer key"))
|
"transfer key"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're converting key types here, which is not very nice
|
/* We're converting key types here, which is not very nice
|
||||||
@ -840,8 +840,8 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe);
|
GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe);
|
||||||
GNUNET_free (commit_links);
|
GNUNET_free (commit_links);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
||||||
"ECDH error"))
|
"ECDH error"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe);
|
GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe);
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -852,9 +852,9 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (commit_links);
|
GNUNET_free (commit_links);
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_internal_error (connection,
|
TMH_RESPONSE_reply_internal_error (connection,
|
||||||
"Decryption error"))
|
"Decryption error"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_NO == secret_initialized)
|
if (GNUNET_NO == secret_initialized)
|
||||||
@ -871,11 +871,11 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
GNUNET_free (commit_links);
|
GNUNET_free (commit_links);
|
||||||
/* FIXME: return more specific error with original signature (#3712) */
|
/* FIXME: return more specific error with original signature (#3712) */
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
||||||
off,
|
off,
|
||||||
j,
|
j,
|
||||||
"transfer secret"))
|
"transfer secret"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_break (GNUNET_YES == secret_initialized);
|
GNUNET_break (GNUNET_YES == secret_initialized);
|
||||||
@ -887,16 +887,16 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls,
|
TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
off,
|
off,
|
||||||
num_newcoins,
|
num_newcoins,
|
||||||
commit_coins))
|
commit_coins))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (commit_coins);
|
GNUNET_free (commit_coins);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < num_newcoins; j++)
|
for (j = 0; j < num_newcoins; j++)
|
||||||
@ -915,7 +915,7 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
GNUNET_free (commit_coins);
|
GNUNET_free (commit_coins);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
||||||
"Decryption error"))
|
"Decryption error"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
GNUNET_CRYPTO_ecdsa_key_get_public (&link_data->coin_priv.ecdsa_priv,
|
GNUNET_CRYPTO_ecdsa_key_get_public (&link_data->coin_priv.ecdsa_priv,
|
||||||
@ -933,8 +933,8 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
"blind failed\n");
|
"blind failed\n");
|
||||||
GNUNET_free (commit_coins);
|
GNUNET_free (commit_coins);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
|
||||||
"Blinding error"))
|
"Blinding error"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (buf_len != commit_coins[j].coin_ev_size) ||
|
if ( (buf_len != commit_coins[j].coin_ev_size) ||
|
||||||
@ -949,11 +949,11 @@ check_commitment (struct MHD_Connection *connection,
|
|||||||
/* FIXME: return more specific error with original signature (#3712) */
|
/* FIXME: return more specific error with original signature (#3712) */
|
||||||
GNUNET_free (commit_coins);
|
GNUNET_free (commit_coins);
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
TMH_RESPONSE_reply_refresh_reveal_missmatch (connection,
|
||||||
off,
|
off,
|
||||||
j,
|
j,
|
||||||
"envelope"))
|
"envelope"))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_free (buf);
|
GNUNET_free (buf);
|
||||||
}
|
}
|
||||||
@ -989,7 +989,7 @@ refresh_mint_coin (struct MHD_Connection *connection,
|
|||||||
struct TALER_DenominationSignature ev_sig;
|
struct TALER_DenominationSignature ev_sig;
|
||||||
|
|
||||||
dki = TMH_KS_denomination_key_lookup (key_state,
|
dki = TMH_KS_denomination_key_lookup (key_state,
|
||||||
denom_pub);
|
denom_pub);
|
||||||
if (NULL == dki)
|
if (NULL == dki)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -997,9 +997,9 @@ refresh_mint_coin (struct MHD_Connection *connection,
|
|||||||
return ev_sig;
|
return ev_sig;
|
||||||
}
|
}
|
||||||
ev_sig.rsa_signature
|
ev_sig.rsa_signature
|
||||||
= GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
|
= GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
|
||||||
commit_coin->coin_ev,
|
commit_coin->coin_ev,
|
||||||
commit_coin->coin_ev_size);
|
commit_coin->coin_ev_size);
|
||||||
if (NULL == ev_sig.rsa_signature)
|
if (NULL == ev_sig.rsa_signature)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -1007,10 +1007,10 @@ refresh_mint_coin (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_refresh_collectable (TMH_plugin->cls,
|
TMH_plugin->insert_refresh_collectable (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
coin_off,
|
coin_off,
|
||||||
&ev_sig))
|
&ev_sig))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_CRYPTO_rsa_signature_free (ev_sig.rsa_signature);
|
GNUNET_CRYPTO_rsa_signature_free (ev_sig.rsa_signature);
|
||||||
@ -1036,9 +1036,9 @@ refresh_mint_coin (struct MHD_Connection *connection,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
||||||
const struct GNUNET_HashCode *session_hash,
|
const struct GNUNET_HashCode *session_hash,
|
||||||
unsigned int num_oldcoins,
|
unsigned int num_oldcoins,
|
||||||
struct TALER_TransferPrivateKeyP **transfer_privs)
|
struct TALER_TransferPrivateKeyP **transfer_privs)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct TALER_MINTDB_Session *session;
|
struct TALER_MINTDB_Session *session;
|
||||||
@ -1053,19 +1053,19 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
unsigned int off;
|
unsigned int off;
|
||||||
|
|
||||||
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
|
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
|
||||||
GNUNET_NO)))
|
GNUNET_NO)))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = TMH_plugin->get_refresh_session (TMH_plugin->cls,
|
res = TMH_plugin->get_refresh_session (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
&refresh_session);
|
&refresh_session);
|
||||||
if (GNUNET_NO == res)
|
if (GNUNET_NO == res)
|
||||||
return TMH_RESPONSE_reply_arg_invalid (connection,
|
return TMH_RESPONSE_reply_arg_invalid (connection,
|
||||||
"session_hash");
|
"session_hash");
|
||||||
if (GNUNET_SYSERR == res)
|
if (GNUNET_SYSERR == res)
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
if (0 == refresh_session.num_oldcoins)
|
if (0 == refresh_session.num_oldcoins)
|
||||||
@ -1080,10 +1080,10 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->get_refresh_melt (TMH_plugin->cls,
|
TMH_plugin->get_refresh_melt (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
j,
|
j,
|
||||||
&melts[j]))
|
&melts[j]))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (melts);
|
GNUNET_free (melts);
|
||||||
@ -1094,16 +1094,16 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
sizeof (struct TALER_DenominationPublicKey));
|
sizeof (struct TALER_DenominationPublicKey));
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->get_refresh_order (TMH_plugin->cls,
|
TMH_plugin->get_refresh_order (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
refresh_session.num_newcoins,
|
refresh_session.num_newcoins,
|
||||||
denom_pubs))
|
denom_pubs))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (denom_pubs);
|
GNUNET_free (denom_pubs);
|
||||||
GNUNET_free (melts);
|
GNUNET_free (melts);
|
||||||
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
return (MHD_YES == TMH_RESPONSE_reply_internal_db_error (connection))
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1135,7 +1135,7 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
/* Client request OK, start transaction */
|
/* Client request OK, start transaction */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->start (TMH_plugin->cls,
|
TMH_plugin->start (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
for (j=0;j<refresh_session.num_newcoins;j++)
|
for (j=0;j<refresh_session.num_newcoins;j++)
|
||||||
@ -1148,11 +1148,11 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
sizeof (struct TALER_MINTDB_RefreshCommitCoin));
|
sizeof (struct TALER_MINTDB_RefreshCommitCoin));
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls,
|
TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
session_hash,
|
session_hash,
|
||||||
refresh_session.noreveal_index,
|
refresh_session.noreveal_index,
|
||||||
refresh_session.num_newcoins,
|
refresh_session.num_newcoins,
|
||||||
commit_coins))
|
commit_coins))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_free (commit_coins);
|
GNUNET_free (commit_coins);
|
||||||
@ -1194,7 +1194,7 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->commit (TMH_plugin->cls,
|
TMH_plugin->commit (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("/refresh/reveal transaction commit failed\n");
|
TALER_LOG_WARNING ("/refresh/reveal transaction commit failed\n");
|
||||||
for (i=0;i<refresh_session.num_newcoins;i++)
|
for (i=0;i<refresh_session.num_newcoins;i++)
|
||||||
@ -1204,8 +1204,8 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = TMH_RESPONSE_reply_refresh_reveal_success (connection,
|
res = TMH_RESPONSE_reply_refresh_reveal_success (connection,
|
||||||
refresh_session.num_newcoins,
|
refresh_session.num_newcoins,
|
||||||
ev_sigs);
|
ev_sigs);
|
||||||
for (i=0;i<refresh_session.num_newcoins;i++)
|
for (i=0;i<refresh_session.num_newcoins;i++)
|
||||||
GNUNET_CRYPTO_rsa_signature_free (ev_sigs[i].rsa_signature);
|
GNUNET_CRYPTO_rsa_signature_free (ev_sigs[i].rsa_signature);
|
||||||
GNUNET_free (ev_sigs);
|
GNUNET_free (ev_sigs);
|
||||||
@ -1256,15 +1256,15 @@ TMH_DB_execute_refresh_link (struct MHD_Connection *connection,
|
|||||||
GNUNET_assert (GNUNET_OK == res);
|
GNUNET_assert (GNUNET_OK == res);
|
||||||
|
|
||||||
ldl = TMH_plugin->get_link_data_list (TMH_plugin->cls,
|
ldl = TMH_plugin->get_link_data_list (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
coin_pub);
|
coin_pub);
|
||||||
if (NULL == ldl)
|
if (NULL == ldl)
|
||||||
{
|
{
|
||||||
return TMH_RESPONSE_reply_json_pack (connection,
|
return TMH_RESPONSE_reply_json_pack (connection,
|
||||||
MHD_HTTP_NOT_FOUND,
|
MHD_HTTP_NOT_FOUND,
|
||||||
"{s:s}",
|
"{s:s}",
|
||||||
"error",
|
"error",
|
||||||
"link data not found (link)");
|
"link data not found (link)");
|
||||||
}
|
}
|
||||||
res = TMH_RESPONSE_reply_refresh_link_success (connection,
|
res = TMH_RESPONSE_reply_refresh_link_success (connection,
|
||||||
&transfer_pub,
|
&transfer_pub,
|
||||||
|
Loading…
Reference in New Issue
Block a user