diff options
Diffstat (limited to 'src/block/plugin_block_fs.c')
-rw-r--r-- | src/block/plugin_block_fs.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/block/plugin_block_fs.c b/src/block/plugin_block_fs.c index db8e59991..627f21a10 100644 --- a/src/block/plugin_block_fs.c +++ b/src/block/plugin_block_fs.c | |||
@@ -56,14 +56,12 @@ | |||
56 | * @return characterization of result | 56 | * @return characterization of result |
57 | */ | 57 | */ |
58 | static enum GNUNET_BLOCK_EvaluationResult | 58 | static enum GNUNET_BLOCK_EvaluationResult |
59 | block_plugin_fs_evaluate (void *cls, | 59 | block_plugin_fs_evaluate (void *cls, enum GNUNET_BLOCK_Type type, |
60 | enum GNUNET_BLOCK_Type type, | ||
61 | const GNUNET_HashCode * query, | 60 | const GNUNET_HashCode * query, |
62 | struct GNUNET_CONTAINER_BloomFilter **bf, | 61 | struct GNUNET_CONTAINER_BloomFilter **bf, |
63 | int32_t bf_mutator, | 62 | int32_t bf_mutator, const void *xquery, |
64 | const void *xquery, | 63 | size_t xquery_size, const void *reply_block, |
65 | size_t xquery_size, | 64 | size_t reply_block_size) |
66 | const void *reply_block, size_t reply_block_size) | ||
67 | { | 65 | { |
68 | const struct SBlock *sb; | 66 | const struct SBlock *sb; |
69 | GNUNET_HashCode chash; | 67 | GNUNET_HashCode chash; |
@@ -125,8 +123,7 @@ block_plugin_fs_evaluate (void *cls, | |||
125 | &sh); | 123 | &sh); |
126 | if (0 != memcmp (nsid, &sh, sizeof (GNUNET_HashCode))) | 124 | if (0 != memcmp (nsid, &sh, sizeof (GNUNET_HashCode))) |
127 | { | 125 | { |
128 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, | 126 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "block-fs", |
129 | "block-fs", | ||
130 | _ | 127 | _ |
131 | ("Reply mismatched in terms of namespace. Discarded.\n")); | 128 | ("Reply mismatched in terms of namespace. Discarded.\n")); |
132 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 129 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
@@ -162,10 +159,9 @@ block_plugin_fs_evaluate (void *cls, | |||
162 | * (or if extracting a key from a block of this type does not work) | 159 | * (or if extracting a key from a block of this type does not work) |
163 | */ | 160 | */ |
164 | static int | 161 | static int |
165 | block_plugin_fs_get_key (void *cls, | 162 | block_plugin_fs_get_key (void *cls, enum GNUNET_BLOCK_Type type, |
166 | enum GNUNET_BLOCK_Type type, | 163 | const void *block, size_t block_size, |
167 | const void *block, | 164 | GNUNET_HashCode * key) |
168 | size_t block_size, GNUNET_HashCode * key) | ||
169 | { | 165 | { |
170 | const struct KBlock *kb; | 166 | const struct KBlock *kb; |
171 | const struct SBlock *sb; | 167 | const struct SBlock *sb; |
@@ -185,9 +181,9 @@ block_plugin_fs_get_key (void *cls, | |||
185 | } | 181 | } |
186 | kb = block; | 182 | kb = block; |
187 | if (block_size - sizeof (struct KBlock) != | 183 | if (block_size - sizeof (struct KBlock) != |
188 | ntohl (kb->purpose.size) | 184 | ntohl (kb->purpose.size) - |
189 | - sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) | 185 | sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) - |
190 | - sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)) | 186 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)) |
191 | { | 187 | { |
192 | GNUNET_break_op (0); | 188 | GNUNET_break_op (0); |
193 | return GNUNET_NO; | 189 | return GNUNET_NO; |
@@ -236,9 +232,9 @@ block_plugin_fs_get_key (void *cls, | |||
236 | } | 232 | } |
237 | nb = block; | 233 | nb = block; |
238 | if (block_size - sizeof (struct NBlock) != | 234 | if (block_size - sizeof (struct NBlock) != |
239 | ntohl (nb->ns_purpose.size) | 235 | ntohl (nb->ns_purpose.size) - |
240 | - sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) | 236 | sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) - |
241 | - sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)) | 237 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)) |
242 | { | 238 | { |
243 | GNUNET_break_op (0); | 239 | GNUNET_break_op (0); |
244 | return GNUNET_NO; | 240 | return GNUNET_NO; |
@@ -252,16 +248,16 @@ block_plugin_fs_get_key (void *cls, | |||
252 | } | 248 | } |
253 | if (GNUNET_OK != | 249 | if (GNUNET_OK != |
254 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK_KSIG, | 250 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK_KSIG, |
255 | &nb->ksk_purpose, | 251 | &nb->ksk_purpose, &nb->ksk_signature, |
256 | &nb->ksk_signature, &nb->keyspace)) | 252 | &nb->keyspace)) |
257 | { | 253 | { |
258 | GNUNET_break_op (0); | 254 | GNUNET_break_op (0); |
259 | return GNUNET_NO; | 255 | return GNUNET_NO; |
260 | } | 256 | } |
261 | if (GNUNET_OK != | 257 | if (GNUNET_OK != |
262 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK, | 258 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK, |
263 | &nb->ns_purpose, | 259 | &nb->ns_purpose, &nb->ns_signature, |
264 | &nb->ns_signature, &nb->subspace)) | 260 | &nb->subspace)) |
265 | { | 261 | { |
266 | GNUNET_break_op (0); | 262 | GNUNET_break_op (0); |
267 | return GNUNET_NO; | 263 | return GNUNET_NO; |