From ca66a1d1af2412e3ad04c18150db7a259dc69b5e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 10 Jan 2021 00:54:12 +0100 Subject: fix major bug with SQL statement missing ORDER BY freshcoin_index resulting in possible link failures (but usually lucky with old DB schema) --- src/include/taler_crypto_lib.h | 41 +++++++++++++++++++++++++++++++++++ src/include/taler_exchangedb_plugin.h | 1 + 2 files changed, 42 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 70e49697c..4ea845b49 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -1050,6 +1050,47 @@ TALER_CRYPTO_helper_esign_disconnect ( struct TALER_CRYPTO_ExchangeSignHelper *esh); +/* ********************* wallet signing ************************** */ + +/** + * Sign link data. + * + * @param h_denom_pub hash of the denomiantion public key of the new coin + * @param transfer_pub transfer public key + * @param coin_ev coin envelope + * @param coin_ev_size number of bytes in @a coin_ev + * @param old_coin_priv private key to sign with + * @param[out] coin_sig resulting signature + */ +void +TALER_wallet_link_sign (const struct GNUNET_HashCode *h_denom_pub, + const struct TALER_TransferPublicKeyP *transfer_pub, + const void *coin_ev, + size_t coin_ev_size, + const struct TALER_CoinSpendPrivateKeyP *old_coin_priv, + struct TALER_CoinSpendSignatureP *coin_sig); + + +/** + * Verify link signature. + * + * @param h_denom_pub hash of the denomiantion public key of the new coin + * @param transfer_pub transfer public key + * @param coin_ev coin envelope + * @param coin_ev_size number of bytes in @a coin_ev + * @param old_coin_priv private key to sign with + * @param coin_sig resulting signature + * @return #GNUNET_OK if the signature is valid + */ +enum GNUNET_GenericReturnValue +TALER_wallet_link_verify ( + const struct GNUNET_HashCode *h_denom_pub, + const struct TALER_TransferPublicKeyP *transfer_pub, + const void *coin_ev, + size_t coin_ev_size, + const struct TALER_CoinSpendPublicKeyP *old_coin_pub, + const struct TALER_CoinSpendSignatureP *coin_sig); + /* ********************* offline signing ************************** */ diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 83d283401..da320d39c 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1274,6 +1274,7 @@ struct TALER_EXCHANGEDB_LinkList * link data, of type #TALER_SIGNATURE_WALLET_COIN_LINK */ struct TALER_CoinSpendSignatureP orig_coin_link_sig; + }; -- cgit v1.2.3