aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-09 11:31:53 +0100
committerChristian Grothoff <christian@grothoff.org>2022-01-09 11:31:53 +0100
commitc3ecadd45b11f82e22ba81b42864c7826d0f97c6 (patch)
treebb0ee6ca8184aaeb27502d7436871f56c113e076 /src
parent5b9d8a931e50fff58bf260176aab8b6c27fe200a (diff)
downloadgnunet-c3ecadd45b11f82e22ba81b42864c7826d0f97c6.tar.gz
gnunet-c3ecadd45b11f82e22ba81b42864c7826d0f97c6.zip
DHT: signed path definition (not implemented at all)
Diffstat (limited to 'src')
-rw-r--r--src/dht/dht.h2
-rw-r--r--src/include/gnunet_dht_service.h57
2 files changed, 57 insertions, 2 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h
index 86f1b9b49..c69b69f07 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2001, 2002, 2003, 2004, 2009, 2011 GNUnet e.V. 3 Copyright (C) 2001, 2002, 2003, 2004, 2009, 2011, 2021 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 160beffdd..15da9ecdd 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2004-2013, 2016 GNUnet e.V. 3 Copyright (C) 2004-2013, 2016, 2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -113,6 +113,61 @@ enum GNUNET_DHT_RouteOption
113}; 113};
114 114
115 115
116GNUNET_NETWORK_STRUCT_BEGIN
117
118/**
119 * Message signed by a peer when doing path tracking.
120 */
121struct GNUNET_DHT_HopSignature
122{
123 /**
124 * Must be #GNUNET_SIGNATURE_PURPOSE_DHT_HOP.
125 */
126 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
127
128 /**
129 * Previous hop the message was received from. All zeros
130 * if this peer was the initiator.
131 */
132 struct GNUNET_PeerIdentity pred;
133
134 /**
135 * Next hop the message was forwarded to.
136 */
137 struct GNUNET_PeerIdentity succ;
138};
139
140
141/**
142 * A (signed) path tracking a block's flow through the DHT is represented by
143 * an array of path elements, each consisting of a peer on the path and a
144 * signature by which the peer affirms its routing decision.
145 */
146struct GNUNET_DHT_PathElement
147{
148
149 /**
150 * Previous peer on the path (matches "pred" in the signed field).
151 *
152 * The public key used to create the @e sig is in the *next* path element,
153 * or is the sender of the message if this was the last path element.
154 *
155 * The "succ" field can be found in 'pred' if there are two more path
156 * elements in the path, is the sender if there is only one more path
157 * element, or the recipient if this was the last element on the path.
158 */
159 struct GNUNET_PeerIdentity pred;
160
161 /**
162 * Signature affirming the hop of type
163 * #GNUNET_SIGNATURE_PURPOSE_DHT_HOP.
164 */
165 struct GNUNET_CRYPTO_EddsaSignature sig;
166
167};
168
169GNUNET_NETWORK_STRUCT_END
170
116/** 171/**
117 * Initialize the connection with the DHT service. 172 * Initialize the connection with the DHT service.
118 * 173 *