aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_credential.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/reclaim_credential.c')
-rw-r--r--src/reclaim/reclaim_credential.c72
1 files changed, 6 insertions, 66 deletions
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 */
262struct GNUNET_RECLAIM_Credential * 253struct GNUNET_RECLAIM_Credential *
263GNUNET_RECLAIM_credential_new (const char *attr_name, 254GNUNET_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 */
320size_t 304size_t
321GNUNET_RECLAIM_credential_list_serialize ( 305GNUNET_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 */
349struct GNUNET_RECLAIM_CredentialList * 326struct GNUNET_RECLAIM_CredentialList *
350GNUNET_RECLAIM_credential_list_deserialize (const char *data, size_t data_size) 327GNUNET_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 */
423void 395void
424GNUNET_RECLAIM_credential_list_destroy ( 396GNUNET_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 */
464size_t 429size_t
465GNUNET_RECLAIM_credential_serialize ( 430GNUNET_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 */
636const char * 595const char *
637GNUNET_RECLAIM_presentation_number_to_typename (uint32_t type) 596GNUNET_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 */
768size_t 720size_t
769GNUNET_RECLAIM_presentation_list_serialize ( 721GNUNET_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 */
870void 817void
871GNUNET_RECLAIM_presentation_list_destroy ( 818GNUNET_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 */
910size_t 850size_t
911GNUNET_RECLAIM_presentation_serialize ( 851GNUNET_RECLAIM_presentation_serialize (
912 const struct GNUNET_RECLAIM_Presentation *presentation, 852 const struct GNUNET_RECLAIM_Presentation *presentation,