diff options
Diffstat (limited to 'src/mint/mint_db.h')
-rw-r--r-- | src/mint/mint_db.h | 56 |
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 @@ | |||
35 | int | 34 | int |
36 | TALER_MINT_DB_prepare (PGconn *db_conn); | 35 | TALER_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 | */ | ||
38 | int | 50 | int |
39 | TALER_MINT_DB_get_collectable_blindcoin (PGconn *db_conn, | 51 | TALER_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 | */ | ||
43 | int | 68 | int |
44 | TALER_MINT_DB_insert_collectable_blindcoin (PGconn *db_conn, | 69 | TALER_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 | */ | ||
65 | int | 100 | int |
66 | TALER_MINT_DB_update_reserve (PGconn *db_conn, | 101 | TALER_MINT_DB_update_reserve (PGconn *db_conn, |
67 | const struct Reserve *reserve, | 102 | const struct Reserve *reserve, |
@@ -72,7 +107,7 @@ int | |||
72 | TALER_MINT_DB_insert_refresh_order (PGconn *db_conn, | 107 | TALER_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 | ||
77 | int | 112 | int |
78 | TALER_MINT_DB_get_refresh_session (PGconn *db_conn, | 113 | TALER_MINT_DB_get_refresh_session (PGconn *db_conn, |
@@ -123,19 +158,22 @@ int | |||
123 | TALER_MINT_DB_get_refresh_order (PGconn *db_conn, | 158 | TALER_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 | ||
129 | int | 164 | int |
130 | TALER_MINT_DB_insert_refresh_collectable (PGconn *db_conn, | 165 | TALER_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 | |||
134 | int | 170 | int |
135 | TALER_MINT_DB_get_refresh_collectable (PGconn *db_conn, | 171 | TALER_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 | |||
139 | int | 177 | int |
140 | TALER_MINT_DB_set_reveal_ok (PGconn *db_conn, | 178 | TALER_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 | ||
151 | int | 189 | int |
@@ -158,8 +196,8 @@ TALER_MINT_DB_get_refresh_melt (PGconn *db_conn, | |||
158 | typedef | 196 | typedef |
159 | int (*LinkIterator) (void *cls, | 197 | int (*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 | ||
164 | int | 202 | int |
165 | TALER_db_get_link (PGconn *db_conn, | 203 | TALER_db_get_link (PGconn *db_conn, |