Unable to add PKEY records

2020-10-31 Thread Alessio Vanni
Hello,

I'm using GNUnet from git, at commit be928bb30 and I can't add PKEY
records using gnunet-namestore.

I created two egos and when I print them I get this:

$ gnunet-identity -d
cheeri - 000G004CFKEYWM8P73FHEQ9YHHY53BCTSV4V9P664VPT0MMY7N38QQXHRR - ECDSA
vanni - 000G001PQEQT32SMW5S17279816Z45J7B85KRY74CWKQT1AYS1SF0XNG9R - ECDSA

If I then try to add one of them in the other's namestore, I get this:

$ gnunet-namestore -z cheeri -a -e 30d -n vanni -p -t PKEY -V 
000G001PQEQT32SMW5S17279816Z45J7B85KRY74CWKQT1AYS1SF0XNG9R
Oct 31 14:52:59-401197 gnunet-namestore-4713 ERROR Record type does not match 
parsed record type
Value `000G001PQEQT32SMW5S17279816Z45J7B85KRY74CWKQT1AYS1SF0XNG9R' invalid for 
record type `PKEY'

Also, though I don't know if it's related, the following line appears in
the log inside ~/.cache/gnunet, whenever I start GNUnet with gnunet-arm:

Configuration specifies invalid value for option `.pin' in section `gns': 
Properly base32-encoded public key required

The configuration I have inside ~/.config is empty; the value comes from
the default configuration in $PREFIX/share/gnunet/config.d/

Thanks,
A.V.



Re: [bug-GNUnet] Can't specify different names for config file in projec

2019-09-18 Thread Alessio Vanni
Hello,

> What you should do -- if you want to have your "own" configuration (and
> use the libgnunetutil configuration parser) -- is to load your
> configuration using GNUNET_CONFIGURATION_create/load APIs providing your
> own application paths explicitly there. However, that configuration
> object must then not be used to interact with GNUnet services. So you'd
> basically have two configuration handles: one or your own application
> (which you'd use internally), and one which you'd pass to GNUnet APIs.

I've experimented with this approach and managed to find a way that
seems to work without particular issues, for clients and services.  As
such, this case can be closed as not-a-bug.

Thanks,
A.V.

___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


Re: [bug-GNUnet] Can't specify different names for config file in project data

2019-09-11 Thread Alessio Vanni
Christian Grothoff  writes:

> Ok, then I'm not sure how you expect this to work: if you do not give
> the code access to the configuration data (i.e. by telling it to load it
> from a different directory than where GNUnet was installed and also not
> providing the right configuration information in that directory), then
> obviously the logic will fail when it needs its configuration.
>
> Note that you can use GNUNET_CONFIGURATION_load* with the "right"
> path(s) to manually load either the GNUnet configuration data or your
> own applications' configuration data (if they are in different
> locations). However, without such manual action on your part,
> libgnunetutil will by design only load the configuration data from the
> one location that is configured via the ProjectData mechanism.
>
> Does this help?

I'm not sure if I understood correctly what you mean, so let me list
what I know about how configuration works.  It might be wrong and that's
why I'm doing this.

When I define the ProjectData structure, I specify that I want my
application to look for a certain configuration file.  Because I want
this file to be specific to my application, I don't use the GNUnet's
file, but something else (say, "test-program.conf" and
"~/.test-program.d/config")

Before reading that file (if it exists), GNUnet searches a standard
location for a default configuration, which is the "config.d" directory
inside the GNUNET_OS_IPK_DATADIR directory.

That directory is found by using the ".project_dirname" field of the
ProjectData structure, so if that field is "test-program", the
GNUNET_OS_IPK_DATADIR directory would be "share/test-program/config.d/".

The configuration loader will load any file that is inside that
directory and then it will load the config file provided by
".config_file" or ".user_config_file".

Because that directory is not GNUnet's directory, anything specific to
GNUnet is not loaded.  The problem with this is that the application is
then unable to find the port/socket needed to connect with GNUnet's
services.

