From e64ec174f28812a18fd35f5d671a03e335380d93 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Tue, 21 Apr 2020 15:45:12 +0200 Subject: rename, fix --- src/revocation/gnunet-revocation.c | 12 ++++++------ src/revocation/gnunet-service-revocation.c | 10 +++++----- src/revocation/plugin_block_revocation.c | 12 ++++++------ src/revocation/revocation_api.c | 16 ++++++++-------- src/revocation/test_revocation.c | 4 ++-- src/revocation/test_revocation.conf | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c index 2230114ae..2c46a20e7 100644 --- a/src/revocation/gnunet-revocation.c +++ b/src/revocation/gnunet-revocation.c @@ -86,7 +86,7 @@ static unsigned long long matching_bits; /** * Epoch length */ -static struct GNUNET_TIME_Relative epoch_length; +static struct GNUNET_TIME_Relative epoch_duration; /** * Task used for proof-of-work calculation. @@ -348,7 +348,7 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego *ego) if (GNUNET_YES == GNUNET_REVOCATION_check_pow (&proof_of_work, (unsigned int) matching_bits, - epoch_length)) + epoch_duration)) { fprintf (stderr, "%s", _ ("Revocation certificate ready\n")); if (perform) @@ -432,12 +432,12 @@ run (void *cls, } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "REVOCATION", - "EPOCH_LENGTH", - &epoch_length)) + "EPOCH_DURATION", + &epoch_duration)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "REVOCATION", - "EPOCH_LENGTH"); + "EPOCH_DURATION"); return; } @@ -470,7 +470,7 @@ run (void *cls, if (GNUNET_YES != GNUNET_REVOCATION_check_pow (&proof_of_work, (unsigned int) matching_bits, - epoch_length)) + epoch_duration)) { struct GNUNET_REVOCATION_PowCalculationHandle *ph; ph = GNUNET_REVOCATION_pow_start (&proof_of_work, diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index a9fbd57a7..3c08e8452 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -131,7 +131,7 @@ static unsigned long long revocation_work_required; /** * Length of an expiration expoch */ -static struct GNUNET_TIME_Relative epoch_length; +static struct GNUNET_TIME_Relative epoch_duration; /** * Our application ID for set union operations. Must be the @@ -174,7 +174,7 @@ verify_revoke_message (const struct RevokeMessage *rm) { if (GNUNET_YES != GNUNET_REVOCATION_check_pow (&rm->proof_of_work, (unsigned int) revocation_work_required, - epoch_length)) + epoch_duration)) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof of work invalid!\n"); @@ -846,12 +846,12 @@ run (void *cls, if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "REVOCATION", - "EPOCH_LENGTH", - &epoch_length)) + "EPOCH_DURATION", + &epoch_duration)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "REVOCATION", - "EPOCH_LENGTH"); + "EPOCH_DURATION"); GNUNET_SCHEDULER_shutdown (); GNUNET_free (fn); return; diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c index f384cfe1d..291c56f70 100644 --- a/src/revocation/plugin_block_revocation.c +++ b/src/revocation/plugin_block_revocation.c @@ -52,7 +52,7 @@ struct InternalContext { unsigned int matching_bits; - struct GNUNET_TIME_Relative epoch_length; + struct GNUNET_TIME_Relative epoch_duration; }; @@ -146,7 +146,7 @@ block_plugin_revocation_evaluate (void *cls, if (0 >= GNUNET_REVOCATION_check_pow (&rm->proof_of_work, ic->matching_bits, - ic->epoch_length)) + ic->epoch_duration)) { GNUNET_break_op (0); return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; @@ -210,7 +210,7 @@ libgnunet_plugin_block_revocation_init (void *cls) struct GNUNET_BLOCK_PluginFunctions *api; struct InternalContext *ic; unsigned long long matching_bits; - struct GNUNET_TIME_Relative epoch_length; + struct GNUNET_TIME_Relative epoch_duration; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, @@ -221,8 +221,8 @@ libgnunet_plugin_block_revocation_init (void *cls) if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "REVOCATION", - "EPOCH_LENGTH", - &epoch_length)) + "EPOCH_DURATION", + &epoch_duration)) return NULL; api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); @@ -232,7 +232,7 @@ libgnunet_plugin_block_revocation_init (void *cls) api->types = types; ic = GNUNET_new (struct InternalContext); ic->matching_bits = (unsigned int) matching_bits; - ic->epoch_length = epoch_length; + ic->epoch_duration = epoch_duration; api->cls = ic; return api; } diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 7bf7799de..bff004698 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c @@ -311,7 +311,7 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_MQ_handler_end () }; unsigned long long matching_bits; - struct GNUNET_TIME_Relative epoch_length; + struct GNUNET_TIME_Relative epoch_duration; struct RevokeMessage *rm; struct GNUNET_MQ_Envelope *env; @@ -328,8 +328,8 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, if ((GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "REVOCATION", - "EPOCH_LENGTH", - &epoch_length))) + "EPOCH_DURATION", + &epoch_duration))) { GNUNET_break (0); GNUNET_free (h); @@ -337,7 +337,7 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, } if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow, (unsigned int) matching_bits, - epoch_length)) + epoch_duration)) { GNUNET_break (0); GNUNET_free (h); @@ -431,7 +431,7 @@ calculate_score (const struct GNUNET_REVOCATION_PowCalculationHandle *ph) enum GNUNET_GenericReturnValue GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, unsigned int difficulty, - struct GNUNET_TIME_Relative epoch_length) + struct GNUNET_TIME_Relative epoch_duration) { char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) + sizeof (struct GNUNET_TIME_AbsoluteNBO) @@ -462,7 +462,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, &pow->signature, &pow->key)) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Proof of work signature invalid!\n"); return GNUNET_NO; } @@ -508,12 +508,12 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, * Check expiration */ ts = GNUNET_TIME_absolute_ntoh (pow->timestamp); - ttl = GNUNET_TIME_relative_multiply (epoch_length, + ttl = GNUNET_TIME_relative_multiply (epoch_duration, epochs); /** * Extend by 10% for unsynchronized clocks */ - buffer = GNUNET_TIME_relative_divide (epoch_length, + buffer = GNUNET_TIME_relative_divide (epoch_duration, 10); exp = GNUNET_TIME_absolute_add (ts, ttl); exp = GNUNET_TIME_absolute_add (exp, diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c index 84f90fe54..a7de15a3f 100644 --- a/src/revocation/test_revocation.c +++ b/src/revocation/test_revocation.c @@ -141,14 +141,14 @@ revocation_cb (void *cls, enum GNUNET_GenericReturnValue is_valid) } } +struct GNUNET_REVOCATION_Pow proof_of_work; + static void ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) { static int completed = 0; const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; - struct GNUNET_REVOCATION_Pow proof_of_work; - if ((NULL != ego) && (cls == &testpeers[0])) { diff --git a/src/revocation/test_revocation.conf b/src/revocation/test_revocation.conf index f195429b4..66e2cdcc9 100644 --- a/src/revocation/test_revocation.conf +++ b/src/revocation/test_revocation.conf @@ -7,7 +7,7 @@ SERVICEHOME=$GNUNET_TMP/test-revocation-service [revocation] WORKBITS = 3 IMMEDIATE_START = YES -EPOCH_LENGTH = 365 d +EPOCH_DURATION = 365 d [identity] # Directory where we store information about our egos -- cgit v1.2.3