diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-09 12:22:04 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-09 12:22:04 +0100 |
commit | ec19c1e316efdd29a7af0524fc2ff33cc4b19d09 (patch) | |
tree | 184a59ff1c8408c462254e53f7e2004be829e237 /src/cadet | |
parent | c3ecadd45b11f82e22ba81b42864c7826d0f97c6 (diff) | |
download | gnunet-ec19c1e316efdd29a7af0524fc2ff33cc4b19d09.tar.gz gnunet-ec19c1e316efdd29a7af0524fc2ff33cc4b19d09.zip |
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)
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_dht.c | 9 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.c | 8 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.h | 5 |
3 files changed, 12 insertions, 10 deletions
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; | |||
112 | static void | 112 | static void |
113 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | 113 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, |
114 | const struct GNUNET_HashCode *key, | 114 | const struct GNUNET_HashCode *key, |
115 | const struct GNUNET_PeerIdentity *get_path, | 115 | const struct GNUNET_DHT_PathElement *get_path, |
116 | unsigned int get_path_length, | 116 | unsigned int get_path_length, |
117 | const struct GNUNET_PeerIdentity *put_path, | 117 | const struct GNUNET_DHT_PathElement *put_path, |
118 | unsigned int put_path_length, | 118 | unsigned int put_path_length, |
119 | enum GNUNET_BLOCK_Type type, | 119 | enum GNUNET_BLOCK_Type type, |
120 | size_t size, | 120 | size_t size, |
121 | const void *data) | 121 | const void *data) |
122 | { | 122 | { |
123 | const struct GNUNET_HELLO_Message *hello = data; | 123 | const struct GNUNET_HELLO_Message *hello = data; |
124 | struct CadetPeer *peer; | ||
125 | 124 | ||
126 | GCPP_try_path_from_dht (get_path, | 125 | GCPP_try_path_from_dht (get_path, |
127 | get_path_length, | 126 | get_path_length, |
@@ -131,7 +130,9 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
131 | (ntohs (hello->header.size) == size) && | 130 | (ntohs (hello->header.size) == size) && |
132 | (size == GNUNET_HELLO_size (hello))) | 131 | (size == GNUNET_HELLO_size (hello))) |
133 | { | 132 | { |
134 | peer = GCP_get (&put_path[0], | 133 | struct CadetPeer *peer; |
134 | |||
135 | peer = GCP_get (&put_path[0].pred, | ||
135 | GNUNET_YES); | 136 | GNUNET_YES); |
136 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 137 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
137 | "Got HELLO for %s\n", | 138 | "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, | |||
468 | * @return a path through the network | 468 | * @return a path through the network |
469 | */ | 469 | */ |
470 | void | 470 | void |
471 | GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, | 471 | GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, |
472 | unsigned int get_path_length, | 472 | unsigned int get_path_length, |
473 | const struct GNUNET_PeerIdentity *put_path, | 473 | const struct GNUNET_DHT_PathElement *put_path, |
474 | unsigned int put_path_length) | 474 | unsigned int put_path_length) |
475 | { | 475 | { |
476 | struct CadetPeer *cpath[get_path_length + put_path_length]; | 476 | struct CadetPeer *cpath[get_path_length + put_path_length]; |
@@ -490,8 +490,8 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, | |||
490 | const struct GNUNET_PeerIdentity *pid; | 490 | const struct GNUNET_PeerIdentity *pid; |
491 | 491 | ||
492 | pid = (off < get_path_length) | 492 | pid = (off < get_path_length) |
493 | ? &get_path[get_path_length - off - 1] | 493 | ? &get_path[get_path_length - off - 1].pred |
494 | : &put_path[get_path_length + put_path_length - off - 1]; | 494 | : &put_path[get_path_length + put_path_length - off - 1].pred; |
495 | /* Check that I am not in the path */ | 495 | /* Check that I am not in the path */ |
496 | if (0 == GNUNET_memcmp (&my_full_id, | 496 | if (0 == GNUNET_memcmp (&my_full_id, |
497 | pid)) | 497 | 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 @@ | |||
28 | #define GNUNET_SERVICE_CADET_PATHS_H | 28 | #define GNUNET_SERVICE_CADET_PATHS_H |
29 | 29 | ||
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | #include "gnunet_dht_service.h" | ||
31 | #include "gnunet-service-cadet.h" | 32 | #include "gnunet-service-cadet.h" |
32 | 33 | ||
33 | /** | 34 | /** |
@@ -42,9 +43,9 @@ | |||
42 | * @param put_path_length length of the @a put_path | 43 | * @param put_path_length length of the @a put_path |
43 | */ | 44 | */ |
44 | void | 45 | void |
45 | GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, | 46 | GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, |
46 | unsigned int get_path_length, | 47 | unsigned int get_path_length, |
47 | const struct GNUNET_PeerIdentity *put_path, | 48 | const struct GNUNET_DHT_PathElement *put_path, |
48 | unsigned int put_path_length); | 49 | unsigned int put_path_length); |
49 | 50 | ||
50 | 51 | ||