From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: location@lists.ipfire.org Subject: Re: What generates database.db from database.txt? Date: Wed, 21 Oct 2020 14:15:03 +0100 Message-ID: In-Reply-To: <30238400-7580-8c9e-2cc8-27d648680f41@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3527478182154509003==" List-Id: --===============3527478182154509003== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, > On 21 Oct 2020, at 12:07, Gisle Vanem wrote: >=20 > Michael Tremer wrote: >=20 >> This probably requires some more debugging and log output. >> You can set LOC_LOG=3D7 as an environment variable and then run test/test-= country. >=20 > With this, test-country only reports an extra: > libloc: loc_new: ctx 05021298 created >=20 > But with '-DENABLE_DEBUG' there's way too much trace > to be useful. That is the kind of debug information I would need. >=20 >> I pulled the database last week because we had some issue with some data i= n it that triggered some bugs. >> You can download it from the archive still until the updater works again: >> https://location.ipfire.org/databases/1/archive/location-2020-10-16.db.xz >=20 >=20 >> Yes, I assumed so. There are some tools that use but they might potentiall= y just bundle it with their own software which I want to avoid. >> It probably is possible to #ifdef the Windows crypto library here and chec= k the signature that way. But since I have never worked with it, I do not kno= w how to do that. Mac OS X has the same issue. >=20 > An issue with OpenSSL and 'loc_database_verify()'? No, that OpenSSL isn=E2=80=99t easily available on that platform without ship= ping it manually. >> Have you ever worked with it? >=20 > Yes, but 'test-signature' works fine. It's just when calling > 'EVP_VerifyXX()' functions from a .dll (like a Python module), it > fails with 'no OPENSSL_AppLink". > Ref: > https://stackoverflow.com/questions/38933943/openssl-code-works-natively-bu= t-as-dll-causes-openssl-uplink-no-openssl-applink >=20 > With your URL above, > set loc_log=3D7 & py -3 location.py --database location-2020-10-16.db verif= y: >=20 > libloc: loc_new: ctx 0FDACEE8 created > libloc: loc_database_read_as_section_v1: Read 48148 ASes from the database > libloc: loc_database_read_network_nodes_section_v1: Read 2628939 network no= des from the database > libloc: loc_database_read_networks_section_v1: Read 1318972 networks from t= he database > libloc: loc_database_read_countries_section_v1: Read 253 countries from the= database > libloc: loc_database_read: Opened database in 16.0000ms > libloc: loc_database_read_as_section_v1: Read 48148 ASes from the database > libloc: loc_database_read_network_nodes_section_v1: Read 2628939 network no= des from the database > libloc: loc_database_read_networks_section_v1: Read 1318972 networks from t= he database > libloc: loc_database_read_countries_section_v1: Read 253 countries from the= database > libloc: loc_database_read: Opened database in 27.0000ms > OPENSSL_Uplink(640BC6B0,08): no OPENSSL_Applink I have absolutely no idea how to fix this unfortunately. I do not even have access to a Windows system to reproduce this. > BUT, with 'location-2020-05-15.db', there is this error: >=20 > libloc: loc_new: ctx 0FA35190 created > libloc: loc_database_read_header: Incompatible database version: 0 > Traceback (most recent call last): > File "F:\gv\VC_project\ws_trace\src\Geo-IP\IPFire\libloc\src\py3_install\l= ocation.py", line 618, in > main() > File "F:\gv\VC_project\ws_trace\src\Geo-IP\IPFire\libloc\src\py3_install\l= ocation.py", line 616, in main > c.run() > File "F:\gv\VC_project\ws_trace\src\Geo-IP\IPFire\libloc\src\py3_install\l= ocation.py", line 200, in run > db =3D location.Database(args.database) > SystemError: returned NULL without setting an e= rror > libloc: loc_unref: context 0FA35190 released This is a small bug where we do not raise the error message with Python. However, the debug output should tell you why this didn=E2=80=99t work. The database version that should be shown there is 1. You have a zero. > ---- >=20 > Check yourself if the 'location-2020-05-15.db.xz' is still in the archive. Did you extract the file? Best, -Michael >=20 >=20 > --=20 > --gv --===============3527478182154509003==--