netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

Arch|NetBSD: Failure with undefined BIGNUMBER when using system WolfSSL

Open rdmark opened this issue 1 year ago • 1 comments

When building with system WolfSSL on Arch and NetBSD, we get errors like:

[171/254] Compiling C object etc/uams/uams_randnum.so.p/uams_randnum.c.o
In file included from ../include/atalk/logger.h:5,
                 from ../etc/uams/uams_randnum.c:36:
./config.h:378:9: warning: "HAVE_PTHREAD" redefined
  378 | #define HAVE_PTHREAD 1
      |         ^~~~~~~~~~~~
In file included from ../etc/uams/uams_randnum.c:30:
/usr/include/wolfssl/options.h:132:9: note: this is the location of the previous definition
  132 | #define HAVE_PTHREAD
      |         ^~~~~~~~~~~~
[172/254] Compiling C object etc/uams/uams_dhx_passwd.so.p/uams_dhx_passwd.c.o
FAILED: etc/uams/uams_dhx_passwd.so.p/uams_dhx_passwd.c.o 
cc -Ietc/uams/uams_dhx_passwd.so.p -Ietc/uams -I../etc/uams -I. -I.. -Iinclude -I../include -Isys -I../sys -Ietc/afpd -I../etc/afpd -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c11 -O0 -g -DHAVE_CONFIG_H '-D_U_=__attribute__((unused))' -Wno-pedantic -Wno-extra -Wno-all -Wno-deprecated-declarations -D_GNU_SOURCE -fPIC -MD -MQ etc/uams/uams_dhx_passwd.so.p/uams_dhx_passwd.c.o -MF etc/uams/uams_dhx_passwd.so.p/uams_dhx_passwd.c.o.d -o etc/uams/uams_dhx_passwd.so.p/uams_dhx_passwd.c.o -c ../etc/uams/uams_dhx_passwd.c
../etc/uams/uams_dhx_passwd.c: In function ‘pwd_login’:
../etc/uams/uams_dhx_passwd.c:81:5: error: unknown type name ‘BIGNUM’
   81 |     BIGNUM *bn, *gbn, *pbn;
      |     ^~~~~~
../etc/uams/uams_dhx_passwd.c:82:11: error: unknown type name ‘BIGNUM’
   82 |     const BIGNUM *pub_key;
      |           ^~~~~~

rdmark avatar Jul 30 '24 23:07 rdmark

The two cases are quite different.

On NetBSD the build system actually warns that WolfSSL doesn't have all the symbols and flag SSL as built-in. However it seems like a macro gets set incorrectly and the wrong headers get included.

On Arch, the build system things WolfSSL is good and flags SSL as WolfSSL. But in reality capabilities are missing.

rdmark avatar Jul 31 '24 13:07 rdmark

After https://github.com/Netatalk/netatalk/pull/1440 the NetBSD issue got resolved. Probably because we got rid of all of the local macro hacks.

We are still getting missing symbol errors on Arch.

rdmark avatar Sep 07 '24 12:09 rdmark

Has the issue been reported in the Arch Linux bug tracker, over on their gitlab?

VorpalBlade avatar Sep 20 '24 06:09 VorpalBlade

It has not, to my best knowledge. But it’s a good idea. Shall I give it a go or are you volunteering? :)

rdmark avatar Sep 20 '24 07:09 rdmark

You are probably more knowledgeable on what the actual specific issue is than I am. I'm just a C++ and Rust programmer with rusty (pun not intended) C knowledge, who don't really know these libraries at all.

https://archlinux.org/packages/extra/x86_64/wolfssl/ has the relevant links to the gitlab. If you can't get an account on their bug tracker (process a bit manual due to spam issues, but I think you can log in with github to get around that) I can absolutely report this, but you need to provide some details so I understand the situation fully.

VorpalBlade avatar Sep 20 '24 08:09 VorpalBlade

The Arch anti spam filter defeated me a few months ago but I can try again with your advice.

Edit: Sent an account creation request to the given email address.

rdmark avatar Sep 20 '24 12:09 rdmark

Did you manage to get through? Or should I report it using my existing account?

VorpalBlade avatar Sep 24 '24 10:09 VorpalBlade

Reported! https://gitlab.archlinux.org/archlinux/packaging/packages/wolfssl/-/issues/2

At a related note, there's this bug too: https://gitlab.archlinux.org/archlinux/packaging/packages/wolfssl/-/issues/1

So it seems that the Arch wolfSSL not being full-featured is a known issue.

rdmark avatar Sep 24 '24 12:09 rdmark