aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-10 14:22:35 +0100
committerChristian Grothoff <christian@grothoff.org>2022-01-10 14:22:35 +0100
commit8ee3c5121e87d8f25193ae6044d5818f4629fa1e (patch)
treeeb0dd0250f11fb5f9bc788cef8ba55da90160698 /src/include
parentd4641d36b885ba764945d6353ed71b7bc485c6ac (diff)
downloadgnunet-8ee3c5121e87d8f25193ae6044d5818f4629fa1e.tar.gz
gnunet-8ee3c5121e87d8f25193ae6044d5818f4629fa1e.zip
-DHT: add path signature verification logic; tests pass, but logic remains dead
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_dht_service.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 5c365639a..768b19fb1 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -482,29 +482,33 @@ GNUNET_DHT_pp2s (const struct GNUNET_DHT_PathElement *path,
482 482
483 483
484/** 484/**
485 * Verify signatures on a @a path, in reverse order (starting at 485 * Verify signatures on a path consisting of @a put_path and @a get_path in
486 * the last element of the path). Note that the last signature 486 * reverse order (starting at the last element of the @a get_path). Note that
487 * on the path is never verified as that is the slot where our 487 * the last signature on the path is never verified as that is the slot where
488 * peer (@a me) would need to sign. 488 * our peer (@a me) would need to sign.
489 * 489 *
490 * @param key key of the data (not necessarily the query hash) 490 * @param key key of the data (not necessarily the query hash)
491 * @param data payload (the block) 491 * @param data payload (the block)
492 * @param data_size number of bytes in @a data 492 * @param data_size number of bytes in @a data
493 * @param exp_time expiration time of @a data 493 * @param exp_time expiration time of @a data
494 * @param path array of path elements to verify 494 * @param get_path array of path elements to verify
495 * @param path_len length of the @a path array 495 * @param get_path_len length of the @a get_path array
496 * @param put_path array of path elements to verify
497 * @param put_path_len length of the @a put_path array
496 * @param me our own peer identity (needed to verify the last element) 498 * @param me our own peer identity (needed to verify the last element)
497 * @return 0 on success, otherwise the index of 499 * @return 0 on success, otherwise the index of
498 * the last path element that succeeded with verification; 500 * the last path element that succeeded with verification;
499 * @a path_len -1 if no signature was valid 501 * @a get_path_len + @a put_path_len - 1 if no signature was valid
500 */ 502 */
501unsigned int 503unsigned int
502GNUNET_DHT_verify_path (const struct GNUNET_HashCode *key, 504GNUNET_DHT_verify_path (const struct GNUNET_HashCode *key,
503 const void *data, 505 const void *data,
504 size_t data_size, 506 size_t data_size,
505 struct GNUNET_TIME_Absolute exp_time, 507 struct GNUNET_TIME_Absolute exp_time,
506 const struct GNUNET_DHT_PathElement *path, 508 const struct GNUNET_DHT_PathElement *put_path,
507 unsigned int path_len, 509 unsigned int put_path_len,
510 const struct GNUNET_DHT_PathElement *get_path,
511 unsigned int get_path_len,
508 const struct GNUNET_PeerIdentity *me); 512 const struct GNUNET_PeerIdentity *me);
509 513
510 514