Calling the loader on the config files specified by the default
ProjectData or simply not changing those two field in the structure does
not really solve it: if the file is empty (the tutorial on the website
itself says it's fine to have an empty gnunet.conf) the default values
are still not loaded as they are located in "share/gnunet/config.d"
which is never scanned by GNUnet.

Ultimately what I'm expecting is that on initialization the application
loads GNUnet's settings (mainly to find the services' port/sockets) and
then its own settings.  Is that a wrong assumption to make?

Thanks,
A.V.

___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


Re: [bug-GNUnet] Can't specify different names for config file in project data

2019-09-10 Thread Alessio Vanni
Sorry for the late reply.  I didn't see there was a reply to the report
(I'm not subscribed to this list... I check the archives from time to
time though.)

> This shouldn't be the case, as GNUnet picks up the (default) service
> contact information from a the share/gnunet/config.d/ directory.
>
> Also, when I change the value, everything still works for me. What is
> the error message you are seeing (if any)?

The problem is in 3rd-party applications.  GNUnet itself correctly reads
its config files from the correct directories.  However, if the
GNUNET_OS_ProjectData structure holds different values, the application
doesn't work.

The main problem is that it can't connect to GNUnet services, so the
error is that `GNUNET_CLIENT_connect' returns NULL when making a
connection.

For a concrete error message, using `GNUNET_IDENTITY_ego_lookup' (which
makes an implicit connection to the IDENTITY service) when .config_file
and .user_config_file are different from "gnunet.conf" and
"~/.config/gnunet.conf" respectively, it fails with the following
message:

ERROR Assertion failed at identity_api_lookup.c:202.

The line in question is a `GNUNET_break' called when
`GNUNET_CLIENT_connect' returns NULL.

The error does not happen if the configuration file (either one, as long
as it exists) is the same as GNUnet itself.

