diff options
| author | Christian Grothoff <christian@grothoff.org> | 2016-11-18 18:29:18 +0100 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2016-11-18 18:29:18 +0100 | 
| commit | 7d6b8d53d5a6ee6ca1545fb5d458199c6249edc5 (patch) | |
| tree | f44f7afb792184ef46e6d4882cb20de0e2d8b519 /src/wire/test_wire_plugin.c | |
| parent | de68a7b301fd78a89c4f5e6f34791c8debab36e0 (diff) | |
addressing #4803: nicer error messages for invalid wire formats
Diffstat (limited to 'src/wire/test_wire_plugin.c')
| -rw-r--r-- | src/wire/test_wire_plugin.c | 13 | 
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wire/test_wire_plugin.c b/src/wire/test_wire_plugin.c index c465302f..0828a06b 100644 --- a/src/wire/test_wire_plugin.c +++ b/src/wire/test_wire_plugin.c @@ -112,6 +112,7 @@ run_test (const struct TestBlock *test,    json_t *lwire;    struct TALER_Amount in;    struct TALER_Amount expect; +  char *emsg;    GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,                                &salt, @@ -134,12 +135,14 @@ run_test (const struct TestBlock *test,                         "sig",                         GNUNET_JSON_from_data (&sig,                                                sizeof (sig))); -  if (GNUNET_OK != +  if (TALER_EC_NONE !=        plugin->wire_validate (plugin->cls,                               wire, -                             &pub_key)) +                             &pub_key, +                             &emsg))    {      GNUNET_break (0); +    GNUNET_free (emsg);      return GNUNET_SYSERR;    }    /* load wire details from file */ @@ -151,12 +154,14 @@ run_test (const struct TestBlock *test,      GNUNET_break (0);      return GNUNET_SYSERR;    } -  if (GNUNET_OK != +  if (TALER_EC_NONE !=        plugin->wire_validate (plugin->cls,                               lwire, -                             &pub_key)) +                             &pub_key, +                             &emsg))    {      GNUNET_break (0); +    GNUNET_free (emsg);      json_decref (lwire);      return GNUNET_SYSERR;    }  | 
