GNUnet  0.11.x
gnunet-service-reclaim_tickets.c
Go to the documentation of this file.
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 it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your 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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #include <inttypes.h>
29 
30 
35 #define DEFAULT_TICKET_REFRESH_INTERVAL GNUNET_TIME_UNIT_HOURS
36 
41 struct ParallelLookup;
42 
43 
48 {
53 
58 
63 
68 };
69 
70 
75 {
79  struct GNUNET_RECLAIM_Ticket ticket;
80 
85 
90 
94  struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub;
95 
100 
105 
110 
115 
119  struct GNUNET_TIME_Absolute lookup_start_time;
120 
125 
129  void *cb_cls;
130 };
131 
132 
137 {
138  /* DLL */
140 
141  /* DLL */
143 
144  /* The GNS request */
146 
147  /* The handle the return to */
149 
153  struct GNUNET_TIME_Absolute lookup_start_time;
154 
155  /* The label to look up */
156  char *label;
157 };
158 
159 
164 {
169 
174 
178  struct GNUNET_RECLAIM_Ticket ticket;
179 
184 
189 
194 
198  void *cb_cls;
199 };
200 
201 
206 {
211 
216 
220  void *cb_cls;
221 };
222 
223 
225 {
230 
235 
239  uint64_t old_id;
240 
244  uint64_t new_id;
245 };
246 
247 
252 {
257 
262 
266  void *cb_cls;
267 
271  struct GNUNET_RECLAIM_Ticket ticket;
272 
277 
282 
287 
292 
297 
301  unsigned int ticket_attrs;
302 
307 
312 };
313 
314 
319 
320 
321 /* Namestore handle */
323 
324 
325 /* GNS handle */
326 static struct GNUNET_GNS_Handle *gns;
327 
328 
329 /* Handle to the statistics service */
331 
332 
338 static void
340 {
341  struct RevokedAttributeEntry *ae;
342  struct TicketRecordsEntry *le;
343 
344  if (NULL != rh->ns_qe)
346  if (NULL != rh->ns_it)
348  while (NULL != (ae = rh->attrs_head))
349  {
351  GNUNET_free (ae);
352  }
353  while (NULL != (le = rh->tickets_to_update_head))
354  {
357  le);
358  if (NULL != le->data)
359  GNUNET_free (le->data);
360  if (NULL != le->label)
361  GNUNET_free (le->label);
362  GNUNET_free (le);
363  }
364  GNUNET_free (rh);
365 }
366 
367 
374 static void
375 process_tickets (void *cls);
376 
377 
386 static void
387 ticket_processed (void *cls, int32_t success, const char *emsg)
388 {
389  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
390 
391  rvk->ns_qe = NULL;
393 }
394 
395 
401 static void
402 process_tickets (void *cls)
403 {
404  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
405  struct TicketRecordsEntry *le;
406  struct RevokedAttributeEntry *ae;
407 
408  if (NULL == rvk->tickets_to_update_head)
409  {
411  "Finished updatding tickets, success\n");
412  rvk->cb (rvk->cb_cls, GNUNET_OK);
413  cleanup_rvk (rvk);
414  return;
415  }
416  le = rvk->tickets_to_update_head;
419  le);
420  struct GNUNET_GNSRECORD_Data rd[le->rd_count];
422  le->data,
423  le->rd_count,
424  rd))
425  {
427  "Unable to deserialize ticket record(s)\n");
428  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
429  cleanup_rvk (rvk);
430  return;
431  }
432  for (int i = 0; i < le->rd_count; i++)
433  {
435  continue;
436  for (ae = rvk->attrs_head; NULL != ae; ae = ae->next)
437  {
438  if (0 != memcmp (rd[i].data, &ae->old_id, sizeof(uint64_t)))
439  continue;
440  rd[i].data = &ae->new_id;
441  }
442  }
444  &rvk->identity,
445  le->label,
446  le->rd_count,
447  rd,
449  rvk);
450  GNUNET_free (le->label);
451  GNUNET_free (le->data);
452  GNUNET_free (le);
453 }
454 
455 
461 static void
463 {
464  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
465 
466  rvk->ns_it = NULL;
468 }
469 
470 
481 static void
482 rvk_ticket_update (void *cls,
483  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
484  const char *label,
485  unsigned int rd_count,
486  const struct GNUNET_GNSRECORD_Data *rd)
487 {
488  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
489  struct TicketRecordsEntry *le;
490  struct RevokedAttributeEntry *ae;
491  int has_changed = GNUNET_NO;
492 
494  for (int i = 0; i < rd_count; i++)
495  {
496  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
497  continue;
498  for (ae = rvk->attrs_head; NULL != ae; ae = ae->next)
499  {
500  if (0 != memcmp (rd[i].data, &ae->old_id, sizeof(uint64_t)))
501  continue;
502  has_changed = GNUNET_YES;
503  break;
504  }
505  if (GNUNET_YES == has_changed)
506  break;
507  }
508  if (GNUNET_YES == has_changed)
509  {
510  le = GNUNET_new (struct TicketRecordsEntry);
511  le->data_size = GNUNET_GNSRECORD_records_get_size (rd_count, rd);
512  le->data = GNUNET_malloc (le->data_size);
513  le->rd_count = rd_count;
514  le->label = GNUNET_strdup (label);
515  GNUNET_GNSRECORD_records_serialize (rd_count, rd, le->data_size, le->data);
518  le);
519  }
521 }
522 
523 
529 static void
530 rvk_ns_iter_err (void *cls)
531 {
532  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
533 
534  rvk->ns_it = NULL;
536  "Namestore error on revocation (id=%" PRIu64 "\n",
537  rvk->move_attr->old_id);
538  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
539  cleanup_rvk (rvk);
540 }
541 
542 
548 static void
549 rvk_ns_err (void *cls)
550 {
551  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
552 
553  rvk->ns_qe = NULL;
555  "Namestore error on revocation (id=%" PRIu64 "\n",
556  rvk->move_attr->old_id);
557  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
558  cleanup_rvk (rvk);
559 }
560 
561 
571 static void
573 
574 
580 static void
581 move_attrs_cont (void *cls)
582 {
583  move_attrs ((struct RECLAIM_TICKETS_RevokeHandle *) cls);
584 }
585 
586 
595 static void
596 del_attr_finished (void *cls, int32_t success, const char *emsg)
597 {
598  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
599 
600  rvk->ns_qe = NULL;
601  if (GNUNET_SYSERR == success)
602  {
604  "Error removing attribute: %s\n",
605  emsg);
606  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
607  cleanup_rvk (rvk);
608  return;
609  }
610  rvk->move_attr = rvk->move_attr->next;
612 }
613 
614 
624 static void
625 move_attr_finished (void *cls, int32_t success, const char *emsg)
626 {
627  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
628  char *label;
629 
630  rvk->ns_qe = NULL;
631  if (GNUNET_SYSERR == success)
632  {
633  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error moving attribute: %s\n", emsg);
634  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
635  cleanup_rvk (rvk);
636  return;
637  }
639  sizeof(uint64_t));
640  GNUNET_assert (NULL != label);
641  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing attribute %s\n", label);
643  &rvk->identity,
644  label,
645  0,
646  NULL,
648  rvk);
649  GNUNET_free (label);
650 }
651 
652 
662 static void
663 rvk_move_attr_cb (void *cls,
664  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
665  const char *label,
666  unsigned int rd_count,
667  const struct GNUNET_GNSRECORD_Data *rd)
668 {
669  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
671  struct GNUNET_GNSRECORD_Data new_rd;
672  struct RevokedAttributeEntry *le;
673  char *new_label;
674  char *attr_data;
675 
676  rvk->ns_qe = NULL;
677  if (0 == rd_count)
678  {
680  "The attribute %s no longer exists!\n",
681  label);
682  le = rvk->move_attr;
683  rvk->move_attr = le->next;
685  GNUNET_free (le);
687  return;
688  }
690  rvk->move_attr->new_id =
692  new_rd = *rd;
695  "Attribute to update: Name=%s, ID=%" PRIu64 "\n",
696  claim->name,
697  claim->id);
698  claim->id = rvk->move_attr->new_id;
700  attr_data = GNUNET_malloc (rd->data_size);
701  new_rd.data_size = GNUNET_RECLAIM_ATTRIBUTE_serialize (claim, attr_data);
702  new_rd.data = attr_data;
704  sizeof(uint64_t));
705  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute %s\n", new_label);
707  &rvk->identity,
708  new_label,
709  1,
710  &new_rd,
712  rvk);
713  GNUNET_free (new_label);
714  GNUNET_free (claim);
715  GNUNET_free (attr_data);
716 }
717 
718 
727 static void
729 {
730  char *label;
731 
732  if (NULL == rvk->move_attr)
733  {
734  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished moving attributes\n");
735  rvk->ns_it =
737  &rvk->identity,
739  rvk,
741  rvk,
743  rvk);
744  return;
745  }
747  sizeof(uint64_t));
748  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Moving attribute %s\n", label);
749 
751  &rvk->identity,
752  label,
753  &rvk_ns_err,
754  rvk,
756  rvk);
757  GNUNET_free (label);
758 }
759 
760 
772 static void
773 remove_ticket_cont (void *cls, int32_t success, const char *emsg)
774 {
775  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
776 
777  rvk->ns_qe = NULL;
778  if (GNUNET_SYSERR == success)
779  {
780  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", emsg);
781  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
782  cleanup_rvk (rvk);
783  return;
784  }
785  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleted ticket\n");
786  if (0 == rvk->ticket_attrs)
787  {
789  "No attributes to move... strange\n");
790  rvk->cb (rvk->cb_cls, GNUNET_OK);
791  cleanup_rvk (rvk);
792  return;
793  }
794  rvk->move_attr = rvk->attrs_head;
795  move_attrs (rvk);
796 }
797 
798 
809 static void
810 revoke_attrs_cb (void *cls,
811  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
812  const char *label,
813  unsigned int rd_count,
814  const struct GNUNET_GNSRECORD_Data *rd)
815 
816 {
817  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
818  struct RevokedAttributeEntry *le;
819 
820  rvk->ns_qe = NULL;
825  for (int i = 0; i < rd_count; i++)
826  {
827  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
828  continue;
829  le = GNUNET_new (struct RevokedAttributeEntry);
830  le->old_id = *((uint64_t *) rd[i].data);
832  rvk->ticket_attrs++;
833  }
834 
837  &rvk->identity,
838  label,
839  0,
840  NULL,
842  rvk);
843 }
844 
845 
851 static void
852 rvk_attrs_err_cb (void *cls)
853 {
854  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
855 
856  rvk->cb (rvk->cb_cls, GNUNET_SYSERR);
857  cleanup_rvk (rvk);
858 }
859 
860 
876  void *cb_cls)
877 {
878  struct RECLAIM_TICKETS_RevokeHandle *rvk;
879  char *label;
880 
882  rvk->cb = cb;
883  rvk->cb_cls = cb_cls;
884  rvk->identity = *identity;
885  rvk->ticket = *ticket;
888  label = GNUNET_STRINGS_data_to_string_alloc (&ticket->rnd, sizeof(uint64_t));
889  GNUNET_assert (NULL != label);
891  identity,
892  label,
894  rvk,
896  rvk);
897  GNUNET_free (label);
898  return rvk;
899 }
900 
901 
907 void
909 {
910  GNUNET_assert (NULL != rh);
911  cleanup_rvk (rh);
912 }
913 
914 
915 /*******************************
916 * Ticket consume
917 *******************************/
918 
924 static void
926 {
927  struct ParallelLookup *lu;
928 
929  if (NULL != cth->lookup_request)
931  if (NULL != cth->kill_task)
933  while (NULL != (lu = cth->parallel_lookups_head))
934  {
935  if (NULL != lu->lookup_request)
940  lu);
941  GNUNET_free (lu);
942  }
943 
944  if (NULL != cth->attrs)
946  GNUNET_free (cth);
947 }
948 
949 
957 static void
959  uint32_t rd_count,
960  const struct GNUNET_GNSRECORD_Data *rd)
961 {
962  struct ParallelLookup *parallel_lookup = cls;
963  struct RECLAIM_TICKETS_ConsumeHandle *cth = parallel_lookup->handle;
965 
967  "Parallel lookup finished (count=%u)\n",
968  rd_count);
969 
972  parallel_lookup);
973  GNUNET_free (parallel_lookup->label);
974 
976  "attribute_lookup_time_total",
978  parallel_lookup->lookup_start_time)
979  .rel_value_us,
980  GNUNET_YES);
981  GNUNET_STATISTICS_update (stats, "attribute_lookups_count", 1, GNUNET_YES);
982 
983 
984  GNUNET_free (parallel_lookup);
985  if (1 != rd_count)
986  GNUNET_break (0); // FIXME: We should never find this.
988  {
990  attr_le->claim =
993  cth->attrs->list_tail,
994  attr_le);
995  }
996 
997  if (NULL != cth->parallel_lookups_head)
998  return; // Wait for more
999 
1000  /* Else we are done */
1001  cth->cb (cth->cb_cls, &cth->ticket.identity, cth->attrs, GNUNET_OK, NULL);
1002  cleanup_cth (cth);
1003 }
1004 
1005 
1011 static void
1013 {
1014  struct RECLAIM_TICKETS_ConsumeHandle *cth = cls;
1015  struct ParallelLookup *lu;
1016  struct ParallelLookup *tmp;
1017 
1018  cth->kill_task = NULL;
1019  for (lu = cth->parallel_lookups_head; NULL != lu;)
1020  {
1022  GNUNET_free (lu->label);
1023  tmp = lu->next;
1025  cth->parallel_lookups_tail,
1026  lu);
1027  GNUNET_free (lu);
1028  lu = tmp;
1029  }
1030  cth->cb (cth->cb_cls, NULL, NULL, GNUNET_SYSERR, "Aborted");
1031 }
1032 
1033 
1043 static void
1044 lookup_authz_cb (void *cls,
1045  uint32_t rd_count,
1046  const struct GNUNET_GNSRECORD_Data *rd)
1047 {
1048  struct RECLAIM_TICKETS_ConsumeHandle *cth = cls;
1049  struct ParallelLookup *parallel_lookup;
1050  char *lbl;
1051 
1052  cth->lookup_request = NULL;
1053 
1054  GNUNET_STATISTICS_update (stats,
1055  "reclaim_authz_lookup_time_total",
1057  cth->lookup_start_time)
1058  .rel_value_us,
1059  GNUNET_YES);
1060  GNUNET_STATISTICS_update (stats,
1061  "reclaim_authz_lookups_count",
1062  1,
1063  GNUNET_YES);
1064 
1065  for (int i = 0; i < rd_count; i++)
1066  {
1067  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
1068  continue;
1069  lbl = GNUNET_STRINGS_data_to_string_alloc (rd[i].data, rd[i].data_size);
1070  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Attribute ref found %s\n", lbl);
1071  parallel_lookup = GNUNET_new (struct ParallelLookup);
1072  parallel_lookup->handle = cth;
1073  parallel_lookup->label = lbl;
1074  parallel_lookup->lookup_start_time = GNUNET_TIME_absolute_get ();
1075  parallel_lookup->lookup_request =
1076  GNUNET_GNS_lookup (gns,
1077  lbl,
1078  &cth->ticket.identity,
1082  parallel_lookup);
1084  cth->parallel_lookups_tail,
1085  parallel_lookup);
1086  }
1091  if (NULL != cth->parallel_lookups_head)
1092  {
1096  cth);
1097  return;
1098  }
1102  cth->cb (cth->cb_cls, &cth->ticket.identity, cth->attrs, GNUNET_OK, NULL);
1103  cleanup_cth (cth);
1104 }
1105 
1106 
1120  const struct GNUNET_RECLAIM_Ticket *ticket,
1122  void *cb_cls)
1123 {
1124  struct RECLAIM_TICKETS_ConsumeHandle *cth;
1125  char *label;
1126 
1128 
1129  cth->identity = *id;
1132  cth->ticket = *ticket;
1133  cth->cb = cb;
1134  cth->cb_cls = cb_cls;
1135  label =
1136  GNUNET_STRINGS_data_to_string_alloc (&cth->ticket.rnd, sizeof(uint64_t));
1138  "Looking for AuthZ info under %s\n",
1139  label);
1141  cth->lookup_request =
1142  GNUNET_GNS_lookup (gns,
1143  label,
1144  &cth->ticket.identity,
1147  &lookup_authz_cb,
1148  cth);
1149  GNUNET_free (label);
1150  return cth;
1151 }
1152 
1153 
1159 void
1161 {
1162  cleanup_cth (cth);
1163  return;
1164 }
1165 
1166 
1167 /*******************************
1168 * Ticket issue
1169 *******************************/
1170 
1175 static void
1177 {
1178  if (NULL != handle->ns_qe)
1179  GNUNET_NAMESTORE_cancel (handle->ns_qe);
1180  GNUNET_free (handle);
1181 }
1182 
1183 
1192 static void
1193 store_ticket_issue_cont (void *cls, int32_t success, const char *emsg)
1194 {
1195  struct TicketIssueHandle *handle = cls;
1196 
1197  handle->ns_qe = NULL;
1198  if (GNUNET_SYSERR == success)
1199  {
1200  handle->cb (handle->cb_cls,
1201  &handle->ticket,
1202  GNUNET_SYSERR,
1203  "Error storing AuthZ ticket in GNS");
1204  return;
1205  }
1206  handle->cb (handle->cb_cls, &handle->ticket, GNUNET_OK, NULL);
1207  cleanup_issue_handle (handle);
1208 }
1209 
1210 
1218 static void
1220 {
1222  struct GNUNET_GNSRECORD_Data *attrs_record;
1223  char *label;
1224  size_t list_len = 1;
1225  int i;
1226 
1227  for (le = ih->attrs->list_head; NULL != le; le = le->next)
1228  list_len++;
1229 
1230  attrs_record =
1231  GNUNET_malloc (list_len * sizeof(struct GNUNET_GNSRECORD_Data));
1232  i = 0;
1233  for (le = ih->attrs->list_head; NULL != le; le = le->next)
1234  {
1235  attrs_record[i].data = &le->claim->id;
1236  attrs_record[i].data_size = sizeof(le->claim->id);
1244  i++;
1245  }
1246  attrs_record[i].data = &ih->ticket;
1247  attrs_record[i].data_size = sizeof(struct GNUNET_RECLAIM_Ticket);
1250  attrs_record[i].flags =
1252 
1253  label =
1254  GNUNET_STRINGS_data_to_string_alloc (&ih->ticket.rnd, sizeof(uint64_t));
1255  // Publish record
1257  &ih->identity,
1258  label,
1259  list_len,
1260  attrs_record,
1262  ih);
1263  GNUNET_free (attrs_record);
1264  GNUNET_free (label);
1265 }
1266 
1267 
1268 /*************************************************
1269 * Ticket iteration (finding a specific ticket)
1270 *************************************************/
1271 
1272 
1278 static void
1280 {
1281  struct TicketIssueHandle *tih = cls;
1282 
1283  tih->ns_it = NULL;
1284  tih->cb (tih->cb_cls,
1285  &tih->ticket,
1286  GNUNET_SYSERR,
1287  "Error storing AuthZ ticket in GNS");
1288  cleanup_issue_handle (tih);
1289 }
1290 
1291 
1304 static void
1306  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
1307  const char *label,
1308  unsigned int rd_count,
1309  const struct GNUNET_GNSRECORD_Data *rd)
1310 {
1311  struct TicketIssueHandle *tih = cls;
1312  struct GNUNET_RECLAIM_Ticket *ticket = NULL;
1313 
1314  // figure out the number of requested attributes
1316  unsigned int attr_cnt = 0;
1317 
1318  for (le = tih->attrs->list_head; NULL != le; le = le->next)
1319  attr_cnt++;
1320 
1321  // ticket search
1322  unsigned int found_attrs_cnt = 0;
1323 
1324  for (int i = 0; i < rd_count; i++)
1325  {
1326  // found ticket
1327  if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET == rd[i].record_type)
1328  {
1329  ticket = (struct GNUNET_RECLAIM_Ticket *) rd[i].data;
1330  // cmp audience
1331  if (0 == memcmp (&tih->ticket.audience,
1332  &ticket->audience,
1333  sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)))
1334  {
1335  tih->ticket = *ticket;
1336  continue;
1337  }
1338  ticket = NULL;
1339  }
1340 
1341  // cmp requested attributes with ticket attributes
1342  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
1343  continue;
1344  for (le = tih->attrs->list_head; NULL != le; le = le->next)
1345  {
1346  // cmp attr_ref id with requested attr id
1348  " %" PRIu64 "\n %" PRIu64 "\n",
1349  *((uint64_t *) rd[i].data),
1350  le->claim->id);
1351 
1352 
1353  if (0 == memcmp (rd[i].data, &le->claim->id, sizeof(uint64_t)))
1354  found_attrs_cnt++;
1355  }
1356  }
1357 
1362  if ((attr_cnt == found_attrs_cnt) && (NULL != ticket))
1363  {
1365  tih->cb (tih->cb_cls, &tih->ticket, GNUNET_OK, NULL);
1366  cleanup_issue_handle (tih);
1367  return;
1368  }
1369 
1370  // ticket not found in current record, checking next record set
1372 }
1373 
1374 
1382 static void
1384 {
1385  struct TicketIssueHandle *tih = cls;
1386 
1388  tih->ticket.rnd =
1390  issue_ticket (tih);
1391 }
1392 
1393 
1405 void
1408  const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
1410  void *cb_cls)
1411 {
1412  struct TicketIssueHandle *tih;
1413 
1414  tih = GNUNET_new (struct TicketIssueHandle);
1415  tih->cb = cb;
1416  tih->cb_cls = cb_cls;
1418  tih->identity = *identity;
1419  tih->ticket.audience = *audience;
1420 
1421  // First check whether the ticket has already been issued
1422  tih->ns_it =
1424  &tih->identity,
1426  tih,
1428  tih,
1430  tih);
1431 }
1432 
1433 
1434 /************************************
1435 * Ticket iteration
1436 ************************************/
1437 
1443 static void
1445 {
1446  if (NULL != iter->ns_it)
1448  GNUNET_free (iter);
1449 }
1450 
1451 
1463 static void
1465  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
1466  const char *label,
1467  unsigned int rd_count,
1468  const struct GNUNET_GNSRECORD_Data *rd)
1469 {
1470  struct RECLAIM_TICKETS_Iterator *iter = cls;
1471 
1472  for (int i = 0; i < rd_count; i++)
1473  {
1474  if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET != rd[i].record_type)
1475  continue;
1476  iter->cb (iter->cb_cls, (struct GNUNET_RECLAIM_Ticket *) rd[i].data);
1477  return;
1478  }
1480 }
1481 
1482 
1488 static void
1490 {
1491  struct RECLAIM_TICKETS_Iterator *iter = cls;
1492 
1493  iter->ns_it = NULL;
1494  iter->cb (iter->cb_cls, NULL);
1495  cleanup_iter (iter);
1496 }
1497 
1498 
1504 static void
1506 {
1507  struct RECLAIM_TICKETS_Iterator *iter = cls;
1508 
1509  iter->ns_it = NULL;
1510  iter->cb (iter->cb_cls, NULL);
1511  cleanup_iter (iter);
1512 }
1513 
1514 
1520 void
1522 {
1524 }
1525 
1526 
1532 void
1534 {
1536  cleanup_iter (iter);
1537 }
1538 
1539 
1548 struct RECLAIM_TICKETS_Iterator *
1552  void *cb_cls)
1553 {
1554  struct RECLAIM_TICKETS_Iterator *iter;
1555 
1556  iter = GNUNET_new (struct RECLAIM_TICKETS_Iterator);
1557  iter->cb = cb;
1558  iter->cb_cls = cb_cls;
1559  iter->ns_it =
1561  identity,
1563  iter,
1565  iter,
1567  iter);
1568  return iter;
1569 }
1570 
1571 
1578 int
1580 {
1581  // Get ticket expiration time (relative) from config
1582  if (GNUNET_OK ==
1584  "reclaim",
1585  "TICKET_REFRESH_INTERVAL",
1587  {
1589  "Configured refresh interval for tickets: %s\n",
1591  GNUNET_YES));
1592  }
1593  else
1594  {
1596  }
1597  // Connect to identity and namestore services
1598  nsh = GNUNET_NAMESTORE_connect (c);
1599  if (NULL == nsh)
1600  {
1602  "error connecting to namestore");
1603  return GNUNET_SYSERR;
1604  }
1605  gns = GNUNET_GNS_connect (c);
1606  if (NULL == gns)
1607  {
1608  GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "error connecting to gns");
1609  return GNUNET_SYSERR;
1610  }
1611  stats = GNUNET_STATISTICS_create ("reclaim", c);
1612  return GNUNET_OK;
1613 }
1614 
1615 
1620 void
1622 {
1623  if (NULL != nsh)
1625  nsh = NULL;
1626  if (NULL != gns)
1627  GNUNET_GNS_disconnect (gns);
1628  gns = NULL;
1629  if (NULL != stats)
1630  {
1632  stats = NULL;
1633  }
1634 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
const char * name
The name of the attribute.
struct GNUNET_RECLAIM_ATTRIBUTE_Claim * claim
The attribute claim.
Connection to the GNS service.
Definition: gns_api.h:35
static void rvk_move_attr_cb(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Got the referenced attribute.
static void filter_tickets_finished_cb(void *cls)
Done iterating over tickets and we apparently did not find an existing, matching ticket.
static void cleanup_iter(struct RECLAIM_TICKETS_Iterator *iter)
Cleanup ticket iterator.
The authorization ticket.
static void abort_parallel_lookups(void *cls)
Cancel the lookups for attribute records.
struct TicketReference * prev
DLL.
struct GNUNET_RECLAIM_Ticket ticket
Tickets.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.
GNUNET_NETWORK_STRUCT_END ssize_t GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Calculate how many bytes we will need to serialize the given records.
int GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
uint64_t rel_value_us
The actual value.
Ticket revocation request handle.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry * list_tail
List tail.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
static void issue_ticket(struct TicketIssueHandle *ih)
Issue a new ticket.
uint64_t GNUNET_CRYPTO_random_u64(enum GNUNET_CRYPTO_Quality mode, uint64_t max)
Random on unsigned 64-bit values.
ssize_t GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, size_t dest_size, char *dest)
Serialize the given records to the given destination buffer.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
Starts a new zone iteration (used to periodically PUT all of our records into our DHT)...
static void move_attr_finished(void *cls, int32_t success, const char *emsg)
Updated an attribute ID.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Absolute lookup_start_time
Lookup time.
static void ticket_processed(void *cls, int32_t success, const char *emsg)
Finished storing updated attribute references.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * attrs
Attributes.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR
Record type for identity attributes (of RECLAIM).
static void process_parallel_lookup_result(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
We found an attribute record.
void RECLAIM_TICKETS_iteration_stop(struct RECLAIM_TICKETS_Iterator *iter)
Stop a running ticket iteration.
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
static struct GNUNET_TIME_Relative ticket_refresh_interval
Ticket expiration interval.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
uint64_t new_id
New ID of the attribute.
static void move_attrs(struct RECLAIM_TICKETS_RevokeHandle *rh)
We change every attribute ID of the ticket attributes we want to revoke.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.
static void store_ticket_issue_cont(void *cls, int32_t success, const char *emsg)
Store finished, abort on error.
Handle to a lookup request.
Definition: gns_api.c:42
struct ParallelLookup * prev
static void rvk_ns_iter_err(void *cls)
Error iterating namestore.
struct GNUNET_RECLAIM_Ticket ticket
Ticket to issue.
struct RevokedAttributeEntry * attrs_tail
Revoked attributes.
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Audience Key.
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF
Record type for reclaim records.
#define GNUNET_NO
Definition: gnunet_common.h:78
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
struct GNUNET_SCHEDULER_Task * kill_task
Kill task.
size_t data_size
Number of bytes in data.
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct RECLAIM_TICKETS_ConsumeHandle * handle
void GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, uint64_t limit)
Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start for the next record...
Private ECC key encoded for transmission.
void(* RECLAIM_TICKETS_TicketIter)(void *cls, struct GNUNET_RECLAIM_Ticket *ticket)
Continuation called with ticket.
struct RevokedAttributeEntry * next
DLL.
struct TicketReference * next
DLL.
int GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *dest)
Deserialize the given records to the given destination.
struct GNUNET_GNS_LookupRequest * lookup_request
static void filter_tickets_error_cb(void *cls)
Namestore error on issue.
static void collect_tickets_cb(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Return each record of type to the caller and proceed with the iteration.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct RECLAIM_TICKETS_Iterator * RECLAIM_TICKETS_iteration_start(const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, RECLAIM_TICKETS_TicketIter cb, void *cb_cls)
Iterate over all tickets issued by an identity.
Handle for the service.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
struct GNUNET_TIME_Absolute lookup_start_time
Lookup time.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static void revoke_attrs_cb(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
We found the attribute references.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
static void del_attr_finished(void *cls, int32_t success, const char *emsg)
Done deleting the old record.
static char * zone
Name of the zone we manage.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level &#39;level&#39; that indicates a failure of the command &#39;cmd&#39; with the mess...
void GNUNET_RECLAIM_ATTRIBUTE_list_destroy(struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
Destroy claim list.
struct RevokedAttributeEntry * move_attr
Current attribute to move.
Handle for a zone iterator operation.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1253
const void * data
Binary value stored in the DNS record.
RECLAIM_TICKETS_TicketIter cb
Iter callback.
Connection to the NAMESTORE service.
uint64_t expiration_time
Expiration time for the DNS record.
static void rvk_ticket_update_finished(void *cls)
Done collecting tickets.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1280
unsigned int rd_count
Record count.
void GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle)
Shutdown connection with the GNS service.
Definition: gns_api.c:284
static void move_attrs_cont(void *cls)
Delayed continuation for move_attrs.
Handle to a consume operation.
static void collect_tickets_error_cb(void *cls)
Cancel ticket iteration on namestore error.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:687
static void cleanup_issue_handle(struct TicketIssueHandle *handle)
Cleanup ticket consume handle.
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Issuer Key.
struct TicketRecordsEntry * tickets_to_update_tail
Tickets to update.
void RECLAIM_TICKETS_iteration_next(struct RECLAIM_TICKETS_Iterator *iter)
Continue ticket iteration.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:442
void(* RECLAIM_TICKETS_ConsumeCallback)(void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *l, int32_t success, const char *emsg)
Consume callback.
struct GNUNET_GNS_Handle * GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the GNS service.
Definition: gns_api.c:262
This is a private record of this peer and it should thus not be handed out to other peers...
RECLAIM_TICKETS_RevokeCallback cb
Callback.
static void rvk_attrs_err_cb(void *cls)
Failed to query namestore.
#define DEFAULT_TICKET_REFRESH_INTERVAL
FIXME: the defaul ticket iteration interval should probably be the minimim attribute expiration...
static void cleanup_cth(struct RECLAIM_TICKETS_ConsumeHandle *cth)
Cleanup ticket consume handle.
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:118
struct RevokedAttributeEntry * attrs_head
Revoked attributes.
struct TicketRecordsEntry * tickets_to_update_head
Tickets to update.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore Iterator.
struct GNUNET_CRYPTO_EcdsaPublicKey identity
The ticket issuer (= the user)
static void cleanup_rvk(struct RECLAIM_TICKETS_RevokeHandle *rh)
Cleanup revoke handle.
void RECLAIM_TICKETS_consume_cancel(struct RECLAIM_TICKETS_ConsumeHandle *cth)
Cancel a consume operation.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * attrs
Attributes.
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:239
struct ParallelLookup * next
An QueueEntry used to store information for a pending NAMESTORE record operation. ...
Definition: namestore_api.c:53
uint64_t rnd
The ticket random (NBO)
static struct GNUNET_NAMESTORE_Handle * nsh
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
void RECLAIM_TICKETS_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, const struct GNUNET_CRYPTO_EcdsaPublicKey *audience, RECLAIM_TICKETS_TicketResult cb, void *cb_cls)
Issue a new reclaim ticket, thereby authorizing the audience to access the set of provided attributes...
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore queue entry.
struct GNUNET_GNS_LookupRequest * lookup_request
LookupRequest.
struct GNUNET_RECLAIM_Ticket ticket
Ticket.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * attrs
Attributes to issue.
void RECLAIM_TICKETS_revoke_cancel(struct RECLAIM_TICKETS_RevokeHandle *rh)
Cancel a revocation.
void(* RECLAIM_TICKETS_TicketResult)(void *cls, struct GNUNET_RECLAIM_Ticket *ticket, int32_t success, const char *emsg)
Continuation called with ticket.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore iterator.
struct RevokedAttributeEntry * prev
DLL.
static void process_tickets(void *cls)
For each ticket, store new, updated attribute references (Implementation further below) ...
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
Get required size for serialization buffer.
uint32_t record_type
Type of the GNS/DNS record.
struct RECLAIM_TICKETS_RevokeHandle * RECLAIM_TICKETS_revoke(const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, RECLAIM_TICKETS_RevokeCallback cb, void *cb_cls)
Revoke a ticket.
configuration data
Definition: configuration.c:85
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:375
struct GNUNET_CRYPTO_EcdsaPublicKey audience
The ticket audience (= relying party)
RECLAIM_TICKETS_ConsumeCallback cb
Callback.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
void RECLAIM_TICKETS_deinit(void)
Close handles and clean up.
A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures.
static void remove_ticket_cont(void *cls, int32_t success, const char *emsg)
Finished deleting ticket and attribute references.
struct RECLAIM_TICKETS_ConsumeHandle * RECLAIM_TICKETS_consume(const struct GNUNET_CRYPTO_EcdsaPrivateKey *id, const struct GNUNET_RECLAIM_Ticket *ticket, RECLAIM_TICKETS_ConsumeCallback cb, void *cb_cls)
Consume a ticket.
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
Definition: scheduler.c:134
void * GNUNET_GNS_lookup_cancel(struct GNUNET_GNS_LookupRequest *lr)
Cancel pending lookup request.
Definition: gns_api.c:308
#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET
Record type for local ticket references.
Ticket issue request handle.
A reference to a ticket stored in GNS.
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, char *result)
Serialize an attribute.
Time for absolute times used by GNUnet, in microseconds.
RECLAIM_TICKETS_TicketResult cb
Callback.
#define GNUNET_YES
Definition: gnunet_common.h:77
struct GNUNET_RECLAIM_ATTRIBUTE_Claim * claim
Claim to store.
Defaults, look in cache, then in DHT.
uint64_t old_id
Old ID of the attribute.
static void collect_tickets_finished_cb(void *cls)
Signal ticket iteration has finished.
struct GNUNET_RECLAIM_Ticket ticket
Ticket to issue.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
Definition: strings.c:920
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
This flag is currently unused; former RF_PENDING flag.
static void filter_tickets_cb(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Iterator over records.
struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, const char *name, const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, uint32_t type, enum GNUNET_GNS_LocalOptions options, GNUNET_GNS_LookupResultProcessor proc, void *proc_cls)
Perform an asynchronous lookup operation on the GNS.
Definition: gns_api.c:336
uint32_t data
The data value.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry * next
DLL.
int RECLAIM_TICKETS_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize tickets component.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * GNUNET_RECLAIM_ATTRIBUTE_list_dup(const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
Make a (deep) copy of a claim list.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry * list_head
List head.
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Issuer Key.
static void rvk_ticket_update(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
We need to update all other tickets with the new attribute IDs.
void(* RECLAIM_TICKETS_RevokeCallback)(void *cls, int32_t success)
Revocation callback.
struct ParallelLookup * parallel_lookups_tail
Lookup DLL.
static void lookup_authz_cb(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
GNS result with attribute references.
unsigned int ticket_attrs
Number of attributes in ticket.
static struct GNUNET_STATISTICS_Handle * stats
static struct GNUNET_GNS_Handle * gns
struct GNUNET_RECLAIM_ATTRIBUTE_Claim * GNUNET_RECLAIM_ATTRIBUTE_deserialize(const char *data, size_t data_size)
Deserialize an attribute.
static void rvk_ns_err(void *cls)
Error storing new attribute in namestore.
#define GNUNET_malloc(size)
Wrapper around malloc.
struct ParallelLookup * parallel_lookups_head
Lookup DLL.
#define GNUNET_free(ptr)
Wrapper around free.
Time for relative time used by GNUnet, in microseconds.
Handle for a parallel GNS lookup job.
struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub
Audience Key.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:966
High-quality operations are desired.