aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile102
-rw-r--r--README8
-rw-r--r--README.md268
-rw-r--r--configure.ac4
-rw-r--r--contrib/branding/logo/gnunet-logo-dark-text.svg1411
-rw-r--r--contrib/gnunet-arch-full.svg648
-rw-r--r--contrib/packages/guix/notest-guix-env.scm145
-rw-r--r--doc/documentation/chapters/preface.texi67
-rw-r--r--doc/documentation/chapters/user.texi364
-rw-r--r--doc/documentation/gnunet.texi3
-rw-r--r--docker/README.md138
-rw-r--r--docker/docker-entrypoint.sh15
-rw-r--r--docker/gnunet.conf21
-rw-r--r--po/POTFILES.in137
-rw-r--r--src/Makefile.am6
-rw-r--r--src/arm/test_exponential_backoff.c3
-rw-r--r--src/cadet/cadet_api.c1
-rw-r--r--src/core/test_core_api_reliability.c4
-rw-r--r--src/core/test_core_quota_compliance.c5
-rw-r--r--src/datacache/plugin_datacache_sqlite.c5
-rw-r--r--src/identity-provider/identity-token.conf2
-rw-r--r--src/identity-provider/jwt.c189
-rw-r--r--src/identity-provider/jwt.h9
-rw-r--r--src/identity-provider/test_idp.conf33
-rwxr-xr-xsrc/identity-provider/test_idp.sh31
-rwxr-xr-xsrc/identity-provider/test_idp_attribute.sh40
-rwxr-xr-xsrc/identity-provider/test_idp_consume.sh43
-rwxr-xr-xsrc/identity-provider/test_idp_issue.sh42
-rwxr-xr-xsrc/identity-provider/test_idp_revoke.sh65
-rw-r--r--src/identity/gnunet-service-identity.c49
-rw-r--r--src/include/Makefile.am2
-rw-r--r--src/include/gnunet_abe_lib.h2
-rw-r--r--src/include/gnunet_crypto_lib.h26
-rw-r--r--src/include/gnunet_gnsrecord_lib.h10
-rw-r--r--src/include/gnunet_protocols.h30
-rw-r--r--src/include/gnunet_reclaim_attribute_lib.h (renamed from src/include/gnunet_identity_attribute_lib.h)64
-rw-r--r--src/include/gnunet_reclaim_attribute_plugin.h (renamed from src/include/gnunet_identity_attribute_plugin.h)24
-rw-r--r--src/include/gnunet_reclaim_plugin.h (renamed from src/include/gnunet_identity_provider_plugin.h)28
-rw-r--r--src/include/gnunet_reclaim_service.h (renamed from src/include/gnunet_identity_provider_service.h)116
-rw-r--r--src/include/gnunet_signatures.h6
-rw-r--r--src/multicast/gnunet-service-multicast.c18
-rw-r--r--src/multicast/test_multicast_multipeer.c2
-rw-r--r--src/reclaim-attribute/Makefile.am (renamed from src/identity-attribute/Makefile.am)20
-rw-r--r--src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c (renamed from src/identity-attribute/plugin_identity_attribute_gnuid.c)22
-rw-r--r--src/reclaim-attribute/reclaim_attribute.c (renamed from src/identity-attribute/identity_attribute.c)100
-rw-r--r--src/reclaim-attribute/reclaim_attribute.h (renamed from src/identity-attribute/identity_attribute.h)10
-rw-r--r--src/reclaim/.gitignore (renamed from src/identity-provider/.gitignore)0
-rw-r--r--src/reclaim/Makefile.am (renamed from src/identity-provider/Makefile.am)95
-rw-r--r--src/reclaim/gnunet-reclaim.c (renamed from src/identity-provider/gnunet-idp.c)148
-rw-r--r--src/reclaim/gnunet-service-reclaim.c (renamed from src/identity-provider/gnunet-service-identity-provider.c)204
-rw-r--r--src/reclaim/jwt.c1
-rw-r--r--src/reclaim/oidc_helper.c440
-rw-r--r--src/reclaim/oidc_helper.h109
-rw-r--r--src/reclaim/plugin_gnsrecord_reclaim.c (renamed from src/identity-provider/plugin_gnsrecord_identity_provider.c)12
-rw-r--r--src/reclaim/plugin_reclaim_sqlite.c (renamed from src/identity-provider/plugin_identity_provider_sqlite.c)72
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c (renamed from src/identity-provider/plugin_rest_openid_connect.c)787
-rw-r--r--src/reclaim/plugin_rest_reclaim.c (renamed from src/identity-provider/plugin_rest_identity_provider.c)118
-rw-r--r--src/reclaim/reclaim.conf (renamed from src/identity-provider/identity-provider.conf)15
-rw-r--r--src/reclaim/reclaim.h (renamed from src/identity-provider/identity_provider.h)24
-rw-r--r--src/reclaim/reclaim_api.c (renamed from src/identity-provider/identity_provider_api.c)345
-rwxr-xr-xsrc/reclaim/test_reclaim.sh31
-rwxr-xr-xsrc/reclaim/test_reclaim_attribute.sh40
-rwxr-xr-xsrc/reclaim/test_reclaim_consume.sh43
-rw-r--r--src/reclaim/test_reclaim_defaults.conf (renamed from src/identity-provider/test_idp_defaults.conf)0
-rwxr-xr-xsrc/reclaim/test_reclaim_issue.sh42
-rwxr-xr-xsrc/reclaim/test_reclaim_revoke.sh65
-rw-r--r--src/rest/Makefile.am12
-rw-r--r--src/rest/plugin_rest_copying.c231
-rw-r--r--src/rps/gnunet-rps-profiler.c284
-rw-r--r--src/rps/gnunet-service-rps.c655
-rw-r--r--src/rps/gnunet-service-rps_custommap.c2
-rw-r--r--src/rps/rps-test_util.c80
-rw-r--r--src/transport/test_quota_compliance.c4
-rw-r--r--src/transport/test_transport_api_reliability.c4
-rw-r--r--src/util/crypto_hash.c26
-rw-r--r--src/util/dnsparser.c2
-rw-r--r--src/util/scheduler.c189
77 files changed, 6104 insertions, 2314 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..4fdd91f60
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,102 @@
1FROM ubuntu:18.04
2
3ENV DEBIAN_FRONTEND noninteractive
4
5# Install tools and dependencies
6RUN apt-get update && \
7 apt-get -y install --no-install-recommends \
8 ca-certificates \
9 libsasl2-modules \
10 git \
11 automake \
12 autopoint \
13 autoconf \
14 texinfo \
15 libtool \
16 libltdl-dev \
17 libgpg-error-dev \
18 libidn11-dev \
19 libunistring-dev \
20 libglpk-dev \
21 libbluetooth-dev \
22 libextractor-dev \
23 libmicrohttpd-dev \
24 libgnutls28-dev \
25 libgcrypt20-dev \
26 libpq-dev \
27 libsqlite3-dev && \
28 apt-get clean all && \
29 apt-get -y autoremove && \
30 rm -rf \
31 /var/lib/apt/lists/* \
32 /tmp/*
33
34# Install GNUrl
35ENV GNURL_GIT_URL https://git.taler.net/gnurl.git
36ENV GNURL_GIT_BRANCH gnurl-7.57.0
37
38RUN git clone $GNURL_GIT_URL \
39 --branch $GNURL_GIT_BRANCH \
40 --depth=1 \
41 --quiet && \
42 cd /gnurl && \
43 autoreconf -i && \
44 ./configure \
45 --enable-ipv6 \
46 --with-gnutls \
47 --without-libssh2 \
48 --without-libmetalink \
49 --without-winidn \
50 --without-librtmp \
51 --without-nghttp2 \
52 --without-nss \
53 --without-cyassl \
54 --without-polarssl \
55 --without-ssl \
56 --without-winssl \
57 --without-darwinssl \
58 --disable-sspi \
59 --disable-ntlm-wb \
60 --disable-ldap \
61 --disable-rtsp \
62 --disable-dict \
63 --disable-telnet \
64 --disable-tftp \
65 --disable-pop3 \
66 --disable-imap \
67 --disable-smtp \
68 --disable-gopher \
69 --disable-file \
70 --disable-ftp \
71 --disable-smb && \
72 make install && \
73 cd - && \
74 rm -fr /gnurl
75
76# Install GNUnet
77ENV GNUNET_PREFIX /usr/local/gnunet
78ENV CFLAGS '-g -Wall -O0'
79
80COPY . /gnunet
81
82RUN cd /gnunet && \
83 ./bootstrap && \
84 ./configure \
85 --with-nssdir=/lib \
86 --prefix="$GNUNET_PREFIX" \
87 --enable-logging=verbose && \
88 make -j3 && \
89 make install && \
90 ldconfig && \
91 cd - && \
92 rm -fr /gnunet
93
94# Configure GNUnet
95COPY docker/gnunet.conf /etc/gnunet.conf
96COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
97RUN chmod 755 /usr/local/bin/docker-entrypoint
98
99ENV LOCAL_PORT_RANGE='40001 40200'
100ENV PATH "$GNUNET_PREFIX/bin:/usr/local/bin:$PATH"
101
102ENTRYPOINT ["docker-entrypoint"]
diff --git a/README b/README
index a00c5a0a9..256a6c69c 100644
--- a/README
+++ b/README
@@ -453,12 +453,12 @@ Further Reading
453 453
454* Documentation 454* Documentation
455 455
456 A preliminary rendering of the new GNUnet manual is deployed at 456 A HTML version of the new GNUnet manual is deployed at
457 457
458 https://d.n0.is/pub/doc/gnunet/manual/ 458 https://docs.gnunet.org
459 459
460 we plan to have a complete new gnunet.org up and running in 2019. 460 which currently displays just GNUnet documentation. Until 2019
461 This website output exists as a convenience solution until then. 461 we will add more reading material.
462 462
463* Academia / papers 463* Academia / papers
464 464
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..3f40b3d87
--- /dev/null
+++ b/README.md
@@ -0,0 +1,268 @@
1<p align="center">
2 <a href="https://gnunet.org"><img src="contrib/branding/logo/gnunet-logo-dark-text.svg" alt="GNUnet" width="300px"/></a>
3</p>
4
5> GNUnet is a *new* network protocol stack for building secure, distributed, and privacy-preserving applications.
6
7* [Install](#how-to-install-gnunet)
8 * [From Source](#from-source)
9 * [Using Docker](#docker)
10* [Using GNUnet](#using-gnunet)
11* [License](#license)
12
13How to Install GNUnet
14---------------------
15
16### 1. From Source
17
18**Dependencies**
19
20Install these packages. Some of them may need to be installed from source depending on your OS.
21
22```
23- libmicrohttpd >= 0.9.42 (available from https://www.gnu.org/software/libmicrohttpd/)
24- libgcrypt >= 1.6
25- libgnurl >= 7.35.0 (recommended, available from https://gnunet.org/gnurl)
26- libcurl >= 7.35.0 (alternative to libgnurl)
27- libunistring >= 0.9.2
28- gnutls >= 3.2.12 (highly recommended: a gnutls linked against libunbound)
29- libidn >= 1.0
30- libextractor >= 0.6.1 (highly recommended)
31- openssl >= 1.0 (binary, used to generate X.509 certificate)
32- libltdl >= 2.2 (part of GNU libtool)
33- sqlite >= 3.8 (default database, required)
34- mysql >= 5.1 (alternative to sqlite)
35- postgres >= 9.5 (alternative to sqlite)
36- Texinfo >= 5.2 [*1]
37- which (for the bootstrap script)
38- gettext
39- zlib
40- pkg-config
41```
42
43
44You can also install the dependencies with the [GNU Guix package manager:](https://https://www.gnu.org/software/guix/) by using the provided environment file:
45
46```shell
47guix package -l guix-env.scm
48```
49
50
51**Using GNU Make**
52
53```shell
54./bootstrap # Run this to generate the configure files.
55./configure # See the various flags avalable to you.
56make
57make install
58```
59
60**Using the [GNU Guix package manager:](https://https://www.gnu.org/software/guix/)**
61
62```shell
63# To build, run tests, and install:
64guix package -f guix-env.scm
65
66# To skip the testing phase:
67guix package -f guix-env.scm:notest
68```
69
70
71### 2. Docker
72
73```
74docker build -t gnunet .
75```
76
77
78
79Using GNUnet
80-------------
81
82There are many possible ways to use the subsystems of GNUnet, so we will provide a few examples in this section.
83
84<p align="center">
85 <a href="contrib/gnunet-arch-full.svg"><img src="contrib/gnunet-arch-full.svg" alt="GNUnet Modular Architecture" width="600px" border="1px"/></a>
86</p>
87
88>***GNUnet is composed of over 30 modular subsystems***
89
90
91### Start GNUnet Services
92
93Before we can begin using most of the components we must start them.
94
95```shell
96gnunet-arm --start
97```
98
99Now we can open up another shell and try using some of the modules.
100
101### Cadet
102
103#### Examples
104
105Open a Cadet connection:
106
107```shell
108# Node 1
109gnunet-cadet -o <shared secret>
110```
111
112Conect to peer:
113
114```shell
115# Node 2
116gnunet-cadet <peer-id of Node 1> <shared secret>
117```
118
119#### Sharing Files
120
121With the cli tool, you can also share files:
122
123```shell
124# Node 1
125gnunet-cadet -o <shared secret> > filename
126```
127
128On the Node 2 we're going to send the file to Node 1, and to do this we need to make use of [coprocesses](https://www.gnu.org/software/bash/manual/html_node/Coprocesses.html).
129The syntax for using coprocesses varies per shell. In our example we are assuming Bash. More info for different shells can be found [here](https://unix.stackexchange.com/questions/86270/how-do-you-use-the-command-coproc-in-various-shells)
130
131```shell
132# Node 2
133coproc gnunet-cadet <peer-id of Node 1> <shared secret>
134cat <file> >&"${COPROC[1]}"
135```
136
137Now this enables us to do some fun things, such as streaming video by piping to a media player:
138
139```shell
140# Node 1
141gnunet-cadet -o <shared secret> | vlc -
142```
143
144```shell
145# Node 2
146coproc gnunet-cadet <peer-id of Node 1> <shared secret>
147cat <video-file> >&"${COPROC[1]}"
148```
149
150### Filesharing
151
152You can use GNUnet as a content-addressed storage, much like IPFS: sharing immutable files in a decentralized fashion with added privacy.
153
154For instance, you can get a nice cat picture with
155```sh
156gnunet-download gnunet://fs/loc/CB0ZX5EM1ZNNRT7AX93RVHCN1H49242DWZ4AXBTCJBAG22Z33VHYMR61J71YJXTXHEC22TNE0PRWA6D5X7NFNY2J9BNMG0SFN5DKZ0G.R48JSE2T4Y3W2AMDHZYX2MMDJC4HR0BVTJYNWJT2DGK7EQXR35DT84H9ZRAK3QTCTHDBAE1S6W16P8PCKC4HGEEKNW2T42HXF9RS1J0.1906755.J5Z3BDEG2PW332001GGZ2SSKCCSV8WDM696HNARG49X9TMABC4DG.B6Y7BCJ6B5K40EXCXASX1HQAD8MBJ9WTFWPCE3F15Q3Q4Y2PB8BKVGCS5HA4FG4484858NB74PBEE5V1638MGG7NS40A82K7QKK3G0G.1577833200 --output cat.png
157```
158
159You can also give files to the network, like so:
160
161```sh
162$ echo "I love GNUnet" > ILoveGNUnet.txt
163$ gnunet-publish ILoveGNUnet.txt
164
165Publishing `/tmp/ILoveGNUnet.txt` done.
166URI is `gnunet://fs/chk/SXA4RGZWDHE4PDWD2F4XG778J4SZY3E3SNDZ9AWFRZYYBV52W1T2WQNZCF1NYAT842800SSBQ8F247TG6MX7H4S1RWZZSC8ZXGQ4YPR.AZ3B5WR1XCWCWR6W30S2365KFY7A3R5AMF5SRN3Z11R72SMVQDX3F6GXQSZMWZGM5BSYVDQEJ93CR024QAAE65CKHM52GH8MZK1BM90.14`.
167```
168
169The URI you get is what you can use to retrieve the file with `gnunet-download`.
170
171### GNS
172
173*coming soon*
174
175
176### VPN
177
178#### "Half-hidden" services
179
180You can tunnel IP traffic through GNUnet allowing you to offer web, [rsh](https://linux.die.net/man/1/rsh), messaging or other servers without revealing your IP address.
181
182This is similar to Tor's Hidden (aka Onion) services, but currently does not provide as much privacy as onion routing isn't yet implemented; on the other hand, you can tunnel UDP, unlike Tor.
183
184#### Configuring server
185
186First, set up access from GNUnet to IP with `exit`:
187
188`gnunet.conf`:
189```
190[exit]
191FORCESTART = YES
192EXIT_IPV4 = YES
193EXIT_RANGE_IPV4_POLICY = 169.254.86.1;
194```
195
196Exit, by the way can also be used as a general-purpose IP proxy i.e. exit relay but here we restrict IPs to be accessed to those we'll be serving stuff on only.
197
198Then, start up a server to be shared. For the sake of example,
199
200```sh
201python3 -m http.server 8080
202```
203
204Now to configure the actual "half-hidden service". The config syntax is as follows:
205
206```sh
207[<shared secret>.gnunet.]
208TCP_REDIRECTS = <exposed port>:<local IP>:<local port>
209```
210
211...which for our example would be
212
213```sh
214[myhttptest.gnunet.]
215TCP_REDIRECTS = 80:169.254.86.1:8080
216```
217
218Local IP can be anything (if allowed by other configuration) but a localhost address (in other words, you can't bind a hidden service to the loopback interface and say 127.0.0.1 in `TCP_REDIRECTS`). The packets will appear as coming from the exit TUN interface to whatever address is configured in `TCP_REDIRECTS` (unlike SSH local forwarding, where the packets appear as coming from the loopback interface) and so they will not be forwarded to 127.0.0.1.
219
220You can share access to this service with a peer id, shared secret and IP port numbler: here `gnunet-peerinfo -s`, `myhttptest` and `80` respectively.
221
222#### Connecting
223
224`gnunet-vpn` gives you ephemeral IPs to connect to if you tell it a peer id and a shared secret, like so:
225
226```sh
227$ gnunet-vpn -p N7R25J8ADR553EPW0NFWNCXK9V80RVCP69QJ47XMT82VKAR7Y300 -t -s myhttptest
22810.11.139.20
229
230# And just connect to the given IP
231$ wget 10.11.139.20
232Connecting to 10.11.139.20:80... connected.
233```
234
235(You can try it out with your browser too.)
236
237### Running a Hostlist Server
238
239*coming soon*
240
241GNUnet Configuration
242--------------------------
243### Examples
244
245```yaml
246[transport]
247OPTIONS = -L DEBUG
248PLUGINS = tcp
249#PLUGINS = udp
250
251[transport-tcp]
252OPTIONS = -L DEBUG
253BINDTO = 192.168.0.2
254```
255
256TODO: *explain what this does and add more*
257
258
259Philosophy
260-------------------------
261
262GNUnet is made for an open society: It's a self-organizing network and it's [http://www.gnu.org/philosophy/free-sw.html](free software) as in freedom. GNUnet puts you in control of your data. You determine which data to share with whom, and you're not pressured to accept compromises.
263
264
265Related Projects
266-------------------------
267
268 <a href="https://pep.foundation"><img src="https://pep.foundation/static/media/uploads/peplogo.svg" alt="pep.foundation" width="80px"/></a> <a href="https://secushare.org"><img src="https://secushare.org/img/secushare-0444.png" alt="Secushare" width="80px"/></a>
diff --git a/configure.ac b/configure.ac
index c7314d765..535ce0ffe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1759,8 +1759,8 @@ src/zonemaster/Makefile
1759src/zonemaster/zonemaster.conf 1759src/zonemaster/zonemaster.conf
1760src/rest/Makefile 1760src/rest/Makefile
1761src/abe/Makefile 1761src/abe/Makefile
1762src/identity-attribute/Makefile 1762src/reclaim-attribute/Makefile
1763src/identity-provider/Makefile 1763src/reclaim/Makefile
1764pkgconfig/Makefile 1764pkgconfig/Makefile
1765pkgconfig/gnunetarm.pc 1765pkgconfig/gnunetarm.pc
1766pkgconfig/gnunetats.pc 1766pkgconfig/gnunetats.pc
diff --git a/contrib/branding/logo/gnunet-logo-dark-text.svg b/contrib/branding/logo/gnunet-logo-dark-text.svg
new file mode 100644
index 000000000..5644e0ae7
--- /dev/null
+++ b/contrib/branding/logo/gnunet-logo-dark-text.svg
@@ -0,0 +1,1411 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<svg
3 xmlns:dc="http://purl.org/dc/elements/1.1/"
4 xmlns:cc="http://creativecommons.org/ns#"
5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6 xmlns:svg="http://www.w3.org/2000/svg"
7 xmlns="http://www.w3.org/2000/svg"
8 xmlns:xlink="http://www.w3.org/1999/xlink"
9 version="1.1"
10 id="svg2"
11 height="280"
12 width="320">
13 <title
14 id="title3310">logo for GNUnet</title>
15 <defs
16 id="defs4">
17 <linearGradient
18 id="gnunet">
19 <stop
20 style="stop-color:#ff0000;stop-opacity:0.58431375;"
21 offset="0"
22 id="stop9516" />
23 <stop
24 style="stop-color:#ffcc00;stop-opacity:1;"
25 offset="1"
26 id="stop9518" />
27 </linearGradient>
28 <linearGradient
29 id="linearGradient4094">
30 <stop
31 style="stop-color:#232323;stop-opacity:1;"
32 offset="0"
33 id="stop4096" />
34 <stop
35 style="stop-color:#4d4d4d;stop-opacity:1;"
36 offset="1"
37 id="stop4098" />
38 </linearGradient>
39 <linearGradient
40 id="linearGradient4014">
41 <stop
42 style="stop-color:#a0a0a0;stop-opacity:1;"
43 offset="0"
44 id="stop4016" />
45 <stop
46 style="stop-color:#ffffff;stop-opacity:1;"
47 offset="1"
48 id="stop4018" />
49 </linearGradient>
50 <linearGradient
51 id="linearGradient4678">
52 <stop
53 style="stop-color:#e5e5e5;stop-opacity:1;"
54 offset="0"
55 id="stop4680" />
56 <stop
57 style="stop-color:#d3cdcd;stop-opacity:1;"
58 offset="1"
59 id="stop4682" />
60 </linearGradient>
61 <linearGradient
62 id="linearGradient4341">
63 <stop
64 id="stop4343"
65 offset="0"
66 style="stop-color:#333333;stop-opacity:1;" />
67 <stop
68 id="stop4345"
69 offset="1"
70 style="stop-color:#484848;stop-opacity:1;" />
71 </linearGradient>
72 <linearGradient
73 id="linearGradient4696-5">
74 <stop
75 id="stop4698-6"
76 offset="0"
77 style="stop-color:#ffb638;stop-opacity:1;" />
78 <stop
79 id="stop4700-2"
80 offset="1"
81 style="stop-color:#f0ae26;stop-opacity:1;" />
82 </linearGradient>
83 <linearGradient
84 id="linearGradient4702-3-6">
85 <stop
86 id="stop4704-1"
87 offset="0"
88 style="stop-color:#ff0000;stop-opacity:0.58431375;" />
89 <stop
90 id="stop4706-8"
91 offset="1"
92 style="stop-color:#ffcc00;stop-opacity:1;" />
93 </linearGradient>
94 <color-profile
95 name="Artifex-PS-CMYK-Profile"
96 xlink:href="/usr/share/color/icc/ghostscript/ps_cmyk.icc"
97 id="color-profile27" />
98 <linearGradient
99 y2="69.791016"
100 x2="177.04297"
101 y1="63.65625"
102 x1="142.96875"
103 gradientTransform="matrix(-0.88803314,0,0,0.88803314,595.57001,1106.9291)"
104 gradientUnits="userSpaceOnUse"
105 id="linearGradient3138"
106 xlink:href="#linearGradient4702-3-6" />
107 <linearGradient
108 y2="1043.709"
109 x2="80.655251"
110 y1="1025.709"
111 x1="108.08774"
112 gradientTransform="matrix(-0.49726789,0,0,0.49726789,555.31016,722.70088)"
113 gradientUnits="userSpaceOnUse"
114 id="linearGradient3141"
115 xlink:href="#linearGradient4696-5" />
116 <linearGradient
117 y2="922.07178"
118 x2="78.000107"
119 y1="1004.8033"
120 x1="113.5146"
121 gradientTransform="matrix(0.88803314,0,0,0.88803314,415.18739,350.00262)"
122 gradientUnits="userSpaceOnUse"
123 id="linearGradient3144"
124 xlink:href="#linearGradient4702-3-6" />
125 <linearGradient
126 y2="70.667412"
127 x2="176.60477"
128 y1="63.65625"
129 x1="142.96875"
130 gradientTransform="matrix(0.88803314,0,0,0.88803314,415.2161,1106.9294)"
131 gradientUnits="userSpaceOnUse"
132 id="linearGradient3148"
133 xlink:href="#linearGradient4702-3-6" />
134 <linearGradient
135 y2="70.667412"
136 x2="176.60477"
137 y1="63.65625"
138 x1="142.96875"
139 gradientTransform="matrix(0.88803314,0,0,0.88803314,415.2161,1106.9294)"
140 gradientUnits="userSpaceOnUse"
141 id="linearGradient3780"
142 xlink:href="#linearGradient4702-3-6" />
143 <linearGradient
144 y2="922.07178"
145 x2="78.000107"
146 y1="1004.8033"
147 x1="113.5146"
148 gradientTransform="matrix(0.88803314,0,0,0.88803314,415.18739,350.00262)"
149 gradientUnits="userSpaceOnUse"
150 id="linearGradient3782"
151 xlink:href="#linearGradient4702-3-6" />
152 <linearGradient
153 y2="1043.709"
154 x2="80.655251"
155 y1="1025.709"
156 x1="108.08774"
157 gradientTransform="matrix(-0.49726789,0,0,0.49726789,555.31016,722.70088)"
158 gradientUnits="userSpaceOnUse"
159 id="linearGradient3784"
160 xlink:href="#linearGradient4696-5" />
161 <linearGradient
162 y2="69.791016"
163 x2="177.04297"
164 y1="63.65625"
165 x1="142.96875"
166 gradientTransform="matrix(-0.88803314,0,0,0.88803314,595.57001,1106.9291)"
167 gradientUnits="userSpaceOnUse"
168 id="linearGradient3786"
169 xlink:href="#linearGradient4702-3-6" />
170 <filter
171 id="filter9204"
172 style="color-interpolation-filters:sRGB">
173 <feColorMatrix
174 id="feColorMatrix9194"
175 result="colormatrix"
176 values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 -0.2125 -0.7154 -0.0721 1 0 "
177 in="SourceGraphic" />
178 <feComposite
179 k1="0"
180 id="feComposite9196"
181 result="composite"
182 k4="0"
183 k3="0"
184 k2="1"
185 operator="arithmetic"
186 in2="colormatrix"
187 in="SourceGraphic" />
188 <feGaussianBlur
189 id="feGaussianBlur9198"
190 result="blur1"
191 stdDeviation="5 0.01" />
192 <feGaussianBlur
193 id="feGaussianBlur9200"
194 result="blur2"
195 stdDeviation="0.01 5"
196 in="composite" />
197 <feBlend
198 id="feBlend9202"
199 result="blend"
200 mode="darken"
201 in2="blur1"
202 in="blur2" />
203 </filter>
204 <filter
205 id="filter9330"
206 style="color-interpolation-filters:sRGB">
207 <feGaussianBlur
208 id="feGaussianBlur9328"
209 result="blur"
210 stdDeviation="2 2" />
211 </filter>
212 </defs>
213 <metadata
214 id="metadata7">
215 <rdf:RDF>
216 <cc:Work
217 rdf:about="">
218 <dc:format>image/svg+xml</dc:format>
219 <dc:type
220 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
221 <dc:title>logo for GNUnet</dc:title>
222 <dc:creator>
223 <cc:Agent>
224 <dc:title>Luis Felipe López Acevedo, Amirouche Boubekki, carlo von lynX</dc:title>
225 </cc:Agent>
226 </dc:creator>
227 <dc:rights>
228 <cc:Agent>
229 <dc:title>GNUnet e.V.</dc:title>
230 </cc:Agent>
231 </dc:rights>
232 <cc:license
233 rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
234 <dc:description />
235 </cc:Work>
236 <cc:License
237 rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
238 <cc:permits
239 rdf:resource="http://creativecommons.org/ns#Reproduction" />
240 <cc:permits
241 rdf:resource="http://creativecommons.org/ns#Distribution" />
242 <cc:requires
243 rdf:resource="http://creativecommons.org/ns#Notice" />
244 <cc:requires
245 rdf:resource="http://creativecommons.org/ns#Attribution" />
246 <cc:permits
247 rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
248 <cc:requires
249 rdf:resource="http://creativecommons.org/ns#ShareAlike" />
250 </cc:License>
251 </rdf:RDF>
252 </metadata>
253 <g
254 id="g5346"
255 style="display:none"
256 transform="translate(-387.41463,-609.81931)">
257 <text
258 xml:space="preserve"
259 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.53852463px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.03365779px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
260 x="453.95291"
261 y="869.96057"
262 id="text5344"><tspan
263 id="tspan5342"
264 x="453.95291"
265 y="869.96057"
266 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:49.33333206px;font-family:'Ubuntu Bold';-inkscape-font-specification:'Ubuntu Bold, ';fill:#ffffff;stroke-width:1.03365779px"
267 dx="0 0 0">gnu net</tspan></text>
268 </g>
269 <g
270 transform="translate(-387.41463,-609.81931)"
271 style="display:none"
272 id="g950">
273 <text
274 id="text948"
275 y="869.21057"
276 x="467.77612"
277 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.53852463px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.03365779px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
278 xml:space="preserve"><tspan
279 dx="0 -2.5 -3 0 -19.25 -2.5 -3"
280 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#ffffff;stroke-width:1.03365779px"
281 y="869.21057"
282 x="467.77612"
283 id="tspan946">gnu net</tspan></text>
284 </g>
285 <g
286 id="g941"
287 style="display:none"
288 transform="translate(0,-20)">
289 <ellipse
290 ry="17.690269"
291 rx="17.68549"
292 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#ee0000;stroke-width:1.68696308;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.97635139"
293 id="ellipse937"
294 cx="157.97346"
295 cy="180.65355" />
296 <ellipse
297 ry="17.690269"
298 rx="17.68549"
299 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#ee0000;stroke-width:1.68696308;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.97635139"
300 id="ellipse939"
301 cx="157.97346"
302 cy="111.16864" />
303 </g>
304 <g
305 transform="translate(-387.41463,-609.81931)"
306 style="display:none"
307 id="g935">
308 <g
309 aria-label="gnu net"
310 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.53852463px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.03365779px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;image-rendering:auto"
311 id="g933">
312 <path
313 d="m 423.90503,684.79003 h 22.14128 v 61.61056 q 0,11.55196 4.3855,16.04443 4.38546,4.49242 12.72857,4.49242 12.19374,0 20.00203,-9.94753 7.80828,-9.94753 7.80828,-27.48942 v -44.71046 h 22.14128 v 99.6893 h -22.14128 v -24.92231 q -3.31586,12.83553 -12.30071,20.10899 -8.98489,7.27346 -22.14132,7.27346 -15.29567,0 -23.95963,-9.94753 -8.664,-10.0545 -8.664,-30.59135 z"
314 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#ffffff;stroke-width:4.46906853px"
315 id="path925" />
316 <path
317 d="m 669.48029,784.47933 h -22.14128 v -61.50359 q 0,-11.65892 -4.3855,-16.15139 -4.38546,-4.49243 -12.72857,-4.49243 -12.30071,0 -20.10899,9.94753 -7.70132,9.94754 -7.70132,27.48947 v 44.71041 h -22.14128 v -99.6893 h 22.14128 v 25.02928 q 3.31586,-12.94249 12.30071,-20.10899 8.98489,-7.27346 22.14132,-7.27346 15.29567,0 23.95967,9.94753 8.66396,9.94753 8.66396,30.59135 z"
318 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#ffffff;stroke-width:4.46906853px"
319 id="path927" />
320 </g>
321 </g>
322 <g
323 id="g1296"
324 style="display:none"
325 transform="translate(0,-67.278107)">
326 <path
327 style="fill:none;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
328 d="m 62.698223,85.778107 -39.5,48.000003 v 0 l -1,2"
329 id="path1256" />
330 <path
331 style="fill:none;stroke:#dddddd;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
332 d="m 12.698223,104.77811 10,29 21,-10.5 v 0 0"
333 id="path1258" />
334 <path
335 style="display:inline;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
336 d="m 11.809253,105.24526 63.6227,34.91188 23.31802,-11.09978 -35.03955,28.74946 11.86161,-17.77468 -53.18435,-5.79678 40.95076,23.69646 25.32406,0.49689 24.193047,3.02495 v 48.02104 l 21.04995,-32.14943 -20.559,-15.87161 32.52749,48.02104 -8.06937,31.38386 -24.94907,-31.76198 24.94907,77.51429 22.25436,-36.69889 21.97354,37.07701 -43.59987,-0.37188 41.32877,-28.87448 22.05899,-21.17152 -19.90986,50.171 -3.71591,-29.60613 -8.57843,-31.7682 -9.69437,24.71516 54.37611,-52.19866 -24.96716,8.94671 -18.39175,19.15282 18.27579,-55.07718 25.20812,27.362 20.66591,-41.35238 -46.00204,14.12783 22.94304,-37.07431 23.05297,23.0777 31.8814,-26.48075 40.07874,-25.58708 -15.26372,39.20869 -24.69305,-13.74039 -55.05634,4.03119 79.62738,9.58108 -56.57441,12.73416"
337 id="path1260" />
338 <path
339 style="display:inline;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
340 d="m 98.868943,129.31358 37.045597,48.02106"
341 id="path1262" />
342 <path
343 style="display:inline;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
344 d="m 88.284483,158.4287 10.96248,-29.11512 12.474537,32.51819"
345 id="path1264" />
346 <path
347 style="display:inline;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
348 d="m 212.13974,133.78236 54.69043,-3.64603 -31.75647,27.04795"
349 id="path1266" />
350 <path
351 transform="translate(-387.41463,-542.5412)"
352 style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#dddddd;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
353 d="m 399.11285,648.31931 50.5,-19.5 -14.05,28.1 0.925,-1.725 -5.875,11.75 -0.25,-0.75"
354 id="path1268" />
355 <path
356 transform="translate(-387.41463,-542.5412)"
357 style="display:inline;opacity:1;fill:#729fcf;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
358 d="m 601.57854,741.42859 -2.26809,-64.28015"
359 id="path1270" />
360 <path
361 style="fill:none;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
362 d="m 189.57322,206.52811 -44,2.625 25.375,17.125 v 0"
363 id="path1272" />
364 <path
365 transform="translate(-387.41463,-542.5412)"
366 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
367 d="m 475.69911,700.21367 24.57107,51.42411"
368 id="path1274" />
369 <path
370 transform="translate(-387.41463,-542.5412)"
371 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
372 d="m 534.29164,751.63778 12.85257,40.08057"
373 id="path1276" />
374 <path
375 transform="translate(-387.41463,-542.5412)"
376 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
377 d="m 525.21925,783.02162 0.37803,45.75234"
378 id="path1278" />
379 <path
380 transform="translate(-387.41463,-542.5412)"
381 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
382 d="m 601.95657,742.56293 -12.09653,36.6775"
383 id="path1280" />
384 <path
385 transform="translate(-387.41463,-542.5412)"
386 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
387 d="m 475.69911,700.59178 46.98395,22.0278 10.85256,28.26194"
388 id="path1282" />
389 <path
390 transform="translate(-387.41463,-542.5412)"
391 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
392 d="m 589.104,778.86231 -12.85255,-66.17074 v 36.6775 z"
393 id="path1284" />
394 <path
395 transform="translate(-387.41463,-542.5412)"
396 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
397 d="m 557.35064,768.27501 31.75336,10.5873"
398 id="path1286" />
399 <path
400 transform="translate(-387.41463,-542.5412)"
401 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
402 d="m 500.27018,704.37298 v 48.77728 l 24.57105,30.2495 23.81505,9.45293"
403 id="path1288" />
404 <path
405 transform="translate(-387.41463,-542.5412)"
406 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
407 d="m 524.46323,829.53019 44.98392,-0.37812"
408 id="path1290" />
409 <path
410 transform="translate(-387.41463,-542.5412)"
411 style="display:inline;opacity:1;fill:none;stroke:#dddddd;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
412 d="m 694.61285,647.31931 -40.285,-17.00922 -4.715,-1.99078 29,57.5 v -0.5 0 h 0.5 v 0"
413 id="path1292" />
414 <path
415 transform="translate(-387.41463,-542.5412)"
416 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#dddddd;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
417 d="m 409.92428,677.14844 54.05634,6.0499"
418 id="path1294" />
419 </g>
420 <g
421 transform="translate(0,-67.278107)"
422 style="display:none"
423 id="g1254">
424 <ellipse
425 transform="translate(-387.41463,-542.5412)"
426 ry="4.1593032"
427 rx="4.1581793"
428 cy="829.24042"
429 cx="568.98083"
430 id="ellipse1194"
431 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
432 <ellipse
433 transform="translate(-387.41463,-542.5412)"
434 ry="4.1593032"
435 rx="4.1581793"
436 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
437 id="ellipse1196"
438 cx="588.85413"
439 cy="778.67493" />
440 <ellipse
441 transform="translate(-387.41463,-542.5412)"
442 ry="4.1593032"
443 rx="4.1581793"
444 cy="740.67249"
445 cx="601.57867"
446 id="ellipse1198"
447 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
448 <ellipse
449 transform="translate(-387.41463,-542.5412)"
450 ry="4.1593032"
451 rx="4.1581793"
452 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
453 id="ellipse1200"
454 cx="525.79852"
455 cy="829.24042" />
456 <ellipse
457 transform="translate(-387.41463,-542.5412)"
458 ry="4.1593032"
459 rx="4.1581793"
460 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
461 id="ellipse1202"
462 cx="557.82654"
463 cy="768.71582" />
464 <ellipse
465 transform="translate(-387.41463,-542.5412)"
466 ry="4.1593032"
467 rx="4.1581793"
468 cy="783.02173"
469 cx="525.21936"
470 id="ellipse1204"
471 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
472 <ellipse
473 transform="translate(-387.41463,-542.5412)"
474 ry="4.1593032"
475 rx="4.1581793"
476 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
477 id="ellipse1206"
478 cx="400.09586"
479 cy="647.34271" />
480 <ellipse
481 transform="translate(-387.41463,-542.5412)"
482 ry="4.1593032"
483 rx="4.1581793"
484 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
485 id="ellipse1208"
486 cx="450.11285"
487 cy="628.31934" />
488 <ellipse
489 transform="translate(-387.41463,-542.5412)"
490 ry="4.1593032"
491 rx="4.1581793"
492 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
493 id="ellipse1210"
494 cx="622.36951"
495 cy="699.45752" />
496 <ellipse
497 transform="translate(-387.41463,-542.5412)"
498 ry="4.1593032"
499 rx="4.1581793"
500 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
501 id="ellipse1212"
502 cx="547.21771"
503 cy="792.29773" />
504 <ellipse
505 transform="translate(-387.41463,-542.5412)"
506 ry="4.1593032"
507 rx="4.1581793"
508 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
509 id="ellipse1214"
510 cx="566.20697"
511 cy="800.12549" />
512 <ellipse
513 transform="translate(-387.41463,-542.5412)"
514 ry="4.1593032"
515 rx="4.1581793"
516 cy="751.63794"
517 cx="500.64822"
518 id="ellipse1216"
519 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
520 <ellipse
521 transform="translate(-387.41463,-542.5412)"
522 ry="4.1593032"
523 rx="4.1581793"
524 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
525 id="ellipse1218"
526 cx="533.33447"
527 cy="751.72632" />
528 <ellipse
529 transform="translate(-387.41463,-542.5412)"
530 ry="4.1593032"
531 rx="4.1581793"
532 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
533 id="ellipse1220"
534 cx="450.75012"
535 cy="699.83545" />
536 <ellipse
537 transform="translate(-387.41463,-542.5412)"
538 ry="4.1593032"
539 rx="4.1581793"
540 cy="700.59174"
541 cx="476.07718"
542 id="ellipse1222"
543 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
544 <ellipse
545 transform="translate(-387.41463,-542.5412)"
546 ry="4.1593032"
547 rx="4.1581793"
548 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
549 id="ellipse1224"
550 cx="521.49146"
551 cy="719.65314" />
552 <ellipse
553 transform="translate(-387.41463,-542.5412)"
554 ry="4.1593032"
555 rx="4.1581793"
556 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
557 id="ellipse1226"
558 cx="500.6362"
559 cy="703.87305" />
560 <ellipse
561 ry="4.1593032"
562 rx="4.1581793"
563 cy="134.28851"
564 cx="211.9584"
565 id="ellipse1228"
566 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
567 <ellipse
568 transform="translate(-387.41463,-542.5412)"
569 ry="4.1593032"
570 rx="4.1581793"
571 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
572 id="ellipse1230"
573 cx="576.62964"
574 cy="713.44794" />
575 <ellipse
576 ry="4.1593032"
577 rx="4.1581793"
578 cy="123.16669"
579 cx="43.166531"
580 id="ellipse1232"
581 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
582 <ellipse
583 ry="4.1593032"
584 rx="4.1581793"
585 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
586 id="ellipse1234"
587 cx="98.865997"
588 cy="129.43542" />
589 <ellipse
590 ry="4.1593032"
591 rx="4.1581793"
592 cy="130.05022"
593 cx="267.08618"
594 id="ellipse1236"
595 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
596 <ellipse
597 transform="translate(-387.41463,-542.5412)"
598 ry="4.1593032"
599 rx="4.1581793"
600 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
601 id="ellipse1238"
602 cx="679.07196"
603 cy="686.22339" />
604 <ellipse
605 transform="translate(-387.41463,-542.5412)"
606 ry="4.1593032"
607 rx="4.1581793"
608 cy="748.99109"
609 cx="577.00763"
610 id="ellipse1240"
611 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
612 <ellipse
613 transform="translate(-387.41463,-542.5412)"
614 ry="4.1593032"
615 rx="4.1581793"
616 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
617 id="ellipse1242"
618 cx="577.00763"
619 cy="748.99109" />
620 <ellipse
621 transform="translate(-387.41463,-542.5412)"
622 ry="4.1593032"
623 rx="4.1581793"
624 cy="748.99109"
625 cx="577.07013"
626 id="ellipse1244"
627 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
628 <ellipse
629 transform="translate(0,-3e-6)"
630 ry="4.1593032"
631 rx="4.1581793"
632 cy="133.85095"
633 cx="22.887779"
634 id="ellipse1246"
635 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
636 <ellipse
637 transform="translate(-387.41463,-542.5412)"
638 ry="4.1593032"
639 rx="4.1581793"
640 cy="682.1922"
641 cx="462.47165"
642 id="ellipse1248"
643 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
644 <ellipse
645 transform="translate(-387.41463,-542.5412)"
646 ry="4.1593032"
647 rx="4.1581793"
648 cy="647.3053"
649 cx="694.58264"
650 id="ellipse1250"
651 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
652 <ellipse
653 transform="translate(-387.41463,-542.5412)"
654 ry="4.1593032"
655 rx="4.1581793"
656 style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#eeeeee;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
657 id="ellipse1252"
658 cx="649.61285"
659 cy="628.31934" />
660 </g>
661 <g
662 transform="translate(0,-67.278107)"
663 style="display:inline"
664 id="g1533">
665 <path
666 id="path1493"
667 d="m 62.698223,85.778107 -39.5,48.000003 v 0 l -1,2"
668 style="fill:none;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
669 <path
670 id="path1495"
671 d="m 12.698223,104.77811 10,29 21,-10.5 v 0 0"
672 style="fill:none;stroke:#3399cc;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
673 <path
674 id="path1497"
675 d="m 11.809253,105.24526 63.6227,34.91188 23.31802,-11.09978 -35.03955,28.74946 11.86161,-17.77468 -53.18435,-5.79678 40.95076,23.69646 25.32406,0.49689 24.193047,3.02495 v 48.02104 l 21.04995,-32.14943 -20.559,-15.87161 32.52749,48.02104 -8.06937,31.38386 -24.94907,-31.76198 24.94907,77.51429 22.25436,-36.69889 21.97354,37.07701 -43.59987,-0.37188 41.32877,-28.87448 22.05899,-21.17152 -19.90986,50.171 -3.71591,-29.60613 -8.57843,-31.7682 -9.69437,24.71516 54.37611,-52.19866 -24.96716,8.94671 -18.39175,19.15282 18.27579,-55.07718 25.20812,27.362 20.66591,-41.35238 -46.00204,14.12783 22.94304,-37.07431 23.05297,23.0777 31.8814,-26.48075 40.07874,-25.58708 -15.26372,39.20869 -24.69305,-13.74039 -55.05634,4.03119 79.62738,9.58108 -56.57441,12.73416"
676 style="display:inline;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
677 <path
678 id="path1499"
679 d="m 98.868943,129.31358 37.045597,48.02106"
680 style="display:inline;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
681 <path
682 id="path1501"
683 d="m 88.284483,158.4287 10.96248,-29.11512 12.474537,32.51819"
684 style="display:inline;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
685 <path
686 id="path1503"
687 d="m 212.13974,133.78236 54.69043,-3.64603 -31.75647,27.04795"
688 style="display:inline;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
689 <path
690 id="path1505"
691 d="m 399.11285,648.31931 50.5,-19.5 -14.05,28.1 0.925,-1.725 -5.875,11.75 -0.25,-0.75"
692 style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#3399cc;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
693 transform="translate(-387.41463,-542.5412)" />
694 <path
695 id="path1507"
696 d="m 601.57854,741.42859 -2.26809,-64.28015"
697 style="display:inline;opacity:1;fill:#729fcf;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
698 transform="translate(-387.41463,-542.5412)" />
699 <path
700 id="path1509"
701 d="m 189.57322,206.52811 -44,2.625 25.375,17.125 v 0"
702 style="fill:none;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
703 <path
704 id="path1511"
705 d="m 475.69911,700.21367 24.57107,51.42411"
706 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
707 transform="translate(-387.41463,-542.5412)" />
708 <path
709 id="path1513"
710 d="m 534.29164,751.63778 12.85257,40.08057"
711 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
712 transform="translate(-387.41463,-542.5412)" />
713 <path
714 id="path1515"
715 d="m 525.21925,783.02162 0.37803,45.75234"
716 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
717 transform="translate(-387.41463,-542.5412)" />
718 <path
719 id="path1517"
720 d="m 601.95657,742.56293 -12.09653,36.6775"
721 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
722 transform="translate(-387.41463,-542.5412)" />
723 <path
724 id="path1519"
725 d="m 475.69911,700.59178 46.98395,22.0278 10.85256,28.26194"
726 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
727 transform="translate(-387.41463,-542.5412)" />
728 <path
729 id="path1521"
730 d="m 589.104,778.86231 -12.85255,-66.17074 v 36.6775 z"
731 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
732 transform="translate(-387.41463,-542.5412)" />
733 <path
734 id="path1523"
735 d="m 557.35064,768.27501 31.75336,10.5873"
736 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
737 transform="translate(-387.41463,-542.5412)" />
738 <path
739 id="path1525"
740 d="m 500.27018,704.37298 v 48.77728 l 24.57105,30.2495 23.81505,9.45293"
741 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
742 transform="translate(-387.41463,-542.5412)" />
743 <path
744 id="path1527"
745 d="m 524.46323,829.53019 44.98392,-0.37812"
746 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
747 transform="translate(-387.41463,-542.5412)" />
748 <path
749 id="path1529"
750 d="m 694.61285,647.31931 -40.285,-17.00922 -4.715,-1.99078 29,57.5 v -0.5 0 h 0.5 v 0"
751 style="display:inline;opacity:1;fill:none;stroke:#3399cc;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
752 transform="translate(-387.41463,-542.5412)" />
753 <path
754 id="path1531"
755 d="m 409.92428,677.14844 54.05634,6.0499"
756 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#3399cc;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
757 transform="translate(-387.41463,-542.5412)" />
758 </g>
759 <g
760 id="g1491"
761 style="display:inline"
762 transform="translate(0,-67.278107)">
763 <ellipse
764 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
765 id="ellipse1431"
766 cx="568.98083"
767 cy="829.24042"
768 rx="4.1581793"
769 ry="4.1593032"
770 transform="translate(-387.41463,-542.5412)" />
771 <ellipse
772 cy="778.67493"
773 cx="588.85413"
774 id="ellipse1433"
775 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
776 rx="4.1581793"
777 ry="4.1593032"
778 transform="translate(-387.41463,-542.5412)" />
779 <ellipse
780 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
781 id="ellipse1435"
782 cx="601.57867"
783 cy="740.67249"
784 rx="4.1581793"
785 ry="4.1593032"
786 transform="translate(-387.41463,-542.5412)" />
787 <ellipse
788 cy="829.24042"
789 cx="525.79852"
790 id="ellipse1437"
791 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
792 rx="4.1581793"
793 ry="4.1593032"
794 transform="translate(-387.41463,-542.5412)" />
795 <ellipse
796 cy="768.71582"
797 cx="557.82654"
798 id="ellipse1439"
799 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
800 rx="4.1581793"
801 ry="4.1593032"
802 transform="translate(-387.41463,-542.5412)" />
803 <ellipse
804 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
805 id="ellipse1441"
806 cx="525.21936"
807 cy="783.02173"
808 rx="4.1581793"
809 ry="4.1593032"
810 transform="translate(-387.41463,-542.5412)" />
811 <ellipse
812 cy="647.34271"
813 cx="400.09586"
814 id="ellipse1443"
815 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
816 rx="4.1581793"
817 ry="4.1593032"
818 transform="translate(-387.41463,-542.5412)" />
819 <ellipse
820 cy="628.31934"
821 cx="450.11285"
822 id="ellipse1445"
823 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
824 rx="4.1581793"
825 ry="4.1593032"
826 transform="translate(-387.41463,-542.5412)" />
827 <ellipse
828 cy="699.45752"
829 cx="622.36951"
830 id="ellipse1447"
831 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
832 rx="4.1581793"
833 ry="4.1593032"
834 transform="translate(-387.41463,-542.5412)" />
835 <ellipse
836 cy="792.29773"
837 cx="547.21771"
838 id="ellipse1449"
839 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
840 rx="4.1581793"
841 ry="4.1593032"
842 transform="translate(-387.41463,-542.5412)" />
843 <ellipse
844 cy="800.12549"
845 cx="566.20697"
846 id="ellipse1451"
847 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
848 rx="4.1581793"
849 ry="4.1593032"
850 transform="translate(-387.41463,-542.5412)" />
851 <ellipse
852 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
853 id="ellipse1453"
854 cx="500.64822"
855 cy="751.63794"
856 rx="4.1581793"
857 ry="4.1593032"
858 transform="translate(-387.41463,-542.5412)" />
859 <ellipse
860 cy="751.72632"
861 cx="533.33447"
862 id="ellipse1455"
863 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
864 rx="4.1581793"
865 ry="4.1593032"
866 transform="translate(-387.41463,-542.5412)" />
867 <ellipse
868 cy="699.83545"
869 cx="450.75012"
870 id="ellipse1457"
871 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
872 rx="4.1581793"
873 ry="4.1593032"
874 transform="translate(-387.41463,-542.5412)" />
875 <ellipse
876 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
877 id="ellipse1459"
878 cx="476.07718"
879 cy="700.59174"
880 rx="4.1581793"
881 ry="4.1593032"
882 transform="translate(-387.41463,-542.5412)" />
883 <ellipse
884 cy="719.65314"
885 cx="521.49146"
886 id="ellipse1461"
887 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
888 rx="4.1581793"
889 ry="4.1593032"
890 transform="translate(-387.41463,-542.5412)" />
891 <ellipse
892 cy="703.87305"
893 cx="500.6362"
894 id="ellipse1463"
895 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
896 rx="4.1581793"
897 ry="4.1593032"
898 transform="translate(-387.41463,-542.5412)" />
899 <ellipse
900 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
901 id="ellipse1465"
902 cx="211.9584"
903 cy="134.28851"
904 rx="4.1581793"
905 ry="4.1593032" />
906 <ellipse
907 cy="713.44794"
908 cx="576.62964"
909 id="ellipse1467"
910 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
911 rx="4.1581793"
912 ry="4.1593032"
913 transform="translate(-387.41463,-542.5412)" />
914 <ellipse
915 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
916 id="ellipse1469"
917 cx="43.166531"
918 cy="123.16669"
919 rx="4.1581793"
920 ry="4.1593032" />
921 <ellipse
922 cy="129.43542"
923 cx="98.865997"
924 id="ellipse1471"
925 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
926 rx="4.1581793"
927 ry="4.1593032" />
928 <ellipse
929 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
930 id="ellipse1473"
931 cx="267.08618"
932 cy="130.05022"
933 rx="4.1581793"
934 ry="4.1593032" />
935 <ellipse
936 cy="686.22339"
937 cx="679.07196"
938 id="ellipse1475"
939 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
940 rx="4.1581793"
941 ry="4.1593032"
942 transform="translate(-387.41463,-542.5412)" />
943 <ellipse
944 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
945 id="ellipse1477"
946 cx="577.00763"
947 cy="748.99109"
948 rx="4.1581793"
949 ry="4.1593032"
950 transform="translate(-387.41463,-542.5412)" />
951 <ellipse
952 cy="748.99109"
953 cx="577.00763"
954 id="ellipse1479"
955 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
956 rx="4.1581793"
957 ry="4.1593032"
958 transform="translate(-387.41463,-542.5412)" />
959 <ellipse
960 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
961 id="ellipse1481"
962 cx="577.07013"
963 cy="748.99109"
964 rx="4.1581793"
965 ry="4.1593032"
966 transform="translate(-387.41463,-542.5412)" />
967 <ellipse
968 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
969 id="ellipse1483"
970 cx="22.887779"
971 cy="133.85095"
972 rx="4.1581793"
973 ry="4.1593032"
974 transform="translate(0,-3e-6)" />
975 <ellipse
976 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
977 id="ellipse1485"
978 cx="462.47165"
979 cy="682.1922"
980 rx="4.1581793"
981 ry="4.1593032"
982 transform="translate(-387.41463,-542.5412)" />
983 <ellipse
984 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
985 id="ellipse1487"
986 cx="694.58264"
987 cy="647.3053"
988 rx="4.1581793"
989 ry="4.1593032"
990 transform="translate(-387.41463,-542.5412)" />
991 <ellipse
992 cy="628.31934"
993 cx="649.61285"
994 id="ellipse1489"
995 style="display:inline;opacity:1;fill:#419edb;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
996 rx="4.1581793"
997 ry="4.1593032"
998 transform="translate(-387.41463,-542.5412)" />
999 </g>
1000 <g
1001 id="g1539"
1002 style="display:inline"
1003 transform="translate(0,-20)">
1004 <ellipse
1005 ry="4.1593032"
1006 rx="4.1581793"
1007 style="display:inline;opacity:1;fill:#3399cc;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1008 id="ellipse1535"
1009 cx="159.80099"
1010 cy="276.32968" />
1011 <ellipse
1012 ry="4.1593032"
1013 rx="4.1581793"
1014 style="display:inline;opacity:1;fill:#3399cc;fill-opacity:1;stroke:#3399cc;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1015 id="ellipse1537"
1016 cx="159.80099"
1017 cy="259.99252" />
1018 </g>
1019 <g
1020 transform="translate(0,-67.278107)"
1021 style="display:none"
1022 id="layer3">
1023 <path
1024 id="path5313"
1025 d="m 62.698223,85.778107 -39.5,48.000003 v 0 l -1,2"
1026 style="fill:none;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1027 <path
1028 id="path5311"
1029 d="m 12.698223,104.77811 10,29 21,-10.5 v 0 0"
1030 style="fill:none;stroke:#cc0000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1031 <path
1032 id="path9316"
1033 d="m 11.809253,105.24526 63.6227,34.91188 23.31802,-11.09978 -35.03955,28.74946 11.86161,-17.77468 -53.18435,-5.79678 40.95076,23.69646 25.32406,0.49689 24.193047,3.02495 v 48.02104 l 21.04995,-32.14943 -20.559,-15.87161 32.52749,48.02104 -8.06937,31.38386 -24.94907,-31.76198 24.94907,77.51429 22.25436,-36.69889 21.97354,37.07701 -43.59987,-0.37188 41.32877,-28.87448 22.05899,-21.17152 -19.90986,50.171 -3.71591,-29.60613 -8.57843,-31.7682 -9.69437,24.71516 54.37611,-52.19866 -24.96716,8.94671 -18.39175,19.15282 18.27579,-55.07718 25.20812,27.362 20.66591,-41.35238 -46.00204,14.12783 22.94304,-37.07431 23.05297,23.0777 31.8814,-26.48075 40.07874,-25.58708 -15.26372,39.20869 -24.69305,-13.74039 -55.05634,4.03119 79.62738,9.58108 -56.57441,12.73416"
1034 style="display:inline;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1035 <path
1036 id="path9318"
1037 d="m 98.868943,129.31358 37.045597,48.02106"
1038 style="display:inline;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1039 <path
1040 id="path12058"
1041 d="m 88.284483,158.4287 10.96248,-29.11512 12.474537,32.51819"
1042 style="display:inline;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1043 <path
1044 id="path12250"
1045 d="m 212.13974,133.78236 54.69043,-3.64603 -31.75647,27.04795"
1046 style="display:inline;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1047 <path
1048 id="path5161"
1049 d="m 399.11285,648.31931 50.5,-19.5 -14.05,28.1 0.925,-1.725 -5.875,11.75 -0.25,-0.75"
1050 style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#cc0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1051 transform="translate(-387.41463,-542.5412)" />
1052 <path
1053 id="path12206"
1054 d="m 601.57854,741.42859 -2.26809,-64.28015"
1055 style="display:inline;opacity:1;fill:#729fcf;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1056 transform="translate(-387.41463,-542.5412)" />
1057 <path
1058 id="path5331"
1059 d="m 189.57322,206.52811 -44,2.625 25.375,17.125 v 0"
1060 style="fill:none;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
1061 <path
1062 id="path9320"
1063 d="m 475.69911,700.21367 24.57107,51.42411"
1064 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1065 transform="translate(-387.41463,-542.5412)" />
1066 <path
1067 id="path9322"
1068 d="m 534.29164,751.63778 12.85257,40.08057"
1069 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1070 transform="translate(-387.41463,-542.5412)" />
1071 <path
1072 id="path9324"
1073 d="m 525.21925,783.02162 0.37803,45.75234"
1074 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1075 transform="translate(-387.41463,-542.5412)" />
1076 <path
1077 id="path9326"
1078 d="m 601.95657,742.56293 -12.09653,36.6775"
1079 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1080 transform="translate(-387.41463,-542.5412)" />
1081 <path
1082 id="path12060"
1083 d="m 475.69911,700.59178 46.98395,22.0278 10.85256,28.26194"
1084 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1085 transform="translate(-387.41463,-542.5412)" />
1086 <path
1087 id="path12208"
1088 d="m 589.104,778.86231 -12.85255,-66.17074 v 36.6775 z"
1089 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843"
1090 transform="translate(-387.41463,-542.5412)" />
1091 <path
1092 id="path12210"
1093 d="m 557.35064,768.27501 31.75336,10.5873"
1094 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843"
1095 transform="translate(-387.41463,-542.5412)" />
1096 <path
1097 id="path12212"
1098 d="m 500.27018,704.37298 v 48.77728 l 24.57105,30.2495 23.81505,9.45293"
1099 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843"
1100 transform="translate(-387.41463,-542.5412)" />
1101 <path
1102 id="path12216"
1103 d="m 524.46323,829.53019 44.98392,-0.37812"
1104 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1105 transform="translate(-387.41463,-542.5412)" />
1106 <path
1107 id="path5163"
1108 d="m 694.61285,647.31931 -40.285,-17.00922 -4.715,-1.99078 29,57.5 v -0.5 0 h 0.5 v 0"
1109 style="display:inline;opacity:1;fill:none;stroke:#cc0000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
1110 transform="translate(-387.41463,-542.5412)" />
1111 <path
1112 id="path12214"
1113 d="m 409.92428,677.14844 54.05634,6.0499"
1114 style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:1.58654225px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843"
1115 transform="translate(-387.41463,-542.5412)" />
1116 </g>
1117 <g
1118 id="g325"
1119 style="display:none"
1120 transform="translate(0,-67.278107)">
1121 <ellipse
1122 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1123 id="ellipse12254"
1124 cx="568.98083"
1125 cy="829.24042"
1126 rx="4.1581793"
1127 ry="4.1593032"
1128 transform="translate(-387.41463,-542.5412)" />
1129 <ellipse
1130 cy="778.67493"
1131 cx="588.85413"
1132 id="ellipse12290"
1133 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1134 rx="4.1581793"
1135 ry="4.1593032"
1136 transform="translate(-387.41463,-542.5412)" />
1137 <ellipse
1138 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1139 id="ellipse12284"
1140 cx="601.57867"
1141 cy="740.67249"
1142 rx="4.1581793"
1143 ry="4.1593032"
1144 transform="translate(-387.41463,-542.5412)" />
1145 <ellipse
1146 cy="829.24042"
1147 cx="525.79852"
1148 id="ellipse12256"
1149 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1150 rx="4.1581793"
1151 ry="4.1593032"
1152 transform="translate(-387.41463,-542.5412)" />
1153 <ellipse
1154 cy="768.71582"
1155 cx="557.82654"
1156 id="ellipse12306"
1157 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1158 rx="4.1581793"
1159 ry="4.1593032"
1160 transform="translate(-387.41463,-542.5412)" />
1161 <ellipse
1162 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1163 id="ellipse12280"
1164 cx="525.21936"
1165 cy="783.02173"
1166 rx="4.1581793"
1167 ry="4.1593032"
1168 transform="translate(-387.41463,-542.5412)" />
1169 <ellipse
1170 cy="647.34271"
1171 cx="400.09586"
1172 id="ellipse12258"
1173 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1174 rx="4.1581793"
1175 ry="4.1593032"
1176 transform="translate(-387.41463,-542.5412)" />
1177 <ellipse
1178 cy="628.31934"
1179 cx="450.11285"
1180 id="ellipse12258-3"
1181 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1182 rx="4.1581793"
1183 ry="4.1593032"
1184 transform="translate(-387.41463,-542.5412)" />
1185 <ellipse
1186 cy="699.45752"
1187 cx="622.36951"
1188 id="ellipse12294"
1189 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1190 rx="4.1581793"
1191 ry="4.1593032"
1192 transform="translate(-387.41463,-542.5412)" />
1193 <ellipse
1194 cy="792.29773"
1195 cx="547.21771"
1196 id="ellipse12252"
1197 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1198 rx="4.1581793"
1199 ry="4.1593032"
1200 transform="translate(-387.41463,-542.5412)" />
1201 <ellipse
1202 cy="800.12549"
1203 cx="566.20697"
1204 id="ellipse12282"
1205 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1206 rx="4.1581793"
1207 ry="4.1593032"
1208 transform="translate(-387.41463,-542.5412)" />
1209 <ellipse
1210 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1211 id="ellipse12276"
1212 cx="500.64822"
1213 cy="751.63794"
1214 rx="4.1581793"
1215 ry="4.1593032"
1216 transform="translate(-387.41463,-542.5412)" />
1217 <ellipse
1218 cy="751.72632"
1219 cx="533.33447"
1220 id="ellipse12278"
1221 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1222 rx="4.1581793"
1223 ry="4.1593032"
1224 transform="translate(-387.41463,-542.5412)" />
1225 <ellipse
1226 cy="699.83545"
1227 cx="450.75012"
1228 id="ellipse12262"
1229 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1230 rx="4.1581793"
1231 ry="4.1593032"
1232 transform="translate(-387.41463,-542.5412)" />
1233 <ellipse
1234 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1235 id="ellipse12268"
1236 cx="476.07718"
1237 cy="700.59174"
1238 rx="4.1581793"
1239 ry="4.1593032"
1240 transform="translate(-387.41463,-542.5412)" />
1241 <ellipse
1242 cy="719.65314"
1243 cx="521.49146"
1244 id="ellipse12270"
1245 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1246 rx="4.1581793"
1247 ry="4.1593032"
1248 transform="translate(-387.41463,-542.5412)" />
1249 <ellipse
1250 cy="703.87305"
1251 cx="500.6362"
1252 id="ellipse12274"
1253 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1254 rx="4.1581793"
1255 ry="4.1593032"
1256 transform="translate(-387.41463,-542.5412)" />
1257 <ellipse
1258 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1259 id="ellipse12292"
1260 cx="211.9584"
1261 cy="134.28851"
1262 rx="4.1581793"
1263 ry="4.1593032" />
1264 <ellipse
1265 cy="713.44794"
1266 cx="576.62964"
1267 id="ellipse12286"
1268 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1269 rx="4.1581793"
1270 ry="4.1593032"
1271 transform="translate(-387.41463,-542.5412)" />
1272 <ellipse
1273 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1274 id="ellipse12260"
1275 cx="43.166531"
1276 cy="123.16669"
1277 rx="4.1581793"
1278 ry="4.1593032" />
1279 <ellipse
1280 cy="129.43542"
1281 cx="98.865997"
1282 id="ellipse12266"
1283 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1284 rx="4.1581793"
1285 ry="4.1593032" />
1286 <ellipse
1287 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1288 id="ellipse12296"
1289 cx="267.08618"
1290 cy="130.05022"
1291 rx="4.1581793"
1292 ry="4.1593032" />
1293 <ellipse
1294 cy="686.22339"
1295 cx="679.07196"
1296 id="ellipse12298"
1297 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1298 rx="4.1581793"
1299 ry="4.1593032"
1300 transform="translate(-387.41463,-542.5412)" />
1301 <ellipse
1302 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1303 id="ellipse12288"
1304 cx="577.00763"
1305 cy="748.99109"
1306 rx="4.1581793"
1307 ry="4.1593032"
1308 transform="translate(-387.41463,-542.5412)" />
1309 <ellipse
1310 cy="748.99109"
1311 cx="577.00763"
1312 id="ellipse12302"
1313 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1314 rx="4.1581793"
1315 ry="4.1593032"
1316 transform="translate(-387.41463,-542.5412)" />
1317 <ellipse
1318 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1319 id="ellipse12304"
1320 cx="577.07013"
1321 cy="748.99109"
1322 rx="4.1581793"
1323 ry="4.1593032"
1324 transform="translate(-387.41463,-542.5412)" />
1325 <ellipse
1326 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1327 id="ellipse12264"
1328 cx="22.887779"
1329 cy="133.85095"
1330 rx="4.1581793"
1331 ry="4.1593032"
1332 transform="translate(0,-3e-6)" />
1333 <ellipse
1334 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1335 id="ellipse12272"
1336 cx="462.47165"
1337 cy="682.1922"
1338 rx="4.1581793"
1339 ry="4.1593032"
1340 transform="translate(-387.41463,-542.5412)" />
1341 <ellipse
1342 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1343 id="ellipse12300"
1344 cx="694.58264"
1345 cy="647.3053"
1346 rx="4.1581793"
1347 ry="4.1593032"
1348 transform="translate(-387.41463,-542.5412)" />
1349 <ellipse
1350 cy="628.31934"
1351 cx="649.61285"
1352 id="ellipse12258-3-0"
1353 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#cc0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
1354 rx="4.1581793"
1355 ry="4.1593032"
1356 transform="translate(-387.41463,-542.5412)" />
1357 </g>
1358 <g
1359 transform="translate(0,-20)"
1360 style="display:none"
1361 id="layer6">
1362 <ellipse
1363 cy="276.32968"
1364 cx="159.80099"
1365 id="ellipse12282-8-9-0"
1366 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#ee0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.97635139"
1367 rx="4.1581793"
1368 ry="4.1593032" />
1369 <ellipse
1370 cy="259.99252"
1371 cx="159.80099"
1372 id="ellipse12282-8-9"
1373 style="display:inline;opacity:1;fill:#ee0000;fill-opacity:1;stroke:#ee0000;stroke-width:0.39663559;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.97635139"
1374 rx="4.1581793"
1375 ry="4.1593032" />
1376 </g>
1377 <g
1378 id="g975"
1379 style="display:inline"
1380 transform="translate(-387.41463,-609.81931)">
1381 <g
1382 id="text973"
1383 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.53852463px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.03365779px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;image-rendering:auto"
1384 aria-label="gnu net">
1385 <path
1386 id="path977"
1387 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1388 d="m 489.62118,868.96318 q 0,2.375 -0.81641,4.23046 -0.81641,1.85547 -2.30078,3.14193 -1.45964,1.28646 -3.46354,1.95443 -1.97917,0.69271 -4.42839,0.69271 -6.01172,0 -10.26693,-3.63672 l 2.42448,-3.95834 q 3.53776,3.04297 7.84245,3.04297 2.64714,0 4.25521,-1.31119 1.63281,-1.28646 1.63281,-4.0573 v -2.47395 q -1.58333,1.36067 -3.04297,2.02864 -1.45963,0.64323 -3.38932,0.64323 -2.22656,0 -4.13151,-0.9401 -1.90495,-0.94011 -3.29037,-2.54818 -1.36067,-1.63281 -2.15234,-3.78516 -0.76693,-2.15234 -0.76693,-4.57682 0,-2.42448 0.76693,-4.57682 0.79167,-2.17709 2.15234,-3.76042 1.38542,-1.60807 3.29037,-2.52344 1.90495,-0.9401 4.13151,-0.9401 1.92969,0 3.4388,0.66797 1.50912,0.64323 2.99349,1.95442 v -2.07812 h 5.1211 z m -5.1211,-16.67448 q -0.91536,-1.01433 -2.375,-1.53386 -1.43489,-0.54427 -2.79557,-0.54427 -2.89453,0 -4.70052,2.02865 -1.78125,2.02864 -1.78125,5.17057 0,1.55859 0.47005,2.89453 0.49479,1.3112 1.33594,2.27604 0.86588,0.96485 2.05338,1.53386 1.21224,0.54427 2.6224,0.54427 1.36068,0 2.79557,-0.54427 1.45964,-0.56901 2.375,-1.58334 z" />
1389 <path
1390 id="path979"
1391 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1392 d="m 514.82951,869.21057 h -5.12109 v -14.22526 q 0,-2.69661 -1.01433,-3.73568 -1.01432,-1.03906 -2.94401,-1.03906 -2.84505,0 -4.65104,2.30078 -1.78125,2.30078 -1.78125,6.35808 v 10.34114 h -5.12109 v -23.05729 h 5.12109 v 5.78906 q 0.76693,-2.99349 2.84505,-4.65104 2.07813,-1.68229 5.1211,-1.68229 3.53776,0 5.54166,2.30078 2.00391,2.30078 2.00391,7.07552 z" />
1393 <path
1394 id="path981"
1395 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1396 d="m 518.90503,846.15328 h 5.12109 v 14.25 q 0,2.67187 1.01433,3.71094 1.01432,1.03906 2.94401,1.03906 2.82031,0 4.6263,-2.30078 1.80599,-2.30078 1.80599,-6.35807 v -10.34115 h 5.12109 v 23.05729 h -5.12109 v -5.76432 q -0.76693,2.96875 -2.84505,4.65104 -2.07813,1.68229 -5.1211,1.68229 -3.53776,0 -5.54166,-2.30078 -2.00391,-2.32552 -2.00391,-7.07552 z" />
1397 <path
1398 id="path983"
1399 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1400 d="m 575.70451,869.21057 h -5.12109 v -14.22526 q 0,-2.69661 -1.01433,-3.73568 -1.01432,-1.03906 -2.94401,-1.03906 -2.84505,0 -4.65104,2.30078 -1.78125,2.30078 -1.78125,6.35808 v 10.34114 h -5.12109 v -23.05729 h 5.12109 v 5.78906 q 0.76693,-2.99349 2.84505,-4.65104 2.07813,-1.68229 5.1211,-1.68229 3.53776,0 5.54167,2.30078 2.0039,2.30078 2.0039,7.07552 z" />
1401 <path
1402 id="path985"
1403 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1404 d="m 583.76832,859.63635 q 0.37109,2.375 2.2513,3.95834 1.90495,1.55859 5.09635,1.55859 2.4987,0 4.32943,-0.76693 1.85547,-0.79166 3.19141,-2.07812 l 2.62239,3.61198 q -2.22656,2.22656 -4.72526,3.04297 -2.47396,0.8164 -5.41797,0.8164 -2.67187,0 -4.97265,-0.89062 -2.30079,-0.89063 -3.98308,-2.47396 -1.68229,-1.60807 -2.64713,-3.8099 -0.94011,-2.20182 -0.94011,-4.89844 0,-2.62239 0.86589,-4.82421 0.89062,-2.22657 2.47396,-3.83464 1.60807,-1.63281 3.83463,-2.52344 2.22657,-0.91536 4.92318,-0.91536 2.79557,0 5.07161,0.96484 2.27605,0.94011 3.88412,2.7461 1.63281,1.80599 2.54818,4.42838 0.91536,2.59766 0.91536,5.88802 z m 13.53255,-4.5026 q -0.39584,-2.22656 -2.30078,-3.5625 -1.90495,-1.36068 -4.32943,-1.36068 -2.42448,0 -4.35417,1.36068 -1.92968,1.33594 -2.32552,3.5625 z" />
1405 <path
1406 id="path987"
1407 style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.66666794px;font-family:'Anonymous Pro';-inkscape-font-specification:'Anonymous Pro Bold';fill:#292929;stroke-width:1.03365779px;fill-opacity:1"
1408 d="m 627.08081,861.86291 q -0.39583,3.63672 -2.86979,5.78907 -2.44922,2.1276 -6.13542,2.1276 -2.02864,0 -3.71094,-0.66797 -1.68229,-0.66797 -2.86979,-1.85547 -1.1875,-1.1875 -1.85547,-2.84505 -0.64322,-1.68229 -0.64322,-3.66146 v -9.97005 h -5.22006 v -4.6263 h 5.22006 v -9.22787 h 5.12109 v 9.22787 h 9.67318 v 4.6263 h -9.67318 v 9.97005 q 0,2.22657 1.08854,3.31511 1.08854,1.08854 2.86979,1.08854 2.17709,0 3.24089,-1.26172 1.0638,-1.26172 1.26172,-3.04297 z" />
1409 </g>
1410 </g>
1411</svg>
diff --git a/contrib/gnunet-arch-full.svg b/contrib/gnunet-arch-full.svg
new file mode 100644
index 000000000..766f2b855
--- /dev/null
+++ b/contrib/gnunet-arch-full.svg
@@ -0,0 +1,648 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4<!-- Generated by graphviz version 2.38.0 (20140413.2041)
5 -->
6<!-- Title: dependencies Pages: 1 -->
7<svg width="1277pt" height="836pt"
8 viewBox="0.00 0.00 1276.81 836.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 832)">
10<title>dependencies</title>
11<polygon fill="white" stroke="none" points="-4,4 -4,-832 1272.81,-832 1272.81,4 -4,4"/>
12<!-- voting -->
13<g id="node1" class="node"><title>voting</title>
14<polygon fill="none" stroke="black" points="120.944,-743.562 80,-756 39.0559,-743.562 39.0942,-723.438 120.906,-723.438 120.944,-743.562"/>
15<text text-anchor="middle" x="80" y="-734.3" font-family="Times,serif" font-size="14.00">voting</text>
16</g>
17<!-- consensus -->
18<g id="node2" class="node"><title>consensus</title>
19<ellipse fill="none" stroke="black" cx="112" cy="-594" rx="46.2923" ry="18"/>
20<text text-anchor="middle" x="112" y="-590.3" font-family="Times,serif" font-size="14.00">consensus</text>
21</g>
22<!-- voting&#45;&gt;consensus -->
23<g id="edge1" class="edge"><title>voting&#45;&gt;consensus</title>
24<path fill="none" stroke="black" d="M121.028,-728.482C145.315,-721.103 174.155,-707.724 189,-684 197.487,-670.436 196.445,-662.162 189,-648 180.933,-632.654 166.19,-620.887 151.748,-612.383"/>
25<polygon fill="black" stroke="black" points="153.308,-609.247 142.857,-607.508 149.942,-615.385 153.308,-609.247"/>
26</g>
27<!-- identity -->
28<g id="node3" class="node"><title>identity</title>
29<ellipse fill="none" stroke="black" cx="282" cy="-450" rx="37.8943" ry="18"/>
30<text text-anchor="middle" x="282" y="-446.3" font-family="Times,serif" font-size="14.00">identity</text>
31</g>
32<!-- voting&#45;&gt;identity -->
33<g id="edge2" class="edge"><title>voting&#45;&gt;identity</title>
34<path fill="none" stroke="black" d="M58.5145,-723.377C45.8789,-714.02 31.0387,-700.353 24,-684 5.02284,-639.911 -2.50901,-616.016 24,-576 46.6577,-541.798 71.8444,-557.396 109,-540 158.351,-516.894 214.207,-487.564 248.77,-469.032"/>
35<polygon fill="black" stroke="black" points="250.781,-471.924 257.931,-464.105 247.466,-465.759 250.781,-471.924"/>
36</g>
37<!-- cadet -->
38<g id="node4" class="node"><title>cadet</title>
39<ellipse fill="none" stroke="black" cx="538" cy="-450" rx="29.4969" ry="18"/>
40<text text-anchor="middle" x="538" y="-446.3" font-family="Times,serif" font-size="14.00">cadet</text>
41</g>
42<!-- voting&#45;&gt;cadet -->
43<g id="edge3" class="edge"><title>voting&#45;&gt;cadet</title>
44<path fill="none" stroke="black" d="M72.0051,-723.243C55.682,-693.149 22.8306,-620.604 57,-576 70.8829,-557.877 390.653,-484.265 500.977,-459.316"/>
45<polygon fill="black" stroke="black" points="501.999,-462.673 510.983,-457.057 500.458,-455.845 501.999,-462.673"/>
46</g>
47<!-- secretsharing -->
48<g id="node5" class="node"><title>secretsharing</title>
49<ellipse fill="none" stroke="black" cx="123" cy="-666" rx="57.3905" ry="18"/>
50<text text-anchor="middle" x="123" y="-662.3" font-family="Times,serif" font-size="14.00">secretsharing</text>
51</g>
52<!-- voting&#45;&gt;secretsharing -->
53<g id="edge4" class="edge"><title>voting&#45;&gt;secretsharing</title>
54<path fill="none" stroke="black" d="M88.4954,-723.17C93.8716,-714.418 100.986,-702.837 107.357,-692.466"/>
55<polygon fill="black" stroke="black" points="110.45,-694.117 112.702,-683.764 104.486,-690.453 110.45,-694.117"/>
56</g>
57<!-- consensus&#45;&gt;cadet -->
58<g id="edge72" class="edge"><title>consensus&#45;&gt;cadet</title>
59<path fill="none" stroke="black" d="M146.507,-581.905C153.275,-579.85 160.34,-577.79 167,-576 236.135,-557.417 256.193,-562.96 324,-540 360.547,-527.625 367.474,-519.056 403,-504 437.068,-489.562 476.509,-474.236 503.927,-463.798"/>
60<polygon fill="black" stroke="black" points="505.344,-467.004 513.453,-460.185 502.862,-460.459 505.344,-467.004"/>
61</g>
62<!-- set -->
63<g id="node24" class="node"><title>set</title>
64<ellipse fill="none" stroke="black" cx="517" cy="-522" rx="27" ry="18"/>
65<text text-anchor="middle" x="517" y="-518.3" font-family="Times,serif" font-size="14.00">set</text>
66</g>
67<!-- consensus&#45;&gt;set -->
68<g id="edge71" class="edge"><title>consensus&#45;&gt;set</title>
69<path fill="none" stroke="black" d="M145.818,-581.678C152.772,-579.596 160.083,-577.583 167,-576 182.24,-572.511 394.44,-541.075 480.815,-528.33"/>
70<polygon fill="black" stroke="black" points="481.561,-531.758 490.943,-526.837 480.539,-524.833 481.561,-531.758"/>
71</g>
72<!-- dht -->
73<g id="node7" class="node"><title>dht</title>
74<ellipse fill="none" stroke="black" cx="756" cy="-378" rx="27" ry="18"/>
75<text text-anchor="middle" x="756" y="-374.3" font-family="Times,serif" font-size="14.00">dht</text>
76</g>
77<!-- cadet&#45;&gt;dht -->
78<g id="edge51" class="edge"><title>cadet&#45;&gt;dht</title>
79<path fill="none" stroke="black" d="M563.434,-440.833C602.822,-428.186 678.592,-403.856 722.428,-389.78"/>
80<polygon fill="black" stroke="black" points="723.607,-393.078 732.058,-386.688 721.467,-386.413 723.607,-393.078"/>
81</g>
82<!-- core -->
83<g id="node8" class="node"><title>core</title>
84<ellipse fill="none" stroke="black" cx="555" cy="-234" rx="27" ry="18"/>
85<text text-anchor="middle" x="555" y="-230.3" font-family="Times,serif" font-size="14.00">core</text>
86</g>
87<!-- cadet&#45;&gt;core -->
88<g id="edge50" class="edge"><title>cadet&#45;&gt;core</title>
89<path fill="none" stroke="black" d="M539.362,-431.849C542.303,-394.832 549.266,-307.181 552.824,-262.386"/>
90<polygon fill="black" stroke="black" points="556.328,-262.478 553.631,-252.232 549.35,-261.924 556.328,-262.478"/>
91</g>
92<!-- block -->
93<g id="node11" class="node"><title>block</title>
94<polygon fill="none" stroke="black" points="429,-324 385.598,-306 429,-288 472.402,-306 429,-324"/>
95<text text-anchor="middle" x="429" y="-302.3" font-family="Times,serif" font-size="14.00">block</text>
96</g>
97<!-- cadet&#45;&gt;block -->
98<g id="edge52" class="edge"><title>cadet&#45;&gt;block</title>
99<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M522.106,-434.467C511.33,-424.227 497.085,-409.913 486,-396 469.058,-374.736 452.633,-348.272 441.802,-329.75"/>
100<polygon fill="blue" stroke="blue" points="444.702,-327.773 436.674,-320.859 438.638,-331.27 444.702,-327.773"/>
101</g>
102<!-- secretsharing&#45;&gt;consensus -->
103<g id="edge5" class="edge"><title>secretsharing&#45;&gt;consensus</title>
104<path fill="none" stroke="black" d="M120.281,-647.697C119.069,-639.983 117.612,-630.712 116.261,-622.112"/>
105<polygon fill="black" stroke="black" points="119.698,-621.44 114.688,-612.104 112.783,-622.526 119.698,-621.44"/>
106</g>
107<!-- fs -->
108<g id="node6" class="node"><title>fs</title>
109<polygon fill="none" stroke="black" points="100,-527.562 73,-540 46,-527.562 46.0252,-507.438 99.9748,-507.438 100,-527.562"/>
110<text text-anchor="middle" x="73" y="-518.3" font-family="Times,serif" font-size="14.00">fs</text>
111</g>
112<!-- fs&#45;&gt;identity -->
113<g id="edge12" class="edge"><title>fs&#45;&gt;identity</title>
114<path fill="none" stroke="black" d="M100.21,-509.307C104.786,-507.46 109.507,-505.625 114,-504 164.764,-485.643 178.566,-484.387 230,-468 233.971,-466.735 238.108,-465.404 242.237,-464.067"/>
115<polygon fill="black" stroke="black" points="243.351,-467.386 251.778,-460.965 241.186,-460.729 243.351,-467.386"/>
116</g>
117<!-- fs&#45;&gt;cadet -->
118<g id="edge9" class="edge"><title>fs&#45;&gt;cadet</title>
119<path fill="none" stroke="black" d="M100.01,-516.934C178.772,-505.077 408.387,-470.512 499.803,-456.75"/>
120<polygon fill="black" stroke="black" points="500.372,-460.204 509.74,-455.254 499.33,-453.282 500.372,-460.204"/>
121</g>
122<!-- fs&#45;&gt;dht -->
123<g id="edge6" class="edge"><title>fs&#45;&gt;dht</title>
124<path fill="none" stroke="black" d="M100.081,-509.411C132.571,-495.433 183.726,-473.164 192,-468 213.144,-454.802 212.035,-441.688 235,-432 322.67,-395.017 615.27,-383.079 719.081,-379.955"/>
125<polygon fill="black" stroke="black" points="719.199,-383.453 729.093,-379.664 718.996,-376.456 719.199,-383.453"/>
126</g>
127<!-- fs&#45;&gt;core -->
128<g id="edge7" class="edge"><title>fs&#45;&gt;core</title>
129<path fill="none" stroke="black" d="M65.0877,-507.277C55.5997,-488.827 42.6595,-455.618 57,-432 93.0072,-372.699 269.007,-312.27 334,-288 397.135,-264.424 474.404,-248.714 518.841,-240.869"/>
130<polygon fill="black" stroke="black" points="519.614,-244.287 528.871,-239.134 518.42,-237.39 519.614,-244.287"/>
131</g>
132<!-- datastore -->
133<g id="node9" class="node"><title>datastore</title>
134<ellipse fill="none" stroke="black" cx="108" cy="-450" rx="42.4939" ry="18"/>
135<text text-anchor="middle" x="108" y="-446.3" font-family="Times,serif" font-size="14.00">datastore</text>
136</g>
137<!-- fs&#45;&gt;datastore -->
138<g id="edge8" class="edge"><title>fs&#45;&gt;datastore</title>
139<path fill="none" stroke="black" d="M79.9149,-507.17C84.2467,-498.507 89.9645,-487.071 95.1098,-476.78"/>
140<polygon fill="black" stroke="black" points="98.2763,-478.274 99.618,-467.764 92.0153,-475.143 98.2763,-478.274"/>
141</g>
142<!-- ats -->
143<g id="node10" class="node"><title>ats</title>
144<ellipse fill="none" stroke="black" cx="385" cy="-90" rx="27" ry="18"/>
145<text text-anchor="middle" x="385" y="-86.3" font-family="Times,serif" font-size="14.00">ats</text>
146</g>
147<!-- fs&#45;&gt;ats -->
148<g id="edge10" class="edge"><title>fs&#45;&gt;ats</title>
149<path fill="none" stroke="black" d="M60.2844,-507.296C39.3694,-483.267 0,-431.113 0,-379 0,-379 0,-379 0,-233 0,-159.097 252.872,-111.714 348.742,-96.4063"/>
150<polygon fill="black" stroke="black" points="349.504,-99.8296 358.84,-94.8203 348.418,-92.9144 349.504,-99.8296"/>
151</g>
152<!-- fs&#45;&gt;block -->
153<g id="edge11" class="edge"><title>fs&#45;&gt;block</title>
154<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M99.0792,-507.426C116.81,-497.613 140.343,-483.417 159,-468 175.732,-454.174 174.815,-445.258 192,-432 259.224,-380.139 351.062,-338.689 398.245,-319.166"/>
155<polygon fill="blue" stroke="blue" points="399.679,-322.361 407.611,-315.337 397.03,-315.881 399.679,-322.361"/>
156</g>
157<!-- dht&#45;&gt;core -->
158<g id="edge42" class="edge"><title>dht&#45;&gt;core</title>
159<path fill="none" stroke="black" d="M780.722,-370.233C802.496,-362.816 832.877,-348.569 847,-324 854.974,-310.128 857.48,-300.09 847,-288 810.092,-245.421 650.341,-266.908 596,-252 592.628,-251.075 589.164,-249.944 585.745,-248.709"/>
160<polygon fill="black" stroke="black" points="586.936,-245.416 576.348,-245.037 584.388,-251.936 586.936,-245.416"/>
161</g>
162<!-- dht&#45;&gt;block -->
163<g id="edge44" class="edge"><title>dht&#45;&gt;block</title>
164<path fill="none" stroke="black" d="M730.132,-372.774C681.84,-364.697 574.817,-345.908 486,-324 478.104,-322.052 469.673,-319.694 461.782,-317.363"/>
165<polygon fill="black" stroke="black" points="462.742,-313.997 452.157,-314.456 460.718,-320.698 462.742,-313.997"/>
166</g>
167<!-- nse -->
168<g id="node27" class="node"><title>nse</title>
169<ellipse fill="none" stroke="black" cx="811" cy="-306" rx="27" ry="18"/>
170<text text-anchor="middle" x="811" y="-302.3" font-family="Times,serif" font-size="14.00">nse</text>
171</g>
172<!-- dht&#45;&gt;nse -->
173<g id="edge43" class="edge"><title>dht&#45;&gt;nse</title>
174<path fill="none" stroke="black" d="M767.934,-361.811C775.214,-352.546 784.663,-340.52 792.854,-330.094"/>
175<polygon fill="black" stroke="black" points="795.663,-332.185 799.089,-322.159 790.159,-327.86 795.663,-332.185"/>
176</g>
177<!-- datacache -->
178<g id="node28" class="node"><title>datacache</title>
179<polygon fill="none" stroke="black" points="702,-324 637.818,-306 702,-288 766.182,-306 702,-324"/>
180<text text-anchor="middle" x="702" y="-302.3" font-family="Times,serif" font-size="14.00">datacache</text>
181</g>
182<!-- dht&#45;&gt;datacache -->
183<g id="edge45" class="edge"><title>dht&#45;&gt;datacache</title>
184<path fill="none" stroke="black" d="M744.016,-361.465C736.66,-351.93 727.125,-339.57 718.998,-329.034"/>
185<polygon fill="black" stroke="black" points="721.73,-326.846 712.851,-321.066 716.187,-331.121 721.73,-326.846"/>
186</g>
187<!-- peerinfo -->
188<g id="node29" class="node"><title>peerinfo</title>
189<ellipse fill="none" stroke="black" cx="518" cy="-90" rx="40.0939" ry="18"/>
190<text text-anchor="middle" x="518" y="-86.3" font-family="Times,serif" font-size="14.00">peerinfo</text>
191</g>
192<!-- dht&#45;&gt;peerinfo -->
193<g id="edge46" class="edge"><title>dht&#45;&gt;peerinfo</title>
194<path fill="none" stroke="black" d="M728.828,-376.457C687.438,-374.282 608.033,-364.658 557,-324 495.436,-274.952 504.26,-168.494 512.535,-118.27"/>
195<polygon fill="black" stroke="black" points="516.027,-118.624 514.32,-108.168 509.133,-117.406 516.027,-118.624"/>
196</g>
197<!-- hello -->
198<g id="node30" class="node"><title>hello</title>
199<polygon fill="none" stroke="black" points="854,-36 813.614,-18 854,-3.55271e-15 894.386,-18 854,-36"/>
200<text text-anchor="middle" x="854" y="-14.3" font-family="Times,serif" font-size="14.00">hello</text>
201</g>
202<!-- dht&#45;&gt;hello -->
203<g id="edge47" class="edge"><title>dht&#45;&gt;hello</title>
204<path fill="none" stroke="black" d="M782.364,-373.864C833.24,-367.278 942.225,-350.399 968,-324 996.322,-294.992 988,-275.542 988,-235 988,-235 988,-235 988,-161 988,-99.7534 921.245,-54.2239 881.968,-32.736"/>
205<polygon fill="black" stroke="black" points="883.108,-29.3792 872.632,-27.796 879.834,-35.5665 883.108,-29.3792"/>
206</g>
207<!-- transport -->
208<g id="node33" class="node"><title>transport</title>
209<ellipse fill="none" stroke="black" cx="680" cy="-162" rx="42.4939" ry="18"/>
210<text text-anchor="middle" x="680" y="-158.3" font-family="Times,serif" font-size="14.00">transport</text>
211</g>
212<!-- core&#45;&gt;transport -->
213<g id="edge58" class="edge"><title>core&#45;&gt;transport</title>
214<path fill="none" stroke="black" d="M575.083,-221.753C594.251,-211.02 623.495,-194.643 646.244,-181.903"/>
215<polygon fill="black" stroke="black" points="648.219,-184.809 655.234,-176.869 644.799,-178.701 648.219,-184.809"/>
216</g>
217<!-- exit -->
218<g id="node12" class="node"><title>exit</title>
219<polygon fill="none" stroke="black" points="952,-540 898,-540 898,-504 952,-504 952,-540"/>
220<text text-anchor="middle" x="925" y="-518.3" font-family="Times,serif" font-size="14.00">exit</text>
221</g>
222<!-- exit&#45;&gt;cadet -->
223<g id="edge13" class="edge"><title>exit&#45;&gt;cadet</title>
224<path fill="none" stroke="black" d="M897.67,-514.323C883.742,-511.021 866.513,-507.093 851,-504 752.337,-484.331 635.236,-465.765 576.155,-456.729"/>
225<polygon fill="black" stroke="black" points="576.571,-453.252 566.158,-455.206 575.517,-460.172 576.571,-453.252"/>
226</g>
227<!-- tun -->
228<g id="node13" class="node"><title>tun</title>
229<polygon fill="none" stroke="black" points="929,-468 897.995,-450 929,-432 960.005,-450 929,-468"/>
230<text text-anchor="middle" x="929" y="-446.3" font-family="Times,serif" font-size="14.00">tun</text>
231</g>
232<!-- exit&#45;&gt;tun -->
233<g id="edge14" class="edge"><title>exit&#45;&gt;tun</title>
234<path fill="none" stroke="black" d="M925.989,-503.697C926.436,-495.868 926.975,-486.435 927.473,-477.728"/>
235<polygon fill="black" stroke="black" points="930.974,-477.806 928.05,-467.622 923.985,-477.406 930.974,-477.806"/>
236</g>
237<!-- dnsstub -->
238<g id="node14" class="node"><title>dnsstub</title>
239<polygon fill="none" stroke="black" points="1032,-468 978.877,-450 1032,-432 1085.12,-450 1032,-468"/>
240<text text-anchor="middle" x="1032" y="-446.3" font-family="Times,serif" font-size="14.00">dnsstub</text>
241</g>
242<!-- exit&#45;&gt;dnsstub -->
243<g id="edge15" class="edge"><title>exit&#45;&gt;dnsstub</title>
244<path fill="none" stroke="black" d="M951.175,-503.876C967.88,-492.948 989.443,-478.841 1006.1,-467.947"/>
245<polygon fill="black" stroke="black" points="1008.33,-470.67 1014.78,-462.266 1004.49,-464.812 1008.33,-470.67"/>
246</g>
247<!-- vpn -->
248<g id="node15" class="node"><title>vpn</title>
249<ellipse fill="none" stroke="black" cx="815" cy="-522" rx="27" ry="18"/>
250<text text-anchor="middle" x="815" y="-518.3" font-family="Times,serif" font-size="14.00">vpn</text>
251</g>
252<!-- vpn&#45;&gt;cadet -->
253<g id="edge16" class="edge"><title>vpn&#45;&gt;cadet</title>
254<path fill="none" stroke="black" d="M793.129,-511.116C787.017,-508.578 780.317,-506.003 774,-504 705.524,-482.293 623.185,-465.931 576.085,-457.463"/>
255<polygon fill="black" stroke="black" points="576.482,-453.979 566.025,-455.678 575.26,-460.871 576.482,-453.979"/>
256</g>
257<!-- vpn&#45;&gt;tun -->
258<g id="edge18" class="edge"><title>vpn&#45;&gt;tun</title>
259<path fill="none" stroke="black" d="M834.339,-509.125C854.149,-496.961 884.945,-478.051 905.995,-465.126"/>
260<polygon fill="black" stroke="black" points="907.942,-468.038 914.632,-459.822 904.279,-462.072 907.942,-468.038"/>
261</g>
262<!-- regex -->
263<g id="node16" class="node"><title>regex</title>
264<ellipse fill="none" stroke="black" cx="756" cy="-450" rx="30.5947" ry="18"/>
265<text text-anchor="middle" x="756" y="-446.3" font-family="Times,serif" font-size="14.00">regex</text>
266</g>
267<!-- vpn&#45;&gt;regex -->
268<g id="edge17" class="edge"><title>vpn&#45;&gt;regex</title>
269<path fill="none" stroke="black" d="M802.198,-505.811C794.496,-496.673 784.53,-484.849 775.827,-474.524"/>
270<polygon fill="black" stroke="black" points="778.307,-472.035 769.186,-466.644 772.954,-476.546 778.307,-472.035"/>
271</g>
272<!-- regex&#45;&gt;dht -->
273<g id="edge57" class="edge"><title>regex&#45;&gt;dht</title>
274<path fill="none" stroke="black" d="M756,-431.697C756,-423.983 756,-414.712 756,-406.112"/>
275<polygon fill="black" stroke="black" points="759.5,-406.104 756,-396.104 752.5,-406.104 759.5,-406.104"/>
276</g>
277<!-- regex&#45;&gt;block -->
278<g id="edge49" class="edge"><title>regex&#45;&gt;block</title>
279<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M732.22,-438.673C673.767,-413.29 523.157,-347.888 458.838,-319.957"/>
280<polygon fill="blue" stroke="blue" points="459.85,-316.581 449.283,-315.808 457.061,-323.002 459.85,-316.581"/>
281</g>
282<!-- pt -->
283<g id="node17" class="node"><title>pt</title>
284<polygon fill="none" stroke="black" points="986,-599.562 959,-612 932,-599.562 932.025,-579.438 985.975,-579.438 986,-599.562"/>
285<text text-anchor="middle" x="959" y="-590.3" font-family="Times,serif" font-size="14.00">pt</text>
286</g>
287<!-- pt&#45;&gt;cadet -->
288<g id="edge19" class="edge"><title>pt&#45;&gt;cadet</title>
289<path fill="none" stroke="black" d="M931.717,-579.439C928.807,-578.197 925.864,-577.023 923,-576 860.875,-553.809 836.841,-571.725 779,-540 758.602,-528.812 761.339,-515.294 741,-504 688.34,-474.76 619.008,-461.18 576.516,-455.23"/>
290<polygon fill="black" stroke="black" points="576.951,-451.758 566.577,-453.91 576.029,-458.697 576.951,-451.758"/>
291</g>
292<!-- pt&#45;&gt;vpn -->
293<g id="edge20" class="edge"><title>pt&#45;&gt;vpn</title>
294<path fill="none" stroke="black" d="M931.915,-579.834C907.352,-567.894 871.179,-550.309 845.585,-537.868"/>
295<polygon fill="black" stroke="black" points="846.864,-534.598 836.34,-533.373 843.803,-540.893 846.864,-534.598"/>
296</g>
297<!-- dns -->
298<g id="node18" class="node"><title>dns</title>
299<ellipse fill="none" stroke="black" cx="997" cy="-522" rx="27" ry="18"/>
300<text text-anchor="middle" x="997" y="-518.3" font-family="Times,serif" font-size="14.00">dns</text>
301</g>
302<!-- pt&#45;&gt;dns -->
303<g id="edge21" class="edge"><title>pt&#45;&gt;dns</title>
304<path fill="none" stroke="black" d="M966.508,-579.17C971.277,-570.385 977.594,-558.748 983.241,-548.346"/>
305<polygon fill="black" stroke="black" points="986.48,-549.716 988.175,-539.257 980.328,-546.376 986.48,-549.716"/>
306</g>
307<!-- dnsparser -->
308<g id="node19" class="node"><title>dnsparser</title>
309<polygon fill="none" stroke="black" points="1143,-540 1080.49,-522 1143,-504 1205.51,-522 1143,-540"/>
310<text text-anchor="middle" x="1143" y="-518.3" font-family="Times,serif" font-size="14.00">dnsparser</text>
311</g>
312<!-- pt&#45;&gt;dnsparser -->
313<g id="edge22" class="edge"><title>pt&#45;&gt;dnsparser</title>
314<path fill="none" stroke="black" d="M986.15,-582.671C1018.5,-570.365 1072.61,-549.781 1108.05,-536.296"/>
315<polygon fill="black" stroke="black" points="1109.42,-539.521 1117.52,-532.694 1106.93,-532.979 1109.42,-539.521"/>
316</g>
317<!-- dns&#45;&gt;tun -->
318<g id="edge23" class="edge"><title>dns&#45;&gt;tun</title>
319<path fill="none" stroke="black" d="M982.91,-506.496C972.543,-495.824 958.362,-481.226 947.147,-469.681"/>
320<polygon fill="black" stroke="black" points="949.418,-466.995 939.94,-462.261 944.397,-471.873 949.418,-466.995"/>
321</g>
322<!-- dns&#45;&gt;dnsstub -->
323<g id="edge24" class="edge"><title>dns&#45;&gt;dnsstub</title>
324<path fill="none" stroke="black" d="M1005.12,-504.765C1009.59,-495.828 1015.21,-484.573 1020.16,-474.673"/>
325<polygon fill="black" stroke="black" points="1023.3,-476.227 1024.64,-465.717 1017.04,-473.096 1023.3,-476.227"/>
326</g>
327<!-- gnsrecord -->
328<g id="node25" class="node"><title>gnsrecord</title>
329<ellipse fill="none" stroke="black" cx="1192" cy="-450" rx="45.4919" ry="18"/>
330<text text-anchor="middle" x="1192" y="-446.3" font-family="Times,serif" font-size="14.00">gnsrecord</text>
331</g>
332<!-- dnsparser&#45;&gt;gnsrecord -->
333<g id="edge39" class="edge"><title>dnsparser&#45;&gt;gnsrecord</title>
334<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M1152.92,-506.834C1159.12,-497.971 1167.29,-486.304 1174.55,-475.928"/>
335<polygon fill="blue" stroke="blue" points="1177.51,-477.805 1180.38,-467.606 1171.77,-473.791 1177.51,-477.805"/>
336</g>
337<!-- zonemaster -->
338<g id="node20" class="node"><title>zonemaster</title>
339<polygon fill="none" stroke="black" points="914.433,-599.562 851,-612 787.567,-599.562 787.626,-579.438 914.374,-579.438 914.433,-599.562"/>
340<text text-anchor="middle" x="851" y="-590.3" font-family="Times,serif" font-size="14.00">zonemaster</text>
341</g>
342<!-- zonemaster&#45;&gt;dht -->
343<g id="edge26" class="edge"><title>zonemaster&#45;&gt;dht</title>
344<path fill="none" stroke="black" d="M853.642,-579.298C856.499,-561.438 859.583,-529.479 851,-504 836.849,-461.994 802.343,-422.916 779.052,-399.996"/>
345<polygon fill="black" stroke="black" points="781.264,-397.267 771.628,-392.861 776.413,-402.314 781.264,-397.267"/>
346</g>
347<!-- namestore -->
348<g id="node21" class="node"><title>namestore</title>
349<ellipse fill="none" stroke="black" cx="685" cy="-522" rx="47.3916" ry="18"/>
350<text text-anchor="middle" x="685" y="-518.3" font-family="Times,serif" font-size="14.00">namestore</text>
351</g>
352<!-- zonemaster&#45;&gt;namestore -->
353<g id="edge25" class="edge"><title>zonemaster&#45;&gt;namestore</title>
354<path fill="none" stroke="black" d="M818.599,-579.337C791.812,-568.041 753.653,-551.95 724.971,-539.855"/>
355<polygon fill="black" stroke="black" points="726.212,-536.58 715.637,-535.919 723.492,-543.03 726.212,-536.58"/>
356</g>
357<!-- namestore&#45;&gt;identity -->
358<g id="edge37" class="edge"><title>namestore&#45;&gt;identity</title>
359<path fill="none" stroke="black" d="M642.634,-513.641C566.046,-500.338 405.247,-472.408 326.867,-458.793"/>
360<polygon fill="black" stroke="black" points="327.275,-455.312 316.823,-457.049 326.077,-462.208 327.275,-455.312"/>
361</g>
362<!-- namestore&#45;&gt;gnsrecord -->
363<g id="edge38" class="edge"><title>namestore&#45;&gt;gnsrecord</title>
364<path fill="none" stroke="black" d="M726.085,-512.971C742.503,-509.919 761.609,-506.564 779,-504 918.405,-483.451 954.522,-488.05 1094,-468 1109.42,-465.784 1126.13,-463.019 1141.32,-460.368"/>
365<polygon fill="black" stroke="black" points="1142.32,-463.746 1151.56,-458.558 1141.1,-456.853 1142.32,-463.746"/>
366</g>
367<!-- gns -->
368<g id="node22" class="node"><title>gns</title>
369<ellipse fill="none" stroke="black" cx="850" cy="-666" rx="27" ry="18"/>
370<text text-anchor="middle" x="850" y="-662.3" font-family="Times,serif" font-size="14.00">gns</text>
371</g>
372<!-- gns&#45;&gt;identity -->
373<g id="edge34" class="edge"><title>gns&#45;&gt;identity</title>
374<path fill="none" stroke="black" d="M823.048,-663.899C740.091,-660.169 489.801,-646.281 417,-612 395.952,-602.089 396.543,-591.28 379,-576 359.686,-559.178 350.742,-559.383 334,-540 317.464,-520.856 303.335,-495.717 293.996,-477.041"/>
375<polygon fill="black" stroke="black" points="297.085,-475.39 289.562,-467.93 290.791,-478.453 297.085,-475.39"/>
376</g>
377<!-- gns&#45;&gt;dht -->
378<g id="edge28" class="edge"><title>gns&#45;&gt;dht</title>
379<path fill="none" stroke="black" d="M870.511,-653.985C875.467,-651.699 880.829,-649.525 886,-648 1002.11,-613.746 1046.93,-664.524 1156,-612 1236.59,-573.194 1305.75,-498.559 1246,-432 1215.85,-398.416 902.601,-384.19 793.343,-380.225"/>
380<polygon fill="black" stroke="black" points="793.243,-376.719 783.125,-379.863 792.995,-383.715 793.243,-376.719"/>
381</g>
382<!-- gns&#45;&gt;block -->
383<g id="edge29" class="edge"><title>gns&#45;&gt;block</title>
384<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M822.824,-664.872C770.707,-663.582 654.321,-655.598 569,-612 548.284,-601.414 548.925,-590.83 531,-576 509.902,-558.544 496.079,-562.857 481,-540 438.212,-475.142 430.206,-380.324 428.985,-334.208"/>
385<polygon fill="blue" stroke="blue" points="432.483,-334.033 428.808,-324.096 425.484,-334.156 432.483,-334.033"/>
386</g>
387<!-- gns&#45;&gt;dnsstub -->
388<g id="edge33" class="edge"><title>gns&#45;&gt;dnsstub</title>
389<path fill="none" stroke="black" d="M871.065,-654.325C875.905,-652.077 881.078,-649.834 886,-648 941.778,-627.217 973.486,-654.658 1015,-612 1049.82,-576.222 1044.5,-512.583 1037.99,-476.971"/>
390<polygon fill="black" stroke="black" points="1041.36,-476 1035.97,-466.88 1034.5,-477.373 1041.36,-476"/>
391</g>
392<!-- gns&#45;&gt;vpn -->
393<g id="edge31" class="edge"><title>gns&#45;&gt;vpn</title>
394<path fill="none" stroke="black" d="M827.858,-655.35C811.041,-646.688 789.135,-632.213 779,-612 768.086,-590.233 781.353,-564.325 794.756,-546.091"/>
395<polygon fill="black" stroke="black" points="797.832,-547.84 801.242,-537.808 792.321,-543.524 797.832,-547.84"/>
396</g>
397<!-- gns&#45;&gt;dns -->
398<g id="edge27" class="edge"><title>gns&#45;&gt;dns</title>
399<path fill="none" stroke="black" d="M871.13,-654.496C875.967,-652.239 881.122,-649.949 886,-648 933.377,-629.072 964.65,-653.009 995,-612 1008.03,-594.39 1007.25,-568.995 1003.95,-549.835"/>
400<polygon fill="black" stroke="black" points="1007.35,-549.022 1001.93,-539.921 1000.49,-550.418 1007.35,-549.022"/>
401</g>
402<!-- gns&#45;&gt;dnsparser -->
403<g id="edge32" class="edge"><title>gns&#45;&gt;dnsparser</title>
404<path fill="none" stroke="black" d="M870.586,-654.227C875.54,-651.931 880.881,-649.692 886,-648 963.461,-622.391 995.505,-653.066 1066,-612 1093.37,-596.054 1115.84,-566.774 1129.29,-546.163"/>
405<polygon fill="black" stroke="black" points="1132.29,-547.978 1134.66,-537.654 1126.37,-544.243 1132.29,-547.978"/>
406</g>
407<!-- revocation -->
408<g id="node23" class="node"><title>revocation</title>
409<ellipse fill="none" stroke="black" cx="474" cy="-594" rx="48.1917" ry="18"/>
410<text text-anchor="middle" x="474" y="-590.3" font-family="Times,serif" font-size="14.00">revocation</text>
411</g>
412<!-- gns&#45;&gt;revocation -->
413<g id="edge30" class="edge"><title>gns&#45;&gt;revocation</title>
414<path fill="none" stroke="black" d="M823.776,-661.482C769.658,-654.024 641.808,-635.374 536,-612 531.019,-610.9 525.841,-609.65 520.694,-608.34"/>
415<polygon fill="black" stroke="black" points="521.456,-604.922 510.895,-605.77 519.68,-611.693 521.456,-604.922"/>
416</g>
417<!-- gns&#45;&gt;gnsrecord -->
418<g id="edge41" class="edge"><title>gns&#45;&gt;gnsrecord</title>
419<path fill="none" stroke="black" d="M870.549,-654.113C875.504,-651.822 880.856,-649.613 886,-648 978.027,-619.137 1009.84,-646.249 1100,-612 1156.37,-590.587 1185.79,-592.754 1215,-540 1225.98,-520.174 1217.7,-494.957 1208.15,-476.431"/>
420<polygon fill="black" stroke="black" points="1211.2,-474.717 1203.29,-467.672 1205.08,-478.114 1211.2,-474.717"/>
421</g>
422<!-- revocation&#45;&gt;core -->
423<g id="edge35" class="edge"><title>revocation&#45;&gt;core</title>
424<path fill="none" stroke="black" d="M447.586,-578.755C410.639,-556.683 348,-510.49 348,-451 348,-451 348,-451 348,-377 348,-335.398 347.208,-317.038 377,-288 415.046,-250.916 477.859,-239.613 517.794,-236.267"/>
425<polygon fill="black" stroke="black" points="518.191,-239.747 527.918,-235.547 517.695,-232.765 518.191,-239.747"/>
426</g>
427<!-- revocation&#45;&gt;set -->
428<g id="edge36" class="edge"><title>revocation&#45;&gt;set</title>
429<path fill="none" stroke="black" d="M484.409,-576.055C489.683,-567.469 496.183,-556.888 501.987,-547.439"/>
430<polygon fill="black" stroke="black" points="505.024,-549.182 507.276,-538.829 499.06,-545.518 505.024,-549.182"/>
431</g>
432<!-- set&#45;&gt;cadet -->
433<g id="edge75" class="edge"><title>set&#45;&gt;cadet</title>
434<path fill="none" stroke="black" d="M522.084,-504.055C524.482,-496.059 527.401,-486.331 530.08,-477.4"/>
435<polygon fill="black" stroke="black" points="533.442,-478.373 532.963,-467.789 526.737,-476.362 533.442,-478.373"/>
436</g>
437<!-- conversation -->
438<g id="node26" class="node"><title>conversation</title>
439<polygon fill="none" stroke="black" points="1017.18,-743.562 948,-756 878.82,-743.562 878.884,-723.438 1017.12,-723.438 1017.18,-743.562"/>
440<text text-anchor="middle" x="948" y="-734.3" font-family="Times,serif" font-size="14.00">conversation</text>
441</g>
442<!-- conversation&#45;&gt;cadet -->
443<g id="edge53" class="edge"><title>conversation&#45;&gt;cadet</title>
444<path fill="none" stroke="black" d="M900.537,-723.335C873.864,-714.435 840.677,-701.257 814,-684 756.206,-646.615 759.329,-615.558 703,-576 673.069,-554.981 658.318,-561.866 629,-540 611.601,-527.024 611.36,-519.336 596,-504 585.077,-493.094 572.479,-481.475 561.82,-471.903"/>
445<polygon fill="black" stroke="black" points="563.901,-469.069 554.107,-465.028 559.243,-474.295 563.901,-469.069"/>
446</g>
447<!-- conversation&#45;&gt;gns -->
448<g id="edge54" class="edge"><title>conversation&#45;&gt;gns</title>
449<path fill="none" stroke="black" d="M928.638,-723.17C913.533,-712.381 892.408,-697.291 875.857,-685.469"/>
450<polygon fill="black" stroke="black" points="877.846,-682.589 867.674,-679.625 873.777,-688.285 877.846,-682.589"/>
451</g>
452<!-- conversation&#45;&gt;gnsrecord -->
453<g id="edge40" class="edge"><title>conversation&#45;&gt;gnsrecord</title>
454<path fill="none" stroke="blue" stroke-dasharray="1,5" d="M1017.21,-728.51C1076.25,-719.968 1155.24,-705.041 1179,-684 1241.33,-628.786 1256.97,-583.117 1231,-504 1227.58,-493.58 1221.24,-483.522 1214.65,-475.019"/>
455<polygon fill="blue" stroke="blue" points="1217.15,-472.551 1208.08,-467.08 1211.76,-477.015 1217.15,-472.551"/>
456</g>
457<!-- speaker -->
458<g id="node31" class="node"><title>speaker</title>
459<polygon fill="none" stroke="black" points="948,-684 894.877,-666 948,-648 1001.12,-666 948,-684"/>
460<text text-anchor="middle" x="948" y="-662.3" font-family="Times,serif" font-size="14.00">speaker</text>
461</g>
462<!-- conversation&#45;&gt;speaker -->
463<g id="edge55" class="edge"><title>conversation&#45;&gt;speaker</title>
464<path fill="none" stroke="black" d="M948,-723.17C948,-714.919 948,-704.153 948,-694.256"/>
465<polygon fill="black" stroke="black" points="951.5,-694.019 948,-684.019 944.5,-694.019 951.5,-694.019"/>
466</g>
467<!-- microphone -->
468<g id="node32" class="node"><title>microphone</title>
469<polygon fill="none" stroke="black" points="1095,-684 1019.76,-666 1095,-648 1170.24,-666 1095,-684"/>
470<text text-anchor="middle" x="1095" y="-662.3" font-family="Times,serif" font-size="14.00">microphone</text>
471</g>
472<!-- conversation&#45;&gt;microphone -->
473<g id="edge56" class="edge"><title>conversation&#45;&gt;microphone</title>
474<path fill="none" stroke="black" d="M976.692,-723.337C1001.14,-711.695 1036.29,-694.958 1061.92,-682.753"/>
475<polygon fill="black" stroke="black" points="1063.71,-685.777 1071.23,-678.318 1060.7,-679.457 1063.71,-685.777"/>
476</g>
477<!-- nse&#45;&gt;core -->
478<g id="edge48" class="edge"><title>nse&#45;&gt;core</title>
479<path fill="none" stroke="black" d="M790.412,-294.231C785.459,-291.935 780.118,-289.695 775,-288 697.966,-262.487 673.625,-275.652 596,-252 592.83,-251.034 589.569,-249.913 586.336,-248.716"/>
480<polygon fill="black" stroke="black" points="587.428,-245.385 576.841,-244.978 584.864,-251.899 587.428,-245.385"/>
481</g>
482<!-- peerinfo&#45;&gt;hello -->
483<g id="edge76" class="edge"><title>peerinfo&#45;&gt;hello</title>
484<path fill="none" stroke="black" d="M548.194,-77.9517C554.676,-75.8006 561.524,-73.6914 568,-72 654.752,-49.3407 758.747,-32.6176 814.333,-24.4966"/>
485<polygon fill="black" stroke="black" points="815.063,-27.9277 824.46,-23.0344 814.062,-20.9995 815.063,-27.9277"/>
486</g>
487<!-- transport&#45;&gt;ats -->
488<g id="edge66" class="edge"><title>transport&#45;&gt;ats</title>
489<path fill="none" stroke="black" d="M644.122,-152.487C587.168,-138.972 476.742,-112.769 420.21,-99.3548"/>
490<polygon fill="black" stroke="black" points="420.844,-95.9082 410.306,-97.0048 419.228,-102.719 420.844,-95.9082"/>
491</g>
492<!-- transport&#45;&gt;peerinfo -->
493<g id="edge68" class="edge"><title>transport&#45;&gt;peerinfo</title>
494<path fill="none" stroke="black" d="M651.411,-148.647C624.725,-137.116 584.738,-119.837 555.501,-107.204"/>
495<polygon fill="black" stroke="black" points="556.601,-103.867 546.033,-103.113 553.824,-110.292 556.601,-103.867"/>
496</g>
497<!-- transport&#45;&gt;hello -->
498<g id="edge67" class="edge"><title>transport&#45;&gt;hello</title>
499<path fill="none" stroke="black" d="M721.405,-157.922C756.719,-153.037 806.213,-140.439 835,-108 850.042,-91.0495 854.193,-65.1533 854.935,-45.6573"/>
500<polygon fill="black" stroke="black" points="858.435,-45.6195 855.044,-35.5822 851.436,-45.5437 858.435,-45.6195"/>
501</g>
502<!-- nat -->
503<g id="node36" class="node"><title>nat</title>
504<polygon fill="none" stroke="black" points="796,-108 765.835,-90 796,-72 826.165,-90 796,-108"/>
505<text text-anchor="middle" x="796" y="-86.3" font-family="Times,serif" font-size="14.00">nat</text>
506</g>
507<!-- transport&#45;&gt;nat -->
508<g id="edge69" class="edge"><title>transport&#45;&gt;nat</title>
509<path fill="none" stroke="black" d="M703.474,-146.834C723.706,-134.626 752.749,-117.1 772.878,-104.953"/>
510<polygon fill="black" stroke="black" points="774.946,-107.793 781.7,-99.6294 771.33,-101.799 774.946,-107.793"/>
511</g>
512<!-- fragmentation -->
513<g id="node37" class="node"><title>fragmentation</title>
514<polygon fill="none" stroke="black" points="662,-108 576.537,-90 662,-72 747.463,-90 662,-108"/>
515<text text-anchor="middle" x="662" y="-86.3" font-family="Times,serif" font-size="14.00">fragmentation</text>
516</g>
517<!-- transport&#45;&gt;fragmentation -->
518<g id="edge70" class="edge"><title>transport&#45;&gt;fragmentation</title>
519<path fill="none" stroke="black" d="M675.643,-144.055C673.556,-135.941 671.011,-126.044 668.687,-117.006"/>
520<polygon fill="black" stroke="black" points="672.073,-116.12 666.193,-107.307 665.294,-117.864 672.073,-116.12"/>
521</g>
522<!-- topology -->
523<g id="node34" class="node"><title>topology</title>
524<polygon fill="none" stroke="black" points="959.5,-324 894.5,-324 894.5,-288 959.5,-288 959.5,-324"/>
525<text text-anchor="middle" x="927" y="-302.3" font-family="Times,serif" font-size="14.00">topology</text>
526</g>
527<!-- topology&#45;&gt;core -->
528<g id="edge61" class="edge"><title>topology&#45;&gt;core</title>
529<path fill="none" stroke="black" d="M894.413,-292.17C889.63,-290.593 884.724,-289.139 880,-288 756.312,-258.18 718.97,-284.656 596,-252 592.621,-251.103 589.151,-249.989 585.73,-248.765"/>
530<polygon fill="black" stroke="black" points="586.918,-245.471 576.329,-245.106 584.379,-251.995 586.918,-245.471"/>
531</g>
532<!-- topology&#45;&gt;peerinfo -->
533<g id="edge59" class="edge"><title>topology&#45;&gt;peerinfo</title>
534<path fill="none" stroke="black" d="M894.233,-295.354C862.315,-285.612 812.655,-269.532 771,-252 705.781,-224.55 688.475,-218.336 629,-180 597.704,-159.827 564.778,-132.553 542.992,-113.534"/>
535<polygon fill="black" stroke="black" points="545.032,-110.666 535.215,-106.682 540.404,-115.919 545.032,-110.666"/>
536</g>
537<!-- topology&#45;&gt;hello -->
538<g id="edge62" class="edge"><title>topology&#45;&gt;hello</title>
539<path fill="none" stroke="black" d="M922.652,-287.966C910.314,-239.626 875.032,-101.398 860.438,-44.2243"/>
540<polygon fill="black" stroke="black" points="863.829,-43.3557 857.964,-34.532 857.046,-45.087 863.829,-43.3557"/>
541</g>
542<!-- topology&#45;&gt;transport -->
543<g id="edge60" class="edge"><title>topology&#45;&gt;transport</title>
544<path fill="none" stroke="black" d="M897.206,-287.871C850.798,-261.191 761.564,-209.891 713.17,-182.069"/>
545<polygon fill="black" stroke="black" points="714.758,-178.945 704.344,-176.995 711.269,-185.014 714.758,-178.945"/>
546</g>
547<!-- hostlist -->
548<g id="node35" class="node"><title>hostlist</title>
549<polygon fill="none" stroke="black" points="214,-324 158,-324 158,-288 214,-288 214,-324"/>
550<text text-anchor="middle" x="186" y="-302.3" font-family="Times,serif" font-size="14.00">hostlist</text>
551</g>
552<!-- hostlist&#45;&gt;core -->
553<g id="edge63" class="edge"><title>hostlist&#45;&gt;core</title>
554<path fill="none" stroke="black" d="M214.167,-292.599C218.733,-290.88 223.455,-289.271 228,-288 330.933,-259.219 456.746,-244.294 517.975,-238.275"/>
555<polygon fill="black" stroke="black" points="518.666,-241.725 528.286,-237.286 517.998,-234.757 518.666,-241.725"/>
556</g>
557<!-- hostlist&#45;&gt;peerinfo -->
558<g id="edge64" class="edge"><title>hostlist&#45;&gt;peerinfo</title>
559<path fill="none" stroke="black" d="M212.608,-287.849C273.449,-248.632 422.455,-152.586 487.166,-110.875"/>
560<polygon fill="black" stroke="black" points="489.21,-113.721 495.719,-105.362 485.418,-107.838 489.21,-113.721"/>
561</g>
562<!-- hostlist&#45;&gt;hello -->
563<g id="edge65" class="edge"><title>hostlist&#45;&gt;hello</title>
564<path fill="none" stroke="black" d="M192.198,-287.715C209.228,-243.039 261.382,-123.627 349,-72 425.521,-26.9118 694.449,-19.9666 805.486,-19.053"/>
565<polygon fill="black" stroke="black" points="805.751,-22.5513 815.727,-18.9823 805.703,-15.5515 805.751,-22.5513"/>
566</g>
567<!-- scalarproduct -->
568<g id="node38" class="node"><title>scalarproduct</title>
569<ellipse fill="none" stroke="black" cx="636" cy="-594" rx="57.6901" ry="18"/>
570<text text-anchor="middle" x="636" y="-590.3" font-family="Times,serif" font-size="14.00">scalarproduct</text>
571</g>
572<!-- scalarproduct&#45;&gt;cadet -->
573<g id="edge74" class="edge"><title>scalarproduct&#45;&gt;cadet</title>
574<path fill="none" stroke="black" d="M622.726,-576.035C614.79,-565.742 604.61,-552.266 596,-540 581.021,-518.662 564.9,-493.752 553.465,-475.721"/>
575<polygon fill="black" stroke="black" points="556.241,-473.562 547.943,-466.975 550.322,-477.299 556.241,-473.562"/>
576</g>
577<!-- scalarproduct&#45;&gt;set -->
578<g id="edge73" class="edge"><title>scalarproduct&#45;&gt;set</title>
579<path fill="none" stroke="black" d="M610.179,-577.811C591.059,-566.564 565.021,-551.248 545.33,-539.665"/>
580<polygon fill="black" stroke="black" points="546.899,-536.527 536.505,-534.473 543.349,-542.56 546.899,-536.527"/>
581</g>
582<!-- secushare -->
583<g id="node39" class="node"><title>secushare</title>
584<polygon fill="none" stroke="black" points="633.366,-815.562 578,-828 522.634,-815.562 522.686,-795.438 633.314,-795.438 633.366,-815.562"/>
585<text text-anchor="middle" x="578" y="-806.3" font-family="Times,serif" font-size="14.00">secushare</text>
586</g>
587<!-- social -->
588<g id="node42" class="node"><title>social</title>
589<ellipse fill="none" stroke="black" cx="578" cy="-738" rx="31.3957" ry="18"/>
590<text text-anchor="middle" x="578" y="-734.3" font-family="Times,serif" font-size="14.00">social</text>
591</g>
592<!-- secushare&#45;&gt;social -->
593<g id="edge80" class="edge"><title>secushare&#45;&gt;social</title>
594<path fill="none" stroke="black" d="M578,-795.17C578,-786.919 578,-776.153 578,-766.256"/>
595<polygon fill="black" stroke="black" points="581.5,-766.019 578,-756.019 574.5,-766.019 581.5,-766.019"/>
596</g>
597<!-- multicast -->
598<g id="node40" class="node"><title>multicast</title>
599<ellipse fill="none" stroke="black" cx="326" cy="-594" rx="43.5923" ry="18"/>
600<text text-anchor="middle" x="326" y="-590.3" font-family="Times,serif" font-size="14.00">multicast</text>
601</g>
602<!-- multicast&#45;&gt;cadet -->
603<g id="edge82" class="edge"><title>multicast&#45;&gt;cadet</title>
604<path fill="none" stroke="black" d="M347.889,-578.338C386.803,-552.273 467.927,-497.935 510.526,-469.402"/>
605<polygon fill="black" stroke="black" points="512.642,-472.198 519.003,-463.725 508.747,-466.382 512.642,-472.198"/>
606</g>
607<!-- psyc -->
608<g id="node41" class="node"><title>psyc</title>
609<ellipse fill="none" stroke="black" cx="326" cy="-666" rx="27" ry="18"/>
610<text text-anchor="middle" x="326" y="-662.3" font-family="Times,serif" font-size="14.00">psyc</text>
611</g>
612<!-- psyc&#45;&gt;multicast -->
613<g id="edge81" class="edge"><title>psyc&#45;&gt;multicast</title>
614<path fill="none" stroke="black" d="M326,-647.697C326,-639.983 326,-630.712 326,-622.112"/>
615<polygon fill="black" stroke="black" points="329.5,-622.104 326,-612.104 322.5,-622.104 329.5,-622.104"/>
616</g>
617<!-- psycstore -->
618<g id="node43" class="node"><title>psycstore</title>
619<ellipse fill="none" stroke="black" cx="220" cy="-594" rx="44.393" ry="18"/>
620<text text-anchor="middle" x="220" y="-590.3" font-family="Times,serif" font-size="14.00">psycstore</text>
621</g>
622<!-- psyc&#45;&gt;psycstore -->
623<g id="edge79" class="edge"><title>psyc&#45;&gt;psycstore</title>
624<path fill="none" stroke="black" d="M307.536,-652.807C291.938,-642.506 269.271,-627.537 250.911,-615.413"/>
625<polygon fill="black" stroke="black" points="252.567,-612.312 242.294,-609.722 248.71,-618.154 252.567,-612.312"/>
626</g>
627<!-- social&#45;&gt;gns -->
628<g id="edge78" class="edge"><title>social&#45;&gt;gns</title>
629<path fill="none" stroke="black" d="M605.831,-729.838C655.82,-716.973 760.68,-689.987 815.282,-675.935"/>
630<polygon fill="black" stroke="black" points="816.373,-679.268 825.185,-673.386 814.628,-672.489 816.373,-679.268"/>
631</g>
632<!-- social&#45;&gt;psyc -->
633<g id="edge77" class="edge"><title>social&#45;&gt;psyc</title>
634<path fill="none" stroke="black" d="M550.552,-729.376C504.247,-716.513 410.731,-690.537 360.222,-676.506"/>
635<polygon fill="black" stroke="black" points="360.996,-673.089 350.424,-673.784 359.122,-679.833 360.996,-673.089"/>
636</g>
637<!-- rps -->
638<g id="node44" class="node"><title>rps</title>
639<ellipse fill="none" stroke="black" cx="593" cy="-306" rx="27" ry="18"/>
640<text text-anchor="middle" x="593" y="-302.3" font-family="Times,serif" font-size="14.00">rps</text>
641</g>
642<!-- rps&#45;&gt;core -->
643<g id="edge83" class="edge"><title>rps&#45;&gt;core</title>
644<path fill="none" stroke="black" d="M584.187,-288.765C579.582,-280.283 573.845,-269.714 568.679,-260.197"/>
645<polygon fill="black" stroke="black" points="571.613,-258.266 563.766,-251.147 565.461,-261.606 571.613,-258.266"/>
646</g>
647</g>
648</svg>
diff --git a/contrib/packages/guix/notest-guix-env.scm b/contrib/packages/guix/notest-guix-env.scm
new file mode 100644
index 000000000..ffb0ec889
--- /dev/null
+++ b/contrib/packages/guix/notest-guix-env.scm
@@ -0,0 +1,145 @@
1;;; This file is part of GNUnet.
2;;; Copyright (C) 2016, 2017, 2018 GNUnet e.V.
3;;;
4;;; GNUnet is free software: you can redistribute it and/or modify it
5;;; under the terms of the GNU Affero General Public License as published
6;;; by the Free Software Foundation, either version 3 of the License,
7;;; or (at your option) any later version.
8;;;
9;;; GNUnet is distributed in the hope that it will be useful, but
10;;; WITHOUT ANY WARRANTY; without even the implied warranty of
11;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12;;; Affero General Public License for more details.
13;;;
14;;; You should have received a copy of the GNU Affero General Public License
15;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17(use-modules
18 (ice-9 popen)
19 (ice-9 match)
20 (ice-9 rdelim)
21 (guix packages)
22 (guix build-system gnu)
23 (guix gexp)
24 ((guix build utils) #:select (with-directory-excursion))
25 (guix git-download)
26 (guix utils) ; current-source-directory
27 (gnu packages)
28 (gnu packages aidc)
29 (gnu packages autotools)
30 (gnu packages backup)
31 (gnu packages base)
32 (gnu packages compression)
33 (gnu packages curl)
34 (gnu packages databases)
35 (gnu packages file)
36 (gnu packages gettext)
37 (gnu packages glib)
38 (gnu packages gnome)
39 (gnu packages gnunet)
40 (gnu packages gnupg)
41 (gnu packages gnuzilla)
42 (gnu packages groff)
43 (gnu packages gstreamer)
44 (gnu packages gtk)
45 (gnu packages guile)
46 (gnu packages image)
47 (gnu packages image-viewers)
48 (gnu packages libidn)
49 (gnu packages libunistring)
50 (gnu packages linux)
51 (gnu packages maths)
52 (gnu packages multiprecision)
53 (gnu packages perl)
54 (gnu packages pkg-config)
55 (gnu packages pulseaudio)
56 (gnu packages python)
57 (gnu packages tex)
58 (gnu packages texinfo)
59 (gnu packages tex)
60 (gnu packages tls)
61 (gnu packages upnp)
62 (gnu packages video)
63 (gnu packages web)
64 (gnu packages xiph)
65 ((guix licenses) #:prefix license:))
66
67(define %source-dir (current-source-directory))
68
69(define gnunet-dev-env
70 (let* ((revision "1")
71 (select? (delay (or (git-predicate
72 (current-source-directory))
73 source-file?))))
74 (package
75 (inherit gnunet)
76 (name "gnunet")
77 (version (string-append "git" revision))
78 (source
79 (local-file
80 (string-append (getcwd))
81 #:recursive? #t))
82 (inputs
83 `(("glpk" ,glpk)
84 ("gnurl" ,gnurl)
85 ("gstreamer" ,gstreamer)
86 ("gst-plugins-base" ,gst-plugins-base)
87 ("gnutls/dane" ,gnutls/dane)
88 ("libextractor" ,libextractor)
89 ("libgcrypt" ,libgcrypt)
90 ("libidn" ,libidn)
91 ("libmicrohttpd" ,libmicrohttpd)
92 ("libltdl" ,libltdl)
93 ("libunistring" ,libunistring)
94 ("openssl" ,openssl)
95 ("opus" ,opus)
96 ("pulseaudio" ,pulseaudio)
97 ("sqlite" ,sqlite)
98 ("postgresql" ,postgresql)
99 ("mysql" ,mariadb)
100 ("zlib" ,zlib)
101 ("perl" ,perl)
102 ("python-2" ,python-2) ; tests and gnunet-qr
103 ("python2-future" ,python2-future)
104 ("jansson" ,jansson)
105 ("nss" ,nss)
106 ("glib" ,glib "bin")
107 ("gmp" ,gmp)
108 ("bluez" ,bluez) ; for optional bluetooth feature
109 ("glib" ,glib)
110 ;; ("texlive" ,texlive) ;FIXME: minimize.
111 ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
112 ("miniupnpc" ,miniupnpc)
113 ("libogg" ,libogg)))
114 (native-inputs
115 `(("pkg-config" ,pkg-config)
116 ("autoconf" ,autoconf)
117 ("automake" ,automake)
118 ("gnu-gettext" ,gnu-gettext)
119 ("which" ,which)
120 ("texinfo" ,texinfo-5) ; Debian stable: 5.2
121 ("libtool" ,libtool)))
122 (outputs '("out" "debug"))
123 (arguments
124 `(#:configure-flags
125 (list (string-append "--with-nssdir=" %output "/lib")
126 "--enable-experimental")
127 #:phases
128 ;; swap check and install phases and set paths to installed bin
129 (modify-phases %standard-phases
130 (add-after 'unpack 'patch-bin-sh
131 (lambda _
132 (for-each (lambda (f) (chmod f #o755))
133 (find-files "po" ""))
134 #t))
135 (add-after 'patch-bin-sh 'bootstrap
136 (lambda _
137 (invoke "sh" "bootstrap")))
138 ;;(add-before 'build 'chdir
139 ;; (lambda _
140 ;; (chdir "doc/documentation")))
141 (delete 'check)
142 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
143 ))))))
144
145gnunet-dev-env
diff --git a/doc/documentation/chapters/preface.texi b/doc/documentation/chapters/preface.texi
index 00e6290f0..29cf924a2 100644
--- a/doc/documentation/chapters/preface.texi
+++ b/doc/documentation/chapters/preface.texi
@@ -12,9 +12,9 @@ all kinds of basic applications for the foundation of a new Internet.
12 12
13@menu 13@menu
14* About this book:: 14* About this book::
15* Contributing to this book::
15* Introduction:: 16* Introduction::
16* Project governance:: 17* Project governance::
17* General Terminology::
18* Typography:: 18* Typography::
19@end menu 19@end menu
20 20
@@ -37,6 +37,26 @@ The first chapter (``Preface'') as well as the the second
37chapter (``Philosophy'') give an introduction to GNUnet as a project, 37chapter (``Philosophy'') give an introduction to GNUnet as a project,
38what GNUnet tries to achieve. 38what GNUnet tries to achieve.
39 39
40@node Contributing to this book
41@section Contributing to this book
42
43The GNUnet Reference Manual is a collective work produced by various
44people throughout the years. The version you are reading is derived
45from many individual efforts hosted on our website. This was a failed
46experiment, and with the conversion to Texinfo we hope to address this
47in the longterm. Texinfo is the documentation language of the GNU project.
48While it can be intimidating at first and look scary or complicated,
49it is just another way to express text format instructions. We encourage
50you to take this opportunity and learn about Texinfo, learn about GNUnet,
51and one word at a time we will arrive at a book which explains GNUnet in
52the least complicated way to you. Even when you don't want or can't learn
53Texinfo, you can contribute. Send us an Email or join our IRC chat room
54on freenode and talk with us about the documentation (the prefered way
55to reach out is the mailinglist, since you can communicate with us
56without waiting on someone in the chatroom). One way or another you
57can help shape the understanding of GNUnet without the ability to read
58and understand its sourcecode.
59
40@node Introduction 60@node Introduction
41@section Introduction 61@section Introduction
42 62
@@ -66,25 +86,31 @@ immediately. A few months after the first release we contacted the
66GNU project, happily agreed to their governance model and became an 86GNU project, happily agreed to their governance model and became an
67official GNU package. 87official GNU package.
68 88
69Within the first year, we created GNU libextractor, a helper library 89Within the first year, we created
90@uref{https://gnu.org/s/libextractor, GNU libextractor}, a helper library
70for meta data extraction which has been used by a few other projects 91for meta data extraction which has been used by a few other projects
71as well. 2003 saw the emergence of pluggable transports, the ability 92as well. 2003 saw the emergence of pluggable transports, the ability
72for GNUnet to use different mechanisms for communication, starting 93for GNUnet to use different mechanisms for communication, starting
73with TCP, UDP and SMTP (support for the latter was later dropped due 94with TCP, UDP and SMTP (support for the latter was later dropped due
74to a lack of maintenance). In 2005, the project first started to 95to a lack of maintenance). In 2005, the project first started to
75evolve beyond the original file-sharing application with a first 96evolve beyond the original file-sharing application with a first
76simple P2P chat. In 2007, we created GNU libmicrohttpd 97simple P2P chat. In 2007, we created
98@uref{https://gnu.org/s/libmicrohttpd, GNU libmicrohttpd}
77to support a pluggable transport based on HTTP. In 2009, the 99to support a pluggable transport based on HTTP. In 2009, the
78architecture was radically modularized into the multi-process system 100architecture was radically modularized into the multi-process system
79that exists today. Coincidentally, the first version of the ARM 101that exists today. Coincidentally, the first version of the ARM@footnote{ARM: Automatic Restart Manager}
80service was implemented a day before systemd was announced. From 2009 102service was implemented a day before systemd was announced. From 2009
81to 2014 work progressed rapidly thanks to a significant research grant 103to 2014 work progressed rapidly thanks to a significant research grant
82from the Deutsche Forschungsgesellschaft. This resulted in particular 104from the Deutsche Forschungsgesellschaft. This resulted in particular
83in the creation of the R5N DHT, CADET, ATS and the GNU Name System. 105in the creation of the R5N DHT, CADET, ATS and the GNU Name System.
84In 2010, GNUnet was selected as the basis for the SecuShare online 106In 2010, GNUnet was selected as the basis for the
85social network, resutling in a significant growth of the core team. 107@uref{https://secushare.org, secushare} online
86In 2013, we launched GNU Taler to address the challenge of convenient 108social network, resulting in a significant growth of the core team.
87and privacy-preserving online payments. In 2015, the pEp project 109In 2013, we launched @uref{https://taler.net, GNU Taler} to address
110the challenge of convenient
111and privacy-preserving online payments. In 2015, the
112@c TODO: Maybe even markup for the E if it renders in most outputs.
113@uref{https://pep.foundation/, pEp}@footnote{pretty easy privacy} project
88announced that they will use GNUnet as the technology for their 114announced that they will use GNUnet as the technology for their
89meta-data protection layer, ultimately resulting in GNUnet e.V. 115meta-data protection layer, ultimately resulting in GNUnet e.V.
90entering into a formal long-term collaboration with the pEp 116entering into a formal long-term collaboration with the pEp
@@ -99,9 +125,9 @@ computing has been the core driver of the GNU project. With GNUnet we
99are focusing on informational self-determination for collaborative 125are focusing on informational self-determination for collaborative
100computing and communication over networks. 126computing and communication over networks.
101 127
102The Internet is shaped as much by code and protocols as by its 128The Internet is shaped as much by code and protocols as it is by its
103associated political processes (IETF, ICANN, IEEE, etc.), and its 129associated political processes (IETF, ICANN, IEEE, etc.).
104flaws are similarly not limited to the protocol design. Thus, 130Similarly its flaws are not limited to the protocol design. Thus,
105technical excellence by itself will not suffice to create a better 131technical excellence by itself will not suffice to create a better
106network. We also need to build a community that is wise, humble and 132network. We also need to build a community that is wise, humble and
107has a sense of humor to achieve our goal to create a technical 133has a sense of humor to achieve our goal to create a technical
@@ -116,23 +142,22 @@ follows the governance model of a benevolent dictator. This means
116that ultimately, the GNU project appoints the GNU maintainer and can 142that ultimately, the GNU project appoints the GNU maintainer and can
117overrule decisions made by the GNUnet maintainer. Similarly, the 143overrule decisions made by the GNUnet maintainer. Similarly, the
118GNUnet maintainer can overrule any decisions made by individual 144GNUnet maintainer can overrule any decisions made by individual
145@c TODO: Should we mention if this is just about GNUnet? Other projects
146@c TODO: in GNU seem to have rare issues (GCC, the 2018 documentation
147@c TODO: discussion.
119developers. Still, in practice neither has happened in the last 20 148developers. Still, in practice neither has happened in the last 20
120years, and we hope to keep it that way. 149years, and we hope to keep it that way.
121 150
151@c TODO: Actually we are a Swiss association, or just a German association
152@c TODO: with Swiss bylaws/Satzung?
153@c TODO: Rewrite one of the 'GNUnet eV may also' sentences.
122The GNUnet project is supported by GNUnet e.V., a German association 154The GNUnet project is supported by GNUnet e.V., a German association
123where any developer can become a member. GNUnet e.V. servers as a 155where any developer can become a member. GNUnet e.V. serves as a
124legal entity to hold the copyrights to GNUnet. GNUnet e.V. may also 156legal entity to hold the copyrights to GNUnet. GNUnet e.V. may also
125choose to pay for project resources, and can collect donations. 157choose to pay for project resources, and can collect donations.
126GNUnet e.V. may also choose to adjust the license of the 158GNUnet e.V. may also choose to adjust the license of the
127software (with the constraint that it has to remain free software). 159software (with the constraint that it has to remain free software)@footnote{For example in 2018 we switched from GPL3 to AGPL3. In practice these changes do not happen very often.}
128
129
130@node General Terminology
131@section General Terminology
132 160
133In the following manual we may use words that can not be found in the
134Appendix. Since we want to keep the manual selfcontained, we will
135explain words here.
136 161
137@node Typography 162@node Typography
138@section Typography 163@section Typography
@@ -142,3 +167,5 @@ command should/can be issued as root, or if "normal" user privileges are
142sufficient. We use a @code{#} for root's shell prompt, a 167sufficient. We use a @code{#} for root's shell prompt, a
143@code{%} for users' shell prompt, assuming they use the C-shell or tcsh 168@code{%} for users' shell prompt, assuming they use the C-shell or tcsh
144and a @code{$} for bourne shell and derivatives. 169and a @code{$} for bourne shell and derivatives.
170@c TODO: Really? Why the different prompts? Do we already have c-shell
171@c TODO: examples?
diff --git a/doc/documentation/chapters/user.texi b/doc/documentation/chapters/user.texi
index fe47abb86..35afdf5f7 100644
--- a/doc/documentation/chapters/user.texi
+++ b/doc/documentation/chapters/user.texi
@@ -26,6 +26,7 @@ always welcome.
26* First steps - Using the GNUnet VPN:: 26* First steps - Using the GNUnet VPN::
27* File-sharing:: 27* File-sharing::
28* The GNU Name System:: 28* The GNU Name System::
29* re@:claim Identity Provider::
29* Using the Virtual Public Network:: 30* Using the Virtual Public Network::
30@end menu 31@end menu
31 32
@@ -43,6 +44,7 @@ To stop GNUnet:
43@example 44@example
44$ gnunet-arm -e 45$ gnunet-arm -e
45@end example 46@end example
47
46@node First steps - Using the GNU Name System 48@node First steps - Using the GNU Name System
47@section First steps - Using the GNU Name System 49@section First steps - Using the GNU Name System
48@c %**end of header 50@c %**end of header
@@ -246,7 +248,7 @@ more an experimental feature and not really our primary goal at this
246time. Still, it is a possible use-case and we welcome help with testing 248time. Still, it is a possible use-case and we welcome help with testing
247and development. 249and development.
248 250
249 251@pindex gnunet-bcd
250@node Creating a Business Card 252@node Creating a Business Card
251@subsection Creating a Business Card 253@subsection Creating a Business Card
252@c FIXME: Which parts of texlive are needed? Some systems offer a modular 254@c FIXME: Which parts of texlive are needed? Some systems offer a modular
@@ -257,7 +259,9 @@ Note that this requires having @command{LaTeX} installed on your system.
257If you are using a Debian GNU/Linux based operating system, the 259If you are using a Debian GNU/Linux based operating system, the
258following command should install the required components. 260following command should install the required components.
259Keep in mind that this @b{requires 3GB} of downloaded data and possibly 261Keep in mind that this @b{requires 3GB} of downloaded data and possibly
260@b{even more} when unpacked. 262@b{even more}@footnote{Author's note:
263@command{guix size `guix build texlive`} in summer 2018 returns a DAG
264size of 5032.4 MiB} when unpacked.
261@b{We welcome any help in identifying the required components of the 265@b{We welcome any help in identifying the required components of the
262TexLive Distribution. This way we could just state the required components 266TexLive Distribution. This way we could just state the required components
263without pulling in the full distribution of TexLive.} 267without pulling in the full distribution of TexLive.}
@@ -312,12 +316,14 @@ you might need a trip to the store together.
312Before we get started, we need to tell @code{gnunet-qr} which zone 316Before we get started, we need to tell @code{gnunet-qr} which zone
313it should import new records into. For this, run: 317it should import new records into. For this, run:
314 318
319@pindex gnunet-identity
315@example 320@example
316$ gnunet-identity -s namestore -e NAME 321$ gnunet-identity -s namestore -e NAME
317@end example 322@end example
318where NAME is the name of the zone you want to import records 323where NAME is the name of the zone you want to import records
319into. In our running example, this would be ``gnu''. 324into. In our running example, this would be ``gnu''.
320 325
326@pindex gnunet-qr
321Henceforth, for every business card you collect, simply run: 327Henceforth, for every business card you collect, simply run:
322@example 328@example
323$ gnunet-qr 329$ gnunet-qr
@@ -335,6 +341,7 @@ GNUnet network at this time, you should thus be able to
335resolve your friends names. Suppose your friend's nickname 341resolve your friends names. Suppose your friend's nickname
336is "Bob". Then, type 342is "Bob". Then, type
337 343
344@pindex gnunet-gns
338@example 345@example
339$ gnunet-gns -u test.bob.gnu 346$ gnunet-gns -u test.bob.gnu
340@end example 347@end example
@@ -381,6 +388,7 @@ a revocation certificate corresponding to your ego. This certificate,
381when published on the P2P network, flags your private key as invalid, 388when published on the P2P network, flags your private key as invalid,
382and all further resolutions or other checks involving the key will fail. 389and all further resolutions or other checks involving the key will fail.
383 390
391@pindex gnunet-revocation
384A revocation certificate is thus a useful tool when things go out of 392A revocation certificate is thus a useful tool when things go out of
385control, but at the same time it should be stored securely. 393control, but at the same time it should be stored securely.
386Generation of the revocation certificate for a zone can be done through 394Generation of the revocation certificate for a zone can be done through
@@ -433,6 +441,7 @@ private conversation with your friend. Finally, help us
433with the next GNUnet release for even more applications 441with the next GNUnet release for even more applications
434using this new public key infrastructure. 442using this new public key infrastructure.
435 443
444@pindex gnunet-conservation-gtk
436@node First steps - Using GNUnet Conversation 445@node First steps - Using GNUnet Conversation
437@section First steps - Using GNUnet Conversation 446@section First steps - Using GNUnet Conversation
438@c %**end of header 447@c %**end of header
@@ -485,6 +494,7 @@ that will show up when you call somebody else, as well as the
485GNS zone that will be used to resolve names of users that you 494GNS zone that will be used to resolve names of users that you
486are calling. Run 495are calling. Run
487 496
497@pindex gnunet-conversation
488@example 498@example
489gnunet-conversation -e zone-name 499gnunet-conversation -e zone-name
490@end example 500@end example
@@ -564,7 +574,7 @@ Either of you can end the call using @command{/cancel}. You can exit
564 574
565@menu 575@menu
566* VPN Preliminaries:: 576* VPN Preliminaries::
567* Exit configuration:: 577* GNUnet-Exit configuration::
568* GNS configuration:: 578* GNS configuration::
569* Accessing the service:: 579* Accessing the service::
570* Using a Browser:: 580* Using a Browser::
@@ -595,6 +605,9 @@ The exact details may differ a bit, which is fine. Add the text
595hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4 605hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4
596@end example 606@end example
597 607
608@c TODO: outdated section, we no longer install this as part of the
609@c TODO: standard installation procedure and should point out the manual
610@c TODO: steps required to make it useful.
598@noindent 611@noindent
599You might want to make sure that @code{/lib/libnss_gns.so.2} exists on 612You might want to make sure that @code{/lib/libnss_gns.so.2} exists on
600your system, it should have been created during the installation. 613your system, it should have been created during the installation.
@@ -608,8 +621,8 @@ $ cd src/gns/nss; sudo make install
608@noindent 621@noindent
609to install the NSS plugins in the proper location. 622to install the NSS plugins in the proper location.
610 623
611@node Exit configuration 624@node GNUnet-Exit configuration
612@subsection Exit configuration 625@subsection GNUnet-Exit configuration
613@c %**end of header 626@c %**end of header
614 627
615Stop your peer (as user @code{gnunet}, run @command{gnunet-arm -e}) and 628Stop your peer (as user @code{gnunet}, run @command{gnunet-arm -e}) and
@@ -696,9 +709,10 @@ the searcher/downloader specify "no anonymity", non-anonymous
696file-sharing is used. If either user specifies some desired degree 709file-sharing is used. If either user specifies some desired degree
697of anonymity, anonymous file-sharing will be used. 710of anonymity, anonymous file-sharing will be used.
698 711
699After a short introduction, we will first look at the various concepts in 712After a short introduction, we will first look at the various concepts
700GNUnet's file-sharing implementation. Then, we will discuss specifics as to how 713in GNUnet's file-sharing implementation. Then, we will discuss
701they impact users that publish, search or download files. 714specifics as to how they impact users that publish, search or download
715files.
702 716
703 717
704@menu 718@menu
@@ -706,7 +720,6 @@ they impact users that publish, search or download files.
706* fs-Downloading:: 720* fs-Downloading::
707* fs-Publishing:: 721* fs-Publishing::
708* fs-Concepts:: 722* fs-Concepts::
709* fs-Directories::
710* Namespace Management:: 723* Namespace Management::
711* File-Sharing URIs:: 724* File-Sharing URIs::
712* GTK User Interface:: 725* GTK User Interface::
@@ -724,10 +737,11 @@ $ gnunet-search [-t TIMEOUT] KEYWORD
724@end example 737@end example
725 738
726@noindent 739@noindent
727The -t option specifies that the query should timeout after 740The @command{-t} option specifies that the query should timeout after
728approximately TIMEOUT seconds. A value of zero is interpreted 741approximately TIMEOUT seconds. A value of zero (``0'') is interpreted
729as @emph{no timeout}, which is also the default. In this case, 742as @emph{no timeout}, which is the default. In this case,
730gnunet-search will never terminate (unless you press CTRL-C). 743@command{gnunet-search} will never terminate (unless you press
744@command{CTRL-C}).
731 745
732If multiple words are passed as keywords, they will all be 746If multiple words are passed as keywords, they will all be
733considered optional. Prefix keywords with a "+" to make them mandatory. 747considered optional. Prefix keywords with a "+" to make them mandatory.
@@ -750,10 +764,11 @@ as the first will match files shared under the keywords
750"Das" or "Kapital" whereas the second will match files 764"Das" or "Kapital" whereas the second will match files
751shared under the keyword "Das Kapital". 765shared under the keyword "Das Kapital".
752 766
753Search results are printed by gnunet-search like this: 767Search results are printed by @command{gnunet-search} like this:
754 768
755@c it will be better the avoid the ellipsis altogether because I don't 769@c it will be better the avoid the ellipsis altogether because I don't
756@c understand the explanation below that 770@c understand the explanation below that
771@c ng0: who is ``I'' and what was the complete sentence?
757@example 772@example
758#15: 773#15:
759gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446 774gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
@@ -762,10 +777,11 @@ gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
762 777
763@noindent 778@noindent
764The whole line is the command you would have to enter to download 779The whole line is the command you would have to enter to download
765the file. The argument passed to @code{-o} is the suggested 780the file. The first argument passed to @code{-o} is the suggested
766filename (you may change it to whatever you like). 781filename (you may change it to whatever you like).
767It is followed by the key for decrypting the file, the query for searching the 782It is followed by the key for decrypting the file, the query for
768file, a checksum (in hexadecimal) finally the size of the file in bytes. 783searching the file, a checksum (in hexadecimal) finally the size of
784the file in bytes.
769 785
770@node fs-Downloading 786@node fs-Downloading
771@subsection Downloading 787@subsection Downloading
@@ -802,9 +818,9 @@ already present.
802GNUnet's file-encoding mechanism will ensure file integrity, even if the 818GNUnet's file-encoding mechanism will ensure file integrity, even if the
803existing file was not downloaded from GNUnet in the first place. 819existing file was not downloaded from GNUnet in the first place.
804 820
805You may want to use the @command{-V} switch to turn on verbose reporting. In 821You may want to use the @command{-V} switch to turn on verbose
806this case, @command{gnunet-download} will print the current number of bytes 822reporting. In this case, @command{gnunet-download} will print the
807downloaded whenever new data was received. 823current number of bytes downloaded whenever new data was received.
808 824
809@node fs-Publishing 825@node fs-Publishing
810@subsection Publishing 826@subsection Publishing
@@ -834,7 +850,7 @@ $ gnunet-publish -m "description:GNU License" -k gpl -k test -m "mimetype:text/p
834The option @code{-k} is used to specify keywords for the file that 850The option @code{-k} is used to specify keywords for the file that
835should be inserted. You can supply any number of keywords, 851should be inserted. You can supply any number of keywords,
836and each of the keywords will be sufficient to locate and 852and each of the keywords will be sufficient to locate and
837retrieve the file. Please note that you must use the @code{-k} option 853retrieve the file. Please note that you must use the @code{-k} option
838more than once -- one for each expression you use as a keyword for 854more than once -- one for each expression you use as a keyword for
839the filename. 855the filename.
840 856
@@ -845,10 +861,14 @@ list by running @command{extract -L}. Use quotes around the entire
845meta-data argument if the value contains spaces. The meta-data 861meta-data argument if the value contains spaces. The meta-data
846is displayed to other users when they select which files to 862is displayed to other users when they select which files to
847download. The meta-data and the keywords are optional and 863download. The meta-data and the keywords are optional and
848maybe inferred using @code{GNU libextractor}. 864may be inferred using @code{GNU libextractor}.
865
866@command{gnunet-publish} has a few additional options to handle
867namespaces and directories. Refer to the man-page for details:
849 868
850gnunet-publish has a few additional options to handle namespaces and 869@example
851directories. See the man-page for details. 870man gnunet-publish
871@end example
852 872
853@node Indexing vs. Inserting 873@node Indexing vs. Inserting
854@subsubsection Indexing vs Inserting 874@subsubsection Indexing vs Inserting
@@ -890,18 +910,17 @@ able to crack the encryption (e.g. by guessing the keyword.
890@subsection Concepts 910@subsection Concepts
891@c %**end of header 911@c %**end of header
892 912
893Sharing files in GNUnet is not quite as simple as in traditional 913For better results with filesharing it is useful to understand the
894file sharing systems. For example, it is not sufficient to just 914following concepts.
895place files into a specific directory to share them. In addition 915In addition to anonymous routing GNUnet attempts to give users a better
896to anonymous routing GNUnet attempts to give users a better experience 916experience in searching for content. GNUnet uses cryptography to safely
897in searching for content. GNUnet uses cryptography to safely break 917break content into smaller pieces that can be obtained from different
898content into smaller pieces that can be obtained from different 918sources without allowing participants to corrupt files. GNUnet makes it
899sources without allowing participants to corrupt files. GNUnet 919difficult for an adversary to send back bogus search results. GNUnet
900makes it difficult for an adversary to send back bogus search 920enables content providers to group related content and to establish a
901results. GNUnet enables content providers to group related content 921reputation. Furthermore, GNUnet allows updates to certain content to be
902and to establish a reputation. Furthermore, GNUnet allows updates 922made available. This section is supposed to introduce users to the
903to certain content to be made available. This section is supposed 923concepts that are used to achieve these goals.
904to introduce users to the concepts that are used to achieve these goals.
905 924
906 925
907@menu 926@menu
@@ -921,10 +940,10 @@ to introduce users to the concepts that are used to achieve these goals.
921@c %**end of header 940@c %**end of header
922 941
923A file in GNUnet is just a sequence of bytes. Any file-format is allowed 942A file in GNUnet is just a sequence of bytes. Any file-format is allowed
924and the maximum file size is theoretically 264 bytes, except that it 943and the maximum file size is theoretically @math{2^64 - 1} bytes, except
925would take an impractical amount of time to share such a file. 944that it would take an impractical amount of time to share such a file.
926GNUnet itself never interprets the contents of shared files, except 945GNUnet itself never interprets the contents of shared files, except when
927when using GNU libextractor to obtain keywords. 946using GNU libextractor to obtain keywords.
928 947
929@node Keywords 948@node Keywords
930@subsubsection Keywords 949@subsubsection Keywords
@@ -954,10 +973,26 @@ it cannot be changed since it is treated just like an ordinary file
954by the network. Small files (of a few kilobytes) can be inlined in 973by the network. Small files (of a few kilobytes) can be inlined in
955the directory, so that a separate download becomes unnecessary. 974the directory, so that a separate download becomes unnecessary.
956 975
976Directories are shared just like ordinary files. If you download a
977directory with @command{gnunet-download}, you can use
978@command{gnunet-directory} to list its contents. The canonical
979extension for GNUnet directories when stored as files in your
980local file-system is ".gnd". The contents of a directory are URIs and
981meta data.
982The URIs contain all the information required by
983@command{gnunet-download} to retrieve the file. The meta data
984typically includes the mime-type, description, a filename and
985other meta information, and possibly even the full original file
986(if it was small).
987
957@node Pseudonyms 988@node Pseudonyms
958@subsubsection Pseudonyms 989@subsubsection Pseudonyms
959@c %**end of header 990@c %**end of header
960 991
992@b{Please note that the text in this subsection is outdated and needs}
993@b{to be rewritten for version 0.10!}
994@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
995
961Pseudonyms in GNUnet are essentially public-private (RSA) key pairs 996Pseudonyms in GNUnet are essentially public-private (RSA) key pairs
962that allow a GNUnet user to maintain an identity (which may or may not 997that allow a GNUnet user to maintain an identity (which may or may not
963be detached from their real-life identity). GNUnet's pseudonyms are not 998be detached from their real-life identity). GNUnet's pseudonyms are not
@@ -973,6 +1008,10 @@ to copy around).
973@subsubsection Namespaces 1008@subsubsection Namespaces
974@c %**end of header 1009@c %**end of header
975 1010
1011@b{Please note that the text in this subsection is outdated and needs}
1012@b{to be rewritten for version 0.10!}
1013@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1014
976A namespace is a set of files that were signed by the same pseudonym. 1015A namespace is a set of files that were signed by the same pseudonym.
977Files (or directories) that have been signed and placed into a namespace 1016Files (or directories) that have been signed and placed into a namespace
978can be updated. Updates are identified as authentic if the same secret 1017can be updated. Updates are identified as authentic if the same secret
@@ -984,11 +1023,15 @@ same entity (which does not have to be the same person).
984@subsubsection Advertisements 1023@subsubsection Advertisements
985@c %**end of header 1024@c %**end of header
986 1025
1026@b{Please note that the text in this subsection is outdated and needs}
1027@b{to be rewritten for version 0.10!}
1028@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1029
987Advertisements are used to notify other users about the existence of a 1030Advertisements are used to notify other users about the existence of a
988namespace. Advertisements are propagated using the normal keyword search. 1031namespace. Advertisements are propagated using the normal keyword search.
989When an advertisement is received (in response to a search), the namespace 1032When an advertisement is received (in response to a search), the namespace
990is added to the list of namespaces available in the namespace-search 1033is added to the list of namespaces available in the namespace-search
991dialogs of gnunet-fs-gtk and printed by gnunet-pseudonym. Whenever a 1034dialogs of gnunet-fs-gtk and printed by @code{gnunet-identity}. Whenever a
992namespace is created, an appropriate advertisement can be generated. 1035namespace is created, an appropriate advertisement can be generated.
993The default keyword for the advertising of namespaces is "namespace". 1036The default keyword for the advertising of namespaces is "namespace".
994 1037
@@ -996,7 +1039,7 @@ Note that GNUnet differentiates between your pseudonyms (the identities
996that you control) and namespaces. If you create a pseudonym, you will 1039that you control) and namespaces. If you create a pseudonym, you will
997not automatically see the respective namespace. You first have to create 1040not automatically see the respective namespace. You first have to create
998an advertisement for the namespace and find it using keyword 1041an advertisement for the namespace and find it using keyword
999search --- even for your own namespaces. The @command{gnunet-pseudonym} 1042search --- even for your own namespaces. The @command{gnunet-identity}
1000tool is currently responsible for both managing pseudonyms and namespaces. 1043tool is currently responsible for both managing pseudonyms and namespaces.
1001This will likely change in the future to reduce the potential for 1044This will likely change in the future to reduce the potential for
1002confusion. 1045confusion.
@@ -1044,22 +1087,6 @@ level by one. If all blocks reach replication level zero, the
1044selection is simply random. 1087selection is simply random.
1045 1088
1046 1089
1047@node fs-Directories
1048@subsection Directories
1049@c %**end of header
1050
1051Directories are shared just like ordinary files. If you download a
1052directory with @command{gnunet-download}, you can use
1053@command{gnunet-directory} to list its contents. The canonical
1054extension for GNUnet directories when stored as files in your
1055local file-system is ".gnd". The contents of a directory are URIs and
1056meta data.
1057The URIs contain all the information required by
1058@command{gnunet-download} to retrieve the file. The meta data
1059typically includes the mime-type, description, a filename and
1060other meta information, and possibly even the full original file
1061(if it was small).
1062
1063@node Namespace Management 1090@node Namespace Management
1064@subsection Namespace Management 1091@subsection Namespace Management
1065@c %**end of header 1092@c %**end of header
@@ -1067,8 +1094,8 @@ other meta information, and possibly even the full original file
1067@b{Please note that the text in this subsection is outdated and needs} 1094@b{Please note that the text in this subsection is outdated and needs}
1068@b{to be rewritten for version 0.10!} 1095@b{to be rewritten for version 0.10!}
1069 1096
1070The gnunet-pseudonym tool can be used to create pseudonyms and 1097The @code{gnunet-identity} tool can be used to create pseudonyms and
1071to advertise namespaces. By default, gnunet-pseudonym simply 1098to advertise namespaces. By default, @code{gnunet-identity -D} simply
1072lists all locally available pseudonyms. 1099lists all locally available pseudonyms.
1073 1100
1074 1101
@@ -1084,6 +1111,10 @@ lists all locally available pseudonyms.
1084@subsubsection Creating Pseudonyms 1111@subsubsection Creating Pseudonyms
1085@c %**end of header 1112@c %**end of header
1086 1113
1114@b{Please note that the text in this subsection is outdated and needs}
1115@b{to be rewritten for version 0.10!}
1116@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1117
1087With the @command{-C NICK} option it can also be used to 1118With the @command{-C NICK} option it can also be used to
1088create a new pseudonym. A pseudonym is the virtual identity 1119create a new pseudonym. A pseudonym is the virtual identity
1089of the entity in control of a namespace. Anyone can create 1120of the entity in control of a namespace. Anyone can create
@@ -1095,6 +1126,10 @@ used.
1095@subsubsection Deleting Pseudonyms 1126@subsubsection Deleting Pseudonyms
1096@c %**end of header 1127@c %**end of header
1097 1128
1129@b{Please note that the text in this subsection is outdated and needs}
1130@b{to be rewritten for version 0.10!}
1131@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1132
1098With the @command{-D NICK} option pseudonyms can be deleted. 1133With the @command{-D NICK} option pseudonyms can be deleted.
1099Once the pseudonym has been deleted it is impossible to add 1134Once the pseudonym has been deleted it is impossible to add
1100content to the corresponding namespace. Deleting the 1135content to the corresponding namespace. Deleting the
@@ -1105,6 +1140,10 @@ unavailable.
1105@subsubsection Advertising namespaces 1140@subsubsection Advertising namespaces
1106@c %**end of header 1141@c %**end of header
1107 1142
1143@b{Please note that the text in this subsection is outdated and needs}
1144@b{to be rewritten for version 0.10!}
1145@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1146
1108Each namespace is associated with meta-data that describes 1147Each namespace is associated with meta-data that describes
1109the namespace. This meta-data is provided by the user at 1148the namespace. This meta-data is provided by the user at
1110the time that the namespace is advertised. Advertisements 1149the time that the namespace is advertised. Advertisements
@@ -1121,6 +1160,10 @@ the quality of the content found in it.
1121@subsubsection Namespace names 1160@subsubsection Namespace names
1122@c %**end of header 1161@c %**end of header
1123 1162
1163@b{Please note that the text in this subsection is outdated and needs}
1164@b{to be rewritten for version 0.10!}
1165@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1166
1124While the namespace is uniquely identified by its ID, another way 1167While the namespace is uniquely identified by its ID, another way
1125to refer to the namespace is to use the NICKNAME. 1168to refer to the namespace is to use the NICKNAME.
1126The NICKNAME can be freely chosen by the creator of the namespace and 1169The NICKNAME can be freely chosen by the creator of the namespace and
@@ -1132,6 +1175,10 @@ to the NICKNAME to get a unique identifier.
1132@subsubsection Namespace root 1175@subsubsection Namespace root
1133@c %**end of header 1176@c %**end of header
1134 1177
1178@b{Please note that the text in this subsection is outdated and needs}
1179@b{to be rewritten for version 0.10!}
1180@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1181
1135An item of particular interest in the namespace advertisement is 1182An item of particular interest in the namespace advertisement is
1136the ROOT. The ROOT is the identifier of a designated entry in the 1183the ROOT. The ROOT is the identifier of a designated entry in the
1137namespace. The idea is that the ROOT can be used to advertise an 1184namespace. The idea is that the ROOT can be used to advertise an
@@ -1219,6 +1266,10 @@ Furthermore they must not contain '++'.
1219@subsubsection Namespace content (sks) 1266@subsubsection Namespace content (sks)
1220@c %**end of header 1267@c %**end of header
1221 1268
1269@b{Please note that the text in this subsection is outdated and needs}
1270@b{to be rewritten for version 0.10!}
1271@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1272
1222Namespaces are sets of files that have been approved by some (usually 1273Namespaces are sets of files that have been approved by some (usually
1223pseudonymous) user --- typically by that user publishing all of the 1274pseudonymous) user --- typically by that user publishing all of the
1224files together. A file can be in many namespaces. A file is in a 1275files together. A file can be in many namespaces. A file is in a
@@ -1419,8 +1470,8 @@ $ gnunet-identity -C "myzone"
1419 1470
1420Henceforth, on your system you control the TLD ``myzone''. 1471Henceforth, on your system you control the TLD ``myzone''.
1421 1472
1422All of your zones can be listed using the @command{gnunet-identity} 1473All of your zones can be listed (displayed) using the
1423command line tool as well: 1474@command{gnunet-identity} command line tool as well:
1424 1475
1425@example 1476@example
1426$ gnunet-identity -d 1477$ gnunet-identity -d
@@ -1528,11 +1579,11 @@ record you want to access).
1528@subsection Using Public Keys as Top Level Domains 1579@subsection Using Public Keys as Top Level Domains
1529 1580
1530 1581
1531GNS also assumes responsibility for any name that uses in a well-formed 1582GNS also assumes responsibility for any name that uses in a
1532public key for the TLD. Names ending this way are then resolved by querying 1583well-formed public key for the TLD. Names ending this way are then
1533the respective zone. Such public key TLDs are expected to be used under rare 1584resolved by querying the respective zone. Such public key TLDs are
1534circumstances where globally unique names are required, and for 1585expected to be used under rare circumstances where globally unique
1535integration with legacy systems. 1586names are required, and for integration with legacy systems.
1536 1587
1537@node Resource Records in GNS 1588@node Resource Records in GNS
1538@subsection Resource Records in GNS 1589@subsection Resource Records in GNS
@@ -1569,18 +1620,31 @@ GNS currently supports the following record types:
1569* CNAME:: 1620* CNAME::
1570* GNS2DNS:: 1621* GNS2DNS::
1571* SOA SRV PTR and MX:: 1622* SOA SRV PTR and MX::
1623* PLACE::
1624* PHONE::
1625* ID ATTR::
1626* ID TOKEN::
1627* ID TOKEN METADATA::
1628* CREDENTIAL::
1629* POLICY::
1630* ATTRIBUTE::
1631* ABE KEY::
1632* ABE MASTER::
1633* RECLAIM OIDC CLIENT::
1634* RECLAIM OIDC REDIRECT::
1572@end menu 1635@end menu
1573 1636
1574@node NICK 1637@node NICK
1575@subsubsection NICK 1638@subsubsection NICK
1576 1639
1577A NICK record is used to give a zone a name. With a NICK record, you can 1640A NICK record is used to give a zone a name. With a NICK record, you
1578essentially specify how you would like to be called. GNS expects this 1641can essentially specify how you would like to be called. GNS expects
1579record under the empty label ``@@'' in the zone's database (NAMESTORE); however, 1642this record under the empty label ``@@'' in the zone's database
1580it will then automatically be copied into each record set, so that 1643(NAMESTORE); however, it will then automatically be copied into each
1581clients never need to do a separate lookup to discover the NICK record. 1644record set, so that clients never need to do a separate lookup to
1582Also, users do not usually have to worry about setting the NICK record: 1645discover the NICK record. Also, users do not usually have to worry
1583it is automatically set to the local name of the TLD. 1646about setting the NICK record: it is automatically set to the local
1647name of the TLD.
1584 1648
1585@b{Example}@ 1649@b{Example}@
1586 1650
@@ -1739,6 +1803,66 @@ should use the ZKEY zone as the destination hostname and
1739GNS-enabled mail servers should be configured to accept 1803GNS-enabled mail servers should be configured to accept
1740e-mails to the ZKEY-zones of all local users. 1804e-mails to the ZKEY-zones of all local users.
1741 1805
1806@node PLACE
1807@subsubsection PLACE
1808
1809Record type for a social place.
1810
1811@node PHONE
1812@subsubsection PHONE
1813
1814Record type for a phone (of CONVERSATION).
1815
1816@node ID ATTR
1817@subsubsection ID ATTR
1818
1819Record type for identity attributes (of IDENTITY).
1820
1821@node ID TOKEN
1822@subsubsection ID TOKEN
1823
1824Record type for an identity token (of IDENTITY-TOKEN).
1825
1826@node ID TOKEN METADATA
1827@subsubsection ID TOKEN METADATA
1828
1829Record type for the private metadata of an identity token (of IDENTITY-TOKEN).
1830
1831@node CREDENTIAL
1832@subsubsection CREDENTIAL
1833
1834Record type for credential.
1835
1836@node POLICY
1837@subsubsection POLICY
1838
1839Record type for policies.
1840
1841@node ATTRIBUTE
1842@subsubsection ATTRIBUTE
1843
1844Record type for reverse lookups.
1845
1846@node ABE KEY
1847@subsubsection ABE KEY
1848
1849Record type for ABE records.
1850
1851@node ABE MASTER
1852@subsubsection ABE MASTER
1853
1854Record type for ABE master keys.
1855
1856@node RECLAIM OIDC CLIENT
1857@subsubsection RECLAIM OIDC CLIENT
1858
1859Record type for reclaim OIDC clients.
1860
1861@node RECLAIM OIDC REDIRECT
1862@subsubsection RECLAIM OIDC REDIRECT
1863
1864Record type for reclaim OIDC redirect URIs.
1865
1742@node Synchronizing with legacy DNS 1866@node Synchronizing with legacy DNS
1743@subsection Synchronizing with legacy DNS 1867@subsection Synchronizing with legacy DNS
1744 1868
@@ -1769,6 +1893,98 @@ is thus advisable to disable the namecache by setting the
1769option ``DISABLE'' to ``YES'' in section ``[namecache]''. 1893option ``DISABLE'' to ``YES'' in section ``[namecache]''.
1770 1894
1771 1895
1896@node re@:claim Identity Provider
1897@section re@:claim Identity Provider
1898
1899The re:claim Identity Provider (IdP) is a decentralized IdP service.
1900It allows its users to manage and authorize third parties to access their identity attributes such as email or shipping addresses.
1901
1902It basically mimics the concepts of centralized IdPs, such as those offered by Google or Facebook.
1903Like other IdPs, re:claim features an (optional) OpenID-Connect 1.0-compliant protocol layer that can be used for websites to integrate re:claim as an Identity Provider with little effort.
1904
1905@menu
1906* Managing Attributes::
1907* Sharing Attributes with Third Parties::
1908* Revoking Authorizations of Third Parties::
1909* Using the OpenID-Connect IdP::
1910@end menu
1911
1912@node Managing Attributes
1913@subsection Managing Attributes
1914
1915Before adding attributes to an identity, you must first create an ego:
1916
1917@example
1918$ gnunet-identity -C "username"
1919@end example
1920
1921Henceforth, you can manage a new user profile of the user ``username''.
1922
1923To add an email address to your user profile, simply use the @command{gnunet-idp} command line tool::
1924
1925@example
1926$ gnunet-idp -e "username" -a "email" -V "username@@example.gnunet"
1927@end example
1928
1929All of your attributes can be listed using the @command{gnunet-idp}
1930command line tool as well:
1931
1932@example
1933$ gnunet-idp -e "username" -D
1934@end example
1935
1936Currently, and by default, attribute values are interpreted as plain text.
1937In the future there might be more value types such as X.509 certificate credentials.
1938
1939@node Sharing Attributes with Third Parties
1940@subsection Sharing Attributes with Third Parties
1941
1942If you want to allow a third party such as a website or friend to access to your attributes (or a subset thereof) execute:
1943
1944@example
1945$ gnunet-idp -e "username" -r "PKEY" -i "attribute1,attribute2,..."
1946@end example
1947
1948Where "PKEY" is the public key of the third party and "attribute1,attribute2,..." is a comma-separated list of attribute names, such as "email", that you want to share.
1949
1950The command will return a "ticket" string.
1951You must give this "ticket" to the requesting third party.
1952
1953The third party can then retrieve your shared identity attributes using:
1954
1955@example
1956$ gnunet-idp -e "friend" -C "ticket"
1957@end example
1958
1959This will retrieve and list the shared identity attributes.
1960The above command will also work if the user "username" is currently offline since the attributes are retrieved from GNS.
1961Further, the "ticket" can be re-used later to retrieve up-to-date attributes in case "username" has changed the value(s). For instance, becasue his email address changed.
1962
1963To list all given authorizations (tickets) you can execute:
1964@example
1965$ gnunet-idp -e "friend" -T (TODO there is only a REST API for this ATM)
1966@end example
1967
1968
1969@node Revoking Authorizations of Third Parties
1970@subsection Revoking Authorizations of Third Parties
1971
1972If you want to revoke the access of a third party to your attributes you can execute:
1973
1974@example
1975$ gnunet-idp -e "username" -R "ticket"
1976@end example
1977
1978This will prevent the third party from accessing the attribute in the future.
1979Please note that if the third party has previously accessed the attribute, there is not way in which the system could have prevented the thiry party from storing the data.
1980As such, only access to updated data in the future can be revoked.
1981This behaviour is _exactly the same_ as with other IdPs.
1982
1983@node Using the OpenID-Connect IdP
1984@subsection Using the OpenID-Connect IdP
1985
1986TODO: Document setup and REST endpoints
1987
1772@node Using the Virtual Public Network 1988@node Using the Virtual Public Network
1773@section Using the Virtual Public Network 1989@section Using the Virtual Public Network
1774 1990
diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi
index 7743fddea..50630d4fe 100644
--- a/doc/documentation/gnunet.texi
+++ b/doc/documentation/gnunet.texi
@@ -101,8 +101,8 @@ This document is the Reference Manual for GNUnet version @value{VERSION}.
101Preface 101Preface
102 102
103* About this book 103* About this book
104* Contributing to this book
104* Introduction 105* Introduction
105* General Terminology::
106* Typography:: 106* Typography::
107 107
108Philosophy 108Philosophy
@@ -251,6 +251,7 @@ GNUnet Developer Handbook
251@unnumbered Programming Index 251@unnumbered Programming Index
252@syncodeindex tp fn 252@syncodeindex tp fn
253@syncodeindex vr fn 253@syncodeindex vr fn
254@syncodeindex pg fn
254@printindex fn 255@printindex fn
255 256
256@bye 257@bye
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 000000000..ce05012fc
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,138 @@
1# gnunet-docker
2A Dockerfile (and maybe later docker-compose.yml) for getting a running GNUnet docker container.
3
4> This README and parts of the Dockerfile were adapted from https://github.com/compiaffe/gnunet-docker
5
6
7## Build it
8This will take quite a while and will consume a bit of data.
9
10First you need to go to the root of this repo.
11
12```bash
13cd ..
14```
15
16Now you can build the image.
17
18```bash
19docker build -t gnunet .
20```
21
22## Start it from the newly created gnunet image
23Start a container from `gnunet` image, which can access /dev/net/tun, has access to the host network. We are going to name it `gnunet1`.
24
25Note the `--rm` that will delete the container as soon as you stop it and `-ti` gives you an interactive terminal.
26
27#### Linux Users
28```bash
29docker run \
30 --rm \
31 -ti \
32 --privileged \
33 --name gnunet1 \
34 --net=host \
35 -v /dev/net/tun:/dev/net/tun \
36 gnunet
37```
38
39#### Mac Users
40```bash
41docker run \
42 --rm \
43 -it \
44 --privileged \
45 --name gnunet1 \
46 -e LOCAL_PORT_RANGE='40001 40200' \
47 -e GNUNET_PORT=2086 \
48 -p 2086:2086 \
49 -p 2086:2086/udp \
50 -p40001-40200:40001-40200 \
51 -p40001-40200:40001-40200/udp \
52 gnunet
53```
54
55This terminal will keep on printing to screen at the moment. So go on in a new terminal please.
56
57Don't worry about warnings too much...
58
59## Check if you are connected
60Open a new terminal and connect to the container we just started:
61
62```bash
63docker exec -it gnunet1 gnunet-peerinfo -i
64```
65
66If you get a list of peers, all is good.
67
68## Multiple containers on the same host
69### Running
70#### Run Container 1
71```bash
72export GPORT=2086 LPORT='40001-40200' GNAME=gnunet1
73docker run \
74 --rm \
75 -it \
76 --privileged \
77 -e GNUNET_PORT=$GPORT \
78 -e LOCAL_PORT_RANGE="${LPORT/-/ }" \
79 -p $GPORT:$GPORT \
80 -p $GPORT:$GPORT/udp \
81 -p$LPORT:$LPORT \
82 -p$LPORT:$LPORT/udp \
83 --name $GNAME \
84 gnunet
85```
86
87#### Run Container 2
88```bash
89export GPORT=2087 LPORT='40201-40400' GNAME=gnunet2
90docker run \
91 --rm \
92 -it \
93 --privileged \
94 -e GNUNET_PORT=$GPORT \
95 -e LOCAL_PORT_RANGE="${LPORT/-/ }" \
96 -p $GPORT:$GPORT \
97 -p $GPORT:$GPORT/udp \
98 -p$LPORT:$LPORT \
99 -p$LPORT:$LPORT/udp \
100 --name $GNAME \
101 gnunet
102```
103
104### Testing cadet example
105#### Container 1
106```bash
107$ docker exec -it gnunet1 bash
108$ gnunet-peerinfo -s
109I am peer `VWPN1NZA6YMM866EJ5J2NY47XG692MQ6H6WASVECF0M18A9SCMZ0'.
110$ gnunet-cadet -o asdasd
111```
112
113#### Container 2
114```bash
115$ docker exec -it gnunet2 bash
116$ gnunet-cadet VWPN1NZA6YMM866EJ5J2NY47XG692MQ6H6WASVECF0M18A9SCMZ0 asdasd
117```
118
119### Testing file sharing example
120#### Container 1
121```bash
122$ docker exec -it gnunet1 bash
123$ echo 'test' > test.txt
124$ gnunet-publish test.txt
125Publishing `/test.txt' done.
126URI is `gnunet://fs/chk/1RZ7A8TAQHMF8DWAGTSZ9CSA365T60C4BC6DDS810VM78D2Q0366CRX8DGFA29EWBT9BW5Y9HYD0Z1EAKNFNJQDJ04QQSGTQ352W28R.7MYB03GYXT17Z93ZRZRVV64AH9KPWFSVDEZGVE84YHD63XZFJ36B86M48KHTZVF87SZ05HBVB44PCXE8CVWAH72VN1SKYPRK1QN2C98.5'.
127```
128
129#### Container 2
130```bash
131$ docker exec -it gnunet2 bash
132$ gnunet-download -o out.file "gnunet://fs/chk/1RZ7A8TAQHMF8DWAGTSZ9CSA365T60C4BC6DDS810VM78D2Q0366CRX8DGFA29EWBT9BW5Y9HYD0Z1EAKNFNJQDJ04QQSGTQ352W28R.7MYB03GYXT17Z93ZRZRVV64AH9KPWFSVDEZGVE84YHD63XZFJ36B86M48KHTZVF87SZ05HBVB44PCXE8CVWAH72VN1SKYPRK1QN2C98.5"
133100% [============================================================]
134Downloading `out.file' done (0 b/s).
135$ cat out.file
136test
137```
138
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
new file mode 100644
index 000000000..7f98ef68b
--- /dev/null
+++ b/docker/docker-entrypoint.sh
@@ -0,0 +1,15 @@
1#!/bin/bash -e
2
3echo "${LOCAL_PORT_RANGE:-49152 65535}" > /proc/sys/net/ipv4/ip_local_port_range
4sed -i 's/$GNUNET_PORT/'${GNUNET_PORT:-2086}'/g' /etc/gnunet.conf
5
6if [[ $# -eq 0 ]]; then
7 exec gnunet-arm \
8 --config=/etc/gnunet.conf \
9 --start \
10 --monitor
11elif [[ -z $1 ]] || [[ ${1:0:1} == '-' ]]; then
12 exec gnunet-arm "$@"
13else
14 exec "$@"
15fi
diff --git a/docker/gnunet.conf b/docker/gnunet.conf
new file mode 100644
index 000000000..c8299ef46
--- /dev/null
+++ b/docker/gnunet.conf
@@ -0,0 +1,21 @@
1[arm]
2SYSTEM_ONLY = NO
3USER_ONLY = NO
4
5[fs]
6FORCESTART = NO
7
8[nat]
9ENABLE_UPNP = NO
10BEHIND_NAT = YES
11
12[transport-tcp]
13PORT = $GNUNET_PORT
14ADVERTISED_PORT = $GNUNET_PORT
15
16[transport-udp]
17PORT = $GNUNET_PORT
18BROADCAST = YES
19
20[cadet]
21TESTING_IGNORE_KEYS = ACCEPT_FROM;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8a95064a6..86235f860 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,13 +4,21 @@ src/arm/arm_monitor_api.c
4src/arm/gnunet-arm.c 4src/arm/gnunet-arm.c
5src/arm/gnunet-service-arm.c 5src/arm/gnunet-service-arm.c
6src/arm/mockup-service.c 6src/arm/mockup-service.c
7src/ats-tests/ats-testing-experiment.c
8src/ats-tests/ats-testing-log.c
9src/ats-tests/ats-testing-preferences.c
10src/ats-tests/ats-testing-traffic.c
11src/ats-tests/ats-testing.c
12src/ats-tests/gnunet-ats-sim.c
13src/ats-tests/gnunet-solver-eval.c
14src/ats-tool/gnunet-ats.c
7src/ats/ats_api_connectivity.c 15src/ats/ats_api_connectivity.c
8src/ats/ats_api_performance.c 16src/ats/ats_api_performance.c
9src/ats/ats_api_scanner.c 17src/ats/ats_api_scanner.c
10src/ats/ats_api_scheduling.c 18src/ats/ats_api_scheduling.c
11src/ats/gnunet-ats-solver-eval.c 19src/ats/gnunet-ats-solver-eval.c
12src/ats/gnunet-service-ats_addresses.c
13src/ats/gnunet-service-ats.c 20src/ats/gnunet-service-ats.c
21src/ats/gnunet-service-ats_addresses.c
14src/ats/gnunet-service-ats_connectivity.c 22src/ats/gnunet-service-ats_connectivity.c
15src/ats/gnunet-service-ats_normalization.c 23src/ats/gnunet-service-ats_normalization.c
16src/ats/gnunet-service-ats_performance.c 24src/ats/gnunet-service-ats_performance.c
@@ -21,14 +29,6 @@ src/ats/gnunet-service-ats_scheduling.c
21src/ats/plugin_ats_mlp.c 29src/ats/plugin_ats_mlp.c
22src/ats/plugin_ats_proportional.c 30src/ats/plugin_ats_proportional.c
23src/ats/plugin_ats_ril.c 31src/ats/plugin_ats_ril.c
24src/ats-tests/ats-testing.c
25src/ats-tests/ats-testing-experiment.c
26src/ats-tests/ats-testing-log.c
27src/ats-tests/ats-testing-preferences.c
28src/ats-tests/ats-testing-traffic.c
29src/ats-tests/gnunet-ats-sim.c
30src/ats-tests/gnunet-solver-eval.c
31src/ats-tool/gnunet-ats.c
32src/auction/gnunet-auction-create.c 32src/auction/gnunet-auction-create.c
33src/auction/gnunet-auction-info.c 33src/auction/gnunet-auction-info.c
34src/auction/gnunet-auction-join.c 34src/auction/gnunet-auction-join.c
@@ -40,8 +40,8 @@ src/block/plugin_block_test.c
40src/cadet/cadet_api.c 40src/cadet/cadet_api.c
41src/cadet/cadet_test_lib.c 41src/cadet/cadet_test_lib.c
42src/cadet/desirability_table.c 42src/cadet/desirability_table.c
43src/cadet/gnunet-cadet.c
44src/cadet/gnunet-cadet-profiler.c 43src/cadet/gnunet-cadet-profiler.c
44src/cadet/gnunet-cadet.c
45src/cadet/gnunet-service-cadet.c 45src/cadet/gnunet-service-cadet.c
46src/cadet/gnunet-service-cadet_channel.c 46src/cadet/gnunet-service-cadet_channel.c
47src/cadet/gnunet-service-cadet_connection.c 47src/cadet/gnunet-service-cadet_connection.c
@@ -57,15 +57,15 @@ src/consensus/gnunet-service-consensus.c
57src/consensus/plugin_block_consensus.c 57src/consensus/plugin_block_consensus.c
58src/conversation/conversation_api.c 58src/conversation/conversation_api.c
59src/conversation/conversation_api_call.c 59src/conversation/conversation_api_call.c
60src/conversation/gnunet-conversation.c
61src/conversation/gnunet-conversation-test.c 60src/conversation/gnunet-conversation-test.c
62src/conversation/gnunet_gst.c 61src/conversation/gnunet-conversation.c
63src/conversation/gnunet_gst_test.c
64src/conversation/gnunet-helper-audio-playback.c
65src/conversation/gnunet-helper-audio-playback-gst.c 62src/conversation/gnunet-helper-audio-playback-gst.c
66src/conversation/gnunet-helper-audio-record.c 63src/conversation/gnunet-helper-audio-playback.c
67src/conversation/gnunet-helper-audio-record-gst.c 64src/conversation/gnunet-helper-audio-record-gst.c
65src/conversation/gnunet-helper-audio-record.c
68src/conversation/gnunet-service-conversation.c 66src/conversation/gnunet-service-conversation.c
67src/conversation/gnunet_gst.c
68src/conversation/gnunet_gst_test.c
69src/conversation/microphone.c 69src/conversation/microphone.c
70src/conversation/plugin_gnsrecord_conversation.c 70src/conversation/plugin_gnsrecord_conversation.c
71src/conversation/speaker.c 71src/conversation/speaker.c
@@ -102,7 +102,6 @@ src/dht/dht_api.c
102src/dht/dht_test_lib.c 102src/dht/dht_test_lib.c
103src/dht/gnunet-dht-get.c 103src/dht/gnunet-dht-get.c
104src/dht/gnunet-dht-monitor.c 104src/dht/gnunet-dht-monitor.c
105src/dht/gnunet_dht_profiler.c
106src/dht/gnunet-dht-put.c 105src/dht/gnunet-dht-put.c
107src/dht/gnunet-service-dht.c 106src/dht/gnunet-service-dht.c
108src/dht/gnunet-service-dht_clients.c 107src/dht/gnunet-service-dht_clients.c
@@ -111,6 +110,7 @@ src/dht/gnunet-service-dht_hello.c
111src/dht/gnunet-service-dht_neighbours.c 110src/dht/gnunet-service-dht_neighbours.c
112src/dht/gnunet-service-dht_nse.c 111src/dht/gnunet-service-dht_nse.c
113src/dht/gnunet-service-dht_routing.c 112src/dht/gnunet-service-dht_routing.c
113src/dht/gnunet_dht_profiler.c
114src/dht/plugin_block_dht.c 114src/dht/plugin_block_dht.c
115src/dns/dns_api.c 115src/dns/dns_api.c
116src/dns/gnunet-dns-monitor.c 116src/dns/gnunet-dns-monitor.c
@@ -124,8 +124,8 @@ src/dv/gnunet-dv.c
124src/dv/gnunet-service-dv.c 124src/dv/gnunet-service-dv.c
125src/dv/plugin_transport_dv.c 125src/dv/plugin_transport_dv.c
126src/exit/gnunet-daemon-exit.c 126src/exit/gnunet-daemon-exit.c
127src/exit/gnunet-helper-exit.c
128src/exit/gnunet-helper-exit-windows.c 127src/exit/gnunet-helper-exit-windows.c
128src/exit/gnunet-helper-exit.c
129src/fragmentation/defragmentation.c 129src/fragmentation/defragmentation.c
130src/fragmentation/fragmentation.c 130src/fragmentation/fragmentation.c
131src/fs/fs_api.c 131src/fs/fs_api.c
@@ -150,8 +150,8 @@ src/fs/gnunet-auto-share.c
150src/fs/gnunet-daemon-fsprofiler.c 150src/fs/gnunet-daemon-fsprofiler.c
151src/fs/gnunet-directory.c 151src/fs/gnunet-directory.c
152src/fs/gnunet-download.c 152src/fs/gnunet-download.c
153src/fs/gnunet-fs.c
154src/fs/gnunet-fs-profiler.c 153src/fs/gnunet-fs-profiler.c
154src/fs/gnunet-fs.c
155src/fs/gnunet-helper-fs-publish.c 155src/fs/gnunet-helper-fs-publish.c
156src/fs/gnunet-publish.c 156src/fs/gnunet-publish.c
157src/fs/gnunet-search.c 157src/fs/gnunet-search.c
@@ -171,10 +171,10 @@ src/gns/gns_tld_api.c
171src/gns/gnunet-bcd.c 171src/gns/gnunet-bcd.c
172src/gns/gnunet-dns2gns.c 172src/gns/gnunet-dns2gns.c
173src/gns/gnunet-gns-benchmark.c 173src/gns/gnunet-gns-benchmark.c
174src/gns/gnunet-gns.c
175src/gns/gnunet-gns-helper-service-w32.c 174src/gns/gnunet-gns-helper-service-w32.c
176src/gns/gnunet-gns-import.c 175src/gns/gnunet-gns-import.c
177src/gns/gnunet-gns-proxy.c 176src/gns/gnunet-gns-proxy.c
177src/gns/gnunet-gns.c
178src/gns/gnunet-service-gns.c 178src/gns/gnunet-service-gns.c
179src/gns/gnunet-service-gns_interceptor.c 179src/gns/gnunet-service-gns_interceptor.c
180src/gns/gnunet-service-gns_resolver.c 180src/gns/gnunet-service-gns_resolver.c
@@ -183,45 +183,35 @@ src/gns/nss/nss_gns_query.c
183src/gns/plugin_block_gns.c 183src/gns/plugin_block_gns.c
184src/gns/plugin_gnsrecord_gns.c 184src/gns/plugin_gnsrecord_gns.c
185src/gns/plugin_rest_gns.c 185src/gns/plugin_rest_gns.c
186src/gns/w32nsp-install.c
187src/gns/w32nsp-resolve.c
188src/gns/w32nsp-uninstall.c
189src/gns/w32nsp.c
186src/gnsrecord/gnsrecord.c 190src/gnsrecord/gnsrecord.c
187src/gnsrecord/gnsrecord_crypto.c 191src/gnsrecord/gnsrecord_crypto.c
188src/gnsrecord/gnsrecord_misc.c 192src/gnsrecord/gnsrecord_misc.c
189src/gnsrecord/gnsrecord_serialization.c 193src/gnsrecord/gnsrecord_serialization.c
190src/gnsrecord/plugin_gnsrecord_dns.c 194src/gnsrecord/plugin_gnsrecord_dns.c
191src/gns/w32nsp.c
192src/gns/w32nsp-install.c
193src/gns/w32nsp-resolve.c
194src/gns/w32nsp-uninstall.c
195src/hello/address.c 195src/hello/address.c
196src/hello/gnunet-hello.c 196src/hello/gnunet-hello.c
197src/hello/hello.c 197src/hello/hello.c
198src/hostlist/gnunet-daemon-hostlist.c 198src/hostlist/gnunet-daemon-hostlist.c
199src/hostlist/gnunet-daemon-hostlist_client.c 199src/hostlist/gnunet-daemon-hostlist_client.c
200src/hostlist/gnunet-daemon-hostlist_server.c 200src/hostlist/gnunet-daemon-hostlist_server.c
201src/identity-attribute/identity_attribute.c
202src/identity-attribute/plugin_identity_attribute_gnuid.c
203src/identity/gnunet-identity.c 201src/identity/gnunet-identity.c
204src/identity/gnunet-service-identity.c 202src/identity/gnunet-service-identity.c
205src/identity/identity_api.c 203src/identity/identity_api.c
206src/identity/identity_api_lookup.c 204src/identity/identity_api_lookup.c
207src/identity/plugin_rest_identity.c 205src/identity/plugin_rest_identity.c
208src/identity-provider/gnunet-idp.c 206src/json/json.c
209src/identity-provider/gnunet-service-identity-provider.c 207src/json/json_generator.c
210src/identity-provider/identity_provider_api.c 208src/json/json_helper.c
211src/identity-provider/jwt.c 209src/json/json_mhd.c
212src/identity-provider/plugin_gnsrecord_identity_provider.c
213src/identity-provider/plugin_identity_provider_sqlite.c
214src/identity-provider/plugin_rest_identity_provider.c
215src/identity-provider/plugin_rest_openid_connect.c
216src/jsonapi/jsonapi.c 210src/jsonapi/jsonapi.c
217src/jsonapi/jsonapi_document.c 211src/jsonapi/jsonapi_document.c
218src/jsonapi/jsonapi_error.c 212src/jsonapi/jsonapi_error.c
219src/jsonapi/jsonapi_relationship.c 213src/jsonapi/jsonapi_relationship.c
220src/jsonapi/jsonapi_resource.c 214src/jsonapi/jsonapi_resource.c
221src/json/json.c
222src/json/json_generator.c
223src/json/json_helper.c
224src/json/json_mhd.c
225src/multicast/gnunet-multicast.c 215src/multicast/gnunet-multicast.c
226src/multicast/gnunet-service-multicast.c 216src/multicast/gnunet-service-multicast.c
227src/multicast/multicast_api.c 217src/multicast/multicast_api.c
@@ -235,8 +225,8 @@ src/namecache/namecache_api.c
235src/namecache/plugin_namecache_flat.c 225src/namecache/plugin_namecache_flat.c
236src/namecache/plugin_namecache_postgres.c 226src/namecache/plugin_namecache_postgres.c
237src/namecache/plugin_namecache_sqlite.c 227src/namecache/plugin_namecache_sqlite.c
238src/namestore/gnunet-namestore.c
239src/namestore/gnunet-namestore-fcfsd.c 228src/namestore/gnunet-namestore-fcfsd.c
229src/namestore/gnunet-namestore.c
240src/namestore/gnunet-service-namestore.c 230src/namestore/gnunet-service-namestore.c
241src/namestore/gnunet-zoneimport.c 231src/namestore/gnunet-zoneimport.c
242src/namestore/namestore_api.c 232src/namestore/namestore_api.c
@@ -252,10 +242,10 @@ src/nat-auto/gnunet-service-nat-auto.c
252src/nat-auto/gnunet-service-nat-auto_legacy.c 242src/nat-auto/gnunet-service-nat-auto_legacy.c
253src/nat-auto/nat_auto_api.c 243src/nat-auto/nat_auto_api.c
254src/nat-auto/nat_auto_api_test.c 244src/nat-auto/nat_auto_api_test.c
255src/nat/gnunet-helper-nat-client.c
256src/nat/gnunet-helper-nat-client-windows.c 245src/nat/gnunet-helper-nat-client-windows.c
257src/nat/gnunet-helper-nat-server.c 246src/nat/gnunet-helper-nat-client.c
258src/nat/gnunet-helper-nat-server-windows.c 247src/nat/gnunet-helper-nat-server-windows.c
248src/nat/gnunet-helper-nat-server.c
259src/nat/gnunet-nat.c 249src/nat/gnunet-nat.c
260src/nat/gnunet-service-nat.c 250src/nat/gnunet-service-nat.c
261src/nat/gnunet-service-nat_externalip.c 251src/nat/gnunet-service-nat_externalip.c
@@ -264,15 +254,15 @@ src/nat/gnunet-service-nat_mini.c
264src/nat/gnunet-service-nat_stun.c 254src/nat/gnunet-service-nat_stun.c
265src/nat/nat_api.c 255src/nat/nat_api.c
266src/nat/nat_api_stun.c 256src/nat/nat_api_stun.c
267src/nse/gnunet-nse.c
268src/nse/gnunet-nse-profiler.c 257src/nse/gnunet-nse-profiler.c
258src/nse/gnunet-nse.c
269src/nse/gnunet-service-nse.c 259src/nse/gnunet-service-nse.c
270src/nse/nse_api.c 260src/nse/nse_api.c
261src/peerinfo-tool/gnunet-peerinfo.c
262src/peerinfo-tool/gnunet-peerinfo_plugins.c
271src/peerinfo/gnunet-service-peerinfo.c 263src/peerinfo/gnunet-service-peerinfo.c
272src/peerinfo/peerinfo_api.c 264src/peerinfo/peerinfo_api.c
273src/peerinfo/peerinfo_api_notify.c 265src/peerinfo/peerinfo_api_notify.c
274src/peerinfo-tool/gnunet-peerinfo.c
275src/peerinfo-tool/gnunet-peerinfo_plugins.c
276src/peerstore/gnunet-peerstore.c 266src/peerstore/gnunet-peerstore.c
277src/peerstore/gnunet-service-peerstore.c 267src/peerstore/gnunet-service-peerstore.c
278src/peerstore/peerstore_api.c 268src/peerstore/peerstore_api.c
@@ -297,6 +287,16 @@ src/psycutil/psyc_env.c
297src/psycutil/psyc_message.c 287src/psycutil/psyc_message.c
298src/psycutil/psyc_slicer.c 288src/psycutil/psyc_slicer.c
299src/pt/gnunet-daemon-pt.c 289src/pt/gnunet-daemon-pt.c
290src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
291src/reclaim-attribute/reclaim_attribute.c
292src/reclaim/gnunet-reclaim.c
293src/reclaim/gnunet-service-reclaim.c
294src/reclaim/jwt.c
295src/reclaim/plugin_gnsrecord_reclaim.c
296src/reclaim/plugin_reclaim_sqlite.c
297src/reclaim/plugin_rest_openid_connect.c
298src/reclaim/plugin_rest_reclaim.c
299src/reclaim/reclaim_api.c
300src/regex/gnunet-daemon-regexprofiler.c 300src/regex/gnunet-daemon-regexprofiler.c
301src/regex/gnunet-regex-profiler.c 301src/regex/gnunet-regex-profiler.c
302src/regex/gnunet-regex-simulation-profiler.c 302src/regex/gnunet-regex-simulation-profiler.c
@@ -317,21 +317,20 @@ src/revocation/gnunet-revocation.c
317src/revocation/gnunet-service-revocation.c 317src/revocation/gnunet-service-revocation.c
318src/revocation/plugin_block_revocation.c 318src/revocation/plugin_block_revocation.c
319src/revocation/revocation_api.c 319src/revocation/revocation_api.c
320src/rps/gnunet-rps.c
321src/rps/gnunet-rps-profiler.c 320src/rps/gnunet-rps-profiler.c
321src/rps/gnunet-rps.c
322src/rps/gnunet-service-rps.c 322src/rps/gnunet-service-rps.c
323src/rps/gnunet-service-rps_custommap.c 323src/rps/gnunet-service-rps_custommap.c
324src/rps/gnunet-service-rps_sampler.c 324src/rps/gnunet-service-rps_sampler.c
325src/rps/gnunet-service-rps_sampler_elem.c 325src/rps/gnunet-service-rps_sampler_elem.c
326src/rps/gnunet-service-rps_view.c 326src/rps/gnunet-service-rps_view.c
327src/rps/rps_api.c
328src/rps/rps_test_lib.c
329src/rps/rps-test_util.c 327src/rps/rps-test_util.c
328src/rps/rps_api.c
330src/scalarproduct/gnunet-scalarproduct.c 329src/scalarproduct/gnunet-scalarproduct.c
331src/scalarproduct/gnunet-service-scalarproduct_alice.c
332src/scalarproduct/gnunet-service-scalarproduct_bob.c
333src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c 330src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
334src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c 331src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
332src/scalarproduct/gnunet-service-scalarproduct_alice.c
333src/scalarproduct/gnunet-service-scalarproduct_bob.c
335src/scalarproduct/scalarproduct_api.c 334src/scalarproduct/scalarproduct_api.c
336src/secretsharing/gnunet-secretsharing-profiler.c 335src/secretsharing/gnunet-secretsharing-profiler.c
337src/secretsharing/gnunet-service-secretsharing.c 336src/secretsharing/gnunet-service-secretsharing.c
@@ -360,15 +359,16 @@ src/statistics/gnunet-statistics.c
360src/statistics/statistics_api.c 359src/statistics/statistics_api.c
361src/template/gnunet-service-template.c 360src/template/gnunet-service-template.c
362src/template/gnunet-template.c 361src/template/gnunet-template.c
362src/testbed-logger/gnunet-service-testbed-logger.c
363src/testbed-logger/testbed_logger_api.c
363src/testbed/generate-underlay-topology.c 364src/testbed/generate-underlay-topology.c
364src/testbed/gnunet-daemon-latency-logger.c 365src/testbed/gnunet-daemon-latency-logger.c
365src/testbed/gnunet-daemon-testbed-blacklist.c 366src/testbed/gnunet-daemon-testbed-blacklist.c
366src/testbed/gnunet-daemon-testbed-underlay.c 367src/testbed/gnunet-daemon-testbed-underlay.c
367src/testbed/gnunet-helper-testbed.c 368src/testbed/gnunet-helper-testbed.c
368src/testbed/gnunet_mpi_test.c
369src/testbed/gnunet-service-test-barriers.c 369src/testbed/gnunet-service-test-barriers.c
370src/testbed/gnunet-service-testbed_barriers.c
371src/testbed/gnunet-service-testbed.c 370src/testbed/gnunet-service-testbed.c
371src/testbed/gnunet-service-testbed_barriers.c
372src/testbed/gnunet-service-testbed_cache.c 372src/testbed/gnunet-service-testbed_cache.c
373src/testbed/gnunet-service-testbed_connectionpool.c 373src/testbed/gnunet-service-testbed_connectionpool.c
374src/testbed/gnunet-service-testbed_cpustatus.c 374src/testbed/gnunet-service-testbed_cpustatus.c
@@ -376,20 +376,19 @@ src/testbed/gnunet-service-testbed_links.c
376src/testbed/gnunet-service-testbed_meminfo.c 376src/testbed/gnunet-service-testbed_meminfo.c
377src/testbed/gnunet-service-testbed_oc.c 377src/testbed/gnunet-service-testbed_oc.c
378src/testbed/gnunet-service-testbed_peers.c 378src/testbed/gnunet-service-testbed_peers.c
379src/testbed/gnunet_testbed_mpi_spawn.c
380src/testbed/gnunet-testbed-profiler.c 379src/testbed/gnunet-testbed-profiler.c
381src/testbed-logger/gnunet-service-testbed-logger.c 380src/testbed/gnunet_mpi_test.c
382src/testbed-logger/testbed_logger_api.c 381src/testbed/gnunet_testbed_mpi_spawn.c
383src/testbed/testbed_api_barriers.c
384src/testbed/testbed_api.c 382src/testbed/testbed_api.c
383src/testbed/testbed_api_barriers.c
385src/testbed/testbed_api_hosts.c 384src/testbed/testbed_api_hosts.c
386src/testbed/testbed_api_operations.c 385src/testbed/testbed_api_operations.c
387src/testbed/testbed_api_peers.c 386src/testbed/testbed_api_peers.c
388src/testbed/testbed_api_sd.c 387src/testbed/testbed_api_sd.c
389src/testbed/testbed_api_services.c 388src/testbed/testbed_api_services.c
390src/testbed/testbed_api_statistics.c 389src/testbed/testbed_api_statistics.c
391src/testbed/testbed_api_testbed.c
392src/testbed/testbed_api_test.c 390src/testbed/testbed_api_test.c
391src/testbed/testbed_api_testbed.c
393src/testbed/testbed_api_topology.c 392src/testbed/testbed_api_topology.c
394src/testbed/testbed_api_underlay.c 393src/testbed/testbed_api_underlay.c
395src/testing/gnunet-testing.c 394src/testing/gnunet-testing.c
@@ -398,28 +397,28 @@ src/testing/testing.c
398src/topology/friends.c 397src/topology/friends.c
399src/topology/gnunet-daemon-topology.c 398src/topology/gnunet-daemon-topology.c
400src/transport/gnunet-helper-transport-bluetooth.c 399src/transport/gnunet-helper-transport-bluetooth.c
401src/transport/gnunet-helper-transport-wlan.c
402src/transport/gnunet-helper-transport-wlan-dummy.c 400src/transport/gnunet-helper-transport-wlan-dummy.c
403src/transport/gnunet-service-transport_ats.c 401src/transport/gnunet-helper-transport-wlan.c
404src/transport/gnunet-service-transport.c 402src/transport/gnunet-service-transport.c
403src/transport/gnunet-service-transport_ats.c
405src/transport/gnunet-service-transport_hello.c 404src/transport/gnunet-service-transport_hello.c
406src/transport/gnunet-service-transport_manipulation.c 405src/transport/gnunet-service-transport_manipulation.c
407src/transport/gnunet-service-transport_neighbours.c 406src/transport/gnunet-service-transport_neighbours.c
408src/transport/gnunet-service-transport_plugins.c 407src/transport/gnunet-service-transport_plugins.c
409src/transport/gnunet-service-transport_validation.c 408src/transport/gnunet-service-transport_validation.c
410src/transport/gnunet-transport.c
411src/transport/gnunet-transport-certificate-creation.c 409src/transport/gnunet-transport-certificate-creation.c
412src/transport/gnunet-transport-profiler.c 410src/transport/gnunet-transport-profiler.c
413src/transport/gnunet-transport-wlan-receiver.c 411src/transport/gnunet-transport-wlan-receiver.c
414src/transport/gnunet-transport-wlan-sender.c 412src/transport/gnunet-transport-wlan-sender.c
413src/transport/gnunet-transport.c
415src/transport/plugin_transport_http_client.c 414src/transport/plugin_transport_http_client.c
416src/transport/plugin_transport_http_common.c 415src/transport/plugin_transport_http_common.c
417src/transport/plugin_transport_http_server.c 416src/transport/plugin_transport_http_server.c
418src/transport/plugin_transport_smtp.c 417src/transport/plugin_transport_smtp.c
419src/transport/plugin_transport_tcp.c 418src/transport/plugin_transport_tcp.c
420src/transport/plugin_transport_template.c 419src/transport/plugin_transport_template.c
421src/transport/plugin_transport_udp_broadcasting.c
422src/transport/plugin_transport_udp.c 420src/transport/plugin_transport_udp.c
421src/transport/plugin_transport_udp_broadcasting.c
423src/transport/plugin_transport_unix.c 422src/transport/plugin_transport_unix.c
424src/transport/plugin_transport_wlan.c 423src/transport/plugin_transport_wlan.c
425src/transport/plugin_transport_xt.c 424src/transport/plugin_transport_xt.c
@@ -428,6 +427,11 @@ src/transport/tcp_connection_legacy.c
428src/transport/tcp_server_legacy.c 427src/transport/tcp_server_legacy.c
429src/transport/tcp_server_mst_legacy.c 428src/transport/tcp_server_mst_legacy.c
430src/transport/tcp_service_legacy.c 429src/transport/tcp_service_legacy.c
430src/transport/transport-testing-filenames.c
431src/transport/transport-testing-loggers.c
432src/transport/transport-testing-main.c
433src/transport/transport-testing-send.c
434src/transport/transport-testing.c
431src/transport/transport_api_address_to_string.c 435src/transport/transport_api_address_to_string.c
432src/transport/transport_api_blacklist.c 436src/transport/transport_api_blacklist.c
433src/transport/transport_api_core.c 437src/transport/transport_api_core.c
@@ -436,11 +440,6 @@ src/transport/transport_api_manipulation.c
436src/transport/transport_api_monitor_peers.c 440src/transport/transport_api_monitor_peers.c
437src/transport/transport_api_monitor_plugins.c 441src/transport/transport_api_monitor_plugins.c
438src/transport/transport_api_offer_hello.c 442src/transport/transport_api_offer_hello.c
439src/transport/transport-testing.c
440src/transport/transport-testing-filenames.c
441src/transport/transport-testing-loggers.c
442src/transport/transport-testing-main.c
443src/transport/transport-testing-send.c
444src/util/bandwidth.c 443src/util/bandwidth.c
445src/util/bio.c 444src/util/bio.c
446src/util/client.c 445src/util/client.c
@@ -452,8 +451,8 @@ src/util/configuration_loader.c
452src/util/container_bloomfilter.c 451src/util/container_bloomfilter.c
453src/util/container_heap.c 452src/util/container_heap.c
454src/util/container_meta_data.c 453src/util/container_meta_data.c
455src/util/container_multihashmap32.c
456src/util/container_multihashmap.c 454src/util/container_multihashmap.c
455src/util/container_multihashmap32.c
457src/util/container_multipeermap.c 456src/util/container_multipeermap.c
458src/util/container_multishortmap.c 457src/util/container_multishortmap.c
459src/util/crypto_abe.c 458src/util/crypto_abe.c
@@ -475,13 +474,15 @@ src/util/dnsparser.c
475src/util/dnsstub.c 474src/util/dnsstub.c
476src/util/getopt.c 475src/util/getopt.c
477src/util/getopt_helpers.c 476src/util/getopt_helpers.c
478src/util/gnunet-config.c
479src/util/gnunet-config-diff.c 477src/util/gnunet-config-diff.c
478src/util/gnunet-config.c
480src/util/gnunet-ecc.c 479src/util/gnunet-ecc.c
481src/util/gnunet-helper-w32-console.c 480src/util/gnunet-helper-w32-console.c
482src/util/gnunet-resolver.c 481src/util/gnunet-resolver.c
483src/util/gnunet-scrypt.c 482src/util/gnunet-scrypt.c
484src/util/gnunet-service-resolver.c 483src/util/gnunet-service-resolver.c
484src/util/gnunet-timeout-w32.c
485src/util/gnunet-timeout.c
485src/util/gnunet-uri.c 486src/util/gnunet-uri.c
486src/util/helper.c 487src/util/helper.c
487src/util/load.c 488src/util/load.c
@@ -509,13 +510,13 @@ src/util/tun.c
509src/util/w32cat.c 510src/util/w32cat.c
510src/util/win.c 511src/util/win.c
511src/util/winproc.c 512src/util/winproc.c
512src/vpn/gnunet-helper-vpn.c
513src/vpn/gnunet-helper-vpn-windows.c 513src/vpn/gnunet-helper-vpn-windows.c
514src/vpn/gnunet-helper-vpn.c
514src/vpn/gnunet-service-vpn.c 515src/vpn/gnunet-service-vpn.c
515src/vpn/gnunet-vpn.c 516src/vpn/gnunet-vpn.c
516src/vpn/vpn_api.c 517src/vpn/vpn_api.c
517src/zonemaster/gnunet-service-zonemaster.c
518src/zonemaster/gnunet-service-zonemaster-monitor.c 518src/zonemaster/gnunet-service-zonemaster-monitor.c
519src/zonemaster/gnunet-service-zonemaster.c
519src/fs/fs_api.h 520src/fs/fs_api.h
520src/include/gnunet_common.h 521src/include/gnunet_common.h
521src/include/gnunet_mq_lib.h 522src/include/gnunet_mq_lib.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 00f30adc3..4ded81891 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,11 +19,13 @@ if HAVE_EXPERIMENTAL
19 social 19 social
20# dv (FTBFS) 20# dv (FTBFS)
21if HAVE_ABE 21if HAVE_ABE
22if HAVE_JSON
22 EXP_DIR += \ 23 EXP_DIR += \
23 abe \ 24 abe \
24 credential \ 25 credential \
25 identity-attribute \ 26 reclaim-attribute \
26 identity-provider 27 reclaim
28endif
27endif 29endif
28if HAVE_JSON 30if HAVE_JSON
29 EXP_DIR += \ 31 EXP_DIR += \
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c
index 4a7d51bc7..f15bca2db 100644
--- a/src/arm/test_exponential_backoff.c
+++ b/src/arm/test_exponential_backoff.c
@@ -343,7 +343,10 @@ init ()
343 cfg = GNUNET_CONFIGURATION_create (); 343 cfg = GNUNET_CONFIGURATION_create ();
344 if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, 344 if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg,
345 "test_arm_api_data.conf")) 345 "test_arm_api_data.conf"))
346 {
347 GNUNET_CONFIGURATION_destroy (cfg);
346 return GNUNET_SYSERR; 348 return GNUNET_SYSERR;
349 }
347 if (NULL == getcwd (pwd, PATH_MAX)) 350 if (NULL == getcwd (pwd, PATH_MAX))
348 return GNUNET_SYSERR; 351 return GNUNET_SYSERR;
349 GNUNET_assert (0 < GNUNET_asprintf (&binary, 352 GNUNET_assert (0 < GNUNET_asprintf (&binary,
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 319279110..92dd39b97 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -841,6 +841,7 @@ handle_mq_error (void *cls,
841 h); 841 h);
842 GNUNET_MQ_destroy (h->mq); 842 GNUNET_MQ_destroy (h->mq);
843 h->mq = NULL; 843 h->mq = NULL;
844 GNUNET_assert (NULL == h->reconnect_task);
844 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time, 845 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
845 &reconnect_cbk, 846 &reconnect_cbk,
846 h); 847 h);
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index 4cc5b4bcd..c7c71f1f1 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -143,6 +143,8 @@ do_shutdown (void *cls)
143 unsigned long long delta; 143 unsigned long long delta;
144 144
145 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us; 145 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
146 if (0 == delta)
147 delta = 1;
146 FPRINTF (stderr, 148 FPRINTF (stderr,
147 "\nThroughput was %llu kb/s\n", 149 "\nThroughput was %llu kb/s\n",
148 total_bytes * 1000000LL / 1024 / delta); 150 total_bytes * 1000000LL / 1024 / delta);
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index a15105556..caff045f0 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -227,7 +227,8 @@ measurement_stop (void *cls)
227 running = GNUNET_NO; 227 running = GNUNET_NO;
228 228
229 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us; 229 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
230 230 if (0 == delta)
231 delta = 1;
231 throughput_out = total_bytes_sent * 1000000LL / delta; /* convert to bytes/s */ 232 throughput_out = total_bytes_sent * 1000000LL / delta; /* convert to bytes/s */
232 throughput_in = total_bytes_recv * 1000000LL / delta; /* convert to bytes/s */ 233 throughput_in = total_bytes_recv * 1000000LL / delta; /* convert to bytes/s */
233 234
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c
index 4684e514c..dc4236a8b 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -749,7 +749,8 @@ libgnunet_plugin_datacache_sqlite_init (void *cls)
749 " value BLOB NOT NULL," 749 " value BLOB NOT NULL,"
750 " path BLOB DEFAULT '')"); 750 " path BLOB DEFAULT '')");
751 SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds091 (key,type,expire)"); 751 SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds091 (key,type,expire)");
752 SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire ON ds091 (prox,expire)"); 752 SQLITE3_EXEC (dbh, "CREATE INDEX idx_prox_expire ON ds091 (prox,expire)");
753 SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire_only ON ds091 (expire)");
753 plugin = GNUNET_new (struct Plugin); 754 plugin = GNUNET_new (struct Plugin);
754 plugin->env = env; 755 plugin->env = env;
755 plugin->dbh = dbh; 756 plugin->dbh = dbh;
diff --git a/src/identity-provider/identity-token.conf b/src/identity-provider/identity-token.conf
deleted file mode 100644
index f29f6cdf3..000000000
--- a/src/identity-provider/identity-token.conf
+++ /dev/null
@@ -1,2 +0,0 @@
1[identity-token]
2BINARY=gnunet-service-identity-token
diff --git a/src/identity-provider/jwt.c b/src/identity-provider/jwt.c
deleted file mode 100644
index 1a984f7b5..000000000
--- a/src/identity-provider/jwt.c
+++ /dev/null
@@ -1,189 +0,0 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2010-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
19/**
20 * @file identity-provider/jwt.c
21 * @brief helper library for JSON-Web-Tokens
22 * @author Martin Schanzenbach
23 */
24#include "platform.h"
25#include "gnunet_util_lib.h"
26#include "gnunet_signatures.h"
27#include "gnunet_identity_attribute_lib.h"
28#include <jansson.h>
29
30
31#define JWT_ALG "alg"
32
33/*TODO is this the correct way to define new algs? */
34#define JWT_ALG_VALUE "urn:org:gnunet:jwt:alg:ecdsa:ed25519"
35
36#define JWT_TYP "typ"
37
38#define JWT_TYP_VALUE "jwt"
39
40//TODO change server address
41#define SERVER_ADDRESS "https://localhost"
42
43static char*
44create_jwt_header(void)
45{
46 json_t *root;
47 char *json_str;
48
49 root = json_object ();
50 json_object_set_new (root, JWT_ALG, json_string (JWT_ALG_VALUE));
51 json_object_set_new (root, JWT_TYP, json_string (JWT_TYP_VALUE));
52
53 json_str = json_dumps (root, JSON_INDENT(1));
54 json_decref (root);
55 return json_str;
56}
57
58/**
59 * Create a JWT from attributes
60 *
61 * @param aud_key the public of the subject
62 * @param attrs the attribute list
63 * @param priv_key the key used to sign the JWT
64 * @return a new base64-encoded JWT string.
65 */
66char*
67jwt_create_from_list (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
68 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
69 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key)
70{
71 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
72 struct GNUNET_CRYPTO_EcdsaPublicKey sub_key;
73 struct GNUNET_CRYPTO_EcdsaSignature signature;
74 struct GNUNET_CRYPTO_EccSignaturePurpose *purpose;
75 char* audience;
76 char* subject;
77 char* header;
78 char* padding;
79 char* body_str;
80 char* result;
81 char* header_base64;
82 char* body_base64;
83 char* signature_target;
84 char* signature_base64;
85 char* attr_val_str;
86 json_t* body;
87
88 //exp REQUIRED time expired from config
89 //iat REQUIRED time now
90 //auth_time only if max_age
91 //nonce only if nonce
92 // OPTIONAL acr,amr,azp
93 GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &sub_key);
94 /* TODO maybe we should use a local identity here */
95 subject = GNUNET_STRINGS_data_to_string_alloc (&sub_key,
96 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
97 audience = GNUNET_STRINGS_data_to_string_alloc (aud_key,
98 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
99 header = create_jwt_header ();
100 body = json_object ();
101 /* TODO who is the issuer? local IdP or subject ? See self-issued tokens? */
102 //iss REQUIRED case sensitive server uri with https
103 json_object_set_new (body,
104 "iss", json_string (SERVER_ADDRESS));
105 //sub REQUIRED public key identity, not exceed 255 ASCII length
106 json_object_set_new (body,
107 "sub", json_string (subject));
108 /* TODO what should be in here exactly? */
109 //aud REQUIRED public key client_id must be there
110 json_object_set_new (body,
111 "aud", json_string (audience));
112 for (le = attrs->list_head; NULL != le; le = le->next)
113 {
114 /**
115 * TODO here we should have a function that
116 * calls the Attribute plugins to create a
117 * json representation for its value
118 */
119 attr_val_str = GNUNET_IDENTITY_ATTRIBUTE_value_to_string (le->claim->type,
120 le->claim->data,
121 le->claim->data_size);
122 json_object_set_new (body,
123 le->claim->name,
124 json_string (attr_val_str));
125 GNUNET_free (attr_val_str);
126 }
127 body_str = json_dumps (body, JSON_INDENT(0));
128 json_decref (body);
129
130 GNUNET_STRINGS_base64_encode (header,
131 strlen (header),
132 &header_base64);
133 //Remove GNUNET padding of base64
134 padding = strtok(header_base64, "=");
135 while (NULL != padding)
136 padding = strtok(NULL, "=");
137
138 GNUNET_STRINGS_base64_encode (body_str,
139 strlen (body_str),
140 &body_base64);
141
142 //Remove GNUNET padding of base64
143 padding = strtok(body_base64, "=");
144 while (NULL != padding)
145 padding = strtok(NULL, "=");
146
147 GNUNET_free (subject);
148 GNUNET_free (audience);
149
150 /**
151 * TODO
152 * Creating the JWT signature. This might not be
153 * standards compliant, check.
154 */
155 GNUNET_asprintf (&signature_target, "%s,%s", header_base64, body_base64);
156
157 purpose =
158 GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
159 strlen (signature_target));
160 purpose->size =
161 htonl (strlen (signature_target) + sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose));
162 purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TOKEN);
163 GNUNET_memcpy (&purpose[1], signature_target, strlen (signature_target));
164 if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign (priv_key,
165 purpose,
166 (struct GNUNET_CRYPTO_EcdsaSignature *)&signature))
167 {
168 GNUNET_free (signature_target);
169 GNUNET_free (body_str);
170 GNUNET_free (body_base64);
171 GNUNET_free (header_base64);
172 GNUNET_free (purpose);
173 return NULL;
174 }
175 GNUNET_STRINGS_base64_encode ((const char*)&signature,
176 sizeof (struct GNUNET_CRYPTO_EcdsaSignature),
177 &signature_base64);
178 GNUNET_asprintf (&result, "%s.%s.%s",
179 header_base64, body_base64, signature_base64);
180
181 GNUNET_free (signature_target);
182 GNUNET_free (header);
183 GNUNET_free (body_str);
184 GNUNET_free (signature_base64);
185 GNUNET_free (body_base64);
186 GNUNET_free (header_base64);
187 GNUNET_free (purpose);
188 return result;
189}
diff --git a/src/identity-provider/jwt.h b/src/identity-provider/jwt.h
deleted file mode 100644
index 072958973..000000000
--- a/src/identity-provider/jwt.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef JWT_H
2#define JWT_H
3
4char*
5jwt_create_from_list (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
6 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
7 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key);
8
9#endif
diff --git a/src/identity-provider/test_idp.conf b/src/identity-provider/test_idp.conf
deleted file mode 100644
index 3e4df561a..000000000
--- a/src/identity-provider/test_idp.conf
+++ /dev/null
@@ -1,33 +0,0 @@
1@INLINE@ test_idp_defaults.conf
2
3[PATHS]
4GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-idp-peer-1/
5
6[dht]
7START_ON_DEMAND = YES
8
9[rest]
10START_ON_DEMAND = YES
11PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/restlog
12
13[transport]
14PLUGINS =
15
16[identity-provider]
17START_ON_DEMAND = YES
18#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=$GNUNET_TMP/idplog
19
20[gns]
21#PREFIX = valgrind --leak-check=full --track-origins=yes
22START_ON_DEMAND = YES
23AUTO_IMPORT_PKEY = YES
24MAX_PARALLEL_BACKGROUND_QUERIES = 10
25DEFAULT_LOOKUP_TIMEOUT = 15 s
26RECORD_PUT_INTERVAL = 1 h
27ZONE_PUBLISH_TIME_WINDOW = 1 h
28DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
29
30[identity-rest-plugin]
31address = http://localhost:8000/#/login
32psw = mysupersecretpassword
33expiration_time = 3600
diff --git a/src/identity-provider/test_idp.sh b/src/identity-provider/test_idp.sh
deleted file mode 100755
index 598d1008c..000000000
--- a/src/identity-provider/test_idp.sh
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/bash
2#trap "gnunet-arm -e -c test_idp_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27gnunet-identity -C testego -c test_idp.conf
28valgrind gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
29gnunet-idp -e testego -a name -V John -c test_idp.conf
30gnunet-idp -e testego -D -c test_idp.conf
31gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_attribute.sh b/src/identity-provider/test_idp_attribute.sh
deleted file mode 100755
index 7f0f06dac..000000000
--- a/src/identity-provider/test_idp_attribute.sh
+++ /dev/null
@@ -1,40 +0,0 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27#gnunet-arm -i rest -c test_idp.conf
28gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf
30TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}')
31gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
32gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1
33if test $? != 0
34then
35 echo "Failed."
36 exit 1
37fi
38
39#curl localhost:7776/idp/attributes/testego
40gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_consume.sh b/src/identity-provider/test_idp_consume.sh
deleted file mode 100755
index 11f6865a4..000000000
--- a/src/identity-provider/test_idp_consume.sh
+++ /dev/null
@@ -1,43 +0,0 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27#gnunet-arm -i rest -c test_idp.conf
28gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}')
31TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}')
32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
33gnunet-idp -e testego -a name -V John -c test_idp.conf
34TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}')
35gnunet-idp -e rpego -C $TICKET -c test_idp.conf > /dev/null 2>&1
36
37if test $? != 0
38then
39 "Failed."
40 exit 1
41fi
42#curl http://localhost:7776/idp/tickets/testego
43gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_issue.sh b/src/identity-provider/test_idp_issue.sh
deleted file mode 100755
index 90487ee73..000000000
--- a/src/identity-provider/test_idp_issue.sh
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27#gnunet-arm -i rest -c test_idp.conf
28gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}')
31TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}')
32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1
33gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1
34#gnunet-idp -e testego -D -c test_idp.conf
35gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf > /dev/null 2>&1
36if test $? != 0
37then
38 echo "Failed."
39 exit 1
40fi
41#curl http://localhost:7776/idp/attributes/testego
42gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_revoke.sh b/src/identity-provider/test_idp_revoke.sh
deleted file mode 100755
index 7a3f5d030..000000000
--- a/src/identity-provider/test_idp_revoke.sh
+++ /dev/null
@@ -1,65 +0,0 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf 2&>1 > /dev/null
27gnunet-identity -C alice -c test_idp.conf
28gnunet-identity -C bob -c test_idp.conf
29gnunet-identity -C eve -c test_idp.conf
30ALICE_KEY=$(gnunet-identity -d -c test_idp.conf | grep alice | awk '{print $3}')
31BOB_KEY=$(gnunet-identity -d -c test_idp.conf | grep bob | awk '{print $3}')
32EVE_KEY=$(gnunet-identity -d -c test_idp.conf | grep eve | awk '{print $3}')
33
34gnunet-idp -e alice -E 15s -a email -V john@doe.gnu -c test_idp.conf
35gnunet-idp -e alice -E 15s -a name -V John -c test_idp.conf
36TICKET_BOB=$(gnunet-idp -e alice -i "email,name" -r $BOB_KEY -c test_idp.conf | awk '{print $1}')
37#gnunet-idp -e bob -C $TICKET_BOB -c test_idp.conf
38TICKET_EVE=$(gnunet-idp -e alice -i "email" -r $EVE_KEY -c test_idp.conf | awk '{print $1}')
39
40#echo "Consuming $TICKET"
41#gnunet-idp -e eve -C $TICKET_EVE -c test_idp.conf
42gnunet-idp -e alice -R $TICKET_EVE -c test_idp.conf
43
44#sleep 6
45
46gnunet-idp -e eve -C $TICKET_EVE -c test_idp.conf 2&>1 >/dev/null
47if test $? == 0
48then
49 echo "Eve can still resolve attributes..."
50 gnunet-arm -e -c test_idp.conf
51 exit 1
52fi
53
54gnunet-arm -e -c test_idp.conf
55gnunet-arm -s -c test_idp.conf 2&>1 > /dev/null
56
57gnunet-idp -e bob -C $TICKET_BOB -c test_idp.conf 2&>1 >/dev/null
58if test $? != 0
59then
60 echo "Bob cannot resolve attributes..."
61 gnunet-arm -e -c test_idp.conf
62 exit 1
63fi
64
65gnunet-arm -e -c test_idp.conf
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 6b8e21806..266f5ccc3 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -371,11 +371,12 @@ handle_get_default_message (void *cls,
371 struct GNUNET_MQ_Envelope *env; 371 struct GNUNET_MQ_Envelope *env;
372 struct GNUNET_SERVICE_Client *client = cls; 372 struct GNUNET_SERVICE_Client *client = cls;
373 struct Ego *ego; 373 struct Ego *ego;
374 const char *name; 374 char *name;
375 char *identifier; 375 char *identifier;
376 376
377 377
378 name = (const char *) &gdm[1]; 378 name = GNUNET_strdup ((const char *) &gdm[1]);
379 GNUNET_STRINGS_utf8_tolower ((const char *) &gdm[1], name);
379 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 380 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
380 "Received GET_DEFAULT for service `%s' from client\n", 381 "Received GET_DEFAULT for service `%s' from client\n",
381 name); 382 name);
@@ -387,6 +388,7 @@ handle_get_default_message (void *cls,
387 { 388 {
388 send_result_code (client, 1, gettext_noop ("no default known")); 389 send_result_code (client, 1, gettext_noop ("no default known"));
389 GNUNET_SERVICE_client_continue (client); 390 GNUNET_SERVICE_client_continue (client);
391 GNUNET_free (name);
390 return; 392 return;
391 } 393 }
392 for (ego = ego_head; NULL != ego; ego = ego->next) 394 for (ego = ego_head; NULL != ego; ego = ego->next)
@@ -399,6 +401,7 @@ handle_get_default_message (void *cls,
399 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), env); 401 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), env);
400 GNUNET_SERVICE_client_continue (client); 402 GNUNET_SERVICE_client_continue (client);
401 GNUNET_free (identifier); 403 GNUNET_free (identifier);
404 GNUNET_free (name);
402 return; 405 return;
403 } 406 }
404 } 407 }
@@ -406,6 +409,7 @@ handle_get_default_message (void *cls,
406 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
407 "Failed to find ego `%s'\n", 410 "Failed to find ego `%s'\n",
408 name); 411 name);
412 GNUNET_free (name);
409 send_result_code (client, 1, 413 send_result_code (client, 1,
410 gettext_noop ("default configured, but ego unknown (internal error)")); 414 gettext_noop ("default configured, but ego unknown (internal error)"));
411 GNUNET_SERVICE_client_continue (client); 415 GNUNET_SERVICE_client_continue (client);
@@ -477,9 +481,11 @@ handle_set_default_message (void *cls,
477{ 481{
478 struct Ego *ego; 482 struct Ego *ego;
479 struct GNUNET_SERVICE_Client *client = cls; 483 struct GNUNET_SERVICE_Client *client = cls;
480 const char *str; 484 char *str;
485
486 str = GNUNET_strdup ((const char *) &sdm[1]);
487 GNUNET_STRINGS_utf8_tolower ((const char *) &sdm[1], str);
481 488
482 str = (const char *) &sdm[1];
483 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 489 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
484 "Received SET_DEFAULT for service `%s' from client\n", 490 "Received SET_DEFAULT for service `%s' from client\n",
485 str); 491 str);
@@ -500,10 +506,12 @@ handle_set_default_message (void *cls,
500 subsystem_cfg_file); 506 subsystem_cfg_file);
501 send_result_code (client, 0, NULL); 507 send_result_code (client, 0, NULL);
502 GNUNET_SERVICE_client_continue (client); 508 GNUNET_SERVICE_client_continue (client);
509 GNUNET_free (str);
503 return; 510 return;
504 } 511 }
505 } 512 }
506 send_result_code (client, 1, _("Unknown ego specified for service (internal error)")); 513 send_result_code (client, 1, _("Unknown ego specified for service (internal error)"));
514 GNUNET_free (str);
507 GNUNET_SERVICE_client_continue (client); 515 GNUNET_SERVICE_client_continue (client);
508} 516}
509 517
@@ -585,12 +593,13 @@ handle_create_message (void *cls,
585{ 593{
586 struct GNUNET_SERVICE_Client *client = cls; 594 struct GNUNET_SERVICE_Client *client = cls;
587 struct Ego *ego; 595 struct Ego *ego;
588 const char *str; 596 char *str;
589 char *fn; 597 char *fn;
590 598
591 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 599 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
592 "Received CREATE message from client\n"); 600 "Received CREATE message from client\n");
593 str = (const char *) &crm[1]; 601 str = GNUNET_strdup ((const char *) &crm[1]);
602 GNUNET_STRINGS_utf8_tolower ((const char *) &crm[1], str);
594 for (ego = ego_head; NULL != ego; ego = ego->next) 603 for (ego = ego_head; NULL != ego; ego = ego->next)
595 { 604 {
596 if (0 == strcmp (ego->identifier, 605 if (0 == strcmp (ego->identifier,
@@ -598,6 +607,7 @@ handle_create_message (void *cls,
598 { 607 {
599 send_result_code (client, 1, gettext_noop ("identifier already in use for another ego")); 608 send_result_code (client, 1, gettext_noop ("identifier already in use for another ego"));
600 GNUNET_SERVICE_client_continue (client); 609 GNUNET_SERVICE_client_continue (client);
610 GNUNET_free (str);
601 return; 611 return;
602 } 612 }
603 } 613 }
@@ -620,6 +630,7 @@ handle_create_message (void *cls,
620 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, 630 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
621 "write", fn); 631 "write", fn);
622 GNUNET_free (fn); 632 GNUNET_free (fn);
633 GNUNET_free (str);
623 notify_listeners (ego); 634 notify_listeners (ego);
624 GNUNET_SERVICE_client_continue (client); 635 GNUNET_SERVICE_client_continue (client);
625} 636}
@@ -726,18 +737,22 @@ handle_rename_message (void *cls,
726{ 737{
727 uint16_t old_name_len; 738 uint16_t old_name_len;
728 struct Ego *ego; 739 struct Ego *ego;
729 const char *old_name; 740 char *old_name;
730 const char *new_name; 741 char *new_name;
731 struct RenameContext rename_ctx; 742 struct RenameContext rename_ctx;
732 struct GNUNET_SERVICE_Client *client = cls; 743 struct GNUNET_SERVICE_Client *client = cls;
733 char *fn_old; 744 char *fn_old;
734 char *fn_new; 745 char *fn_new;
746 const char *old_name_tmp;
735 747
736 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 748 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
737 "Received RENAME message from client\n"); 749 "Received RENAME message from client\n");
738 old_name_len = ntohs (rm->old_name_len); 750 old_name_len = ntohs (rm->old_name_len);
739 old_name = (const char *) &rm[1]; 751 old_name_tmp = (const char *) &rm[1];
740 new_name = &old_name[old_name_len]; 752 old_name = GNUNET_strdup (old_name_tmp);
753 GNUNET_STRINGS_utf8_tolower (old_name_tmp, old_name);
754 new_name = GNUNET_strdup (&old_name_tmp[old_name_len]);
755 GNUNET_STRINGS_utf8_tolower (&old_name_tmp[old_name_len], old_name);
741 756
742 /* check if new name is already in use */ 757 /* check if new name is already in use */
743 for (ego = ego_head; NULL != ego; ego = ego->next) 758 for (ego = ego_head; NULL != ego; ego = ego->next)
@@ -747,6 +762,8 @@ handle_rename_message (void *cls,
747 { 762 {
748 send_result_code (client, 1, gettext_noop ("target name already exists")); 763 send_result_code (client, 1, gettext_noop ("target name already exists"));
749 GNUNET_SERVICE_client_continue (client); 764 GNUNET_SERVICE_client_continue (client);
765 GNUNET_free (old_name);
766 GNUNET_free (new_name);
750 return; 767 return;
751 } 768 }
752 } 769 }
@@ -776,6 +793,8 @@ handle_rename_message (void *cls,
776 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old); 793 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old);
777 GNUNET_free (fn_old); 794 GNUNET_free (fn_old);
778 GNUNET_free (fn_new); 795 GNUNET_free (fn_new);
796 GNUNET_free (old_name);
797 GNUNET_free (new_name);
779 notify_listeners (ego); 798 notify_listeners (ego);
780 send_result_code (client, 0, NULL); 799 send_result_code (client, 0, NULL);
781 GNUNET_SERVICE_client_continue (client); 800 GNUNET_SERVICE_client_continue (client);
@@ -785,6 +804,8 @@ handle_rename_message (void *cls,
785 804
786 /* failed to locate old name */ 805 /* failed to locate old name */
787 send_result_code (client, 1, gettext_noop ("no matching ego found")); 806 send_result_code (client, 1, gettext_noop ("no matching ego found"));
807 GNUNET_free (old_name);
808 GNUNET_free (new_name);
788 GNUNET_SERVICE_client_continue (client); 809 GNUNET_SERVICE_client_continue (client);
789} 810}
790 811
@@ -868,13 +889,15 @@ handle_delete_message (void *cls,
868 const struct DeleteMessage *dm) 889 const struct DeleteMessage *dm)
869{ 890{
870 struct Ego *ego; 891 struct Ego *ego;
871 const char *name; 892 char *name;
872 char *fn; 893 char *fn;
873 struct GNUNET_SERVICE_Client *client = cls; 894 struct GNUNET_SERVICE_Client *client = cls;
874 895
875 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 896 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
876 "Received DELETE message from client\n"); 897 "Received DELETE message from client\n");
877 name = (const char *) &dm[1]; 898 name = GNUNET_strdup ((const char *) &dm[1]);
899 GNUNET_STRINGS_utf8_tolower ((const char *) &dm[1], name);
900
878 for (ego = ego_head; NULL != ego; ego = ego->next) 901 for (ego = ego_head; NULL != ego; ego = ego->next)
879 { 902 {
880 if (0 == strcmp (ego->identifier, 903 if (0 == strcmp (ego->identifier,
@@ -901,6 +924,7 @@ handle_delete_message (void *cls,
901 notify_listeners (ego); 924 notify_listeners (ego);
902 GNUNET_free (ego->pk); 925 GNUNET_free (ego->pk);
903 GNUNET_free (ego); 926 GNUNET_free (ego);
927 GNUNET_free (name);
904 send_result_code (client, 0, NULL); 928 send_result_code (client, 0, NULL);
905 GNUNET_SERVICE_client_continue (client); 929 GNUNET_SERVICE_client_continue (client);
906 return; 930 return;
@@ -908,6 +932,7 @@ handle_delete_message (void *cls,
908 } 932 }
909 933
910 send_result_code (client, 1, gettext_noop ("no matching ego found")); 934 send_result_code (client, 1, gettext_noop ("no matching ego found"));
935 GNUNET_free (name);
911 GNUNET_SERVICE_client_continue (client); 936 GNUNET_SERVICE_client_continue (client);
912} 937}
913 938
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 08e9dd156..41b2b1382 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -66,7 +66,7 @@ gnunetinclude_HEADERS = \
66 gnunet_hello_lib.h \ 66 gnunet_hello_lib.h \
67 gnunet_helper_lib.h \ 67 gnunet_helper_lib.h \
68 gnunet_identity_service.h \ 68 gnunet_identity_service.h \
69 gnunet_identity_provider_service.h \ 69 gnunet_reclaim_service.h \
70 gnunet_json_lib.h \ 70 gnunet_json_lib.h \
71 gnunet_jsonapi_lib.h \ 71 gnunet_jsonapi_lib.h \
72 gnunet_jsonapi_util.h \ 72 gnunet_jsonapi_util.h \
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h
index d380c9b03..554d4488b 100644
--- a/src/include/gnunet_abe_lib.h
+++ b/src/include/gnunet_abe_lib.h
@@ -87,7 +87,7 @@ GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key,
87 * Delete a CP-ABE key. 87 * Delete a CP-ABE key.
88 * 88 *
89 * @param key the key to delete 89 * @param key the key to delete
90 * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe) 90 * @param delete_pub GNUNET_YES if the public key should also be freed (bug in gabe)
91 * @return fresh private key; free using #GNUNET_free 91 * @return fresh private key; free using #GNUNET_free
92 */ 92 */
93void 93void
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 0bffef212..8a591fa09 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -206,14 +206,15 @@ struct GNUNET_CRYPTO_EcdsaSignature
206 206
207 207
208/** 208/**
209 * Public ECC key (always for Curve25519) encoded in a format suitable 209 * Public ECC key (always for curve Ed25519) encoded in a format
210 * for network transmission and EdDSA signatures. 210 * suitable for network transmission and EdDSA signatures.
211 */ 211 */
212struct GNUNET_CRYPTO_EddsaPublicKey 212struct GNUNET_CRYPTO_EddsaPublicKey
213{ 213{
214 /** 214 /**
215 * Q consists of an x- and a y-value, each mod p (256 bits), given 215 * Point Q consists of a y-value mod p (256 bits); the x-value is
216 * here in affine coordinates and Ed25519 standard compact format. 216 * always positive. The point is stored in Ed25519 standard
217 * compact format.
217 */ 218 */
218 unsigned char q_y[256 / 8]; 219 unsigned char q_y[256 / 8];
219 220
@@ -725,6 +726,23 @@ GNUNET_CRYPTO_hash_context_abort (struct GNUNET_HashContext *hc);
725 726
726 727
727/** 728/**
729 * Calculate HMAC of a message (RFC 2104)
730 * TODO: Shouldn' this be the standard hmac function and
731 * the above be renamed?
732 *
733 * @param key secret key
734 * @param key_len secret key length
735 * @param plaintext input plaintext
736 * @param plaintext_len length of @a plaintext
737 * @param hmac where to store the hmac
738 */
739void
740GNUNET_CRYPTO_hmac_raw (const void *key, size_t key_len,
741 const void *plaintext, size_t plaintext_len,
742 struct GNUNET_HashCode *hmac);
743
744
745/**
728 * @ingroup hash 746 * @ingroup hash
729 * Calculate HMAC of a message (RFC 2104) 747 * Calculate HMAC of a message (RFC 2104)
730 * 748 *
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index 20846238b..693cc6cdb 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -132,6 +132,16 @@ extern "C"
132#define GNUNET_GNSRECORD_TYPE_ABE_MASTER 65551 132#define GNUNET_GNSRECORD_TYPE_ABE_MASTER 65551
133 133
134/** 134/**
135 * Record type for reclaim OIDC clients
136 */
137#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT 65552
138
139/**
140 * Record type for reclaim OIDC redirect URIs
141 */
142#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT 65553
143
144/**
135 * Flags that can be set for a record. 145 * Flags that can be set for a record.
136 */ 146 */
137enum GNUNET_GNSRECORD_Flags 147enum GNUNET_GNSRECORD_Flags
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 36aa424b4..4400db7e1 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2656,35 +2656,35 @@ extern "C"
2656 * 2656 *
2657 * IDENTITY PROVIDER MESSAGE TYPES 2657 * IDENTITY PROVIDER MESSAGE TYPES
2658 */ 2658 */
2659#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE 961 2659#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE 961
2660 2660
2661#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE_RESPONSE 962 2661#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE_RESPONSE 962
2662 2662
2663#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_START 963 2663#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START 963
2664 2664
2665#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP 964 2665#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP 964
2666 2666
2667#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT 965 2667#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT 965
2668 2668
2669#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT 966 2669#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT 966
2670 2670
2671#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET 967 2671#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET 967
2672 2672
2673#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT 968 2673#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT 968
2674 2674
2675#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET 969 2675#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET 969
2676 2676
2677#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT 970 2677#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT 970
2678 2678
2679#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET 971 2679#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET 971
2680 2680
2681#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT 972 2681#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT 972
2682 2682
2683#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START 973 2683#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START 973
2684 2684
2685#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP 974 2685#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP 974
2686 2686
2687#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT 975 2687#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT 975
2688 2688
2689/************************************************** 2689/**************************************************
2690 * 2690 *
diff --git a/src/include/gnunet_identity_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h
index eb01f7ac2..df5356d76 100644
--- a/src/include/gnunet_identity_attribute_lib.h
+++ b/src/include/gnunet_reclaim_attribute_lib.h
@@ -25,8 +25,8 @@
25 * @defgroup identity-provider Identity Provider service 25 * @defgroup identity-provider Identity Provider service
26 * @{ 26 * @{
27 */ 27 */
28#ifndef GNUNET_IDENTITY_ATTRIBUTE_LIB_H 28#ifndef GNUNET_RECLAIM_ATTRIBUTE_LIB_H
29#define GNUNET_IDENTITY_ATTRIBUTE_LIB_H 29#define GNUNET_RECLAIM_ATTRIBUTE_LIB_H
30 30
31#ifdef __cplusplus 31#ifdef __cplusplus
32extern "C" 32extern "C"
@@ -42,19 +42,19 @@ extern "C"
42/** 42/**
43 * No value attribute. 43 * No value attribute.
44 */ 44 */
45#define GNUNET_IDENTITY_ATTRIBUTE_TYPE_NONE 0 45#define GNUNET_RECLAIM_ATTRIBUTE_TYPE_NONE 0
46 46
47/** 47/**
48 * String attribute. 48 * String attribute.
49 */ 49 */
50#define GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING 1 50#define GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING 1
51 51
52 52
53 53
54/** 54/**
55 * An attribute. 55 * An attribute.
56 */ 56 */
57struct GNUNET_IDENTITY_ATTRIBUTE_Claim 57struct GNUNET_RECLAIM_ATTRIBUTE_Claim
58{ 58{
59 /** 59 /**
60 * The name of the attribute. Note "name" must never be individually 60 * The name of the attribute. Note "name" must never be individually
@@ -86,35 +86,35 @@ struct GNUNET_IDENTITY_ATTRIBUTE_Claim
86 86
87}; 87};
88 88
89struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList 89struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList
90{ 90{
91 /** 91 /**
92 * List head 92 * List head
93 */ 93 */
94 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *list_head; 94 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *list_head;
95 95
96 /** 96 /**
97 * List tail 97 * List tail
98 */ 98 */
99 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *list_tail; 99 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *list_tail;
100}; 100};
101 101
102struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry 102struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry
103{ 103{
104 /** 104 /**
105 * DLL 105 * DLL
106 */ 106 */
107 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *prev; 107 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *prev;
108 108
109 /** 109 /**
110 * DLL 110 * DLL
111 */ 111 */
112 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *next; 112 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *next;
113 113
114 /** 114 /**
115 * The attribute claim 115 * The attribute claim
116 */ 116 */
117 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *claim; 117 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *claim;
118}; 118};
119 119
120/** 120/**
@@ -126,8 +126,8 @@ struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry
126 * @param data_size the attribute value size 126 * @param data_size the attribute value size
127 * @return the new attribute 127 * @return the new attribute
128 */ 128 */
129struct GNUNET_IDENTITY_ATTRIBUTE_Claim * 129struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
130GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, 130GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char* attr_name,
131 uint32_t type, 131 uint32_t type,
132 const void* data, 132 const void* data,
133 size_t data_size); 133 size_t data_size);
@@ -141,13 +141,13 @@ GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name,
141 * @return the required buffer size 141 * @return the required buffer size
142 */ 142 */
143size_t 143size_t
144GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 144GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
145 145
146void 146void
147GNUNET_IDENTITY_ATTRIBUTE_list_destroy (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 147GNUNET_RECLAIM_ATTRIBUTE_list_destroy (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
148 148
149void 149void
150GNUNET_IDENTITY_ATTRIBUTE_list_add (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 150GNUNET_RECLAIM_ATTRIBUTE_list_add (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
151 const char* attr_name, 151 const char* attr_name,
152 uint32_t type, 152 uint32_t type,
153 const void* data, 153 const void* data,
@@ -162,7 +162,7 @@ GNUNET_IDENTITY_ATTRIBUTE_list_add (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *
162 * @return length of serialized data 162 * @return length of serialized data
163 */ 163 */
164size_t 164size_t
165GNUNET_IDENTITY_ATTRIBUTE_list_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 165GNUNET_RECLAIM_ATTRIBUTE_list_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
166 char *result); 166 char *result);
167 167
168/** 168/**
@@ -173,8 +173,8 @@ GNUNET_IDENTITY_ATTRIBUTE_list_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE
173 * 173 *
174 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller 174 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller
175 */ 175 */
176struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList * 176struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
177GNUNET_IDENTITY_ATTRIBUTE_list_deserialize (const char* data, 177GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char* data,
178 size_t data_size); 178 size_t data_size);
179 179
180 180
@@ -186,7 +186,7 @@ GNUNET_IDENTITY_ATTRIBUTE_list_deserialize (const char* data,
186 * @return the required buffer size 186 * @return the required buffer size
187 */ 187 */
188size_t 188size_t
189GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr); 189GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr);
190 190
191 191
192 192
@@ -199,7 +199,7 @@ GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (const struct GNUNET_IDENTITY_ATTRI
199 * @return length of serialized data 199 * @return length of serialized data
200 */ 200 */
201size_t 201size_t
202GNUNET_IDENTITY_ATTRIBUTE_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr, 202GNUNET_RECLAIM_ATTRIBUTE_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
203 char *result); 203 char *result);
204 204
205/** 205/**
@@ -210,12 +210,12 @@ GNUNET_IDENTITY_ATTRIBUTE_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_Clai
210 * 210 *
211 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller 211 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller
212 */ 212 */
213struct GNUNET_IDENTITY_ATTRIBUTE_Claim * 213struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
214GNUNET_IDENTITY_ATTRIBUTE_deserialize (const char* data, 214GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char* data,
215 size_t data_size); 215 size_t data_size);
216 216
217struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList* 217struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList*
218GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 218GNUNET_RECLAIM_ATTRIBUTE_list_dup (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
219 219
220/** 220/**
221 * Convert a type name to the corresponding number 221 * Convert a type name to the corresponding number
@@ -224,7 +224,7 @@ GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim
224 * @return corresponding number, UINT32_MAX on error 224 * @return corresponding number, UINT32_MAX on error
225 */ 225 */
226uint32_t 226uint32_t
227GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (const char *typename); 227GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename);
228 228
229/** 229/**
230 * Convert human-readable version of a 'claim' of an attribute to the binary 230 * Convert human-readable version of a 'claim' of an attribute to the binary
@@ -237,7 +237,7 @@ GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (const char *typename);
237 * @return #GNUNET_OK on success 237 * @return #GNUNET_OK on success
238 */ 238 */
239int 239int
240GNUNET_IDENTITY_ATTRIBUTE_string_to_value (uint32_t type, 240GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
241 const char *s, 241 const char *s,
242 void **data, 242 void **data,
243 size_t *data_size); 243 size_t *data_size);
@@ -251,7 +251,7 @@ GNUNET_IDENTITY_ATTRIBUTE_string_to_value (uint32_t type,
251 * @return NULL on error, otherwise human-readable representation of the claim 251 * @return NULL on error, otherwise human-readable representation of the claim
252 */ 252 */
253char * 253char *
254GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, 254GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type,
255 const void* data, 255 const void* data,
256 size_t data_size); 256 size_t data_size);
257 257
@@ -262,7 +262,7 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type,
262 * @return corresponding typestring, NULL on error 262 * @return corresponding typestring, NULL on error
263 */ 263 */
264const char* 264const char*
265GNUNET_IDENTITY_ATTRIBUTE_number_to_typename (uint32_t type); 265GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (uint32_t type);
266 266
267 267
268#if 0 /* keep Emacsens' auto-indent happy */ 268#if 0 /* keep Emacsens' auto-indent happy */
@@ -273,9 +273,9 @@ GNUNET_IDENTITY_ATTRIBUTE_number_to_typename (uint32_t type);
273#endif 273#endif
274 274
275 275
276/* ifndef GNUNET_IDENTITY_ATTRIBUTE_LIB_H */ 276/* ifndef GNUNET_RECLAIM_ATTRIBUTE_LIB_H */
277#endif 277#endif
278 278
279/** @} */ /* end of group identity */ 279/** @} */ /* end of group identity */
280 280
281/* end of gnunet_identity_attribute_lib.h */ 281/* end of gnunet_reclaim_attribute_lib.h */
diff --git a/src/include/gnunet_identity_attribute_plugin.h b/src/include/gnunet_reclaim_attribute_plugin.h
index 7c399c616..cf0bb141a 100644
--- a/src/include/gnunet_identity_attribute_plugin.h
+++ b/src/include/gnunet_reclaim_attribute_plugin.h
@@ -26,11 +26,11 @@
26 * Plugin API for the idp database backend 26 * Plugin API for the idp database backend
27 * @{ 27 * @{
28 */ 28 */
29#ifndef GNUNET_IDENTITY_ATTRIBUTE_PLUGIN_H 29#ifndef GNUNET_RECLAIM_ATTRIBUTE_PLUGIN_H
30#define GNUNET_IDENTITY_ATTRIBUTE_PLUGIN_H 30#define GNUNET_RECLAIM_ATTRIBUTE_PLUGIN_H
31 31
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_identity_attribute_lib.h" 33#include "gnunet_reclaim_attribute_lib.h"
34 34
35#ifdef __cplusplus 35#ifdef __cplusplus
36extern "C" 36extern "C"
@@ -51,7 +51,7 @@ extern "C"
51 * @param data_size number of bytes in @a data 51 * @param data_size number of bytes in @a data
52 * @return NULL on error, otherwise human-readable representation of the value 52 * @return NULL on error, otherwise human-readable representation of the value
53 */ 53 */
54typedef char * (*GNUNET_IDENTITY_ATTRIBUTE_ValueToStringFunction) (void *cls, 54typedef char * (*GNUNET_RECLAIM_ATTRIBUTE_ValueToStringFunction) (void *cls,
55 uint32_t type, 55 uint32_t type,
56 const void *data, 56 const void *data,
57 size_t data_size); 57 size_t data_size);
@@ -69,7 +69,7 @@ typedef char * (*GNUNET_IDENTITY_ATTRIBUTE_ValueToStringFunction) (void *cls,
69 * @param data_size set to number of bytes in @a data 69 * @param data_size set to number of bytes in @a data
70 * @return #GNUNET_OK on success 70 * @return #GNUNET_OK on success
71 */ 71 */
72typedef int (*GNUNET_IDENTITY_ATTRIBUTE_StringToValueFunction) (void *cls, 72typedef int (*GNUNET_RECLAIM_ATTRIBUTE_StringToValueFunction) (void *cls,
73 uint32_t type, 73 uint32_t type,
74 const char *s, 74 const char *s,
75 void **data, 75 void **data,
@@ -84,7 +84,7 @@ typedef int (*GNUNET_IDENTITY_ATTRIBUTE_StringToValueFunction) (void *cls,
84 * @param typename name to convert 84 * @param typename name to convert
85 * @return corresponding number, UINT32_MAX on error 85 * @return corresponding number, UINT32_MAX on error
86 */ 86 */
87typedef uint32_t (*GNUNET_IDENTITY_ATTRIBUTE_TypenameToNumberFunction) (void *cls, 87typedef uint32_t (*GNUNET_RECLAIM_ATTRIBUTE_TypenameToNumberFunction) (void *cls,
88 const char *typename); 88 const char *typename);
89 89
90 90
@@ -96,7 +96,7 @@ typedef uint32_t (*GNUNET_IDENTITY_ATTRIBUTE_TypenameToNumberFunction) (void *cl
96 * @param type number of a type to convert 96 * @param type number of a type to convert
97 * @return corresponding typestring, NULL on error 97 * @return corresponding typestring, NULL on error
98 */ 98 */
99typedef const char * (*GNUNET_IDENTITY_ATTRIBUTE_NumberToTypenameFunction) (void *cls, 99typedef const char * (*GNUNET_RECLAIM_ATTRIBUTE_NumberToTypenameFunction) (void *cls,
100 uint32_t type); 100 uint32_t type);
101 101
102 102
@@ -104,7 +104,7 @@ typedef const char * (*GNUNET_IDENTITY_ATTRIBUTE_NumberToTypenameFunction) (void
104 * Each plugin is required to return a pointer to a struct of this 104 * Each plugin is required to return a pointer to a struct of this
105 * type as the return value from its entry point. 105 * type as the return value from its entry point.
106 */ 106 */
107struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions 107struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions
108{ 108{
109 109
110 /** 110 /**
@@ -115,22 +115,22 @@ struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions
115 /** 115 /**
116 * Conversion to string. 116 * Conversion to string.
117 */ 117 */
118 GNUNET_IDENTITY_ATTRIBUTE_ValueToStringFunction value_to_string; 118 GNUNET_RECLAIM_ATTRIBUTE_ValueToStringFunction value_to_string;
119 119
120 /** 120 /**
121 * Conversion to binary. 121 * Conversion to binary.
122 */ 122 */
123 GNUNET_IDENTITY_ATTRIBUTE_StringToValueFunction string_to_value; 123 GNUNET_RECLAIM_ATTRIBUTE_StringToValueFunction string_to_value;
124 124
125 /** 125 /**
126 * Typename to number. 126 * Typename to number.
127 */ 127 */
128 GNUNET_IDENTITY_ATTRIBUTE_TypenameToNumberFunction typename_to_number; 128 GNUNET_RECLAIM_ATTRIBUTE_TypenameToNumberFunction typename_to_number;
129 129
130 /** 130 /**
131 * Number to typename. 131 * Number to typename.
132 */ 132 */
133 GNUNET_IDENTITY_ATTRIBUTE_NumberToTypenameFunction number_to_typename; 133 GNUNET_RECLAIM_ATTRIBUTE_NumberToTypenameFunction number_to_typename;
134 134
135}; 135};
136 136
diff --git a/src/include/gnunet_identity_provider_plugin.h b/src/include/gnunet_reclaim_plugin.h
index 2330066dd..c400af64c 100644
--- a/src/include/gnunet_identity_provider_plugin.h
+++ b/src/include/gnunet_reclaim_plugin.h
@@ -22,15 +22,15 @@
22 * @file 22 * @file
23 * Plugin API for the idp database backend 23 * Plugin API for the idp database backend
24 * 24 *
25 * @defgroup identity-provider-plugin IdP service plugin API 25 * @defgroup reclaim-plugin IdP service plugin API
26 * Plugin API for the idp database backend 26 * Plugin API for the idp database backend
27 * @{ 27 * @{
28 */ 28 */
29#ifndef GNUNET_IDENTITY_PROVIDER_PLUGIN_H 29#ifndef GNUNET_RECLAIM_PLUGIN_H
30#define GNUNET_IDENTITY_PROVIDER_PLUGIN_H 30#define GNUNET_RECLAIM_PLUGIN_H
31 31
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_identity_provider_service.h" 33#include "gnunet_reclaim_service.h"
34 34
35#ifdef __cplusplus 35#ifdef __cplusplus
36extern "C" 36extern "C"
@@ -47,15 +47,15 @@ extern "C"
47 * @param cls closure 47 * @param cls closure
48 * @param ticket the ticket 48 * @param ticket the ticket
49 */ 49 */
50typedef void (*GNUNET_IDENTITY_PROVIDER_TicketIterator) (void *cls, 50typedef void (*GNUNET_RECLAIM_TicketIterator) (void *cls,
51 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 51 const struct GNUNET_RECLAIM_Ticket *ticket,
52 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 52 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
53 53
54 54
55/** 55/**
56 * @brief struct returned by the initialization function of the plugin 56 * @brief struct returned by the initialization function of the plugin
57 */ 57 */
58struct GNUNET_IDENTITY_PROVIDER_PluginFunctions 58struct GNUNET_RECLAIM_PluginFunctions
59{ 59{
60 60
61 /** 61 /**
@@ -71,8 +71,8 @@ struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
71 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 71 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
72 */ 72 */
73 int (*store_ticket) (void *cls, 73 int (*store_ticket) (void *cls,
74 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 74 const struct GNUNET_RECLAIM_Ticket *ticket,
75 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 75 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
76 76
77 /** 77 /**
78 * Delete a ticket from the database. 78 * Delete a ticket from the database.
@@ -82,7 +82,7 @@ struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
82 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 82 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
83 */ 83 */
84 int (*delete_ticket) (void *cls, 84 int (*delete_ticket) (void *cls,
85 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket); 85 const struct GNUNET_RECLAIM_Ticket *ticket);
86 86
87 87
88 88
@@ -101,11 +101,11 @@ struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
101 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 101 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
102 int audience, 102 int audience,
103 uint64_t offset, 103 uint64_t offset,
104 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, void *iter_cls); 104 GNUNET_RECLAIM_TicketIterator iter, void *iter_cls);
105 105
106 int (*get_ticket_attributes) (void* cls, 106 int (*get_ticket_attributes) (void* cls,
107 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 107 const struct GNUNET_RECLAIM_Ticket *ticket,
108 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, 108 GNUNET_RECLAIM_TicketIterator iter,
109 void *iter_cls); 109 void *iter_cls);
110}; 110};
111 111
diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_reclaim_service.h
index 0c72556e8..7e668cd62 100644
--- a/src/include/gnunet_identity_provider_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -22,11 +22,11 @@
22 * @file 22 * @file
23 * Identity provider service; implements identity provider for GNUnet 23 * Identity provider service; implements identity provider for GNUnet
24 * 24 *
25 * @defgroup identity-provider Identity Provider service 25 * @defgroup reclaim Identity Provider service
26 * @{ 26 * @{
27 */ 27 */
28#ifndef GNUNET_IDENTITY_PROVIDER_SERVICE_H 28#ifndef GNUNET_RECLAIM_SERVICE_H
29#define GNUNET_IDENTITY_PROVIDER_SERVICE_H 29#define GNUNET_RECLAIM_SERVICE_H
30 30
31#ifdef __cplusplus 31#ifdef __cplusplus
32extern "C" 32extern "C"
@@ -37,27 +37,27 @@ extern "C"
37#endif 37#endif
38 38
39#include "gnunet_util_lib.h" 39#include "gnunet_util_lib.h"
40#include "gnunet_identity_attribute_lib.h" 40#include "gnunet_reclaim_attribute_lib.h"
41 41
42/** 42/**
43 * Version number of GNUnet Identity Provider API. 43 * Version number of GNUnet Identity Provider API.
44 */ 44 */
45#define GNUNET_IDENTITY_PROVIDER_VERSION 0x00000000 45#define GNUNET_RECLAIM_VERSION 0x00000000
46 46
47/** 47/**
48 * Handle to access the identity service. 48 * Handle to access the identity service.
49 */ 49 */
50struct GNUNET_IDENTITY_PROVIDER_Handle; 50struct GNUNET_RECLAIM_Handle;
51 51
52/** 52/**
53 * Handle for a token. 53 * Handle for a token.
54 */ 54 */
55struct GNUNET_IDENTITY_PROVIDER_Token; 55struct GNUNET_RECLAIM_Token;
56 56
57/** 57/**
58 * The ticket 58 * The ticket
59 */ 59 */
60struct GNUNET_IDENTITY_PROVIDER_Ticket 60struct GNUNET_RECLAIM_Ticket
61{ 61{
62 /** 62 /**
63 * The ticket issuer 63 * The ticket issuer
@@ -78,7 +78,7 @@ struct GNUNET_IDENTITY_PROVIDER_Ticket
78/** 78/**
79 * Handle for an operation with the identity provider service. 79 * Handle for an operation with the identity provider service.
80 */ 80 */
81struct GNUNET_IDENTITY_PROVIDER_Operation; 81struct GNUNET_RECLAIM_Operation;
82 82
83 83
84/** 84/**
@@ -87,8 +87,8 @@ struct GNUNET_IDENTITY_PROVIDER_Operation;
87 * @param cfg Configuration to contact the identity provider service. 87 * @param cfg Configuration to contact the identity provider service.
88 * @return handle to communicate with identity provider service 88 * @return handle to communicate with identity provider service
89 */ 89 */
90struct GNUNET_IDENTITY_PROVIDER_Handle * 90struct GNUNET_RECLAIM_Handle *
91GNUNET_IDENTITY_PROVIDER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); 91GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
92 92
93/** 93/**
94 * Continuation called to notify client about result of the 94 * Continuation called to notify client about result of the
@@ -101,7 +101,7 @@ GNUNET_IDENTITY_PROVIDER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
101 * @param emsg NULL on success, otherwise an error message 101 * @param emsg NULL on success, otherwise an error message
102 */ 102 */
103typedef void 103typedef void
104(*GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus) (void *cls, 104(*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
105 int32_t success, 105 int32_t success,
106 const char *emsg); 106 const char *emsg);
107 107
@@ -118,12 +118,12 @@ typedef void
118 * @param cont_cls closure for @a cont 118 * @param cont_cls closure for @a cont
119 * @return handle to abort the request 119 * @return handle to abort the request
120 */ 120 */
121struct GNUNET_IDENTITY_PROVIDER_Operation * 121struct GNUNET_RECLAIM_Operation *
122GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 122GNUNET_RECLAIM_attribute_store (struct GNUNET_RECLAIM_Handle *h,
123 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 123 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
124 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr, 124 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
125 const struct GNUNET_TIME_Relative *exp_interval, 125 const struct GNUNET_TIME_Relative *exp_interval,
126 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont, 126 GNUNET_RECLAIM_ContinuationWithStatus cont,
127 void *cont_cls); 127 void *cont_cls);
128 128
129 129
@@ -135,19 +135,19 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
135 * @param attr the attribute 135 * @param attr the attribute
136 */ 136 */
137typedef void 137typedef void
138(*GNUNET_IDENTITY_PROVIDER_AttributeResult) (void *cls, 138(*GNUNET_RECLAIM_AttributeResult) (void *cls,
139 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 139 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
140 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr); 140 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr);
141 141
142 142
143 143
144/** 144/**
145 * List all attributes for a local identity. 145 * List all attributes for a local identity.
146 * This MUST lock the `struct GNUNET_IDENTITY_PROVIDER_Handle` 146 * This MUST lock the `struct GNUNET_RECLAIM_Handle`
147 * for any other calls than #GNUNET_IDENTITY_PROVIDER_get_attributes_next() and 147 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and
148 * #GNUNET_IDENTITY_PROVIDER_get_attributes_stop. @a proc will be called once 148 * #GNUNET_RECLAIM_get_attributes_stop. @a proc will be called once
149 * immediately, and then again after 149 * immediately, and then again after
150 * #GNUNET_IDENTITY_PROVIDER_get_attributes_next() is invoked. 150 * #GNUNET_RECLAIM_get_attributes_next() is invoked.
151 * 151 *
152 * On error (disconnect), @a error_cb will be invoked. 152 * On error (disconnect), @a error_cb will be invoked.
153 * On normal completion, @a finish_cb proc will be 153 * On normal completion, @a finish_cb proc will be
@@ -166,36 +166,36 @@ typedef void
166 * @param finish_cb_cls closure for @a finish_cb 166 * @param finish_cb_cls closure for @a finish_cb
167 * @return an iterator handle to use for iteration 167 * @return an iterator handle to use for iteration
168 */ 168 */
169struct GNUNET_IDENTITY_PROVIDER_AttributeIterator * 169struct GNUNET_RECLAIM_AttributeIterator *
170GNUNET_IDENTITY_PROVIDER_get_attributes_start (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 170GNUNET_RECLAIM_get_attributes_start (struct GNUNET_RECLAIM_Handle *h,
171 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 171 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
172 GNUNET_SCHEDULER_TaskCallback error_cb, 172 GNUNET_SCHEDULER_TaskCallback error_cb,
173 void *error_cb_cls, 173 void *error_cb_cls,
174 GNUNET_IDENTITY_PROVIDER_AttributeResult proc, 174 GNUNET_RECLAIM_AttributeResult proc,
175 void *proc_cls, 175 void *proc_cls,
176 GNUNET_SCHEDULER_TaskCallback finish_cb, 176 GNUNET_SCHEDULER_TaskCallback finish_cb,
177 void *finish_cb_cls); 177 void *finish_cb_cls);
178 178
179 179
180/** 180/**
181 * Calls the record processor specified in #GNUNET_IDENTITY_PROVIDER_get_attributes_start 181 * Calls the record processor specified in #GNUNET_RECLAIM_get_attributes_start
182 * for the next record. 182 * for the next record.
183 * 183 *
184 * @param it the iterator 184 * @param it the iterator
185 */ 185 */
186void 186void
187GNUNET_IDENTITY_PROVIDER_get_attributes_next (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it); 187GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it);
188 188
189 189
190/** 190/**
191 * Stops iteration and releases the idp handle for further calls. Must 191 * Stops iteration and releases the idp handle for further calls. Must
192 * be called on any iteration that has not yet completed prior to calling 192 * be called on any iteration that has not yet completed prior to calling
193 * #GNUNET_IDENTITY_PROVIDER_disconnect. 193 * #GNUNET_RECLAIM_disconnect.
194 * 194 *
195 * @param it the iterator 195 * @param it the iterator
196 */ 196 */
197void 197void
198GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it); 198GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it);
199 199
200 200
201/** 201/**
@@ -207,12 +207,12 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At
207 * @param ticket the ticket 207 * @param ticket the ticket
208 */ 208 */
209typedef void 209typedef void
210(*GNUNET_IDENTITY_PROVIDER_TicketCallback)(void *cls, 210(*GNUNET_RECLAIM_TicketCallback)(void *cls,
211 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket); 211 const struct GNUNET_RECLAIM_Ticket *ticket);
212 212
213/** 213/**
214 * Issues a ticket to another identity. The identity may use 214 * Issues a ticket to another identity. The identity may use
215 * GNUNET_IDENTITY_PROVIDER_ticket_consume to consume the ticket 215 * GNUNET_RECLAIM_ticket_consume to consume the ticket
216 * and retrieve the attributes specified in the AttributeList. 216 * and retrieve the attributes specified in the AttributeList.
217 * 217 *
218 * @param h the identity provider to use 218 * @param h the identity provider to use
@@ -223,12 +223,12 @@ typedef void
223 * @param cb_cls the callback closure 223 * @param cb_cls the callback closure
224 * @return handle to abort the operation 224 * @return handle to abort the operation
225 */ 225 */
226struct GNUNET_IDENTITY_PROVIDER_Operation * 226struct GNUNET_RECLAIM_Operation *
227GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 227GNUNET_RECLAIM_ticket_issue (struct GNUNET_RECLAIM_Handle *h,
228 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 228 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
229 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 229 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
230 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 230 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
231 GNUNET_IDENTITY_PROVIDER_TicketCallback cb, 231 GNUNET_RECLAIM_TicketCallback cb,
232 void *cb_cls); 232 void *cb_cls);
233 233
234/** 234/**
@@ -242,11 +242,11 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
242 * @param cb_cls the callback closure 242 * @param cb_cls the callback closure
243 * @return handle to abort the operation 243 * @return handle to abort the operation
244 */ 244 */
245struct GNUNET_IDENTITY_PROVIDER_Operation * 245struct GNUNET_RECLAIM_Operation *
246GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 246GNUNET_RECLAIM_ticket_revoke (struct GNUNET_RECLAIM_Handle *h,
247 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 247 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
248 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 248 const struct GNUNET_RECLAIM_Ticket *ticket,
249 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, 249 GNUNET_RECLAIM_ContinuationWithStatus cb,
250 void *cb_cls); 250 void *cb_cls);
251 251
252 252
@@ -262,11 +262,11 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *
262 * @param cb_cls the callback closure 262 * @param cb_cls the callback closure
263 * @return handle to abort the operation 263 * @return handle to abort the operation
264 */ 264 */
265struct GNUNET_IDENTITY_PROVIDER_Operation * 265struct GNUNET_RECLAIM_Operation *
266GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 266GNUNET_RECLAIM_ticket_consume (struct GNUNET_RECLAIM_Handle *h,
267 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 267 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
268 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 268 const struct GNUNET_RECLAIM_Ticket *ticket,
269 GNUNET_IDENTITY_PROVIDER_AttributeResult cb, 269 GNUNET_RECLAIM_AttributeResult cb,
270 void *cb_cls); 270 void *cb_cls);
271 271
272/** 272/**
@@ -286,12 +286,12 @@ GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle
286 * @param finish_cb_cls closure for @a finish_cb 286 * @param finish_cb_cls closure for @a finish_cb
287 * @return an iterator handle to use for iteration 287 * @return an iterator handle to use for iteration
288 */ 288 */
289struct GNUNET_IDENTITY_PROVIDER_TicketIterator * 289struct GNUNET_RECLAIM_TicketIterator *
290GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 290GNUNET_RECLAIM_ticket_iteration_start (struct GNUNET_RECLAIM_Handle *h,
291 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 291 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
292 GNUNET_SCHEDULER_TaskCallback error_cb, 292 GNUNET_SCHEDULER_TaskCallback error_cb,
293 void *error_cb_cls, 293 void *error_cb_cls,
294 GNUNET_IDENTITY_PROVIDER_TicketCallback proc, 294 GNUNET_RECLAIM_TicketCallback proc,
295 void *proc_cls, 295 void *proc_cls,
296 GNUNET_SCHEDULER_TaskCallback finish_cb, 296 GNUNET_SCHEDULER_TaskCallback finish_cb,
297 void *finish_cb_cls); 297 void *finish_cb_cls);
@@ -313,34 +313,34 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
313 * @param finish_cb_cls closure for @a finish_cb 313 * @param finish_cb_cls closure for @a finish_cb
314 * @return an iterator handle to use for iteration 314 * @return an iterator handle to use for iteration
315 */ 315 */
316struct GNUNET_IDENTITY_PROVIDER_TicketIterator * 316struct GNUNET_RECLAIM_TicketIterator *
317GNUNET_IDENTITY_PROVIDER_ticket_iteration_start_rp (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 317GNUNET_RECLAIM_ticket_iteration_start_rp (struct GNUNET_RECLAIM_Handle *h,
318 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 318 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
319 GNUNET_SCHEDULER_TaskCallback error_cb, 319 GNUNET_SCHEDULER_TaskCallback error_cb,
320 void *error_cb_cls, 320 void *error_cb_cls,
321 GNUNET_IDENTITY_PROVIDER_TicketCallback proc, 321 GNUNET_RECLAIM_TicketCallback proc,
322 void *proc_cls, 322 void *proc_cls,
323 GNUNET_SCHEDULER_TaskCallback finish_cb, 323 GNUNET_SCHEDULER_TaskCallback finish_cb,
324 void *finish_cb_cls); 324 void *finish_cb_cls);
325 325
326/** 326/**
327 * Calls the record processor specified in #GNUNET_IDENTITY_PROVIDER_ticket_iteration_start 327 * Calls the record processor specified in #GNUNET_RECLAIM_ticket_iteration_start
328 * for the next record. 328 * for the next record.
329 * 329 *
330 * @param it the iterator 330 * @param it the iterator
331 */ 331 */
332void 332void
333GNUNET_IDENTITY_PROVIDER_ticket_iteration_next (struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it); 333GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it);
334 334
335/** 335/**
336 * Stops iteration and releases the idp handle for further calls. Must 336 * Stops iteration and releases the idp handle for further calls. Must
337 * be called on any iteration that has not yet completed prior to calling 337 * be called on any iteration that has not yet completed prior to calling
338 * #GNUNET_IDENTITY_PROVIDER_disconnect. 338 * #GNUNET_RECLAIM_disconnect.
339 * 339 *
340 * @param it the iterator 340 * @param it the iterator
341 */ 341 */
342void 342void
343GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it); 343GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it);
344 344
345/** 345/**
346 * Disconnect from identity provider service. 346 * Disconnect from identity provider service.
@@ -348,7 +348,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_
348 * @param h identity provider service to disconnect 348 * @param h identity provider service to disconnect
349 */ 349 */
350void 350void
351GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h); 351GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h);
352 352
353 353
354/** 354/**
@@ -360,7 +360,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h);
360 * @param op operation to cancel 360 * @param op operation to cancel
361 */ 361 */
362void 362void
363GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op); 363GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op);
364 364
365#if 0 /* keep Emacsens' auto-indent happy */ 365#if 0 /* keep Emacsens' auto-indent happy */
366{ 366{
@@ -370,9 +370,9 @@ GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op);
370#endif 370#endif
371 371
372 372
373/* ifndef GNUNET_IDENTITY_PROVIDER_SERVICE_H */ 373/* ifndef GNUNET_RECLAIM_SERVICE_H */
374#endif 374#endif
375 375
376/** @} */ /* end of group identity */ 376/** @} */ /* end of group identity */
377 377
378/* end of gnunet_identity_provider_service.h */ 378/* end of gnunet_reclaim_service.h */
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h
index d7accaf2c..829f8be7e 100644
--- a/src/include/gnunet_signatures.h
+++ b/src/include/gnunet_signatures.h
@@ -151,12 +151,12 @@ extern "C"
151/** 151/**
152 * Signature for the first round of distributed key generation. 152 * Signature for the first round of distributed key generation.
153 */ 153 */
154#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1 22 154#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1 21
155 155
156/** 156/**
157 * Signature for the second round of distributed key generation. 157 * Signature for the second round of distributed key generation.
158 */ 158 */
159#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2 23 159#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2 22
160 160
161/** 161/**
162 * Signature for cooperatice decryption. 162 * Signature for cooperatice decryption.
@@ -181,7 +181,7 @@ extern "C"
181/** 181/**
182 * Signature for a GNUid Ticket 182 * Signature for a GNUid Ticket
183 */ 183 */
184#define GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET 27 184#define GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN 27
185 185
186/** 186/**
187 * Signature for a GNUnet credential 187 * Signature for a GNUnet credential
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index 20d29b906..f8441cc2b 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -1449,17 +1449,15 @@ check_client_member_join (void *cls,
1449 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; 1449 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1];
1450 uint32_t relay_count = ntohl (msg->relay_count); 1450 uint32_t relay_count = ntohl (msg->relay_count);
1451 1451
1452 if (0 == relay_count) 1452 if (0 != relay_count)
1453 { 1453 {
1454 GNUNET_break (0); 1454 if (UINT32_MAX / relay_count < sizeof (*relays)){
1455 return GNUNET_SYSERR; 1455 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1456 } 1456 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n",
1457 if (UINT32_MAX / relay_count < sizeof (*relays)){ 1457 (unsigned long)relay_count,
1458 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1458 sizeof (*relays));
1459 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", 1459 return GNUNET_SYSERR;
1460 (unsigned long)relay_count, 1460 }
1461 sizeof (*relays));
1462 return GNUNET_SYSERR;
1463 } 1461 }
1464 uint32_t relay_size = relay_count * sizeof (*relays); 1462 uint32_t relay_size = relay_count * sizeof (*relays);
1465 struct GNUNET_MessageHeader *join_msg = NULL; 1463 struct GNUNET_MessageHeader *join_msg = NULL;
diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c
index 3a7c6d961..7766ff875 100644
--- a/src/multicast/test_multicast_multipeer.c
+++ b/src/multicast/test_multicast_multipeer.c
@@ -160,6 +160,7 @@ notify (void *cls,
160 160
161 *data_size = sizeof (struct pingpong_msg); 161 *data_size = sizeof (struct pingpong_msg);
162 GNUNET_memcpy(data, pp_msg, *data_size); 162 GNUNET_memcpy(data, pp_msg, *data_size);
163 GNUNET_free (pp_msg);
163 164
164 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 165 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
165 "Peer #%u sents ping to origin\n", mc_peer->peer); 166 "Peer #%u sents ping to origin\n", mc_peer->peer);
@@ -328,6 +329,7 @@ origin_notify (void *cls,
328 pp_msg->msg = PONG; 329 pp_msg->msg = PONG;
329 *data_size = sizeof (struct pingpong_msg); 330 *data_size = sizeof (struct pingpong_msg);
330 GNUNET_memcpy(data, pp_msg, *data_size); 331 GNUNET_memcpy(data, pp_msg, *data_size);
332 GNUNET_free (pp_msg);
331 333
332 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong\n"); 334 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong\n");
333 335
diff --git a/src/identity-attribute/Makefile.am b/src/reclaim-attribute/Makefile.am
index 2c73a443e..7db2925b1 100644
--- a/src/identity-attribute/Makefile.am
+++ b/src/reclaim-attribute/Makefile.am
@@ -17,28 +17,28 @@ if USE_COVERAGE
17endif 17endif
18 18
19lib_LTLIBRARIES = \ 19lib_LTLIBRARIES = \
20 libgnunetidentityattribute.la 20 libgnunetreclaimattribute.la
21 21
22libgnunetidentityattribute_la_SOURCES = \ 22libgnunetreclaimattribute_la_SOURCES = \
23 identity_attribute.c 23 reclaim_attribute.c
24libgnunetidentityattribute_la_LIBADD = \ 24libgnunetreclaimattribute_la_LIBADD = \
25 $(top_builddir)/src/util/libgnunetutil.la \ 25 $(top_builddir)/src/util/libgnunetutil.la \
26 $(GN_LIBINTL) 26 $(GN_LIBINTL)
27libgnunetidentityattribute_la_LDFLAGS = \ 27libgnunetreclaimattribute_la_LDFLAGS = \
28 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 28 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
29 -version-info 0:0:0 29 -version-info 0:0:0
30 30
31 31
32plugin_LTLIBRARIES = \ 32plugin_LTLIBRARIES = \
33 libgnunet_plugin_identity_attribute_gnuid.la 33 libgnunet_plugin_reclaim_attribute_gnuid.la
34 34
35 35
36libgnunet_plugin_identity_attribute_gnuid_la_SOURCES = \ 36libgnunet_plugin_reclaim_attribute_gnuid_la_SOURCES = \
37 plugin_identity_attribute_gnuid.c 37 plugin_reclaim_attribute_gnuid.c
38libgnunet_plugin_identity_attribute_gnuid_la_LIBADD = \ 38libgnunet_plugin_reclaim_attribute_gnuid_la_LIBADD = \
39 $(top_builddir)/src/util/libgnunetutil.la \ 39 $(top_builddir)/src/util/libgnunetutil.la \
40 $(LTLIBINTL) 40 $(LTLIBINTL)
41libgnunet_plugin_identity_attribute_gnuid_la_LDFLAGS = \ 41libgnunet_plugin_reclaim_attribute_gnuid_la_LDFLAGS = \
42 $(GN_PLUGIN_LDFLAGS) 42 $(GN_PLUGIN_LDFLAGS)
43 43
44 44
diff --git a/src/identity-attribute/plugin_identity_attribute_gnuid.c b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
index c09b167f5..48afc0732 100644
--- a/src/identity-attribute/plugin_identity_attribute_gnuid.c
+++ b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
@@ -17,7 +17,7 @@
17*/ 17*/
18 18
19/** 19/**
20 * @file identity-attribute/plugin_identity_attribute_gnuid.c 20 * @file reclaim-attribute/plugin_reclaim_attribute_gnuid.c
21 * @brief identity attribute plugin to provide the API for fundamental 21 * @brief identity attribute plugin to provide the API for fundamental
22 * attribute types. 22 * attribute types.
23 * 23 *
@@ -25,7 +25,7 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_identity_attribute_plugin.h" 28#include "gnunet_reclaim_attribute_plugin.h"
29#include <inttypes.h> 29#include <inttypes.h>
30 30
31 31
@@ -47,7 +47,7 @@ gnuid_value_to_string (void *cls,
47 47
48 switch (type) 48 switch (type)
49 { 49 {
50 case GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING: 50 case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING:
51 return GNUNET_strndup (data, data_size); 51 return GNUNET_strndup (data, data_size);
52 default: 52 default:
53 return NULL; 53 return NULL;
@@ -78,7 +78,7 @@ gnuid_string_to_value (void *cls,
78 switch (type) 78 switch (type)
79 { 79 {
80 80
81 case GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING: 81 case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING:
82 *data = GNUNET_strdup (s); 82 *data = GNUNET_strdup (s);
83 *data_size = strlen (s); 83 *data_size = strlen (s);
84 return GNUNET_OK; 84 return GNUNET_OK;
@@ -96,7 +96,7 @@ static struct {
96 const char *name; 96 const char *name;
97 uint32_t number; 97 uint32_t number;
98} gnuid_name_map[] = { 98} gnuid_name_map[] = {
99 { "STRING", GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING }, 99 { "STRING", GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING },
100 { NULL, UINT32_MAX } 100 { NULL, UINT32_MAX }
101}; 101};
102 102
@@ -151,11 +151,11 @@ gnuid_number_to_typename (void *cls,
151 * @return the exported block API 151 * @return the exported block API
152 */ 152 */
153void * 153void *
154libgnunet_plugin_identity_attribute_gnuid_init (void *cls) 154libgnunet_plugin_reclaim_attribute_gnuid_init (void *cls)
155{ 155{
156 struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions *api; 156 struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api;
157 157
158 api = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions); 158 api = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions);
159 api->value_to_string = &gnuid_value_to_string; 159 api->value_to_string = &gnuid_value_to_string;
160 api->string_to_value = &gnuid_string_to_value; 160 api->string_to_value = &gnuid_string_to_value;
161 api->typename_to_number = &gnuid_typename_to_number; 161 api->typename_to_number = &gnuid_typename_to_number;
@@ -171,12 +171,12 @@ libgnunet_plugin_identity_attribute_gnuid_init (void *cls)
171 * @return NULL 171 * @return NULL
172 */ 172 */
173void * 173void *
174libgnunet_plugin_identity_attribute_gnuid_done (void *cls) 174libgnunet_plugin_reclaim_attribute_gnuid_done (void *cls)
175{ 175{
176 struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions *api = cls; 176 struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api = cls;
177 177
178 GNUNET_free (api); 178 GNUNET_free (api);
179 return NULL; 179 return NULL;
180} 180}
181 181
182/* end of plugin_identity_attribute_type_gnuid.c */ 182/* end of plugin_reclaim_attribute_type_gnuid.c */
diff --git a/src/identity-attribute/identity_attribute.c b/src/reclaim-attribute/reclaim_attribute.c
index 7d47c46a7..74d668ea8 100644
--- a/src/identity-attribute/identity_attribute.c
+++ b/src/reclaim-attribute/reclaim_attribute.c
@@ -17,14 +17,14 @@
17 */ 17 */
18 18
19/** 19/**
20 * @file identity-attribute/identity_attribute.c 20 * @file reclaim-attribute/reclaim_attribute.c
21 * @brief helper library to manage identity attributes 21 * @brief helper library to manage identity attributes
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_util_lib.h" 25#include "gnunet_util_lib.h"
26#include "identity_attribute.h" 26#include "reclaim_attribute.h"
27#include "gnunet_identity_attribute_plugin.h" 27#include "gnunet_reclaim_attribute_plugin.h"
28 28
29/** 29/**
30 * Handle for a plugin 30 * Handle for a plugin
@@ -39,7 +39,7 @@ struct Plugin
39 /** 39 /**
40 * Plugin API 40 * Plugin API
41 */ 41 */
42 struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions *api; 42 struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api;
43}; 43};
44 44
45/** 45/**
@@ -65,7 +65,7 @@ add_plugin (void* cls,
65 const char *library_name, 65 const char *library_name,
66 void *lib_ret) 66 void *lib_ret)
67{ 67{
68 struct GNUNET_IDENTITY_ATTRIBUTE_PluginFunctions *api = lib_ret; 68 struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api = lib_ret;
69 struct Plugin *plugin; 69 struct Plugin *plugin;
70 70
71 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 71 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -86,7 +86,7 @@ init()
86 if (GNUNET_YES == initialized) 86 if (GNUNET_YES == initialized)
87 return; 87 return;
88 initialized = GNUNET_YES; 88 initialized = GNUNET_YES;
89 GNUNET_PLUGIN_load_all ("libgnunet_plugin_identity_attribute_", NULL, 89 GNUNET_PLUGIN_load_all ("libgnunet_plugin_reclaim_attribute_", NULL,
90 &add_plugin, NULL); 90 &add_plugin, NULL);
91} 91}
92 92
@@ -97,7 +97,7 @@ init()
97 * @return corresponding number, UINT32_MAX on error 97 * @return corresponding number, UINT32_MAX on error
98 */ 98 */
99uint32_t 99uint32_t
100GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (const char *typename) 100GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename)
101{ 101{
102 unsigned int i; 102 unsigned int i;
103 struct Plugin *plugin; 103 struct Plugin *plugin;
@@ -121,7 +121,7 @@ GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (const char *typename)
121 * @return corresponding typestring, NULL on error 121 * @return corresponding typestring, NULL on error
122 */ 122 */
123const char* 123const char*
124GNUNET_IDENTITY_ATTRIBUTE_number_to_typename (uint32_t type) 124GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (uint32_t type)
125{ 125{
126 unsigned int i; 126 unsigned int i;
127 struct Plugin *plugin; 127 struct Plugin *plugin;
@@ -149,7 +149,7 @@ GNUNET_IDENTITY_ATTRIBUTE_number_to_typename (uint32_t type)
149 * @return #GNUNET_OK on success 149 * @return #GNUNET_OK on success
150 */ 150 */
151int 151int
152GNUNET_IDENTITY_ATTRIBUTE_string_to_value (uint32_t type, 152GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
153 const char *s, 153 const char *s,
154 void **data, 154 void **data,
155 size_t *data_size) 155 size_t *data_size)
@@ -180,7 +180,7 @@ GNUNET_IDENTITY_ATTRIBUTE_string_to_value (uint32_t type,
180 * @return NULL on error, otherwise human-readable representation of the claim 180 * @return NULL on error, otherwise human-readable representation of the claim
181 */ 181 */
182char * 182char *
183GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, 183GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type,
184 const void* data, 184 const void* data,
185 size_t data_size) 185 size_t data_size)
186{ 186{
@@ -210,16 +210,16 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type,
210 * @param data_size the attribute value size 210 * @param data_size the attribute value size
211 * @return the new attribute 211 * @return the new attribute
212 */ 212 */
213struct GNUNET_IDENTITY_ATTRIBUTE_Claim * 213struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
214GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, 214GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char* attr_name,
215 uint32_t type, 215 uint32_t type,
216 const void* data, 216 const void* data,
217 size_t data_size) 217 size_t data_size)
218{ 218{
219 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr; 219 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr;
220 char *write_ptr; 220 char *write_ptr;
221 221
222 attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + 222 attr = GNUNET_malloc (sizeof (struct GNUNET_RECLAIM_ATTRIBUTE_Claim) +
223 strlen (attr_name) + 1 + 223 strlen (attr_name) + 1 +
224 data_size); 224 data_size);
225 attr->type = type; 225 attr->type = type;
@@ -249,15 +249,15 @@ GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name,
249 * @return 249 * @return
250 */ 250 */
251void 251void
252GNUNET_IDENTITY_ATTRIBUTE_list_add (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *claim_list, 252GNUNET_RECLAIM_ATTRIBUTE_list_add (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *claim_list,
253 const char* attr_name, 253 const char* attr_name,
254 uint32_t type, 254 uint32_t type,
255 const void* data, 255 const void* data,
256 size_t data_size) 256 size_t data_size)
257{ 257{
258 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 258 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
259 le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 259 le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
260 le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr_name, 260 le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr_name,
261 type, 261 type,
262 data, 262 data,
263 data_size); 263 data_size);
@@ -267,20 +267,20 @@ GNUNET_IDENTITY_ATTRIBUTE_list_add (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *
267} 267}
268 268
269size_t 269size_t
270GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 270GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
271{ 271{
272 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 272 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
273 size_t len = 0; 273 size_t len = 0;
274 for (le = attrs->list_head; NULL != le; le = le->next) 274 for (le = attrs->list_head; NULL != le; le = le->next)
275 len += GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (le->claim); 275 len += GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (le->claim);
276 return len; 276 return len;
277} 277}
278 278
279size_t 279size_t
280GNUNET_IDENTITY_ATTRIBUTE_list_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 280GNUNET_RECLAIM_ATTRIBUTE_list_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
281 char *result) 281 char *result)
282{ 282{
283 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 283 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
284 size_t len; 284 size_t len;
285 size_t total_len; 285 size_t total_len;
286 char* write_ptr; 286 char* write_ptr;
@@ -289,7 +289,7 @@ GNUNET_IDENTITY_ATTRIBUTE_list_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE
289 total_len = 0; 289 total_len = 0;
290 for (le = attrs->list_head; NULL != le; le = le->next) 290 for (le = attrs->list_head; NULL != le; le = le->next)
291 { 291 {
292 len = GNUNET_IDENTITY_ATTRIBUTE_serialize (le->claim, 292 len = GNUNET_RECLAIM_ATTRIBUTE_serialize (le->claim,
293 write_ptr); 293 write_ptr);
294 total_len += len; 294 total_len += len;
295 write_ptr += len; 295 write_ptr += len;
@@ -297,49 +297,49 @@ GNUNET_IDENTITY_ATTRIBUTE_list_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE
297 return total_len; 297 return total_len;
298} 298}
299 299
300struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList * 300struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
301GNUNET_IDENTITY_ATTRIBUTE_list_deserialize (const char* data, 301GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char* data,
302 size_t data_size) 302 size_t data_size)
303{ 303{
304 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 304 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
305 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 305 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
306 size_t attr_len; 306 size_t attr_len;
307 const char* read_ptr; 307 const char* read_ptr;
308 308
309 if (data_size < sizeof (struct Attribute)) 309 if (data_size < sizeof (struct Attribute))
310 return NULL; 310 return NULL;
311 311
312 attrs = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 312 attrs = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
313 read_ptr = data; 313 read_ptr = data;
314 while (((data + data_size) - read_ptr) >= sizeof (struct Attribute)) 314 while (((data + data_size) - read_ptr) >= sizeof (struct Attribute))
315 { 315 {
316 316
317 le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 317 le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
318 le->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize (read_ptr, 318 le->claim = GNUNET_RECLAIM_ATTRIBUTE_deserialize (read_ptr,
319 data_size - (read_ptr - data)); 319 data_size - (read_ptr - data));
320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
321 "Deserialized attribute %s\n", le->claim->name); 321 "Deserialized attribute %s\n", le->claim->name);
322 GNUNET_CONTAINER_DLL_insert (attrs->list_head, 322 GNUNET_CONTAINER_DLL_insert (attrs->list_head,
323 attrs->list_tail, 323 attrs->list_tail,
324 le); 324 le);
325 attr_len = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (le->claim); 325 attr_len = GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (le->claim);
326 read_ptr += attr_len; 326 read_ptr += attr_len;
327 } 327 }
328 return attrs; 328 return attrs;
329} 329}
330 330
331struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList* 331struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList*
332GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 332GNUNET_RECLAIM_ATTRIBUTE_list_dup (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
333{ 333{
334 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 334 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
335 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *result_le; 335 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *result_le;
336 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *result; 336 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *result;
337 337
338 result = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 338 result = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
339 for (le = attrs->list_head; NULL != le; le = le->next) 339 for (le = attrs->list_head; NULL != le; le = le->next)
340 { 340 {
341 result_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 341 result_le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
342 result_le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (le->claim->name, 342 result_le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (le->claim->name,
343 le->claim->type, 343 le->claim->type,
344 le->claim->data, 344 le->claim->data,
345 le->claim->data_size); 345 le->claim->data_size);
@@ -352,10 +352,10 @@ GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim
352 352
353 353
354void 354void
355GNUNET_IDENTITY_ATTRIBUTE_list_destroy (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 355GNUNET_RECLAIM_ATTRIBUTE_list_destroy (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
356{ 356{
357 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 357 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
358 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *tmp_le; 358 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *tmp_le;
359 359
360 for (le = attrs->list_head; NULL != le;) 360 for (le = attrs->list_head; NULL != le;)
361 { 361 {
@@ -369,7 +369,7 @@ GNUNET_IDENTITY_ATTRIBUTE_list_destroy (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimLi
369} 369}
370 370
371size_t 371size_t
372GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 372GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
373{ 373{
374 return sizeof (struct Attribute) 374 return sizeof (struct Attribute)
375 + strlen (attr->name) 375 + strlen (attr->name)
@@ -377,7 +377,7 @@ GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (const struct GNUNET_IDENTITY_ATTRI
377} 377}
378 378
379size_t 379size_t
380GNUNET_IDENTITY_ATTRIBUTE_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr, 380GNUNET_RECLAIM_ATTRIBUTE_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
381 char *result) 381 char *result)
382{ 382{
383 size_t data_len_ser; 383 size_t data_len_ser;
@@ -403,11 +403,11 @@ GNUNET_IDENTITY_ATTRIBUTE_serialize (const struct GNUNET_IDENTITY_ATTRIBUTE_Clai
403 return sizeof (struct Attribute) + strlen (attr->name) + attr->data_size; 403 return sizeof (struct Attribute) + strlen (attr->name) + attr->data_size;
404} 404}
405 405
406struct GNUNET_IDENTITY_ATTRIBUTE_Claim * 406struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
407GNUNET_IDENTITY_ATTRIBUTE_deserialize (const char* data, 407GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char* data,
408 size_t data_size) 408 size_t data_size)
409{ 409{
410 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr; 410 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr;
411 struct Attribute *attr_ser; 411 struct Attribute *attr_ser;
412 size_t data_len; 412 size_t data_len;
413 size_t name_len; 413 size_t name_len;
@@ -419,7 +419,7 @@ GNUNET_IDENTITY_ATTRIBUTE_deserialize (const char* data,
419 attr_ser = (struct Attribute*)data; 419 attr_ser = (struct Attribute*)data;
420 data_len = ntohs (attr_ser->data_size); 420 data_len = ntohs (attr_ser->data_size);
421 name_len = ntohs (attr_ser->name_len); 421 name_len = ntohs (attr_ser->name_len);
422 attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) 422 attr = GNUNET_malloc (sizeof (struct GNUNET_RECLAIM_ATTRIBUTE_Claim)
423 + data_len + name_len + 1); 423 + data_len + name_len + 1);
424 attr->type = ntohs (attr_ser->attribute_type); 424 attr->type = ntohs (attr_ser->attribute_type);
425 attr->version = ntohl (attr_ser->attribute_version); 425 attr->version = ntohl (attr_ser->attribute_version);
@@ -441,4 +441,4 @@ GNUNET_IDENTITY_ATTRIBUTE_deserialize (const char* data,
441 441
442} 442}
443 443
444/* end of identity_attribute.c */ 444/* end of reclaim_attribute.c */
diff --git a/src/identity-attribute/identity_attribute.h b/src/reclaim-attribute/reclaim_attribute.h
index 2346dcde1..746d32980 100644
--- a/src/identity-attribute/identity_attribute.h
+++ b/src/reclaim-attribute/reclaim_attribute.h
@@ -17,14 +17,14 @@
17 */ 17 */
18/** 18/**
19 * @author Martin Schanzenbach 19 * @author Martin Schanzenbach
20 * @file identity-attribute/identity_attribute.h 20 * @file reclaim-attribute/reclaim_attribute.h
21 * @brief GNUnet Identity attributes 21 * @brief GNUnet reclaim identity attributes
22 * 22 *
23 */ 23 */
24#ifndef IDENTITY_ATTRIBUTE_H 24#ifndef RECLAIM_ATTRIBUTE_H
25#define IDENTITY_ATTRIBUTE_H 25#define RECLAIM_ATTRIBUTE_H
26 26
27#include "gnunet_identity_provider_service.h" 27#include "gnunet_reclaim_service.h"
28 28
29struct Attribute 29struct Attribute
30{ 30{
diff --git a/src/identity-provider/.gitignore b/src/reclaim/.gitignore
index ef77fccdc..ef77fccdc 100644
--- a/src/identity-provider/.gitignore
+++ b/src/reclaim/.gitignore
diff --git a/src/identity-provider/Makefile.am b/src/reclaim/Makefile.am
index 2eb699542..2ee43d21a 100644
--- a/src/identity-provider/Makefile.am
+++ b/src/reclaim/Makefile.am
@@ -13,12 +13,12 @@ if USE_COVERAGE
13endif 13endif
14 14
15if HAVE_SQLITE 15if HAVE_SQLITE
16SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la 16SQLITE_PLUGIN = libgnunet_plugin_reclaim_sqlite.la
17endif 17endif
18 18
19EXTRA_DIST = \ 19EXTRA_DIST = \
20 test_idp_defaults.conf \ 20 test_reclaim_defaults.conf \
21 test_idp.conf \ 21 test_reclaim.conf \
22 $(check_SCRIPTS) 22 $(check_SCRIPTS)
23 23
24pkgcfgdir= $(pkgdatadir)/config.d/ 24pkgcfgdir= $(pkgdatadir)/config.d/
@@ -26,46 +26,46 @@ pkgcfgdir= $(pkgdatadir)/config.d/
26libexecdir= $(pkglibdir)/libexec/ 26libexecdir= $(pkglibdir)/libexec/
27 27
28pkgcfg_DATA = \ 28pkgcfg_DATA = \
29 identity-provider.conf 29 reclaim.conf
30 30
31lib_LTLIBRARIES = \ 31lib_LTLIBRARIES = \
32 libgnunetidentityprovider.la 32 libgnunetreclaim.la
33plugin_LTLIBRARIES = \ 33plugin_LTLIBRARIES = \
34 libgnunet_plugin_rest_identity_provider.la \ 34 libgnunet_plugin_rest_reclaim.la \
35 libgnunet_plugin_rest_openid_connect.la \ 35 libgnunet_plugin_rest_openid_connect.la \
36 libgnunet_plugin_gnsrecord_identity_provider.la \ 36 libgnunet_plugin_gnsrecord_reclaim.la \
37 $(SQLITE_PLUGIN) 37 $(SQLITE_PLUGIN)
38 38
39bin_PROGRAMS = \ 39bin_PROGRAMS = \
40 gnunet-idp 40 gnunet-reclaim
41 41
42libexec_PROGRAMS = \ 42libexec_PROGRAMS = \
43 gnunet-service-identity-provider 43 gnunet-service-reclaim
44 44
45libgnunet_plugin_gnsrecord_identity_provider_la_SOURCES = \ 45libgnunet_plugin_gnsrecord_reclaim_la_SOURCES = \
46 plugin_gnsrecord_identity_provider.c 46 plugin_gnsrecord_reclaim.c
47libgnunet_plugin_gnsrecord_identity_provider_la_LIBADD = \ 47libgnunet_plugin_gnsrecord_reclaim_la_LIBADD = \
48 $(top_builddir)/src/util/libgnunetutil.la \ 48 $(top_builddir)/src/util/libgnunetutil.la \
49 $(LTLIBINTL) 49 $(LTLIBINTL)
50libgnunet_plugin_gnsrecord_identity_provider_la_LDFLAGS = \ 50libgnunet_plugin_gnsrecord_reclaim_la_LDFLAGS = \
51 $(GN_PLUGIN_LDFLAGS) 51 $(GN_PLUGIN_LDFLAGS)
52 52
53libgnunet_plugin_identity_provider_sqlite_la_SOURCES = \ 53libgnunet_plugin_reclaim_sqlite_la_SOURCES = \
54 plugin_identity_provider_sqlite.c 54 plugin_reclaim_sqlite.c
55libgnunet_plugin_identity_provider_sqlite_la_LIBADD = \ 55libgnunet_plugin_reclaim_sqlite_la_LIBADD = \
56 libgnunetidentityprovider.la \ 56 libgnunetreclaim.la \
57 $(top_builddir)/src/sq/libgnunetsq.la \ 57 $(top_builddir)/src/sq/libgnunetsq.la \
58 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 58 $(top_builddir)/src/statistics/libgnunetstatistics.la \
59 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \ 59 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
60 $(LTLIBINTL) 60 $(LTLIBINTL)
61libgnunet_plugin_identity_provider_sqlite_la_LDFLAGS = \ 61libgnunet_plugin_reclaim_sqlite_la_LDFLAGS = \
62 $(GN_PLUGIN_LDFLAGS) 62 $(GN_PLUGIN_LDFLAGS)
63 63
64 64
65 65
66gnunet_service_identity_provider_SOURCES = \ 66gnunet_service_reclaim_SOURCES = \
67 gnunet-service-identity-provider.c 67 gnunet-service-reclaim.c
68gnunet_service_identity_provider_LDADD = \ 68gnunet_service_reclaim_LDADD = \
69 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ 69 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
70 $(top_builddir)/src/util/libgnunetutil.la \ 70 $(top_builddir)/src/util/libgnunetutil.la \
71 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 71 $(top_builddir)/src/namestore/libgnunetnamestore.la \
@@ -73,66 +73,67 @@ gnunet_service_identity_provider_LDADD = \
73 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 73 $(top_builddir)/src/statistics/libgnunetstatistics.la \
74 $(top_builddir)/src/abe/libgnunetabe.la \ 74 $(top_builddir)/src/abe/libgnunetabe.la \
75 $(top_builddir)/src/credential/libgnunetcredential.la \ 75 $(top_builddir)/src/credential/libgnunetcredential.la \
76 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \ 76 $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
77 libgnunetidentityprovider.la \ 77 libgnunetreclaim.la \
78 $(top_builddir)/src/gns/libgnunetgns.la \ 78 $(top_builddir)/src/gns/libgnunetgns.la \
79 $(GN_LIBINTL) 79 $(GN_LIBINTL)
80 80
81libgnunetidentityprovider_la_SOURCES = \ 81libgnunetreclaim_la_SOURCES = \
82 identity_provider_api.c \ 82 reclaim_api.c \
83 identity_provider.h 83 reclaim.h
84libgnunetidentityprovider_la_LIBADD = \ 84libgnunetreclaim_la_LIBADD = \
85 $(top_builddir)/src/util/libgnunetutil.la \ 85 $(top_builddir)/src/util/libgnunetutil.la \
86 $(GN_LIBINTL) $(XLIB) 86 $(GN_LIBINTL) $(XLIB)
87libgnunetidentityprovider_la_LDFLAGS = \ 87libgnunetreclaim_la_LDFLAGS = \
88 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 88 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
89 -version-info 0:0:0 89 -version-info 0:0:0
90 90
91libgnunet_plugin_rest_identity_provider_la_SOURCES = \ 91libgnunet_plugin_rest_reclaim_la_SOURCES = \
92 plugin_rest_identity_provider.c \ 92 plugin_rest_reclaim.c
93 jwt.c 93libgnunet_plugin_rest_reclaim_la_LIBADD = \
94libgnunet_plugin_rest_identity_provider_la_LIBADD = \
95 $(top_builddir)/src/identity/libgnunetidentity.la \ 94 $(top_builddir)/src/identity/libgnunetidentity.la \
96 libgnunetidentityprovider.la \ 95 libgnunetreclaim.la \
97 $(top_builddir)/src/rest/libgnunetrest.la \ 96 $(top_builddir)/src/rest/libgnunetrest.la \
98 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \ 97 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
99 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \ 98 $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
100 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 99 $(top_builddir)/src/namestore/libgnunetnamestore.la \
101 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ 100 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
102 $(LTLIBINTL) -ljansson -lmicrohttpd 101 $(LTLIBINTL) -ljansson -lmicrohttpd
103libgnunet_plugin_rest_identity_provider_la_LDFLAGS = \ 102libgnunet_plugin_rest_reclaim_la_LDFLAGS = \
104 $(GN_PLUGIN_LDFLAGS) 103 $(GN_PLUGIN_LDFLAGS)
105 104
106libgnunet_plugin_rest_openid_connect_la_SOURCES = \ 105libgnunet_plugin_rest_openid_connect_la_SOURCES = \
107 plugin_rest_openid_connect.c \ 106 plugin_rest_openid_connect.c \
108 jwt.c 107 oidc_helper.c
109libgnunet_plugin_rest_openid_connect_la_LIBADD = \ 108libgnunet_plugin_rest_openid_connect_la_LIBADD = \
110 $(top_builddir)/src/identity/libgnunetidentity.la \ 109 $(top_builddir)/src/identity/libgnunetidentity.la \
111 libgnunetidentityprovider.la \ 110 libgnunetreclaim.la \
112 $(top_builddir)/src/rest/libgnunetrest.la \ 111 $(top_builddir)/src/rest/libgnunetrest.la \
113 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \ 112 $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
114 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \ 113 $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
115 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 114 $(top_builddir)/src/namestore/libgnunetnamestore.la \
115 $(top_builddir)/src/gns/libgnunetgns.la \
116 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
116 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ 117 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
117 $(LTLIBINTL) -ljansson -lmicrohttpd 118 $(LTLIBINTL) -ljansson -lmicrohttpd
118libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \ 119libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \
119 $(GN_PLUGIN_LDFLAGS) 120 $(GN_PLUGIN_LDFLAGS)
120 121
121gnunet_idp_SOURCES = \ 122gnunet_reclaim_SOURCES = \
122 gnunet-idp.c 123 gnunet-reclaim.c
123gnunet_idp_LDADD = \ 124gnunet_reclaim_LDADD = \
124 $(top_builddir)/src/util/libgnunetutil.la \ 125 $(top_builddir)/src/util/libgnunetutil.la \
125 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 126 $(top_builddir)/src/namestore/libgnunetnamestore.la \
126 libgnunetidentityprovider.la \ 127 libgnunetreclaim.la \
127 $(top_builddir)/src/identity/libgnunetidentity.la \ 128 $(top_builddir)/src/identity/libgnunetidentity.la \
128 $(top_builddir)/src/identity-attribute/libgnunetidentityattribute.la \ 129 $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
129 $(GN_LIBINTL) 130 $(GN_LIBINTL)
130 131
131check_SCRIPTS = \ 132check_SCRIPTS = \
132 test_idp_attribute.sh \ 133 test_reclaim_attribute.sh \
133 test_idp_issue.sh \ 134 test_reclaim_issue.sh \
134 test_idp_consume.sh \ 135 test_reclaim_consume.sh \
135 test_idp_revoke.sh 136 test_reclaim_revoke.sh
136 137
137if ENABLE_TEST_RUN 138if ENABLE_TEST_RUN
138 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; 139 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/identity-provider/gnunet-idp.c b/src/reclaim/gnunet-reclaim.c
index 79e4f8d27..9947eac6d 100644
--- a/src/identity-provider/gnunet-idp.c
+++ b/src/reclaim/gnunet-reclaim.c
@@ -17,7 +17,7 @@
17 */ 17 */
18/** 18/**
19 * @author Martin Schanzenbach 19 * @author Martin Schanzenbach
20 * @file src/identity-provider/gnunet-idp.c 20 * @file src/reclaim/gnunet-reclaim.c
21 * @brief Identity Provider utility 21 * @brief Identity Provider utility
22 * 22 *
23 */ 23 */
@@ -25,7 +25,7 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
27#include "gnunet_namestore_service.h" 27#include "gnunet_namestore_service.h"
28#include "gnunet_identity_provider_service.h" 28#include "gnunet_reclaim_service.h"
29#include "gnunet_identity_service.h" 29#include "gnunet_identity_service.h"
30#include "gnunet_signatures.h" 30#include "gnunet_signatures.h"
31 31
@@ -85,19 +85,19 @@ static char* ego_name;
85static struct GNUNET_IDENTITY_Handle *identity_handle; 85static struct GNUNET_IDENTITY_Handle *identity_handle;
86 86
87/** 87/**
88 * IdP handle 88 * reclaim handle
89 */ 89 */
90static struct GNUNET_IDENTITY_PROVIDER_Handle *idp_handle; 90static struct GNUNET_RECLAIM_Handle *reclaim_handle;
91 91
92/** 92/**
93 * IdP operation 93 * reclaim operation
94 */ 94 */
95static struct GNUNET_IDENTITY_PROVIDER_Operation *idp_op; 95static struct GNUNET_RECLAIM_Operation *reclaim_op;
96 96
97/** 97/**
98 * Attribute iterator 98 * Attribute iterator
99 */ 99 */
100static struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *attr_iterator; 100static struct GNUNET_RECLAIM_AttributeIterator *attr_iterator;
101 101
102/** 102/**
103 * Master ABE key 103 * Master ABE key
@@ -117,12 +117,12 @@ static struct GNUNET_CRYPTO_EcdsaPublicKey rp_key;
117/** 117/**
118 * Ticket to consume 118 * Ticket to consume
119 */ 119 */
120static struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 120static struct GNUNET_RECLAIM_Ticket ticket;
121 121
122/** 122/**
123 * Attribute list 123 * Attribute list
124 */ 124 */
125static struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list; 125static struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attr_list;
126 126
127/** 127/**
128 * Attribute expiration interval 128 * Attribute expiration interval
@@ -139,12 +139,12 @@ do_cleanup(void *cls)
139{ 139{
140 if (NULL != timeout) 140 if (NULL != timeout)
141 GNUNET_SCHEDULER_cancel (timeout); 141 GNUNET_SCHEDULER_cancel (timeout);
142 if (NULL != idp_op) 142 if (NULL != reclaim_op)
143 GNUNET_IDENTITY_PROVIDER_cancel (idp_op); 143 GNUNET_RECLAIM_cancel (reclaim_op);
144 if (NULL != attr_iterator) 144 if (NULL != attr_iterator)
145 GNUNET_IDENTITY_PROVIDER_get_attributes_stop (attr_iterator); 145 GNUNET_RECLAIM_get_attributes_stop (attr_iterator);
146 if (NULL != idp_handle) 146 if (NULL != reclaim_handle)
147 GNUNET_IDENTITY_PROVIDER_disconnect (idp_handle); 147 GNUNET_RECLAIM_disconnect (reclaim_handle);
148 if (NULL != identity_handle) 148 if (NULL != identity_handle)
149 GNUNET_IDENTITY_disconnect (identity_handle); 149 GNUNET_IDENTITY_disconnect (identity_handle);
150 if (NULL != abe_key) 150 if (NULL != abe_key)
@@ -155,13 +155,13 @@ do_cleanup(void *cls)
155 155
156static void 156static void
157ticket_issue_cb (void* cls, 157ticket_issue_cb (void* cls,
158 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket) 158 const struct GNUNET_RECLAIM_Ticket *ticket)
159{ 159{
160 char* ticket_str; 160 char* ticket_str;
161 idp_op = NULL; 161 reclaim_op = NULL;
162 if (NULL != ticket) { 162 if (NULL != ticket) {
163 ticket_str = GNUNET_STRINGS_data_to_string_alloc (ticket, 163 ticket_str = GNUNET_STRINGS_data_to_string_alloc (ticket,
164 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 164 sizeof (struct GNUNET_RECLAIM_Ticket));
165 printf("%s\n", 165 printf("%s\n",
166 ticket_str); 166 ticket_str);
167 GNUNET_free (ticket_str); 167 GNUNET_free (ticket_str);
@@ -174,7 +174,7 @@ store_attr_cont (void *cls,
174 int32_t success, 174 int32_t success,
175 const char*emsg) 175 const char*emsg)
176{ 176{
177 idp_op = NULL; 177 reclaim_op = NULL;
178 if (GNUNET_SYSERR == success) { 178 if (GNUNET_SYSERR == success) {
179 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 179 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
180 "%s\n", emsg); 180 "%s\n", emsg);
@@ -185,12 +185,12 @@ store_attr_cont (void *cls,
185static void 185static void
186process_attrs (void *cls, 186process_attrs (void *cls,
187 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 187 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
188 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 188 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
189{ 189{
190 char *value_str; 190 char *value_str;
191 if (NULL == identity) 191 if (NULL == identity)
192 { 192 {
193 idp_op = NULL; 193 reclaim_op = NULL;
194 GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 194 GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
195 return; 195 return;
196 } 196 }
@@ -199,9 +199,9 @@ process_attrs (void *cls,
199 ret = 1; 199 ret = 1;
200 return; 200 return;
201 } 201 }
202 value_str = GNUNET_IDENTITY_ATTRIBUTE_value_to_string (attr->type, 202 value_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
203 attr->data, 203 attr->data,
204 attr->data_size); 204 attr->data_size);
205 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 205 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
206 "%s: %s\n", attr->name, value_str); 206 "%s: %s\n", attr->name, value_str);
207} 207}
@@ -229,7 +229,7 @@ timeout_task (void *cls)
229static void 229static void
230process_rvk (void *cls, int success, const char* msg) 230process_rvk (void *cls, int success, const char* msg)
231{ 231{
232 idp_op = NULL; 232 reclaim_op = NULL;
233 if (GNUNET_OK != success) 233 if (GNUNET_OK != success)
234 { 234 {
235 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 235 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
@@ -242,7 +242,7 @@ process_rvk (void *cls, int success, const char* msg)
242static void 242static void
243iter_finished (void *cls) 243iter_finished (void *cls)
244{ 244{
245 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *claim; 245 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *claim;
246 char *data; 246 char *data;
247 size_t data_size; 247 size_t data_size;
248 int type; 248 int type;
@@ -256,21 +256,21 @@ iter_finished (void *cls)
256 256
257 if (issue_attrs) 257 if (issue_attrs)
258 { 258 {
259 idp_op = GNUNET_IDENTITY_PROVIDER_ticket_issue (idp_handle, 259 reclaim_op = GNUNET_RECLAIM_ticket_issue (reclaim_handle,
260 pkey, 260 pkey,
261 &rp_key, 261 &rp_key,
262 attr_list, 262 attr_list,
263 &ticket_issue_cb, 263 &ticket_issue_cb,
264 NULL); 264 NULL);
265 return; 265 return;
266 } 266 }
267 if (consume_ticket) 267 if (consume_ticket)
268 { 268 {
269 idp_op = GNUNET_IDENTITY_PROVIDER_ticket_consume (idp_handle, 269 reclaim_op = GNUNET_RECLAIM_ticket_consume (reclaim_handle,
270 pkey, 270 pkey,
271 &ticket, 271 &ticket,
272 &process_attrs, 272 &process_attrs,
273 NULL); 273 NULL);
274 timeout = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 10), 274 timeout = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 10),
275 &timeout_task, 275 &timeout_task,
276 NULL); 276 NULL);
@@ -278,34 +278,34 @@ iter_finished (void *cls)
278 } 278 }
279 if (revoke_ticket) 279 if (revoke_ticket)
280 { 280 {
281 idp_op = GNUNET_IDENTITY_PROVIDER_ticket_revoke (idp_handle, 281 reclaim_op = GNUNET_RECLAIM_ticket_revoke (reclaim_handle,
282 pkey, 282 pkey,
283 &ticket, 283 &ticket,
284 &process_rvk, 284 &process_rvk,
285 NULL); 285 NULL);
286 return; 286 return;
287 } 287 }
288 if (attr_name) 288 if (attr_name)
289 { 289 {
290 if (NULL == type_str) 290 if (NULL == type_str)
291 type = GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING; 291 type = GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING;
292 else 292 else
293 type = GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (type_str); 293 type = GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (type_str);
294 294
295 GNUNET_assert (GNUNET_SYSERR != GNUNET_IDENTITY_ATTRIBUTE_string_to_value (type, 295 GNUNET_assert (GNUNET_SYSERR != GNUNET_RECLAIM_ATTRIBUTE_string_to_value (type,
296 attr_value, 296 attr_value,
297 (void**)&data, 297 (void**)&data,
298 &data_size)); 298 &data_size));
299 claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr_name, 299 claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr_name,
300 type, 300 type,
301 data, 301 data,
302 data_size); 302 data_size);
303 idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, 303 reclaim_op = GNUNET_RECLAIM_attribute_store (reclaim_handle,
304 pkey, 304 pkey,
305 claim, 305 claim,
306 &exp_interval, 306 &exp_interval,
307 &store_attr_cont, 307 &store_attr_cont,
308 NULL); 308 NULL);
309 return; 309 return;
310 } 310 }
311 GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 311 GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
@@ -314,9 +314,9 @@ iter_finished (void *cls)
314static void 314static void
315iter_cb (void *cls, 315iter_cb (void *cls,
316 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 316 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
317 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 317 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
318{ 318{
319 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 319 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
320 char *attrs_tmp; 320 char *attrs_tmp;
321 char *attr_str; 321 char *attr_str;
322 322
@@ -329,11 +329,11 @@ iter_cb (void *cls,
329 attr_str = strtok (NULL, ","); 329 attr_str = strtok (NULL, ",");
330 continue; 330 continue;
331 } 331 }
332 le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 332 le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
333 le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr->name, 333 le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name,
334 attr->type, 334 attr->type,
335 attr->data, 335 attr->data,
336 attr->data_size); 336 attr->data_size);
337 GNUNET_CONTAINER_DLL_insert (attr_list->list_head, 337 GNUNET_CONTAINER_DLL_insert (attr_list->list_head,
338 attr_list->list_tail, 338 attr_list->list_tail,
339 le); 339 le);
@@ -344,7 +344,7 @@ iter_cb (void *cls,
344 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 344 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
345 "%s: %s\n", attr->name, (char*)attr->data); 345 "%s: %s\n", attr->name, (char*)attr->data);
346 } 346 }
347 GNUNET_IDENTITY_PROVIDER_get_attributes_next (attr_iterator); 347 GNUNET_RECLAIM_get_attributes_next (attr_iterator);
348} 348}
349 349
350static void 350static void
@@ -365,24 +365,24 @@ ego_iter_finished (void *cls)
365 GNUNET_STRINGS_string_to_data (consume_ticket, 365 GNUNET_STRINGS_string_to_data (consume_ticket,
366 strlen (consume_ticket), 366 strlen (consume_ticket),
367 &ticket, 367 &ticket,
368 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 368 sizeof (struct GNUNET_RECLAIM_Ticket));
369 if (NULL != revoke_ticket) 369 if (NULL != revoke_ticket)
370 GNUNET_STRINGS_string_to_data (revoke_ticket, 370 GNUNET_STRINGS_string_to_data (revoke_ticket,
371 strlen (revoke_ticket), 371 strlen (revoke_ticket),
372 &ticket, 372 &ticket,
373 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 373 sizeof (struct GNUNET_RECLAIM_Ticket));
374 374
375 375
376 attr_list = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 376 attr_list = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
377 377
378 attr_iterator = GNUNET_IDENTITY_PROVIDER_get_attributes_start (idp_handle, 378 attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle,
379 pkey, 379 pkey,
380 &iter_error, 380 &iter_error,
381 NULL, 381 NULL,
382 &iter_cb, 382 &iter_cb,
383 NULL, 383 NULL,
384 &iter_finished, 384 &iter_finished,
385 NULL); 385 NULL);
386 386
387 387
388} 388}
@@ -439,7 +439,7 @@ run (void *cls,
439 return; 439 return;
440 } 440 }
441 441
442 idp_handle = GNUNET_IDENTITY_PROVIDER_connect (c); 442 reclaim_handle = GNUNET_RECLAIM_connect (c);
443 //Get Ego 443 //Get Ego
444 identity_handle = GNUNET_IDENTITY_connect (c, 444 identity_handle = GNUNET_IDENTITY_connect (c,
445 &ego_cb, 445 &ego_cb,
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/reclaim/gnunet-service-reclaim.c
index c53e72477..bf8780a92 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/reclaim/gnunet-service-reclaim.c
@@ -17,8 +17,8 @@
17 */ 17 */
18/** 18/**
19 * @author Martin Schanzenbach 19 * @author Martin Schanzenbach
20 * @file src/identity-provider/gnunet-service-identity-provider.c 20 * @file src/reclaim/gnunet-service-reclaim.c
21 * @brief Identity Token Service 21 * @brief reclaim Service
22 * 22 *
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
@@ -32,10 +32,10 @@
32#include "gnunet_credential_service.h" 32#include "gnunet_credential_service.h"
33#include "gnunet_statistics_service.h" 33#include "gnunet_statistics_service.h"
34#include "gnunet_gns_service.h" 34#include "gnunet_gns_service.h"
35#include "gnunet_identity_provider_plugin.h" 35#include "gnunet_reclaim_plugin.h"
36#include "gnunet_identity_attribute_lib.h" 36#include "gnunet_reclaim_attribute_lib.h"
37#include "gnunet_signatures.h" 37#include "gnunet_signatures.h"
38#include "identity_provider.h" 38#include "reclaim.h"
39 39
40/** 40/**
41 * First pass state 41 * First pass state
@@ -65,7 +65,7 @@ static struct GNUNET_IDENTITY_Handle *identity_handle;
65/** 65/**
66 * Database handle 66 * Database handle
67 */ 67 */
68static struct GNUNET_IDENTITY_PROVIDER_PluginFunctions *TKT_database; 68static struct GNUNET_RECLAIM_PluginFunctions *TKT_database;
69 69
70/** 70/**
71 * Name of DB plugin 71 * Name of DB plugin
@@ -396,7 +396,7 @@ struct AttributeStoreHandle
396 /** 396 /**
397 * The attribute to store 397 * The attribute to store
398 */ 398 */
399 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *claim; 399 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *claim;
400 400
401 /** 401 /**
402 * The attribute expiration interval 402 * The attribute expiration interval
@@ -433,7 +433,7 @@ struct ConsumeTicketHandle
433 /** 433 /**
434 * Ticket 434 * Ticket
435 */ 435 */
436 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 436 struct GNUNET_RECLAIM_Ticket ticket;
437 437
438 /** 438 /**
439 * LookupRequest 439 * LookupRequest
@@ -473,7 +473,7 @@ struct ConsumeTicketHandle
473 /** 473 /**
474 * Attributes 474 * Attributes
475 */ 475 */
476 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 476 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
477 477
478 /** 478 /**
479 * Lookup time 479 * Lookup time
@@ -535,12 +535,12 @@ struct TicketRevocationHandle
535 /** 535 /**
536 * Attributes to reissue 536 * Attributes to reissue
537 */ 537 */
538 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 538 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
539 539
540 /** 540 /**
541 * Attributes to revoke 541 * Attributes to revoke
542 */ 542 */
543 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *rvk_attrs; 543 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *rvk_attrs;
544 544
545 /** 545 /**
546 * Issuer Key 546 * Issuer Key
@@ -550,7 +550,7 @@ struct TicketRevocationHandle
550 /** 550 /**
551 * Ticket to issue 551 * Ticket to issue
552 */ 552 */
553 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 553 struct GNUNET_RECLAIM_Ticket ticket;
554 554
555 /** 555 /**
556 * QueueEntry 556 * QueueEntry
@@ -603,7 +603,7 @@ struct TicketIssueHandle
603 /** 603 /**
604 * Attributes to issue 604 * Attributes to issue
605 */ 605 */
606 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 606 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
607 607
608 /** 608 /**
609 * Issuer Key 609 * Issuer Key
@@ -613,7 +613,7 @@ struct TicketIssueHandle
613 /** 613 /**
614 * Ticket to issue 614 * Ticket to issue
615 */ 615 */
616 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 616 struct GNUNET_RECLAIM_Ticket ticket;
617 617
618 /** 618 /**
619 * QueueEntry 619 * QueueEntry
@@ -861,7 +861,7 @@ static void
861cleanup_ticket_issue_handle (struct TicketIssueHandle *handle) 861cleanup_ticket_issue_handle (struct TicketIssueHandle *handle)
862{ 862{
863 if (NULL != handle->attrs) 863 if (NULL != handle->attrs)
864 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); 864 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (handle->attrs);
865 if (NULL != handle->ns_qe) 865 if (NULL != handle->ns_qe)
866 GNUNET_NAMESTORE_cancel (handle->ns_qe); 866 GNUNET_NAMESTORE_cancel (handle->ns_qe);
867 GNUNET_free (handle); 867 GNUNET_free (handle);
@@ -871,12 +871,12 @@ cleanup_ticket_issue_handle (struct TicketIssueHandle *handle)
871static void 871static void
872send_ticket_result (struct IdpClient *client, 872send_ticket_result (struct IdpClient *client,
873 uint32_t r_id, 873 uint32_t r_id,
874 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 874 const struct GNUNET_RECLAIM_Ticket *ticket,
875 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 875 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
876{ 876{
877 struct TicketResultMessage *irm; 877 struct TicketResultMessage *irm;
878 struct GNUNET_MQ_Envelope *env; 878 struct GNUNET_MQ_Envelope *env;
879 struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket_buf; 879 struct GNUNET_RECLAIM_Ticket *ticket_buf;
880 880
881 /* store ticket in DB */ 881 /* store ticket in DB */
882 if (GNUNET_OK != TKT_database->store_ticket (TKT_database->cls, 882 if (GNUNET_OK != TKT_database->store_ticket (TKT_database->cls,
@@ -889,9 +889,9 @@ send_ticket_result (struct IdpClient *client,
889 } 889 }
890 890
891 env = GNUNET_MQ_msg_extra (irm, 891 env = GNUNET_MQ_msg_extra (irm,
892 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket), 892 sizeof (struct GNUNET_RECLAIM_Ticket),
893 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT); 893 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT);
894 ticket_buf = (struct GNUNET_IDENTITY_PROVIDER_Ticket *)&irm[1]; 894 ticket_buf = (struct GNUNET_RECLAIM_Ticket *)&irm[1];
895 *ticket_buf = *ticket; 895 *ticket_buf = *ticket;
896 irm->id = htonl (r_id); 896 irm->id = htonl (r_id);
897 GNUNET_MQ_send (client->mq, 897 GNUNET_MQ_send (client->mq,
@@ -927,14 +927,14 @@ store_ticket_issue_cont (void *cls,
927 927
928 928
929int 929int
930serialize_abe_keyinfo2 (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 930serialize_abe_keyinfo2 (const struct GNUNET_RECLAIM_Ticket *ticket,
931 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 931 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
932 const struct GNUNET_ABE_AbeKey *rp_key, 932 const struct GNUNET_ABE_AbeKey *rp_key,
933 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey, 933 struct GNUNET_CRYPTO_EcdhePrivateKey **ecdh_privkey,
934 char **result) 934 char **result)
935{ 935{
936 struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey; 936 struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey;
937 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 937 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
938 char *enc_keyinfo; 938 char *enc_keyinfo;
939 char *serialized_key; 939 char *serialized_key;
940 char *buf; 940 char *buf;
@@ -1009,7 +1009,7 @@ issue_ticket_after_abe_bootstrap (void *cls,
1009 struct GNUNET_ABE_AbeMasterKey *abe_key) 1009 struct GNUNET_ABE_AbeMasterKey *abe_key)
1010{ 1010{
1011 struct TicketIssueHandle *ih = cls; 1011 struct TicketIssueHandle *ih = cls;
1012 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 1012 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
1013 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 1013 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
1014 struct GNUNET_GNSRECORD_Data code_record[1]; 1014 struct GNUNET_GNSRECORD_Data code_record[1];
1015 struct GNUNET_ABE_AbeKey *rp_key; 1015 struct GNUNET_ABE_AbeKey *rp_key;
@@ -1101,7 +1101,7 @@ handle_issue_ticket_message (void *cls,
1101 1101
1102 ih = GNUNET_new (struct TicketIssueHandle); 1102 ih = GNUNET_new (struct TicketIssueHandle);
1103 attrs_len = ntohs (im->attr_len); 1103 attrs_len = ntohs (im->attr_len);
1104 ih->attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize ((char*)&im[1], attrs_len); 1104 ih->attrs = GNUNET_RECLAIM_ATTRIBUTE_list_deserialize ((char*)&im[1], attrs_len);
1105 ih->r_id = ntohl (im->id); 1105 ih->r_id = ntohl (im->id);
1106 ih->client = idp; 1106 ih->client = idp;
1107 ih->identity = im->identity; 1107 ih->identity = im->identity;
@@ -1132,9 +1132,9 @@ static void
1132cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh) 1132cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh)
1133{ 1133{
1134 if (NULL != rh->attrs) 1134 if (NULL != rh->attrs)
1135 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->attrs); 1135 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (rh->attrs);
1136 if (NULL != rh->rvk_attrs) 1136 if (NULL != rh->rvk_attrs)
1137 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->rvk_attrs); 1137 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (rh->rvk_attrs);
1138 if (NULL != rh->abe_key) 1138 if (NULL != rh->abe_key)
1139 GNUNET_ABE_cpabe_delete_master_key (rh->abe_key); 1139 GNUNET_ABE_cpabe_delete_master_key (rh->abe_key);
1140 if (NULL != rh->ns_qe) 1140 if (NULL != rh->ns_qe)
@@ -1157,9 +1157,12 @@ send_revocation_finished (struct TicketRevocationHandle *rh,
1157{ 1157{
1158 struct GNUNET_MQ_Envelope *env; 1158 struct GNUNET_MQ_Envelope *env;
1159 struct RevokeTicketResultMessage *trm; 1159 struct RevokeTicketResultMessage *trm;
1160
1161 GNUNET_break(TKT_database->delete_ticket (TKT_database->cls,
1162 &rh->ticket));
1160 1163
1161 env = GNUNET_MQ_msg (trm, 1164 env = GNUNET_MQ_msg (trm,
1162 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT); 1165 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT);
1163 trm->id = htonl (rh->r_id); 1166 trm->id = htonl (rh->r_id);
1164 trm->success = htonl (success); 1167 trm->success = htonl (success);
1165 GNUNET_MQ_send (rh->client->mq, 1168 GNUNET_MQ_send (rh->client->mq,
@@ -1179,8 +1182,8 @@ send_revocation_finished (struct TicketRevocationHandle *rh,
1179 */ 1182 */
1180static void 1183static void
1181ticket_reissue_proc (void *cls, 1184ticket_reissue_proc (void *cls,
1182 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1185 const struct GNUNET_RECLAIM_Ticket *ticket,
1183 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); 1186 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
1184 1187
1185static void 1188static void
1186revocation_reissue_tickets (struct TicketRevocationHandle *rh); 1189revocation_reissue_tickets (struct TicketRevocationHandle *rh);
@@ -1206,9 +1209,6 @@ reissue_ticket_cont (void *cls,
1206 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", 1209 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n",
1207 "Unknown Error\n"); 1210 "Unknown Error\n");
1208 send_revocation_finished (rh, GNUNET_SYSERR); 1211 send_revocation_finished (rh, GNUNET_SYSERR);
1209 GNUNET_CONTAINER_DLL_remove (rh->client->revoke_op_head,
1210 rh->client->revoke_op_tail,
1211 rh);
1212 cleanup_revoke_ticket_handle (rh); 1212 cleanup_revoke_ticket_handle (rh);
1213 return; 1213 return;
1214 } 1214 }
@@ -1226,12 +1226,12 @@ reissue_ticket_cont (void *cls,
1226 */ 1226 */
1227static void 1227static void
1228ticket_reissue_proc (void *cls, 1228ticket_reissue_proc (void *cls,
1229 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1229 const struct GNUNET_RECLAIM_Ticket *ticket,
1230 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 1230 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
1231{ 1231{
1232 struct TicketRevocationHandle *rh = cls; 1232 struct TicketRevocationHandle *rh = cls;
1233 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 1233 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
1234 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le_rollover; 1234 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le_rollover;
1235 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 1235 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
1236 struct GNUNET_GNSRECORD_Data code_record[1]; 1236 struct GNUNET_GNSRECORD_Data code_record[1];
1237 struct GNUNET_ABE_AbeKey *rp_key; 1237 struct GNUNET_ABE_AbeKey *rp_key;
@@ -1258,9 +1258,18 @@ ticket_reissue_proc (void *cls,
1258 { 1258 {
1259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1260 "Do not reissue for this identity.!\n"); 1260 "Do not reissue for this identity.!\n");
1261 1261 label = GNUNET_STRINGS_data_to_string_alloc (&rh->ticket.rnd,
1262 rh->offset++; 1262 sizeof (uint64_t));
1263 GNUNET_SCHEDULER_add_now (&reissue_next, rh); 1263 //Delete record
1264 rh->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle,
1265 &rh->identity,
1266 label,
1267 0,
1268 NULL,
1269 &reissue_ticket_cont,
1270 rh);
1271
1272 GNUNET_free (label);
1264 return; 1273 return;
1265 } 1274 }
1266 1275
@@ -1374,9 +1383,6 @@ revocation_reissue_tickets (struct TicketRevocationHandle *rh)
1374 if (GNUNET_NO == ret) 1383 if (GNUNET_NO == ret)
1375 { 1384 {
1376 send_revocation_finished (rh, GNUNET_OK); 1385 send_revocation_finished (rh, GNUNET_OK);
1377 GNUNET_CONTAINER_DLL_remove (rh->client->revoke_op_head,
1378 rh->client->revoke_op_tail,
1379 rh);
1380 cleanup_revoke_ticket_handle (rh); 1386 cleanup_revoke_ticket_handle (rh);
1381 return; 1387 return;
1382 } 1388 }
@@ -1391,10 +1397,8 @@ check_attr_error (void *cls)
1391 struct TicketRevocationHandle *rh = cls; 1397 struct TicketRevocationHandle *rh = cls;
1392 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1398 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1393 "Unable to check for existing attribute\n"); 1399 "Unable to check for existing attribute\n");
1400 rh->ns_qe = NULL;
1394 send_revocation_finished (rh, GNUNET_SYSERR); 1401 send_revocation_finished (rh, GNUNET_SYSERR);
1395 GNUNET_CONTAINER_DLL_remove (rh->client->revoke_op_head,
1396 rh->client->revoke_op_tail,
1397 rh);
1398 cleanup_revoke_ticket_handle (rh); 1402 cleanup_revoke_ticket_handle (rh);
1399} 1403}
1400 1404
@@ -1426,15 +1430,16 @@ check_attr_cb (void *cls,
1426 char* policy; 1430 char* policy;
1427 uint32_t attr_ver; 1431 uint32_t attr_ver;
1428 1432
1433 rh->ns_qe = NULL;
1429 if (1 != rd_count) { 1434 if (1 != rd_count) {
1430 GNUNET_SCHEDULER_add_now (&reenc_next_attribute, 1435 GNUNET_SCHEDULER_add_now (&reenc_next_attribute,
1431 rh); 1436 rh);
1432 return; 1437 return;
1433 } 1438 }
1434 1439
1435 buf_size = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (rh->attrs->list_head->claim); 1440 buf_size = GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (rh->attrs->list_head->claim);
1436 buf = GNUNET_malloc (buf_size); 1441 buf = GNUNET_malloc (buf_size);
1437 GNUNET_IDENTITY_ATTRIBUTE_serialize (rh->attrs->list_head->claim, 1442 GNUNET_RECLAIM_ATTRIBUTE_serialize (rh->attrs->list_head->claim,
1438 buf); 1443 buf);
1439 rh->attrs->list_head->claim->version++; 1444 rh->attrs->list_head->claim->version++;
1440 GNUNET_asprintf (&policy, "%s_%lu", 1445 GNUNET_asprintf (&policy, "%s_%lu",
@@ -1458,9 +1463,6 @@ check_attr_cb (void *cls,
1458 policy); 1463 policy);
1459 GNUNET_free (policy); 1464 GNUNET_free (policy);
1460 send_revocation_finished (rh, GNUNET_SYSERR); 1465 send_revocation_finished (rh, GNUNET_SYSERR);
1461 GNUNET_CONTAINER_DLL_remove (rh->client->revoke_op_head,
1462 rh->client->revoke_op_tail,
1463 rh);
1464 cleanup_revoke_ticket_handle (rh); 1466 cleanup_revoke_ticket_handle (rh);
1465 return; 1467 return;
1466 } 1468 }
@@ -1525,8 +1527,9 @@ attr_reenc_cont (void *cls,
1525 const char *emsg) 1527 const char *emsg)
1526{ 1528{
1527 struct TicketRevocationHandle *rh = cls; 1529 struct TicketRevocationHandle *rh = cls;
1528 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 1530 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
1529 1531
1532 rh->ns_qe = NULL;
1530 if (GNUNET_SYSERR == success) 1533 if (GNUNET_SYSERR == success)
1531 { 1534 {
1532 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1535 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1558,12 +1561,12 @@ attr_reenc_cont (void *cls,
1558 1561
1559static void 1562static void
1560process_attributes_to_update (void *cls, 1563process_attributes_to_update (void *cls,
1561 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1564 const struct GNUNET_RECLAIM_Ticket *ticket,
1562 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 1565 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
1563{ 1566{
1564 struct TicketRevocationHandle *rh = cls; 1567 struct TicketRevocationHandle *rh = cls;
1565 1568
1566 rh->attrs = GNUNET_IDENTITY_ATTRIBUTE_list_dup (attrs); 1569 rh->attrs = GNUNET_RECLAIM_ATTRIBUTE_list_dup (attrs);
1567 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1570 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1568 "Revocation Phase I: Collecting attributes\n"); 1571 "Revocation Phase I: Collecting attributes\n");
1569 /* Reencrypt all attributes with new key */ 1572 /* Reencrypt all attributes with new key */
@@ -1571,9 +1574,6 @@ process_attributes_to_update (void *cls,
1571 { 1574 {
1572 /* No attributes to reencrypt */ 1575 /* No attributes to reencrypt */
1573 send_revocation_finished (rh, GNUNET_OK); 1576 send_revocation_finished (rh, GNUNET_OK);
1574 GNUNET_CONTAINER_DLL_remove (rh->client->revoke_op_head,
1575 rh->client->revoke_op_tail,
1576 rh);
1577 cleanup_revoke_ticket_handle (rh); 1577 cleanup_revoke_ticket_handle (rh);
1578 return; 1578 return;
1579 } else { 1579 } else {
@@ -1621,11 +1621,11 @@ handle_revoke_ticket_message (void *cls,
1621{ 1621{
1622 struct TicketRevocationHandle *rh; 1622 struct TicketRevocationHandle *rh;
1623 struct IdpClient *idp = cls; 1623 struct IdpClient *idp = cls;
1624 struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket; 1624 struct GNUNET_RECLAIM_Ticket *ticket;
1625 1625
1626 rh = GNUNET_new (struct TicketRevocationHandle); 1626 rh = GNUNET_new (struct TicketRevocationHandle);
1627 ticket = (struct GNUNET_IDENTITY_PROVIDER_Ticket*)&rm[1]; 1627 ticket = (struct GNUNET_RECLAIM_Ticket*)&rm[1];
1628 rh->rvk_attrs = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 1628 rh->rvk_attrs = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
1629 rh->ticket = *ticket; 1629 rh->ticket = *ticket;
1630 rh->r_id = ntohl (rm->id); 1630 rh->r_id = ntohl (rm->id);
1631 rh->client = idp; 1631 rh->client = idp;
@@ -1667,7 +1667,7 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle)
1667 GNUNET_ABE_cpabe_delete_key (handle->key, 1667 GNUNET_ABE_cpabe_delete_key (handle->key,
1668 GNUNET_YES); 1668 GNUNET_YES);
1669 if (NULL != handle->attrs) 1669 if (NULL != handle->attrs)
1670 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); 1670 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (handle->attrs);
1671 GNUNET_free (handle); 1671 GNUNET_free (handle);
1672} 1672}
1673 1673
@@ -1698,7 +1698,7 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1698 struct ConsumeTicketHandle *handle = parallel_lookup->handle; 1698 struct ConsumeTicketHandle *handle = parallel_lookup->handle;
1699 struct ConsumeTicketResultMessage *crm; 1699 struct ConsumeTicketResultMessage *crm;
1700 struct GNUNET_MQ_Envelope *env; 1700 struct GNUNET_MQ_Envelope *env;
1701 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *attr_le; 1701 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *attr_le;
1702 struct GNUNET_TIME_Absolute decrypt_duration; 1702 struct GNUNET_TIME_Absolute decrypt_duration;
1703 char *data; 1703 char *data;
1704 char *data_tmp; 1704 char *data_tmp;
@@ -1741,8 +1741,8 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1741 1, 1741 1,
1742 GNUNET_YES); 1742 GNUNET_YES);
1743 1743
1744 attr_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 1744 attr_le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
1745 attr_le->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize (data, 1745 attr_le->claim = GNUNET_RECLAIM_ATTRIBUTE_deserialize (data,
1746 attr_len); 1746 attr_len);
1747 attr_le->claim->version = ntohl(*(uint32_t*)rd->data); 1747 attr_le->claim->version = ntohl(*(uint32_t*)rd->data);
1748 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head, 1748 GNUNET_CONTAINER_DLL_insert (handle->attrs->list_head,
@@ -1766,15 +1766,15 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
1766 } 1766 }
1767 1767
1768 GNUNET_SCHEDULER_cancel (handle->kill_task); 1768 GNUNET_SCHEDULER_cancel (handle->kill_task);
1769 attrs_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (handle->attrs); 1769 attrs_len = GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (handle->attrs);
1770 env = GNUNET_MQ_msg_extra (crm, 1770 env = GNUNET_MQ_msg_extra (crm,
1771 attrs_len, 1771 attrs_len,
1772 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT); 1772 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT);
1773 crm->id = htonl (handle->r_id); 1773 crm->id = htonl (handle->r_id);
1774 crm->attrs_len = htons (attrs_len); 1774 crm->attrs_len = htons (attrs_len);
1775 crm->identity = handle->ticket.identity; 1775 crm->identity = handle->ticket.identity;
1776 data_tmp = (char *) &crm[1]; 1776 data_tmp = (char *) &crm[1];
1777 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (handle->attrs, 1777 GNUNET_RECLAIM_ATTRIBUTE_list_serialize (handle->attrs,
1778 data_tmp); 1778 data_tmp);
1779 GNUNET_MQ_send (handle->client->mq, env); 1779 GNUNET_MQ_send (handle->client->mq, env);
1780 GNUNET_CONTAINER_DLL_remove (handle->client->consume_op_head, 1780 GNUNET_CONTAINER_DLL_remove (handle->client->consume_op_head,
@@ -1805,7 +1805,7 @@ abort_parallel_lookups2 (void *cls)
1805 lu = tmp; 1805 lu = tmp;
1806 } 1806 }
1807 env = GNUNET_MQ_msg (arm, 1807 env = GNUNET_MQ_msg (arm,
1808 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT); 1808 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
1809 arm->id = htonl (handle->r_id); 1809 arm->id = htonl (handle->r_id);
1810 arm->attr_len = htons (0); 1810 arm->attr_len = htons (0);
1811 GNUNET_MQ_send (handle->client->mq, env); 1811 GNUNET_MQ_send (handle->client->mq, env);
@@ -1918,10 +1918,10 @@ handle_consume_ticket_message (void *cls,
1918 ch->r_id = ntohl (cm->id); 1918 ch->r_id = ntohl (cm->id);
1919 ch->client = idp; 1919 ch->client = idp;
1920 ch->identity = cm->identity; 1920 ch->identity = cm->identity;
1921 ch->attrs = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 1921 ch->attrs = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
1922 GNUNET_CRYPTO_ecdsa_key_get_public (&ch->identity, 1922 GNUNET_CRYPTO_ecdsa_key_get_public (&ch->identity,
1923 &ch->identity_pub); 1923 &ch->identity_pub);
1924 ch->ticket = *((struct GNUNET_IDENTITY_PROVIDER_Ticket*)&cm[1]); 1924 ch->ticket = *((struct GNUNET_RECLAIM_Ticket*)&cm[1]);
1925 rnd_label = GNUNET_STRINGS_data_to_string_alloc (&ch->ticket.rnd, 1925 rnd_label = GNUNET_STRINGS_data_to_string_alloc (&ch->ticket.rnd,
1926 sizeof (uint64_t)); 1926 sizeof (uint64_t));
1927 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1927 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1967,7 +1967,7 @@ attr_store_cont (void *cls,
1967 struct AttributeStoreHandle *as_handle = cls; 1967 struct AttributeStoreHandle *as_handle = cls;
1968 struct GNUNET_MQ_Envelope *env; 1968 struct GNUNET_MQ_Envelope *env;
1969 struct AttributeStoreResultMessage *acr_msg; 1969 struct AttributeStoreResultMessage *acr_msg;
1970 1970
1971 as_handle->ns_qe = NULL; 1971 as_handle->ns_qe = NULL;
1972 GNUNET_CONTAINER_DLL_remove (as_handle->client->store_op_head, 1972 GNUNET_CONTAINER_DLL_remove (as_handle->client->store_op_head,
1973 as_handle->client->store_op_tail, 1973 as_handle->client->store_op_tail,
@@ -1986,7 +1986,7 @@ attr_store_cont (void *cls,
1986 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1986 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1987 "Sending ATTRIBUTE_STORE_RESPONSE message\n"); 1987 "Sending ATTRIBUTE_STORE_RESPONSE message\n");
1988 env = GNUNET_MQ_msg (acr_msg, 1988 env = GNUNET_MQ_msg (acr_msg,
1989 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE_RESPONSE); 1989 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE_RESPONSE);
1990 acr_msg->id = htonl (as_handle->r_id); 1990 acr_msg->id = htonl (as_handle->r_id);
1991 acr_msg->op_result = htonl (GNUNET_OK); 1991 acr_msg->op_result = htonl (GNUNET_OK);
1992 GNUNET_MQ_send (as_handle->client->mq, 1992 GNUNET_MQ_send (as_handle->client->mq,
@@ -2009,10 +2009,10 @@ attr_store_task (void *cls)
2009 2009
2010 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2010 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2011 "Storing attribute\n"); 2011 "Storing attribute\n");
2012 buf_size = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (as_handle->claim); 2012 buf_size = GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (as_handle->claim);
2013 buf = GNUNET_malloc (buf_size); 2013 buf = GNUNET_malloc (buf_size);
2014 2014
2015 GNUNET_IDENTITY_ATTRIBUTE_serialize (as_handle->claim, 2015 GNUNET_RECLAIM_ATTRIBUTE_serialize (as_handle->claim,
2016 buf); 2016 buf);
2017 2017
2018 GNUNET_asprintf (&policy, 2018 GNUNET_asprintf (&policy,
@@ -2111,7 +2111,7 @@ handle_attribute_store_message (void *cls,
2111 data_len = ntohs (sam->attr_len); 2111 data_len = ntohs (sam->attr_len);
2112 2112
2113 as_handle = GNUNET_new (struct AttributeStoreHandle); 2113 as_handle = GNUNET_new (struct AttributeStoreHandle);
2114 as_handle->claim = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&sam[1], 2114 as_handle->claim = GNUNET_RECLAIM_ATTRIBUTE_deserialize ((char*)&sam[1],
2115 data_len); 2115 data_len);
2116 2116
2117 as_handle->r_id = ntohl (sam->id); 2117 as_handle->r_id = ntohl (sam->id);
@@ -2158,7 +2158,7 @@ attr_iter_finished (void *cls)
2158 struct AttributeResultMessage *arm; 2158 struct AttributeResultMessage *arm;
2159 2159
2160 env = GNUNET_MQ_msg (arm, 2160 env = GNUNET_MQ_msg (arm,
2161 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT); 2161 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
2162 arm->id = htonl (ai->request_id); 2162 arm->id = htonl (ai->request_id);
2163 arm->attr_len = htons (0); 2163 arm->attr_len = htons (0);
2164 GNUNET_MQ_send (ai->client->mq, env); 2164 GNUNET_MQ_send (ai->client->mq, env);
@@ -2189,14 +2189,14 @@ attr_iter_cb (void *cls,
2189 if (rd_count != 1) 2189 if (rd_count != 1)
2190 { 2190 {
2191 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 2191 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it,
2192 1); 2192 1);
2193 return; 2193 return;
2194 } 2194 }
2195 2195
2196 if (GNUNET_GNSRECORD_TYPE_ID_ATTR != rd->record_type) 2196 if (GNUNET_GNSRECORD_TYPE_ID_ATTR != rd->record_type)
2197 { 2197 {
2198 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 2198 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it,
2199 1); 2199 1);
2200 return; 2200 return;
2201 } 2201 }
2202 attr_ver = ntohl(*((uint32_t*)rd->data)); 2202 attr_ver = ntohl(*((uint32_t*)rd->data));
@@ -2213,7 +2213,7 @@ attr_iter_cb (void *cls,
2213 if (GNUNET_SYSERR == msg_extra_len) 2213 if (GNUNET_SYSERR == msg_extra_len)
2214 { 2214 {
2215 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 2215 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it,
2216 1); 2216 1);
2217 return; 2217 return;
2218 } 2218 }
2219 2219
@@ -2224,7 +2224,7 @@ attr_iter_cb (void *cls,
2224 "Found attribute: %s\n", label); 2224 "Found attribute: %s\n", label);
2225 env = GNUNET_MQ_msg_extra (arm, 2225 env = GNUNET_MQ_msg_extra (arm,
2226 msg_extra_len, 2226 msg_extra_len,
2227 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT); 2227 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
2228 arm->id = htonl (ai->request_id); 2228 arm->id = htonl (ai->request_id);
2229 arm->attr_len = htons (msg_extra_len); 2229 arm->attr_len = htons (msg_extra_len);
2230 GNUNET_CRYPTO_ecdsa_key_get_public (zone, 2230 GNUNET_CRYPTO_ecdsa_key_get_public (zone,
@@ -2264,7 +2264,7 @@ iterate_next_after_abe_bootstrap (void *cls,
2264 struct AttributeIterator *ai = cls; 2264 struct AttributeIterator *ai = cls;
2265 ai->abe_key = abe_key; 2265 ai->abe_key = abe_key;
2266 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 2266 GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it,
2267 1); 2267 1);
2268} 2268}
2269 2269
2270 2270
@@ -2406,8 +2406,8 @@ cleanup_ticket_iter_handle (struct TicketIteration *ti)
2406 */ 2406 */
2407static void 2407static void
2408ticket_iterate_proc (void *cls, 2408ticket_iterate_proc (void *cls,
2409 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 2409 const struct GNUNET_RECLAIM_Ticket *ticket,
2410 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 2410 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
2411{ 2411{
2412 struct TicketIterationProcResult *proc = cls; 2412 struct TicketIterationProcResult *proc = cls;
2413 2413
@@ -2467,7 +2467,7 @@ run_ticket_iteration_round (struct TicketIteration *ti)
2467 } 2467 }
2468 /* send empty response to indicate end of list */ 2468 /* send empty response to indicate end of list */
2469 env = GNUNET_MQ_msg (trm, 2469 env = GNUNET_MQ_msg (trm,
2470 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT); 2470 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT);
2471 trm->id = htonl (ti->r_id); 2471 trm->id = htonl (ti->r_id);
2472 GNUNET_MQ_send (ti->client->mq, 2472 GNUNET_MQ_send (ti->client->mq,
2473 env); 2473 env);
@@ -2572,7 +2572,7 @@ run (void *cls,
2572 char *database; 2572 char *database;
2573 cfg = c; 2573 cfg = c;
2574 2574
2575 stats = GNUNET_STATISTICS_create ("identity-provider", cfg); 2575 stats = GNUNET_STATISTICS_create ("reclaim", cfg);
2576 2576
2577 //Connect to identity and namestore services 2577 //Connect to identity and namestore services
2578 ns_handle = GNUNET_NAMESTORE_connect (cfg); 2578 ns_handle = GNUNET_NAMESTORE_connect (cfg);
@@ -2597,13 +2597,13 @@ run (void *cls,
2597 /* Loading DB plugin */ 2597 /* Loading DB plugin */
2598 if (GNUNET_OK != 2598 if (GNUNET_OK !=
2599 GNUNET_CONFIGURATION_get_value_string (cfg, 2599 GNUNET_CONFIGURATION_get_value_string (cfg,
2600 "identity-provider", 2600 "reclaim",
2601 "database", 2601 "database",
2602 &database)) 2602 &database))
2603 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2603 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2604 "No database backend configured\n"); 2604 "No database backend configured\n");
2605 GNUNET_asprintf (&db_lib_name, 2605 GNUNET_asprintf (&db_lib_name,
2606 "libgnunet_plugin_identity_provider_%s", 2606 "libgnunet_plugin_reclaim_%s",
2607 database); 2607 database);
2608 TKT_database = GNUNET_PLUGIN_load (db_lib_name, 2608 TKT_database = GNUNET_PLUGIN_load (db_lib_name,
2609 (void *) cfg); 2609 (void *) cfg);
@@ -2619,7 +2619,7 @@ run (void *cls,
2619 2619
2620 if (GNUNET_OK == 2620 if (GNUNET_OK ==
2621 GNUNET_CONFIGURATION_get_value_time (cfg, 2621 GNUNET_CONFIGURATION_get_value_time (cfg,
2622 "identity-provider", 2622 "reclaim",
2623 "TOKEN_EXPIRATION_INTERVAL", 2623 "TOKEN_EXPIRATION_INTERVAL",
2624 &token_expiration_interval)) 2624 &token_expiration_interval))
2625 { 2625 {
@@ -2736,51 +2736,51 @@ client_connect_cb (void *cls,
2736 * Define "main" method using service macro. 2736 * Define "main" method using service macro.
2737 */ 2737 */
2738GNUNET_SERVICE_MAIN 2738GNUNET_SERVICE_MAIN
2739("identity-provider", 2739("reclaim",
2740 GNUNET_SERVICE_OPTION_NONE, 2740 GNUNET_SERVICE_OPTION_NONE,
2741 &run, 2741 &run,
2742 &client_connect_cb, 2742 &client_connect_cb,
2743 &client_disconnect_cb, 2743 &client_disconnect_cb,
2744 NULL, 2744 NULL,
2745 GNUNET_MQ_hd_var_size (attribute_store_message, 2745 GNUNET_MQ_hd_var_size (attribute_store_message,
2746 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE, 2746 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE,
2747 struct AttributeStoreMessage, 2747 struct AttributeStoreMessage,
2748 NULL), 2748 NULL),
2749 GNUNET_MQ_hd_fixed_size (iteration_start, 2749 GNUNET_MQ_hd_fixed_size (iteration_start,
2750 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_START, 2750 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START,
2751 struct AttributeIterationStartMessage, 2751 struct AttributeIterationStartMessage,
2752 NULL), 2752 NULL),
2753 GNUNET_MQ_hd_fixed_size (iteration_next, 2753 GNUNET_MQ_hd_fixed_size (iteration_next,
2754 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT, 2754 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT,
2755 struct AttributeIterationNextMessage, 2755 struct AttributeIterationNextMessage,
2756 NULL), 2756 NULL),
2757 GNUNET_MQ_hd_fixed_size (iteration_stop, 2757 GNUNET_MQ_hd_fixed_size (iteration_stop,
2758 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP, 2758 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP,
2759 struct AttributeIterationStopMessage, 2759 struct AttributeIterationStopMessage,
2760 NULL), 2760 NULL),
2761 GNUNET_MQ_hd_var_size (issue_ticket_message, 2761 GNUNET_MQ_hd_var_size (issue_ticket_message,
2762 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET, 2762 GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET,
2763 struct IssueTicketMessage, 2763 struct IssueTicketMessage,
2764 NULL), 2764 NULL),
2765 GNUNET_MQ_hd_var_size (consume_ticket_message, 2765 GNUNET_MQ_hd_var_size (consume_ticket_message,
2766 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET, 2766 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET,
2767 struct ConsumeTicketMessage, 2767 struct ConsumeTicketMessage,
2768 NULL), 2768 NULL),
2769 GNUNET_MQ_hd_fixed_size (ticket_iteration_start, 2769 GNUNET_MQ_hd_fixed_size (ticket_iteration_start,
2770 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START, 2770 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START,
2771 struct TicketIterationStartMessage, 2771 struct TicketIterationStartMessage,
2772 NULL), 2772 NULL),
2773 GNUNET_MQ_hd_fixed_size (ticket_iteration_next, 2773 GNUNET_MQ_hd_fixed_size (ticket_iteration_next,
2774 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT, 2774 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT,
2775 struct TicketIterationNextMessage, 2775 struct TicketIterationNextMessage,
2776 NULL), 2776 NULL),
2777 GNUNET_MQ_hd_fixed_size (ticket_iteration_stop, 2777 GNUNET_MQ_hd_fixed_size (ticket_iteration_stop,
2778 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP, 2778 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP,
2779 struct TicketIterationStopMessage, 2779 struct TicketIterationStopMessage,
2780 NULL), 2780 NULL),
2781 GNUNET_MQ_hd_var_size (revoke_ticket_message, 2781 GNUNET_MQ_hd_var_size (revoke_ticket_message,
2782 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET, 2782 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET,
2783 struct RevokeTicketMessage, 2783 struct RevokeTicketMessage,
2784 NULL), 2784 NULL),
2785 GNUNET_MQ_handler_end()); 2785 GNUNET_MQ_handler_end());
2786/* end of gnunet-service-identity-provider.c */ 2786/* end of gnunet-service-reclaim.c */
diff --git a/src/reclaim/jwt.c b/src/reclaim/jwt.c
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/src/reclaim/jwt.c
@@ -0,0 +1 @@
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
new file mode 100644
index 000000000..1e9e64fec
--- /dev/null
+++ b/src/reclaim/oidc_helper.c
@@ -0,0 +1,440 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2010-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
19/**
20 * @file reclaim/oidc_helper.c
21 * @brief helper library for OIDC related functions
22 * @author Martin Schanzenbach
23 */
24#include "platform.h"
25#include "gnunet_util_lib.h"
26#include "gnunet_signatures.h"
27#include "gnunet_reclaim_service.h"
28#include "gnunet_reclaim_attribute_lib.h"
29#include <jansson.h>
30#include <inttypes.h>
31#include "oidc_helper.h"
32
33static char*
34create_jwt_header(void)
35{
36 json_t *root;
37 char *json_str;
38
39 root = json_object ();
40 json_object_set_new (root, JWT_ALG, json_string (JWT_ALG_VALUE));
41 json_object_set_new (root, JWT_TYP, json_string (JWT_TYP_VALUE));
42
43 json_str = json_dumps (root, JSON_INDENT(0) | JSON_COMPACT);
44 json_decref (root);
45 return json_str;
46}
47
48static void
49replace_char(char* str, char find, char replace){
50 char *current_pos = strchr(str,find);
51 while (current_pos){
52 *current_pos = replace;
53 current_pos = strchr(current_pos,find);
54 }
55}
56
57//RFC4648
58static void
59fix_base64(char* str) {
60 char *padding;
61 //First, remove trailing padding '='
62 padding = strtok(str, "=");
63 while (NULL != padding)
64 padding = strtok(NULL, "=");
65
66 //Replace + with -
67 replace_char (str, '+', '-');
68
69 //Replace / with _
70 replace_char (str, '/', '_');
71
72}
73
74/**
75 * Create a JWT from attributes
76 *
77 * @param aud_key the public of the audience
78 * @param sub_key the public key of the subject
79 * @param attrs the attribute list
80 * @param expiration_time the validity of the token
81 * @param secret_key the key used to sign the JWT
82 * @return a new base64-encoded JWT string.
83 */
84char*
85OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
86 const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
87 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
88 const struct GNUNET_TIME_Relative *expiration_time,
89 const char *nonce,
90 const char *secret_key)
91{
92 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
93 struct GNUNET_HashCode signature;
94 struct GNUNET_TIME_Absolute exp_time;
95 struct GNUNET_TIME_Absolute time_now;
96 char* audience;
97 char* subject;
98 char* header;
99 char* body_str;
100 char* result;
101 char* header_base64;
102 char* body_base64;
103 char* signature_target;
104 char* signature_base64;
105 char* attr_val_str;
106 json_t* body;
107
108 //iat REQUIRED time now
109 time_now = GNUNET_TIME_absolute_get();
110 //exp REQUIRED time expired from config
111 exp_time = GNUNET_TIME_absolute_add (time_now, *expiration_time);
112 //auth_time only if max_age
113 //nonce only if nonce
114 // OPTIONAL acr,amr,azp
115 subject = GNUNET_STRINGS_data_to_string_alloc (sub_key,
116 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
117 audience = GNUNET_STRINGS_data_to_string_alloc (aud_key,
118 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
119 header = create_jwt_header ();
120 body = json_object ();
121
122 //iss REQUIRED case sensitive server uri with https
123 //The issuer is the local reclaim instance (e.g. https://reclaim.id/api/openid)
124 json_object_set_new (body,
125 "iss", json_string (SERVER_ADDRESS));
126 //sub REQUIRED public key identity, not exceed 255 ASCII length
127 json_object_set_new (body,
128 "sub", json_string (subject));
129 //aud REQUIRED public key client_id must be there
130 json_object_set_new (body,
131 "aud", json_string (audience));
132 //iat
133 json_object_set_new (body,
134 "iat", json_integer (time_now.abs_value_us / (1000*1000)));
135 //exp
136 json_object_set_new (body,
137 "exp", json_integer (exp_time.abs_value_us / (1000*1000)));
138 //nbf
139 json_object_set_new (body,
140 "nbf", json_integer (time_now.abs_value_us / (1000*1000)));
141 //nonce
142 if (NULL != nonce)
143 json_object_set_new (body,
144 "nonce", json_string (nonce));
145
146 for (le = attrs->list_head; NULL != le; le = le->next)
147 {
148 attr_val_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (le->claim->type,
149 le->claim->data,
150 le->claim->data_size);
151 json_object_set_new (body,
152 le->claim->name,
153 json_string (attr_val_str));
154 GNUNET_free (attr_val_str);
155 }
156 body_str = json_dumps (body, JSON_INDENT(0) | JSON_COMPACT);
157 json_decref (body);
158
159 GNUNET_STRINGS_base64_encode (header,
160 strlen (header),
161 &header_base64);
162 fix_base64(header_base64);
163
164 GNUNET_STRINGS_base64_encode (body_str,
165 strlen (body_str),
166 &body_base64);
167 fix_base64(body_base64);
168
169 GNUNET_free (subject);
170 GNUNET_free (audience);
171
172 /**
173 * Creating the JWT signature. This might not be
174 * standards compliant, check.
175 */
176 GNUNET_asprintf (&signature_target, "%s.%s", header_base64, body_base64);
177 GNUNET_CRYPTO_hmac_raw (secret_key, strlen (secret_key), signature_target, strlen (signature_target), &signature);
178 GNUNET_STRINGS_base64_encode ((const char*)&signature,
179 sizeof (struct GNUNET_HashCode),
180 &signature_base64);
181 fix_base64(signature_base64);
182
183 GNUNET_asprintf (&result, "%s.%s.%s",
184 header_base64, body_base64, signature_base64);
185
186 GNUNET_free (signature_target);
187 GNUNET_free (header);
188 GNUNET_free (body_str);
189 GNUNET_free (signature_base64);
190 GNUNET_free (body_base64);
191 GNUNET_free (header_base64);
192 return result;
193}
194/**
195 * Builds an OIDC authorization code including
196 * a reclaim ticket and nonce
197 *
198 * @param issuer the issuer of the ticket, used to sign the ticket and nonce
199 * @param ticket the ticket to include in the code
200 * @param nonce the nonce to include in the code
201 * @return a new authorization code (caller must free)
202 */
203char*
204OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
205 const struct GNUNET_RECLAIM_Ticket *ticket,
206 const char* nonce)
207{
208 char *ticket_str;
209 json_t *code_json;
210 char *signature_payload;
211 char *signature_str;
212 char *authz_code;
213 size_t signature_payload_len;
214 struct GNUNET_CRYPTO_EcdsaSignature signature;
215 struct GNUNET_CRYPTO_EccSignaturePurpose *purpose;
216
217 signature_payload_len = sizeof (struct GNUNET_RECLAIM_Ticket);
218 if (NULL != nonce)
219 signature_payload_len += strlen (nonce);
220
221 signature_payload = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + signature_payload_len);
222 purpose = (struct GNUNET_CRYPTO_EccSignaturePurpose *)signature_payload;
223 purpose->size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + signature_payload_len);
224 purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN);
225 memcpy (&purpose[1],
226 ticket,
227 sizeof (struct GNUNET_RECLAIM_Ticket));
228 if (NULL != nonce)
229 memcpy (((char*)&purpose[1]) + sizeof (struct GNUNET_RECLAIM_Ticket),
230 nonce,
231 strlen (nonce));
232 if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (issuer,
233 purpose,
234 &signature))
235 {
236 GNUNET_free (signature_payload);
237 return NULL;
238 }
239 signature_str = GNUNET_STRINGS_data_to_string_alloc (&signature,
240 sizeof (signature));
241 ticket_str = GNUNET_STRINGS_data_to_string_alloc (ticket,
242 sizeof (struct GNUNET_RECLAIM_Ticket));
243
244 code_json = json_object ();
245 json_object_set_new (code_json,
246 "ticket",
247 json_string (ticket_str));
248 if (NULL != nonce)
249 json_object_set_new (code_json,
250 "nonce",
251 json_string (nonce));
252 json_object_set_new (code_json,
253 "signature",
254 json_string (signature_str));
255 authz_code = json_dumps (code_json,
256 JSON_INDENT(0) | JSON_COMPACT);
257 GNUNET_free (signature_payload);
258 GNUNET_free (signature_str);
259 GNUNET_free (ticket_str);
260 json_decref (code_json);
261 return authz_code;
262}
263
264
265
266
267/**
268 * Parse reclaim ticket and nonce from
269 * authorization code.
270 * This also verifies the signature in the code.
271 *
272 * @param audience the expected audience of the code
273 * @param code the string representation of the code
274 * @param ticket where to store the ticket
275 * @param nonce where to store the nonce
276 * @return GNUNET_OK if successful, else GNUNET_SYSERR
277 */
278int
279OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
280 const char* code,
281 struct GNUNET_RECLAIM_Ticket **ticket,
282 char **nonce)
283{
284 json_error_t error;
285 json_t *code_json;
286 json_t *ticket_json;
287 json_t *nonce_json;
288 json_t *signature_json;
289 const char *ticket_str;
290 const char *signature_str;
291 const char *nonce_str;
292 char *code_output;
293 struct GNUNET_CRYPTO_EccSignaturePurpose *purpose;
294 struct GNUNET_CRYPTO_EcdsaSignature signature;
295 size_t signature_payload_len;
296
297 code_output = NULL;
298 GNUNET_STRINGS_base64_decode (code,
299 strlen(code),
300 (void**)&code_output);
301 code_json = json_loads (code_output, 0 , &error);
302 GNUNET_free (code_output);
303 ticket_json = json_object_get (code_json, "ticket");
304 nonce_json = json_object_get (code_json, "nonce");
305 signature_json = json_object_get (code_json, "signature");
306 *ticket = NULL;
307 *nonce = NULL;
308
309 if ((NULL == ticket_json || !json_is_string (ticket_json)) ||
310 (NULL == signature_json || !json_is_string (signature_json)))
311 {
312 json_decref (code_json);
313 return GNUNET_SYSERR;
314 }
315 ticket_str = json_string_value (ticket_json);
316 signature_str = json_string_value (signature_json);
317 nonce_str = NULL;
318 if (NULL != nonce_json)
319 nonce_str = json_string_value (nonce_json);
320 signature_payload_len = sizeof (struct GNUNET_RECLAIM_Ticket);
321 if (NULL != nonce_str)
322 signature_payload_len += strlen (nonce_str);
323 purpose = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
324 signature_payload_len);
325 purpose->size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + signature_payload_len);
326 purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN);
327 if (GNUNET_OK != GNUNET_STRINGS_string_to_data (ticket_str,
328 strlen (ticket_str),
329 &purpose[1],
330 sizeof (struct GNUNET_RECLAIM_Ticket)))
331 {
332 GNUNET_free (purpose);
333 json_decref (code_json);
334 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
335 "Cannot parse ticket!\n");
336 return GNUNET_SYSERR;
337 }
338 if (GNUNET_OK != GNUNET_STRINGS_string_to_data (signature_str,
339 strlen (signature_str),
340 &signature,
341 sizeof (struct GNUNET_CRYPTO_EcdsaSignature)))
342 {
343 GNUNET_free (purpose);
344 json_decref (code_json);
345 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
346 "Cannot parse signature!\n");
347 return GNUNET_SYSERR;
348 }
349 *ticket = GNUNET_new (struct GNUNET_RECLAIM_Ticket);
350 memcpy (*ticket,
351 &purpose[1],
352 sizeof (struct GNUNET_RECLAIM_Ticket));
353 if (0 != memcmp (audience,
354 &(*ticket)->audience,
355 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
356 {
357 GNUNET_free (purpose);
358 GNUNET_free (*ticket);
359 json_decref (code_json);
360 *ticket = NULL;
361 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
362 "Audience in ticket does not match client!\n");
363 return GNUNET_SYSERR;
364
365 }
366 if (NULL != nonce_str)
367 memcpy (((char*)&purpose[1]) + sizeof (struct GNUNET_RECLAIM_Ticket),
368 nonce_str,
369 strlen (nonce_str));
370 if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN,
371 purpose,
372 &signature,
373 &(*ticket)->identity))
374 {
375 GNUNET_free (purpose);
376 GNUNET_free (*ticket);
377 json_decref (code_json);
378 *ticket = NULL;
379 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
380 "Signature of authZ code invalid!\n");
381 return GNUNET_SYSERR;
382 }
383 *nonce = GNUNET_strdup (nonce_str);
384 return GNUNET_OK;
385}
386
387/**
388 * Build a token response for a token request
389 * TODO: Maybe we should add the scope here?
390 *
391 * @param access_token the access token to include
392 * @param id_token the id_token to include
393 * @param expiration_time the expiration time of the token(s)
394 * @param token_response where to store the response
395 */
396void
397OIDC_build_token_response (const char *access_token,
398 const char *id_token,
399 const struct GNUNET_TIME_Relative *expiration_time,
400 char **token_response)
401{
402 json_t *root_json;
403
404 root_json = json_object ();
405
406 GNUNET_assert (NULL != access_token);
407 GNUNET_assert (NULL != id_token);
408 GNUNET_assert (NULL != expiration_time);
409 json_object_set_new (root_json,
410 "access_token",
411 json_string (access_token));
412 json_object_set_new (root_json,
413 "token_type",
414 json_string ("Bearer"));
415 json_object_set_new (root_json,
416 "expires_in",
417 json_integer (expiration_time->rel_value_us / (1000 * 1000)));
418 json_object_set_new (root_json,
419 "id_token",
420 json_string (id_token));
421 *token_response = json_dumps (root_json,
422 JSON_INDENT(0) | JSON_COMPACT);
423 json_decref (root_json);
424}
425
426/**
427 * Generate a new access token
428 */
429char*
430OIDC_access_token_new ()
431{
432 char* access_token_number;
433 char* access_token;
434 uint64_t random_number;
435
436 random_number = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_NONCE, UINT64_MAX);
437 GNUNET_asprintf (&access_token_number, "%" PRIu64, random_number);
438 GNUNET_STRINGS_base64_encode(access_token_number,strlen(access_token_number),&access_token);
439 return access_token;
440}
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h
new file mode 100644
index 000000000..7a0f45bf9
--- /dev/null
+++ b/src/reclaim/oidc_helper.h
@@ -0,0 +1,109 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2010-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
19/**
20 * @file reclaim/oidc_helper.h
21 * @brief helper library for OIDC related functions
22 * @author Martin Schanzenbach
23 */
24
25#ifndef JWT_H
26#define JWT_H
27
28#define JWT_ALG "alg"
29
30/* Use 512bit HMAC */
31#define JWT_ALG_VALUE "HS512"
32
33#define JWT_TYP "typ"
34
35#define JWT_TYP_VALUE "jwt"
36
37#define SERVER_ADDRESS "https://reclaim.id"
38
39/**
40 * Create a JWT from attributes
41 *
42 * @param aud_key the public of the audience
43 * @param sub_key the public key of the subject
44 * @param attrs the attribute list
45 * @param expiration_time the validity of the token
46 * @param secret_key the key used to sign the JWT
47 * @return a new base64-encoded JWT string.
48 */
49char*
50OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
51 const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
52 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
53 const struct GNUNET_TIME_Relative *expiration_time,
54 const char *nonce,
55 const char *secret_key);
56
57/**
58 * Builds an OIDC authorization code including
59 * a reclaim ticket and nonce
60 *
61 * @param issuer the issuer of the ticket, used to sign the ticket and nonce
62 * @param ticket the ticket to include in the code
63 * @param nonce the nonce to include in the code
64 * @return a new authorization code (caller must free)
65 */
66char*
67OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
68 const struct GNUNET_RECLAIM_Ticket *ticket,
69 const char* nonce);
70
71/**
72 * Parse reclaim ticket and nonce from
73 * authorization code.
74 * This also verifies the signature in the code.
75 *
76 * @param audience the expected audience of the code
77 * @param code the string representation of the code
78 * @param ticket where to store the ticket
79 * @param nonce where to store the nonce
80 * @return GNUNET_OK if successful, else GNUNET_SYSERR
81 */
82int
83OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
84 const char* code,
85 struct GNUNET_RECLAIM_Ticket **ticket,
86 char **nonce);
87
88/**
89 * Build a token response for a token request
90 * TODO: Maybe we should add the scope here?
91 *
92 * @param access_token the access token to include
93 * @param id_token the id_token to include
94 * @param expiration_time the expiration time of the token(s)
95 * @param token_response where to store the response
96 */
97void
98OIDC_build_token_response (const char *access_token,
99 const char *id_token,
100 const struct GNUNET_TIME_Relative *expiration_time,
101 char **token_response);
102/**
103 * Generate a new access token
104 */
105char*
106OIDC_access_token_new ();
107
108
109#endif
diff --git a/src/identity-provider/plugin_gnsrecord_identity_provider.c b/src/reclaim/plugin_gnsrecord_reclaim.c
index f0dc563dc..781b88abc 100644
--- a/src/identity-provider/plugin_gnsrecord_identity_provider.c
+++ b/src/reclaim/plugin_gnsrecord_reclaim.c
@@ -17,7 +17,7 @@
17*/ 17*/
18 18
19/** 19/**
20 * @file identity-provider/plugin_gnsrecord_identity_provider.c 20 * @file reclaim/plugin_gnsrecord_reclaim.c
21 * @brief gnsrecord plugin to provide the API for identity records 21 * @brief gnsrecord plugin to provide the API for identity records
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
23 */ 23 */
@@ -54,6 +54,8 @@ value_to_string (void *cls,
54 case GNUNET_GNSRECORD_TYPE_ID_ATTR: 54 case GNUNET_GNSRECORD_TYPE_ID_ATTR:
55 return GNUNET_STRINGS_data_to_string_alloc (data, data_size); 55 return GNUNET_STRINGS_data_to_string_alloc (data, data_size);
56 case GNUNET_GNSRECORD_TYPE_ID_TOKEN: //DEPRECATED 56 case GNUNET_GNSRECORD_TYPE_ID_TOKEN: //DEPRECATED
57 case GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT:
58 case GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT:
57 return GNUNET_strndup (data, data_size); 59 return GNUNET_strndup (data, data_size);
58 case GNUNET_GNSRECORD_TYPE_ABE_KEY: 60 case GNUNET_GNSRECORD_TYPE_ABE_KEY:
59 case GNUNET_GNSRECORD_TYPE_ABE_MASTER: 61 case GNUNET_GNSRECORD_TYPE_ABE_MASTER:
@@ -113,6 +115,8 @@ string_to_value (void *cls,
113 *data, 115 *data,
114 *data_size); 116 *data_size);
115 case GNUNET_GNSRECORD_TYPE_ID_TOKEN: 117 case GNUNET_GNSRECORD_TYPE_ID_TOKEN:
118 case GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT:
119 case GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT:
116 *data = GNUNET_strdup (s); 120 *data = GNUNET_strdup (s);
117 *data_size = strlen (s); 121 *data_size = strlen (s);
118 return GNUNET_OK; 122 return GNUNET_OK;
@@ -181,6 +185,8 @@ static struct {
181 { "ABE_KEY", GNUNET_GNSRECORD_TYPE_ABE_KEY }, 185 { "ABE_KEY", GNUNET_GNSRECORD_TYPE_ABE_KEY },
182 { "ABE_MASTER", GNUNET_GNSRECORD_TYPE_ABE_MASTER }, 186 { "ABE_MASTER", GNUNET_GNSRECORD_TYPE_ABE_MASTER },
183 { "ID_TOKEN_METADATA", GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA }, 187 { "ID_TOKEN_METADATA", GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA },
188 { "RECLAIM_OIDC_CLIENT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT },
189 { "RECLAIM_OIDC_REDIRECT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT },
184 { NULL, UINT32_MAX } 190 { NULL, UINT32_MAX }
185}; 191};
186 192
@@ -234,7 +240,7 @@ number_to_typename (void *cls,
234 * @return the exported block API 240 * @return the exported block API
235 */ 241 */
236void * 242void *
237libgnunet_plugin_gnsrecord_identity_provider_init (void *cls) 243libgnunet_plugin_gnsrecord_reclaim_init (void *cls)
238{ 244{
239 struct GNUNET_GNSRECORD_PluginFunctions *api; 245 struct GNUNET_GNSRECORD_PluginFunctions *api;
240 246
@@ -254,7 +260,7 @@ libgnunet_plugin_gnsrecord_identity_provider_init (void *cls)
254 * @return NULL 260 * @return NULL
255 */ 261 */
256void * 262void *
257libgnunet_plugin_gnsrecord_identity_provider_done (void *cls) 263libgnunet_plugin_gnsrecord_reclaim_done (void *cls)
258{ 264{
259 struct GNUNET_GNSRECORD_PluginFunctions *api = cls; 265 struct GNUNET_GNSRECORD_PluginFunctions *api = cls;
260 266
diff --git a/src/identity-provider/plugin_identity_provider_sqlite.c b/src/reclaim/plugin_reclaim_sqlite.c
index f2a8b7b54..b545a94e8 100644
--- a/src/identity-provider/plugin_identity_provider_sqlite.c
+++ b/src/reclaim/plugin_reclaim_sqlite.c
@@ -17,15 +17,15 @@
17 */ 17 */
18 18
19/** 19/**
20 * @file identity-provider/plugin_identity_provider_sqlite.c 20 * @file reclaim/plugin_reclaim_sqlite.c
21 * @brief sqlite-based idp backend 21 * @brief sqlite-based idp backend
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
23 */ 23 */
24 24
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_identity_provider_service.h" 26#include "gnunet_reclaim_service.h"
27#include "gnunet_identity_provider_plugin.h" 27#include "gnunet_reclaim_plugin.h"
28#include "gnunet_identity_attribute_lib.h" 28#include "gnunet_reclaim_attribute_lib.h"
29#include "gnunet_sq_lib.h" 29#include "gnunet_sq_lib.h"
30#include <sqlite3.h> 30#include <sqlite3.h>
31 31
@@ -47,9 +47,9 @@
47 * a failure of the command 'cmd' on file 'filename' 47 * a failure of the command 'cmd' on file 'filename'
48 * with the message given by strerror(errno). 48 * with the message given by strerror(errno).
49 */ 49 */
50#define LOG_SQLITE(db, level, cmd) do { GNUNET_log_from (level, "identity-provider", _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db->dbh)); } while(0) 50#define LOG_SQLITE(db, level, cmd) do { GNUNET_log_from (level, "reclaim", _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db->dbh)); } while(0)
51 51
52#define LOG(kind,...) GNUNET_log_from (kind, "identity-provider-sqlite", __VA_ARGS__) 52#define LOG(kind,...) GNUNET_log_from (kind, "reclaim-sqlite", __VA_ARGS__)
53 53
54 54
55/** 55/**
@@ -180,12 +180,12 @@ database_setup (struct Plugin *plugin)
180 180
181 if (GNUNET_OK != 181 if (GNUNET_OK !=
182 GNUNET_CONFIGURATION_get_value_filename (plugin->cfg, 182 GNUNET_CONFIGURATION_get_value_filename (plugin->cfg,
183 "identity-provider-sqlite", 183 "reclaim-sqlite",
184 "FILENAME", 184 "FILENAME",
185 &afsdir)) 185 &afsdir))
186 { 186 {
187 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, 187 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
188 "identity-provider-sqlite", 188 "reclaim-sqlite",
189 "FILENAME"); 189 "FILENAME");
190 return GNUNET_SYSERR; 190 return GNUNET_SYSERR;
191 } 191 }
@@ -370,9 +370,9 @@ database_shutdown (struct Plugin *plugin)
370 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 370 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
371 */ 371 */
372static int 372static int
373identity_provider_sqlite_store_ticket (void *cls, 373reclaim_sqlite_store_ticket (void *cls,
374 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 374 const struct GNUNET_RECLAIM_Ticket *ticket,
375 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs) 375 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
376{ 376{
377 struct Plugin *plugin = cls; 377 struct Plugin *plugin = cls;
378 size_t attrs_len; 378 size_t attrs_len;
@@ -401,9 +401,9 @@ identity_provider_sqlite_store_ticket (void *cls,
401 GNUNET_SQ_reset (plugin->dbh, 401 GNUNET_SQ_reset (plugin->dbh,
402 plugin->delete_ticket); 402 plugin->delete_ticket);
403 403
404 attrs_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (attrs); 404 attrs_len = GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (attrs);
405 attrs_ser = GNUNET_malloc (attrs_len); 405 attrs_ser = GNUNET_malloc (attrs_len);
406 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs, 406 GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs,
407 attrs_ser); 407 attrs_ser);
408 struct GNUNET_SQ_QueryParam sparams[] = { 408 struct GNUNET_SQ_QueryParam sparams[] = {
409 GNUNET_SQ_query_param_auto_from_type (&ticket->identity), 409 GNUNET_SQ_query_param_auto_from_type (&ticket->identity),
@@ -458,8 +458,8 @@ identity_provider_sqlite_store_ticket (void *cls,
458 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 458 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
459 */ 459 */
460static int 460static int
461identity_provider_sqlite_delete_ticket (void *cls, 461reclaim_sqlite_delete_ticket (void *cls,
462 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket) 462 const struct GNUNET_RECLAIM_Ticket *ticket)
463{ 463{
464 struct Plugin *plugin = cls; 464 struct Plugin *plugin = cls;
465 int n; 465 int n;
@@ -521,11 +521,11 @@ identity_provider_sqlite_delete_ticket (void *cls,
521static int 521static int
522get_ticket_and_call_iterator (struct Plugin *plugin, 522get_ticket_and_call_iterator (struct Plugin *plugin,
523 sqlite3_stmt *stmt, 523 sqlite3_stmt *stmt,
524 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, 524 GNUNET_RECLAIM_TicketIterator iter,
525 void *iter_cls) 525 void *iter_cls)
526{ 526{
527 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 527 struct GNUNET_RECLAIM_Ticket ticket;
528 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 528 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
529 int ret; 529 int ret;
530 int sret; 530 int sret;
531 size_t attrs_len; 531 size_t attrs_len;
@@ -552,13 +552,13 @@ get_ticket_and_call_iterator (struct Plugin *plugin,
552 } 552 }
553 else 553 else
554 { 554 {
555 attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize (attrs_ser, 555 attrs = GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (attrs_ser,
556 attrs_len); 556 attrs_len);
557 if (NULL != iter) 557 if (NULL != iter)
558 iter (iter_cls, 558 iter (iter_cls,
559 &ticket, 559 &ticket,
560 attrs); 560 attrs);
561 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs); 561 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (attrs);
562 ret = GNUNET_YES; 562 ret = GNUNET_YES;
563 } 563 }
564 GNUNET_SQ_cleanup_result (rs); 564 GNUNET_SQ_cleanup_result (rs);
@@ -586,9 +586,9 @@ get_ticket_and_call_iterator (struct Plugin *plugin,
586 * @return #GNUNET_OK on success, else #GNUNET_SYSERR 586 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
587 */ 587 */
588static int 588static int
589identity_provider_sqlite_ticket_get_attrs (void *cls, 589reclaim_sqlite_ticket_get_attrs (void *cls,
590 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 590 const struct GNUNET_RECLAIM_Ticket *ticket,
591 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, 591 GNUNET_RECLAIM_TicketIterator iter,
592 void *iter_cls) 592 void *iter_cls)
593{ 593{
594 struct Plugin *plugin = cls; 594 struct Plugin *plugin = cls;
@@ -628,11 +628,11 @@ identity_provider_sqlite_ticket_get_attrs (void *cls,
628 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error 628 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
629 */ 629 */
630static int 630static int
631identity_provider_sqlite_iterate_tickets (void *cls, 631reclaim_sqlite_iterate_tickets (void *cls,
632 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 632 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
633 int audience, 633 int audience,
634 uint64_t offset, 634 uint64_t offset,
635 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, 635 GNUNET_RECLAIM_TicketIterator iter,
636 void *iter_cls) 636 void *iter_cls)
637{ 637{
638 struct Plugin *plugin = cls; 638 struct Plugin *plugin = cls;
@@ -680,15 +680,15 @@ identity_provider_sqlite_iterate_tickets (void *cls,
680/** 680/**
681 * Entry point for the plugin. 681 * Entry point for the plugin.
682 * 682 *
683 * @param cls the "struct GNUNET_IDENTITY_PROVIDER_PluginEnvironment*" 683 * @param cls the "struct GNUNET_RECLAIM_PluginEnvironment*"
684 * @return NULL on error, otherwise the plugin context 684 * @return NULL on error, otherwise the plugin context
685 */ 685 */
686void * 686void *
687libgnunet_plugin_identity_provider_sqlite_init (void *cls) 687libgnunet_plugin_reclaim_sqlite_init (void *cls)
688{ 688{
689 static struct Plugin plugin; 689 static struct Plugin plugin;
690 const struct GNUNET_CONFIGURATION_Handle *cfg = cls; 690 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
691 struct GNUNET_IDENTITY_PROVIDER_PluginFunctions *api; 691 struct GNUNET_RECLAIM_PluginFunctions *api;
692 692
693 if (NULL != plugin.cfg) 693 if (NULL != plugin.cfg)
694 return NULL; /* can only initialize once! */ 694 return NULL; /* can only initialize once! */
@@ -699,12 +699,12 @@ libgnunet_plugin_identity_provider_sqlite_init (void *cls)
699 database_shutdown (&plugin); 699 database_shutdown (&plugin);
700 return NULL; 700 return NULL;
701 } 701 }
702 api = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_PluginFunctions); 702 api = GNUNET_new (struct GNUNET_RECLAIM_PluginFunctions);
703 api->cls = &plugin; 703 api->cls = &plugin;
704 api->store_ticket = &identity_provider_sqlite_store_ticket; 704 api->store_ticket = &reclaim_sqlite_store_ticket;
705 api->delete_ticket = &identity_provider_sqlite_delete_ticket; 705 api->delete_ticket = &reclaim_sqlite_delete_ticket;
706 api->iterate_tickets = &identity_provider_sqlite_iterate_tickets; 706 api->iterate_tickets = &reclaim_sqlite_iterate_tickets;
707 api->get_ticket_attributes = &identity_provider_sqlite_ticket_get_attrs; 707 api->get_ticket_attributes = &reclaim_sqlite_ticket_get_attrs;
708 LOG (GNUNET_ERROR_TYPE_INFO, 708 LOG (GNUNET_ERROR_TYPE_INFO,
709 _("Sqlite database running\n")); 709 _("Sqlite database running\n"));
710 return api; 710 return api;
@@ -718,9 +718,9 @@ libgnunet_plugin_identity_provider_sqlite_init (void *cls)
718 * @return always NULL 718 * @return always NULL
719 */ 719 */
720void * 720void *
721libgnunet_plugin_identity_provider_sqlite_done (void *cls) 721libgnunet_plugin_reclaim_sqlite_done (void *cls)
722{ 722{
723 struct GNUNET_IDENTITY_PROVIDER_PluginFunctions *api = cls; 723 struct GNUNET_RECLAIM_PluginFunctions *api = cls;
724 struct Plugin *plugin = api->cls; 724 struct Plugin *plugin = api->cls;
725 725
726 database_shutdown (plugin); 726 database_shutdown (plugin);
@@ -731,4 +731,4 @@ libgnunet_plugin_identity_provider_sqlite_done (void *cls)
731 return NULL; 731 return NULL;
732} 732}
733 733
734/* end of plugin_identity_provider_sqlite.c */ 734/* end of plugin_reclaim_sqlite.c */
diff --git a/src/identity-provider/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index d87a345cf..24673c692 100644
--- a/src/identity-provider/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -36,9 +36,9 @@
36#include <jansson.h> 36#include <jansson.h>
37#include <inttypes.h> 37#include <inttypes.h>
38#include "gnunet_signatures.h" 38#include "gnunet_signatures.h"
39#include "gnunet_identity_attribute_lib.h" 39#include "gnunet_reclaim_attribute_lib.h"
40#include "gnunet_identity_provider_service.h" 40#include "gnunet_reclaim_service.h"
41#include "jwt.h" 41#include "oidc_helper.h"
42 42
43/** 43/**
44 * REST root namespace 44 * REST root namespace
@@ -68,7 +68,7 @@
68/** 68/**
69 * Attribute key 69 * Attribute key
70 */ 70 */
71#define GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE "attribute" 71#define GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE "attribute"
72 72
73/** 73/**
74 * Ticket key 74 * Ticket key
@@ -79,7 +79,7 @@
79/** 79/**
80 * Value key 80 * Value key
81 */ 81 */
82#define GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE_VALUE "value" 82#define GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE_VALUE "value"
83 83
84/** 84/**
85 * State while collecting all egos 85 * State while collecting all egos
@@ -168,7 +168,6 @@ static char* OIDC_ignored_parameter_array [] =
168{ 168{
169 "display", 169 "display",
170 "prompt", 170 "prompt",
171 "max_age",
172 "ui_locales", 171 "ui_locales",
173 "response_mode", 172 "response_mode",
174 "id_token_hint", 173 "id_token_hint",
@@ -230,12 +229,6 @@ struct OIDC_Variables
230 char *client_id; 229 char *client_id;
231 230
232 /** 231 /**
233 * GNUNET_YES if there is a delegation to
234 * this RP or if it is a local identity
235 */
236 int is_client_trusted;
237
238 /**
239 * The OIDC redirect uri 232 * The OIDC redirect uri
240 */ 233 */
241 char *redirect_uri; 234 char *redirect_uri;
@@ -347,6 +340,16 @@ struct RequestHandle
347 struct GNUNET_REST_RequestHandle *rest_handle; 340 struct GNUNET_REST_RequestHandle *rest_handle;
348 341
349 /** 342 /**
343 * GNS handle
344 */
345 struct GNUNET_GNS_Handle *gns_handle;
346
347 /**
348 * GNS lookup op
349 */
350 struct GNUNET_GNS_LookupRequest *gns_op;
351
352 /**
350 * Handle to NAMESTORE 353 * Handle to NAMESTORE
351 */ 354 */
352 struct GNUNET_NAMESTORE_Handle *namestore_handle; 355 struct GNUNET_NAMESTORE_Handle *namestore_handle;
@@ -359,7 +362,7 @@ struct RequestHandle
359 /** 362 /**
360 * Attribute claim list 363 * Attribute claim list
361 */ 364 */
362 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list; 365 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attr_list;
363 366
364 /** 367 /**
365 * IDENTITY Operation 368 * IDENTITY Operation
@@ -369,27 +372,27 @@ struct RequestHandle
369 /** 372 /**
370 * Identity Provider 373 * Identity Provider
371 */ 374 */
372 struct GNUNET_IDENTITY_PROVIDER_Handle *idp; 375 struct GNUNET_RECLAIM_Handle *idp;
373 376
374 /** 377 /**
375 * Idp Operation 378 * Idp Operation
376 */ 379 */
377 struct GNUNET_IDENTITY_PROVIDER_Operation *idp_op; 380 struct GNUNET_RECLAIM_Operation *idp_op;
378 381
379 /** 382 /**
380 * Attribute iterator 383 * Attribute iterator
381 */ 384 */
382 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *attr_it; 385 struct GNUNET_RECLAIM_AttributeIterator *attr_it;
383 386
384 /** 387 /**
385 * Ticket iterator 388 * Ticket iterator
386 */ 389 */
387 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *ticket_it; 390 struct GNUNET_RECLAIM_TicketIterator *ticket_it;
388 391
389 /** 392 /**
390 * A ticket 393 * A ticket
391 */ 394 */
392 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 395 struct GNUNET_RECLAIM_Ticket ticket;
393 396
394 /** 397 /**
395 * Desired timeout for the lookup (default is no timeout). 398 * Desired timeout for the lookup (default is no timeout).
@@ -422,6 +425,16 @@ struct RequestHandle
422 char *tld; 425 char *tld;
423 426
424 /** 427 /**
428 * The redirect prefix
429 */
430 char *redirect_prefix;
431
432 /**
433 * The redirect suffix
434 */
435 char *redirect_suffix;
436
437 /**
425 * Error response message 438 * Error response message
426 */ 439 */
427 char *emsg; 440 char *emsg;
@@ -450,8 +463,8 @@ struct RequestHandle
450static void 463static void
451cleanup_handle (struct RequestHandle *handle) 464cleanup_handle (struct RequestHandle *handle)
452{ 465{
453 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *claim_entry; 466 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *claim_entry;
454 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *claim_tmp; 467 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *claim_tmp;
455 struct EgoEntry *ego_entry; 468 struct EgoEntry *ego_entry;
456 struct EgoEntry *ego_tmp; 469 struct EgoEntry *ego_tmp;
457 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 470 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -463,19 +476,28 @@ cleanup_handle (struct RequestHandle *handle)
463 if (NULL != handle->identity_handle) 476 if (NULL != handle->identity_handle)
464 GNUNET_IDENTITY_disconnect (handle->identity_handle); 477 GNUNET_IDENTITY_disconnect (handle->identity_handle);
465 if (NULL != handle->attr_it) 478 if (NULL != handle->attr_it)
466 GNUNET_IDENTITY_PROVIDER_get_attributes_stop (handle->attr_it); 479 GNUNET_RECLAIM_get_attributes_stop (handle->attr_it);
467 if (NULL != handle->ticket_it) 480 if (NULL != handle->ticket_it)
468 GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (handle->ticket_it); 481 GNUNET_RECLAIM_ticket_iteration_stop (handle->ticket_it);
469 if (NULL != handle->idp) 482 if (NULL != handle->idp)
470 GNUNET_IDENTITY_PROVIDER_disconnect (handle->idp); 483 GNUNET_RECLAIM_disconnect (handle->idp);
471 if (NULL != handle->url) 484 if (NULL != handle->url)
472 GNUNET_free (handle->url); 485 GNUNET_free (handle->url);
473 if (NULL != handle->tld) 486 if (NULL != handle->tld)
474 GNUNET_free (handle->tld); 487 GNUNET_free (handle->tld);
488 if (NULL != handle->redirect_prefix)
489 GNUNET_free (handle->redirect_prefix);
490 if (NULL != handle->redirect_suffix)
491 GNUNET_free (handle->redirect_suffix);
475 if (NULL != handle->emsg) 492 if (NULL != handle->emsg)
476 GNUNET_free (handle->emsg); 493 GNUNET_free (handle->emsg);
477 if (NULL != handle->edesc) 494 if (NULL != handle->edesc)
478 GNUNET_free (handle->edesc); 495 GNUNET_free (handle->edesc);
496 if (NULL != handle->gns_op)
497 GNUNET_GNS_lookup_cancel (handle->gns_op);
498 if (NULL != handle->gns_handle)
499 GNUNET_GNS_disconnect (handle->gns_handle);
500
479 if (NULL != handle->namestore_handle) 501 if (NULL != handle->namestore_handle)
480 GNUNET_NAMESTORE_disconnect (handle->namestore_handle); 502 GNUNET_NAMESTORE_disconnect (handle->namestore_handle);
481 if (NULL != handle->oidc) 503 if (NULL != handle->oidc)
@@ -732,6 +754,8 @@ cookie_identity_interpretation (struct RequestHandle *handle)
732 { 754 {
733 handle->oidc->login_identity = strtok(handle->oidc->login_identity, OIDC_COOKIE_HEADER_INFORMATION_KEY); 755 handle->oidc->login_identity = strtok(handle->oidc->login_identity, OIDC_COOKIE_HEADER_INFORMATION_KEY);
734 handle->oidc->login_identity = GNUNET_strdup(handle->oidc->login_identity); 756 handle->oidc->login_identity = GNUNET_strdup(handle->oidc->login_identity);
757 } else {
758 handle->oidc->login_identity = NULL;
735 } 759 }
736 } 760 }
737 else 761 else
@@ -753,7 +777,7 @@ login_redirection(void *cls)
753 struct RequestHandle *handle = cls; 777 struct RequestHandle *handle = cls;
754 778
755 if ( GNUNET_OK 779 if ( GNUNET_OK
756 == GNUNET_CONFIGURATION_get_value_string (cfg, "identity-rest-plugin", 780 == GNUNET_CONFIGURATION_get_value_string (cfg, "reclaim-rest-plugin",
757 "address", &login_base_url) ) 781 "address", &login_base_url) )
758 { 782 {
759 GNUNET_asprintf (&new_redirect, "%s?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s&%s=%s", 783 GNUNET_asprintf (&new_redirect, "%s?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s&%s=%s",
@@ -799,11 +823,12 @@ oidc_iteration_error (void *cls)
799 GNUNET_SCHEDULER_add_now (&do_error, handle); 823 GNUNET_SCHEDULER_add_now (&do_error, handle);
800} 824}
801 825
802static void get_client_name_result (void *cls, 826static void
803 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 827get_client_name_result (void *cls,
804 const char *label, 828 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
805 unsigned int rd_count, 829 const char *label,
806 const struct GNUNET_GNSRECORD_Data *rd) 830 unsigned int rd_count,
831 const struct GNUNET_GNSRECORD_Data *rd)
807{ 832{
808 struct RequestHandle *handle = cls; 833 struct RequestHandle *handle = cls;
809 struct MHD_Response *resp; 834 struct MHD_Response *resp;
@@ -811,46 +836,33 @@ static void get_client_name_result (void *cls,
811 char *redirect_uri; 836 char *redirect_uri;
812 char *code_json_string; 837 char *code_json_string;
813 char *code_base64_final_string; 838 char *code_base64_final_string;
814 char *redirect_path; 839
815 char *tmp;
816 char *tmp_prefix;
817 char *prefix;
818 ticket_str = GNUNET_STRINGS_data_to_string_alloc (&handle->ticket, 840 ticket_str = GNUNET_STRINGS_data_to_string_alloc (&handle->ticket,
819 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 841 sizeof (struct GNUNET_RECLAIM_Ticket));
820 //TODO change if more attributes are needed (see max_age) 842 //TODO change if more attributes are needed (see max_age)
821 GNUNET_asprintf (&code_json_string, "{\"ticket\":\"%s\"%s%s%s}", 843 code_json_string = OIDC_build_authz_code (&handle->priv_key,
822 ticket_str, 844 &handle->ticket,
823 (NULL != handle->oidc->nonce) ? ", \"nonce\":\"" : "", 845 handle->oidc->nonce);
824 (NULL != handle->oidc->nonce) ? handle->oidc->nonce : "",
825 (NULL != handle->oidc->nonce) ? "\"" : "");
826 code_base64_final_string = base_64_encode(code_json_string); 846 code_base64_final_string = base_64_encode(code_json_string);
827 tmp = GNUNET_strdup (handle->oidc->redirect_uri);
828 redirect_path = strtok (tmp, "/");
829 redirect_path = strtok (NULL, "/");
830 redirect_path = strtok (NULL, "/");
831 tmp_prefix = GNUNET_strdup (handle->oidc->redirect_uri);
832 prefix = strrchr (tmp_prefix,
833 (unsigned char) '.');
834 *prefix = '\0';
835 GNUNET_asprintf (&redirect_uri, "%s.%s/%s?%s=%s&state=%s", 847 GNUNET_asprintf (&redirect_uri, "%s.%s/%s?%s=%s&state=%s",
836 tmp_prefix, 848 handle->redirect_prefix,
837 handle->tld, 849 handle->tld,
838 redirect_path, 850 handle->redirect_suffix,
839 handle->oidc->response_type, 851 handle->oidc->response_type,
840 code_base64_final_string, handle->oidc->state); 852 code_base64_final_string, handle->oidc->state);
841 resp = GNUNET_REST_create_response (""); 853 resp = GNUNET_REST_create_response ("");
842 MHD_add_response_header (resp, "Location", redirect_uri); 854 MHD_add_response_header (resp, "Location", redirect_uri);
843 handle->proc (handle->proc_cls, resp, MHD_HTTP_FOUND); 855 handle->proc (handle->proc_cls, resp, MHD_HTTP_FOUND);
844 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle); 856 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
845 GNUNET_free (tmp);
846 GNUNET_free (tmp_prefix);
847 GNUNET_free (redirect_uri); 857 GNUNET_free (redirect_uri);
848 GNUNET_free (ticket_str); 858 GNUNET_free (ticket_str);
849 GNUNET_free (code_json_string); 859 GNUNET_free (code_json_string);
850 GNUNET_free (code_base64_final_string); 860 GNUNET_free (code_base64_final_string);
851 return; 861 return;
862
852} 863}
853 864
865
854static void 866static void
855get_client_name_error (void *cls) 867get_client_name_error (void *cls)
856{ 868{
@@ -861,32 +873,93 @@ get_client_name_error (void *cls)
861 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); 873 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
862} 874}
863 875
864/** 876
865 * Issues ticket and redirects to relying party with the authorization code as
866 * parameter. Otherwise redirects with error
867 */
868static void 877static void
869oidc_ticket_issue_cb (void* cls, 878lookup_redirect_uri_result (void *cls,
870 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket) 879 uint32_t rd_count,
880 const struct GNUNET_GNSRECORD_Data *rd)
871{ 881{
872 struct RequestHandle *handle = cls; 882 struct RequestHandle *handle = cls;
873 handle->idp_op = NULL; 883 char *tmp;
874 handle->ticket = *ticket; 884 char *tmp_key_str;
875 if (NULL != ticket) { 885 char *pos;
886 struct GNUNET_CRYPTO_EcdsaPublicKey redirect_zone;
887
888 handle->gns_op = NULL;
889 if (0 == rd_count)
890 {
891 handle->emsg = GNUNET_strdup("server_error");
892 handle->edesc = GNUNET_strdup("Server cannot generate ticket, redirect uri not found.");
893 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
894 return;
895 }
896 for (int i = 0; i < rd_count; i++)
897 {
898 if (GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT != rd[i].record_type)
899 continue;
900 if (0 != strcmp (rd[i].data,
901 handle->oidc->redirect_uri))
902 continue;
903 tmp = GNUNET_strdup (rd[i].data);
904 pos = strrchr (tmp,
905 (unsigned char) '.');
906 *pos = '\0';
907 handle->redirect_prefix = GNUNET_strdup (tmp);
908 tmp_key_str = pos + 1;
909 pos = strchr (tmp_key_str,
910 (unsigned char) '/');
911 *pos = '\0';
912 handle->redirect_suffix = GNUNET_strdup (pos + 1);
913
914 GNUNET_STRINGS_string_to_data (tmp_key_str,
915 strlen (tmp_key_str),
916 &redirect_zone,
917 sizeof (redirect_zone));
918
876 GNUNET_NAMESTORE_zone_to_name (handle->namestore_handle, 919 GNUNET_NAMESTORE_zone_to_name (handle->namestore_handle,
877 &handle->priv_key, 920 &handle->priv_key,
878 &handle->oidc->client_pkey, 921 &redirect_zone,
879 &get_client_name_error, 922 &get_client_name_error,
880 handle, 923 handle,
881 &get_client_name_result, 924 &get_client_name_result,
882 handle); 925 handle);
926 GNUNET_free (tmp);
883 return; 927 return;
884 } 928 }
885 handle->emsg = GNUNET_strdup("server_error"); 929 handle->emsg = GNUNET_strdup("server_error");
886 handle->edesc = GNUNET_strdup("Server cannot generate ticket."); 930 handle->edesc = GNUNET_strdup("Server cannot generate ticket, redirect uri not found.");
887 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); 931 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
888} 932}
889 933
934/**
935 * Issues ticket and redirects to relying party with the authorization code as
936 * parameter. Otherwise redirects with error
937 */
938static void
939oidc_ticket_issue_cb (void* cls,
940 const struct GNUNET_RECLAIM_Ticket *ticket)
941{
942 struct RequestHandle *handle = cls;
943
944 handle->idp_op = NULL;
945 handle->ticket = *ticket;
946 if (NULL == ticket)
947 {
948 handle->emsg = GNUNET_strdup("server_error");
949 handle->edesc = GNUNET_strdup("Server cannot generate ticket.");
950 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
951 return;
952 }
953 handle->gns_op = GNUNET_GNS_lookup (handle->gns_handle,
954 "+",
955 &handle->oidc->client_pkey,
956 GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT,
957 GNUNET_GNS_LO_DEFAULT,
958 &lookup_redirect_uri_result,
959 handle);
960
961}
962
890static void 963static void
891oidc_collect_finished_cb (void *cls) 964oidc_collect_finished_cb (void *cls)
892{ 965{
@@ -900,12 +973,12 @@ oidc_collect_finished_cb (void *cls)
900 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); 973 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
901 return; 974 return;
902 } 975 }
903 handle->idp_op = GNUNET_IDENTITY_PROVIDER_ticket_issue (handle->idp, 976 handle->idp_op = GNUNET_RECLAIM_ticket_issue (handle->idp,
904 &handle->priv_key, 977 &handle->priv_key,
905 &handle->oidc->client_pkey, 978 &handle->oidc->client_pkey,
906 handle->attr_list, 979 handle->attr_list,
907 &oidc_ticket_issue_cb, 980 &oidc_ticket_issue_cb,
908 handle); 981 handle);
909} 982}
910 983
911 984
@@ -915,17 +988,17 @@ oidc_collect_finished_cb (void *cls)
915static void 988static void
916oidc_attr_collect (void *cls, 989oidc_attr_collect (void *cls,
917 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 990 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
918 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 991 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
919{ 992{
920 struct RequestHandle *handle = cls; 993 struct RequestHandle *handle = cls;
921 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 994 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
922 char* scope_variables; 995 char* scope_variables;
923 char* scope_variable; 996 char* scope_variable;
924 char delimiter[]=" "; 997 char delimiter[]=" ";
925 998
926 if ( (NULL == attr->name) || (NULL == attr->data) ) 999 if ( (NULL == attr->name) || (NULL == attr->data) )
927 { 1000 {
928 GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); 1001 GNUNET_RECLAIM_get_attributes_next (handle->attr_it);
929 return; 1002 return;
930 } 1003 }
931 1004
@@ -941,18 +1014,18 @@ oidc_attr_collect (void *cls,
941 } 1014 }
942 if ( NULL == scope_variable ) 1015 if ( NULL == scope_variable )
943 { 1016 {
944 GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); 1017 GNUNET_RECLAIM_get_attributes_next (handle->attr_it);
945 GNUNET_free(scope_variables); 1018 GNUNET_free(scope_variables);
946 return; 1019 return;
947 } 1020 }
948 GNUNET_free(scope_variables); 1021 GNUNET_free(scope_variables);
949 1022
950 le = GNUNET_new(struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); 1023 le = GNUNET_new(struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
951 le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (attr->name, attr->type, 1024 le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name, attr->type,
952 attr->data, attr->data_size); 1025 attr->data, attr->data_size);
953 GNUNET_CONTAINER_DLL_insert(handle->attr_list->list_head, 1026 GNUNET_CONTAINER_DLL_insert(handle->attr_list->list_head,
954 handle->attr_list->list_tail, le); 1027 handle->attr_list->list_tail, le);
955 GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); 1028 GNUNET_RECLAIM_get_attributes_next (handle->attr_it);
956} 1029}
957 1030
958 1031
@@ -1005,88 +1078,33 @@ login_check (void *cls)
1005 handle->priv_key = *GNUNET_IDENTITY_ego_get_private_key ( 1078 handle->priv_key = *GNUNET_IDENTITY_ego_get_private_key (
1006 handle->ego_entry->ego); 1079 handle->ego_entry->ego);
1007 handle->resp_object = GNUNET_JSONAPI_document_new (); 1080 handle->resp_object = GNUNET_JSONAPI_document_new ();
1008 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 1081 handle->idp = GNUNET_RECLAIM_connect (cfg);
1009 handle->attr_list = GNUNET_new( 1082 handle->attr_list = GNUNET_new(
1010 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); 1083 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
1011 handle->attr_it = GNUNET_IDENTITY_PROVIDER_get_attributes_start ( 1084 handle->attr_it = GNUNET_RECLAIM_get_attributes_start (
1012 handle->idp, &handle->priv_key, &oidc_iteration_error, handle, 1085 handle->idp, &handle->priv_key, &oidc_iteration_error, handle,
1013 &oidc_attr_collect, handle, &oidc_collect_finished_cb, handle); 1086 &oidc_attr_collect, handle, &oidc_collect_finished_cb, handle);
1014 return; 1087 return;
1015 } 1088 }
1016 } 1089 }
1017 handle->emsg = GNUNET_strdup("invalid_cookie"); 1090 //handle->emsg = GNUNET_strdup("invalid_cookie");
1018 handle->edesc = GNUNET_strdup( 1091 //handle->edesc = GNUNET_strdup(
1019 "The cookie of the login identity is not valid"); 1092 // "The cookie of the login identity is not valid");
1020 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); 1093 //GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
1094 GNUNET_SCHEDULER_add_now (&login_redirection,handle);
1021 return; 1095 return;
1022 } 1096 }
1023 } 1097 }
1024} 1098}
1025 1099
1026/** 1100/**
1027 * Searches for client_id in namestore. If found trust status stored in handle
1028 * Else continues to search
1029 *
1030 * @param handle the RequestHandle
1031 */
1032static void
1033namestore_iteration_callback (
1034 void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
1035 const char *rname, unsigned int rd_len,
1036 const struct GNUNET_GNSRECORD_Data *rd)
1037{
1038 struct RequestHandle *handle = cls;
1039 struct GNUNET_CRYPTO_EcdsaPublicKey login_identity_pkey;
1040 struct GNUNET_CRYPTO_EcdsaPublicKey current_zone_pkey;
1041 int i;
1042
1043 for (i = 0; i < rd_len; i++)
1044 {
1045 if ( GNUNET_GNSRECORD_TYPE_PKEY != rd[i].record_type )
1046 continue;
1047
1048 if ( NULL != handle->oidc->login_identity )
1049 {
1050 GNUNET_CRYPTO_ecdsa_public_key_from_string (
1051 handle->oidc->login_identity,
1052 strlen (handle->oidc->login_identity),
1053 &login_identity_pkey);
1054 GNUNET_IDENTITY_ego_get_public_key (handle->ego_entry->ego,
1055 &current_zone_pkey);
1056
1057 if ( 0 == memcmp (rd[i].data, &handle->oidc->client_pkey,
1058 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) )
1059 {
1060 if ( 0 == memcmp (&login_identity_pkey, &current_zone_pkey,
1061 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) )
1062 {
1063 handle->oidc->is_client_trusted = GNUNET_YES;
1064 }
1065 }
1066 }
1067 else
1068 {
1069 if ( 0 == memcmp (rd[i].data, &handle->oidc->client_pkey,
1070 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) )
1071 {
1072 handle->oidc->is_client_trusted = GNUNET_YES;
1073 }
1074 }
1075 }
1076
1077 GNUNET_NAMESTORE_zone_iterator_next (handle->namestore_handle_it,
1078 1);
1079}
1080
1081
1082/**
1083 * Iteration over all results finished, build final 1101 * Iteration over all results finished, build final
1084 * response. 1102 * response.
1085 * 1103 *
1086 * @param cls the `struct RequestHandle` 1104 * @param cls the `struct RequestHandle`
1087 */ 1105 */
1088static void 1106static void
1089namestore_iteration_finished (void *cls) 1107build_authz_response (void *cls)
1090{ 1108{
1091 struct RequestHandle *handle = cls; 1109 struct RequestHandle *handle = cls;
1092 struct GNUNET_HashCode cache_key; 1110 struct GNUNET_HashCode cache_key;
@@ -1096,25 +1114,6 @@ namestore_iteration_finished (void *cls)
1096 int number_of_ignored_parameter, iterator; 1114 int number_of_ignored_parameter, iterator;
1097 1115
1098 1116
1099 handle->ego_entry = handle->ego_entry->next;
1100
1101 if(NULL != handle->ego_entry)
1102 {
1103 handle->priv_key = *GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego);
1104 handle->namestore_handle_it = GNUNET_NAMESTORE_zone_iteration_start (handle->namestore_handle, &handle->priv_key,
1105 &oidc_iteration_error, handle, &namestore_iteration_callback, handle,
1106 &namestore_iteration_finished, handle);
1107 return;
1108 }
1109 if (GNUNET_NO == handle->oidc->is_client_trusted)
1110 {
1111 handle->emsg = GNUNET_strdup("unauthorized_client");
1112 handle->edesc = GNUNET_strdup("The client is not authorized to request an "
1113 "authorization code using this method.");
1114 GNUNET_SCHEDULER_add_now (&do_error, handle);
1115 return;
1116 }
1117
1118 // REQUIRED value: redirect_uri 1117 // REQUIRED value: redirect_uri
1119 GNUNET_CRYPTO_hash (OIDC_REDIRECT_URI_KEY, strlen (OIDC_REDIRECT_URI_KEY), 1118 GNUNET_CRYPTO_hash (OIDC_REDIRECT_URI_KEY, strlen (OIDC_REDIRECT_URI_KEY),
1120 &cache_key); 1119 &cache_key);
@@ -1244,8 +1243,8 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1244 struct RequestHandle *handle = cls; 1243 struct RequestHandle *handle = cls;
1245 struct GNUNET_HashCode cache_key; 1244 struct GNUNET_HashCode cache_key;
1246 struct EgoEntry *tmp_ego; 1245 struct EgoEntry *tmp_ego;
1247 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
1248 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; 1246 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
1247 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
1249 1248
1250 cookie_identity_interpretation(handle); 1249 cookie_identity_interpretation(handle);
1251 1250
@@ -1299,9 +1298,8 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1299 1298
1300 handle->ego_entry = handle->ego_head; 1299 handle->ego_entry = handle->ego_head;
1301 handle->priv_key = *GNUNET_IDENTITY_ego_get_private_key (handle->ego_head->ego); 1300 handle->priv_key = *GNUNET_IDENTITY_ego_get_private_key (handle->ego_head->ego);
1302 handle->oidc->is_client_trusted = GNUNET_NO; 1301 //If we know this identity, translated the corresponding TLD
1303 1302 //TODO: We might want to have a reverse lookup functionality for TLDs?
1304 //First check if client_id is one of our egos; TODO: handle other TLD cases: Delegation, from config
1305 for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) 1303 for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next)
1306 { 1304 {
1307 priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego); 1305 priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego);
@@ -1311,17 +1309,10 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1311 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) ) 1309 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) )
1312 { 1310 {
1313 handle->tld = GNUNET_strdup (tmp_ego->identifier); 1311 handle->tld = GNUNET_strdup (tmp_ego->identifier);
1314 handle->oidc->is_client_trusted = GNUNET_YES;
1315 handle->ego_entry = handle->ego_tail; 1312 handle->ego_entry = handle->ego_tail;
1316 } 1313 }
1317 } 1314 }
1318 1315 GNUNET_SCHEDULER_add_now (&build_authz_response, handle);
1319
1320 // Checks if client_id is valid:
1321 handle->namestore_handle_it = GNUNET_NAMESTORE_zone_iteration_start (
1322 handle->namestore_handle, &handle->priv_key, &oidc_iteration_error,
1323 handle, &namestore_iteration_callback, handle,
1324 &namestore_iteration_finished, handle);
1325} 1316}
1326 1317
1327/** 1318/**
@@ -1359,8 +1350,8 @@ login_cont (struct GNUNET_REST_RequestHandle *con_handle,
1359 1350
1360 current_time = GNUNET_new(struct GNUNET_TIME_Absolute); 1351 current_time = GNUNET_new(struct GNUNET_TIME_Absolute);
1361 *current_time = GNUNET_TIME_relative_to_absolute ( 1352 *current_time = GNUNET_TIME_relative_to_absolute (
1362 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_get_minute_ (), 1353 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_get_second_ (),
1363 30)); 1354 5));
1364 last_time = GNUNET_CONTAINER_multihashmap_get(OIDC_identity_login_time, &cache_key); 1355 last_time = GNUNET_CONTAINER_multihashmap_get(OIDC_identity_login_time, &cache_key);
1365 if (NULL != last_time) 1356 if (NULL != last_time)
1366 { 1357 {
@@ -1382,37 +1373,19 @@ login_cont (struct GNUNET_REST_RequestHandle *con_handle,
1382 return; 1373 return;
1383} 1374}
1384 1375
1385/** 1376static int
1386 * Responds to token url-encoded POST request 1377check_authorization (struct RequestHandle *handle,
1387 * 1378 struct GNUNET_CRYPTO_EcdsaPublicKey *cid)
1388 * @param con_handle the connection handle
1389 * @param url the url
1390 * @param cls the RequestHandle
1391 */
1392static void
1393token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1394 const char* url,
1395 void *cls)
1396{ 1379{
1397 //TODO static strings
1398 struct RequestHandle *handle = cls;
1399 struct GNUNET_HashCode cache_key; 1380 struct GNUNET_HashCode cache_key;
1400 char *authorization, *credentials; 1381 char *authorization;
1401 char delimiter[]=" "; 1382 char *credentials;
1402 char delimiter_user_psw[]=":"; 1383 char *basic_authorization;
1403 char *grant_type, *code; 1384 char *client_id;
1404 char *user_psw = NULL, *client_id, *psw; 1385 char *pass;
1405 char *expected_psw; 1386 char *expected_pass;
1406 int client_exists = GNUNET_NO; 1387 int client_exists = GNUNET_NO;
1407 struct MHD_Response *resp;
1408 char* code_output;
1409 json_t *root, *ticket_string, *nonce, *max_age;
1410 json_error_t error;
1411 char *json_response;
1412 1388
1413 /*
1414 * Check Authorization
1415 */
1416 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY, 1389 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY,
1417 strlen (OIDC_AUTHORIZATION_HEADER_KEY), 1390 strlen (OIDC_AUTHORIZATION_HEADER_KEY),
1418 &cache_key); 1391 &cache_key);
@@ -1422,80 +1395,75 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1422 handle->emsg=GNUNET_strdup("invalid_client"); 1395 handle->emsg=GNUNET_strdup("invalid_client");
1423 handle->edesc=GNUNET_strdup("missing authorization"); 1396 handle->edesc=GNUNET_strdup("missing authorization");
1424 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1397 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1425 GNUNET_SCHEDULER_add_now (&do_error, handle); 1398 return GNUNET_SYSERR;
1426 return;
1427 } 1399 }
1428 authorization = GNUNET_CONTAINER_multihashmap_get ( handle->rest_handle->header_param_map, &cache_key); 1400 authorization = GNUNET_CONTAINER_multihashmap_get (handle->rest_handle->header_param_map,
1401 &cache_key);
1429 1402
1430 //split header in "Basic" and [content] 1403 //split header in "Basic" and [content]
1431 credentials = strtok (authorization, delimiter); 1404 credentials = strtok (authorization, " ");
1432 if (0 != strcmp ("Basic",credentials)) 1405 if (0 != strcmp ("Basic", credentials))
1433 { 1406 {
1434 handle->emsg=GNUNET_strdup("invalid_client"); 1407 handle->emsg=GNUNET_strdup("invalid_client");
1435 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1408 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1436 GNUNET_SCHEDULER_add_now (&do_error, handle); 1409 return GNUNET_SYSERR;
1437 return;
1438 } 1410 }
1439 credentials = strtok(NULL, delimiter); 1411 credentials = strtok(NULL, " ");
1440 if (NULL == credentials) 1412 if (NULL == credentials)
1441 { 1413 {
1442 handle->emsg=GNUNET_strdup("invalid_client"); 1414 handle->emsg=GNUNET_strdup("invalid_client");
1443 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1415 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1444 GNUNET_SCHEDULER_add_now (&do_error, handle); 1416 return GNUNET_SYSERR;
1445 return;
1446 } 1417 }
1447 GNUNET_STRINGS_base64_decode (credentials, strlen (credentials), &user_psw); 1418 GNUNET_STRINGS_base64_decode (credentials,
1419 strlen (credentials),
1420 (void**)&basic_authorization);
1448 1421
1449 if ( NULL == user_psw ) 1422 if ( NULL == basic_authorization )
1450 { 1423 {
1451 handle->emsg=GNUNET_strdup("invalid_client"); 1424 handle->emsg=GNUNET_strdup("invalid_client");
1452 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1425 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1453 GNUNET_SCHEDULER_add_now (&do_error, handle); 1426 return GNUNET_SYSERR;
1454 return;
1455 } 1427 }
1456 client_id = strtok (user_psw, delimiter_user_psw); 1428 client_id = strtok (basic_authorization, ":");
1457 if ( NULL == client_id ) 1429 if ( NULL == client_id )
1458 { 1430 {
1459 GNUNET_free_non_null(user_psw); 1431 GNUNET_free_non_null(basic_authorization);
1460 handle->emsg=GNUNET_strdup("invalid_client"); 1432 handle->emsg=GNUNET_strdup("invalid_client");
1461 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1433 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1462 GNUNET_SCHEDULER_add_now (&do_error, handle); 1434 return GNUNET_SYSERR;
1463 return;
1464 } 1435 }
1465 psw = strtok (NULL, delimiter_user_psw); 1436 pass = strtok (NULL, ":");
1466 if (NULL == psw) 1437 if (NULL == pass)
1467 { 1438 {
1468 GNUNET_free_non_null(user_psw); 1439 GNUNET_free_non_null(basic_authorization);
1469 handle->emsg=GNUNET_strdup("invalid_client"); 1440 handle->emsg=GNUNET_strdup("invalid_client");
1470 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1441 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1471 GNUNET_SCHEDULER_add_now (&do_error, handle); 1442 return GNUNET_SYSERR;
1472 return;
1473 } 1443 }
1474 1444
1475 //check client password 1445 //check client password
1476 if ( GNUNET_OK 1446 if ( GNUNET_OK
1477 == GNUNET_CONFIGURATION_get_value_string (cfg, "identity-rest-plugin", 1447 == GNUNET_CONFIGURATION_get_value_string (cfg, "reclaim-rest-plugin",
1478 "psw", &expected_psw) ) 1448 "psw", &expected_pass) )
1479 { 1449 {
1480 if (0 != strcmp (expected_psw, psw)) 1450 if (0 != strcmp (expected_pass, pass))
1481 { 1451 {
1482 GNUNET_free_non_null(user_psw); 1452 GNUNET_free_non_null(basic_authorization);
1483 GNUNET_free(expected_psw); 1453 GNUNET_free(expected_pass);
1484 handle->emsg=GNUNET_strdup("invalid_client"); 1454 handle->emsg=GNUNET_strdup("invalid_client");
1485 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1455 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1486 GNUNET_SCHEDULER_add_now (&do_error, handle); 1456 return GNUNET_SYSERR;
1487 return;
1488 } 1457 }
1489 GNUNET_free(expected_psw); 1458 GNUNET_free(expected_pass);
1490 } 1459 }
1491 else 1460 else
1492 { 1461 {
1493 GNUNET_free_non_null(user_psw); 1462 GNUNET_free_non_null(basic_authorization);
1494 handle->emsg = GNUNET_strdup("server_error"); 1463 handle->emsg = GNUNET_strdup("server_error");
1495 handle->edesc = GNUNET_strdup ("gnunet configuration failed"); 1464 handle->edesc = GNUNET_strdup ("gnunet configuration failed");
1496 handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; 1465 handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
1497 GNUNET_SCHEDULER_add_now (&do_error, handle); 1466 return GNUNET_SYSERR;
1498 return;
1499 } 1467 }
1500 1468
1501 //check client_id 1469 //check client_id
@@ -1510,9 +1478,107 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1510 } 1478 }
1511 if (GNUNET_NO == client_exists) 1479 if (GNUNET_NO == client_exists)
1512 { 1480 {
1513 GNUNET_free_non_null(user_psw); 1481 GNUNET_free_non_null(basic_authorization);
1514 handle->emsg=GNUNET_strdup("invalid_client"); 1482 handle->emsg=GNUNET_strdup("invalid_client");
1515 handle->response_code = MHD_HTTP_UNAUTHORIZED; 1483 handle->response_code = MHD_HTTP_UNAUTHORIZED;
1484 return GNUNET_SYSERR;
1485 }
1486 GNUNET_STRINGS_string_to_data (client_id,
1487 strlen(client_id),
1488 cid,
1489 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
1490
1491 GNUNET_free (basic_authorization);
1492 return GNUNET_OK;
1493}
1494
1495static int
1496ego_exists (struct RequestHandle *handle,
1497 struct GNUNET_CRYPTO_EcdsaPublicKey *test_key)
1498{
1499 struct EgoEntry *ego_entry;
1500 struct GNUNET_CRYPTO_EcdsaPublicKey pub_key;
1501
1502 for (ego_entry = handle->ego_head; NULL != ego_entry; ego_entry = ego_entry->next)
1503 {
1504 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key);
1505 if (0 == memcmp (&pub_key,
1506 test_key,
1507 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)))
1508 {
1509 break;
1510 }
1511 }
1512 if (NULL == ego_entry)
1513 return GNUNET_NO;
1514 return GNUNET_YES;
1515}
1516
1517static void
1518store_ticket_reference (const struct RequestHandle *handle,
1519 const char* access_token,
1520 const struct GNUNET_RECLAIM_Ticket *ticket,
1521 const struct GNUNET_CRYPTO_EcdsaPublicKey *cid)
1522{
1523 struct GNUNET_HashCode cache_key;
1524 char *id_ticket_combination;
1525 char *ticket_string;
1526 char *client_id;
1527
1528 GNUNET_CRYPTO_hash(access_token, strlen(access_token), &cache_key);
1529 client_id = GNUNET_STRINGS_data_to_string_alloc (cid,
1530 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
1531 ticket_string = GNUNET_STRINGS_data_to_string_alloc (ticket,
1532 sizeof (struct GNUNET_RECLAIM_Ticket));
1533 GNUNET_asprintf(&id_ticket_combination,
1534 "%s;%s",
1535 client_id,
1536 ticket_string);
1537 GNUNET_CONTAINER_multihashmap_put(OIDC_interpret_access_token,
1538 &cache_key,
1539 id_ticket_combination,
1540 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
1541
1542 GNUNET_free (client_id);
1543 GNUNET_free (ticket_string);
1544}
1545
1546/**
1547 * Responds to token url-encoded POST request
1548 *
1549 * @param con_handle the connection handle
1550 * @param url the url
1551 * @param cls the RequestHandle
1552 */
1553static void
1554token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1555 const char* url,
1556 void *cls)
1557{
1558 struct RequestHandle *handle = cls;
1559 struct GNUNET_TIME_Relative expiration_time;
1560 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *cl;
1561 struct GNUNET_RECLAIM_Ticket *ticket;
1562 struct GNUNET_CRYPTO_EcdsaPublicKey cid;
1563 struct GNUNET_HashCode cache_key;
1564 struct MHD_Response *resp;
1565 char *grant_type;
1566 char *code;
1567 char *json_response;
1568 char *id_token;
1569 char *access_token;
1570 char *jwt_secret;
1571 char *nonce;
1572 int i = 1;
1573
1574 /*
1575 * Check Authorization
1576 */
1577 if (GNUNET_SYSERR == check_authorization (handle,
1578 &cid))
1579 {
1580 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1581 "OIDC authorization for token endpoint failed\n");
1516 GNUNET_SCHEDULER_add_now (&do_error, handle); 1582 GNUNET_SCHEDULER_add_now (&do_error, handle);
1517 return; 1583 return;
1518 } 1584 }
@@ -1524,27 +1590,25 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1524 //TODO Do not allow multiple equal parameter names 1590 //TODO Do not allow multiple equal parameter names
1525 //REQUIRED grant_type 1591 //REQUIRED grant_type
1526 GNUNET_CRYPTO_hash (OIDC_GRANT_TYPE_KEY, strlen (OIDC_GRANT_TYPE_KEY), &cache_key); 1592 GNUNET_CRYPTO_hash (OIDC_GRANT_TYPE_KEY, strlen (OIDC_GRANT_TYPE_KEY), &cache_key);
1527 if ( GNUNET_NO 1593 if (GNUNET_NO ==
1528 == GNUNET_CONTAINER_multihashmap_contains ( 1594 GNUNET_CONTAINER_multihashmap_contains (handle->rest_handle->url_param_map,
1529 handle->rest_handle->url_param_map, &cache_key) ) 1595 &cache_key))
1530 { 1596 {
1531 GNUNET_free_non_null(user_psw);
1532 handle->emsg = GNUNET_strdup("invalid_request"); 1597 handle->emsg = GNUNET_strdup("invalid_request");
1533 handle->edesc = GNUNET_strdup("missing parameter grant_type"); 1598 handle->edesc = GNUNET_strdup("missing parameter grant_type");
1534 handle->response_code = MHD_HTTP_BAD_REQUEST; 1599 handle->response_code = MHD_HTTP_BAD_REQUEST;
1535 GNUNET_SCHEDULER_add_now (&do_error, handle); 1600 GNUNET_SCHEDULER_add_now (&do_error, handle);
1536 return; 1601 return;
1537 } 1602 }
1538 grant_type = GNUNET_CONTAINER_multihashmap_get ( 1603 grant_type = GNUNET_CONTAINER_multihashmap_get (handle->rest_handle->url_param_map,
1539 handle->rest_handle->url_param_map, &cache_key); 1604 &cache_key);
1540 1605
1541 //REQUIRED code 1606 //REQUIRED code
1542 GNUNET_CRYPTO_hash (OIDC_CODE_KEY, strlen (OIDC_CODE_KEY), &cache_key); 1607 GNUNET_CRYPTO_hash (OIDC_CODE_KEY, strlen (OIDC_CODE_KEY), &cache_key);
1543 if ( GNUNET_NO 1608 if (GNUNET_NO ==
1544 == GNUNET_CONTAINER_multihashmap_contains ( 1609 GNUNET_CONTAINER_multihashmap_contains (handle->rest_handle->url_param_map,
1545 handle->rest_handle->url_param_map, &cache_key) ) 1610 &cache_key))
1546 { 1611 {
1547 GNUNET_free_non_null(user_psw);
1548 handle->emsg = GNUNET_strdup("invalid_request"); 1612 handle->emsg = GNUNET_strdup("invalid_request");
1549 handle->edesc = GNUNET_strdup("missing parameter code"); 1613 handle->edesc = GNUNET_strdup("missing parameter code");
1550 handle->response_code = MHD_HTTP_BAD_REQUEST; 1614 handle->response_code = MHD_HTTP_BAD_REQUEST;
@@ -1557,11 +1621,10 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1557 //REQUIRED redirect_uri 1621 //REQUIRED redirect_uri
1558 GNUNET_CRYPTO_hash (OIDC_REDIRECT_URI_KEY, strlen (OIDC_REDIRECT_URI_KEY), 1622 GNUNET_CRYPTO_hash (OIDC_REDIRECT_URI_KEY, strlen (OIDC_REDIRECT_URI_KEY),
1559 &cache_key); 1623 &cache_key);
1560 if ( GNUNET_NO 1624 if (GNUNET_NO ==
1561 == GNUNET_CONTAINER_multihashmap_contains ( 1625 GNUNET_CONTAINER_multihashmap_contains (handle->rest_handle->url_param_map,
1562 handle->rest_handle->url_param_map, &cache_key) ) 1626 &cache_key) )
1563 { 1627 {
1564 GNUNET_free_non_null(user_psw);
1565 handle->emsg = GNUNET_strdup("invalid_request"); 1628 handle->emsg = GNUNET_strdup("invalid_request");
1566 handle->edesc = GNUNET_strdup("missing parameter redirect_uri"); 1629 handle->edesc = GNUNET_strdup("missing parameter redirect_uri");
1567 handle->response_code = MHD_HTTP_BAD_REQUEST; 1630 handle->response_code = MHD_HTTP_BAD_REQUEST;
@@ -1572,21 +1635,18 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1572 //Check parameter grant_type == "authorization_code" 1635 //Check parameter grant_type == "authorization_code"
1573 if (0 != strcmp(OIDC_GRANT_TYPE_VALUE, grant_type)) 1636 if (0 != strcmp(OIDC_GRANT_TYPE_VALUE, grant_type))
1574 { 1637 {
1575 GNUNET_free_non_null(user_psw);
1576 handle->emsg=GNUNET_strdup("unsupported_grant_type"); 1638 handle->emsg=GNUNET_strdup("unsupported_grant_type");
1577 handle->response_code = MHD_HTTP_BAD_REQUEST; 1639 handle->response_code = MHD_HTTP_BAD_REQUEST;
1578 GNUNET_SCHEDULER_add_now (&do_error, handle); 1640 GNUNET_SCHEDULER_add_now (&do_error, handle);
1579 return; 1641 return;
1580 } 1642 }
1581 GNUNET_CRYPTO_hash (code, strlen (code), &cache_key); 1643 GNUNET_CRYPTO_hash (code, strlen (code), &cache_key);
1582 int i = 1; 1644 if (GNUNET_SYSERR ==
1583 if ( GNUNET_SYSERR 1645 GNUNET_CONTAINER_multihashmap_put (OIDC_ticket_once,
1584 == GNUNET_CONTAINER_multihashmap_put (OIDC_ticket_once, 1646 &cache_key,
1585 &cache_key, 1647 &i,
1586 &i, 1648 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY) )
1587 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY) )
1588 { 1649 {
1589 GNUNET_free_non_null(user_psw);
1590 handle->emsg = GNUNET_strdup("invalid_request"); 1650 handle->emsg = GNUNET_strdup("invalid_request");
1591 handle->edesc = GNUNET_strdup("Cannot use the same code more than once"); 1651 handle->edesc = GNUNET_strdup("Cannot use the same code more than once");
1592 handle->response_code = MHD_HTTP_BAD_REQUEST; 1652 handle->response_code = MHD_HTTP_BAD_REQUEST;
@@ -1595,16 +1655,11 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1595 } 1655 }
1596 1656
1597 //decode code 1657 //decode code
1598 GNUNET_STRINGS_base64_decode(code,strlen(code),&code_output); 1658 if(GNUNET_OK != OIDC_parse_authz_code (&cid,
1599 root = json_loads (code_output, 0, &error); 1659 code,
1600 GNUNET_free(code_output); 1660 &ticket,
1601 ticket_string = json_object_get (root, "ticket"); 1661 &nonce))
1602 nonce = json_object_get (root, "nonce");
1603 max_age = json_object_get (root, "max_age");
1604
1605 if(ticket_string == NULL && !json_is_string(ticket_string))
1606 { 1662 {
1607 GNUNET_free_non_null(user_psw);
1608 handle->emsg = GNUNET_strdup("invalid_request"); 1663 handle->emsg = GNUNET_strdup("invalid_request");
1609 handle->edesc = GNUNET_strdup("invalid code"); 1664 handle->edesc = GNUNET_strdup("invalid code");
1610 handle->response_code = MHD_HTTP_BAD_REQUEST; 1665 handle->response_code = MHD_HTTP_BAD_REQUEST;
@@ -1612,42 +1667,13 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1612 return; 1667 return;
1613 } 1668 }
1614 1669
1615 struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket = GNUNET_new(struct GNUNET_IDENTITY_PROVIDER_Ticket);
1616 if ( GNUNET_OK
1617 != GNUNET_STRINGS_string_to_data (json_string_value(ticket_string),
1618 strlen (json_string_value(ticket_string)),
1619 ticket,
1620 sizeof(struct GNUNET_IDENTITY_PROVIDER_Ticket)))
1621 {
1622 GNUNET_free_non_null(user_psw);
1623 handle->emsg = GNUNET_strdup("invalid_request");
1624 handle->edesc = GNUNET_strdup("invalid code");
1625 handle->response_code = MHD_HTTP_BAD_REQUEST;
1626 GNUNET_SCHEDULER_add_now (&do_error, handle);
1627 GNUNET_free(ticket);
1628 return;
1629 }
1630 // this is the current client (relying party)
1631 struct GNUNET_CRYPTO_EcdsaPublicKey pub_key;
1632 GNUNET_IDENTITY_ego_get_public_key(handle->ego_entry->ego,&pub_key);
1633 if (0 != memcmp(&pub_key,&ticket->audience,sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)))
1634 {
1635 GNUNET_free_non_null(user_psw);
1636 handle->emsg = GNUNET_strdup("invalid_request");
1637 handle->edesc = GNUNET_strdup("invalid code");
1638 handle->response_code = MHD_HTTP_BAD_REQUEST;
1639 GNUNET_SCHEDULER_add_now (&do_error, handle);
1640 GNUNET_free(ticket);
1641 return;
1642 }
1643
1644 //create jwt 1670 //create jwt
1645 unsigned long long int expiration_time; 1671 if (GNUNET_OK !=
1646 if ( GNUNET_OK 1672 GNUNET_CONFIGURATION_get_value_time(cfg,
1647 != GNUNET_CONFIGURATION_get_value_number(cfg, "identity-rest-plugin", 1673 "reclaim-rest-plugin",
1648 "expiration_time", &expiration_time) ) 1674 "expiration_time",
1675 &expiration_time))
1649 { 1676 {
1650 GNUNET_free_non_null(user_psw);
1651 handle->emsg = GNUNET_strdup("server_error"); 1677 handle->emsg = GNUNET_strdup("server_error");
1652 handle->edesc = GNUNET_strdup ("gnunet configuration failed"); 1678 handle->edesc = GNUNET_strdup ("gnunet configuration failed");
1653 handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; 1679 handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
@@ -1656,118 +1682,56 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1656 return; 1682 return;
1657 } 1683 }
1658 1684
1659 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *cl = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList);
1660 //aud REQUIRED public key client_id must be there
1661 GNUNET_IDENTITY_ATTRIBUTE_list_add(cl,
1662 "aud",
1663 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
1664 client_id,
1665 strlen(client_id));
1666 //exp REQUIRED time expired from config
1667 struct GNUNET_TIME_Absolute exp_time = GNUNET_TIME_relative_to_absolute (
1668 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_get_second_ (),
1669 expiration_time));
1670 const char* exp_time_string = GNUNET_STRINGS_absolute_time_to_string(exp_time);
1671 GNUNET_IDENTITY_ATTRIBUTE_list_add (cl,
1672 "exp",
1673 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
1674 exp_time_string,
1675 strlen(exp_time_string));
1676 //iat REQUIRED time now
1677 struct GNUNET_TIME_Absolute time_now = GNUNET_TIME_absolute_get();
1678 const char* time_now_string = GNUNET_STRINGS_absolute_time_to_string(time_now);
1679 GNUNET_IDENTITY_ATTRIBUTE_list_add (cl,
1680 "iat",
1681 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
1682 time_now_string,
1683 strlen(time_now_string));
1684 //nonce only if nonce is provided
1685 if ( NULL != nonce && json_is_string(nonce) )
1686 {
1687 GNUNET_IDENTITY_ATTRIBUTE_list_add (cl,
1688 "nonce",
1689 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
1690 json_string_value(nonce),
1691 strlen(json_string_value(nonce)));
1692 }
1693 //auth_time only if max_age is provided
1694 if ( NULL != max_age && json_is_string(max_age) )
1695 {
1696 GNUNET_IDENTITY_ATTRIBUTE_list_add (cl,
1697 "auth_time",
1698 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING,
1699 json_string_value(max_age),
1700 strlen(json_string_value(max_age)));
1701 }
1702 //TODO OPTIONAL acr,amr,azp
1703 1685
1704 struct EgoEntry *ego_entry; 1686 //TODO OPTIONAL acr,amr,azp
1705 for (ego_entry = handle->ego_head; NULL != ego_entry; ego_entry = ego_entry->next) 1687 if (GNUNET_NO == ego_exists (handle,
1688 &ticket->audience))
1706 { 1689 {
1707 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key); 1690 handle->emsg = GNUNET_strdup("invalid_request");
1708 if (0 == memcmp (&pub_key, &ticket->audience, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))) 1691 handle->edesc = GNUNET_strdup("invalid code...");
1709 { 1692 handle->response_code = MHD_HTTP_BAD_REQUEST;
1710 break; 1693 GNUNET_SCHEDULER_add_now (&do_error, handle);
1711 } 1694 GNUNET_free(ticket);
1712 } 1695 }
1713 if ( NULL == ego_entry ) 1696 if ( GNUNET_OK
1697 != GNUNET_CONFIGURATION_get_value_string (cfg, "reclaim-rest-plugin",
1698 "jwt_secret", &jwt_secret) )
1714 { 1699 {
1715 GNUNET_free_non_null(user_psw);
1716 handle->emsg = GNUNET_strdup("invalid_request"); 1700 handle->emsg = GNUNET_strdup("invalid_request");
1717 handle->edesc = GNUNET_strdup("invalid code...."); 1701 handle->edesc = GNUNET_strdup("No signing secret configured!");
1718 handle->response_code = MHD_HTTP_BAD_REQUEST; 1702 handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
1719 GNUNET_SCHEDULER_add_now (&do_error, handle); 1703 GNUNET_SCHEDULER_add_now (&do_error, handle);
1720 GNUNET_free(ticket); 1704 GNUNET_free(ticket);
1721 return; 1705 return;
1722 } 1706 }
1723 char *id_token = jwt_create_from_list(&ticket->audience, 1707 //TODO We should collect the attributes here. cl always empty
1724 cl, 1708 cl = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
1725 GNUNET_IDENTITY_ego_get_private_key(ego_entry->ego)); 1709 id_token = OIDC_id_token_new (&ticket->audience,
1726 1710 &ticket->identity,
1727 //Create random access_token 1711 cl,
1728 char* access_token_number; 1712 &expiration_time,
1729 char* access_token; 1713 (NULL != nonce) ? nonce : NULL,
1730 uint64_t random_number; 1714 jwt_secret);
1731 random_number = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_NONCE, UINT64_MAX); 1715 access_token = OIDC_access_token_new ();
1732 GNUNET_asprintf(&access_token_number, "%" PRIu64, random_number); 1716 OIDC_build_token_response (access_token,
1733 GNUNET_STRINGS_base64_encode(access_token_number,strlen(access_token_number),&access_token); 1717 id_token,
1734 1718 &expiration_time,
1735 1719 &json_response);
1736 1720
1737 //TODO OPTIONAL add refresh_token and scope 1721 store_ticket_reference (handle,
1738 GNUNET_asprintf (&json_response, 1722 access_token,
1739 "{ \"access_token\" : \"%s\", " 1723 ticket,
1740 "\"token_type\" : \"Bearer\", " 1724 &cid);
1741 "\"expires_in\" : %d, "
1742 "\"id_token\" : \"%s\"}",
1743 access_token,
1744 expiration_time,
1745 id_token);
1746 GNUNET_CRYPTO_hash(access_token, strlen(access_token), &cache_key);
1747 char *id_ticket_combination;
1748 GNUNET_asprintf(&id_ticket_combination,
1749 "%s;%s",
1750 client_id,
1751 json_string_value(ticket_string));
1752 GNUNET_CONTAINER_multihashmap_put(OIDC_interpret_access_token,
1753 &cache_key,
1754 id_ticket_combination,
1755 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
1756
1757 resp = GNUNET_REST_create_response (json_response); 1725 resp = GNUNET_REST_create_response (json_response);
1758 MHD_add_response_header (resp, "Cache-Control", "no-store"); 1726 MHD_add_response_header (resp, "Cache-Control", "no-store");
1759 MHD_add_response_header (resp, "Pragma", "no-cache"); 1727 MHD_add_response_header (resp, "Pragma", "no-cache");
1760 MHD_add_response_header (resp, "Content-Type", "application/json"); 1728 MHD_add_response_header (resp, "Content-Type", "application/json");
1761 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 1729 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
1762 1730 GNUNET_RECLAIM_ATTRIBUTE_list_destroy(cl);
1763 GNUNET_IDENTITY_ATTRIBUTE_list_destroy(cl);
1764 GNUNET_free(access_token_number);
1765 GNUNET_free(access_token); 1731 GNUNET_free(access_token);
1766 GNUNET_free(user_psw);
1767 GNUNET_free(json_response); 1732 GNUNET_free(json_response);
1768 GNUNET_free(ticket); 1733 GNUNET_free(ticket);
1769 GNUNET_free(id_token); 1734 GNUNET_free(id_token);
1770 json_decref (root);
1771 GNUNET_SCHEDULER_add_now(&cleanup_handle_delayed, handle); 1735 GNUNET_SCHEDULER_add_now(&cleanup_handle_delayed, handle);
1772} 1736}
1773 1737
@@ -1777,7 +1741,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1777static void 1741static void
1778consume_ticket (void *cls, 1742consume_ticket (void *cls,
1779 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 1743 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
1780 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 1744 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
1781{ 1745{
1782 struct RequestHandle *handle = cls; 1746 struct RequestHandle *handle = cls;
1783 char *tmp_value; 1747 char *tmp_value;
@@ -1789,9 +1753,9 @@ consume_ticket (void *cls,
1789 return; 1753 return;
1790 } 1754 }
1791 1755
1792 tmp_value = GNUNET_IDENTITY_ATTRIBUTE_value_to_string (attr->type, 1756 tmp_value = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
1793 attr->data, 1757 attr->data,
1794 attr->data_size); 1758 attr->data_size);
1795 1759
1796 value = json_string (tmp_value); 1760 value = json_string (tmp_value);
1797 1761
@@ -1820,7 +1784,7 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1820 struct GNUNET_HashCode cache_key; 1784 struct GNUNET_HashCode cache_key;
1821 char *authorization, *authorization_type, *authorization_access_token; 1785 char *authorization, *authorization_type, *authorization_access_token;
1822 char *client_ticket, *client, *ticket_str; 1786 char *client_ticket, *client, *ticket_str;
1823 struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket; 1787 struct GNUNET_RECLAIM_Ticket *ticket;
1824 1788
1825 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY, 1789 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY,
1826 strlen (OIDC_AUTHORIZATION_HEADER_KEY), 1790 strlen (OIDC_AUTHORIZATION_HEADER_KEY),
@@ -1918,12 +1882,12 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1918 GNUNET_free(client_ticket); 1882 GNUNET_free(client_ticket);
1919 return; 1883 return;
1920 } 1884 }
1921 ticket = GNUNET_new(struct GNUNET_IDENTITY_PROVIDER_Ticket); 1885 ticket = GNUNET_new(struct GNUNET_RECLAIM_Ticket);
1922 if ( GNUNET_OK 1886 if ( GNUNET_OK
1923 != GNUNET_STRINGS_string_to_data (ticket_str, 1887 != GNUNET_STRINGS_string_to_data (ticket_str,
1924 strlen (ticket_str), 1888 strlen (ticket_str),
1925 ticket, 1889 ticket,
1926 sizeof(struct GNUNET_IDENTITY_PROVIDER_Ticket))) 1890 sizeof(struct GNUNET_RECLAIM_Ticket)))
1927 { 1891 {
1928 handle->emsg = GNUNET_strdup("invalid_token"); 1892 handle->emsg = GNUNET_strdup("invalid_token");
1929 handle->edesc = GNUNET_strdup("The Access Token expired"); 1893 handle->edesc = GNUNET_strdup("The Access Token expired");
@@ -1935,15 +1899,15 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1935 return; 1899 return;
1936 } 1900 }
1937 1901
1938 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 1902 handle->idp = GNUNET_RECLAIM_connect (cfg);
1939 handle->oidc->response = json_object(); 1903 handle->oidc->response = json_object();
1940 json_object_set_new( handle->oidc->response, "sub", json_string( handle->ego_entry->keystring)); 1904 json_object_set_new( handle->oidc->response, "sub", json_string( handle->ego_entry->keystring));
1941 handle->idp_op = GNUNET_IDENTITY_PROVIDER_ticket_consume ( 1905 handle->idp_op = GNUNET_RECLAIM_ticket_consume (
1942 handle->idp, 1906 handle->idp,
1943 GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego), 1907 GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego),
1944 ticket, 1908 ticket,
1945 consume_ticket, 1909 consume_ticket,
1946 handle); 1910 handle);
1947 GNUNET_free(ticket); 1911 GNUNET_free(ticket);
1948 GNUNET_free(authorization); 1912 GNUNET_free(authorization);
1949 GNUNET_free(client_ticket); 1913 GNUNET_free(client_ticket);
@@ -2103,6 +2067,7 @@ rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle,
2103 handle->identity_handle = GNUNET_IDENTITY_connect (cfg, 2067 handle->identity_handle = GNUNET_IDENTITY_connect (cfg,
2104 &list_ego, 2068 &list_ego,
2105 handle); 2069 handle);
2070 handle->gns_handle = GNUNET_GNS_connect (cfg);
2106 handle->namestore_handle = GNUNET_NAMESTORE_connect (cfg); 2071 handle->namestore_handle = GNUNET_NAMESTORE_connect (cfg);
2107 handle->timeout_task = 2072 handle->timeout_task =
2108 GNUNET_SCHEDULER_add_delayed (handle->timeout, 2073 GNUNET_SCHEDULER_add_delayed (handle->timeout,
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/reclaim/plugin_rest_reclaim.c
index a83163db2..38ffc4ddb 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/reclaim/plugin_rest_reclaim.c
@@ -18,8 +18,8 @@
18/** 18/**
19 * @author Martin Schanzenbach 19 * @author Martin Schanzenbach
20 * @author Philippe Buschmann 20 * @author Philippe Buschmann
21 * @file identity/plugin_rest_identity.c 21 * @file reclaim/plugin_rest_reclaim.c
22 * @brief GNUnet Namestore REST plugin 22 * @brief GNUnet reclaim REST plugin
23 * 23 *
24 */ 24 */
25 25
@@ -36,38 +36,38 @@
36#include <jansson.h> 36#include <jansson.h>
37#include <inttypes.h> 37#include <inttypes.h>
38#include "gnunet_signatures.h" 38#include "gnunet_signatures.h"
39#include "gnunet_identity_attribute_lib.h" 39#include "gnunet_reclaim_attribute_lib.h"
40#include "gnunet_identity_provider_service.h" 40#include "gnunet_reclaim_service.h"
41 41
42/** 42/**
43 * REST root namespace 43 * REST root namespace
44 */ 44 */
45#define GNUNET_REST_API_NS_IDENTITY_PROVIDER "/idp" 45#define GNUNET_REST_API_NS_RECLAIM "/reclaim"
46 46
47/** 47/**
48 * Attribute namespace 48 * Attribute namespace
49 */ 49 */
50#define GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES "/idp/attributes" 50#define GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES "/reclaim/attributes"
51 51
52/** 52/**
53 * Ticket namespace 53 * Ticket namespace
54 */ 54 */
55#define GNUNET_REST_API_NS_IDENTITY_TICKETS "/idp/tickets" 55#define GNUNET_REST_API_NS_IDENTITY_TICKETS "/reclaim/tickets"
56 56
57/** 57/**
58 * Revoke namespace 58 * Revoke namespace
59 */ 59 */
60#define GNUNET_REST_API_NS_IDENTITY_REVOKE "/idp/revoke" 60#define GNUNET_REST_API_NS_IDENTITY_REVOKE "/reclaim/revoke"
61 61
62/** 62/**
63 * Revoke namespace 63 * Revoke namespace
64 */ 64 */
65#define GNUNET_REST_API_NS_IDENTITY_CONSUME "/idp/consume" 65#define GNUNET_REST_API_NS_IDENTITY_CONSUME "/reclaim/consume"
66 66
67/** 67/**
68 * Attribute key 68 * Attribute key
69 */ 69 */
70#define GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE "attribute" 70#define GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE "attribute"
71 71
72/** 72/**
73 * Ticket key 73 * Ticket key
@@ -78,7 +78,7 @@
78/** 78/**
79 * Value key 79 * Value key
80 */ 80 */
81#define GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE_VALUE "value" 81#define GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE_VALUE "value"
82 82
83/** 83/**
84 * State while collecting all egos 84 * State while collecting all egos
@@ -190,7 +190,7 @@ struct RequestHandle
190 /** 190 /**
191 * Attribute claim list 191 * Attribute claim list
192 */ 192 */
193 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list; 193 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attr_list;
194 194
195 /** 195 /**
196 * IDENTITY Operation 196 * IDENTITY Operation
@@ -200,27 +200,27 @@ struct RequestHandle
200 /** 200 /**
201 * Identity Provider 201 * Identity Provider
202 */ 202 */
203 struct GNUNET_IDENTITY_PROVIDER_Handle *idp; 203 struct GNUNET_RECLAIM_Handle *idp;
204 204
205 /** 205 /**
206 * Idp Operation 206 * Idp Operation
207 */ 207 */
208 struct GNUNET_IDENTITY_PROVIDER_Operation *idp_op; 208 struct GNUNET_RECLAIM_Operation *idp_op;
209 209
210 /** 210 /**
211 * Attribute iterator 211 * Attribute iterator
212 */ 212 */
213 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *attr_it; 213 struct GNUNET_RECLAIM_AttributeIterator *attr_it;
214 214
215 /** 215 /**
216 * Ticket iterator 216 * Ticket iterator
217 */ 217 */
218 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *ticket_it; 218 struct GNUNET_RECLAIM_TicketIterator *ticket_it;
219 219
220 /** 220 /**
221 * A ticket 221 * A ticket
222 */ 222 */
223 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 223 struct GNUNET_RECLAIM_Ticket ticket;
224 224
225 /** 225 /**
226 * Desired timeout for the lookup (default is no timeout). 226 * Desired timeout for the lookup (default is no timeout).
@@ -271,8 +271,8 @@ struct RequestHandle
271static void 271static void
272cleanup_handle (struct RequestHandle *handle) 272cleanup_handle (struct RequestHandle *handle)
273{ 273{
274 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *claim_entry; 274 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *claim_entry;
275 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *claim_tmp; 275 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *claim_tmp;
276 struct EgoEntry *ego_entry; 276 struct EgoEntry *ego_entry;
277 struct EgoEntry *ego_tmp; 277 struct EgoEntry *ego_tmp;
278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -284,11 +284,11 @@ cleanup_handle (struct RequestHandle *handle)
284 if (NULL != handle->identity_handle) 284 if (NULL != handle->identity_handle)
285 GNUNET_IDENTITY_disconnect (handle->identity_handle); 285 GNUNET_IDENTITY_disconnect (handle->identity_handle);
286 if (NULL != handle->attr_it) 286 if (NULL != handle->attr_it)
287 GNUNET_IDENTITY_PROVIDER_get_attributes_stop (handle->attr_it); 287 GNUNET_RECLAIM_get_attributes_stop (handle->attr_it);
288 if (NULL != handle->ticket_it) 288 if (NULL != handle->ticket_it)
289 GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (handle->ticket_it); 289 GNUNET_RECLAIM_ticket_iteration_stop (handle->ticket_it);
290 if (NULL != handle->idp) 290 if (NULL != handle->idp)
291 GNUNET_IDENTITY_PROVIDER_disconnect (handle->idp); 291 GNUNET_RECLAIM_disconnect (handle->idp);
292 if (NULL != handle->url) 292 if (NULL != handle->url)
293 GNUNET_free (handle->url); 293 GNUNET_free (handle->url);
294 if (NULL != handle->emsg) 294 if (NULL != handle->emsg)
@@ -435,7 +435,7 @@ collect_finished_cb (void *cls)
435 */ 435 */
436static void 436static void
437ticket_collect (void *cls, 437ticket_collect (void *cls,
438 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket) 438 const struct GNUNET_RECLAIM_Ticket *ticket)
439{ 439{
440 struct GNUNET_JSONAPI_Resource *json_resource; 440 struct GNUNET_JSONAPI_Resource *json_resource;
441 struct RequestHandle *handle = cls; 441 struct RequestHandle *handle = cls;
@@ -474,7 +474,7 @@ ticket_collect (void *cls,
474 value); 474 value);
475 GNUNET_free (tmp); 475 GNUNET_free (tmp);
476 json_decref (value); 476 json_decref (value);
477 GNUNET_IDENTITY_PROVIDER_ticket_iteration_next (handle->ticket_it); 477 GNUNET_RECLAIM_ticket_iteration_next (handle->ticket_it);
478} 478}
479 479
480 480
@@ -523,8 +523,8 @@ list_tickets_cont (struct GNUNET_REST_RequestHandle *con_handle,
523 return; 523 return;
524 } 524 }
525 priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); 525 priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego);
526 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 526 handle->idp = GNUNET_RECLAIM_connect (cfg);
527 handle->ticket_it = GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (handle->idp, 527 handle->ticket_it = GNUNET_RECLAIM_ticket_iteration_start (handle->idp,
528 priv_key, 528 priv_key,
529 &collect_error_cb, 529 &collect_error_cb,
530 handle, 530 handle,
@@ -549,7 +549,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
549 struct RequestHandle *handle = cls; 549 struct RequestHandle *handle = cls;
550 struct EgoEntry *ego_entry; 550 struct EgoEntry *ego_entry;
551 struct MHD_Response *resp; 551 struct MHD_Response *resp;
552 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attribute; 552 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attribute;
553 struct GNUNET_JSONAPI_Document *json_obj; 553 struct GNUNET_JSONAPI_Document *json_obj;
554 struct GNUNET_JSONAPI_Resource *json_res; 554 struct GNUNET_JSONAPI_Resource *json_res;
555 struct GNUNET_TIME_Relative exp; 555 struct GNUNET_TIME_Relative exp;
@@ -565,14 +565,14 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
565 565
566 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding an attribute for %s.\n", 566 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding an attribute for %s.\n",
567 handle->url); 567 handle->url);
568 if ( strlen (GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES) >= 568 if ( strlen (GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES) >=
569 strlen (handle->url)) 569 strlen (handle->url))
570 { 570 {
571 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); 571 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n");
572 GNUNET_SCHEDULER_add_now (&do_error, handle); 572 GNUNET_SCHEDULER_add_now (&do_error, handle);
573 return; 573 return;
574 } 574 }
575 identity = handle->url + strlen (GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES) + 1; 575 identity = handle->url + strlen (GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES) + 1;
576 576
577 for (ego_entry = handle->ego_head; 577 for (ego_entry = handle->ego_head;
578 NULL != ego_entry; 578 NULL != ego_entry;
@@ -625,7 +625,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
625 } 625 }
626 json_res = GNUNET_JSONAPI_document_get_resource (json_obj, 0); 626 json_res = GNUNET_JSONAPI_document_get_resource (json_obj, 0);
627 if (GNUNET_NO == GNUNET_JSONAPI_resource_check_type (json_res, 627 if (GNUNET_NO == GNUNET_JSONAPI_resource_check_type (json_res,
628 GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE)) 628 GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE))
629 { 629 {
630 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 630 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
631 "Unsupported JSON data type\n"); 631 "Unsupported JSON data type\n");
@@ -651,12 +651,12 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
651 value_json = GNUNET_JSONAPI_resource_read_attr (json_res, 651 value_json = GNUNET_JSONAPI_resource_read_attr (json_res,
652 "value"); 652 "value");
653 value_str = json_string_value (value_json); 653 value_str = json_string_value (value_json);
654 attribute = GNUNET_IDENTITY_ATTRIBUTE_claim_new (name_str, 654 attribute = GNUNET_RECLAIM_ATTRIBUTE_claim_new (name_str,
655 GNUNET_IDENTITY_ATTRIBUTE_TYPE_STRING, 655 GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING,
656 value_str, 656 value_str,
657 strlen (value_str) + 1); 657 strlen (value_str) + 1);
658 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 658 handle->idp = GNUNET_RECLAIM_connect (cfg);
659 handle->idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (handle->idp, 659 handle->idp_op = GNUNET_RECLAIM_attribute_store (handle->idp,
660 identity_priv, 660 identity_priv,
661 attribute, 661 attribute,
662 &exp, 662 &exp,
@@ -675,7 +675,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
675static void 675static void
676attr_collect (void *cls, 676attr_collect (void *cls,
677 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 677 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
678 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 678 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
679{ 679{
680 struct GNUNET_JSONAPI_Resource *json_resource; 680 struct GNUNET_JSONAPI_Resource *json_resource;
681 struct RequestHandle *handle = cls; 681 struct RequestHandle *handle = cls;
@@ -684,17 +684,17 @@ attr_collect (void *cls,
684 684
685 if ((NULL == attr->name) || (NULL == attr->data)) 685 if ((NULL == attr->name) || (NULL == attr->data))
686 { 686 {
687 GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); 687 GNUNET_RECLAIM_get_attributes_next (handle->attr_it);
688 return; 688 return;
689 } 689 }
690 690
691 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute: %s\n", 691 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute: %s\n",
692 attr->name); 692 attr->name);
693 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE, 693 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE,
694 attr->name); 694 attr->name);
695 GNUNET_JSONAPI_document_resource_add (handle->resp_object, json_resource); 695 GNUNET_JSONAPI_document_resource_add (handle->resp_object, json_resource);
696 696
697 tmp_value = GNUNET_IDENTITY_ATTRIBUTE_value_to_string (attr->type, 697 tmp_value = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
698 attr->data, 698 attr->data,
699 attr->data_size); 699 attr->data_size);
700 700
@@ -705,7 +705,7 @@ attr_collect (void *cls,
705 value); 705 value);
706 json_decref (value); 706 json_decref (value);
707 GNUNET_free(tmp_value); 707 GNUNET_free(tmp_value);
708 GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); 708 GNUNET_RECLAIM_get_attributes_next (handle->attr_it);
709} 709}
710 710
711 711
@@ -729,14 +729,14 @@ list_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
729 729
730 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting attributes for %s.\n", 730 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting attributes for %s.\n",
731 handle->url); 731 handle->url);
732 if ( strlen (GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES) >= 732 if ( strlen (GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES) >=
733 strlen (handle->url)) 733 strlen (handle->url))
734 { 734 {
735 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); 735 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n");
736 GNUNET_SCHEDULER_add_now (&do_error, handle); 736 GNUNET_SCHEDULER_add_now (&do_error, handle);
737 return; 737 return;
738 } 738 }
739 identity = handle->url + strlen (GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES) + 1; 739 identity = handle->url + strlen (GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES) + 1;
740 740
741 for (ego_entry = handle->ego_head; 741 for (ego_entry = handle->ego_head;
742 NULL != ego_entry; 742 NULL != ego_entry;
@@ -755,8 +755,8 @@ list_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
755 return; 755 return;
756 } 756 }
757 priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); 757 priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego);
758 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 758 handle->idp = GNUNET_RECLAIM_connect (cfg);
759 handle->attr_it = GNUNET_IDENTITY_PROVIDER_get_attributes_start (handle->idp, 759 handle->attr_it = GNUNET_RECLAIM_get_attributes_start (handle->idp,
760 priv_key, 760 priv_key,
761 &collect_error_cb, 761 &collect_error_cb,
762 handle, 762 handle,
@@ -780,7 +780,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
780 struct RequestHandle *handle = cls; 780 struct RequestHandle *handle = cls;
781 struct EgoEntry *ego_entry; 781 struct EgoEntry *ego_entry;
782 struct MHD_Response *resp; 782 struct MHD_Response *resp;
783 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 783 struct GNUNET_RECLAIM_Ticket ticket;
784 struct GNUNET_JSONAPI_Document *json_obj; 784 struct GNUNET_JSONAPI_Document *json_obj;
785 struct GNUNET_JSONAPI_Resource *json_res; 785 struct GNUNET_JSONAPI_Resource *json_res;
786 struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk; 786 struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk;
@@ -844,7 +844,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
844 rnd_json = GNUNET_JSONAPI_resource_read_attr (json_res, 844 rnd_json = GNUNET_JSONAPI_resource_read_attr (json_res,
845 "rnd"); 845 "rnd");
846 identity_json = GNUNET_JSONAPI_resource_read_attr (json_res, 846 identity_json = GNUNET_JSONAPI_resource_read_attr (json_res,
847 "identity"); 847 "issuer");
848 audience_json = GNUNET_JSONAPI_resource_read_attr (json_res, 848 audience_json = GNUNET_JSONAPI_resource_read_attr (json_res,
849 "audience"); 849 "audience");
850 rnd_str = json_string_value (rnd_json); 850 rnd_str = json_string_value (rnd_json);
@@ -884,8 +884,8 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
884 } 884 }
885 identity_priv = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); 885 identity_priv = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego);
886 886
887 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 887 handle->idp = GNUNET_RECLAIM_connect (cfg);
888 handle->idp_op = GNUNET_IDENTITY_PROVIDER_ticket_revoke (handle->idp, 888 handle->idp_op = GNUNET_RECLAIM_ticket_revoke (handle->idp,
889 identity_priv, 889 identity_priv,
890 &ticket, 890 &ticket,
891 &finished_cont, 891 &finished_cont,
@@ -896,7 +896,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
896static void 896static void
897consume_cont (void *cls, 897consume_cont (void *cls,
898 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 898 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
899 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr) 899 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
900{ 900{
901 struct RequestHandle *handle = cls; 901 struct RequestHandle *handle = cls;
902 struct GNUNET_JSONAPI_Resource *json_resource; 902 struct GNUNET_JSONAPI_Resource *json_resource;
@@ -910,7 +910,7 @@ consume_cont (void *cls,
910 910
911 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute: %s\n", 911 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute: %s\n",
912 attr->name); 912 attr->name);
913 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_IDENTITY_ATTRIBUTE, 913 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_RECLAIM_ATTRIBUTE,
914 attr->name); 914 attr->name);
915 GNUNET_JSONAPI_document_resource_add (handle->resp_object, json_resource); 915 GNUNET_JSONAPI_document_resource_add (handle->resp_object, json_resource);
916 916
@@ -934,7 +934,7 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
934 struct RequestHandle *handle = cls; 934 struct RequestHandle *handle = cls;
935 struct EgoEntry *ego_entry; 935 struct EgoEntry *ego_entry;
936 struct MHD_Response *resp; 936 struct MHD_Response *resp;
937 struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; 937 struct GNUNET_RECLAIM_Ticket ticket;
938 struct GNUNET_JSONAPI_Document *json_obj; 938 struct GNUNET_JSONAPI_Document *json_obj;
939 struct GNUNET_JSONAPI_Resource *json_res; 939 struct GNUNET_JSONAPI_Resource *json_res;
940 struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk; 940 struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk;
@@ -1038,8 +1038,8 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1038 } 1038 }
1039 identity_priv = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); 1039 identity_priv = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego);
1040 handle->resp_object = GNUNET_JSONAPI_document_new (); 1040 handle->resp_object = GNUNET_JSONAPI_document_new ();
1041 handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); 1041 handle->idp = GNUNET_RECLAIM_connect (cfg);
1042 handle->idp_op = GNUNET_IDENTITY_PROVIDER_ticket_consume (handle->idp, 1042 handle->idp_op = GNUNET_RECLAIM_ticket_consume (handle->idp,
1043 identity_priv, 1043 identity_priv,
1044 &ticket, 1044 &ticket,
1045 &consume_cont, 1045 &consume_cont,
@@ -1084,12 +1084,12 @@ init_cont (struct RequestHandle *handle)
1084{ 1084{
1085 struct GNUNET_REST_RequestHandlerError err; 1085 struct GNUNET_REST_RequestHandlerError err;
1086 static const struct GNUNET_REST_RequestHandler handlers[] = { 1086 static const struct GNUNET_REST_RequestHandler handlers[] = {
1087 {MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES, &list_attribute_cont}, 1087 {MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES, &list_attribute_cont},
1088 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY_ATTRIBUTES, &add_attribute_cont}, 1088 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES, &add_attribute_cont},
1089 {MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_TICKETS, &list_tickets_cont}, 1089 {MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_TICKETS, &list_tickets_cont},
1090 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY_REVOKE, &revoke_ticket_cont}, 1090 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY_REVOKE, &revoke_ticket_cont},
1091 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY_CONSUME, &consume_ticket_cont}, 1091 {MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY_CONSUME, &consume_ticket_cont},
1092 {MHD_HTTP_METHOD_OPTIONS, GNUNET_REST_API_NS_IDENTITY_PROVIDER, 1092 {MHD_HTTP_METHOD_OPTIONS, GNUNET_REST_API_NS_RECLAIM,
1093 &options_cont}, 1093 &options_cont},
1094 GNUNET_REST_HANDLER_END 1094 GNUNET_REST_HANDLER_END
1095 }; 1095 };
@@ -1202,7 +1202,7 @@ rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle,
1202 * @return NULL on error, otherwise the plugin context 1202 * @return NULL on error, otherwise the plugin context
1203 */ 1203 */
1204void * 1204void *
1205libgnunet_plugin_rest_identity_provider_init (void *cls) 1205libgnunet_plugin_rest_reclaim_init (void *cls)
1206{ 1206{
1207 static struct Plugin plugin; 1207 static struct Plugin plugin;
1208 struct GNUNET_REST_Plugin *api; 1208 struct GNUNET_REST_Plugin *api;
@@ -1214,7 +1214,7 @@ libgnunet_plugin_rest_identity_provider_init (void *cls)
1214 plugin.cfg = cfg; 1214 plugin.cfg = cfg;
1215 api = GNUNET_new (struct GNUNET_REST_Plugin); 1215 api = GNUNET_new (struct GNUNET_REST_Plugin);
1216 api->cls = &plugin; 1216 api->cls = &plugin;
1217 api->name = GNUNET_REST_API_NS_IDENTITY_PROVIDER; 1217 api->name = GNUNET_REST_API_NS_RECLAIM;
1218 api->process_request = &rest_identity_process_request; 1218 api->process_request = &rest_identity_process_request;
1219 GNUNET_asprintf (&allow_methods, 1219 GNUNET_asprintf (&allow_methods,
1220 "%s, %s, %s, %s, %s", 1220 "%s, %s, %s, %s, %s",
@@ -1237,7 +1237,7 @@ libgnunet_plugin_rest_identity_provider_init (void *cls)
1237 * @return always NULL 1237 * @return always NULL
1238 */ 1238 */
1239void * 1239void *
1240libgnunet_plugin_rest_identity_provider_done (void *cls) 1240libgnunet_plugin_rest_reclaim_done (void *cls)
1241{ 1241{
1242 struct GNUNET_REST_Plugin *api = cls; 1242 struct GNUNET_REST_Plugin *api = cls;
1243 struct Plugin *plugin = api->cls; 1243 struct Plugin *plugin = api->cls;
@@ -1250,4 +1250,4 @@ libgnunet_plugin_rest_identity_provider_done (void *cls)
1250 return NULL; 1250 return NULL;
1251} 1251}
1252 1252
1253/* end of plugin_rest_identity_provider.c */ 1253/* end of plugin_rest_reclaim.c */
diff --git a/src/identity-provider/identity-provider.conf b/src/reclaim/reclaim.conf
index cc50152a1..cf0a0dc5e 100644
--- a/src/identity-provider/identity-provider.conf
+++ b/src/reclaim/reclaim.conf
@@ -1,22 +1,23 @@
1[identity-provider] 1[reclaim]
2START_ON_DEMAND = NO 2START_ON_DEMAND = NO
3RUN_PER_USER = YES 3RUN_PER_USER = YES
4#PORT = 2108 4#PORT = 2108
5HOSTNAME = localhost 5HOSTNAME = localhost
6BINARY = gnunet-service-identity-provider 6BINARY = gnunet-service-reclaim
7ACCEPT_FROM = 127.0.0.1; 7ACCEPT_FROM = 127.0.0.1;
8ACCEPT_FROM6 = ::1; 8ACCEPT_FROM6 = ::1;
9UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-identity-provider.sock 9UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-reclaim.sock
10UNIX_MATCH_UID = NO 10UNIX_MATCH_UID = NO
11UNIX_MATCH_GID = YES 11UNIX_MATCH_GID = YES
12TOKEN_EXPIRATION_INTERVAL = 30 m 12TOKEN_EXPIRATION_INTERVAL = 30 m
13DATABASE = sqlite 13DATABASE = sqlite
14 14
15[identity-rest-plugin] 15[reclaim-rest-plugin]
16#ADDRESS = https://identity.gnu:8000#/login 16#ADDRESS = https://identity.gnu:8000#/login
17ADDRESS = https://reclaim.ui/#/login 17ADDRESS = https://reclaim.ui/#/login
18PSW = secret 18PSW = secret
19EXPIRATION_TIME = 3600 19JWT_SECRET = secret
20EXPIRATION_TIME = 1d
20 21
21[identity-provider-sqlite] 22[reclaim-sqlite]
22FILENAME = $GNUNET_DATA_HOME/identity-provider/sqlite.db 23FILENAME = $GNUNET_DATA_HOME/reclaim/sqlite.db
diff --git a/src/identity-provider/identity_provider.h b/src/reclaim/reclaim.h
index 6a4b7769f..d2c84686d 100644
--- a/src/identity-provider/identity_provider.h
+++ b/src/reclaim/reclaim.h
@@ -18,13 +18,13 @@
18 18
19/** 19/**
20 * @author Martin Schanzenbach 20 * @author Martin Schanzenbach
21 * @file identity-provider/identity_provider.h 21 * @file reclaim/reclaim.h
22 * 22 *
23 * @brief Common type definitions for the identity provider 23 * @brief Common type definitions for the identity provider
24 * service and API. 24 * service and API.
25 */ 25 */
26#ifndef IDENTITY_PROVIDER_H 26#ifndef RECLAIM_H
27#define IDENTITY_PROVIDER_H 27#define RECLAIM_H
28 28
29#include "gnunet_common.h" 29#include "gnunet_common.h"
30 30
@@ -152,7 +152,7 @@ struct AttributeIterationStartMessage
152struct AttributeIterationNextMessage 152struct AttributeIterationNextMessage
153{ 153{
154 /** 154 /**
155 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT 155 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
156 */ 156 */
157 struct GNUNET_MessageHeader header; 157 struct GNUNET_MessageHeader header;
158 158
@@ -170,7 +170,7 @@ struct AttributeIterationNextMessage
170struct AttributeIterationStopMessage 170struct AttributeIterationStopMessage
171{ 171{
172 /** 172 /**
173 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP 173 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
174 */ 174 */
175 struct GNUNET_MessageHeader header; 175 struct GNUNET_MessageHeader header;
176 176
@@ -214,7 +214,7 @@ struct TicketIterationStartMessage
214struct TicketIterationNextMessage 214struct TicketIterationNextMessage
215{ 215{
216 /** 216 /**
217 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT 217 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
218 */ 218 */
219 struct GNUNET_MessageHeader header; 219 struct GNUNET_MessageHeader header;
220 220
@@ -232,7 +232,7 @@ struct TicketIterationNextMessage
232struct TicketIterationStopMessage 232struct TicketIterationStopMessage
233{ 233{
234 /** 234 /**
235 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP 235 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
236 */ 236 */
237 struct GNUNET_MessageHeader header; 237 struct GNUNET_MessageHeader header;
238 238
@@ -251,7 +251,7 @@ struct TicketIterationStopMessage
251struct IssueTicketMessage 251struct IssueTicketMessage
252{ 252{
253 /** 253 /**
254 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET 254 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
255 */ 255 */
256 struct GNUNET_MessageHeader header; 256 struct GNUNET_MessageHeader header;
257 257
@@ -284,7 +284,7 @@ struct IssueTicketMessage
284struct RevokeTicketMessage 284struct RevokeTicketMessage
285{ 285{
286 /** 286 /**
287 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET 287 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
288 */ 288 */
289 struct GNUNET_MessageHeader header; 289 struct GNUNET_MessageHeader header;
290 290
@@ -312,7 +312,7 @@ struct RevokeTicketMessage
312struct RevokeTicketResultMessage 312struct RevokeTicketResultMessage
313{ 313{
314 /** 314 /**
315 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT 315 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
316 */ 316 */
317 struct GNUNET_MessageHeader header; 317 struct GNUNET_MessageHeader header;
318 318
@@ -334,7 +334,7 @@ struct RevokeTicketResultMessage
334struct TicketResultMessage 334struct TicketResultMessage
335{ 335{
336 /** 336 /**
337 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT 337 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
338 */ 338 */
339 struct GNUNET_MessageHeader header; 339 struct GNUNET_MessageHeader header;
340 340
@@ -351,7 +351,7 @@ struct TicketResultMessage
351struct ConsumeTicketMessage 351struct ConsumeTicketMessage
352{ 352{
353 /** 353 /**
354 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET 354 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
355 */ 355 */
356 struct GNUNET_MessageHeader header; 356 struct GNUNET_MessageHeader header;
357 357
diff --git a/src/identity-provider/identity_provider_api.c b/src/reclaim/reclaim_api.c
index 772b4a244..3f1584ccd 100644
--- a/src/identity-provider/identity_provider_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -17,8 +17,8 @@
17*/ 17*/
18 18
19/** 19/**
20 * @file identity-provider/identity_provider_api.c 20 * @file reclaim/reclaim_api.c
21 * @brief api to interact with the identity provider service 21 * @brief api to interact with the reclaim service
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
@@ -26,33 +26,33 @@
26#include "gnunet_constants.h" 26#include "gnunet_constants.h"
27#include "gnunet_protocols.h" 27#include "gnunet_protocols.h"
28#include "gnunet_mq_lib.h" 28#include "gnunet_mq_lib.h"
29#include "gnunet_identity_provider_service.h" 29#include "gnunet_reclaim_service.h"
30#include "gnunet_identity_attribute_lib.h" 30#include "gnunet_reclaim_attribute_lib.h"
31#include "identity_provider.h" 31#include "reclaim.h"
32 32
33#define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "reclaim-api",__VA_ARGS__)
34 34
35 35
36/** 36/**
37 * Handle for an operation with the service. 37 * Handle for an operation with the service.
38 */ 38 */
39struct GNUNET_IDENTITY_PROVIDER_Operation 39struct GNUNET_RECLAIM_Operation
40{ 40{
41 41
42 /** 42 /**
43 * Main handle. 43 * Main handle.
44 */ 44 */
45 struct GNUNET_IDENTITY_PROVIDER_Handle *h; 45 struct GNUNET_RECLAIM_Handle *h;
46 46
47 /** 47 /**
48 * We keep operations in a DLL. 48 * We keep operations in a DLL.
49 */ 49 */
50 struct GNUNET_IDENTITY_PROVIDER_Operation *next; 50 struct GNUNET_RECLAIM_Operation *next;
51 51
52 /** 52 /**
53 * We keep operations in a DLL. 53 * We keep operations in a DLL.
54 */ 54 */
55 struct GNUNET_IDENTITY_PROVIDER_Operation *prev; 55 struct GNUNET_RECLAIM_Operation *prev;
56 56
57 /** 57 /**
58 * Message to send to the service. 58 * Message to send to the service.
@@ -63,22 +63,22 @@ struct GNUNET_IDENTITY_PROVIDER_Operation
63 /** 63 /**
64 * Continuation to invoke after attribute store call 64 * Continuation to invoke after attribute store call
65 */ 65 */
66 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus as_cb; 66 GNUNET_RECLAIM_ContinuationWithStatus as_cb;
67 67
68 /** 68 /**
69 * Attribute result callback 69 * Attribute result callback
70 */ 70 */
71 GNUNET_IDENTITY_PROVIDER_AttributeResult ar_cb; 71 GNUNET_RECLAIM_AttributeResult ar_cb;
72 72
73 /** 73 /**
74 * Revocation result callback 74 * Revocation result callback
75 */ 75 */
76 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus rvk_cb; 76 GNUNET_RECLAIM_ContinuationWithStatus rvk_cb;
77 77
78 /** 78 /**
79 * Ticket result callback 79 * Ticket result callback
80 */ 80 */
81 GNUNET_IDENTITY_PROVIDER_TicketCallback tr_cb; 81 GNUNET_RECLAIM_TicketCallback tr_cb;
82 82
83 /** 83 /**
84 * Envelope with the message for this queue entry. 84 * Envelope with the message for this queue entry.
@@ -100,23 +100,23 @@ struct GNUNET_IDENTITY_PROVIDER_Operation
100/** 100/**
101 * Handle for a ticket iterator operation 101 * Handle for a ticket iterator operation
102 */ 102 */
103struct GNUNET_IDENTITY_PROVIDER_TicketIterator 103struct GNUNET_RECLAIM_TicketIterator
104{ 104{
105 105
106 /** 106 /**
107 * Kept in a DLL. 107 * Kept in a DLL.
108 */ 108 */
109 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *next; 109 struct GNUNET_RECLAIM_TicketIterator *next;
110 110
111 /** 111 /**
112 * Kept in a DLL. 112 * Kept in a DLL.
113 */ 113 */
114 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *prev; 114 struct GNUNET_RECLAIM_TicketIterator *prev;
115 115
116 /** 116 /**
117 * Main handle to access the idp. 117 * Main handle to access the idp.
118 */ 118 */
119 struct GNUNET_IDENTITY_PROVIDER_Handle *h; 119 struct GNUNET_RECLAIM_Handle *h;
120 120
121 /** 121 /**
122 * Function to call on completion. 122 * Function to call on completion.
@@ -131,7 +131,7 @@ struct GNUNET_IDENTITY_PROVIDER_TicketIterator
131 /** 131 /**
132 * The continuation to call with the results 132 * The continuation to call with the results
133 */ 133 */
134 GNUNET_IDENTITY_PROVIDER_TicketCallback tr_cb; 134 GNUNET_RECLAIM_TicketCallback tr_cb;
135 135
136 /** 136 /**
137 * Closure for @e tr_cb. 137 * Closure for @e tr_cb.
@@ -165,23 +165,23 @@ struct GNUNET_IDENTITY_PROVIDER_TicketIterator
165/** 165/**
166 * Handle for a attribute iterator operation 166 * Handle for a attribute iterator operation
167 */ 167 */
168struct GNUNET_IDENTITY_PROVIDER_AttributeIterator 168struct GNUNET_RECLAIM_AttributeIterator
169{ 169{
170 170
171 /** 171 /**
172 * Kept in a DLL. 172 * Kept in a DLL.
173 */ 173 */
174 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *next; 174 struct GNUNET_RECLAIM_AttributeIterator *next;
175 175
176 /** 176 /**
177 * Kept in a DLL. 177 * Kept in a DLL.
178 */ 178 */
179 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *prev; 179 struct GNUNET_RECLAIM_AttributeIterator *prev;
180 180
181 /** 181 /**
182 * Main handle to access the idp. 182 * Main handle to access the idp.
183 */ 183 */
184 struct GNUNET_IDENTITY_PROVIDER_Handle *h; 184 struct GNUNET_RECLAIM_Handle *h;
185 185
186 /** 186 /**
187 * Function to call on completion. 187 * Function to call on completion.
@@ -196,7 +196,7 @@ struct GNUNET_IDENTITY_PROVIDER_AttributeIterator
196 /** 196 /**
197 * The continuation to call with the results 197 * The continuation to call with the results
198 */ 198 */
199 GNUNET_IDENTITY_PROVIDER_AttributeResult proc; 199 GNUNET_RECLAIM_AttributeResult proc;
200 200
201 /** 201 /**
202 * Closure for @e proc. 202 * Closure for @e proc.
@@ -235,7 +235,7 @@ struct GNUNET_IDENTITY_PROVIDER_AttributeIterator
235/** 235/**
236 * Handle for the service. 236 * Handle for the service.
237 */ 237 */
238struct GNUNET_IDENTITY_PROVIDER_Handle 238struct GNUNET_RECLAIM_Handle
239{ 239{
240 /** 240 /**
241 * Configuration to use. 241 * Configuration to use.
@@ -255,32 +255,32 @@ struct GNUNET_IDENTITY_PROVIDER_Handle
255 /** 255 /**
256 * Head of active operations. 256 * Head of active operations.
257 */ 257 */
258 struct GNUNET_IDENTITY_PROVIDER_Operation *op_head; 258 struct GNUNET_RECLAIM_Operation *op_head;
259 259
260 /** 260 /**
261 * Tail of active operations. 261 * Tail of active operations.
262 */ 262 */
263 struct GNUNET_IDENTITY_PROVIDER_Operation *op_tail; 263 struct GNUNET_RECLAIM_Operation *op_tail;
264 264
265 /** 265 /**
266 * Head of active iterations 266 * Head of active iterations
267 */ 267 */
268 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it_head; 268 struct GNUNET_RECLAIM_AttributeIterator *it_head;
269 269
270 /** 270 /**
271 * Tail of active iterations 271 * Tail of active iterations
272 */ 272 */
273 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it_tail; 273 struct GNUNET_RECLAIM_AttributeIterator *it_tail;
274 274
275 /** 275 /**
276 * Head of active iterations 276 * Head of active iterations
277 */ 277 */
278 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *ticket_it_head; 278 struct GNUNET_RECLAIM_TicketIterator *ticket_it_head;
279 279
280 /** 280 /**
281 * Tail of active iterations 281 * Tail of active iterations
282 */ 282 */
283 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *ticket_it_tail; 283 struct GNUNET_RECLAIM_TicketIterator *ticket_it_tail;
284 284
285 285
286 /** 286 /**
@@ -318,10 +318,10 @@ struct GNUNET_IDENTITY_PROVIDER_Handle
318/** 318/**
319 * Try again to connect to the service. 319 * Try again to connect to the service.
320 * 320 *
321 * @param h handle to the identity provider service. 321 * @param h handle to the reclaim service.
322 */ 322 */
323static void 323static void
324reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h); 324reconnect (struct GNUNET_RECLAIM_Handle *h);
325 325
326/** 326/**
327 * Reconnect 327 * Reconnect
@@ -331,7 +331,7 @@ reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h);
331static void 331static void
332reconnect_task (void *cls) 332reconnect_task (void *cls)
333{ 333{
334 struct GNUNET_IDENTITY_PROVIDER_Handle *handle = cls; 334 struct GNUNET_RECLAIM_Handle *handle = cls;
335 335
336 handle->reconnect_task = NULL; 336 handle->reconnect_task = NULL;
337 reconnect (handle); 337 reconnect (handle);
@@ -344,7 +344,7 @@ reconnect_task (void *cls)
344 * @param handle our service 344 * @param handle our service
345 */ 345 */
346static void 346static void
347force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle) 347force_reconnect (struct GNUNET_RECLAIM_Handle *handle)
348{ 348{
349 GNUNET_MQ_destroy (handle->mq); 349 GNUNET_MQ_destroy (handle->mq);
350 handle->mq = NULL; 350 handle->mq = NULL;
@@ -362,9 +362,9 @@ force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle)
362 * @param it entry to free 362 * @param it entry to free
363 */ 363 */
364static void 364static void
365free_it (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it) 365free_it (struct GNUNET_RECLAIM_AttributeIterator *it)
366{ 366{
367 struct GNUNET_IDENTITY_PROVIDER_Handle *h = it->h; 367 struct GNUNET_RECLAIM_Handle *h = it->h;
368 368
369 GNUNET_CONTAINER_DLL_remove (h->it_head, 369 GNUNET_CONTAINER_DLL_remove (h->it_head,
370 h->it_tail, 370 h->it_tail,
@@ -375,7 +375,7 @@ free_it (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it)
375} 375}
376 376
377static void 377static void
378free_op (struct GNUNET_IDENTITY_PROVIDER_Operation* op) 378free_op (struct GNUNET_RECLAIM_Operation* op)
379{ 379{
380 if (NULL == op) 380 if (NULL == op)
381 return; 381 return;
@@ -397,7 +397,7 @@ static void
397mq_error_handler (void *cls, 397mq_error_handler (void *cls,
398 enum GNUNET_MQ_Error error) 398 enum GNUNET_MQ_Error error)
399{ 399{
400 struct GNUNET_IDENTITY_PROVIDER_Handle *handle = cls; 400 struct GNUNET_RECLAIM_Handle *handle = cls;
401 force_reconnect (handle); 401 force_reconnect (handle);
402} 402}
403 403
@@ -412,8 +412,8 @@ static void
412handle_attribute_store_response (void *cls, 412handle_attribute_store_response (void *cls,
413 const struct AttributeStoreResultMessage *msg) 413 const struct AttributeStoreResultMessage *msg)
414{ 414{
415 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls; 415 struct GNUNET_RECLAIM_Handle *h = cls;
416 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 416 struct GNUNET_RECLAIM_Operation *op;
417 uint32_t r_id = ntohl (msg->id); 417 uint32_t r_id = ntohl (msg->id);
418 int res; 418 int res;
419 const char *emsg; 419 const char *emsg;
@@ -448,7 +448,7 @@ handle_attribute_store_response (void *cls,
448 448
449/** 449/**
450 * Handle an incoming message of type 450 * Handle an incoming message of type
451 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT 451 * #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT
452 * 452 *
453 * @param cls 453 * @param cls
454 * @param msg the message we received 454 * @param msg the message we received
@@ -474,7 +474,7 @@ check_consume_ticket_result (void *cls,
474 474
475/** 475/**
476 * Handle an incoming message of type 476 * Handle an incoming message of type
477 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT 477 * #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT
478 * 478 *
479 * @param cls 479 * @param cls
480 * @param msg the message we received 480 * @param msg the message we received
@@ -483,8 +483,8 @@ static void
483handle_consume_ticket_result (void *cls, 483handle_consume_ticket_result (void *cls,
484 const struct ConsumeTicketResultMessage *msg) 484 const struct ConsumeTicketResultMessage *msg)
485{ 485{
486 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls; 486 struct GNUNET_RECLAIM_Handle *h = cls;
487 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 487 struct GNUNET_RECLAIM_Operation *op;
488 size_t attrs_len; 488 size_t attrs_len;
489 uint32_t r_id = ntohl (msg->id); 489 uint32_t r_id = ntohl (msg->id);
490 490
@@ -500,9 +500,9 @@ handle_consume_ticket_result (void *cls,
500 return; 500 return;
501 501
502 { 502 {
503 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs; 503 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs;
504 struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; 504 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
505 attrs = GNUNET_IDENTITY_ATTRIBUTE_list_deserialize ((char*)&msg[1], 505 attrs = GNUNET_RECLAIM_ATTRIBUTE_list_deserialize ((char*)&msg[1],
506 attrs_len); 506 attrs_len);
507 if (NULL != op->ar_cb) 507 if (NULL != op->ar_cb)
508 { 508 {
@@ -518,7 +518,7 @@ handle_consume_ticket_result (void *cls,
518 op->ar_cb (op->cls, 518 op->ar_cb (op->cls,
519 &msg->identity, 519 &msg->identity,
520 le->claim); 520 le->claim);
521 GNUNET_IDENTITY_ATTRIBUTE_list_destroy (attrs); 521 GNUNET_RECLAIM_ATTRIBUTE_list_destroy (attrs);
522 } 522 }
523 } 523 }
524 if (NULL != op) 524 if (NULL != op)
@@ -539,7 +539,7 @@ handle_consume_ticket_result (void *cls,
539 539
540/** 540/**
541 * Handle an incoming message of type 541 * Handle an incoming message of type
542 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT 542 * #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT
543 * 543 *
544 * @param cls 544 * @param cls
545 * @param msg the message we received 545 * @param msg the message we received
@@ -565,7 +565,7 @@ check_attribute_result (void *cls,
565 565
566/** 566/**
567 * Handle an incoming message of type 567 * Handle an incoming message of type
568 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT 568 * #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT
569 * 569 *
570 * @param cls 570 * @param cls
571 * @param msg the message we received 571 * @param msg the message we received
@@ -575,9 +575,9 @@ handle_attribute_result (void *cls,
575 const struct AttributeResultMessage *msg) 575 const struct AttributeResultMessage *msg)
576{ 576{
577 static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy; 577 static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy;
578 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls; 578 struct GNUNET_RECLAIM_Handle *h = cls;
579 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it; 579 struct GNUNET_RECLAIM_AttributeIterator *it;
580 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 580 struct GNUNET_RECLAIM_Operation *op;
581 size_t attr_len; 581 size_t attr_len;
582 uint32_t r_id = ntohl (msg->id); 582 uint32_t r_id = ntohl (msg->id);
583 583
@@ -627,8 +627,8 @@ handle_attribute_result (void *cls,
627 } 627 }
628 628
629 { 629 {
630 struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr; 630 struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr;
631 attr = GNUNET_IDENTITY_ATTRIBUTE_deserialize ((char*)&msg[1], 631 attr = GNUNET_RECLAIM_ATTRIBUTE_deserialize ((char*)&msg[1],
632 attr_len); 632 attr_len);
633 if (NULL != it) 633 if (NULL != it)
634 { 634 {
@@ -652,7 +652,7 @@ handle_attribute_result (void *cls,
652 652
653/** 653/**
654 * Handle an incoming message of type 654 * Handle an incoming message of type
655 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT 655 * #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
656 * 656 *
657 * @param cls 657 * @param cls
658 * @param msg the message we received 658 * @param msg the message we received
@@ -677,7 +677,7 @@ check_ticket_result (void *cls,
677 677
678/** 678/**
679 * Handle an incoming message of type 679 * Handle an incoming message of type
680 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT 680 * #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
681 * 681 *
682 * @param cls 682 * @param cls
683 * @param msg the message we received 683 * @param msg the message we received
@@ -686,10 +686,10 @@ static void
686handle_ticket_result (void *cls, 686handle_ticket_result (void *cls,
687 const struct TicketResultMessage *msg) 687 const struct TicketResultMessage *msg)
688{ 688{
689 struct GNUNET_IDENTITY_PROVIDER_Handle *handle = cls; 689 struct GNUNET_RECLAIM_Handle *handle = cls;
690 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 690 struct GNUNET_RECLAIM_Operation *op;
691 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it; 691 struct GNUNET_RECLAIM_TicketIterator *it;
692 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket; 692 const struct GNUNET_RECLAIM_Ticket *ticket;
693 uint32_t r_id = ntohl (msg->id); 693 uint32_t r_id = ntohl (msg->id);
694 size_t msg_len; 694 size_t msg_len;
695 695
@@ -712,7 +712,7 @@ handle_ticket_result (void *cls,
712 if (NULL != op->tr_cb) 712 if (NULL != op->tr_cb)
713 op->tr_cb (op->cls, NULL); 713 op->tr_cb (op->cls, NULL);
714 } else { 714 } else {
715 ticket = (struct GNUNET_IDENTITY_PROVIDER_Ticket *)&msg[1]; 715 ticket = (struct GNUNET_RECLAIM_Ticket *)&msg[1];
716 if (NULL != op->tr_cb) 716 if (NULL != op->tr_cb)
717 op->tr_cb (op->cls, ticket); 717 op->tr_cb (op->cls, ticket);
718 } 718 }
@@ -728,7 +728,7 @@ handle_ticket_result (void *cls,
728 it->finish_cb (it->finish_cb_cls); 728 it->finish_cb (it->finish_cb_cls);
729 GNUNET_free (it); 729 GNUNET_free (it);
730 } else { 730 } else {
731 ticket = (struct GNUNET_IDENTITY_PROVIDER_Ticket *)&msg[1]; 731 ticket = (struct GNUNET_RECLAIM_Ticket *)&msg[1];
732 if (NULL != it->tr_cb) 732 if (NULL != it->tr_cb)
733 it->tr_cb (it->cls, ticket); 733 it->tr_cb (it->cls, ticket);
734 } 734 }
@@ -740,7 +740,7 @@ handle_ticket_result (void *cls,
740 740
741/** 741/**
742 * Handle an incoming message of type 742 * Handle an incoming message of type
743 * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT 743 * #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
744 * 744 *
745 * @param cls 745 * @param cls
746 * @param msg the message we received 746 * @param msg the message we received
@@ -749,8 +749,8 @@ static void
749handle_revoke_ticket_result (void *cls, 749handle_revoke_ticket_result (void *cls,
750 const struct RevokeTicketResultMessage *msg) 750 const struct RevokeTicketResultMessage *msg)
751{ 751{
752 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls; 752 struct GNUNET_RECLAIM_Handle *h = cls;
753 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 753 struct GNUNET_RECLAIM_Operation *op;
754 uint32_t r_id = ntohl (msg->id); 754 uint32_t r_id = ntohl (msg->id);
755 int32_t success; 755 int32_t success;
756 756
@@ -785,42 +785,42 @@ handle_revoke_ticket_result (void *cls,
785/** 785/**
786 * Try again to connect to the service. 786 * Try again to connect to the service.
787 * 787 *
788 * @param h handle to the identity provider service. 788 * @param h handle to the reclaim service.
789 */ 789 */
790static void 790static void
791reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) 791reconnect (struct GNUNET_RECLAIM_Handle *h)
792{ 792{
793 struct GNUNET_MQ_MessageHandler handlers[] = { 793 struct GNUNET_MQ_MessageHandler handlers[] = {
794 GNUNET_MQ_hd_fixed_size (attribute_store_response, 794 GNUNET_MQ_hd_fixed_size (attribute_store_response,
795 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE_RESPONSE, 795 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE_RESPONSE,
796 struct AttributeStoreResultMessage, 796 struct AttributeStoreResultMessage,
797 h), 797 h),
798 GNUNET_MQ_hd_var_size (attribute_result, 798 GNUNET_MQ_hd_var_size (attribute_result,
799 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_RESULT, 799 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT,
800 struct AttributeResultMessage, 800 struct AttributeResultMessage,
801 h), 801 h),
802 GNUNET_MQ_hd_var_size (ticket_result, 802 GNUNET_MQ_hd_var_size (ticket_result,
803 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT, 803 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT,
804 struct TicketResultMessage, 804 struct TicketResultMessage,
805 h), 805 h),
806 GNUNET_MQ_hd_var_size (consume_ticket_result, 806 GNUNET_MQ_hd_var_size (consume_ticket_result,
807 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET_RESULT, 807 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT,
808 struct ConsumeTicketResultMessage, 808 struct ConsumeTicketResultMessage,
809 h), 809 h),
810 GNUNET_MQ_hd_fixed_size (revoke_ticket_result, 810 GNUNET_MQ_hd_fixed_size (revoke_ticket_result,
811 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT, 811 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT,
812 struct RevokeTicketResultMessage, 812 struct RevokeTicketResultMessage,
813 h), 813 h),
814 GNUNET_MQ_handler_end () 814 GNUNET_MQ_handler_end ()
815 }; 815 };
816 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 816 struct GNUNET_RECLAIM_Operation *op;
817 817
818 GNUNET_assert (NULL == h->mq); 818 GNUNET_assert (NULL == h->mq);
819 LOG (GNUNET_ERROR_TYPE_DEBUG, 819 LOG (GNUNET_ERROR_TYPE_DEBUG,
820 "Connecting to identity provider service.\n"); 820 "Connecting to reclaim service.\n");
821 821
822 h->mq = GNUNET_CLIENT_connect (h->cfg, 822 h->mq = GNUNET_CLIENT_connect (h->cfg,
823 "identity-provider", 823 "reclaim",
824 handlers, 824 handlers,
825 &mq_error_handler, 825 &mq_error_handler,
826 h); 826 h);
@@ -833,17 +833,17 @@ reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
833 833
834 834
835/** 835/**
836 * Connect to the identity provider service. 836 * Connect to the reclaim service.
837 * 837 *
838 * @param cfg the configuration to use 838 * @param cfg the configuration to use
839 * @return handle to use 839 * @return handle to use
840 */ 840 */
841struct GNUNET_IDENTITY_PROVIDER_Handle * 841struct GNUNET_RECLAIM_Handle *
842GNUNET_IDENTITY_PROVIDER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) 842GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
843{ 843{
844 struct GNUNET_IDENTITY_PROVIDER_Handle *h; 844 struct GNUNET_RECLAIM_Handle *h;
845 845
846 h = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Handle); 846 h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
847 h->cfg = cfg; 847 h->cfg = cfg;
848 reconnect (h); 848 reconnect (h);
849 if (NULL == h->mq) 849 if (NULL == h->mq)
@@ -864,9 +864,9 @@ GNUNET_IDENTITY_PROVIDER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
864 * @param op operation to cancel 864 * @param op operation to cancel
865 */ 865 */
866void 866void
867GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op) 867GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op)
868{ 868{
869 struct GNUNET_IDENTITY_PROVIDER_Handle *h = op->h; 869 struct GNUNET_RECLAIM_Handle *h = op->h;
870 870
871 GNUNET_CONTAINER_DLL_remove (h->op_head, 871 GNUNET_CONTAINER_DLL_remove (h->op_head,
872 h->op_tail, 872 h->op_tail,
@@ -881,7 +881,7 @@ GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op)
881 * @param h handle to destroy 881 * @param h handle to destroy
882 */ 882 */
883void 883void
884GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) 884GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h)
885{ 885{
886 GNUNET_assert (NULL != h); 886 GNUNET_assert (NULL != h);
887 if (NULL != h->mq) 887 if (NULL != h->mq)
@@ -902,7 +902,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
902 * Store an attribute. If the attribute is already present, 902 * Store an attribute. If the attribute is already present,
903 * it is replaced with the new attribute. 903 * it is replaced with the new attribute.
904 * 904 *
905 * @param h handle to the identity provider 905 * @param h handle to the reclaim
906 * @param pkey private key of the identity 906 * @param pkey private key of the identity
907 * @param attr the attribute value 907 * @param attr the attribute value
908 * @param exp_interval the relative expiration interval for the attribute 908 * @param exp_interval the relative expiration interval for the attribute
@@ -910,19 +910,19 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
910 * @param cont_cls closure for @a cont 910 * @param cont_cls closure for @a cont
911 * @return handle to abort the request 911 * @return handle to abort the request
912 */ 912 */
913struct GNUNET_IDENTITY_PROVIDER_Operation * 913struct GNUNET_RECLAIM_Operation *
914GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 914GNUNET_RECLAIM_attribute_store (struct GNUNET_RECLAIM_Handle *h,
915 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 915 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
916 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr, 916 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
917 const struct GNUNET_TIME_Relative *exp_interval, 917 const struct GNUNET_TIME_Relative *exp_interval,
918 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont, 918 GNUNET_RECLAIM_ContinuationWithStatus cont,
919 void *cont_cls) 919 void *cont_cls)
920{ 920{
921 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 921 struct GNUNET_RECLAIM_Operation *op;
922 struct AttributeStoreMessage *sam; 922 struct AttributeStoreMessage *sam;
923 size_t attr_len; 923 size_t attr_len;
924 924
925 op = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Operation); 925 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
926 op->h = h; 926 op->h = h;
927 op->as_cb = cont; 927 op->as_cb = cont;
928 op->cls = cont_cls; 928 op->cls = cont_cls;
@@ -930,15 +930,15 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
930 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, 930 GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
931 h->op_tail, 931 h->op_tail,
932 op); 932 op);
933 attr_len = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size (attr); 933 attr_len = GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (attr);
934 op->env = GNUNET_MQ_msg_extra (sam, 934 op->env = GNUNET_MQ_msg_extra (sam,
935 attr_len, 935 attr_len,
936 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE); 936 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE);
937 sam->identity = *pkey; 937 sam->identity = *pkey;
938 sam->id = htonl (op->r_id); 938 sam->id = htonl (op->r_id);
939 sam->exp = GNUNET_htonll (exp_interval->rel_value_us); 939 sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
940 940
941 GNUNET_IDENTITY_ATTRIBUTE_serialize (attr, 941 GNUNET_RECLAIM_ATTRIBUTE_serialize (attr,
942 (char*)&sam[1]); 942 (char*)&sam[1]);
943 943
944 sam->attr_len = htons (attr_len); 944 sam->attr_len = htons (attr_len);
@@ -952,11 +952,11 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
952 952
953/** 953/**
954 * List all attributes for a local identity. 954 * List all attributes for a local identity.
955 * This MUST lock the `struct GNUNET_IDENTITY_PROVIDER_Handle` 955 * This MUST lock the `struct GNUNET_RECLAIM_Handle`
956 * for any other calls than #GNUNET_IDENTITY_PROVIDER_get_attributes_next() and 956 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and
957 * #GNUNET_IDENTITY_PROVIDER_get_attributes_stop. @a proc will be called once 957 * #GNUNET_RECLAIM_get_attributes_stop. @a proc will be called once
958 * immediately, and then again after 958 * immediately, and then again after
959 * #GNUNET_IDENTITY_PROVIDER_get_attributes_next() is invoked. 959 * #GNUNET_RECLAIM_get_attributes_next() is invoked.
960 * 960 *
961 * On error (disconnect), @a error_cb will be invoked. 961 * On error (disconnect), @a error_cb will be invoked.
962 * On normal completion, @a finish_cb proc will be 962 * On normal completion, @a finish_cb proc will be
@@ -975,23 +975,23 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
975 * @param finish_cb_cls closure for @a finish_cb 975 * @param finish_cb_cls closure for @a finish_cb
976 * @return an iterator handle to use for iteration 976 * @return an iterator handle to use for iteration
977 */ 977 */
978struct GNUNET_IDENTITY_PROVIDER_AttributeIterator * 978struct GNUNET_RECLAIM_AttributeIterator *
979GNUNET_IDENTITY_PROVIDER_get_attributes_start (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 979GNUNET_RECLAIM_get_attributes_start (struct GNUNET_RECLAIM_Handle *h,
980 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 980 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
981 GNUNET_SCHEDULER_TaskCallback error_cb, 981 GNUNET_SCHEDULER_TaskCallback error_cb,
982 void *error_cb_cls, 982 void *error_cb_cls,
983 GNUNET_IDENTITY_PROVIDER_AttributeResult proc, 983 GNUNET_RECLAIM_AttributeResult proc,
984 void *proc_cls, 984 void *proc_cls,
985 GNUNET_SCHEDULER_TaskCallback finish_cb, 985 GNUNET_SCHEDULER_TaskCallback finish_cb,
986 void *finish_cb_cls) 986 void *finish_cb_cls)
987{ 987{
988 struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it; 988 struct GNUNET_RECLAIM_AttributeIterator *it;
989 struct GNUNET_MQ_Envelope *env; 989 struct GNUNET_MQ_Envelope *env;
990 struct AttributeIterationStartMessage *msg; 990 struct AttributeIterationStartMessage *msg;
991 uint32_t rid; 991 uint32_t rid;
992 992
993 rid = h->r_id_gen++; 993 rid = h->r_id_gen++;
994 it = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator); 994 it = GNUNET_new (struct GNUNET_RECLAIM_AttributeIterator);
995 it->h = h; 995 it->h = h;
996 it->error_cb = error_cb; 996 it->error_cb = error_cb;
997 it->error_cb_cls = error_cb_cls; 997 it->error_cb_cls = error_cb_cls;
@@ -1005,7 +1005,7 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_start (struct GNUNET_IDENTITY_PROVIDER_H
1005 h->it_tail, 1005 h->it_tail,
1006 it); 1006 it);
1007 env = GNUNET_MQ_msg (msg, 1007 env = GNUNET_MQ_msg (msg,
1008 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_START); 1008 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START);
1009 msg->id = htonl (rid); 1009 msg->id = htonl (rid);
1010 msg->identity = *identity; 1010 msg->identity = *identity;
1011 if (NULL == h->mq) 1011 if (NULL == h->mq)
@@ -1018,20 +1018,20 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_start (struct GNUNET_IDENTITY_PROVIDER_H
1018 1018
1019 1019
1020/** 1020/**
1021 * Calls the record processor specified in #GNUNET_IDENTITY_PROVIDER_get_attributes_start 1021 * Calls the record processor specified in #GNUNET_RECLAIM_get_attributes_start
1022 * for the next record. 1022 * for the next record.
1023 * 1023 *
1024 * @param it the iterator 1024 * @param it the iterator
1025 */ 1025 */
1026void 1026void
1027GNUNET_IDENTITY_PROVIDER_get_attributes_next (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it) 1027GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it)
1028{ 1028{
1029 struct GNUNET_IDENTITY_PROVIDER_Handle *h = it->h; 1029 struct GNUNET_RECLAIM_Handle *h = it->h;
1030 struct AttributeIterationNextMessage *msg; 1030 struct AttributeIterationNextMessage *msg;
1031 struct GNUNET_MQ_Envelope *env; 1031 struct GNUNET_MQ_Envelope *env;
1032 1032
1033 env = GNUNET_MQ_msg (msg, 1033 env = GNUNET_MQ_msg (msg,
1034 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT); 1034 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT);
1035 msg->id = htonl (it->r_id); 1035 msg->id = htonl (it->r_id);
1036 GNUNET_MQ_send (h->mq, 1036 GNUNET_MQ_send (h->mq,
1037 env); 1037 env);
@@ -1041,21 +1041,21 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_next (struct GNUNET_IDENTITY_PROVIDER_At
1041/** 1041/**
1042 * Stops iteration and releases the idp handle for further calls. Must 1042 * Stops iteration and releases the idp handle for further calls. Must
1043 * be called on any iteration that has not yet completed prior to calling 1043 * be called on any iteration that has not yet completed prior to calling
1044 * #GNUNET_IDENTITY_PROVIDER_disconnect. 1044 * #GNUNET_RECLAIM_disconnect.
1045 * 1045 *
1046 * @param it the iterator 1046 * @param it the iterator
1047 */ 1047 */
1048void 1048void
1049GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it) 1049GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it)
1050{ 1050{
1051 struct GNUNET_IDENTITY_PROVIDER_Handle *h = it->h; 1051 struct GNUNET_RECLAIM_Handle *h = it->h;
1052 struct GNUNET_MQ_Envelope *env; 1052 struct GNUNET_MQ_Envelope *env;
1053 struct AttributeIterationStopMessage *msg; 1053 struct AttributeIterationStopMessage *msg;
1054 1054
1055 if (NULL != h->mq) 1055 if (NULL != h->mq)
1056 { 1056 {
1057 env = GNUNET_MQ_msg (msg, 1057 env = GNUNET_MQ_msg (msg,
1058 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP); 1058 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP);
1059 msg->id = htonl (it->r_id); 1059 msg->id = htonl (it->r_id);
1060 GNUNET_MQ_send (h->mq, 1060 GNUNET_MQ_send (h->mq,
1061 env); 1061 env);
@@ -1066,10 +1066,10 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At
1066 1066
1067/** TODO 1067/** TODO
1068 * Issues a ticket to another identity. The identity may use 1068 * Issues a ticket to another identity. The identity may use
1069 * @GNUNET_IDENTITY_PROVIDER_authorization_ticket_consume to consume the ticket 1069 * @GNUNET_RECLAIM_authorization_ticket_consume to consume the ticket
1070 * and retrieve the attributes specified in the AttributeList. 1070 * and retrieve the attributes specified in the AttributeList.
1071 * 1071 *
1072 * @param h the identity provider to use 1072 * @param h the reclaim to use
1073 * @param iss the issuing identity 1073 * @param iss the issuing identity
1074 * @param rp the subject of the ticket (the relying party) 1074 * @param rp the subject of the ticket (the relying party)
1075 * @param attrs the attributes that the relying party is given access to 1075 * @param attrs the attributes that the relying party is given access to
@@ -1077,19 +1077,19 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At
1077 * @param cb_cls the callback closure 1077 * @param cb_cls the callback closure
1078 * @return handle to abort the operation 1078 * @return handle to abort the operation
1079 */ 1079 */
1080struct GNUNET_IDENTITY_PROVIDER_Operation * 1080struct GNUNET_RECLAIM_Operation *
1081GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1081GNUNET_RECLAIM_ticket_issue (struct GNUNET_RECLAIM_Handle *h,
1082 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 1082 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
1083 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 1083 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
1084 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 1084 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
1085 GNUNET_IDENTITY_PROVIDER_TicketCallback cb, 1085 GNUNET_RECLAIM_TicketCallback cb,
1086 void *cb_cls) 1086 void *cb_cls)
1087{ 1087{
1088 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 1088 struct GNUNET_RECLAIM_Operation *op;
1089 struct IssueTicketMessage *tim; 1089 struct IssueTicketMessage *tim;
1090 size_t attr_len; 1090 size_t attr_len;
1091 1091
1092 op = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Operation); 1092 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1093 op->h = h; 1093 op->h = h;
1094 op->tr_cb = cb; 1094 op->tr_cb = cb;
1095 op->cls = cb_cls; 1095 op->cls = cb_cls;
@@ -1097,15 +1097,15 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1097 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, 1097 GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
1098 h->op_tail, 1098 h->op_tail,
1099 op); 1099 op);
1100 attr_len = GNUNET_IDENTITY_ATTRIBUTE_list_serialize_get_size (attrs); 1100 attr_len = GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (attrs);
1101 op->env = GNUNET_MQ_msg_extra (tim, 1101 op->env = GNUNET_MQ_msg_extra (tim,
1102 attr_len, 1102 attr_len,
1103 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET); 1103 GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET);
1104 tim->identity = *iss; 1104 tim->identity = *iss;
1105 tim->rp = *rp; 1105 tim->rp = *rp;
1106 tim->id = htonl (op->r_id); 1106 tim->id = htonl (op->r_id);
1107 1107
1108 GNUNET_IDENTITY_ATTRIBUTE_list_serialize (attrs, 1108 GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs,
1109 (char*)&tim[1]); 1109 (char*)&tim[1]);
1110 1110
1111 tim->attr_len = htons (attr_len); 1111 tim->attr_len = htons (attr_len);
@@ -1119,24 +1119,24 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h
1119 * Consumes an issued ticket. The ticket is persisted 1119 * Consumes an issued ticket. The ticket is persisted
1120 * and used to retrieve identity information from the issuer 1120 * and used to retrieve identity information from the issuer
1121 * 1121 *
1122 * @param h the identity provider to use 1122 * @param h the reclaim to use
1123 * @param identity the identity that is the subject of the issued ticket (the relying party) 1123 * @param identity the identity that is the subject of the issued ticket (the relying party)
1124 * @param ticket the issued ticket to consume 1124 * @param ticket the issued ticket to consume
1125 * @param cb the callback to call 1125 * @param cb the callback to call
1126 * @param cb_cls the callback closure 1126 * @param cb_cls the callback closure
1127 * @return handle to abort the operation 1127 * @return handle to abort the operation
1128 */ 1128 */
1129struct GNUNET_IDENTITY_PROVIDER_Operation * 1129struct GNUNET_RECLAIM_Operation *
1130GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1130GNUNET_RECLAIM_ticket_consume (struct GNUNET_RECLAIM_Handle *h,
1131 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 1131 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
1132 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1132 const struct GNUNET_RECLAIM_Ticket *ticket,
1133 GNUNET_IDENTITY_PROVIDER_AttributeResult cb, 1133 GNUNET_RECLAIM_AttributeResult cb,
1134 void *cb_cls) 1134 void *cb_cls)
1135{ 1135{
1136 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 1136 struct GNUNET_RECLAIM_Operation *op;
1137 struct ConsumeTicketMessage *ctm; 1137 struct ConsumeTicketMessage *ctm;
1138 1138
1139 op = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Operation); 1139 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1140 op->h = h; 1140 op->h = h;
1141 op->ar_cb = cb; 1141 op->ar_cb = cb;
1142 op->cls = cb_cls; 1142 op->cls = cb_cls;
@@ -1145,14 +1145,14 @@ GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle
1145 h->op_tail, 1145 h->op_tail,
1146 op); 1146 op);
1147 op->env = GNUNET_MQ_msg_extra (ctm, 1147 op->env = GNUNET_MQ_msg_extra (ctm,
1148 sizeof (const struct GNUNET_IDENTITY_PROVIDER_Ticket), 1148 sizeof (const struct GNUNET_RECLAIM_Ticket),
1149 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET); 1149 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET);
1150 ctm->identity = *identity; 1150 ctm->identity = *identity;
1151 ctm->id = htonl (op->r_id); 1151 ctm->id = htonl (op->r_id);
1152 1152
1153 GNUNET_memcpy ((char*)&ctm[1], 1153 GNUNET_memcpy ((char*)&ctm[1],
1154 ticket, 1154 ticket,
1155 sizeof (const struct GNUNET_IDENTITY_PROVIDER_Ticket)); 1155 sizeof (const struct GNUNET_RECLAIM_Ticket));
1156 1156
1157 if (NULL != h->mq) 1157 if (NULL != h->mq)
1158 GNUNET_MQ_send_copy (h->mq, 1158 GNUNET_MQ_send_copy (h->mq,
@@ -1166,7 +1166,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle
1166 * Lists all tickets that have been issued to remote 1166 * Lists all tickets that have been issued to remote
1167 * identites (relying parties) 1167 * identites (relying parties)
1168 * 1168 *
1169 * @param h the identity provider to use 1169 * @param h the reclaim to use
1170 * @param identity the issuing identity 1170 * @param identity the issuing identity
1171 * @param error_cb function to call on error (i.e. disconnect), 1171 * @param error_cb function to call on error (i.e. disconnect),
1172 * the handle is afterwards invalid 1172 * the handle is afterwards invalid
@@ -1179,17 +1179,17 @@ GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle
1179 * @param finish_cb_cls closure for @a finish_cb 1179 * @param finish_cb_cls closure for @a finish_cb
1180 * @return an iterator handle to use for iteration 1180 * @return an iterator handle to use for iteration
1181 */ 1181 */
1182struct GNUNET_IDENTITY_PROVIDER_TicketIterator * 1182struct GNUNET_RECLAIM_TicketIterator *
1183GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1183GNUNET_RECLAIM_ticket_iteration_start (struct GNUNET_RECLAIM_Handle *h,
1184 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 1184 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
1185 GNUNET_SCHEDULER_TaskCallback error_cb, 1185 GNUNET_SCHEDULER_TaskCallback error_cb,
1186 void *error_cb_cls, 1186 void *error_cb_cls,
1187 GNUNET_IDENTITY_PROVIDER_TicketCallback proc, 1187 GNUNET_RECLAIM_TicketCallback proc,
1188 void *proc_cls, 1188 void *proc_cls,
1189 GNUNET_SCHEDULER_TaskCallback finish_cb, 1189 GNUNET_SCHEDULER_TaskCallback finish_cb,
1190 void *finish_cb_cls) 1190 void *finish_cb_cls)
1191{ 1191{
1192 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it; 1192 struct GNUNET_RECLAIM_TicketIterator *it;
1193 struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub; 1193 struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub;
1194 struct GNUNET_MQ_Envelope *env; 1194 struct GNUNET_MQ_Envelope *env;
1195 struct TicketIterationStartMessage *msg; 1195 struct TicketIterationStartMessage *msg;
@@ -1198,7 +1198,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
1198 GNUNET_CRYPTO_ecdsa_key_get_public (identity, 1198 GNUNET_CRYPTO_ecdsa_key_get_public (identity,
1199 &identity_pub); 1199 &identity_pub);
1200 rid = h->r_id_gen++; 1200 rid = h->r_id_gen++;
1201 it = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_TicketIterator); 1201 it = GNUNET_new (struct GNUNET_RECLAIM_TicketIterator);
1202 it->h = h; 1202 it->h = h;
1203 it->error_cb = error_cb; 1203 it->error_cb = error_cb;
1204 it->error_cb_cls = error_cb_cls; 1204 it->error_cb_cls = error_cb_cls;
@@ -1211,7 +1211,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
1211 h->ticket_it_tail, 1211 h->ticket_it_tail,
1212 it); 1212 it);
1213 env = GNUNET_MQ_msg (msg, 1213 env = GNUNET_MQ_msg (msg,
1214 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START); 1214 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START);
1215 msg->id = htonl (rid); 1215 msg->id = htonl (rid);
1216 msg->identity = identity_pub; 1216 msg->identity = identity_pub;
1217 msg->is_audience = htonl (GNUNET_NO); 1217 msg->is_audience = htonl (GNUNET_NO);
@@ -1229,7 +1229,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
1229 * Lists all tickets that have been issued to remote 1229 * Lists all tickets that have been issued to remote
1230 * identites (relying parties) 1230 * identites (relying parties)
1231 * 1231 *
1232 * @param h the identity provider to use 1232 * @param h the reclaim to use
1233 * @param identity the issuing identity 1233 * @param identity the issuing identity
1234 * @param error_cb function to call on error (i.e. disconnect), 1234 * @param error_cb function to call on error (i.e. disconnect),
1235 * the handle is afterwards invalid 1235 * the handle is afterwards invalid
@@ -1242,23 +1242,23 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
1242 * @param finish_cb_cls closure for @a finish_cb 1242 * @param finish_cb_cls closure for @a finish_cb
1243 * @return an iterator handle to use for iteration 1243 * @return an iterator handle to use for iteration
1244 */ 1244 */
1245struct GNUNET_IDENTITY_PROVIDER_TicketIterator * 1245struct GNUNET_RECLAIM_TicketIterator *
1246GNUNET_IDENTITY_PROVIDER_ticket_iteration_start_rp (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1246GNUNET_RECLAIM_ticket_iteration_start_rp (struct GNUNET_RECLAIM_Handle *h,
1247 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 1247 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
1248 GNUNET_SCHEDULER_TaskCallback error_cb, 1248 GNUNET_SCHEDULER_TaskCallback error_cb,
1249 void *error_cb_cls, 1249 void *error_cb_cls,
1250 GNUNET_IDENTITY_PROVIDER_TicketCallback proc, 1250 GNUNET_RECLAIM_TicketCallback proc,
1251 void *proc_cls, 1251 void *proc_cls,
1252 GNUNET_SCHEDULER_TaskCallback finish_cb, 1252 GNUNET_SCHEDULER_TaskCallback finish_cb,
1253 void *finish_cb_cls) 1253 void *finish_cb_cls)
1254{ 1254{
1255 struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it; 1255 struct GNUNET_RECLAIM_TicketIterator *it;
1256 struct GNUNET_MQ_Envelope *env; 1256 struct GNUNET_MQ_Envelope *env;
1257 struct TicketIterationStartMessage *msg; 1257 struct TicketIterationStartMessage *msg;
1258 uint32_t rid; 1258 uint32_t rid;
1259 1259
1260 rid = h->r_id_gen++; 1260 rid = h->r_id_gen++;
1261 it = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_TicketIterator); 1261 it = GNUNET_new (struct GNUNET_RECLAIM_TicketIterator);
1262 it->h = h; 1262 it->h = h;
1263 it->error_cb = error_cb; 1263 it->error_cb = error_cb;
1264 it->error_cb_cls = error_cb_cls; 1264 it->error_cb_cls = error_cb_cls;
@@ -1271,7 +1271,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start_rp (struct GNUNET_IDENTITY_PROVI
1271 h->ticket_it_tail, 1271 h->ticket_it_tail,
1272 it); 1272 it);
1273 env = GNUNET_MQ_msg (msg, 1273 env = GNUNET_MQ_msg (msg,
1274 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START); 1274 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START);
1275 msg->id = htonl (rid); 1275 msg->id = htonl (rid);
1276 msg->identity = *identity; 1276 msg->identity = *identity;
1277 msg->is_audience = htonl (GNUNET_YES); 1277 msg->is_audience = htonl (GNUNET_YES);
@@ -1286,20 +1286,20 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start_rp (struct GNUNET_IDENTITY_PROVI
1286} 1286}
1287 1287
1288/** 1288/**
1289 * Calls the record processor specified in #GNUNET_IDENTITY_PROVIDER_ticket_iteration_start 1289 * Calls the record processor specified in #GNUNET_RECLAIM_ticket_iteration_start
1290 * for the next record. 1290 * for the next record.
1291 * 1291 *
1292 * @param it the iterator 1292 * @param it the iterator
1293 */ 1293 */
1294void 1294void
1295GNUNET_IDENTITY_PROVIDER_ticket_iteration_next (struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it) 1295GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it)
1296{ 1296{
1297 struct GNUNET_IDENTITY_PROVIDER_Handle *h = it->h; 1297 struct GNUNET_RECLAIM_Handle *h = it->h;
1298 struct TicketIterationNextMessage *msg; 1298 struct TicketIterationNextMessage *msg;
1299 struct GNUNET_MQ_Envelope *env; 1299 struct GNUNET_MQ_Envelope *env;
1300 1300
1301 env = GNUNET_MQ_msg (msg, 1301 env = GNUNET_MQ_msg (msg,
1302 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT); 1302 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT);
1303 msg->id = htonl (it->r_id); 1303 msg->id = htonl (it->r_id);
1304 GNUNET_MQ_send (h->mq, 1304 GNUNET_MQ_send (h->mq,
1305 env); 1305 env);
@@ -1309,21 +1309,21 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_next (struct GNUNET_IDENTITY_PROVIDER_
1309/** 1309/**
1310 * Stops iteration and releases the idp handle for further calls. Must 1310 * Stops iteration and releases the idp handle for further calls. Must
1311 * be called on any iteration that has not yet completed prior to calling 1311 * be called on any iteration that has not yet completed prior to calling
1312 * #GNUNET_IDENTITY_PROVIDER_disconnect. 1312 * #GNUNET_RECLAIM_disconnect.
1313 * 1313 *
1314 * @param it the iterator 1314 * @param it the iterator
1315 */ 1315 */
1316void 1316void
1317GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_TicketIterator *it) 1317GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it)
1318{ 1318{
1319 struct GNUNET_IDENTITY_PROVIDER_Handle *h = it->h; 1319 struct GNUNET_RECLAIM_Handle *h = it->h;
1320 struct GNUNET_MQ_Envelope *env; 1320 struct GNUNET_MQ_Envelope *env;
1321 struct TicketIterationStopMessage *msg; 1321 struct TicketIterationStopMessage *msg;
1322 1322
1323 if (NULL != h->mq) 1323 if (NULL != h->mq)
1324 { 1324 {
1325 env = GNUNET_MQ_msg (msg, 1325 env = GNUNET_MQ_msg (msg,
1326 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP); 1326 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP);
1327 msg->id = htonl (it->r_id); 1327 msg->id = htonl (it->r_id);
1328 GNUNET_MQ_send (h->mq, 1328 GNUNET_MQ_send (h->mq,
1329 env); 1329 env);
@@ -1335,27 +1335,26 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_
1335 * Revoked an issued ticket. The relying party will be unable to retrieve 1335 * Revoked an issued ticket. The relying party will be unable to retrieve
1336 * updated attributes. 1336 * updated attributes.
1337 * 1337 *
1338 * @param h the identity provider to use 1338 * @param h the reclaim to use
1339 * @param identity the issuing identity 1339 * @param identity the issuing identity
1340 * @param ticket the ticket to revoke 1340 * @param ticket the ticket to revoke
1341 * @param cb the callback 1341 * @param cb the callback
1342 * @param cb_cls the callback closure 1342 * @param cb_cls the callback closure
1343 * @return handle to abort the operation 1343 * @return handle to abort the operation
1344 */ 1344 */
1345struct GNUNET_IDENTITY_PROVIDER_Operation * 1345struct GNUNET_RECLAIM_Operation *
1346GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 1346GNUNET_RECLAIM_ticket_revoke (struct GNUNET_RECLAIM_Handle *h,
1347 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 1347 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
1348 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 1348 const struct GNUNET_RECLAIM_Ticket *ticket,
1349 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, 1349 GNUNET_RECLAIM_ContinuationWithStatus cb,
1350 void *cb_cls) 1350 void *cb_cls)
1351{ 1351{
1352 struct GNUNET_IDENTITY_PROVIDER_Operation *op; 1352 struct GNUNET_RECLAIM_Operation *op;
1353 struct GNUNET_MQ_Envelope *env;
1354 struct RevokeTicketMessage *msg; 1353 struct RevokeTicketMessage *msg;
1355 uint32_t rid; 1354 uint32_t rid;
1356 1355
1357 rid = h->r_id_gen++; 1356 rid = h->r_id_gen++;
1358 op = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Operation); 1357 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1359 op->h = h; 1358 op->h = h;
1360 op->rvk_cb = cb; 1359 op->rvk_cb = cb;
1361 op->cls = cb_cls; 1360 op->cls = cb_cls;
@@ -1363,22 +1362,22 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *
1363 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, 1362 GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
1364 h->op_tail, 1363 h->op_tail,
1365 op); 1364 op);
1366 env = GNUNET_MQ_msg_extra (msg, 1365 op->env = GNUNET_MQ_msg_extra (msg,
1367 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket), 1366 sizeof (struct GNUNET_RECLAIM_Ticket),
1368 GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET); 1367 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET);
1369 msg->id = htonl (rid); 1368 msg->id = htonl (rid);
1370 msg->identity = *identity; 1369 msg->identity = *identity;
1371 GNUNET_memcpy (&msg[1], 1370 GNUNET_memcpy (&msg[1],
1372 ticket, 1371 ticket,
1373 sizeof (struct GNUNET_IDENTITY_PROVIDER_Ticket)); 1372 sizeof (struct GNUNET_RECLAIM_Ticket));
1374 if (NULL == h->mq) 1373 if (NULL != h->mq) {
1375 op->env = env;
1376 else
1377 GNUNET_MQ_send (h->mq, 1374 GNUNET_MQ_send (h->mq,
1378 env); 1375 op->env);
1376 op->env = NULL;
1377 }
1379 return op; 1378 return op;
1380} 1379}
1381 1380
1382 1381
1383 1382
1384/* end of identity_provider_api.c */ 1383/* end of reclaim_api.c */
diff --git a/src/reclaim/test_reclaim.sh b/src/reclaim/test_reclaim.sh
new file mode 100755
index 000000000..311f5382a
--- /dev/null
+++ b/src/reclaim/test_reclaim.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2#trap "gnunet-arm -e -c test_reclaim_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_reclaim.conf
27gnunet-identity -C testego -c test_reclaim.conf
28valgrind gnunet-reclaim -e testego -a email -V john@doe.gnu -c test_reclaim.conf
29gnunet-reclaim -e testego -a name -V John -c test_reclaim.conf
30gnunet-reclaim -e testego -D -c test_reclaim.conf
31gnunet-arm -e -c test_reclaim.conf
diff --git a/src/reclaim/test_reclaim_attribute.sh b/src/reclaim/test_reclaim_attribute.sh
new file mode 100755
index 000000000..39bd715b7
--- /dev/null
+++ b/src/reclaim/test_reclaim_attribute.sh
@@ -0,0 +1,40 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_reclaim.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_reclaim.conf
27#gnunet-arm -i rest -c test_reclaim.conf
28gnunet-identity -C testego -c test_reclaim.conf
29gnunet-identity -C rpego -c test_reclaim.conf
30TEST_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep testego | awk '{print $3}')
31gnunet-reclaim -e testego -a email -V john@doe.gnu -c test_reclaim.conf
32gnunet-reclaim -e testego -a name -V John -c test_reclaim.conf > /dev/null 2>&1
33if test $? != 0
34then
35 echo "Failed."
36 exit 1
37fi
38
39#curl localhost:7776/reclaim/attributes/testego
40gnunet-arm -e -c test_reclaim.conf
diff --git a/src/reclaim/test_reclaim_consume.sh b/src/reclaim/test_reclaim_consume.sh
new file mode 100755
index 000000000..36c8052d0
--- /dev/null
+++ b/src/reclaim/test_reclaim_consume.sh
@@ -0,0 +1,43 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_reclaim.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_reclaim.conf
27#gnunet-arm -i rest -c test_reclaim.conf
28gnunet-identity -C testego -c test_reclaim.conf
29gnunet-identity -C rpego -c test_reclaim.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep rpego | awk '{print $3}')
31TEST_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep testego | awk '{print $3}')
32gnunet-reclaim -e testego -a email -V john@doe.gnu -c test_reclaim.conf
33gnunet-reclaim -e testego -a name -V John -c test_reclaim.conf
34TICKET=$(gnunet-reclaim -e testego -i "email,name" -r $SUBJECT_KEY -c test_reclaim.conf | awk '{print $1}')
35gnunet-reclaim -e rpego -C $TICKET -c test_reclaim.conf > /dev/null 2>&1
36
37if test $? != 0
38then
39 "Failed."
40 exit 1
41fi
42#curl http://localhost:7776/reclaim/tickets/testego
43gnunet-arm -e -c test_reclaim.conf
diff --git a/src/identity-provider/test_idp_defaults.conf b/src/reclaim/test_reclaim_defaults.conf
index a9a197dea..a9a197dea 100644
--- a/src/identity-provider/test_idp_defaults.conf
+++ b/src/reclaim/test_reclaim_defaults.conf
diff --git a/src/reclaim/test_reclaim_issue.sh b/src/reclaim/test_reclaim_issue.sh
new file mode 100755
index 000000000..6a71470e1
--- /dev/null
+++ b/src/reclaim/test_reclaim_issue.sh
@@ -0,0 +1,42 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_reclaim.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_reclaim.conf
27#gnunet-arm -i rest -c test_reclaim.conf
28gnunet-identity -C testego -c test_reclaim.conf
29gnunet-identity -C rpego -c test_reclaim.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep rpego | awk '{print $3}')
31TEST_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep testego | awk '{print $3}')
32gnunet-reclaim -e testego -a email -V john@doe.gnu -c test_reclaim.conf > /dev/null 2>&1
33gnunet-reclaim -e testego -a name -V John -c test_reclaim.conf > /dev/null 2>&1
34#gnunet-reclaim -e testego -D -c test_reclaim.conf
35gnunet-reclaim -e testego -i "email,name" -r $SUBJECT_KEY -c test_reclaim.conf > /dev/null 2>&1
36if test $? != 0
37then
38 echo "Failed."
39 exit 1
40fi
41#curl http://localhost:7776/reclaim/attributes/testego
42gnunet-arm -e -c test_reclaim.conf
diff --git a/src/reclaim/test_reclaim_revoke.sh b/src/reclaim/test_reclaim_revoke.sh
new file mode 100755
index 000000000..595752fd8
--- /dev/null
+++ b/src/reclaim/test_reclaim_revoke.sh
@@ -0,0 +1,65 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_reclaim.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_reclaim.conf 2&>1 > /dev/null
27gnunet-identity -C alice -c test_reclaim.conf
28gnunet-identity -C bob -c test_reclaim.conf
29gnunet-identity -C eve -c test_reclaim.conf
30ALICE_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep alice | awk '{print $3}')
31BOB_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep bob | awk '{print $3}')
32EVE_KEY=$(gnunet-identity -d -c test_reclaim.conf | grep eve | awk '{print $3}')
33
34gnunet-reclaim -e alice -E 15s -a email -V john@doe.gnu -c test_reclaim.conf
35gnunet-reclaim -e alice -E 15s -a name -V John -c test_reclaim.conf
36TICKET_BOB=$(gnunet-reclaim -e alice -i "email,name" -r $BOB_KEY -c test_reclaim.conf | awk '{print $1}')
37#gnunet-reclaim -e bob -C $TICKET_BOB -c test_reclaim.conf
38TICKET_EVE=$(gnunet-reclaim -e alice -i "email" -r $EVE_KEY -c test_reclaim.conf | awk '{print $1}')
39
40#echo "Consuming $TICKET"
41#gnunet-reclaim -e eve -C $TICKET_EVE -c test_reclaim.conf
42gnunet-reclaim -e alice -R $TICKET_EVE -c test_reclaim.conf
43
44#sleep 6
45
46gnunet-reclaim -e eve -C $TICKET_EVE -c test_reclaim.conf 2&>1 >/dev/null
47if test $? == 0
48then
49 echo "Eve can still resolve attributes..."
50 gnunet-arm -e -c test_reclaim.conf
51 exit 1
52fi
53
54gnunet-arm -e -c test_reclaim.conf
55gnunet-arm -s -c test_reclaim.conf 2&>1 > /dev/null
56
57gnunet-reclaim -e bob -C $TICKET_BOB -c test_reclaim.conf 2&>1 >/dev/null
58if test $? != 0
59then
60 echo "Bob cannot resolve attributes..."
61 gnunet-arm -e -c test_reclaim.conf
62 exit 1
63fi
64
65gnunet-arm -e -c test_reclaim.conf
diff --git a/src/rest/Makefile.am b/src/rest/Makefile.am
index ebfb98024..ce0454d53 100644
--- a/src/rest/Makefile.am
+++ b/src/rest/Makefile.am
@@ -29,6 +29,18 @@ libexec_PROGRAMS = \
29EXTRA_DIST = \ 29EXTRA_DIST = \
30 rest.conf 30 rest.conf
31 31
32plugin_LTLIBRARIES = libgnunet_plugin_rest_copying.la
33
34libgnunet_plugin_rest_copying_la_SOURCES = \
35 plugin_rest_copying.c
36libgnunet_plugin_rest_copying_la_LIBADD = \
37 $(top_builddir)/src/rest/libgnunetrest.la \
38 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
39 $(LTLIBINTL) -lmicrohttpd
40libgnunet_plugin_rest_copying_la_LDFLAGS = \
41 $(GN_PLUGIN_LDFLAGS)
42
43
32gnunet_rest_server_SOURCES = \ 44gnunet_rest_server_SOURCES = \
33 gnunet-rest-server.c 45 gnunet-rest-server.c
34 46
diff --git a/src/rest/plugin_rest_copying.c b/src/rest/plugin_rest_copying.c
new file mode 100644
index 000000000..668dc5d38
--- /dev/null
+++ b/src/rest/plugin_rest_copying.c
@@ -0,0 +1,231 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2012-2018 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 * @author Martin Schanzenbach
20 * @file gns/plugin_rest_copying.c
21 * @brief REST plugin that serves licensing information.
22 *
23 */
24
25#include "platform.h"
26#include "gnunet_rest_plugin.h"
27#include <gnunet_rest_lib.h>
28
29#define GNUNET_REST_API_NS_COPYING "/copying"
30
31#define GNUNET_REST_COPYING_TEXT "GNU Affero General Public License version 3 or later. See also: <http://www.gnu.org/licenses/>"
32
33/**
34 * @brief struct returned by the initialization function of the plugin
35 */
36struct Plugin
37{
38 const struct GNUNET_CONFIGURATION_Handle *cfg;
39};
40
41const struct GNUNET_CONFIGURATION_Handle *cfg;
42
43struct RequestHandle
44{
45 /**
46 * Handle to rest request
47 */
48 struct GNUNET_REST_RequestHandle *rest_handle;
49
50 /**
51 * The plugin result processor
52 */
53 GNUNET_REST_ResultProcessor proc;
54
55 /**
56 * The closure of the result processor
57 */
58 void *proc_cls;
59
60 /**
61 * HTTP response code
62 */
63 int response_code;
64
65};
66
67
68/**
69 * Cleanup request handle.
70 *
71 * @param handle Handle to clean up
72 */
73static void
74cleanup_handle (struct RequestHandle *handle)
75{
76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
77 "Cleaning up\n");
78 GNUNET_free (handle);
79}
80
81
82/**
83 * Task run on shutdown. Cleans up everything.
84 *
85 * @param cls unused
86 * @param tc scheduler context
87 */
88static void
89do_error (void *cls)
90{
91 struct RequestHandle *handle = cls;
92 struct MHD_Response *resp;
93
94 resp = GNUNET_REST_create_response (NULL);
95 handle->proc (handle->proc_cls, resp, handle->response_code);
96 cleanup_handle (handle);
97}
98
99
100/**
101 * Handle rest request
102 *
103 * @param handle the lookup handle
104 */
105static void
106get_cont (struct GNUNET_REST_RequestHandle *con_handle,
107 const char* url,
108 void *cls)
109{
110 struct MHD_Response *resp;
111 struct RequestHandle *handle = cls;
112
113 resp = GNUNET_REST_create_response (GNUNET_REST_COPYING_TEXT);
114 handle->proc (handle->proc_cls,
115 resp,
116 MHD_HTTP_OK);
117 cleanup_handle (handle);
118}
119
120
121
122/**
123 * Handle rest request
124 *
125 * @param handle the lookup handle
126 */
127static void
128options_cont (struct GNUNET_REST_RequestHandle *con_handle,
129 const char* url,
130 void *cls)
131{
132 struct MHD_Response *resp;
133 struct RequestHandle *handle = cls;
134
135 resp = GNUNET_REST_create_response (NULL);
136 MHD_add_response_header (resp,
137 "Access-Control-Allow-Methods",
138 MHD_HTTP_METHOD_GET);
139 handle->proc (handle->proc_cls,
140 resp,
141 MHD_HTTP_OK);
142 cleanup_handle (handle);
143}
144
145
146/**
147 * Function processing the REST call
148 *
149 * @param method HTTP method
150 * @param url URL of the HTTP request
151 * @param data body of the HTTP request (optional)
152 * @param data_size length of the body
153 * @param proc callback function for the result
154 * @param proc_cls closure for @a proc
155 * @return #GNUNET_OK if request accepted
156 */
157static void
158rest_copying_process_request (struct GNUNET_REST_RequestHandle *conndata_handle,
159 GNUNET_REST_ResultProcessor proc,
160 void *proc_cls)
161{
162 static const struct GNUNET_REST_RequestHandler handlers[] = {
163 {MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_COPYING, &get_cont},
164 {MHD_HTTP_METHOD_OPTIONS, GNUNET_REST_API_NS_COPYING, &options_cont},
165 GNUNET_REST_HANDLER_END
166 };
167 struct RequestHandle *handle = GNUNET_new (struct RequestHandle);
168 struct GNUNET_REST_RequestHandlerError err;
169
170 handle->proc_cls = proc_cls;
171 handle->proc = proc;
172 handle->rest_handle = conndata_handle;
173
174 if (GNUNET_NO == GNUNET_REST_handle_request (conndata_handle,
175 handlers,
176 &err,
177 handle))
178 {
179 handle->response_code = err.error_code;
180 GNUNET_SCHEDULER_add_now (&do_error, handle);
181 }
182}
183
184
185/**
186 * Entry point for the plugin.
187 *
188 * @param cls the "struct GNUNET_NAMESTORE_PluginEnvironment*"
189 * @return NULL on error, otherwise the plugin context
190 */
191void *
192libgnunet_plugin_rest_copying_init (void *cls)
193{
194 static struct Plugin plugin;
195 cfg = cls;
196 struct GNUNET_REST_Plugin *api;
197
198 if (NULL != plugin.cfg)
199 return NULL; /* can only initialize once! */
200 memset (&plugin, 0, sizeof (struct Plugin));
201 plugin.cfg = cfg;
202 api = GNUNET_new (struct GNUNET_REST_Plugin);
203 api->cls = &plugin;
204 api->name = GNUNET_REST_API_NS_COPYING;
205 api->process_request = &rest_copying_process_request;
206 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
207 _("COPYING REST API initialized\n"));
208 return api;
209}
210
211
212/**
213 * Exit point from the plugin.
214 *
215 * @param cls the plugin context (as returned by "init")
216 * @return always NULL
217 */
218void *
219libgnunet_plugin_rest_copying_done (void *cls)
220{
221 struct GNUNET_REST_Plugin *api = cls;
222 struct Plugin *plugin = api->cls;
223
224 plugin->cfg = NULL;
225 GNUNET_free (api);
226 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
227 "COPYING REST plugin is finished\n");
228 return NULL;
229}
230
231/* end of plugin_rest_copying.c */
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 16f23e86c..49714872f 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -49,7 +49,11 @@ static unsigned bits_needed;
49/** 49/**
50 * How long do we run the test? 50 * How long do we run the test?
51 */ 51 */
52//#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 52static struct GNUNET_TIME_Relative duration;
53
54/**
55 * When do we do a hard shutdown?
56 */
53static struct GNUNET_TIME_Relative timeout; 57static struct GNUNET_TIME_Relative timeout;
54 58
55 59
@@ -446,6 +450,10 @@ struct RPSPeer
446 * @brief statistics values 450 * @brief statistics values
447 */ 451 */
448 uint64_t stats[STAT_TYPE_MAX]; 452 uint64_t stats[STAT_TYPE_MAX];
453 /**
454 * @brief Handle for the statistics get request
455 */
456 struct GNUNET_STATISTICS_GetHandle *h_stat_get[STAT_TYPE_MAX];
449}; 457};
450 458
451/** 459/**
@@ -489,15 +497,16 @@ static unsigned int view_sizes;
489static int ok; 497static int ok;
490 498
491/** 499/**
492 * Identifier for the churn task that runs periodically 500 * Identifier for the task that runs after the test to collect results
493 */ 501 */
494static struct GNUNET_SCHEDULER_Task *post_test_task; 502static struct GNUNET_SCHEDULER_Task *post_test_task;
495 503
496/** 504/**
497 * Identifier for the churn task that runs periodically 505 * Identifier for the shutdown task
498 */ 506 */
499static struct GNUNET_SCHEDULER_Task *shutdown_task; 507static struct GNUNET_SCHEDULER_Task *shutdown_task;
500 508
509
501/** 510/**
502 * Identifier for the churn task that runs periodically 511 * Identifier for the churn task that runs periodically
503 */ 512 */
@@ -874,6 +883,75 @@ static int check_statistics_collect_completed ()
874 return GNUNET_YES; 883 return GNUNET_YES;
875} 884}
876 885
886static void
887rps_disconnect_adapter (void *cls,
888 void *op_result);
889
890static void
891cancel_pending_req (struct PendingRequest *pending_req)
892{
893 struct RPSPeer *rps_peer;
894
895 rps_peer = pending_req->rps_peer;
896 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_req_head,
897 rps_peer->pending_req_tail,
898 pending_req);
899 rps_peer->num_pending_reqs--;
900 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
901 "Cancelling pending rps get request\n");
902 GNUNET_SCHEDULER_cancel (pending_req->request_task);
903 GNUNET_free (pending_req);
904}
905
906static void
907cancel_request (struct PendingReply *pending_rep)
908{
909 struct RPSPeer *rps_peer;
910
911 rps_peer = pending_rep->rps_peer;
912 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_rep_head,
913 rps_peer->pending_rep_tail,
914 pending_rep);
915 rps_peer->num_pending_reps--;
916 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
917 "Cancelling rps get reply\n");
918 GNUNET_RPS_request_cancel (pending_rep->req_handle);
919 GNUNET_free (pending_rep);
920}
921
922void
923clean_peer (unsigned peer_index)
924{
925 struct PendingRequest *pending_req;
926
927 while (NULL != (pending_req = rps_peers[peer_index].pending_req_head))
928 {
929 cancel_pending_req (pending_req);
930 }
931 pending_req = rps_peers[peer_index].pending_req_head;
932 rps_disconnect_adapter (&rps_peers[peer_index],
933 &rps_peers[peer_index].rps_handle);
934 for (unsigned stat_type = STAT_TYPE_ROUNDS;
935 stat_type < STAT_TYPE_MAX;
936 stat_type++)
937 {
938 if (NULL != rps_peers[peer_index].h_stat_get[stat_type])
939 {
940 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
941 "(%u) did not yet receive stat value for `%s'\n",
942 rps_peers[peer_index].index,
943 stat_type_2_str (stat_type));
944 GNUNET_STATISTICS_get_cancel (
945 rps_peers[peer_index].h_stat_get[stat_type]);
946 }
947 }
948 if (NULL != rps_peers[peer_index].op)
949 {
950 GNUNET_TESTBED_operation_done (rps_peers[peer_index].op);
951 rps_peers[peer_index].op = NULL;
952 }
953}
954
877/** 955/**
878 * Task run on timeout to shut everything down. 956 * Task run on timeout to shut everything down.
879 */ 957 */
@@ -881,35 +959,55 @@ static void
881shutdown_op (void *cls) 959shutdown_op (void *cls)
882{ 960{
883 unsigned int i; 961 unsigned int i;
962 struct OpListEntry *entry;
884 963
885 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 964 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
886 "Shutdown task scheduled, going down.\n"); 965 "Shutdown task scheduled, going down.\n");
887 in_shutdown = GNUNET_YES; 966 in_shutdown = GNUNET_YES;
967
968 if (NULL != shutdown_task)
969 {
970 GNUNET_SCHEDULER_cancel (shutdown_task);
971 shutdown_task = NULL;
972 }
888 if (NULL != post_test_task) 973 if (NULL != post_test_task)
889 { 974 {
890 GNUNET_SCHEDULER_cancel (post_test_task); 975 GNUNET_SCHEDULER_cancel (post_test_task);
976 post_test_task = NULL;
891 } 977 }
892 if (NULL != churn_task) 978 if (NULL != churn_task)
893 { 979 {
894 GNUNET_SCHEDULER_cancel (churn_task); 980 GNUNET_SCHEDULER_cancel (churn_task);
895 churn_task = NULL; 981 churn_task = NULL;
896 } 982 }
983 entry = oplist_head;
984 while (NULL != (entry = oplist_head))
985 {
986 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
987 "Operation still pending on shutdown (%u)\n",
988 entry->index);
989 GNUNET_TESTBED_operation_done (entry->op);
990 GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry);
991 GNUNET_free (entry);
992 }
897 for (i = 0; i < num_peers; i++) 993 for (i = 0; i < num_peers; i++)
898 { 994 {
899 if (NULL != rps_peers[i].rps_handle) 995 clean_peer (i);
900 {
901 GNUNET_RPS_disconnect (rps_peers[i].rps_handle);
902 }
903 if (NULL != rps_peers[i].op)
904 {
905 GNUNET_TESTBED_operation_done (rps_peers[i].op);
906 }
907 } 996 }
908} 997}
909 998
999static void
1000trigger_shutdown (void *cls)
1001{
1002 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1003 "Shutdown was triggerd by timeout, going down.\n");
1004 shutdown_task = NULL;
1005 GNUNET_SCHEDULER_shutdown ();
1006}
1007
910 1008
911/** 1009/**
912 * Task run on timeout to collect statistics and potentially shut down. 1010 * Task run after #duration to collect statistics and potentially shut down.
913 */ 1011 */
914static void 1012static void
915post_test_op (void *cls) 1013post_test_op (void *cls)
@@ -919,7 +1017,7 @@ post_test_op (void *cls)
919 post_test_task = NULL; 1017 post_test_task = NULL;
920 post_test = GNUNET_YES; 1018 post_test = GNUNET_YES;
921 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1019 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
922 "Post test task scheduled, going down.\n"); 1020 "Post test task scheduled.\n");
923 if (NULL != churn_task) 1021 if (NULL != churn_task)
924 { 1022 {
925 GNUNET_SCHEDULER_cancel (churn_task); 1023 GNUNET_SCHEDULER_cancel (churn_task);
@@ -943,7 +1041,7 @@ post_test_op (void *cls)
943 GNUNET_YES == check_statistics_collect_completed()) 1041 GNUNET_YES == check_statistics_collect_completed())
944 { 1042 {
945 GNUNET_SCHEDULER_cancel (shutdown_task); 1043 GNUNET_SCHEDULER_cancel (shutdown_task);
946 shutdown_task = GNUNET_SCHEDULER_add_now (&shutdown_op, NULL); 1044 shutdown_task = NULL;
947 GNUNET_SCHEDULER_shutdown (); 1045 GNUNET_SCHEDULER_shutdown ();
948 } 1046 }
949} 1047}
@@ -1030,9 +1128,9 @@ info_cb (void *cb_cls,
1030 */ 1128 */
1031static void 1129static void
1032rps_connect_complete_cb (void *cls, 1130rps_connect_complete_cb (void *cls,
1033 struct GNUNET_TESTBED_Operation *op, 1131 struct GNUNET_TESTBED_Operation *op,
1034 void *ca_result, 1132 void *ca_result,
1035 const char *emsg) 1133 const char *emsg)
1036{ 1134{
1037 struct RPSPeer *rps_peer = cls; 1135 struct RPSPeer *rps_peer = cls;
1038 struct GNUNET_RPS_Handle *rps = ca_result; 1136 struct GNUNET_RPS_Handle *rps = ca_result;
@@ -1057,7 +1155,9 @@ rps_connect_complete_cb (void *cls,
1057 return; 1155 return;
1058 } 1156 }
1059 1157
1060 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started client successfully\n"); 1158 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1159 "Started client successfully (%u)\n",
1160 rps_peer->index);
1061 1161
1062 cur_test_run.main_test (rps_peer); 1162 cur_test_run.main_test (rps_peer);
1063} 1163}
@@ -1075,7 +1175,7 @@ rps_connect_complete_cb (void *cls,
1075 */ 1175 */
1076static void * 1176static void *
1077rps_connect_adapter (void *cls, 1177rps_connect_adapter (void *cls,
1078 const struct GNUNET_CONFIGURATION_Handle *cfg) 1178 const struct GNUNET_CONFIGURATION_Handle *cfg)
1079{ 1179{
1080 struct GNUNET_RPS_Handle *h; 1180 struct GNUNET_RPS_Handle *h;
1081 1181
@@ -1167,15 +1267,26 @@ stat_complete_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
1167 */ 1267 */
1168static void 1268static void
1169rps_disconnect_adapter (void *cls, 1269rps_disconnect_adapter (void *cls,
1170 void *op_result) 1270 void *op_result)
1171{ 1271{
1172 struct RPSPeer *peer = cls; 1272 struct RPSPeer *peer = cls;
1173 struct GNUNET_RPS_Handle *h = op_result; 1273 struct GNUNET_RPS_Handle *h = op_result;
1274 struct PendingReply *pending_rep;
1174 1275
1175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect_adapter()\n"); 1276 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1277 "disconnect_adapter (%u)\n",
1278 peer->index);
1176 GNUNET_assert (NULL != peer); 1279 GNUNET_assert (NULL != peer);
1177 GNUNET_RPS_disconnect (h); 1280 if (NULL != peer->rps_handle)
1178 peer->rps_handle = NULL; 1281 {
1282 while (NULL != (pending_rep = peer->pending_rep_head))
1283 {
1284 cancel_request (pending_rep);
1285 }
1286 GNUNET_assert (h == peer->rps_handle);
1287 GNUNET_RPS_disconnect (h);
1288 peer->rps_handle = NULL;
1289 }
1179} 1290}
1180 1291
1181 1292
@@ -1219,13 +1330,15 @@ default_reply_handle (void *cls,
1219 rps_peer->num_recv_ids++; 1330 rps_peer->num_recv_ids++;
1220 } 1331 }
1221 1332
1222 if (0 == evaluate () && HAVE_QUICK_QUIT == cur_test_run.have_quick_quit) 1333 if (GNUNET_YES != post_test) return;
1334 if (HAVE_QUICK_QUIT != cur_test_run.have_quick_quit) return;
1335 if (0 == evaluate())
1223 { 1336 {
1224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test succeeded before timeout\n"); 1337 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1225 GNUNET_assert (NULL != post_test_task); 1338 "Test succeeded before end of duration\n");
1226 GNUNET_SCHEDULER_cancel (post_test_task); 1339 if (NULL != post_test_task) GNUNET_SCHEDULER_cancel (post_test_task);
1227 post_test_task = GNUNET_SCHEDULER_add_now (&post_test_op, NULL); 1340 post_test_task = GNUNET_SCHEDULER_add_now (&post_test_op, NULL);
1228 GNUNET_assert (NULL!= post_test_task); 1341 GNUNET_assert (NULL != post_test_task);
1229 } 1342 }
1230} 1343}
1231 1344
@@ -1239,13 +1352,13 @@ request_peers (void *cls)
1239 struct RPSPeer *rps_peer; 1352 struct RPSPeer *rps_peer;
1240 struct PendingReply *pending_rep; 1353 struct PendingReply *pending_rep;
1241 1354
1242 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test)
1243 return;
1244 rps_peer = pending_req->rps_peer; 1355 rps_peer = pending_req->rps_peer;
1245 GNUNET_assert (1 <= rps_peer->num_pending_reqs); 1356 GNUNET_assert (1 <= rps_peer->num_pending_reqs);
1246 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_req_head, 1357 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_req_head,
1247 rps_peer->pending_req_tail, 1358 rps_peer->pending_req_tail,
1248 pending_req); 1359 pending_req);
1360 rps_peer->num_pending_reqs--;
1361 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) return;
1249 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1362 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1250 "Requesting one peer\n"); 1363 "Requesting one peer\n");
1251 pending_rep = GNUNET_new (struct PendingReply); 1364 pending_rep = GNUNET_new (struct PendingReply);
@@ -1258,39 +1371,6 @@ request_peers (void *cls)
1258 rps_peer->pending_rep_tail, 1371 rps_peer->pending_rep_tail,
1259 pending_rep); 1372 pending_rep);
1260 rps_peer->num_pending_reps++; 1373 rps_peer->num_pending_reps++;
1261 rps_peer->num_pending_reqs--;
1262}
1263
1264static void
1265cancel_pending_req (struct PendingRequest *pending_req)
1266{
1267 struct RPSPeer *rps_peer;
1268
1269 rps_peer = pending_req->rps_peer;
1270 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_req_head,
1271 rps_peer->pending_req_tail,
1272 pending_req);
1273 rps_peer->num_pending_reqs--;
1274 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1275 "Cancelling pending request\n");
1276 GNUNET_SCHEDULER_cancel (pending_req->request_task);
1277 GNUNET_free (pending_req);
1278}
1279
1280static void
1281cancel_request (struct PendingReply *pending_rep)
1282{
1283 struct RPSPeer *rps_peer;
1284
1285 rps_peer = pending_rep->rps_peer;
1286 GNUNET_CONTAINER_DLL_remove (rps_peer->pending_rep_head,
1287 rps_peer->pending_rep_tail,
1288 pending_rep);
1289 rps_peer->num_pending_reps--;
1290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1291 "Cancelling request\n");
1292 GNUNET_RPS_request_cancel (pending_rep->req_handle);
1293 GNUNET_free (pending_rep);
1294} 1374}
1295 1375
1296 1376
@@ -2261,12 +2341,6 @@ void write_final_stats (void){
2261 stat_type < STAT_TYPE_MAX; 2341 stat_type < STAT_TYPE_MAX;
2262 stat_type++) 2342 stat_type++)
2263 { 2343 {
2264 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2265 "Add to sum (%" PRIu64 ") %" PRIu64 " of stat type %u - %s\n",
2266 sums[stat_type],
2267 rps_peers[i].stats[stat_type],
2268 stat_type,
2269 stat_type_2_str (stat_type));
2270 sums[stat_type] += rps_peers[i].stats[stat_type]; 2344 sums[stat_type] += rps_peers[i].stats[stat_type];
2271 } 2345 }
2272 } 2346 }
@@ -2312,6 +2386,8 @@ post_test_shutdown_ready_cb (void *cls,
2312{ 2386{
2313 struct STATcls *stat_cls = (struct STATcls *) cls; 2387 struct STATcls *stat_cls = (struct STATcls *) cls;
2314 struct RPSPeer *rps_peer = stat_cls->rps_peer; 2388 struct RPSPeer *rps_peer = stat_cls->rps_peer;
2389
2390 rps_peer->h_stat_get[stat_cls->stat_type] = NULL;
2315 if (GNUNET_OK == success) 2391 if (GNUNET_OK == success)
2316 { 2392 {
2317 /* set flag that we we got the value */ 2393 /* set flag that we we got the value */
@@ -2363,6 +2439,7 @@ stat_iterator (void *cls,
2363{ 2439{
2364 const struct STATcls *stat_cls = (const struct STATcls *) cls; 2440 const struct STATcls *stat_cls = (const struct STATcls *) cls;
2365 struct RPSPeer *rps_peer = (struct RPSPeer *) stat_cls->rps_peer; 2441 struct RPSPeer *rps_peer = (struct RPSPeer *) stat_cls->rps_peer;
2442
2366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got stat value: %s - %" PRIu64 "\n", 2443 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got stat value: %s - %" PRIu64 "\n",
2367 //stat_type_2_str (stat_cls->stat_type), 2444 //stat_type_2_str (stat_cls->stat_type),
2368 name, 2445 name,
@@ -2455,12 +2532,13 @@ void post_profiler (struct RPSPeer *rps_peer)
2455 stat_cls->stat_type = stat_type; 2532 stat_cls->stat_type = stat_type;
2456 rps_peer->file_name_stats = 2533 rps_peer->file_name_stats =
2457 store_prefix_file_name (rps_peer->peer_id, "stats"); 2534 store_prefix_file_name (rps_peer->peer_id, "stats");
2458 GNUNET_STATISTICS_get (rps_peer->stats_h, 2535 rps_peer->h_stat_get[stat_type] = GNUNET_STATISTICS_get (
2459 "rps", 2536 rps_peer->stats_h,
2460 stat_type_2_str (stat_type), 2537 "rps",
2461 post_test_shutdown_ready_cb, 2538 stat_type_2_str (stat_type),
2462 stat_iterator, 2539 post_test_shutdown_ready_cb,
2463 (struct STATcls *) stat_cls); 2540 stat_iterator,
2541 (struct STATcls *) stat_cls);
2464 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2542 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2465 "Requested statistics for %s (peer %" PRIu32 ")\n", 2543 "Requested statistics for %s (peer %" PRIu32 ")\n",
2466 stat_type_2_str (stat_type), 2544 stat_type_2_str (stat_type),
@@ -2555,6 +2633,8 @@ test_run (void *cls,
2555 /* Connect all peers to statistics service */ 2633 /* Connect all peers to statistics service */
2556 if (COLLECT_STATISTICS == cur_test_run.have_collect_statistics) 2634 if (COLLECT_STATISTICS == cur_test_run.have_collect_statistics)
2557 { 2635 {
2636 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2637 "Connecting to statistics service\n");
2558 rps_peers[i].stat_op = 2638 rps_peers[i].stat_op =
2559 GNUNET_TESTBED_service_connect (NULL, 2639 GNUNET_TESTBED_service_connect (NULL,
2560 peers[i], 2640 peers[i],
@@ -2569,11 +2649,12 @@ test_run (void *cls,
2569 2649
2570 if (NULL != churn_task) 2650 if (NULL != churn_task)
2571 GNUNET_SCHEDULER_cancel (churn_task); 2651 GNUNET_SCHEDULER_cancel (churn_task);
2572 post_test_task = GNUNET_SCHEDULER_add_delayed (timeout, &post_test_op, NULL); 2652 post_test_task = GNUNET_SCHEDULER_add_delayed (duration, &post_test_op, NULL);
2573 timeout = GNUNET_TIME_relative_multiply (timeout, 1 + (0.1 * num_peers)); 2653 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "timeout for shutdown is %lu\n", timeout.rel_value_us/1000000);
2574 shutdown_task = GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL); 2654 shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout,
2575 shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); 2655 &trigger_shutdown,
2576 2656 NULL);
2657 GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL);
2577} 2658}
2578 2659
2579 2660
@@ -2609,7 +2690,7 @@ run (void *cls,
2609 if (0 == cur_test_run.num_requests) cur_test_run.num_requests = 5; 2690 if (0 == cur_test_run.num_requests) cur_test_run.num_requests = 5;
2610 //cur_test_run.have_churn = HAVE_CHURN; 2691 //cur_test_run.have_churn = HAVE_CHURN;
2611 cur_test_run.have_churn = HAVE_NO_CHURN; 2692 cur_test_run.have_churn = HAVE_NO_CHURN;
2612 cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; 2693 cur_test_run.have_quick_quit = HAVE_QUICK_QUIT;
2613 cur_test_run.have_collect_statistics = COLLECT_STATISTICS; 2694 cur_test_run.have_collect_statistics = COLLECT_STATISTICS;
2614 cur_test_run.stat_collect_flags = BIT(STAT_TYPE_ROUNDS) | 2695 cur_test_run.stat_collect_flags = BIT(STAT_TYPE_ROUNDS) |
2615 BIT(STAT_TYPE_BLOCKS) | 2696 BIT(STAT_TYPE_BLOCKS) |
@@ -2632,10 +2713,38 @@ run (void *cls,
2632 /* 'Clean' directory */ 2713 /* 'Clean' directory */
2633 (void) GNUNET_DISK_directory_remove ("/tmp/rps/"); 2714 (void) GNUNET_DISK_directory_remove ("/tmp/rps/");
2634 GNUNET_DISK_directory_create ("/tmp/rps/"); 2715 GNUNET_DISK_directory_create ("/tmp/rps/");
2635 if (0 == timeout.rel_value_us) 2716 if (0 == duration.rel_value_us)
2636 { 2717 {
2637 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); 2718 if (0 == timeout.rel_value_us)
2719 {
2720 duration = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90);
2721 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
2722 (90 * 1.2) +
2723 (0.01 * num_peers));
2724 }
2725 else
2726 {
2727 duration = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
2728 (timeout.rel_value_us/1000000)
2729 * 0.75);
2730 }
2638 } 2731 }
2732 else
2733 {
2734 if (0 == timeout.rel_value_us)
2735 {
2736 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
2737 ((duration.rel_value_us/1000000)
2738 * 1.2) + (0.01 * num_peers));
2739 }
2740 }
2741 GNUNET_assert (duration.rel_value_us < timeout.rel_value_us);
2742 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2743 "duration is %lus\n",
2744 duration.rel_value_us/1000000);
2745 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2746 "timeout is %lus\n",
2747 timeout.rel_value_us/1000000);
2639 2748
2640 /* Compute number of bits for representing largest peer id */ 2749 /* Compute number of bits for representing largest peer id */
2641 for (bits_needed = 1; (1 << bits_needed) < num_peers; bits_needed++) 2750 for (bits_needed = 1; (1 << bits_needed) < num_peers; bits_needed++)
@@ -2685,6 +2794,12 @@ main (int argc, char *argv[])
2685 gettext_noop ("number of peers to start"), 2794 gettext_noop ("number of peers to start"),
2686 &num_peers), 2795 &num_peers),
2687 2796
2797 GNUNET_GETOPT_option_relative_time ('d',
2798 "duration",
2799 "DURATION",
2800 gettext_noop ("duration of the profiling"),
2801 &duration),
2802
2688 GNUNET_GETOPT_option_relative_time ('t', 2803 GNUNET_GETOPT_option_relative_time ('t',
2689 "timeout", 2804 "timeout",
2690 "TIMEOUT", 2805 "TIMEOUT",
@@ -2732,7 +2847,6 @@ main (int argc, char *argv[])
2732 GNUNET_free (rps_peers); 2847 GNUNET_free (rps_peers);
2733 GNUNET_free (rps_peer_ids); 2848 GNUNET_free (rps_peer_ids);
2734 GNUNET_CONTAINER_multipeermap_destroy (peer_map); 2849 GNUNET_CONTAINER_multipeermap_destroy (peer_map);
2735 printf ("test -1\n");
2736 return ret_value; 2850 return ret_value;
2737} 2851}
2738 2852
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 5a75ac55a..21963ee42 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -68,6 +68,7 @@ static struct GNUNET_STATISTICS_Handle *stats;
68 */ 68 */
69static struct GNUNET_PeerIdentity own_identity; 69static struct GNUNET_PeerIdentity own_identity;
70 70
71static int in_shutdown = GNUNET_NO;
71 72
72/** 73/**
73 * @brief Port used for cadet. 74 * @brief Port used for cadet.
@@ -97,11 +98,6 @@ static struct GNUNET_HashCode port;
97#define unset_peer_flag(peer_ctx, mask) ((peer_ctx->peer_flags) &= ~(mask)) 98#define unset_peer_flag(peer_ctx, mask) ((peer_ctx->peer_flags) &= ~(mask))
98 99
99/** 100/**
100 * Set a channel flag of given channel context.
101 */
102#define set_channel_flag(channel_flags, mask) ((*channel_flags) |= (mask))
103
104/**
105 * Get channel flag of given channel context. 101 * Get channel flag of given channel context.
106 */ 102 */
107#define check_channel_flag_set(channel_flags, mask)\ 103#define check_channel_flag_set(channel_flags, mask)\
@@ -164,6 +160,11 @@ struct PendingMessage
164}; 160};
165 161
166/** 162/**
163 * @brief Context for a channel
164 */
165struct ChannelCtx;
166
167/**
167 * Struct used to keep track of other peer's status 168 * Struct used to keep track of other peer's status
168 * 169 *
169 * This is stored in a multipeermap. 170 * This is stored in a multipeermap.
@@ -181,22 +182,12 @@ struct PeerContext
181 /** 182 /**
182 * Channel open to client. 183 * Channel open to client.
183 */ 184 */
184 struct GNUNET_CADET_Channel *send_channel; 185 struct ChannelCtx *send_channel_ctx;
185
186 /**
187 * Flags to the sending channel
188 */
189 uint32_t *send_channel_flags;
190 186
191 /** 187 /**
192 * Channel open from client. 188 * Channel open from client.
193 */ 189 */
194 struct GNUNET_CADET_Channel *recv_channel; // unneeded? 190 struct ChannelCtx *recv_channel_ctx;
195
196 /**
197 * Flags to the receiving channel
198 */
199 uint32_t *recv_channel_flags;
200 191
201 /** 192 /**
202 * Array of pending operations on this peer. 193 * Array of pending operations on this peer.
@@ -242,6 +233,11 @@ struct PeerContext
242 struct PendingMessage *pending_messages_tail; 233 struct PendingMessage *pending_messages_tail;
243 234
244 /** 235 /**
236 * @brief Task to destroy this context.
237 */
238 struct GNUNET_SCHEDULER_Task *destruction_task;
239
240 /**
245 * This is pobably followed by 'statistical' data (when we first saw 241 * This is pobably followed by 'statistical' data (when we first saw
246 * it, how did we get its ID, how many pushes (in a timeinterval), 242 * it, how did we get its ID, how many pushes (in a timeinterval),
247 * ...) 243 * ...)
@@ -265,6 +261,33 @@ struct PeersIteratorCls
265}; 261};
266 262
267/** 263/**
264 * @brief Context for a channel
265 */
266struct ChannelCtx
267{
268 /**
269 * @brief Meant to be used in a DLL
270 */
271 struct ChannelCtx *next;
272 struct ChannelCtx *prev;
273
274 /**
275 * @brief The channel itself
276 */
277 struct GNUNET_CADET_Channel *channel;
278
279 /**
280 * @brief The peer context associated with the channel
281 */
282 struct PeerContext *peer_ctx;
283
284 /**
285 * @brief Scheduled task that will destroy this context
286 */
287 struct GNUNET_SCHEDULER_Task *destruction_task;
288};
289
290/**
268 * @brief Hashmap of valid peers. 291 * @brief Hashmap of valid peers.
269 */ 292 */
270static struct GNUNET_CONTAINER_MultiPeerMap *valid_peers; 293static struct GNUNET_CONTAINER_MultiPeerMap *valid_peers;
@@ -332,8 +355,6 @@ create_peer_ctx (const struct GNUNET_PeerIdentity *peer)
332 355
333 ctx = GNUNET_new (struct PeerContext); 356 ctx = GNUNET_new (struct PeerContext);
334 ctx->peer_id = *peer; 357 ctx->peer_id = *peer;
335 ctx->send_channel_flags = GNUNET_new (uint32_t);
336 ctx->recv_channel_flags = GNUNET_new (uint32_t);
337 ret = GNUNET_CONTAINER_multipeermap_put (peer_map, peer, ctx, 358 ret = GNUNET_CONTAINER_multipeermap_put (peer_map, peer, ctx,
338 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 359 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
339 GNUNET_assert (GNUNET_OK == ret); 360 GNUNET_assert (GNUNET_OK == ret);
@@ -387,8 +408,8 @@ Peers_check_connected (const struct GNUNET_PeerIdentity *peer)
387 /* Get the context */ 408 /* Get the context */
388 peer_ctx = get_peer_ctx (peer); 409 peer_ctx = get_peer_ctx (peer);
389 /* If we have no channel to this peer we don't know whether it's online */ 410 /* If we have no channel to this peer we don't know whether it's online */
390 if ( (NULL == peer_ctx->send_channel) && 411 if ( (NULL == peer_ctx->send_channel_ctx) &&
391 (NULL == peer_ctx->recv_channel) ) 412 (NULL == peer_ctx->recv_channel_ctx) )
392 { 413 {
393 Peers_unset_peer_flag (peer, Peers_ONLINE); 414 Peers_unset_peer_flag (peer, Peers_ONLINE);
394 return GNUNET_NO; 415 return GNUNET_NO;
@@ -575,6 +596,24 @@ handle_peer_pull_reply (void *cls,
575 596
576/* End declaration of handlers */ 597/* End declaration of handlers */
577 598
599/**
600 * @brief Allocate memory for a new channel context and insert it into DLL
601 *
602 * @param peer_ctx context of the according peer
603 *
604 * @return The channel context
605 */
606static struct ChannelCtx *
607add_channel_ctx (struct PeerContext *peer_ctx);
608
609/**
610 * @brief Remove the channel context from the DLL and free the memory.
611 *
612 * @param channel_ctx The channel context.
613 */
614static void
615remove_channel_ctx (struct ChannelCtx *channel_ctx);
616
578 617
579/** 618/**
580 * @brief Get the channel of a peer. If not existing, create. 619 * @brief Get the channel of a peer. If not existing, create.
@@ -610,16 +649,17 @@ get_channel (const struct GNUNET_PeerIdentity *peer)
610 649
611 650
612 peer_ctx = get_peer_ctx (peer); 651 peer_ctx = get_peer_ctx (peer);
613 if (NULL == peer_ctx->send_channel) 652 if (NULL == peer_ctx->send_channel_ctx)
614 { 653 {
615 LOG (GNUNET_ERROR_TYPE_DEBUG, 654 LOG (GNUNET_ERROR_TYPE_DEBUG,
616 "Trying to establish channel to peer %s\n", 655 "Trying to establish channel to peer %s\n",
617 GNUNET_i2s (peer)); 656 GNUNET_i2s (peer));
618 ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity); 657 ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity);
619 *ctx_peer = *peer; 658 *ctx_peer = *peer;
620 peer_ctx->send_channel = 659 peer_ctx->send_channel_ctx = add_channel_ctx (peer_ctx);
660 peer_ctx->send_channel_ctx->channel =
621 GNUNET_CADET_channel_create (cadet_handle, 661 GNUNET_CADET_channel_create (cadet_handle,
622 (struct GNUNET_PeerIdentity *) ctx_peer, /* context */ 662 peer_ctx->send_channel_ctx, /* context */
623 peer, 663 peer,
624 &port, 664 &port,
625 GNUNET_CADET_OPTION_RELIABLE, 665 GNUNET_CADET_OPTION_RELIABLE,
@@ -627,8 +667,9 @@ get_channel (const struct GNUNET_PeerIdentity *peer)
627 cleanup_destroyed_channel, /* Disconnect handler */ 667 cleanup_destroyed_channel, /* Disconnect handler */
628 cadet_handlers); 668 cadet_handlers);
629 } 669 }
630 GNUNET_assert (NULL != peer_ctx->send_channel); 670 GNUNET_assert (NULL != peer_ctx->send_channel_ctx);
631 return peer_ctx->send_channel; 671 GNUNET_assert (NULL != peer_ctx->send_channel_ctx->channel);
672 return peer_ctx->send_channel_ctx->channel;
632} 673}
633 674
634 675
@@ -1045,12 +1086,10 @@ restore_valid_peers ()
1045 */ 1086 */
1046void 1087void
1047Peers_initialise (char* fn_valid_peers, 1088Peers_initialise (char* fn_valid_peers,
1048 struct GNUNET_CADET_Handle *cadet_h, 1089 struct GNUNET_CADET_Handle *cadet_h)
1049 const struct GNUNET_PeerIdentity *own_id)
1050{ 1090{
1051 filename_valid_peers = GNUNET_strdup (fn_valid_peers); 1091 filename_valid_peers = GNUNET_strdup (fn_valid_peers);
1052 cadet_handle = cadet_h; 1092 cadet_handle = cadet_h;
1053 own_identity = *own_id;
1054 peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); 1093 peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO);
1055 valid_peers = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); 1094 valid_peers = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO);
1056 restore_valid_peers (); 1095 restore_valid_peers ();
@@ -1136,14 +1175,12 @@ Peers_get_valid_peers (PeersIterator iterator,
1136 * @param peer the new #GNUNET_PeerIdentity 1175 * @param peer the new #GNUNET_PeerIdentity
1137 * 1176 *
1138 * @return #GNUNET_YES if peer was inserted 1177 * @return #GNUNET_YES if peer was inserted
1139 * #GNUNET_NO otherwise (if peer was already known or 1178 * #GNUNET_NO otherwise
1140 * peer was #own_identity)
1141 */ 1179 */
1142int 1180int
1143Peers_insert_peer (const struct GNUNET_PeerIdentity *peer) 1181Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
1144{ 1182{
1145 if ( (GNUNET_YES == Peers_check_peer_known (peer)) || 1183 if (GNUNET_YES == Peers_check_peer_known (peer))
1146 (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity)) )
1147 { 1184 {
1148 return GNUNET_NO; /* We already know this peer - nothing to do */ 1185 return GNUNET_NO; /* We already know this peer - nothing to do */
1149 } 1186 }
@@ -1161,8 +1198,7 @@ Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1161 * 1198 *
1162 * @param peer the peer whose liveliness is to be checked 1199 * @param peer the peer whose liveliness is to be checked
1163 * @return #GNUNET_YES if peer had to be inserted 1200 * @return #GNUNET_YES if peer had to be inserted
1164 * #GNUNET_NO otherwise (if peer was already known or 1201 * #GNUNET_NO otherwise
1165 * peer was #own_identity)
1166 */ 1202 */
1167int 1203int
1168Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer) 1204Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
@@ -1170,13 +1206,10 @@ Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
1170 struct PeerContext *peer_ctx; 1206 struct PeerContext *peer_ctx;
1171 int ret; 1207 int ret;
1172 1208
1173 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity))
1174 {
1175 return GNUNET_NO;
1176 }
1177 ret = Peers_insert_peer (peer); 1209 ret = Peers_insert_peer (peer);
1178 peer_ctx = get_peer_ctx (peer); 1210 peer_ctx = get_peer_ctx (peer);
1179 if (GNUNET_NO == Peers_check_peer_flag (peer, Peers_ONLINE)) 1211 if ( (GNUNET_NO == Peers_check_peer_flag (peer, Peers_ONLINE)) &&
1212 (NULL == peer_ctx->liveliness_check_pending) )
1180 { 1213 {
1181 check_peer_live (peer_ctx); 1214 check_peer_live (peer_ctx);
1182 } 1215 }
@@ -1208,7 +1241,7 @@ Peers_check_removable (const struct GNUNET_PeerIdentity *peer)
1208 } 1241 }
1209 1242
1210 peer_ctx = get_peer_ctx (peer); 1243 peer_ctx = get_peer_ctx (peer);
1211 if ( (NULL != peer_ctx->recv_channel) || 1244 if ( (NULL != peer_ctx->recv_channel_ctx) ||
1212 (NULL != peer_ctx->pending_messages_head) || 1245 (NULL != peer_ctx->pending_messages_head) ||
1213 (GNUNET_NO == check_peer_flag_set (peer_ctx, Peers_PULL_REPLY_PENDING)) ) 1246 (GNUNET_NO == check_peer_flag_set (peer_ctx, Peers_PULL_REPLY_PENDING)) )
1214 { 1247 {
@@ -1224,6 +1257,46 @@ Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer,
1224int 1257int
1225Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags); 1258Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags);
1226 1259
1260static void
1261destroy_peer (void *cls)
1262{
1263 struct PeerContext *peer_ctx = cls;
1264
1265 GNUNET_assert (NULL != peer_ctx);
1266 peer_ctx->destruction_task = NULL;
1267 Peers_remove_peer (&peer_ctx->peer_id);
1268}
1269
1270static void
1271destroy_channel (void *cls);
1272
1273
1274static void
1275schedule_channel_destruction (struct ChannelCtx *channel_ctx)
1276{
1277 GNUNET_assert (NULL != channel_ctx);
1278 if (NULL != channel_ctx->destruction_task &&
1279 GNUNET_NO == in_shutdown)
1280 {
1281 channel_ctx->destruction_task =
1282 GNUNET_SCHEDULER_add_now (destroy_channel, channel_ctx);
1283 }
1284}
1285
1286
1287static void
1288schedule_peer_destruction (struct PeerContext *peer_ctx)
1289{
1290 GNUNET_assert (NULL != peer_ctx);
1291 if (NULL != peer_ctx->destruction_task &&
1292 GNUNET_NO == in_shutdown)
1293 {
1294 peer_ctx->destruction_task =
1295 GNUNET_SCHEDULER_add_now (destroy_peer, peer_ctx);
1296 }
1297}
1298
1299
1227/** 1300/**
1228 * @brief Remove peer 1301 * @brief Remove peer
1229 * 1302 *
@@ -1235,7 +1308,8 @@ int
1235Peers_remove_peer (const struct GNUNET_PeerIdentity *peer) 1308Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1236{ 1309{
1237 struct PeerContext *peer_ctx; 1310 struct PeerContext *peer_ctx;
1238 uint32_t *channel_flag; 1311
1312 GNUNET_assert (NULL != peer_map);
1239 1313
1240 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) 1314 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer))
1241 { 1315 {
@@ -1249,7 +1323,12 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1249 GNUNET_i2s (&peer_ctx->peer_id)); 1323 GNUNET_i2s (&peer_ctx->peer_id));
1250 Peers_unset_peer_flag (peer, Peers_ONLINE); 1324 Peers_unset_peer_flag (peer, Peers_ONLINE);
1251 1325
1326 /* Clear list of pending operations */
1327 // TODO this probably leaks memory
1328 // ('only' the cls to the function. Not sure what to do with it)
1252 GNUNET_array_grow (peer_ctx->pending_ops, peer_ctx->num_pending_ops, 0); 1329 GNUNET_array_grow (peer_ctx->pending_ops, peer_ctx->num_pending_ops, 0);
1330
1331 /* Remove all pending messages */
1253 while (NULL != peer_ctx->pending_messages_head) 1332 while (NULL != peer_ctx->pending_messages_head)
1254 { 1333 {
1255 LOG (GNUNET_ERROR_TYPE_DEBUG, 1334 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1261,10 +1340,12 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1261 peer_ctx->liveliness_check_pending, 1340 peer_ctx->liveliness_check_pending,
1262 sizeof (struct PendingMessage))) ) 1341 sizeof (struct PendingMessage))) )
1263 { 1342 {
1343 // TODO this may leak memory
1264 peer_ctx->liveliness_check_pending = NULL; 1344 peer_ctx->liveliness_check_pending = NULL;
1265 } 1345 }
1266 remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES); 1346 remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES);
1267 } 1347 }
1348
1268 /* If we are still waiting for notification whether this peer is live 1349 /* If we are still waiting for notification whether this peer is live
1269 * cancel the according task */ 1350 * cancel the according task */
1270 if (NULL != peer_ctx->liveliness_check_pending) 1351 if (NULL != peer_ctx->liveliness_check_pending)
@@ -1277,28 +1358,40 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1277 remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES); 1358 remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES);
1278 peer_ctx->liveliness_check_pending = NULL; 1359 peer_ctx->liveliness_check_pending = NULL;
1279 } 1360 }
1280 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_SENDING); 1361
1281 if (NULL != peer_ctx->send_channel && 1362
1282 GNUNET_YES != Peers_check_channel_flag (channel_flag, Peers_CHANNEL_DESTROING)) 1363 /* Do we still have to wait for destruction of channels
1364 * or issue the destruction? */
1365 if (NULL != peer_ctx->send_channel_ctx &&
1366 NULL != peer_ctx->send_channel_ctx->destruction_task
1367 )
1283 { 1368 {
1284 LOG (GNUNET_ERROR_TYPE_DEBUG, 1369 schedule_peer_destruction (peer_ctx);
1285 "Destroying send channel\n"); 1370 return GNUNET_NO;
1286 GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
1287 peer_ctx->send_channel = NULL;
1288 peer_ctx->mq = NULL;
1289 } 1371 }
1290 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_RECEIVING); 1372 if (NULL != peer_ctx->recv_channel_ctx &&
1291 if (NULL != peer_ctx->recv_channel && 1373 NULL != peer_ctx->recv_channel_ctx->destruction_task)
1292 GNUNET_YES != Peers_check_channel_flag (channel_flag, Peers_CHANNEL_DESTROING))
1293 { 1374 {
1294 LOG (GNUNET_ERROR_TYPE_DEBUG, 1375 schedule_peer_destruction (peer_ctx);
1295 "Destroying recv channel\n"); 1376 return GNUNET_NO;
1296 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel); 1377 }
1297 peer_ctx->recv_channel = NULL; 1378 if (NULL != peer_ctx->recv_channel_ctx)
1379 {
1380 schedule_channel_destruction (peer_ctx->recv_channel_ctx);
1381 schedule_peer_destruction (peer_ctx);
1382 return GNUNET_NO;
1383 }
1384 if (NULL != peer_ctx->send_channel_ctx)
1385 {
1386 schedule_channel_destruction (peer_ctx->send_channel_ctx);
1387 schedule_peer_destruction (peer_ctx);
1388 return GNUNET_NO;
1298 } 1389 }
1299 1390
1300 GNUNET_free (peer_ctx->send_channel_flags); 1391 if (NULL != peer_ctx->destruction_task)
1301 GNUNET_free (peer_ctx->recv_channel_flags); 1392 {
1393 GNUNET_SCHEDULER_cancel (peer_ctx->destruction_task);
1394 }
1302 1395
1303 if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_remove_all (peer_map, &peer_ctx->peer_id)) 1396 if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_remove_all (peer_map, &peer_ctx->peer_id))
1304 { 1397 {
@@ -1308,7 +1401,6 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1308 return GNUNET_YES; 1401 return GNUNET_YES;
1309} 1402}
1310 1403
1311
1312/** 1404/**
1313 * @brief set flags on a given peer. 1405 * @brief set flags on a given peer.
1314 * 1406 *
@@ -1364,77 +1456,6 @@ Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1364 return check_peer_flag_set (peer_ctx, flags); 1456 return check_peer_flag_set (peer_ctx, flags);
1365} 1457}
1366 1458
1367
1368/**
1369 * @brief set flags on a given channel.
1370 *
1371 * @param channel the channel to set flags on
1372 * @param flags the flags
1373 */
1374void
1375Peers_set_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags)
1376{
1377 set_channel_flag (channel_flags, flags);
1378}
1379
1380
1381/**
1382 * @brief unset flags on a given channel.
1383 *
1384 * @param channel the channel to unset flags on
1385 * @param flags the flags
1386 */
1387void
1388Peers_unset_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags)
1389{
1390 unset_channel_flag (channel_flags, flags);
1391}
1392
1393
1394/**
1395 * @brief Check whether flags on a channel are set.
1396 *
1397 * @param channel the channel to check the flag of
1398 * @param flags the flags to check
1399 *
1400 * @return #GNUNET_YES if all given flags are set
1401 * #GNUNET_NO otherwise
1402 */
1403int
1404Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags)
1405{
1406 return check_channel_flag_set (channel_flags, flags);
1407}
1408
1409/**
1410 * @brief Get the flags for the channel in @a role for @a peer.
1411 *
1412 * @param peer Peer to get the channel flags for.
1413 * @param role Role of channel to get flags for
1414 *
1415 * @return The flags.
1416 */
1417uint32_t *
1418Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer,
1419 enum Peers_ChannelRole role)
1420{
1421 const struct PeerContext *peer_ctx;
1422
1423 peer_ctx = get_peer_ctx (peer);
1424 if (Peers_CHANNEL_ROLE_SENDING == role)
1425 {
1426 return peer_ctx->send_channel_flags;
1427 }
1428 else if (Peers_CHANNEL_ROLE_RECEIVING == role)
1429 {
1430 return peer_ctx->recv_channel_flags;
1431 }
1432 else
1433 {
1434 GNUNET_assert (0);
1435 }
1436}
1437
1438/** 1459/**
1439 * @brief Check whether we have information about the given peer. 1460 * @brief Check whether we have information about the given peer.
1440 * 1461 *
@@ -1505,7 +1526,7 @@ Peers_check_peer_send_intention (const struct GNUNET_PeerIdentity *peer)
1505 const struct PeerContext *peer_ctx; 1526 const struct PeerContext *peer_ctx;
1506 1527
1507 peer_ctx = get_peer_ctx (peer); 1528 peer_ctx = get_peer_ctx (peer);
1508 if (NULL != peer_ctx->recv_channel) 1529 if (NULL != peer_ctx->recv_channel_ctx)
1509 { 1530 {
1510 return GNUNET_YES; 1531 return GNUNET_YES;
1511 } 1532 }
@@ -1530,6 +1551,7 @@ Peers_handle_inbound_channel (void *cls,
1530{ 1551{
1531 struct PeerContext *peer_ctx; 1552 struct PeerContext *peer_ctx;
1532 struct GNUNET_PeerIdentity *ctx_peer; 1553 struct GNUNET_PeerIdentity *ctx_peer;
1554 struct ChannelCtx *channel_ctx;
1533 1555
1534 LOG (GNUNET_ERROR_TYPE_DEBUG, 1556 LOG (GNUNET_ERROR_TYPE_DEBUG,
1535 "New channel was established to us (Peer %s).\n", 1557 "New channel was established to us (Peer %s).\n",
@@ -1540,19 +1562,22 @@ Peers_handle_inbound_channel (void *cls,
1540 set_peer_live (peer_ctx); 1562 set_peer_live (peer_ctx);
1541 ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity); 1563 ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity);
1542 *ctx_peer = *initiator; 1564 *ctx_peer = *initiator;
1565 channel_ctx = add_channel_ctx (peer_ctx);
1566 channel_ctx->channel = channel;
1543 /* We only accept one incoming channel per peer */ 1567 /* We only accept one incoming channel per peer */
1544 if (GNUNET_YES == Peers_check_peer_send_intention (initiator)) 1568 if (GNUNET_YES == Peers_check_peer_send_intention (initiator))
1545 { 1569 {
1546 set_channel_flag (peer_ctx->recv_channel_flags, 1570 LOG (GNUNET_ERROR_TYPE_WARNING,
1547 Peers_CHANNEL_ESTABLISHED_TWICE); 1571 "Already got one receive channel. Destroying old one.\n");
1548 //GNUNET_CADET_channel_destroy (channel); 1572 GNUNET_break_op (0);
1549 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel); 1573 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel_ctx->channel);
1550 peer_ctx->recv_channel = channel; 1574 remove_channel_ctx (peer_ctx->recv_channel_ctx);
1575 peer_ctx->recv_channel_ctx = channel_ctx;
1551 /* return the channel context */ 1576 /* return the channel context */
1552 return ctx_peer; 1577 return channel_ctx;
1553 } 1578 }
1554 peer_ctx->recv_channel = channel; 1579 peer_ctx->recv_channel_ctx = channel_ctx;
1555 return ctx_peer; 1580 return channel_ctx;
1556} 1581}
1557 1582
1558 1583
@@ -1574,7 +1599,7 @@ Peers_check_sending_channel_exists (const struct GNUNET_PeerIdentity *peer)
1574 return GNUNET_NO; 1599 return GNUNET_NO;
1575 } 1600 }
1576 peer_ctx = get_peer_ctx (peer); 1601 peer_ctx = get_peer_ctx (peer);
1577 if (NULL == peer_ctx->send_channel) 1602 if (NULL == peer_ctx->send_channel_ctx)
1578 { 1603 {
1579 return GNUNET_NO; 1604 return GNUNET_NO;
1580 } 1605 }
@@ -1607,12 +1632,14 @@ Peers_check_channel_role (const struct GNUNET_PeerIdentity *peer,
1607 } 1632 }
1608 peer_ctx = get_peer_ctx (peer); 1633 peer_ctx = get_peer_ctx (peer);
1609 if ( (Peers_CHANNEL_ROLE_SENDING == role) && 1634 if ( (Peers_CHANNEL_ROLE_SENDING == role) &&
1610 (channel == peer_ctx->send_channel) ) 1635 (NULL != peer_ctx->send_channel_ctx) &&
1636 (channel == peer_ctx->send_channel_ctx->channel) )
1611 { 1637 {
1612 return GNUNET_YES; 1638 return GNUNET_YES;
1613 } 1639 }
1614 if ( (Peers_CHANNEL_ROLE_RECEIVING == role) && 1640 if ( (Peers_CHANNEL_ROLE_RECEIVING == role) &&
1615 (channel == peer_ctx->recv_channel) ) 1641 (NULL != peer_ctx->recv_channel_ctx) &&
1642 (channel == peer_ctx->recv_channel_ctx->channel) )
1616 { 1643 {
1617 return GNUNET_YES; 1644 return GNUNET_YES;
1618 } 1645 }
@@ -1642,18 +1669,29 @@ Peers_destroy_sending_channel (const struct GNUNET_PeerIdentity *peer)
1642 return GNUNET_NO; 1669 return GNUNET_NO;
1643 } 1670 }
1644 peer_ctx = get_peer_ctx (peer); 1671 peer_ctx = get_peer_ctx (peer);
1645 if (NULL != peer_ctx->send_channel) 1672 if (NULL != peer_ctx->send_channel_ctx)
1646 { 1673 {
1647 set_channel_flag (peer_ctx->send_channel_flags, Peers_CHANNEL_CLEAN); 1674 schedule_channel_destruction (peer_ctx->send_channel_ctx);
1648 GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
1649 peer_ctx->send_channel = NULL;
1650 peer_ctx->mq = NULL;
1651 (void) Peers_check_connected (peer); 1675 (void) Peers_check_connected (peer);
1652 return GNUNET_YES; 1676 return GNUNET_YES;
1653 } 1677 }
1654 return GNUNET_NO; 1678 return GNUNET_NO;
1655} 1679}
1656 1680
1681static void
1682destroy_channel (void *cls)
1683{
1684 struct ChannelCtx *channel_ctx = cls;
1685 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
1686
1687 GNUNET_assert (channel_ctx == peer_ctx->send_channel_ctx ||
1688 channel_ctx == peer_ctx->recv_channel_ctx);
1689
1690 channel_ctx->destruction_task = NULL;
1691 GNUNET_CADET_channel_destroy (channel_ctx->channel);
1692 remove_channel_ctx (peer_ctx->send_channel_ctx);
1693}
1694
1657/** 1695/**
1658 * This is called when a channel is destroyed. 1696 * This is called when a channel is destroyed.
1659 * 1697 *
@@ -1664,9 +1702,9 @@ void
1664Peers_cleanup_destroyed_channel (void *cls, 1702Peers_cleanup_destroyed_channel (void *cls,
1665 const struct GNUNET_CADET_Channel *channel) 1703 const struct GNUNET_CADET_Channel *channel)
1666{ 1704{
1667 struct GNUNET_PeerIdentity *peer = cls; 1705 struct ChannelCtx *channel_ctx = cls;
1668 struct PeerContext *peer_ctx; 1706 const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
1669 uint32_t *channel_flag; 1707 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
1670 1708
1671 if (GNUNET_NO == Peers_check_peer_known (peer)) 1709 if (GNUNET_NO == Peers_check_peer_known (peer))
1672 {/* We don't want to implicitly create a context that we're about to kill */ 1710 {/* We don't want to implicitly create a context that we're about to kill */
@@ -1675,71 +1713,34 @@ Peers_cleanup_destroyed_channel (void *cls,
1675 GNUNET_i2s (peer)); 1713 GNUNET_i2s (peer));
1676 return; 1714 return;
1677 } 1715 }
1678 peer_ctx = get_peer_ctx (peer);
1679 1716
1680 /* If our peer issued the destruction of the channel, the #Peers_TO_DESTROY 1717 /* If our peer issued the destruction of the channel, the #Peers_TO_DESTROY
1681 * flag will be set. In this case simply make sure that the channels are 1718 * flag will be set. In this case simply make sure that the channels are
1682 * cleaned. */ 1719 * cleaned. */
1683 /* FIXME This distinction seems to be redundant */ 1720 /* The distinction seems to be redundant */
1684 if (Peers_check_peer_flag (peer, Peers_TO_DESTROY)) 1721 LOG (GNUNET_ERROR_TYPE_DEBUG,
1685 {/* We initiatad the destruction of this particular peer */ 1722 "Peer is NOT in the process of being destroyed\n");
1723 if ( (NULL != peer_ctx->send_channel_ctx) &&
1724 (channel == peer_ctx->send_channel_ctx->channel) )
1725 { /* Something (but us) killd the channel - clean up peer */
1686 LOG (GNUNET_ERROR_TYPE_DEBUG, 1726 LOG (GNUNET_ERROR_TYPE_DEBUG,
1687 "Peer is in the process of being destroyed\n"); 1727 "send channel (%s) was destroyed - cleaning up\n",
1688 if (channel == peer_ctx->send_channel) 1728 GNUNET_i2s (peer));
1689 { 1729 remove_channel_ctx (peer_ctx->send_channel_ctx);
1690 peer_ctx->send_channel = NULL;
1691 peer_ctx->mq = NULL;
1692 }
1693 else if (channel == peer_ctx->recv_channel)
1694 {
1695 peer_ctx->recv_channel = NULL;
1696 }
1697
1698 if (NULL != peer_ctx->send_channel)
1699 {
1700 GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
1701 channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_SENDING);
1702 Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING);
1703 peer_ctx->send_channel = NULL;
1704 peer_ctx->mq = NULL;
1705 }
1706 if (NULL != peer_ctx->recv_channel)
1707 {
1708 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel);
1709 channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_RECEIVING);
1710 Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING);
1711 peer_ctx->recv_channel = NULL;
1712 }
1713 /* Set the #Peers_ONLINE flag accordingly */
1714 (void) Peers_check_connected (peer);
1715 return;
1716 } 1730 }
1717 1731 else if ( (NULL != peer_ctx->recv_channel_ctx) &&
1718 else 1732 (channel == peer_ctx->recv_channel_ctx->channel) )
1719 { /* We did not initiate the destruction of this peer */ 1733 { /* Other peer doesn't want to send us messages anymore */
1720 LOG (GNUNET_ERROR_TYPE_DEBUG, 1734 LOG (GNUNET_ERROR_TYPE_DEBUG,
1721 "Peer is NOT in the process of being destroyed\n"); 1735 "Peer %s destroyed recv channel - cleaning up channel\n",
1722 if (channel == peer_ctx->send_channel) 1736 GNUNET_i2s (peer));
1723 { /* Something (but us) killd the channel - clean up peer */ 1737 remove_channel_ctx (peer_ctx->send_channel_ctx);
1724 LOG (GNUNET_ERROR_TYPE_DEBUG, 1738 }
1725 "send channel (%s) was destroyed - cleaning up\n", 1739 else
1726 GNUNET_i2s (peer)); 1740 {
1727 peer_ctx->send_channel = NULL; 1741 LOG (GNUNET_ERROR_TYPE_WARNING,
1728 peer_ctx->mq = NULL; 1742 "unknown channel (%s) was destroyed\n",
1729 } 1743 GNUNET_i2s (peer));
1730 else if (channel == peer_ctx->recv_channel)
1731 { /* Other peer doesn't want to send us messages anymore */
1732 LOG (GNUNET_ERROR_TYPE_DEBUG,
1733 "Peer %s destroyed recv channel - cleaning up channel\n",
1734 GNUNET_i2s (peer));
1735 peer_ctx->recv_channel = NULL;
1736 }
1737 else
1738 {
1739 LOG (GNUNET_ERROR_TYPE_WARNING,
1740 "unknown channel (%s) was destroyed\n",
1741 GNUNET_i2s (peer));
1742 }
1743 } 1744 }
1744 (void) Peers_check_connected (peer); 1745 (void) Peers_check_connected (peer);
1745} 1746}
@@ -1791,10 +1792,6 @@ Peers_schedule_operation (const struct GNUNET_PeerIdentity *peer,
1791 struct PeerPendingOp pending_op; 1792 struct PeerPendingOp pending_op;
1792 struct PeerContext *peer_ctx; 1793 struct PeerContext *peer_ctx;
1793 1794
1794 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity))
1795 {
1796 return GNUNET_NO;
1797 }
1798 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer)); 1795 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer));
1799 1796
1800 //TODO if LIVE/ONLINE execute immediately 1797 //TODO if LIVE/ONLINE execute immediately
@@ -1828,7 +1825,7 @@ Peers_get_recv_channel (const struct GNUNET_PeerIdentity *peer)
1828 1825
1829 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer)); 1826 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer));
1830 peer_ctx = get_peer_ctx (peer); 1827 peer_ctx = get_peer_ctx (peer);
1831 return peer_ctx->recv_channel; 1828 return peer_ctx->recv_channel_ctx->channel;
1832} 1829}
1833/*********************************************************************** 1830/***********************************************************************
1834 * /Old gnunet-service-rps_peers.c 1831 * /Old gnunet-service-rps_peers.c
@@ -2489,6 +2486,9 @@ send_pull_reply (const struct GNUNET_PeerIdentity *peer_id,
2489 2486
2490 Peers_send_message (peer_id, ev, "PULL REPLY"); 2487 Peers_send_message (peer_id, ev, "PULL REPLY");
2491 GNUNET_STATISTICS_update(stats, "# pull reply send issued", 1, GNUNET_NO); 2488 GNUNET_STATISTICS_update(stats, "# pull reply send issued", 1, GNUNET_NO);
2489 // TODO check with send intention: as send_channel is used/opened we indicate
2490 // a sending intention without intending it.
2491 // -> clean peer afterwards?
2492} 2492}
2493 2493
2494 2494
@@ -2621,7 +2621,7 @@ remove_peer (const struct GNUNET_PeerIdentity *peer)
2621 CustomPeerMap_remove_peer (push_map, peer); 2621 CustomPeerMap_remove_peer (push_map, peer);
2622 RPS_sampler_reinitialise_by_value (prot_sampler, peer); 2622 RPS_sampler_reinitialise_by_value (prot_sampler, peer);
2623 RPS_sampler_reinitialise_by_value (client_sampler, peer); 2623 RPS_sampler_reinitialise_by_value (client_sampler, peer);
2624 Peers_remove_peer (peer); 2624 schedule_peer_destruction (get_peer_ctx (peer));
2625} 2625}
2626 2626
2627 2627
@@ -2665,6 +2665,58 @@ clean_peer (const struct GNUNET_PeerIdentity *peer)
2665} 2665}
2666 2666
2667/** 2667/**
2668 * @brief Allocate memory for a new channel context and insert it into DLL
2669 *
2670 * @param peer_ctx context of the according peer
2671 *
2672 * @return The channel context
2673 */
2674static struct ChannelCtx *
2675add_channel_ctx (struct PeerContext *peer_ctx)
2676{
2677 struct ChannelCtx *channel_ctx;
2678 channel_ctx = GNUNET_new (struct ChannelCtx);
2679 channel_ctx->peer_ctx = peer_ctx;
2680 return channel_ctx;
2681}
2682
2683/**
2684 * @brief Remove the channel context from the DLL and free the memory.
2685 *
2686 * @param channel_ctx The channel context.
2687 */
2688static void
2689remove_channel_ctx (struct ChannelCtx *channel_ctx)
2690{
2691 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
2692 if (NULL != channel_ctx->destruction_task)
2693 {
2694 GNUNET_SCHEDULER_cancel (channel_ctx->destruction_task);
2695 }
2696 GNUNET_free (channel_ctx);
2697
2698 if (channel_ctx == peer_ctx->send_channel_ctx)
2699 {
2700 peer_ctx->send_channel_ctx = NULL;
2701 peer_ctx->mq = NULL;
2702 }
2703 else if (channel_ctx == peer_ctx->recv_channel_ctx)
2704 {
2705 peer_ctx->recv_channel_ctx = NULL;
2706 }
2707 else
2708 {
2709 LOG (GNUNET_ERROR_TYPE_ERROR,
2710 "Trying to remove channel_ctx that is not associated with a peer\n");
2711 LOG (GNUNET_ERROR_TYPE_ERROR,
2712 "\trecv: %p\n", peer_ctx->recv_channel_ctx);
2713 LOG (GNUNET_ERROR_TYPE_ERROR,
2714 "\tsend: %p\n", peer_ctx->send_channel_ctx);
2715 GNUNET_assert (0);
2716 }
2717}
2718
2719/**
2668 * @brief This is called when a channel is destroyed. 2720 * @brief This is called when a channel is destroyed.
2669 * 2721 *
2670 * Removes peer completely from our knowledge if the send_channel was destroyed 2722 * Removes peer completely from our knowledge if the send_channel was destroyed
@@ -2680,8 +2732,8 @@ static void
2680cleanup_destroyed_channel (void *cls, 2732cleanup_destroyed_channel (void *cls,
2681 const struct GNUNET_CADET_Channel *channel) 2733 const struct GNUNET_CADET_Channel *channel)
2682{ 2734{
2683 struct GNUNET_PeerIdentity *peer = cls; 2735 struct ChannelCtx *channel_ctx = cls;
2684 uint32_t *channel_flag; 2736 struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
2685 struct PeerContext *peer_ctx; 2737 struct PeerContext *peer_ctx;
2686 2738
2687 GNUNET_assert (NULL != peer); 2739 GNUNET_assert (NULL != peer);
@@ -2691,94 +2743,26 @@ cleanup_destroyed_channel (void *cls,
2691 LOG (GNUNET_ERROR_TYPE_WARNING, 2743 LOG (GNUNET_ERROR_TYPE_WARNING,
2692 "channel (%s) without associated context was destroyed\n", 2744 "channel (%s) without associated context was destroyed\n",
2693 GNUNET_i2s (peer)); 2745 GNUNET_i2s (peer));
2694 GNUNET_free (peer); 2746 remove_channel_ctx (channel_ctx);
2695 return; 2747 return;
2696 } 2748 }
2697 2749
2698 peer_ctx = get_peer_ctx (peer); 2750 peer_ctx = get_peer_ctx (peer);
2699 if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_RECEIVING))
2700 {
2701 LOG (GNUNET_ERROR_TYPE_DEBUG,
2702 "Callback on destruction of recv-channel was called (%s)\n",
2703 GNUNET_i2s (peer));
2704 set_channel_flag (peer_ctx->recv_channel_flags, Peers_CHANNEL_DESTROING);
2705 } else if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_SENDING))
2706 {
2707 LOG (GNUNET_ERROR_TYPE_DEBUG,
2708 "Callback on destruction of send-channel was called (%s)\n",
2709 GNUNET_i2s (peer));
2710 set_channel_flag (peer_ctx->send_channel_flags, Peers_CHANNEL_DESTROING);
2711 } else {
2712 LOG (GNUNET_ERROR_TYPE_ERROR,
2713 "Channel to be destroyed has is neither sending nor receiving role\n");
2714 }
2715 2751
2716 if (GNUNET_YES == Peers_check_peer_flag (peer, Peers_TO_DESTROY)) 2752 // What should be done here:
2717 { /* We are in the middle of removing that peer from our knowledge. In this 2753 // * cleanup everything related to the channel
2718 case simply make sure that the channels are cleaned. */ 2754 // * memory
2719 Peers_cleanup_destroyed_channel (cls, channel); 2755 // * remove peer if necessary
2720 to_file (file_name_view_log,
2721 "-%s\t(cleanup channel, ourself)",
2722 GNUNET_i2s_full (peer));
2723 GNUNET_free (peer);
2724 return;
2725 }
2726 2756
2727 if (GNUNET_YES == 2757 if (peer_ctx->recv_channel_ctx == channel_ctx)
2728 Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_SENDING)) 2758 {
2729 { /* Channel used for sending was destroyed */ 2759 remove_channel_ctx (channel_ctx);
2730 /* Possible causes of channel destruction:
2731 * - ourselves -> cleaning send channel -> clean context
2732 * - other peer -> peer probably went down -> remove
2733 */
2734 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_SENDING);
2735 if (GNUNET_YES == Peers_check_channel_flag (channel_flag, Peers_CHANNEL_CLEAN))
2736 { /* We are about to clean the sending channel. Clean the respective
2737 * context */
2738 Peers_cleanup_destroyed_channel (cls, channel);
2739 GNUNET_free (peer);
2740 return;
2741 }
2742 else
2743 { /* Other peer destroyed our sending channel that it is supposed to keep
2744 * open. It probably went down. Remove it from our knowledge. */
2745 Peers_cleanup_destroyed_channel (cls, channel);
2746 remove_peer (peer);
2747 GNUNET_free (peer);
2748 return;
2749 }
2750 }
2751 else if (GNUNET_YES ==
2752 Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_RECEIVING))
2753 { /* Channel used for receiving was destroyed */
2754 /* Possible causes of channel destruction:
2755 * - ourselves -> peer tried to establish channel twice -> clean context
2756 * - other peer -> peer doesn't want to send us data -> clean
2757 */
2758 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_RECEIVING);
2759 if (GNUNET_YES ==
2760 Peers_check_channel_flag (channel_flag, Peers_CHANNEL_ESTABLISHED_TWICE))
2761 { /* Other peer tried to establish a channel to us twice. We do not accept
2762 * that. Clean the context. */
2763 Peers_cleanup_destroyed_channel (cls, channel);
2764 GNUNET_free (peer);
2765 return;
2766 }
2767 else
2768 { /* Other peer doesn't want to send us data anymore. We are free to clean
2769 * it. */
2770 Peers_cleanup_destroyed_channel (cls, channel);
2771 clean_peer (peer);
2772 GNUNET_free (peer);
2773 return;
2774 }
2775 } 2760 }
2776 else 2761 else if (peer_ctx->send_channel_ctx == channel_ctx)
2777 { 2762 {
2778 LOG (GNUNET_ERROR_TYPE_WARNING, 2763 remove_channel_ctx (channel_ctx);
2779 "Destroyed channel is neither sending nor receiving channel\n"); 2764 remove_peer (&peer_ctx->peer_id);
2780 } 2765 }
2781 GNUNET_free (peer);
2782} 2766}
2783 2767
2784/*********************************************************************** 2768/***********************************************************************
@@ -3037,8 +3021,6 @@ handle_client_seed (void *cls,
3037 3021
3038 num_peers = ntohl (msg->num_peers); 3022 num_peers = ntohl (msg->num_peers);
3039 peers = (struct GNUNET_PeerIdentity *) &msg[1]; 3023 peers = (struct GNUNET_PeerIdentity *) &msg[1];
3040 //peers = GNUNET_new_array (num_peers, struct GNUNET_PeerIdentity);
3041 //GNUNET_memcpy (peers, &msg[1], num_peers * sizeof (struct GNUNET_PeerIdentity));
3042 3024
3043 LOG (GNUNET_ERROR_TYPE_DEBUG, 3025 LOG (GNUNET_ERROR_TYPE_DEBUG,
3044 "Client seeded peers:\n"); 3026 "Client seeded peers:\n");
@@ -3053,9 +3035,6 @@ handle_client_seed (void *cls,
3053 3035
3054 got_peer (&peers[i]); 3036 got_peer (&peers[i]);
3055 } 3037 }
3056
3057 ////GNUNET_free (peers);
3058
3059 GNUNET_SERVICE_client_continue (cli_ctx->client); 3038 GNUNET_SERVICE_client_continue (cli_ctx->client);
3060} 3039}
3061 3040
@@ -3173,11 +3152,12 @@ static void
3173handle_peer_check (void *cls, 3152handle_peer_check (void *cls,
3174 const struct GNUNET_MessageHeader *msg) 3153 const struct GNUNET_MessageHeader *msg)
3175{ 3154{
3176 const struct GNUNET_PeerIdentity *peer = cls; 3155 const struct ChannelCtx *channel_ctx = cls;
3156 const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
3177 LOG (GNUNET_ERROR_TYPE_DEBUG, 3157 LOG (GNUNET_ERROR_TYPE_DEBUG,
3178 "Received CHECK_LIVE (%s)\n", GNUNET_i2s (peer)); 3158 "Received CHECK_LIVE (%s)\n", GNUNET_i2s (peer));
3179 3159
3180 GNUNET_CADET_receive_done (Peers_get_recv_channel (peer)); 3160 GNUNET_CADET_receive_done (channel_ctx->channel);
3181} 3161}
3182 3162
3183/** 3163/**
@@ -3193,7 +3173,8 @@ static void
3193handle_peer_push (void *cls, 3173handle_peer_push (void *cls,
3194 const struct GNUNET_MessageHeader *msg) 3174 const struct GNUNET_MessageHeader *msg)
3195{ 3175{
3196 const struct GNUNET_PeerIdentity *peer = cls; 3176 const struct ChannelCtx *channel_ctx = cls;
3177 const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
3197 3178
3198 // (check the proof of work (?)) 3179 // (check the proof of work (?))
3199 3180
@@ -3238,7 +3219,7 @@ handle_peer_push (void *cls,
3238 CustomPeerMap_put (push_map, peer); 3219 CustomPeerMap_put (push_map, peer);
3239 3220
3240 GNUNET_break_op (Peers_check_peer_known (peer)); 3221 GNUNET_break_op (Peers_check_peer_known (peer));
3241 GNUNET_CADET_receive_done (Peers_get_recv_channel (peer)); 3222 GNUNET_CADET_receive_done (channel_ctx->channel);
3242} 3223}
3243 3224
3244 3225
@@ -3254,7 +3235,8 @@ static void
3254handle_peer_pull_request (void *cls, 3235handle_peer_pull_request (void *cls,
3255 const struct GNUNET_MessageHeader *msg) 3236 const struct GNUNET_MessageHeader *msg)
3256{ 3237{
3257 struct GNUNET_PeerIdentity *peer = cls; 3238 const struct ChannelCtx *channel_ctx = cls;
3239 const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
3258 const struct GNUNET_PeerIdentity *view_array; 3240 const struct GNUNET_PeerIdentity *view_array;
3259 3241
3260 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received PULL REQUEST (%s)\n", GNUNET_i2s (peer)); 3242 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received PULL REQUEST (%s)\n", GNUNET_i2s (peer));
@@ -3277,7 +3259,7 @@ handle_peer_pull_request (void *cls,
3277 #endif /* ENABLE_MALICIOUS */ 3259 #endif /* ENABLE_MALICIOUS */
3278 3260
3279 GNUNET_break_op (Peers_check_peer_known (peer)); 3261 GNUNET_break_op (Peers_check_peer_known (peer));
3280 GNUNET_CADET_receive_done (Peers_get_recv_channel (peer)); 3262 GNUNET_CADET_receive_done (channel_ctx->channel);
3281 view_array = View_get_as_array (); 3263 view_array = View_get_as_array ();
3282 send_pull_reply (peer, view_array, View_size ()); 3264 send_pull_reply (peer, view_array, View_size ());
3283} 3265}
@@ -3317,7 +3299,8 @@ check_peer_pull_reply (void *cls,
3317 if (GNUNET_YES != Peers_check_peer_flag (sender, Peers_PULL_REPLY_PENDING)) 3299 if (GNUNET_YES != Peers_check_peer_flag (sender, Peers_PULL_REPLY_PENDING))
3318 { 3300 {
3319 LOG (GNUNET_ERROR_TYPE_WARNING, 3301 LOG (GNUNET_ERROR_TYPE_WARNING,
3320 "Received a pull reply from a peer we didn't request one from!\n"); 3302 "Received a pull reply from a peer (%s) we didn't request one from!\n",
3303 GNUNET_i2s (sender));
3321 GNUNET_break_op (0); 3304 GNUNET_break_op (0);
3322 return GNUNET_SYSERR; 3305 return GNUNET_SYSERR;
3323 } 3306 }
@@ -3334,8 +3317,9 @@ static void
3334handle_peer_pull_reply (void *cls, 3317handle_peer_pull_reply (void *cls,
3335 const struct GNUNET_RPS_P2P_PullReplyMessage *msg) 3318 const struct GNUNET_RPS_P2P_PullReplyMessage *msg)
3336{ 3319{
3320 const struct ChannelCtx *channel_ctx = cls;
3321 const struct GNUNET_PeerIdentity *sender = &channel_ctx->peer_ctx->peer_id;
3337 const struct GNUNET_PeerIdentity *peers; 3322 const struct GNUNET_PeerIdentity *peers;
3338 struct GNUNET_PeerIdentity *sender = cls;
3339 uint32_t i; 3323 uint32_t i;
3340#ifdef ENABLE_MALICIOUS 3324#ifdef ENABLE_MALICIOUS
3341 struct AttackedPeer *tmp_att_peer; 3325 struct AttackedPeer *tmp_att_peer;
@@ -3373,9 +3357,7 @@ handle_peer_pull_reply (void *cls,
3373 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set, 3357 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set,
3374 &peers[i]) 3358 &peers[i])
3375 && GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set, 3359 && GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set,
3376 &peers[i]) 3360 &peers[i]))
3377 && 0 != GNUNET_CRYPTO_cmp_peer_identity (&peers[i],
3378 &own_identity))
3379 { 3361 {
3380 tmp_att_peer = GNUNET_new (struct AttackedPeer); 3362 tmp_att_peer = GNUNET_new (struct AttackedPeer);
3381 tmp_att_peer->peer_id = peers[i]; 3363 tmp_att_peer->peer_id = peers[i];
@@ -3387,21 +3369,17 @@ handle_peer_pull_reply (void *cls,
3387 continue; 3369 continue;
3388 } 3370 }
3389 #endif /* ENABLE_MALICIOUS */ 3371 #endif /* ENABLE_MALICIOUS */
3390 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, 3372 /* Make sure we 'know' about this peer */
3391 &peers[i])) 3373 (void) Peers_insert_peer (&peers[i]);
3392 {
3393 /* Make sure we 'know' about this peer */
3394 (void) Peers_insert_peer (&peers[i]);
3395 3374
3396 if (GNUNET_YES == Peers_check_peer_valid (&peers[i])) 3375 if (GNUNET_YES == Peers_check_peer_valid (&peers[i]))
3397 { 3376 {
3398 CustomPeerMap_put (pull_map, &peers[i]); 3377 CustomPeerMap_put (pull_map, &peers[i]);
3399 } 3378 }
3400 else 3379 else
3401 { 3380 {
3402 Peers_schedule_operation (&peers[i], insert_in_pull_map); 3381 Peers_schedule_operation (&peers[i], insert_in_pull_map);
3403 (void) Peers_issue_peer_liveliness_check (&peers[i]); 3382 (void) Peers_issue_peer_liveliness_check (&peers[i]);
3404 }
3405 } 3383 }
3406 } 3384 }
3407 3385
@@ -3409,7 +3387,7 @@ handle_peer_pull_reply (void *cls,
3409 clean_peer (sender); 3387 clean_peer (sender);
3410 3388
3411 GNUNET_break_op (Peers_check_peer_known (sender)); 3389 GNUNET_break_op (Peers_check_peer_known (sender));
3412 GNUNET_CADET_receive_done (Peers_get_recv_channel (sender)); 3390 GNUNET_CADET_receive_done (channel_ctx->channel);
3413} 3391}
3414 3392
3415 3393
@@ -3836,10 +3814,8 @@ do_round (void *cls)
3836 for (i = 0; i < a_peers; i++) 3814 for (i = 0; i < a_peers; i++)
3837 { 3815 {
3838 peer = view_array[permut[i]]; 3816 peer = view_array[permut[i]];
3839 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, &peer)) // TODO 3817 // FIXME if this fails schedule/loop this for later
3840 { // FIXME if this fails schedule/loop this for later 3818 send_push (&peer);
3841 send_push (&peer);
3842 }
3843 } 3819 }
3844 3820
3845 /* Send PULL requests */ 3821 /* Send PULL requests */
@@ -3857,8 +3833,7 @@ do_round (void *cls)
3857 for (i = first_border; i < second_border; i++) 3833 for (i = first_border; i < second_border; i++)
3858 { 3834 {
3859 peer = view_array[permut[i]]; 3835 peer = view_array[permut[i]];
3860 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, &peer) && 3836 if ( GNUNET_NO == Peers_check_peer_flag (&peer, Peers_PULL_REPLY_PENDING))
3861 GNUNET_NO == Peers_check_peer_flag (&peer, Peers_PULL_REPLY_PENDING)) // TODO
3862 { // FIXME if this fails schedule/loop this for later 3837 { // FIXME if this fails schedule/loop this for later
3863 send_pull_request (&peer); 3838 send_pull_request (&peer);
3864 } 3839 }
@@ -3955,7 +3930,6 @@ do_round (void *cls)
3955 "-%s", 3930 "-%s",
3956 GNUNET_i2s_full (&peers_to_clean[i])); 3931 GNUNET_i2s_full (&peers_to_clean[i]));
3957 clean_peer (&peers_to_clean[i]); 3932 clean_peer (&peers_to_clean[i]);
3958 //peer_destroy_channel_send (sender);
3959 } 3933 }
3960 3934
3961 GNUNET_array_grow (peers_to_clean, peers_to_clean_size, 0); 3935 GNUNET_array_grow (peers_to_clean, peers_to_clean_size, 0);
@@ -4011,7 +3985,6 @@ do_round (void *cls)
4011 GNUNET_i2s (update_peer)); 3985 GNUNET_i2s (update_peer));
4012 insert_in_sampler (NULL, update_peer); 3986 insert_in_sampler (NULL, update_peer);
4013 clean_peer (update_peer); /* This cleans only if it is not in the view */ 3987 clean_peer (update_peer); /* This cleans only if it is not in the view */
4014 //peer_destroy_channel_send (sender);
4015 } 3988 }
4016 3989
4017 for (i = 0; i < CustomPeerMap_size (pull_map); i++) 3990 for (i = 0; i < CustomPeerMap_size (pull_map); i++)
@@ -4022,7 +3995,6 @@ do_round (void *cls)
4022 insert_in_sampler (NULL, CustomPeerMap_get_peer_by_index (pull_map, i)); 3995 insert_in_sampler (NULL, CustomPeerMap_get_peer_by_index (pull_map, i));
4023 /* This cleans only if it is not in the view */ 3996 /* This cleans only if it is not in the view */
4024 clean_peer (CustomPeerMap_get_peer_by_index (pull_map, i)); 3997 clean_peer (CustomPeerMap_get_peer_by_index (pull_map, i));
4025 //peer_destroy_channel_send (sender);
4026 } 3998 }
4027 3999
4028 4000
@@ -4125,6 +4097,8 @@ shutdown_task (void *cls)
4125 struct ClientContext *client_ctx; 4097 struct ClientContext *client_ctx;
4126 struct ReplyCls *reply_cls; 4098 struct ReplyCls *reply_cls;
4127 4099
4100 in_shutdown = GNUNET_YES;
4101
4128 LOG (GNUNET_ERROR_TYPE_DEBUG, 4102 LOG (GNUNET_ERROR_TYPE_DEBUG,
4129 "RPS is going down\n"); 4103 "RPS is going down\n");
4130 4104
@@ -4369,10 +4343,17 @@ run (void *cls,
4369 NULL, /* WindowSize handler */ 4343 NULL, /* WindowSize handler */
4370 cleanup_destroyed_channel, /* Disconnect handler */ 4344 cleanup_destroyed_channel, /* Disconnect handler */
4371 cadet_handlers); 4345 cadet_handlers);
4346 if (NULL == cadet_port)
4347 {
4348 LOG (GNUNET_ERROR_TYPE_ERROR,
4349 "Cadet port `%s' is already in use.\n",
4350 GNUNET_APPLICATION_PORT_RPS);
4351 GNUNET_assert (0);
4352 }
4372 4353
4373 4354
4374 peerinfo_handle = GNUNET_PEERINFO_connect (cfg); 4355 peerinfo_handle = GNUNET_PEERINFO_connect (cfg);
4375 Peers_initialise (fn_valid_peers, cadet_handle, &own_identity); 4356 Peers_initialise (fn_valid_peers, cadet_handle);
4376 GNUNET_free (fn_valid_peers); 4357 GNUNET_free (fn_valid_peers);
4377 4358
4378 /* Initialise sampler */ 4359 /* Initialise sampler */
diff --git a/src/rps/gnunet-service-rps_custommap.c b/src/rps/gnunet-service-rps_custommap.c
index 42507655b..9e003eb39 100644
--- a/src/rps/gnunet-service-rps_custommap.c
+++ b/src/rps/gnunet-service-rps_custommap.c
@@ -213,7 +213,7 @@ CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map,
213 GNUNET_assert (NULL != last_index); 213 GNUNET_assert (NULL != last_index);
214 GNUNET_assert (CustomPeerMap_size (c_peer_map) == *last_index); 214 GNUNET_assert (CustomPeerMap_size (c_peer_map) == *last_index);
215 GNUNET_CONTAINER_multihashmap32_put (c_peer_map->hash_map, *index, last_p, 215 GNUNET_CONTAINER_multihashmap32_put (c_peer_map->hash_map, *index, last_p,
216 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 216 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
217 GNUNET_CONTAINER_multihashmap32_remove_all (c_peer_map->hash_map, *last_index); 217 GNUNET_CONTAINER_multihashmap32_remove_all (c_peer_map->hash_map, *last_index);
218 *last_index = *index; 218 *last_index = *index;
219 } 219 }
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index d47e4952f..08fe96097 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -31,6 +31,17 @@
31 31
32#define LOG(kind, ...) GNUNET_log_from(kind,"rps-test_util",__VA_ARGS__) 32#define LOG(kind, ...) GNUNET_log_from(kind,"rps-test_util",__VA_ARGS__)
33 33
34#define B2B_PAT "%c%c%c%c%c%c%c%c"
35#define B2B(byte) \
36 (byte & 0x80 ? '1' : '0'), \
37 (byte & 0x40 ? '1' : '0'), \
38 (byte & 0x20 ? '1' : '0'), \
39 (byte & 0x10 ? '1' : '0'), \
40 (byte & 0x08 ? '1' : '0'), \
41 (byte & 0x04 ? '1' : '0'), \
42 (byte & 0x02 ? '1' : '0'), \
43 (byte & 0x01 ? '1' : '0')
44
34#ifndef TO_FILE 45#ifndef TO_FILE
35#define TO_FILE 46#define TO_FILE
36#endif /* TO_FILE */ 47#endif /* TO_FILE */
@@ -155,6 +166,9 @@ to_file_raw (const char *file_name, const char *buf, size_t size_buf)
155 166
156 return; 167 return;
157 } 168 }
169 LOG (GNUNET_ERROR_TYPE_WARNING,
170 "Wrote %u bytes raw.\n",
171 size_written);
158 if (GNUNET_YES != GNUNET_DISK_file_close (f)) 172 if (GNUNET_YES != GNUNET_DISK_file_close (f))
159 LOG (GNUNET_ERROR_TYPE_WARNING, 173 LOG (GNUNET_ERROR_TYPE_WARNING,
160 "Unable to close file\n"); 174 "Unable to close file\n");
@@ -180,6 +194,8 @@ to_file_raw_unaligned (const char *file_name,
180 // num_bits_buf_unaligned = bits_needed % 8; 194 // num_bits_buf_unaligned = bits_needed % 8;
181 // return; 195 // return;
182 //} 196 //}
197 LOG (GNUNET_ERROR_TYPE_DEBUG,
198 "Was asked to write %u bits\n", bits_needed);
183 199
184 char buf_write[size_buf + 1]; 200 char buf_write[size_buf + 1];
185 const unsigned bytes_iter = (0 != bits_needed % 8? 201 const unsigned bytes_iter = (0 != bits_needed % 8?
@@ -187,6 +203,14 @@ to_file_raw_unaligned (const char *file_name,
187 bits_needed/8); 203 bits_needed/8);
188 // TODO what if no iteration happens? 204 // TODO what if no iteration happens?
189 unsigned size_buf_write = 0; 205 unsigned size_buf_write = 0;
206 LOG (GNUNET_ERROR_TYPE_DEBUG,
207 "num_bits_buf_unaligned: %u\n",
208 num_bits_buf_unaligned);
209 LOG (GNUNET_ERROR_TYPE_DEBUG,
210 "ua args: size_buf: %u, bits_needed: %u -> iter: %u\n",
211 size_buf,
212 bits_needed,
213 bytes_iter);
190 buf_write[0] = buf_unaligned; 214 buf_write[0] = buf_unaligned;
191 /* Iterate over input bytes */ 215 /* Iterate over input bytes */
192 for (unsigned i = 0; i < bytes_iter; i++) 216 for (unsigned i = 0; i < bytes_iter; i++)
@@ -227,17 +251,57 @@ to_file_raw_unaligned (const char *file_name,
227 { 251 {
228 num_bits_needed_iter = 8; 252 num_bits_needed_iter = 8;
229 } 253 }
254 LOG (GNUNET_ERROR_TYPE_DEBUG,
255 "number of bits needed in this iteration: %u\n",
256 num_bits_needed_iter);
230 mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1; 257 mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1;
258 LOG (GNUNET_ERROR_TYPE_DEBUG,
259 "mask needed bits (current iter): "B2B_PAT"\n",
260 B2B(mask_bits_needed_iter));
261 LOG (GNUNET_ERROR_TYPE_DEBUG,
262 "Unaligned byte: "B2B_PAT" (%u bits)\n",
263 B2B(buf_unaligned),
264 num_bits_buf_unaligned);
231 byte_input = buf[i]; 265 byte_input = buf[i];
266 LOG (GNUNET_ERROR_TYPE_DEBUG,
267 "next whole input byte: "B2B_PAT"\n",
268 B2B(byte_input));
232 byte_input &= mask_bits_needed_iter; 269 byte_input &= mask_bits_needed_iter;
233 num_bits_to_align = 8 - num_bits_buf_unaligned; 270 num_bits_to_align = 8 - num_bits_buf_unaligned;
271 LOG (GNUNET_ERROR_TYPE_DEBUG,
272 "input byte, needed bits: "B2B_PAT"\n",
273 B2B(byte_input));
274 LOG (GNUNET_ERROR_TYPE_DEBUG,
275 "number of bits needed to align unaligned bit: %u\n",
276 num_bits_to_align);
234 num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter); 277 num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter);
278 LOG (GNUNET_ERROR_TYPE_DEBUG,
279 "number of bits of new byte to move: %u\n",
280 num_bits_to_move);
235 mask_input_to_move = ((char) 1 << num_bits_to_move) - 1; 281 mask_input_to_move = ((char) 1 << num_bits_to_move) - 1;
282 LOG (GNUNET_ERROR_TYPE_DEBUG,
283 "mask of bits of new byte to take for moving: "B2B_PAT"\n",
284 B2B(mask_input_to_move));
236 bits_to_move = byte_input & mask_input_to_move; 285 bits_to_move = byte_input & mask_input_to_move;
286 LOG (GNUNET_ERROR_TYPE_DEBUG,
287 "masked bits of new byte to take for moving: "B2B_PAT"\n",
288 B2B(bits_to_move));
237 distance_shift_bits = num_bits_buf_unaligned; 289 distance_shift_bits = num_bits_buf_unaligned;
290 LOG (GNUNET_ERROR_TYPE_DEBUG,
291 "distance needed to shift bits to their correct spot: %u\n",
292 distance_shift_bits);
238 bits_moving = bits_to_move << distance_shift_bits; 293 bits_moving = bits_to_move << distance_shift_bits;
294 LOG (GNUNET_ERROR_TYPE_DEBUG,
295 "shifted, masked bits of new byte being moved: "B2B_PAT"\n",
296 B2B(bits_moving));
239 byte_to_fill = buf_unaligned | bits_moving; 297 byte_to_fill = buf_unaligned | bits_moving;
240 if (num_bits_buf_unaligned + num_bits_needed_iter > 8) 298 LOG (GNUNET_ERROR_TYPE_DEBUG,
299 "byte being filled: "B2B_PAT"\n",
300 B2B(byte_to_fill));
301 LOG (GNUNET_ERROR_TYPE_DEBUG,
302 "pending bytes: %u\n",
303 num_bits_buf_unaligned + num_bits_needed_iter);
304 if (num_bits_buf_unaligned + num_bits_needed_iter >= 8)
241 { 305 {
242 /* buf_unaligned was aligned by filling 306 /* buf_unaligned was aligned by filling
243 * -> can be written to storage */ 307 * -> can be written to storage */
@@ -246,10 +310,22 @@ to_file_raw_unaligned (const char *file_name,
246 310
247 /* store the leftover, unaligned bits in buffer */ 311 /* store the leftover, unaligned bits in buffer */
248 mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move); 312 mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move);
313 LOG (GNUNET_ERROR_TYPE_DEBUG,
314 "mask of leftover bits of new byte: "B2B_PAT"\n",
315 B2B(mask_input_leftover));
249 byte_input_leftover = byte_input & mask_input_leftover; 316 byte_input_leftover = byte_input & mask_input_leftover;
317 LOG (GNUNET_ERROR_TYPE_DEBUG,
318 "masked, leftover bits of new byte: "B2B_PAT"\n",
319 B2B(byte_input_leftover));
250 num_bits_leftover = num_bits_needed_iter - num_bits_to_move; 320 num_bits_leftover = num_bits_needed_iter - num_bits_to_move;
251 num_bits_discard = 8 - num_bits_needed_iter; 321 LOG (GNUNET_ERROR_TYPE_DEBUG,
322 "number of unaligned bits left: %u\n",
323 num_bits_leftover);
324 //num_bits_discard = 8 - num_bits_needed_iter;
252 byte_unaligned_new = byte_input_leftover >> num_bits_to_move; 325 byte_unaligned_new = byte_input_leftover >> num_bits_to_move;
326 LOG (GNUNET_ERROR_TYPE_DEBUG,
327 "new unaligned byte: "B2B_PAT"\n",
328 B2B(byte_unaligned_new));
253 buf_unaligned = byte_unaligned_new; 329 buf_unaligned = byte_unaligned_new;
254 num_bits_buf_unaligned = num_bits_leftover % 8; 330 num_bits_buf_unaligned = num_bits_leftover % 8;
255 } 331 }
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 0ef3c864a..cd93ff855 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -65,6 +65,8 @@ report ()
65 unsigned long long datarate; 65 unsigned long long datarate;
66 66
67 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us; 67 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
68 if (0 == delta)
69 delta = 1;
68 datarate = (total_bytes_recv * 1000 * 1000) / delta; 70 datarate = (total_bytes_recv * 1000 * 1000) / delta;
69 71
70 FPRINTF (stderr, 72 FPRINTF (stderr,
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 86e2a7e9d..c6e77bae0 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -174,6 +174,8 @@ custom_shutdown (void *cls)
174 174
175 /* Calculcate statistics */ 175 /* Calculcate statistics */
176 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us; 176 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
177 if (0 == delta)
178 delta = 1;
177 rate = (1000LL* 1000ll * total_bytes) / (1024 * delta); 179 rate = (1000LL* 1000ll * total_bytes) / (1024 * delta);
178 FPRINTF (stderr, 180 FPRINTF (stderr,
179 "\nThroughput was %llu KiBytes/s\n", 181 "\nThroughput was %llu KiBytes/s\n",
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 8410b7835..fe1f58df7 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -365,14 +365,17 @@ GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
365 365
366/** 366/**
367 * Calculate HMAC of a message (RFC 2104) 367 * Calculate HMAC of a message (RFC 2104)
368 * TODO: Shouldn' this be the standard hmac function and
369 * the above be renamed?
368 * 370 *
369 * @param key secret key 371 * @param key secret key
372 * @param key_len secret key length
370 * @param plaintext input plaintext 373 * @param plaintext input plaintext
371 * @param plaintext_len length of @a plaintext 374 * @param plaintext_len length of @a plaintext
372 * @param hmac where to store the hmac 375 * @param hmac where to store the hmac
373 */ 376 */
374void 377void
375GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, 378GNUNET_CRYPTO_hmac_raw (const void *key, size_t key_len,
376 const void *plaintext, size_t plaintext_len, 379 const void *plaintext, size_t plaintext_len,
377 struct GNUNET_HashCode *hmac) 380 struct GNUNET_HashCode *hmac)
378{ 381{
@@ -390,7 +393,7 @@ GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
390 { 393 {
391 gcry_md_reset (md); 394 gcry_md_reset (md);
392 } 395 }
393 gcry_md_setkey (md, key->key, sizeof (key->key)); 396 gcry_md_setkey (md, key, key_len);
394 gcry_md_write (md, plaintext, plaintext_len); 397 gcry_md_write (md, plaintext, plaintext_len);
395 mc = gcry_md_read (md, GCRY_MD_SHA512); 398 mc = gcry_md_read (md, GCRY_MD_SHA512);
396 GNUNET_assert (NULL != mc); 399 GNUNET_assert (NULL != mc);
@@ -399,6 +402,25 @@ GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
399 402
400 403
401/** 404/**
405 * Calculate HMAC of a message (RFC 2104)
406 *
407 * @param key secret key
408 * @param plaintext input plaintext
409 * @param plaintext_len length of @a plaintext
410 * @param hmac where to store the hmac
411 */
412void
413GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
414 const void *plaintext, size_t plaintext_len,
415 struct GNUNET_HashCode *hmac)
416{
417 GNUNET_CRYPTO_hmac_raw ((void*) key->key, sizeof (key->key),
418 plaintext, plaintext_len,
419 hmac);
420}
421
422
423/**
402 * Context for cummulative hashing. 424 * Context for cummulative hashing.
403 */ 425 */
404struct GNUNET_HashContext 426struct GNUNET_HashContext
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c
index 6fb6d657f..24f1b18cf 100644
--- a/src/util/dnsparser.c
+++ b/src/util/dnsparser.c
@@ -959,7 +959,7 @@ GNUNET_DNSPARSER_builder_add_name (char *dst,
959 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 959 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
960 "Invalid DNS name `%s': label with %u characters encountered\n", 960 "Invalid DNS name `%s': label with %u characters encountered\n",
961 name, 961 name,
962 len); 962 (unsigned int) len);
963 goto fail; /* label too long or empty */ 963 goto fail; /* label too long or empty */
964 } 964 }
965 dst[pos++] = (char) (uint8_t) len; 965 dst[pos++] = (char) (uint8_t) len;
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 93d133d1b..5d3836639 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -965,8 +965,6 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task)
965 965
966 /* scheduler must be running */ 966 /* scheduler must be running */
967 GNUNET_assert (NULL != scheduler_driver); 967 GNUNET_assert (NULL != scheduler_driver);
968 GNUNET_assert ( (NULL != active_task) ||
969 (GNUNET_NO == task->lifeness) );
970 is_fd_task = (NULL != task->fds); 968 is_fd_task = (NULL != task->fds);
971 if (is_fd_task) 969 if (is_fd_task)
972 { 970 {
@@ -1056,9 +1054,9 @@ GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback tas
1056{ 1054{
1057 struct GNUNET_SCHEDULER_Task *t; 1055 struct GNUNET_SCHEDULER_Task *t;
1058 1056
1057 /* scheduler must be running */
1058 GNUNET_assert (NULL != scheduler_driver);
1059 GNUNET_assert (NULL != task); 1059 GNUNET_assert (NULL != task);
1060 GNUNET_assert ((NULL != active_task) ||
1061 (GNUNET_SCHEDULER_REASON_STARTUP == reason));
1062 t = GNUNET_new (struct GNUNET_SCHEDULER_Task); 1060 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1063 t->read_fd = -1; 1061 t->read_fd = -1;
1064 t->write_fd = -1; 1062 t->write_fd = -1;
@@ -1099,7 +1097,8 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at,
1099 struct GNUNET_SCHEDULER_Task *pos; 1097 struct GNUNET_SCHEDULER_Task *pos;
1100 struct GNUNET_SCHEDULER_Task *prev; 1098 struct GNUNET_SCHEDULER_Task *prev;
1101 1099
1102 GNUNET_assert (NULL != active_task); 1100 /* scheduler must be running */
1101 GNUNET_assert (NULL != scheduler_driver);
1103 GNUNET_assert (NULL != task); 1102 GNUNET_assert (NULL != task);
1104 t = GNUNET_new (struct GNUNET_SCHEDULER_Task); 1103 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1105 t->callback = task; 1104 t->callback = task;
@@ -1286,7 +1285,8 @@ GNUNET_SCHEDULER_add_shutdown (GNUNET_SCHEDULER_TaskCallback task,
1286{ 1285{
1287 struct GNUNET_SCHEDULER_Task *t; 1286 struct GNUNET_SCHEDULER_Task *t;
1288 1287
1289 GNUNET_assert (NULL != active_task); 1288 /* scheduler must be running */
1289 GNUNET_assert (NULL != scheduler_driver);
1290 GNUNET_assert (NULL != task); 1290 GNUNET_assert (NULL != task);
1291 t = GNUNET_new (struct GNUNET_SCHEDULER_Task); 1291 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1292 t->callback = task; 1292 t->callback = task;
@@ -1403,7 +1403,8 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1403{ 1403{
1404 struct GNUNET_SCHEDULER_Task *t; 1404 struct GNUNET_SCHEDULER_Task *t;
1405 1405
1406 GNUNET_assert (NULL != active_task); 1406 /* scheduler must be running */
1407 GNUNET_assert (NULL != scheduler_driver);
1407 GNUNET_assert (NULL != task); 1408 GNUNET_assert (NULL != task);
1408 t = GNUNET_new (struct GNUNET_SCHEDULER_Task); 1409 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1409 init_fd_info (t, 1410 init_fd_info (t,
@@ -1832,7 +1833,6 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1832 1833
1833 /* scheduler must be running */ 1834 /* scheduler must be running */
1834 GNUNET_assert (NULL != scheduler_driver); 1835 GNUNET_assert (NULL != scheduler_driver);
1835 GNUNET_assert (NULL != active_task);
1836 GNUNET_assert (NULL != task); 1836 GNUNET_assert (NULL != task);
1837 int no_rs = (NULL == rs); 1837 int no_rs = (NULL == rs);
1838 int no_ws = (NULL == ws); 1838 int no_ws = (NULL == ws);
@@ -2022,99 +2022,109 @@ GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh)
2022 if (timeout.abs_value_us > now.abs_value_us) 2022 if (timeout.abs_value_us > now.abs_value_us)
2023 { 2023 {
2024 /** 2024 /**
2025 * The driver called this function before the current timeout was 2025 * The event loop called this function before the current timeout was
2026 * reached (and no FD tasks are ready). This can happen in the 2026 * reached (and no FD tasks are ready). This is acceptable if
2027 * rare case when the system time is changed while the driver is 2027 *
2028 * waiting for the timeout, so we handle this gracefully. It might 2028 * - the system time was changed while the driver was waiting for
2029 * also be a programming error in the driver though. 2029 * the timeout
2030 * - an external event loop called GNUnet API functions outside of
2031 * the callbacks called in GNUNET_SCHEDULER_do_work and thus
2032 * wasn't notified about the new timeout
2033 *
2034 * It might also mean we are busy-waiting because of a programming
2035 * error in the external event loop.
2030 */ 2036 */
2031 LOG (GNUNET_ERROR_TYPE_DEBUG, 2037 LOG (GNUNET_ERROR_TYPE_DEBUG,
2032 "GNUNET_SCHEDULER_do_work did not find any ready " 2038 "GNUNET_SCHEDULER_do_work did not find any ready "
2033 "tasks and timeout has not been reached yet.\n"); 2039 "tasks and timeout has not been reached yet.\n");
2034 return GNUNET_NO;
2035 } 2040 }
2036 /** 2041 else
2037 * the current timeout was reached but no ready tasks were found, 2042 {
2038 * internal scheduler error! 2043 /**
2039 */ 2044 * the current timeout was reached but no ready tasks were found,
2040 GNUNET_assert (0); 2045 * internal scheduler error!
2041 } 2046 */
2042 2047 GNUNET_assert (0);
2043 /* find out which task priority level we are going to 2048 }
2044 process this time */
2045 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP;
2046 GNUNET_assert (NULL == ready_head[GNUNET_SCHEDULER_PRIORITY_KEEP]);
2047 /* yes, p>0 is correct, 0 is "KEEP" which should
2048 * always be an empty queue (see assertion)! */
2049 for (p = GNUNET_SCHEDULER_PRIORITY_COUNT - 1; p > 0; p--)
2050 {
2051 pos = ready_head[p];
2052 if (NULL != pos)
2053 break;
2054 } 2049 }
2055 GNUNET_assert (NULL != pos); /* ready_count wrong? */ 2050 else
2056
2057 /* process all tasks at this priority level, then yield */
2058 while (NULL != (pos = ready_head[p]))
2059 { 2051 {
2060 GNUNET_CONTAINER_DLL_remove (ready_head[p], 2052 /* find out which task priority level we are going to
2061 ready_tail[p], 2053 process this time */
2062 pos); 2054 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP;
2063 ready_count--; 2055 GNUNET_assert (NULL == ready_head[GNUNET_SCHEDULER_PRIORITY_KEEP]);
2064 current_priority = pos->priority; 2056 /* yes, p>0 is correct, 0 is "KEEP" which should
2065 current_lifeness = pos->lifeness; 2057 * always be an empty queue (see assertion)! */
2066 active_task = pos; 2058 for (p = GNUNET_SCHEDULER_PRIORITY_COUNT - 1; p > 0; p--)
2067#if PROFILE_DELAYS
2068 if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value_us >
2069 DELAY_THRESHOLD.rel_value_us)
2070 { 2059 {
2071 LOG (GNUNET_ERROR_TYPE_DEBUG, 2060 pos = ready_head[p];
2072 "Task %p took %s to be scheduled\n", 2061 if (NULL != pos)
2073 pos, 2062 break;
2074 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time),
2075 GNUNET_YES));
2076 } 2063 }
2077#endif 2064 GNUNET_assert (NULL != pos); /* ready_count wrong? */
2078 tc.reason = pos->reason; 2065
2079 GNUNET_NETWORK_fdset_zero (sh->rs); 2066 /* process all tasks at this priority level, then yield */
2080 GNUNET_NETWORK_fdset_zero (sh->ws); 2067 while (NULL != (pos = ready_head[p]))
2081 // FIXME: do we have to remove FdInfos from fds if they are not ready?
2082 tc.fds_len = pos->fds_len;
2083 tc.fds = pos->fds;
2084 for (unsigned int i = 0; i != pos->fds_len; ++i)
2085 { 2068 {
2086 struct GNUNET_SCHEDULER_FdInfo *fdi = &pos->fds[i]; 2069 GNUNET_CONTAINER_DLL_remove (ready_head[p],
2087 if (0 != (GNUNET_SCHEDULER_ET_IN & fdi->et)) 2070 ready_tail[p],
2071 pos);
2072 ready_count--;
2073 current_priority = pos->priority;
2074 current_lifeness = pos->lifeness;
2075 active_task = pos;
2076#if PROFILE_DELAYS
2077 if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value_us >
2078 DELAY_THRESHOLD.rel_value_us)
2088 { 2079 {
2089 GNUNET_NETWORK_fdset_set_native (sh->rs, 2080 LOG (GNUNET_ERROR_TYPE_DEBUG,
2090 fdi->sock); 2081 "Task %p took %s to be scheduled\n",
2082 pos,
2083 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time),
2084 GNUNET_YES));
2091 } 2085 }
2092 if (0 != (GNUNET_SCHEDULER_ET_OUT & fdi->et)) 2086#endif
2087 tc.reason = pos->reason;
2088 GNUNET_NETWORK_fdset_zero (sh->rs);
2089 GNUNET_NETWORK_fdset_zero (sh->ws);
2090 // FIXME: do we have to remove FdInfos from fds if they are not ready?
2091 tc.fds_len = pos->fds_len;
2092 tc.fds = pos->fds;
2093 for (unsigned int i = 0; i != pos->fds_len; ++i)
2093 { 2094 {
2094 GNUNET_NETWORK_fdset_set_native (sh->ws, 2095 struct GNUNET_SCHEDULER_FdInfo *fdi = &pos->fds[i];
2095 fdi->sock); 2096 if (0 != (GNUNET_SCHEDULER_ET_IN & fdi->et))
2097 {
2098 GNUNET_NETWORK_fdset_set_native (sh->rs,
2099 fdi->sock);
2100 }
2101 if (0 != (GNUNET_SCHEDULER_ET_OUT & fdi->et))
2102 {
2103 GNUNET_NETWORK_fdset_set_native (sh->ws,
2104 fdi->sock);
2105 }
2096 } 2106 }
2097 } 2107 tc.read_ready = sh->rs;
2098 tc.read_ready = sh->rs; 2108 tc.write_ready = sh->ws;
2099 tc.write_ready = sh->ws; 2109 LOG (GNUNET_ERROR_TYPE_DEBUG,
2100 LOG (GNUNET_ERROR_TYPE_DEBUG, 2110 "Running task %p\n",
2101 "Running task %p\n", 2111 pos);
2102 pos); 2112 GNUNET_assert (NULL != pos->callback);
2103 GNUNET_assert (NULL != pos->callback); 2113 pos->callback (pos->callback_cls);
2104 pos->callback (pos->callback_cls); 2114 if (NULL != pos->fds)
2105 if (NULL != pos->fds)
2106 {
2107 int del_result = scheduler_driver->del (scheduler_driver->cls, pos);
2108 if (GNUNET_OK != del_result)
2109 { 2115 {
2110 LOG (GNUNET_ERROR_TYPE_ERROR, 2116 int del_result = scheduler_driver->del (scheduler_driver->cls, pos);
2111 "driver could not delete task %p\n", pos); 2117 if (GNUNET_OK != del_result)
2112 GNUNET_assert (0); 2118 {
2119 LOG (GNUNET_ERROR_TYPE_ERROR,
2120 "driver could not delete task %p\n", pos);
2121 GNUNET_assert (0);
2122 }
2113 } 2123 }
2124 active_task = NULL;
2125 dump_backtrace (pos);
2126 destroy_task (pos);
2114 } 2127 }
2115 active_task = NULL;
2116 dump_backtrace (pos);
2117 destroy_task (pos);
2118 } 2128 }
2119 shutdown_if_no_lifeness (); 2129 shutdown_if_no_lifeness ();
2120 if (0 == ready_count) 2130 if (0 == ready_count)
@@ -2164,12 +2174,12 @@ struct GNUNET_SCHEDULER_Handle *
2164GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver) 2174GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver)
2165{ 2175{
2166 struct GNUNET_SCHEDULER_Handle *sh; 2176 struct GNUNET_SCHEDULER_Handle *sh;
2167 struct GNUNET_SCHEDULER_Task tsk;
2168 const struct GNUNET_DISK_FileHandle *pr; 2177 const struct GNUNET_DISK_FileHandle *pr;
2169 2178
2170 /* general set-up */ 2179 /* scheduler must not be running */
2171 GNUNET_assert (NULL == active_task); 2180 GNUNET_assert (NULL == scheduler_driver);
2172 GNUNET_assert (NULL == shutdown_pipe_handle); 2181 GNUNET_assert (NULL == shutdown_pipe_handle);
2182 /* general set-up */
2173 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle); 2183 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle);
2174 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, 2184 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO,
2175 GNUNET_NO, 2185 GNUNET_NO,
@@ -2204,10 +2214,6 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver)
2204 /* Setup initial tasks */ 2214 /* Setup initial tasks */
2205 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; 2215 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
2206 current_lifeness = GNUNET_NO; 2216 current_lifeness = GNUNET_NO;
2207 memset (&tsk,
2208 0,
2209 sizeof (tsk));
2210 active_task = &tsk;
2211 install_parent_control_task = 2217 install_parent_control_task =
2212 GNUNET_SCHEDULER_add_now (&install_parent_control_handler, 2218 GNUNET_SCHEDULER_add_now (&install_parent_control_handler,
2213 NULL); 2219 NULL);
@@ -2217,7 +2223,6 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver)
2217 &shutdown_pipe_cb, 2223 &shutdown_pipe_cb,
2218 NULL); 2224 NULL);
2219 current_lifeness = GNUNET_YES; 2225 current_lifeness = GNUNET_YES;
2220 active_task = NULL;
2221 scheduler_driver->set_wakeup (scheduler_driver->cls, 2226 scheduler_driver->set_wakeup (scheduler_driver->cls,
2222 get_timeout ()); 2227 get_timeout ());
2223 /* begin main event loop */ 2228 /* begin main event loop */