summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2015-08-11 16:13:07 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2015-08-11 16:13:07 +0200
commitf9c3548be9788cf0ba47dcde88fa4e08fb911093 (patch)
tree152961c4ddd21d73ba493435309a92318a9ed489
parent87f1602acacfc1a8ae67f2b5eca3bd355018ffd6 (diff)
downloadmerchant-f9c3548be9788cf0ba47dcde88fa4e08fb911093.tar.gz
merchant-f9c3548be9788cf0ba47dcde88fa4e08fb911093.tar.bz2
merchant-f9c3548be9788cf0ba47dcde88fa4e08fb911093.zip
the branch has got lighted and the hardcoded paths in Makefile.am
have gone. To be merged in master.
-rw-r--r--src/backend/Makefile.am5
-rwxr-xr-xsrc/backend/taler-merchant-dbinitbin35040 -> 0 bytes
-rw-r--r--src/backend/taler-merchant-httpd.c1
-rw-r--r--src/backend/taler-mint-httpd_parsing.c1
-rw-r--r--src/backend/taler-mint-httpd_parsing.h3
-rw-r--r--src/backend/taler-mint-httpd_responses.c2
-rw-r--r--src/backend/taler-mint-httpd_responses.h302
7 files changed, 7 insertions, 307 deletions
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 7c100040..47dda1f9 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -13,8 +13,7 @@ taler_merchant_httpd_SOURCES = \
taler_merchant_httpd_LDADD = \
$(LIBGCRYPT_LIBS) \
- /home/marcello/Taler/trans_mint/src/util/libtalerutil.la \
- /home/marcello/Taler/trans_mint/src/mintdb/libtalermintdb.la \
+ -ltalerutil \
-lmicrohttpd \
-ljansson \
-lgnunetutil \
@@ -25,7 +24,7 @@ taler_merchant_httpd_LDADD = \
-lpthread
# NOTE: the lines
-# /home/demo/mint/src/util/libtalerutil.la \
+# /home/marcello/Taler/trans_mint/src/util/libtalerutil.la \
# /home/demo/mint/src/mintdb/libtalermintdb.la \
# don't seem to be replaceable with -ltalerutil and -ltalermintdb
# -ltalerutil \
diff --git a/src/backend/taler-merchant-dbinit b/src/backend/taler-merchant-dbinit
deleted file mode 100755
index b737366c..00000000
--- a/src/backend/taler-merchant-dbinit
+++ /dev/null
Binary files differ
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 9c431c2b..f5390233 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -26,6 +26,7 @@
#include <gnunet/gnunet_util_lib.h>
#include <taler/taler_json_lib.h>
#include <taler/taler_mint_service.h>
+#include <taler/taler_signatures.h>
#include "taler-mint-httpd_parsing.h"
#include "taler-mint-httpd_responses.h"
#include "merchant.h"
diff --git a/src/backend/taler-mint-httpd_parsing.c b/src/backend/taler-mint-httpd_parsing.c
index f84e7314..8d9e3f9f 100644
--- a/src/backend/taler-mint-httpd_parsing.c
+++ b/src/backend/taler-mint-httpd_parsing.c
@@ -27,7 +27,6 @@
#include "taler-mint-httpd_parsing.h"
#include "taler-mint-httpd_responses.h"
-
/**
* Initial size for POST request buffer.
*/
diff --git a/src/backend/taler-mint-httpd_parsing.h b/src/backend/taler-mint-httpd_parsing.h
index a2cf4c46..d6a2b4ea 100644
--- a/src/backend/taler-mint-httpd_parsing.h
+++ b/src/backend/taler-mint-httpd_parsing.h
@@ -25,8 +25,7 @@
#include <microhttpd.h>
#include <jansson.h>
-#include "taler_util.h"
-
+#include <taler/taler_util.h>
/**
* Process a POST request containing a JSON object. This
diff --git a/src/backend/taler-mint-httpd_responses.c b/src/backend/taler-mint-httpd_responses.c
index a2a49c03..aa8f0bf8 100644
--- a/src/backend/taler-mint-httpd_responses.c
+++ b/src/backend/taler-mint-httpd_responses.c
@@ -24,7 +24,7 @@
*/
#include "platform.h"
#include "taler-mint-httpd_responses.h"
-#include "taler_util.h"
+#include <taler/taler_util.h>
#include <gnunet/gnunet_util_lib.h>
diff --git a/src/backend/taler-mint-httpd_responses.h b/src/backend/taler-mint-httpd_responses.h
index 7afd0188..b1a49d42 100644
--- a/src/backend/taler-mint-httpd_responses.h
+++ b/src/backend/taler-mint-httpd_responses.h
@@ -29,9 +29,6 @@
#include <jansson.h>
#include <microhttpd.h>
#include <pthread.h>
-#include "taler-mint-httpd.h"
-#include "taler-mint-httpd_db.h"
-
/**
* Send JSON object as response.
@@ -65,66 +62,13 @@ TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
/**
- * Send a response indicating an invalid signature.
- *
- * @param connection the MHD connection to use
- * @param param_name the parameter that is invalid
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
- const char *param_name);
-
-
-/**
- * Send a response indicating an invalid argument.
- *
- * @param connection the MHD connection to use
- * @param param_name the parameter that is invalid
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
- const char *param_name);
-
-
-/**
- * Send a response indicating an argument refering to a
- * resource unknown to the mint (i.e. unknown reserve or
- * denomination key).
- *
- * @param connection the MHD connection to use
- * @param param_name the parameter that is invalid
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
- const char *param_name);
-
-
-/**
- * Send a response indicating a missing argument.
- *
- * @param connection the MHD connection to use
- * @param param_name the parameter that is missing
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
- const char *param_name);
-
-
-/**
- * Send a response indicating permission denied.
+ * Send a response indicating that the JSON was malformed.
*
* @param connection the MHD connection to use
- * @param hint hint about why access was denied
* @return a MHD result code
*/
int
-TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
- const char *hint);
-
+TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
/**
* Send a response indicating an internal error.
@@ -136,42 +80,6 @@ TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
int
TMH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
const char *hint);
-
-
-/**
- * Send a response indicating an external error.
- *
- * @param connection the MHD connection to use
- * @param hint hint about the error's nature
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
- const char *hint);
-
-
-/**
- * Send a response indicating an error committing a
- * transaction (concurrent interference).
- *
- * @param connection the MHD connection to use
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection);
-
-
-/**
- * Send a response indicating a failure to talk to the Mint's
- * database.
- *
- * @param connection the MHD connection to use
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection);
-
-
/**
* Send a response indicating that the request was too big.
*
@@ -181,210 +89,4 @@ TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection);
int
TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection);
-
-/**
- * Send a response indicating that the JSON was malformed.
- *
- * @param connection the MHD connection to use
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
-
-
-/**
- * Send confirmation of deposit success to client. This function
- * will create a signed message affirming the given information
- * and return it to the client. By this, the mint affirms that
- * the coin had sufficient (residual) value for the specified
- * transaction and that it will execute the requested deposit
- * operation with the given wiring details.
- *
- * @param connection connection to the client
- * @param coin_pub public key of the coin
- * @param h_wire hash of wire details
- * @param h_contract hash of contract details
- * @param transaction_id transaction ID
- * @param timestamp client's timestamp
- * @param refund_deadline until when this deposit be refunded
- * @param merchant merchant public key
- * @param amount_without_fee fraction of coin value to deposit (without fee)
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_contract,
- uint64_t transaction_id,
- struct GNUNET_TIME_Absolute timestamp,
- struct GNUNET_TIME_Absolute refund_deadline,
- const struct TALER_MerchantPublicKeyP *merchant,
- const struct TALER_Amount *amount_without_fee);
-
-
-/**
- * Send proof that a /deposit request is invalid to client. This
- * function will create a message with all of the operations affecting
- * the coin that demonstrate that the coin has insufficient value.
- *
- * @param connection connection to the client
- * @param tl transaction list to use to build reply
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_TransactionList *tl);
-
-
-/**
- * Send reserve status information to client.
- *
- * @param connection connection to the client
- * @param rh reserve history to return
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_withdraw_status_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh);
-
-
-/**
- * Send reserve status information to client with the
- * message that we have insufficient funds for the
- * requested /withdraw/sign operation.
- *
- * @param connection connection to the client
- * @param rh reserve history to return
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_withdraw_sign_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh);
-
-
-/**
- * Send blinded coin information to client.
- *
- * @param connection connection to the client
- * @param collectable blinded coin to return
- * @return MHD result code
- */
-int
-TMH_RESPONSE_reply_withdraw_sign_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_CollectableBlindcoin *collectable);
-
-
-/**
- * Send a confirmation response to a "/refresh/melt" request.
- *
- * @param connection the connection to send the response to
- * @param session_hash hash of the refresh session
- * @param noreveal_index which index will the client not have to reveal
- * @return a MHD status code
- */
-int
-TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
- const struct GNUNET_HashCode *session_hash,
- uint16_t noreveal_index);
-
-
-/**
- * Send a response for a failed "/refresh/melt" request. The
- * transaction history of the given coin demonstrates that the
- * @a residual value of the coin is below the @a requested
- * contribution of the coin for the melt. Thus, the mint
- * refuses the melt operation.
- *
- * @param connection the connection to send the response to
- * @param coin_pub public key of the coin
- * @param coin_value original value of the coin
- * @param tl transaction history for the coin
- * @param requested how much this coin was supposed to contribute
- * @param residual remaining value of the coin (after subtracting @a tl)
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- struct TALER_Amount coin_value,
- struct TALER_MINTDB_TransactionList *tl,
- struct TALER_Amount requested,
- struct TALER_Amount residual);
-
-
-/**
- * Send a response for "/refresh/reveal".
- *
- * @param connection the connection to send the response to
- * @param num_newcoins number of new coins for which we reveal data
- * @param sigs array of @a num_newcoins signatures revealed
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
- unsigned int num_newcoins,
- const struct TALER_DenominationSignature *sigs);
-
-
-/**
- * Send a response for a failed "/refresh/reveal", where the
- * revealed value(s) do not match the original commitment.
- *
- * @param connection the connection to send the response to
- * @param mc all information about the original commitment
- * @param off offset in the array of kappa-commitments where
- * the missmatch was detected
- * @param j index of the coin for which the missmatch was
- * detected
- * @param missmatch_object name of the object that was
- * bogus (i.e. "transfer key").
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
- const struct TALER_MINTDB_MeltCommitment *mc,
- unsigned int off,
- unsigned int j,
- const char *missmatch_object);
-
-
-/**
- * Information for each session a coin was melted into.
- */
-struct TMH_RESPONSE_LinkSessionInfo
-{
- /**
- * Transfer public key of the coin.
- */
- struct TALER_TransferPublicKeyP transfer_pub;
-
- /**
- * Encrypted shared secret for decrypting the transfer secrets.
- */
- struct TALER_EncryptedLinkSecretP shared_secret_enc;
-
- /**
- * Linked data of coins being created in the session.
- */
- struct TALER_MINTDB_LinkDataList *ldl;
-
-};
-
-
-/**
- * Send a response for "/refresh/link".
- *
- * @param connection the connection to send the response to
- * @param num_sessions number of sessions the coin was used in
- * @param sessions array of @a num_session entries with
- * information for each session
- * @return a MHD result code
- */
-int
-TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
- unsigned int num_sessions,
- const struct TMH_RESPONSE_LinkSessionInfo *sessions);
-
-
#endif