[GH-ISSUE #12] error: implicit declaration of function ‘blake2s256_hmac’ #5

Open
opened 2026-10-13 21:04:55 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @UglyAnimal on GitHub (Aug 1, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/12

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"
Originally created by @UglyAnimal on GitHub (Aug 1, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/12 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" ```
Author
Owner

@Trotzky commented on GitHub (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'

<!-- gh-comment-id:2334982825 --> @Trotzky commented on GitHub (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' `
Author
Owner

@Trotzky commented on GitHub (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/20220111220506.742067-2-Jason@zx2c4.com/

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 ???

<!-- gh-comment-id:2335012992 --> @Trotzky commented on GitHub (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/20220111220506.742067-2-Jason@zx2c4.com/ 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 ???
Author
Owner

@leninalive commented on GitHub (Sep 15, 2024):

@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.

<!-- gh-comment-id:2351524997 --> @leninalive commented on GitHub (Sep 15, 2024): @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.
Author
Owner

@ushakov commented on GitHub (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/20220111220506.742067-2-Jason@zx2c4.com/

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.

<!-- gh-comment-id:2363465566 --> @ushakov commented on GitHub (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/20220111220506.742067-2-Jason@zx2c4.com/ 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.
Author
Owner

@Einheri commented on GitHub (Dec 5, 2024):

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

<!-- gh-comment-id:2521017589 --> @Einheri commented on GitHub (Dec 5, 2024): the same problem on 5.15.0-126-generic , Ubuntu 24.04.5
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-linux-kernel-module#5
No description provided.