diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-26 01:57:13 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-26 01:57:13 +0100 |
commit | 8fe9edb11728c34de80242b438cbb0d75e26a04d (patch) | |
tree | 00fbb48deb1f4451b864a78b38e3f0bc80fb8f39 /src/include | |
parent | d4c1c6f32d949ed493ba286d81fc172f57fe0ffe (diff) | |
download | gnunet-8fe9edb11728c34de80242b438cbb0d75e26a04d.tar.gz gnunet-8fe9edb11728c34de80242b438cbb0d75e26a04d.zip |
-hack up GET/PUT signatures, still broken by design
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_dht_service.h | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index e0f9f6fc3..4e14d981d 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -118,10 +118,10 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
118 | /** | 118 | /** |
119 | * Message signed by a peer when doing path tracking. | 119 | * Message signed by a peer when doing path tracking. |
120 | */ | 120 | */ |
121 | struct GNUNET_DHT_HopSignature | 121 | struct GNUNET_DHT_PutHopSignature |
122 | { | 122 | { |
123 | /** | 123 | /** |
124 | * Must be #GNUNET_SIGNATURE_PURPOSE_DHT_HOP. | 124 | * Must be #GNUNET_SIGNATURE_PURPOSE_DHT_PUT_HOP. |
125 | */ | 125 | */ |
126 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 126 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
127 | 127 | ||
@@ -131,9 +131,43 @@ struct GNUNET_DHT_HopSignature | |||
131 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | 131 | struct GNUNET_TIME_AbsoluteNBO expiration_time; |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * Key of the block. | 134 | * Hash over the payload of the block. |
135 | */ | ||
136 | struct GNUNET_HashCode h_data; | ||
137 | |||
138 | /** | ||
139 | * Previous hop the message was received from. All zeros | ||
140 | * if this peer was the initiator. | ||
135 | */ | 141 | */ |
136 | struct GNUNET_HashCode key; | 142 | struct GNUNET_PeerIdentity pred; |
143 | |||
144 | /** | ||
145 | * Next hop the message was forwarded to. | ||
146 | */ | ||
147 | struct GNUNET_PeerIdentity succ; | ||
148 | }; | ||
149 | |||
150 | |||
151 | /** | ||
152 | * Message signed by a peer when doing path tracking | ||
153 | * for RESULT (GET) hops. | ||
154 | */ | ||
155 | struct GNUNET_DHT_ResultHopSignature | ||
156 | { | ||
157 | /** | ||
158 | * Must be #GNUNET_SIGNATURE_PURPOSE_DHT_RESULT_HOP. | ||
159 | */ | ||
160 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
161 | |||
162 | /** | ||
163 | * Expiration time of the block. | ||
164 | */ | ||
165 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | ||
166 | |||
167 | /** | ||
168 | * Query hash of the GET that is being answered. | ||
169 | */ | ||
170 | struct GNUNET_HashCode query_hash; | ||
137 | 171 | ||
138 | /** | 172 | /** |
139 | * Hash over the payload of the block. | 173 | * Hash over the payload of the block. |
@@ -181,6 +215,7 @@ struct GNUNET_DHT_PathElement | |||
181 | 215 | ||
182 | }; | 216 | }; |
183 | 217 | ||
218 | |||
184 | GNUNET_NETWORK_STRUCT_END | 219 | GNUNET_NETWORK_STRUCT_END |
185 | 220 | ||
186 | /** | 221 | /** |
@@ -266,7 +301,7 @@ GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph); | |||
266 | * | 301 | * |
267 | * @param cls closure | 302 | * @param cls closure |
268 | * @param exp when will this value expire | 303 | * @param exp when will this value expire |
269 | * @param key key of the result | 304 | * @param query_hash key of the query |
270 | * @param get_path peers on reply path (or NULL if not recorded) | 305 | * @param get_path peers on reply path (or NULL if not recorded) |
271 | * [0] = datastore's first neighbor, [length - 1] = local peer | 306 | * [0] = datastore's first neighbor, [length - 1] = local peer |
272 | * @param get_path_length number of entries in @a get_path | 307 | * @param get_path_length number of entries in @a get_path |
@@ -282,7 +317,7 @@ GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph); | |||
282 | typedef void | 317 | typedef void |
283 | (*GNUNET_DHT_GetIterator) (void *cls, | 318 | (*GNUNET_DHT_GetIterator) (void *cls, |
284 | struct GNUNET_TIME_Absolute exp, | 319 | struct GNUNET_TIME_Absolute exp, |
285 | const struct GNUNET_HashCode *key, | 320 | const struct GNUNET_HashCode *query_hash, |
286 | const struct GNUNET_DHT_PathElement *get_path, | 321 | const struct GNUNET_DHT_PathElement *get_path, |
287 | unsigned int get_path_length, | 322 | unsigned int get_path_length, |
288 | const struct GNUNET_DHT_PathElement *put_path, | 323 | const struct GNUNET_DHT_PathElement *put_path, |
@@ -487,7 +522,7 @@ GNUNET_DHT_pp2s (const struct GNUNET_DHT_PathElement *path, | |||
487 | * the last signature on the path is never verified as that is the slot where | 522 | * the last signature on the path is never verified as that is the slot where |
488 | * our peer (@a me) would need to sign. | 523 | * our peer (@a me) would need to sign. |
489 | * | 524 | * |
490 | * @param key key of the data (not necessarily the query hash) | 525 | * @param query_hash the query hash, not necessarily the key of the block |
491 | * @param data payload (the block) | 526 | * @param data payload (the block) |
492 | * @param data_size number of bytes in @a data | 527 | * @param data_size number of bytes in @a data |
493 | * @param exp_time expiration time of @a data | 528 | * @param exp_time expiration time of @a data |
@@ -501,7 +536,7 @@ GNUNET_DHT_pp2s (const struct GNUNET_DHT_PathElement *path, | |||
501 | * @a get_path_len + @a put_path_len - 1 if no signature was valid | 536 | * @a get_path_len + @a put_path_len - 1 if no signature was valid |
502 | */ | 537 | */ |
503 | unsigned int | 538 | unsigned int |
504 | GNUNET_DHT_verify_path (const struct GNUNET_HashCode *key, | 539 | GNUNET_DHT_verify_path (const struct GNUNET_HashCode *query_hash, |
505 | const void *data, | 540 | const void *data, |
506 | size_t data_size, | 541 | size_t data_size, |
507 | struct GNUNET_TIME_Absolute exp_time, | 542 | struct GNUNET_TIME_Absolute exp_time, |