2 This file is part of GNUnet.
3 Copyright (C) 2016 GNUnet e.V.
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
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
22 * @author Martin Schanzenbach
23 * @file reclaim/reclaim.h
25 * @brief Common type definitions for the identity provider
31 #include "gnunet_common.h"
34 GNUNET_NETWORK_STRUCT_BEGIN
38 * Use to store an identity attribute
40 struct AttributeStoreMessage
43 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
45 struct GNUNET_MessageHeader header;
48 * Unique identifier for this request (for key collisions).
50 uint32_t id GNUNET_PACKED;
53 * The length of the attribute
55 uint32_t attr_len GNUNET_PACKED;
58 * The expiration interval of the attribute
60 uint64_t exp GNUNET_PACKED;
65 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
67 /* followed by the serialized attribute */
72 * Use to delete an identity attribute
74 struct AttributeDeleteMessage
77 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
79 struct GNUNET_MessageHeader header;
82 * Unique identifier for this request (for key collisions).
84 uint32_t id GNUNET_PACKED;
87 * The length of the attribute
89 uint32_t attr_len GNUNET_PACKED;
94 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
96 /* followed by the serialized attribute */
101 * Attribute store/delete response message
103 struct SuccessResultMessage
108 struct GNUNET_MessageHeader header;
111 * Unique identifier for this request (for key collisions).
113 uint32_t id GNUNET_PACKED;
116 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
118 int32_t op_result GNUNET_PACKED;
122 * Attribute is returned from the idp.
124 struct AttributeResultMessage
129 struct GNUNET_MessageHeader header;
132 * Unique identifier for this request (for key collisions).
134 uint32_t id GNUNET_PACKED;
137 * Length of serialized attribute data
139 uint16_t attr_len GNUNET_PACKED;
142 * always zero (for alignment)
144 uint16_t reserved GNUNET_PACKED;
147 * The public key of the identity.
149 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
152 * serialized attribute data
157 * Reference plus Attestation is returned from the idp.
159 struct ReferenceResultMessage
164 struct GNUNET_MessageHeader header;
167 * Unique identifier for this request (for key collisions).
169 uint32_t id GNUNET_PACKED;
172 * Length of serialized attestation data
174 uint16_t attest_len GNUNET_PACKED;
177 * Length of serialized reference data
179 uint16_t ref_len GNUNET_PACKED;
182 * always zero (for alignment)
184 uint16_t reserved GNUNET_PACKED;
187 * The public key of the identity.
189 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
192 * serialized reference data + attestation data
197 * Start a attribute iteration for the given identity
199 struct AttributeIterationStartMessage
204 struct GNUNET_MessageHeader header;
207 * Unique identifier for this request (for key collisions).
209 uint32_t id GNUNET_PACKED;
214 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
219 * Ask for next result of attribute iteration for the given operation
221 struct AttributeIterationNextMessage
224 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
226 struct GNUNET_MessageHeader header;
229 * Unique identifier for this request (for key collisions).
231 uint32_t id GNUNET_PACKED;
236 * Stop attribute iteration for the given operation
238 struct AttributeIterationStopMessage
241 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
243 struct GNUNET_MessageHeader header;
246 * Unique identifier for this request (for key collisions).
248 uint32_t id GNUNET_PACKED;
252 * Start a ticket iteration for the given identity
254 struct TicketIterationStartMessage
259 struct GNUNET_MessageHeader header;
262 * Unique identifier for this request (for key collisions).
264 uint32_t id GNUNET_PACKED;
269 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
274 * Ask for next result of ticket iteration for the given operation
276 struct TicketIterationNextMessage
279 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
281 struct GNUNET_MessageHeader header;
284 * Unique identifier for this request (for key collisions).
286 uint32_t id GNUNET_PACKED;
291 * Stop ticket iteration for the given operation
293 struct TicketIterationStopMessage
296 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
298 struct GNUNET_MessageHeader header;
301 * Unique identifier for this request (for key collisions).
303 uint32_t id GNUNET_PACKED;
308 * Ticket issue message
310 struct IssueTicketMessage
313 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
315 struct GNUNET_MessageHeader header;
318 * Unique identifier for this request (for key collisions).
320 uint32_t id GNUNET_PACKED;
325 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
330 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
333 * length of serialized attribute list
335 uint32_t attr_len GNUNET_PACKED;
337 // Followed by a serialized attribute list
341 * Ticket revoke message
343 struct RevokeTicketMessage
346 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
348 struct GNUNET_MessageHeader header;
351 * Unique identifier for this request (for key collisions).
353 uint32_t id GNUNET_PACKED;
358 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
361 * length of serialized attribute list
363 uint32_t attrs_len GNUNET_PACKED;
366 * The ticket to revoke
368 struct GNUNET_RECLAIM_Ticket ticket;
372 * Ticket revoke message
374 struct RevokeTicketResultMessage
377 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
379 struct GNUNET_MessageHeader header;
382 * Unique identifier for this request (for key collisions).
384 uint32_t id GNUNET_PACKED;
389 uint32_t success GNUNET_PACKED;
394 * Ticket result message
396 struct TicketResultMessage
399 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
401 struct GNUNET_MessageHeader header;
404 * Unique identifier for this request (for key collisions).
406 uint32_t id GNUNET_PACKED;
411 struct GNUNET_RECLAIM_Ticket ticket;
415 * Ticket consume message
417 struct ConsumeTicketMessage
420 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
422 struct GNUNET_MessageHeader header;
425 * Unique identifier for this request (for key collisions).
427 uint32_t id GNUNET_PACKED;
432 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
435 * The ticket to consume
437 struct GNUNET_RECLAIM_Ticket ticket;
441 * Attribute list is returned from the idp.
443 struct ConsumeTicketResultMessage
448 struct GNUNET_MessageHeader header;
451 * Unique identifier for this request (for key collisions).
453 uint32_t id GNUNET_PACKED;
458 uint32_t result GNUNET_PACKED;
461 * Length of serialized attribute data
463 uint16_t attrs_len GNUNET_PACKED;
466 * always zero (for alignment)
468 uint16_t reserved GNUNET_PACKED;
471 * The public key of the identity.
473 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
476 * serialized attributes data
481 GNUNET_NETWORK_STRUCT_END