diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-08-17 03:56:49 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-08-17 03:56:49 +0200 |
commit | c4a68b896fa0889cc96cc30b2eae38e1996f4300 (patch) | |
tree | 235903f91fbbf4e8ccb3dbe8af54a1a13cb272cd /src/mint-lib | |
parent | 0edac106656769dc172e1e66eee7a01e54e8baaa (diff) |
add internal sig verification, pack hashes, fix testcase
Diffstat (limited to 'src/mint-lib')
-rw-r--r-- | src/mint-lib/mint_api_json.c | 3 | ||||
-rw-r--r-- | src/mint-lib/test_mint_api.c | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/mint-lib/mint_api_json.c b/src/mint-lib/mint_api_json.c index b15173940..46f54d948 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 340e9d17f..71e23f473 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", |