[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 19/31: check signature in check_pow
From: |
gnunet |
Subject: |
[gnunet] 19/31: check signature in check_pow |
Date: |
Wed, 22 Apr 2020 21:53:10 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 424cd50ecd0144b264a547fe149839cf2866c21f
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Mon Apr 20 18:33:43 2020 +0200
check signature in check_pow
---
src/revocation/plugin_block_revocation.c | 9 ---------
src/revocation/revocation_api.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/revocation/plugin_block_revocation.c
b/src/revocation/plugin_block_revocation.c
index 934c8d8c9..7c1ec26eb 100644
--- a/src/revocation/plugin_block_revocation.c
+++ b/src/revocation/plugin_block_revocation.c
@@ -149,15 +149,6 @@ block_plugin_revocation_evaluate (void *cls,
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
- &rm->proof_of_work.purpose,
- &rm->proof_of_work.signature,
- &rm->proof_of_work.key))
- {
- GNUNET_break_op (0);
- return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
- }
GNUNET_CRYPTO_hash (&rm->proof_of_work.key,
sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
&chash);
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 771bcb92d..2979e7400 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -423,6 +423,20 @@ GNUNET_REVOCATION_check_pow (const struct
GNUNET_REVOCATION_Pow *pow,
unsigned int epochs;
uint64_t pow_val;
+ /**
+ * Check if signature valid
+ */
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
+ &pow->purpose,
+ &pow->signature,
+ &pow->key))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Proof of work signature invalid!\n");
+ return -1;
+ }
+
/**
* First, check if any duplicates are in the PoW set
*/
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] 07/31: towards more expirations, (continued)
- [gnunet] 07/31: towards more expirations, gnunet, 2020/04/22
- [gnunet] 05/31: revert, gnunet, 2020/04/22
- [gnunet] 06/31: simplify pow even more; add timestamp to revocation pow, gnunet, 2020/04/22
- [gnunet] 09/31: no diplicate nonces, gnunet, 2020/04/22
- [gnunet] 11/31: uncrustify, gnunet, 2020/04/22
- [gnunet] 12/31: those are actually debug messages, gnunet, 2020/04/22
- [gnunet] 13/31: more comments, allow to pick up pow later, gnunet, 2020/04/22
- [gnunet] 18/31: fix, gnunet, 2020/04/22
- [gnunet] 10/31: some comments, gnunet, 2020/04/22
- [gnunet] 25/31: packed makes no sense there, gnunet, 2020/04/22
- [gnunet] 19/31: check signature in check_pow,
gnunet <=
- [gnunet] 14/31: evaluate epochs, gnunet, 2020/04/22
- [gnunet] 24/31: remove pow_get, gnunet, 2020/04/22
- [gnunet] 21/31: predate validity time on creation; extent ttl on validation, gnunet, 2020/04/22
- [gnunet] 28/31: purge scrypt; add argon2, gnunet, 2020/04/22
- [gnunet] 16/31: remove sign API call, gnunet, 2020/04/22
- [gnunet] 17/31: update API comments, gnunet, 2020/04/22
- [gnunet] 30/31: add epochs CLI parameter, gnunet, 2020/04/22
- [gnunet] 29/31: remova binary file commited by accident, gnunet, 2020/04/22
- [gnunet] 08/31: towards less variance, gnunet, 2020/04/22
- [gnunet] 22/31: new pass API, gnunet, 2020/04/22