diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-15 17:07:13 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-15 17:07:13 +0100 |
commit | ef938e0f7aca4232cbae322fdc7b68ed21fcd679 (patch) | |
tree | 9ea7af8c56ca6a5fd0bc2131bbde8549dc2eef13 /src/include/taler_crypto_lib.h | |
parent | 8ecbdeb55b5f9dfcd39d0ee1eaa2fc3f00aa9c5d (diff) | |
download | exchange-ef938e0f7aca4232cbae322fdc7b68ed21fcd679.tar.xz |
-correctly implement CS idempotency check on withdraw
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r-- | src/include/taler_crypto_lib.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index f007d67af..ab5202baa 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -572,6 +572,22 @@ struct TALER_BlindedCoinHash /** + * Hash used to uniquely represent a withdraw process so as to perform + * idempotency checks (and prevent clients from harmfully replaying withdraw + * operations with problematic variations on the inputs). In the CS case, + * this is a hash over the DK and nonce, while in the RSA case, it is simply a + * hash over the DK and the blinded coin. + */ +struct TALER_WithdrawIdentificationHash +{ + /** + * Actual hash value. + */ + struct GNUNET_HashCode hash; +}; + + +/** * Hash used to represent the hash of the public * key of a coin (without blinding). */ @@ -1309,6 +1325,22 @@ TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet, /** + * Compute the hash to uniquely identify a withdraw + * request. + * + * @param blinded_planchet blinded planchet + * @param denom_hash hash of the denomination publick key + * @param[out] wih where to write the hash + * @return #GNUNET_OK when successful, #GNUNET_SYSERR if an internal error occured + */ +enum GNUNET_GenericReturnValue +TALER_withdraw_request_hash ( + const struct TALER_BlindedPlanchet *blinded_planchet, + const struct TALER_DenominationHash *denom_hash, + struct TALER_WithdrawIdentificationHash *wih); + + +/** * Compute the hash of a coin. * * @param coin_pub public key of the coin |