GNUnet  0.10.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 
52 
57 
62 
67 };
68 
69 
77  struct GNUNET_RECLAIM_Ticket ticket;
78 
83 
88 
92  struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub;
93 
98 
103 
108 
113 
117  struct GNUNET_TIME_Absolute lookup_start_time;
118 
123 
127  void *cb_cls;
128 };
129 
130 
135  /* DLL */
137 
138  /* DLL */
140 
141  /* The GNS request */
143 
144  /* The handle the return to */
146 
150  struct GNUNET_TIME_Absolute lookup_start_time;
151 
152  /* The label to look up */
153  char *label;
154 };
155 
156 
165 
170 
174  struct GNUNET_RECLAIM_Ticket ticket;
175 
180 
185 
190 
194  void *cb_cls;
195 };
196 
197 
206 
211 
215  void *cb_cls;
216 };
217 
218 
224 
229 
233  uint64_t old_id;
234 
238  uint64_t new_id;
239 };
240 
241 
250 
255 
259  void *cb_cls;
260 
264  struct GNUNET_RECLAIM_Ticket ticket;
265 
270 
275 
280 
285 
290 
294  unsigned int ticket_attrs;
295 
300 
305 };
306 
307 
312 
313 
314 /* Namestore handle */
316 
317 
318 /* GNS handle */
319 static struct GNUNET_GNS_Handle *gns;
320 
321 
322 /* Handle to the statistics service */
324 
325 
326 
332 static void
334 {
335  struct RevokedAttributeEntry *ae;
336  struct TicketRecordsEntry *le;
337 
338  if (NULL != rh->ns_qe)
340  if (NULL != rh->ns_it)
342  while (NULL != (ae = rh->attrs_head))
343  {
345  GNUNET_free(ae);
346  }
347  while (NULL != (le = rh->tickets_to_update_head))
348  {
351  le);
352  if (NULL != le->data)
353  GNUNET_free(le->data);
354  if (NULL != le->label)
355  GNUNET_free(le->label);
356  GNUNET_free(le);
357  }
358  GNUNET_free(rh);
359 }
360 
361 
368 static void
369 process_tickets(void *cls);
370 
371 
380 static void
381 ticket_processed(void *cls, int32_t success, const char *emsg)
382 {
383  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
384 
385  rvk->ns_qe = NULL;
387 }
388 
389 
395 static void
396 process_tickets(void *cls)
397 {
398  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
399  struct TicketRecordsEntry *le;
400  struct RevokedAttributeEntry *ae;
401 
402  if (NULL == rvk->tickets_to_update_head)
403  {
405  "Finished updatding tickets, success\n");
406  rvk->cb(rvk->cb_cls, GNUNET_OK);
407  cleanup_rvk(rvk);
408  return;
409  }
410  le = rvk->tickets_to_update_head;
413  le);
414  struct GNUNET_GNSRECORD_Data rd[le->rd_count];
416  le->data,
417  le->rd_count,
418  rd))
419  {
421  "Unable to deserialize ticket record(s)\n");
422  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
423  cleanup_rvk(rvk);
424  return;
425  }
426  for (int i = 0; i < le->rd_count; i++)
427  {
429  continue;
430  for (ae = rvk->attrs_head; NULL != ae; ae = ae->next)
431  {
432  if (0 != memcmp(rd[i].data, &ae->old_id, sizeof(uint64_t)))
433  continue;
434  rd[i].data = &ae->new_id;
435  }
436  }
438  &rvk->identity,
439  le->label,
440  le->rd_count,
441  rd,
443  rvk);
444  GNUNET_free(le->label);
445  GNUNET_free(le->data);
446  GNUNET_free(le);
447 }
448 
449 
455 static void
457 {
458  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
459 
460  rvk->ns_it = NULL;
462 }
463 
464 
475 static void
477  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
478  const char *label,
479  unsigned int rd_count,
480  const struct GNUNET_GNSRECORD_Data *rd)
481 {
482  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
483  struct TicketRecordsEntry *le;
484  struct RevokedAttributeEntry *ae;
485  int has_changed = GNUNET_NO;
486 
488  for (int i = 0; i < rd_count; i++)
489  {
490  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
491  continue;
492  for (ae = rvk->attrs_head; NULL != ae; ae = ae->next)
493  {
494  if (0 != memcmp(rd[i].data, &ae->old_id, sizeof(uint64_t)))
495  continue;
496  has_changed = GNUNET_YES;
497  break;
498  }
499  if (GNUNET_YES == has_changed)
500  break;
501  }
502  if (GNUNET_YES == has_changed)
503  {
504  le = GNUNET_new(struct TicketRecordsEntry);
505  le->data_size = GNUNET_GNSRECORD_records_get_size(rd_count, rd);
506  le->data = GNUNET_malloc(le->data_size);
507  le->rd_count = rd_count;
508  le->label = GNUNET_strdup(label);
509  GNUNET_GNSRECORD_records_serialize(rd_count, rd, le->data_size, le->data);
512  le);
513  }
515 }
516 
517 
523 static void
524 rvk_ns_iter_err(void *cls)
525 {
526  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
527 
528  rvk->ns_it = NULL;
530  "Namestore error on revocation (id=%" PRIu64 "\n",
531  rvk->move_attr->old_id);
532  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
533  cleanup_rvk(rvk);
534 }
535 
536 
542 static void
543 rvk_ns_err(void *cls)
544 {
545  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
546 
547  rvk->ns_qe = NULL;
549  "Namestore error on revocation (id=%" PRIu64 "\n",
550  rvk->move_attr->old_id);
551  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
552  cleanup_rvk(rvk);
553 }
554 
555 
565 static void
567 
568 
574 static void
575 move_attrs_cont(void *cls)
576 {
578 }
579 
580 
589 static void
590 del_attr_finished(void *cls, int32_t success, const char *emsg)
591 {
592  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
593 
594  rvk->ns_qe = NULL;
595  if (GNUNET_SYSERR == success)
596  {
598  "Error removing attribute: %s\n",
599  emsg);
600  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
601  cleanup_rvk(rvk);
602  return;
603  }
604  rvk->move_attr = rvk->move_attr->next;
606 }
607 
608 
618 static void
619 move_attr_finished(void *cls, int32_t success, const char *emsg)
620 {
621  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
622  char *label;
623 
624  rvk->ns_qe = NULL;
625  if (GNUNET_SYSERR == success)
626  {
627  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error moving attribute: %s\n", emsg);
628  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
629  cleanup_rvk(rvk);
630  return;
631  }
633  sizeof(uint64_t));
634  GNUNET_assert(NULL != label);
635  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Removing attribute %s\n", label);
637  &rvk->identity,
638  label,
639  0,
640  NULL,
642  rvk);
643  GNUNET_free(label);
644 }
645 
646 
656 static void
658  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
659  const char *label,
660  unsigned int rd_count,
661  const struct GNUNET_GNSRECORD_Data *rd)
662 {
663  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
665  struct GNUNET_GNSRECORD_Data new_rd;
666  struct RevokedAttributeEntry *le;
667  char *new_label;
668  char *attr_data;
669 
670  rvk->ns_qe = NULL;
671  if (0 == rd_count)
672  {
674  "The attribute %s no longer exists!\n",
675  label);
676  le = rvk->move_attr;
677  rvk->move_attr = le->next;
679  GNUNET_free(le);
681  return;
682  }
684  rvk->move_attr->new_id =
686  new_rd = *rd;
689  "Attribute to update: Name=%s, ID=%" PRIu64 "\n",
690  claim->name,
691  claim->id);
692  claim->id = rvk->move_attr->new_id;
694  attr_data = GNUNET_malloc(rd->data_size);
695  new_rd.data_size = GNUNET_RECLAIM_ATTRIBUTE_serialize(claim, attr_data);
696  new_rd.data = attr_data;
698  sizeof(uint64_t));
699  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Adding attribute %s\n", new_label);
701  &rvk->identity,
702  new_label,
703  1,
704  &new_rd,
706  rvk);
707  GNUNET_free(new_label);
708  GNUNET_free(claim);
709  GNUNET_free(attr_data);
710 }
711 
712 
721 static void
723 {
724  char *label;
725 
726  if (NULL == rvk->move_attr)
727  {
728  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Finished moving attributes\n");
729  rvk->ns_it =
731  &rvk->identity,
733  rvk,
735  rvk,
737  rvk);
738  return;
739  }
741  sizeof(uint64_t));
742  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Moving attribute %s\n", label);
743 
745  &rvk->identity,
746  label,
747  &rvk_ns_err,
748  rvk,
750  rvk);
751  GNUNET_free(label);
752 }
753 
754 
766 static void
767 remove_ticket_cont(void *cls, int32_t success, const char *emsg)
768 {
769  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
770 
771  rvk->ns_qe = NULL;
772  if (GNUNET_SYSERR == success)
773  {
774  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "%s\n", emsg);
775  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
776  cleanup_rvk(rvk);
777  return;
778  }
779  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Deleted ticket\n");
780  if (0 == rvk->ticket_attrs)
781  {
783  "No attributes to move... strange\n");
784  rvk->cb(rvk->cb_cls, GNUNET_OK);
785  cleanup_rvk(rvk);
786  return;
787  }
788  rvk->move_attr = rvk->attrs_head;
789  move_attrs(rvk);
790 }
791 
792 
803 static void
804 revoke_attrs_cb(void *cls,
805  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
806  const char *label,
807  unsigned int rd_count,
808  const struct GNUNET_GNSRECORD_Data *rd)
809 
810 {
811  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
812  struct RevokedAttributeEntry *le;
813 
814  rvk->ns_qe = NULL;
819  for (int i = 0; i < rd_count; i++)
820  {
821  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
822  continue;
823  le = GNUNET_new(struct RevokedAttributeEntry);
824  le->old_id = *((uint64_t *)rd[i].data);
826  rvk->ticket_attrs++;
827  }
828 
831  &rvk->identity,
832  label,
833  0,
834  NULL,
836  rvk);
837 }
838 
839 
845 static void
847 {
848  struct RECLAIM_TICKETS_RevokeHandle *rvk = cls;
849 
850  rvk->cb(rvk->cb_cls, GNUNET_SYSERR);
851  cleanup_rvk(rvk);
852 }
853 
854 
870  void *cb_cls)
871 {
872  struct RECLAIM_TICKETS_RevokeHandle *rvk;
873  char *label;
874 
876  rvk->cb = cb;
877  rvk->cb_cls = cb_cls;
878  rvk->identity = *identity;
879  rvk->ticket = *ticket;
882  label = GNUNET_STRINGS_data_to_string_alloc(&ticket->rnd, sizeof(uint64_t));
883  GNUNET_assert(NULL != label);
885  identity,
886  label,
888  rvk,
890  rvk);
891  GNUNET_free(label);
892  return rvk;
893 }
894 
895 
901 void
903 {
904  GNUNET_assert(NULL != rh);
905  cleanup_rvk(rh);
906 }
907 
908 
909 /*******************************
910 * Ticket consume
911 *******************************/
912 
918 static void
920 {
921  struct ParallelLookup *lu;
922 
923  if (NULL != cth->lookup_request)
925  if (NULL != cth->kill_task)
927  while (NULL != (lu = cth->parallel_lookups_head))
928  {
929  if (NULL != lu->lookup_request)
934  lu);
935  GNUNET_free(lu);
936  }
937 
938  if (NULL != cth->attrs)
940  GNUNET_free(cth);
941 }
942 
943 
951 static void
953  uint32_t rd_count,
954  const struct GNUNET_GNSRECORD_Data *rd)
955 {
956  struct ParallelLookup *parallel_lookup = cls;
957  struct RECLAIM_TICKETS_ConsumeHandle *cth = parallel_lookup->handle;
959 
961  "Parallel lookup finished (count=%u)\n",
962  rd_count);
963 
966  parallel_lookup);
967  GNUNET_free(parallel_lookup->label);
968 
970  "attribute_lookup_time_total",
972  parallel_lookup->lookup_start_time)
973  .rel_value_us,
974  GNUNET_YES);
975  GNUNET_STATISTICS_update(stats, "attribute_lookups_count", 1, GNUNET_YES);
976 
977 
978  GNUNET_free(parallel_lookup);
979  if (1 != rd_count)
980  GNUNET_break(0); // FIXME: We should never find this.
982  {
984  attr_le->claim =
987  cth->attrs->list_tail,
988  attr_le);
989  }
990 
991  if (NULL != cth->parallel_lookups_head)
992  return; // Wait for more
993 
994  /* Else we are done */
995  cth->cb(cth->cb_cls, &cth->ticket.identity, cth->attrs, GNUNET_OK, NULL);
996  cleanup_cth(cth);
997 }
998 
999 
1005 static void
1007 {
1008  struct RECLAIM_TICKETS_ConsumeHandle *cth = cls;
1009  struct ParallelLookup *lu;
1010  struct ParallelLookup *tmp;
1011 
1012  cth->kill_task = NULL;
1013  for (lu = cth->parallel_lookups_head; NULL != lu;)
1014  {
1016  GNUNET_free(lu->label);
1017  tmp = lu->next;
1019  cth->parallel_lookups_tail,
1020  lu);
1021  GNUNET_free(lu);
1022  lu = tmp;
1023  }
1024  cth->cb(cth->cb_cls, NULL, NULL, GNUNET_SYSERR, "Aborted");
1025 }
1026 
1027 
1037 static void
1039  uint32_t rd_count,
1040  const struct GNUNET_GNSRECORD_Data *rd)
1041 {
1042  struct RECLAIM_TICKETS_ConsumeHandle *cth = cls;
1043  struct ParallelLookup *parallel_lookup;
1044  char *lbl;
1045 
1046  cth->lookup_request = NULL;
1047 
1049  "reclaim_authz_lookup_time_total",
1051  cth->lookup_start_time)
1052  .rel_value_us,
1053  GNUNET_YES);
1055  "reclaim_authz_lookups_count",
1056  1,
1057  GNUNET_YES);
1058 
1059  for (int i = 0; i < rd_count; i++)
1060  {
1061  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
1062  continue;
1064  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Attribute ref found %s\n", lbl);
1065  parallel_lookup = GNUNET_new(struct ParallelLookup);
1066  parallel_lookup->handle = cth;
1067  parallel_lookup->label = lbl;
1068  parallel_lookup->lookup_start_time = GNUNET_TIME_absolute_get();
1069  parallel_lookup->lookup_request =
1070  GNUNET_GNS_lookup(gns,
1071  lbl,
1072  &cth->ticket.identity,
1076  parallel_lookup);
1078  cth->parallel_lookups_tail,
1079  parallel_lookup);
1080  }
1085  if (NULL != cth->parallel_lookups_head)
1086  {
1090  cth);
1091  return;
1092  }
1096  cth->cb(cth->cb_cls, &cth->ticket.identity, cth->attrs, GNUNET_OK, NULL);
1097  cleanup_cth(cth);
1098 }
1099 
1100 
1114  const struct GNUNET_RECLAIM_Ticket *ticket,
1116  void *cb_cls)
1117 {
1118  struct RECLAIM_TICKETS_ConsumeHandle *cth;
1119  char *label;
1120 
1122 
1123  cth->identity = *id;
1126  cth->ticket = *ticket;
1127  cth->cb = cb;
1128  cth->cb_cls = cb_cls;
1129  label =
1130  GNUNET_STRINGS_data_to_string_alloc(&cth->ticket.rnd, sizeof(uint64_t));
1132  "Looking for AuthZ info under %s\n",
1133  label);
1135  cth->lookup_request =
1136  GNUNET_GNS_lookup(gns,
1137  label,
1138  &cth->ticket.identity,
1141  &lookup_authz_cb,
1142  cth);
1143  GNUNET_free(label);
1144  return cth;
1145 }
1146 
1147 
1153 void
1155 {
1156  cleanup_cth(cth);
1157  return;
1158 }
1159 
1160 
1161 /*******************************
1162 * Ticket issue
1163 *******************************/
1164 
1169 static void
1171 {
1172  if (NULL != handle->ns_qe)
1173  GNUNET_NAMESTORE_cancel(handle->ns_qe);
1174  GNUNET_free(handle);
1175 }
1176 
1177 
1186 static void
1187 store_ticket_issue_cont(void *cls, int32_t success, const char *emsg)
1188 {
1189  struct TicketIssueHandle *handle = cls;
1190 
1191  handle->ns_qe = NULL;
1192  if (GNUNET_SYSERR == success)
1193  {
1194  handle->cb(handle->cb_cls,
1195  &handle->ticket,
1196  GNUNET_SYSERR,
1197  "Error storing AuthZ ticket in GNS");
1198  return;
1199  }
1200  handle->cb(handle->cb_cls, &handle->ticket, GNUNET_OK, NULL);
1201  cleanup_issue_handle(handle);
1202 }
1203 
1204 
1212 static void
1214 {
1216  struct GNUNET_GNSRECORD_Data *attrs_record;
1217  char *label;
1218  size_t list_len = 1;
1219  int i;
1220 
1221  for (le = ih->attrs->list_head; NULL != le; le = le->next)
1222  list_len++;
1223 
1224  attrs_record =
1225  GNUNET_malloc(list_len * sizeof(struct GNUNET_GNSRECORD_Data));
1226  i = 0;
1227  for (le = ih->attrs->list_head; NULL != le; le = le->next)
1228  {
1229  attrs_record[i].data = &le->claim->id;
1230  attrs_record[i].data_size = sizeof(le->claim->id);
1238  i++;
1239  }
1240  attrs_record[i].data = &ih->ticket;
1241  attrs_record[i].data_size = sizeof(struct GNUNET_RECLAIM_Ticket);
1244  attrs_record[i].flags =
1246 
1247  label =
1248  GNUNET_STRINGS_data_to_string_alloc(&ih->ticket.rnd, sizeof(uint64_t));
1249  // Publish record
1251  &ih->identity,
1252  label,
1253  list_len,
1254  attrs_record,
1256  ih);
1257  GNUNET_free(attrs_record);
1258  GNUNET_free(label);
1259 }
1260 
1261 /*************************************************
1262 * Ticket iteration (finding a specific ticket)
1263 *************************************************/
1264 
1265 
1271 static void
1273 {
1274  struct TicketIssueHandle *tih = cls;
1275 
1276  tih->ns_it = NULL;
1277  tih->cb(tih->cb_cls,
1278  &tih->ticket,
1279  GNUNET_SYSERR,
1280  "Error storing AuthZ ticket in GNS");
1281  cleanup_issue_handle(tih);
1282 }
1283 
1284 
1297 static void
1299  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
1300  const char *label,
1301  unsigned int rd_count,
1302  const struct GNUNET_GNSRECORD_Data *rd)
1303 {
1304  struct TicketIssueHandle *tih = cls;
1305  struct GNUNET_RECLAIM_Ticket *ticket = NULL;
1306 
1307  // figure out the number of requested attributes
1309  unsigned int attr_cnt = 0;
1310 
1311  for (le = tih->attrs->list_head; NULL != le; le = le->next)
1312  attr_cnt++;
1313 
1314  // ticket search
1315  unsigned int found_attrs_cnt = 0;
1316 
1317  for (int i = 0; i < rd_count; i++)
1318  {
1319  // found ticket
1320  if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET == rd[i].record_type)
1321  {
1322  ticket = (struct GNUNET_RECLAIM_Ticket *)rd[i].data;
1323  // cmp audience
1324  if (0 == memcmp(&tih->ticket.audience,
1325  &ticket->audience,
1326  sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)))
1327  {
1328  tih->ticket = *ticket;
1329  continue;
1330  }
1331  ticket = NULL;
1332  }
1333 
1334  // cmp requested attributes with ticket attributes
1335  if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF != rd[i].record_type)
1336  continue;
1337  for (le = tih->attrs->list_head; NULL != le; le = le->next)
1338  {
1339  // cmp attr_ref id with requested attr id
1341  " %" PRIu64 "\n %" PRIu64 "\n",
1342  *((uint64_t *)rd[i].data),
1343  le->claim->id);
1344 
1345 
1346  if (0 == memcmp(rd[i].data, &le->claim->id, sizeof(uint64_t)))
1347  found_attrs_cnt++;
1348  }
1349  }
1350 
1355  if (attr_cnt == found_attrs_cnt && NULL != ticket)
1356  {
1358  tih->cb(tih->cb_cls, &tih->ticket, GNUNET_OK, NULL);
1359  cleanup_issue_handle(tih);
1360  return;
1361  }
1362 
1363  // ticket not found in current record, checking next record set
1365 }
1366 
1367 
1375 static void
1377 {
1378  struct TicketIssueHandle *tih = cls;
1379 
1381  tih->ticket.rnd =
1383  issue_ticket(tih);
1384 }
1385 
1386 
1398 void
1401  const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
1403  void *cb_cls)
1404 {
1405  struct TicketIssueHandle *tih;
1406 
1407  tih = GNUNET_new(struct TicketIssueHandle);
1408  tih->cb = cb;
1409  tih->cb_cls = cb_cls;
1411  tih->identity = *identity;
1412  tih->ticket.audience = *audience;
1413 
1414  // First check whether the ticket has already been issued
1415  tih->ns_it =
1417  &tih->identity,
1419  tih,
1421  tih,
1423  tih);
1424 }
1425 
1426 
1427 /************************************
1428 * Ticket iteration
1429 ************************************/
1430 
1436 static void
1438 {
1439  if (NULL != iter->ns_it)
1441  GNUNET_free(iter);
1442 }
1443 
1444 
1456 static void
1458  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
1459  const char *label,
1460  unsigned int rd_count,
1461  const struct GNUNET_GNSRECORD_Data *rd)
1462 {
1463  struct RECLAIM_TICKETS_Iterator *iter = cls;
1464 
1465  for (int i = 0; i < rd_count; i++)
1466  {
1467  if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET != rd[i].record_type)
1468  continue;
1469  iter->cb(iter->cb_cls, (struct GNUNET_RECLAIM_Ticket *)rd[i].data);
1470  return;
1471  }
1473 }
1474 
1475 
1481 static void
1483 {
1484  struct RECLAIM_TICKETS_Iterator *iter = cls;
1485 
1486  iter->ns_it = NULL;
1487  iter->cb(iter->cb_cls, NULL);
1488  cleanup_iter(iter);
1489 }
1490 
1491 
1497 static void
1499 {
1500  struct RECLAIM_TICKETS_Iterator *iter = cls;
1501 
1502  iter->ns_it = NULL;
1503  iter->cb(iter->cb_cls, NULL);
1504  cleanup_iter(iter);
1505 }
1506 
1507 
1513 void
1515 {
1517 }
1518 
1519 
1525 void
1527 {
1529  cleanup_iter(iter);
1530 }
1531 
1532 
1541 struct RECLAIM_TICKETS_Iterator *
1545  void *cb_cls)
1546 {
1547  struct RECLAIM_TICKETS_Iterator *iter;
1548 
1549  iter = GNUNET_new(struct RECLAIM_TICKETS_Iterator);
1550  iter->cb = cb;
1551  iter->cb_cls = cb_cls;
1552  iter->ns_it =
1554  identity,
1556  iter,
1558  iter,
1560  iter);
1561  return iter;
1562 }
1563 
1564 
1571 int
1573 {
1574  // Get ticket expiration time (relative) from config
1575  if (GNUNET_OK ==
1577  "reclaim",
1578  "TICKET_REFRESH_INTERVAL",
1580  {
1582  "Configured refresh interval for tickets: %s\n",
1584  GNUNET_YES));
1585  }
1586  else
1587  {
1589  }
1590  // Connect to identity and namestore services
1591  nsh = GNUNET_NAMESTORE_connect(c);
1592  if (NULL == nsh)
1593  {
1595  "error connecting to namestore");
1596  return GNUNET_SYSERR;
1597  }
1598  gns = GNUNET_GNS_connect(c);
1599  if (NULL == gns)
1600  {
1601  GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, "error connecting to gns");
1602  return GNUNET_SYSERR;
1603  }
1604  stats = GNUNET_STATISTICS_create("reclaim", c);
1605  return GNUNET_OK;
1606 }
1607 
1608 
1613 void
1615 {
1616  if (NULL != nsh)
1618  nsh = NULL;
1619  if (NULL != gns)
1620  GNUNET_GNS_disconnect(gns);
1621  gns = NULL;
1622  if (NULL != stats)
1623  {
1625  stats = NULL;
1626  }
1627 }
#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 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:1237
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:1264
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:282
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:686
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:440
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:260
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:241
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:83
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:373
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:131
void * GNUNET_GNS_lookup_cancel(struct GNUNET_GNS_LookupRequest *lr)
Cancel pending lookup request.
Definition: gns_api.c:306
#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:921
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:334
uint32_t data
The data value.
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry * next
DLL.
static size_t data_size
Number of bytes in data.
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:956
High-quality operations are desired.