diff options
Diffstat (limited to 'src/reclaim')
-rw-r--r-- | src/reclaim/did.h | 4 | ||||
-rw-r--r-- | src/reclaim/gnunet-service-reclaim.c | 16 | ||||
-rw-r--r-- | src/reclaim/gnunet-service-reclaim_tickets.c | 21 | ||||
-rw-r--r-- | src/reclaim/oidc_helper.c | 11 | ||||
-rw-r--r-- | src/reclaim/oidc_helper.h | 6 | ||||
-rw-r--r-- | src/reclaim/reclaim_api.c | 69 | ||||
-rw-r--r-- | src/reclaim/reclaim_attribute.c | 33 | ||||
-rw-r--r-- | src/reclaim/reclaim_credential.c | 72 |
8 files changed, 32 insertions, 200 deletions
diff --git a/src/reclaim/did.h b/src/reclaim/did.h index fc465da3b..42f65db26 100644 --- a/src/reclaim/did.h +++ b/src/reclaim/did.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | /** | 26 | /** |
27 | * Create a DID string from an ego in the format | 27 | * Create a DID string from an ego in the format |
28 | * did:gns:<pubkey> | 28 | * did:gns:\<pubkey\> |
29 | * | 29 | * |
30 | * @param ego the Ego to use | 30 | * @param ego the Ego to use |
31 | * @return the DID string | 31 | * @return the DID string |
@@ -36,7 +36,7 @@ DID_ego_to_did (struct GNUNET_IDENTITY_Ego *ego); | |||
36 | 36 | ||
37 | /** | 37 | /** |
38 | * Extract the public key from a DID | 38 | * Extract the public key from a DID |
39 | * in the format did:gns:<pubkey> | 39 | * in the format did:gns:\<pubkey\> |
40 | * | 40 | * |
41 | * @param did the DID parse | 41 | * @param did the DID parse |
42 | * @param pk where to store the public key | 42 | * @param pk where to store the public key |
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c index 84a98d1e4..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 | */ |
527 | static void | 527 | static void |
528 | cleanup_as_handle (struct AttributeStoreHandle *ash) | 528 | cleanup_as_handle (struct AttributeStoreHandle *ash) |
@@ -723,8 +723,8 @@ issue_ticket_result_cb (void *cls, | |||
723 | /** | 723 | /** |
724 | * Check issue ticket message | 724 | * Check issue ticket message |
725 | * | 725 | * |
726 | * @cls unused | 726 | * @param cls unused |
727 | * @im message to check | 727 | * @param im message to check |
728 | * @return GNUNET_OK if message is ok | 728 | * @return GNUNET_OK if message is ok |
729 | */ | 729 | */ |
730 | static int | 730 | static int |
@@ -937,7 +937,7 @@ check_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) | |||
937 | * Handle a consume ticket message | 937 | * Handle a consume ticket message |
938 | * | 938 | * |
939 | * @param cls our client handle | 939 | * @param cls our client handle |
940 | * @cm the message to handle | 940 | * @param cm the message to handle |
941 | */ | 941 | */ |
942 | static void | 942 | static void |
943 | handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) | 943 | handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) |
@@ -1686,8 +1686,8 @@ attr_delete_cont (void *cls, int32_t success, const char *emsg) | |||
1686 | /** | 1686 | /** |
1687 | * Check attribute delete message format | 1687 | * Check attribute delete message format |
1688 | * | 1688 | * |
1689 | * @cls unused | 1689 | * @param cls unused |
1690 | * @dam message to check | 1690 | * @param dam message to check |
1691 | */ | 1691 | */ |
1692 | static int | 1692 | static int |
1693 | check_attribute_delete_message (void *cls, | 1693 | check_attribute_delete_message (void *cls, |
@@ -1777,8 +1777,8 @@ cred_delete_cont (void *cls, int32_t success, const char *emsg) | |||
1777 | /** | 1777 | /** |
1778 | * Check credential delete message format | 1778 | * Check credential delete message format |
1779 | * | 1779 | * |
1780 | * @cls unused | 1780 | * @param cls unused |
1781 | * @dam message to check | 1781 | * @param dam message to check |
1782 | */ | 1782 | */ |
1783 | static int | 1783 | static int |
1784 | check_credential_delete_message (void *cls, | 1784 | check_credential_delete_message (void *cls, |
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c index 23b617a7f..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 | */ |
491 | static void | 491 | static void |
@@ -568,9 +568,8 @@ rvk_ns_err (void *cls) | |||
568 | * want to revoke. | 568 | * want to revoke. |
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 | * (Implementation further below) | ||
572 | * | 571 | * |
573 | * @param rvk handle to the operation | 572 | * @param rh handle to the operation |
574 | */ | 573 | */ |
575 | static void | 574 | static void |
576 | move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rh); | 575 | move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rh); |
@@ -757,14 +756,6 @@ rvk_move_attr_cb (void *cls, | |||
757 | } | 756 | } |
758 | 757 | ||
759 | 758 | ||
760 | /** | ||
761 | * We change every attribute ID of the ticket attributes we | ||
762 | * want to revoke. | ||
763 | * When we are done, we need to update any other ticket which | ||
764 | * included references to any of the changed attributes. | ||
765 | * | ||
766 | * @param rvk handle to the operation | ||
767 | */ | ||
768 | static void | 759 | static void |
769 | move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rvk) | 760 | move_attrs (struct RECLAIM_TICKETS_RevokeHandle *rvk) |
770 | { | 761 | { |
@@ -844,7 +835,7 @@ remove_ticket_cont (void *cls, int32_t success, const char *emsg) | |||
844 | * @param cls handle to the operation | 835 | * @param cls handle to the operation |
845 | * @param zone the issuer key | 836 | * @param zone the issuer key |
846 | * @param label ticket rnd | 837 | * @param label ticket rnd |
847 | * @param rd_cound size of record set | 838 | * @param rd_count size of record set |
848 | * @param rd record set | 839 | * @param rd record set |
849 | */ | 840 | */ |
850 | static void | 841 | static void |
@@ -995,7 +986,7 @@ cleanup_cth (struct RECLAIM_TICKETS_ConsumeHandle *cth) | |||
995 | * We found an attribute record. | 986 | * We found an attribute record. |
996 | * | 987 | * |
997 | * @param cls handle to the operation | 988 | * @param cls handle to the operation |
998 | * @param rd_cound size of record set | 989 | * @param rd_count size of record set |
999 | * @param rd record set | 990 | * @param rd record set |
1000 | */ | 991 | */ |
1001 | static void | 992 | static void |
@@ -1083,7 +1074,7 @@ abort_parallel_lookups (void *cls) | |||
1083 | * attribute record under the referenced label. | 1074 | * attribute record under the referenced label. |
1084 | * | 1075 | * |
1085 | * @param cls handle to the operation | 1076 | * @param cls handle to the operation |
1086 | * @param rd_cound size of the record set | 1077 | * @param rd_count size of the record set |
1087 | * @param rd record set | 1078 | * @param rd record set |
1088 | */ | 1079 | */ |
1089 | static void | 1080 | static void |
@@ -1671,7 +1662,7 @@ cleanup_iter (struct RECLAIM_TICKETS_Iterator *iter) | |||
1671 | 1662 | ||
1672 | 1663 | ||
1673 | /** | 1664 | /** |
1674 | * Return each record of type @GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET | 1665 | * Return each record of type #GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET |
1675 | * to the caller and proceed with the iteration. | 1666 | * to the caller and proceed with the iteration. |
1676 | * FIXME: Should we _not_ proceed automatically here? | 1667 | * FIXME: Should we _not_ proceed automatically here? |
1677 | * | 1668 | * |
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index 11963c345..90c33375f 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c | |||
@@ -423,17 +423,6 @@ generate_id_token_body (const struct GNUNET_IDENTITY_PublicKey *aud_key, | |||
423 | } | 423 | } |
424 | 424 | ||
425 | 425 | ||
426 | /** | ||
427 | * Create a JWT using RSA256 algorithm from attributes | ||
428 | * | ||
429 | * @param aud_key the public of the audience | ||
430 | * @param sub_key the public key of the subject | ||
431 | * @param attrs the attribute list | ||
432 | * @param presentations credential presentation list (may be empty) | ||
433 | * @param expiration_time the validity of the token | ||
434 | * @param secret_rsa_key the key used to sign the JWT | ||
435 | * @return a new base64-encoded JWT string. | ||
436 | */ | ||
437 | char * | 426 | char * |
438 | OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key, | 427 | OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key, |
439 | const struct GNUNET_IDENTITY_PublicKey *sub_key, | 428 | const struct GNUNET_IDENTITY_PublicKey *sub_key, |
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h index b134c71ad..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 | */ |
63 | char * | 63 | char * |
@@ -162,7 +162,7 @@ OIDC_access_token_new (const struct GNUNET_RECLAIM_Ticket *ticket); | |||
162 | * Parse an access token | 162 | * Parse an access token |
163 | */ | 163 | */ |
164 | int | 164 | int |
165 | OIDC_access_token_parse (const char*token, | 165 | OIDC_access_token_parse (const char *token, |
166 | struct GNUNET_RECLAIM_Ticket **ticket); | 166 | struct GNUNET_RECLAIM_Ticket **ticket); |
167 | 167 | ||
168 | 168 | ||
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index bc6b835c9..6f55d62e4 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c | |||
@@ -1076,14 +1076,6 @@ GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | 1078 | ||
1079 | /** | ||
1080 | * Cancel an operation. Note that the operation MAY still | ||
1081 | * be executed; this merely cancels the continuation; if the request | ||
1082 | * was already transmitted, the service may still choose to complete | ||
1083 | * the operation. | ||
1084 | * | ||
1085 | * @param op operation to cancel | ||
1086 | */ | ||
1087 | void | 1079 | void |
1088 | GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op) | 1080 | GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op) |
1089 | { | 1081 | { |
@@ -1210,23 +1202,11 @@ GNUNET_RECLAIM_attribute_delete ( | |||
1210 | } | 1202 | } |
1211 | 1203 | ||
1212 | 1204 | ||
1213 | /** | ||
1214 | * Store an credential. If the credential is already present, | ||
1215 | * it is replaced with the new credential. | ||
1216 | * | ||
1217 | * @param h handle to the re:claimID service | ||
1218 | * @param pkey private key of the identity | ||
1219 | * @param attr the credential value | ||
1220 | * @param exp_interval the relative expiration interval for the credential | ||
1221 | * @param cont continuation to call when done | ||
1222 | * @param cont_cls closure for @a cont | ||
1223 | * @return handle to abort the request | ||
1224 | */ | ||
1225 | struct GNUNET_RECLAIM_Operation * | 1205 | struct GNUNET_RECLAIM_Operation * |
1226 | GNUNET_RECLAIM_credential_store ( | 1206 | GNUNET_RECLAIM_credential_store ( |
1227 | struct GNUNET_RECLAIM_Handle *h, | 1207 | struct GNUNET_RECLAIM_Handle *h, |
1228 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | 1208 | const struct GNUNET_IDENTITY_PrivateKey *pkey, |
1229 | const struct GNUNET_RECLAIM_Credential *attr, | 1209 | const struct GNUNET_RECLAIM_Credential *credential, |
1230 | const struct GNUNET_TIME_Relative *exp_interval, | 1210 | const struct GNUNET_TIME_Relative *exp_interval, |
1231 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 1211 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
1232 | void *cont_cls) | 1212 | void *cont_cls) |
@@ -1241,7 +1221,7 @@ GNUNET_RECLAIM_credential_store ( | |||
1241 | op->cls = cont_cls; | 1221 | op->cls = cont_cls; |
1242 | op->r_id = h->r_id_gen++; | 1222 | op->r_id = h->r_id_gen++; |
1243 | 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); |
1244 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr); | 1224 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (credential); |
1245 | op->env = GNUNET_MQ_msg_extra (sam, | 1225 | op->env = GNUNET_MQ_msg_extra (sam, |
1246 | attr_len, | 1226 | attr_len, |
1247 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); | 1227 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); |
@@ -1249,7 +1229,7 @@ GNUNET_RECLAIM_credential_store ( | |||
1249 | sam->id = htonl (op->r_id); | 1229 | sam->id = htonl (op->r_id); |
1250 | sam->exp = GNUNET_htonll (exp_interval->rel_value_us); | 1230 | sam->exp = GNUNET_htonll (exp_interval->rel_value_us); |
1251 | 1231 | ||
1252 | GNUNET_RECLAIM_credential_serialize (attr, (char *) &sam[1]); | 1232 | GNUNET_RECLAIM_credential_serialize (credential, (char *) &sam[1]); |
1253 | 1233 | ||
1254 | sam->attr_len = htons (attr_len); | 1234 | sam->attr_len = htons (attr_len); |
1255 | if (NULL != h->mq) | 1235 | if (NULL != h->mq) |
@@ -1258,17 +1238,6 @@ GNUNET_RECLAIM_credential_store ( | |||
1258 | } | 1238 | } |
1259 | 1239 | ||
1260 | 1240 | ||
1261 | /** | ||
1262 | * Delete an credential. Tickets used to share this credential are updated | ||
1263 | * accordingly. | ||
1264 | * | ||
1265 | * @param h handle to the re:claimID service | ||
1266 | * @param pkey Private key of the identity to add an attribute to | ||
1267 | * @param attr The credential | ||
1268 | * @param cont Continuation to call when done | ||
1269 | * @param cont_cls Closure for @a cont | ||
1270 | * @return handle Used to to abort the request | ||
1271 | */ | ||
1272 | struct GNUNET_RECLAIM_Operation * | 1241 | struct GNUNET_RECLAIM_Operation * |
1273 | GNUNET_RECLAIM_credential_delete ( | 1242 | GNUNET_RECLAIM_credential_delete ( |
1274 | struct GNUNET_RECLAIM_Handle *h, | 1243 | struct GNUNET_RECLAIM_Handle *h, |
@@ -1366,12 +1335,6 @@ GNUNET_RECLAIM_get_attributes_start ( | |||
1366 | } | 1335 | } |
1367 | 1336 | ||
1368 | 1337 | ||
1369 | /** | ||
1370 | * Calls the record processor specified in #GNUNET_RECLAIM_get_attributes_start | ||
1371 | * for the next record. | ||
1372 | * | ||
1373 | * @param it the iterator | ||
1374 | */ | ||
1375 | void | 1338 | void |
1376 | GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it) | 1339 | GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it) |
1377 | { | 1340 | { |
@@ -1476,12 +1439,6 @@ GNUNET_RECLAIM_get_credentials_start ( | |||
1476 | } | 1439 | } |
1477 | 1440 | ||
1478 | 1441 | ||
1479 | /** | ||
1480 | * Calls the record processor specified in #GNUNET_RECLAIM_get_credential_start | ||
1481 | * for the next record. | ||
1482 | * | ||
1483 | * @param it the iterator | ||
1484 | */ | ||
1485 | void | 1442 | void |
1486 | GNUNET_RECLAIM_get_credentials_next (struct | 1443 | GNUNET_RECLAIM_get_credentials_next (struct |
1487 | GNUNET_RECLAIM_CredentialIterator *ait) | 1444 | GNUNET_RECLAIM_CredentialIterator *ait) |
@@ -1497,13 +1454,6 @@ GNUNET_RECLAIM_get_credentials_next (struct | |||
1497 | } | 1454 | } |
1498 | 1455 | ||
1499 | 1456 | ||
1500 | /** | ||
1501 | * Stops iteration and releases the handle for further calls. Must | ||
1502 | * be called on any iteration that has not yet completed prior to calling | ||
1503 | * #GNUNET_RECLAIM_disconnect. | ||
1504 | * | ||
1505 | * @param it the iterator | ||
1506 | */ | ||
1507 | void | 1457 | void |
1508 | GNUNET_RECLAIM_get_credentials_stop (struct | 1458 | GNUNET_RECLAIM_get_credentials_stop (struct |
1509 | GNUNET_RECLAIM_CredentialIterator *ait) | 1459 | GNUNET_RECLAIM_CredentialIterator *ait) |
@@ -1524,19 +1474,6 @@ GNUNET_RECLAIM_get_credentials_stop (struct | |||
1524 | } | 1474 | } |
1525 | 1475 | ||
1526 | 1476 | ||
1527 | /** | ||
1528 | * Issues a ticket to another relying party. The identity may use | ||
1529 | * @GNUNET_RECLAIM_ticket_consume to consume the ticket | ||
1530 | * and retrieve the attributes specified in the attribute list. | ||
1531 | * | ||
1532 | * @param h the reclaim to use | ||
1533 | * @param iss the issuing identity (= the user) | ||
1534 | * @param rp the subject of the ticket (= the relying party) | ||
1535 | * @param attrs the attributes that the relying party is given access to | ||
1536 | * @param cb the callback | ||
1537 | * @param cb_cls the callback closure | ||
1538 | * @return handle to abort the operation | ||
1539 | */ | ||
1540 | struct GNUNET_RECLAIM_Operation * | 1477 | struct GNUNET_RECLAIM_Operation * |
1541 | GNUNET_RECLAIM_ticket_issue ( | 1478 | GNUNET_RECLAIM_ticket_issue ( |
1542 | struct GNUNET_RECLAIM_Handle *h, | 1479 | struct GNUNET_RECLAIM_Handle *h, |
diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c index 560267578..b5c41b2d1 100644 --- a/src/reclaim/reclaim_attribute.c +++ b/src/reclaim/reclaim_attribute.c | |||
@@ -282,14 +282,6 @@ GNUNET_RECLAIM_attribute_new (const char *attr_name, | |||
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
285 | /** | ||
286 | * Add a new attribute to a claim list | ||
287 | * | ||
288 | * @param attr_name the name of the new attribute claim | ||
289 | * @param type the type of the claim | ||
290 | * @param data claim payload | ||
291 | * @param data_size claim payload size | ||
292 | */ | ||
293 | void | 285 | void |
294 | GNUNET_RECLAIM_attribute_list_add ( | 286 | GNUNET_RECLAIM_attribute_list_add ( |
295 | struct GNUNET_RECLAIM_AttributeList *al, | 287 | struct GNUNET_RECLAIM_AttributeList *al, |
@@ -333,16 +325,9 @@ GNUNET_RECLAIM_attribute_list_serialize_get_size ( | |||
333 | } | 325 | } |
334 | 326 | ||
335 | 327 | ||
336 | /** | ||
337 | * Serialize an attribute list | ||
338 | * | ||
339 | * @param attrs the attribute list to serialize | ||
340 | * @param result the serialized attribute | ||
341 | * @return length of serialized data | ||
342 | */ | ||
343 | size_t | 328 | size_t |
344 | GNUNET_RECLAIM_attribute_list_serialize ( | 329 | GNUNET_RECLAIM_attribute_list_serialize ( |
345 | const struct GNUNET_RECLAIM_AttributeList *al, | 330 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
346 | char *result) | 331 | char *result) |
347 | { | 332 | { |
348 | struct GNUNET_RECLAIM_AttributeListEntry *ale; | 333 | struct GNUNET_RECLAIM_AttributeListEntry *ale; |
@@ -351,7 +336,7 @@ GNUNET_RECLAIM_attribute_list_serialize ( | |||
351 | char *write_ptr; | 336 | char *write_ptr; |
352 | write_ptr = result; | 337 | write_ptr = result; |
353 | total_len = 0; | 338 | total_len = 0; |
354 | for (ale = al->list_head; NULL != ale; ale = ale->next) | 339 | for (ale = attrs->list_head; NULL != ale; ale = ale->next) |
355 | { | 340 | { |
356 | GNUNET_assert (NULL != ale->attribute); | 341 | GNUNET_assert (NULL != ale->attribute); |
357 | len = GNUNET_RECLAIM_attribute_serialize (ale->attribute, write_ptr); | 342 | len = GNUNET_RECLAIM_attribute_serialize (ale->attribute, write_ptr); |
@@ -404,21 +389,16 @@ GNUNET_RECLAIM_attribute_list_deserialize (const char *data, size_t data_size) | |||
404 | } | 389 | } |
405 | 390 | ||
406 | 391 | ||
407 | /** | ||
408 | * Make a (deep) copy of a claim list | ||
409 | * @param attrs claim list to copy | ||
410 | * @return copied claim list | ||
411 | */ | ||
412 | struct GNUNET_RECLAIM_AttributeList * | 392 | struct GNUNET_RECLAIM_AttributeList * |
413 | GNUNET_RECLAIM_attribute_list_dup ( | 393 | GNUNET_RECLAIM_attribute_list_dup ( |
414 | const struct GNUNET_RECLAIM_AttributeList *al) | 394 | const struct GNUNET_RECLAIM_AttributeList *attrs) |
415 | { | 395 | { |
416 | struct GNUNET_RECLAIM_AttributeListEntry *ale; | 396 | struct GNUNET_RECLAIM_AttributeListEntry *ale; |
417 | struct GNUNET_RECLAIM_AttributeListEntry *result_ale; | 397 | struct GNUNET_RECLAIM_AttributeListEntry *result_ale; |
418 | struct GNUNET_RECLAIM_AttributeList *result; | 398 | struct GNUNET_RECLAIM_AttributeList *result; |
419 | 399 | ||
420 | result = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); | 400 | result = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); |
421 | for (ale = al->list_head; NULL != ale; ale = ale->next) | 401 | for (ale = attrs->list_head; NULL != ale; ale = ale->next) |
422 | { | 402 | { |
423 | result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry); | 403 | result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry); |
424 | GNUNET_assert (NULL != ale->attribute); | 404 | GNUNET_assert (NULL != ale->attribute); |
@@ -441,11 +421,6 @@ GNUNET_RECLAIM_attribute_list_dup ( | |||
441 | } | 421 | } |
442 | 422 | ||
443 | 423 | ||
444 | /** | ||
445 | * Destroy claim list | ||
446 | * | ||
447 | * @param attrs list to destroy | ||
448 | */ | ||
449 | void | 424 | void |
450 | GNUNET_RECLAIM_attribute_list_destroy ( | 425 | GNUNET_RECLAIM_attribute_list_destroy ( |
451 | 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 b4aeedf29..6dc1a1fcf 100644 --- a/src/reclaim/reclaim_credential.c +++ b/src/reclaim/reclaim_credential.c | |||
@@ -250,15 +250,6 @@ GNUNET_RECLAIM_credential_value_to_string (uint32_t type, | |||
250 | } | 250 | } |
251 | 251 | ||
252 | 252 | ||
253 | /** | ||
254 | * Create a new credential. | ||
255 | * | ||
256 | * @param attr_name the credential name | ||
257 | * @param type the credential type | ||
258 | * @param data the credential value | ||
259 | * @param data_size the credential value size | ||
260 | * @return the new credential | ||
261 | */ | ||
262 | struct GNUNET_RECLAIM_Credential * | 253 | struct GNUNET_RECLAIM_Credential * |
263 | GNUNET_RECLAIM_credential_new (const char *attr_name, | 254 | GNUNET_RECLAIM_credential_new (const char *attr_name, |
264 | uint32_t type, | 255 | uint32_t type, |
@@ -310,13 +301,6 @@ GNUNET_RECLAIM_credential_list_serialize_get_size ( | |||
310 | } | 301 | } |
311 | 302 | ||
312 | 303 | ||
313 | /** | ||
314 | * Serialize an attribute list | ||
315 | * | ||
316 | * @param attrs the attribute list to serialize | ||
317 | * @param result the serialized attribute | ||
318 | * @return length of serialized data | ||
319 | */ | ||
320 | size_t | 304 | size_t |
321 | GNUNET_RECLAIM_credential_list_serialize ( | 305 | GNUNET_RECLAIM_credential_list_serialize ( |
322 | const struct GNUNET_RECLAIM_CredentialList *credentials, | 306 | const struct GNUNET_RECLAIM_CredentialList *credentials, |
@@ -339,13 +323,6 @@ GNUNET_RECLAIM_credential_list_serialize ( | |||
339 | } | 323 | } |
340 | 324 | ||
341 | 325 | ||
342 | /** | ||
343 | * Deserialize an credential list | ||
344 | * | ||
345 | * @param data the serialized attribute list | ||
346 | * @param data_size the length of the serialized data | ||
347 | * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller | ||
348 | */ | ||
349 | struct GNUNET_RECLAIM_CredentialList * | 326 | struct GNUNET_RECLAIM_CredentialList * |
350 | GNUNET_RECLAIM_credential_list_deserialize (const char *data, size_t data_size) | 327 | GNUNET_RECLAIM_credential_list_deserialize (const char *data, size_t data_size) |
351 | { | 328 | { |
@@ -415,19 +392,14 @@ GNUNET_RECLAIM_credential_list_dup ( | |||
415 | } | 392 | } |
416 | 393 | ||
417 | 394 | ||
418 | /** | ||
419 | * Destroy credential list | ||
420 | * | ||
421 | * @param attrs list to destroy | ||
422 | */ | ||
423 | void | 395 | void |
424 | GNUNET_RECLAIM_credential_list_destroy ( | 396 | GNUNET_RECLAIM_credential_list_destroy ( |
425 | struct GNUNET_RECLAIM_CredentialList *al) | 397 | struct GNUNET_RECLAIM_CredentialList *credentials) |
426 | { | 398 | { |
427 | struct GNUNET_RECLAIM_CredentialListEntry *ale; | 399 | struct GNUNET_RECLAIM_CredentialListEntry *ale; |
428 | struct GNUNET_RECLAIM_CredentialListEntry *tmp_ale; | 400 | struct GNUNET_RECLAIM_CredentialListEntry *tmp_ale; |
429 | 401 | ||
430 | for (ale = al->list_head; NULL != ale;) | 402 | for (ale = credentials->list_head; NULL != ale;) |
431 | { | 403 | { |
432 | if (NULL != ale->credential) | 404 | if (NULL != ale->credential) |
433 | GNUNET_free (ale->credential); | 405 | GNUNET_free (ale->credential); |
@@ -435,7 +407,7 @@ GNUNET_RECLAIM_credential_list_destroy ( | |||
435 | ale = ale->next; | 407 | ale = ale->next; |
436 | GNUNET_free (tmp_ale); | 408 | GNUNET_free (tmp_ale); |
437 | } | 409 | } |
438 | GNUNET_free (al); | 410 | GNUNET_free (credentials); |
439 | } | 411 | } |
440 | 412 | ||
441 | 413 | ||
@@ -454,13 +426,6 @@ GNUNET_RECLAIM_credential_serialize_get_size ( | |||
454 | } | 426 | } |
455 | 427 | ||
456 | 428 | ||
457 | /** | ||
458 | * Serialize an credential | ||
459 | * | ||
460 | * @param attr the credential to serialize | ||
461 | * @param result the serialized credential | ||
462 | * @return length of serialized data | ||
463 | */ | ||
464 | size_t | 429 | size_t |
465 | GNUNET_RECLAIM_credential_serialize ( | 430 | GNUNET_RECLAIM_credential_serialize ( |
466 | const struct GNUNET_RECLAIM_Credential *credential, | 431 | const struct GNUNET_RECLAIM_Credential *credential, |
@@ -627,12 +592,6 @@ GNUNET_RECLAIM_presentation_typename_to_number (const char *typename) | |||
627 | } | 592 | } |
628 | 593 | ||
629 | 594 | ||
630 | /** | ||
631 | * Convert an presentation type number to the corresponding presentation type string | ||
632 | * | ||
633 | * @param type number of a type | ||
634 | * @return corresponding typestring, NULL on error | ||
635 | */ | ||
636 | const char * | 595 | const char * |
637 | GNUNET_RECLAIM_presentation_number_to_typename (uint32_t type) | 596 | GNUNET_RECLAIM_presentation_number_to_typename (uint32_t type) |
638 | { | 597 | { |
@@ -758,13 +717,6 @@ GNUNET_RECLAIM_presentation_list_serialize_get_size ( | |||
758 | } | 717 | } |
759 | 718 | ||
760 | 719 | ||
761 | /** | ||
762 | * Serialize an attribute list | ||
763 | * | ||
764 | * @param attrs the attribute list to serialize | ||
765 | * @param result the serialized attribute | ||
766 | * @return length of serialized data | ||
767 | */ | ||
768 | size_t | 720 | size_t |
769 | GNUNET_RECLAIM_presentation_list_serialize ( | 721 | GNUNET_RECLAIM_presentation_list_serialize ( |
770 | const struct GNUNET_RECLAIM_PresentationList *presentations, | 722 | const struct GNUNET_RECLAIM_PresentationList *presentations, |
@@ -862,19 +814,14 @@ GNUNET_RECLAIM_presentation_list_dup ( | |||
862 | } | 814 | } |
863 | 815 | ||
864 | 816 | ||
865 | /** | ||
866 | * Destroy presentation list | ||
867 | * | ||
868 | * @param attrs list to destroy | ||
869 | */ | ||
870 | void | 817 | void |
871 | GNUNET_RECLAIM_presentation_list_destroy ( | 818 | GNUNET_RECLAIM_presentation_list_destroy ( |
872 | struct GNUNET_RECLAIM_PresentationList *al) | 819 | struct GNUNET_RECLAIM_PresentationList *presentations) |
873 | { | 820 | { |
874 | struct GNUNET_RECLAIM_PresentationListEntry *ale; | 821 | struct GNUNET_RECLAIM_PresentationListEntry *ale; |
875 | struct GNUNET_RECLAIM_PresentationListEntry *tmp_ale; | 822 | struct GNUNET_RECLAIM_PresentationListEntry *tmp_ale; |
876 | 823 | ||
877 | for (ale = al->list_head; NULL != ale;) | 824 | for (ale = presentations->list_head; NULL != ale;) |
878 | { | 825 | { |
879 | if (NULL != ale->presentation) | 826 | if (NULL != ale->presentation) |
880 | GNUNET_free (ale->presentation); | 827 | GNUNET_free (ale->presentation); |
@@ -882,7 +829,7 @@ GNUNET_RECLAIM_presentation_list_destroy ( | |||
882 | ale = ale->next; | 829 | ale = ale->next; |
883 | GNUNET_free (tmp_ale); | 830 | GNUNET_free (tmp_ale); |
884 | } | 831 | } |
885 | GNUNET_free (al); | 832 | GNUNET_free (presentations); |
886 | } | 833 | } |
887 | 834 | ||
888 | 835 | ||
@@ -900,13 +847,6 @@ GNUNET_RECLAIM_presentation_serialize_get_size ( | |||
900 | } | 847 | } |
901 | 848 | ||
902 | 849 | ||
903 | /** | ||
904 | * Serialize an presentation | ||
905 | * | ||
906 | * @param attr the presentation to serialize | ||
907 | * @param result the serialized presentation | ||
908 | * @return length of serialized data | ||
909 | */ | ||
910 | size_t | 850 | size_t |
911 | GNUNET_RECLAIM_presentation_serialize ( | 851 | GNUNET_RECLAIM_presentation_serialize ( |
912 | const struct GNUNET_RECLAIM_Presentation *presentation, | 852 | const struct GNUNET_RECLAIM_Presentation *presentation, |