[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: theoretically complete truth up
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: theoretically complete truth upload of REDUX API |
Date: |
Fri, 19 Feb 2021 13:01:40 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 3df34e6 theoretically complete truth upload of REDUX API
3df34e6 is described below
commit 3df34e626a36838f56f6e0557ceb5cd8e9dbfa72
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Feb 19 13:01:38 2021 +0100
theoretically complete truth upload of REDUX API
---
src/reducer/anastasis_api_backup_redux.c | 584 ++++++++++++++++++++++---------
1 file changed, 424 insertions(+), 160 deletions(-)
diff --git a/src/reducer/anastasis_api_backup_redux.c
b/src/reducer/anastasis_api_backup_redux.c
index de152ad..be527d2 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -220,21 +220,6 @@ struct SecretShareState
};
-/**
- * Callback function FIXME: Description.
- *
- * @param state FIXME: Description
- * @param arguments FIXME: Description
- * @param cb FIXME: Description
- * @param cb_cls FIXME: Description
- */
-typedef struct ANASTASIS_ReduxAction *
-(*DispatchHandler)(json_t *state,
- const json_t *arguments,
- ANASTASIS_ActionCallback cb,
- void *cb_cls);
-
-
/**
* Update the 'backup_state' field of @a state to @a new_backup_state.
*
@@ -282,7 +267,7 @@ ANASTASIS_backup_start (const struct
GNUNET_CONFIGURATION_Handle *cfg)
*
* @param state state to operate on
* @param arguments arguments with a provider URL to add
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
*/
static struct ANASTASIS_ReduxAction *
@@ -359,7 +344,7 @@ add_provider (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -499,7 +484,7 @@ add_authentication (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -905,7 +890,7 @@ method_candidate (struct PolicyBuilder *pb,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -1021,7 +1006,7 @@ done_authentication (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -1282,7 +1267,7 @@ add_policy (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -1350,7 +1335,7 @@ del_policy (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -2000,7 +1985,7 @@ free_enter_secret (void *cls)
*
* @param state json state to operate on
* @param provider_ids ids of providers to upload recovery document explicitly
to
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
*/
static void
@@ -2378,11 +2363,42 @@ upload (json_t *state,
struct UploadContext;
+/**
+ * Maps a TruthUpload to a policy and recovery method where this
+ * truth is used.
+ */
+struct PolicyMethodReference
+{
+ /**
+ * Offset into the "policies" array.
+ */
+ unsigned int policy_index;
+
+ /**
+ * Offset into the "methods" array (of the policy selected
+ * by @e policy_index).
+ */
+ unsigned int method_index;
+
+};
+
+
/**
* Entry we keep per truth upload.
*/
struct TruthUpload
{
+
+ /**
+ * Kept in a DLL.
+ */
+ struct TruthUpload *next;
+
+ /**
+ * Kept in a DLL.
+ */
+ struct TruthUpload *prev;
+
/**
* Handle to the actual upload operation.
*/
@@ -2410,6 +2426,26 @@ struct TruthUpload
*/
struct ANASTASIS_PaymentSecretP ps;
+ /**
+ * Which policies and methods does this truth affect?
+ */
+ struct PolicyMethodReference *policies;
+
+ /**
+ * Where are we uploading to?
+ */
+ char *provider_url;
+
+ /**
+ * Which challenge object are we uploading?
+ */
+ uint32_t am_idx;
+
+ /**
+ * Length of the @e policies array.
+ */
+ unsigned int policies_length;
+
/**
* Taler error code of the upload.
*/
@@ -2449,14 +2485,14 @@ struct UploadContext
struct ANASTASIS_SecretShare *ss;
/**
- * Array of truth uploads of length @e tues_length. Some entries may be NULL.
+ * Head of DLL of truth uploads.
*/
- struct TruthUpload *tues;
+ struct TruthUpload *tues_head;
/**
- * Length of the @e truth_uploads array.
+ * Tail of DLL of truth uploads.
*/
- unsigned int tues_length;
+ struct TruthUpload *tues_tail;
};
@@ -2470,11 +2506,13 @@ static void
upload_cancel_cb (void *cls)
{
struct UploadContext *uc = cls;
+ struct TruthUpload *tue;
- for (unsigned int i = 0; i<uc->tues_length; i++)
+ while (NULL != (tue = uc->tues_head))
{
- struct TruthUpload *tue = &uc->tues[i];
-
+ GNUNET_CONTAINER_DLL_remove (uc->tues_head,
+ uc->tues_tail,
+ tue);
if (NULL != tue->tu)
{
ANASTASIS_truth_upload_cancel (tue->tu);
@@ -2485,9 +2523,10 @@ upload_cancel_cb (void *cls)
ANASTASIS_truth_free (tue->t);
tue->t = NULL;
}
+ GNUNET_free (tue->provider_url);
GNUNET_free (tue->payment_request);
+ GNUNET_free (tue);
}
- GNUNET_free (uc->tues);
if (NULL != uc->ss)
{
ANASTASIS_secret_share_cancel (uc->ss);
@@ -2523,17 +2562,17 @@ static void
request_truth_payment (struct UploadContext *uc)
{
json_t *payments;
- json_t *auth_methods;
+ json_t *policies;
- auth_methods = json_object_get (uc->state,
- "authentication_methods");
- GNUNET_assert (json_is_array (auth_methods));
+ policies = json_object_get (uc->state,
+ "policies");
+ GNUNET_assert (json_is_array (policies));
payments = json_array ();
GNUNET_assert (NULL != payments);
- for (unsigned int i = 0; i<uc->tues_length; i++)
+ for (struct TruthUpload *tue = uc->tues_head;
+ NULL != tue;
+ tue = tue->next)
{
- struct TruthUpload *tue = &uc->tues[i];
-
if (NULL != tue->payment_request)
{
GNUNET_assert (
@@ -2544,16 +2583,26 @@ request_truth_payment (struct UploadContext *uc)
}
if (NULL != tue->t)
{
- json_t *auth_method = json_array_get (auth_methods,
- i);
- json_t *truth = ANASTASIS_truth_to_json (tue->t);
-
- GNUNET_assert (NULL != auth_method);
- GNUNET_assert (NULL != truth);
- GNUNET_assert (0 ==
- json_object_set_new (auth_method,
- "truth",
- truth));
+ for (unsigned int i = 0; i<tue->policies_length; i++)
+ {
+ const struct PolicyMethodReference *pmr = &tue->policies[i];
+ json_t *policy = json_array_get (policies,
+ pmr->policy_index);
+ json_t *methods = json_object_get (policy,
+ "methods");
+ json_t *auth_method = json_array_get (methods,
+ pmr->method_index);
+ json_t *truth = ANASTASIS_truth_to_json (tue->t);
+
+ GNUNET_assert (NULL != policy);
+ GNUNET_assert (NULL != methods);
+ GNUNET_assert (NULL != auth_method);
+ GNUNET_assert (NULL != truth);
+ GNUNET_assert (0 ==
+ json_object_set_new (auth_method,
+ "truth",
+ truth));
+ }
}
}
GNUNET_assert (0 ==
@@ -2582,10 +2631,10 @@ check_upload_finished (struct UploadContext *uc)
enum TALER_ErrorCode failed = TALER_EC_NONE;
bool active = false;
- for (unsigned int i = 0; i<uc->tues_length; i++)
+ for (struct TruthUpload *tue = uc->tues_head;
+ NULL != tue;
+ tue = tue->next)
{
- struct TruthUpload *tue = &uc->tues[i];
-
if (TALER_EC_NONE != tue->ec)
{
uc->cb (uc->cb_cls,
@@ -2688,6 +2737,214 @@ truth_upload_cb (void *cls,
}
+/**
+ * Check if we still need to create a new truth object for the truth
+ * identified by @a provider_url and @a am_idx. If so, create it from
+ * @a truth for policy reference @a pmr. If such a truth object
+ * already exists, append @a pmr to its list of reasons.
+ *
+ * @param[in,out] our upload context
+ * @param pmr policy method combination that requires the truth
+ * @param provider_url the URL of the Anastasis provider to upload
+ * the truth to, used to check for existing entries
+ * @param am_idx index of the authentication method, used to check for
existing entries
+ * @param[in] truth object representing already uploaded truth, reference
captured!
+ * @return #GNUNET_SYSERR error requiring abort,
+ * #GNUNET_NO if truth uploads remain unchanged (@a pmr was only
appended)
+ * #GNUNET_OK if an existing truth upload was cancelled (!)
+ */
+static int
+add_truth_object (struct UploadContext *uc,
+ const struct PolicyMethodReference *pmr,
+ const char *provider_url,
+ uint32_t am_idx,
+ json_t *truth)
+{
+ /* check if we are already uploading this truth */
+ {
+ for (struct TruthUpload *tue = uc->tues_head;
+ NULL != tue;
+ tue = tue->next)
+ {
+ if ( (0 == strcmp (tue->provider_url,
+ provider_url)) &&
+ (am_idx == tue->am_idx) )
+ {
+ GNUNET_array_append (tue->policies,
+ tue->policies_length,
+ *pmr);
+ if (NULL == tue->t)
+ {
+ if (NULL != tue->tu)
+ {
+ ANASTASIS_truth_upload_cancel (tue->tu);
+ tue->tu = NULL;
+ return GNUNET_OK;
+ }
+ }
+ else
+ {
+ json_decref (truth);
+ }
+ return GNUNET_NO;
+ }
+ }
+ }
+
+ /* Create new entry */
+ {
+ struct TruthUpload *tue = GNUNET_new (struct TruthUpload);
+
+ GNUNET_CONTAINER_DLL_insert (uc->tues_head,
+ uc->tues_tail,
+ tue);
+ tue->t = ANASTASIS_truth_from_json (truth);
+ if (NULL == tue->t)
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ tue->uc = uc;
+ tue->policies = GNUNET_new (struct PolicyMethodReference);
+ *tue->policies = *pmr;
+ tue->provider_url = GNUNET_strdup (provider_url);
+ tue->am_idx = am_idx;
+ tue->policies_length = 1;
+ return GNUNET_NO;
+ }
+}
+
+
+/**
+ * Check if we still need to upload the truth identified by
+ * @a provider_url and @a am_idx. If so, upload it for
+ * policy reference @a pmr. If the upload is already queued,
+ * append @a pmr to its list of reasons.
+ *
+ * @param[in,out] our upload context
+ * @param pmr policy method combination that requires the truth
+ * @param provider_url the URL of the Anastasis provider to upload
+ * the truth to, used to check for existing entries
+ * @param am_idx index of the authentication method, used to check for
existing entries
+ * @param auth_method object with the challenge details, to generate the truth
+ * @return #GNUNET_SYSERR on error requiring abort,
+ * #GNUNET_NO if no new truth upload was generated (@a pmr was
appended)
+ * #GNUNET_OK if a new truth upload was initiated
+ */
+static int
+check_truth_upload (struct UploadContext *uc,
+ const struct PolicyMethodReference *pmr,
+ const char *provider_url,
+ uint32_t am_idx,
+ json_t *auth_method)
+{
+ json_t *user_id;
+
+ user_id = json_object_get (uc->state,
+ "identity_attributes");
+ if (! json_is_object (user_id))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+
+ /* check if we are already uploading this truth */
+ for (struct TruthUpload *tue = uc->tues_head;
+ NULL != tue;
+ tue = tue->next)
+ {
+ if ( (0 == strcmp (tue->provider_url,
+ provider_url)) &&
+ (am_idx == tue->am_idx) )
+ {
+ GNUNET_array_append (tue->policies,
+ tue->policies_length,
+ *pmr);
+ return GNUNET_NO;
+ }
+ }
+
+ /* need new upload */
+ {
+ struct TruthUpload *tue = GNUNET_new (struct TruthUpload);
+ const char *method;
+ const char *payment_request = NULL;
+ const char *mime_type = NULL;
+ const char *instructions = NULL;
+ void *truth_data;
+ size_t truth_data_size;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("method",
+ &method),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("mime_type",
+ &mime_type)),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("instructions",
+ &instructions)),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("payment_request",
+ &payment_request)),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_fixed_auto ("payment_secret",
+ &tue->ps)),
+ GNUNET_JSON_spec_varsize ("challenge",
+ &truth_data,
+ &truth_data_size),
+ GNUNET_JSON_spec_end ()
+ };
+ struct ANASTASIS_CRYPTO_PowSalt salt;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (auth_method,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ if (GNUNET_OK !=
+ lookup_salt (uc->state,
+ provider_url,
+ &salt))
+ {
+ GNUNET_break (0);
+ GNUNET_JSON_parse_free (spec);
+ upload_cancel_cb (uc);
+ return GNUNET_SYSERR;
+ }
+ ANASTASIS_CRYPTO_user_identifier_derive (user_id,
+ &salt,
+ &id);
+ tue->tu = ANASTASIS_truth_upload (ANASTASIS_REDUX_ctx_,
+ &id,
+ provider_url,
+ method,
+ instructions,
+ mime_type,
+ &salt,
+ truth_data,
+ truth_data_size,
+ false, /* FIXME-#6759: support
forced payments */
+ (NULL != payment_request)
+ ? &tue->ps
+ : NULL,
+ &truth_upload_cb,
+ tue);
+ if (NULL == tue->tu)
+ {
+ GNUNET_break (0);
+ GNUNET_JSON_parse_free (spec);
+ upload_cancel_cb (uc);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_JSON_parse_free (spec);
+ return GNUNET_OK;
+ }
+}
+
+
/**
* Function to upload truths and recovery document policies.
* Ultimately transitions to failed state (allowing user to go back
@@ -2705,7 +2962,7 @@ upload (json_t *state,
{
struct UploadContext *uc;
json_t *auth_methods;
- json_t *user_id;
+ json_t *policies;
auth_methods = json_object_get (state,
"authentication_methods");
@@ -2715,17 +2972,18 @@ upload (json_t *state,
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'authentication_methods' must be an array");
+ "'authentication_methods' must be non-empty array");
return NULL;
}
- user_id = json_object_get (state,
- "identity_attributes");
- if (! json_is_object (user_id))
+ policies = json_object_get (state,
+ "policies");
+ if ( (! json_is_array (policies)) ||
+ (0 == json_array_size (policies)) )
{
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'identity_attributes' must be an object");
+ "'policies' must be non-empty array");
return NULL;
}
@@ -2735,127 +2993,118 @@ upload (json_t *state,
uc->cb = cb;
uc->cb_cls = cb_cls;
uc->state = json_incref (state);
- uc->tues_length = json_array_size (auth_methods);
- uc->tues = GNUNET_new_array (uc->tues_length,
- struct TruthUpload);
{
- json_t *auth_method;
- size_t index;
- bool async_truth = false;
+ json_t *policy;
+ size_t pindex;
+ unsigned int async_truth = 0;
- json_array_foreach (auth_methods, index, auth_method)
+ json_array_foreach (policies, pindex, policy)
{
- struct TruthUpload *tue = &uc->tues[index];
- const char *method;
- const char *provider_url;
- const char *payment_request = NULL;
- const char *mime_type = NULL;
- const char *instructions = NULL;
- void *truth_data;
- size_t truth_data_size;
- json_t *truth = NULL;
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_string ("method",
- &method),
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("mime_type",
- &mime_type)),
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("instructions",
- &instructions)),
- GNUNET_JSON_spec_string ("provider_url",
- &provider_url), // FIXME: spec suggests this
is with policy, not auth_method! => check computation above, ensure provider
URL is fixed per truth? OR stay with current spec and allow same truth to be
used with multiple providers!?
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("payment_request",
- &payment_request)),
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_fixed_auto ("payment_secret",
- &tue->ps)),
- GNUNET_JSON_spec_varsize ("challenge",
- &truth_data,
- &truth_data_size),
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_json ("truth",
- &truth)),
- GNUNET_JSON_spec_end ()
- };
- struct ANASTASIS_CRYPTO_PowSalt salt;
+ json_t *methods = json_object_get (policy,
+ "methods");
+ json_t *auth_method;
+ size_t mindex;
- if (GNUNET_OK !=
- GNUNET_JSON_parse (auth_method,
- spec,
- NULL, NULL))
+ if ( (! json_is_array (methods)) ||
+ (0 == json_array_size (policies)) )
{
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'authentication_method' data malformed");
+ "'policies' must be non-empty array");
+ upload_cancel_cb (uc);
return NULL;
}
- if (NULL == truth)
+ json_array_foreach (methods, mindex, auth_method)
{
- struct ANASTASIS_CRYPTO_UserIdentifierP id;
+ uint32_t am_idx;
+ const char *provider_url;
+ json_t *truth = NULL;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("provider",
+ &provider_url),
+ GNUNET_JSON_spec_uint32 ("authentication_method",
+ &am_idx),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_json ("truth",
+ &truth)),
+ GNUNET_JSON_spec_end ()
+ };
if (GNUNET_OK !=
- lookup_salt (state,
- provider_url,
- &salt))
+ GNUNET_JSON_parse (auth_method,
+ spec,
+ NULL, NULL))
{
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "provider salt required");
- GNUNET_JSON_parse_free (spec);
- upload_cancel_cb (uc);
- return NULL;
- }
- ANASTASIS_CRYPTO_user_identifier_derive (user_id,
- &salt,
- &id);
- tue->tu = ANASTASIS_truth_upload (ANASTASIS_REDUX_ctx_,
- &id,
- provider_url,
- method,
- instructions,
- mime_type,
- &salt,
- truth_data,
- truth_data_size,
- false, /* FIXME: support forced
payments */
- (NULL != payment_request)
- ? &tue->ps
- : NULL,
- &truth_upload_cb,
- tue);
- if (NULL == tue->tu)
- {
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_INVALID, // FIXME: needs new EC!
- "failure attempting truth upload");
- GNUNET_JSON_parse_free (spec);
+ "'method' data malformed");
upload_cancel_cb (uc);
return NULL;
}
- async_truth = true;
- }
- else
- {
- tue->t = ANASTASIS_truth_from_json (truth);
- if (NULL == tue->t)
{
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'truth' malformed");
- GNUNET_JSON_parse_free (spec);
- upload_cancel_cb (uc);
- return NULL;
+ struct PolicyMethodReference pmr = {
+ .policy_index = pindex,
+ .method_index = mindex
+ };
+ json_t *amj;
+
+ amj = json_array_get (auth_methods,
+ am_idx);
+ if (NULL == amj)
+ {
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ "'authentication_method' refers to invalid
authorization index malformed");
+ upload_cancel_cb (uc);
+ return NULL;
+ }
+ if (NULL == truth)
+ {
+ int ret;
+
+ ret = check_truth_upload (uc,
+ &pmr,
+ provider_url,
+ am_idx,
+ amj);
+ if (GNUNET_SYSERR == ret)
+ {
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ NULL);
+ return NULL;
+ }
+ if (GNUNET_OK == ret)
+ async_truth++;
+ }
+ else
+ {
+ int ret;
+
+ ret = add_truth_object (uc,
+ &pmr,
+ provider_url,
+ am_idx,
+ truth);
+ if (GNUNET_SYSERR == ret)
+ {
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ NULL);
+ return NULL;
+ }
+ if (GNUNET_OK == ret)
+ async_truth--;
+ }
}
- }
- GNUNET_JSON_parse_free (spec);
- }
- if (async_truth)
+ } /* end for all methods of policy */
+ } /* end for all policies */
+ if (async_truth > 0)
return &uc->ra;
}
share_secret (uc);
@@ -2872,7 +3121,7 @@ upload (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
*/
static struct ANASTASIS_ReduxAction *
@@ -2927,7 +3176,7 @@ enter_secret (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
*/
static struct ANASTASIS_ReduxAction *
@@ -2949,7 +3198,7 @@ pay_truths_backup (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
*/
static struct ANASTASIS_ReduxAction *
@@ -2970,7 +3219,7 @@ pay_policies_backup (json_t *state,
*
* @param state state to operate on
* @param arguments arguments to use for operation on state
- * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb callback to call during/after operation
* @param cb_cls callback closure
* @return NULL
*/
@@ -2989,6 +3238,21 @@ back_finished (json_t *state,
}
+/**
+ * Signature of callback function that implements a state transition.
+ *
+ * @param state current state
+ * @param arguments arguments for the state transition
+ * @param cb function to call when done
+ * @param cb_cls closure for @a cb
+ */
+typedef struct ANASTASIS_ReduxAction *
+(*DispatchHandler)(json_t *state,
+ const json_t *arguments,
+ ANASTASIS_ActionCallback cb,
+ void *cb_cls);
+
+
/**
* Operates on a backup state depending on given #ANASTASIS_BackupState
* and #ANASTASIS_BackupAction. The new #ANASTASIS_BackupState is returned
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: theoretically complete truth upload of REDUX API,
gnunet <=