From 74234f75a41222f6a630106be75a799f4f02ec1d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 25 Oct 2021 18:37:06 +0200 Subject: -work on FTBFS --- src/auditordb/plugin_auditordb_postgres.c | 11 ++++---- src/exchange/taler-exchange-httpd_deposit.c | 9 ++++--- src/exchange/taler-exchange-httpd_keys.c | 21 +++++++-------- src/exchange/taler-exchange-httpd_keys.h | 15 ++++++----- src/exchange/taler-exchange-httpd_kyc-check.c | 2 +- src/exchange/taler-exchange-httpd_link.c | 8 +++--- src/exchange/taler-exchange-httpd_melt.c | 2 +- src/exchange/taler-exchange-httpd_recoup.c | 31 ++++++++++++----------- src/exchange/taler-exchange-httpd_responses.c | 4 +-- src/exchange/taler-exchange-httpd_responses.h | 4 +-- src/exchange/taler-exchange-httpd_transfers_get.c | 10 ++++---- src/include/taler_crypto_lib.h | 23 ++++++++--------- src/include/taler_util.h | 11 -------- src/util/crypto_wire.c | 30 +++------------------- src/util/payto.c | 15 +++++++++++ 15 files changed, 91 insertions(+), 105 deletions(-) (limited to 'src') diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c index be221a8b7..577f1803a 100644 --- a/src/auditordb/plugin_auditordb_postgres.c +++ b/src/auditordb/plugin_auditordb_postgres.c @@ -2153,7 +2153,7 @@ postgres_get_wire_fee_summary (void *cls, static enum GNUNET_DB_QueryStatus postgres_insert_denomination_balance ( 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_loss, const struct TALER_Amount *denom_risk, @@ -2193,7 +2193,7 @@ postgres_insert_denomination_balance ( static enum GNUNET_DB_QueryStatus postgres_update_denomination_balance ( 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_loss, const struct TALER_Amount *denom_risk, @@ -2231,7 +2231,8 @@ postgres_update_denomination_balance ( */ static enum GNUNET_DB_QueryStatus 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_loss, struct TALER_Amount *denom_risk, @@ -2428,7 +2429,7 @@ static enum GNUNET_DB_QueryStatus postgres_insert_historic_denom_revenue ( void *cls, 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, const struct TALER_Amount *revenue_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++) { - struct GNUNET_HashCode denom_pub_hash; + struct TALER_DenominationHash denom_pub_hash; struct GNUNET_TIME_Absolute revenue_timestamp; struct TALER_Amount revenue_balance; struct TALER_Amount loss; 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, diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 266ab7289..f3f48c040 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -753,6 +753,17 @@ TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub, 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 /** @@ -1891,18 +1902,6 @@ TALER_exchange_offline_wire_del_verify ( 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. * diff --git a/src/include/taler_util.h b/src/include/taler_util.h index d62882b4c..4faa75c4f 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -327,17 +327,6 @@ char * 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. * diff --git a/src/util/crypto_wire.c b/src/util/crypto_wire.c index 1975b518a..616ae410e 100644 --- a/src/util/crypto_wire.c +++ b/src/util/crypto_wire.c @@ -23,28 +23,6 @@ #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. * @@ -64,8 +42,8 @@ TALER_exchange_wire_signature_check ( .purpose.size = htonl (sizeof (wd)) }; - TALER_exchange_wire_signature_hash (payto_uri, - &wd.h_wire_details); + TALER_payto_hash (payto_uri, + &wd.h_wire_details); return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS, &wd, &master_sig->eddsa_signature, @@ -91,8 +69,8 @@ TALER_exchange_wire_signature_make ( .purpose.size = htonl (sizeof (wd)) }; - TALER_exchange_wire_signature_hash (payto_uri, - &wd.h_wire_details); + TALER_payto_hash (payto_uri, + &wd.h_wire_details); GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv, &wd, &master_sig->eddsa_signature); diff --git a/src/util/payto.c b/src/util/payto.c index 26872f1ee..bc8370c40 100644 --- a/src/util/payto.c +++ b/src/util/payto.c @@ -260,7 +260,22 @@ void TALER_payto_hash (const char *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, strlen (payto) + 1, &h_payto->hash); +#endif } -- cgit v1.2.3