From 7d6b8d53d5a6ee6ca1545fb5d458199c6249edc5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 18 Nov 2016 18:29:18 +0100 Subject: addressing #4803: nicer error messages for invalid wire formats --- src/exchange-lib/exchange_api_wire.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/exchange-lib/exchange_api_wire.c') diff --git a/src/exchange-lib/exchange_api_wire.c b/src/exchange-lib/exchange_api_wire.c index 7401e66d4..fe60d664c 100644 --- a/src/exchange-lib/exchange_api_wire.c +++ b/src/exchange-lib/exchange_api_wire.c @@ -95,7 +95,8 @@ verify_wire_method_signature_ok (const struct TALER_EXCHANGE_WireHandle *wh, const struct TALER_EXCHANGE_Keys *key_state; struct TALER_WIRE_Plugin *plugin; char *lib_name; - int ret; + char *emsg; + enum TALER_ErrorCode ec; key_state = TALER_EXCHANGE_get_keys (wh->exchange); (void) GNUNET_asprintf (&lib_name, @@ -112,13 +113,15 @@ verify_wire_method_signature_ok (const struct TALER_EXCHANGE_WireHandle *wh, return GNUNET_NO; } plugin->library_name = lib_name; - ret = plugin->wire_validate (plugin->cls, - json, - &key_state->master_pub); + ec = plugin->wire_validate (plugin->cls, + json, + &key_state->master_pub, + &emsg); + GNUNET_free_non_null (emsg); GNUNET_PLUGIN_unload (lib_name, plugin); GNUNET_free (lib_name); - return (GNUNET_YES == ret) ? GNUNET_OK : GNUNET_SYSERR; + return (TALER_EC_NONE == ec) ? GNUNET_OK : GNUNET_SYSERR; } -- cgit v1.2.3