From f9347d23953f771689d339b544370d3f9fdd97ba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Jan 2015 21:09:47 +0100 Subject: [PATCH] document TODOs --- src/mint/taler-mint-httpd_db.c | 8 +++++++- src/mint/taler-mint-httpd_db.h | 14 ++++++++++---- src/mint/taler-mint-httpd_deposit.c | 5 +++++ src/mint/taler-mint-httpd_responses.c | 4 ++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index 45e6eeef2..7a78f93ea 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c @@ -13,11 +13,16 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, If not, see */ - /** * @file taler-mint-httpd_db.c * @brief Database access abstraction for the mint. * @author Christian Grothoff + * + * TODO: + * - actually abstract DB implementation (i.e. via plugin logic) + * - /deposit: properly check existing deposits + * - /deposit: properly perform commit (check return value) + * - /deposit: check for leaks */ #include "platform.h" #include "taler-mint-httpd_db.h" @@ -61,6 +66,7 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, if (GNUNET_YES == res) { // FIXME: memory leak + // FIXME: memcmp will not actually work here if (0 == memcmp (existing_deposit, deposit, sizeof (struct Deposit))) return TALER_MINT_reply_deposit_success (connection, deposit); // FIXME: in the future, check if there's enough credits diff --git a/src/mint/taler-mint-httpd_db.h b/src/mint/taler-mint-httpd_db.h index 959b5582b..1829f3d37 100644 --- a/src/mint/taler-mint-httpd_db.h +++ b/src/mint/taler-mint-httpd_db.h @@ -13,11 +13,13 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, If not, see */ - /** * @file mint/taler-mint_httpd_db.h * @brief Mint-specific database access * @author Chrisitan Grothoff + * + * TODO: + * - revisit and document `struct Deposit` members. */ #ifndef TALER_MINT_HTTPD_DB_H #define TALER_MINT_HTTPD_DB_H @@ -28,7 +30,6 @@ #include "taler_util.h" #include "taler_rsa.h" -GNUNET_NETWORK_STRUCT_BEGIN /** * Specification for a /deposit operation. @@ -37,7 +38,9 @@ struct Deposit { /* FIXME: should be TALER_CoinPublicInfo */ struct GNUNET_CRYPTO_EddsaPublicKey coin_pub; + struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; + struct TALER_RSA_Signature coin_sig; struct TALER_RSA_Signature ubsig; @@ -47,10 +50,15 @@ struct Deposit * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT. */ struct TALER_RSA_SignaturePurpose purpose; + uint64_t transaction_id; + struct TALER_AmountNBO amount; + struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub; + struct GNUNET_HashCode h_contract; + struct GNUNET_HashCode h_wire; /* TODO: uint16_t wire_size */ @@ -58,8 +66,6 @@ struct Deposit }; -GNUNET_NETWORK_STRUCT_END - /** * Execute a deposit. The validity of the coin and signature diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c index 84dfd6d93..c4f4718e3 100644 --- a/src/mint/taler-mint-httpd_deposit.c +++ b/src/mint/taler-mint-httpd_deposit.c @@ -21,6 +21,11 @@ * @author Florian Dold * @author Benedikt Mueller * @author Christian Grothoff + * + * TODO: + * - actually verify coin signature + * - revisit `struct Deposit` parsing once the struct + * has been finalized */ #include "platform.h" #include diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index d581e2623..6ae219b63 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -22,6 +22,10 @@ * @author Florian Dold * @author Benedikt Mueller * @author Christian Grothoff + * + * TODO: + * - when generating /deposit reply, do include signature of mint + * to say that we accepted it (check reply format) */ #include "platform.h" #include "taler-mint-httpd_responses.h"