aboutsummaryrefslogtreecommitdiff
path: root/src/mint/mint_db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mint/mint_db.h')
-rw-r--r--src/mint/mint_db.h56
1 files changed, 47 insertions, 9 deletions
diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h
index 7998a01cf..01ad1a6ed 100644
--- a/src/mint/mint_db.h
+++ b/src/mint/mint_db.h
@@ -27,7 +27,6 @@
27#include <microhttpd.h> 27#include <microhttpd.h>
28#include <gnunet/gnunet_util_lib.h> 28#include <gnunet/gnunet_util_lib.h>
29#include "taler_util.h" 29#include "taler_util.h"
30#include "taler_rsa.h"
31#include "taler-mint-httpd_db.h" 30#include "taler-mint-httpd_db.h"
32#include "mint.h" 31#include "mint.h"
33 32
@@ -35,13 +34,40 @@
35int 34int
36TALER_MINT_DB_prepare (PGconn *db_conn); 35TALER_MINT_DB_prepare (PGconn *db_conn);
37 36
37
38/**
39 * Locate the response for a /withdraw request under the
40 * key of the hash of the blinded message.
41 *
42 * @param db_conn database connection to use
43 * @param h_blind hash of the blinded message
44 * @param collectable corresponding collectable coin (blind signature)
45 * if a coin is found
46 * @return #GNUNET_SYSERR on internal error
47 * #GNUNET_NO if the collectable was not found
48 * #GNUNET_YES on success
49 */
38int 50int
39TALER_MINT_DB_get_collectable_blindcoin (PGconn *db_conn, 51TALER_MINT_DB_get_collectable_blindcoin (PGconn *db_conn,
40 struct TALER_RSA_BlindedSignaturePurpose *blind_ev, 52 const struct GNUNET_HashCode *h_blind,
41 struct CollectableBlindcoin *collectable); 53 struct CollectableBlindcoin *collectable);
42 54
55
56/**
57 * Store collectable bit coin under the corresponding
58 * hash of the blinded message.
59 *
60 * @param db_conn database connection to use
61 * @param h_blind hash of the blinded message
62 * @param collectable corresponding collectable coin (blind signature)
63 * if a coin is found
64 * @return #GNUNET_SYSERR on internal error
65 * #GNUNET_NO if the collectable was not found
66 * #GNUNET_YES on success
67 */
43int 68int
44TALER_MINT_DB_insert_collectable_blindcoin (PGconn *db_conn, 69TALER_MINT_DB_insert_collectable_blindcoin (PGconn *db_conn,
70 const struct GNUNET_HashCode *h_blind,
45 const struct CollectableBlindcoin *collectable); 71 const struct CollectableBlindcoin *collectable);
46 72
47 73
@@ -62,6 +88,15 @@ TALER_MINT_DB_get_reserve (PGconn *db_conn,
62 const struct GNUNET_CRYPTO_EddsaPublicKey *reserve_pub, 88 const struct GNUNET_CRYPTO_EddsaPublicKey *reserve_pub,
63 struct Reserve *reserve_res); 89 struct Reserve *reserve_res);
64 90
91
92/**
93 * Update information about a reserve.
94 *
95 * @param db_conn
96 * @param reserve current reserve status
97 * @param fresh FIXME
98 * @return #GNUNET_OK on success
99 */
65int 100int
66TALER_MINT_DB_update_reserve (PGconn *db_conn, 101TALER_MINT_DB_update_reserve (PGconn *db_conn,
67 const struct Reserve *reserve, 102 const struct Reserve *reserve,
@@ -72,7 +107,7 @@ int
72TALER_MINT_DB_insert_refresh_order (PGconn *db_conn, 107TALER_MINT_DB_insert_refresh_order (PGconn *db_conn,
73 uint16_t newcoin_index, 108 uint16_t newcoin_index,
74 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, 109 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub,
75 const struct TALER_RSA_PublicKeyBinaryEncoded *denom_pub); 110 const struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub);
76 111
77int 112int
78TALER_MINT_DB_get_refresh_session (PGconn *db_conn, 113TALER_MINT_DB_get_refresh_session (PGconn *db_conn,
@@ -123,19 +158,22 @@ int
123TALER_MINT_DB_get_refresh_order (PGconn *db_conn, 158TALER_MINT_DB_get_refresh_order (PGconn *db_conn,
124 uint16_t newcoin_index, 159 uint16_t newcoin_index,
125 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, 160 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub,
126 struct TALER_RSA_PublicKeyBinaryEncoded *denom_pub); 161 struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub);
127 162
128 163
129int 164int
130TALER_MINT_DB_insert_refresh_collectable (PGconn *db_conn, 165TALER_MINT_DB_insert_refresh_collectable (PGconn *db_conn,
131 uint16_t newcoin_index, 166 uint16_t newcoin_index,
132 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, 167 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub,
133 const struct TALER_RSA_Signature *ev_sig); 168 const struct GNUNET_CRYPTO_rsa_Signature *ev_sig);
169
134int 170int
135TALER_MINT_DB_get_refresh_collectable (PGconn *db_conn, 171TALER_MINT_DB_get_refresh_collectable (PGconn *db_conn,
136 uint16_t newcoin_index, 172 uint16_t newcoin_index,
137 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, 173 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub,
138 struct TALER_RSA_Signature *ev_sig); 174 struct GNUNET_CRYPTO_rsa_Signature *ev_sig);
175
176
139int 177int
140TALER_MINT_DB_set_reveal_ok (PGconn *db_conn, 178TALER_MINT_DB_set_reveal_ok (PGconn *db_conn,
141 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub); 179 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub);
@@ -145,7 +183,7 @@ TALER_MINT_DB_insert_refresh_melt (PGconn *db_conn,
145 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, 183 const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub,
146 uint16_t oldcoin_index, 184 uint16_t oldcoin_index,
147 const struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub, 185 const struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub,
148 const struct TALER_RSA_PublicKeyBinaryEncoded *denom_pub); 186 const struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub);
149 187
150 188
151int 189int
@@ -158,8 +196,8 @@ TALER_MINT_DB_get_refresh_melt (PGconn *db_conn,
158typedef 196typedef
159int (*LinkIterator) (void *cls, 197int (*LinkIterator) (void *cls,
160 const struct LinkDataEnc *link_data_enc, 198 const struct LinkDataEnc *link_data_enc,
161 const struct TALER_RSA_PublicKeyBinaryEncoded *denom_pub, 199 const struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub,
162 const struct TALER_RSA_Signature *ev_sig); 200 const struct GNUNET_CRYPTO_rsa_Signature *ev_sig);
163 201
164int 202int
165TALER_db_get_link (PGconn *db_conn, 203TALER_db_get_link (PGconn *db_conn,