diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-29 15:08:04 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-29 15:08:04 +0200 |
commit | 1eade92340968378afc390379b86590f335cb814 (patch) | |
tree | f994fb61ceaf00f7403488d14ceb3f809d558aca /src/revocation | |
parent | b21cab7cb9da43009df76acdb779f7c89a003378 (diff) | |
download | gnunet-1eade92340968378afc390379b86590f335cb814.tar.gz gnunet-1eade92340968378afc390379b86590f335cb814.zip |
fix comments, struct naming; version
Diffstat (limited to 'src/revocation')
-rw-r--r-- | src/revocation/gnunet-revocation.c | 10 | ||||
-rw-r--r-- | src/revocation/revocation.h | 2 | ||||
-rw-r--r-- | src/revocation/revocation_api.c | 14 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c index 8b7cf33c6..1edd98f0e 100644 --- a/src/revocation/gnunet-revocation.c +++ b/src/revocation/gnunet-revocation.c | |||
@@ -101,7 +101,7 @@ static struct GNUNET_SCHEDULER_Task *pow_task; | |||
101 | /** | 101 | /** |
102 | * Proof-of-work object | 102 | * Proof-of-work object |
103 | */ | 103 | */ |
104 | static struct GNUNET_REVOCATION_Pow proof_of_work; | 104 | static struct GNUNET_REVOCATION_PowP proof_of_work; |
105 | 105 | ||
106 | /** | 106 | /** |
107 | * Function run if the user aborts with CTRL-C. | 107 | * Function run if the user aborts with CTRL-C. |
@@ -229,10 +229,10 @@ static void | |||
229 | sync_pow () | 229 | sync_pow () |
230 | { | 230 | { |
231 | if ((NULL != filename) && | 231 | if ((NULL != filename) && |
232 | (sizeof(struct GNUNET_REVOCATION_Pow) != | 232 | (sizeof(struct GNUNET_REVOCATION_PowP) != |
233 | GNUNET_DISK_fn_write (filename, | 233 | GNUNET_DISK_fn_write (filename, |
234 | &proof_of_work, | 234 | &proof_of_work, |
235 | sizeof(struct GNUNET_REVOCATION_Pow), | 235 | sizeof(struct GNUNET_REVOCATION_PowP), |
236 | GNUNET_DISK_PERM_USER_READ | 236 | GNUNET_DISK_PERM_USER_READ |
237 | | GNUNET_DISK_PERM_USER_WRITE))) | 237 | | GNUNET_DISK_PERM_USER_WRITE))) |
238 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename); | 238 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename); |
@@ -278,10 +278,10 @@ calculate_pow (void *cls) | |||
278 | if (GNUNET_OK == GNUNET_REVOCATION_pow_round (ph)) | 278 | if (GNUNET_OK == GNUNET_REVOCATION_pow_round (ph)) |
279 | { | 279 | { |
280 | if ((NULL != filename) && | 280 | if ((NULL != filename) && |
281 | (sizeof(struct GNUNET_REVOCATION_Pow) != | 281 | (sizeof(struct GNUNET_REVOCATION_PowP) != |
282 | GNUNET_DISK_fn_write (filename, | 282 | GNUNET_DISK_fn_write (filename, |
283 | &proof_of_work, | 283 | &proof_of_work, |
284 | sizeof(struct GNUNET_REVOCATION_Pow), | 284 | sizeof(struct GNUNET_REVOCATION_PowP), |
285 | GNUNET_DISK_PERM_USER_READ | 285 | GNUNET_DISK_PERM_USER_READ |
286 | | GNUNET_DISK_PERM_USER_WRITE))) | 286 | | GNUNET_DISK_PERM_USER_WRITE))) |
287 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename); | 287 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename); |
diff --git a/src/revocation/revocation.h b/src/revocation/revocation.h index 868c2b853..635c56cfc 100644 --- a/src/revocation/revocation.h +++ b/src/revocation/revocation.h | |||
@@ -92,7 +92,7 @@ struct RevokeMessage | |||
92 | /** | 92 | /** |
93 | * Number that causes a hash collision with the @e public_key. | 93 | * Number that causes a hash collision with the @e public_key. |
94 | */ | 94 | */ |
95 | struct GNUNET_REVOCATION_Pow proof_of_work; | 95 | struct GNUNET_REVOCATION_PowP proof_of_work; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | 98 | ||
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 18a312ab8..12cb63c57 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c | |||
@@ -83,7 +83,7 @@ struct GNUNET_REVOCATION_PowCalculationHandle | |||
83 | /** | 83 | /** |
84 | * The final PoW result data structure. | 84 | * The final PoW result data structure. |
85 | */ | 85 | */ |
86 | struct GNUNET_REVOCATION_Pow *pow; | 86 | struct GNUNET_REVOCATION_PowP *pow; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * The current nonce to try | 89 | * The current nonce to try |
@@ -297,7 +297,7 @@ handle_revocation_response (void *cls, | |||
297 | */ | 297 | */ |
298 | struct GNUNET_REVOCATION_Handle * | 298 | struct GNUNET_REVOCATION_Handle * |
299 | GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, | 299 | GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, |
300 | const struct GNUNET_REVOCATION_Pow *pow, | 300 | const struct GNUNET_REVOCATION_PowP *pow, |
301 | GNUNET_REVOCATION_Callback func, | 301 | GNUNET_REVOCATION_Callback func, |
302 | void *func_cls) | 302 | void *func_cls) |
303 | { | 303 | { |
@@ -428,14 +428,14 @@ calculate_score (const struct GNUNET_REVOCATION_PowCalculationHandle *ph) | |||
428 | * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not | 428 | * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not |
429 | */ | 429 | */ |
430 | enum GNUNET_GenericReturnValue | 430 | enum GNUNET_GenericReturnValue |
431 | GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, | 431 | GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, |
432 | unsigned int difficulty, | 432 | unsigned int difficulty, |
433 | struct GNUNET_TIME_Relative epoch_duration) | 433 | struct GNUNET_TIME_Relative epoch_duration) |
434 | { | 434 | { |
435 | char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) | 435 | char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) |
436 | + sizeof (struct GNUNET_TIME_AbsoluteNBO) | 436 | + sizeof (struct GNUNET_TIME_AbsoluteNBO) |
437 | + sizeof (uint64_t)] GNUNET_ALIGN; | 437 | + sizeof (uint64_t)] GNUNET_ALIGN; |
438 | struct GNUNET_REVOCATION_SignaturePurpose spurp; | 438 | struct GNUNET_REVOCATION_SignaturePurposePS spurp; |
439 | struct GNUNET_HashCode result; | 439 | struct GNUNET_HashCode result; |
440 | struct GNUNET_TIME_Absolute ts; | 440 | struct GNUNET_TIME_Absolute ts; |
441 | struct GNUNET_TIME_Absolute exp; | 441 | struct GNUNET_TIME_Absolute exp; |
@@ -538,10 +538,10 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, | |||
538 | */ | 538 | */ |
539 | void | 539 | void |
540 | GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 540 | GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
541 | struct GNUNET_REVOCATION_Pow *pow) | 541 | struct GNUNET_REVOCATION_PowP *pow) |
542 | { | 542 | { |
543 | struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get (); | 543 | struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get (); |
544 | struct GNUNET_REVOCATION_SignaturePurpose rp; | 544 | struct GNUNET_REVOCATION_SignaturePurposePS rp; |
545 | 545 | ||
546 | /** | 546 | /** |
547 | * Predate the validity period to prevent rejections due to | 547 | * Predate the validity period to prevent rejections due to |
@@ -575,7 +575,7 @@ GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
575 | * @return a handle for use in PoW rounds | 575 | * @return a handle for use in PoW rounds |
576 | */ | 576 | */ |
577 | struct GNUNET_REVOCATION_PowCalculationHandle* | 577 | struct GNUNET_REVOCATION_PowCalculationHandle* |
578 | GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_Pow *pow, | 578 | GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow, |
579 | int epochs, | 579 | int epochs, |
580 | unsigned int difficulty) | 580 | unsigned int difficulty) |
581 | { | 581 | { |