From bea425de6cbbfb054a19e0f2312c5ef00c2e1bbe Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Tue, 17 Feb 2015 17:23:13 +0100 Subject: Fix #3624: Check JSON format for wire deposits (SEPA specification) --- src/include/taler_json_lib.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index 262e612cc..f0ae923f4 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -23,6 +23,14 @@ #include +/** + * Print JSON parsing related error information + */ +#define TALER_JSON_warn(error) \ + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ + "JSON parsing failed at %s:%u: %s (%s)\n", \ + __FILE__, __LINE__, error.text, error.source) + /** * Convert a TALER amount to a JSON object. @@ -103,6 +111,16 @@ TALER_JSON_to_data (json_t *json, void *out, size_t out_size); +/** + * Check if the given wire format JSON object is correctly formatted + * + * @param type the type of the wire format + * @param wire the JSON wire format object + * @return 1 if correctly formatted; 0 if not + */ +int +TALER_JSON_validate_wireformat (const char *type, json_t *wire); + #endif /* TALER_JSON_LIB_H_ */ -- cgit v1.2.3