diff options
Diffstat (limited to 'src/mint/mint_db.h')
-rw-r--r-- | src/mint/mint_db.h | 72 |
1 files changed, 54 insertions, 18 deletions
diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h index 0f746c14d..e0c2e2e0a 100644 --- a/src/mint/mint_db.h +++ b/src/mint/mint_db.h | |||
@@ -122,23 +122,49 @@ TALER_MINT_DB_get_known_coin (PGconn *db_conn, | |||
122 | 122 | ||
123 | 123 | ||
124 | int | 124 | int |
125 | TALER_MINT_DB_upsert_known_coin (PGconn *db_conn, struct KnownCoin *known_coin); | 125 | TALER_MINT_DB_upsert_known_coin (PGconn *db_conn, |
126 | struct KnownCoin *known_coin); | ||
127 | |||
128 | |||
126 | 129 | ||
127 | 130 | ||
128 | int | 131 | int |
129 | TALER_MINT_DB_insert_refresh_commit_link (PGconn *db_conn, | 132 | TALER_MINT_DB_create_refresh_session (PGconn *db_conn, |
130 | const struct RefreshCommitLink *commit_link); | 133 | const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub); |
131 | 134 | ||
135 | |||
136 | /** | ||
137 | * Store the commitment to the given (encrypted) refresh link data | ||
138 | * for the given refresh session. | ||
139 | * | ||
140 | * @param db_conn database connection to use | ||
141 | * @param refresh_session_pub public key of the refresh session this | ||
142 | * commitment belongs with | ||
143 | * @param i | ||
144 | * @param j | ||
145 | * @param commit_link link information to store | ||
146 | * @return #GNUNET_SYSERR on internal error, #GNUNET_OK on success | ||
147 | */ | ||
132 | int | 148 | int |
133 | TALER_MINT_DB_insert_refresh_commit_coin (PGconn *db_conn, | 149 | TALER_MINT_DB_insert_refresh_commit_link (PGconn *db_conn, |
134 | const struct RefreshCommitCoin *commit_coin); | 150 | const struct GNUNET_CRYPTO_EddsaPublicKey *refresh_session_pub, |
151 | int i, int j, | ||
152 | const struct RefreshCommitLink *commit_link); | ||
135 | 153 | ||
136 | 154 | ||
137 | int | 155 | int |
138 | TALER_MINT_DB_get_refresh_commit_link (PGconn *db_conn, | 156 | TALER_MINT_DB_get_refresh_commit_link (PGconn *db_conn, |
139 | const struct GNUNET_CRYPTO_EddsaPublicKey *refresh_session_pub, | 157 | const struct GNUNET_CRYPTO_EddsaPublicKey *refresh_session_pub, |
140 | int i, int j, | 158 | int i, int j, |
141 | struct RefreshCommitLink *commit_link); | 159 | struct RefreshCommitLink *cc); |
160 | |||
161 | |||
162 | int | ||
163 | TALER_MINT_DB_insert_refresh_commit_coin (PGconn *db_conn, | ||
164 | const struct GNUNET_CRYPTO_EddsaPublicKey *refresh_session_pub, | ||
165 | int i, | ||
166 | int j, | ||
167 | const struct RefreshCommitCoin *commit_coin); | ||
142 | 168 | ||
143 | 169 | ||
144 | int | 170 | int |
@@ -148,12 +174,6 @@ TALER_MINT_DB_get_refresh_commit_coin (PGconn *db_conn, | |||
148 | struct RefreshCommitCoin *commit_coin); | 174 | struct RefreshCommitCoin *commit_coin); |
149 | 175 | ||
150 | 176 | ||
151 | int | ||
152 | TALER_MINT_DB_create_refresh_session (PGconn *db_conn, | ||
153 | const struct GNUNET_CRYPTO_EddsaPublicKey | ||
154 | *session_pub); | ||
155 | |||
156 | |||
157 | struct GNUNET_CRYPTO_rsa_PublicKey * | 177 | struct GNUNET_CRYPTO_rsa_PublicKey * |
158 | TALER_MINT_DB_get_refresh_order (PGconn *db_conn, | 178 | TALER_MINT_DB_get_refresh_order (PGconn *db_conn, |
159 | uint16_t newcoin_index, | 179 | uint16_t newcoin_index, |
@@ -178,6 +198,7 @@ int | |||
178 | TALER_MINT_DB_set_reveal_ok (PGconn *db_conn, | 198 | TALER_MINT_DB_set_reveal_ok (PGconn *db_conn, |
179 | const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub); | 199 | const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub); |
180 | 200 | ||
201 | |||
181 | int | 202 | int |
182 | TALER_MINT_DB_insert_refresh_melt (PGconn *db_conn, | 203 | TALER_MINT_DB_insert_refresh_melt (PGconn *db_conn, |
183 | const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, | 204 | const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub, |
@@ -193,11 +214,15 @@ TALER_MINT_DB_get_refresh_melt (PGconn *db_conn, | |||
193 | struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub); | 214 | struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub); |
194 | 215 | ||
195 | 216 | ||
196 | typedef | 217 | /** |
197 | int (*LinkIterator) (void *cls, | 218 | * FIXME: doc, name is bad, too. |
198 | const struct LinkDataEnc *link_data_enc, | 219 | */ |
199 | const struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub, | 220 | typedef int |
200 | const struct GNUNET_CRYPTO_rsa_Signature *ev_sig); | 221 | (*LinkIterator) (void *cls, |
222 | const struct TALER_RefreshLinkEncrypted *link_data_enc, | ||
223 | const struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub, | ||
224 | const struct GNUNET_CRYPTO_rsa_Signature *ev_sig); | ||
225 | |||
201 | 226 | ||
202 | int | 227 | int |
203 | TALER_db_get_link (PGconn *db_conn, | 228 | TALER_db_get_link (PGconn *db_conn, |
@@ -206,26 +231,37 @@ TALER_db_get_link (PGconn *db_conn, | |||
206 | void *cls); | 231 | void *cls); |
207 | 232 | ||
208 | 233 | ||
234 | /** | ||
235 | * Obtain shared secret from the transfer public key (?). | ||
236 | * | ||
237 | * @param shared_secret_enc[out] set to shared secret; FIXME: use other type | ||
238 | * to indicate this is the encrypted secret | ||
239 | */ | ||
209 | int | 240 | int |
210 | TALER_db_get_transfer (PGconn *db_conn, | 241 | TALER_db_get_transfer (PGconn *db_conn, |
211 | const struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub, | 242 | const struct GNUNET_CRYPTO_EcdsaPublicKey *coin_pub, |
212 | struct GNUNET_CRYPTO_EcdsaPublicKey *transfer_pub, | 243 | struct GNUNET_CRYPTO_EcdsaPublicKey *transfer_pub, |
213 | struct SharedSecretEnc *shared_secret_enc); | 244 | struct GNUNET_HashCode *shared_secret_enc); |
214 | 245 | ||
215 | int | 246 | int |
216 | TALER_MINT_DB_init_deposits (PGconn *db_conn, int temporary); | 247 | TALER_MINT_DB_init_deposits (PGconn *db_conn, int temporary); |
217 | 248 | ||
249 | |||
218 | int | 250 | int |
219 | TALER_MINT_DB_prepare_deposits (PGconn *db_conn); | 251 | TALER_MINT_DB_prepare_deposits (PGconn *db_conn); |
220 | 252 | ||
253 | |||
221 | int | 254 | int |
222 | TALER_MINT_DB_insert_deposit (PGconn *db_conn, | 255 | TALER_MINT_DB_insert_deposit (PGconn *db_conn, |
223 | const struct Deposit *deposit); | 256 | const struct Deposit *deposit); |
224 | 257 | ||
258 | |||
225 | int | 259 | int |
226 | TALER_MINT_DB_get_deposit (PGconn *db_conn, | 260 | TALER_MINT_DB_get_deposit (PGconn *db_conn, |
227 | const struct GNUNET_CRYPTO_EddsaPublicKey *coin_pub, | 261 | const struct GNUNET_CRYPTO_EddsaPublicKey *coin_pub, |
228 | struct Deposit **r_deposit); | 262 | struct Deposit **r_deposit); |
263 | |||
264 | |||
229 | int | 265 | int |
230 | TALER_MINT_DB_insert_known_coin (PGconn *db_conn, | 266 | TALER_MINT_DB_insert_known_coin (PGconn *db_conn, |
231 | const struct KnownCoin *known_coin); | 267 | const struct KnownCoin *known_coin); |