aboutsummaryrefslogtreecommitdiff
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
parenta1f20a92a0578e63b2b5d764ac802dbe45ab08e0 (diff)
downloadexchange-f9347d23953f771689d339b544370d3f9fdd97ba.tar.gz
exchange-f9347d23953f771689d339b544370d3f9fdd97ba.zip
document TODOs
-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 @@
13 You should have received a copy of the GNU General Public License along with 13 You should have received a copy of the GNU General Public License along with
14 TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> 14 TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
15*/ 15*/
16
17/** 16/**
18 * @file taler-mint-httpd_db.c 17 * @file taler-mint-httpd_db.c
19 * @brief Database access abstraction for the mint. 18 * @brief Database access abstraction for the mint.
20 * @author Christian Grothoff 19 * @author Christian Grothoff
20 *
21 * TODO:
22 * - actually abstract DB implementation (i.e. via plugin logic)
23 * - /deposit: properly check existing deposits
24 * - /deposit: properly perform commit (check return value)
25 * - /deposit: check for leaks
21 */ 26 */
22#include "platform.h" 27#include "platform.h"
23#include "taler-mint-httpd_db.h" 28#include "taler-mint-httpd_db.h"
@@ -61,6 +66,7 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection,
61 if (GNUNET_YES == res) 66 if (GNUNET_YES == res)
62 { 67 {
63 // FIXME: memory leak 68 // FIXME: memory leak
69 // FIXME: memcmp will not actually work here
64 if (0 == memcmp (existing_deposit, deposit, sizeof (struct Deposit))) 70 if (0 == memcmp (existing_deposit, deposit, sizeof (struct Deposit)))
65 return TALER_MINT_reply_deposit_success (connection, deposit); 71 return TALER_MINT_reply_deposit_success (connection, deposit);
66 // FIXME: in the future, check if there's enough credits 72 // 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 @@
13 You should have received a copy of the GNU General Public License along with 13 You should have received a copy of the GNU General Public License along with
14 TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> 14 TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
15*/ 15*/
16
17/** 16/**
18 * @file mint/taler-mint_httpd_db.h 17 * @file mint/taler-mint_httpd_db.h
19 * @brief Mint-specific database access 18 * @brief Mint-specific database access
20 * @author Chrisitan Grothoff 19 * @author Chrisitan Grothoff
20 *
21 * TODO:
22 * - revisit and document `struct Deposit` members.
21 */ 23 */
22#ifndef TALER_MINT_HTTPD_DB_H 24#ifndef TALER_MINT_HTTPD_DB_H
23#define TALER_MINT_HTTPD_DB_H 25#define TALER_MINT_HTTPD_DB_H
@@ -28,7 +30,6 @@
28#include "taler_util.h" 30#include "taler_util.h"
29#include "taler_rsa.h" 31#include "taler_rsa.h"
30 32
31GNUNET_NETWORK_STRUCT_BEGIN
32 33
33/** 34/**
34 * Specification for a /deposit operation. 35 * Specification for a /deposit operation.
@@ -37,7 +38,9 @@ struct Deposit
37{ 38{
38 /* FIXME: should be TALER_CoinPublicInfo */ 39 /* FIXME: should be TALER_CoinPublicInfo */
39 struct GNUNET_CRYPTO_EddsaPublicKey coin_pub; 40 struct GNUNET_CRYPTO_EddsaPublicKey coin_pub;
41
40 struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; 42 struct TALER_RSA_PublicKeyBinaryEncoded denom_pub;
43
41 struct TALER_RSA_Signature coin_sig; 44 struct TALER_RSA_Signature coin_sig;
42 45
43 struct TALER_RSA_Signature ubsig; 46 struct TALER_RSA_Signature ubsig;
@@ -47,10 +50,15 @@ struct Deposit
47 * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT. 50 * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT.
48 */ 51 */
49 struct TALER_RSA_SignaturePurpose purpose; 52 struct TALER_RSA_SignaturePurpose purpose;
53
50 uint64_t transaction_id; 54 uint64_t transaction_id;
55
51 struct TALER_AmountNBO amount; 56 struct TALER_AmountNBO amount;
57
52 struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub; 58 struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub;
59
53 struct GNUNET_HashCode h_contract; 60 struct GNUNET_HashCode h_contract;
61
54 struct GNUNET_HashCode h_wire; 62 struct GNUNET_HashCode h_wire;
55 63
56 /* TODO: uint16_t wire_size */ 64 /* TODO: uint16_t wire_size */
@@ -58,8 +66,6 @@ struct Deposit
58 66
59}; 67};
60 68
61GNUNET_NETWORK_STRUCT_END
62
63 69
64/** 70/**
65 * Execute a deposit. The validity of the coin and signature 71 * 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 @@
21 * @author Florian Dold 21 * @author Florian Dold
22 * @author Benedikt Mueller 22 * @author Benedikt Mueller
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 *
25 * TODO:
26 * - actually verify coin signature
27 * - revisit `struct Deposit` parsing once the struct
28 * has been finalized
24 */ 29 */
25#include "platform.h" 30#include "platform.h"
26#include <gnunet/gnunet_util_lib.h> 31#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 @@
22 * @author Florian Dold 22 * @author Florian Dold
23 * @author Benedikt Mueller 23 * @author Benedikt Mueller
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 *
26 * TODO:
27 * - when generating /deposit reply, do include signature of mint
28 * to say that we accepted it (check reply format)
25 */ 29 */
26#include "platform.h" 30#include "platform.h"
27#include "taler-mint-httpd_responses.h" 31#include "taler-mint-httpd_responses.h"