diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-10 14:57:20 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-10 14:57:20 +0100 |
commit | bfd4daf8ae1a3c6229ee3a8ca944adb2ef7e8677 (patch) | |
tree | 25aba3b09bbd0f1fdbc8f9295f49e2caffdb950c /src/include | |
parent | 98edb2e5e83bafe96bb312262fcd9e992589b1d3 (diff) | |
download | gnunet-bfd4daf8ae1a3c6229ee3a8ca944adb2ef7e8677.tar.gz gnunet-bfd4daf8ae1a3c6229ee3a8ca944adb2ef7e8677.zip |
-remove signing from DHTU API: no longer needed
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_dhtu_plugin.h | 75 |
1 files changed, 7 insertions, 68 deletions
diff --git a/src/include/gnunet_dhtu_plugin.h b/src/include/gnunet_dhtu_plugin.h index e65318fb5..2c97d5848 100644 --- a/src/include/gnunet_dhtu_plugin.h +++ b/src/include/gnunet_dhtu_plugin.h | |||
@@ -57,36 +57,13 @@ struct GNUNET_DHTU_Target; | |||
57 | */ | 57 | */ |
58 | struct GNUNET_DHTU_PreferenceHandle; | 58 | struct GNUNET_DHTU_PreferenceHandle; |
59 | 59 | ||
60 | /** | ||
61 | * Opaque handle for a private key used by this underlay. | ||
62 | */ | ||
63 | struct GNUNET_DHTU_PrivateKey; | ||
64 | 60 | ||
65 | /** | 61 | /** |
66 | * Handle for a public key used by another peer. Note that | 62 | * Key used to identify peer's position in the DHT. |
67 | * the underlay used must be communicated separately. | ||
68 | */ | 63 | */ |
69 | struct GNUNET_DHTU_PublicKey | 64 | struct GNUNET_DHTU_HashKey |
70 | { | 65 | { |
71 | /** | 66 | struct GNUNET_HashCode sha512; |
72 | * How long is the public key, in network byte order. | ||
73 | */ | ||
74 | uint16_t size; | ||
75 | |||
76 | /* followed by size-2 bytes of the actual public key */ | ||
77 | }; | ||
78 | |||
79 | |||
80 | /** | ||
81 | * Hash used by the DHT for keys and peers. | ||
82 | */ | ||
83 | struct GNUNET_DHTU_Hash | ||
84 | { | ||
85 | |||
86 | /** | ||
87 | * For now, use a 512 bit hash. (To be discussed). | ||
88 | */ | ||
89 | struct GNUNET_HashCode hc; | ||
90 | }; | 67 | }; |
91 | 68 | ||
92 | 69 | ||
@@ -111,9 +88,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
111 | * Function to call with new addresses of this peer. | 88 | * Function to call with new addresses of this peer. |
112 | * | 89 | * |
113 | * @param cls the closure | 90 | * @param cls the closure |
114 | * @param my_id hash position of this address in the DHT | 91 | * @param key hash position of this address in the DHT |
115 | * @param pk private key of this peer used at @a address, | ||
116 | * pointer will remain valid until @e address_del_cb is called | ||
117 | * @param address address under which we are likely reachable, | 92 | * @param address address under which we are likely reachable, |
118 | * pointer will remain valid until @e address_del_cb is called; to be used for HELLOs. Example: "ip+udp://1.1.1.1:2086/" | 93 | * pointer will remain valid until @e address_del_cb is called; to be used for HELLOs. Example: "ip+udp://1.1.1.1:2086/" |
119 | * @param source handle for sending from this address, NULL if we can only receive | 94 | * @param source handle for sending from this address, NULL if we can only receive |
@@ -121,8 +96,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
121 | */ | 96 | */ |
122 | void | 97 | void |
123 | (*address_add_cb)(void *cls, | 98 | (*address_add_cb)(void *cls, |
124 | const struct GNUNET_DHTU_Hash *my_id, | 99 | struct GNUNET_DHTU_HashKey *key, |
125 | const struct GNUNET_DHTU_PrivateKey *pk, | ||
126 | const char *address, | 100 | const char *address, |
127 | struct GNUNET_DHTU_Source *source, | 101 | struct GNUNET_DHTU_Source *source, |
128 | void **ctx); | 102 | void **ctx); |
@@ -164,9 +138,8 @@ struct GNUNET_DHTU_PluginEnvironment | |||
164 | */ | 138 | */ |
165 | void | 139 | void |
166 | (*connect_cb)(void *cls, | 140 | (*connect_cb)(void *cls, |
167 | const struct GNUNET_DHTU_PublicKey *pk, | ||
168 | const struct GNUNET_DHTU_Hash *peer_id, | ||
169 | struct GNUNET_DHTU_Target *target, | 141 | struct GNUNET_DHTU_Target *target, |
142 | struct GNUNET_DHTU_HashKey *key, | ||
170 | void **ctx); | 143 | void **ctx); |
171 | 144 | ||
172 | /** | 145 | /** |
@@ -209,41 +182,6 @@ struct GNUNET_DHTU_PluginFunctions | |||
209 | void *cls; | 182 | void *cls; |
210 | 183 | ||
211 | /** | 184 | /** |
212 | * Use our private key to sign a message. | ||
213 | * | ||
214 | * @param cls closure | ||
215 | * @param pk our private key to sign with | ||
216 | * @param purpose what to sign | ||
217 | * @param[out] signature, allocated on heap and returned | ||
218 | * @return -1 on error, otherwise number of bytes in @a sig | ||
219 | */ | ||
220 | ssize_t | ||
221 | (*sign)(void *cls, | ||
222 | const struct GNUNET_DHTU_PrivateKey *pk, | ||
223 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | ||
224 | void **sig); | ||
225 | |||
226 | /** | ||
227 | * Verify signature in @a sig over @a purpose. | ||
228 | * | ||
229 | * @param cls closure | ||
230 | * @param pk public key to verify signature of | ||
231 | * @param purpose what was being signed | ||
232 | * @param sig signature data | ||
233 | * @param sig_size number of bytes in @a sig | ||
234 | * @return #GNUNET_OK if signature is valid | ||
235 | * #GNUNET_NO if signatures are not supported | ||
236 | * #GNUNET_SYSERR if signature is invalid | ||
237 | */ | ||
238 | enum GNUNET_GenericReturnValue | ||
239 | (*verify)(void *cls, | ||
240 | const struct GNUNET_DHTU_PublicKey *pk, | ||
241 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | ||
242 | const void *sig, | ||
243 | size_t sig_size); | ||
244 | |||
245 | |||
246 | /** | ||
247 | * Request creation of a session with a peer at the given @a address. | 185 | * Request creation of a session with a peer at the given @a address. |
248 | * | 186 | * |
249 | * @param cls closure (internal context for the plugin) | 187 | * @param cls closure (internal context for the plugin) |
@@ -253,6 +191,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
253 | (*try_connect) (void *cls, | 191 | (*try_connect) (void *cls, |
254 | const char *address); | 192 | const char *address); |
255 | 193 | ||
194 | |||
256 | /** | 195 | /** |
257 | * Request underlay to keep the connection to @a target alive if possible. | 196 | * Request underlay to keep the connection to @a target alive if possible. |
258 | * Hold may be called multiple times to express a strong preference to | 197 | * Hold may be called multiple times to express a strong preference to |