diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2017-12-02 22:32:28 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2017-12-02 22:32:28 +0100 |
commit | a9a7ac802811e76e33b54040bf31f00ea9438cea (patch) | |
tree | 7f9a22daca2b95e7308d8877c668fc878a39ae4c /src/identity-provider/gnunet-service-identity-provider.c | |
parent | 14c62ed969ace8843154d10b55d4c3571383dc37 (diff) | |
download | gnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.tar.gz gnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.zip |
-refactored
Diffstat (limited to 'src/identity-provider/gnunet-service-identity-provider.c')
-rw-r--r-- | src/identity-provider/gnunet-service-identity-provider.c | 120 |
1 files changed, 60 insertions, 60 deletions
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 | |||
809 | cleanup_ticket_issue_handle (struct TicketIssueHandle *handle) | 809 | cleanup_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 | |||
820 | send_ticket_result (struct IdpClient *client, | 820 | send_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 | ||
874 | int | 874 | int |
875 | serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, | 875 | serialize_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 | |||
1087 | cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle) | 1087 | cleanup_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, | |||
1132 | static void | 1132 | static void |
1133 | ticket_reissue_proc (void *cls, | 1133 | ticket_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 | ||
1137 | static void | 1137 | static void |
1138 | revocation_reissue_tickets (struct TicketRevocationHandle *rh); | 1138 | revocation_reissue_tickets (struct TicketRevocationHandle *rh); |
@@ -1176,11 +1176,11 @@ reissue_ticket_cont (void *cls, | |||
1176 | static void | 1176 | static void |
1177 | ticket_reissue_proc (void *cls, | 1177 | ticket_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, | |||
1437 | static void | 1437 | static void |
1438 | process_attributes_to_update (void *cls, | 1438 | process_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, | |||
1830 | static void | 1830 | static void |
1831 | cleanup_as_handle (struct AttributeStoreHandle *handle) | 1831 | cleanup_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) | |||
2280 | static void | 2280 | static void |
2281 | ticket_iterate_proc (void *cls, | 2281 | ticket_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 | ||