diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 11:57:30 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:23 +0200 |
commit | 5d498b8e1b50373636126956d1c6addfd11ade5e (patch) | |
tree | f7b7f140838ed52668ad3d02eadbc94cc9936318 /src/revocation/plugin_block_revocation.c | |
parent | 5680378974db794d67b75473435a0651fad0cd24 (diff) | |
download | gnunet-5d498b8e1b50373636126956d1c6addfd11ade5e.tar.gz gnunet-5d498b8e1b50373636126956d1c6addfd11ade5e.zip |
- fix revocation
Diffstat (limited to 'src/revocation/plugin_block_revocation.c')
-rw-r--r-- | src/revocation/plugin_block_revocation.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c index ba3c33b6f..3c9344a49 100644 --- a/src/revocation/plugin_block_revocation.c +++ b/src/revocation/plugin_block_revocation.c | |||
@@ -144,6 +144,8 @@ block_plugin_revocation_evaluate (void *cls, | |||
144 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 144 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
145 | } | 145 | } |
146 | struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; | 146 | struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; |
147 | const struct GNUNET_IDENTITY_PublicKey *pk; | ||
148 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; | ||
147 | if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow, | 149 | if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow, |
148 | ic->matching_bits, | 150 | ic->matching_bits, |
149 | ic->epoch_duration)) | 151 | ic->epoch_duration)) |
@@ -151,8 +153,8 @@ block_plugin_revocation_evaluate (void *cls, | |||
151 | GNUNET_break_op (0); | 153 | GNUNET_break_op (0); |
152 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 154 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
153 | } | 155 | } |
154 | GNUNET_CRYPTO_hash (&pow->key, | 156 | GNUNET_CRYPTO_hash (pk, |
155 | sizeof(struct GNUNET_IDENTITY_PublicKey), | 157 | GNUNET_IDENTITY_key_get_length (pk), |
156 | &chash); | 158 | &chash); |
157 | if (GNUNET_YES == | 159 | if (GNUNET_YES == |
158 | GNUNET_BLOCK_GROUP_bf_test_and_set (group, | 160 | GNUNET_BLOCK_GROUP_bf_test_and_set (group, |
@@ -188,8 +190,10 @@ block_plugin_revocation_get_key (void *cls, | |||
188 | return GNUNET_SYSERR; | 190 | return GNUNET_SYSERR; |
189 | } | 191 | } |
190 | struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; | 192 | struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; |
191 | GNUNET_CRYPTO_hash (&pow->key, | 193 | const struct GNUNET_IDENTITY_PublicKey *pk; |
192 | sizeof(struct GNUNET_IDENTITY_PublicKey), | 194 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; |
195 | GNUNET_CRYPTO_hash (pk, | ||
196 | GNUNET_IDENTITY_key_get_length (pk), | ||
193 | key); | 197 | key); |
194 | return GNUNET_OK; | 198 | return GNUNET_OK; |
195 | } | 199 | } |