summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd.h2
-rw-r--r--src/backend/taler-merchant-httpd_auditors.c2
-rw-r--r--src/backend/taler-merchant-httpd_get-orders-ID.c12
-rw-r--r--src/backend/taler-merchant-httpd_get-orders-ID.h2
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-abort.c6
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-paid.c2
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-pay.c23
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-refund.c5
-rw-r--r--src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c13
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c10
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders.c2
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c2
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c2
-rw-r--r--src/backend/taler-merchant-httpd_private-post-transfers.c2
14 files changed, 41 insertions, 44 deletions
diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h
index 3fe35130..1b18cdd4 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -63,7 +63,7 @@ struct TMH_WireMethod
/**
* Hash of our wire format details as given in #j_wire.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* Is this wire method active (should it be included in new contracts)?
diff --git a/src/backend/taler-merchant-httpd_auditors.c b/src/backend/taler-merchant-httpd_auditors.c
index 1a0f6273..e693935e 100644
--- a/src/backend/taler-merchant-httpd_auditors.c
+++ b/src/backend/taler-merchant-httpd_auditors.c
@@ -120,7 +120,7 @@ TMH_AUDITORS_check_dk (struct TALER_EXCHANGE_Handle *mh,
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Denomination key %s offered by client not audited by any accepted auditor\n",
- GNUNET_h2s (&dk->h_key));
+ GNUNET_h2s (&dk->h_key.hash));
*hc = MHD_HTTP_BAD_REQUEST;
*ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_AUDITOR_FAILURE;
return GNUNET_NO;
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c
index dbb5ef10..cc385e4a 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -47,7 +47,7 @@ struct GetOrderData
/**
* Hashed version of contract terms. All zeros if not provided.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* Claim token used for access control. All zeros if not provided.
@@ -363,7 +363,7 @@ TMH_make_order_status_url (struct MHD_Connection *con,
const char *session_id,
const char *instance_id,
struct TALER_ClaimTokenP *claim_token,
- struct GNUNET_HashCode *h_contract)
+ struct TALER_PrivateContractHash *h_contract)
{
const char *host;
const char *forwarded_host;
@@ -832,7 +832,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
if ( (NULL != cts) &&
(GNUNET_OK !=
GNUNET_CRYPTO_hash_from_string (cts,
- &god->h_contract_terms)) )
+ &god->h_contract_terms.hash)) )
{
/* cts has wrong encoding */
GNUNET_break_op (0);
@@ -1049,7 +1049,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
/* Check if client provided the right hash code of the contract terms */
if (NULL != god->contract_terms)
{
- struct GNUNET_HashCode h;
+ struct TALER_PrivateContractHash h;
contract_available = true;
if (GNUNET_OK !=
@@ -1085,7 +1085,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
else
{
struct TALER_ClaimTokenP db_claim_token;
- struct GNUNET_HashCode unused;
+ struct GNUNET_HashCode unused; /* h_post_data */
qs = TMH_db->lookup_order (TMH_db->cls,
hc->instance->settings.id,
@@ -1305,7 +1305,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
{
/* Check if paid. */
- struct GNUNET_HashCode h_contract;
+ struct TALER_PrivateContractHash h_contract;
bool paid;
qs = TMH_db->lookup_order_status (TMH_db->cls,
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.h b/src/backend/taler-merchant-httpd_get-orders-ID.h
index 67dd2a1a..a09d40a3 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.h
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.h
@@ -67,7 +67,7 @@ TMH_make_order_status_url (struct MHD_Connection *con,
const char *session_id,
const char *instance_id,
struct TALER_ClaimTokenP *claim_token,
- struct GNUNET_HashCode *h_contract);
+ struct TALER_PrivateContractHash *h_contract);
/**
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
index ce17063e..e3afaffb 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
@@ -126,7 +126,7 @@ struct AbortContext
/**
* Hashed contract terms (according to client).
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* Context for our operation.
@@ -746,7 +746,7 @@ begin_transaction (struct AbortContext *ac)
/* check payment was indeed incomplete
(now that we are in the transaction scope!) */
{
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
bool paid;
qs = TMH_db->lookup_order_status (TMH_db->cls,
@@ -940,7 +940,7 @@ parse_abort (struct MHD_Connection *connection,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Handling /abort for order `%s' with contract hash `%s'\n",
ac->hc->infix,
- GNUNET_h2s (&ac->h_contract_terms));
+ GNUNET_h2s (&ac->h_contract_terms.hash));
return GNUNET_OK;
}
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
index 52f233eb..7b1a7863 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
@@ -151,7 +151,7 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
}
{
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
if (GNUNET_OK !=
TALER_JSON_contract_hash (contract_terms,
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index fa372fe0..04d174eb 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -76,7 +76,7 @@ struct DepositConfirmation
/**
* Hash of the denomination of this coin.
*/
- struct GNUNET_HashCode h_denom;
+ struct TALER_DenominationHash h_denom;
/**
* Amount this coin contributes to the total purchase price.
@@ -218,13 +218,13 @@ struct PayContext
/**
* Hashed proposal.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* "h_wire" from @e contract_terms. Used to identify
* the instance's wire transfer method.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* Maximum fee the merchant is willing to pay, from @e root.
@@ -511,11 +511,7 @@ pay_context_cleanup (void *cls)
{
struct DepositConfirmation *dc = &pc->dc[i];
- if (NULL != dc->ub_sig.rsa_signature)
- {
- GNUNET_CRYPTO_rsa_signature_free (dc->ub_sig.rsa_signature);
- dc->ub_sig.rsa_signature = NULL;
- }
+ TALER_denom_sig_free (&dc->ub_sig);
GNUNET_free (dc->exchange_url);
}
GNUNET_free (pc->dc);
@@ -590,7 +586,7 @@ deposit_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Storing successful payment %s (%s) at instance `%s'\n",
pc->hc->infix,
- GNUNET_h2s (&pc->h_contract_terms),
+ GNUNET_h2s (&pc->h_contract_terms.hash),
pc->hc->instance->settings.id);
TMH_db->preflight (TMH_db->cls);
{
@@ -846,6 +842,7 @@ process_pay_with_exchange (void *cls,
pc->wire_transfer_deadline,
pc->wm->j_wire,
&pc->h_contract_terms,
+ NULL, /* FIXME-Oec */
&dc->coin_pub,
&dc->ub_sig,
&denom_details->key,
@@ -1471,7 +1468,7 @@ execute_pay_transaction (struct PayContext *pc)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Order `%s' (%s) was fully paid\n",
pc->order_id,
- GNUNET_h2s (&pc->h_contract_terms));
+ GNUNET_h2s (&pc->h_contract_terms.hash));
{
enum GNUNET_DB_QueryStatus qs;
@@ -1645,8 +1642,8 @@ parse_pay (struct MHD_Connection *connection,
&dc->coin_sig),
GNUNET_JSON_spec_fixed_auto ("coin_pub",
&dc->coin_pub),
- TALER_JSON_spec_denomination_signature ("ub_sig",
- &dc->ub_sig),
+ TALER_JSON_spec_denom_sig ("ub_sig",
+ &dc->ub_sig),
GNUNET_JSON_spec_fixed_auto ("h_denom",
&dc->h_denom),
TALER_JSON_spec_amount ("contribution",
@@ -1758,7 +1755,7 @@ parse_pay (struct MHD_Connection *connection,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Handling payment for order `%s' with contract hash `%s'\n",
pc->order_id,
- GNUNET_h2s (&pc->h_contract_terms));
+ GNUNET_h2s (&pc->h_contract_terms.hash));
/* basic sanity check on the contract */
if (NULL == json_object_get (contract_terms,
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
index ff64d9a2..8ba00129 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
@@ -134,7 +134,7 @@ struct PostRefundData
/**
* Hashed version of contract terms. All zeros if not provided.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* DLL of (suspended) requests.
@@ -620,7 +620,8 @@ TMH_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
hc->infix);
}
{
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
+
if (GNUNET_OK !=
TALER_JSON_contract_hash (contract_terms,
&h_contract_terms))
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
index da4064d7..b018b282 100644
--- a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
+++ b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -71,7 +71,7 @@ struct ExchangeKycRequest
/**
* Hash of the wire account (with salt) we are checking.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* Handle for the actual HTTP request to the exchange.
@@ -179,7 +179,7 @@ struct KycContext
* Set to the h_wire of the merchant account if
* @a have_h_wire is true, used to filter by account.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* How long are we willing to wait for the exchange(s)?
@@ -523,12 +523,11 @@ kyc_with_exchange (void *cls,
{
struct ExchangeKycRequest *ekr = cls;
struct KycContext *kc = ekr->kc;
- struct GNUNET_HashCode h_payto;
+ struct TALER_PaytoHash h_payto;
ekr->fo = NULL;
- GNUNET_CRYPTO_hash (ekr->payto_uri,
- strlen (ekr->payto_uri),
- &h_payto);
+ TALER_payto_hash (ekr->payto_uri,
+ &h_payto);
ekr->kyc = TALER_EXCHANGE_kyc_check (eh,
ekr->exchange_kyc_serial,
&h_payto,
@@ -552,7 +551,7 @@ kyc_with_exchange (void *cls,
*/
static void
kyc_status_cb (void *cls,
- const struct GNUNET_HashCode *h_wire,
+ const struct TALER_MerchantWireHash *h_wire,
uint64_t exchange_kyc_serial,
const char *payto_uri,
const char *exchange_url,
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index c2fe759f..ab4e379a 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -83,7 +83,7 @@ struct TransferQuery
/**
* Hash of the merchant's bank account the transfer (presumably) went to.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* Value deposited (including deposit fee).
@@ -200,7 +200,7 @@ struct GetOrderRequestContext
/**
* Hash over the @e contract_terms.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* Total amount the exchange deposited into our bank account
@@ -502,7 +502,7 @@ deposit_get_cb (void *cls,
remember our target UUID */
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute now;
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
now = GNUNET_TIME_absolute_get ();
(void) GNUNET_TIME_round_abs (&now);
@@ -658,7 +658,7 @@ static void
deposit_cb (void *cls,
uint64_t deposit_serial,
const char *exchange_url,
- const struct GNUNET_HashCode *h_wire,
+ const struct TALER_MerchantWireHash *h_wire,
const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *deposit_fee,
const struct TALER_CoinSpendPublicKeyP *coin_pub)
@@ -1420,7 +1420,7 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
}
{
- struct GNUNET_HashCode *h_contract = NULL;
+ struct TALER_PrivateContractHash *h_contract = NULL;
/* In a session-bound payment, allow the browser to check the order
* status page (e.g. to get a refund).
diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c
index ba8b47c9..8c6b12ff 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders.c
@@ -274,7 +274,7 @@ add_order (void *cls,
{
struct TMH_PendingOrder *po = cls;
json_t *contract_terms;
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
enum GNUNET_DB_QueryStatus qs;
const char *summary;
char *order_id = NULL;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
index ebbfdf0a..20645b30 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
@@ -150,7 +150,7 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
enum TALER_MERCHANTDB_RefundStatus rs;
- struct GNUNET_HashCode h_contract;
+ struct TALER_PrivateContractHash h_contract;
{
enum GNUNET_DB_QueryStatus qs;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 2706e511..e148bc0d 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -1046,7 +1046,7 @@ patch_order (struct MHD_Connection *connection,
/* sanity check result */
{
- struct GNUNET_HashCode h_control;
+ struct TALER_PrivateContractHash h_control;
switch (TALER_JSON_contract_hash (order,
&h_control))
diff --git a/src/backend/taler-merchant-httpd_private-post-transfers.c b/src/backend/taler-merchant-httpd_private-post-transfers.c
index 2febf4bc..871aa57a 100644
--- a/src/backend/taler-merchant-httpd_private-post-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-post-transfers.c
@@ -298,7 +298,7 @@ check_transfer (void *cls,
const struct TALER_Amount *deposit_fee,
const struct TALER_Amount *refund_fee,
const struct TALER_Amount *wire_fee,
- const struct GNUNET_HashCode *h_wire,
+ const struct TALER_MerchantWireHash *h_wire,
struct GNUNET_TIME_Absolute deposit_timestamp,
struct GNUNET_TIME_Absolute refund_deadline,
const struct TALER_ExchangeSignatureP *exchange_sig,