I attached a minimal program for testing this issue.  It simply calls
`GNUNET_IDENTITY_ego_lookup'.  If it successfully connects, it will
print wether or not the ego "test-ego" exists; otherwise, it will fail
with the above message.

Thanks,
A.V.

#include 
#define SOCKTYPE int
#define FDTYPE int

#include 
#include 

static struct GNUNET_OS_ProjectData test_pd = {
 .libname = "test",
 .project_dirname = "test",
 .binary_name = "test-config",
 .env_varname = "TEST_PREFIX",
 .base_config_varname = "TEST_CONFIG",
 .bug_email = "",
 .homepage = "",
 .config_file = "test.conf",
 .user_config_file = "/tmp/test.conf",
 .version = "1.0",
 .is_gnu = 0,
 .gettext_domain = "test",
 .gettext_path = NULL,
};

static const struct GNUNET_CONFIGURATION_Handle *cfg = NULL;

static void
ego_lookup(void *cls, const struct GNUNET_IDENTITY_Ego *ego) {
 if (ego == NULL) {
	  GNUNET_log(GNUNET_ERROR_TYPE_INFO, "test-ego does not exist\n");
 } else {
	  GNUNET_log(GNUNET_ERROR_TYPE_INFO, "test-ego exists\n");
 }
 GNUNET_SCHEDULER_shutdown();
}

static void
run(void *cls, char *const *args, const char *cfgname,
const struct GNUNET_CONFIGURATION_Handle *c) {
 GNUNET_log_setup("test-config", "INFO", NULL);
 
 cfg = c;

 if (GNUNET_IDENTITY_ego_lookup(cfg, "test-ego", &ego_lookup, NULL) == NULL) {
	  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error with ego lookup\n");
	  GNUNET_SCHEDULER_shutdown();
 }
}

int
main(int argc, char *argv[]) {
 const struct GNUNET_GETOPT_CommandLineOption opts[] = {
	  GNUNET_GETOPT_OPTION_END,
 };
 
 GNUNET_OS_init(&test_pd);

 return (GNUNET_PROGRAM_run(argc, argv, "test-config",
"test", opts, &run, NULL)
	 != GNUNET_OK);
}
___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


[bug-GNUnet] Can't specify different names for config file in project data

2019-09-01 Thread Alessio Vanni
The GNUNET_OS_ProjectData struct contains two fields, `config_file' and
`user_config_file'.  By default they are set to "gnunet.conf" and
"~/.config/gnunet.conf".

When these fields are set to a different name, the application refuses
to start.  It seems the problem is caused by the fact that the
application is unable to find the required informations to connect with
GNUnet, i.e. the specified file must be a copy of gnunet.conf instead of
containing only the application-specific configuration for the
application to work.

A.V.

___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


[bug-GNUnet] Application does not compile when using GNUNET_log_strerror

2019-08-30 Thread Alessio Vanni
I'm building an out-of-tree application which uses some system calls, so
I thought I'd use GNUNET_log_strerror when an error occurs (i.e. the
function returns -1.)  However, when I try to compile the application,
the compiler fails saying that STRERROR (all caps) is undefined.

The problem is caused by the fact that GNUnet's headers assume to have
plibc.h always available, but that header is not included within those
headers.

The GNUnet documentation doesn't say if it should be included when
building an application or not (neither gnunet-ext nor the handbook), so
it's unclear how to proceed.  plibc.h should probably be always included
by placing the #include directive within one of the installed GNUnet
headers.

Sincerely,
A.V.

___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


[bug-GNUnet] --enable-logging=no is broken

2019-08-19 Thread Alessio Vanni
The ARM service spams the log file with too many messages (to the point
of reaching more than 100MB of log messages in the worst case and using
a lot of CPU in the meanwhile), so I tried to disable logging
altogether.

To begin with, it doesn't compile: gnunet_common.h conditionally
declares `GNUNET_get_log_call_status' when `GNUNET_CULL_LOGGING' is not
defined; however, `get_nick_record' in gnunet-service-namestore.c
unconditionally calls it, leading to a compilation error.  Additionally,
common_logging.c unconditionally defines it.

Removing the conditional from gnunet_common.h doesn't seem to work (or
maybe I did something wrong, but in any case it didn't compile), so I
also added the #if in `get_nick_record' around the call to the
incriminated function.  Now the code compiles, but running gnunet-arm -s
refuses to work: it returns but no service is started (and since logging
is disabled no error message is printed...)

Output of gnunet-bugreport (with some bugs on its own...):

