You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

777 lines
25 KiB

  1. From 6603f7e1a837d3a51a1949a6f4e1802b6ef3d806 Mon Sep 17 00:00:00 2001
  2. From: "Schanzenbach, Martin" <mschanzenbach@posteo.de>
  3. Date: Thu, 28 Feb 2019 14:19:34 +0100
  4. Subject: [PATCH] fix dist for experimental
  5. ---
  6. po/POTFILES.in | 114 ++++++++++++++++++++--------------------
  7. src/include/Makefile.am | 1 +
  8. 2 files changed, 58 insertions(+), 57 deletions(-)
  9. --- a/po/POTFILES.in
  10. +++ b/po/POTFILES.in
  11. @@ -4,6 +4,14 @@ src/arm/arm_monitor_api.c
  12. src/arm/gnunet-arm.c
  13. src/arm/gnunet-service-arm.c
  14. src/arm/mockup-service.c
  15. +src/ats-tests/ats-testing-experiment.c
  16. +src/ats-tests/ats-testing-log.c
  17. +src/ats-tests/ats-testing-preferences.c
  18. +src/ats-tests/ats-testing-traffic.c
  19. +src/ats-tests/ats-testing.c
  20. +src/ats-tests/gnunet-ats-sim.c
  21. +src/ats-tests/gnunet-solver-eval.c
  22. +src/ats-tool/gnunet-ats.c
  23. src/ats/ats_api2_application.c
  24. src/ats/ats_api2_transport.c
  25. src/ats/ats_api_connectivity.c
  26. @@ -11,10 +19,10 @@ src/ats/ats_api_performance.c
  27. src/ats/ats_api_scanner.c
  28. src/ats/ats_api_scheduling.c
  29. src/ats/gnunet-ats-solver-eval.c
  30. -src/ats/gnunet-service-ats_addresses.c
  31. +src/ats/gnunet-service-ats-new.c
  32. src/ats/gnunet-service-ats.c
  33. +src/ats/gnunet-service-ats_addresses.c
  34. src/ats/gnunet-service-ats_connectivity.c
  35. -src/ats/gnunet-service-ats-new.c
  36. src/ats/gnunet-service-ats_normalization.c
  37. src/ats/gnunet-service-ats_performance.c
  38. src/ats/gnunet-service-ats_plugins.c
  39. @@ -26,14 +34,6 @@ src/ats/plugin_ats2_simple.c
  40. src/ats/plugin_ats_mlp.c
  41. src/ats/plugin_ats_proportional.c
  42. src/ats/plugin_ats_ril.c
  43. -src/ats-tests/ats-testing.c
  44. -src/ats-tests/ats-testing-experiment.c
  45. -src/ats-tests/ats-testing-log.c
  46. -src/ats-tests/ats-testing-preferences.c
  47. -src/ats-tests/ats-testing-traffic.c
  48. -src/ats-tests/gnunet-ats-sim.c
  49. -src/ats-tests/gnunet-solver-eval.c
  50. -src/ats-tool/gnunet-ats.c
  51. src/auction/gnunet-auction-create.c
  52. src/auction/gnunet-auction-info.c
  53. src/auction/gnunet-auction-join.c
  54. @@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c
  55. src/cadet/cadet_api_list_tunnels.c
  56. src/cadet/cadet_test_lib.c
  57. src/cadet/desirability_table.c
  58. -src/cadet/gnunet-cadet.c
  59. src/cadet/gnunet-cadet-profiler.c
  60. +src/cadet/gnunet-cadet.c
  61. src/cadet/gnunet-service-cadet.c
  62. src/cadet/gnunet-service-cadet_channel.c
  63. src/cadet/gnunet-service-cadet_connection.c
  64. @@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c
  65. src/consensus/plugin_block_consensus.c
  66. src/conversation/conversation_api.c
  67. src/conversation/conversation_api_call.c
  68. -src/conversation/gnunet-conversation.c
  69. src/conversation/gnunet-conversation-test.c
  70. -src/conversation/gnunet_gst.c
  71. -src/conversation/gnunet_gst_test.c
  72. -src/conversation/gnunet-helper-audio-playback.c
  73. +src/conversation/gnunet-conversation.c
  74. src/conversation/gnunet-helper-audio-playback-gst.c
  75. -src/conversation/gnunet-helper-audio-record.c
  76. +src/conversation/gnunet-helper-audio-playback.c
  77. src/conversation/gnunet-helper-audio-record-gst.c
  78. +src/conversation/gnunet-helper-audio-record.c
  79. src/conversation/gnunet-service-conversation.c
  80. +src/conversation/gnunet_gst.c
  81. +src/conversation/gnunet_gst_test.c
  82. src/conversation/microphone.c
  83. src/conversation/plugin_gnsrecord_conversation.c
  84. src/conversation/speaker.c
  85. @@ -111,7 +111,6 @@ src/dht/dht_api.c
  86. src/dht/dht_test_lib.c
  87. src/dht/gnunet-dht-get.c
  88. src/dht/gnunet-dht-monitor.c
  89. -src/dht/gnunet_dht_profiler.c
  90. src/dht/gnunet-dht-put.c
  91. src/dht/gnunet-service-dht.c
  92. src/dht/gnunet-service-dht_clients.c
  93. @@ -120,6 +119,7 @@ src/dht/gnunet-service-dht_hello.c
  94. src/dht/gnunet-service-dht_neighbours.c
  95. src/dht/gnunet-service-dht_nse.c
  96. src/dht/gnunet-service-dht_routing.c
  97. +src/dht/gnunet_dht_profiler.c
  98. src/dht/plugin_block_dht.c
  99. src/dns/dns_api.c
  100. src/dns/gnunet-dns-monitor.c
  101. @@ -129,8 +129,8 @@ src/dns/gnunet-service-dns.c
  102. src/dns/gnunet-zonewalk.c
  103. src/dns/plugin_block_dns.c
  104. src/exit/gnunet-daemon-exit.c
  105. -src/exit/gnunet-helper-exit.c
  106. src/exit/gnunet-helper-exit-windows.c
  107. +src/exit/gnunet-helper-exit.c
  108. src/fragmentation/defragmentation.c
  109. src/fragmentation/fragmentation.c
  110. src/fs/fs_api.c
  111. @@ -155,8 +155,8 @@ src/fs/gnunet-auto-share.c
  112. src/fs/gnunet-daemon-fsprofiler.c
  113. src/fs/gnunet-directory.c
  114. src/fs/gnunet-download.c
  115. -src/fs/gnunet-fs.c
  116. src/fs/gnunet-fs-profiler.c
  117. +src/fs/gnunet-fs.c
  118. src/fs/gnunet-helper-fs-publish.c
  119. src/fs/gnunet-publish.c
  120. src/fs/gnunet-search.c
  121. @@ -176,10 +176,10 @@ src/gns/gns_tld_api.c
  122. src/gns/gnunet-bcd.c
  123. src/gns/gnunet-dns2gns.c
  124. src/gns/gnunet-gns-benchmark.c
  125. -src/gns/gnunet-gns.c
  126. src/gns/gnunet-gns-helper-service-w32.c
  127. src/gns/gnunet-gns-import.c
  128. src/gns/gnunet-gns-proxy.c
  129. +src/gns/gnunet-gns.c
  130. src/gns/gnunet-service-gns.c
  131. src/gns/gnunet-service-gns_interceptor.c
  132. src/gns/gnunet-service-gns_resolver.c
  133. @@ -187,19 +187,19 @@ src/gns/nss/nss_gns.c
  134. src/gns/nss/nss_gns_query.c
  135. src/gns/plugin_block_gns.c
  136. src/gns/plugin_gnsrecord_gns.c
  137. +src/gns/w32nsp-install.c
  138. +src/gns/w32nsp-resolve.c
  139. +src/gns/w32nsp-uninstall.c
  140. +src/gns/w32nsp.c
  141. src/gnsrecord/gnsrecord.c
  142. src/gnsrecord/gnsrecord_crypto.c
  143. src/gnsrecord/gnsrecord_misc.c
  144. src/gnsrecord/gnsrecord_serialization.c
  145. src/gnsrecord/plugin_gnsrecord_dns.c
  146. -src/gns/w32nsp.c
  147. -src/gns/w32nsp-install.c
  148. -src/gns/w32nsp-resolve.c
  149. -src/gns/w32nsp-uninstall.c
  150. src/hello/address.c
  151. src/hello/gnunet-hello.c
  152. -src/hello/hello.c
  153. src/hello/hello-ng.c
  154. +src/hello/hello.c
  155. src/hostlist/gnunet-daemon-hostlist.c
  156. src/hostlist/gnunet-daemon-hostlist_client.c
  157. src/hostlist/gnunet-daemon-hostlist_server.c
  158. @@ -222,8 +222,8 @@ src/namecache/namecache_api.c
  159. src/namecache/plugin_namecache_flat.c
  160. src/namecache/plugin_namecache_postgres.c
  161. src/namecache/plugin_namecache_sqlite.c
  162. -src/namestore/gnunet-namestore.c
  163. src/namestore/gnunet-namestore-fcfsd.c
  164. +src/namestore/gnunet-namestore.c
  165. src/namestore/gnunet-service-namestore.c
  166. src/namestore/gnunet-zoneimport.c
  167. src/namestore/namestore_api.c
  168. @@ -238,10 +238,10 @@ src/nat-auto/gnunet-service-nat-auto.c
  169. src/nat-auto/gnunet-service-nat-auto_legacy.c
  170. src/nat-auto/nat_auto_api.c
  171. src/nat-auto/nat_auto_api_test.c
  172. -src/nat/gnunet-helper-nat-client.c
  173. src/nat/gnunet-helper-nat-client-windows.c
  174. -src/nat/gnunet-helper-nat-server.c
  175. +src/nat/gnunet-helper-nat-client.c
  176. src/nat/gnunet-helper-nat-server-windows.c
  177. +src/nat/gnunet-helper-nat-server.c
  178. src/nat/gnunet-nat.c
  179. src/nat/gnunet-service-nat.c
  180. src/nat/gnunet-service-nat_externalip.c
  181. @@ -250,16 +250,16 @@ src/nat/gnunet-service-nat_mini.c
  182. src/nat/gnunet-service-nat_stun.c
  183. src/nat/nat_api.c
  184. src/nat/nat_api_stun.c
  185. -src/nse/gnunet-nse.c
  186. src/nse/gnunet-nse-profiler.c
  187. +src/nse/gnunet-nse.c
  188. src/nse/gnunet-service-nse.c
  189. src/nse/nse_api.c
  190. src/nt/nt.c
  191. +src/peerinfo-tool/gnunet-peerinfo.c
  192. +src/peerinfo-tool/gnunet-peerinfo_plugins.c
  193. src/peerinfo/gnunet-service-peerinfo.c
  194. src/peerinfo/peerinfo_api.c
  195. src/peerinfo/peerinfo_api_notify.c
  196. -src/peerinfo-tool/gnunet-peerinfo.c
  197. -src/peerinfo-tool/gnunet-peerinfo_plugins.c
  198. src/peerstore/gnunet-peerstore.c
  199. src/peerstore/gnunet-service-peerstore.c
  200. src/peerstore/peerstore_api.c
  201. @@ -295,7 +295,6 @@ src/regex/regex_internal_dht.c
  202. src/regex/regex_test_graph.c
  203. src/regex/regex_test_lib.c
  204. src/regex/regex_test_random.c
  205. -src/rest/gnunet-rest-server.c
  206. src/rest-plugins/json_reclaim.c
  207. src/rest-plugins/oidc_helper.c
  208. src/rest-plugins/plugin_rest_copying.c
  209. @@ -306,27 +305,28 @@ src/rest-plugins/plugin_rest_namestore.c
  210. src/rest-plugins/plugin_rest_openid_connect.c
  211. src/rest-plugins/plugin_rest_peerinfo.c
  212. src/rest-plugins/plugin_rest_reclaim.c
  213. +src/rest/gnunet-rest-server.c
  214. src/rest/rest.c
  215. src/revocation/gnunet-revocation.c
  216. src/revocation/gnunet-service-revocation.c
  217. src/revocation/plugin_block_revocation.c
  218. src/revocation/revocation_api.c
  219. -src/rps/gnunet-rps.c
  220. src/rps/gnunet-rps-profiler.c
  221. +src/rps/gnunet-rps.c
  222. src/rps/gnunet-service-rps.c
  223. src/rps/gnunet-service-rps_custommap.c
  224. src/rps/gnunet-service-rps_sampler.c
  225. src/rps/gnunet-service-rps_sampler_elem.c
  226. src/rps/gnunet-service-rps_view.c
  227. -src/rps/rps_api.c
  228. src/rps/rps-sampler_client.c
  229. src/rps/rps-sampler_common.c
  230. src/rps/rps-test_util.c
  231. +src/rps/rps_api.c
  232. src/scalarproduct/gnunet-scalarproduct.c
  233. -src/scalarproduct/gnunet-service-scalarproduct_alice.c
  234. -src/scalarproduct/gnunet-service-scalarproduct_bob.c
  235. src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
  236. src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
  237. +src/scalarproduct/gnunet-service-scalarproduct_alice.c
  238. +src/scalarproduct/gnunet-service-scalarproduct_bob.c
  239. src/scalarproduct/scalarproduct_api.c
  240. src/secretsharing/gnunet-secretsharing-profiler.c
  241. src/secretsharing/gnunet-service-secretsharing.c
  242. @@ -352,15 +352,16 @@ src/statistics/gnunet-statistics.c
  243. src/statistics/statistics_api.c
  244. src/template/gnunet-service-template.c
  245. src/template/gnunet-template.c
  246. +src/testbed-logger/gnunet-service-testbed-logger.c
  247. +src/testbed-logger/testbed_logger_api.c
  248. src/testbed/generate-underlay-topology.c
  249. src/testbed/gnunet-daemon-latency-logger.c
  250. src/testbed/gnunet-daemon-testbed-blacklist.c
  251. src/testbed/gnunet-daemon-testbed-underlay.c
  252. src/testbed/gnunet-helper-testbed.c
  253. -src/testbed/gnunet_mpi_test.c
  254. src/testbed/gnunet-service-test-barriers.c
  255. -src/testbed/gnunet-service-testbed_barriers.c
  256. src/testbed/gnunet-service-testbed.c
  257. +src/testbed/gnunet-service-testbed_barriers.c
  258. src/testbed/gnunet-service-testbed_cache.c
  259. src/testbed/gnunet-service-testbed_connectionpool.c
  260. src/testbed/gnunet-service-testbed_cpustatus.c
  261. @@ -368,20 +369,19 @@ src/testbed/gnunet-service-testbed_links
  262. src/testbed/gnunet-service-testbed_meminfo.c
  263. src/testbed/gnunet-service-testbed_oc.c
  264. src/testbed/gnunet-service-testbed_peers.c
  265. -src/testbed/gnunet_testbed_mpi_spawn.c
  266. src/testbed/gnunet-testbed-profiler.c
  267. -src/testbed-logger/gnunet-service-testbed-logger.c
  268. -src/testbed-logger/testbed_logger_api.c
  269. -src/testbed/testbed_api_barriers.c
  270. +src/testbed/gnunet_mpi_test.c
  271. +src/testbed/gnunet_testbed_mpi_spawn.c
  272. src/testbed/testbed_api.c
  273. +src/testbed/testbed_api_barriers.c
  274. src/testbed/testbed_api_hosts.c
  275. src/testbed/testbed_api_operations.c
  276. src/testbed/testbed_api_peers.c
  277. src/testbed/testbed_api_sd.c
  278. src/testbed/testbed_api_services.c
  279. src/testbed/testbed_api_statistics.c
  280. -src/testbed/testbed_api_testbed.c
  281. src/testbed/testbed_api_test.c
  282. +src/testbed/testbed_api_testbed.c
  283. src/testbed/testbed_api_topology.c
  284. src/testbed/testbed_api_underlay.c
  285. src/testing/gnunet-testing.c
  286. @@ -393,29 +393,29 @@ src/transport/gnunet-communicator-tcp.c
  287. src/transport/gnunet-communicator-udp.c
  288. src/transport/gnunet-communicator-unix.c
  289. src/transport/gnunet-helper-transport-bluetooth.c
  290. -src/transport/gnunet-helper-transport-wlan.c
  291. src/transport/gnunet-helper-transport-wlan-dummy.c
  292. +src/transport/gnunet-helper-transport-wlan.c
  293. src/transport/gnunet-service-tng.c
  294. -src/transport/gnunet-service-transport_ats.c
  295. src/transport/gnunet-service-transport.c
  296. +src/transport/gnunet-service-transport_ats.c
  297. src/transport/gnunet-service-transport_hello.c
  298. src/transport/gnunet-service-transport_manipulation.c
  299. src/transport/gnunet-service-transport_neighbours.c
  300. src/transport/gnunet-service-transport_plugins.c
  301. src/transport/gnunet-service-transport_validation.c
  302. -src/transport/gnunet-transport.c
  303. src/transport/gnunet-transport-certificate-creation.c
  304. src/transport/gnunet-transport-profiler.c
  305. src/transport/gnunet-transport-wlan-receiver.c
  306. src/transport/gnunet-transport-wlan-sender.c
  307. +src/transport/gnunet-transport.c
  308. src/transport/plugin_transport_http_client.c
  309. src/transport/plugin_transport_http_common.c
  310. src/transport/plugin_transport_http_server.c
  311. src/transport/plugin_transport_smtp.c
  312. src/transport/plugin_transport_tcp.c
  313. src/transport/plugin_transport_template.c
  314. -src/transport/plugin_transport_udp_broadcasting.c
  315. src/transport/plugin_transport_udp.c
  316. +src/transport/plugin_transport_udp_broadcasting.c
  317. src/transport/plugin_transport_unix.c
  318. src/transport/plugin_transport_wlan.c
  319. src/transport/plugin_transport_xt.c
  320. @@ -424,6 +424,11 @@ src/transport/tcp_connection_legacy.c
  321. src/transport/tcp_server_legacy.c
  322. src/transport/tcp_server_mst_legacy.c
  323. src/transport/tcp_service_legacy.c
  324. +src/transport/transport-testing-filenames.c
  325. +src/transport/transport-testing-loggers.c
  326. +src/transport/transport-testing-main.c
  327. +src/transport/transport-testing-send.c
  328. +src/transport/transport-testing.c
  329. src/transport/transport_api2_address.c
  330. src/transport/transport_api2_communication.c
  331. src/transport/transport_api2_core.c
  332. @@ -436,11 +441,6 @@ src/transport/transport_api_manipulation
  333. src/transport/transport_api_monitor_peers.c
  334. src/transport/transport_api_monitor_plugins.c
  335. src/transport/transport_api_offer_hello.c
  336. -src/transport/transport-testing.c
  337. -src/transport/transport-testing-filenames.c
  338. -src/transport/transport-testing-loggers.c
  339. -src/transport/transport-testing-main.c
  340. -src/transport/transport-testing-send.c
  341. src/util/bandwidth.c
  342. src/util/benchmark.c
  343. src/util/bio.c
  344. @@ -453,8 +453,8 @@ src/util/configuration_loader.c
  345. src/util/container_bloomfilter.c
  346. src/util/container_heap.c
  347. src/util/container_meta_data.c
  348. -src/util/container_multihashmap32.c
  349. src/util/container_multihashmap.c
  350. +src/util/container_multihashmap32.c
  351. src/util/container_multipeermap.c
  352. src/util/container_multishortmap.c
  353. src/util/crypto_abe.c
  354. @@ -476,15 +476,15 @@ src/util/dnsparser.c
  355. src/util/dnsstub.c
  356. src/util/getopt.c
  357. src/util/getopt_helpers.c
  358. -src/util/gnunet-config.c
  359. src/util/gnunet-config-diff.c
  360. +src/util/gnunet-config.c
  361. src/util/gnunet-ecc.c
  362. src/util/gnunet-helper-w32-console.c
  363. src/util/gnunet-resolver.c
  364. src/util/gnunet-scrypt.c
  365. src/util/gnunet-service-resolver.c
  366. -src/util/gnunet-timeout.c
  367. src/util/gnunet-timeout-w32.c
  368. +src/util/gnunet-timeout.c
  369. src/util/gnunet-uri.c
  370. src/util/helper.c
  371. src/util/load.c
  372. @@ -513,13 +513,13 @@ src/util/tun.c
  373. src/util/w32cat.c
  374. src/util/win.c
  375. src/util/winproc.c
  376. -src/vpn/gnunet-helper-vpn.c
  377. src/vpn/gnunet-helper-vpn-windows.c
  378. +src/vpn/gnunet-helper-vpn.c
  379. src/vpn/gnunet-service-vpn.c
  380. src/vpn/gnunet-vpn.c
  381. src/vpn/vpn_api.c
  382. -src/zonemaster/gnunet-service-zonemaster.c
  383. src/zonemaster/gnunet-service-zonemaster-monitor.c
  384. +src/zonemaster/gnunet-service-zonemaster.c
  385. src/fs/fs_api.h
  386. src/include/compat.h
  387. src/include/gnunet_common.h
  388. --- a/src/include/Makefile.am
  389. +++ b/src/include/Makefile.am
  390. @@ -47,6 +47,7 @@ gnunetinclude_HEADERS = \
  391. gnunet_container_lib.h \
  392. gnunet_conversation_service.h \
  393. gnunet_core_service.h \
  394. + gnunet_credential_service.h \
  395. gnunet_crypto_lib.h \
  396. gnunet_curl_lib.h \
  397. gnunet_datacache_lib.h \
  398. --- /dev/null
  399. +++ b/src/include/gnunet_credential_service.h
  400. @@ -0,0 +1,375 @@
  401. +/*
  402. + This file is part of GNUnet
  403. + Copyright (C) 2012-2014 GNUnet e.V.
  404. +
  405. + GNUnet is free software: you can redistribute it and/or modify it
  406. + under the terms of the GNU Affero General Public License as published
  407. + by the Free Software Foundation, either version 3 of the License,
  408. + or (at your option) any later version.
  409. +
  410. + GNUnet is distributed in the hope that it will be useful, but
  411. + WITHOUT ANY WARRANTY; without even the implied warranty of
  412. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  413. + Affero General Public License for more details.
  414. +
  415. + You should have received a copy of the GNU Affero General Public License
  416. + along with this program. If not, see <http://www.gnu.org/licenses/>.
  417. +
  418. + SPDX-License-Identifier: AGPL3.0-or-later
  419. + */
  420. +
  421. +/**
  422. + * @author Martin Schanzenbach
  423. + *
  424. + * @file
  425. + * API to the Credential service
  426. + *
  427. + * @defgroup credential Credential service
  428. + * Credentials
  429. + *
  430. + * @{
  431. + */
  432. +#ifndef GNUNET_CREDENTIAL_SERVICE_H
  433. +#define GNUNET_CREDENTIAL_SERVICE_H
  434. +
  435. +#include "gnunet_util_lib.h"
  436. +#include "gnunet_gns_service.h"
  437. +#include "gnunet_identity_service.h"
  438. +
  439. +#ifdef __cplusplus
  440. +extern "C"
  441. +{
  442. +#if 0 /* keep Emacsens' auto-indent happy */
  443. +}
  444. +#endif
  445. +#endif
  446. +
  447. +
  448. +/**
  449. + * Connection to the Credential service.
  450. + */
  451. +struct GNUNET_CREDENTIAL_Handle;
  452. +
  453. +/**
  454. + * Handle to control a lookup operation.
  455. + */
  456. +struct GNUNET_CREDENTIAL_Request;
  457. +
  458. +/*
  459. +* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
  460. +*/
  461. +enum GNUNET_CREDENTIAL_CredentialFlags {
  462. +
  463. + //Subject had credentials before, but have been revoked now
  464. + GNUNET_CREDENTIAL_FLAG_REVOKED=0,
  465. +
  466. + //Subject flag indicates that the subject is a holder of this credential and may present it as such
  467. + GNUNET_CREDENTIAL_FLAG_SUBJECT=1,
  468. +
  469. + //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
  470. + GNUNET_CREDENTIAL_FLAG_ISSUER=2
  471. +
  472. +};
  473. +
  474. +GNUNET_NETWORK_STRUCT_BEGIN
  475. +/**
  476. + * The attribute delegation record
  477. + */
  478. +struct GNUNET_CREDENTIAL_DelegationRecord {
  479. +
  480. + /**
  481. + * Number of delegation sets in this record
  482. + */
  483. + uint32_t set_count;
  484. +
  485. + /**
  486. + * Length of delegation sets
  487. + */
  488. + uint64_t data_size;
  489. + /**
  490. + * Followed by set_count DelegationSetRecords
  491. + *
  492. + */
  493. +};
  494. +
  495. +/**
  496. + * The attribute delegation record
  497. + */
  498. +struct GNUNET_CREDENTIAL_DelegationRecordSet {
  499. +
  500. + /**
  501. + * Public key of the subject this attribute was delegated to
  502. + */
  503. + struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
  504. +
  505. + /**
  506. + * Length of attribute, may be 0
  507. + */
  508. + uint32_t subject_attribute_len;
  509. +};
  510. +
  511. +
  512. +GNUNET_NETWORK_STRUCT_END
  513. +
  514. +/**
  515. + * The attribute delegation record
  516. + */
  517. +struct GNUNET_CREDENTIAL_DelegationSet {
  518. +
  519. + /**
  520. + * Public key of the subject this attribute was delegated to
  521. + */
  522. + struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
  523. +
  524. + uint32_t subject_attribute_len;
  525. +
  526. + /**
  527. + * The subject attribute
  528. + */
  529. + const char *subject_attribute;
  530. +};
  531. +
  532. +
  533. +/**
  534. + * A delegation
  535. + */
  536. +struct GNUNET_CREDENTIAL_Delegation {
  537. +
  538. + /**
  539. + * The issuer of the delegation
  540. + */
  541. + struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
  542. +
  543. + /**
  544. + * Public key of the subject this attribute was delegated to
  545. + */
  546. + struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
  547. +
  548. + /**
  549. + * Length of the attribute
  550. + */
  551. + uint32_t issuer_attribute_len;
  552. +
  553. + /**
  554. + * The attribute
  555. + */
  556. + const char *issuer_attribute;
  557. +
  558. + /**
  559. + * Length of the attribute
  560. + */
  561. + uint32_t subject_attribute_len;
  562. +
  563. + /**
  564. + * The attribute
  565. + */
  566. + const char *subject_attribute;
  567. +};
  568. +
  569. +
  570. +/**
  571. + * A credential
  572. + */
  573. +struct GNUNET_CREDENTIAL_Credential {
  574. +
  575. + /**
  576. + * The issuer of the credential
  577. + */
  578. + struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
  579. +
  580. + /**
  581. + * Public key of the subject this credential was issued to
  582. + */
  583. + struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
  584. +
  585. + /**
  586. + * Signature of this credential
  587. + */
  588. + struct GNUNET_CRYPTO_EcdsaSignature signature;
  589. +
  590. + /**
  591. + * Expiration of this credential
  592. + */
  593. + struct GNUNET_TIME_Absolute expiration;
  594. +
  595. + /**
  596. + * Length of the attribute
  597. + */
  598. + uint32_t issuer_attribute_len;
  599. +
  600. + /**
  601. + * The attribute
  602. + */
  603. + const char *issuer_attribute;
  604. +
  605. +};
  606. +
  607. +
  608. +
  609. +/**
  610. + * Initialize the connection with the Credential service.
  611. + *
  612. + * @param cfg configuration to use
  613. + * @return handle to the Credential service, or NULL on error
  614. + */
  615. +struct GNUNET_CREDENTIAL_Handle *
  616. +GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
  617. +
  618. +
  619. +/**
  620. + * Shutdown connection with the Credentail service.
  621. + *
  622. + * @param handle connection to shut down
  623. + */
  624. +void
  625. +GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
  626. +
  627. +
  628. +/**
  629. + * Iterator called on obtained result for an attribute verification.
  630. + *
  631. + * @param cls closure
  632. + * @param d_count the number of delegations processed
  633. + * @param delegation_chain the delegations processed
  634. + * @param c_count the number of credentials found
  635. + * @param credential the credentials
  636. + */
  637. +typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls,
  638. + unsigned int d_count,
  639. + struct GNUNET_CREDENTIAL_Delegation *delegation_chain,
  640. + unsigned int c_count,
  641. + struct GNUNET_CREDENTIAL_Credential *credential);
  642. +
  643. +/**
  644. + * Iterator called on obtained result for an attribute delegation.
  645. + *
  646. + * @param cls closure
  647. + * @param success GNUNET_YES if successful
  648. + * @param result the record data that can be handed to the subject
  649. + */
  650. +typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
  651. + uint32_t success);
  652. +
  653. +/**
  654. + * Iterator called on obtained result for an attribute delegation removal.
  655. + *
  656. + * @param cls closure
  657. + * @param success GNUNET_YES if successful
  658. + * @param result the record data that can be handed to the subject
  659. + */
  660. +typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
  661. + uint32_t success);
  662. +
  663. +
  664. +/**
  665. + * Performs attribute verification.
  666. + * Checks if there is a delegation chain from
  667. + * attribute ``issuer_attribute'' issued by the issuer
  668. + * with public key ``issuer_key'' maps to the attribute
  669. + * ``subject_attribute'' claimed by the subject with key
  670. + * ``subject_key''
  671. + *
  672. + * @param handle handle to the Credential service
  673. + * @param issuer_key the issuer public key
  674. + * @param issuer_attribute the issuer attribute
  675. + * @param subject_key the subject public key
  676. + * @param credential_count number of credentials
  677. + * @param credentials the subject credentials
  678. + * @param proc function to call on result
  679. + * @param proc_cls closure for processor
  680. + * @return handle to the queued request
  681. + */
  682. +struct GNUNET_CREDENTIAL_Request*
  683. +GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
  684. + const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
  685. + const char *issuer_attribute,
  686. + const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
  687. + uint32_t credential_count,
  688. + const struct GNUNET_CREDENTIAL_Credential *credentials,
  689. + GNUNET_CREDENTIAL_CredentialResultProcessor proc,
  690. + void *proc_cls);
  691. +
  692. +struct GNUNET_CREDENTIAL_Request*
  693. +GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
  694. + const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
  695. + const char *issuer_attribute,
  696. + const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
  697. + GNUNET_CREDENTIAL_CredentialResultProcessor proc,
  698. + void *proc_cls);
  699. +
  700. +/**
  701. + * Delegate an attribute
  702. + *
  703. + * @param handle handle to the Credential service
  704. + * @param issuer the ego that should be used to delegate the attribute
  705. + * @param attribute the name of the attribute to delegate
  706. + * @param subject the subject of the delegation
  707. + * @param delegated_attribute the name of the attribute that is delegated to
  708. + * @param proc the result callback
  709. + * @param proc_cls the result closure context
  710. + * @return handle to the queued request
  711. + */
  712. +struct GNUNET_CREDENTIAL_Request *
  713. +GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
  714. + struct GNUNET_IDENTITY_Ego *issuer,
  715. + const char *attribute,
  716. + struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
  717. + const char *delegated_attribute,
  718. + GNUNET_CREDENTIAL_DelegateResultProcessor proc,
  719. + void *proc_cls);
  720. +
  721. +/**
  722. + * Remove a delegation
  723. + *
  724. + * @param handle handle to the Credential service
  725. + * @param issuer the ego that was used to delegate the attribute
  726. + * @param attribute the name of the attribute that is delegated
  727. + * @param proc the callback
  728. + * @param proc_cls callback closure
  729. + * @return handle to the queued request
  730. + */
  731. +struct GNUNET_CREDENTIAL_Request *
  732. +GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
  733. + struct GNUNET_IDENTITY_Ego *issuer,
  734. + const char *attribute,
  735. + GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc,
  736. + void *proc_cls);
  737. +
  738. +
  739. +
  740. +/**
  741. + * Issue an attribute to a subject
  742. + *
  743. + * @param issuer the ego that should be used to issue the attribute
  744. + * @param subject the subject of the attribute
  745. + * @param attribute the name of the attribute
  746. + * @param expiration the TTL of the credential
  747. + * @return handle to the queued request
  748. + */
  749. +struct GNUNET_CREDENTIAL_Credential*
  750. +GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
  751. + struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
  752. + const char *attribute,
  753. + struct GNUNET_TIME_Absolute *expiration);
  754. +
  755. +
  756. +
  757. +/**
  758. + * Cancel pending lookup request
  759. + *
  760. + * @param lr the lookup request to cancel
  761. + */
  762. +void
  763. +GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr);
  764. +
  765. +
  766. +#if 0 /* keep Emacsens' auto-indent happy */
  767. +{
  768. +#endif
  769. +#ifdef __cplusplus
  770. +}
  771. +#endif
  772. +
  773. +#endif
  774. +
  775. +/** @} */ /* end of group */