From ec19c1e316efdd29a7af0524fc2ff33cc4b19d09 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 9 Jan 2022 12:22:04 +0100 Subject: DHT: modify API and protocol messages to add path signatures, except for now the actual signatures are just placeholders (signing and signature verification are missing) --- src/cadet/gnunet-service-cadet_dht.c | 9 +++++---- src/cadet/gnunet-service-cadet_paths.c | 8 ++++---- src/cadet/gnunet-service-cadet_paths.h | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/cadet') diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c index 6caac474d..d44a50f50 100644 --- a/src/cadet/gnunet-service-cadet_dht.c +++ b/src/cadet/gnunet-service-cadet_dht.c @@ -112,16 +112,15 @@ static struct GNUNET_TIME_Relative announce_delay; static void dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, - const struct GNUNET_PeerIdentity *get_path, + const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, - const struct GNUNET_PeerIdentity *put_path, + const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length, enum GNUNET_BLOCK_Type type, size_t size, const void *data) { const struct GNUNET_HELLO_Message *hello = data; - struct CadetPeer *peer; GCPP_try_path_from_dht (get_path, get_path_length, @@ -131,7 +130,9 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, (ntohs (hello->header.size) == size) && (size == GNUNET_HELLO_size (hello))) { - peer = GCP_get (&put_path[0], + struct CadetPeer *peer; + + peer = GCP_get (&put_path[0].pred, GNUNET_YES); LOG (GNUNET_ERROR_TYPE_DEBUG, "Got HELLO for %s\n", diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c index 2da4e2708..aa31aaa74 100644 --- a/src/cadet/gnunet-service-cadet_paths.c +++ b/src/cadet/gnunet-service-cadet_paths.c @@ -468,9 +468,9 @@ extend_path (struct CadetPeerPath *path, * @return a path through the network */ void -GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, +GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, - const struct GNUNET_PeerIdentity *put_path, + const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length) { struct CadetPeer *cpath[get_path_length + put_path_length]; @@ -490,8 +490,8 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, const struct GNUNET_PeerIdentity *pid; pid = (off < get_path_length) - ? &get_path[get_path_length - off - 1] - : &put_path[get_path_length + put_path_length - off - 1]; + ? &get_path[get_path_length - off - 1].pred + : &put_path[get_path_length + put_path_length - off - 1].pred; /* Check that I am not in the path */ if (0 == GNUNET_memcmp (&my_full_id, pid)) diff --git a/src/cadet/gnunet-service-cadet_paths.h b/src/cadet/gnunet-service-cadet_paths.h index 3961dd721..afd193596 100644 --- a/src/cadet/gnunet-service-cadet_paths.h +++ b/src/cadet/gnunet-service-cadet_paths.h @@ -28,6 +28,7 @@ #define GNUNET_SERVICE_CADET_PATHS_H #include "gnunet_util_lib.h" +#include "gnunet_dht_service.h" #include "gnunet-service-cadet.h" /** @@ -42,9 +43,9 @@ * @param put_path_length length of the @a put_path */ void -GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, +GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, - const struct GNUNET_PeerIdentity *put_path, + const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length); -- cgit v1.2.3