diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-16 18:48:04 +0200 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-16 18:48:04 +0200 |
commit | 1940b899b3620786b0265144ab756a3f05bcc8b0 (patch) | |
tree | 92e16378a5b6f6211bf937597b429b6c092b04bb | |
parent | 5ef8d3c6cbe7970bc9c9e54b4ab23c8727200b15 (diff) | |
download | gnunet-1940b899b3620786b0265144ab756a3f05bcc8b0.tar.gz gnunet-1940b899b3620786b0265144ab756a3f05bcc8b0.zip |
start zklaim service
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | po/POTFILES.in | 125 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 5 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_attribute_lib.h | 6 | ||||
-rw-r--r-- | src/zklaim/Makefile.am | 47 | ||||
-rw-r--r-- | src/zklaim/plugin_reclaim_attribute_zklaim.c | 181 | ||||
-rw-r--r-- | src/zklaim/zklaim_api.c | 433 | ||||
-rw-r--r-- | src/zklaim/zklaim_api.h | 90 |
9 files changed, 823 insertions, 66 deletions
diff --git a/configure.ac b/configure.ac index 91a2f5227..53539cbb0 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1772,6 +1772,7 @@ src/rest-plugins/Makefile | |||
1772 | src/abe/Makefile | 1772 | src/abe/Makefile |
1773 | src/reclaim-attribute/Makefile | 1773 | src/reclaim-attribute/Makefile |
1774 | src/reclaim/Makefile | 1774 | src/reclaim/Makefile |
1775 | src/zklaim/Makefile | ||
1775 | pkgconfig/Makefile | 1776 | pkgconfig/Makefile |
1776 | pkgconfig/gnunetarm.pc | 1777 | pkgconfig/gnunetarm.pc |
1777 | pkgconfig/gnunetats.pc | 1778 | pkgconfig/gnunetats.pc |
diff --git a/po/POTFILES.in b/po/POTFILES.in index a0fbfc6a1..a18d114ed 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in | |||
@@ -4,13 +4,21 @@ src/arm/arm_monitor_api.c | |||
4 | src/arm/gnunet-arm.c | 4 | src/arm/gnunet-arm.c |
5 | src/arm/gnunet-service-arm.c | 5 | src/arm/gnunet-service-arm.c |
6 | src/arm/mockup-service.c | 6 | src/arm/mockup-service.c |
7 | src/ats-tests/ats-testing-experiment.c | ||
8 | src/ats-tests/ats-testing-log.c | ||
9 | src/ats-tests/ats-testing-preferences.c | ||
10 | src/ats-tests/ats-testing-traffic.c | ||
11 | src/ats-tests/ats-testing.c | ||
12 | src/ats-tests/gnunet-ats-sim.c | ||
13 | src/ats-tests/gnunet-solver-eval.c | ||
14 | src/ats-tool/gnunet-ats.c | ||
7 | src/ats/ats_api_connectivity.c | 15 | src/ats/ats_api_connectivity.c |
8 | src/ats/ats_api_performance.c | 16 | src/ats/ats_api_performance.c |
9 | src/ats/ats_api_scanner.c | 17 | src/ats/ats_api_scanner.c |
10 | src/ats/ats_api_scheduling.c | 18 | src/ats/ats_api_scheduling.c |
11 | src/ats/gnunet-ats-solver-eval.c | 19 | src/ats/gnunet-ats-solver-eval.c |
12 | src/ats/gnunet-service-ats_addresses.c | ||
13 | src/ats/gnunet-service-ats.c | 20 | src/ats/gnunet-service-ats.c |
21 | src/ats/gnunet-service-ats_addresses.c | ||
14 | src/ats/gnunet-service-ats_connectivity.c | 22 | src/ats/gnunet-service-ats_connectivity.c |
15 | src/ats/gnunet-service-ats_normalization.c | 23 | src/ats/gnunet-service-ats_normalization.c |
16 | src/ats/gnunet-service-ats_performance.c | 24 | src/ats/gnunet-service-ats_performance.c |
@@ -21,14 +29,6 @@ src/ats/gnunet-service-ats_scheduling.c | |||
21 | src/ats/plugin_ats_mlp.c | 29 | src/ats/plugin_ats_mlp.c |
22 | src/ats/plugin_ats_proportional.c | 30 | src/ats/plugin_ats_proportional.c |
23 | src/ats/plugin_ats_ril.c | 31 | src/ats/plugin_ats_ril.c |
24 | src/ats-tests/ats-testing.c | ||
25 | src/ats-tests/ats-testing-experiment.c | ||
26 | src/ats-tests/ats-testing-log.c | ||
27 | src/ats-tests/ats-testing-preferences.c | ||
28 | src/ats-tests/ats-testing-traffic.c | ||
29 | src/ats-tests/gnunet-ats-sim.c | ||
30 | src/ats-tests/gnunet-solver-eval.c | ||
31 | src/ats-tool/gnunet-ats.c | ||
32 | src/auction/gnunet-auction-create.c | 32 | src/auction/gnunet-auction-create.c |
33 | src/auction/gnunet-auction-info.c | 33 | src/auction/gnunet-auction-info.c |
34 | src/auction/gnunet-auction-join.c | 34 | src/auction/gnunet-auction-join.c |
@@ -40,8 +40,8 @@ src/block/plugin_block_test.c | |||
40 | src/cadet/cadet_api.c | 40 | src/cadet/cadet_api.c |
41 | src/cadet/cadet_test_lib.c | 41 | src/cadet/cadet_test_lib.c |
42 | src/cadet/desirability_table.c | 42 | src/cadet/desirability_table.c |
43 | src/cadet/gnunet-cadet.c | ||
44 | src/cadet/gnunet-cadet-profiler.c | 43 | src/cadet/gnunet-cadet-profiler.c |
44 | src/cadet/gnunet-cadet.c | ||
45 | src/cadet/gnunet-service-cadet.c | 45 | src/cadet/gnunet-service-cadet.c |
46 | src/cadet/gnunet-service-cadet_channel.c | 46 | src/cadet/gnunet-service-cadet_channel.c |
47 | src/cadet/gnunet-service-cadet_connection.c | 47 | src/cadet/gnunet-service-cadet_connection.c |
@@ -57,15 +57,15 @@ src/consensus/gnunet-service-consensus.c | |||
57 | src/consensus/plugin_block_consensus.c | 57 | src/consensus/plugin_block_consensus.c |
58 | src/conversation/conversation_api.c | 58 | src/conversation/conversation_api.c |
59 | src/conversation/conversation_api_call.c | 59 | src/conversation/conversation_api_call.c |
60 | src/conversation/gnunet-conversation.c | ||
61 | src/conversation/gnunet-conversation-test.c | 60 | src/conversation/gnunet-conversation-test.c |
62 | src/conversation/gnunet_gst.c | 61 | src/conversation/gnunet-conversation.c |
63 | src/conversation/gnunet_gst_test.c | ||
64 | src/conversation/gnunet-helper-audio-playback.c | ||
65 | src/conversation/gnunet-helper-audio-playback-gst.c | 62 | src/conversation/gnunet-helper-audio-playback-gst.c |
66 | src/conversation/gnunet-helper-audio-record.c | 63 | src/conversation/gnunet-helper-audio-playback.c |
67 | src/conversation/gnunet-helper-audio-record-gst.c | 64 | src/conversation/gnunet-helper-audio-record-gst.c |
65 | src/conversation/gnunet-helper-audio-record.c | ||
68 | src/conversation/gnunet-service-conversation.c | 66 | src/conversation/gnunet-service-conversation.c |
67 | src/conversation/gnunet_gst.c | ||
68 | src/conversation/gnunet_gst_test.c | ||
69 | src/conversation/microphone.c | 69 | src/conversation/microphone.c |
70 | src/conversation/plugin_gnsrecord_conversation.c | 70 | src/conversation/plugin_gnsrecord_conversation.c |
71 | src/conversation/speaker.c | 71 | src/conversation/speaker.c |
@@ -102,7 +102,6 @@ src/dht/dht_api.c | |||
102 | src/dht/dht_test_lib.c | 102 | src/dht/dht_test_lib.c |
103 | src/dht/gnunet-dht-get.c | 103 | src/dht/gnunet-dht-get.c |
104 | src/dht/gnunet-dht-monitor.c | 104 | src/dht/gnunet-dht-monitor.c |
105 | src/dht/gnunet_dht_profiler.c | ||
106 | src/dht/gnunet-dht-put.c | 105 | src/dht/gnunet-dht-put.c |
107 | src/dht/gnunet-service-dht.c | 106 | src/dht/gnunet-service-dht.c |
108 | src/dht/gnunet-service-dht_clients.c | 107 | src/dht/gnunet-service-dht_clients.c |
@@ -111,6 +110,7 @@ src/dht/gnunet-service-dht_hello.c | |||
111 | src/dht/gnunet-service-dht_neighbours.c | 110 | src/dht/gnunet-service-dht_neighbours.c |
112 | src/dht/gnunet-service-dht_nse.c | 111 | src/dht/gnunet-service-dht_nse.c |
113 | src/dht/gnunet-service-dht_routing.c | 112 | src/dht/gnunet-service-dht_routing.c |
113 | src/dht/gnunet_dht_profiler.c | ||
114 | src/dht/plugin_block_dht.c | 114 | src/dht/plugin_block_dht.c |
115 | src/dns/dns_api.c | 115 | src/dns/dns_api.c |
116 | src/dns/gnunet-dns-monitor.c | 116 | src/dns/gnunet-dns-monitor.c |
@@ -124,8 +124,8 @@ src/dv/gnunet-dv.c | |||
124 | src/dv/gnunet-service-dv.c | 124 | src/dv/gnunet-service-dv.c |
125 | src/dv/plugin_transport_dv.c | 125 | src/dv/plugin_transport_dv.c |
126 | src/exit/gnunet-daemon-exit.c | 126 | src/exit/gnunet-daemon-exit.c |
127 | src/exit/gnunet-helper-exit.c | ||
128 | src/exit/gnunet-helper-exit-windows.c | 127 | src/exit/gnunet-helper-exit-windows.c |
128 | src/exit/gnunet-helper-exit.c | ||
129 | src/fragmentation/defragmentation.c | 129 | src/fragmentation/defragmentation.c |
130 | src/fragmentation/fragmentation.c | 130 | src/fragmentation/fragmentation.c |
131 | src/fs/fs_api.c | 131 | src/fs/fs_api.c |
@@ -150,8 +150,8 @@ src/fs/gnunet-auto-share.c | |||
150 | src/fs/gnunet-daemon-fsprofiler.c | 150 | src/fs/gnunet-daemon-fsprofiler.c |
151 | src/fs/gnunet-directory.c | 151 | src/fs/gnunet-directory.c |
152 | src/fs/gnunet-download.c | 152 | src/fs/gnunet-download.c |
153 | src/fs/gnunet-fs.c | ||
154 | src/fs/gnunet-fs-profiler.c | 153 | src/fs/gnunet-fs-profiler.c |
154 | src/fs/gnunet-fs.c | ||
155 | src/fs/gnunet-helper-fs-publish.c | 155 | src/fs/gnunet-helper-fs-publish.c |
156 | src/fs/gnunet-publish.c | 156 | src/fs/gnunet-publish.c |
157 | src/fs/gnunet-search.c | 157 | src/fs/gnunet-search.c |
@@ -171,10 +171,10 @@ src/gns/gns_tld_api.c | |||
171 | src/gns/gnunet-bcd.c | 171 | src/gns/gnunet-bcd.c |
172 | src/gns/gnunet-dns2gns.c | 172 | src/gns/gnunet-dns2gns.c |
173 | src/gns/gnunet-gns-benchmark.c | 173 | src/gns/gnunet-gns-benchmark.c |
174 | src/gns/gnunet-gns.c | ||
175 | src/gns/gnunet-gns-helper-service-w32.c | 174 | src/gns/gnunet-gns-helper-service-w32.c |
176 | src/gns/gnunet-gns-import.c | 175 | src/gns/gnunet-gns-import.c |
177 | src/gns/gnunet-gns-proxy.c | 176 | src/gns/gnunet-gns-proxy.c |
177 | src/gns/gnunet-gns.c | ||
178 | src/gns/gnunet-service-gns.c | 178 | src/gns/gnunet-service-gns.c |
179 | src/gns/gnunet-service-gns_interceptor.c | 179 | src/gns/gnunet-service-gns_interceptor.c |
180 | src/gns/gnunet-service-gns_resolver.c | 180 | src/gns/gnunet-service-gns_resolver.c |
@@ -182,16 +182,15 @@ src/gns/nss/nss_gns.c | |||
182 | src/gns/nss/nss_gns_query.c | 182 | src/gns/nss/nss_gns_query.c |
183 | src/gns/plugin_block_gns.c | 183 | src/gns/plugin_block_gns.c |
184 | src/gns/plugin_gnsrecord_gns.c | 184 | src/gns/plugin_gnsrecord_gns.c |
185 | src/gns/plugin_rest_gns.c | 185 | src/gns/w32nsp-install.c |
186 | src/gns/w32nsp-resolve.c | ||
187 | src/gns/w32nsp-uninstall.c | ||
188 | src/gns/w32nsp.c | ||
186 | src/gnsrecord/gnsrecord.c | 189 | src/gnsrecord/gnsrecord.c |
187 | src/gnsrecord/gnsrecord_crypto.c | 190 | src/gnsrecord/gnsrecord_crypto.c |
188 | src/gnsrecord/gnsrecord_misc.c | 191 | src/gnsrecord/gnsrecord_misc.c |
189 | src/gnsrecord/gnsrecord_serialization.c | 192 | src/gnsrecord/gnsrecord_serialization.c |
190 | src/gnsrecord/plugin_gnsrecord_dns.c | 193 | src/gnsrecord/plugin_gnsrecord_dns.c |
191 | src/gns/w32nsp.c | ||
192 | src/gns/w32nsp-install.c | ||
193 | src/gns/w32nsp-resolve.c | ||
194 | src/gns/w32nsp-uninstall.c | ||
195 | src/hello/address.c | 194 | src/hello/address.c |
196 | src/hello/gnunet-hello.c | 195 | src/hello/gnunet-hello.c |
197 | src/hello/hello.c | 196 | src/hello/hello.c |
@@ -202,17 +201,17 @@ src/identity/gnunet-identity.c | |||
202 | src/identity/gnunet-service-identity.c | 201 | src/identity/gnunet-service-identity.c |
203 | src/identity/identity_api.c | 202 | src/identity/identity_api.c |
204 | src/identity/identity_api_lookup.c | 203 | src/identity/identity_api_lookup.c |
205 | src/identity/plugin_rest_identity.c | ||
206 | src/jsonapi/jsonapi.c | ||
207 | src/jsonapi/jsonapi_document.c | ||
208 | src/jsonapi/jsonapi_error.c | ||
209 | src/jsonapi/jsonapi_relationship.c | ||
210 | src/jsonapi/jsonapi_resource.c | ||
211 | src/json/json.c | 204 | src/json/json.c |
212 | src/json/json_generator.c | 205 | src/json/json_generator.c |
213 | src/json/json_gnsrecord.c | 206 | src/json/json_gnsrecord.c |
214 | src/json/json_helper.c | 207 | src/json/json_helper.c |
215 | src/json/json_mhd.c | 208 | src/json/json_mhd.c |
209 | src/jsonapi/jsonapi.c | ||
210 | src/jsonapi/jsonapi_document.c | ||
211 | src/jsonapi/jsonapi_error.c | ||
212 | src/jsonapi/jsonapi_relationship.c | ||
213 | src/jsonapi/jsonapi_resource.c | ||
214 | src/jsonapi/plugin_rest_reclaim.c | ||
216 | src/multicast/gnunet-multicast.c | 215 | src/multicast/gnunet-multicast.c |
217 | src/multicast/gnunet-service-multicast.c | 216 | src/multicast/gnunet-service-multicast.c |
218 | src/multicast/multicast_api.c | 217 | src/multicast/multicast_api.c |
@@ -226,8 +225,8 @@ src/namecache/namecache_api.c | |||
226 | src/namecache/plugin_namecache_flat.c | 225 | src/namecache/plugin_namecache_flat.c |
227 | src/namecache/plugin_namecache_postgres.c | 226 | src/namecache/plugin_namecache_postgres.c |
228 | src/namecache/plugin_namecache_sqlite.c | 227 | src/namecache/plugin_namecache_sqlite.c |
229 | src/namestore/gnunet-namestore.c | ||
230 | src/namestore/gnunet-namestore-fcfsd.c | 228 | src/namestore/gnunet-namestore-fcfsd.c |
229 | src/namestore/gnunet-namestore.c | ||
231 | src/namestore/gnunet-service-namestore.c | 230 | src/namestore/gnunet-service-namestore.c |
232 | src/namestore/gnunet-zoneimport.c | 231 | src/namestore/gnunet-zoneimport.c |
233 | src/namestore/namestore_api.c | 232 | src/namestore/namestore_api.c |
@@ -242,10 +241,10 @@ src/nat-auto/gnunet-service-nat-auto.c | |||
242 | src/nat-auto/gnunet-service-nat-auto_legacy.c | 241 | src/nat-auto/gnunet-service-nat-auto_legacy.c |
243 | src/nat-auto/nat_auto_api.c | 242 | src/nat-auto/nat_auto_api.c |
244 | src/nat-auto/nat_auto_api_test.c | 243 | src/nat-auto/nat_auto_api_test.c |
245 | src/nat/gnunet-helper-nat-client.c | ||
246 | src/nat/gnunet-helper-nat-client-windows.c | 244 | src/nat/gnunet-helper-nat-client-windows.c |
247 | src/nat/gnunet-helper-nat-server.c | 245 | src/nat/gnunet-helper-nat-client.c |
248 | src/nat/gnunet-helper-nat-server-windows.c | 246 | src/nat/gnunet-helper-nat-server-windows.c |
247 | src/nat/gnunet-helper-nat-server.c | ||
249 | src/nat/gnunet-nat.c | 248 | src/nat/gnunet-nat.c |
250 | src/nat/gnunet-service-nat.c | 249 | src/nat/gnunet-service-nat.c |
251 | src/nat/gnunet-service-nat_externalip.c | 250 | src/nat/gnunet-service-nat_externalip.c |
@@ -254,15 +253,15 @@ src/nat/gnunet-service-nat_mini.c | |||
254 | src/nat/gnunet-service-nat_stun.c | 253 | src/nat/gnunet-service-nat_stun.c |
255 | src/nat/nat_api.c | 254 | src/nat/nat_api.c |
256 | src/nat/nat_api_stun.c | 255 | src/nat/nat_api_stun.c |
257 | src/nse/gnunet-nse.c | ||
258 | src/nse/gnunet-nse-profiler.c | 256 | src/nse/gnunet-nse-profiler.c |
257 | src/nse/gnunet-nse.c | ||
259 | src/nse/gnunet-service-nse.c | 258 | src/nse/gnunet-service-nse.c |
260 | src/nse/nse_api.c | 259 | src/nse/nse_api.c |
260 | src/peerinfo-tool/gnunet-peerinfo.c | ||
261 | src/peerinfo-tool/gnunet-peerinfo_plugins.c | ||
261 | src/peerinfo/gnunet-service-peerinfo.c | 262 | src/peerinfo/gnunet-service-peerinfo.c |
262 | src/peerinfo/peerinfo_api.c | 263 | src/peerinfo/peerinfo_api.c |
263 | src/peerinfo/peerinfo_api_notify.c | 264 | src/peerinfo/peerinfo_api_notify.c |
264 | src/peerinfo-tool/gnunet-peerinfo.c | ||
265 | src/peerinfo-tool/gnunet-peerinfo_plugins.c | ||
266 | src/peerstore/gnunet-peerstore.c | 265 | src/peerstore/gnunet-peerstore.c |
267 | src/peerstore/gnunet-service-peerstore.c | 266 | src/peerstore/gnunet-service-peerstore.c |
268 | src/peerstore/peerstore_api.c | 267 | src/peerstore/peerstore_api.c |
@@ -292,7 +291,6 @@ src/reclaim-attribute/reclaim_attribute.c | |||
292 | src/reclaim/gnunet-reclaim.c | 291 | src/reclaim/gnunet-reclaim.c |
293 | src/reclaim/gnunet-service-reclaim.c | 292 | src/reclaim/gnunet-service-reclaim.c |
294 | src/reclaim/jwt.c | 293 | src/reclaim/jwt.c |
295 | src/reclaim/oidc_helper.c | ||
296 | src/reclaim/plugin_gnsrecord_reclaim.c | 294 | src/reclaim/plugin_gnsrecord_reclaim.c |
297 | src/reclaim/plugin_reclaim_sqlite.c | 295 | src/reclaim/plugin_reclaim_sqlite.c |
298 | src/reclaim/reclaim_api.c | 296 | src/reclaim/reclaim_api.c |
@@ -318,27 +316,25 @@ src/rest-plugins/plugin_rest_namestore.c | |||
318 | src/rest-plugins/plugin_rest_openid_connect.c | 316 | src/rest-plugins/plugin_rest_openid_connect.c |
319 | src/rest-plugins/plugin_rest_peerinfo.c | 317 | src/rest-plugins/plugin_rest_peerinfo.c |
320 | src/rest/gnunet-rest-server.c | 318 | src/rest/gnunet-rest-server.c |
321 | src/rest/plugin_rest_copying.c | ||
322 | src/rest/rest.c | 319 | src/rest/rest.c |
323 | src/revocation/gnunet-revocation.c | 320 | src/revocation/gnunet-revocation.c |
324 | src/revocation/gnunet-service-revocation.c | 321 | src/revocation/gnunet-service-revocation.c |
325 | src/revocation/plugin_block_revocation.c | 322 | src/revocation/plugin_block_revocation.c |
326 | src/revocation/revocation_api.c | 323 | src/revocation/revocation_api.c |
327 | src/rps/gnunet-rps.c | ||
328 | src/rps/gnunet-rps-profiler.c | 324 | src/rps/gnunet-rps-profiler.c |
325 | src/rps/gnunet-rps.c | ||
329 | src/rps/gnunet-service-rps.c | 326 | src/rps/gnunet-service-rps.c |
330 | src/rps/gnunet-service-rps_custommap.c | 327 | src/rps/gnunet-service-rps_custommap.c |
331 | src/rps/gnunet-service-rps_sampler.c | 328 | src/rps/gnunet-service-rps_sampler.c |
332 | src/rps/gnunet-service-rps_sampler_elem.c | 329 | src/rps/gnunet-service-rps_sampler_elem.c |
333 | src/rps/gnunet-service-rps_view.c | 330 | src/rps/gnunet-service-rps_view.c |
334 | src/rps/rps_api.c | ||
335 | src/rps/rps_test_lib.c | ||
336 | src/rps/rps-test_util.c | 331 | src/rps/rps-test_util.c |
332 | src/rps/rps_api.c | ||
337 | src/scalarproduct/gnunet-scalarproduct.c | 333 | src/scalarproduct/gnunet-scalarproduct.c |
338 | src/scalarproduct/gnunet-service-scalarproduct_alice.c | ||
339 | src/scalarproduct/gnunet-service-scalarproduct_bob.c | ||
340 | src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | 334 | src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c |
341 | src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c | 335 | src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c |
336 | src/scalarproduct/gnunet-service-scalarproduct_alice.c | ||
337 | src/scalarproduct/gnunet-service-scalarproduct_bob.c | ||
342 | src/scalarproduct/scalarproduct_api.c | 338 | src/scalarproduct/scalarproduct_api.c |
343 | src/secretsharing/gnunet-secretsharing-profiler.c | 339 | src/secretsharing/gnunet-secretsharing-profiler.c |
344 | src/secretsharing/gnunet-service-secretsharing.c | 340 | src/secretsharing/gnunet-service-secretsharing.c |
@@ -367,15 +363,16 @@ src/statistics/gnunet-statistics.c | |||
367 | src/statistics/statistics_api.c | 363 | src/statistics/statistics_api.c |
368 | src/template/gnunet-service-template.c | 364 | src/template/gnunet-service-template.c |
369 | src/template/gnunet-template.c | 365 | src/template/gnunet-template.c |
366 | src/testbed-logger/gnunet-service-testbed-logger.c | ||
367 | src/testbed-logger/testbed_logger_api.c | ||
370 | src/testbed/generate-underlay-topology.c | 368 | src/testbed/generate-underlay-topology.c |
371 | src/testbed/gnunet-daemon-latency-logger.c | 369 | src/testbed/gnunet-daemon-latency-logger.c |
372 | src/testbed/gnunet-daemon-testbed-blacklist.c | 370 | src/testbed/gnunet-daemon-testbed-blacklist.c |
373 | src/testbed/gnunet-daemon-testbed-underlay.c | 371 | src/testbed/gnunet-daemon-testbed-underlay.c |
374 | src/testbed/gnunet-helper-testbed.c | 372 | src/testbed/gnunet-helper-testbed.c |
375 | src/testbed/gnunet_mpi_test.c | ||
376 | src/testbed/gnunet-service-test-barriers.c | 373 | src/testbed/gnunet-service-test-barriers.c |
377 | src/testbed/gnunet-service-testbed_barriers.c | ||
378 | src/testbed/gnunet-service-testbed.c | 374 | src/testbed/gnunet-service-testbed.c |
375 | src/testbed/gnunet-service-testbed_barriers.c | ||
379 | src/testbed/gnunet-service-testbed_cache.c | 376 | src/testbed/gnunet-service-testbed_cache.c |
380 | src/testbed/gnunet-service-testbed_connectionpool.c | 377 | src/testbed/gnunet-service-testbed_connectionpool.c |
381 | src/testbed/gnunet-service-testbed_cpustatus.c | 378 | src/testbed/gnunet-service-testbed_cpustatus.c |
@@ -383,20 +380,19 @@ src/testbed/gnunet-service-testbed_links.c | |||
383 | src/testbed/gnunet-service-testbed_meminfo.c | 380 | src/testbed/gnunet-service-testbed_meminfo.c |
384 | src/testbed/gnunet-service-testbed_oc.c | 381 | src/testbed/gnunet-service-testbed_oc.c |
385 | src/testbed/gnunet-service-testbed_peers.c | 382 | src/testbed/gnunet-service-testbed_peers.c |
386 | src/testbed/gnunet_testbed_mpi_spawn.c | ||
387 | src/testbed/gnunet-testbed-profiler.c | 383 | src/testbed/gnunet-testbed-profiler.c |
388 | src/testbed-logger/gnunet-service-testbed-logger.c | 384 | src/testbed/gnunet_mpi_test.c |
389 | src/testbed-logger/testbed_logger_api.c | 385 | src/testbed/gnunet_testbed_mpi_spawn.c |
390 | src/testbed/testbed_api_barriers.c | ||
391 | src/testbed/testbed_api.c | 386 | src/testbed/testbed_api.c |
387 | src/testbed/testbed_api_barriers.c | ||
392 | src/testbed/testbed_api_hosts.c | 388 | src/testbed/testbed_api_hosts.c |
393 | src/testbed/testbed_api_operations.c | 389 | src/testbed/testbed_api_operations.c |
394 | src/testbed/testbed_api_peers.c | 390 | src/testbed/testbed_api_peers.c |
395 | src/testbed/testbed_api_sd.c | 391 | src/testbed/testbed_api_sd.c |
396 | src/testbed/testbed_api_services.c | 392 | src/testbed/testbed_api_services.c |
397 | src/testbed/testbed_api_statistics.c | 393 | src/testbed/testbed_api_statistics.c |
398 | src/testbed/testbed_api_testbed.c | ||
399 | src/testbed/testbed_api_test.c | 394 | src/testbed/testbed_api_test.c |
395 | src/testbed/testbed_api_testbed.c | ||
400 | src/testbed/testbed_api_topology.c | 396 | src/testbed/testbed_api_topology.c |
401 | src/testbed/testbed_api_underlay.c | 397 | src/testbed/testbed_api_underlay.c |
402 | src/testing/gnunet-testing.c | 398 | src/testing/gnunet-testing.c |
@@ -405,28 +401,28 @@ src/testing/testing.c | |||
405 | src/topology/friends.c | 401 | src/topology/friends.c |
406 | src/topology/gnunet-daemon-topology.c | 402 | src/topology/gnunet-daemon-topology.c |
407 | src/transport/gnunet-helper-transport-bluetooth.c | 403 | src/transport/gnunet-helper-transport-bluetooth.c |
408 | src/transport/gnunet-helper-transport-wlan.c | ||
409 | src/transport/gnunet-helper-transport-wlan-dummy.c | 404 | src/transport/gnunet-helper-transport-wlan-dummy.c |
410 | src/transport/gnunet-service-transport_ats.c | 405 | src/transport/gnunet-helper-transport-wlan.c |
411 | src/transport/gnunet-service-transport.c | 406 | src/transport/gnunet-service-transport.c |
407 | src/transport/gnunet-service-transport_ats.c | ||
412 | src/transport/gnunet-service-transport_hello.c | 408 | src/transport/gnunet-service-transport_hello.c |
413 | src/transport/gnunet-service-transport_manipulation.c | 409 | src/transport/gnunet-service-transport_manipulation.c |
414 | src/transport/gnunet-service-transport_neighbours.c | 410 | src/transport/gnunet-service-transport_neighbours.c |
415 | src/transport/gnunet-service-transport_plugins.c | 411 | src/transport/gnunet-service-transport_plugins.c |
416 | src/transport/gnunet-service-transport_validation.c | 412 | src/transport/gnunet-service-transport_validation.c |
417 | src/transport/gnunet-transport.c | ||
418 | src/transport/gnunet-transport-certificate-creation.c | 413 | src/transport/gnunet-transport-certificate-creation.c |
419 | src/transport/gnunet-transport-profiler.c | 414 | src/transport/gnunet-transport-profiler.c |
420 | src/transport/gnunet-transport-wlan-receiver.c | 415 | src/transport/gnunet-transport-wlan-receiver.c |
421 | src/transport/gnunet-transport-wlan-sender.c | 416 | src/transport/gnunet-transport-wlan-sender.c |
417 | src/transport/gnunet-transport.c | ||
422 | src/transport/plugin_transport_http_client.c | 418 | src/transport/plugin_transport_http_client.c |
423 | src/transport/plugin_transport_http_common.c | 419 | src/transport/plugin_transport_http_common.c |
424 | src/transport/plugin_transport_http_server.c | 420 | src/transport/plugin_transport_http_server.c |
425 | src/transport/plugin_transport_smtp.c | 421 | src/transport/plugin_transport_smtp.c |
426 | src/transport/plugin_transport_tcp.c | 422 | src/transport/plugin_transport_tcp.c |
427 | src/transport/plugin_transport_template.c | 423 | src/transport/plugin_transport_template.c |
428 | src/transport/plugin_transport_udp_broadcasting.c | ||
429 | src/transport/plugin_transport_udp.c | 424 | src/transport/plugin_transport_udp.c |
425 | src/transport/plugin_transport_udp_broadcasting.c | ||
430 | src/transport/plugin_transport_unix.c | 426 | src/transport/plugin_transport_unix.c |
431 | src/transport/plugin_transport_wlan.c | 427 | src/transport/plugin_transport_wlan.c |
432 | src/transport/plugin_transport_xt.c | 428 | src/transport/plugin_transport_xt.c |
@@ -435,6 +431,11 @@ src/transport/tcp_connection_legacy.c | |||
435 | src/transport/tcp_server_legacy.c | 431 | src/transport/tcp_server_legacy.c |
436 | src/transport/tcp_server_mst_legacy.c | 432 | src/transport/tcp_server_mst_legacy.c |
437 | src/transport/tcp_service_legacy.c | 433 | src/transport/tcp_service_legacy.c |
434 | src/transport/transport-testing-filenames.c | ||
435 | src/transport/transport-testing-loggers.c | ||
436 | src/transport/transport-testing-main.c | ||
437 | src/transport/transport-testing-send.c | ||
438 | src/transport/transport-testing.c | ||
438 | src/transport/transport_api_address_to_string.c | 439 | src/transport/transport_api_address_to_string.c |
439 | src/transport/transport_api_blacklist.c | 440 | src/transport/transport_api_blacklist.c |
440 | src/transport/transport_api_core.c | 441 | src/transport/transport_api_core.c |
@@ -443,11 +444,6 @@ src/transport/transport_api_manipulation.c | |||
443 | src/transport/transport_api_monitor_peers.c | 444 | src/transport/transport_api_monitor_peers.c |
444 | src/transport/transport_api_monitor_plugins.c | 445 | src/transport/transport_api_monitor_plugins.c |
445 | src/transport/transport_api_offer_hello.c | 446 | src/transport/transport_api_offer_hello.c |
446 | src/transport/transport-testing.c | ||
447 | src/transport/transport-testing-filenames.c | ||
448 | src/transport/transport-testing-loggers.c | ||
449 | src/transport/transport-testing-main.c | ||
450 | src/transport/transport-testing-send.c | ||
451 | src/util/bandwidth.c | 447 | src/util/bandwidth.c |
452 | src/util/bio.c | 448 | src/util/bio.c |
453 | src/util/client.c | 449 | src/util/client.c |
@@ -459,8 +455,8 @@ src/util/configuration_loader.c | |||
459 | src/util/container_bloomfilter.c | 455 | src/util/container_bloomfilter.c |
460 | src/util/container_heap.c | 456 | src/util/container_heap.c |
461 | src/util/container_meta_data.c | 457 | src/util/container_meta_data.c |
462 | src/util/container_multihashmap32.c | ||
463 | src/util/container_multihashmap.c | 458 | src/util/container_multihashmap.c |
459 | src/util/container_multihashmap32.c | ||
464 | src/util/container_multipeermap.c | 460 | src/util/container_multipeermap.c |
465 | src/util/container_multishortmap.c | 461 | src/util/container_multishortmap.c |
466 | src/util/crypto_abe.c | 462 | src/util/crypto_abe.c |
@@ -482,15 +478,15 @@ src/util/dnsparser.c | |||
482 | src/util/dnsstub.c | 478 | src/util/dnsstub.c |
483 | src/util/getopt.c | 479 | src/util/getopt.c |
484 | src/util/getopt_helpers.c | 480 | src/util/getopt_helpers.c |
485 | src/util/gnunet-config.c | ||
486 | src/util/gnunet-config-diff.c | 481 | src/util/gnunet-config-diff.c |
482 | src/util/gnunet-config.c | ||
487 | src/util/gnunet-ecc.c | 483 | src/util/gnunet-ecc.c |
488 | src/util/gnunet-helper-w32-console.c | 484 | src/util/gnunet-helper-w32-console.c |
489 | src/util/gnunet-resolver.c | 485 | src/util/gnunet-resolver.c |
490 | src/util/gnunet-scrypt.c | 486 | src/util/gnunet-scrypt.c |
491 | src/util/gnunet-service-resolver.c | 487 | src/util/gnunet-service-resolver.c |
492 | src/util/gnunet-timeout.c | ||
493 | src/util/gnunet-timeout-w32.c | 488 | src/util/gnunet-timeout-w32.c |
489 | src/util/gnunet-timeout.c | ||
494 | src/util/gnunet-uri.c | 490 | src/util/gnunet-uri.c |
495 | src/util/helper.c | 491 | src/util/helper.c |
496 | src/util/load.c | 492 | src/util/load.c |
@@ -518,14 +514,15 @@ src/util/tun.c | |||
518 | src/util/w32cat.c | 514 | src/util/w32cat.c |
519 | src/util/win.c | 515 | src/util/win.c |
520 | src/util/winproc.c | 516 | src/util/winproc.c |
521 | src/vpn/gnunet-helper-vpn.c | ||
522 | src/vpn/gnunet-helper-vpn-windows.c | 517 | src/vpn/gnunet-helper-vpn-windows.c |
518 | src/vpn/gnunet-helper-vpn.c | ||
523 | src/vpn/gnunet-service-vpn.c | 519 | src/vpn/gnunet-service-vpn.c |
524 | src/vpn/gnunet-vpn.c | 520 | src/vpn/gnunet-vpn.c |
525 | src/vpn/vpn_api.c | 521 | src/vpn/vpn_api.c |
522 | src/zklaim/plugin_reclaim_attribute_zklaim.c | ||
526 | src/zklaim/zklaim.c | 523 | src/zklaim/zklaim.c |
527 | src/zonemaster/gnunet-service-zonemaster.c | ||
528 | src/zonemaster/gnunet-service-zonemaster-monitor.c | 524 | src/zonemaster/gnunet-service-zonemaster-monitor.c |
525 | src/zonemaster/gnunet-service-zonemaster.c | ||
529 | src/fs/fs_api.h | 526 | src/fs/fs_api.h |
530 | src/include/gnunet_common.h | 527 | src/include/gnunet_common.h |
531 | src/include/gnunet_mq_lib.h | 528 | src/include/gnunet_mq_lib.h |
diff --git a/src/Makefile.am b/src/Makefile.am index 1c129b041..54f6dfab2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -29,6 +29,7 @@ if HAVE_ZKLAIM | |||
29 | EXP_DIR += zklaim | 29 | EXP_DIR += zklaim |
30 | endif | 30 | endif |
31 | endif | 31 | endif |
32 | endif | ||
32 | if HAVE_JSON | 33 | if HAVE_JSON |
33 | EXP_DIR += \ | 34 | EXP_DIR += \ |
34 | auction | 35 | auction |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 4400db7e1..0081138e0 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2700,6 +2700,11 @@ extern "C" | |||
2700 | 2700 | ||
2701 | /******************************************************************************/ | 2701 | /******************************************************************************/ |
2702 | 2702 | ||
2703 | /******************************************************************************/ | ||
2704 | /*********************************** ZKLAIM ***********************************/ | ||
2705 | #define GNUNET_MESSAGE_TYPE_ZKLAIM_CREATE 990 | ||
2706 | |||
2707 | #define GNUNET_MESSAGE_TYPE_ZKLAIM_RESULT_CODE 991 | ||
2703 | 2708 | ||
2704 | /******************************************************************************/ | 2709 | /******************************************************************************/ |
2705 | /*********************************** CADET **********************************/ | 2710 | /*********************************** CADET **********************************/ |
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h index df5356d76..9b928328e 100644 --- a/src/include/gnunet_reclaim_attribute_lib.h +++ b/src/include/gnunet_reclaim_attribute_lib.h | |||
@@ -50,6 +50,12 @@ extern "C" | |||
50 | #define GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING 1 | 50 | #define GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING 1 |
51 | 51 | ||
52 | 52 | ||
53 | /** | ||
54 | * ZKlaim attribute. | ||
55 | */ | ||
56 | #define GNUNET_RECLAIM_ATTRIBUTE_TYPE_ZKLAIM 2 | ||
57 | |||
58 | |||
53 | 59 | ||
54 | /** | 60 | /** |
55 | * An attribute. | 61 | * An attribute. |
diff --git a/src/zklaim/Makefile.am b/src/zklaim/Makefile.am index a3432794a..1b25ac1a3 100644 --- a/src/zklaim/Makefile.am +++ b/src/zklaim/Makefile.am | |||
@@ -12,9 +12,51 @@ if USE_COVERAGE | |||
12 | XLIB = -lgcov | 12 | XLIB = -lgcov |
13 | endif | 13 | endif |
14 | 14 | ||
15 | plugin_LTLIBRARIES = \ | ||
16 | libgnunet_plugin_reclaim_attribute_zklaim.la | ||
15 | 17 | ||
16 | gnunet_zklaim_SOURCES = zklaim.c | 18 | lib_LTLIBRARIES = \ |
19 | libgnunetzklaim.la | ||
20 | |||
21 | libgnunetzklaim_la_SOURCES = \ | ||
22 | zklaim_api.c \ | ||
23 | zklaim_api.h | ||
24 | libgnunetzklaim_la_LIBADD = \ | ||
25 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
26 | $(GN_LIBINTL) $(XLIB) | ||
27 | libgnunetzklaim_la_LDFLAGS = \ | ||
28 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | ||
29 | -version-info 0:0:0 | ||
30 | |||
31 | |||
32 | libgnunet_plugin_reclaim_attribute_zklaim_la_SOURCES = \ | ||
33 | plugin_reclaim_attribute_zklaim.c | ||
34 | libgnunet_plugin_reclaim_attribute_zklaim_la_LIBADD = \ | ||
35 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
36 | $(LTLIBINTL) | ||
37 | libgnunet_plugin_reclaim_attribute_zklaim_la_LDFLAGS = \ | ||
38 | $(GN_PLUGIN_LDFLAGS) | ||
39 | |||
40 | test_zklaim_SOURCES = zklaim.c | ||
41 | test_zklaim_LDADD = \ | ||
42 | $(GCLIBADD)\ | ||
43 | $(LIBGCRYPT_LIBS) \ | ||
44 | -lzklaim \ | ||
45 | -lgcrypt \ | ||
46 | -lgmp \ | ||
47 | -lgmpxx \ | ||
48 | -lcrypto \ | ||
49 | -lprocps \ | ||
50 | -lstdc++ \ | ||
51 | -lm | ||
52 | test_zklaim_LDFLAGS = \ | ||
53 | $(GN_LIB_LDFLAGS) | ||
54 | |||
55 | gnunet_zklaim_SOURCES = gnunet-zklaim.c | ||
17 | gnunet_zklaim_LDADD = \ | 56 | gnunet_zklaim_LDADD = \ |
57 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
58 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
59 | libgnunetzklaim.la \ | ||
18 | $(GCLIBADD)\ | 60 | $(GCLIBADD)\ |
19 | $(LIBGCRYPT_LIBS) \ | 61 | $(LIBGCRYPT_LIBS) \ |
20 | -lzklaim \ | 62 | -lzklaim \ |
@@ -28,8 +70,9 @@ gnunet_zklaim_LDADD = \ | |||
28 | gnunet_zklaim_LDFLAGS = \ | 70 | gnunet_zklaim_LDFLAGS = \ |
29 | $(GN_LIB_LDFLAGS) | 71 | $(GN_LIB_LDFLAGS) |
30 | 72 | ||
31 | #lib_LTLIBRARIES = libgnunetzklaim.la | ||
32 | bin_PROGRAMS = gnunet-zklaim | 73 | bin_PROGRAMS = gnunet-zklaim |
74 | #lib_LTLIBRARIES = libgnunetzklaim.la | ||
75 | check_PROGRAMS = test_zklaim | ||
33 | 76 | ||
34 | if ENABLE_TEST_RUN | 77 | if ENABLE_TEST_RUN |
35 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; | 78 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; |
diff --git a/src/zklaim/plugin_reclaim_attribute_zklaim.c b/src/zklaim/plugin_reclaim_attribute_zklaim.c new file mode 100644 index 000000000..a79576cb1 --- /dev/null +++ b/src/zklaim/plugin_reclaim_attribute_zklaim.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2013, 2014, 2016 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 | |||
19 | /** | ||
20 | * @file zklaim/plugin_reclaim_attribute_zklaim.c | ||
21 | * @brief identity attribute plugin to provide the API for ZKlaims | ||
22 | * | ||
23 | * @author Martin Schanzenbach | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "gnunet_util_lib.h" | ||
27 | #include "gnunet_reclaim_attribute_plugin.h" | ||
28 | #include <inttypes.h> | ||
29 | |||
30 | |||
31 | /** | ||
32 | * Convert the 'value' of an attribute to a string. | ||
33 | * | ||
34 | * @param cls closure, unused | ||
35 | * @param type type of the attribute | ||
36 | * @param data value in binary encoding | ||
37 | * @param data_size number of bytes in @a data | ||
38 | * @return NULL on error, otherwise human-readable representation of the value | ||
39 | */ | ||
40 | static char * | ||
41 | zklaim_value_to_string (void *cls, | ||
42 | uint32_t type, | ||
43 | const void *data, | ||
44 | size_t data_size) | ||
45 | { | ||
46 | |||
47 | switch (type) | ||
48 | { | ||
49 | case GNUNET_RECLAIM_ATTRIBUTE_TYPE_ZKLAIM: | ||
50 | return GNUNET_strndup (data, data_size); | ||
51 | default: | ||
52 | return NULL; | ||
53 | } | ||
54 | } | ||
55 | |||
56 | |||
57 | /** | ||
58 | * Convert human-readable version of a 'value' of an attribute to the binary | ||
59 | * representation. | ||
60 | * | ||
61 | * @param cls closure, unused | ||
62 | * @param type type of the attribute | ||
63 | * @param s human-readable string | ||
64 | * @param data set to value in binary encoding (will be allocated) | ||
65 | * @param data_size set to number of bytes in @a data | ||
66 | * @return #GNUNET_OK on success | ||
67 | */ | ||
68 | static int | ||
69 | zklaim_string_to_value (void *cls, | ||
70 | uint32_t type, | ||
71 | const char *s, | ||
72 | void **data, | ||
73 | size_t *data_size) | ||
74 | { | ||
75 | if (NULL == s) | ||
76 | return GNUNET_SYSERR; | ||
77 | switch (type) | ||
78 | { | ||
79 | |||
80 | case GNUNET_RECLAIM_ATTRIBUTE_TYPE_ZKLAIM: | ||
81 | *data = GNUNET_strdup (s); | ||
82 | *data_size = strlen (s); | ||
83 | return GNUNET_OK; | ||
84 | default: | ||
85 | return GNUNET_SYSERR; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | |||
90 | /** | ||
91 | * Mapping of attribute type numbers to human-readable | ||
92 | * attribute type names. | ||
93 | */ | ||
94 | static struct { | ||
95 | const char *name; | ||
96 | uint32_t number; | ||
97 | } zklaim_name_map[] = { | ||
98 | { "ZKLAIM", GNUNET_RECLAIM_ATTRIBUTE_TYPE_ZKLAIM }, | ||
99 | { NULL, UINT32_MAX } | ||
100 | }; | ||
101 | |||
102 | |||
103 | /** | ||
104 | * Convert a type name to the corresponding number. | ||
105 | * | ||
106 | * @param cls closure, unused | ||
107 | * @param zklaim_typename name to convert | ||
108 | * @return corresponding number, UINT32_MAX on error | ||
109 | */ | ||
110 | static uint32_t | ||
111 | zklaim_typename_to_number (void *cls, | ||
112 | const char *zklaim_typename) | ||
113 | { | ||
114 | unsigned int i; | ||
115 | |||
116 | i=0; | ||
117 | while ( (NULL != zklaim_name_map[i].name) && | ||
118 | (0 != strcasecmp (zklaim_typename, | ||
119 | zklaim_name_map[i].name)) ) | ||
120 | i++; | ||
121 | return zklaim_name_map[i].number; | ||
122 | } | ||
123 | |||
124 | |||
125 | /** | ||
126 | * Convert a type number (i.e. 1) to the corresponding type string | ||
127 | * | ||
128 | * @param cls closure, unused | ||
129 | * @param type number of a type to convert | ||
130 | * @return corresponding typestring, NULL on error | ||
131 | */ | ||
132 | static const char * | ||
133 | zklaim_number_to_typename (void *cls, | ||
134 | uint32_t type) | ||
135 | { | ||
136 | unsigned int i; | ||
137 | |||
138 | i=0; | ||
139 | while ( (NULL != zklaim_name_map[i].name) && | ||
140 | (type != zklaim_name_map[i].number) ) | ||
141 | i++; | ||
142 | return zklaim_name_map[i].name; | ||
143 | } | ||
144 | |||
145 | |||
146 | /** | ||
147 | * Entry point for the plugin. | ||
148 | * | ||
149 | * @param cls NULL | ||
150 | * @return the exported block API | ||
151 | */ | ||
152 | void * | ||
153 | libgnunet_plugin_reclaim_attribute_zklaim_init (void *cls) | ||
154 | { | ||
155 | struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api; | ||
156 | |||
157 | api = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions); | ||
158 | api->value_to_string = &zklaim_value_to_string; | ||
159 | api->string_to_value = &zklaim_string_to_value; | ||
160 | api->typename_to_number = &zklaim_typename_to_number; | ||
161 | api->number_to_typename = &zklaim_number_to_typename; | ||
162 | return api; | ||
163 | } | ||
164 | |||
165 | |||
166 | /** | ||
167 | * Exit point from the plugin. | ||
168 | * | ||
169 | * @param cls the return value from #libgnunet_plugin_block_test_init() | ||
170 | * @return NULL | ||
171 | */ | ||
172 | void * | ||
173 | libgnunet_plugin_reclaim_attribute_zklaim_done (void *cls) | ||
174 | { | ||
175 | struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api = cls; | ||
176 | |||
177 | GNUNET_free (api); | ||
178 | return NULL; | ||
179 | } | ||
180 | |||
181 | /* end of plugin_reclaim_attribute_type_zklaim.c */ | ||
diff --git a/src/zklaim/zklaim_api.c b/src/zklaim/zklaim_api.c new file mode 100644 index 000000000..f54ede342 --- /dev/null +++ b/src/zklaim/zklaim_api.c | |||
@@ -0,0 +1,433 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2013, 2016 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 | |||
19 | /** | ||
20 | * @file zklaim/zklaim_api.c | ||
21 | * @brief api to interact with the zklaim service | ||
22 | * @author Martin Schanzenbach | ||
23 | */ | ||
24 | #include "platform.h" | ||
25 | #include "gnunet_util_lib.h" | ||
26 | #include "gnunet_constants.h" | ||
27 | #include "gnunet_protocols.h" | ||
28 | #include "gnunet_zklaim_service.h" | ||
29 | #include "zklaim/zklaim.h" | ||
30 | #include "zklaim_api.h" | ||
31 | |||
32 | #define LOG(kind,...) GNUNET_log_from (kind, "zklaim-api",__VA_ARGS__) | ||
33 | |||
34 | /** | ||
35 | * Handle for an ego. | ||
36 | */ | ||
37 | struct GNUNET_ZKLAIM_Context | ||
38 | { | ||
39 | /** | ||
40 | * ZKlaim context. | ||
41 | */ | ||
42 | struct zklaim_ctx *zk_ctx; | ||
43 | |||
44 | /** | ||
45 | * Current name associated with this context. | ||
46 | */ | ||
47 | char *name; | ||
48 | |||
49 | /** | ||
50 | * Attributes associated with context | ||
51 | */ | ||
52 | char *attrs; | ||
53 | |||
54 | /** | ||
55 | * Client context associated with this ego. | ||
56 | */ | ||
57 | void *ctx; | ||
58 | |||
59 | }; | ||
60 | |||
61 | |||
62 | /** | ||
63 | * Handle for an operation with the service. | ||
64 | */ | ||
65 | struct GNUNET_ZKLAIM_Operation | ||
66 | { | ||
67 | |||
68 | /** | ||
69 | * Main handle. | ||
70 | */ | ||
71 | struct GNUNET_ZKLAIM_Handle *h; | ||
72 | |||
73 | /** | ||
74 | * We keep operations in a DLL. | ||
75 | */ | ||
76 | struct GNUNET_ZKLAIM_Operation *next; | ||
77 | |||
78 | /** | ||
79 | * We keep operations in a DLL. | ||
80 | */ | ||
81 | struct GNUNET_ZKLAIM_Operation *prev; | ||
82 | |||
83 | /** | ||
84 | * Message to send to the zklaim service. | ||
85 | * Allocated at the end of this struct. | ||
86 | */ | ||
87 | const struct GNUNET_MessageHeader *msg; | ||
88 | |||
89 | /** | ||
90 | * Continuation to invoke with the result of the transmission; @e cb | ||
91 | * will be NULL in this case. | ||
92 | */ | ||
93 | GNUNET_ZKLAIM_ContinuationWithStatus cont; | ||
94 | |||
95 | /** | ||
96 | * Closure for @e cont or @e cb. | ||
97 | */ | ||
98 | void *cls; | ||
99 | |||
100 | }; | ||
101 | |||
102 | |||
103 | /** | ||
104 | * Handle for the service. | ||
105 | */ | ||
106 | struct GNUNET_ZKLAIM_Handle | ||
107 | { | ||
108 | /** | ||
109 | * Configuration to use. | ||
110 | */ | ||
111 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
112 | |||
113 | /** | ||
114 | * Connection to service. | ||
115 | */ | ||
116 | struct GNUNET_MQ_Handle *mq; | ||
117 | |||
118 | /** | ||
119 | * Hash map from the hash of the public key to the | ||
120 | * respective `GNUNET_ZKLAIM_Ego` handle. | ||
121 | */ | ||
122 | struct GNUNET_CONTAINER_MultiHashMap *egos; | ||
123 | |||
124 | /** | ||
125 | * Closure for @e cb. | ||
126 | */ | ||
127 | void *cb_cls; | ||
128 | |||
129 | /** | ||
130 | * Head of active operations. | ||
131 | */ | ||
132 | struct GNUNET_ZKLAIM_Operation *op_head; | ||
133 | |||
134 | /** | ||
135 | * Tail of active operations. | ||
136 | */ | ||
137 | struct GNUNET_ZKLAIM_Operation *op_tail; | ||
138 | |||
139 | /** | ||
140 | * Task doing exponential back-off trying to reconnect. | ||
141 | */ | ||
142 | struct GNUNET_SCHEDULER_Task *reconnect_task; | ||
143 | |||
144 | /** | ||
145 | * Time for next connect retry. | ||
146 | */ | ||
147 | struct GNUNET_TIME_Relative reconnect_delay; | ||
148 | |||
149 | }; | ||
150 | |||
151 | |||
152 | /** | ||
153 | * Try again to connect to the zklaim service. | ||
154 | * | ||
155 | * @param cls handle to the zklaim service. | ||
156 | */ | ||
157 | static void | ||
158 | reconnect (void *cls); | ||
159 | |||
160 | /** | ||
161 | * Reschedule a connect attempt to the service. | ||
162 | * | ||
163 | * @param h transport service to reconnect | ||
164 | */ | ||
165 | static void | ||
166 | reschedule_connect (struct GNUNET_ZKLAIM_Handle *h) | ||
167 | { | ||
168 | struct GNUNET_ZKLAIM_Operation *op; | ||
169 | |||
170 | GNUNET_assert (NULL == h->reconnect_task); | ||
171 | |||
172 | if (NULL != h->mq) | ||
173 | { | ||
174 | GNUNET_MQ_destroy (h->mq); | ||
175 | h->mq = NULL; | ||
176 | } | ||
177 | while (NULL != (op = h->op_head)) | ||
178 | { | ||
179 | GNUNET_CONTAINER_DLL_remove (h->op_head, | ||
180 | h->op_tail, | ||
181 | op); | ||
182 | if (NULL != op->cont) | ||
183 | op->cont (op->cls, | ||
184 | GNUNET_SYSERR, | ||
185 | "Error in communication with the zklaim service"); | ||
186 | GNUNET_free (op); | ||
187 | } | ||
188 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
189 | "Scheduling task to reconnect to zklaim service in %s.\n", | ||
190 | GNUNET_STRINGS_relative_time_to_string (h->reconnect_delay, | ||
191 | GNUNET_YES)); | ||
192 | h->reconnect_task = | ||
193 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, | ||
194 | &reconnect, | ||
195 | h); | ||
196 | h->reconnect_delay = GNUNET_TIME_STD_BACKOFF (h->reconnect_delay); | ||
197 | } | ||
198 | |||
199 | |||
200 | /** | ||
201 | * Generic error handler, called with the appropriate error code and | ||
202 | * the same closure specified at the creation of the message queue. | ||
203 | * Not every message queue implementation supports an error handler. | ||
204 | * | ||
205 | * @param cls closure with the `struct GNUNET_ZKLAIM_Handle *` | ||
206 | * @param error error code | ||
207 | */ | ||
208 | static void | ||
209 | mq_error_handler (void *cls, | ||
210 | enum GNUNET_MQ_Error error) | ||
211 | { | ||
212 | struct GNUNET_ZKLAIM_Handle *h = cls; | ||
213 | |||
214 | reschedule_connect (h); | ||
215 | } | ||
216 | |||
217 | |||
218 | /** | ||
219 | * We received a result code from the service. Check the message | ||
220 | * is well-formed. | ||
221 | * | ||
222 | * @param cls closure | ||
223 | * @param rcm result message received | ||
224 | * @return #GNUNET_OK if the message is well-formed | ||
225 | */ | ||
226 | static int | ||
227 | check_zklaim_result_code (void *cls, | ||
228 | const struct ResultCodeMessage *rcm) | ||
229 | { | ||
230 | uint16_t size = ntohs (rcm->header.size) - sizeof (*rcm); | ||
231 | const char *str = (const char *) &rcm[1]; | ||
232 | |||
233 | if (0 == size) | ||
234 | return GNUNET_OK; | ||
235 | if ('\0' != str[size - 1]) | ||
236 | { | ||
237 | GNUNET_break (0); | ||
238 | return GNUNET_SYSERR; | ||
239 | } | ||
240 | return GNUNET_OK; | ||
241 | } | ||
242 | |||
243 | |||
244 | /** | ||
245 | * We received a result code from the service. | ||
246 | * | ||
247 | * @param cls closure | ||
248 | * @param rcm result message received | ||
249 | */ | ||
250 | static void | ||
251 | handle_zklaim_result_code (void *cls, | ||
252 | const struct ResultCodeMessage *rcm) | ||
253 | { | ||
254 | struct GNUNET_ZKLAIM_Handle *h = cls; | ||
255 | struct GNUNET_ZKLAIM_Operation *op; | ||
256 | uint16_t size = ntohs (rcm->header.size) - sizeof (*rcm); | ||
257 | const char *str = (0 == size) ? NULL : (const char *) &rcm[1]; | ||
258 | |||
259 | op = h->op_head; | ||
260 | if (NULL == op) | ||
261 | { | ||
262 | GNUNET_break (0); | ||
263 | reschedule_connect (h); | ||
264 | return; | ||
265 | } | ||
266 | GNUNET_CONTAINER_DLL_remove (h->op_head, | ||
267 | h->op_tail, | ||
268 | op); | ||
269 | if (NULL != op->cont) | ||
270 | op->cont (op->cls, | ||
271 | GNUNET_OK, | ||
272 | str); | ||
273 | GNUNET_free (op); | ||
274 | } | ||
275 | |||
276 | |||
277 | /** | ||
278 | * Try again to connect to the zklaim service. | ||
279 | * | ||
280 | * @param cls handle to the zklaim service. | ||
281 | */ | ||
282 | static void | ||
283 | reconnect (void *cls) | ||
284 | { | ||
285 | struct GNUNET_ZKLAIM_Handle *h = cls; | ||
286 | struct GNUNET_MQ_MessageHandler handlers[] = { | ||
287 | GNUNET_MQ_hd_var_size (zklaim_result_code, | ||
288 | GNUNET_MESSAGE_TYPE_ZKLAIM_RESULT_CODE, | ||
289 | struct ResultCodeMessage, | ||
290 | h), | ||
291 | GNUNET_MQ_handler_end () | ||
292 | }; | ||
293 | |||
294 | h->reconnect_task = NULL; | ||
295 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
296 | "Connecting to zklaim service.\n"); | ||
297 | GNUNET_assert (NULL == h->mq); | ||
298 | h->mq = GNUNET_CLIENT_connect (h->cfg, | ||
299 | "zklaim", | ||
300 | handlers, | ||
301 | &mq_error_handler, | ||
302 | h); | ||
303 | if (NULL == h->mq) | ||
304 | return; | ||
305 | } | ||
306 | |||
307 | |||
308 | /** | ||
309 | * Connect to the zklaim service. | ||
310 | * | ||
311 | * @param cfg the configuration to use | ||
312 | * @param cb function to call on all zklaim events, can be NULL | ||
313 | * @param cb_cls closure for @a cb | ||
314 | * @return handle to use | ||
315 | */ | ||
316 | struct GNUNET_ZKLAIM_Handle * | ||
317 | GNUNET_ZKLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
318 | { | ||
319 | struct GNUNET_ZKLAIM_Handle *h; | ||
320 | |||
321 | h = GNUNET_new (struct GNUNET_ZKLAIM_Handle); | ||
322 | h->cfg = cfg; | ||
323 | reconnect (h); | ||
324 | if (NULL == h->mq) | ||
325 | { | ||
326 | GNUNET_free (h); | ||
327 | return NULL; | ||
328 | } | ||
329 | return h; | ||
330 | } | ||
331 | |||
332 | |||
333 | /** | ||
334 | * Create a new zklaim with the given name. | ||
335 | * | ||
336 | * @param h zklaim service to use | ||
337 | * @param name desired name | ||
338 | * @param cont function to call with the result (will only be called once) | ||
339 | * @param cont_cls closure for @a cont | ||
340 | * @return handle to abort the operation | ||
341 | */ | ||
342 | struct GNUNET_ZKLAIM_Operation * | ||
343 | GNUNET_ZKLAIM_context_create (struct GNUNET_ZKLAIM_Handle *h, | ||
344 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, | ||
345 | const char *name, | ||
346 | const char *attr_list, | ||
347 | GNUNET_ZKLAIM_ContinuationWithStatus cont, | ||
348 | void *cont_cls) | ||
349 | { | ||
350 | struct GNUNET_ZKLAIM_Operation *op; | ||
351 | struct GNUNET_MQ_Envelope *env; | ||
352 | struct CreateRequestMessage *crm; | ||
353 | size_t slen; | ||
354 | |||
355 | if (NULL == h->mq) | ||
356 | return NULL; | ||
357 | slen = strlen (name) + 1; | ||
358 | if (slen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (struct CreateRequestMessage)) | ||
359 | { | ||
360 | GNUNET_break (0); | ||
361 | return NULL; | ||
362 | } | ||
363 | op = GNUNET_new (struct GNUNET_ZKLAIM_Operation); | ||
364 | op->h = h; | ||
365 | op->cont = cont; | ||
366 | op->cls = cont_cls; | ||
367 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, | ||
368 | h->op_tail, | ||
369 | op); | ||
370 | env = GNUNET_MQ_msg_extra (crm, | ||
371 | slen, | ||
372 | GNUNET_MESSAGE_TYPE_ZKLAIM_CREATE); | ||
373 | crm->name_len = htons (slen); | ||
374 | crm->reserved = htons (0); | ||
375 | crm->private_key = *pk; | ||
376 | GNUNET_memcpy (&crm[1], | ||
377 | name, | ||
378 | slen); | ||
379 | GNUNET_MQ_send (h->mq, | ||
380 | env); | ||
381 | //TODO add attrs | ||
382 | return op; | ||
383 | } | ||
384 | |||
385 | |||
386 | /** | ||
387 | * Cancel an zklaim operation. Note that the operation MAY still | ||
388 | * be executed; this merely cancels the continuation; if the request | ||
389 | * was already transmitted, the service may still choose to complete | ||
390 | * the operation. | ||
391 | * | ||
392 | * @param op operation to cancel | ||
393 | */ | ||
394 | void | ||
395 | GNUNET_ZKLAIM_cancel (struct GNUNET_ZKLAIM_Operation *op) | ||
396 | { | ||
397 | op->cont = NULL; | ||
398 | } | ||
399 | |||
400 | |||
401 | /** | ||
402 | * Disconnect from zklaim service | ||
403 | * | ||
404 | * @param h handle to destroy | ||
405 | */ | ||
406 | void | ||
407 | GNUNET_ZKLAIM_disconnect (struct GNUNET_ZKLAIM_Handle *h) | ||
408 | { | ||
409 | struct GNUNET_ZKLAIM_Operation *op; | ||
410 | |||
411 | GNUNET_assert (NULL != h); | ||
412 | if (h->reconnect_task != NULL) | ||
413 | { | ||
414 | GNUNET_SCHEDULER_cancel (h->reconnect_task); | ||
415 | h->reconnect_task = NULL; | ||
416 | } | ||
417 | while (NULL != (op = h->op_head)) | ||
418 | { | ||
419 | GNUNET_break (NULL == op->cont); | ||
420 | GNUNET_CONTAINER_DLL_remove (h->op_head, | ||
421 | h->op_tail, | ||
422 | op); | ||
423 | GNUNET_free (op); | ||
424 | } | ||
425 | if (NULL != h->mq) | ||
426 | { | ||
427 | GNUNET_MQ_destroy (h->mq); | ||
428 | h->mq = NULL; | ||
429 | } | ||
430 | GNUNET_free (h); | ||
431 | } | ||
432 | |||
433 | /* end of zklaim_api.c */ | ||
diff --git a/src/zklaim/zklaim_api.h b/src/zklaim/zklaim_api.h new file mode 100644 index 000000000..77053c667 --- /dev/null +++ b/src/zklaim/zklaim_api.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2013 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 | |||
19 | /** | ||
20 | * @author Martin Schanzenbach | ||
21 | * @file zklaim/zklaim.h | ||
22 | * | ||
23 | * @brief Common type definitions for the zklaim | ||
24 | * service and API. | ||
25 | */ | ||
26 | #ifndef ZKLAIM_API_H | ||
27 | #define ZKLAIM_API_H | ||
28 | |||
29 | #include "gnunet_common.h" | ||
30 | |||
31 | |||
32 | GNUNET_NETWORK_STRUCT_BEGIN | ||
33 | |||
34 | |||
35 | /** | ||
36 | * Answer from service to client about last operation; | ||
37 | * GET_DEFAULT maybe answered with this message on failure; | ||
38 | * CREATE and RENAME will always be answered with this message. | ||
39 | */ | ||
40 | struct ResultCodeMessage | ||
41 | { | ||
42 | /** | ||
43 | * Type: #GNUNET_MESSAGE_TYPE_ZKLAIM_RESULT_CODE | ||
44 | */ | ||
45 | struct GNUNET_MessageHeader header; | ||
46 | |||
47 | /** | ||
48 | * Status code for the last operation, in NBO. | ||
49 | * (currently not used). | ||
50 | */ | ||
51 | uint32_t result_code GNUNET_PACKED; | ||
52 | |||
53 | /* followed by 0-terminated error message (on error) */ | ||
54 | |||
55 | }; | ||
56 | |||
57 | |||
58 | /** | ||
59 | * Client requests creation of an identity. Service | ||
60 | * will respond with a result code. | ||
61 | */ | ||
62 | struct CreateRequestMessage | ||
63 | { | ||
64 | /** | ||
65 | * Type: #GNUNET_MESSAGE_TYPE_ZKLAIM_CREATE | ||
66 | */ | ||
67 | struct GNUNET_MessageHeader header; | ||
68 | |||
69 | /** | ||
70 | * Number of bytes in identity name string including 0-termination, in NBO. | ||
71 | */ | ||
72 | uint16_t name_len GNUNET_PACKED; | ||
73 | |||
74 | /** | ||
75 | * Always zero. | ||
76 | */ | ||
77 | uint16_t reserved GNUNET_PACKED; | ||
78 | |||
79 | /** | ||
80 | * The private key | ||
81 | */ | ||
82 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | ||
83 | |||
84 | /* followed by 0-terminated identity name */ | ||
85 | |||
86 | }; | ||
87 | |||
88 | GNUNET_NETWORK_STRUCT_END | ||
89 | |||
90 | #endif | ||