summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-09-02 12:59:54 +0200
committerjospaeth <spaethj@in.tum.de>2020-09-02 12:59:54 +0200
commitdb702fdd245d35599d873f5de33ba886256295a6 (patch)
treed1d333d7798a47e2e0fff902b3dfc3aa98eabdcf
parenta5770a6b2c43b49e35482115a04d638dacfaa929 (diff)
rename escrowAnchor to anchor
-rw-r--r--src/escrow/escrow.h2
-rw-r--r--src/escrow/escrow_api.c20
-rw-r--r--src/escrow/gnunet-escrow.c6
-rw-r--r--src/escrow/plugin_escrow_anastasis.c6
-rw-r--r--src/escrow/plugin_escrow_gns.c28
-rw-r--r--src/escrow/plugin_escrow_plaintext.c14
-rw-r--r--src/include/gnunet_escrow_lib.h12
-rw-r--r--src/include/gnunet_escrow_plugin.h4
8 files changed, 46 insertions, 46 deletions
diff --git a/src/escrow/escrow.h b/src/escrow/escrow.h
index cf3660e03..1f5257970 100644
--- a/src/escrow/escrow.h
+++ b/src/escrow/escrow.h
@@ -169,7 +169,7 @@ struct ESCROW_Plugin_AnchorContinuationWrapper
/**
* The escrow anchor
*/
- struct GNUNET_ESCROW_Anchor *escrowAnchor;
+ struct GNUNET_ESCROW_Anchor *anchor;
/**
* The unique ID of the respective ESCROW_Operation
diff --git a/src/escrow/escrow_api.c b/src/escrow/escrow_api.c
index 5bd615c2d..4b3f5e68d 100644
--- a/src/escrow/escrow_api.c
+++ b/src/escrow/escrow_api.c
@@ -245,7 +245,7 @@ handle_start_escrow_result (void *cls)
}
GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op);
if (NULL != op->cb_put)
- op->cb_put (op->cb_cls, w->escrowAnchor, w->emsg);
+ op->cb_put (op->cb_cls, w->anchor, w->emsg);
GNUNET_free (op);
}
@@ -378,7 +378,7 @@ handle_verify_escrow_result (void *cls)
*
* @param h the handle for the escrow component
* @param ego the identity ego that was put into escrow
- * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method
+ * @param anchor the escrow anchor returned by the GNUNET_ESCROW_put method
* @param method the escrow method to use
* @param cb function to call with the verification result on completion
* @param cb_cls closure for @a cb
@@ -388,7 +388,7 @@ handle_verify_escrow_result (void *cls)
struct GNUNET_ESCROW_Operation *
GNUNET_ESCROW_verify (struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
enum GNUNET_ESCROW_Key_Escrow_Method method,
GNUNET_ESCROW_VerifyContinuation cb,
void *cb_cls)
@@ -405,7 +405,7 @@ GNUNET_ESCROW_verify (struct GNUNET_ESCROW_Handle *h,
GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
api = init_plugin (h, method);
- op->plugin_op_wrap = api->verify_key_escrow (h, ego, escrowAnchor, &handle_verify_escrow_result, op->id);
+ op->plugin_op_wrap = api->verify_key_escrow (h, ego, anchor, &handle_verify_escrow_result, op->id);
return op;
}
@@ -511,23 +511,23 @@ GNUNET_ESCROW_anchor_string_to_data (const char *anchorString)
/**
* Serialize an escrow anchor (struct GNUNET_ESCROW_Anchor) into a string
*
- * @param escrowAnchor the escrow anchor struct
+ * @param anchor the escrow anchor struct
*
* @return the encoded escrow anchor string
*/
char *
-GNUNET_ESCROW_anchor_data_to_string (const struct GNUNET_ESCROW_Anchor *escrowAnchor)
+GNUNET_ESCROW_anchor_data_to_string (const struct GNUNET_ESCROW_Anchor *anchor)
{
char *anchorString, *ptr;
const char *methodString, *egoNameString, *anchorData;
char *methodStringEnc, *egoNameStringEnc, *anchorDataEnc;
- methodString = GNUNET_ESCROW_method_number_to_string (escrowAnchor->method);
+ methodString = GNUNET_ESCROW_method_number_to_string (anchor->method);
GNUNET_STRINGS_urlencode (methodString, strlen (methodString), &methodStringEnc);
- egoNameString = escrowAnchor->egoName;
+ egoNameString = anchor->egoName;
GNUNET_STRINGS_urlencode (egoNameString, strlen (egoNameString), &egoNameStringEnc);
- anchorData = (const char *)&escrowAnchor[1];
- GNUNET_STRINGS_urlencode (anchorData, escrowAnchor->size, &anchorDataEnc);
+ anchorData = (const char *)&anchor[1];
+ GNUNET_STRINGS_urlencode (anchorData, anchor->size, &anchorDataEnc);
anchorString = GNUNET_malloc (strlen (methodStringEnc) + 1
+ strlen (egoNameStringEnc) + 1
diff --git a/src/escrow/gnunet-escrow.c b/src/escrow/gnunet-escrow.c
index e66c43046..36728f949 100644
--- a/src/escrow/gnunet-escrow.c
+++ b/src/escrow/gnunet-escrow.c
@@ -194,14 +194,14 @@ do_cleanup (void *cls)
static void
put_cb (void *cls,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
const char *emsg)
{
char *anchorString;
escrow_op = NULL;
- if (NULL == escrowAnchor)
+ if (NULL == anchor)
{
ret = 1;
if (NULL != emsg)
@@ -209,7 +209,7 @@ put_cb (void *cls,
}
else
{
- anchorString = GNUNET_ESCROW_anchor_data_to_string (escrowAnchor);
+ anchorString = GNUNET_ESCROW_anchor_data_to_string (anchor);
fprintf (stdout, "Escrow finished! Please keep the following anchor "
"in order to restore the key later!\n%s\n", anchorString);
diff --git a/src/escrow/plugin_escrow_anastasis.c b/src/escrow/plugin_escrow_anastasis.c
index 0c96d8d8d..68be45867 100644
--- a/src/escrow/plugin_escrow_anastasis.c
+++ b/src/escrow/plugin_escrow_anastasis.c
@@ -67,7 +67,7 @@ start_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h,
w->op_id = op_id;
// TODO: implement
- w->escrowAnchor = NULL;
+ w->anchor = NULL;
w->emsg = _ ("Anastasis escrow is not yet implemented!\n");
GNUNET_SCHEDULER_add_now (cb, w);
return NULL;
@@ -79,7 +79,7 @@ start_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h,
*
* @param h the handle for the escrow component
* @param ego the identity ego containing the private key
- * @param escrowAnchor the escrow anchor needed to restore the key
+ * @param anchor the escrow anchor needed to restore the key
* @param cb the function called upon completion
* @param op_id unique ID of the respective ESCROW_Operation
*
@@ -88,7 +88,7 @@ start_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h,
struct ESCROW_PluginOperationWrapper *
verify_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
GNUNET_SCHEDULER_TaskCallback cb,
uint32_t op_id)
{
diff --git a/src/escrow/plugin_escrow_gns.c b/src/escrow/plugin_escrow_gns.c
index a3a3cc81b..16dc95bea 100644
--- a/src/escrow/plugin_escrow_gns.c
+++ b/src/escrow/plugin_escrow_gns.c
@@ -532,7 +532,7 @@ keyshare_distribution_finished (void *cls)
anchor->size = anchorDataSize;
GNUNET_memcpy (&anchor[1], p_op->userSecret, anchorDataSize);
- p_op->anchor_wrap->escrowAnchor = anchor;
+ p_op->anchor_wrap->anchor = anchor;
/* set the last escrow time */
ESCROW_update_escrow_status (p_op->h, p_op->ego, "gns");
@@ -566,7 +566,7 @@ keyshare_distributed (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to store keyshare %s\n",
emsg);
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->anchor_wrap->emsg = _ ("Keyshare distribution failed!\n");
p_op->cont (p_op->anchor_wrap);
// this also cancels all running namestore operations
@@ -662,7 +662,7 @@ escrow_ids_finished (struct ESCROW_PluginOperationWrapper *plugin_op_wrap)
keyshares = split_private_key (p_op);
if (NULL == keyshares)
{
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->anchor_wrap->emsg = _ ("Failed to split the key!\n");
start_cont (plugin_op_wrap);
return;
@@ -671,7 +671,7 @@ escrow_ids_finished (struct ESCROW_PluginOperationWrapper *plugin_op_wrap)
/* distribute the shares to the identities */
if (GNUNET_OK != distribute_keyshares (plugin_op_wrap, keyshares))
{
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->anchor_wrap->emsg = _ ("Failed to distribute the keyshares!\n");
start_cont (plugin_op_wrap);
return;
@@ -708,7 +708,7 @@ escrow_id_created (void *cls,
}
else
p_op->anchor_wrap->emsg = _ ("Failed to create ego!\n");
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->cont (p_op->anchor_wrap);
// this also cancels all running identity operations
cleanup_plugin_operation (plugin_op_wrap);
@@ -851,7 +851,7 @@ handle_existing_wrong_ego_deletion (void *cls,
"Identity create operation returned with error: %s\n",
emsg);
p_op->anchor_wrap->emsg = _ ("Identity delete of wrong existing ego failed!\n");
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->cont (p_op->anchor_wrap);
// this also cancels all running identity operations
cleanup_plugin_operation (plugin_op_wrap);
@@ -960,7 +960,7 @@ handle_config_load_error (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
if (NULL != p_op->anchor_wrap)
{
- p_op->anchor_wrap->escrowAnchor = NULL;
+ p_op->anchor_wrap->anchor = NULL;
p_op->anchor_wrap->emsg = emsg;
p_op->sched_task = GNUNET_SCHEDULER_add_now (&start_cont, plugin_op_wrap);
return;
@@ -1090,7 +1090,7 @@ start_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
if (NULL == ego || NULL == userSecret)
{
- w->escrowAnchor = NULL;
+ w->anchor = NULL;
if (NULL == ego)
w->emsg = _ ("ESCROW_put was called with ego == NULL\n");
else if (NULL == userSecret)
@@ -1320,7 +1320,7 @@ get_user_secret_from_anchor (const struct GNUNET_ESCROW_Anchor *anchor)
static void
restore_private_key (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
- struct GNUNET_ESCROW_Anchor *escrowAnchor, // TODO: use escrowAnchor??
+ struct GNUNET_ESCROW_Anchor *anchor, // TODO: use anchor??
PkContinuation cont,
void *cont_cls)
{
@@ -1427,7 +1427,7 @@ verify_restored_pk (void *cls,
*
* @param h the handle for the escrow component
* @param ego the identity ego containing the private key
- * @param escrowAnchor the escrow anchor needed to restore the key
+ * @param anchor the escrow anchor needed to restore the key
* @param cb the function called upon completion
* @param op_id unique ID of the respective ESCROW_Operation
*
@@ -1436,7 +1436,7 @@ verify_restored_pk (void *cls,
struct ESCROW_PluginOperationWrapper *
verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
GNUNET_SCHEDULER_TaskCallback cb,
uint32_t op_id)
{
@@ -1456,7 +1456,7 @@ verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
p_op->cont = cb;
p_op->ego = ego;
p_op->egoName = GNUNET_strdup (ego->name);
- p_op->userSecret = get_user_secret_from_anchor (escrowAnchor);
+ p_op->userSecret = get_user_secret_from_anchor (anchor);
w = GNUNET_new (struct ESCROW_Plugin_VerifyContinuationWrapper);
w->h = h;
@@ -1470,7 +1470,7 @@ verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
p_op->sched_task = GNUNET_SCHEDULER_add_now (&verify_cont, plugin_op_wrap);
return plugin_op_wrap;
}
- if (0 != strcmp (ego->name, escrowAnchor->egoName))
+ if (0 != strcmp (ego->name, anchor->egoName))
{
w->verificationResult = GNUNET_ESCROW_INVALID;
w->emsg = _ ("This anchor was not created when putting ego that in escrow!\n");
@@ -1483,7 +1483,7 @@ verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
return plugin_op_wrap;
restore_private_key (plugin_op_wrap,
- escrowAnchor,
+ anchor,
&verify_restored_pk,
plugin_op_wrap);
diff --git a/src/escrow/plugin_escrow_plaintext.c b/src/escrow/plugin_escrow_plaintext.c
index b26653667..f629ac452 100644
--- a/src/escrow/plugin_escrow_plaintext.c
+++ b/src/escrow/plugin_escrow_plaintext.c
@@ -171,7 +171,7 @@ start_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h,
if (NULL == ego)
{
- w->escrowAnchor = NULL;
+ w->anchor = NULL;
w->emsg = _ ("ESCROW_put was called with ego == NULL!\n");
p_op->sched_task = GNUNET_SCHEDULER_add_now (&start_cont, plugin_op_wrap);
return plugin_op_wrap;
@@ -186,7 +186,7 @@ start_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h,
anchor->size = anchorDataSize;
GNUNET_memcpy (&anchor[1], pkString, anchorDataSize);
- w->escrowAnchor = anchor;
+ w->anchor = anchor;
/* set the last escrow time */
ESCROW_update_escrow_status (h, ego, "plaintext");
@@ -214,7 +214,7 @@ verify_cont (void *cls)
*
* @param h the handle for the escrow component
* @param ego the identity ego containing the private key
- * @param escrowAnchor the escrow anchor needed to restore the key
+ * @param anchor the escrow anchor needed to restore the key
* @param cb the function called upon completion
* @param op_id unique ID of the respective ESCROW_Operation
*
@@ -223,7 +223,7 @@ verify_cont (void *cls)
struct ESCROW_PluginOperationWrapper *
verify_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
ESCROW_Plugin_Continuation cb,
uint32_t op_id)
{
@@ -257,7 +257,7 @@ verify_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h,
p_op->sched_task = GNUNET_SCHEDULER_add_now (&verify_cont, plugin_op_wrap);
return plugin_op_wrap;
}
- if (0 != strcmp (ego->name, escrowAnchor->egoName))
+ if (0 != strcmp (ego->name, anchor->egoName))
{
w->verificationResult = GNUNET_ESCROW_INVALID;
w->emsg = _ ("This anchor was not created when putting ego that in escrow!\n");
@@ -267,8 +267,8 @@ verify_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h,
pk = GNUNET_IDENTITY_ego_get_private_key (ego);
pkString = GNUNET_CRYPTO_ecdsa_private_key_to_string (pk);
verificationResult = strncmp (pkString,
- (char *)&escrowAnchor[1],
- escrowAnchor->size) == 0 ?
+ (char *)&anchor[1],
+ anchor->size) == 0 ?
GNUNET_ESCROW_VALID : GNUNET_ESCROW_INVALID;
w->verificationResult = verificationResult;
diff --git a/src/include/gnunet_escrow_lib.h b/src/include/gnunet_escrow_lib.h
index 56bd56032..3d3e39664 100644
--- a/src/include/gnunet_escrow_lib.h
+++ b/src/include/gnunet_escrow_lib.h
@@ -125,12 +125,12 @@ typedef void (*GNUNET_ESCROW_EgoCreateContinuation) (
* Continuation for PUT operations.
*
* @param cls closure
- * @param escrowAnchor the escrow anchor needed to get the data back
+ * @param anchor the escrow anchor needed to get the data back
* @param emsg error message, NULL on success
*/
typedef void (*GNUNET_ESCROW_AnchorContinuation) (
void *cls,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
const char *emsg);
/**
@@ -331,7 +331,7 @@ GNUNET_ESCROW_get (
*
* @param h the handle for the escrow component
* @param ego the identity ego that was put into escrow
- * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method
+ * @param anchor the escrow anchor returned by the GNUNET_ESCROW_put method
* @param method the escrow method to use
* @param cb function to call with the verification result on completion
* @param cb_cls closure for @a cb
@@ -342,7 +342,7 @@ struct GNUNET_ESCROW_Operation *
GNUNET_ESCROW_verify (
struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
enum GNUNET_ESCROW_Key_Escrow_Method method,
GNUNET_ESCROW_VerifyContinuation cb,
void *cb_cls);
@@ -386,13 +386,13 @@ GNUNET_ESCROW_anchor_string_to_data (
/**
* Serialize an escrow anchor (struct GNUNET_ESCROW_Anchor) into a string
*
- * @param escrowAnchor the escrow anchor struct
+ * @param anchor the escrow anchor struct
*
* @return the encoded escrow anchor string
*/
char *
GNUNET_ESCROW_anchor_data_to_string (
- const struct GNUNET_ESCROW_Anchor *escrowAnchor);
+ const struct GNUNET_ESCROW_Anchor *anchor);
/**
diff --git a/src/include/gnunet_escrow_plugin.h b/src/include/gnunet_escrow_plugin.h
index dbdf6dce6..3095d3616 100644
--- a/src/include/gnunet_escrow_plugin.h
+++ b/src/include/gnunet_escrow_plugin.h
@@ -68,7 +68,7 @@ typedef struct ESCROW_PluginOperationWrapper *(*GNUNET_ESCROW_StartKeyEscrowFunc
*
* @param h the handle for the escrow component
* @param ego the identity ego containing the private key
- * @param escrowAnchor the escrow anchor needed to restore the key
+ * @param anchor the escrow anchor needed to restore the key
* @param cb the function called upon completion
* @param op_id unique ID of the respective ESCROW_Operation
*
@@ -77,7 +77,7 @@ typedef struct ESCROW_PluginOperationWrapper *(*GNUNET_ESCROW_StartKeyEscrowFunc
typedef struct ESCROW_PluginOperationWrapper *(*GNUNET_ESCROW_VerifyKeyEscrowFunction) (
struct GNUNET_ESCROW_Handle *h,
struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_ESCROW_Anchor *escrowAnchor,
+ struct GNUNET_ESCROW_Anchor *anchor,
GNUNET_SCHEDULER_TaskCallback cb,
uint32_t op_id);