Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: implicit declaration of function ‘blake2s256_hmac’ #12

Open
UglyAnimal opened this issue Aug 1, 2024 · 5 comments
Open

error: implicit declaration of function ‘blake2s256_hmac’ #12

UglyAnimal opened this issue Aug 1, 2024 · 5 comments

Comments

@UglyAnimal
Copy link

Getting following error when running make on raspberry pi 4:

root@pi:~/amneziawg-linux-kernel-module/src# make
CWD=$(pwd); \
cd /root/amneziawg-linux-kernel-module/src/generated; \
for patch in /root/amneziawg-linux-kernel-module/src/patches/000-initial-amneziawg.patch; do \
	patch -F3 -t -p0 -i $patch; \
done; \
cd $CWD; \
date > /root/amneziawg-linux-kernel-module/src/generated/.patches.stamp
patching file cookie.c
patching file cookie.h
patching file device.c
Hunk #1 succeeded at 362 (offset -15 lines).
Hunk #2 succeeded at 463 (offset -15 lines).
patching file device.h
patching file main.c
Hunk #1 succeeded at 9 with fuzz 3.
Hunk #2 succeeded at 43 (offset -7 lines).
Hunk #3 succeeded at 69 with fuzz 2 (offset -7 lines).
patching file messages.h
patching file netlink.c
patching file noise.c
Hunk #1 succeeded at 482 (offset -2 lines).
Hunk #2 succeeded at 499 (offset -2 lines).
Hunk #3 succeeded at 632 (offset -2 lines).
Hunk #4 succeeded at 648 (offset -2 lines).
patching file noise.h
patching file receive.c
Hunk #1 succeeded at 32 (offset -1 lines).
Hunk #2 succeeded at 112 (offset -1 lines).
Hunk #3 succeeded at 135 (offset -1 lines).
Hunk #4 succeeded at 165 (offset -1 lines).
Hunk #5 succeeded at 185 (offset -1 lines).
Hunk #6 succeeded at 217 (offset -1 lines).
Hunk #7 succeeded at 573 (offset -9 lines).
Hunk #8 succeeded at 589 (offset -9 lines).
patching file send.c
Hunk #1 succeeded at 14 (offset -1 lines).
Hunk #2 succeeded at 42 (offset -1 lines).
Hunk #3 succeeded at 119 (offset -1 lines).
Hunk #4 succeeded at 135 (offset -1 lines).
Hunk #5 succeeded at 158 (offset -1 lines).
Hunk #6 succeeded at 201 (offset -1 lines).
Hunk #7 succeeded at 245 (offset -1 lines).
Hunk #8 succeeded at 332 with fuzz 3 (offset -1 lines).
Hunk #9 succeeded at 337 with fuzz 3 (offset -4 lines).
patching file socket.c
Hunk #1 succeeded at 199 (offset -1 lines).
patching file socket.h
patching file uapi/wireguard.h
  CC [M]  /root/amneziawg-linux-kernel-module/src/generated/main.o
  CC [M]  /root/amneziawg-linux-kernel-module/src/generated/noise.o
/root/amneziawg-linux-kernel-module/src/generated/noise.c: In function ‘kdf’:
/root/amneziawg-linux-kernel-module/src/generated/noise.c:325:9: error: implicit declaration of function ‘blake2s256_hmac’ [-Werror=implicit-function-declaration]
  325 |         blake2s256_hmac(secret, data, chaining_key, data_len, NOISE_HASH_LEN);
      |         ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /root/amneziawg-linux-kernel-module/src/generated/noise.o] Error 1
make[1]: *** [Makefile:1911: /root/amneziawg-linux-kernel-module/src/generated] Error 2
make: *** [Makefile:93: module] Error 2
root@pi:~/amneziawg-linux-kernel-module/src# uname -r
5.15.0-1059-raspi
root@pi:~/amneziawg-linux-kernel-module/src# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
@Trotzky
Copy link

Trotzky commented Sep 7, 2024

Got same error on Ubuntu 22.04.4 LTS
5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
DKMS make.log for amneziawg-1.0.0 for kernel 5.15.0-119-generic (x86_64) Sat Sep 7 04:03:44 AM MSK 2024 make: Entering directory '/var/lib/dkms/amneziawg/1.0.0/build' ---cut---- patching file uapi/wireguard.h CC [M] /var/lib/dkms/amneziawg/1.0.0/build/generated/main.o CC [M] /var/lib/dkms/amneziawg/1.0.0/build/generated/noise.o /var/lib/dkms/amneziawg/1.0.0/build/generated/noise.c: In function ‘kdf’: /var/lib/dkms/amneziawg/1.0.0/build/generated/noise.c:325:9: error: implicit declaration of function ‘blake2s256_hmac’ [-Werror=implicit-function-declaration] 325 | blake2s256_hmac(secret, data, chaining_key, data_len, NOISE_HASH_LEN); | ^~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:297: /var/lib/dkms/amneziawg/1.0.0/build/generated/noise.o] Error 1 make[1]: *** [Makefile:1911: /var/lib/dkms/amneziawg/1.0.0/build/generated] Error 2 make: *** [Makefile:93: module] Error 2 make: Leaving directory '/var/lib/dkms/amneziawg/1.0.0/build'

@Trotzky
Copy link

Trotzky commented Sep 7, 2024

At some point blake2s256_hmac was removed from kernel crypto library
Some info on that:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Confirmed by reading blake2s.h
in v5.15.43 we have blake2s256_hmac at the end of blake2s.h
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/crypto/blake2s.h?h=v5.15.43

Starting from v5.15.44 it was removed!
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/crypto/blake2s.h?h=v5.15.44

amnesiawg kernel module is based on older kernel version and can't be built for kernels newer than v5.15.43 ???

@leninalive
Copy link

@Trotzky how did you obtain kernel sources? For your kernel AmneziaWG uses patch method to build final sources for itself so you must get correct sources for your kernel before compilation.

@ushakov
Copy link

ushakov commented Sep 20, 2024

@Trotzky

At some point blake2s256_hmac was removed from kernel crypto library Some info on that: https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

I believe this is not relevant to this issue as both you and the OP (and also me:) have 5.15.0 kernel which contains that function. However I cannot trace how amneziawg-dkms build includes, or is supposed to include, that header...

I also experience this on Ubuntu 24.04.5. My kernel sources are installed automatically by building amneziawg-dkms version 1.0.0-0~202409181554+8d1b073~ubuntu22.04.1 from the PPA and they do match the running kernel.

@Einheri
Copy link

Einheri commented Dec 5, 2024

the same problem on 5.15.0-126-generic , Ubuntu 24.04.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants