summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c53
-rw-r--r--src/exchange/taler-exchange-httpd_deposits_get.c40
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c21
-rw-r--r--src/exchange/taler-exchange-httpd_keys.h4
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c16
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c15
-rw-r--r--src/exchange/taler-exchange-httpd_refund.c22
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c196
-rw-r--r--src/exchange/taler-exchange-httpd_transfers_get.c47
9 files changed, 169 insertions, 245 deletions
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index 00353a401..59d25904f 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -57,41 +57,36 @@
* @return MHD result code
*/
static MHD_RESULT
-reply_deposit_success (struct MHD_Connection *connection,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_MerchantWireHashP *h_wire,
- const struct TALER_ExtensionContractHashP *h_extensions,
- const struct
- TALER_PrivateContractHashP *h_contract_terms,
- struct GNUNET_TIME_Timestamp exchange_timestamp,
- struct GNUNET_TIME_Timestamp refund_deadline,
- struct GNUNET_TIME_Timestamp wire_deadline,
- const struct TALER_MerchantPublicKeyP *merchant,
- const struct TALER_Amount *amount_without_fee)
+reply_deposit_success (
+ struct MHD_Connection *connection,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_MerchantWireHashP *h_wire,
+ const struct TALER_ExtensionContractHashP *h_extensions,
+ const struct TALER_PrivateContractHashP *h_contract_terms,
+ struct GNUNET_TIME_Timestamp exchange_timestamp,
+ struct GNUNET_TIME_Timestamp refund_deadline,
+ struct GNUNET_TIME_Timestamp wire_deadline,
+ const struct TALER_MerchantPublicKeyP *merchant,
+ const struct TALER_Amount *amount_without_fee)
{
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
- struct TALER_DepositConfirmationPS dc = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT),
- .purpose.size = htonl (sizeof (dc)),
- .h_contract_terms = *h_contract_terms,
- .h_wire = *h_wire,
- .exchange_timestamp = GNUNET_TIME_timestamp_hton (exchange_timestamp),
- .refund_deadline = GNUNET_TIME_timestamp_hton (refund_deadline),
- .wire_deadline = GNUNET_TIME_timestamp_hton (wire_deadline),
- .coin_pub = *coin_pub,
- .merchant_pub = *merchant
- };
enum TALER_ErrorCode ec;
- if (NULL != h_extensions)
- dc.h_extensions = *h_extensions;
- TALER_amount_hton (&dc.amount_without_fee,
- amount_without_fee);
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&dc,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_deposit_confirmation_sign (
+ &TEH_keys_exchange_sign_,
+ h_contract_terms,
+ h_wire,
+ h_extensions,
+ exchange_timestamp,
+ wire_deadline,
+ refund_deadline,
+ amount_without_fee,
+ coin_pub,
+ merchant,
+ &pub,
+ &sig)))
{
return TALER_MHD_reply_with_ec (connection,
ec,
diff --git a/src/exchange/taler-exchange-httpd_deposits_get.c b/src/exchange/taler-exchange-httpd_deposits_get.c
index c88026fc4..72657d16e 100644
--- a/src/exchange/taler-exchange-httpd_deposits_get.c
+++ b/src/exchange/taler-exchange-httpd_deposits_get.c
@@ -46,34 +46,30 @@
* @return MHD result code
*/
static MHD_RESULT
-reply_deposit_details (struct MHD_Connection *connection,
- const struct
- TALER_PrivateContractHashP *h_contract_terms,
- const struct TALER_MerchantWireHashP *h_wire,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_Amount *coin_contribution,
- const struct TALER_WireTransferIdentifierRawP *wtid,
- struct GNUNET_TIME_Timestamp exec_time)
+reply_deposit_details (
+ struct MHD_Connection *connection,
+ const struct TALER_PrivateContractHashP *h_contract_terms,
+ const struct TALER_MerchantWireHashP *h_wire,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_Amount *coin_contribution,
+ const struct TALER_WireTransferIdentifierRawP *wtid,
+ struct GNUNET_TIME_Timestamp exec_time)
{
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
- struct TALER_ConfirmWirePS cw = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE),
- .purpose.size = htonl (sizeof (cw)),
- .h_wire = *h_wire,
- .h_contract_terms = *h_contract_terms,
- .wtid = *wtid,
- .coin_pub = *coin_pub,
- .execution_time = GNUNET_TIME_timestamp_hton (exec_time)
- };
enum TALER_ErrorCode ec;
- TALER_amount_hton (&cw.coin_contribution,
- coin_contribution);
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&cw,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_confirm_wire_sign (
+ &TEH_keys_exchange_sign_,
+ h_wire,
+ h_contract_terms,
+ wtid,
+ coin_pub,
+ exec_time,
+ coin_contribution,
+ &pub,
+ &sig)))
{
return TALER_MHD_reply_with_ec (connection,
ec,
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index 658e5a347..e0ca24a65 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -1797,19 +1797,17 @@ create_krd (struct TEH_KeyStateHandle *ksh,
GNUNET_TIME_timestamp2s (last_cpd));
/* Sign hash over denomination keys */
{
- struct TALER_ExchangeKeySetPS ks = {
- .purpose.size = htonl (sizeof (ks)),
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_KEY_SET),
- .list_issue_date = GNUNET_TIME_timestamp_hton (last_cpd),
- .hc = *denom_keys_hash
- };
enum TALER_ErrorCode ec;
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign2 (ksh,
- &ks,
- &exchange_pub,
- &exchange_sig)))
+ (ec =
+ TALER_exchange_online_key_set_sign (
+ &TEH_keys_exchange_sign2_,
+ ksh,
+ last_cpd,
+ denom_keys_hash,
+ &exchange_pub,
+ &exchange_sig)))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Could not create key response data: cannot sign (%s)\n",
@@ -2770,11 +2768,12 @@ TEH_keys_exchange_sign_ (
enum TALER_ErrorCode
TEH_keys_exchange_sign2_ (
- struct TEH_KeyStateHandle *ksh,
+ void *cls,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig)
{
+ struct TEH_KeyStateHandle *ksh = cls;
enum TALER_ErrorCode ec;
TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_EDDSA]++;
diff --git a/src/exchange/taler-exchange-httpd_keys.h b/src/exchange/taler-exchange-httpd_keys.h
index 732ee032d..544906ad8 100644
--- a/src/exchange/taler-exchange-httpd_keys.h
+++ b/src/exchange/taler-exchange-httpd_keys.h
@@ -367,7 +367,7 @@ TEH_keys_exchange_sign_ (
* number of bytes of the data structure, including its header. Use
* #TEH_keys_exchange_sign() instead of calling this function directly!
*
- * @param ksh key state state to look in
+ * @param cls key state state to look in
* @param purpose the message to sign
* @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key
@@ -375,7 +375,7 @@ TEH_keys_exchange_sign_ (
*/
enum TALER_ErrorCode
TEH_keys_exchange_sign2_ (
- struct TEH_KeyStateHandle *ksh,
+ void *cls,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig);
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
index d6b16d219..62ecbaab9 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -414,19 +414,15 @@ TEH_handler_kyc_check (
{
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
- struct TALER_ExchangeAccountSetupSuccessPS as = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_EXCHANGE_ACCOUNT_SETUP_SUCCESS),
- .purpose.size = htonl (sizeof (as)),
- .h_payto = kyp->h_payto,
- .timestamp = GNUNET_TIME_timestamp_hton (now)
- };
enum TALER_ErrorCode ec;
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&as,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_account_setup_success_sign (
+ &TEH_keys_exchange_sign_,
+ &kyp->h_payto,
+ now,
+ &pub,
+ &sig)))
{
return TALER_MHD_reply_with_ec (rc->connection,
ec,
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c
index 531209c10..6fe97c8f2 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -48,18 +48,15 @@ reply_melt_success (struct MHD_Connection *connection,
{
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
- struct TALER_RefreshMeltConfirmationPS body = {
- .purpose.size = htonl (sizeof (body)),
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT),
- .rc = *rc,
- .noreveal_index = htonl (noreveal_index)
- };
enum TALER_ErrorCode ec;
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&body,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_melt_confirmation_sign (
+ &TEH_keys_exchange_sign_,
+ rc,
+ noreveal_index,
+ &pub,
+ &sig)))
{
return TALER_MHD_reply_with_ec (connection,
ec,
diff --git a/src/exchange/taler-exchange-httpd_refund.c b/src/exchange/taler-exchange-httpd_refund.c
index 84b60bcdb..3718fdedf 100644
--- a/src/exchange/taler-exchange-httpd_refund.c
+++ b/src/exchange/taler-exchange-httpd_refund.c
@@ -50,22 +50,18 @@ reply_refund_success (struct MHD_Connection *connection,
{
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
- struct TALER_RefundConfirmationPS rc = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND),
- .purpose.size = htonl (sizeof (rc)),
- .h_contract_terms = refund->h_contract_terms,
- .coin_pub = *coin_pub,
- .merchant = refund->merchant_pub,
- .rtransaction_id = GNUNET_htonll (refund->rtransaction_id)
- };
enum TALER_ErrorCode ec;
- TALER_amount_hton (&rc.refund_amount,
- &refund->refund_amount);
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&rc,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_refund_confirmation_sign (
+ &TEH_keys_exchange_sign_,
+ &refund->h_contract_terms,
+ coin_pub,
+ &refund->merchant_pub,
+ refund->rtransaction_id,
+ &refund->refund_amount,
+ &pub,
+ &sig)))
{
return TALER_MHD_reply_with_ec (connection,
ec,
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index ee8c902dd..725e08d96 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -241,21 +241,16 @@ TEH_RESPONSE_compile_transaction_history (
pos->details.old_coin_recoup;
struct TALER_ExchangePublicKeyP epub;
struct TALER_ExchangeSignatureP esig;
- struct TALER_RecoupRefreshConfirmationPS pc = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH),
- .purpose.size = htonl (sizeof (pc)),
- .timestamp = GNUNET_TIME_timestamp_hton (pr->timestamp),
- .coin_pub = pr->coin.coin_pub,
- .old_coin_pub = pr->old_coin_pub
- };
-
- TALER_amount_hton (&pc.recoup_amount,
- &pr->value);
+
if (TALER_EC_NONE !=
- TEH_keys_exchange_sign (&pc,
- &epub,
- &esig))
+ TALER_exchange_online_confirm_recoup_refresh_sign (
+ &TEH_keys_exchange_sign_,
+ pr->timestamp,
+ &pr->value,
+ &pr->coin.coin_pub,
+ &pr->old_coin_pub,
+ &epub,
+ &esig))
{
GNUNET_break (0);
json_decref (history);
@@ -295,20 +290,16 @@ TEH_RESPONSE_compile_transaction_history (
pos->details.recoup;
struct TALER_ExchangePublicKeyP epub;
struct TALER_ExchangeSignatureP esig;
- struct TALER_RecoupConfirmationPS pc = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP),
- .purpose.size = htonl (sizeof (pc)),
- .timestamp = GNUNET_TIME_timestamp_hton (recoup->timestamp),
- .coin_pub = *coin_pub,
- .reserve_pub = recoup->reserve_pub
- };
-
- TALER_amount_hton (&pc.recoup_amount,
- &recoup->value);
+
if (TALER_EC_NONE !=
- TEH_keys_exchange_sign (&pc,
- &epub,
- &esig))
+ TALER_exchange_online_confirm_recoup_sign (
+ &TEH_keys_exchange_sign_,
+ recoup->timestamp,
+ &recoup->value,
+ coin_pub,
+ &recoup->reserve_pub,
+ &epub,
+ &esig))
{
GNUNET_break (0);
json_decref (history);
@@ -351,21 +342,16 @@ TEH_RESPONSE_compile_transaction_history (
pos->details.recoup_refresh;
struct TALER_ExchangePublicKeyP epub;
struct TALER_ExchangeSignatureP esig;
- struct TALER_RecoupRefreshConfirmationPS pc = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH),
- .purpose.size = htonl (sizeof (pc)),
- .timestamp = GNUNET_TIME_timestamp_hton (pr->timestamp),
- .coin_pub = *coin_pub,
- .old_coin_pub = pr->old_coin_pub
- };
-
- TALER_amount_hton (&pc.recoup_amount,
- &pr->value);
+
if (TALER_EC_NONE !=
- TEH_keys_exchange_sign (&pc,
- &epub,
- &esig))
+ TALER_exchange_online_confirm_recoup_refresh_sign (
+ &TEH_keys_exchange_sign_,
+ pr->timestamp,
+ &pr->value,
+ coin_pub,
+ &pr->old_coin_pub,
+ &epub,
+ &esig))
{
GNUNET_break (0);
json_decref (history);
@@ -424,18 +410,12 @@ TEH_RESPONSE_reply_unknown_denom_pub_hash (
enum TALER_ErrorCode ec;
now = GNUNET_TIME_timestamp_get ();
- {
- struct TALER_DenominationUnknownAffirmationPS dua = {
- .purpose.size = htonl (sizeof (dua)),
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN),
- .timestamp = GNUNET_TIME_timestamp_hton (now),
- .h_denom_pub = *dph,
- };
-
- ec = TEH_keys_exchange_sign (&dua,
- &epub,
- &esig);
- }
+ ec = TALER_exchange_online_denomination_unknown_sign (
+ &TEH_keys_exchange_sign_,
+ now,
+ dph,
+ &epub,
+ &esig);
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
@@ -471,22 +451,14 @@ TEH_RESPONSE_reply_expired_denom_pub_hash (
enum TALER_ErrorCode ecr;
struct GNUNET_TIME_Timestamp now
= GNUNET_TIME_timestamp_get ();
- struct TALER_DenominationExpiredAffirmationPS dua = {
- .purpose.size = htonl (sizeof (dua)),
- .purpose.purpose = htonl (
- TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_EXPIRED),
- .timestamp = GNUNET_TIME_timestamp_hton (now),
- .h_denom_pub = *dph,
- };
-
- /* strncpy would create a compiler warning */
- memcpy (dua.operation,
- oper,
- GNUNET_MIN (sizeof (dua.operation),
- strlen (oper)));
- ecr = TEH_keys_exchange_sign (&dua,
- &epub,
- &esig);
+
+ ecr = TALER_exchange_online_denomination_expired_sign (
+ &TEH_keys_exchange_sign_,
+ now,
+ dph,
+ oper,
+ &epub,
+ &esig);
if (TALER_EC_NONE != ecr)
{
GNUNET_break (0);
@@ -523,18 +495,12 @@ TEH_RESPONSE_reply_invalid_denom_cipher_for_operation (
enum TALER_ErrorCode ec;
now = GNUNET_TIME_timestamp_get ();
- {
- struct TALER_DenominationUnknownAffirmationPS dua = {
- .purpose.size = htonl (sizeof (dua)),
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN),
- .timestamp = GNUNET_TIME_timestamp_hton (now),
- .h_denom_pub = *dph,
- };
-
- ec = TEH_keys_exchange_sign (&dua,
- &epub,
- &esig);
- }
+ ec = TALER_exchange_online_denomination_unknown_sign (
+ &TEH_keys_exchange_sign_,
+ now,
+ dph,
+ &epub,
+ &esig);
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
@@ -679,26 +645,19 @@ TEH_RESPONSE_compile_reserve_history (
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
+ if (TALER_EC_NONE !=
+ TALER_exchange_online_confirm_recoup_sign (
+ &TEH_keys_exchange_sign_,
+ recoup->timestamp,
+ &recoup->value,
+ &recoup->coin.coin_pub,
+ &recoup->reserve_pub,
+ &pub,
+ &sig))
{
- struct TALER_RecoupConfirmationPS pc = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP),
- .purpose.size = htonl (sizeof (pc)),
- .timestamp = GNUNET_TIME_timestamp_hton (recoup->timestamp),
- .coin_pub = recoup->coin.coin_pub,
- .reserve_pub = recoup->reserve_pub
- };
-
- TALER_amount_hton (&pc.recoup_amount,
- &recoup->value);
- if (TALER_EC_NONE !=
- TEH_keys_exchange_sign (&pc,
- &pub,
- &sig))
- {
- GNUNET_break (0);
- json_decref (json_history);
- return NULL;
- }
+ GNUNET_break (0);
+ json_decref (json_history);
+ return NULL;
}
if (0 !=
@@ -731,30 +690,21 @@ TEH_RESPONSE_compile_reserve_history (
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
+ if (TALER_EC_NONE !=
+ TALER_exchange_online_reserve_closed_sign (
+ &TEH_keys_exchange_sign_,
+ closing->execution_date,
+ &closing->amount,
+ &closing->closing_fee,
+ closing->receiver_account_details,
+ &closing->wtid,
+ &pos->details.closing->reserve_pub,
+ &pub,
+ &sig))
{
- struct TALER_ReserveCloseConfirmationPS rcc = {
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED),
- .purpose.size = htonl (sizeof (rcc)),
- .timestamp = GNUNET_TIME_timestamp_hton (closing->execution_date),
- .reserve_pub = pos->details.closing->reserve_pub,
- .wtid = closing->wtid
- };
-
- TALER_amount_hton (&rcc.closing_amount,
- &closing->amount);
- TALER_amount_hton (&rcc.closing_fee,
- &closing->closing_fee);
- TALER_payto_hash (closing->receiver_account_details,
- &rcc.h_payto);
- if (TALER_EC_NONE !=
- TEH_keys_exchange_sign (&rcc,
- &pub,
- &sig))
- {
- GNUNET_break (0);
- json_decref (json_history);
- return NULL;
- }
+ GNUNET_break (0);
+ json_decref (json_history);
+ return NULL;
}
if (0 !=
json_array_append_new (
diff --git a/src/exchange/taler-exchange-httpd_transfers_get.c b/src/exchange/taler-exchange-httpd_transfers_get.c
index 3f87f370a..0a994d8ec 100644
--- a/src/exchange/taler-exchange-httpd_transfers_get.c
+++ b/src/exchange/taler-exchange-httpd_transfers_get.c
@@ -93,11 +93,11 @@ reply_transfer_details (struct MHD_Connection *connection,
const struct AggregatedDepositDetail *wdd_head)
{
json_t *deposits;
- struct TALER_WireDepositDetailP dd;
struct GNUNET_HashContext *hash_context;
- struct TALER_WireDepositDataPS wdp;
+ struct GNUNET_HashCode h_details;
struct TALER_ExchangePublicKeyP pub;
struct TALER_ExchangeSignatureP sig;
+ struct TALER_PaytoHashP h_payto;
deposits = json_array ();
GNUNET_assert (NULL != deposits);
@@ -106,16 +106,12 @@ reply_transfer_details (struct MHD_Connection *connection,
NULL != wdd_pos;
wdd_pos = wdd_pos->next)
{
- dd.h_contract_terms = wdd_pos->h_contract_terms;
- dd.execution_time = GNUNET_TIME_timestamp_hton (exec_time);
- dd.coin_pub = wdd_pos->coin_pub;
- TALER_amount_hton (&dd.deposit_value,
- &wdd_pos->deposit_value);
- TALER_amount_hton (&dd.deposit_fee,
- &wdd_pos->deposit_fee);
- GNUNET_CRYPTO_hash_context_read (hash_context,
- &dd,
- sizeof (struct TALER_WireDepositDetailP));
+ TALER_exchange_online_wire_deposit_append (hash_context,
+ &wdd_pos->h_contract_terms,
+ exec_time,
+ &wdd_pos->coin_pub,
+ &wdd_pos->deposit_value,
+ &wdd_pos->deposit_fee);
if (0 !=
json_array_append_new (
deposits,
@@ -137,24 +133,21 @@ reply_transfer_details (struct MHD_Connection *connection,
"json_array_append_new() failed");
}
}
- wdp.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT);
- wdp.purpose.size = htonl (sizeof (struct TALER_WireDepositDataPS));
- TALER_amount_hton (&wdp.total,
- total);
- TALER_amount_hton (&wdp.wire_fee,
- wire_fee);
- wdp.merchant_pub = *merchant_pub;
- TALER_payto_hash (payto_uri,
- &wdp.h_payto);
GNUNET_CRYPTO_hash_context_finish (hash_context,
- &wdp.h_details);
+ &h_details);
{
enum TALER_ErrorCode ec;
if (TALER_EC_NONE !=
- (ec = TEH_keys_exchange_sign (&wdp,
- &pub,
- &sig)))
+ (ec = TALER_exchange_online_wire_deposit_sign (
+ &TEH_keys_exchange_sign_,
+ total,
+ wire_fee,
+ merchant_pub,
+ payto_uri,
+ &h_details,
+ &pub,
+ &sig)))
{
json_decref (deposits);
return TALER_MHD_reply_with_ec (connection,
@@ -163,6 +156,8 @@ reply_transfer_details (struct MHD_Connection *connection,
}
}
+ TALER_payto_hash (payto_uri,
+ &h_payto);
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,
@@ -173,7 +168,7 @@ reply_transfer_details (struct MHD_Connection *connection,
GNUNET_JSON_pack_data_auto ("merchant_pub",
merchant_pub),
GNUNET_JSON_pack_data_auto ("h_payto",
- &wdp.h_payto),
+ &h_payto),
GNUNET_JSON_pack_timestamp ("execution_time",
exec_time),
GNUNET_JSON_pack_array_steal ("deposits",