diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 27 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 23 | ||||
-rw-r--r-- | src/include/taler_signatures.h | 5 |
3 files changed, 52 insertions, 3 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index bafcca08..6b554dfb 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -3811,6 +3811,33 @@ TALER_exchange_online_reserve_closed_verify ( const struct TALER_ExchangeSignatureP *sig); +enum TALER_ErrorCode +TALER_exchange_online_purse_created_sign ( + TALER_ExchangeSignCallback scb, + struct GNUNET_TIME_Timestamp exchange_time, + struct GNUNET_TIME_Timestamp purse_expiration, + const struct TALER_Amount *amount_without_fee, + const struct TALER_Amount *total_deposited, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_PurseMergePublicKeyP *merge_pub, + const struct TALER_PrivateContractHashP *h_contract_terms, + struct TALER_ExchangePublicKeyP *pub, + struct TALER_ExchangeSignatureP *sig); + + +enum GNUNET_GenericReturnValue +TALER_exchange_online_purse_created_verify ( + struct GNUNET_TIME_Timestamp exchange_time, + struct GNUNET_TIME_Timestamp purse_expiration, + const struct TALER_Amount *amount_without_fee, + const struct TALER_Amount *total_deposited, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_PurseMergePublicKeyP *merge_pub, + const struct TALER_PrivateContractHashP *h_contract_terms, + const struct TALER_ExchangePublicKeyP *pub, + const struct TALER_ExchangeSignatureP *sig); + + /* ********************* offline signing ************************** */ diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 6b86dc3c..488ffd51 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -4389,6 +4389,10 @@ struct TALER_EXCHANGEDB_Plugin * @param pub_ckey ephemeral key for DH used to encrypt the contract * @param econtract_size number of bytes in @a econtract * @param econtract the encrypted contract + * @param[out] in_conflict set to true if @a econtract + * conflicts with an existing contract; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -4396,7 +4400,8 @@ struct TALER_EXCHANGEDB_Plugin const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_ContractDiffiePublicP *pub_ckey, size_t econtract_size, - const void *econtract); + const void *econtract, + bool *in_conflict); /** @@ -4428,6 +4433,10 @@ struct TALER_EXCHANGEDB_Plugin * @param age_limit age limit to enforce for payments into the purse * @param amount target amount (with fees) to be put into the purse * @param purse_sig signature with @a purse_pub's private key affirming the above + * @param[out] in_conflict set to true if the meta data + * conflicts with an existing purse; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -4439,7 +4448,8 @@ struct TALER_EXCHANGEDB_Plugin const struct TALER_PrivateContractHashP *h_contract_terms, uint32_t age_limit, const struct TALER_Amount *amount, - const struct TALER_PurseContractSignatureP *purse_sig); + const struct TALER_PurseContractSignatureP *purse_sig, + bool *in_conflict); /** @@ -4507,6 +4517,11 @@ struct TALER_EXCHANGEDB_Plugin * @param coin_pub coin to deposit (debit) * @param amount fraction of the coin's value to deposit * @param coin_sig signature affirming the operation + * @param amount_minus_fee amount to add to the purse + * @param[out] balance_ok set to false if the coin's + * remaining balance is below @a amount; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -4515,7 +4530,9 @@ struct TALER_EXCHANGEDB_Plugin const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_Amount *amount, - const struct TALER_CoinSpendSignatureP *coin_sig); + const struct TALER_CoinSpendSignatureP *coin_sig, + const struct TALER_Amount *amount_minus_fee, + bool *balance_ok); /** diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 52c294ce..70c917b6 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -176,6 +176,11 @@ */ #define TALER_SIGNATURE_EXCHANGE_ACCOUNT_SETUP_SUCCESS 1044 +/** + * Signature by which the exchange affirms that a purse + * was created with a certain amount deposited into it. + */ +#define TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_CREATION 1045 /**********************/ /* Auditor signatures */ |