aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"