aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim
diff options
context:
space:
mode:
authorWillow Liquorice <willow@howhill.com>2022-09-07 20:50:41 +0100
committerWillow Liquorice <willow@howhill.com>2022-10-03 00:44:35 +0100
commit2803abe19c6c65c1a98a9b69cef27b5dc363f93e (patch)
tree6658559e86a51506080c12acbf348d0964a39f8b /src/reclaim
parent8a86448236ad19365734ee3353da449c21f41a28 (diff)
downloadgnunet-2803abe19c6c65c1a98a9b69cef27b5dc363f93e.tar.gz
gnunet-2803abe19c6c65c1a98a9b69cef27b5dc363f93e.zip
-DOC: Documentation cleanup pass through RECLAIM subsystem
Diffstat (limited to 'src/reclaim')
-rw-r--r--src/reclaim/gnunet-service-reclaim.c2
-rw-r--r--src/reclaim/gnunet-service-reclaim_tickets.c10
-rw-r--r--src/reclaim/oidc_helper.c11
-rw-r--r--src/reclaim/oidc_helper.h4
-rw-r--r--src/reclaim/reclaim_api.c19
-rw-r--r--src/reclaim/reclaim_attribute.c25
-rw-r--r--src/reclaim/reclaim_credential.c29
7 files changed, 21 insertions, 79 deletions
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c
index 9f035f1bd..5290621d6 100644
--- a/src/reclaim/gnunet-service-reclaim.c
+++ b/src/reclaim/gnunet-service-reclaim.c
@@ -522,7 +522,7 @@ cleanup_adh (struct AttributeDeleteHandle *adh)
522/** 522/**
523 * Cleanup attribute store handle 523 * Cleanup attribute store handle
524 * 524 *
525 * @param handle handle to clean up 525 * @param ash handle to clean up
526 */ 526 */
527static void 527static void
528cleanup_as_handle (struct AttributeStoreHandle *ash) 528cleanup_as_handle (struct AttributeStoreHandle *ash)
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c
index 3fc885aaf..a17dfb0e2 100644
--- a/src/reclaim/gnunet-service-reclaim_tickets.c
+++ b/src/reclaim/gnunet-service-reclaim_tickets.c
@@ -485,7 +485,7 @@ rvk_ticket_update_finished (void *cls)
485 * @param cls handle to the operation 485 * @param cls handle to the operation
486 * @param zone ticket issuer private key 486 * @param zone ticket issuer private key
487 * @param label ticket rnd 487 * @param label ticket rnd
488 * @param rd_cound size of record set 488 * @param rd_count size of record set
489 * @param rd record set 489 * @param rd record set
490 */ 490 */
491static void 491static void
@@ -569,7 +569,7 @@ rvk_ns_err (void *cls)
569 * When we are done, we need to update any other ticket which 569 * When we are done, we need to update any other ticket which
570 * included references to any of the changed attributes. 570 * included references to any of the changed attributes.
571 * 571 *
572 * @param rvk handle to the operation 572 * @param rh handle to the operation
573 */ 573 */
574static void 574static void
575move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rh); 575move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rh);
@@ -835,7 +835,7 @@ remove_ticket_cont (void *cls, int32_t success, const char *emsg)
835 * @param cls handle to the operation 835 * @param cls handle to the operation
836 * @param zone the issuer key 836 * @param zone the issuer key
837 * @param label ticket rnd 837 * @param label ticket rnd
838 * @param rd_cound size of record set 838 * @param rd_count size of record set
839 * @param rd record set 839 * @param rd record set
840 */ 840 */
841static void 841static void
@@ -986,7 +986,7 @@ cleanup_cth (struct RECLAIM_TICKETS_ConsumeHandle *cth)
986 * We found an attribute record. 986 * We found an attribute record.
987 * 987 *
988 * @param cls handle to the operation 988 * @param cls handle to the operation
989 * @param rd_cound size of record set 989 * @param rd_count size of record set
990 * @param rd record set 990 * @param rd record set
991 */ 991 */
992static void 992static void
@@ -1074,7 +1074,7 @@ abort_parallel_lookups (void *cls)
1074 * attribute record under the referenced label. 1074 * attribute record under the referenced label.
1075 * 1075 *
1076 * @param cls handle to the operation 1076 * @param cls handle to the operation
1077 * @param rd_cound size of the record set 1077 * @param rd_count size of the record set
1078 * @param rd record set 1078 * @param rd record set
1079 */ 1079 */
1080static void 1080static void
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index c87514a6b..647ebe302 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -424,17 +424,6 @@ generate_id_token_body (const struct GNUNET_IDENTITY_PublicKey *aud_key,
424} 424}
425 425
426 426
427/**
428 * Create a JWT using RSA256 algorithm from attributes
429 *
430 * @param aud_key the public of the audience
431 * @param sub_key the public key of the subject
432 * @param attrs the attribute list
433 * @param presentations credential presentation list (may be empty)
434 * @param expiration_time the validity of the token
435 * @param secret_rsa_key the key used to sign the JWT
436 * @return a new base64-encoded JWT string.
437 */
438char * 427char *
439OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key, 428OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key,
440 const struct GNUNET_IDENTITY_PublicKey *sub_key, 429 const struct GNUNET_IDENTITY_PublicKey *sub_key,
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h
index 21c7aa86e..81eadf2ed 100644
--- a/src/reclaim/oidc_helper.h
+++ b/src/reclaim/oidc_helper.h
@@ -50,14 +50,14 @@ enum OIDC_VerificationOptions
50}; 50};
51 51
52/** 52/**
53 * Create a JWT using RSA256 from attributes 53 * Create a JWT using RSA256 algorithm from attributes
54 * 54 *
55 * @param aud_key the public of the audience 55 * @param aud_key the public of the audience
56 * @param sub_key the public key of the subject 56 * @param sub_key the public key of the subject
57 * @param attrs the attribute list 57 * @param attrs the attribute list
58 * @param presentations credential presentation list (may be empty) 58 * @param presentations credential presentation list (may be empty)
59 * @param expiration_time the validity of the token 59 * @param expiration_time the validity of the token
60 * @param secret_key the key used to sign the JWT 60 * @param secret_rsa_key the key used to sign the JWT
61 * @return a new base64-encoded JWT string. 61 * @return a new base64-encoded JWT string.
62 */ 62 */
63char * 63char *
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index a61505d62..6f55d62e4 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -1206,7 +1206,7 @@ struct GNUNET_RECLAIM_Operation *
1206GNUNET_RECLAIM_credential_store ( 1206GNUNET_RECLAIM_credential_store (
1207 struct GNUNET_RECLAIM_Handle *h, 1207 struct GNUNET_RECLAIM_Handle *h,
1208 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1208 const struct GNUNET_IDENTITY_PrivateKey *pkey,
1209 const struct GNUNET_RECLAIM_Credential *attr, 1209 const struct GNUNET_RECLAIM_Credential *credential,
1210 const struct GNUNET_TIME_Relative *exp_interval, 1210 const struct GNUNET_TIME_Relative *exp_interval,
1211 GNUNET_RECLAIM_ContinuationWithStatus cont, 1211 GNUNET_RECLAIM_ContinuationWithStatus cont,
1212 void *cont_cls) 1212 void *cont_cls)
@@ -1221,7 +1221,7 @@ GNUNET_RECLAIM_credential_store (
1221 op->cls = cont_cls; 1221 op->cls = cont_cls;
1222 op->r_id = h->r_id_gen++; 1222 op->r_id = h->r_id_gen++;
1223 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); 1223 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1224 attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr); 1224 attr_len = GNUNET_RECLAIM_credential_serialize_get_size (credential);
1225 op->env = GNUNET_MQ_msg_extra (sam, 1225 op->env = GNUNET_MQ_msg_extra (sam,
1226 attr_len, 1226 attr_len,
1227 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); 1227 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE);
@@ -1229,7 +1229,7 @@ GNUNET_RECLAIM_credential_store (
1229 sam->id = htonl (op->r_id); 1229 sam->id = htonl (op->r_id);
1230 sam->exp = GNUNET_htonll (exp_interval->rel_value_us); 1230 sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1231 1231
1232 GNUNET_RECLAIM_credential_serialize (attr, (char *) &sam[1]); 1232 GNUNET_RECLAIM_credential_serialize (credential, (char *) &sam[1]);
1233 1233
1234 sam->attr_len = htons (attr_len); 1234 sam->attr_len = htons (attr_len);
1235 if (NULL != h->mq) 1235 if (NULL != h->mq)
@@ -1439,12 +1439,6 @@ GNUNET_RECLAIM_get_credentials_start (
1439} 1439}
1440 1440
1441 1441
1442/**
1443 * Calls the record processor specified in #GNUNET_RECLAIM_get_credential_start
1444 * for the next record.
1445 *
1446 * @param it the iterator
1447 */
1448void 1442void
1449GNUNET_RECLAIM_get_credentials_next (struct 1443GNUNET_RECLAIM_get_credentials_next (struct
1450 GNUNET_RECLAIM_CredentialIterator *ait) 1444 GNUNET_RECLAIM_CredentialIterator *ait)
@@ -1460,13 +1454,6 @@ GNUNET_RECLAIM_get_credentials_next (struct
1460} 1454}
1461 1455
1462 1456
1463/**
1464 * Stops iteration and releases the handle for further calls. Must
1465 * be called on any iteration that has not yet completed prior to calling
1466 * #GNUNET_RECLAIM_disconnect.
1467 *
1468 * @param it the iterator
1469 */
1470void 1457void
1471GNUNET_RECLAIM_get_credentials_stop (struct 1458GNUNET_RECLAIM_get_credentials_stop (struct
1472 GNUNET_RECLAIM_CredentialIterator *ait) 1459 GNUNET_RECLAIM_CredentialIterator *ait)
diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c
index 5d7adb7e6..b5c41b2d1 100644
--- a/src/reclaim/reclaim_attribute.c
+++ b/src/reclaim/reclaim_attribute.c
@@ -325,16 +325,9 @@ GNUNET_RECLAIM_attribute_list_serialize_get_size (
325} 325}
326 326
327 327
328/**
329 * Serialize an attribute list
330 *
331 * @param attrs the attribute list to serialize
332 * @param result the serialized attribute
333 * @return length of serialized data
334 */
335size_t 328size_t
336GNUNET_RECLAIM_attribute_list_serialize ( 329GNUNET_RECLAIM_attribute_list_serialize (
337 const struct GNUNET_RECLAIM_AttributeList *al, 330 const struct GNUNET_RECLAIM_AttributeList *attrs,
338 char *result) 331 char *result)
339{ 332{
340 struct GNUNET_RECLAIM_AttributeListEntry *ale; 333 struct GNUNET_RECLAIM_AttributeListEntry *ale;
@@ -343,7 +336,7 @@ GNUNET_RECLAIM_attribute_list_serialize (
343 char *write_ptr; 336 char *write_ptr;
344 write_ptr = result; 337 write_ptr = result;
345 total_len = 0; 338 total_len = 0;
346 for (ale = al->list_head; NULL != ale; ale = ale->next) 339 for (ale = attrs->list_head; NULL != ale; ale = ale->next)
347 { 340 {
348 GNUNET_assert (NULL != ale->attribute); 341 GNUNET_assert (NULL != ale->attribute);
349 len = GNUNET_RECLAIM_attribute_serialize (ale->attribute, write_ptr); 342 len = GNUNET_RECLAIM_attribute_serialize (ale->attribute, write_ptr);
@@ -396,21 +389,16 @@ GNUNET_RECLAIM_attribute_list_deserialize (const char *data, size_t data_size)
396} 389}
397 390
398 391
399/**
400 * Make a (deep) copy of a claim list
401 * @param attrs claim list to copy
402 * @return copied claim list
403 */
404struct GNUNET_RECLAIM_AttributeList * 392struct GNUNET_RECLAIM_AttributeList *
405GNUNET_RECLAIM_attribute_list_dup ( 393GNUNET_RECLAIM_attribute_list_dup (
406 const struct GNUNET_RECLAIM_AttributeList *al) 394 const struct GNUNET_RECLAIM_AttributeList *attrs)
407{ 395{
408 struct GNUNET_RECLAIM_AttributeListEntry *ale; 396 struct GNUNET_RECLAIM_AttributeListEntry *ale;
409 struct GNUNET_RECLAIM_AttributeListEntry *result_ale; 397 struct GNUNET_RECLAIM_AttributeListEntry *result_ale;
410 struct GNUNET_RECLAIM_AttributeList *result; 398 struct GNUNET_RECLAIM_AttributeList *result;
411 399
412 result = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); 400 result = GNUNET_new (struct GNUNET_RECLAIM_AttributeList);
413 for (ale = al->list_head; NULL != ale; ale = ale->next) 401 for (ale = attrs->list_head; NULL != ale; ale = ale->next)
414 { 402 {
415 result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry); 403 result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry);
416 GNUNET_assert (NULL != ale->attribute); 404 GNUNET_assert (NULL != ale->attribute);
@@ -433,11 +421,6 @@ GNUNET_RECLAIM_attribute_list_dup (
433} 421}
434 422
435 423
436/**
437 * Destroy claim list
438 *
439 * @param attrs list to destroy
440 */
441void 424void
442GNUNET_RECLAIM_attribute_list_destroy ( 425GNUNET_RECLAIM_attribute_list_destroy (
443 struct GNUNET_RECLAIM_AttributeList *al) 426 struct GNUNET_RECLAIM_AttributeList *al)
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c
index b1312f403..6dc1a1fcf 100644
--- a/src/reclaim/reclaim_credential.c
+++ b/src/reclaim/reclaim_credential.c
@@ -301,13 +301,6 @@ GNUNET_RECLAIM_credential_list_serialize_get_size (
301} 301}
302 302
303 303
304/**
305 * Serialize an attribute list
306 *
307 * @param attrs the attribute list to serialize
308 * @param result the serialized attribute
309 * @return length of serialized data
310 */
311size_t 304size_t
312GNUNET_RECLAIM_credential_list_serialize ( 305GNUNET_RECLAIM_credential_list_serialize (
313 const struct GNUNET_RECLAIM_CredentialList *credentials, 306 const struct GNUNET_RECLAIM_CredentialList *credentials,
@@ -399,19 +392,14 @@ GNUNET_RECLAIM_credential_list_dup (
399} 392}
400 393
401 394
402/**
403 * Destroy credential list
404 *
405 * @param attrs list to destroy
406 */
407void 395void
408GNUNET_RECLAIM_credential_list_destroy ( 396GNUNET_RECLAIM_credential_list_destroy (
409 struct GNUNET_RECLAIM_CredentialList *al) 397 struct GNUNET_RECLAIM_CredentialList *credentials)
410{ 398{
411 struct GNUNET_RECLAIM_CredentialListEntry *ale; 399 struct GNUNET_RECLAIM_CredentialListEntry *ale;
412 struct GNUNET_RECLAIM_CredentialListEntry *tmp_ale; 400 struct GNUNET_RECLAIM_CredentialListEntry *tmp_ale;
413 401
414 for (ale = al->list_head; NULL != ale;) 402 for (ale = credentials->list_head; NULL != ale;)
415 { 403 {
416 if (NULL != ale->credential) 404 if (NULL != ale->credential)
417 GNUNET_free (ale->credential); 405 GNUNET_free (ale->credential);
@@ -419,7 +407,7 @@ GNUNET_RECLAIM_credential_list_destroy (
419 ale = ale->next; 407 ale = ale->next;
420 GNUNET_free (tmp_ale); 408 GNUNET_free (tmp_ale);
421 } 409 }
422 GNUNET_free (al); 410 GNUNET_free (credentials);
423} 411}
424 412
425 413
@@ -826,19 +814,14 @@ GNUNET_RECLAIM_presentation_list_dup (
826} 814}
827 815
828 816
829/**
830 * Destroy presentation list
831 *
832 * @param attrs list to destroy
833 */
834void 817void
835GNUNET_RECLAIM_presentation_list_destroy ( 818GNUNET_RECLAIM_presentation_list_destroy (
836 struct GNUNET_RECLAIM_PresentationList *al) 819 struct GNUNET_RECLAIM_PresentationList *presentations)
837{ 820{
838 struct GNUNET_RECLAIM_PresentationListEntry *ale; 821 struct GNUNET_RECLAIM_PresentationListEntry *ale;
839 struct GNUNET_RECLAIM_PresentationListEntry *tmp_ale; 822 struct GNUNET_RECLAIM_PresentationListEntry *tmp_ale;
840 823
841 for (ale = al->list_head; NULL != ale;) 824 for (ale = presentations->list_head; NULL != ale;)
842 { 825 {
843 if (NULL != ale->presentation) 826 if (NULL != ale->presentation)
844 GNUNET_free (ale->presentation); 827 GNUNET_free (ale->presentation);
@@ -846,7 +829,7 @@ GNUNET_RECLAIM_presentation_list_destroy (
846 ale = ale->next; 829 ale = ale->next;
847 GNUNET_free (tmp_ale); 830 GNUNET_free (tmp_ale);
848 } 831 }
849 GNUNET_free (al); 832 GNUNET_free (presentations);
850} 833}
851 834
852 835