diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-19 20:05:26 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-19 20:05:26 +0200 |
commit | 8f9a45e853d9759f04a5f4fe9aa0146ed3f3fb17 (patch) | |
tree | b9ef6928b2fdb8647a8c7d3e0f6d316198b51d48 /src/revocation/plugin_block_revocation.c | |
parent | eb6b547e243144f27749811c15b6cce90e03aaa7 (diff) | |
download | gnunet-8f9a45e853d9759f04a5f4fe9aa0146ed3f3fb17.tar.gz gnunet-8f9a45e853d9759f04a5f4fe9aa0146ed3f3fb17.zip |
towards less variance
Diffstat (limited to 'src/revocation/plugin_block_revocation.c')
-rw-r--r-- | src/revocation/plugin_block_revocation.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c index 57234fa36..a57a933c3 100644 --- a/src/revocation/plugin_block_revocation.c +++ b/src/revocation/plugin_block_revocation.c | |||
@@ -134,7 +134,6 @@ block_plugin_revocation_evaluate (void *cls, | |||
134 | struct InternalContext *ic = cls; | 134 | struct InternalContext *ic = cls; |
135 | struct GNUNET_HashCode chash; | 135 | struct GNUNET_HashCode chash; |
136 | const struct RevokeMessage *rm = reply_block; | 136 | const struct RevokeMessage *rm = reply_block; |
137 | struct GNUNET_TIME_Absolute ts; | ||
138 | 137 | ||
139 | if (NULL == reply_block) | 138 | if (NULL == reply_block) |
140 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; | 139 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; |
@@ -143,11 +142,8 @@ block_plugin_revocation_evaluate (void *cls, | |||
143 | GNUNET_break_op (0); | 142 | GNUNET_break_op (0); |
144 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 143 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
145 | } | 144 | } |
146 | ts = GNUNET_TIME_absolute_ntoh (rm->ts); | ||
147 | if (GNUNET_YES != | 145 | if (GNUNET_YES != |
148 | GNUNET_REVOCATION_check_pow (&rm->public_key, | 146 | GNUNET_REVOCATION_check_pow (&rm->proof_of_work, |
149 | &ts, | ||
150 | rm->proof_of_work, | ||
151 | ic->matching_bits)) | 147 | ic->matching_bits)) |
152 | { | 148 | { |
153 | GNUNET_break_op (0); | 149 | GNUNET_break_op (0); |
@@ -155,14 +151,14 @@ block_plugin_revocation_evaluate (void *cls, | |||
155 | } | 151 | } |
156 | if (GNUNET_OK != | 152 | if (GNUNET_OK != |
157 | GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, | 153 | GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, |
158 | &rm->purpose, | 154 | &rm->proof_of_work.purpose, |
159 | &rm->signature, | 155 | &rm->proof_of_work.signature, |
160 | &rm->public_key)) | 156 | &rm->proof_of_work.key)) |
161 | { | 157 | { |
162 | GNUNET_break_op (0); | 158 | GNUNET_break_op (0); |
163 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 159 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
164 | } | 160 | } |
165 | GNUNET_CRYPTO_hash (&rm->public_key, | 161 | GNUNET_CRYPTO_hash (&rm->proof_of_work.key, |
166 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), | 162 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), |
167 | &chash); | 163 | &chash); |
168 | if (GNUNET_YES == | 164 | if (GNUNET_YES == |
@@ -198,7 +194,7 @@ block_plugin_revocation_get_key (void *cls, | |||
198 | GNUNET_break_op (0); | 194 | GNUNET_break_op (0); |
199 | return GNUNET_SYSERR; | 195 | return GNUNET_SYSERR; |
200 | } | 196 | } |
201 | GNUNET_CRYPTO_hash (&rm->public_key, | 197 | GNUNET_CRYPTO_hash (&rm->proof_of_work.key, |
202 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), | 198 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), |
203 | key); | 199 | key); |
204 | return GNUNET_OK; | 200 | return GNUNET_OK; |