aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_topo.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-26 01:57:13 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-26 01:57:13 +0100
commit8fe9edb11728c34de80242b438cbb0d75e26a04d (patch)
tree00fbb48deb1f4451b864a78b38e3f0bc80fb8f39 /src/dht/test_dht_topo.c
parentd4c1c6f32d949ed493ba286d81fc172f57fe0ffe (diff)
downloadgnunet-8fe9edb11728c34de80242b438cbb0d75e26a04d.tar.gz
gnunet-8fe9edb11728c34de80242b438cbb0d75e26a04d.zip
-hack up GET/PUT signatures, still broken by design
Diffstat (limited to 'src/dht/test_dht_topo.c')
-rw-r--r--src/dht/test_dht_topo.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index 30e7749ca..fa57e13b5 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -326,7 +326,7 @@ timeout_cb (void *cls)
326 * 326 *
327 * @param cls closure with our 'struct GetOperation' 327 * @param cls closure with our 'struct GetOperation'
328 * @param exp when will this value expire 328 * @param exp when will this value expire
329 * @param key key of the result 329 * @param query query hash
330 * @param get_path peers on reply path (or NULL if not recorded) 330 * @param get_path peers on reply path (or NULL if not recorded)
331 * @param get_path_length number of entries in @a get_path 331 * @param get_path_length number of entries in @a get_path
332 * @param put_path peers on the PUT path (or NULL if not recorded) 332 * @param put_path peers on the PUT path (or NULL if not recorded)
@@ -338,7 +338,7 @@ timeout_cb (void *cls)
338static void 338static void
339dht_get_handler (void *cls, 339dht_get_handler (void *cls,
340 struct GNUNET_TIME_Absolute exp, 340 struct GNUNET_TIME_Absolute exp,
341 const struct GNUNET_HashCode *key, 341 const struct GNUNET_HashCode *query,
342 const struct GNUNET_DHT_PathElement *get_path, 342 const struct GNUNET_DHT_PathElement *get_path,
343 unsigned int get_path_length, 343 unsigned int get_path_length,
344 const struct GNUNET_DHT_PathElement *put_path, 344 const struct GNUNET_DHT_PathElement *put_path,
@@ -359,8 +359,15 @@ dht_get_handler (void *cls,
359 GNUNET_break (0); 359 GNUNET_break (0);
360 return; 360 return;
361 } 361 }
362 GNUNET_CRYPTO_hash (key, 362 if (0 != GNUNET_memcmp (query,
363 sizeof(*key), 363 &get_op->key))
364 {
365 /* exact search should only yield exact results */
366 GNUNET_break (0);
367 return;
368 }
369 GNUNET_CRYPTO_hash (query,
370 sizeof(*query),
364 &want); 371 &want);
365 if (0 != memcmp (&want, 372 if (0 != memcmp (&want,
366 data, 373 data,
@@ -370,19 +377,22 @@ dht_get_handler (void *cls,
370 return; 377 return;
371 } 378 }
372 if (0 != 379 if (0 !=
373 GNUNET_DHT_verify_path (key, 380 GNUNET_DHT_verify_path (query,
374 data, 381 data,
375 size, 382 size,
376 exp, 383 exp,
377 get_path,
378 get_path_length,
379 put_path, 384 put_path,
380 put_path_length, 385 put_path_length,
386 get_path,
387 get_path_length,
381 &get_op->me)) 388 &get_op->me))
382 { 389 {
383 GNUNET_break (0); 390 GNUNET_break (0);
384 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 391 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
385 "Path signature verification failed!\n"); 392 "Path signature (%u/%u) verification failed for peer %s!\n",
393 get_path_length,
394 put_path_length,
395 GNUNET_i2s (&get_op->me));
386 } 396 }
387 else 397 else
388 { 398 {