aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-19 21:09:47 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-19 21:09:47 +0100
commitf9347d23953f771689d339b544370d3f9fdd97ba (patch)
treeb0c0f3ee392b81dac99659ab7b7b2f0464b8a66a /src
parenta1f20a92a0578e63b2b5d764ac802dbe45ab08e0 (diff)
document TODOs
Diffstat (limited to 'src')
-rw-r--r--src/mint/taler-mint-httpd_db.c8
-rw-r--r--src/mint/taler-mint-httpd_db.h14
-rw-r--r--src/mint/taler-mint-httpd_deposit.c5
-rw-r--r--src/mint/taler-mint-httpd_responses.c4
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 <http://www.gnu.org/licenses/>
*/
-
/**
* @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 <http://www.gnu.org/licenses/>
*/
-
/**
* @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 <gnunet/gnunet_util_lib.h>
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"