From f630c5a675ca37467b5fba9a3dd41044381ac6ce Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 23 Apr 2021 23:58:12 +0200 Subject: -fix typos --- ChangeLog | 10 +++++----- README | 18 +++++++++--------- bootstrap | 2 +- doc/index.html | 2 +- doc/release_policy.rfc.txt | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 631c35f46..b8f45a824 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ Sat, 3 Apr 2021 09:40:46 +0200 (08fe7735b) handbook: Add section on commit messages and developer branches - Martin Schanzenbach Thu, 1 Apr 2021 00:41:38 +0200 (9f340d5cc) -SETU: added some more perf messurement point for var message size - Elias Summermatter +SETU: added some more perf measurement point for var message size - Elias Summermatter Thu, 1 Apr 2021 00:15:43 +0200 (12bb61317) SETU: fixed some bug in rand element gen and added variable payload for perfmance - Elias Summermatter @@ -11,7 +11,7 @@ Wed, 31 Mar 2021 11:49:10 +0200 (902331756) SETU: Added new operation parameters for performance tests - Elias Summermatter Wed, 31 Mar 2021 11:16:38 +0200 (b5660e0a3) -SETU: imporved tests - Elias Summermatter +SETU: improved tests - Elias Summermatter Tue, 30 Mar 2021 19:26:40 +0200 (ca4c9eae2) UTIL/SCALARPRODUCT: Do not build ECC dlog or scalarproduct with incompatible libgcrypt versions (>=1.9.0) - Martin Schanzenbach @@ -32,7 +32,7 @@ Thu, 18 Mar 2021 11:48:42 +0100 (f9ae0c23c) Added working test with randum set - Elias Summermatter Thu, 18 Mar 2021 08:45:31 +0100 (0d6237ae0) -Added some randum elemet generation test for setu - Elias Summermatter +Added some randum element generation test for setu - Elias Summermatter Sun, 14 Mar 2021 14:04:00 +0100 (b47586e76) add packaging notice; fix #5633 - Martin Schanzenbach @@ -722,7 +722,7 @@ Thu, 30 Jan 2020 10:48:04 +0100 (015cd279b) added testing scripts for dns2gns - rexxnor Fri, 24 Jan 2020 16:51:29 +0100 (f4a172abf) -export GNUNET_PQ_run_sql() functonality - Christian Grothoff +export GNUNET_PQ_run_sql() functionality - Christian Grothoff Fri, 24 Jan 2020 16:30:45 +0100 (2fd320bc7) modify GNUNET_PQ_connect_with_cfg to enable flexible loading of .sql files - Christian Grothoff @@ -902,7 +902,7 @@ Fri Jun 28 14:10:53 2019 +0200 Thu Jun 27 10:34:46 2019 +0200 The REST server now returns the Origin header value in the - CORS header reponse. -schanzen + CORS header response. -schanzen Thu Jun 27 09:08:06 2019 +0200 GNS NSS plugin will not timeout and not hang forever and block diff --git a/README b/README index 0665a8339..665cb3818 100644 --- a/README +++ b/README @@ -182,7 +182,7 @@ Recommended software for developer tools: you, open a bug so that we can get a more portable fix in. -[*4] We are commited to portable tools and solutions +[*4] We are committed to portable tools and solutions where possible. New scripts should be Posix sh compatible, current and older scripts are in the process of being rewritten to comply @@ -213,7 +213,7 @@ For a correct functionality depending on the host OS, you need to run the equivalent of these steps after installation. Replace $(DESTDIR)$(libexecdir) with the appropriate paths, for example /usr/local/lib/gnunet/libexec/. Note that this -obviously must be run as priviledged user. +obviously must be run as privileged user. chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-vpn chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-vpn @@ -289,8 +289,8 @@ Building GNUnet from source IMPORTANT: You can read further notes about compilation from source in the handbook under doc/handbook/, which includes notes about specific -requirements for operating systems aswell. If you are a package -mantainer for an Operating System we invite you to add your notes if +requirements for operating systems as well. If you are a package +maintainer for an Operating System we invite you to add your notes if you feel it is necessary and can not be covered in your Operating System's documentation. @@ -338,7 +338,7 @@ in 'contrib/services' or by running: Note that you must read paragraph "Notes on setuid", which documents steps you -have to follow after the installation, as a priviledged user. We require some +have to follow after the installation, as a privileged user. We require some binaries to be setuid. The most portable approach across all supported platforms and targets is to let this be handled manually. The installation will work if you do not run these steps as root, but some @@ -376,7 +376,7 @@ $GNUNET_PREFIX you might have specified, as those libraries must be in your packaging script to miss those plugins, so you might need to do some additional manual work to include those libraries in your binary package(s). Similarly, if you want to use the GNUnet Name System and did NOT run -GNUnet's 'make install' process with priviledged rights, the libraries will be +GNUnet's 'make install' process with privileged rights, the libraries will be installed to "$GNUNET_PREFIX" and you will have to move them to "/lib/" manually. @@ -443,7 +443,7 @@ GNUnet by periodically executing $ cat $SERVICEHOME/data/hosts/* > the_file and offering 'the_file' via your web server. Alternatively, you can -run the build-in web server by adding '-p' to the OPTIONS value +run the built-in web server by adding '-p' to the OPTIONS value in the "hostlist" section of gnunet.conf and opening the respective HTTPPORT to the public. @@ -495,7 +495,7 @@ https://bugs.gnunet.org/ or our bugs mailinglist. Please make sure to run the script "contrib/scripts/gnunet-bugreport" and include the output with your bug reports. More about how to report bugs can be found in the GNUnet FAQ on the webpage. Submit -patches via E-Mail to gnunet-developers@gnu.org, formated with +patches via E-Mail to gnunet-developers@gnu.org, formatted with `git format-patch`. In order to run the unit tests by hand (instead of using "make check"), @@ -540,7 +540,7 @@ Then set in the HTTP section of gnunet.conf the "ADVERTISED_PORT" to "ADVERTISED_PORT" to "443" and "PORT" to 4433. You can do the same trick for the TCP and UDP transports if you want -to map them to a priviledged port (from the point of view of the +to map them to a privileged port (from the point of view of the network). However, we are not aware of this providing any advantages at this point. diff --git a/bootstrap b/bootstrap index 8fc4c4426..984c56cb3 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #!/bin/sh # # We should use /usr/bin/env sh, but some systems are notoriously picky. -# In fact we could ommit this line if some automations wouldn't rely on +# In fact we could omit this line if some automations wouldn't rely on # running this file via ./bootstrap. # # This file is in the public domain. diff --git a/doc/index.html b/doc/index.html index 93c0e7d9e..bf8683780 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ GNUnet - GNUnet Manuals and Handbooks - + diff --git a/doc/release_policy.rfc.txt b/doc/release_policy.rfc.txt index 8fd89f73c..41c98ec93 100644 --- a/doc/release_policy.rfc.txt +++ b/doc/release_policy.rfc.txt @@ -42,7 +42,7 @@ document the current release model: mostly we rather explicitly declare certain bugs as "not critical") - Whenever API changes happen the person making that changes should update dependencies or at least work with people who hack on the dependencies to - cooridnate the adjustments + coordinate the adjustments o buildbots are happy (if running) o static analysis is happy (if available, false-positives => ignore) o documentation is reasonably up-to-date @@ -57,7 +57,7 @@ For further information see: https://trunkbaseddevelopment.com/ II. Evaluation Criteria ======================= -(what are criterias to interprete the results as success if we review +(what are criteria to interpret the results as success if we review the problem and solution after a year or so) III. Concerns (of team members) @@ -74,7 +74,7 @@ code. I don't have a magic bullet to motivate you to write more tests, or to improve existing tests. -CG Your argument is good. Two or three of us thought that the problem is about - missing releases which we feld demotivating. We thought, we were stucked + missing releases which we feld demotivating. We thought, we were stuck somewhere. But as you state, it is us not doing the necessary work. What I still find useful is to document the release process. In consequence I changed the problem statement. -xrs @@ -125,7 +125,7 @@ leaves of the dependency graph, that is great. However, occasionally there are architectural changes. Not of the type where the graph changes, but where key API assumptions change. We recently had one for the GNU Name System with the dropping of ".gnu". Before, CADET -changed the semantics and paramter for 'port'. In the future, CORE +changed the semantics and parameter for 'port'. In the future, CORE will introduce protocol versioning. Whenever such a change happens, it usually falls upon the person making that change to update dependencies as well (or at least to work with people who hack on the @@ -175,7 +175,7 @@ Note that none of this really adds up to a "release policy". V. Previous Versions ==================== (if we found some flaws in the solution, and we want to change the -release policy, we document the old ones here als previous versions. +release policy, we document the old ones here as previous versions. the goal is establish a learn process.) IV. References -- cgit v1.2.3 From 8d48dbafe69193f8a23765154be1f7db851bfa1c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 24 Apr 2021 00:02:25 +0200 Subject: -fix typos --- debian/changelog | 36 ++++++++++++++++----------------- debian/gnunet.README.Debian | 2 +- debian/gnunet.lintian-overrides | 2 +- doc/handbook/chapters/developer.texi | 30 +++++++++++++-------------- doc/handbook/chapters/installation.texi | 8 ++++---- doc/handbook/chapters/keyconcepts.texi | 2 +- doc/handbook/chapters/philosophy.texi | 2 +- doc/handbook/chapters/preface.texi | 4 ++-- doc/handbook/chapters/user.texi | 8 ++++---- doc/tutorial/tutorial.texi | 12 +++++------ 10 files changed, 53 insertions(+), 53 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0572e47fa..aafdc69df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -389,7 +389,7 @@ gnunet (0.9.3-4) unstable; urgency=low * Revert the use dh_installdocs --link-doc (Closes: #687875, #687881, #687883). * Fix build on kfreebsd, thanks to Christoph Egger (Closes: #688486). - * Allways install libnss to /lib and fix FTBFS on ia64 (Closes: #688590). + * Always install libnss to /lib and fix FTBFS on ia64 (Closes: #688590). * Install libnss to /lib, really fix #688590, thanks to Christian Grothoff. * Change default option UNIX_MATCH_UID for services datastore and namestore, so users in the gnunet group may use these services (Closes: #686238, @@ -546,7 +546,7 @@ gnunet (0.8.1b-5) unstable; urgency=low gnunet (0.8.1b-4) unstable; urgency=low - * Stopp calling debconf-updatepo in clean target of rules. + * Stop calling debconf-updatepo in clean target of rules. * Dropping la files. -- Daniel Baumann Mon, 03 May 2010 21:06:32 +0200 @@ -659,7 +659,7 @@ gnunet (0.8.0c-4) unstable; urgency=low gnunet (0.8.0c-3) unstable; urgency=low - * Removing unneded versions for build-depends. + * Removing unneeded versions for build-depends. * Wrapping build depends. * Sorting depends. * Updating year in copyright file. @@ -694,7 +694,7 @@ gnunet (0.8.0c-1) unstable; urgency=low * Removing old conflicts and replaces. * Making gnunet binNMU safe (Closes: #527453, #527462). * Using correct rfc-2822 date formats in changelog. - * Using more generic directoy name for local additions within the + * Using more generic directory name for local additions within the packaging directory. * Updating debhelper install files for new upstream. * Adding misc:Depends in control to remaining binary packages. @@ -773,7 +773,7 @@ gnunet (0.8.0-1) unstable; urgency=low * Reordering rules file. * Also excluding gnunet meta package from ia64 since there is no gnunet on ia64 anyway. - * Using lintian debhelper to intall lintian overrides. + * Using lintian debhelper to install lintian overrides. * Removing watch file. * Rewriting copyright file in machine-interpretable format. * Bumping versioned libextractor depends to 0.5.20. @@ -870,7 +870,7 @@ gnunet (0.7.2c-3) unstable; urgency=medium - Updated to new policy. - Using Homepage field in control. - Using versioned depends for libextractor. - - Comented lintian overrides. + - Commented lintian overrides. -- Daniel Baumann Thu, 06 Dec 2007 22:36:00 +0100 @@ -971,7 +971,7 @@ gnunet (0.7.1c-2) unstable; urgency=low gnunet (0.7.1c-1) unstable; urgency=low * New upstream release (Closes: #420538). - * Package splitted into common, tools, daemon, client and dev (Closes: #394740). + * Package split into common, tools, daemon, client and dev (Closes: #394740). * Added LSB section in init script. * Enable IPv6 (Closes: #405763). @@ -1009,7 +1009,7 @@ gnunet (0.7.0e-2) unstable; urgency=low gnunet (0.7.0e-1) unstable; urgency=high - * New uptream release. + * New upstream release. * Set urgency to high since this release fix the remote DOS CVE-2006-2413 (Closes: #368159) -- Arnaud Kyheng Sun, 21 May 2006 11:24:28 +0200 @@ -1062,7 +1062,7 @@ gnunet (0.7.0-1) unstable; urgency=low gnunet (0.6.6b-5) unstable; urgency=low * debian/control: Bumped policy version to 3.6.2. - * debian/control: Updated depedencies to follow C++ ABI changes (Closes: #325844). + * debian/control: Updated dependencies to follow C++ ABI changes (Closes: #325844). * debian/po/vi.po: Added new Vietnamese translation of gnunet debconf messages. Thanks to Clytie Siddall (Closes: #314190). -- Arnaud Kyheng Sun, 21 Aug 2005 10:54:54 +0200 @@ -1163,7 +1163,7 @@ gnunet (0.6.5-3) unstable; urgency=low gnunet (0.6.5-2) unstable; urgency=low - * Applied Martin Quinson l10n patch wich switch to gettext-based debconf and + * Applied Martin Quinson l10n patch which switch to gettext-based debconf and does the following modifications (Closes: #283632): - debian/control: modification for dependencies: build-dep: debhelper (>= 4.1.16) which depends on po-debconf. @@ -1276,7 +1276,7 @@ gnunet (0.6.4a-4) unstable; urgency=low gnunet (0.6.4a-3) unstable; urgency=high - * Bumb revision number for the package to be rebuild against fixed + * Bump revision number for the package to be rebuild against fixed libgcrypt11 (>=1.2.0-10) (Closes: #275793) * debian/control: Added version requirement for libgcrypt11-dev (>=1.2.0-10). @@ -1298,7 +1298,7 @@ gnunet (0.6.4a-1) unstable; urgency=medium * contrib/gnunet.desktop: Added menu file for GNOME and KDE. * contrib/gnunet.root: Fixed to follow debian policy. * Removed beta binaries gnunet-dht* and gnunet-setup from package since - they are not yet fonctional. + they are not yet functional. -- Arnaud Kyheng Wed, 29 Sep 2004 08:09:38 +0200 @@ -1310,7 +1310,7 @@ gnunet (0.6.4-3) unstable; urgency=low gnunet (0.6.4-2) unstable; urgency=low - * Bumb revision number so ftp-master will accept it. + * Bump revision number so ftp-master will accept it. -- Glenn McGrath Fri, 10 Sep 2004 12:13:54 +1000 @@ -1386,7 +1386,7 @@ gnunet (0.6.1d-1) unstable; urgency=low gnunet (0.6.1b-1) unstable; urgency=low * New upstream release - * Run "gnunet-check -ra" in postinst for compatability + * Run "gnunet-check -ra" in postinst for compatibility -- Glenn McGrath Sat, 31 Jan 2004 21:39:33 +1100 @@ -1452,7 +1452,7 @@ gnunet (0.5.4a-5) unstable; urgency=low gnunet (0.5.4a-4) unstable; urgency=low - * Declare build depenency on libtool as well, grrrr + * Declare build dependency on libtool as well, grrrr -- Glenn McGrath Mon, 21 Jul 2003 15:02:20 +0000 @@ -1477,15 +1477,15 @@ gnunet (0.5.4a-1) unstable; urgency=low * New upstream release. * Remove build dependency on libgcrypt, gnunet now uses an internal crypto library based on the CVS branch of libgcrypt. - * Change build dependcy from libgdbmg1-dev to libgdbm-dev - * After 1 year and 39 days in preparation, its now eligable to be + * Change build dependency from libgdbmg1-dev to libgdbm-dev + * After 1 year and 39 days in preparation, its now eligible to be uploaded to unstable (Closes: #147380) -- Glenn McGrath Fri, 27 Jun 2003 16:47:54 +0000 gnunet (0.5.4-1) unstable; urgency=low - * New upsteam release + * New upstream release * Declare shared libraries within gnunet, dependency now detected in gnunet-gtk diff --git a/debian/gnunet.README.Debian b/debian/gnunet.README.Debian index 1bc37bab4..13021e099 100644 --- a/debian/gnunet.README.Debian +++ b/debian/gnunet.README.Debian @@ -2,7 +2,7 @@ gnunet ------ By default, the gnunet server starts automatically when the system is booted. -If you prefere to start it manually when you use it, change its configuration +If you prefer to start it manually when you use it, change its configuration with: # dpkg-reconfigure -plow gnunet-systempeer diff --git a/debian/gnunet.lintian-overrides b/debian/gnunet.lintian-overrides index b38bfe954..79a306d71 100644 --- a/debian/gnunet.lintian-overrides +++ b/debian/gnunet.lintian-overrides @@ -1,3 +1,3 @@ -# internal libraries are not splitted out into a dedicated package to avoid +# internal libraries are not split out into a dedicated package to avoid # micropackaging. gnunet: package-name-doesnt-match-sonames diff --git a/doc/handbook/chapters/developer.texi b/doc/handbook/chapters/developer.texi index 9bb74c3de..e7b88a39f 100644 --- a/doc/handbook/chapters/developer.texi +++ b/doc/handbook/chapters/developer.texi @@ -2305,7 +2305,7 @@ for new developers): @itemize @bullet @item logging (common_logging.c) @item memory allocation (common_allocation.c) -@item endianess conversion (common_endian.c) +@item endianness conversion (common_endian.c) @item internationalization (common_gettext.c) @item String manipulation (string.c) @item file access (disk.c) @@ -4287,7 +4287,7 @@ which will warn you if you don't have the necessary libraries. @c work!@ Finally you just have to be sure that you have the correct drivers @c for your Bluetooth device installed and that your device is on and in a @c discoverable mode. The Windows Bluetooth Stack supports only the RFCOMM -@c protocol so we cannot turn on your device programatically! +@c protocol so we cannot turn on your device programmatically! @c FIXME: Change to unique title @node How does it work2? @@ -4638,7 +4638,7 @@ simply use the socket. @c implementation follows the same principles as the GNU/Linux one: @c @itemize @bullet -@c @item It has a initalization part where it initializes the +@c @item It has a initialization part where it initializes the @c Windows Sockets, creates a RFCOMM socket which will be binded and switched @c to the listening mode and registers a SDP service. In the Microsoft @c Bluetooth API there are two ways to work with the SDP: @@ -5023,7 +5023,7 @@ key of the other peer ephemeral key of the other peer, but we are waiting for the other peer to confirm it's authenticity (ability to decode) via challenge-response. @item @code{KX_STATE_UP} The connection is fully up from the point of -view of the sender (now performing keep-alives) +view of the sender (now performing keep-alive) @item @code{KX_STATE_REKEY_SENT} The sender has initiated a rekeying operation; the other peer has so far failed to confirm a working connection using the new ephemeral key @@ -5653,7 +5653,7 @@ download. The client component is basically a HTTP client (based on libcurl) which can download hostlists from one or more websites. The hostlist format is a binary blob containing a sequence of HELLO messages. Note that any HTTP server can theoretically serve a hostlist, -the build-in hostlist server makes it simply convenient to offer this +the built-in hostlist server makes it simply convenient to offer this service. @@ -5895,7 +5895,7 @@ The size of the list of URLs is restricted, so if an additional server is added and the list is full, the URL with the worst quality ranking (determined through successful downloads and number of HELLOs e.g.) is discarded. During shutdown the list of URLs is saved to a file for -persistance and loaded on startup. URLs from the configuration file are +persistence and loaded on startup. URLs from the configuration file are never discarded. @node Usage @@ -6155,7 +6155,7 @@ To disconnect from NAMESTORE, clients use @code{GNUNET_NAMESTORE_disconnect} and specify the handle to disconnect. NAMESTORE internally uses the ECDSA private key to refer to zones. These -private keys can be obtained from the IDENTITY subsytem. +private keys can be obtained from the IDENTITY subsystem. Here @emph{egos} @emph{can be used to refer to zones or the default ego assigned to the GNS subsystem can be used to obtained the master zone's private key.} @@ -6811,7 +6811,7 @@ the client. -Each listener also requires a seperate client connection. By sending the +Each listener also requires a separate client connection. By sending the @code{GNUNET_SERVICE_SET_LISTEN} message, the client notifies the service of the application id and operation type it is interested in. A client rejects an incoming request by sending @code{GNUNET_SERVICE_SET_REJECT} @@ -7147,7 +7147,7 @@ the client. @node Listeners for Intersection @subsubsection Listeners for Intersection -Each listener also requires a seperate client connection. By sending the +Each listener also requires a separate client connection. By sending the @code{GNUNET_SERVICE_SETI_LISTEN} message, the client notifies the service of the application id and operation type it is interested in. A client rejects an incoming request by sending @code{GNUNET_SERVICE_SETI_REJECT} @@ -7409,7 +7409,7 @@ the client. @node Listeners for Union @subsubsection Listeners for Union -Each listener also requires a seperate client connection. By sending the +Each listener also requires a separate client connection. By sending the @code{GNUNET_SERVICE_SETU_LISTEN} message, the client notifies the service of the application id and operation type it is interested in. A client rejects an incoming request by sending @code{GNUNET_SERVICE_SETU_REJECT} @@ -7832,7 +7832,7 @@ performance). Third, an optional Bloom filter can be specified to exclude known results; replies that hash to the bits set in the Bloom filter are considered invalid. False-positives can be eliminated by sending the same query -again with a different Bloom filter mutator value, which parameterizes +again with a different Bloom filter mutator value, which parametrizes the hash function that is used. Finally, an optional application-specific "eXtended query" (xquery) can be specified to further constrain the results. It is entirely up to @@ -9810,7 +9810,7 @@ properties designed for application level usage: @item MESSENGER allows detection for dropped messages by chaining them (messages refer to the last message by their hash) improving accountability @item MESSENGER allows requesting messages from other peers explicitly to ensure - availibility + availability @item MESSENGER provides confidentiality by padding messages to few different sizes (512 bytes, 4096 bytes, 32768 bytes and maximal message size from CADET) @@ -9825,13 +9825,13 @@ Also MESSENGER provides multiple features with privacy in mind: @itemize @bullet @item MESSENGER allows deleting messages from all peers in the group by the original sender (uses the MESSENGER provided verification) -@item MESSENGER allows using the publically known anonymous ego instead of any +@item MESSENGER allows using the publicly known anonymous ego instead of any unique identifying ego @item MESSENGER allows your node to decide between acting as host of the used messaging room (sharing your peer's identity with all nodes in the group) or acting as guest (sharing your peer's identity only with the nodes you explicitly open a connection to) -@item MESSENGER handles members independantly of the peer's identity making +@item MESSENGER handles members independently of the peer's identity making forwarded messages indistinguishable from directly received ones ( complicating the tracking of messages and identifying its origin) @item MESSENGER allows names of members being not unique (also names are @@ -9977,7 +9977,7 @@ check for completion of a member session requires this information. A member session is a triple of the room key, the member ID and the public key of the member's ego. Member sessions allow that a member can change their ID or -their ego once at a time without loosing the ability to delete old messages or +their ego once at a time without losing the ability to delete old messages or identifying the original sender of a message. On every change of ID or EGO a session will be marked as closed. So every session chain will only contain one open session with the current ID and public key. diff --git a/doc/handbook/chapters/installation.texi b/doc/handbook/chapters/installation.texi index 40a23e738..ad939b5b7 100644 --- a/doc/handbook/chapters/installation.texi +++ b/doc/handbook/chapters/installation.texi @@ -171,7 +171,7 @@ group. In addition the group @code{gnunetdns} may be needed (see below). Create user @code{gnunet} who is member of the group @code{gnunet} (automatically created) and specify a home directory where the GNUnet -services will store persistant data such as information about peers. +services will store persistent data such as information about peers. @example $ sudo useradd --system --home-dir /var/lib/gnunet --create-home gnunet @end example @@ -431,7 +431,7 @@ For the @emph{multi-user setup} first the system services need to be started as the system user, i.e. the user @code{gnunet} needs to execute @code{gnunet-arm -s}. This should be done by the system's init system. Then the user who wants to start GNUnet applications has to run -@code{gnunet-arm -s} too. It is recommented to automate this, e.g. using +@code{gnunet-arm -s} too. It is recommended to automate this, e.g. using the user's crontab. @node gnunet-gtk @@ -1369,7 +1369,7 @@ proxy forwards the HTTP request he receives with a certain URL to another webserver, here a GNUnet peer. So if you have a running Apache or nginx webserver you can configure it to -be a GNUnet reverse proxy. Especially if you have a well-known webiste +be a GNUnet reverse proxy. Especially if you have a well-known website this improves censorship resistance since it looks as normal surfing behaviour. @@ -2175,7 +2175,7 @@ Sane defaults should exist in your you could simply start without any configuration. If you want to configure your peer later, you need to stop it before invoking the @code{gnunet-setup} tool to customize further and to test your -configuration (@code{gnunet-setup} has build-in test functions). +configuration (@code{gnunet-setup} has built-in test functions). The most important option you might have to still set by hand is in [PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where diff --git a/doc/handbook/chapters/keyconcepts.texi b/doc/handbook/chapters/keyconcepts.texi index f429997bf..49129acf5 100644 --- a/doc/handbook/chapters/keyconcepts.texi +++ b/doc/handbook/chapters/keyconcepts.texi @@ -242,7 +242,7 @@ against identification. The messaging service allows the use of an anonymous ego for the signing and verification process of messages instead of a unique ego. This anonymous ego is -a publically known key pair which is shared between all peers in GNUnet. +a publicly known key pair which is shared between all peers in GNUnet. Using this ego only ensures that individual messages alone can't identify its sender inside of a messenger room. It should be clarified that the route of diff --git a/doc/handbook/chapters/philosophy.texi b/doc/handbook/chapters/philosophy.texi index 060871189..785a65e42 100644 --- a/doc/handbook/chapters/philosophy.texi +++ b/doc/handbook/chapters/philosophy.texi @@ -70,7 +70,7 @@ applications. @node Practicality @section Practicality -Whereever possible GNUnet allows the peer to adjust its operations and +Wherever possible GNUnet allows the peer to adjust its operations and functionalities to specific use cases. A GNUnet peer running on a mobile device with limited battery for example might choose not to relay traffic for other participants. diff --git a/doc/handbook/chapters/preface.texi b/doc/handbook/chapters/preface.texi index 62ced08a4..d1afdf756 100644 --- a/doc/handbook/chapters/preface.texi +++ b/doc/handbook/chapters/preface.texi @@ -85,7 +85,7 @@ book which explains GNUnet in the least complicated way to you. Even when you don't want to or can't learn Texinfo, you can contribute. Send us an Email or join our IRC chat room on freenode and talk with -us about the documentation (the prefered way to reach out is the +us about the documentation (the preferred way to reach out is the mailinglist, since you can communicate with us without waiting on someone in the chatroom). One way or another you can help shape the understanding of GNUnet @@ -144,7 +144,7 @@ and privacy-preserving online payments. In 2015, the @c XXX: but the correct version would lead to problems with @c XXX: some of our outputs and/or older versions of texinfo @c XXX: and devices that display versions on consoles etc. -@c XXX: This is why we keep the pEp until proven that p(tripple bar)p +@c XXX: This is why we keep the pEp until proven that p(triple bar)p @c XXX: does not create broken outputs. @uref{https://pep.foundation/, pretty Easy privacy} (pEp) project announced that they will use GNUnet as the technology for their diff --git a/doc/handbook/chapters/user.texi b/doc/handbook/chapters/user.texi index b5889891b..911d23526 100644 --- a/doc/handbook/chapters/user.texi +++ b/doc/handbook/chapters/user.texi @@ -109,7 +109,7 @@ rules - GO0T87F9BPMF8NKD5A54L2AH1T0GRML539TPFSRMCEA98182QD30 @subsection The GNS Tab -Maintaing your zones is through the NAMESTORE service and is discussed +Maintaining your zones is through the NAMESTORE service and is discussed here. You can manage your zone using @command{gnunet-identity} and @command{gnunet-namestore}, or most conveniently using @command{gnunet-namestore-gtk}. @@ -1633,7 +1633,7 @@ are BOXed up. @subsubsection LEHO The LEgacy HOstname of a server. Some webservers expect a specific -hostname to provide a service (virtiual hosting). Also SSL +hostname to provide a service (virtual hosting). Also SSL certificates usually contain DNS names. To provide the expected legacy DNS name for a server, the LEHO record can be used. To mitigate the just mentioned issues the GNS proxy has to be used. @@ -2404,7 +2404,7 @@ $ gnunet-peerinfo -s A ROOMKEY gets entered in readable text form. The service will then hash the entered ROOMKEY and use the result as shared secret for transmission through -the CADET submodule. You can also optionally leave out the '-r' paramter and +the CADET submodule. You can also optionally leave out the '-r' parameter and the ROOMKEY to use the zeroed hash instead. If no IDENTITY is provided you will not send any name to others, you will be @@ -2478,7 +2478,7 @@ $ gnunet-messenger [-e IDENTITY] -d PEERIDENTITY -r ROOMKEY -p @end example Notice that you can only send such encrypted messages to members who use an ego -which is not publically known as the anonymous ego to ensure transparency. If +which is not publicly known as the anonymous ego to ensure transparency. If any user could decrypt these messages they would not be private. So as receiver of such messages the IDENTITY is required and it has to match a local ego. diff --git a/doc/tutorial/tutorial.texi b/doc/tutorial/tutorial.texi index e1d70c492..0a011c0c8 100644 --- a/doc/tutorial/tutorial.texi +++ b/doc/tutorial/tutorial.texi @@ -282,7 +282,7 @@ Assuming all dependencies are installed, the following commands will compile and install GNUnet in your home directory. You can specify the directory where GNUnet will be installed by changing the @code{--prefix} value when calling @command{./configure}. If -you do not specifiy a prefix, GNUnet is installed in the directory +you do not specify a prefix, GNUnet is installed in the directory @file{/usr/local}. When developing new applications you may want to enable verbose logging by adding @code{--enable-logging=verbose}: @@ -940,7 +940,7 @@ with the service, a connection must be created: As a result a @code{GNUNET\_MQ\_Handle} is returned which can to used henceforth to transmit messages to the service. The complete MQ API can be found in @file{gnunet\_mq\_lib.h}. -The @code{hanlders} array in the example above is incomplete. +The @code{handlers} array in the example above is incomplete. Here is where you will define which messages you expect to receive from the service, and which functions handle them. The @code{error\_cb} is a function that is to be called whenever @@ -1060,7 +1060,7 @@ functions, typically called @code{run}, @code{client\_connect\_cb} and @code{client\_disconnect\_cb} as well as an array of message handlers that will be called for incoming messages from clients. -A minimal version of the three central service funtions would look +A minimal version of the three central service functions would look like this: @example @@ -1093,7 +1093,7 @@ forget to call @code{GNUNET\_SERVICE\_client\_continue()}? @node Interacting directly with other Peers using the CORE Service @section Interacting directly with other Peers using the CORE Service -FIXME: This section still needs to be updated to the lastest API! +FIXME: This section still needs to be updated to the latest API! One of the most important services in GNUnet is the @code{CORE} service managing connections between peers and handling encryption between peers. @@ -1349,7 +1349,7 @@ sent. This does not guarantee that the data is accessible to others peers, or even that is has been stored, only that the service has requested to a neighboring peer the retransmission of the PUT request towards its final destination. Currently there is no feedback about whether or not the data -has been sucessfully stored or where it has been stored. In order to +has been successfully stored or where it has been stored. In order to improve the availablilty of the data and to compensate for possible errors, peers leaving and other unfavorable events, just make several PUT requests! @@ -1504,7 +1504,7 @@ GET request, a PUT request or a response (a reply to a GET). Since the different events have different associated data, the API gets 3 different callbacks (one for each message type) and optional type and key parameters, to allow for filtering of -messages. When an event happens, the appropiate callback is +messages. When an event happens, the appropriate callback is called with all the information about the event. @example -- cgit v1.2.3 From 3cd24823660a0447e590ff352e9da7eb076b292b Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 22 Feb 2021 10:16:16 +0100 Subject: RECLAIM: Added libpabc credential support. --- configure.ac | 24 + contrib/Makefile.inc | 3 +- po/POTFILES.in | 125 ++--- src/reclaim/Makefile.am | 40 ++ src/reclaim/json_reclaim.c | 16 +- src/reclaim/pabc_helper.c | 364 +++++++++++++++ src/reclaim/pabc_helper.h | 41 ++ src/reclaim/plugin_reclaim_credential_jwt.c | 32 +- src/reclaim/plugin_reclaim_credential_pabc.c | 639 +++++++++++++++++++++++++ src/reclaim/plugin_rest_pabc.c | 666 +++++++++++++++++++++++++++ src/reclaim/reclaim_credential.c | 1 - 11 files changed, 1871 insertions(+), 80 deletions(-) create mode 100644 src/reclaim/pabc_helper.c create mode 100644 src/reclaim/pabc_helper.h create mode 100644 src/reclaim/plugin_reclaim_credential_pabc.c create mode 100644 src/reclaim/plugin_rest_pabc.c diff --git a/configure.ac b/configure.ac index e66103b58..4a2f148ff 100644 --- a/configure.ac +++ b/configure.ac @@ -791,6 +791,30 @@ AS_IF([test "x$zbar" = x1], [AC_DEFINE([HAVE_ZBAR],[1],[Have zbar library])], [AC_DEFINE([HAVE_ZBAR],[0],[Lacking zbar library])]) +# check for libpabc library +pabc=0 +AC_MSG_CHECKING(for libpabc) +AC_ARG_WITH(pabc, + [ --with-pabc=PREFIX (base of libpabc installation)], + [AC_MSG_RESULT([$with_pabc]) + AS_CASE([$with_pabc], + [no],[], + [yes],[ + CHECK_LIBHEADER(PABC, pabc, pabc_new_ctx, pabc/pabc.h,pabc=1,) + ],[ + LDFLAGS="-L$with_pabc/lib $LDFLAGS" + CPPFLAGS="-I$with_pabc/include $CPPFLAGS" + AC_CHECK_HEADERS(pabc/pabc.h, + AC_CHECK_LIB([pabc], [pabc_new_ctx], + EXT_LIB_PATH="-L$with_pabc/lib $EXT_LIB_PATH" + pabc=1)) + ]) + ], + [AC_MSG_RESULT([--with-pabc not specified]) + CHECK_LIBHEADER(PABC, pabc, pabc_new_ctx, pabc/pabc.h,pabc=1,)]) +AM_CONDITIONAL(HAVE_PABC, [test x$pabc = x1]) + + # check for jansson library jansson=0 AC_MSG_CHECKING(for libjansson) diff --git a/contrib/Makefile.inc b/contrib/Makefile.inc index c737a07f8..a563ef4a1 100644 --- a/contrib/Makefile.inc +++ b/contrib/Makefile.inc @@ -8,7 +8,8 @@ BUILDCOMMON_SHLIB_FILES = \ build-common/sh/lib.sh/existence_python.sh \ build-common/sh/lib.sh/msg.sh \ build-common/sh/lib.sh/progname.sh \ - build-common/sh/lib.sh/version_gnunet.sh + build-common/sh/lib.sh/version_gnunet.sh \ + build-common/LICENSE BUILDCOMMON_CONF_FILES = \ build-common/conf/.dir-locals.el \ diff --git a/po/POTFILES.in b/po/POTFILES.in index 9d1e3427c..dd36b7411 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -10,13 +10,21 @@ src/arm/arm_monitor_api.c src/arm/gnunet-arm.c src/arm/gnunet-service-arm.c src/arm/mockup-service.c +src/ats-tests/ats-testing-experiment.c +src/ats-tests/ats-testing-log.c +src/ats-tests/ats-testing-preferences.c +src/ats-tests/ats-testing-traffic.c +src/ats-tests/ats-testing.c +src/ats-tests/gnunet-ats-sim.c +src/ats-tests/gnunet-solver-eval.c +src/ats-tool/gnunet-ats.c src/ats/ats_api_connectivity.c src/ats/ats_api_performance.c src/ats/ats_api_scanner.c src/ats/ats_api_scheduling.c src/ats/gnunet-ats-solver-eval.c -src/ats/gnunet-service-ats_addresses.c src/ats/gnunet-service-ats.c +src/ats/gnunet-service-ats_addresses.c src/ats/gnunet-service-ats_connectivity.c src/ats/gnunet-service-ats_normalization.c src/ats/gnunet-service-ats_performance.c @@ -25,14 +33,6 @@ src/ats/gnunet-service-ats_preferences.c src/ats/gnunet-service-ats_reservations.c src/ats/gnunet-service-ats_scheduling.c src/ats/plugin_ats_proportional.c -src/ats-tests/ats-testing.c -src/ats-tests/ats-testing-experiment.c -src/ats-tests/ats-testing-log.c -src/ats-tests/ats-testing-preferences.c -src/ats-tests/ats-testing-traffic.c -src/ats-tests/gnunet-ats-sim.c -src/ats-tests/gnunet-solver-eval.c -src/ats-tool/gnunet-ats.c src/auction/gnunet-auction-create.c src/auction/gnunet-auction-info.c src/auction/gnunet-auction-join.c @@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c src/cadet/cadet_api_list_tunnels.c src/cadet/cadet_test_lib.c src/cadet/desirability_table.c -src/cadet/gnunet-cadet.c src/cadet/gnunet-cadet-profiler.c +src/cadet/gnunet-cadet.c src/cadet/gnunet-service-cadet.c src/cadet/gnunet-service-cadet_channel.c src/cadet/gnunet-service-cadet_connection.c @@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c src/consensus/plugin_block_consensus.c src/conversation/conversation_api.c src/conversation/conversation_api_call.c -src/conversation/gnunet-conversation.c src/conversation/gnunet-conversation-test.c -src/conversation/gnunet_gst.c -src/conversation/gnunet_gst_test.c -src/conversation/gnunet-helper-audio-playback.c +src/conversation/gnunet-conversation.c src/conversation/gnunet-helper-audio-playback-gst.c -src/conversation/gnunet-helper-audio-record.c +src/conversation/gnunet-helper-audio-playback.c src/conversation/gnunet-helper-audio-record-gst.c +src/conversation/gnunet-helper-audio-record.c src/conversation/gnunet-service-conversation.c +src/conversation/gnunet_gst.c +src/conversation/gnunet_gst_test.c src/conversation/microphone.c src/conversation/plugin_gnsrecord_conversation.c src/conversation/speaker.c @@ -105,7 +105,6 @@ src/dht/dht_api.c src/dht/dht_test_lib.c src/dht/gnunet-dht-get.c src/dht/gnunet-dht-monitor.c -src/dht/gnunet_dht_profiler.c src/dht/gnunet-dht-put.c src/dht/gnunet-service-dht.c src/dht/gnunet-service-dht_clients.c @@ -114,6 +113,7 @@ src/dht/gnunet-service-dht_hello.c src/dht/gnunet-service-dht_neighbours.c src/dht/gnunet-service-dht_nse.c src/dht/gnunet-service-dht_routing.c +src/dht/gnunet_dht_profiler.c src/dht/plugin_block_dht.c src/dns/dns_api.c src/dns/gnunet-dns-monitor.c @@ -148,8 +148,8 @@ src/fs/gnunet-auto-share.c src/fs/gnunet-daemon-fsprofiler.c src/fs/gnunet-directory.c src/fs/gnunet-download.c -src/fs/gnunet-fs.c src/fs/gnunet-fs-profiler.c +src/fs/gnunet-fs.c src/fs/gnunet-helper-fs-publish.c src/fs/gnunet-publish.c src/fs/gnunet-search.c @@ -169,9 +169,9 @@ src/gns/gns_tld_api.c src/gns/gnunet-bcd.c src/gns/gnunet-dns2gns.c src/gns/gnunet-gns-benchmark.c -src/gns/gnunet-gns.c src/gns/gnunet-gns-import.c src/gns/gnunet-gns-proxy.c +src/gns/gnunet-gns.c src/gns/gnunet-service-gns.c src/gns/gnunet-service-gns_interceptor.c src/gns/gnunet-service-gns_resolver.c @@ -189,8 +189,8 @@ src/gnsrecord/json_gnsrecord.c src/gnsrecord/plugin_gnsrecord_dns.c src/hello/address.c src/hello/gnunet-hello.c -src/hello/hello.c src/hello/hello-ng.c +src/hello/hello.c src/hostlist/gnunet-daemon-hostlist.c src/hostlist/gnunet-daemon-hostlist_client.c src/hostlist/gnunet-daemon-hostlist_server.c @@ -205,8 +205,8 @@ src/json/json_generator.c src/json/json_helper.c src/json/json_mhd.c src/messenger/gnunet-messenger.c -src/messenger/gnunet-service-messenger_basement.c src/messenger/gnunet-service-messenger.c +src/messenger/gnunet-service-messenger_basement.c src/messenger/gnunet-service-messenger_ego_store.c src/messenger/gnunet-service-messenger_handle.c src/messenger/gnunet-service-messenger_list_handles.c @@ -245,8 +245,8 @@ src/namecache/namecache_api.c src/namecache/plugin_namecache_flat.c src/namecache/plugin_namecache_postgres.c src/namecache/plugin_namecache_sqlite.c -src/namestore/gnunet-namestore.c src/namestore/gnunet-namestore-fcfsd.c +src/namestore/gnunet-namestore.c src/namestore/gnunet-service-namestore.c src/namestore/gnunet-zoneimport.c src/namestore/namestore_api.c @@ -272,17 +272,17 @@ src/nat/gnunet-service-nat_mini.c src/nat/gnunet-service-nat_stun.c src/nat/nat_api.c src/nat/nat_api_stun.c -src/nse/gnunet-nse.c src/nse/gnunet-nse-profiler.c +src/nse/gnunet-nse.c src/nse/gnunet-service-nse.c src/nse/nse_api.c src/nt/nt.c -src/peerinfo/gnunet-service-peerinfo.c -src/peerinfo/peerinfo_api.c -src/peerinfo/peerinfo_api_notify.c src/peerinfo-tool/gnunet-peerinfo.c src/peerinfo-tool/gnunet-peerinfo_plugins.c src/peerinfo-tool/plugin_rest_peerinfo.c +src/peerinfo/gnunet-service-peerinfo.c +src/peerinfo/peerinfo_api.c +src/peerinfo/peerinfo_api_notify.c src/peerstore/gnunet-peerstore.c src/peerstore/gnunet-service-peerstore.c src/peerstore/peerstore_api.c @@ -302,10 +302,13 @@ src/reclaim/gnunet-service-reclaim.c src/reclaim/gnunet-service-reclaim_tickets.c src/reclaim/json_reclaim.c src/reclaim/oidc_helper.c +src/reclaim/pabc_helper.c src/reclaim/plugin_gnsrecord_reclaim.c src/reclaim/plugin_reclaim_attribute_basic.c src/reclaim/plugin_reclaim_credential_jwt.c +src/reclaim/plugin_reclaim_credential_pabc.c src/reclaim/plugin_rest_openid_connect.c +src/reclaim/plugin_rest_pabc.c src/reclaim/plugin_rest_reclaim.c src/reclaim/reclaim_api.c src/reclaim/reclaim_attribute.c @@ -328,27 +331,27 @@ src/rest/gnunet-rest-server.c src/rest/plugin_rest_config.c src/rest/plugin_rest_copying.c src/rest/rest.c -src/revocation/gnunet-revocation.c src/revocation/gnunet-revocation-tvg.c +src/revocation/gnunet-revocation.c src/revocation/gnunet-service-revocation.c src/revocation/plugin_block_revocation.c src/revocation/revocation_api.c -src/rps/gnunet-rps.c src/rps/gnunet-rps-profiler.c +src/rps/gnunet-rps.c src/rps/gnunet-service-rps.c src/rps/gnunet-service-rps_custommap.c src/rps/gnunet-service-rps_sampler.c src/rps/gnunet-service-rps_sampler_elem.c src/rps/gnunet-service-rps_view.c -src/rps/rps_api.c src/rps/rps-sampler_client.c src/rps/rps-sampler_common.c src/rps/rps-test_util.c +src/rps/rps_api.c src/scalarproduct/gnunet-scalarproduct.c -src/scalarproduct/gnunet-service-scalarproduct_alice.c -src/scalarproduct/gnunet-service-scalarproduct_bob.c src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c +src/scalarproduct/gnunet-service-scalarproduct_alice.c +src/scalarproduct/gnunet-service-scalarproduct_bob.c src/scalarproduct/scalarproduct_api.c src/secretsharing/gnunet-secretsharing-profiler.c src/secretsharing/gnunet-service-secretsharing.c @@ -362,12 +365,12 @@ src/set/gnunet-set-ibf-profiler.c src/set/gnunet-set-profiler.c src/set/ibf.c src/set/ibf_sim.c +src/set/plugin_block_set_test.c +src/set/set_api.c src/seti/gnunet-service-seti.c src/seti/gnunet-seti-profiler.c src/seti/plugin_block_seti_test.c src/seti/seti_api.c -src/set/plugin_block_set_test.c -src/set/set_api.c src/setu/gnunet-service-setu.c src/setu/gnunet-service-setu_strata_estimator.c src/setu/gnunet-setu-ibf-profiler.c @@ -386,15 +389,16 @@ src/statistics/gnunet-statistics.c src/statistics/statistics_api.c src/template/gnunet-service-template.c src/template/gnunet-template.c +src/testbed-logger/gnunet-service-testbed-logger.c +src/testbed-logger/testbed_logger_api.c src/testbed/generate-underlay-topology.c src/testbed/gnunet-daemon-latency-logger.c src/testbed/gnunet-daemon-testbed-blacklist.c src/testbed/gnunet-daemon-testbed-underlay.c src/testbed/gnunet-helper-testbed.c -src/testbed/gnunet_mpi_test.c src/testbed/gnunet-service-test-barriers.c -src/testbed/gnunet-service-testbed_barriers.c src/testbed/gnunet-service-testbed.c +src/testbed/gnunet-service-testbed_barriers.c src/testbed/gnunet-service-testbed_cache.c src/testbed/gnunet-service-testbed_connectionpool.c src/testbed/gnunet-service-testbed_cpustatus.c @@ -402,69 +406,81 @@ src/testbed/gnunet-service-testbed_links.c src/testbed/gnunet-service-testbed_meminfo.c src/testbed/gnunet-service-testbed_oc.c src/testbed/gnunet-service-testbed_peers.c -src/testbed/gnunet_testbed_mpi_spawn.c src/testbed/gnunet-testbed-profiler.c -src/testbed-logger/gnunet-service-testbed-logger.c -src/testbed-logger/testbed_logger_api.c -src/testbed/testbed_api_barriers.c +src/testbed/gnunet_mpi_test.c +src/testbed/gnunet_testbed_mpi_spawn.c src/testbed/testbed_api.c +src/testbed/testbed_api_barriers.c src/testbed/testbed_api_cmd_controller.c src/testbed/testbed_api_cmd_peer.c -src/testbed/testbed_api_cmd_service.c +src/testbed/testbed_api_cmd_peer_store.c +src/testbed/testbed_api_cmd_tng_connect.c +src/testbed/testbed_api_cmd_tng_service.c src/testbed/testbed_api_hosts.c src/testbed/testbed_api_operations.c src/testbed/testbed_api_peers.c src/testbed/testbed_api_sd.c src/testbed/testbed_api_services.c src/testbed/testbed_api_statistics.c -src/testbed/testbed_api_testbed.c src/testbed/testbed_api_test.c +src/testbed/testbed_api_testbed.c src/testbed/testbed_api_topology.c src/testbed/testbed_api_underlay.c src/testing/gnunet-testing.c src/testing/list-keys.c +src/testing/testing.c src/testing/testing_api_cmd_batch.c -src/testing/testing_api_cmd_hello_world_birth.c src/testing/testing_api_cmd_hello_world.c +src/testing/testing_api_cmd_hello_world_birth.c src/testing/testing_api_loop.c src/testing/testing_api_trait_cmd.c src/testing/testing_api_trait_process.c src/testing/testing_api_traits.c -src/testing/testing.c src/topology/friends.c src/topology/gnunet-daemon-topology.c src/transport/gnunet-communicator-tcp.c src/transport/gnunet-communicator-udp.c src/transport/gnunet-communicator-unix.c src/transport/gnunet-helper-transport-bluetooth.c -src/transport/gnunet-helper-transport-wlan.c src/transport/gnunet-helper-transport-wlan-dummy.c +src/transport/gnunet-helper-transport-wlan.c src/transport/gnunet-service-tng.c -src/transport/gnunet-service-transport_ats.c src/transport/gnunet-service-transport.c +src/transport/gnunet-service-transport_ats.c src/transport/gnunet-service-transport_hello.c src/transport/gnunet-service-transport_manipulation.c src/transport/gnunet-service-transport_neighbours.c src/transport/gnunet-service-transport_plugins.c src/transport/gnunet-service-transport_validation.c -src/transport/gnunet-transport.c src/transport/gnunet-transport-profiler.c src/transport/gnunet-transport-wlan-receiver.c src/transport/gnunet-transport-wlan-sender.c +src/transport/gnunet-transport.c src/transport/plugin_transport_http_client.c src/transport/plugin_transport_http_common.c src/transport/plugin_transport_http_server.c src/transport/plugin_transport_smtp.c src/transport/plugin_transport_tcp.c src/transport/plugin_transport_template.c -src/transport/plugin_transport_udp_broadcasting.c src/transport/plugin_transport_udp.c +src/transport/plugin_transport_udp_broadcasting.c src/transport/plugin_transport_unix.c src/transport/plugin_transport_wlan.c src/transport/tcp_connection_legacy.c src/transport/tcp_server_legacy.c src/transport/tcp_server_mst_legacy.c src/transport/tcp_service_legacy.c +src/transport/transport-testing-communicator.c +src/transport/transport-testing-filenames.c +src/transport/transport-testing-filenames2.c +src/transport/transport-testing-loggers.c +src/transport/transport-testing-loggers2.c +src/transport/transport-testing-main.c +src/transport/transport-testing-main2.c +src/transport/transport-testing-send.c +src/transport/transport-testing-send2.c +src/transport/transport-testing.c +src/transport/transport-testing2.c src/transport/transport_api2_application.c src/transport/transport_api2_communication.c src/transport/transport_api2_core.c @@ -477,17 +493,6 @@ src/transport/transport_api_manipulation.c src/transport/transport_api_monitor_peers.c src/transport/transport_api_monitor_plugins.c src/transport/transport_api_offer_hello.c -src/transport/transport-testing2.c -src/transport/transport-testing.c -src/transport/transport-testing-communicator.c -src/transport/transport-testing-filenames2.c -src/transport/transport-testing-filenames.c -src/transport/transport-testing-loggers2.c -src/transport/transport-testing-loggers.c -src/transport/transport-testing-main2.c -src/transport/transport-testing-main.c -src/transport/transport-testing-send2.c -src/transport/transport-testing-send.c src/util/bandwidth.c src/util/benchmark.c src/util/bio.c @@ -502,8 +507,8 @@ src/util/consttime_memcmp.c src/util/container_bloomfilter.c src/util/container_heap.c src/util/container_meta_data.c -src/util/container_multihashmap32.c src/util/container_multihashmap.c +src/util/container_multihashmap32.c src/util/container_multipeermap.c src/util/container_multishortmap.c src/util/container_multiuuidmap.c @@ -528,8 +533,8 @@ src/util/dnsstub.c src/util/getopt.c src/util/getopt_helpers.c src/util/gnunet-base32.c -src/util/gnunet-config.c src/util/gnunet-config-diff.c +src/util/gnunet-config.c src/util/gnunet-crypto-tvg.c src/util/gnunet-ecc.c src/util/gnunet-qr.c @@ -567,8 +572,8 @@ src/vpn/gnunet-helper-vpn.c src/vpn/gnunet-service-vpn.c src/vpn/gnunet-vpn.c src/vpn/vpn_api.c -src/zonemaster/gnunet-service-zonemaster.c src/zonemaster/gnunet-service-zonemaster-monitor.c +src/zonemaster/gnunet-service-zonemaster.c src/fs/fs_api.h src/testbed/testbed_api.h src/testbed/testbed_api_operations.h diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am index 9463f19d9..1a0b7fae4 100644 --- a/src/reclaim/Makefile.am +++ b/src/reclaim/Makefile.am @@ -16,6 +16,11 @@ REST_PLUGIN = \ CREDENTIAL_PLUGIN = \ libgnunet_plugin_reclaim_credential_jwt.la +if HAVE_PABC + CREDENTIAL_PLUGIN += libgnunet_plugin_reclaim_credential_pabc.la + REST_PLUGIN += libgnunet_plugin_rest_pabc.la +endif + EXTRA_DIST = \ reclaim.conf \ test_reclaim_defaults.conf \ @@ -87,6 +92,26 @@ libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) libgnunet_plugin_rest_openid_connect_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS) +if HAVE_PABC +libgnunet_plugin_rest_pabc_la_SOURCES = \ + plugin_rest_pabc.c \ + pabc_helper.c +libgnunet_plugin_rest_pabc_la_LIBADD = \ + libgnunetreclaim.la \ + $(top_builddir)/src/json/libgnunetjson.la \ + $(top_builddir)/src/rest/libgnunetrest.la \ + $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ + $(LTLIBINTL) -ljansson -lpabc $(MHD_LIBS) +libgnunet_plugin_rest_pabc_la_DEPENDENCIES = \ + libgnunetreclaim.la \ + $(top_builddir)/src/json/libgnunetjson.la \ + $(top_builddir)/src/rest/libgnunetrest.la \ + $(top_builddir)/src/util/libgnunetutil.la +libgnunet_plugin_rest_pabc_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) +libgnunet_plugin_rest_pabc_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS) +endif + libgnunet_plugin_gnsrecord_reclaim_la_SOURCES = \ plugin_gnsrecord_reclaim.c @@ -134,6 +159,21 @@ libgnunet_plugin_reclaim_attribute_basic_la_LIBADD = \ libgnunet_plugin_reclaim_attribute_basic_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) +if HAVE_PABC +libgnunet_plugin_reclaim_credential_pabc_la_SOURCES = \ + plugin_reclaim_credential_pabc.c \ + pabc_helper.c +libgnunet_plugin_reclaim_credential_pabc_la_LIBADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + libgnunetreclaim.la \ + -ljansson\ + -lpabc \ + $(LTLIBINTL) +libgnunet_plugin_reclaim_credential_pabc_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) +endif + + libgnunet_plugin_reclaim_credential_jwt_la_SOURCES = \ plugin_reclaim_credential_jwt.c libgnunet_plugin_reclaim_credential_jwt_la_LIBADD = \ diff --git a/src/reclaim/json_reclaim.c b/src/reclaim/json_reclaim.c index 4eeb22bee..b1ca7a4a5 100644 --- a/src/reclaim/json_reclaim.c +++ b/src/reclaim/json_reclaim.c @@ -290,10 +290,11 @@ parse_credential (void *cls, json_t *root, struct GNUNET_JSON_Specification *spe { struct GNUNET_RECLAIM_Credential *cred; const char *name_str = NULL; - const char *val_str = NULL; const char *type_str = NULL; const char *id_str = NULL; - char *data; + json_t *val_json; + char *data = NULL; + char *val_str = NULL; int unpack_state; uint32_t type; size_t data_size; @@ -308,7 +309,7 @@ parse_credential (void *cls, json_t *root, struct GNUNET_JSON_Specification *spe } // interpret single attribute unpack_state = json_unpack (root, - "{s:s, s?s, s:s, s:s!}", + "{s:s, s?s, s:s, s:o!}", "name", &name_str, "id", @@ -316,14 +317,19 @@ parse_credential (void *cls, json_t *root, struct GNUNET_JSON_Specification *spe "type", &type_str, "value", - &val_str); - if ((0 != unpack_state) || (NULL == name_str) || (NULL == val_str) || + &val_json); + if ((0 != unpack_state) || (NULL == name_str) || (NULL == val_json) || (NULL == type_str)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error json object has a wrong format!\n"); return GNUNET_SYSERR; } + if (json_is_string (val_json)) { + val_str = GNUNET_strdup (json_string_value (val_json)); + } else { + val_str = json_dumps (val_json, JSON_COMPACT); + } type = GNUNET_RECLAIM_credential_typename_to_number (type_str); if (GNUNET_SYSERR == (GNUNET_RECLAIM_credential_string_to_value (type, diff --git a/src/reclaim/pabc_helper.c b/src/reclaim/pabc_helper.c new file mode 100644 index 000000000..1b1dbea0f --- /dev/null +++ b/src/reclaim/pabc_helper.c @@ -0,0 +1,364 @@ +// maximilian.kaul@aisec.fraunhofer.de + +// WIP implementation of +// https://github.com/ontio/ontology-crypto/wiki/Anonymous-Credential +// using the relic library https://github.com/relic-toolkit/relic/ + +#include "pabc_helper.h" +#include +#include +#include + +static char pabc_dir[PATH_MAX + 1]; + +static const char * +get_homedir () +{ + const char *homedir; + if ((homedir = getenv ("HOME")) == NULL) + { + homedir = getpwuid (getuid ())->pw_dir; + } + return homedir; +} + + +static enum GNUNET_GenericReturnValue +write_file (char const *const filename, const char *buffer) +{ + struct GNUNET_DISK_FileHandle *fh; + fh = GNUNET_DISK_file_open (filename, + GNUNET_DISK_OPEN_WRITE + | GNUNET_DISK_OPEN_TRUNCATE + | GNUNET_DISK_OPEN_CREATE, + GNUNET_DISK_PERM_USER_WRITE + | GNUNET_DISK_PERM_USER_READ); + if (fh == NULL) + return GNUNET_SYSERR; + if (GNUNET_SYSERR == GNUNET_DISK_file_write (fh, + buffer, strlen (buffer) + 1)) + goto fail; + GNUNET_DISK_file_close (fh); + return GNUNET_OK; + +fail: + GNUNET_DISK_file_close (fh); + return GNUNET_SYSERR; +} + + +static enum GNUNET_GenericReturnValue +init_pabc_dir () +{ + size_t filename_size = strlen (get_homedir ()) + 1 + strlen (".local") + 1 + + strlen ("pabc-reclaim") + 1; + snprintf (pabc_dir, filename_size, "%s/%s/%s", + get_homedir (), ".local", "pabc-reclaim"); + return GNUNET_DISK_directory_create (pabc_dir); +} + + +static const char * +get_pabcdir () +{ + init_pabc_dir (); + return pabc_dir; +} + + +enum GNUNET_GenericReturnValue +read_file (char const *const filename, char **buffer) +{ + struct GNUNET_DISK_FileHandle *fh; + if (GNUNET_YES != GNUNET_DISK_file_test (filename)) + return GNUNET_SYSERR; + + fh = GNUNET_DISK_file_open (filename, + GNUNET_DISK_OPEN_READ, + GNUNET_DISK_PERM_USER_READ); + if (fh == NULL) + return GNUNET_SYSERR; + long lSize = GNUNET_DISK_file_seek (fh, 0, GNUNET_DISK_SEEK_END); + if (lSize < 0) + goto fail; + GNUNET_DISK_file_seek (fh, 0, GNUNET_DISK_SEEK_SET); + *buffer = calloc ((size_t) lSize + 1, sizeof(char)); + if (*buffer == NULL) + goto fail; + + // copy the file into the buffer: + size_t r = GNUNET_DISK_file_read (fh, *buffer, (size_t) lSize); + if (r != (size_t) lSize) + goto fail; + + GNUNET_DISK_file_close (fh); + return GNUNET_OK; + +fail: + GNUNET_DISK_file_close (fh); + return GNUNET_SYSERR; +} + + +struct pabc_public_parameters * +PABC_read_issuer_ppfile (const char *f, struct pabc_context *const ctx) +{ + if (NULL == ctx) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No global context provided\n"); + return NULL; + } + struct pabc_public_parameters *pp; + char *buffer; + int r; + r = read_file (f, &buffer); + if (GNUNET_OK != r) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error reading file\n"); + return NULL; + } + if (PABC_OK != pabc_decode_and_new_public_parameters (ctx, &pp, buffer)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to decode public parameters\n"); + PABC_FREE_NULL (buffer); + return NULL; + } + PABC_FREE_NULL (buffer); + return pp; +} + + +enum GNUNET_GenericReturnValue +PABC_load_public_parameters (struct pabc_context *const ctx, + char const *const pp_name, + struct pabc_public_parameters **pp) +{ + char fname[PATH_MAX]; + char *pp_filename; + const char *pdir = get_pabcdir (); + + if (ctx == NULL) + return GNUNET_SYSERR; + if (pp_name == NULL) + return GNUNET_SYSERR; + + GNUNET_STRINGS_urlencode (pp_name, strlen (pp_name), &pp_filename); + if (GNUNET_YES != GNUNET_DISK_directory_test (pdir, GNUNET_YES)) + { + GNUNET_free (pp_filename); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error reading %s\n", pdir); + return GNUNET_SYSERR; + } + snprintf (fname, PATH_MAX, "%s/%s%s", pdir, pp_filename, PABC_PP_EXT); + if (GNUNET_YES != GNUNET_DISK_file_test (fname)) + { + GNUNET_free (pp_filename); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error testing %s\n", fname); + return GNUNET_SYSERR; + } + *pp = PABC_read_issuer_ppfile (fname, ctx); + if (*pp) + return GNUNET_OK; + else + return GNUNET_SYSERR; +} + + +enum GNUNET_GenericReturnValue +PABC_write_public_parameters (char const *const pp_name, + struct pabc_public_parameters *const pp) +{ + char *json; + char *filename; + char *pp_filename; + enum pabc_status status; + struct pabc_context *ctx = NULL; + + GNUNET_STRINGS_urlencode (pp_name, strlen (pp_name), &pp_filename); + PABC_ASSERT (pabc_new_ctx (&ctx)); + // store in json file + status = pabc_encode_public_parameters (ctx, pp, &json); + if (status != PABC_OK) + { + GNUNET_free (pp_filename); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to encode public parameters.\n"); + pabc_free_ctx (&ctx); + return GNUNET_SYSERR; + } + + size_t filename_size = + strlen (get_pabcdir ()) + 1 + strlen (pp_filename) + strlen (PABC_PP_EXT) + + 1; + filename = GNUNET_malloc (filename_size); + if (! filename) + { + GNUNET_free (pp_filename); + PABC_FREE_NULL (json); + pabc_free_ctx (&ctx); + return GNUNET_SYSERR; + } + snprintf (filename, filename_size, "%s/%s%s", get_pabcdir (), pp_filename, + PABC_PP_EXT); + + GNUNET_free (pp_filename); + if (GNUNET_OK != write_file (filename, json)) + { + PABC_FREE_NULL (filename); + PABC_FREE_NULL (json); + pabc_free_ctx (&ctx); + return GNUNET_SYSERR; + } + PABC_FREE_NULL (filename); + PABC_FREE_NULL (json); + pabc_free_ctx (&ctx); + return GNUNET_OK; +} + + +enum GNUNET_GenericReturnValue +PABC_write_usr_ctx (char const *const usr_name, + char const *const pp_name, + struct pabc_context const *const ctx, + struct pabc_public_parameters const *const pp, + struct pabc_user_context *const usr_ctx) +{ + + char *pp_filename; + char *json = NULL; + enum pabc_status status; + char *fname = NULL; + + if (NULL == usr_name) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No issuer given.\n"); + return GNUNET_SYSERR; + } + if (NULL == pp_name) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No user given.\n"); + return GNUNET_SYSERR; + } + if (NULL == ctx) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No context given.\n"); + return GNUNET_SYSERR; + } + if (NULL == pp) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No public parameters given.\n"); + return GNUNET_SYSERR; + } + if (NULL == usr_ctx) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No user context given.\n"); + return GNUNET_SYSERR; + } + + GNUNET_STRINGS_urlencode (pp_name, strlen (pp_name), &pp_filename); + status = pabc_encode_user_ctx (ctx, pp, usr_ctx, &json); + if (PABC_OK != status) + { + GNUNET_free (pp_filename); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to encode user context.\n"); + return status; + } + + size_t fname_size = strlen (get_pabcdir ()) + 1 + strlen (usr_name) + 1 + + strlen (pp_filename) + strlen (PABC_USR_EXT) + 1; + fname = GNUNET_malloc (fname_size); + + snprintf (fname, fname_size, "%s/%s_%s%s", get_pabcdir (), usr_name, + pp_filename, + PABC_USR_EXT); + + GNUNET_free (pp_filename); + if (GNUNET_OK == write_file (fname, json)) + { + GNUNET_free (fname); + GNUNET_free (json); + return GNUNET_OK; + } + else + { + GNUNET_free (fname); + GNUNET_free (json); + return GNUNET_SYSERR; + } +} + + +enum GNUNET_GenericReturnValue +PABC_read_usr_ctx (char const *const usr_name, + char const *const pp_name, + struct pabc_context const *const ctx, + struct pabc_public_parameters const *const pp, + struct pabc_user_context **usr_ctx) +{ + char *json = NULL; + char *pp_filename; + enum pabc_status status; + + char *fname = NULL; + + if (NULL == usr_name) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No issuer given.\n"); + return GNUNET_SYSERR; + } + if (NULL == pp_name) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No user given.\n"); + return GNUNET_SYSERR; + } + if (NULL == ctx) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No context given.\n"); + return GNUNET_SYSERR; + } + if (NULL == pp) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No public parameters given.\n"); + return GNUNET_SYSERR; + } + if (NULL == usr_ctx) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No user context given.\n"); + return GNUNET_SYSERR; + } + GNUNET_STRINGS_urlencode (pp_name, strlen (pp_name), &pp_filename); + + size_t fname_size = strlen (get_pabcdir ()) + 1 + strlen (usr_name) + 1 + + strlen (pp_filename) + strlen (PABC_USR_EXT) + 1; + fname = GNUNET_malloc (fname_size); + snprintf (fname, fname_size, "%s/%s_%s%s", get_pabcdir (), usr_name, + pp_filename, + PABC_USR_EXT); + GNUNET_free (pp_filename); + if (GNUNET_OK != read_file (fname, &json)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to read `%s'\n", fname); + PABC_FREE_NULL (fname); + return GNUNET_SYSERR; + } + GNUNET_free (fname); + + status = pabc_new_user_context (ctx, pp, usr_ctx); + if (PABC_OK != status) + { + GNUNET_free (json); + return GNUNET_SYSERR; + } + status = pabc_decode_user_ctx (ctx, pp, *usr_ctx, json); + GNUNET_free (json); + if (PABC_OK != status) + { + pabc_free_user_context (ctx, pp, usr_ctx); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to encode user context.\n"); + return GNUNET_SYSERR; + } + + return GNUNET_OK; +} diff --git a/src/reclaim/pabc_helper.h b/src/reclaim/pabc_helper.h new file mode 100644 index 000000000..045ad5dda --- /dev/null +++ b/src/reclaim/pabc_helper.h @@ -0,0 +1,41 @@ +#include "platform.h" +#include "gnunet_util_lib.h" +#include + +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + +#define PABC_ISK_EXT ".isk" + +#define PABC_PP_EXT ".pp" + +#define PABC_USR_EXT ".usr" + +#define PABC_ATTR_DELIM "=" + +enum GNUNET_GenericReturnValue +PABC_write_public_parameters (char const *const pp_name, + struct pabc_public_parameters *const pp); + + +enum GNUNET_GenericReturnValue +PABC_load_public_parameters (struct pabc_context *const ctx, + char const *const pp_name, + struct pabc_public_parameters **pp); + +enum GNUNET_GenericReturnValue +PABC_write_usr_ctx (char const *const user_name, + char const *const pp_name, + struct pabc_context const *const ctx, + struct pabc_public_parameters const *const + pp, + struct pabc_user_context *const usr_ctx); + +enum GNUNET_GenericReturnValue +PABC_read_usr_ctx (char const *const user_name, + char const *const pp_name, + struct pabc_context const *const ctx, + struct pabc_public_parameters const *const + pp, + struct pabc_user_context **usr_ctx); diff --git a/src/reclaim/plugin_reclaim_credential_jwt.c b/src/reclaim/plugin_reclaim_credential_jwt.c index aac0a6ea5..e5dc90363 100644 --- a/src/reclaim/plugin_reclaim_credential_jwt.c +++ b/src/reclaim/plugin_reclaim_credential_jwt.c @@ -158,11 +158,10 @@ jwt_parse_attributes (void *cls, struct GNUNET_RECLAIM_AttributeList *attrs; char delim[] = "."; char *val_str = NULL; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing JWT attributes.\n"); char *decoded_jwt; char *tmp; json_t *json_val; - json_error_t *json_err = NULL; + json_error_t json_err; attrs = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); @@ -173,7 +172,7 @@ jwt_parse_attributes (void *cls, (void **) &decoded_jwt); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded JWT: %s\n", decoded_jwt); GNUNET_assert (NULL != decoded_jwt); - json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, json_err); + json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err); GNUNET_free (decoded_jwt); const char *key; const char *addr_key; @@ -252,6 +251,8 @@ struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred) { + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT) + return NULL; return jwt_parse_attributes (cls, cred->data, cred->data_size); } @@ -267,6 +268,8 @@ struct GNUNET_RECLAIM_AttributeList * jwt_parse_attributes_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred) { + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT) + return NULL; return jwt_parse_attributes (cls, cred->data, cred->data_size); } @@ -291,14 +294,14 @@ jwt_get_issuer (void *cls, json_t *issuer_json; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing JWT attributes.\n"); json_t *json_val; - json_error_t *json_err = NULL; + json_error_t json_err; jwt_string = GNUNET_strndup (data, data_size); jwt_body = strtok (jwt_string, delim); jwt_body = strtok (NULL, delim); GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body), (void **) &decoded_jwt); - json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, json_err); + json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err); GNUNET_free (decoded_jwt); GNUNET_free (jwt_string); if (NULL == json_val) @@ -355,7 +358,7 @@ jwt_get_issuer_p (void *cls, * @param cred the jwt credential * @return a string, containing the isser */ -int +enum GNUNET_GenericReturnValue jwt_get_expiration (void *cls, const char *data, size_t data_size, @@ -368,14 +371,14 @@ jwt_get_expiration (void *cls, json_t *exp_json; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing JWT attributes.\n"); json_t *json_val; - json_error_t *json_err = NULL; + json_error_t json_err; jwt_string = GNUNET_strndup (data, data_size); jwt_body = strtok (jwt_string, delim); jwt_body = strtok (NULL, delim); GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body), (void **) &decoded_jwt); - json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, json_err); + json_val = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err); GNUNET_free (decoded_jwt); GNUNET_free (jwt_string); if (NULL == json_val) @@ -396,13 +399,15 @@ jwt_get_expiration (void *cls, * * @param cls the plugin * @param cred the jwt credential - * @return a string, containing the isser + * @return the expirati */ -int +enum GNUNET_GenericReturnValue jwt_get_expiration_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred, struct GNUNET_TIME_Absolute *exp) { + if (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT != cred->type) + return GNUNET_NO; return jwt_get_expiration (cls, cred->data, cred->data_size, exp); } @@ -414,22 +419,23 @@ jwt_get_expiration_c (void *cls, * @param cred the jwt credential * @return a string, containing the isser */ -int +enum GNUNET_GenericReturnValue jwt_get_expiration_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred, struct GNUNET_TIME_Absolute *exp) { + if (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT != cred->type) + return GNUNET_NO; return jwt_get_expiration (cls, cred->data, cred->data_size, exp); } -int +enum GNUNET_GenericReturnValue jwt_create_presentation (void *cls, const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **pres) { - // FIXME sanity checks?? if (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT != cred->type) return GNUNET_NO; *pres = GNUNET_RECLAIM_presentation_new (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT, diff --git a/src/reclaim/plugin_reclaim_credential_pabc.c b/src/reclaim/plugin_reclaim_credential_pabc.c new file mode 100644 index 000000000..2f6b7b8c4 --- /dev/null +++ b/src/reclaim/plugin_reclaim_credential_pabc.c @@ -0,0 +1,639 @@ +/* + This file is part of GNUnet + Copyright (C) 2013, 2014, 2016 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + SPDX-License-Identifier: AGPL3.0-or-later + */ + +/** + * @file reclaim/plugin_reclaim_credential_pabc.c + * @brief reclaim-credential-plugin-pabc attribute plugin to provide the API for + * pabc credentials. + * + * @author Martin Schanzenbach + */ +#include "platform.h" +#include "gnunet_util_lib.h" +#include "gnunet_reclaim_plugin.h" +#include +#include +#include +#include "pabc_helper.h" + +/** + * Convert the 'value' of an credential to a string. + * + * @param cls closure, unused + * @param type type of the credential + * @param data value in binary encoding + * @param data_size number of bytes in @a data + * @return NULL on error, otherwise human-readable representation of the value + */ +static char * +pabc_value_to_string (void *cls, + uint32_t type, + const void *data, + size_t data_size) +{ + switch (type) + { + case GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC: + return GNUNET_strndup (data, data_size); + + default: + return NULL; + } +} + + +/** + * Convert human-readable version of a 'value' of an credential to the binary + * representation. + * + * @param cls closure, unused + * @param type type of the credential + * @param s human-readable string + * @param data set to value in binary encoding (will be allocated) + * @param data_size set to number of bytes in @a data + * @return #GNUNET_OK on success + */ +static int +pabc_string_to_value (void *cls, + uint32_t type, + const char *s, + void **data, + size_t *data_size) +{ + if (NULL == s) + return GNUNET_SYSERR; + switch (type) + { + case GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC: + *data = GNUNET_strdup (s); + *data_size = strlen (s) + 1; + return GNUNET_OK; + + default: + return GNUNET_SYSERR; + } +} + + +/** + * Mapping of credential type numbers to human-readable + * credential type names. + */ +static struct +{ + const char *name; + uint32_t number; +} pabc_cred_name_map[] = { { "PABC", GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC }, + { NULL, UINT32_MAX } }; + +/** + * Convert a type name to the corresponding number. + * + * @param cls closure, unused + * @param pabc_typename name to convert + * @return corresponding number, UINT32_MAX on error + */ +static uint32_t +pabc_typename_to_number (void *cls, const char *pabc_typename) +{ + unsigned int i; + + i = 0; + while ((NULL != pabc_cred_name_map[i].name) && + (0 != strcasecmp (pabc_typename, pabc_cred_name_map[i].name))) + i++; + return pabc_cred_name_map[i].number; +} + + +/** + * Convert a type number (i.e. 1) to the corresponding type string + * + * @param cls closure, unused + * @param type number of a type to convert + * @return corresponding typestring, NULL on error + */ +static const char * +pabc_number_to_typename (void *cls, uint32_t type) +{ + unsigned int i; + + i = 0; + while ((NULL != pabc_cred_name_map[i].name) && (type != + pabc_cred_name_map[i]. + number)) + i++; + return pabc_cred_name_map[i].name; +} + + +static void +inspect_attrs (char const *const key, + char const *const value, + void *ctx) +{ + struct GNUNET_RECLAIM_AttributeList *attrs = ctx; + + if (NULL == value) + return; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Found attribue in PABC credential: `%s': `%s'\n", + key, value); + if (0 == strcmp (key, "expiration")) + return; + if (0 == strcmp (key, "issuer")) + return; + if (0 == strcmp (key, "subject")) + return; + GNUNET_RECLAIM_attribute_list_add (attrs, + key, + NULL, + GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING, + value, + strlen (value)); +} + + +/** + * Parse a pabc and return the respective claim value as Attribute + * + * @param cls the plugin + * @param cred the pabc credential + * @return a GNUNET_RECLAIM_Attribute, containing the new value + */ +struct GNUNET_RECLAIM_AttributeList * +pabc_parse_attributes (void *cls, + const char *data, + size_t data_size) +{ + struct GNUNET_RECLAIM_AttributeList *attrs; + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Collecting PABC attributes...\n"); + attrs = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); + GNUNET_assert (PABC_OK == + pabc_cred_inspect_credential (data, + &inspect_attrs, attrs)); + return attrs; +} + + +/** + * Parse a pabc and return the respective claim value as Attribute + * + * @param cls the plugin + * @param cred the pabc credential + * @return a GNUNET_RECLAIM_Attribute, containing the new value + */ +struct GNUNET_RECLAIM_AttributeList * +pabc_parse_attributes_c (void *cls, + const struct GNUNET_RECLAIM_Credential *cred) +{ + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC) + return NULL; + return pabc_parse_attributes (cls, cred->data, cred->data_size); +} + + +/** + * Parse a pabc and return the respective claim value as Attribute + * + * @param cls the plugin + * @param cred the pabc credential + * @return a GNUNET_RECLAIM_Attribute, containing the new value + */ +struct GNUNET_RECLAIM_AttributeList * +pabc_parse_attributes_p (void *cls, + const struct GNUNET_RECLAIM_Presentation *cred) +{ + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC) + return NULL; + return pabc_parse_attributes (cls, cred->data, cred->data_size); +} + +struct Finder +{ + const char* target; + char *result; +}; + +static void +find_attr (char const *const key, + char const *const value, + void *ctx) +{ + struct Finder *fdr = ctx; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Found `%s', looking for `%s'\n", + key, fdr->target); + if (0 == strcmp (key, fdr->target)) + fdr->result = GNUNET_strdup (value); +} + + + +/** + * Parse a pabc and return an attribute value. + * + * @param cls the plugin + * @param data the pabc credential data + * @param data_size the pabc credential size + * @param skey the attribute key to look for. + * @return a string, containing the isser + */ +char * +pabc_get_attribute (void *cls, + const char *data, + size_t data_size, + const char *skey) +{ + + struct Finder fdr; + memset (&fdr, 0, sizeof (fdr)); + fdr.target = skey; + pabc_cred_inspect_credential (data, &find_attr, &fdr); + return fdr.result; +} + + +/** + * Parse a pabc and return the issuer + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +char* +pabc_get_issuer (void *cls, + const char *data, + size_t data_size) +{ + char *res; + if (PABC_OK != pabc_cred_get_attr_by_name_from_cred (data, + "issuer", + &res)) + return NULL; + return res; +} + + +/** + * Parse a pabc and return the issuer + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +char* +pabc_get_issuer (void *cls, + const char *data, + size_t data_size) +{ + return pabc_get_attribute (cls, data, data_size, "issuer"); +} + + +/** + * Parse a pabc and return the issuer + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +char * +pabc_get_issuer_c (void *cls, + const struct GNUNET_RECLAIM_Credential *cred) +{ + if (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC != cred->type) + return NULL; + return pabc_get_issuer (cls, cred->data, cred->data_size); +} + + +/** + * Parse a pabc and return the issuer + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +char * +pabc_get_issuer_p (void *cls, + const struct GNUNET_RECLAIM_Presentation *cred) +{ + if (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC != cred->type) + return NULL; + return pabc_get_issuer (cls, cred->data, cred->data_size); +} + + +/** + * Parse a pabc and return the expiration + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +int +pabc_get_expiration (void *cls, + const char *data, + size_t data_size, + struct GNUNET_TIME_Absolute *exp) +{ + json_t *json_root; + json_t *json_attrs; + json_t *value; + json_t *exp_j; + json_error_t *json_err = NULL; + const char*key; + + json_root = json_loads (data, JSON_DECODE_ANY, json_err); + if ((NULL == json_root) || + (! json_is_object (json_root))) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to retrive expiration from credential\n"); + return GNUNET_SYSERR; + } + + if (1 != sscanf (exp_str, "%llu", &exp_i)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Invalid expiration `%s'\n", exp_str); + GNUNET_free (exp_str); + return GNUNET_SYSERR; + } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Converted expiration string `%s' to %llu", + exp_str, exp_i); + + GNUNET_free (exp_str); + exp->abs_value_us = exp_i * 1000 * 1000; + return GNUNET_OK; +} + + +/** + * Parse a pabc and return the expiration + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +enum GNUNET_GenericReturnValue +pabc_get_expiration_c (void *cls, + const struct GNUNET_RECLAIM_Credential *cred, + struct GNUNET_TIME_Absolute *exp) +{ + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC) + return GNUNET_NO; + return pabc_get_expiration (cls, cred->data, cred->data_size, exp); +} + + +/** + * Parse a pabc and return the expiration + * + * @param cls the plugin + * @param cred the pabc credential + * @return a string, containing the isser + */ +enum GNUNET_GenericReturnValue +pabc_get_expiration_p (void *cls, + const struct GNUNET_RECLAIM_Presentation *cred, + struct GNUNET_TIME_Absolute *exp) +{ + if (cred->type != GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC) + return GNUNET_NO; + return pabc_get_expiration (cls, cred->data, cred->data_size, exp); +} + + +int +pabc_create_presentation (void *cls, + const struct GNUNET_RECLAIM_Credential *credential, + const struct GNUNET_RECLAIM_AttributeList *attrs, + struct GNUNET_RECLAIM_Presentation **pres) +{ + struct pabc_context *ctx = NULL; + struct pabc_user_context *usr_ctx = NULL; + struct pabc_public_parameters *pp = NULL; + struct pabc_credential *cred = NULL; + struct pabc_blinded_proof *proof = NULL; + struct GNUNET_RECLAIM_AttributeListEntry *ale; + char *issuer; + char *subject; + enum pabc_status status; + + if (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC != credential->type) + return GNUNET_NO; + + + PABC_ASSERT (pabc_new_ctx (&ctx)); + issuer = pabc_get_issuer_c (cls, credential); + if (NULL == issuer) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "No issuer found in credential\n"); + pabc_free_ctx (&ctx); + return GNUNET_SYSERR; + } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Got issuer for credential: %s\n", issuer); + status = PABC_load_public_parameters (ctx, issuer, &pp); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to read public parameters.\n"); + pabc_free_ctx (&ctx); + GNUNET_free (issuer); + return GNUNET_SYSERR; + } + if (PABC_OK != pabc_cred_get_attr_by_name_from_cred (credential->data, + "subject", + &subject)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to get subject.\n"); + pabc_free_ctx (&ctx); + GNUNET_free (issuer); + return GNUNET_SYSERR; + } + status = PABC_read_usr_ctx (subject, issuer, ctx, pp, &usr_ctx); + GNUNET_free (issuer); + GNUNET_free (subject); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to read user context.\n"); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + + status = pabc_new_credential (ctx, pp, &cred); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to allocate credential.\n"); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + + status = pabc_decode_credential (ctx, pp, cred, credential->data); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to decode credential.\n"); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + + status = pabc_new_proof (ctx, pp, &proof); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to allocate proof.\n"); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + + // now we can parse the attributes to disclose and configure the proof + for (ale = attrs->list_head; NULL != ale; ale = ale->next) + { + status = pabc_set_disclosure_by_attribute_name (ctx, pp, proof, + ale->attribute->name, + PABC_DISCLOSED, cred); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to configure proof.\n"); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + } + + // and finally -> sign the proof + status = pabc_gen_proof (ctx, usr_ctx, pp, proof, cred); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to sign proof.\n"); + pabc_free_proof (ctx, pp, &proof); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + // print the result + char *json = NULL; + char *ppid = NULL; + char *userid = NULL; + GNUNET_assert (PABC_OK == pabc_cred_get_userid_from_cred (credential->data, + &userid)); + GNUNET_assert (PABC_OK == pabc_cred_get_ppid_from_cred (credential->data, + &ppid)); + pabc_cred_encode_proof (ctx, pp, proof, userid, ppid, &json); + GNUNET_free (ppid); + GNUNET_free (userid); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to serialize proof.\n"); + pabc_free_proof (ctx, pp, &proof); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_SYSERR; + } + char *json_enc; + GNUNET_STRINGS_base64_encode (json, + strlen (json) + 1, + &json_enc); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Presentation: %s\n", json_enc); + // clean up + *pres = GNUNET_RECLAIM_presentation_new (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, + json_enc, + strlen (json_enc) + 1); + GNUNET_free (json_enc); + PABC_FREE_NULL (json); + pabc_free_proof (ctx, pp, &proof); + pabc_free_credential (ctx, pp, &cred); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + return GNUNET_OK; +} + + +/** + * Entry point for the plugin. + * + * @param cls NULL + * @return the exported block API + */ +void * +libgnunet_plugin_reclaim_credential_pabc_init (void *cls) +{ + struct GNUNET_RECLAIM_CredentialPluginFunctions *api; + + api = GNUNET_new (struct GNUNET_RECLAIM_CredentialPluginFunctions); + api->value_to_string = &pabc_value_to_string; + api->string_to_value = &pabc_string_to_value; + api->typename_to_number = &pabc_typename_to_number; + api->number_to_typename = &pabc_number_to_typename; + api->get_attributes = &pabc_parse_attributes_c; + api->get_issuer = &pabc_get_issuer_c; + api->get_expiration = &pabc_get_expiration_c; + api->value_to_string_p = &pabc_value_to_string; + api->string_to_value_p = &pabc_string_to_value; + api->typename_to_number_p = &pabc_typename_to_number; + api->number_to_typename_p = &pabc_number_to_typename; + api->get_attributes_p = &pabc_parse_attributes_p; + api->get_issuer_p = &pabc_get_issuer_p; + api->get_expiration_p = &pabc_get_expiration_p; + api->create_presentation = &pabc_create_presentation; + return api; +} + + +/** + * Exit point from the plugin. + * + * @param cls the return value from #libgnunet_plugin_block_test_init() + * @return NULL + */ +void * +libgnunet_plugin_reclaim_credential_pabc_done (void *cls) +{ + struct GNUNET_RECLAIM_CredentialPluginFunctions *api = cls; + + GNUNET_free (api); + return NULL; +} + + +/* end of plugin_reclaim_credential_type_pabc.c */ diff --git a/src/reclaim/plugin_rest_pabc.c b/src/reclaim/plugin_rest_pabc.c new file mode 100644 index 000000000..6603fb888 --- /dev/null +++ b/src/reclaim/plugin_rest_pabc.c @@ -0,0 +1,666 @@ +/* + This file is part of GNUnet. + Copyright (C) 2012-2015 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + SPDX-License-Identifier: AGPL3.0-or-later + */ +/** + * @author Martin Schanzenbach + * @file reclaim/plugin_rest_pabc.c + * @brief GNUnet pabc REST plugin + * + */ +#include "platform.h" +#include "microhttpd.h" +#include +#include +#include +#include "gnunet_reclaim_lib.h" +#include "gnunet_reclaim_service.h" +#include "gnunet_rest_lib.h" +#include "gnunet_rest_plugin.h" +#include "gnunet_signatures.h" +#include "pabc_helper.h" + +/** + * REST root namespace + */ +#define GNUNET_REST_API_NS_PABC "/pabc" + +/** + * Credential request endpoint + */ +#define GNUNET_REST_API_NS_PABC_CR "/pabc/cr" + +/** + * The configuration handle + */ +const struct GNUNET_CONFIGURATION_Handle *cfg; + +/** + * HTTP methods allows for this plugin + */ +static char *allow_methods; + +/** + * @brief struct returned by the initialization function of the plugin + */ +struct Plugin +{ + const struct GNUNET_CONFIGURATION_Handle *cfg; +}; + + +struct RequestHandle +{ + /** + * DLL + */ + struct RequestHandle *next; + + /** + * DLL + */ + struct RequestHandle *prev; + + /** + * Rest connection + */ + struct GNUNET_REST_RequestHandle *rest_handle; + + /** + * Desired timeout for the lookup (default is no timeout). + */ + struct GNUNET_TIME_Relative timeout; + + /** + * ID of a task associated with the resolution process. + */ + struct GNUNET_SCHEDULER_Task *timeout_task; + + /** + * The plugin result processor + */ + GNUNET_REST_ResultProcessor proc; + + /** + * The closure of the result processor + */ + void *proc_cls; + + /** + * The url + */ + char *url; + + /** + * Error response message + */ + char *emsg; + + /** + * Reponse code + */ + int response_code; + + /** + * Response object + */ + json_t *resp_object; +}; + +/** + * DLL + */ +static struct RequestHandle *requests_head; + +/** + * DLL + */ +static struct RequestHandle *requests_tail; + + +/** + * Cleanup lookup handle + * @param handle Handle to clean up + */ +static void +cleanup_handle (void *cls) +{ + struct RequestHandle *handle = cls; + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cleaning up\n"); + if (NULL != handle->resp_object) + json_decref (handle->resp_object); + if (NULL != handle->timeout_task) + GNUNET_SCHEDULER_cancel (handle->timeout_task); + if (NULL != handle->url) + GNUNET_free (handle->url); + if (NULL != handle->emsg) + GNUNET_free (handle->emsg); + GNUNET_CONTAINER_DLL_remove (requests_head, + requests_tail, + handle); + GNUNET_free (handle); +} + + +/** + * Task run on error, sends error message. Cleans up everything. + * + * @param cls the `struct RequestHandle` + */ +static void +do_error (void *cls) +{ + struct RequestHandle *handle = cls; + struct MHD_Response *resp; + char *json_error; + + GNUNET_asprintf (&json_error, "{ \"error\" : \"%s\" }", handle->emsg); + if (0 == handle->response_code) + { + handle->response_code = MHD_HTTP_BAD_REQUEST; + } + resp = GNUNET_REST_create_response (json_error); + MHD_add_response_header (resp, "Content-Type", "application/json"); + handle->proc (handle->proc_cls, resp, handle->response_code); + cleanup_handle (handle); + GNUNET_free (json_error); +} + + +/** + * Task run on timeout, sends error message. Cleans up everything. + * + * @param cls the `struct RequestHandle` + */ +static void +do_timeout (void *cls) +{ + struct RequestHandle *handle = cls; + + handle->timeout_task = NULL; + do_error (handle); +} + + +static void +return_response (void *cls) +{ + char *result_str; + struct RequestHandle *handle = cls; + struct MHD_Response *resp; + + result_str = json_dumps (handle->resp_object, 0); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); + resp = GNUNET_REST_create_response (result_str); + MHD_add_response_header (resp, "Access-Control-Allow-Methods", allow_methods); + handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); + GNUNET_free (result_str); + cleanup_handle (handle); +} + + +static enum pabc_status +set_attributes_from_idtoken (const struct pabc_context *ctx, + const struct pabc_public_parameters *pp, + struct pabc_user_context *usr_ctx, + const char *id_token) +{ + json_t *payload_json; + json_t *value; + json_error_t json_err; + const char *key; + const char *jwt_body; + char *decoded_jwt; + char delim[] = "."; + char *jwt_string; + const char *pabc_key; + enum pabc_status status; + + // FIXME parse JWT + jwt_string = GNUNET_strndup (id_token, strlen (id_token)); + jwt_body = strtok (jwt_string, delim); + jwt_body = strtok (NULL, delim); + GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body), + (void **) &decoded_jwt); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded ID Token: %s\n", decoded_jwt); + payload_json = json_loads (decoded_jwt, JSON_DECODE_ANY, &json_err); + GNUNET_free (decoded_jwt); + + json_object_foreach (payload_json, key, value) + { + pabc_key = key; + if (0 == strcmp ("iss", key)) + pabc_key = "issuer"; // rename + if (0 == strcmp ("sub", key)) + pabc_key = "subject"; // rename + if (0 == strcmp ("jti", key)) + continue; + if (0 == strcmp ("exp", key)) + pabc_key = "expiration"; // rename + if (0 == strcmp ("iat", key)) + continue; + if (0 == strcmp ("nbf", key)) + continue; + if (0 == strcmp ("aud", key)) + continue; + char *tmp_val; + if (json_is_string (value)) + tmp_val = GNUNET_strdup (json_string_value (value)); + else + tmp_val = json_dumps (value, JSON_ENCODE_ANY); + if (NULL == tmp_val) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to encode JSON value for `%s'\n", key); + continue; + } + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Setting `%s' to `%s'\n", key, tmp_val); + status = pabc_set_attribute_value_by_name (ctx, pp, usr_ctx, + pabc_key, + tmp_val); + GNUNET_free (tmp_val); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Failed to set attribute `%s'.\n", key); + } + } + return PABC_OK; +} + + +static enum GNUNET_GenericReturnValue +setup_new_user_context (struct pabc_context *ctx, + struct pabc_public_parameters *pp, + struct pabc_user_context **usr_ctx) +{ + if (PABC_OK != pabc_new_user_context (ctx, pp, usr_ctx)) + return GNUNET_SYSERR; + + if (PABC_OK != pabc_populate_user_context (ctx, *usr_ctx)) + { + pabc_free_user_context (ctx, pp, usr_ctx); + return GNUNET_SYSERR; + } + return GNUNET_OK; +} + + +static void +cr_cont (struct GNUNET_REST_RequestHandle *con_handle, + const char *url, + void *cls) +{ + struct RequestHandle *handle = cls; + char term_data[handle->rest_handle->data_size + 1]; + char *response_str; + json_t *data_json; + json_t *nonce_json; + json_t *pp_json; + json_t *idtoken_json; + json_t *iss_json; + json_t *identity_json; + json_error_t err; + struct pabc_public_parameters *pp = NULL; + struct pabc_context *ctx = NULL; + struct pabc_user_context *usr_ctx = NULL; + struct pabc_credential_request *cr = NULL; + struct pabc_nonce *nonce = NULL; + enum pabc_status status; + + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Credential request...\n"); + + if (0 >= handle->rest_handle->data_size) + { + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + term_data[handle->rest_handle->data_size] = '\0'; + GNUNET_memcpy (term_data, + handle->rest_handle->data, + handle->rest_handle->data_size); + data_json = json_loads (term_data, JSON_DECODE_ANY, &err); + if (NULL == data_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse %s\n", term_data); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + if (! json_is_object (data_json)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse %s\n", term_data); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + nonce_json = json_object_get (data_json, "nonce"); + if (NULL == nonce_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse nonce\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + iss_json = json_object_get (data_json, "issuer"); + if (NULL == iss_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse issuer\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + identity_json = json_object_get (data_json, "identity"); + if (NULL == identity_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse identity\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + idtoken_json = json_object_get (data_json, "id_token"); + if (NULL == idtoken_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse id_token\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + pp_json = json_object_get (data_json, "public_params"); + if (NULL == pp_json) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Unable to parse public parameters\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + PABC_ASSERT (pabc_new_ctx (&ctx)); + char *pp_str = json_dumps (pp_json, JSON_ENCODE_ANY); + status = pabc_decode_and_new_public_parameters (ctx, + &pp, + pp_str); + char *ppid; + GNUNET_assert (PABC_OK == pabc_cred_get_ppid_from_pp (pp_str, &ppid)); + GNUNET_free (pp_str); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to read public parameters: %s\n", + pp_str); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + // (Over)write parameters + status = PABC_write_public_parameters (json_string_value (iss_json), + pp); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to write public parameters.\n"); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + status = PABC_read_usr_ctx (json_string_value (identity_json), + json_string_value (iss_json), + ctx, pp, &usr_ctx); + if (PABC_OK != status) + { + if (GNUNET_OK != setup_new_user_context (ctx, pp, &usr_ctx)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup user context.\n"); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + PABC_write_usr_ctx (json_string_value (identity_json), + json_string_value (iss_json), + ctx, pp, usr_ctx); + } + + // Set attributes from JWT to context + status = set_attributes_from_idtoken (ctx, + pp, + usr_ctx, + json_string_value (idtoken_json)); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to set attributes.\n"); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + + // nonce + status = pabc_new_nonce (ctx, &nonce); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to allocate nonce.\n"); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + char *nonce_str = json_dumps (nonce_json, JSON_ENCODE_ANY); + status = pabc_decode_nonce (ctx, nonce, nonce_str); + if (status != PABC_OK) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to decode nonce.\n"); + pabc_free_nonce (ctx, &nonce); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + // cr + status = pabc_new_credential_request (ctx, pp, &cr); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to allocate cr.\n"); + pabc_free_nonce (ctx, &nonce); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + + status = pabc_gen_credential_request (ctx, pp, usr_ctx, nonce, cr); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to generate cr.\n"); + pabc_free_nonce (ctx, &nonce); + pabc_free_credential_request (ctx, pp, &cr); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + handle->resp_object = json_object (); + GNUNET_assert (PABC_OK == pabc_cred_encode_cr (ctx, pp, cr, + json_string_value ( + identity_json), + ppid, &response_str)); + if (PABC_OK != status) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to serialize cr.\n"); + pabc_free_nonce (ctx, &nonce); + pabc_free_credential_request (ctx, pp, &cr); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + json_decref (data_json); + GNUNET_SCHEDULER_add_now (&do_error, handle); + return; + } + json_decref (handle->resp_object); + handle->resp_object = json_loads (response_str, JSON_DECODE_ANY, &err); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s\n", response_str); + GNUNET_free (response_str); + + // clean up + pabc_free_nonce (ctx, &nonce); + pabc_free_credential_request (ctx, pp, &cr); + pabc_free_user_context (ctx, pp, &usr_ctx); + pabc_free_public_parameters (ctx, &pp); + GNUNET_SCHEDULER_add_now (&return_response, handle); + json_decref (data_json); +} + + +/** + * Respond to OPTIONS request + * + * @param con_handle the connection handle + * @param url the url + * @param cls the RequestHandle + */ +static void +options_cont (struct GNUNET_REST_RequestHandle *con_handle, + const char *url, + void *cls) +{ + struct MHD_Response *resp; + struct RequestHandle *handle = cls; + + // For now, independent of path return all options + resp = GNUNET_REST_create_response (NULL); + MHD_add_response_header (resp, "Access-Control-Allow-Methods", allow_methods); + handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); + cleanup_handle (handle); + return; +} + + +static enum GNUNET_GenericReturnValue +rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, + GNUNET_REST_ResultProcessor proc, + void *proc_cls) +{ + struct RequestHandle *handle = GNUNET_new (struct RequestHandle); + struct GNUNET_REST_RequestHandlerError err; + static const struct GNUNET_REST_RequestHandler handlers[] = { + {MHD_HTTP_METHOD_POST, + GNUNET_REST_API_NS_PABC_CR, &cr_cont }, + { MHD_HTTP_METHOD_OPTIONS, GNUNET_REST_API_NS_PABC, &options_cont }, + GNUNET_REST_HANDLER_END + }; + + handle->response_code = 0; + handle->timeout = GNUNET_TIME_UNIT_FOREVER_REL; + handle->proc_cls = proc_cls; + handle->proc = proc; + handle->rest_handle = rest_handle; + + handle->url = GNUNET_strdup (rest_handle->url); + if (handle->url[strlen (handle->url) - 1] == '/') + handle->url[strlen (handle->url) - 1] = '\0'; + handle->timeout_task = + GNUNET_SCHEDULER_add_delayed (handle->timeout, &do_timeout, handle); + GNUNET_CONTAINER_DLL_insert (requests_head, + requests_tail, + handle); + if (GNUNET_NO == + GNUNET_REST_handle_request (handle->rest_handle, handlers, &err, handle)) + { + cleanup_handle (handle); + return GNUNET_NO; + } + + return GNUNET_YES; +} + + +/** + * Entry point for the plugin. + * + * @param cls Config info + * @return NULL on error, otherwise the plugin context + */ +void * +libgnunet_plugin_rest_pabc_init (void *cls) +{ + static struct Plugin plugin; + struct GNUNET_REST_Plugin *api; + + cfg = cls; + if (NULL != plugin.cfg) + return NULL; /* can only initialize once! */ + memset (&plugin, 0, sizeof(struct Plugin)); + plugin.cfg = cfg; + api = GNUNET_new (struct GNUNET_REST_Plugin); + api->cls = &plugin; + api->name = GNUNET_REST_API_NS_PABC; + api->process_request = &rest_identity_process_request; + GNUNET_asprintf (&allow_methods, + "%s, %s", + MHD_HTTP_METHOD_POST, + MHD_HTTP_METHOD_OPTIONS); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + _ ("Identity Provider REST API initialized\n")); + return api; +} + + +/** + * Exit point from the plugin. + * + * @param cls the plugin context (as returned by "init") + * @return always NULL + */ +void * +libgnunet_plugin_rest_reclaim_done (void *cls) +{ + struct GNUNET_REST_Plugin *api = cls; + struct Plugin *plugin = api->cls; + struct RequestHandle *request; + + plugin->cfg = NULL; + while (NULL != (request = requests_head)) + do_error (request); + + GNUNET_free (allow_methods); + GNUNET_free (api); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "PABC REST plugin is finished\n"); + return NULL; +} + + +/* end of plugin_rest_reclaim.c */ diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c index c8c0d397c..da5cee988 100644 --- a/src/reclaim/reclaim_credential.c +++ b/src/reclaim/reclaim_credential.c @@ -1033,7 +1033,6 @@ GNUNET_RECLAIM_presentation_get_expiration (const struct /** * Create a presentation from a credential and a lift of (selected) * attributes in the credential. - * FIXME not yet implemented * * @param cred the credential to use * @param attrs the attributes to present from the credential -- cgit v1.2.3 From 8233e282046e27de57de75f175e131a974087618 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sat, 24 Apr 2021 17:29:42 +0200 Subject: Swap gnunet-config's default behaviour for the rewrite flag With the previous default, a configuration file could keep values different from the defaults even when the user did not explicitly edit that option, potentially leading to buggy behaviour. For example: GNUnet's version X+1 changes the default value for a certain option A, but anyone who has edited the configuration file with version X or earlier, would still have got the old default for A even when updating to version X+1. It was possible to write only the edited parts, but that required explicitly passing the `--rewrite' (or `-w') flag. The default behaviour has now been swapped so that the resulting file contains only differences, while a "frozen" configuration is generated with the `--rewrite' flag. Also, as it's a minor change: a function used internally by the logging component was using translated strings to check the requested log level. This behaviour is buggy as passing an untranslated string to e.g. `GNUNET_log_setup', while the current locale is different and a translation for that string exists, would generate a different log level than the one requested. --- contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd | 3 --- contrib/packages/alpine/gnunet/gnunet.xsession | 1 - debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services | 1 - debian/gnunet.postinst | 3 --- doc/man/gnunet-config.1 | 6 +++--- src/util/common_logging.c | 16 ++++++++-------- src/util/gnunet-config.c | 11 ++++++----- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd index 3c5a22ee2..2a4dcc1c4 100644 --- a/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd +++ b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd @@ -21,12 +21,10 @@ start() { # Customize gnunet.conf port=$((8000+$(id -u $user))) gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ --section=gns-proxy \ --option=IMMEDIATE_START \ --value=YES gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ --section=gns-proxy \ --option=OPTIONS \ --value="-p $port" @@ -79,7 +77,6 @@ stop() { # Disable gns-proxy in config gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ --section=gns-proxy \ --option=IMMEDIATE_START \ --value=NO diff --git a/contrib/packages/alpine/gnunet/gnunet.xsession b/contrib/packages/alpine/gnunet/gnunet.xsession index 944d47a27..dead5c783 100644 --- a/contrib/packages/alpine/gnunet/gnunet.xsession +++ b/contrib/packages/alpine/gnunet/gnunet.xsession @@ -10,7 +10,6 @@ if [ "$gnunet_proxy" ]; then port=$((8000+$(id -u $user))) gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ --section=gns-proxy \ --option=OPTIONS \ --value="-p $port" diff --git a/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services b/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services index aff1dd78c..d780b0e8e 100644 --- a/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services +++ b/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services @@ -9,7 +9,6 @@ if [ "$gnunet_proxy" ]; then port=$((8000+$(id -u "$user"))) gnunet-config -c "$HOME/.config/gnunet.conf" \ - --rewrite \ --section=gns-proxy \ --option=OPTIONS \ --value="-p $port" diff --git a/debian/gnunet.postinst b/debian/gnunet.postinst index 07e5202e8..b6317f5be 100644 --- a/debian/gnunet.postinst +++ b/debian/gnunet.postinst @@ -149,12 +149,10 @@ EOF fi port=$((8000+$(id -u "${users[$i]}"))) gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ - --rewrite \ --section=gns-proxy \ --option=IMMEDIATE_START \ --value=YES gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ - --rewrite \ --section=gns-proxy \ --option=OPTIONS \ --value="-p $port" @@ -180,7 +178,6 @@ if [ "$gnunet_proxy" ]; then port=$((8000+$(id -u $user))) gnunet-config -c $HOME/.config/gnunet.conf \ - --rewrite \ --section=gns-proxy \ --option=OPTIONS \ --value="-p $port" diff --git a/doc/man/gnunet-config.1 b/doc/man/gnunet-config.1 index f6166cbca..89bc3d14b 100644 --- a/doc/man/gnunet-config.1 +++ b/doc/man/gnunet-config.1 @@ -39,7 +39,7 @@ .Op Fl s Ar SECTION | Fl -section= Ns Ar SECTION .Op Fl V Ar VALUE | Fl -value Ar VALUE .Op Fl v | -version -.Op Fl W | -rewrite +.Op Fl w | -rewrite .Sh DESCRIPTION .Nm can be used to read or modify GNUnet configuration files. @@ -69,8 +69,8 @@ Configuration value to store in the given section under the given option. Must only be given together with -s and -o options. .It Fl v | -version Print GNUnet version number. -.It Fl W | -rewrite -Consider differences to defaults only. +.It Fl w | -rewrite +Write to file the full configuration, including default values, instead of just the differences. .El .Sh SEE ALSO The full documentation for gnunet is maintained as a Texinfo manual. diff --git a/src/util/common_logging.c b/src/util/common_logging.c index b30175543..48cc6fe3b 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -246,27 +246,27 @@ static int gnunet_force_log_present; /** * Convert a textual description of a loglevel - * to the respective GNUNET_GE_KIND. + * to the respective enumeration type. * * @param log loglevel to parse - * @return GNUNET_GE_INVALID if log does not parse + * @return GNUNET_ERROR_TYPE_INVALID if log does not parse */ static enum GNUNET_ErrorType get_type (const char *log) { if (NULL == log) return GNUNET_ERROR_TYPE_UNSPECIFIED; - if (0 == strcasecmp (log, _ ("DEBUG"))) + if (0 == strcasecmp (log, "DEBUG")) return GNUNET_ERROR_TYPE_DEBUG; - if (0 == strcasecmp (log, _ ("INFO"))) + if (0 == strcasecmp (log, "INFO")) return GNUNET_ERROR_TYPE_INFO; - if (0 == strcasecmp (log, _ ("MESSAGE"))) + if (0 == strcasecmp (log, "MESSAGE")) return GNUNET_ERROR_TYPE_MESSAGE; - if (0 == strcasecmp (log, _ ("WARNING"))) + if (0 == strcasecmp (log, "WARNING")) return GNUNET_ERROR_TYPE_WARNING; - if (0 == strcasecmp (log, _ ("ERROR"))) + if (0 == strcasecmp (log, "ERROR")) return GNUNET_ERROR_TYPE_ERROR; - if (0 == strcasecmp (log, _ ("NONE"))) + if (0 == strcasecmp (log, "NONE")) return GNUNET_ERROR_TYPE_NONE; return GNUNET_ERROR_TYPE_INVALID; } diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 2b279dda2..4d050cdd3 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c @@ -65,10 +65,11 @@ static int list_sections; static int global_ret; /** - * Should we generate a configuration file that is clean and - * only contains the deltas to the defaults? + * Should the generated configuration file contain the whole configuration, or + * just the differences with the defaults? + * If set to a non-zero value, the full configuration will be written to file. */ -static int rewrite; +static int rewrite = 0; /** @@ -157,7 +158,7 @@ run (void *cls, GNUNET_free (name); return; } - if (rewrite) + if (!rewrite) { struct GNUNET_CONFIGURATION_Handle *def; @@ -315,7 +316,7 @@ main (int argc, char *const *argv) 'w', "rewrite", gettext_noop ( - "write configuration file that only contains delta to defaults"), + "write the full configuration file, including default values"), &rewrite), GNUNET_GETOPT_OPTION_END }; int ret; -- cgit v1.2.3 From b996ba4156678b6a0a551b9a932867b2ade42344 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sat, 24 Apr 2021 17:30:45 +0200 Subject: -Fix several incorrect uses of `i.e.' With some other changes to sentences here and there as I found appropriate. --- README.1st | 2 +- doc/handbook/chapters/developer.texi | 53 +++++++++++----------- doc/handbook/chapters/installation.texi | 19 ++++---- doc/handbook/chapters/user.texi | 14 +++--- doc/man/gnunet-config.1 | 2 +- doc/man/gnunet-datastore.1 | 2 +- doc/man/gnunet-namestore.1 | 2 +- src/abd/plugin_gnsrecord_abd.c | 4 +- src/conversation/plugin_gnsrecord_conversation.c | 4 +- src/curl/curl.c | 4 +- src/datacache/datacache.c | 4 +- src/datastore/gnunet-service-datastore.c | 4 +- src/dht/dht_api.c | 2 +- src/dht/gnunet-service-dht_clients.c | 2 +- src/fragmentation/test_fragmentation.c | 2 +- src/fragmentation/test_fragmentation_parallel.c | 2 +- src/fs/fs_directory.c | 2 +- src/fs/fs_download.c | 2 +- src/fs/fs_sharetree.c | 2 +- src/fs/fs_uri.c | 2 +- src/fs/gnunet-helper-fs-publish.c | 2 +- src/fs/gnunet-search.c | 2 +- src/fs/perf_gnunet_service_fs_p2p_respect.c | 2 +- src/gns/gns_tld_api.c | 2 +- src/gns/gnunet-gns-import.c | 13 +++--- src/gns/gnunet-gns-proxy-ca.template | 4 +- src/gns/gnunet-gns-proxy.c | 4 +- src/gns/gnunet-service-gns.c | 2 +- src/gns/gnunet-service-gns_resolver.c | 4 +- src/gns/plugin_gnsrecord_gns.c | 4 +- src/gnsrecord/gnsrecord.c | 4 +- src/gnsrecord/plugin_gnsrecord_dns.c | 4 +- src/hostlist/gnunet-daemon-hostlist_server.c | 4 +- src/identity/gnunet-identity.c | 13 +++--- src/include/gnunet_ats_service.h | 6 +-- src/include/gnunet_ats_transport_service.h | 2 +- src/include/gnunet_client_lib.h | 2 +- src/include/gnunet_container_lib.h | 8 ++-- src/include/gnunet_crypto_lib.h | 4 +- src/include/gnunet_curl_lib.h | 2 +- src/include/gnunet_dht_service.h | 2 +- src/include/gnunet_getopt_lib.h | 2 +- src/include/gnunet_gnsrecord_lib.h | 4 +- src/include/gnunet_gnsrecord_plugin.h | 6 +-- src/include/gnunet_identity_service.h | 15 +++--- src/include/gnunet_mq_lib.h | 8 ++-- src/include/gnunet_network_lib.h | 2 +- src/include/gnunet_reclaim_plugin.h | 12 ++--- src/include/gnunet_strings_lib.h | 8 ++-- src/include/gnunet_testbed_service.h | 6 +-- src/include/gnunet_time_lib.h | 2 +- .../gnunet_transport_communication_service.h | 6 +-- src/include/gnunet_transport_plugin.h | 2 +- src/include/gnunet_tun_lib.h | 4 +- src/namestore/gnunet-namestore-fcfsd.c | 15 +++--- src/namestore/gnunet-zoneimport.c | 13 +++--- src/peerinfo-tool/gnunet-peerinfo_plugins.c | 4 +- src/pt/test_gns_vpn.c | 13 +++--- src/reclaim/plugin_gnsrecord_reclaim.c | 4 +- src/reclaim/plugin_reclaim_attribute_basic.c | 2 +- src/reclaim/plugin_reclaim_credential_jwt.c | 2 +- src/reclaim/plugin_rest_openid_connect.c | 13 +++--- src/reclaim/plugin_rest_reclaim.c | 13 +++--- src/rest/gnunet-rest-server.c | 2 +- src/testbed/testbed_api.c | 2 +- src/testbed/testbed_api_test.c | 2 +- src/testbed/testbed_api_testbed.c | 2 +- src/testing/testing.c | 2 +- src/transport/gnunet-helper-transport-bluetooth.c | 2 +- src/transport/gnunet-helper-transport-wlan.c | 2 +- src/transport/gnunet-service-transport_plugins.c | 4 +- src/util/client.c | 2 +- src/util/container_meta_data.c | 4 +- src/util/crypto_rsa.c | 2 +- src/util/network.c | 2 +- src/util/scheduler.c | 2 +- src/util/strings.c | 8 ++-- src/util/tun.c | 4 +- 78 files changed, 205 insertions(+), 213 deletions(-) diff --git a/README.1st b/README.1st index c25992351..073357466 100644 --- a/README.1st +++ b/README.1st @@ -13,7 +13,7 @@ impact are given with each item. ats: * We currently select one transport per peer, but we should allow the -use of multiple channels concurrently (i.e. UDP + TCP at the same +use of multiple channels concurrently (e.g. UDP + TCP at the same time). Neither ATS nor transport support this today, and this requires a major change in the ATS plugins and the ATS API and the overall ATS/transport logic. [6-12 PM, robustness, performance] diff --git a/doc/handbook/chapters/developer.texi b/doc/handbook/chapters/developer.texi index e7b88a39f..1bf7a7b24 100644 --- a/doc/handbook/chapters/developer.texi +++ b/doc/handbook/chapters/developer.texi @@ -392,9 +392,9 @@ etc.). @item @file{transport/} --- transport service The transport service is responsible for managing the basic P2P communication. It uses plugins to support P2P communication -over TCP, UDP, HTTP, HTTPS and other protocols.The transport service +over TCP, UDP, HTTP, HTTPS and other protocols. The transport service validates peer addresses, enforces bandwidth restrictions, limits the -total number of connections and enforces connectivity restrictions (i.e. +total number of connections and enforces connectivity restrictions (e.g. friends-only). @item @file{peerinfo-tool/} --- gnunet-peerinfo This directory contains the gnunet-peerinfo binary which can be used to @@ -746,21 +746,21 @@ Here you can find some rules to help you write code for GNUnet. @itemize @bullet @item services and daemons use their directory name in -@code{GNUNET_log_setup} (i.e. 'core') and log using +@code{GNUNET_log_setup} (e.g. 'core') and log using plain 'GNUNET_log'. @item command-line tools use their full name in -@code{GNUNET_log_setup} (i.e. 'gnunet-publish') and log using +@code{GNUNET_log_setup} (e.g. 'gnunet-publish') and log using plain 'GNUNET_log'. @item service access libraries log using '@code{GNUNET_log_from}' and use '@code{DIRNAME-api}' for the -component (i.e. 'core-api') +component (e.g. 'core-api') @item pure libraries (without associated service) use '@code{GNUNET_log_from}' with the component set to their library name (without lib or '@file{.so}'), -which should also be their directory name (i.e. '@file{nat}') +which should also be their directory name (e.g. '@file{nat}') @item plugins should use '@code{GNUNET_log_from}' with the directory name and the plugin name combined to produce -the component name (i.e. 'transport-tcp'). +the component name (e.g. 'transport-tcp'). @item logging should be unified per-file by defining a @code{LOG} macro with the appropriate arguments, along these lines: @@ -832,14 +832,14 @@ test @subsubsection src/ directories @itemize @bullet -@item gnunet-NAME: end-user applications (i.e., gnunet-search, gnunet-arm) -@item gnunet-service-NAME: service processes with accessor library (i.e., +@item gnunet-NAME: end-user applications (like gnunet-search or gnunet-arm) +@item gnunet-service-NAME: service processes with accessor library (e.g. gnunet-service-arm) @item libgnunetNAME: accessor library (_service.h-header) or standalone library (_lib.h-header) -@item gnunet-daemon-NAME: daemon process without accessor library (i.e., +@item gnunet-daemon-NAME: daemon process without accessor library (e.g. gnunet-daemon-hostlist) and no GNUnet management port -@item libgnunet_plugin_DIR_NAME: loadable plugins (i.e., +@item libgnunet_plugin_DIR_NAME: loadable plugins (e.g. libgnunet_plugin_transport_tcp) @end itemize @@ -6640,7 +6640,7 @@ The size of an element's data is limited to around 62 KB. Sets created by a local client can be modified and reused for multiple operations. As each set operation requires potentially expensive special auxiliary data to be computed for each element of a set, a set can only -participate in one type of set operation (i.e. union or intersection). +participate in one type of set operation (either union or intersection). The type of a set is determined upon its creation. If a the elements of a set are needed for an operation of a different type, all of the set's element must be copied to a new set of appropriate @@ -9030,14 +9030,13 @@ particular key has been revoked. The service responds with a @code{QueryResponseMessage} which simply contains a bit that says if the given public key is still valid, or if it has been revoked. -The second possible interaction is for a client to revoke a key by -passing a @code{RevokeMessage} to the service. The @code{RevokeMessage} -contains the ECDSA public key to be revoked, a signature by the -corresponding private key and the proof-of-work, The service responds -with a @code{RevocationResponseMessage} which can be used to indicate -that the @code{RevokeMessage} was invalid (i.e. proof of work incorrect), -or otherwise indicates that the revocation has been processed -successfully. +The second possible interaction is for a client to revoke a key by passing a +@code{RevokeMessage} to the service. The @code{RevokeMessage} contains the +ECDSA public key to be revoked, a signature by the corresponding private key +and the proof-of-work. The service responds with a +@code{RevocationResponseMessage} which can be used to indicate that the +@code{RevokeMessage} was invalid (e.g. the proof of work is incorrect), or +otherwise to indicate that the revocation has been processed successfully. @node The REVOCATION Peer-to-Peer Protocol @subsection The REVOCATION Peer-to-Peer Protocol @@ -9615,9 +9614,9 @@ In order to address the above issues, we want to: TRANSPORT shall create bi-directional channels from this whenever possible. @item DV should no longer be a plugin, but part of TRANSPORT. -@item TRANSPORT should provide communicators help communicating (i.e. in the - case of uni-directional communicators or the need for out-of-band - signalling for NAT traversal). We call this functionality +@item TRANSPORT should provide communicators help communicating, for example + in the case of uni-directional communicators or the need for out-of-band + signalling for NAT traversal. We call this functionality @emph{backchannels}. @item Transport manipulation should be signalled to CORE on a per-message basis instead of an approximate bandwidth. @@ -9715,8 +9714,8 @@ by layer. For example, CADET will always strictly implement reliable and in-order delivery of messages, while the same options are only advisory for TRANSPORT and CORE: they should try (using ACKs on unreliable communicators, not changing the message order themselves), but if messages are lost anyway -(i.e. because a TCP is dropped in the middle), or if messages are reordered -(i.e. because they took dierent paths over the network and arrived in a +(e.g. because a TCP is dropped in the middle), or if messages are reordered +(e.g. because they took different paths over the network and arrived in a different order) TRANSPORT and CORE do not have to correct this. Whether a preference is strict or loose is thus dened by the respective layer. @@ -9728,8 +9727,8 @@ The API for communicators is defined in Each communicator must specify its (global) communication characteristics, which for now only say whether the communication is reliable (e.g. TCP, HTTPS) or unreliable (e.g. UDP, WLAN). Each communicator must specify a unique address -prex, or NULL if the communicator cannot establish outgoing connections (i.e. -is only acting as a TCP server). +prex, or NULL if the communicator cannot establish outgoing connections +(for example because it is only acting as a TCP server). A communicator must tell TRANSPORT which addresses it is reachable under. Addresses may be added or removed at any time. A communicator may have zero addresses (transmission only). diff --git a/doc/handbook/chapters/installation.texi b/doc/handbook/chapters/installation.texi index ad939b5b7..24431e20f 100644 --- a/doc/handbook/chapters/installation.texi +++ b/doc/handbook/chapters/installation.texi @@ -1355,7 +1355,7 @@ The interface channel depends on the wlan network that the card is connected to. If no connection has been made since the start of the computer, it is usually the first channel of the card. Peers will only find each other and communicate if they are on the same -channel. Channels must be set manually, i.e. using: +channel. Channels must be set manually, e.g. by using: @example iwconfig wlan0 channel 1 @@ -1944,12 +1944,13 @@ Python installation and its dependencies. Another way to install Ascension on Debian is to install the python3-ascension package. It can be found within the above mentioned Ascension git repository. -This also adds a system user ascension and runs a GNUnet peer in the -background. Attention: This only works if a recent version of GNUnet is +This also adds a system user called ascension and runs a GNUnet peer in the +background. Please note: This only works if a recent version of GNUnet is installed on your system. The version number of Ascension is chosen according -to the required feature level of GNUnet. I.e. Ascension 0.11.5 is only -compatible with GNUnet 0.11.5 and upwards. As Debian's packages for GNUnet are -outdated even in experimental, you will need to install GNUnet manually +to the required feature level of GNUnet: Ascension 0.11.5 is only +compatible with GNUnet 0.11.5 or later and so on. +As Debian's packages for GNUnet are outdated even in experimental, +you will need to install GNUnet manually @xref{Installing GNUnet}. Please check @xref{Migrating an existing DNS zone into GNS}, for usage manual @@ -2034,11 +2035,11 @@ Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet. Being a DNS exit is usually pretty harmless. However, enabling IPv4 or IPv6-exit without further precautions may enable adversaries to access your local network, send spam, attack other systems from your Internet -connection and to other mischief that will appear to come from your +connection and do other mischiefs that will appear to come from your machine. This may or may not get you into legal trouble. If you want to allow IPv4 or IPv6-exit functionality, you should strongly consider adding additional firewall rules manually to protect your local -network and to restrict outgoing TCP traffic (i.e. by not allowing access +network and to restrict outgoing TCP traffic (e.g. by not allowing access to port 25). While we plan to improve exit-filtering in the future, you're currently on your own here. Essentially, be prepared for any kind of IP-traffic to exit the respective @@ -2159,7 +2160,7 @@ run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it modifies the system configuration). As always, gnunet-setup should be run after the GNUnet peer was stopped using "gnunet-arm -e". Distributors might want to include a wrapper for gnunet-setup that allows the -desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account +desktop-user to "sudo" (e.g. using gtksudo) to the "gnunet" user account and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in sequence. diff --git a/doc/handbook/chapters/user.texi b/doc/handbook/chapters/user.texi index 911d23526..409a89e47 100644 --- a/doc/handbook/chapters/user.texi +++ b/doc/handbook/chapters/user.texi @@ -71,7 +71,7 @@ $ gnunet-arm -e ``.pin'' is a default zone which points to a zone managed by gnunet.org. Use @code{gnunet-config -s gns} to view the GNS configuration, including all configured zones that are operated by other users. The respective -configuration entry names start with a ``.'', i.e. ``.pin''. +configuration entry names start with a ``.'', e.g. ``.pin''. You can configure any number of top-level domains, and point them to the respective zones of your friends! For this, simply obtain the @@ -1620,7 +1620,7 @@ under "*.friend.gnu". BOX records are there to integrate information from TLSA or SRV records under the main label. In DNS, TLSA and SRV records use special names of the form @code{_port._proto.(label.)*tld} to -indicate the port number and protocol (i.e. tcp or udp) for which +indicate the port number and protocol (like TCP or UDP) for which the TLSA or SRV record is valid. This causes various problems, and is elegantly solved in GNS by integrating the protocol and port numbers together with the respective value into a "BOX" record. @@ -1700,7 +1700,7 @@ be useful if you do not want to start resolution in the DNS root zone (due to issues such as censorship or availability). Note that you would typically want to use a relative name for the -nameserver, i.e. +nameserver, like so: @example Name: pet; RRType: GNS2DNS; Value: gnunet.org@@ns-joker.+@ @@ -2244,7 +2244,7 @@ that subnet to the GNUnet exit's TUN interface. When running a local service, you should make sure that the local service is (also) bound to the IP address of your EXIT interface -(i.e. 169.254.86.1). It will NOT work if your local service is +(e.g. 169.254.86.1). It will NOT work if your local service is just bound to loopback. You may also want to create a "VPN" record in your zone of the GNU Name System to make it easy for others to access your service via a name instead of just the full service @@ -2315,7 +2315,7 @@ and restart your peer, your Internet traffic should be tunneled over the GNUnet VPN. The GNUnet VPN uses DNS-ALG to hijack your IP traffic. Whenever an -application resolves a hostname (i.e. 'gnunet.org'), the +application resolves a hostname (like 'gnunet.org'), the "gnunet-daemon-pt" will instruct the "gnunet-service-dns" to intercept the request (possibly route it over GNUnet as well) and replace the normal answer with an IP in the range of the VPN's interface. @@ -2325,8 +2325,8 @@ destination. For applications that do not use DNS, you can also manually create such a mapping using the gnunet-vpn command-line tool. Here, you -specify the desired address family of the result (i.e. "-4"), and the -intended target IP on the Internet ("-i 131.159.74.67") and +specify the desired address family of the result (e.g. "-4"), and the +intended target IP on the Internet (e.g. "-i 131.159.74.67") and "gnunet-vpn" will tell you which IP address in the range of your VPN tunnel was mapped. diff --git a/doc/man/gnunet-config.1 b/doc/man/gnunet-config.1 index 89bc3d14b..3d243af89 100644 --- a/doc/man/gnunet-config.1 +++ b/doc/man/gnunet-config.1 @@ -45,7 +45,7 @@ can be used to read or modify GNUnet configuration files. .Bl -tag -width indent .It Fl b Ar BACKEND | Fl -supported-backend= Ns Ar BACKEND -Tests whether the specified BACKEND is supported by the current installation. The backend must match the name of a plugin, i.e. "namestore_postgres" for the Postgres database backend of the "NAMESTORE" service. If the BACKEND is supported, gnunet-config will return a status code of 0 (success), otherwise 77 (unsupported). When this option is specified, no other options may be specified. Specifying this option together with other options will cause gnunet-config to return a status code of 1 (error). +Tests whether the specified BACKEND is supported by the current installation. The backend must match the name of a plugin, e.g. "namestore_postgres" for the Postgres database backend of the "NAMESTORE" service. If the BACKEND is supported, gnunet-config will return a status code of 0 (success), otherwise 77 (unsupported). When this option is specified, no other options may be specified. Specifying this option together with other options will cause gnunet-config to return a status code of 1 (error). .It Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME Use the configuration file FILENAME. .It Fl f | -filename diff --git a/doc/man/gnunet-datastore.1 b/doc/man/gnunet-datastore.1 index 81347dcae..842ba62a0 100644 --- a/doc/man/gnunet-datastore.1 +++ b/doc/man/gnunet-datastore.1 @@ -41,7 +41,7 @@ .Nm can be used to backup and restore or merge GNUnet datastores. This is useful if a datastore is to be migrated between -SQL databases, i.e. from sqlite to postgres or vice versa. +SQL databases, e.g. from sqlite to postgres or vice versa. gnunet-datastore will dump the entire contents of the database or insert a dump file into the database. .Bl -tag -width indent diff --git a/doc/man/gnunet-namestore.1 b/doc/man/gnunet-namestore.1 index b9bbff027..73bbe5a5c 100644 --- a/doc/man/gnunet-namestore.1 +++ b/doc/man/gnunet-namestore.1 @@ -109,7 +109,7 @@ Create a record that is a shadow record. Shadow records are only used once all other records of the same type under the same label have expired. .It Fl t Ar TYPE | Fl -type= Ns Ar TYPE -Type of the record to add/delete/display (i.e. "A", "AAAA", "NS", "PKEY", "MX" etc.). +Type of the record to add/delete/display ("A"; "AAAA"; "NS"; "PKEY"; "MX"; etc.). .It Fl u Ar URI | Fl -uri= Ns Ar URI Add PKEY record from gnunet://gns/-URI to our zone; the record type is always PKEY, if no expiration is given FOREVER is used diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c index 272872e24..25dc20152 100644 --- a/src/abd/plugin_gnsrecord_abd.c +++ b/src/abd/plugin_gnsrecord_abd.c @@ -276,7 +276,7 @@ static struct /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param cls closure, unused * @param gns_typename name to convert @@ -296,7 +296,7 @@ abd_typename_to_number (void *cls, const char *gns_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/conversation/plugin_gnsrecord_conversation.c b/src/conversation/plugin_gnsrecord_conversation.c index 2ea2f48f0..786711c8e 100644 --- a/src/conversation/plugin_gnsrecord_conversation.c +++ b/src/conversation/plugin_gnsrecord_conversation.c @@ -179,7 +179,7 @@ static struct /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param cls closure, unused * @param gns_typename name to convert @@ -201,7 +201,7 @@ conversation_typename_to_number (void *cls, /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/curl/curl.c b/src/curl/curl.c index deb14a926..949b9a1b0 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -697,7 +697,7 @@ GNUNET_CURL_job_cancel (struct GNUNET_CURL_Job *job) /** * Test if the given content type @a ct is JSON * - * @param ct a content type, i.e. "application/json; charset=UTF-8" + * @param ct a content type, e.g. "application/json; charset=UTF-8" * @return true if @a ct denotes JSON */ static bool @@ -741,7 +741,7 @@ is_json (const char *ct) * @param db download buffer * @param eh CURL handle (to get the response code) * @param[out] response_code set to the HTTP response code - * (or zero if we aborted the download, i.e. + * (or zero if we aborted the download, for example * because the response was too big, or if * the JSON we received was malformed). * @return NULL if downloading a JSON reply failed. diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c index 5fc5a7481..331a9b784 100644 --- a/src/datacache/datacache.c +++ b/src/datacache/datacache.c @@ -66,12 +66,12 @@ struct GNUNET_DATACACHE_Handle struct GNUNET_DATACACHE_PluginFunctions *api; /** - * Short name for the plugin (i.e. "sqlite"). + * Short name for the plugin (e.g. "sqlite"). */ char *short_name; /** - * Name of the library (i.e. "gnunet_plugin_datacache_sqlite"). + * Name of the library (e.g. "gnunet_plugin_datacache_sqlite"). */ char *lib_name; diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 1c9e5e463..97888ce03 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -84,12 +84,12 @@ struct DatastorePlugin struct GNUNET_DATASTORE_PluginFunctions *api; /** - * Short name for the plugin (i.e. "sqlite"). + * Short name for the plugin (e.g. "sqlite"). */ char *short_name; /** - * Name of the library (i.e. "gnunet_plugin_datastore_sqlite"). + * Name of the library (e.g. "gnunet_plugin_datastore_sqlite"). */ char *lib_name; diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index ffcfba997..96399cb5a 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -1026,7 +1026,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, * has not yet been sent to the service, cancelling the PUT will stop * this from happening (but there is no way for the user of this API * to tell if that is the case). The only use for this API is to - * prevent a later call to 'cont' from #GNUNET_DHT_put (i.e. because + * prevent a later call to 'cont' from #GNUNET_DHT_put (e.g. because * the system is shutting down). * * @param ph put operation to cancel ('cont' will no longer be called) diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index dfa8ee380..cfcb25336 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c @@ -1482,7 +1482,7 @@ GDS_CLIENTS_stop () /** * Define "main" method using service macro. * - * @param name name of the service, i.e. "dht" or "xdht" + * @param name name of the service, like "dht" or "xdht" * @param run name of the initializaton method for the service */ #define GDS_DHT_SERVICE_INIT(name, run) \ diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c index 4c71e0195..77879f75b 100644 --- a/src/fragmentation/test_fragmentation.c +++ b/src/fragmentation/test_fragmentation.c @@ -108,7 +108,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) if (0 == (total % (NUM_MSGS / 100))) fprintf (stderr, "%s", "."); #endif - /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ + /* tolerate 10% loss, e.g. due to duplicate fragment IDs */ if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) { if (NULL == shutdown_task) diff --git a/src/fragmentation/test_fragmentation_parallel.c b/src/fragmentation/test_fragmentation_parallel.c index 000ca60d2..d19296cf5 100644 --- a/src/fragmentation/test_fragmentation_parallel.c +++ b/src/fragmentation/test_fragmentation_parallel.c @@ -100,7 +100,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) if (0 == (total % (NUM_MSGS / 100))) fprintf (stderr, "%s", "."); #endif - /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ + /* tolerate 10% loss, e.g due to duplicate fragment IDs */ if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) { if (NULL == shutdown_task) diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index 9a198d8d7..9f0f12611 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c @@ -120,7 +120,7 @@ struct GetFullDataClosure * * @param cls closure (user-defined) * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index d4677b794..1f8ce7c05 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -586,7 +586,7 @@ try_match_block (struct GNUNET_FS_DownloadContext *dc, * * @param cls our 'struct GNUNET_FS_DownloadContext*' * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c index ac850076d..d5e75f9be 100644 --- a/src/fs/fs_sharetree.c +++ b/src/fs/fs_sharetree.c @@ -183,7 +183,7 @@ add_to_keyword_counter (void *cls, const char *keyword, int is_mandatory) * * @param cls the container multihashmap to update * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index a9afff3e8..4d1b7c6f0 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -1691,7 +1691,7 @@ get_keywords_from_tokens (const char *s, char **array, int index) * * @param cls URI to update * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 5d2d1229b..ef1a9ce4b 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c @@ -100,7 +100,7 @@ static int output_stream; * * @param cls closure, our meta data container * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index e49609b18..3bf013650 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -64,7 +64,7 @@ static struct GNUNET_SCHEDULER_Task *tt; * * @param cls closure (user-defined, unused) * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index b7fe61be7..c48db2383 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c @@ -21,7 +21,7 @@ /** * @file fs/perf_gnunet_service_fs_p2p_respect.c * @brief profile P2P routing respect mechanism. Creates - * a clique of NUM_DAEMONS (i.e. 3) where two + * a clique of NUM_DAEMONS (at least 3) where two * peers share (seed) different files and download * them from each other while all the other peers * just "leach" those files. Ideally, the seeders diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c index b883662ad..1b711cf40 100644 --- a/src/gns/gns_tld_api.c +++ b/src/gns/gns_tld_api.c @@ -235,7 +235,7 @@ identity_zone_cb (void *cls, * @param options local options for the lookup * @param proc processor to call on result * @param proc_cls closure for @a proc - * @return handle to the get request, NULL on error (i.e. bad configuration) + * @return handle to the get request, NULL on error (e.g. bad configuration) */ struct GNUNET_GNS_LookupWithTldRequest * GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c index 972fb49cd..e99c4d3dd 100644 --- a/src/gns/gnunet-gns-import.c +++ b/src/gns/gnunet-gns-import.c @@ -272,13 +272,12 @@ zone_iteration_finished (void *cls) * with 'NULL' for 'ego'. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', - * this function is only called ONCE, and 'NULL' being passed in - * 'ego' does indicate an error (i.e. name is taken or no default - * value is known). If 'ego' is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of 'GNUNET_IDENTITY_connect' (if - * that one was not NULL). + * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', this + * function is only called ONCE, and 'NULL' being passed in 'ego' does + * indicate an error (for example because name is taken or no default value is + * known). If 'ego' is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * 'GNUNET_IDENTITY_connect' (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) ego but the NEW identifier. diff --git a/src/gns/gnunet-gns-proxy-ca.template b/src/gns/gnunet-gns-proxy-ca.template index 32ee27fcd..541e3a355 100644 --- a/src/gns/gnunet-gns-proxy-ca.template +++ b/src/gns/gnunet-gns-proxy-ca.template @@ -51,7 +51,7 @@ cn = "GNS Proxy CA" #dn = "cn = Nikos,st = New\, Something,C=GR,surName=Mavrogiannopoulos,2.5.4.9=Arkadias" # The serial number of the certificate -# The value is in decimal (i.e. 1963) or hex (i.e. 0x07ab). +# The value is in decimal (e.g. 1963) or hex (e.g. 0x07ab). # Comment the field for a random serial number. #serial = 007 @@ -283,7 +283,7 @@ tls_www_server #crl_next_update = 43 # this is the 5th CRL by this CA -# The value is in decimal (i.e. 1963) or hex (i.e. 0x07ab). +# The value is in decimal (e.g. 1963) or hex (e.g. 0x07ab). # Comment the field for a time-based number. # Time-based CRL numbers generated in GnuTLS 3.6.3 and later # are significantly larger than those generated in previous diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index d02f0f576..5e3f9d6df 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -1811,7 +1811,7 @@ con_val_iter (void *cls, * @param con MHD connection handle * @param url the url in the request * @param meth the HTTP method used ("GET", "PUT", etc.) - * @param ver the HTTP version string (i.e. "HTTP/1.1") + * @param ver the HTTP version string ("HTTP/1.1" for version 1.1, etc.) * @param upload_data the data being uploaded (excluding HEADERS, * for a POST that fits into memory and that is encoded * with a supported encoding, the POST data will NOT be @@ -2855,7 +2855,7 @@ lookup_ssl_httpd (const char*domain) /** * Task run when a Socks5Request somehow fails to be associated with - * an MHD connection (i.e. because the client never speaks HTTP after + * an MHD connection (e.g. because the client never speaks HTTP after * the SOCKS5 handshake). Clean up. * * @param cls the `struct Socks5Request *` diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 52300ae3b..5833f4d0b 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -104,7 +104,7 @@ struct GnsClient /** * Representation of a TLD, mapping the respective TLD string - * (i.e. ".gnu") to the respective public key of the zone. + * (e.g. ".gnu") to the respective public key of the zone. */ struct GNS_TopLevelDomain { diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 2f8a55804..784a6ee6d 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -418,7 +418,7 @@ struct GNS_ResolverHandle /** * We increment the loop limiter for each step in a recursive - * resolution. If it passes our @e loop_threshold (i.e. due to + * resolution. If it passes our @e loop_threshold (e.g. due to * self-recursion in the resolution, i.e CNAME fun), we stop. */ unsigned int loop_limiter; @@ -516,7 +516,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; /** * Determine if this name is canonical (is a legal name in a zone, without delegation); * note that we do not test that the name does not contain illegal characters, we only - * test for delegation. Note that service records (i.e. _foo._srv) are canonical names + * test for delegation. Note that service records (like _foo._srv) are canonical names * even though they consist of multiple labels. * * Examples: diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c index a2ad0b905..391144925 100644 --- a/src/gns/plugin_gnsrecord_gns.c +++ b/src/gns/plugin_gnsrecord_gns.c @@ -327,7 +327,7 @@ static struct /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param cls closure, unused * @param gns_typename name to convert @@ -347,7 +347,7 @@ gns_typename_to_number (void *cls, const char *gns_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index 31749a629..e9994a868 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -208,7 +208,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type, /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g "AAAA") to the corresponding number. * * @param dns_typename name to convert * @return corresponding number, UINT32_MAX on error @@ -235,7 +235,7 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param type number of a type to convert * @return corresponding typestring, NULL on error diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c index bde9944e2..123c59905 100644 --- a/src/gnsrecord/plugin_gnsrecord_dns.c +++ b/src/gnsrecord/plugin_gnsrecord_dns.c @@ -735,7 +735,7 @@ static struct /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param cls closure, unused * @param dns_typename name to convert @@ -755,7 +755,7 @@ dns_typename_to_number (void *cls, const char *dns_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c index b6c0495c0..fb80f6331 100644 --- a/src/hostlist/gnunet-daemon-hostlist_server.c +++ b/src/hostlist/gnunet-daemon-hostlist_server.c @@ -320,7 +320,7 @@ accept_policy_callback (void *cls, * @param url the requested url * @param method the HTTP method used (#MHD_HTTP_METHOD_GET, * #MHD_HTTP_METHOD_PUT, etc.) - * @param version the HTTP version string (i.e. + * @param version the HTTP version string (e.g. * #MHD_HTTP_VERSION_1_1) * @param upload_data the data being uploaded (excluding HEADERS, * for a POST that fits into memory and that is encoded @@ -335,7 +335,7 @@ accept_policy_callback (void *cls, * @param con_cls pointer that the callback can set to some * address and that will be preserved by MHD for future * calls for this request; since the access handler may - * be called many times (i.e., for a PUT/POST operation + * be called many times (e.g. for a PUT/POST operation * with plenty of upload data) this allows the application * to easily associate some request-specific state. * If necessary, this state can be cleaned up in the diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index a01cd1ed7..d8dc936d3 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c @@ -268,13 +268,12 @@ set_done (void *cls, const char *emsg) * with 'NULL' for 'ego'. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', - * this function is only called ONCE, and 'NULL' being passed in - * 'ego' does indicate an error (i.e. name is taken or no default - * value is known). If 'ego' is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of 'GNUNET_IDENTITY_connect' (if - * that one was not NULL). + * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', this + * function is only called ONCE, and 'NULL' being passed in 'ego' does + * indicate an error (for example because name is taken or no default value is + * known). If 'ego' is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * 'GNUNET_IDENTITY_connect' (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) ego but the NEW identifier. diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 92572c72b..68ba8e6b2 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h @@ -94,7 +94,7 @@ struct GNUNET_ATS_Properties /** * Distance on network layer (required for distance-vector routing) - * in hops. Zero for direct connections (i.e. plain TCP/UDP). + * in hops. Zero for direct connections (e.g. plain TCP/UDP). */ unsigned int distance; @@ -136,7 +136,7 @@ struct GNUNET_ATS_PropertiesNBO /** * Distance on network layer (required for distance-vector routing) - * in hops. Zero for direct connections (i.e. plain TCP/UDP). + * in hops. Zero for direct connections (e.g. plain TCP/UDP). */ uint32_t distance GNUNET_PACKED; @@ -308,7 +308,7 @@ struct GNUNET_ATS_AddressRecord; * * @param sh handle * @param address the address - * @param session session handle (if available, i.e. for incoming connections) + * @param session session handle (if available, e.g for incoming connections) * @param prop performance data for the address * @return handle to the address representation inside ATS, NULL * on error (i.e. ATS knows this exact address already, or diff --git a/src/include/gnunet_ats_transport_service.h b/src/include/gnunet_ats_transport_service.h index b5848a36a..fd821baef 100644 --- a/src/include/gnunet_ats_transport_service.h +++ b/src/include/gnunet_ats_transport_service.h @@ -85,7 +85,7 @@ struct GNUNET_ATS_Properties /** * Distance on network layer (required for distance-vector routing) - * in hops. Zero for direct connections (i.e. plain TCP/UDP). + * in hops. Zero for direct connections (e.g. plain TCP/UDP). */ uint32_t distance; diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index aaa1f4a74..2ecd38b04 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h @@ -56,7 +56,7 @@ extern "C" * #GNUNET_NO if the service is (definitively) down, * #GNUNET_SYSERR if the configuration does not give us * the necessary information about the service, or if - * we could not check (i.e. socket() failed) + * we could not check (e.g. socket() failed) */ int GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg, diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 0d81abfd3..c8930746d 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h @@ -161,7 +161,7 @@ enum EXTRACTOR_MetaFormat * * @param cls closure (user-defined) * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data @@ -484,7 +484,7 @@ GNUNET_CONTAINER_meta_data_test_equal ( * * @param md metadata to extend * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data @@ -693,7 +693,7 @@ GNUNET_CONTAINER_meta_data_get_serialized_size ( * * @param input serialized meta-data. * @param size number of bytes available - * @return MD on success, NULL on error (i.e. + * @return MD on success, NULL on error (e.g. * bad format) */ struct GNUNET_CONTAINER_MetaData * @@ -2441,7 +2441,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( * Insertion sort of @a element into DLL from @a head to @a tail * sorted by @a comparator. * - * @param TYPE element type of the elements, i.e. `struct ListElement` + * @param TYPE element type of the elements, e.g. `struct ListElement` * @param comparator function like memcmp() to compare elements; takes * three arguments, the @a comparator_cls and two elements, * returns an `int` (-1, 0 or 1) diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 2a552e212..43cdfdfac 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -945,7 +945,7 @@ GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code, /** * @ingroup hash * Determine how many low order bits match in two - * `struct GNUNET_HashCodes`. i.e. - 010011 and 011111 share + * `struct GNUNET_HashCodes`. e.g. - 010011 and 011111 share * the first two lowest order bits, and therefore the * return value is two (NOT XOR distance, nor how many * bits match absolutely!). @@ -2048,7 +2048,7 @@ struct GNUNET_CRYPTO_RsaSignature; /** * Create a new private key. Caller must free return value. * - * @param len length of the key in bits (i.e. 2048) + * @param len length of the key in bits (e.g. 2048) * @return fresh private key */ struct GNUNET_CRYPTO_RsaPrivateKey * diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index f291d6b14..f51e4b503 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -68,7 +68,7 @@ struct GNUNET_CURL_DownloadBuffer /** * Error code (based on libc errno) if we failed to download - * (i.e. response too large). + * (e.g. response too large). */ int eno; }; diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index ea3ea92fa..95d30ae6f 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h @@ -178,7 +178,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, * has not yet been sent to the service, cancelling the PUT will stop * this from happening (but there is no way for the user of this API * to tell if that is the case). The only use for this API is to - * prevent a later call to 'cont' from #GNUNET_DHT_put (i.e. because + * prevent a later call to 'cont' from #GNUNET_DHT_put (e.g. because * the system is shutting down). * * @param ph put operation to cancel ('cont' will no longer be called) diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index b37827ccc..731be4159 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h @@ -83,7 +83,7 @@ struct GNUNET_GETOPT_CommandLineProcessorContext * * @param ctx context for all options * @param scls specific closure (for this processor) - * @param option long name of the option (i.e. "config" for --config) + * @param option long name of the option (e.g. "config" for --config) * @param value argument, NULL if none was given * @return #GNUNET_OK to continue processing other options, #GNUNET_SYSERR to abort */ diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index aff56146e..61cbac2ca 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h @@ -308,7 +308,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data, /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param dns_typename name to convert * @return corresponding number, UINT32_MAX on error @@ -318,7 +318,7 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename); /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param type number of a type to convert * @return corresponding typestring, NULL on error diff --git a/src/include/gnunet_gnsrecord_plugin.h b/src/include/gnunet_gnsrecord_plugin.h index 1435bc4b3..aec22c3af 100644 --- a/src/include/gnunet_gnsrecord_plugin.h +++ b/src/include/gnunet_gnsrecord_plugin.h @@ -81,7 +81,7 @@ typedef int /** - * Function called to convert a type name (i.e. "AAAA") to the + * Function called to convert a type name (e.g. "AAAA") to the * corresponding number. * * @param cls closure @@ -94,8 +94,8 @@ typedef uint32_t /** - * Function called to convert a type number (i.e. 1) to the - * corresponding type string (i.e. "A") + * Function called to convert a type number to the + * corresponding type string (e.g. 1 to "A") * * @param cls closure * @param type number of a type to convert diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 2974568db..c123983e2 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h @@ -210,13 +210,12 @@ GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego, * with 'NULL' for @a ego. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, - * this function is only called ONCE, and 'NULL' being passed in - * @a ego does indicate an error (i.e. name is taken or no default - * value is known). If @a ego is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of #GNUNET_IDENTITY_connect (if - * that one was not NULL). + * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, this + * function is only called ONCE, and 'NULL' being passed in @a ego does + * indicate an error (for example because name is taken or no default value is + * known). If @a ego is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * #GNUNET_IDENTITY_connect (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) @a ego but the NEW @a name. @@ -768,7 +767,7 @@ struct GNUNET_IDENTITY_EgoSuffixLookup; /** * Obtain the ego with the maximum suffix match between the - * ego's name and the given domain name @a suffix. I.e., given + * ego's name and the given domain name @a suffix. For example, given * a @a suffix "a.b.c" and egos with names "d.a.b.c", "b.c" and "c", * we return the ego for "b.c". * diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 710664fe7..37bba8c1b 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -227,23 +227,23 @@ enum GNUNET_MQ_Error enum GNUNET_MQ_PriorityPreferences { /** - * Lowest priority, i.e. background traffic (i.e. NSE, FS). + * Lowest priority, i.e. background traffic (e.g. NSE, FS). * This is the default! */ GNUNET_MQ_PRIO_BACKGROUND = 0, /** - * Best-effort traffic (i.e. CADET relay, DHT) + * Best-effort traffic (e.g. CADET relay, DHT) */ GNUNET_MQ_PRIO_BEST_EFFORT = 1, /** - * Urgent traffic (local peer, i.e. Conversation). + * Urgent traffic (local peer, e.g. Conversation). */ GNUNET_MQ_PRIO_URGENT = 2, /** - * Highest priority, control traffic (i.e. CORE/CADET KX). + * Highest priority, control traffic (e.g. CORE/CADET KX). */ GNUNET_MQ_PRIO_CRITICAL_CONTROL = 3, diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index e40dacde7..97ab64add 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -561,7 +561,7 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); /** * Test if the given @a port is available. * - * @param ipproto transport protocol to test (i.e. IPPROTO_TCP) + * @param ipproto transport protocol to test (e.g. IPPROTO_TCP) * @param port port number to test * @return #GNUNET_OK if the port is available, #GNUNET_NO if not */ diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h index 2ba8fc8a0..11d5d76f7 100644 --- a/src/include/gnunet_reclaim_plugin.h +++ b/src/include/gnunet_reclaim_plugin.h @@ -92,8 +92,8 @@ typedef uint32_t (*GNUNET_RECLAIM_AttributeTypenameToNumberFunction) ( /** - * Function called to convert a type number (i.e. 1) to the - * corresponding type string + * Function called to convert a type number to the + * corresponding type string (e.g. 1 to "A") * * @param cls closure * @param type number of a type to convert @@ -154,8 +154,8 @@ typedef uint32_t (*GNUNET_RECLAIM_CredentialTypenameToNumberFunction) ( /** - * Function called to convert a type number (i.e. 1) to the - * corresponding type string + * Function called to convert a type number to the + * corresponding type string (e.g. 1 to "A") * * @param cls closure * @param type number of a type to convert @@ -253,8 +253,8 @@ typedef uint32_t (*GNUNET_RECLAIM_PresentationTypenameToNumberFunction) ( /** - * Function called to convert a type number (i.e. 1) to the - * corresponding type string + * Function called to convert a type number to the + * corresponding type string (e.g. 1 to "A") * * @param cls closure * @param type number of a type to convert diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index cc655d0b0..955a3afca 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h @@ -59,7 +59,7 @@ extern "C" /** * Convert a given fancy human-readable size to bytes. * - * @param fancy_size human readable string (i.e. 1 MB) + * @param fancy_size human readable string (e.g. 1 MB) * @param size set to the size in bytes * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -72,7 +72,7 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, * Convert a given fancy human-readable time to our internal * representation. * - * @param fancy_time human readable string (i.e. 1 minute) + * @param fancy_time human readable string (e.g. 1 minute) * @param rtime set to the relative time * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -87,7 +87,7 @@ GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time, * representation. The human-readable time is expected to be * in local time, whereas the returned value will be in UTC. * - * @param fancy_time human readable string (i.e. %Y-%m-%d %H:%M:%S) + * @param fancy_time human readable string (e.g. %Y-%m-%d %H:%M:%S) * @param atime set to the absolute time * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -548,7 +548,7 @@ GNUNET_STRINGS_to_address_ipv4 (const char *zt_addr, * `struct sockaddr`. * * @param addr the address - * @param[out] af set to the parsed address family (i.e. AF_INET) + * @param[out] af set to the parsed address family (e.g. AF_INET) * @param[out] sa set to the parsed address * @return 0 on error, otherwise number of bytes in @a sa */ diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index acdfb2034..acb444de4 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h @@ -485,7 +485,7 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) | ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) | ...") * @param cc controller callback to invoke on events * @param cc_cls closure for cc * @return handle to the controller @@ -1415,7 +1415,7 @@ typedef void * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * @param cc controller callback to invoke on events; This callback is called * for all peer start events even if GNUNET_TESTBED_ET_PEER_START isn't * set in the event_mask as this is the only way get access to the @@ -1463,7 +1463,7 @@ GNUNET_TESTBED_run (const char *host_filename, * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * @param cc controller callback to invoke on events; This callback is called * for all peer start events even if #GNUNET_TESTBED_ET_PEER_START isn't * set in the event_mask as this is the only way get access to the diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index 38c372f23..b9e87fcbe 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h @@ -558,7 +558,7 @@ GNUNET_TIME_get_offset (void); /** - * Return the current year (i.e. '2011'). + * Return the current year (e.g. '2011'). */ unsigned int GNUNET_TIME_get_current_year (void); diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h index af2e36b4d..81a382fb2 100644 --- a/src/include/gnunet_transport_communication_service.h +++ b/src/include/gnunet_transport_communication_service.h @@ -94,17 +94,17 @@ struct GNUNET_TRANSPORT_CommunicatorHandle; enum GNUNET_TRANSPORT_CommunicatorCharacteristics { /** - * Characteristics are unknown (i.e. DV). + * Characteristics are unknown (e.g. DV). */ GNUNET_TRANSPORT_CC_UNKNOWN = 0, /** - * Transmission is reliabile (with ACKs), i.e. TCP/HTTP/HTTPS. + * Transmission is reliabile (with ACKs), e.g. TCP/HTTP/HTTPS. */ GNUNET_TRANSPORT_CC_RELIABLE = 1, /** - * Transmission is unreliable (i.e. UDP) + * Transmission is unreliable (e.g. UDP) */ GNUNET_TRANSPORT_CC_UNRELIABLE = 2 }; diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index 01b10f75c..3e6d1edc6 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h @@ -49,7 +49,7 @@ * connections to a given peer. Typically used by stateful plugins to * allow the service to refer to specific streams instead of a more * general notion of "some connection" to the given peer. This is - * useful since sometimes (i.e. for inbound TCP connections) a + * useful since sometimes (e.g. for inbound TCP connections) a * connection may not have an address that can be used for meaningful * distinction between sessions to the same peer. * diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index 0af9a1d3e..61880cea1 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h @@ -746,7 +746,7 @@ GNUNET_NETWORK_STRUCT_END * Initialize an IPv4 header. * * @param ip header to initialize - * @param protocol protocol to use (i.e. IPPROTO_UDP) + * @param protocol protocol to use (e.g. IPPROTO_UDP) * @param payload_length number of bytes of payload that follow (excluding IPv4 * header) * @param src source IP address to use @@ -764,7 +764,7 @@ GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip, * Initialize an IPv6 header. * * @param ip header to initialize - * @param protocol protocol to use (i.e. IPPROTO_UDP) + * @param protocol protocol to use (e.g. IPPROTO_UDP) * @param payload_length number of bytes of payload that follow (excluding IPv4 * header) * @param src source IP address to use diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index 22d108067..6d794746e 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c @@ -751,7 +751,7 @@ lookup_it_finished (void *cls) * @param connection MHD connection handle * @param url the requested url * @param method the HTTP method used ("GET", "PUT", etc.) - * @param version the HTTP version string (i.e. "HTTP/1.1") + * @param version the HTTP version string ("HTTP/1.1" for version 1.1, etc.) * @param upload_data the data being uploaded (excluding HEADERS, * for a POST that fits into memory and that is encoded * with a supported encoding, the POST data will NOT be @@ -1057,13 +1057,12 @@ do_shutdown (void *cls) /** * Method called to inform about the egos of this peer. * - * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, - * this function is only called ONCE, and 'NULL' being passed in - * @a ego does indicate an error (i.e. name is taken or no default - * value is known). If @a ego is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of #GNUNET_IDENTITY_connect (if - * that one was not NULL). + * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, this + * function is only called ONCE, and 'NULL' being passed in @a ego does + * indicate an error (for example because name is taken or no default value is + * known). If @a ego is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * #GNUNET_IDENTITY_connect (if that one was not NULL). * * @param cls closure, NULL * @param ego ego handle diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index ce62b52d5..68b43a016 100644 --- a/src/namestore/gnunet-zoneimport.c +++ b/src/namestore/gnunet-zoneimport.c @@ -1713,13 +1713,12 @@ process_stdin (void *cls) * with 'NULL' for @a ego. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, - * this function is only called ONCE, and 'NULL' being passed in - * @a ego does indicate an error (i.e. name is taken or no default - * value is known). If @a ego is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of #GNUNET_IDENTITY_connect (if - * that one was not NULL). + * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, this + * function is only called ONCE, and 'NULL' being passed in @a ego does + * indicate an error (for example because name is taken or no default value is + * known). If @a ego is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * #GNUNET_IDENTITY_connect (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) @a ego but the NEW @a name. diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c index 901ded014..e196ec58a 100644 --- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c +++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c @@ -50,12 +50,12 @@ struct TransportPlugin struct GNUNET_TRANSPORT_PluginFunctions *api; /** - * Short name for the plugin (i.e. "tcp"). + * Short name for the plugin (e.g. "tcp"). */ char *short_name; /** - * Name of the library (i.e. "gnunet_plugin_transport_tcp"). + * Name of the library (e.g. "gnunet_plugin_transport_tcp"). */ char *lib_name; diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index 7b4abaec2..e20d835f8 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c @@ -530,13 +530,12 @@ fork_and_exec (const char *file, * with 'NULL' for @a ego. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, - * this function is only called ONCE, and 'NULL' being passed in - * @a ego does indicate an error (i.e. name is taken or no default - * value is known). If @a ego is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of #GNUNET_IDENTITY_connect (if - * that one was not NULL). + * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, this + * function is only called ONCE, and 'NULL' being passed in @a ego does + * indicate an error (for example because name is taken or no default value is + * known). If @a ego is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * #GNUNET_IDENTITY_connect (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) @a ego but the NEW @a name. diff --git a/src/reclaim/plugin_gnsrecord_reclaim.c b/src/reclaim/plugin_gnsrecord_reclaim.c index 9e4f0a5c4..ce6fe483d 100644 --- a/src/reclaim/plugin_gnsrecord_reclaim.c +++ b/src/reclaim/plugin_gnsrecord_reclaim.c @@ -118,7 +118,7 @@ static struct /** - * Convert a type name (i.e. "AAAA") to the corresponding number. + * Convert a type name (e.g. "AAAA") to the corresponding number. * * @param cls closure, unused * @param dns_typename name to convert @@ -138,7 +138,7 @@ typename_to_number (void *cls, const char *dns_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A") + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/reclaim/plugin_reclaim_attribute_basic.c b/src/reclaim/plugin_reclaim_attribute_basic.c index c87922886..66f59998a 100644 --- a/src/reclaim/plugin_reclaim_attribute_basic.c +++ b/src/reclaim/plugin_reclaim_attribute_basic.c @@ -124,7 +124,7 @@ basic_typename_to_number (void *cls, const char *basic_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/reclaim/plugin_reclaim_credential_jwt.c b/src/reclaim/plugin_reclaim_credential_jwt.c index e5dc90363..fb01903aa 100644 --- a/src/reclaim/plugin_reclaim_credential_jwt.c +++ b/src/reclaim/plugin_reclaim_credential_jwt.c @@ -122,7 +122,7 @@ jwt_typename_to_number (void *cls, const char *jwt_typename) /** - * Convert a type number (i.e. 1) to the corresponding type string + * Convert a type number to the corresponding type string (e.g. 1 to "A") * * @param cls closure, unused * @param type number of a type to convert diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index c6259d745..fef79fb10 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c @@ -2478,13 +2478,12 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle, * with 'NULL' for 'ego'. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', - * this function is only called ONCE, and 'NULL' being passed in - * 'ego' does indicate an error (i.e. name is taken or no default - * value is known). If 'ego' is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of 'GNUNET_IDENTITY_connect' (if - * that one was not NULL). + * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', this + * function is only called ONCE, and 'NULL' being passed in 'ego' does + * indicate an error (for example because name is taken or no default value is + * known). If 'ego' is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * 'GNUNET_IDENTITY_connect' (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) ego but the NEW identifier. diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index 39d24ea61..1d1231cbd 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -1332,13 +1332,12 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle, * with 'NULL' for 'ego'. That does NOT mean that the callback won't * be invoked in the future or that there was an error. * - * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', - * this function is only called ONCE, and 'NULL' being passed in - * 'ego' does indicate an error (i.e. name is taken or no default - * value is known). If 'ego' is non-NULL and if '*ctx' - * is set in those callbacks, the value WILL be passed to a subsequent - * call to the identity callback of 'GNUNET_IDENTITY_connect' (if - * that one was not NULL). + * When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', this + * function is only called ONCE, and 'NULL' being passed in 'ego' does + * indicate an error (for example because name is taken or no default value is + * known). If 'ego' is non-NULL and if '*ctx' is set in those callbacks, the + * value WILL be passed to a subsequent call to the identity callback of + * 'GNUNET_IDENTITY_connect' (if that one was not NULL). * * When an identity is renamed, this function is called with the * (known) ego but the NEW identifier. diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index ecb3e2ae5..63847587b 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c @@ -436,7 +436,7 @@ post_data_iter (void *cls, * @param con MHD connection handle * @param url the url in the request * @param meth the HTTP method used ("GET", "PUT", etc.) - * @param ver the HTTP version string (i.e. "HTTP/1.1") + * @param ver the HTTP version string ("HTTP/1.1" for version 1.1, etc.) * @param upload_data the data being uploaded (excluding HEADERS, * for a POST that fits into memory and that is encoded * with a supported encoding, the POST data will NOT be diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index f291892c6..386850b89 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c @@ -1546,7 +1546,7 @@ mq_error_handler (void *cls, enum GNUNET_MQ_Error error) * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) | ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) | ...") * @param cc controller callback to invoke on events * @param cc_cls closure for cc * @return handle to the controller diff --git a/src/testbed/testbed_api_test.c b/src/testbed/testbed_api_test.c index 30dbe455d..dd43cf2f6 100644 --- a/src/testbed/testbed_api_test.c +++ b/src/testbed/testbed_api_test.c @@ -109,7 +109,7 @@ run (void *cls, char *const *args, const char *cfgfile, * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * @param cc controller callback to invoke on events; This callback is called * for all peer start events even if GNUNET_TESTBED_ET_PEER_START isn't * set in the event_mask as this is the only way get access to the diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 7ae30e0c6..1aa344e99 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c @@ -1237,7 +1237,7 @@ timeout_task (void *cls) * @param event_mask bit mask with set of events to call 'cc' for; * or-ed values of "1LL" shifted by the * respective 'enum GNUNET_TESTBED_EventType' - * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") + * (e.g. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * @param cc controller callback to invoke on events; This callback is called * for all peer start events even if GNUNET_TESTBED_ET_PEER_START isn't * set in the event_mask as this is the only way get access to the diff --git a/src/testing/testing.c b/src/testing/testing.c index 9724fb55b..991c11a6c 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -91,7 +91,7 @@ struct SharedService struct GNUNET_TESTING_System { /** - * Prefix (i.e. "/tmp/gnunet-testing/") we prepend to each + * Prefix (e.g. "/tmp/gnunet-testing/") we prepend to each * GNUNET_HOME. */ char *tmppath; diff --git a/src/transport/gnunet-helper-transport-bluetooth.c b/src/transport/gnunet-helper-transport-bluetooth.c index 4923e6428..ef3a6292b 100644 --- a/src/transport/gnunet-helper-transport-bluetooth.c +++ b/src/transport/gnunet-helper-transport-bluetooth.c @@ -1374,7 +1374,7 @@ inquiry_devices: // skip the conditions and force a inquiry for new devices * stdin/stdout of this process. Error messages are written to stderr. * * @param argc number of arguments, must be 2 - * @param argv arguments only argument is the name of the interface (i.e. 'hci0') + * @param argv arguments only argument is the name of the interface (e.g. 'hci0') * @return 0 on success (never happens, as we don't return unless aborted), 1 on error * **** similar to gnunet-helper-transport-wlan.c **** diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c index f1b190993..d90565c9c 100644 --- a/src/transport/gnunet-helper-transport-wlan.c +++ b/src/transport/gnunet-helper-transport-wlan.c @@ -1935,7 +1935,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr) * process. Error messages are written to stdout. * * @param argc number of arguments, must be 2 - * @param argv arguments only argument is the name of the interface (i.e. 'mon0') + * @param argv arguments only argument is the name of the interface (e.g. 'mon0') * @return 0 on success (never happens, as we don't return unless aborted), 1 on error */ int diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c index d0a10cbc7..c88532806 100644 --- a/src/transport/gnunet-service-transport_plugins.c +++ b/src/transport/gnunet-service-transport_plugins.c @@ -51,12 +51,12 @@ struct TransportPlugin struct GNUNET_TRANSPORT_PluginFunctions *api; /** - * Short name for the plugin (i.e. "tcp"). + * Short name for the plugin (e.g. "tcp"). */ char *short_name; /** - * Name of the library (i.e. "gnunet_plugin_transport_tcp"). + * Name of the library (e.g. "gnunet_plugin_transport_tcp"). */ char *lib_name; diff --git a/src/util/client.c b/src/util/client.c index 746c0eb55..afd2fe900 100644 --- a/src/util/client.c +++ b/src/util/client.c @@ -892,7 +892,7 @@ connection_client_cancel_impl (struct GNUNET_MQ_Handle *mq, * #GNUNET_NO if the service is (definitively) down, * #GNUNET_SYSERR if the configuration does not give us * the necessary information about the service, or if - * we could not check (i.e. socket() failed) + * we could not check (e.g. socket() failed) */ int GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg, diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index efaac1136..2c477db40 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c @@ -337,7 +337,7 @@ GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData * * @param md metadata to extend * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data @@ -427,7 +427,7 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, * * @param cls the `struct GNUNET_CONTAINER_MetaData` to merge into * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being + * special values can be used (e.g. '<zlib>' for zlib being * used in the main libextractor library and yielding * meta data). * @param type libextractor-type describing the meta data diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 5e4c4d1e6..4d3de00bc 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c @@ -473,7 +473,7 @@ rsa_gcd_validate (gcry_mpi_t r, gcry_mpi_t n) /** * Create a blinding key * - * @param len length of the key in bits (i.e. 2048) + * @param len length of the key in bits (e.g. 2048) * @param bks pre-secret to use to derive the blinding key * @return the newly created blinding key, NULL if RSA key is malicious */ diff --git a/src/util/network.c b/src/util/network.c index c4adefb8f..e771a9834 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -1269,7 +1269,7 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds) /** * Test if the given @a port is available. * - * @param ipproto transport protocol to test (i.e. IPPROTO_TCP) + * @param ipproto transport protocol to test (e.g. IPPROTO_TCP) * @param port port number to test * @return #GNUNET_OK if the port is available, #GNUNET_NO if not */ diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 759312df5..d5c7b964f 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -193,7 +193,7 @@ struct GNUNET_SCHEDULER_Task /** * Why is the task ready? Set after task is added to ready queue. * Initially set to zero. All reasons that have already been - * satisfied (i.e. read or write ready) will be set over time. + * satisfied (e.g. read or write ready) will be set over time. */ enum GNUNET_SCHEDULER_Reason reason; diff --git a/src/util/strings.c b/src/util/strings.c index 61e04c457..b62d5f547 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -316,7 +316,7 @@ convert_with_table (const char *input, /** * Convert a given fancy human-readable size to bytes. * - * @param fancy_size human readable string (i.e. 1 MB) + * @param fancy_size human readable string (e.g. 1 MB) * @param size set to the size in bytes * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -348,7 +348,7 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, * Convert a given fancy human-readable time to our internal * representation. * - * @param fancy_time human readable string (i.e. 1 minute) + * @param fancy_time human readable string (e.g. 1 minute) * @param rtime set to the relative time * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -399,7 +399,7 @@ GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time, * representation. The human-readable time is expected to be * in local time, whereas the returned value will be in UTC. * - * @param fancy_time human readable string (i.e. %Y-%m-%d %H:%M:%S) + * @param fancy_time human readable string (e.g. %Y-%m-%d %H:%M:%S) * @param atime set to the absolute time * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ @@ -1364,7 +1364,7 @@ GNUNET_STRINGS_to_address_ip (const char *addr, * `struct sockaddr`. * * @param addr the address - * @param[out] af set to the parsed address family (i.e. AF_INET) + * @param[out] af set to the parsed address family (e.g. AF_INET) * @param[out] sa set to the parsed address * @return 0 on error, otherwise number of bytes in @a sa */ diff --git a/src/util/tun.c b/src/util/tun.c index 0e3017551..d2b675c71 100644 --- a/src/util/tun.c +++ b/src/util/tun.c @@ -37,7 +37,7 @@ * Initialize an IPv4 header. * * @param ip header to initialize - * @param protocol protocol to use (i.e. IPPROTO_UDP) + * @param protocol protocol to use (e.g. IPPROTO_UDP) * @param payload_length number of bytes of payload that follow (excluding IPv4 header) * @param src source IP address to use * @param dst destination IP address to use @@ -72,7 +72,7 @@ GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip, * Initialize an IPv6 header. * * @param ip header to initialize - * @param protocol protocol to use (i.e. IPPROTO_UDP), technically "next_header" for IPv6 + * @param protocol protocol to use (e.g. IPPROTO_UDP), technically "next_header" for IPv6 * @param payload_length number of bytes of payload that follow (excluding IPv6 header) * @param src source IP address to use * @param dst destination IP address to use -- cgit v1.2.3