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 * Length of serialized attestation data
144 uint16_t attestation_len GNUNET_PACKED;
147 * always zero (for alignment)
149 uint16_t reserved GNUNET_PACKED;
152 * The public key of the identity.
154 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
157 * serialized attribute data
162 * Attestation is returned from the idp.
164 struct AttestationResultMessage
169 struct GNUNET_MessageHeader header;
172 * Unique identifier for this request (for key collisions).
174 uint32_t id GNUNET_PACKED;
177 * Length of serialized attribute data
179 uint16_t attestation_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 attestation data
198 * Start a attribute iteration for the given identity
200 struct AttributeIterationStartMessage
205 struct GNUNET_MessageHeader header;
208 * Unique identifier for this request (for key collisions).
210 uint32_t id GNUNET_PACKED;
215 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
220 * Ask for next result of attribute iteration for the given operation
222 struct AttributeIterationNextMessage
225 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
227 struct GNUNET_MessageHeader header;
230 * Unique identifier for this request (for key collisions).
232 uint32_t id GNUNET_PACKED;
237 * Start a attestation iteration for the given identity
239 struct AttestationIterationStartMessage
244 struct GNUNET_MessageHeader header;
247 * Unique identifier for this request (for key collisions).
249 uint32_t id GNUNET_PACKED;
254 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
259 * Ask for next result of attestation iteration for the given operation
261 struct AttestationIterationNextMessage
264 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
266 struct GNUNET_MessageHeader header;
269 * Unique identifier for this request (for key collisions).
271 uint32_t id GNUNET_PACKED;
276 * Stop attestation iteration for the given operation
278 struct AttestationIterationStopMessage
281 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
283 struct GNUNET_MessageHeader header;
286 * Unique identifier for this request (for key collisions).
288 uint32_t id GNUNET_PACKED;
293 * Stop attribute iteration for the given operation
295 struct AttributeIterationStopMessage
298 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
300 struct GNUNET_MessageHeader header;
303 * Unique identifier for this request (for key collisions).
305 uint32_t id GNUNET_PACKED;
309 * Start a ticket iteration for the given identity
311 struct TicketIterationStartMessage
316 struct GNUNET_MessageHeader header;
319 * Unique identifier for this request (for key collisions).
321 uint32_t id GNUNET_PACKED;
326 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
331 * Ask for next result of ticket iteration for the given operation
333 struct TicketIterationNextMessage
336 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
338 struct GNUNET_MessageHeader header;
341 * Unique identifier for this request (for key collisions).
343 uint32_t id GNUNET_PACKED;
348 * Stop ticket iteration for the given operation
350 struct TicketIterationStopMessage
353 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
355 struct GNUNET_MessageHeader header;
358 * Unique identifier for this request (for key collisions).
360 uint32_t id GNUNET_PACKED;
365 * Ticket issue message
367 struct IssueTicketMessage
370 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
372 struct GNUNET_MessageHeader header;
375 * Unique identifier for this request (for key collisions).
377 uint32_t id GNUNET_PACKED;
382 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
387 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
390 * length of serialized attribute list
392 uint32_t attr_len GNUNET_PACKED;
394 // Followed by a serialized attribute list
398 * Ticket revoke message
400 struct RevokeTicketMessage
403 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
405 struct GNUNET_MessageHeader header;
408 * Unique identifier for this request (for key collisions).
410 uint32_t id GNUNET_PACKED;
415 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
418 * length of serialized attribute list
420 uint32_t attrs_len GNUNET_PACKED;
423 * The ticket to revoke
425 struct GNUNET_RECLAIM_Ticket ticket;
429 * Ticket revoke message
431 struct RevokeTicketResultMessage
434 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
436 struct GNUNET_MessageHeader header;
439 * Unique identifier for this request (for key collisions).
441 uint32_t id GNUNET_PACKED;
446 uint32_t success GNUNET_PACKED;
451 * Ticket result message
453 struct TicketResultMessage
456 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
458 struct GNUNET_MessageHeader header;
461 * Unique identifier for this request (for key collisions).
463 uint32_t id GNUNET_PACKED;
468 struct GNUNET_RECLAIM_Ticket ticket;
472 * Ticket consume message
474 struct ConsumeTicketMessage
477 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
479 struct GNUNET_MessageHeader header;
482 * Unique identifier for this request (for key collisions).
484 uint32_t id GNUNET_PACKED;
489 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
492 * The ticket to consume
494 struct GNUNET_RECLAIM_Ticket ticket;
498 * Attribute list is returned from the idp.
500 struct ConsumeTicketResultMessage
505 struct GNUNET_MessageHeader header;
508 * Unique identifier for this request (for key collisions).
510 uint32_t id GNUNET_PACKED;
515 uint32_t result GNUNET_PACKED;
518 * Length of serialized attribute data
520 uint16_t attrs_len GNUNET_PACKED;
523 * Length of attestation data
525 uint16_t attestations_len;
528 * always zero (for alignment)
530 uint16_t reserved GNUNET_PACKED;
533 * The public key of the identity.
535 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
538 * serialized attributes data
543 GNUNET_NETWORK_STRUCT_END