From ef4238874f6628a9ee4464ad3b70a7fde96d518b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Mon, 27 Dec 2021 23:24:48 +0100 Subject: [age restriction] progress 9/n More worke towards support for extensions and age restriction: - taler-exchange-httpd_management_extensions.c almost completed - handling of request implemented - stub "set_extensions" for database transaction added - utility functions added - TALER_exchange_offline_extension_agemask_{sign,verify} - TALER_agemask_parse_json --- src/json/json_helper.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/json') diff --git a/src/json/json_helper.c b/src/json/json_helper.c index 949354e24..3b4da5595 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -659,4 +659,36 @@ TALER_JSON_spec_i18n_str (const char *name, } +enum GNUNET_GenericReturnValue +TALER_agemask_parse_json (const json_t *root, + struct TALER_AgeMask *mask) +{ + const char *name; + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_string ("extension", + &name), + GNUNET_JSON_spec_uint32 ("mask", + &mask->mask), + GNUNET_JSON_spec_end () + }; + + if (GNUNET_OK != GNUNET_JSON_parse (root, + spec, + NULL, + NULL)) + { + return GNUNET_SYSERR; + } + + if (! strncmp (name, + "age_restriction", + sizeof("age_restriction"))) + { + return GNUNET_SYSERR; + } + + return GNUNET_OK; +} + + /* end of json/json_helper.c */ -- cgit v1.2.3