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 * Length of serialized attribute data
184 uint16_t attributes_len GNUNET_PACKED;
187 * always zero (for alignment)
189 uint16_t reserved GNUNET_PACKED;
192 * The public key of the identity.
194 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
197 * serialized attestation data
203 * Start a attribute iteration for the given identity
205 struct AttributeIterationStartMessage
210 struct GNUNET_MessageHeader header;
213 * Unique identifier for this request (for key collisions).
215 uint32_t id GNUNET_PACKED;
220 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
225 * Ask for next result of attribute iteration for the given operation
227 struct AttributeIterationNextMessage
230 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
232 struct GNUNET_MessageHeader header;
235 * Unique identifier for this request (for key collisions).
237 uint32_t id GNUNET_PACKED;
242 * Start a attestation iteration for the given identity
244 struct AttestationIterationStartMessage
249 struct GNUNET_MessageHeader header;
252 * Unique identifier for this request (for key collisions).
254 uint32_t id GNUNET_PACKED;
259 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
264 * Ask for next result of attestation iteration for the given operation
266 struct AttestationIterationNextMessage
269 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
271 struct GNUNET_MessageHeader header;
274 * Unique identifier for this request (for key collisions).
276 uint32_t id GNUNET_PACKED;
281 * Stop attestation iteration for the given operation
283 struct AttestationIterationStopMessage
286 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
288 struct GNUNET_MessageHeader header;
291 * Unique identifier for this request (for key collisions).
293 uint32_t id GNUNET_PACKED;
298 * Stop attribute iteration for the given operation
300 struct AttributeIterationStopMessage
303 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
305 struct GNUNET_MessageHeader header;
308 * Unique identifier for this request (for key collisions).
310 uint32_t id GNUNET_PACKED;
314 * Start a ticket iteration for the given identity
316 struct TicketIterationStartMessage
321 struct GNUNET_MessageHeader header;
324 * Unique identifier for this request (for key collisions).
326 uint32_t id GNUNET_PACKED;
331 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
336 * Ask for next result of ticket iteration for the given operation
338 struct TicketIterationNextMessage
341 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
343 struct GNUNET_MessageHeader header;
346 * Unique identifier for this request (for key collisions).
348 uint32_t id GNUNET_PACKED;
353 * Stop ticket iteration for the given operation
355 struct TicketIterationStopMessage
358 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
360 struct GNUNET_MessageHeader header;
363 * Unique identifier for this request (for key collisions).
365 uint32_t id GNUNET_PACKED;
370 * Ticket issue message
372 struct IssueTicketMessage
375 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
377 struct GNUNET_MessageHeader header;
380 * Unique identifier for this request (for key collisions).
382 uint32_t id GNUNET_PACKED;
387 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
392 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
395 * length of serialized attribute list
397 uint32_t attr_len GNUNET_PACKED;
399 // Followed by a serialized attribute list
403 * Ticket revoke message
405 struct RevokeTicketMessage
408 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
410 struct GNUNET_MessageHeader header;
413 * Unique identifier for this request (for key collisions).
415 uint32_t id GNUNET_PACKED;
420 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
423 * length of serialized attribute list
425 uint32_t attrs_len GNUNET_PACKED;
428 * The ticket to revoke
430 struct GNUNET_RECLAIM_Ticket ticket;
434 * Ticket revoke message
436 struct RevokeTicketResultMessage
439 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
441 struct GNUNET_MessageHeader header;
444 * Unique identifier for this request (for key collisions).
446 uint32_t id GNUNET_PACKED;
451 uint32_t success GNUNET_PACKED;
456 * Ticket result message
458 struct TicketResultMessage
461 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
463 struct GNUNET_MessageHeader header;
466 * Unique identifier for this request (for key collisions).
468 uint32_t id GNUNET_PACKED;
473 struct GNUNET_RECLAIM_Ticket ticket;
477 * Ticket consume message
479 struct ConsumeTicketMessage
482 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
484 struct GNUNET_MessageHeader header;
487 * Unique identifier for this request (for key collisions).
489 uint32_t id GNUNET_PACKED;
494 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
497 * The ticket to consume
499 struct GNUNET_RECLAIM_Ticket ticket;
503 * Attribute list is returned from the idp.
505 struct ConsumeTicketResultMessage
510 struct GNUNET_MessageHeader header;
513 * Unique identifier for this request (for key collisions).
515 uint32_t id GNUNET_PACKED;
520 uint32_t result GNUNET_PACKED;
523 * Length of serialized attribute data
525 uint16_t attrs_len GNUNET_PACKED;
528 * Length of attestation data
530 uint16_t attestations_len;
533 * always zero (for alignment)
535 uint16_t reserved GNUNET_PACKED;
538 * The public key of the identity.
540 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
543 * serialized attributes data
548 GNUNET_NETWORK_STRUCT_END