diff options
author | jospaeth <spaethj@in.tum.de> | 2020-06-28 13:34:13 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-07-09 14:56:09 +0200 |
commit | c9ea27bc037eeae5ee39b05cd11b06e48399fb43 (patch) | |
tree | d3deb1b47d472561f454799be08d4c0aa349c5c1 /src/include | |
parent | ae8cb76dead0403f4258c762d8d330cc5aca938d (diff) | |
download | gnunet-c9ea27bc037eeae5ee39b05cd11b06e48399fb43.tar.gz gnunet-c9ea27bc037eeae5ee39b05cd11b06e48399fb43.zip |
add plugins for key and attributes escrow
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_reclaim_lib.h | 16 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_plugin.h | 88 |
2 files changed, 104 insertions, 0 deletions
diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h index 54d284f3c..d7d1eb938 100644 --- a/src/include/gnunet_reclaim_lib.h +++ b/src/include/gnunet_reclaim_lib.h | |||
@@ -66,6 +66,22 @@ extern "C" { | |||
66 | #define GNUNET_RECLAIM_ID_LENGTH (256 / 8) | 66 | #define GNUNET_RECLAIM_ID_LENGTH (256 / 8) |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Enum for the different key escrow methods | ||
70 | */ | ||
71 | enum GNUNET_RECLAIM_Key_Escrow_Method { | ||
72 | GNUNET_RECLAIM_KE_PLAINTEXT, | ||
73 | GNUNET_RECLAIM_KE_GNS, | ||
74 | GNUNET_RECLAIM_KE_ANASTASIS | ||
75 | }; | ||
76 | |||
77 | /** | ||
78 | * Enum for the different attribute escrow methods | ||
79 | */ | ||
80 | enum GNUNET_RECLAIM_Attribute_Escrow_Method { | ||
81 | GNUNET_RECLAIM_AE_PLAINTEXT | ||
82 | }; | ||
83 | |||
84 | /** | ||
69 | * A reclaim identifier | 85 | * A reclaim identifier |
70 | * FIXME maybe put this in a different namespace | 86 | * FIXME maybe put this in a different namespace |
71 | */ | 87 | */ |
diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h index 992ad0cc3..c9875e87c 100644 --- a/src/include/gnunet_reclaim_plugin.h +++ b/src/include/gnunet_reclaim_plugin.h | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include "gnunet_util_lib.h" | 33 | #include "gnunet_util_lib.h" |
34 | #include "gnunet_reclaim_lib.h" | 34 | #include "gnunet_reclaim_lib.h" |
35 | #include "gnunet_identity_service.h" | ||
35 | 36 | ||
36 | #ifdef __cplusplus | 37 | #ifdef __cplusplus |
37 | extern "C" { | 38 | extern "C" { |
@@ -200,6 +201,50 @@ typedef int (*GNUNET_RECLAIM_AttestationGetExpirationFunction) ( | |||
200 | const struct GNUNET_RECLAIM_Attestation *attest, | 201 | const struct GNUNET_RECLAIM_Attestation *attest, |
201 | struct GNUNET_TIME_Absolute *expiration); | 202 | struct GNUNET_TIME_Absolute *expiration); |
202 | 203 | ||
204 | /** | ||
205 | * Function called to start the escrow of the key | ||
206 | * | ||
207 | * @param ego the identity ego containing the private key | ||
208 | * @param escrowAnchor the anchor needed to restore the key | ||
209 | * @return GNUNET_OK if successful | ||
210 | */ | ||
211 | typedef int (*GNUNET_RECLAIM_EscrowStartKeyEscrowFunction) ( | ||
212 | struct GNUNET_IDENTITY_Ego *ego, | ||
213 | void *escrowAnchor); | ||
214 | |||
215 | /** | ||
216 | * Function called to renew the escrow of the key | ||
217 | * | ||
218 | * @param ego the identity ego containing the private key | ||
219 | * @param escrowAnchor the anchor needed to restore the key | ||
220 | * @return GNUNET_OK if successful | ||
221 | */ | ||
222 | typedef int (*GNUNET_RECLAIM_EscrowRenewKeyEscrowFunction) ( | ||
223 | struct GNUNET_IDENTITY_Ego *ego, | ||
224 | void *escrowAnchor); | ||
225 | |||
226 | /** | ||
227 | * Function called to start the escrow of the attributes | ||
228 | * | ||
229 | * @param identity the private key of the identity | ||
230 | * @param escrowAnchor the anchor needed to restore the attributes | ||
231 | * @return GNUNET_OK if successful | ||
232 | */ | ||
233 | typedef int (*GNUNET_RECLAIM_EscrowStartAttributesEscrowFunction) ( | ||
234 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | ||
235 | void *escrowAnchor); | ||
236 | |||
237 | /** | ||
238 | * Function called to renew the escrow of the attributes | ||
239 | * | ||
240 | * @param identity the private key of the identity | ||
241 | * @param escrowAnchor the anchor needed to restore the attributes | ||
242 | * @return GNUNET_OK if successful | ||
243 | */ | ||
244 | typedef int (*GNUNET_RECLAIM_EscrowRenewAttributesEscrowFunction) ( | ||
245 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | ||
246 | void *escrowAnchor); | ||
247 | |||
203 | 248 | ||
204 | 249 | ||
205 | /** | 250 | /** |
@@ -282,6 +327,49 @@ struct GNUNET_RECLAIM_AttestationPluginFunctions | |||
282 | GNUNET_RECLAIM_AttestationGetExpirationFunction get_expiration; | 327 | GNUNET_RECLAIM_AttestationGetExpirationFunction get_expiration; |
283 | }; | 328 | }; |
284 | 329 | ||
330 | /** | ||
331 | * Each plugin is required to return a pointer to a struct of this | ||
332 | * type as the return value from its entry point. | ||
333 | */ | ||
334 | struct GNUNET_RECLAIM_EscrowKeyPluginFunctions | ||
335 | { | ||
336 | /** | ||
337 | * Closure for all of the callbacks. | ||
338 | */ | ||
339 | void *cls; | ||
340 | |||
341 | /** | ||
342 | * Start key escrow | ||
343 | */ | ||
344 | GNUNET_RECLAIM_EscrowStartKeyEscrowFunction start_key_escrow; | ||
345 | |||
346 | /** | ||
347 | * Renew key escrow | ||
348 | */ | ||
349 | GNUNET_RECLAIM_EscrowRenewKeyEscrowFunction renew_key_escrow; | ||
350 | }; | ||
351 | |||
352 | /** | ||
353 | * Each plugin is required to return a pointer to a struct of this | ||
354 | * type as the return value from its entry point. | ||
355 | */ | ||
356 | struct GNUNET_RECLAIM_EscrowAttributesPluginFunctions | ||
357 | { | ||
358 | /** | ||
359 | * Closure for all of the callbacks. | ||
360 | */ | ||
361 | void *cls; | ||
362 | |||
363 | /** | ||
364 | * Start attributes escrow | ||
365 | */ | ||
366 | GNUNET_RECLAIM_EscrowStartAttributesEscrowFunction start_attributes_escrow; | ||
367 | |||
368 | /** | ||
369 | * Renew attributes escrow | ||
370 | */ | ||
371 | GNUNET_RECLAIM_EscrowRenewAttributesEscrowFunction renew_attributes_escrow; | ||
372 | }; | ||
285 | 373 | ||
286 | 374 | ||
287 | #if 0 /* keep Emacsens' auto-indent happy */ | 375 | #if 0 /* keep Emacsens' auto-indent happy */ |