diff options
Diffstat (limited to 'src/identity-provider/gnunet-service-identity-provider.c')
-rw-r--r-- | src/identity-provider/gnunet-service-identity-provider.c | 147 |
1 files changed, 26 insertions, 121 deletions
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c index 351308c3a..4e1de36cd 100644 --- a/src/identity-provider/gnunet-service-identity-provider.c +++ b/src/identity-provider/gnunet-service-identity-provider.c | |||
@@ -637,10 +637,8 @@ cleanup() | |||
637 | GNUNET_NAMESTORE_disconnect (ns_handle); | 637 | GNUNET_NAMESTORE_disconnect (ns_handle); |
638 | if (NULL != stats_handle) | 638 | if (NULL != stats_handle) |
639 | GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); | 639 | GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); |
640 | if (NULL != token) | 640 | GNUNET_free_non_null (token); |
641 | GNUNET_free (token); | 641 | GNUNET_free_non_null (label); |
642 | if (NULL != label) | ||
643 | GNUNET_free (label); | ||
644 | 642 | ||
645 | } | 643 | } |
646 | 644 | ||
@@ -648,7 +646,6 @@ cleanup() | |||
648 | * Shutdown task | 646 | * Shutdown task |
649 | * | 647 | * |
650 | * @param cls NULL | 648 | * @param cls NULL |
651 | * @param tc task context | ||
652 | */ | 649 | */ |
653 | static void | 650 | static void |
654 | do_shutdown (void *cls) | 651 | do_shutdown (void *cls) |
@@ -732,9 +729,8 @@ bootstrap_abe_result (void *cls, | |||
732 | { | 729 | { |
733 | struct AbeBootstrapHandle *abh = cls; | 730 | struct AbeBootstrapHandle *abh = cls; |
734 | struct GNUNET_ABE_AbeMasterKey *abe_key; | 731 | struct GNUNET_ABE_AbeMasterKey *abe_key; |
735 | int i; | ||
736 | 732 | ||
737 | for (i=0;i<rd_count;i++) { | 733 | for (uint32_t i=0;i<rd_count;i++) { |
738 | if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type) | 734 | if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type) |
739 | continue; | 735 | continue; |
740 | abe_key = GNUNET_ABE_cpabe_deserialize_master_key (rd[i].data, | 736 | abe_key = GNUNET_ABE_cpabe_deserialize_master_key (rd[i].data, |
@@ -964,7 +960,7 @@ issue_ticket_after_abe_bootstrap (void *cls, | |||
964 | char *label; | 960 | char *label; |
965 | char *policy; | 961 | char *policy; |
966 | int attrs_len; | 962 | int attrs_len; |
967 | int i; | 963 | uint32_t i; |
968 | size_t code_record_len; | 964 | size_t code_record_len; |
969 | 965 | ||
970 | //Create new ABE key for RP | 966 | //Create new ABE key for RP |
@@ -1021,13 +1017,6 @@ issue_ticket_after_abe_bootstrap (void *cls, | |||
1021 | } | 1017 | } |
1022 | 1018 | ||
1023 | 1019 | ||
1024 | /** | ||
1025 | * Checks a ticket issue message | ||
1026 | * | ||
1027 | * @param cls client sending the message | ||
1028 | * @param im message of type `struct TicketIssueMessage` | ||
1029 | * @return #GNUNET_OK if @a im is well-formed | ||
1030 | */ | ||
1031 | static int | 1020 | static int |
1032 | check_issue_ticket_message(void *cls, | 1021 | check_issue_ticket_message(void *cls, |
1033 | const struct IssueTicketMessage *im) | 1022 | const struct IssueTicketMessage *im) |
@@ -1044,14 +1033,6 @@ check_issue_ticket_message(void *cls, | |||
1044 | } | 1033 | } |
1045 | 1034 | ||
1046 | 1035 | ||
1047 | /** | ||
1048 | * | ||
1049 | * Handler for ticket issue message | ||
1050 | * | ||
1051 | * @param cls unused | ||
1052 | * @param client who sent the message | ||
1053 | * @param message the message | ||
1054 | */ | ||
1055 | static void | 1036 | static void |
1056 | handle_issue_ticket_message (void *cls, | 1037 | handle_issue_ticket_message (void *cls, |
1057 | const struct IssueTicketMessage *im) | 1038 | const struct IssueTicketMessage *im) |
@@ -1083,26 +1064,31 @@ handle_issue_ticket_message (void *cls, | |||
1083 | 1064 | ||
1084 | /** | 1065 | /** |
1085 | * Cleanup revoke handle | 1066 | * Cleanup revoke handle |
1067 | * | ||
1068 | * @param rh the ticket revocation handle | ||
1086 | */ | 1069 | */ |
1087 | static void | 1070 | static void |
1088 | cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle) | 1071 | cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh) |
1089 | { | 1072 | { |
1090 | if (NULL != handle->attrs) | 1073 | if (NULL != rh->attrs) |
1091 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); | 1074 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->attrs); |
1092 | if (NULL != handle->rvk_attrs) | 1075 | if (NULL != rh->rvk_attrs) |
1093 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->rvk_attrs); | 1076 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->rvk_attrs); |
1094 | if (NULL != handle->abe_key) | 1077 | if (NULL != rh->abe_key) |
1095 | GNUNET_ABE_cpabe_delete_master_key (handle->abe_key); | 1078 | GNUNET_ABE_cpabe_delete_master_key (rh->abe_key); |
1096 | if (NULL != handle->ns_qe) | 1079 | if (NULL != rh->ns_qe) |
1097 | GNUNET_NAMESTORE_cancel (handle->ns_qe); | 1080 | GNUNET_NAMESTORE_cancel (rh->ns_qe); |
1098 | if (NULL != handle->ns_it) | 1081 | if (NULL != rh->ns_it) |
1099 | GNUNET_NAMESTORE_zone_iteration_stop (handle->ns_it); | 1082 | GNUNET_NAMESTORE_zone_iteration_stop (rh->ns_it); |
1100 | GNUNET_free (handle); | 1083 | GNUNET_free (rh); |
1101 | } | 1084 | } |
1102 | 1085 | ||
1103 | 1086 | ||
1104 | /** | 1087 | /** |
1105 | * Send revocation result | 1088 | * Send revocation result |
1089 | * | ||
1090 | * @param rh ticket revocation handle | ||
1091 | * @param success GNUNET_OK if successful result | ||
1106 | */ | 1092 | */ |
1107 | static void | 1093 | static void |
1108 | send_revocation_finished (struct TicketRevocationHandle *rh, | 1094 | send_revocation_finished (struct TicketRevocationHandle *rh, |
@@ -1190,7 +1176,7 @@ ticket_reissue_proc (void *cls, | |||
1190 | char *label; | 1176 | char *label; |
1191 | char *policy; | 1177 | char *policy; |
1192 | int attrs_len; | 1178 | int attrs_len; |
1193 | int i; | 1179 | uint32_t i; |
1194 | int reissue_ticket; | 1180 | int reissue_ticket; |
1195 | size_t code_record_len; | 1181 | size_t code_record_len; |
1196 | 1182 | ||
@@ -1476,13 +1462,6 @@ get_ticket_after_abe_bootstrap (void *cls, | |||
1476 | rh); | 1462 | rh); |
1477 | } | 1463 | } |
1478 | 1464 | ||
1479 | /** | ||
1480 | * Checks a ticket revocation message | ||
1481 | * | ||
1482 | * @param cls client sending the message | ||
1483 | * @param im message of type `struct RevokeTicketMessage` | ||
1484 | * @return #GNUNET_OK if @a im is well-formed | ||
1485 | */ | ||
1486 | static int | 1465 | static int |
1487 | check_revoke_ticket_message(void *cls, | 1466 | check_revoke_ticket_message(void *cls, |
1488 | const struct RevokeTicketMessage *im) | 1467 | const struct RevokeTicketMessage *im) |
@@ -1497,14 +1476,7 @@ check_revoke_ticket_message(void *cls, | |||
1497 | } | 1476 | } |
1498 | return GNUNET_OK; | 1477 | return GNUNET_OK; |
1499 | } | 1478 | } |
1500 | /** | 1479 | |
1501 | * | ||
1502 | * Handler for ticket revocation message | ||
1503 | * | ||
1504 | * @param cls unused | ||
1505 | * @param client who sent the message | ||
1506 | * @param message the message | ||
1507 | */ | ||
1508 | static void | 1480 | static void |
1509 | handle_revoke_ticket_message (void *cls, | 1481 | handle_revoke_ticket_message (void *cls, |
1510 | const struct RevokeTicketMessage *rm) | 1482 | const struct RevokeTicketMessage *rm) |
@@ -1544,13 +1516,6 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle) | |||
1544 | 1516 | ||
1545 | 1517 | ||
1546 | 1518 | ||
1547 | /** | ||
1548 | * Checks a ticket consume message | ||
1549 | * | ||
1550 | * @param cls client sending the message | ||
1551 | * @param im message of type `struct ConsumeTicketMessage` | ||
1552 | * @return #GNUNET_OK if @a im is well-formed | ||
1553 | */ | ||
1554 | static int | 1519 | static int |
1555 | check_consume_ticket_message(void *cls, | 1520 | check_consume_ticket_message(void *cls, |
1556 | const struct ConsumeTicketMessage *cm) | 1521 | const struct ConsumeTicketMessage *cm) |
@@ -1782,14 +1747,6 @@ process_consume_abe_key (void *cls, uint32_t rd_count, | |||
1782 | } | 1747 | } |
1783 | 1748 | ||
1784 | 1749 | ||
1785 | /** | ||
1786 | * | ||
1787 | * Handler for ticket issue message | ||
1788 | * | ||
1789 | * @param cls unused | ||
1790 | * @param client who sent the message | ||
1791 | * @param message the message | ||
1792 | */ | ||
1793 | static void | 1750 | static void |
1794 | handle_consume_ticket_message (void *cls, | 1751 | handle_consume_ticket_message (void *cls, |
1795 | const struct ConsumeTicketMessage *cm) | 1752 | const struct ConsumeTicketMessage *cm) |
@@ -1941,13 +1898,6 @@ store_after_abe_bootstrap (void *cls, | |||
1941 | GNUNET_SCHEDULER_add_now (&attr_store_task, ash); | 1898 | GNUNET_SCHEDULER_add_now (&attr_store_task, ash); |
1942 | } | 1899 | } |
1943 | 1900 | ||
1944 | /** | ||
1945 | * Checks a store message | ||
1946 | * | ||
1947 | * @param cls client sending the message | ||
1948 | * @param sam message of type `struct AttributeStoreMessage` | ||
1949 | * @return #GNUNET_OK if @a im is well-formed | ||
1950 | */ | ||
1951 | static int | 1901 | static int |
1952 | check_attribute_store_message(void *cls, | 1902 | check_attribute_store_message(void *cls, |
1953 | const struct AttributeStoreMessage *sam) | 1903 | const struct AttributeStoreMessage *sam) |
@@ -1964,14 +1914,6 @@ check_attribute_store_message(void *cls, | |||
1964 | } | 1914 | } |
1965 | 1915 | ||
1966 | 1916 | ||
1967 | /** | ||
1968 | * | ||
1969 | * Handler for store message | ||
1970 | * | ||
1971 | * @param cls unused | ||
1972 | * @param client who sent the message | ||
1973 | * @param message the message | ||
1974 | */ | ||
1975 | static void | 1917 | static void |
1976 | handle_attribute_store_message (void *cls, | 1918 | handle_attribute_store_message (void *cls, |
1977 | const struct AttributeStoreMessage *sam) | 1919 | const struct AttributeStoreMessage *sam) |
@@ -2125,12 +2067,6 @@ iterate_next_after_abe_bootstrap (void *cls, | |||
2125 | 2067 | ||
2126 | 2068 | ||
2127 | 2069 | ||
2128 | /** | ||
2129 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_START message | ||
2130 | * | ||
2131 | * @param cls the client sending the message | ||
2132 | * @param zis_msg message from the client | ||
2133 | */ | ||
2134 | static void | 2070 | static void |
2135 | handle_iteration_start (void *cls, | 2071 | handle_iteration_start (void *cls, |
2136 | const struct AttributeIterationStartMessage *ais_msg) | 2072 | const struct AttributeIterationStartMessage *ais_msg) |
@@ -2153,12 +2089,6 @@ handle_iteration_start (void *cls, | |||
2153 | } | 2089 | } |
2154 | 2090 | ||
2155 | 2091 | ||
2156 | /** | ||
2157 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_STOP message | ||
2158 | * | ||
2159 | * @param cls the client sending the message | ||
2160 | * @param ais_msg message from the client | ||
2161 | */ | ||
2162 | static void | 2092 | static void |
2163 | handle_iteration_stop (void *cls, | 2093 | handle_iteration_stop (void *cls, |
2164 | const struct AttributeIterationStopMessage *ais_msg) | 2094 | const struct AttributeIterationStopMessage *ais_msg) |
@@ -2188,12 +2118,6 @@ handle_iteration_stop (void *cls, | |||
2188 | } | 2118 | } |
2189 | 2119 | ||
2190 | 2120 | ||
2191 | /** | ||
2192 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT message | ||
2193 | * | ||
2194 | * @param cls the client sending the message | ||
2195 | * @param message message from the client | ||
2196 | */ | ||
2197 | static void | 2121 | static void |
2198 | handle_iteration_next (void *cls, | 2122 | handle_iteration_next (void *cls, |
2199 | const struct AttributeIterationNextMessage *ais_msg) | 2123 | const struct AttributeIterationNextMessage *ais_msg) |
@@ -2351,12 +2275,6 @@ run_ticket_iteration_round (struct TicketIteration *ti) | |||
2351 | cleanup_ticket_iter_handle (ti); | 2275 | cleanup_ticket_iter_handle (ti); |
2352 | } | 2276 | } |
2353 | 2277 | ||
2354 | /** | ||
2355 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START message | ||
2356 | * | ||
2357 | * @param cls the client sending the message | ||
2358 | * @param tis_msg message from the client | ||
2359 | */ | ||
2360 | static void | 2278 | static void |
2361 | handle_ticket_iteration_start (void *cls, | 2279 | handle_ticket_iteration_start (void *cls, |
2362 | const struct TicketIterationStartMessage *tis_msg) | 2280 | const struct TicketIterationStartMessage *tis_msg) |
@@ -2381,12 +2299,6 @@ handle_ticket_iteration_start (void *cls, | |||
2381 | } | 2299 | } |
2382 | 2300 | ||
2383 | 2301 | ||
2384 | /** | ||
2385 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP message | ||
2386 | * | ||
2387 | * @param cls the client sending the message | ||
2388 | * @param tis_msg message from the client | ||
2389 | */ | ||
2390 | static void | 2302 | static void |
2391 | handle_ticket_iteration_stop (void *cls, | 2303 | handle_ticket_iteration_stop (void *cls, |
2392 | const struct TicketIterationStopMessage *tis_msg) | 2304 | const struct TicketIterationStopMessage *tis_msg) |
@@ -2416,12 +2328,6 @@ handle_ticket_iteration_stop (void *cls, | |||
2416 | } | 2328 | } |
2417 | 2329 | ||
2418 | 2330 | ||
2419 | /** | ||
2420 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT message | ||
2421 | * | ||
2422 | * @param cls the client sending the message | ||
2423 | * @param message message from the client | ||
2424 | */ | ||
2425 | static void | 2331 | static void |
2426 | handle_ticket_iteration_next (void *cls, | 2332 | handle_ticket_iteration_next (void *cls, |
2427 | const struct TicketIterationNextMessage *tis_msg) | 2333 | const struct TicketIterationNextMessage *tis_msg) |
@@ -2453,9 +2359,8 @@ handle_ticket_iteration_next (void *cls, | |||
2453 | * Main function that will be run | 2359 | * Main function that will be run |
2454 | * | 2360 | * |
2455 | * @param cls closure | 2361 | * @param cls closure |
2456 | * @param args remaining command-line arguments | 2362 | * @param c the configuration used |
2457 | * @param cfgfile name of the configuration file used (for saving, can be NULL) | 2363 | * @param server the service handle |
2458 | * @param c configuration | ||
2459 | */ | 2364 | */ |
2460 | static void | 2365 | static void |
2461 | run (void *cls, | 2366 | run (void *cls, |