Narf, letzter commit war unvollständig durch uncrustify
Towards a complete test with age restriction - substantial amount of fixes in various parts - slight refactoring of extensions - fixes of post handler for /management/extensions - fixes for offline tool extensions signing State: - compiles, runs and tests succeed when age restriction is not enabled - compiles, runs and tests fail, when age restriction is enabled
This commit is contained in:
parent
932dcde25c
commit
1090389d6f
@ -740,7 +740,7 @@ handle_post_management (struct TEH_RequestContext *rc,
|
||||
"extensions"))
|
||||
{
|
||||
return TEH_handler_management_post_extensions (rc->connection,
|
||||
root);
|
||||
root);
|
||||
}
|
||||
GNUNET_break_op (0);
|
||||
return r404 (rc->connection,
|
||||
|
@ -1859,7 +1859,7 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
|
||||
struct GNUNET_CONTAINER_Heap *heap;
|
||||
struct GNUNET_HashContext *hash_context;
|
||||
bool age_restriction_active =
|
||||
TALER_extensions_is_enabled_type (TALER_Extension_AgeRestriction);
|
||||
TALER_extensions_is_enabled_type (TALER_Extension_AgeRestriction);
|
||||
|
||||
sctx.signkeys = json_array ();
|
||||
GNUNET_assert (NULL != sctx.signkeys);
|
||||
@ -1976,10 +1976,13 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
|
||||
* depending on the settings and the properties of the denomination */
|
||||
if (age_restriction_active &&
|
||||
(0 != dk->denom_pub.age_mask.mask))
|
||||
{
|
||||
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "got agerestricted denom %p with mask %d\n", &dk->denom_pub, dk->denom_pub.age_mask.mask);
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||
"got agerestricted denom %p with mask %d\n",
|
||||
&dk->denom_pub,
|
||||
dk->denom_pub.age_mask.mask);
|
||||
array = age_restricted_denoms;
|
||||
}
|
||||
}
|
||||
else
|
||||
array = denoms;
|
||||
|
||||
|
@ -91,7 +91,7 @@ set_extensions (void *cls,
|
||||
return GNUNET_DB_STATUS_HARD_ERROR;
|
||||
}
|
||||
|
||||
GNUNET_assert(NULL != ext->config);
|
||||
GNUNET_assert (NULL != ext->config);
|
||||
|
||||
config = json_dumps (ext->config, JSON_COMPACT | JSON_SORT_KEYS);
|
||||
if (NULL == config)
|
||||
@ -142,7 +142,6 @@ set_extensions (void *cls,
|
||||
}
|
||||
|
||||
|
||||
|
||||
static enum GNUNET_GenericReturnValue
|
||||
verify_extensions_from_json (
|
||||
json_t *extensions,
|
||||
@ -150,7 +149,7 @@ verify_extensions_from_json (
|
||||
{
|
||||
const char*name;
|
||||
const struct TALER_Extension *extension;
|
||||
size_t i=0;
|
||||
size_t i = 0;
|
||||
json_t *blob;
|
||||
|
||||
GNUNET_assert (NULL != extensions);
|
||||
@ -158,12 +157,12 @@ verify_extensions_from_json (
|
||||
|
||||
sec->num_extensions = json_object_size (extensions);
|
||||
sec->extensions = GNUNET_new_array (sec->num_extensions,
|
||||
struct Extension);
|
||||
struct Extension);
|
||||
|
||||
json_object_foreach (extensions, name, blob)
|
||||
{
|
||||
int critical = 0;
|
||||
json_t *config;
|
||||
json_t *config;
|
||||
const char *version = NULL;
|
||||
|
||||
/* load and verify criticality, version, etc. */
|
||||
@ -260,7 +259,7 @@ TEH_handler_management_post_extensions (
|
||||
|
||||
/* Now parse individual extensions and signatures from those objects. */
|
||||
if (GNUNET_OK !=
|
||||
verify_extensions_from_json (extensions, &sec))
|
||||
verify_extensions_from_json (extensions, &sec))
|
||||
{
|
||||
GNUNET_JSON_parse_free (top_spec);
|
||||
return TALER_MHD_reply_with_error (
|
||||
|
@ -658,4 +658,5 @@ TALER_JSON_spec_i18n_str (const char *name,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of json/json_helper.c */
|
||||
|
@ -988,7 +988,7 @@ run (void *cls,
|
||||
MHD_HTTP_NO_CONTENT,
|
||||
false),
|
||||
TALER_TESTING_cmd_exec_offline_sign_extensions ("offline-sign-extensions",
|
||||
CONFIG_FILE),
|
||||
CONFIG_FILE),
|
||||
TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys",
|
||||
CONFIG_FILE),
|
||||
TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees",
|
||||
|
@ -72,7 +72,7 @@ extensionssign_run (void *cls,
|
||||
"-L", "INFO",
|
||||
"extensions",
|
||||
"sign",
|
||||
"upload",
|
||||
"upload",
|
||||
NULL);
|
||||
if (NULL == ks->extensionssign_proc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user