diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-29 18:06:26 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-29 18:06:26 +0900 |
commit | 0f2da4636e108c70697c589d9e38781f2bafefba (patch) | |
tree | 0e831befd71d4323596cdae55e8431df7720c531 /src/reclaim/reclaim.h | |
parent | 4e2259f14be320c8e2fe2a672a473e09677269c4 (diff) | |
download | gnunet-0f2da4636e108c70697c589d9e38781f2bafefba.tar.gz gnunet-0f2da4636e108c70697c589d9e38781f2bafefba.zip |
IDENTITY
This commit is a major rework of the unclean GNUNET_IDENTITY_*Key
structures and its use in serialized objects (e.g. RPC messages).
The structures are now no longer to be used directly but instead through
their serialization helper functions whenever needed.
Diffstat (limited to 'src/reclaim/reclaim.h')
-rw-r--r-- | src/reclaim/reclaim.h | 127 |
1 files changed, 80 insertions, 47 deletions
diff --git a/src/reclaim/reclaim.h b/src/reclaim/reclaim.h index aae8ee89a..5813beaf7 100644 --- a/src/reclaim/reclaim.h +++ b/src/reclaim/reclaim.h | |||
@@ -45,6 +45,11 @@ struct AttributeStoreMessage | |||
45 | struct GNUNET_MessageHeader header; | 45 | struct GNUNET_MessageHeader header; |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * The expiration interval of the attribute | ||
49 | */ | ||
50 | uint64_t exp GNUNET_PACKED; | ||
51 | |||
52 | /** | ||
48 | * Unique identifier for this request (for key collisions). | 53 | * Unique identifier for this request (for key collisions). |
49 | */ | 54 | */ |
50 | uint32_t id GNUNET_PACKED; | 55 | uint32_t id GNUNET_PACKED; |
@@ -55,16 +60,13 @@ struct AttributeStoreMessage | |||
55 | uint32_t attr_len GNUNET_PACKED; | 60 | uint32_t attr_len GNUNET_PACKED; |
56 | 61 | ||
57 | /** | 62 | /** |
58 | * The expiration interval of the attribute | 63 | * The length of the private key |
59 | */ | ||
60 | uint64_t exp GNUNET_PACKED; | ||
61 | |||
62 | /** | ||
63 | * Identity | ||
64 | */ | 64 | */ |
65 | struct GNUNET_IDENTITY_PrivateKey identity; | 65 | uint32_t key_len GNUNET_PACKED; |
66 | 66 | ||
67 | /* followed by the serialized attribute */ | 67 | /* |
68 | * followed by the zone private key | ||
69 | * followed by the serialized attribute */ | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | 72 | ||
@@ -89,9 +91,9 @@ struct AttributeDeleteMessage | |||
89 | uint32_t attr_len GNUNET_PACKED; | 91 | uint32_t attr_len GNUNET_PACKED; |
90 | 92 | ||
91 | /** | 93 | /** |
92 | * Identity | 94 | * The length of the private key |
93 | */ | 95 | */ |
94 | struct GNUNET_IDENTITY_PrivateKey identity; | 96 | uint32_t key_len GNUNET_PACKED; |
95 | 97 | ||
96 | /* followed by the serialized attribute */ | 98 | /* followed by the serialized attribute */ |
97 | }; | 99 | }; |
@@ -149,11 +151,13 @@ struct AttributeResultMessage | |||
149 | uint16_t reserved GNUNET_PACKED; | 151 | uint16_t reserved GNUNET_PACKED; |
150 | 152 | ||
151 | /** | 153 | /** |
152 | * The public key of the identity. | 154 | * The length of the public key |
153 | */ | 155 | */ |
154 | struct GNUNET_IDENTITY_PublicKey identity; | 156 | uint32_t pkey_len GNUNET_PACKED; |
155 | 157 | ||
156 | /* followed by: | 158 | /** |
159 | * followed by the public key key. | ||
160 | * followed by: | ||
157 | * serialized attribute data | 161 | * serialized attribute data |
158 | */ | 162 | */ |
159 | }; | 163 | }; |
@@ -184,11 +188,13 @@ struct CredentialResultMessage | |||
184 | uint16_t reserved GNUNET_PACKED; | 188 | uint16_t reserved GNUNET_PACKED; |
185 | 189 | ||
186 | /** | 190 | /** |
187 | * The public key of the identity. | 191 | * The length of the public key |
188 | */ | 192 | */ |
189 | struct GNUNET_IDENTITY_PublicKey identity; | 193 | uint32_t key_len GNUNET_PACKED; |
190 | 194 | ||
191 | /* followed by: | 195 | /** |
196 | * followed by the private key. | ||
197 | * followed by: | ||
192 | * serialized credential data | 198 | * serialized credential data |
193 | */ | 199 | */ |
194 | }; | 200 | }; |
@@ -210,9 +216,13 @@ struct AttributeIterationStartMessage | |||
210 | uint32_t id GNUNET_PACKED; | 216 | uint32_t id GNUNET_PACKED; |
211 | 217 | ||
212 | /** | 218 | /** |
213 | * Identity. | 219 | * The length of the private key |
220 | */ | ||
221 | uint32_t key_len GNUNET_PACKED; | ||
222 | |||
223 | /** | ||
224 | * followed by the private key. | ||
214 | */ | 225 | */ |
215 | struct GNUNET_IDENTITY_PrivateKey identity; | ||
216 | }; | 226 | }; |
217 | 227 | ||
218 | 228 | ||
@@ -249,9 +259,13 @@ struct CredentialIterationStartMessage | |||
249 | uint32_t id GNUNET_PACKED; | 259 | uint32_t id GNUNET_PACKED; |
250 | 260 | ||
251 | /** | 261 | /** |
252 | * Identity. | 262 | * The length of the private key |
263 | */ | ||
264 | uint32_t key_len GNUNET_PACKED; | ||
265 | |||
266 | /** | ||
267 | * followed by the private key. | ||
253 | */ | 268 | */ |
254 | struct GNUNET_IDENTITY_PrivateKey identity; | ||
255 | }; | 269 | }; |
256 | 270 | ||
257 | 271 | ||
@@ -321,9 +335,13 @@ struct TicketIterationStartMessage | |||
321 | uint32_t id GNUNET_PACKED; | 335 | uint32_t id GNUNET_PACKED; |
322 | 336 | ||
323 | /** | 337 | /** |
324 | * Identity. | 338 | * The length of the private key |
339 | */ | ||
340 | uint32_t key_len GNUNET_PACKED; | ||
341 | |||
342 | /** | ||
343 | * followed by the private key. | ||
325 | */ | 344 | */ |
326 | struct GNUNET_IDENTITY_PrivateKey identity; | ||
327 | }; | 345 | }; |
328 | 346 | ||
329 | 347 | ||
@@ -377,21 +395,25 @@ struct IssueTicketMessage | |||
377 | uint32_t id GNUNET_PACKED; | 395 | uint32_t id GNUNET_PACKED; |
378 | 396 | ||
379 | /** | 397 | /** |
380 | * Identity. | 398 | * length of serialized attribute list |
381 | */ | 399 | */ |
382 | struct GNUNET_IDENTITY_PrivateKey identity; | 400 | uint32_t attr_len GNUNET_PACKED; |
383 | 401 | ||
384 | /** | 402 | /** |
385 | * Requesting party. | 403 | * The length of the identity private key |
386 | */ | 404 | */ |
387 | struct GNUNET_IDENTITY_PublicKey rp; | 405 | uint32_t key_len GNUNET_PACKED; |
388 | 406 | ||
389 | /** | 407 | /** |
390 | * length of serialized attribute list | 408 | * The length of the relying party public key |
391 | */ | 409 | */ |
392 | uint32_t attr_len GNUNET_PACKED; | 410 | uint32_t pkey_len GNUNET_PACKED; |
393 | 411 | ||
394 | // Followed by a serialized attribute list | 412 | /** |
413 | * Followed by the private key. | ||
414 | * Followed by the public key. | ||
415 | * Followed by a serialized attribute list | ||
416 | */ | ||
395 | }; | 417 | }; |
396 | 418 | ||
397 | /** | 419 | /** |
@@ -410,19 +432,20 @@ struct RevokeTicketMessage | |||
410 | uint32_t id GNUNET_PACKED; | 432 | uint32_t id GNUNET_PACKED; |
411 | 433 | ||
412 | /** | 434 | /** |
413 | * Identity. | 435 | * The length of the private key |
414 | */ | 436 | */ |
415 | struct GNUNET_IDENTITY_PrivateKey identity; | 437 | uint32_t key_len GNUNET_PACKED; |
416 | 438 | ||
417 | /** | 439 | /** |
418 | * length of serialized attribute list | 440 | * The length of the ticket |
419 | */ | 441 | */ |
420 | uint32_t attrs_len GNUNET_PACKED; | 442 | uint32_t tkt_len GNUNET_PACKED; |
421 | 443 | ||
422 | /** | 444 | /** |
423 | * The ticket to revoke | 445 | * Followed by the serialized ticket. |
446 | * Followed by the private key. | ||
447 | * Followed by a serialized attribute list | ||
424 | */ | 448 | */ |
425 | struct GNUNET_RECLAIM_Ticket ticket; | ||
426 | }; | 449 | }; |
427 | 450 | ||
428 | /** | 451 | /** |
@@ -463,16 +486,19 @@ struct TicketResultMessage | |||
463 | uint32_t id GNUNET_PACKED; | 486 | uint32_t id GNUNET_PACKED; |
464 | 487 | ||
465 | /** | 488 | /** |
466 | * Length of new presentations created | 489 | * Ticket length |
467 | */ | 490 | */ |
468 | uint32_t presentations_len GNUNET_PACKED; | 491 | uint32_t tkt_len GNUNET_PACKED; |
469 | 492 | ||
470 | /** | 493 | /** |
471 | * The new ticket | 494 | * Length of new presentations created |
472 | */ | 495 | */ |
473 | struct GNUNET_RECLAIM_Ticket ticket; | 496 | uint32_t presentations_len GNUNET_PACKED; |
474 | 497 | ||
475 | /* Followed by the serialized GNUNET_RECLAIM_PresentationList */ | 498 | /* |
499 | * Followed by the serialized ticket | ||
500 | * Followed by the serialized GNUNET_RECLAIM_PresentationList | ||
501 | */ | ||
476 | }; | 502 | }; |
477 | 503 | ||
478 | /** | 504 | /** |
@@ -491,14 +517,19 @@ struct ConsumeTicketMessage | |||
491 | uint32_t id GNUNET_PACKED; | 517 | uint32_t id GNUNET_PACKED; |
492 | 518 | ||
493 | /** | 519 | /** |
494 | * Identity. | 520 | * The length of the private key |
495 | */ | 521 | */ |
496 | struct GNUNET_IDENTITY_PrivateKey identity; | 522 | uint32_t key_len GNUNET_PACKED; |
497 | 523 | ||
498 | /** | 524 | /** |
499 | * The ticket to consume | 525 | * The length of the ticket |
526 | */ | ||
527 | uint32_t tkt_len GNUNET_PACKED; | ||
528 | |||
529 | /** | ||
530 | * Followed by the private key. | ||
531 | * Followed by the serialized ticket. | ||
500 | */ | 532 | */ |
501 | struct GNUNET_RECLAIM_Ticket ticket; | ||
502 | }; | 533 | }; |
503 | 534 | ||
504 | /** | 535 | /** |
@@ -537,11 +568,13 @@ struct ConsumeTicketResultMessage | |||
537 | uint16_t reserved GNUNET_PACKED; | 568 | uint16_t reserved GNUNET_PACKED; |
538 | 569 | ||
539 | /** | 570 | /** |
540 | * The public key of the identity. | 571 | * The length of the private key |
541 | */ | 572 | */ |
542 | struct GNUNET_IDENTITY_PublicKey identity; | 573 | uint32_t key_len GNUNET_PACKED; |
543 | 574 | ||
544 | /* followed by: | 575 | /** |
576 | * Followed by the private key. | ||
577 | * followed by: | ||
545 | * serialized attributes data | 578 | * serialized attributes data |
546 | */ | 579 | */ |
547 | }; | 580 | }; |