From c4a68b896fa0889cc96cc30b2eae38e1996f4300 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 17 Aug 2015 03:56:49 +0200 Subject: add internal sig verification, pack hashes, fix testcase --- src/mint-lib/mint_api_json.c | 3 +++ src/mint-lib/test_mint_api.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mint-lib') diff --git a/src/mint-lib/mint_api_json.c b/src/mint-lib/mint_api_json.c index b1517394..46f54d94 100644 --- a/src/mint-lib/mint_api_json.c +++ b/src/mint-lib/mint_api_json.c @@ -245,6 +245,9 @@ parse_json (json_t *root, &sig.eddsa_signature, spec[i].details.eddsa_signature.pub_key)) { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to verify signature of purpose %u\n", + ntohl (purpose->purpose)); GNUNET_break_op (0); MAJ_parse_free (sig_spec); return i; diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index 340e9d17..71e23f47 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -1973,31 +1973,33 @@ run (void *cls, .expected_response_code = MHD_HTTP_OK, .details.refresh_link.reveal_ref = "refresh-reveal-1" }, -#if TEST_REFRESH /* Test successfully spending coins from the refresh operation: first EUR:1 */ { .oc = OC_DEPOSIT, - .label = "refresh-deposit-refreshed-1", + .label = "refresh-deposit-refreshed-1a", .expected_response_code = MHD_HTTP_OK, .details.deposit.amount = "EUR:1", - .details.deposit.coin_ref = "refresh-reveal-1a", + .details.deposit.coin_ref = "refresh-reveal-1", .details.deposit.coin_idx = 0, .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }", .details.deposit.contract = "{ \"items\"={ \"name\":\"ice cream\", \"value\":3 } }", .details.deposit.transaction_id = 2 }, + /* Test successfully spending coins from the refresh operation: finally EUR:0.1 */ { .oc = OC_DEPOSIT, .label = "refresh-deposit-refreshed-1b", .expected_response_code = MHD_HTTP_OK, .details.deposit.amount = "EUR:0.1", - .details.deposit.coin_ref = "refresh-reveal-1b", + .details.deposit.coin_ref = "refresh-reveal-1", .details.deposit.coin_idx = 4, .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }", .details.deposit.contract = "{ \"items\"={ \"name\":\"ice cream\", \"value\":3 } }", .details.deposit.transaction_id = 2 }, +#if TEST_REFRESH + /* Test running a failing melt operation (same operation again must fail) */ { .oc = OC_REFRESH_MELT, .label = "refresh-melt-failing", -- cgit v1.2.3