aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-08 10:49:06 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-08 10:49:06 +0100
commitf2d31fb82a314dcf6819dd494ff4a11e4f871c4e (patch)
tree029043b01c23f6e780f7fd01c15d467c568664ff /src/identity-provider
parent9f5ea1f7f809d73cbeb7ce5538550c42e978d340 (diff)
parent3f52ce03cb13118bef9a6fbe380f229e2cbec45f (diff)
downloadgnunet-f2d31fb82a314dcf6819dd494ff4a11e4f871c4e.tar.gz
gnunet-f2d31fb82a314dcf6819dd494ff4a11e4f871c4e.zip
Merge remote-tracking branch 'origin/master' into identity_oidc
Diffstat (limited to 'src/identity-provider')
-rw-r--r--src/identity-provider/Makefile.am1
-rw-r--r--src/identity-provider/gnunet-idp.c5
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c310
-rw-r--r--src/identity-provider/identity_provider.h8
-rw-r--r--src/identity-provider/identity_provider_api.c41
-rw-r--r--src/identity-provider/plugin_gnsrecord_identity_provider.c4
-rw-r--r--src/identity-provider/plugin_identity_provider_sqlite.c4
-rw-r--r--src/identity-provider/plugin_rest_identity_provider.c11
8 files changed, 148 insertions, 236 deletions
diff --git a/src/identity-provider/Makefile.am b/src/identity-provider/Makefile.am
index 5c5ddaa57..adf6af3b3 100644
--- a/src/identity-provider/Makefile.am
+++ b/src/identity-provider/Makefile.am
@@ -70,6 +70,7 @@ gnunet_service_identity_provider_LDADD = \
70 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 70 $(top_builddir)/src/namestore/libgnunetnamestore.la \
71 $(top_builddir)/src/identity/libgnunetidentity.la \ 71 $(top_builddir)/src/identity/libgnunetidentity.la \
72 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 72 $(top_builddir)/src/statistics/libgnunetstatistics.la \
73 $(top_builddir)/src/abe/libgnunetabe.la \
73 $(top_builddir)/src/credential/libgnunetcredential.la \ 74 $(top_builddir)/src/credential/libgnunetcredential.la \
74 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \ 75 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \
75 libgnunetidentityprovider.la \ 76 libgnunetidentityprovider.la \
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c
index 62f07842b..995dd5775 100644
--- a/src/identity-provider/gnunet-idp.c
+++ b/src/identity-provider/gnunet-idp.c
@@ -432,8 +432,7 @@ main(int argc, char *const argv[])
432 &type_str), 432 &type_str),
433 GNUNET_GETOPT_OPTION_END 433 GNUNET_GETOPT_OPTION_END
434 }; 434 };
435 GNUNET_PROGRAM_run (argc, argv, "ct", 435 return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, "ct",
436 "ct", options, 436 "ct", options,
437 &run, NULL); 437 &run, NULL));
438 return ret;
439} 438}
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index a5c178aa5..265719d58 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -30,6 +30,7 @@
30#include "gnunet_identity_service.h" 30#include "gnunet_identity_service.h"
31#include "gnunet_gnsrecord_lib.h" 31#include "gnunet_gnsrecord_lib.h"
32#include "gnunet_namestore_service.h" 32#include "gnunet_namestore_service.h"
33#include "gnunet_abe_lib.h"
33#include "gnunet_credential_service.h" 34#include "gnunet_credential_service.h"
34#include "gnunet_statistics_service.h" 35#include "gnunet_statistics_service.h"
35#include "gnunet_gns_service.h" 36#include "gnunet_gns_service.h"
@@ -94,11 +95,6 @@ static struct GNUNET_GNS_Handle *gns_handle;
94static struct GNUNET_CREDENTIAL_Handle *credential_handle; 95static struct GNUNET_CREDENTIAL_Handle *credential_handle;
95 96
96/** 97/**
97 * Stats handle
98 */
99static struct GNUNET_STATISTICS_Handle *stats_handle;
100
101/**
102 * Namestore qe 98 * Namestore qe
103 */ 99 */
104static struct GNUNET_NAMESTORE_QueueEntry *ns_qe; 100static struct GNUNET_NAMESTORE_QueueEntry *ns_qe;
@@ -205,7 +201,7 @@ struct TicketIteration
205 */ 201 */
206typedef void 202typedef void
207(*AbeBootstrapResult) (void *cls, 203(*AbeBootstrapResult) (void *cls,
208 struct GNUNET_CRYPTO_AbeMasterKey *abe_key); 204 struct GNUNET_ABE_AbeMasterKey *abe_key);
209 205
210 206
211struct AbeBootstrapHandle 207struct AbeBootstrapHandle
@@ -233,7 +229,7 @@ struct AbeBootstrapHandle
233 /** 229 /**
234 * The issuer egos ABE master key 230 * The issuer egos ABE master key
235 */ 231 */
236 struct GNUNET_CRYPTO_AbeMasterKey *abe_key; 232 struct GNUNET_ABE_AbeMasterKey *abe_key;
237}; 233};
238 234
239/** 235/**
@@ -264,7 +260,7 @@ struct AttributeIterator
264 /** 260 /**
265 * The issuer egos ABE master key 261 * The issuer egos ABE master key
266 */ 262 */
267 struct GNUNET_CRYPTO_AbeMasterKey *abe_key; 263 struct GNUNET_ABE_AbeMasterKey *abe_key;
268 264
269 /** 265 /**
270 * Namestore iterator 266 * Namestore iterator
@@ -355,7 +351,7 @@ struct AttributeStoreHandle
355 /** 351 /**
356 * The issuer egos ABE master key 352 * The issuer egos ABE master key
357 */ 353 */
358 struct GNUNET_CRYPTO_AbeMasterKey *abe_key; 354 struct GNUNET_ABE_AbeMasterKey *abe_key;
359 355
360 /** 356 /**
361 * QueueEntry 357 * QueueEntry
@@ -423,7 +419,7 @@ struct ConsumeTicketHandle
423 /** 419 /**
424 * The ABE key 420 * The ABE key
425 */ 421 */
426 struct GNUNET_CRYPTO_AbeKey *key; 422 struct GNUNET_ABE_AbeKey *key;
427 423
428 /** 424 /**
429 * Attributes 425 * Attributes
@@ -520,7 +516,7 @@ struct TicketRevocationHandle
520 /** 516 /**
521 * The ABE master key 517 * The ABE master key
522 */ 518 */
523 struct GNUNET_CRYPTO_AbeMasterKey *abe_key; 519 struct GNUNET_ABE_AbeMasterKey *abe_key;
524 520
525 /** 521 /**
526 * Offset 522 * Offset
@@ -634,12 +630,8 @@ cleanup()
634 GNUNET_NAMESTORE_cancel (ns_qe); 630 GNUNET_NAMESTORE_cancel (ns_qe);
635 if (NULL != ns_handle) 631 if (NULL != ns_handle)
636 GNUNET_NAMESTORE_disconnect (ns_handle); 632 GNUNET_NAMESTORE_disconnect (ns_handle);
637 if (NULL != stats_handle) 633 GNUNET_free_non_null (token);
638 GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); 634 GNUNET_free_non_null (label);
639 if (NULL != token)
640 GNUNET_free (token);
641 if (NULL != label)
642 GNUNET_free (label);
643 635
644} 636}
645 637
@@ -647,7 +639,6 @@ cleanup()
647 * Shutdown task 639 * Shutdown task
648 * 640 *
649 * @param cls NULL 641 * @param cls NULL
650 * @param tc task context
651 */ 642 */
652static void 643static void
653do_shutdown (void *cls) 644do_shutdown (void *cls)
@@ -690,7 +681,7 @@ bootstrap_store_task (void *cls)
690 struct GNUNET_GNSRECORD_Data rd[1]; 681 struct GNUNET_GNSRECORD_Data rd[1];
691 char *key; 682 char *key;
692 683
693 rd[0].data_size = GNUNET_CRYPTO_cpabe_serialize_master_key (abh->abe_key, 684 rd[0].data_size = GNUNET_ABE_cpabe_serialize_master_key (abh->abe_key,
694 (void**)&key); 685 (void**)&key);
695 rd[0].data = key; 686 rd[0].data = key;
696 rd[0].record_type = GNUNET_GNSRECORD_TYPE_ABE_MASTER; 687 rd[0].record_type = GNUNET_GNSRECORD_TYPE_ABE_MASTER;
@@ -713,7 +704,6 @@ static void
713bootstrap_abe_error (void *cls) 704bootstrap_abe_error (void *cls)
714{ 705{
715 struct AbeBootstrapHandle *abh = cls; 706 struct AbeBootstrapHandle *abh = cls;
716 GNUNET_free (abh);
717 abh->proc (abh->proc_cls, NULL); 707 abh->proc (abh->proc_cls, NULL);
718 GNUNET_free (abh); 708 GNUNET_free (abh);
719} 709}
@@ -730,13 +720,12 @@ bootstrap_abe_result (void *cls,
730 const struct GNUNET_GNSRECORD_Data *rd) 720 const struct GNUNET_GNSRECORD_Data *rd)
731{ 721{
732 struct AbeBootstrapHandle *abh = cls; 722 struct AbeBootstrapHandle *abh = cls;
733 struct GNUNET_CRYPTO_AbeMasterKey *abe_key; 723 struct GNUNET_ABE_AbeMasterKey *abe_key;
734 int i;
735 724
736 for (i=0;i<rd_count;i++) { 725 for (uint32_t i=0;i<rd_count;i++) {
737 if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type) 726 if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type)
738 continue; 727 continue;
739 abe_key = GNUNET_CRYPTO_cpabe_deserialize_master_key (rd[i].data, 728 abe_key = GNUNET_ABE_cpabe_deserialize_master_key (rd[i].data,
740 rd[i].data_size); 729 rd[i].data_size);
741 abh->proc (abh->proc_cls, abe_key); 730 abh->proc (abh->proc_cls, abe_key);
742 GNUNET_free (abh); 731 GNUNET_free (abh);
@@ -744,7 +733,7 @@ bootstrap_abe_result (void *cls,
744 } 733 }
745 734
746 //No ABE master found, bootstrapping... 735 //No ABE master found, bootstrapping...
747 abh->abe_key = GNUNET_CRYPTO_cpabe_create_master_key (); 736 abh->abe_key = GNUNET_ABE_cpabe_create_master_key ();
748 GNUNET_SCHEDULER_add_now (&bootstrap_store_task, abh); 737 GNUNET_SCHEDULER_add_now (&bootstrap_store_task, abh);
749} 738}
750 739
@@ -767,7 +756,7 @@ bootstrap_abe (const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
767 abh->identity = *identity; 756 abh->identity = *identity;
768 if (GNUNET_YES == recreate) 757 if (GNUNET_YES == recreate)
769 { 758 {
770 abh->abe_key = GNUNET_CRYPTO_cpabe_create_master_key (); 759 abh->abe_key = GNUNET_ABE_cpabe_create_master_key ();
771 GNUNET_SCHEDULER_add_now (&bootstrap_store_task, abh); 760 GNUNET_SCHEDULER_add_now (&bootstrap_store_task, abh);
772 } else { 761 } else {
773 abh->ns_qe = GNUNET_NAMESTORE_records_lookup (ns_handle, 762 abh->ns_qe = GNUNET_NAMESTORE_records_lookup (ns_handle,
@@ -874,7 +863,7 @@ store_ticket_issue_cont (void *cls,
874int 863int
875serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 864serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
876 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 865 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
877 const struct GNUNET_CRYPTO_AbeKey *rp_key, 866 const struct GNUNET_ABE_AbeKey *rp_key,
878 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey, 867 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey,
879 char **result) 868 char **result)
880{ 869{
@@ -892,7 +881,7 @@ serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
892 struct GNUNET_HashCode new_key_hash; 881 struct GNUNET_HashCode new_key_hash;
893 ssize_t enc_size; 882 ssize_t enc_size;
894 883
895 size = GNUNET_CRYPTO_cpabe_serialize_key (rp_key, 884 size = GNUNET_ABE_cpabe_serialize_key (rp_key,
896 (void**)&serialized_key); 885 (void**)&serialized_key);
897 attrs_str_len = 0; 886 attrs_str_len = 0;
898 for (le = attrs->list_head; NULL != le; le = le->next) { 887 for (le = attrs->list_head; NULL != le; le = le->next) {
@@ -951,19 +940,19 @@ serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
951 940
952static void 941static void
953issue_ticket_after_abe_bootstrap (void *cls, 942issue_ticket_after_abe_bootstrap (void *cls,
954 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 943 struct GNUNET_ABE_AbeMasterKey *abe_key)
955{ 944{
956 struct TicketIssueHandle *ih = cls; 945 struct TicketIssueHandle *ih = cls;
957 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 946 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
958 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 947 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
959 struct GNUNET_GNSRECORD_Data code_record[1]; 948 struct GNUNET_GNSRECORD_Data code_record[1];
960 struct GNUNET_CRYPTO_AbeKey *rp_key; 949 struct GNUNET_ABE_AbeKey *rp_key;
961 char *code_record_data; 950 char *code_record_data;
962 char **attrs; 951 char **attrs;
963 char *label; 952 char *label;
964 char *policy; 953 char *policy;
965 int attrs_len; 954 int attrs_len;
966 int i; 955 uint32_t i;
967 size_t code_record_len; 956 size_t code_record_len;
968 957
969 //Create new ABE key for RP 958 //Create new ABE key for RP
@@ -983,7 +972,7 @@ issue_ticket_after_abe_bootstrap (void *cls,
983 i++; 972 i++;
984 } 973 }
985 attrs[i] = NULL; 974 attrs[i] = NULL;
986 rp_key = GNUNET_CRYPTO_cpabe_create_key (abe_key, 975 rp_key = GNUNET_ABE_cpabe_create_key (abe_key,
987 attrs); 976 attrs);
988 977
989 //TODO review this wireformat 978 //TODO review this wireformat
@@ -1014,19 +1003,12 @@ issue_ticket_after_abe_bootstrap (void *cls,
1014 GNUNET_free (label); 1003 GNUNET_free (label);
1015 GNUNET_free (attrs); 1004 GNUNET_free (attrs);
1016 GNUNET_free (code_record_data); 1005 GNUNET_free (code_record_data);
1017 GNUNET_CRYPTO_cpabe_delete_key (rp_key, 1006 GNUNET_ABE_cpabe_delete_key (rp_key,
1018 GNUNET_YES); 1007 GNUNET_YES);
1019 GNUNET_CRYPTO_cpabe_delete_master_key (abe_key); 1008 GNUNET_ABE_cpabe_delete_master_key (abe_key);
1020} 1009}
1021 1010
1022 1011
1023/**
1024 * Checks a ticket issue message
1025 *
1026 * @param cls client sending the message
1027 * @param im message of type `struct TicketIssueMessage`
1028 * @return #GNUNET_OK if @a im is well-formed
1029 */
1030static int 1012static int
1031check_issue_ticket_message(void *cls, 1013check_issue_ticket_message(void *cls,
1032 const struct IssueTicketMessage *im) 1014 const struct IssueTicketMessage *im)
@@ -1043,14 +1025,6 @@ check_issue_ticket_message(void *cls,
1043} 1025}
1044 1026
1045 1027
1046/**
1047 *
1048 * Handler for ticket issue message
1049 *
1050 * @param cls unused
1051 * @param client who sent the message
1052 * @param message the message
1053 */
1054static void 1028static void
1055handle_issue_ticket_message (void *cls, 1029handle_issue_ticket_message (void *cls,
1056 const struct IssueTicketMessage *im) 1030 const struct IssueTicketMessage *im)
@@ -1082,26 +1056,31 @@ handle_issue_ticket_message (void *cls,
1082 1056
1083/** 1057/**
1084 * Cleanup revoke handle 1058 * Cleanup revoke handle
1059 *
1060 * @param rh the ticket revocation handle
1085 */ 1061 */
1086static void 1062static void
1087cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle) 1063cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh)
1088{ 1064{
1089 if (NULL != handle->attrs) 1065 if (NULL != rh->attrs)
1090 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); 1066 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->attrs);
1091 if (NULL != handle->rvk_attrs) 1067 if (NULL != rh->rvk_attrs)
1092 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->rvk_attrs); 1068 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->rvk_attrs);
1093 if (NULL != handle->abe_key) 1069 if (NULL != rh->abe_key)
1094 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key); 1070 GNUNET_ABE_cpabe_delete_master_key (rh->abe_key);
1095 if (NULL != handle->ns_qe) 1071 if (NULL != rh->ns_qe)
1096 GNUNET_NAMESTORE_cancel (handle->ns_qe); 1072 GNUNET_NAMESTORE_cancel (rh->ns_qe);
1097 if (NULL != handle->ns_it) 1073 if (NULL != rh->ns_it)
1098 GNUNET_NAMESTORE_zone_iteration_stop (handle->ns_it); 1074 GNUNET_NAMESTORE_zone_iteration_stop (rh->ns_it);
1099 GNUNET_free (handle); 1075 GNUNET_free (rh);
1100} 1076}
1101 1077
1102 1078
1103/** 1079/**
1104 * Send revocation result 1080 * Send revocation result
1081 *
1082 * @param rh ticket revocation handle
1083 * @param success GNUNET_OK if successful result
1105 */ 1084 */
1106static void 1085static void
1107send_revocation_finished (struct TicketRevocationHandle *rh, 1086send_revocation_finished (struct TicketRevocationHandle *rh,
@@ -1183,13 +1162,13 @@ ticket_reissue_proc (void *cls,
1183 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le_rollover; 1162 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le_rollover;
1184 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 1163 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
1185 struct GNUNET_GNSRECORD_Data code_record[1]; 1164 struct GNUNET_GNSRECORD_Data code_record[1];
1186 struct GNUNET_CRYPTO_AbeKey *rp_key; 1165 struct GNUNET_ABE_AbeKey *rp_key;
1187 char *code_record_data; 1166 char *code_record_data;
1188 char **attr_arr; 1167 char **attr_arr;
1189 char *label; 1168 char *label;
1190 char *policy; 1169 char *policy;
1191 int attrs_len; 1170 int attrs_len;
1192 int i; 1171 uint32_t i;
1193 int reissue_ticket; 1172 int reissue_ticket;
1194 size_t code_record_len; 1173 size_t code_record_len;
1195 1174
@@ -1263,7 +1242,7 @@ ticket_reissue_proc (void *cls,
1263 i++; 1242 i++;
1264 } 1243 }
1265 attr_arr[i] = NULL; 1244 attr_arr[i] = NULL;
1266 rp_key = GNUNET_CRYPTO_cpabe_create_key (rh->abe_key, 1245 rp_key = GNUNET_ABE_cpabe_create_key (rh->abe_key,
1267 attr_arr); 1246 attr_arr);
1268 1247
1269 //TODO review this wireformat 1248 //TODO review this wireformat
@@ -1294,7 +1273,7 @@ ticket_reissue_proc (void *cls,
1294 GNUNET_free (label); 1273 GNUNET_free (label);
1295 GNUNET_free (attr_arr); 1274 GNUNET_free (attr_arr);
1296 GNUNET_free (code_record_data); 1275 GNUNET_free (code_record_data);
1297 GNUNET_CRYPTO_cpabe_delete_key (rp_key, GNUNET_YES); 1276 GNUNET_ABE_cpabe_delete_key (rp_key, GNUNET_YES);
1298} 1277}
1299 1278
1300 1279
@@ -1362,13 +1341,24 @@ reenc_next_attribute (struct TicketRevocationHandle *rh)
1362 /** 1341 /**
1363 * Encrypt the attribute value and store in namestore 1342 * Encrypt the attribute value and store in namestore
1364 */ 1343 */
1365 enc_size = GNUNET_CRYPTO_cpabe_encrypt (buf, 1344 enc_size = GNUNET_ABE_cpabe_encrypt (buf,
1366 buf_size, 1345 buf_size,
1367 policy, //Policy 1346 policy, //Policy
1368 rh->abe_key, 1347 rh->abe_key,
1369 (void**)&enc_buf); 1348 (void**)&enc_buf);
1370 GNUNET_free (buf); 1349 GNUNET_free (buf);
1350 if (GNUNET_SYSERR == enc_size)
1351 {
1352 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1353 "Unable to re-encrypt with policy %s\n",
1354 policy);
1355 GNUNET_free (policy);
1356 send_revocation_finished (rh, GNUNET_SYSERR);
1357 cleanup_revoke_ticket_handle (rh);
1358 return;
1359 }
1371 GNUNET_free (policy); 1360 GNUNET_free (policy);
1361
1372 rd[0].data_size = enc_size + sizeof (uint32_t); 1362 rd[0].data_size = enc_size + sizeof (uint32_t);
1373 rd_buf = GNUNET_malloc (rd[0].data_size); 1363 rd_buf = GNUNET_malloc (rd[0].data_size);
1374 attr_ver = htonl (rh->attrs->list_head->claim->version); 1364 attr_ver = htonl (rh->attrs->list_head->claim->version);
@@ -1463,7 +1453,7 @@ process_attributes_to_update (void *cls,
1463 1453
1464static void 1454static void
1465get_ticket_after_abe_bootstrap (void *cls, 1455get_ticket_after_abe_bootstrap (void *cls,
1466 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 1456 struct GNUNET_ABE_AbeMasterKey *abe_key)
1467{ 1457{
1468 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1458 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1469 "Finished ABE bootstrap\n"); 1459 "Finished ABE bootstrap\n");
@@ -1475,13 +1465,6 @@ get_ticket_after_abe_bootstrap (void *cls,
1475 rh); 1465 rh);
1476} 1466}
1477 1467
1478/**
1479 * Checks a ticket revocation message
1480 *
1481 * @param cls client sending the message
1482 * @param im message of type `struct RevokeTicketMessage`
1483 * @return #GNUNET_OK if @a im is well-formed
1484 */
1485static int 1468static int
1486check_revoke_ticket_message(void *cls, 1469check_revoke_ticket_message(void *cls,
1487 const struct RevokeTicketMessage *im) 1470 const struct RevokeTicketMessage *im)
@@ -1496,14 +1479,7 @@ check_revoke_ticket_message(void *cls,
1496 } 1479 }
1497 return GNUNET_OK; 1480 return GNUNET_OK;
1498} 1481}
1499/** 1482
1500 *
1501 * Handler for ticket revocation message
1502 *
1503 * @param cls unused
1504 * @param client who sent the message
1505 * @param message the message
1506 */
1507static void 1483static void
1508handle_revoke_ticket_message (void *cls, 1484handle_revoke_ticket_message (void *cls,
1509 const struct RevokeTicketMessage *rm) 1485 const struct RevokeTicketMessage *rm)
@@ -1534,8 +1510,8 @@ static void
1534cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle) 1510cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle)
1535{ 1511{
1536 if (NULL != handle->key) 1512 if (NULL != handle->key)
1537 GNUNET_CRYPTO_cpabe_delete_key (handle->key, 1513 GNUNET_ABE_cpabe_delete_key (handle->key,
1538 GNUNET_YES); 1514 GNUNET_YES);
1539 if (NULL != handle->attrs) 1515 if (NULL != handle->attrs)
1540 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); 1516 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs);
1541 GNUNET_free (handle); 1517 GNUNET_free (handle);
@@ -1543,13 +1519,6 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle)
1543 1519
1544 1520
1545 1521
1546/**
1547 * Checks a ticket consume message
1548 *
1549 * @param cls client sending the message
1550 * @param im message of type `struct ConsumeTicketMessage`
1551 * @return #GNUNET_OK if @a im is well-formed
1552 */
1553static int 1522static int
1554check_consume_ticket_message(void *cls, 1523check_consume_ticket_message(void *cls,
1555 const struct ConsumeTicketMessage *cm) 1524 const struct ConsumeTicketMessage *cm)
@@ -1587,11 +1556,11 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1587 parallel_lookup); 1556 parallel_lookup);
1588 GNUNET_free (parallel_lookup->label); 1557 GNUNET_free (parallel_lookup->label);
1589 1558
1590 GNUNET_STATISTICS_update (stats_handle, 1559 GNUNET_STATISTICS_update (stats,
1591 "attribute_lookup_time_total", 1560 "attribute_lookup_time_total",
1592 GNUNET_TIME_absolute_get_duration (parallel_lookup->lookup_start_time).rel_value_us, 1561 GNUNET_TIME_absolute_get_duration (parallel_lookup->lookup_start_time).rel_value_us,
1593 GNUNET_YES); 1562 GNUNET_YES);
1594 GNUNET_STATISTICS_update (stats_handle, 1563 GNUNET_STATISTICS_update (stats,
1595 "attribute_lookups_count", 1564 "attribute_lookups_count",
1596 1, 1565 1,
1597 GNUNET_YES); 1566 GNUNET_YES);
@@ -1603,24 +1572,24 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1603 if (rd->record_type == GNUNET_GNSRECORD_TYPE_ID_ATTR) 1572 if (rd->record_type == GNUNET_GNSRECORD_TYPE_ID_ATTR)
1604 { 1573 {
1605 decrypt_duration = GNUNET_TIME_absolute_get (); 1574 decrypt_duration = GNUNET_TIME_absolute_get ();
1606 attr_len = GNUNET_CRYPTO_cpabe_decrypt (rd->data + sizeof (uint32_t), 1575 attr_len = GNUNET_ABE_cpabe_decrypt (rd->data + sizeof (uint32_t),
1607 rd->data_size - sizeof (uint32_t), 1576 rd->data_size - sizeof (uint32_t),
1608 handle->key, 1577 handle->key,
1609 (void**)&data); 1578 (void**)&data);
1610 if (GNUNET_SYSERR != attr_len) 1579 if (GNUNET_SYSERR != attr_len)
1611 { 1580 {
1612 GNUNET_STATISTICS_update (stats_handle, 1581 GNUNET_STATISTICS_update (stats,
1613 "abe_decrypt_time_total", 1582 "abe_decrypt_time_total",
1614 GNUNET_TIME_absolute_get_duration (decrypt_duration).rel_value_us, 1583 GNUNET_TIME_absolute_get_duration (decrypt_duration).rel_value_us,
1615 GNUNET_YES); 1584 GNUNET_YES);
1616 GNUNET_STATISTICS_update (stats_handle, 1585 GNUNET_STATISTICS_update (stats,
1617 "abe_decrypt_count", 1586 "abe_decrypt_count",
1618 1, 1587 1,
1619 GNUNET_YES); 1588 GNUNET_YES);
1620 1589
1621 attr_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 1590 attr_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry);
1622 attr_le->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize (data, 1591 attr_le->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize (data,
1623 attr_len); 1592 attr_len);
1624 attr_le->claim->version = ntohl(*(uint32_t*)rd->data); 1593 attr_le->claim->version = ntohl(*(uint32_t*)rd->data);
1625 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head, 1594 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head,
1626 handle->attrs->list_tail, 1595 handle->attrs->list_tail,
@@ -1652,7 +1621,7 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1652 crm->identity = handle->ticket.identity; 1621 crm->identity = handle->ticket.identity;
1653 data_tmp = (char *) &crm[1]; 1622 data_tmp = (char *) &crm[1];
1654 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (handle->attrs, 1623 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (handle->attrs,
1655 data_tmp); 1624 data_tmp);
1656 GNUNET_MQ_send (handle->client->mq, env); 1625 GNUNET_MQ_send (handle->client->mq, env);
1657 cleanup_consume_ticket_handle (handle); 1626 cleanup_consume_ticket_handle (handle);
1658} 1627}
@@ -1734,20 +1703,20 @@ process_consume_abe_key (void *cls, uint32_t rd_count,
1734 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1703 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1735 "Decrypted bytes: %zd Expected bytes: %zd\n", 1704 "Decrypted bytes: %zd Expected bytes: %zd\n",
1736 size, rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); 1705 size, rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey));
1737 GNUNET_STATISTICS_update (stats_handle, 1706 GNUNET_STATISTICS_update (stats,
1738 "abe_key_lookup_time_total", 1707 "abe_key_lookup_time_total",
1739 GNUNET_TIME_absolute_get_duration (handle->lookup_start_time).rel_value_us, 1708 GNUNET_TIME_absolute_get_duration (handle->lookup_start_time).rel_value_us,
1740 GNUNET_YES); 1709 GNUNET_YES);
1741 GNUNET_STATISTICS_update (stats_handle, 1710 GNUNET_STATISTICS_update (stats,
1742 "abe_key_lookups_count", 1711 "abe_key_lookups_count",
1743 1, 1712 1,
1744 GNUNET_YES); 1713 GNUNET_YES);
1745 scopes = GNUNET_strdup (buf); 1714 scopes = GNUNET_strdup (buf);
1746 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1715 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1747 "Scopes %s\n", scopes); 1716 "Scopes %s\n", scopes);
1748 handle->key = GNUNET_CRYPTO_cpabe_deserialize_key ((void*)(buf + strlen (scopes) + 1), 1717 handle->key = GNUNET_ABE_cpabe_deserialize_key ((void*)(buf + strlen (scopes) + 1),
1749 rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) 1718 rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)
1750 - strlen (scopes) - 1); 1719 - strlen (scopes) - 1);
1751 1720
1752 for (scope = strtok (scopes, ","); NULL != scope; scope = strtok (NULL, ",")) 1721 for (scope = strtok (scopes, ","); NULL != scope; scope = strtok (NULL, ","))
1753 { 1722 {
@@ -1781,14 +1750,6 @@ process_consume_abe_key (void *cls, uint32_t rd_count,
1781} 1750}
1782 1751
1783 1752
1784/**
1785 *
1786 * Handler for ticket issue message
1787 *
1788 * @param cls unused
1789 * @param client who sent the message
1790 * @param message the message
1791 */
1792static void 1753static void
1793handle_consume_ticket_message (void *cls, 1754handle_consume_ticket_message (void *cls,
1794 const struct ConsumeTicketMessage *cm) 1755 const struct ConsumeTicketMessage *cm)
@@ -1833,7 +1794,7 @@ cleanup_as_handle (struct AttributeStoreHandle *handle)
1833 if (NULL != handle->claim) 1794 if (NULL != handle->claim)
1834 GNUNET_free (handle->claim); 1795 GNUNET_free (handle->claim);
1835 if (NULL != handle->abe_key) 1796 if (NULL != handle->abe_key)
1836 GNUNET_CRYPTO_cpabe_delete_master_key (handle->abe_key); 1797 GNUNET_ABE_cpabe_delete_master_key (handle->abe_key);
1837 GNUNET_free (handle); 1798 GNUNET_free (handle);
1838} 1799}
1839 1800
@@ -1886,7 +1847,7 @@ attr_store_task (void *cls)
1886 buf = GNUNET_malloc (buf_size); 1847 buf = GNUNET_malloc (buf_size);
1887 1848
1888 GNUNET_IDENTITY_ATTRIBUTE_serialize (as_handle->claim, 1849 GNUNET_IDENTITY_ATTRIBUTE_serialize (as_handle->claim,
1889 buf); 1850 buf);
1890 1851
1891 GNUNET_asprintf (&policy, 1852 GNUNET_asprintf (&policy,
1892 "%s_%lu", 1853 "%s_%lu",
@@ -1897,11 +1858,22 @@ attr_store_task (void *cls)
1897 /** 1858 /**
1898 * Encrypt the attribute value and store in namestore 1859 * Encrypt the attribute value and store in namestore
1899 */ 1860 */
1900 enc_size = GNUNET_CRYPTO_cpabe_encrypt (buf, 1861 enc_size = GNUNET_ABE_cpabe_encrypt (buf,
1901 buf_size, 1862 buf_size,
1902 policy, //Policy 1863 policy, //Policy
1903 as_handle->abe_key, 1864 as_handle->abe_key,
1904 (void**)&enc_buf); 1865 (void**)&enc_buf);
1866 if (GNUNET_SYSERR == enc_size)
1867 {
1868 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1869 "Failed to encrypt with policy %s\n",
1870 policy);
1871 cleanup_as_handle (as_handle);
1872 GNUNET_free (buf);
1873 GNUNET_free (policy);
1874 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
1875 return;
1876 }
1905 GNUNET_free (buf); 1877 GNUNET_free (buf);
1906 GNUNET_free (policy); 1878 GNUNET_free (policy);
1907 rd[0].data_size = enc_size + sizeof (uint32_t); 1879 rd[0].data_size = enc_size + sizeof (uint32_t);
@@ -1931,7 +1903,7 @@ attr_store_task (void *cls)
1931 1903
1932static void 1904static void
1933store_after_abe_bootstrap (void *cls, 1905store_after_abe_bootstrap (void *cls,
1934 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 1906 struct GNUNET_ABE_AbeMasterKey *abe_key)
1935{ 1907{
1936 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1908 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1937 "Finished ABE bootstrap\n"); 1909 "Finished ABE bootstrap\n");
@@ -1940,13 +1912,6 @@ store_after_abe_bootstrap (void *cls,
1940 GNUNET_SCHEDULER_add_now (&attr_store_task, ash); 1912 GNUNET_SCHEDULER_add_now (&attr_store_task, ash);
1941} 1913}
1942 1914
1943/**
1944 * Checks a store message
1945 *
1946 * @param cls client sending the message
1947 * @param sam message of type `struct AttributeStoreMessage`
1948 * @return #GNUNET_OK if @a im is well-formed
1949 */
1950static int 1915static int
1951check_attribute_store_message(void *cls, 1916check_attribute_store_message(void *cls,
1952 const struct AttributeStoreMessage *sam) 1917 const struct AttributeStoreMessage *sam)
@@ -1963,14 +1928,6 @@ check_attribute_store_message(void *cls,
1963} 1928}
1964 1929
1965 1930
1966/**
1967 *
1968 * Handler for store message
1969 *
1970 * @param cls unused
1971 * @param client who sent the message
1972 * @param message the message
1973 */
1974static void 1931static void
1975handle_attribute_store_message (void *cls, 1932handle_attribute_store_message (void *cls,
1976 const struct AttributeStoreMessage *sam) 1933 const struct AttributeStoreMessage *sam)
@@ -1985,7 +1942,7 @@ handle_attribute_store_message (void *cls,
1985 1942
1986 as_handle = GNUNET_new (struct AttributeStoreHandle); 1943 as_handle = GNUNET_new (struct AttributeStoreHandle);
1987 as_handle->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&sam[1], 1944 as_handle->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&sam[1],
1988 data_len); 1945 data_len);
1989 1946
1990 as_handle->r_id = ntohl (sam->id); 1947 as_handle->r_id = ntohl (sam->id);
1991 as_handle->identity = sam->identity; 1948 as_handle->identity = sam->identity;
@@ -2001,7 +1958,7 @@ static void
2001cleanup_iter_handle (struct AttributeIterator *ai) 1958cleanup_iter_handle (struct AttributeIterator *ai)
2002{ 1959{
2003 if (NULL != ai->abe_key) 1960 if (NULL != ai->abe_key)
2004 GNUNET_CRYPTO_cpabe_delete_master_key (ai->abe_key); 1961 GNUNET_ABE_cpabe_delete_master_key (ai->abe_key);
2005 GNUNET_CONTAINER_DLL_remove (ai->client->op_head, 1962 GNUNET_CONTAINER_DLL_remove (ai->client->op_head,
2006 ai->client->op_tail, 1963 ai->client->op_tail,
2007 ai); 1964 ai);
@@ -2043,7 +2000,7 @@ attr_iter_cb (void *cls,
2043{ 2000{
2044 struct AttributeIterator *ai = cls; 2001 struct AttributeIterator *ai = cls;
2045 struct AttributeResultMessage *arm; 2002 struct AttributeResultMessage *arm;
2046 struct GNUNET_CRYPTO_AbeKey *key; 2003 struct GNUNET_ABE_AbeKey *key;
2047 struct GNUNET_MQ_Envelope *env; 2004 struct GNUNET_MQ_Envelope *env;
2048 ssize_t msg_extra_len; 2005 ssize_t msg_extra_len;
2049 char* attr_ser; 2006 char* attr_ser;
@@ -2067,15 +2024,19 @@ attr_iter_cb (void *cls,
2067 label, attr_ver); 2024 label, attr_ver);
2068 attrs[0] = policy; 2025 attrs[0] = policy;
2069 attrs[1] = 0; 2026 attrs[1] = 0;
2070 key = GNUNET_CRYPTO_cpabe_create_key (ai->abe_key, 2027 key = GNUNET_ABE_cpabe_create_key (ai->abe_key,
2071 attrs); 2028 attrs);
2072 msg_extra_len = GNUNET_CRYPTO_cpabe_decrypt (rd->data+sizeof (uint32_t), 2029 msg_extra_len = GNUNET_ABE_cpabe_decrypt (rd->data+sizeof (uint32_t),
2073 rd->data_size-sizeof (uint32_t), 2030 rd->data_size-sizeof (uint32_t),
2074 key, 2031 key,
2075 (void**)&attr_ser); 2032 (void**)&attr_ser);
2076 2033 if (GNUNET_SYSERR == msg_extra_len) {
2077 GNUNET_CRYPTO_cpabe_delete_key (key, 2034 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it);
2078 GNUNET_YES); 2035 return;
2036 }
2037
2038 GNUNET_ABE_cpabe_delete_key (key,
2039 GNUNET_YES);
2079 //GNUNET_free (policy); 2040 //GNUNET_free (policy);
2080 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2041 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2081 "Found attribute: %s\n", label); 2042 "Found attribute: %s\n", label);
@@ -2092,14 +2053,14 @@ attr_iter_cb (void *cls,
2092 msg_extra_len); 2053 msg_extra_len);
2093 GNUNET_MQ_send (ai->client->mq, env); 2054 GNUNET_MQ_send (ai->client->mq, env);
2094 GNUNET_free (attr_ser); 2055 GNUNET_free (attr_ser);
2095 GNUNET_CRYPTO_cpabe_delete_master_key (ai->abe_key); 2056 GNUNET_ABE_cpabe_delete_master_key (ai->abe_key);
2096 ai->abe_key = NULL; 2057 ai->abe_key = NULL;
2097} 2058}
2098 2059
2099 2060
2100void 2061void
2101iterate_after_abe_bootstrap (void *cls, 2062iterate_after_abe_bootstrap (void *cls,
2102 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 2063 struct GNUNET_ABE_AbeMasterKey *abe_key)
2103{ 2064{
2104 struct AttributeIterator *ai = cls; 2065 struct AttributeIterator *ai = cls;
2105 ai->abe_key = abe_key; 2066 ai->abe_key = abe_key;
@@ -2115,7 +2076,7 @@ iterate_after_abe_bootstrap (void *cls,
2115 2076
2116void 2077void
2117iterate_next_after_abe_bootstrap (void *cls, 2078iterate_next_after_abe_bootstrap (void *cls,
2118 struct GNUNET_CRYPTO_AbeMasterKey *abe_key) 2079 struct GNUNET_ABE_AbeMasterKey *abe_key)
2119{ 2080{
2120 struct AttributeIterator *ai = cls; 2081 struct AttributeIterator *ai = cls;
2121 ai->abe_key = abe_key; 2082 ai->abe_key = abe_key;
@@ -2124,12 +2085,6 @@ iterate_next_after_abe_bootstrap (void *cls,
2124 2085
2125 2086
2126 2087
2127/**
2128 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_START message
2129 *
2130 * @param cls the client sending the message
2131 * @param zis_msg message from the client
2132 */
2133static void 2088static void
2134handle_iteration_start (void *cls, 2089handle_iteration_start (void *cls,
2135 const struct AttributeIterationStartMessage *ais_msg) 2090 const struct AttributeIterationStartMessage *ais_msg)
@@ -2152,12 +2107,6 @@ handle_iteration_start (void *cls,
2152} 2107}
2153 2108
2154 2109
2155/**
2156 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_STOP message
2157 *
2158 * @param cls the client sending the message
2159 * @param ais_msg message from the client
2160 */
2161static void 2110static void
2162handle_iteration_stop (void *cls, 2111handle_iteration_stop (void *cls,
2163 const struct AttributeIterationStopMessage *ais_msg) 2112 const struct AttributeIterationStopMessage *ais_msg)
@@ -2187,12 +2136,6 @@ handle_iteration_stop (void *cls,
2187} 2136}
2188 2137
2189 2138
2190/**
2191 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT message
2192 *
2193 * @param cls the client sending the message
2194 * @param message message from the client
2195 */
2196static void 2139static void
2197handle_iteration_next (void *cls, 2140handle_iteration_next (void *cls,
2198 const struct AttributeIterationNextMessage *ais_msg) 2141 const struct AttributeIterationNextMessage *ais_msg)
@@ -2350,12 +2293,6 @@ run_ticket_iteration_round (struct TicketIteration *ti)
2350 cleanup_ticket_iter_handle (ti); 2293 cleanup_ticket_iter_handle (ti);
2351} 2294}
2352 2295
2353/**
2354 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START message
2355 *
2356 * @param cls the client sending the message
2357 * @param tis_msg message from the client
2358 */
2359static void 2296static void
2360handle_ticket_iteration_start (void *cls, 2297handle_ticket_iteration_start (void *cls,
2361 const struct TicketIterationStartMessage *tis_msg) 2298 const struct TicketIterationStartMessage *tis_msg)
@@ -2380,12 +2317,6 @@ handle_ticket_iteration_start (void *cls,
2380} 2317}
2381 2318
2382 2319
2383/**
2384 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP message
2385 *
2386 * @param cls the client sending the message
2387 * @param tis_msg message from the client
2388 */
2389static void 2320static void
2390handle_ticket_iteration_stop (void *cls, 2321handle_ticket_iteration_stop (void *cls,
2391 const struct TicketIterationStopMessage *tis_msg) 2322 const struct TicketIterationStopMessage *tis_msg)
@@ -2415,12 +2346,6 @@ handle_ticket_iteration_stop (void *cls,
2415} 2346}
2416 2347
2417 2348
2418/**
2419 * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT message
2420 *
2421 * @param cls the client sending the message
2422 * @param message message from the client
2423 */
2424static void 2349static void
2425handle_ticket_iteration_next (void *cls, 2350handle_ticket_iteration_next (void *cls,
2426 const struct TicketIterationNextMessage *tis_msg) 2351 const struct TicketIterationNextMessage *tis_msg)
@@ -2452,9 +2377,8 @@ handle_ticket_iteration_next (void *cls,
2452 * Main function that will be run 2377 * Main function that will be run
2453 * 2378 *
2454 * @param cls closure 2379 * @param cls closure
2455 * @param args remaining command-line arguments 2380 * @param c the configuration used
2456 * @param cfgfile name of the configuration file used (for saving, can be NULL) 2381 * @param server the service handle
2457 * @param c configuration
2458 */ 2382 */
2459static void 2383static void
2460run (void *cls, 2384run (void *cls,
@@ -2486,8 +2410,6 @@ run (void *cls,
2486 identity_handle = GNUNET_IDENTITY_connect (cfg, 2410 identity_handle = GNUNET_IDENTITY_connect (cfg,
2487 NULL, 2411 NULL,
2488 NULL); 2412 NULL);
2489 stats_handle = GNUNET_STATISTICS_create ("identity-provider",
2490 cfg);
2491 /* Loading DB plugin */ 2413 /* Loading DB plugin */
2492 if (GNUNET_OK != 2414 if (GNUNET_OK !=
2493 GNUNET_CONFIGURATION_get_value_string (cfg, 2415 GNUNET_CONFIGURATION_get_value_string (cfg,
diff --git a/src/identity-provider/identity_provider.h b/src/identity-provider/identity_provider.h
index be9fdc6f5..b1fe6e1fd 100644
--- a/src/identity-provider/identity_provider.h
+++ b/src/identity-provider/identity_provider.h
@@ -248,7 +248,7 @@ struct TicketIterationStopMessage
248struct IssueTicketMessage 248struct IssueTicketMessage
249{ 249{
250 /** 250 /**
251 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE 251 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET
252 */ 252 */
253 struct GNUNET_MessageHeader header; 253 struct GNUNET_MessageHeader header;
254 254
@@ -281,7 +281,7 @@ struct IssueTicketMessage
281struct RevokeTicketMessage 281struct RevokeTicketMessage
282{ 282{
283 /** 283 /**
284 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE 284 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET
285 */ 285 */
286 struct GNUNET_MessageHeader header; 286 struct GNUNET_MessageHeader header;
287 287
@@ -309,7 +309,7 @@ struct RevokeTicketMessage
309struct RevokeTicketResultMessage 309struct RevokeTicketResultMessage
310{ 310{
311 /** 311 /**
312 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE 312 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT
313 */ 313 */
314 struct GNUNET_MessageHeader header; 314 struct GNUNET_MessageHeader header;
315 315
@@ -348,7 +348,7 @@ struct TicketResultMessage
348struct ConsumeTicketMessage 348struct ConsumeTicketMessage
349{ 349{
350 /** 350 /**
351 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE 351 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET
352 */ 352 */
353 struct GNUNET_MessageHeader header; 353 struct GNUNET_MessageHeader header;
354 354
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c
index 6fc8d228a..38c11841c 100644
--- a/src/identity-provider/identity_provider_api.c
+++ b/src/identity-provider/identity_provider_api.c
@@ -317,14 +317,13 @@ struct GNUNET_IDENTITY_PROVIDER_Handle
317 317
318}; 318};
319 319
320
321/** 320/**
322 * Try again to connect to the service. 321 * Try again to connect to the service.
323 * 322 *
324 * @param cls handle to the service. 323 * @param h handle to the identity provider service.
325 */ 324 */
326static void 325static void
327reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle); 326reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h);
328 327
329/** 328/**
330 * Reconnect 329 * Reconnect
@@ -344,7 +343,7 @@ reconnect_task (void *cls)
344/** 343/**
345 * Disconnect from service and then reconnect. 344 * Disconnect from service and then reconnect.
346 * 345 *
347 * @param handle our handle 346 * @param handle our service
348 */ 347 */
349static void 348static void
350force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle) 349force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle)
@@ -515,13 +514,16 @@ handle_consume_ticket_result (void *cls,
515 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs); 514 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs);
516 } 515 }
517 } 516 }
518 op->ar_cb (op->cls, 517 if (NULL != op)
519 NULL, 518 {
520 NULL); 519 op->ar_cb (op->cls,
521 GNUNET_CONTAINER_DLL_remove (h->op_head, 520 NULL,
522 h->op_tail, 521 NULL);
523 op); 522 GNUNET_CONTAINER_DLL_remove (h->op_head,
524 GNUNET_free (op); 523 h->op_tail,
524 op);
525 GNUNET_free (op);
526 }
525 return; 527 return;
526 } 528 }
527 GNUNET_assert (0); 529 GNUNET_assert (0);
@@ -775,7 +777,7 @@ handle_revoke_ticket_result (void *cls,
775/** 777/**
776 * Try again to connect to the service. 778 * Try again to connect to the service.
777 * 779 *
778 * @param cls handle to the identity provider service. 780 * @param h handle to the identity provider service.
779 */ 781 */
780static void 782static void
781reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) 783reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
@@ -895,8 +897,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
895 * 897 *
896 * @param h handle to the identity provider 898 * @param h handle to the identity provider
897 * @param pkey private key of the identity 899 * @param pkey private key of the identity
898 * @param name the attribute name 900 * @param attr the attribute value
899 * @param value the attribute value
900 * @param cont continuation to call when done 901 * @param cont continuation to call when done
901 * @param cont_cls closure for @a cont 902 * @param cont_cls closure for @a cont
902 * @return handle to abort the request 903 * @return handle to abort the request
@@ -928,7 +929,7 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
928 sam->id = htonl (op->r_id); 929 sam->id = htonl (op->r_id);
929 930
930 GNUNET_IDENTITY_ATTRIBUTE_serialize (attr, 931 GNUNET_IDENTITY_ATTRIBUTE_serialize (attr,
931 (char*)&sam[1]); 932 (char*)&sam[1]);
932 933
933 sam->attr_len = htons (attr_len); 934 sam->attr_len = htons (attr_len);
934 if (NULL != h->mq) 935 if (NULL != h->mq)
@@ -1061,7 +1062,7 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At
1061 * @param h the identity provider to use 1062 * @param h the identity provider to use
1062 * @param iss the issuing identity 1063 * @param iss the issuing identity
1063 * @param rp the subject of the ticket (the relying party) 1064 * @param rp the subject of the ticket (the relying party)
1064 * @param attr the attributes that the relying party is given access to 1065 * @param attrs the attributes that the relying party is given access to
1065 * @param cb the callback 1066 * @param cb the callback
1066 * @param cb_cls the callback closure 1067 * @param cb_cls the callback closure
1067 * @return handle to abort the operation 1068 * @return handle to abort the operation
@@ -1095,7 +1096,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1095 tim->id = htonl (op->r_id); 1096 tim->id = htonl (op->r_id);
1096 1097
1097 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs, 1098 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs,
1098 (char*)&tim[1]); 1099 (char*)&tim[1]);
1099 1100
1100 tim->attr_len = htons (attr_len); 1101 tim->attr_len = htons (attr_len);
1101 if (NULL != h->mq) 1102 if (NULL != h->mq)
@@ -1108,7 +1109,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1108 * Consumes an issued ticket. The ticket is persisted 1109 * Consumes an issued ticket. The ticket is persisted
1109 * and used to retrieve identity information from the issuer 1110 * and used to retrieve identity information from the issuer
1110 * 1111 *
1111 * @param id the identity provider to use 1112 * @param h the identity provider to use
1112 * @param identity the identity that is the subject of the issued ticket (the relying party) 1113 * @param identity the identity that is the subject of the issued ticket (the relying party)
1113 * @param ticket the issued ticket to consume 1114 * @param ticket the issued ticket to consume
1114 * @param cb the callback to call 1115 * @param cb the callback to call
@@ -1218,7 +1219,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
1218 * Lists all tickets that have been issued to remote 1219 * Lists all tickets that have been issued to remote
1219 * identites (relying parties) 1220 * identites (relying parties)
1220 * 1221 *
1221 * @param id the identity provider to use 1222 * @param h the identity provider to use
1222 * @param identity the issuing identity 1223 * @param identity the issuing identity
1223 * @param error_cb function to call on error (i.e. disconnect), 1224 * @param error_cb function to call on error (i.e. disconnect),
1224 * the handle is afterwards invalid 1225 * the handle is afterwards invalid
@@ -1324,7 +1325,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_
1324 * Revoked an issued ticket. The relying party will be unable to retrieve 1325 * Revoked an issued ticket. The relying party will be unable to retrieve
1325 * updated attributes. 1326 * updated attributes.
1326 * 1327 *
1327 * @param id the identity provider to use 1328 * @param h the identity provider to use
1328 * @param identity the issuing identity 1329 * @param identity the issuing identity
1329 * @param ticket the ticket to revoke 1330 * @param ticket the ticket to revoke
1330 * @param cb the callback 1331 * @param cb the callback
diff --git a/src/identity-provider/plugin_gnsrecord_identity_provider.c b/src/identity-provider/plugin_gnsrecord_identity_provider.c
index ad5a95dc7..6ed0b0852 100644
--- a/src/identity-provider/plugin_gnsrecord_identity_provider.c
+++ b/src/identity-provider/plugin_gnsrecord_identity_provider.c
@@ -19,9 +19,9 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file identity/plugin_gnsrecord_identity.c 22 * @file identity-provider/plugin_gnsrecord_identity_provider.c
23 * @brief gnsrecord plugin to provide the API for identity records 23 * @brief gnsrecord plugin to provide the API for identity records
24 * @author Christian Grothoff 24 * @author Martin Schanzenbach
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
diff --git a/src/identity-provider/plugin_identity_provider_sqlite.c b/src/identity-provider/plugin_identity_provider_sqlite.c
index 594e4788d..0071528b9 100644
--- a/src/identity-provider/plugin_identity_provider_sqlite.c
+++ b/src/identity-provider/plugin_identity_provider_sqlite.c
@@ -368,6 +368,7 @@ database_shutdown (struct Plugin *plugin)
368 * 368 *
369 * @param cls closure (internal context for the plugin) 369 * @param cls closure (internal context for the plugin)
370 * @param ticket the ticket to persist 370 * @param ticket the ticket to persist
371 * @param attrs the attributes associated with the ticket
371 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 372 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
372 */ 373 */
373static int 374static int
@@ -581,8 +582,7 @@ get_ticket_and_call_iterator (struct Plugin *plugin,
581 * Lookup tickets in the datastore. 582 * Lookup tickets in the datastore.
582 * 583 *
583 * @param cls closure (internal context for the plugin) 584 * @param cls closure (internal context for the plugin)
584 * @param zone private key of the zone 585 * @param ticket the ticket to retrieve attributes for
585 * @param label name of the record in the zone
586 * @param iter function to call with the result 586 * @param iter function to call with the result
587 * @param iter_cls closure for @a iter 587 * @param iter_cls closure for @a iter
588 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 588 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c
index 68644777f..1aa1f818d 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/identity-provider/plugin_rest_identity_provider.c
@@ -1540,17 +1540,6 @@ list_ego (void *cls,
1540 1540
1541} 1541}
1542 1542
1543/**
1544 * Function processing the REST call
1545 *
1546 * @param method HTTP method
1547 * @param url URL of the HTTP request
1548 * @param data body of the HTTP request (optional)
1549 * @param data_size length of the body
1550 * @param proc callback function for the result
1551 * @param proc_cls closure for callback function
1552 * @return GNUNET_OK if request accepted
1553 */
1554static void 1543static void
1555rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle, 1544rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle,
1556 GNUNET_REST_ResultProcessor proc, 1545 GNUNET_REST_ResultProcessor proc,