aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/plugin_block_revocation.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-10-14 19:47:32 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-10-15 12:11:18 +0200
commit96c802b46be51e5c45f34e2de823f787d26c2929 (patch)
tree457ccfd8f9a61563af86318739c4a8f964a57025 /src/revocation/plugin_block_revocation.c
parentc14e3a2769ff0f15fdbb32797e37e43ce2344fa3 (diff)
downloadgnunet-96c802b46be51e5c45f34e2de823f787d26c2929.tar.gz
gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.zip
- towards crypto agility; wip
Diffstat (limited to 'src/revocation/plugin_block_revocation.c')
-rw-r--r--src/revocation/plugin_block_revocation.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c
index 291c56f70..ba3c33b6f 100644
--- a/src/revocation/plugin_block_revocation.c
+++ b/src/revocation/plugin_block_revocation.c
@@ -143,16 +143,16 @@ block_plugin_revocation_evaluate (void *cls,
143 GNUNET_break_op (0); 143 GNUNET_break_op (0);
144 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 144 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
145 } 145 }
146 if (0 >= 146 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1];
147 GNUNET_REVOCATION_check_pow (&rm->proof_of_work, 147 if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow,
148 ic->matching_bits, 148 ic->matching_bits,
149 ic->epoch_duration)) 149 ic->epoch_duration))
150 { 150 {
151 GNUNET_break_op (0); 151 GNUNET_break_op (0);
152 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 152 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
153 } 153 }
154 GNUNET_CRYPTO_hash (&rm->proof_of_work.key, 154 GNUNET_CRYPTO_hash (&pow->key,
155 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), 155 sizeof(struct GNUNET_IDENTITY_PublicKey),
156 &chash); 156 &chash);
157 if (GNUNET_YES == 157 if (GNUNET_YES ==
158 GNUNET_BLOCK_GROUP_bf_test_and_set (group, 158 GNUNET_BLOCK_GROUP_bf_test_and_set (group,
@@ -182,13 +182,14 @@ block_plugin_revocation_get_key (void *cls,
182{ 182{
183 const struct RevokeMessage *rm = block; 183 const struct RevokeMessage *rm = block;
184 184
185 if (block_size != sizeof(*rm)) 185 if (block_size <= sizeof(*rm))
186 { 186 {
187 GNUNET_break_op (0); 187 GNUNET_break_op (0);
188 return GNUNET_SYSERR; 188 return GNUNET_SYSERR;
189 } 189 }
190 GNUNET_CRYPTO_hash (&rm->proof_of_work.key, 190 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1];
191 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), 191 GNUNET_CRYPTO_hash (&pow->key,
192 sizeof(struct GNUNET_IDENTITY_PublicKey),
192 key); 193 key);
193 return GNUNET_OK; 194 return GNUNET_OK;
194} 195}