-work on FTBFS

This commit is contained in:
Christian Grothoff 2021-10-25 18:37:06 +02:00 committed by Christian Grothoff
parent f0951d34dd
commit 74234f75a4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
15 changed files with 91 additions and 105 deletions

View File

@ -2153,7 +2153,7 @@ postgres_get_wire_fee_summary (void *cls,
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_balance ( postgres_insert_denomination_balance (
void *cls, void *cls,
const struct GNUNET_HashCode *denom_pub_hash, const struct TALER_DenominationHash *denom_pub_hash,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk, const struct TALER_Amount *denom_risk,
@ -2193,7 +2193,7 @@ postgres_insert_denomination_balance (
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_denomination_balance ( postgres_update_denomination_balance (
void *cls, void *cls,
const struct GNUNET_HashCode *denom_pub_hash, const struct TALER_DenominationHash *denom_pub_hash,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk, const struct TALER_Amount *denom_risk,
@ -2231,7 +2231,8 @@ postgres_update_denomination_balance (
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_denomination_balance (void *cls, postgres_get_denomination_balance (void *cls,
const struct GNUNET_HashCode *denom_pub_hash, const struct
TALER_DenominationHash *denom_pub_hash,
struct TALER_Amount *denom_balance, struct TALER_Amount *denom_balance,
struct TALER_Amount *denom_loss, struct TALER_Amount *denom_loss,
struct TALER_Amount *denom_risk, struct TALER_Amount *denom_risk,
@ -2428,7 +2429,7 @@ static enum GNUNET_DB_QueryStatus
postgres_insert_historic_denom_revenue ( postgres_insert_historic_denom_revenue (
void *cls, void *cls,
const struct TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
const struct GNUNET_HashCode *denom_pub_hash, const struct TALER_DenominationHash *denom_pub_hash,
struct GNUNET_TIME_Absolute revenue_timestamp, struct GNUNET_TIME_Absolute revenue_timestamp,
const struct TALER_Amount *revenue_balance, const struct TALER_Amount *revenue_balance,
const struct TALER_Amount *loss_balance) const struct TALER_Amount *loss_balance)
@ -2495,7 +2496,7 @@ historic_denom_revenue_cb (void *cls,
for (unsigned int i = 0; i < num_results; i++) for (unsigned int i = 0; i < num_results; i++)
{ {
struct GNUNET_HashCode denom_pub_hash; struct TALER_DenominationHash denom_pub_hash;
struct GNUNET_TIME_Absolute revenue_timestamp; struct GNUNET_TIME_Absolute revenue_timestamp;
struct TALER_Amount revenue_balance; struct TALER_Amount revenue_balance;
struct TALER_Amount loss; struct TALER_Amount loss;

View File

@ -57,8 +57,8 @@
static MHD_RESULT static MHD_RESULT
reply_deposit_success (struct MHD_Connection *connection, reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const struct GNUNET_HashCode *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
struct GNUNET_TIME_Absolute exchange_timestamp, struct GNUNET_TIME_Absolute exchange_timestamp,
struct GNUNET_TIME_Absolute refund_deadline, struct GNUNET_TIME_Absolute refund_deadline,
const struct TALER_MerchantPublicKeyP *merchant, const struct TALER_MerchantPublicKeyP *merchant,
@ -321,9 +321,10 @@ TEH_handler_deposit (struct MHD_Connection *connection,
json_t *wire; json_t *wire;
struct DepositContext dc; struct DepositContext dc;
struct TALER_EXCHANGEDB_Deposit deposit; struct TALER_EXCHANGEDB_Deposit deposit;
struct GNUNET_HashCode my_h_wire; struct TALER_MerchantWireHash my_h_wire;
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_json ("wire", &wire), GNUNET_JSON_spec_json ("wire",
&wire),
TALER_JSON_spec_amount ("contribution", TALER_JSON_spec_amount ("contribution",
TEH_currency, TEH_currency,
&deposit.amount_with_fee), &deposit.amount_with_fee),

View File

@ -73,7 +73,7 @@ struct HelperDenomination
/** /**
* Hash of the denomination key. * 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. * Signature over this key from the security module's key.
@ -635,7 +635,7 @@ helper_denom_cb (
const char *section_name, const char *section_name,
struct GNUNET_TIME_Absolute start_time, struct GNUNET_TIME_Absolute start_time,
struct GNUNET_TIME_Relative validity_duration, 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_DenominationPublicKey *denom_pub,
const struct TALER_SecurityModulePublicKeyP *sm_pub, const struct TALER_SecurityModulePublicKeyP *sm_pub,
const struct TALER_SecurityModuleSignatureP *sm_sig) const struct TALER_SecurityModuleSignatureP *sm_sig)
@ -965,7 +965,7 @@ static void
denomination_info_cb ( denomination_info_cb (
void *cls, void *cls,
const struct TALER_DenominationPublicKey *denom_pub, 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_EXCHANGEDB_DenominationKeyMetaData *meta,
const struct TALER_MasterSignatureP *master_sig, const struct TALER_MasterSignatureP *master_sig,
bool recoup_possible) bool recoup_possible)
@ -1139,7 +1139,7 @@ static void
auditor_denom_cb ( auditor_denom_cb (
void *cls, void *cls,
const struct TALER_AuditorPublicKeyP *auditor_pub, 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) const struct TALER_AuditorSignatureP *auditor_sig)
{ {
struct TEH_KeyStateHandle *ksh = cls; struct TEH_KeyStateHandle *ksh = cls;
@ -1397,7 +1397,7 @@ setup_general_response_headers (const struct TEH_KeyStateHandle *ksh,
*/ */
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue
create_krd (struct TEH_KeyStateHandle *ksh, 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, struct GNUNET_TIME_Absolute last_cpd,
json_t *signkeys, json_t *signkeys,
json_t *recoup, json_t *recoup,
@ -1875,7 +1875,7 @@ TEH_keys_get_state (void)
struct TEH_DenominationKey * 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, struct MHD_Connection *conn,
MHD_RESULT *mret) MHD_RESULT *mret)
{ {
@ -1899,7 +1899,8 @@ TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
struct TEH_DenominationKey * struct TEH_DenominationKey *
TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh, 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, struct MHD_Connection *conn,
MHD_RESULT *mret) MHD_RESULT *mret)
{ {
@ -1918,7 +1919,7 @@ TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
struct TALER_DenominationSignature 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, const void *msg,
size_t msg_size, size_t msg_size,
enum TALER_ErrorCode *ec) enum TALER_ErrorCode *ec)
@ -1941,7 +1942,7 @@ TEH_keys_denomination_sign (const struct GNUNET_HashCode *h_denom_pub,
void 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; struct TEH_KeyStateHandle *ksh;
@ -2284,7 +2285,7 @@ load_fees (const char *section_name,
enum GNUNET_GenericReturnValue 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_DenominationPublicKey *denom_pub,
struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta) struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta)
{ {

View File

@ -50,7 +50,7 @@ struct TEH_DenominationKey
/** /**
* Hash code of the denomination public key. * 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 * 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 * or NULL if @a h_denom_pub could not be found
*/ */
struct TEH_DenominationKey * 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, struct MHD_Connection *conn,
MHD_RESULT *mret); MHD_RESULT *mret);
@ -155,7 +155,8 @@ TEH_keys_denomination_by_hash (const struct GNUNET_HashCode *h_denom_pub,
*/ */
struct TEH_DenominationKey * struct TEH_DenominationKey *
TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh, 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, struct MHD_Connection *conn,
MHD_RESULT *mret); MHD_RESULT *mret);
@ -171,7 +172,7 @@ TEH_keys_denomination_by_hash2 (struct TEH_KeyStateHandle *ksh,
* see @a ec for details about the failure * see @a ec for details about the failure
*/ */
struct TALER_DenominationSignature 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, const void *msg,
size_t msg_size, size_t msg_size,
enum TALER_ErrorCode *ec); 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 * @param h_denom_pub hash of the public key to revoke
*/ */
void 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 * #GNUNET_SYSERR on hard errors
*/ */
enum GNUNET_GenericReturnValue 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_DenominationPublicKey *denom_pub,
struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta); 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 * @param[out] meta set to meta data about the key
* @return #GNUNET_OK on success * @return #GNUNET_OK on success
*/ */
int enum GNUNET_GenericReturnValue
TEH_keys_get_timing (const struct TALER_ExchangePublicKeyP *exchange_pub, TEH_keys_get_timing (const struct TALER_ExchangePublicKeyP *exchange_pub,
struct TALER_EXCHANGEDB_SignkeyMetaData *meta); struct TALER_EXCHANGEDB_SignkeyMetaData *meta);

View File

@ -51,7 +51,7 @@ struct KycCheckContext
* Hash of the payto:// URI we are confirming to * Hash of the payto:// URI we are confirming to
* have finished the KYC for. * have finished the KYC for.
*/ */
struct GNUNET_HashCode h_payto; struct TALER_PaytoHash h_payto;
}; };

View File

@ -82,10 +82,10 @@ handle_link_data (void *cls,
json_t *obj; json_t *obj;
obj = GNUNET_JSON_PACK ( obj = GNUNET_JSON_PACK (
GNUNET_JSON_pack_rsa_public_key ("denom_pub", TALER_JSON_pack_denomination_public_key ("denom_pub",
pos->denom_pub.rsa_public_key), &pos->denom_pub),
GNUNET_JSON_pack_rsa_signature ("ev_sig", TALER_JSON_pack_denomination_signature ("ev_sig",
pos->ev_sig.rsa_signature), &pos->ev_sig),
GNUNET_JSON_pack_data_auto ("link_sig", GNUNET_JSON_pack_data_auto ("link_sig",
&pos->orig_coin_link_sig)); &pos->orig_coin_link_sig));
if ( (NULL == obj) || if ( (NULL == obj) ||

View File

@ -494,7 +494,7 @@ check_for_denomination_key (struct MHD_Connection *connection,
if (GNUNET_TIME_absolute_is_past (dk->meta.expire_deposit)) if (GNUNET_TIME_absolute_is_past (dk->meta.expire_deposit))
{ {
/* We are past deposit expiration time, but maybe this is a zombie? */ /* 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; enum GNUNET_DB_QueryStatus qs;
/* Check that the coin is dirty (we have seen it before), as we will /* Check that the coin is dirty (we have seen it before), as we will

View File

@ -41,7 +41,7 @@ struct RecoupContext
/** /**
* Hash of the blinded coin. * Hash of the blinded coin.
*/ */
struct GNUNET_HashCode h_blind; struct TALER_BlindedCoinHash h_blind;
/** /**
* Full value of the coin. * Full value of the coin.
@ -179,7 +179,7 @@ recoup_transaction (void *cls,
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Recoup requested for unknown envelope %s\n", "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_ret = TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND, MHD_HTTP_NOT_FOUND,
TALER_EC_EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND, TALER_EC_EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND,
@ -342,16 +342,16 @@ recoup_transaction (void *cls,
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT
verify_and_execute_recoup (struct MHD_Connection *connection, verify_and_execute_recoup (
struct MHD_Connection *connection,
const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinPublicInfo *coin,
const struct const struct TALER_DenominationBlindingKeyP *coin_bks,
TALER_DenominationBlindingKeyP *coin_bks,
const struct TALER_CoinSpendSignatureP *coin_sig, const struct TALER_CoinSpendSignatureP *coin_sig,
int refreshed) int refreshed)
{ {
struct RecoupContext pc; struct RecoupContext pc;
const struct TEH_DenominationKey *dk; const struct TEH_DenominationKey *dk;
struct GNUNET_HashCode c_hash; struct TALER_CoinPubHash c_hash;
void *coin_ev; void *coin_ev;
size_t coin_ev_size; size_t coin_ev_size;
MHD_RESULT mret; MHD_RESULT mret;
@ -423,7 +423,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
{ {
struct TALER_RecoupRequestPS pr = { struct TALER_RecoupRequestPS pr = {
.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_RECOUP), .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, .coin_pub = coin->coin_pub,
.h_denom_pub = coin->denom_pub_hash, .h_denom_pub = coin->denom_pub_hash,
.coin_blind = *coin_bks .coin_blind = *coin_bks
@ -442,13 +442,14 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
NULL); NULL);
} }
} }
GNUNET_CRYPTO_hash (&coin->coin_pub.eddsa_pub, TALER_coin_pub_hash (&coin->coin_pub,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
&c_hash); &c_hash);
GNUNET_assert (dk->denom_pub.cipher ==
TALER_DENOMINATION_RSA);
if (GNUNET_YES != if (GNUNET_YES !=
TALER_rsa_blind (&c_hash, TALER_rsa_blind (&c_hash,
&coin_bks->bks, &coin_bks->bks,
dk->denom_pub.rsa_public_key, dk->denom_pub.details.rsa_public_key,
&coin_ev, &coin_ev,
&coin_ev_size)) &coin_ev_size))
{ {
@ -458,7 +459,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
TALER_EC_EXCHANGE_RECOUP_BLINDING_FAILED, TALER_EC_EXCHANGE_RECOUP_BLINDING_FAILED,
NULL); NULL);
} }
GNUNET_CRYPTO_hash (coin_ev, TALER_coin_ev_hash (coin_ev,
coin_ev_size, coin_ev_size,
&pc.h_blind); &pc.h_blind);
GNUNET_free (coin_ev); GNUNET_free (coin_ev);

View File

@ -419,7 +419,7 @@ TEH_RESPONSE_compile_transaction_history (
MHD_RESULT MHD_RESULT
TEH_RESPONSE_reply_unknown_denom_pub_hash ( TEH_RESPONSE_reply_unknown_denom_pub_hash (
struct MHD_Connection *connection, struct MHD_Connection *connection,
const struct GNUNET_HashCode *dph) const struct TALER_DenominationHash *dph)
{ {
struct TALER_ExchangePublicKeyP epub; struct TALER_ExchangePublicKeyP epub;
struct TALER_ExchangeSignatureP esig; struct TALER_ExchangeSignatureP esig;
@ -466,7 +466,7 @@ TEH_RESPONSE_reply_unknown_denom_pub_hash (
MHD_RESULT MHD_RESULT
TEH_RESPONSE_reply_expired_denom_pub_hash ( TEH_RESPONSE_reply_expired_denom_pub_hash (
struct MHD_Connection *connection, struct MHD_Connection *connection,
const struct GNUNET_HashCode *dph, const struct TALER_DenominationHash *dph,
struct GNUNET_TIME_Absolute now, struct GNUNET_TIME_Absolute now,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const char *oper) const char *oper)

View File

@ -59,7 +59,7 @@ TEH_RESPONSE_compile_reserve_history (
MHD_RESULT MHD_RESULT
TEH_RESPONSE_reply_unknown_denom_pub_hash ( TEH_RESPONSE_reply_unknown_denom_pub_hash (
struct MHD_Connection *connection, 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 MHD_RESULT
TEH_RESPONSE_reply_expired_denom_pub_hash ( TEH_RESPONSE_reply_expired_denom_pub_hash (
struct MHD_Connection *connection, struct MHD_Connection *connection,
const struct GNUNET_HashCode *dph, const struct TALER_DenominationHash *dph,
struct GNUNET_TIME_Absolute now, struct GNUNET_TIME_Absolute now,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const char *oper); const char *oper);

View File

@ -51,7 +51,7 @@ struct AggregatedDepositDetail
/** /**
* Hash of the contract terms. * 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. * Coin's public key of the deposited coin.
@ -87,7 +87,7 @@ static MHD_RESULT
reply_transfer_details (struct MHD_Connection *connection, reply_transfer_details (struct MHD_Connection *connection,
const struct TALER_Amount *total, const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const struct TALER_Amount *wire_fee, const struct TALER_Amount *wire_fee,
struct GNUNET_TIME_Absolute exec_time, struct GNUNET_TIME_Absolute exec_time,
const struct AggregatedDepositDetail *wdd_head) const struct AggregatedDepositDetail *wdd_head)
@ -214,7 +214,7 @@ struct WtidTransactionContext
* Hash of the wire details of the merchant (identical for all * Hash of the wire details of the merchant (identical for all
* deposits), only valid if @e is_valid is #GNUNET_YES. * 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. * Wire fee applicable at @e exec_time.
@ -278,10 +278,10 @@ static void
handle_deposit_data (void *cls, handle_deposit_data (void *cls,
uint64_t rowid, uint64_t rowid,
const struct TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const json_t *wire, const json_t *wire,
struct GNUNET_TIME_Absolute exec_time, 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_DenominationPublicKey *denom_pub,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *deposit_value, const struct TALER_Amount *deposit_value,

View File

@ -753,6 +753,17 @@ TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_CoinPubHash *coin_h); struct TALER_CoinPubHash *coin_h);
/**
* Compute the hash of a payto URI.
*
* @param payto URI to hash
* @param[out] h_payto where to write the hash
*/
void
TALER_payto_hash (const char *payto,
struct TALER_PaytoHash *h_payto);
GNUNET_NETWORK_STRUCT_BEGIN GNUNET_NETWORK_STRUCT_BEGIN
/** /**
@ -1891,18 +1902,6 @@ TALER_exchange_offline_wire_del_verify (
const struct TALER_MasterSignatureP *master_sig); const struct TALER_MasterSignatureP *master_sig);
/**
* Compute the hash of the given wire details. The resulting
* hash is what is signed by the master key.
*
* @param payto_uri bank account
* @param[out] hc set to the hash
*/
void
TALER_exchange_wire_signature_hash (const char *payto_uri,
struct TALER_PaytoHash *hc);
/** /**
* Check the signature in @a master_sig. * Check the signature in @a master_sig.
* *

View File

@ -327,17 +327,6 @@ char *
TALER_payto_get_method (const char *payto_uri); TALER_payto_get_method (const char *payto_uri);
/**
* Compute the hash of a payto URI.
*
* @param payto URI to hash
* @param[out] h_payto where to write the hash
*/
void
TALER_payto_hash (const char *payto,
struct TALER_PaytoHash *h_payto);
/** /**
* Obtain the account name from a payto URL. * Obtain the account name from a payto URL.
* *

View File

@ -23,28 +23,6 @@
#include "taler_signatures.h" #include "taler_signatures.h"
/**
* Compute the hash of the given wire details. The resulting
* hash is what is signed by the master key.
*
* @param payto_uri bank account
* @param[out] hc set to the hash
*/
void
TALER_exchange_wire_signature_hash (const char *payto_uri,
struct TALER_PaytoHash *hc)
{
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (hc,
sizeof (*hc),
payto_uri,
strlen (payto_uri) + 1,
"exchange-wire-signature",
strlen ("exchange-wire-signature"),
NULL, 0));
}
/** /**
* Check the signature in @a master_sig. * Check the signature in @a master_sig.
* *
@ -64,7 +42,7 @@ TALER_exchange_wire_signature_check (
.purpose.size = htonl (sizeof (wd)) .purpose.size = htonl (sizeof (wd))
}; };
TALER_exchange_wire_signature_hash (payto_uri, TALER_payto_hash (payto_uri,
&wd.h_wire_details); &wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS, return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
&wd, &wd,
@ -91,7 +69,7 @@ TALER_exchange_wire_signature_make (
.purpose.size = htonl (sizeof (wd)) .purpose.size = htonl (sizeof (wd))
}; };
TALER_exchange_wire_signature_hash (payto_uri, TALER_payto_hash (payto_uri,
&wd.h_wire_details); &wd.h_wire_details);
GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
&wd, &wd,

View File

@ -260,7 +260,22 @@ void
TALER_payto_hash (const char *payto, TALER_payto_hash (const char *payto,
struct TALER_PaytoHash *h_payto) struct TALER_PaytoHash *h_payto)
{ {
/* FIXME: 0.8 had TWO WAYS to hash a payto!
one for the exchange, the other
for merchants (i.e. reserve closing).
I think we should unify... */
#if OLD_EXCHANGE_WAY
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (hc,
sizeof (*hc),
payto_uri,
strlen (payto_uri) + 1,
"exchange-wire-signature",
strlen ("exchange-wire-signature"),
NULL, 0));
#else
GNUNET_CRYPTO_hash (payto, GNUNET_CRYPTO_hash (payto,
strlen (payto) + 1, strlen (payto) + 1,
&h_payto->hash); &h_payto->hash);
#endif
} }