INFO:gnunet-bugreport 0.11.0
INFO:
INFO:Please submit the following
INFO:information with your bug report:
=
INFO:OS : Linux
INFO:OS RELEASE : 4.20.6-gentoo
INFO:HARDWARE   : x86_64
INFO:awk: Found
INFO:gcc: gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0
INFO:cc : cc (Gentoo 8.3.0-r1 p1.1) 8.3.0
INFO:c++: c++ (Gentoo 8.3.0-r1 p1.1) 8.3.0
awk: cmd. line:1: /GNU Make/{,$NF}
awk: cmd. line:1:^ syntax error
INFO:gmake: 
WARNING: make   : Not Found
INFO:autoconf   : 2.69
INFO:automake   : 1.16.1
INFO:libtool: 2.4.6
INFO:libextractor   : v1.8
INFO:GNUnet 0.8 : Not Found (good)
INFO:GNUnet 0.9 : Not Found (good)
INFO:GNUnet 0.10: Not Found (good)
INFO:GNUnet 0.11: 0.11.6
INFO:libgcrypt  : 1.8.3
/usr/local/bin/gnunet-bugreport: line 245: type: mysql_config: not found
INFO:mysql  : Not Found
/usr/local/bin/gnunet-bugreport: line 256: type: pkgconf: not found
INFO:pkgconf: Not Found
INFO:pkg-config : 0.29.2
INFO:glib2  : 2.58.3
INFO:gtk2+  : 2.24.32
INFO:gtk3+  : Not found
INFO:gtk4+  : Not found
/usr/local/bin/gnunet-bugreport: line 333: type: dpkg: not found
/usr/local/bin/gnunet-bugreport: line 344: type: rpm: not found
WARNING: GMP: Test not available
/usr/local/bin/gnunet-bugreport: line 356: type: dpkg: not found
/usr/local/bin/gnunet-bugreport: line 367: type: rpm: not found
INFO:libunistring   : Test not available
/usr/local/bin/gnunet-bugreport: line 379: type: pkg_add: not found
INFO:GNU gettext: 0.19.8.1
INFO:libcurl: 7.65.0
awk: cmd. line:1: {print "$2}
awk: cmd. line:1:^ unterminated string
awk: cmd. line:1: {print "$2}
awk: cmd. line:1:^ syntax error
INFO:libgnurl   : 
INFO:libmicrohttpd  : 96500
INFO:GNU GLPK   : 4.63
INFO:GnuTLS : 3.6.7
=
INFO:Bug report saved in ./my_gnunet_bugreport.log

___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet


[bug-GNUnet] gnunet-bcd refuses connections

2019-08-19 Thread Alessio Vanni
gnunet-bcd starts correctly (including initializing the http server),
but if I try to connect to localhost: with my web browser, the
browser doesn't display anything and gnunet-bcd prints

Closing connection (application reported error generating data)

and nothing else.  The same happens if I try with curl or similar.

This is the output of gnunet-bugreport (there seems to be some bugs in
that tool too though...):

INFO:gnunet-bugreport 0.11.0
INFO:
INFO:Please submit the following
INFO:information with your bug report:
=
INFO:OS : Linux
INFO:OS RELEASE : 4.20.6-gentoo
INFO:HARDWARE   : x86_64
INFO:awk: Found
INFO:gcc: gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0
INFO:cc : cc (Gentoo 8.3.0-r1 p1.1) 8.3.0
INFO:c++: c++ (Gentoo 8.3.0-r1 p1.1) 8.3.0
awk: cmd. line:1: /GNU Make/{,$NF}
awk: cmd. line:1:^ syntax error
INFO:gmake: 
WARNING: make   : Not Found
INFO:autoconf   : 2.69
INFO:automake   : 1.16.1
INFO:libtool: 2.4.6
INFO:libextractor   : v1.8
INFO:GNUnet 0.8 : Not Found (good)
INFO:GNUnet 0.9 : Not Found (good)
INFO:GNUnet 0.10: Not Found (good)
INFO:GNUnet 0.11: 0.11.6
INFO:libgcrypt  : 1.8.3
/usr/local/bin/gnunet-bugreport: line 245: type: mysql_config: not found
INFO:mysql  : Not Found
/usr/local/bin/gnunet-bugreport: line 256: type: pkgconf: not found
INFO:pkgconf: Not Found
INFO:pkg-config : 0.29.2
INFO:glib2  : 2.58.3
INFO:gtk2+  : 2.24.32
INFO:gtk3+  : Not found
INFO:gtk4+  : Not found
/usr/local/bin/gnunet-bugreport: line 333: type: dpkg: not found
/usr/local/bin/gnunet-bugreport: line 344: type: rpm: not found
WARNING: GMP: Test not available
/usr/local/bin/gnunet-bugreport: line 356: type: dpkg: not found
/usr/local/bin/gnunet-bugreport: line 367: type: rpm: not found
INFO:libunistring   : Test not available
/usr/local/bin/gnunet-bugreport: line 379: type: pkg_add: not found
INFO:GNU gettext: 0.19.8.1
INFO:libcurl: 7.65.0
awk: cmd. line:1: {print "$2}
awk: cmd. line:1:^ unterminated string
awk: cmd. line:1: {print "$2}
awk: cmd. line:1:^ syntax error
INFO:libgnurl   : 
INFO:libmicrohttpd  : 96500
INFO:GNU GLPK   : 4.63
INFO:GnuTLS : 3.6.7
=
INFO:Bug report saved in ./my_gnunet_bugreport.log


___
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet