aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-10-02 18:05:58 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2022-10-02 18:05:58 +0200
commit04c7e0bb337dd88dde60293d94d2e192a8fc2ff5 (patch)
treebff69b52b8d07be2442dde6ca86a3df2776b2e67 /src/lib/exchange_api_handle.c
parent165b85ddd59ce4af9b3f28409b6210d8f688f17d (diff)
Refactor extensions
- Extensions are now compiled as shared libraries and loaded at runtime according to the TALER configuration. - So far, only age restriction is loaded as extension. - Groundwork for extension auction_brandt started.
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 707e5cf5..add37a80 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -902,16 +902,19 @@ decode_keys_json (const json_t *resp_obj,
{
struct TALER_MasterSignatureP extensions_sig = {0};
json_t *extensions = NULL;
+ bool no_extensions = false;
+ bool no_signature = false;
+
struct GNUNET_JSON_Specification ext_spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_json ("extensions",
&extensions),
- NULL),
+ &no_extensions),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_fixed_auto (
"extensions_sig",
&extensions_sig),
- NULL),
+ &no_signature),
GNUNET_JSON_spec_end ()
};
@@ -921,7 +924,12 @@ decode_keys_json (const json_t *resp_obj,
ext_spec,
NULL, NULL));
- if (NULL != extensions)
+
+ if (! no_extensions && no_signature)
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "found extensions without signature\n");
+
+ if (! no_extensions && ! no_signature)
{
/* 2. We have an extensions object. Verify its signature. */
EXITIF (GNUNET_OK !=
@@ -936,7 +944,7 @@ decode_keys_json (const json_t *resp_obj,
}
/* 4. assuming we might have now a new value for age_mask, set it in key_data */
- key_data->age_mask = TALER_extensions_age_restriction_ageMask ();
+ key_data->age_mask = TALER_extensions_get_age_restriction_mask ();
}
/**