diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/auditor_api_deposit_confirmation.c | 2 | ||||
-rw-r--r-- | src/lib/exchange_api_curl_defaults.c | 1 | ||||
-rw-r--r-- | src/lib/exchange_api_deposit.c | 4 | ||||
-rw-r--r-- | src/lib/exchange_api_payback.c | 4 | ||||
-rw-r--r-- | src/lib/exchange_api_refresh.c | 16 | ||||
-rw-r--r-- | src/lib/exchange_api_refund.c | 2 | ||||
-rw-r--r-- | src/lib/exchange_api_reserve.c | 6 | ||||
-rw-r--r-- | src/lib/exchange_api_track_transaction.c | 2 | ||||
-rw-r--r-- | src/lib/exchange_api_track_transfer.c | 2 | ||||
-rw-r--r-- | src/lib/test_auditor_api.conf | 2 | ||||
-rw-r--r-- | src/lib/test_exchange_api.c | 16 | ||||
-rw-r--r-- | src/lib/test_exchange_api_twisted.c | 9 |
12 files changed, 33 insertions, 33 deletions
diff --git a/src/lib/auditor_api_deposit_confirmation.c b/src/lib/auditor_api_deposit_confirmation.c index f221b7fd7..73173cc31 100644 --- a/src/lib/auditor_api_deposit_confirmation.c +++ b/src/lib/auditor_api_deposit_confirmation.c @@ -99,7 +99,7 @@ handle_deposit_confirmation_finished (void *cls, /* This should never happen, either us or the auditor is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, auditor says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_curl_defaults.c b/src/lib/exchange_api_curl_defaults.c index 36d1edf7b..7b642bc89 100644 --- a/src/lib/exchange_api_curl_defaults.c +++ b/src/lib/exchange_api_curl_defaults.c @@ -35,7 +35,6 @@ TEL_curl_easy_get (const char *url) CURL *eh; eh = curl_easy_init (); - GNUNET_assert (CURLE_OK == curl_easy_setopt (eh, CURLOPT_URL, diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index 48f9a06bb..30bb6c976 100644 --- a/src/lib/exchange_api_deposit.c +++ b/src/lib/exchange_api_deposit.c @@ -325,7 +325,7 @@ handle_deposit_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_CONFLICT: /* Double spending; check signatures on transaction history */ if (GNUNET_OK != verify_deposit_signature_forbidden (dh, @@ -335,7 +335,7 @@ handle_deposit_finished (void *cls, response_code = 0; } break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_payback.c b/src/lib/exchange_api_payback.c index 912548cfe..f9df27e7a 100644 --- a/src/lib/exchange_api_payback.c +++ b/src/lib/exchange_api_payback.c @@ -226,7 +226,7 @@ handle_payback_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_CONFLICT: { /* Insufficient funds, proof attached */ json_t *history; @@ -256,7 +256,7 @@ handle_payback_finished (void *cls, TALER_EXCHANGE_payback_cancel (ph); return; } - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_refresh.c b/src/lib/exchange_api_refresh.c index db3692bcd..a75baec86 100644 --- a/src/lib/exchange_api_refresh.c +++ b/src/lib/exchange_api_refresh.c @@ -939,7 +939,7 @@ verify_refresh_melt_signature_ok (struct TALER_EXCHANGE_RefreshMeltHandle *rmh, /** - * Verify that the signatures on the "403 FORBIDDEN" response from the + * Verify that the signatures on the "409 CONFLICT" response from the * exchange demonstrating customer double-spending are valid. * * @param rmh melt handle @@ -947,9 +947,9 @@ verify_refresh_melt_signature_ok (struct TALER_EXCHANGE_RefreshMeltHandle *rmh, * @return #GNUNET_OK if the signature(s) is valid, #GNUNET_SYSERR if not */ static int -verify_refresh_melt_signature_forbidden (struct - TALER_EXCHANGE_RefreshMeltHandle *rmh, - const json_t *json) +verify_refresh_melt_signature_conflict (struct + TALER_EXCHANGE_RefreshMeltHandle *rmh, + const json_t *json) { json_t *history; struct TALER_Amount original_value; @@ -1083,17 +1083,17 @@ handle_refresh_melt_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_CONFLICT: /* Double spending; check signatures on transaction history */ if (GNUNET_OK != - verify_refresh_melt_signature_forbidden (rmh, - j)) + verify_refresh_melt_signature_conflict (rmh, + j)) { GNUNET_break_op (0); response_code = 0; } break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; assuming we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c index e8ae6b74a..b8c422e88 100644 --- a/src/lib/exchange_api_refund.c +++ b/src/lib/exchange_api_refund.c @@ -169,7 +169,7 @@ handle_refund_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_reserve.c b/src/lib/exchange_api_reserve.c index a57d4e9dc..2c62cac20 100644 --- a/src/lib/exchange_api_reserve.c +++ b/src/lib/exchange_api_reserve.c @@ -797,7 +797,7 @@ reserve_withdraw_ok (struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh, /** - * We got a 403 FORBIDDEN response for the /reserve/withdraw operation. + * We got a 409 CONFLICT response for the /reserve/withdraw operation. * Check the signatures on the withdraw transactions in the provided * history and that the balances add up. We don't do anything directly * with the information, as the JSON will be returned to the application. @@ -941,7 +941,7 @@ handle_reserve_withdraw_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_CONFLICT: /* The exchange says that the reserve has insufficient funds; check the signatures in the history... */ if (GNUNET_OK != @@ -952,7 +952,7 @@ handle_reserve_withdraw_finished (void *cls, response_code = 0; } break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: GNUNET_break (0); /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we diff --git a/src/lib/exchange_api_track_transaction.c b/src/lib/exchange_api_track_transaction.c index 29b85facf..de3f98b65 100644 --- a/src/lib/exchange_api_track_transaction.c +++ b/src/lib/exchange_api_track_transaction.c @@ -217,7 +217,7 @@ handle_deposit_wtid_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/exchange_api_track_transfer.c b/src/lib/exchange_api_track_transfer.c index 419998a2c..2c90bf199 100644 --- a/src/lib/exchange_api_track_transfer.c +++ b/src/lib/exchange_api_track_transfer.c @@ -279,7 +279,7 @@ handle_track_transfer_finished (void *cls, /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_UNAUTHORIZED: + case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ diff --git a/src/lib/test_auditor_api.conf b/src/lib/test_auditor_api.conf index e01cbfcbd..3a12b3c5e 100644 --- a/src/lib/test_auditor_api.conf +++ b/src/lib/test_auditor_api.conf @@ -15,6 +15,8 @@ BASE_URL = "http://localhost:8083/" # HTTP port the auditor listens to PORT = 8083 +TINY_AMOUNT = EUR:0.01 + [exchange] # how long is one signkey valid? diff --git a/src/lib/test_exchange_api.c b/src/lib/test_exchange_api.c index 23a52be1f..4e8eb7e09 100644 --- a/src/lib/test_exchange_api.c +++ b/src/lib/test_exchange_api.c @@ -228,7 +228,7 @@ run (void *cls, TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2", "create-reserve-1", "EUR:5", - MHD_HTTP_FORBIDDEN), + MHD_HTTP_CONFLICT), /** * Try to double spend using different wire details. @@ -238,7 +238,7 @@ run (void *cls, TALER_TESTING_make_wire_details (43, fakebank_url), "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", - GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_FORBIDDEN), + GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_CONFLICT), /** * Try to double spend using a different transaction id. @@ -253,7 +253,7 @@ run (void *cls, TALER_TESTING_make_wire_details (43, fakebank_url), "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", - GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_FORBIDDEN), + GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_CONFLICT), /** * Try to double spend with different proposal. @@ -263,7 +263,7 @@ run (void *cls, TALER_TESTING_make_wire_details (43, fakebank_url), "{\"items\":[{\"name\":\"ice cream\",\"value\":2}]}", - GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_FORBIDDEN), + GNUNET_TIME_UNIT_ZERO, "EUR:5", MHD_HTTP_CONFLICT), TALER_TESTING_cmd_end () }; @@ -364,7 +364,7 @@ run (void *cls, TALER_TESTING_cmd_refresh_melt ("refresh-melt-failing", "refresh-withdraw-coin-1", - MHD_HTTP_FORBIDDEN, + MHD_HTTP_CONFLICT, NULL), /* FIXME: also test with coin that was already melted @@ -708,7 +708,7 @@ run (void *cls, ("payback-withdraw-coin-2-over", "payback-create-reserve-1", "EUR:10", - MHD_HTTP_FORBIDDEN), + MHD_HTTP_CONFLICT), TALER_TESTING_cmd_status ("payback-reserve-status-2", "payback-create-reserve-1", @@ -740,7 +740,7 @@ run (void *cls, ("expired-withdraw", "short-lived-reserve", "EUR:1", - MHD_HTTP_FORBIDDEN), + MHD_HTTP_CONFLICT), TALER_TESTING_cmd_check_bank_transfer ("check_bank_short-lived_transfer", @@ -798,7 +798,7 @@ run (void *cls, "EUR:0.5", NULL), - TALER_TESTING_cmd_payback ("payback-2b", MHD_HTTP_FORBIDDEN, + TALER_TESTING_cmd_payback ("payback-2b", MHD_HTTP_CONFLICT, "payback-withdraw-coin-2a", "EUR:0.5", NULL), diff --git a/src/lib/test_exchange_api_twisted.c b/src/lib/test_exchange_api_twisted.c index 739669b97..f648b871d 100644 --- a/src/lib/test_exchange_api_twisted.c +++ b/src/lib/test_exchange_api_twisted.c @@ -16,9 +16,8 @@ License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - /** - * @file exchange/test_exchange_api_twister.c + * @file exchange/test_exchange_api_twisted.c * @brief testcase to test exchange's HTTP API interface * @author Marcello Stanisci * @author Sree Harsha Totakura <sreeharsha@totakura.in> @@ -262,7 +261,7 @@ run (void *cls, TALER_TESTING_cmd_refund ("refund-bad-sig", - MHD_HTTP_UNAUTHORIZED, + MHD_HTTP_FORBIDDEN, "EUR:5", "EUR:0.01", "deposit-refund-1"), @@ -285,7 +284,7 @@ run (void *cls, "\"value\":\"EUR:5\"}]}", GNUNET_TIME_UNIT_MINUTES, "EUR:5", - MHD_HTTP_FORBIDDEN), + MHD_HTTP_CONFLICT), TALER_TESTING_cmd_refund ("refund-deposit-not-found", @@ -350,7 +349,7 @@ main (int argc, /* These environment variables get in the way... */ unsetenv ("XDG_DATA_HOME"); unsetenv ("XDG_CONFIG_HOME"); - GNUNET_log_setup ("test-exchange-api-new-twisted", + GNUNET_log_setup ("test-exchange-api-twisted", "DEBUG", NULL); if (NULL == (fakebank_url = TALER_TESTING_prepare_fakebank |