aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-02 22:32:28 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-02 22:32:28 +0100
commita9a7ac802811e76e33b54040bf31f00ea9438cea (patch)
tree7f9a22daca2b95e7308d8877c668fc878a39ae4c /src/identity-provider
parent14c62ed969ace8843154d10b55d4c3571383dc37 (diff)
downloadgnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.tar.gz
gnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.zip
-refactored
Diffstat (limited to 'src/identity-provider')
-rw-r--r--src/identity-provider/Makefile.am12
-rw-r--r--src/identity-provider/gnunet-idp.c26
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c120
-rw-r--r--src/identity-provider/identity_attribute.c245
-rw-r--r--src/identity-provider/identity_attribute.h149
-rw-r--r--src/identity-provider/identity_provider_api.c49
-rw-r--r--src/identity-provider/plugin_identity_provider_sqlite.c14
-rw-r--r--src/identity-provider/plugin_rest_identity_provider.c11
8 files changed, 107 insertions, 519 deletions
diff --git a/src/identity-provider/Makefile.am b/src/identity-provider/Makefile.am
index f64f1aa68..3b072e59d 100644
--- a/src/identity-provider/Makefile.am
+++ b/src/identity-provider/Makefile.am
@@ -63,8 +63,7 @@ libgnunet_plugin_identity_provider_sqlite_la_LDFLAGS = \
63 63
64 64
65gnunet_service_identity_provider_SOURCES = \ 65gnunet_service_identity_provider_SOURCES = \
66 gnunet-service-identity-provider.c \ 66 gnunet-service-identity-provider.c
67 identity_attribute.h
68gnunet_service_identity_provider_LDADD = \ 67gnunet_service_identity_provider_LDADD = \
69 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ 68 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
70 $(top_builddir)/src/util/libgnunetutil.la \ 69 $(top_builddir)/src/util/libgnunetutil.la \
@@ -72,14 +71,14 @@ gnunet_service_identity_provider_LDADD = \
72 $(top_builddir)/src/identity/libgnunetidentity.la \ 71 $(top_builddir)/src/identity/libgnunetidentity.la \
73 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 72 $(top_builddir)/src/statistics/libgnunetstatistics.la \
74 $(top_builddir)/src/credential/libgnunetcredential.la \ 73 $(top_builddir)/src/credential/libgnunetcredential.la \
74 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \
75 libgnunetidentityprovider.la \ 75 libgnunetidentityprovider.la \
76 $(top_builddir)/src/gns/libgnunetgns.la \ 76 $(top_builddir)/src/gns/libgnunetgns.la \
77 $(GN_LIBINTL) 77 $(GN_LIBINTL)
78 78
79libgnunetidentityprovider_la_SOURCES = \ 79libgnunetidentityprovider_la_SOURCES = \
80 identity_provider_api.c \ 80 identity_provider_api.c \
81 identity_provider.h \ 81 identity_provider.h
82 identity_attribute.c
83libgnunetidentityprovider_la_LIBADD = \ 82libgnunetidentityprovider_la_LIBADD = \
84 $(top_builddir)/src/util/libgnunetutil.la \ 83 $(top_builddir)/src/util/libgnunetutil.la \
85 $(GN_LIBINTL) $(XLIB) 84 $(GN_LIBINTL) $(XLIB)
@@ -88,13 +87,13 @@ libgnunetidentityprovider_la_LDFLAGS = \
88 -version-info 0:0:0 87 -version-info 0:0:0
89 88
90libgnunet_plugin_rest_identity_provider_la_SOURCES = \ 89libgnunet_plugin_rest_identity_provider_la_SOURCES = \
91 plugin_rest_identity_provider.c \ 90 plugin_rest_identity_provider.c
92 jwt.c
93libgnunet_plugin_rest_identity_provider_la_LIBADD = \ 91libgnunet_plugin_rest_identity_provider_la_LIBADD = \
94 $(top_builddir)/src/identity/libgnunetidentity.la \ 92 $(top_builddir)/src/identity/libgnunetidentity.la \
95 libgnunetidentityprovider.la \ 93 libgnunetidentityprovider.la \
96 $(top_builddir)/src/rest/libgnunetrest.la \ 94 $(top_builddir)/src/rest/libgnunetrest.la \
97 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \ 95 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
96 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \
98 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 97 $(top_builddir)/src/namestore/libgnunetnamestore.la \
99 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ 98 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
100 $(LTLIBINTL) -ljansson -lmicrohttpd 99 $(LTLIBINTL) -ljansson -lmicrohttpd
@@ -108,6 +107,7 @@ gnunet_idp_LDADD = \
108 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 107 $(top_builddir)/src/namestore/libgnunetnamestore.la \
109 libgnunetidentityprovider.la \ 108 libgnunetidentityprovider.la \
110 $(top_builddir)/src/identity/libgnunetidentity.la \ 109 $(top_builddir)/src/identity/libgnunetidentity.la \
110 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \
111 $(GN_LIBINTL) 111 $(GN_LIBINTL)
112 112
113check_SCRIPTS = \ 113check_SCRIPTS = \
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c
index 88136c124..18a5676c0 100644
--- a/src/identity-provider/gnunet-idp.c
+++ b/src/identity-provider/gnunet-idp.c
@@ -119,7 +119,7 @@ static struct GNUNET_IDENTITY_PROVIDER_Ticket ticket;
119/** 119/**
120 * Attribute list 120 * Attribute list
121 */ 121 */
122static struct GNUNET_IDENTITY_PROVIDER_AttributeList *attr_list; 122static struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list;
123 123
124static void 124static void
125do_cleanup(void *cls) 125do_cleanup(void *cls)
@@ -166,7 +166,7 @@ store_attr_cont (void *cls,
166static void 166static void
167process_attrs (void *cls, 167process_attrs (void *cls,
168 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 168 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
169 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr) 169 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr)
170{ 170{
171 if (NULL == identity) 171 if (NULL == identity)
172 { 172 {
@@ -207,7 +207,7 @@ process_rvk (void *cls, int success, const char* msg)
207static void 207static void
208iter_finished (void *cls) 208iter_finished (void *cls)
209{ 209{
210 struct GNUNET_IDENTITY_PROVIDER_Attribute *attr; 210 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr;
211 211
212 attr_iterator = NULL; 212 attr_iterator = NULL;
213 if (list) 213 if (list)
@@ -244,8 +244,8 @@ iter_finished (void *cls)
244 NULL); 244 NULL);
245 return; 245 return;
246 } 246 }
247 attr = GNUNET_IDENTITY_PROVIDER_attribute_new (attr_name, 247 attr = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr_name,
248 GNUNET_IDENTITY_PROVIDER_AT_STRING, 248 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
249 attr_value, 249 attr_value,
250 strlen (attr_value) + 1); 250 strlen (attr_value) + 1);
251 idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, 251 idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle,
@@ -260,9 +260,9 @@ iter_finished (void *cls)
260static void 260static void
261iter_cb (void *cls, 261iter_cb (void *cls,
262 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 262 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
263 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr) 263 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr)
264{ 264{
265 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 265 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
266 char *attrs_tmp; 266 char *attrs_tmp;
267 char *attr_str; 267 char *attr_str;
268 268
@@ -275,11 +275,11 @@ iter_cb (void *cls,
275 attr_str = strtok (NULL, ","); 275 attr_str = strtok (NULL, ",");
276 continue; 276 continue;
277 } 277 }
278 le = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry); 278 le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry);
279 le->attribute = GNUNET_IDENTITY_PROVIDER_attribute_new (attr->name, 279 le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr->name,
280 attr->attribute_type, 280 attr->type,
281 attr->data, 281 attr->data,
282 attr->data_size); 282 attr->data_size);
283 GNUNET_CONTAINER_DLL_insert (attr_list->list_head, 283 GNUNET_CONTAINER_DLL_insert (attr_list->list_head,
284 attr_list->list_tail, 284 attr_list->list_tail,
285 le); 285 le);
@@ -321,7 +321,7 @@ ego_cb (void *cls,
321 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 321 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket));
322 322
323 323
324 attr_list = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeList); 324 attr_list = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList);
325 325
326 attr_iterator = GNUNET_IDENTITY_PROVIDER_get_attributes_start (idp_handle, 326 attr_iterator = GNUNET_IDENTITY_PROVIDER_get_attributes_start (idp_handle,
327 pkey, 327 pkey,
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index 58dea88a7..a5c178aa5 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -34,9 +34,9 @@
34#include "gnunet_statistics_service.h" 34#include "gnunet_statistics_service.h"
35#include "gnunet_gns_service.h" 35#include "gnunet_gns_service.h"
36#include "gnunet_identity_provider_plugin.h" 36#include "gnunet_identity_provider_plugin.h"
37#include "gnunet_identity_attribute_lib.h"
37#include "gnunet_signatures.h" 38#include "gnunet_signatures.h"
38#include "identity_provider.h" 39#include "identity_provider.h"
39#include "identity_attribute.h"
40 40
41/** 41/**
42 * First pass state 42 * First pass state
@@ -365,7 +365,7 @@ struct AttributeStoreHandle
365 /** 365 /**
366 * The attribute to store 366 * The attribute to store
367 */ 367 */
368 struct GNUNET_IDENTITY_PROVIDER_Attribute *attribute; 368 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *claim;
369 369
370 /** 370 /**
371 * request id 371 * request id
@@ -428,7 +428,7 @@ struct ConsumeTicketHandle
428 /** 428 /**
429 * Attributes 429 * Attributes
430 */ 430 */
431 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs; 431 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs;
432 432
433 /** 433 /**
434 * Lookup time 434 * Lookup time
@@ -490,12 +490,12 @@ struct TicketRevocationHandle
490 /** 490 /**
491 * Attributes to reissue 491 * Attributes to reissue
492 */ 492 */
493 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs; 493 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs;
494 494
495 /** 495 /**
496 * Attributes to revoke 496 * Attributes to revoke
497 */ 497 */
498 struct GNUNET_IDENTITY_PROVIDER_AttributeList *rvk_attrs; 498 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *rvk_attrs;
499 499
500 /** 500 /**
501 * Issuer Key 501 * Issuer Key
@@ -549,7 +549,7 @@ struct TicketIssueHandle
549 /** 549 /**
550 * Attributes to issue 550 * Attributes to issue
551 */ 551 */
552 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs; 552 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs;
553 553
554 /** 554 /**
555 * Issuer Key 555 * Issuer Key
@@ -809,7 +809,7 @@ static void
809cleanup_ticket_issue_handle (struct TicketIssueHandle *handle) 809cleanup_ticket_issue_handle (struct TicketIssueHandle *handle)
810{ 810{
811 if (NULL != handle->attrs) 811 if (NULL != handle->attrs)
812 attribute_list_destroy (handle->attrs); 812 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs);
813 if (NULL != handle->ns_qe) 813 if (NULL != handle->ns_qe)
814 GNUNET_NAMESTORE_cancel (handle->ns_qe); 814 GNUNET_NAMESTORE_cancel (handle->ns_qe);
815 GNUNET_free (handle); 815 GNUNET_free (handle);
@@ -820,7 +820,7 @@ static void
820send_ticket_result (struct IdpClient *client, 820send_ticket_result (struct IdpClient *client,
821 uint32_t r_id, 821 uint32_t r_id,
822 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 822 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
823 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs) 823 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs)
824{ 824{
825 struct TicketResultMessage *irm; 825 struct TicketResultMessage *irm;
826 struct GNUNET_MQ_Envelope *env; 826 struct GNUNET_MQ_Envelope *env;
@@ -873,13 +873,13 @@ store_ticket_issue_cont (void *cls,
873 873
874int 874int
875serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 875serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
876 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs, 876 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
877 const struct GNUNET_CRYPTO_AbeKey *rp_key, 877 const struct GNUNET_CRYPTO_AbeKey *rp_key,
878 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey, 878 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey,
879 char **result) 879 char **result)
880{ 880{
881 struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey; 881 struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey;
882 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 882 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
883 char *enc_keyinfo; 883 char *enc_keyinfo;
884 char *serialized_key; 884 char *serialized_key;
885 char *buf; 885 char *buf;
@@ -896,7 +896,7 @@ serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
896 (void**)&serialized_key); 896 (void**)&serialized_key);
897 attrs_str_len = 0; 897 attrs_str_len = 0;
898 for (le = attrs->list_head; NULL != le; le = le->next) { 898 for (le = attrs->list_head; NULL != le; le = le->next) {
899 attrs_str_len += strlen (le->attribute->name) + 1; 899 attrs_str_len += strlen (le->claim->name) + 1;
900 } 900 }
901 buf = GNUNET_malloc (attrs_str_len + size); 901 buf = GNUNET_malloc (attrs_str_len + size);
902 write_ptr = buf; 902 write_ptr = buf;
@@ -904,14 +904,14 @@ serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
904 "Writing attributes\n"); 904 "Writing attributes\n");
905 for (le = attrs->list_head; NULL != le; le = le->next) { 905 for (le = attrs->list_head; NULL != le; le = le->next) {
906 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 906 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
907 "%s\n", le->attribute->name); 907 "%s\n", le->claim->name);
908 908
909 909
910 GNUNET_memcpy (write_ptr, 910 GNUNET_memcpy (write_ptr,
911 le->attribute->name, 911 le->claim->name,
912 strlen (le->attribute->name)); 912 strlen (le->claim->name));
913 write_ptr[strlen (le->attribute->name)] = ','; 913 write_ptr[strlen (le->claim->name)] = ',';
914 write_ptr += strlen (le->attribute->name) + 1; 914 write_ptr += strlen (le->claim->name) + 1;
915 } 915 }
916 write_ptr--; 916 write_ptr--;
917 write_ptr[0] = '\0'; //replace last , with a 0-terminator 917 write_ptr[0] = '\0'; //replace last , with a 0-terminator
@@ -954,7 +954,7 @@ issue_ticket_after_abe_bootstrap (void *cls,
954 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 954 struct GNUNET_CRYPTO_AbeMasterKey *abe_key)
955{ 955{
956 struct TicketIssueHandle *ih = cls; 956 struct TicketIssueHandle *ih = cls;
957 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 957 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
958 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 958 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
959 struct GNUNET_GNSRECORD_Data code_record[1]; 959 struct GNUNET_GNSRECORD_Data code_record[1];
960 struct GNUNET_CRYPTO_AbeKey *rp_key; 960 struct GNUNET_CRYPTO_AbeKey *rp_key;
@@ -974,8 +974,8 @@ issue_ticket_after_abe_bootstrap (void *cls,
974 i = 0; 974 i = 0;
975 for (le = ih->attrs->list_head; NULL != le; le = le->next) { 975 for (le = ih->attrs->list_head; NULL != le; le = le->next) {
976 GNUNET_asprintf (&policy, "%s_%lu", 976 GNUNET_asprintf (&policy, "%s_%lu",
977 le->attribute->name, 977 le->claim->name,
978 le->attribute->attribute_version); 978 le->claim->version);
979 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 979 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
980 "Adding attribute to key: %s\n", 980 "Adding attribute to key: %s\n",
981 policy); 981 policy);
@@ -1061,7 +1061,7 @@ handle_issue_ticket_message (void *cls,
1061 1061
1062 ih = GNUNET_new (struct TicketIssueHandle); 1062 ih = GNUNET_new (struct TicketIssueHandle);
1063 attrs_len = ntohs (im->attr_len); 1063 attrs_len = ntohs (im->attr_len);
1064 ih->attrs = attribute_list_deserialize ((char*)&im[1], attrs_len); 1064 ih->attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize ((char*)&im[1], attrs_len);
1065 ih->r_id = ntohl (im->id); 1065 ih->r_id = ntohl (im->id);
1066 ih->client = idp; 1066 ih->client = idp;
1067 ih->identity = im->identity; 1067 ih->identity = im->identity;
@@ -1087,9 +1087,9 @@ static void
1087cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle) 1087cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle)
1088{ 1088{
1089 if (NULL != handle->attrs) 1089 if (NULL != handle->attrs)
1090 attribute_list_destroy (handle->attrs); 1090 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs);
1091 if (NULL != handle->rvk_attrs) 1091 if (NULL != handle->rvk_attrs)
1092 attribute_list_destroy (handle->rvk_attrs); 1092 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->rvk_attrs);
1093 if (NULL != handle->abe_key) 1093 if (NULL != handle->abe_key)
1094 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key); 1094 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key);
1095 if (NULL != handle->ns_qe) 1095 if (NULL != handle->ns_qe)
@@ -1132,7 +1132,7 @@ send_revocation_finished (struct TicketRevocationHandle *rh,
1132static void 1132static void
1133ticket_reissue_proc (void *cls, 1133ticket_reissue_proc (void *cls,
1134 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1134 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
1135 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs); 1135 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs);
1136 1136
1137static void 1137static void
1138revocation_reissue_tickets (struct TicketRevocationHandle *rh); 1138revocation_reissue_tickets (struct TicketRevocationHandle *rh);
@@ -1176,11 +1176,11 @@ reissue_ticket_cont (void *cls,
1176static void 1176static void
1177ticket_reissue_proc (void *cls, 1177ticket_reissue_proc (void *cls,
1178 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1178 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
1179 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs) 1179 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs)
1180{ 1180{
1181 struct TicketRevocationHandle *rh = cls; 1181 struct TicketRevocationHandle *rh = cls;
1182 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 1182 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
1183 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le_rollover; 1183 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le_rollover;
1184 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 1184 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
1185 struct GNUNET_GNSRECORD_Data code_record[1]; 1185 struct GNUNET_GNSRECORD_Data code_record[1];
1186 struct GNUNET_CRYPTO_AbeKey *rp_key; 1186 struct GNUNET_CRYPTO_AbeKey *rp_key;
@@ -1223,11 +1223,11 @@ ticket_reissue_proc (void *cls,
1223 NULL != le_rollover; 1223 NULL != le_rollover;
1224 le_rollover = le_rollover->next) 1224 le_rollover = le_rollover->next)
1225 { 1225 {
1226 if (0 == strcmp (le_rollover->attribute->name, 1226 if (0 == strcmp (le_rollover->claim->name,
1227 le->attribute->name)) 1227 le->claim->name))
1228 { 1228 {
1229 reissue_ticket = GNUNET_YES; 1229 reissue_ticket = GNUNET_YES;
1230 le->attribute->attribute_version = le_rollover->attribute->attribute_version; 1230 le->claim->version = le_rollover->claim->version;
1231 } 1231 }
1232 } 1232 }
1233 } 1233 }
@@ -1255,8 +1255,8 @@ ticket_reissue_proc (void *cls,
1255 i = 0; 1255 i = 0;
1256 for (le = attrs->list_head; NULL != le; le = le->next) { 1256 for (le = attrs->list_head; NULL != le; le = le->next) {
1257 GNUNET_asprintf (&policy, "%s_%lu", 1257 GNUNET_asprintf (&policy, "%s_%lu",
1258 le->attribute->name, 1258 le->claim->name,
1259 le->attribute->attribute_version); 1259 le->claim->version);
1260 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1260 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1261 "Recreating key with %s\n", policy); 1261 "Recreating key with %s\n", policy);
1262 attr_arr[i] = policy; 1262 attr_arr[i] = policy;
@@ -1349,14 +1349,14 @@ reenc_next_attribute (struct TicketRevocationHandle *rh)
1349 revocation_reissue_tickets (rh); 1349 revocation_reissue_tickets (rh);
1350 return; 1350 return;
1351 } 1351 }
1352 buf_size = attribute_serialize_get_size (rh->attrs->list_head->attribute); 1352 buf_size = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (rh->attrs->list_head->claim);
1353 buf = GNUNET_malloc (buf_size); 1353 buf = GNUNET_malloc (buf_size);
1354 attribute_serialize (rh->attrs->list_head->attribute, 1354 GNUNET_IDENTITY_ATTRIBUTE_serialize (rh->attrs->list_head->claim,
1355 buf); 1355 buf);
1356 rh->attrs->list_head->attribute->attribute_version++; 1356 rh->attrs->list_head->claim->version++;
1357 GNUNET_asprintf (&policy, "%s_%lu", 1357 GNUNET_asprintf (&policy, "%s_%lu",
1358 rh->attrs->list_head->attribute->name, 1358 rh->attrs->list_head->claim->name,
1359 rh->attrs->list_head->attribute->attribute_version); 1359 rh->attrs->list_head->claim->version);
1360 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1360 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1361 "Encrypting with policy %s\n", policy); 1361 "Encrypting with policy %s\n", policy);
1362 /** 1362 /**
@@ -1371,7 +1371,7 @@ reenc_next_attribute (struct TicketRevocationHandle *rh)
1371 GNUNET_free (policy); 1371 GNUNET_free (policy);
1372 rd[0].data_size = enc_size + sizeof (uint32_t); 1372 rd[0].data_size = enc_size + sizeof (uint32_t);
1373 rd_buf = GNUNET_malloc (rd[0].data_size); 1373 rd_buf = GNUNET_malloc (rd[0].data_size);
1374 attr_ver = htonl (rh->attrs->list_head->attribute->attribute_version); 1374 attr_ver = htonl (rh->attrs->list_head->claim->version);
1375 GNUNET_memcpy (rd_buf, 1375 GNUNET_memcpy (rd_buf,
1376 &attr_ver, 1376 &attr_ver,
1377 sizeof (uint32_t)); 1377 sizeof (uint32_t));
@@ -1384,7 +1384,7 @@ reenc_next_attribute (struct TicketRevocationHandle *rh)
1384 rd[0].expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; //TODO sane? 1384 rd[0].expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; //TODO sane?
1385 rh->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle, 1385 rh->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle,
1386 &rh->identity, 1386 &rh->identity,
1387 rh->attrs->list_head->attribute->name, 1387 rh->attrs->list_head->claim->name,
1388 1, 1388 1,
1389 rd, 1389 rd,
1390 &attr_reenc_cont, 1390 &attr_reenc_cont,
@@ -1403,7 +1403,7 @@ attr_reenc_cont (void *cls,
1403 const char *emsg) 1403 const char *emsg)
1404{ 1404{
1405 struct TicketRevocationHandle *rh = cls; 1405 struct TicketRevocationHandle *rh = cls;
1406 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 1406 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
1407 1407
1408 if (GNUNET_SYSERR == success) 1408 if (GNUNET_SYSERR == success)
1409 { 1409 {
@@ -1437,11 +1437,11 @@ attr_reenc_cont (void *cls,
1437static void 1437static void
1438process_attributes_to_update (void *cls, 1438process_attributes_to_update (void *cls,
1439 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1439 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
1440 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs) 1440 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs)
1441{ 1441{
1442 struct TicketRevocationHandle *rh = cls; 1442 struct TicketRevocationHandle *rh = cls;
1443 1443
1444 rh->attrs = attribute_list_dup (attrs); 1444 rh->attrs = GNUNET_IDENTITY_ATTRIBUTE_list_dup (attrs);
1445 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1445 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1446 "Revocation Phase I: Collecting attributes\n"); 1446 "Revocation Phase I: Collecting attributes\n");
1447 /* Reencrypt all attributes with new key */ 1447 /* Reencrypt all attributes with new key */
@@ -1514,7 +1514,7 @@ handle_revoke_ticket_message (void *cls,
1514 1514
1515 rh = GNUNET_new (struct TicketRevocationHandle); 1515 rh = GNUNET_new (struct TicketRevocationHandle);
1516 ticket = (struct GNUNET_IDENTITY_PROVIDER_Ticket*)&rm[1]; 1516 ticket = (struct GNUNET_IDENTITY_PROVIDER_Ticket*)&rm[1];
1517 rh->rvk_attrs = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeList); 1517 rh->rvk_attrs = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList);
1518 rh->ticket = *ticket; 1518 rh->ticket = *ticket;
1519 rh->r_id = ntohl (rm->id); 1519 rh->r_id = ntohl (rm->id);
1520 rh->client = idp; 1520 rh->client = idp;
@@ -1537,7 +1537,7 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle)
1537 GNUNET_CRYPTO_cpabe_delete_key (handle->key, 1537 GNUNET_CRYPTO_cpabe_delete_key (handle->key,
1538 GNUNET_YES); 1538 GNUNET_YES);
1539 if (NULL != handle->attrs) 1539 if (NULL != handle->attrs)
1540 attribute_list_destroy (handle->attrs); 1540 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs);
1541 GNUNET_free (handle); 1541 GNUNET_free (handle);
1542} 1542}
1543 1543
@@ -1575,7 +1575,7 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1575 struct ConsumeTicketHandle *handle = parallel_lookup->handle; 1575 struct ConsumeTicketHandle *handle = parallel_lookup->handle;
1576 struct ConsumeTicketResultMessage *crm; 1576 struct ConsumeTicketResultMessage *crm;
1577 struct GNUNET_MQ_Envelope *env; 1577 struct GNUNET_MQ_Envelope *env;
1578 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *attr_le; 1578 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *attr_le;
1579 struct GNUNET_TIME_Absolute decrypt_duration; 1579 struct GNUNET_TIME_Absolute decrypt_duration;
1580 char *data; 1580 char *data;
1581 char *data_tmp; 1581 char *data_tmp;
@@ -1618,10 +1618,10 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1618 1, 1618 1,
1619 GNUNET_YES); 1619 GNUNET_YES);
1620 1620
1621 attr_le = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry); 1621 attr_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry);
1622 attr_le->attribute = attribute_deserialize (data, 1622 attr_le->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize (data,
1623 attr_len); 1623 attr_len);
1624 attr_le->attribute->attribute_version = ntohl(*(uint32_t*)rd->data); 1624 attr_le->claim->version = ntohl(*(uint32_t*)rd->data);
1625 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head, 1625 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head,
1626 handle->attrs->list_tail, 1626 handle->attrs->list_tail,
1627 attr_le); 1627 attr_le);
@@ -1643,7 +1643,7 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1643 } 1643 }
1644 1644
1645 GNUNET_SCHEDULER_cancel (handle->kill_task); 1645 GNUNET_SCHEDULER_cancel (handle->kill_task);
1646 attrs_len = attribute_list_serialize_get_size (handle->attrs); 1646 attrs_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (handle->attrs);
1647 env = GNUNET_MQ_msg_extra (crm, 1647 env = GNUNET_MQ_msg_extra (crm,
1648 attrs_len, 1648 attrs_len,
1649 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT); 1649 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT);
@@ -1651,7 +1651,7 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1651 crm->attrs_len = htons (attrs_len); 1651 crm->attrs_len = htons (attrs_len);
1652 crm->identity = handle->ticket.identity; 1652 crm->identity = handle->ticket.identity;
1653 data_tmp = (char *) &crm[1]; 1653 data_tmp = (char *) &crm[1];
1654 attribute_list_serialize (handle->attrs, 1654 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (handle->attrs,
1655 data_tmp); 1655 data_tmp);
1656 GNUNET_MQ_send (handle->client->mq, env); 1656 GNUNET_MQ_send (handle->client->mq, env);
1657 cleanup_consume_ticket_handle (handle); 1657 cleanup_consume_ticket_handle (handle);
@@ -1802,7 +1802,7 @@ handle_consume_ticket_message (void *cls,
1802 ch->r_id = ntohl (cm->id); 1802 ch->r_id = ntohl (cm->id);
1803 ch->client = idp; 1803 ch->client = idp;
1804 ch->identity = cm->identity; 1804 ch->identity = cm->identity;
1805 ch->attrs = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeList); 1805 ch->attrs = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList);
1806 GNUNET_CRYPTO_ecdsa_key_get_public (&ch->identity, 1806 GNUNET_CRYPTO_ecdsa_key_get_public (&ch->identity,
1807 &ch->identity_pub); 1807 &ch->identity_pub);
1808 ch->ticket = *((struct GNUNET_IDENTITY_PROVIDER_Ticket*)&cm[1]); 1808 ch->ticket = *((struct GNUNET_IDENTITY_PROVIDER_Ticket*)&cm[1]);
@@ -1830,8 +1830,8 @@ handle_consume_ticket_message (void *cls,
1830static void 1830static void
1831cleanup_as_handle (struct AttributeStoreHandle *handle) 1831cleanup_as_handle (struct AttributeStoreHandle *handle)
1832{ 1832{
1833 if (NULL != handle->attribute) 1833 if (NULL != handle->claim)
1834 GNUNET_free (handle->attribute); 1834 GNUNET_free (handle->claim);
1835 if (NULL != handle->abe_key) 1835 if (NULL != handle->abe_key)
1836 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key); 1836 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key);
1837 GNUNET_free (handle); 1837 GNUNET_free (handle);
@@ -1882,16 +1882,16 @@ attr_store_task (void *cls)
1882 1882
1883 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1883 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1884 "Storing attribute\n"); 1884 "Storing attribute\n");
1885 buf_size = attribute_serialize_get_size (as_handle->attribute); 1885 buf_size = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (as_handle->claim);
1886 buf = GNUNET_malloc (buf_size); 1886 buf = GNUNET_malloc (buf_size);
1887 1887
1888 attribute_serialize (as_handle->attribute, 1888 GNUNET_IDENTITY_ATTRIBUTE_serialize (as_handle->claim,
1889 buf); 1889 buf);
1890 1890
1891 GNUNET_asprintf (&policy, 1891 GNUNET_asprintf (&policy,
1892 "%s_%lu", 1892 "%s_%lu",
1893 as_handle->attribute->name, 1893 as_handle->claim->name,
1894 as_handle->attribute->attribute_version); 1894 as_handle->claim->version);
1895 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1895 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1896 "Encrypting with policy %s\n", policy); 1896 "Encrypting with policy %s\n", policy);
1897 /** 1897 /**
@@ -1906,7 +1906,7 @@ attr_store_task (void *cls)
1906 GNUNET_free (policy); 1906 GNUNET_free (policy);
1907 rd[0].data_size = enc_size + sizeof (uint32_t); 1907 rd[0].data_size = enc_size + sizeof (uint32_t);
1908 rd_buf = GNUNET_malloc (rd[0].data_size); 1908 rd_buf = GNUNET_malloc (rd[0].data_size);
1909 attr_ver = htonl (as_handle->attribute->attribute_version); 1909 attr_ver = htonl (as_handle->claim->version);
1910 GNUNET_memcpy (rd_buf, 1910 GNUNET_memcpy (rd_buf,
1911 &attr_ver, 1911 &attr_ver,
1912 sizeof (uint32_t)); 1912 sizeof (uint32_t));
@@ -1919,7 +1919,7 @@ attr_store_task (void *cls)
1919 rd[0].expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; //TODO sane? 1919 rd[0].expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; //TODO sane?
1920 as_handle->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle, 1920 as_handle->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle,
1921 &as_handle->identity, 1921 &as_handle->identity,
1922 as_handle->attribute->name, 1922 as_handle->claim->name,
1923 1, 1923 1,
1924 rd, 1924 rd,
1925 &attr_store_cont, 1925 &attr_store_cont,
@@ -1984,7 +1984,7 @@ handle_attribute_store_message (void *cls,
1984 data_len = ntohs (sam->attr_len); 1984 data_len = ntohs (sam->attr_len);
1985 1985
1986 as_handle = GNUNET_new (struct AttributeStoreHandle); 1986 as_handle = GNUNET_new (struct AttributeStoreHandle);
1987 as_handle->attribute = attribute_deserialize ((char*)&sam[1], 1987 as_handle->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&sam[1],
1988 data_len); 1988 data_len);
1989 1989
1990 as_handle->r_id = ntohl (sam->id); 1990 as_handle->r_id = ntohl (sam->id);
@@ -2280,7 +2280,7 @@ cleanup_ticket_iter_handle (struct TicketIteration *ti)
2280static void 2280static void
2281ticket_iterate_proc (void *cls, 2281ticket_iterate_proc (void *cls,
2282 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 2282 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
2283 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs) 2283 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs)
2284{ 2284{
2285 struct TicketIterationProcResult *proc = cls; 2285 struct TicketIterationProcResult *proc = cls;
2286 2286
diff --git a/src/identity-provider/identity_attribute.c b/src/identity-provider/identity_attribute.c
deleted file mode 100644
index c7e833326..000000000
--- a/src/identity-provider/identity_attribute.c
+++ /dev/null
@@ -1,245 +0,0 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2010-2015 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
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 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19 */
20
21/**
22 * @file identity-provider/identity_attribute.c
23 * @brief helper library to manage identity attributes
24 * @author Martin Schanzenbach
25 */
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "identity_attribute.h"
29
30/**
31 * Create a new attribute.
32 *
33 * @param name the attribute name
34 * @param type the attribute type
35 * @param data the attribute value
36 * @param data_size the attribute value size
37 * @return the new attribute
38 */
39struct GNUNET_IDENTITY_PROVIDER_Attribute *
40attribute_new (const char* attr_name,
41 uint32_t attr_type,
42 const void* data,
43 size_t data_size)
44{
45 struct GNUNET_IDENTITY_PROVIDER_Attribute *attr;
46 char *write_ptr;
47
48 attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_Attribute) +
49 strlen (attr_name) + 1 +
50 data_size);
51 attr->attribute_type = attr_type;
52 attr->data_size = data_size;
53 write_ptr = (char*)&attr[1];
54 GNUNET_memcpy (write_ptr,
55 attr_name,
56 strlen (attr_name) + 1);
57 attr->name = write_ptr;
58 write_ptr += strlen (attr->name) + 1;
59 GNUNET_memcpy (write_ptr,
60 data,
61 data_size);
62 attr->data = write_ptr;
63 return attr;
64}
65
66size_t
67attribute_list_serialize_get_size (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
68{
69 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le;
70 size_t len = 0;
71 for (le = attrs->list_head; NULL != le; le = le->next)
72 len += attribute_serialize_get_size (le->attribute);
73 return len;
74}
75
76size_t
77attribute_list_serialize (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs,
78 char *result)
79{
80 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le;
81 size_t len;
82 size_t total_len;
83 char* write_ptr;
84
85 write_ptr = result;
86 total_len = 0;
87 for (le = attrs->list_head; NULL != le; le = le->next)
88 {
89 len = attribute_serialize (le->attribute,
90 write_ptr);
91 total_len += len;
92 write_ptr += len;
93 }
94 return total_len;
95}
96
97struct GNUNET_IDENTITY_PROVIDER_AttributeList *
98attribute_list_deserialize (const char* data,
99 size_t data_size)
100{
101 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs;
102 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le;
103 size_t attr_len;
104 const char* read_ptr;
105
106 if (data_size < sizeof (struct Attribute))
107 return NULL;
108
109 attrs = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeList);
110 read_ptr = data;
111 while (((data + data_size) - read_ptr) >= sizeof (struct Attribute))
112 {
113
114 le = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry);
115 le->attribute = attribute_deserialize (read_ptr,
116 data_size - (read_ptr - data));
117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
118 "Deserialized attribute %s\n", le->attribute->name);
119 GNUNET_CONTAINER_DLL_insert (attrs->list_head,
120 attrs->list_tail,
121 le);
122 attr_len = attribute_serialize_get_size (le->attribute);
123 read_ptr += attr_len;
124 }
125 return attrs;
126}
127
128struct GNUNET_IDENTITY_PROVIDER_AttributeList*
129attribute_list_dup (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
130{
131 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le;
132 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *result_le;
133 struct GNUNET_IDENTITY_PROVIDER_AttributeList *result;
134 size_t len;
135
136 result = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeList);
137 for (le = attrs->list_head; NULL != le; le = le->next)
138 {
139 result_le = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry);
140 len = sizeof (struct GNUNET_IDENTITY_PROVIDER_Attribute) + le->attribute->data_size;
141 result_le->attribute = GNUNET_malloc (len);
142 GNUNET_memcpy (result_le->attribute,
143 le->attribute,
144 len);
145 result_le->attribute->name = (const char*)&result_le->attribute[1];
146 GNUNET_CONTAINER_DLL_insert (result->list_head,
147 result->list_tail,
148 result_le);
149 }
150 return result;
151}
152
153
154void
155attribute_list_destroy (struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
156{
157 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le;
158 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *tmp_le;
159
160 for (le = attrs->list_head; NULL != le;)
161 {
162 GNUNET_free (le->attribute);
163 tmp_le = le;
164 le = le->next;
165 GNUNET_free (tmp_le);
166 }
167 GNUNET_free (attrs);
168
169}
170
171size_t
172attribute_serialize_get_size (const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr)
173{
174 return sizeof (struct Attribute)
175 + strlen (attr->name)
176 + attr->data_size; //TODO get data_size from plugin
177}
178
179size_t
180attribute_serialize (const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr,
181 char *result)
182{
183 size_t data_len_ser;
184 size_t name_len;
185 struct Attribute *attr_ser;
186 char* write_ptr;
187
188 attr_ser = (struct Attribute*)result;
189 attr_ser->attribute_type = htons (attr->attribute_type);
190 attr_ser->attribute_version = htonl (attr->attribute_version);
191 name_len = strlen (attr->name);
192 attr_ser->name_len = htons (name_len);
193 write_ptr = (char*)&attr_ser[1];
194 GNUNET_memcpy (write_ptr, attr->name, name_len);
195 write_ptr += name_len;
196 //TODO plugin-ize
197 //data_len_ser = plugin->serialize_attribute_value (attr,
198 // &attr_ser[1]);
199 data_len_ser = attr->data_size;
200 GNUNET_memcpy (write_ptr, attr->data, attr->data_size);
201 attr_ser->data_size = htons (data_len_ser);
202
203 return sizeof (struct Attribute) + strlen (attr->name) + attr->data_size;
204}
205
206struct GNUNET_IDENTITY_PROVIDER_Attribute *
207attribute_deserialize (const char* data,
208 size_t data_size)
209{
210 struct GNUNET_IDENTITY_PROVIDER_Attribute *attr;
211 struct Attribute *attr_ser;
212 size_t data_len;
213 size_t name_len;
214 char* write_ptr;
215
216 if (data_size < sizeof (struct Attribute))
217 return NULL;
218
219 attr_ser = (struct Attribute*)data;
220 //TODO use plugin.
221 data_len = ntohs (attr_ser->data_size);
222 name_len = ntohs (attr_ser->name_len);
223 attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_Attribute)
224 + data_len + name_len + 1);
225 attr->attribute_type = ntohs (attr_ser->attribute_type);
226 attr->attribute_version = ntohl (attr_ser->attribute_version);
227 attr->data_size = ntohs (attr_ser->data_size);
228
229 write_ptr = (char*)&attr[1];
230 GNUNET_memcpy (write_ptr,
231 &attr_ser[1],
232 name_len);
233 write_ptr[name_len] = '\0';
234 attr->name = write_ptr;
235
236 write_ptr += name_len + 1;
237 GNUNET_memcpy (write_ptr,
238 (char*)&attr_ser[1] + name_len,
239 attr->data_size);
240 attr->data = write_ptr;
241 return attr;
242
243}
244
245/* end of identity_attribute.c */
diff --git a/src/identity-provider/identity_attribute.h b/src/identity-provider/identity_attribute.h
deleted file mode 100644
index 3e8fadccf..000000000
--- a/src/identity-provider/identity_attribute.h
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2012-2015 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
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 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19 */
20/**
21 * @author Martin Schanzenbach
22 * @file identity-provider/identity_attribute.h
23 * @brief GNUnet Identity Provider library
24 *
25 */
26#ifndef IDENTITY_ATTRIBUTE_H
27#define IDENTITY_ATTRIBUTE_H
28
29#include "gnunet_identity_provider_service.h"
30
31struct Attribute
32{
33 /**
34 * Attribute type
35 */
36 uint32_t attribute_type;
37
38 /**
39 * Attribute version
40 */
41 uint32_t attribute_version;
42
43 /**
44 * Name length
45 */
46 uint32_t name_len;
47
48 /**
49 * Data size
50 */
51 uint32_t data_size;
52
53 //followed by data_size Attribute value data
54};
55
56/**
57 * Get required size for serialization buffer
58 *
59 * @param attrs the attribute list to serialize
60 *
61 * @return the required buffer size
62 */
63size_t
64attribute_list_serialize_get_size (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
65
66void
67attribute_list_destroy (struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
68
69
70/**
71 * Serialize an attribute list
72 *
73 * @param attrs the attribute list to serialize
74 * @param result the serialized attribute
75 *
76 * @return length of serialized data
77 */
78size_t
79attribute_list_serialize (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs,
80 char *result);
81
82/**
83 * Deserialize an attribute list
84 *
85 * @param data the serialized attribute list
86 * @param data_size the length of the serialized data
87 *
88 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller
89 */
90struct GNUNET_IDENTITY_PROVIDER_AttributeList *
91attribute_list_deserialize (const char* data,
92 size_t data_size);
93
94
95/**
96 * Get required size for serialization buffer
97 *
98 * @param attr the attribute to serialize
99 *
100 * @return the required buffer size
101 */
102size_t
103attribute_serialize_get_size (const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr);
104
105
106
107/**
108 * Serialize an attribute
109 *
110 * @param attr the attribute to serialize
111 * @param result the serialized attribute
112 *
113 * @return length of serialized data
114 */
115size_t
116attribute_serialize (const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr,
117 char *result);
118
119/**
120 * Deserialize an attribute
121 *
122 * @param data the serialized attribute
123 * @param data_size the length of the serialized data
124 *
125 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller
126 */
127struct GNUNET_IDENTITY_PROVIDER_Attribute *
128attribute_deserialize (const char* data,
129 size_t data_size);
130
131/**
132 * Create a new attribute.
133 *
134 * @param name the attribute name
135 * @param type the attribute type
136 * @param data the attribute value
137 * @param data_size the attribute value size
138 * @return the new attribute
139 */
140struct GNUNET_IDENTITY_PROVIDER_Attribute *
141attribute_new (const char* attr_name,
142 uint32_t attr_type,
143 const void* data,
144 size_t data_size);
145
146struct GNUNET_IDENTITY_PROVIDER_AttributeList*
147attribute_list_dup (const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
148
149#endif
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c
index 6d28709df..6fc8d228a 100644
--- a/src/identity-provider/identity_provider_api.c
+++ b/src/identity-provider/identity_provider_api.c
@@ -29,13 +29,12 @@
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "gnunet_mq_lib.h" 30#include "gnunet_mq_lib.h"
31#include "gnunet_identity_provider_service.h" 31#include "gnunet_identity_provider_service.h"
32#include "gnunet_identity_attribute_lib.h"
32#include "identity_provider.h" 33#include "identity_provider.h"
33#include "identity_attribute.h"
34 34
35#define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) 35#define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__)
36 36
37 37
38
39/** 38/**
40 * Handle for an operation with the service. 39 * Handle for an operation with the service.
41 */ 40 */
@@ -495,9 +494,9 @@ handle_consume_ticket_result (void *cls,
495 return; 494 return;
496 495
497 { 496 {
498 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs; 497 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs;
499 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *le; 498 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
500 attrs = attribute_list_deserialize ((char*)&msg[1], 499 attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize ((char*)&msg[1],
501 attrs_len); 500 attrs_len);
502 if (NULL != op->ar_cb) 501 if (NULL != op->ar_cb)
503 { 502 {
@@ -512,8 +511,8 @@ handle_consume_ticket_result (void *cls,
512 for (le = attrs->list_head; NULL != le; le = le->next) 511 for (le = attrs->list_head; NULL != le; le = le->next)
513 op->ar_cb (op->cls, 512 op->ar_cb (op->cls,
514 &msg->identity, 513 &msg->identity,
515 le->attribute); 514 le->claim);
516 attribute_list_destroy (attrs); 515 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs);
517 } 516 }
518 } 517 }
519 op->ar_cb (op->cls, 518 op->ar_cb (op->cls,
@@ -619,9 +618,9 @@ handle_attribute_result (void *cls,
619 } 618 }
620 619
621 { 620 {
622 struct GNUNET_IDENTITY_PROVIDER_Attribute *attr; 621 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr;
623 attr = attribute_deserialize ((char*)&msg[1], 622 attr = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&msg[1],
624 attr_len); 623 attr_len);
625 if (NULL != it) 624 if (NULL != it)
626 { 625 {
627 if (NULL != it->proc) 626 if (NULL != it->proc)
@@ -905,7 +904,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
905struct GNUNET_IDENTITY_PROVIDER_Operation * 904struct GNUNET_IDENTITY_PROVIDER_Operation *
906GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 905GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
907 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 906 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
908 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr, 907 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr,
909 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont, 908 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont,
910 void *cont_cls) 909 void *cont_cls)
911{ 910{
@@ -921,14 +920,14 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
921 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, 920 GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
922 h->op_tail, 921 h->op_tail,
923 op); 922 op);
924 attr_len = attribute_serialize_get_size (attr); 923 attr_len = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (attr);
925 op->env = GNUNET_MQ_msg_extra (sam, 924 op->env = GNUNET_MQ_msg_extra (sam,
926 attr_len, 925 attr_len,
927 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE); 926 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE);
928 sam->identity = *pkey; 927 sam->identity = *pkey;
929 sam->id = htonl (op->r_id); 928 sam->id = htonl (op->r_id);
930 929
931 attribute_serialize (attr, 930 GNUNET_IDENTITY_ATTRIBUTE_serialize (attr,
932 (char*)&sam[1]); 931 (char*)&sam[1]);
933 932
934 sam->attr_len = htons (attr_len); 933 sam->attr_len = htons (attr_len);
@@ -941,24 +940,6 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
941 940
942 941
943/** 942/**
944 * Create a new attribute.
945 *
946 * @param name the attribute name
947 * @param type the attribute type
948 * @param data the attribute value
949 * @param data_size the attribute value size
950 * @return the new attribute
951 */
952struct GNUNET_IDENTITY_PROVIDER_Attribute *
953GNUNET_IDENTITY_PROVIDER_attribute_new (const char* attr_name,
954 uint32_t attr_type,
955 const void* data,
956 size_t data_size)
957{
958 return attribute_new (attr_name, attr_type, data, data_size);
959}
960
961/**
962 * List all attributes for a local identity. 943 * List all attributes for a local identity.
963 * This MUST lock the `struct GNUNET_IDENTITY_PROVIDER_Handle` 944 * This MUST lock the `struct GNUNET_IDENTITY_PROVIDER_Handle`
964 * for any other calls than #GNUNET_IDENTITY_PROVIDER_get_attributes_next() and 945 * for any other calls than #GNUNET_IDENTITY_PROVIDER_get_attributes_next() and
@@ -1089,7 +1070,7 @@ struct GNUNET_IDENTITY_PROVIDER_Operation *
1089GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1070GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
1090 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 1071 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
1091 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 1072 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
1092 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs, 1073 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
1093 GNUNET_IDENTITY_PROVIDER_TicketCallback cb, 1074 GNUNET_IDENTITY_PROVIDER_TicketCallback cb,
1094 void *cb_cls) 1075 void *cb_cls)
1095{ 1076{
@@ -1105,7 +1086,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1105 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, 1086 GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
1106 h->op_tail, 1087 h->op_tail,
1107 op); 1088 op);
1108 attr_len = attribute_list_serialize_get_size (attrs); 1089 attr_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (attrs);
1109 op->env = GNUNET_MQ_msg_extra (tim, 1090 op->env = GNUNET_MQ_msg_extra (tim,
1110 attr_len, 1091 attr_len,
1111 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET); 1092 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET);
@@ -1113,7 +1094,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1113 tim->rp = *rp; 1094 tim->rp = *rp;
1114 tim->id = htonl (op->r_id); 1095 tim->id = htonl (op->r_id);
1115 1096
1116 attribute_list_serialize (attrs, 1097 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs,
1117 (char*)&tim[1]); 1098 (char*)&tim[1]);
1118 1099
1119 tim->attr_len = htons (attr_len); 1100 tim->attr_len = htons (attr_len);
diff --git a/src/identity-provider/plugin_identity_provider_sqlite.c b/src/identity-provider/plugin_identity_provider_sqlite.c
index c87f30e1c..594e4788d 100644
--- a/src/identity-provider/plugin_identity_provider_sqlite.c
+++ b/src/identity-provider/plugin_identity_provider_sqlite.c
@@ -27,7 +27,7 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_identity_provider_service.h" 28#include "gnunet_identity_provider_service.h"
29#include "gnunet_identity_provider_plugin.h" 29#include "gnunet_identity_provider_plugin.h"
30#include "identity_attribute.h" 30#include "gnunet_identity_attribute_lib.h"
31#include "gnunet_sq_lib.h" 31#include "gnunet_sq_lib.h"
32#include <sqlite3.h> 32#include <sqlite3.h>
33 33
@@ -373,7 +373,7 @@ database_shutdown (struct Plugin *plugin)
373static int 373static int
374identity_provider_sqlite_store_ticket (void *cls, 374identity_provider_sqlite_store_ticket (void *cls,
375 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 375 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
376 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs) 376 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs)
377{ 377{
378 struct Plugin *plugin = cls; 378 struct Plugin *plugin = cls;
379 size_t attrs_len; 379 size_t attrs_len;
@@ -402,9 +402,9 @@ identity_provider_sqlite_store_ticket (void *cls,
402 GNUNET_SQ_reset (plugin->dbh, 402 GNUNET_SQ_reset (plugin->dbh,
403 plugin->delete_ticket); 403 plugin->delete_ticket);
404 404
405 attrs_len = attribute_list_serialize_get_size (attrs); 405 attrs_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (attrs);
406 attrs_ser = GNUNET_malloc (attrs_len); 406 attrs_ser = GNUNET_malloc (attrs_len);
407 attribute_list_serialize (attrs, 407 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs,
408 attrs_ser); 408 attrs_ser);
409 struct GNUNET_SQ_QueryParam sparams[] = { 409 struct GNUNET_SQ_QueryParam sparams[] = {
410 GNUNET_SQ_query_param_auto_from_type (&ticket->identity), 410 GNUNET_SQ_query_param_auto_from_type (&ticket->identity),
@@ -526,7 +526,7 @@ get_ticket_and_call_iterator (struct Plugin *plugin,
526 void *iter_cls) 526 void *iter_cls)
527{ 527{
528 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 528 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket;
529 struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs; 529 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs;
530 int ret; 530 int ret;
531 int sret; 531 int sret;
532 size_t attrs_len; 532 size_t attrs_len;
@@ -553,13 +553,13 @@ get_ticket_and_call_iterator (struct Plugin *plugin,
553 } 553 }
554 else 554 else
555 { 555 {
556 attrs = attribute_list_deserialize (attrs_ser, 556 attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize (attrs_ser,
557 attrs_len); 557 attrs_len);
558 if (NULL != iter) 558 if (NULL != iter)
559 iter (iter_cls, 559 iter (iter_cls,
560 &ticket, 560 &ticket,
561 attrs); 561 attrs);
562 attribute_list_destroy (attrs); 562 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs);
563 ret = GNUNET_YES; 563 ret = GNUNET_YES;
564 } 564 }
565 GNUNET_SQ_cleanup_result (rs); 565 GNUNET_SQ_cleanup_result (rs);
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c
index f6039722f..c27662a0d 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/identity-provider/plugin_rest_identity_provider.c
@@ -37,6 +37,7 @@
37#include <jansson.h> 37#include <jansson.h>
38#include <inttypes.h> 38#include <inttypes.h>
39#include "gnunet_signatures.h" 39#include "gnunet_signatures.h"
40#include "gnunet_identity_attribute_lib.h"
40#include "gnunet_identity_provider_service.h" 41#include "gnunet_identity_provider_service.h"
41 42
42/** 43/**
@@ -508,7 +509,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
508 struct RequestHandle *handle = cls; 509 struct RequestHandle *handle = cls;
509 struct EgoEntry *ego_entry; 510 struct EgoEntry *ego_entry;
510 struct MHD_Response *resp; 511 struct MHD_Response *resp;
511 struct GNUNET_IDENTITY_PROVIDER_Attribute *attribute; 512 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attribute;
512 struct GNUNET_JSONAPI_Document *json_obj; 513 struct GNUNET_JSONAPI_Document *json_obj;
513 struct GNUNET_JSONAPI_Resource *json_res; 514 struct GNUNET_JSONAPI_Resource *json_res;
514 char term_data[handle->rest_handle->data_size+1]; 515 char term_data[handle->rest_handle->data_size+1];
@@ -596,8 +597,8 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
596 value_json = GNUNET_JSONAPI_resource_read_attr (json_res, 597 value_json = GNUNET_JSONAPI_resource_read_attr (json_res,
597 "value"); 598 "value");
598 value_str = json_string_value (value_json); 599 value_str = json_string_value (value_json);
599 attribute = GNUNET_IDENTITY_PROVIDER_attribute_new (name_str, 600 attribute = GNUNET_IDENTITY_ATTRIBUTE_claim_new (name_str,
600 GNUNET_IDENTITY_PROVIDER_AT_STRING, 601 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
601 value_str, 602 value_str,
602 strlen (value_str) + 1); 603 strlen (value_str) + 1);
603 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 604 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg);
@@ -619,7 +620,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
619static void 620static void
620attr_collect (void *cls, 621attr_collect (void *cls,
621 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 622 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
622 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr) 623 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr)
623{ 624{
624 struct GNUNET_JSONAPI_Resource *json_resource; 625 struct GNUNET_JSONAPI_Resource *json_resource;
625 struct RequestHandle *handle = cls; 626 struct RequestHandle *handle = cls;
@@ -833,7 +834,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
833static void 834static void
834consume_cont (void *cls, 835consume_cont (void *cls,
835 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 836 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
836 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr) 837 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr)
837{ 838{
838 struct RequestHandle *handle = cls; 839 struct RequestHandle *handle = cls;
839 struct GNUNET_JSONAPI_Resource *json_resource; 840 struct GNUNET_JSONAPI_Resource *json_resource;