summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-10-25 18:37:06 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-27 09:23:13 +0200
commit74234f75a41222f6a630106be75a799f4f02ec1d (patch)
tree0462b4a2c46d157cdeb07236c0b94962c9e185d9 /src/exchange
parentf0951d34ddd525a04bcb9daabbc55bd1ced2575e (diff)
downloadexchange-74234f75a41222f6a630106be75a799f4f02ec1d.tar.gz
exchange-74234f75a41222f6a630106be75a799f4f02ec1d.tar.bz2
exchange-74234f75a41222f6a630106be75a799f4f02ec1d.zip
-work on FTBFS
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c9
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c21
-rw-r--r--src/exchange/taler-exchange-httpd_keys.h15
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c2
-rw-r--r--src/exchange/taler-exchange-httpd_link.c8
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c2
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c31
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c4
-rw-r--r--src/exchange/taler-exchange-httpd_responses.h4
-rw-r--r--src/exchange/taler-exchange-httpd_transfers_get.c10
10 files changed, 55 insertions, 51 deletions
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index 38dfd4473..bff0e6a28 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -57,8 +57,8 @@
static MHD_RESULT
reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_contract_terms,
+ const struct TALER_MerchantWireHash *h_wire,
+ const struct TALER_PrivateContractHash *h_contract_terms,
struct GNUNET_TIME_Absolute exchange_timestamp,
struct GNUNET_TIME_Absolute refund_deadline,
const struct TALER_MerchantPublicKeyP *merchant,
@@ -321,9 +321,10 @@ TEH_handler_deposit (struct MHD_Connection *connection,
json_t *wire;
struct DepositContext dc;
struct TALER_EXCHANGEDB_Deposit deposit;
- struct GNUNET_HashCode my_h_wire;
+ struct TALER_MerchantWireHash my_h_wire;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("wire", &wire),
+ GNUNET_JSON_spec_json ("wire",
+ &wire),
TALER_JSON_spec_amount ("contribution",
TEH_currency,
&deposit.amount_with_fee),
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index 705900206..4f3b26cc0 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -73,7 +73,7 @@ struct HelperDenomination
/**
* Hash of the denomination key.
*/
- struct GNUNET_HashCode h_denom_pub;
+ struct TALER_DenominationHash h_denom_pub;
/**
* Signature over this key from the security module's key.
@@ -635,7 +635,7 @@ helper_denom_cb (
const char *section_name,
struct GNUNET_TIME_Absolute start_time,
struct GNUNET_TIME_Relative validity_duration,
- const struct GNUNET_HashCode *h_denom_pub,
+ const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_DenominationPublicKey *denom_pub,
const struct TALER_SecurityModulePublicKeyP *sm_pub,
const struct TALER_SecurityModuleSignatureP *sm_sig)
@@ -965,7 +965,7 @@ static void
denomination_info_cb (
void *cls,
const struct TALER_DenominationPublicKey *denom_pub,
- const struct GNUNET_HashCode *h_denom_pub,
+ const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta,
const struct TALER_MasterSignatureP *master_sig,
bool recoup_possible)
@@ -1139,7 +1139,7 @@ static void
auditor_denom_cb (
void *cls,
const struct TALER_AuditorPublicKeyP *auditor_pub,
- const struct GNUNET_HashCode *h_denom_pub,
+ const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_AuditorSignatureP *auditor_sig)
{
struct TEH_KeyStateHandle *ksh = cls;
@@ -1397,7 +1397,7 @@ setup_general_response_headers (const struct TEH_KeyStateHandle *ksh,
*/
static enum GNUNET_GenericReturnValue
create_krd (struct TEH_KeyStateHandle *ksh,
- const struct GNUNET_HashCode *denom_keys_hash,
+ const struct TALER_DenominationHash *denom_keys_hash,
struct GNUNET_TIME_Absolute last_cpd,
json_t *signkeys,
json_t *recoup,
@@ -1875,7 +1875,7 @@ TEH_keys_get_state (void)
struct TEH_DenominationKey *
-TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_denomination_by_hash (const struct TALER_DenominationHash *h_denom_pub,
struct MHD_Connection *conn,
MHD_RESULT *mret)
{
@@ -1899,7 +1899,8 @@ TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
struct TEH_DenominationKey *
TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
- const struct GNUNET_HashCode *h_denom_pub,
+ const struct
+ TALER_DenominationHash *h_denom_pub,
struct MHD_Connection *conn,
MHD_RESULT *mret)
{
@@ -1918,7 +1919,7 @@ TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
struct TALER_DenominationSignature
-TEH_keys_denomination_sign (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_denomination_sign (const struct TALER_DenominationHash *h_denom_pub,
const void *msg,
size_t msg_size,
enum TALER_ErrorCode *ec)
@@ -1941,7 +1942,7 @@ TEH_keys_denomination_sign (const struct GNUNET_HashCode *h_denom_pub,
void
-TEH_keys_denomination_revoke (const struct GNUNET_HashCode *h_denom_pub)
+TEH_keys_denomination_revoke (const struct TALER_DenominationHash *h_denom_pub)
{
struct TEH_KeyStateHandle *ksh;
@@ -2284,7 +2285,7 @@ load_fees (const char *section_name,
enum GNUNET_GenericReturnValue
-TEH_keys_load_fees (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_load_fees (const struct TALER_DenominationHash *h_denom_pub,
struct TALER_DenominationPublicKey *denom_pub,
struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta)
{
diff --git a/src/exchange/taler-exchange-httpd_keys.h b/src/exchange/taler-exchange-httpd_keys.h
index ce5e2b73d..db967a31b 100644
--- a/src/exchange/taler-exchange-httpd_keys.h
+++ b/src/exchange/taler-exchange-httpd_keys.h
@@ -50,7 +50,7 @@ struct TEH_DenominationKey
/**
* Hash code of the denomination public key.
*/
- struct GNUNET_HashCode h_denom_pub;
+ struct TALER_DenominationHash h_denom_pub;
/**
* Meta data about the type of the denomination, such as fees and validity
@@ -135,7 +135,7 @@ TEH_keys_update_states (void);
* or NULL if @a h_denom_pub could not be found
*/
struct TEH_DenominationKey *
-TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_denomination_by_hash (const struct TALER_DenominationHash *h_denom_pub,
struct MHD_Connection *conn,
MHD_RESULT *mret);
@@ -155,7 +155,8 @@ TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
*/
struct TEH_DenominationKey *
TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
- const struct GNUNET_HashCode *h_denom_pub,
+ const struct
+ TALER_DenominationHash *h_denom_pub,
struct MHD_Connection *conn,
MHD_RESULT *mret);
@@ -171,7 +172,7 @@ TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
* see @a ec for details about the failure
*/
struct TALER_DenominationSignature
-TEH_keys_denomination_sign (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_denomination_sign (const struct TALER_DenominationHash *h_denom_pub,
const void *msg,
size_t msg_size,
enum TALER_ErrorCode *ec);
@@ -189,7 +190,7 @@ TEH_keys_denomination_sign (const struct GNUNET_HashCode *h_denom_pub,
* @param h_denom_pub hash of the public key to revoke
*/
void
-TEH_keys_denomination_revoke (const struct GNUNET_HashCode *h_denom_pub);
+TEH_keys_denomination_revoke (const struct TALER_DenominationHash *h_denom_pub);
/**
@@ -366,7 +367,7 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh,
* #GNUNET_SYSERR on hard errors
*/
enum GNUNET_GenericReturnValue
-TEH_keys_load_fees (const struct GNUNET_HashCode *h_denom_pub,
+TEH_keys_load_fees (const struct TALER_DenominationHash *h_denom_pub,
struct TALER_DenominationPublicKey *denom_pub,
struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta);
@@ -378,7 +379,7 @@ TEH_keys_load_fees (const struct GNUNET_HashCode *h_denom_pub,
* @param[out] meta set to meta data about the key
* @return #GNUNET_OK on success
*/
-int
+enum GNUNET_GenericReturnValue
TEH_keys_get_timing (const struct TALER_ExchangePublicKeyP *exchange_pub,
struct TALER_EXCHANGEDB_SignkeyMetaData *meta);
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
index ae1ab34f2..38890e98c 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -51,7 +51,7 @@ struct KycCheckContext
* Hash of the payto:// URI we are confirming to
* have finished the KYC for.
*/
- struct GNUNET_HashCode h_payto;
+ struct TALER_PaytoHash h_payto;
};
diff --git a/src/exchange/taler-exchange-httpd_link.c b/src/exchange/taler-exchange-httpd_link.c
index 75d32e562..cdad01ab9 100644
--- a/src/exchange/taler-exchange-httpd_link.c
+++ b/src/exchange/taler-exchange-httpd_link.c
@@ -82,10 +82,10 @@ handle_link_data (void *cls,
json_t *obj;
obj = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_rsa_public_key ("denom_pub",
- pos->denom_pub.rsa_public_key),
- GNUNET_JSON_pack_rsa_signature ("ev_sig",
- pos->ev_sig.rsa_signature),
+ TALER_JSON_pack_denomination_public_key ("denom_pub",
+ &pos->denom_pub),
+ TALER_JSON_pack_denomination_signature ("ev_sig",
+ &pos->ev_sig),
GNUNET_JSON_pack_data_auto ("link_sig",
&pos->orig_coin_link_sig));
if ( (NULL == obj) ||
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c
index af0a0a636..626f52a61 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -494,7 +494,7 @@ check_for_denomination_key (struct MHD_Connection *connection,
if (GNUNET_TIME_absolute_is_past (dk->meta.expire_deposit))
{
/* We are past deposit expiration time, but maybe this is a zombie? */
- struct GNUNET_HashCode denom_hash;
+ struct TALER_DenominationHash denom_hash;
enum GNUNET_DB_QueryStatus qs;
/* Check that the coin is dirty (we have seen it before), as we will
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c
index 137034a42..3ea394e7c 100644
--- a/src/exchange/taler-exchange-httpd_recoup.c
+++ b/src/exchange/taler-exchange-httpd_recoup.c
@@ -41,7 +41,7 @@ struct RecoupContext
/**
* Hash of the blinded coin.
*/
- struct GNUNET_HashCode h_blind;
+ struct TALER_BlindedCoinHash h_blind;
/**
* Full value of the coin.
@@ -179,7 +179,7 @@ recoup_transaction (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Recoup requested for unknown envelope %s\n",
- GNUNET_h2s (&pc->h_blind));
+ GNUNET_h2s (&pc->h_blind.hash));
*mhd_ret = TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND,
@@ -342,16 +342,16 @@ recoup_transaction (void *cls,
* @return MHD result code
*/
static MHD_RESULT
-verify_and_execute_recoup (struct MHD_Connection *connection,
- const struct TALER_CoinPublicInfo *coin,
- const struct
- TALER_DenominationBlindingKeyP *coin_bks,
- const struct TALER_CoinSpendSignatureP *coin_sig,
- int refreshed)
+verify_and_execute_recoup (
+ struct MHD_Connection *connection,
+ const struct TALER_CoinPublicInfo *coin,
+ const struct TALER_DenominationBlindingKeyP *coin_bks,
+ const struct TALER_CoinSpendSignatureP *coin_sig,
+ int refreshed)
{
struct RecoupContext pc;
const struct TEH_DenominationKey *dk;
- struct GNUNET_HashCode c_hash;
+ struct TALER_CoinPubHash c_hash;
void *coin_ev;
size_t coin_ev_size;
MHD_RESULT mret;
@@ -423,7 +423,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
{
struct TALER_RecoupRequestPS pr = {
.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_RECOUP),
- .purpose.size = htonl (sizeof (struct TALER_RecoupRequestPS)),
+ .purpose.size = htonl (sizeof (pr)),
.coin_pub = coin->coin_pub,
.h_denom_pub = coin->denom_pub_hash,
.coin_blind = *coin_bks
@@ -442,13 +442,14 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
NULL);
}
}
- GNUNET_CRYPTO_hash (&coin->coin_pub.eddsa_pub,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
- &c_hash);
+ TALER_coin_pub_hash (&coin->coin_pub,
+ &c_hash);
+ GNUNET_assert (dk->denom_pub.cipher ==
+ TALER_DENOMINATION_RSA);
if (GNUNET_YES !=
TALER_rsa_blind (&c_hash,
&coin_bks->bks,
- dk->denom_pub.rsa_public_key,
+ dk->denom_pub.details.rsa_public_key,
&coin_ev,
&coin_ev_size))
{
@@ -458,7 +459,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
TALER_EC_EXCHANGE_RECOUP_BLINDING_FAILED,
NULL);
}
- GNUNET_CRYPTO_hash (coin_ev,
+ TALER_coin_ev_hash (coin_ev,
coin_ev_size,
&pc.h_blind);
GNUNET_free (coin_ev);
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 66da12166..8fc217315 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -419,7 +419,7 @@ TEH_RESPONSE_compile_transaction_history (
MHD_RESULT
TEH_RESPONSE_reply_unknown_denom_pub_hash (
struct MHD_Connection *connection,
- const struct GNUNET_HashCode *dph)
+ const struct TALER_DenominationHash *dph)
{
struct TALER_ExchangePublicKeyP epub;
struct TALER_ExchangeSignatureP esig;
@@ -466,7 +466,7 @@ TEH_RESPONSE_reply_unknown_denom_pub_hash (
MHD_RESULT
TEH_RESPONSE_reply_expired_denom_pub_hash (
struct MHD_Connection *connection,
- const struct GNUNET_HashCode *dph,
+ const struct TALER_DenominationHash *dph,
struct GNUNET_TIME_Absolute now,
enum TALER_ErrorCode ec,
const char *oper)
diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h
index b46e85cec..09d566af8 100644
--- a/src/exchange/taler-exchange-httpd_responses.h
+++ b/src/exchange/taler-exchange-httpd_responses.h
@@ -59,7 +59,7 @@ TEH_RESPONSE_compile_reserve_history (
MHD_RESULT
TEH_RESPONSE_reply_unknown_denom_pub_hash (
struct MHD_Connection *connection,
- const struct GNUNET_HashCode *dph);
+ const struct TALER_DenominationHash *dph);
/**
@@ -76,7 +76,7 @@ TEH_RESPONSE_reply_unknown_denom_pub_hash (
MHD_RESULT
TEH_RESPONSE_reply_expired_denom_pub_hash (
struct MHD_Connection *connection,
- const struct GNUNET_HashCode *dph,
+ const struct TALER_DenominationHash *dph,
struct GNUNET_TIME_Absolute now,
enum TALER_ErrorCode ec,
const char *oper);
diff --git a/src/exchange/taler-exchange-httpd_transfers_get.c b/src/exchange/taler-exchange-httpd_transfers_get.c
index abf0fdbc8..8d41cfdf8 100644
--- a/src/exchange/taler-exchange-httpd_transfers_get.c
+++ b/src/exchange/taler-exchange-httpd_transfers_get.c
@@ -51,7 +51,7 @@ struct AggregatedDepositDetail
/**
* Hash of the contract terms.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* Coin's public key of the deposited coin.
@@ -87,7 +87,7 @@ static MHD_RESULT
reply_transfer_details (struct MHD_Connection *connection,
const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct GNUNET_HashCode *h_wire,
+ const struct TALER_MerchantWireHash *h_wire,
const struct TALER_Amount *wire_fee,
struct GNUNET_TIME_Absolute exec_time,
const struct AggregatedDepositDetail *wdd_head)
@@ -214,7 +214,7 @@ struct WtidTransactionContext
* Hash of the wire details of the merchant (identical for all
* deposits), only valid if @e is_valid is #GNUNET_YES.
*/
- struct GNUNET_HashCode h_wire;
+ struct TALER_MerchantWireHash h_wire;
/**
* Wire fee applicable at @e exec_time.
@@ -278,10 +278,10 @@ static void
handle_deposit_data (void *cls,
uint64_t rowid,
const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct GNUNET_HashCode *h_wire,
+ const struct TALER_MerchantWireHash *h_wire,
const json_t *wire,
struct GNUNET_TIME_Absolute exec_time,
- const struct GNUNET_HashCode *h_contract_terms,
+ const struct TALER_PrivateContractHash *h_contract_terms,
const struct TALER_DenominationPublicKey *denom_pub,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *deposit_value,