From c782dfe2aadfd06e47ed354c1fb389fecc715433 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 24 Mar 2022 13:06:04 +0100 Subject: first draft of service API for p2p payments --- src/util/wallet_signatures.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/util') diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c index 097b8ed8a..756856d2a 100644 --- a/src/util/wallet_signatures.c +++ b/src/util/wallet_signatures.c @@ -902,11 +902,17 @@ struct TALER_PurseDepositPS */ struct TALER_PurseContractPublicKeyP purse_pub; + /** + * Hash of the base URL of the exchange hosting the + * @e purse_pub. + */ + struct GNUNET_HashCode h_exchange_base_url; }; void TALER_wallet_purse_deposit_sign ( + const char *exchange_base_url, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_Amount *amount, const struct TALER_CoinSpendPrivateKeyP *coin_priv, @@ -918,6 +924,9 @@ TALER_wallet_purse_deposit_sign ( .purse_pub = *purse_pub, }; + GNUNET_CRYPTO_hash (exchange_base_url, + strlen (exchange_base_url) + 1, + &pm.h_exchange_base_url); TALER_amount_hton (&pm.coin_amount, amount); GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv, @@ -928,6 +937,7 @@ TALER_wallet_purse_deposit_sign ( enum GNUNET_GenericReturnValue TALER_wallet_purse_deposit_verify ( + const char *exchange_base_url, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_Amount *amount, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -939,6 +949,9 @@ TALER_wallet_purse_deposit_verify ( .purse_pub = *purse_pub, }; + GNUNET_CRYPTO_hash (exchange_base_url, + strlen (exchange_base_url) + 1, + &pm.h_exchange_base_url); TALER_amount_hton (&pm.coin_amount, amount); return GNUNET_CRYPTO_eddsa_verify ( -- cgit v1.2.3