mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #145] [MERGED] compat: fix compilation on kernels >= 6.19 (blake2s API change) #205
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-linux-kernel-module#205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/145
Author: @noctuum
Created: 3/5/2026
Status: ✅ Merged
Merged: 3/22/2026
Merged by: @pokamest
Base:
master← Head:fix/kernel-6.19-blake2s-compat📝 Commits (3)
6006d44compat: fix compilation on kernels >= 6.19 (blake2s API change)47b21c8compat: use new blake2s API as default, add fallback for old kernels1a4fed7fix: add blake2s inclusion before using its internal method for compat📊 Changes
3 files changed (+17 additions, -9 deletions)
View changed files
📝
src/compat/compat.h(+8 -0)📝
src/cookie.c(+4 -4)📝
src/noise.c(+5 -5)📄 Description
Fixes #143
Fixes #149
Problem
AmneziaWG fails to build on Linux kernel 6.19+ due to the blake2s API refactor by Eric Biggers that landed in kernel 6.19.
DKMS build errors on kernel
6.19.6-zen1-1-zen(Arch Linux):Same errors in
cookie.c(lines 36, 80, 88, 94).Root Cause
Kernel 6.19 refactored
include/crypto/blake2s.h:1. Struct renamed:
struct blake2s_state→struct blake2s_ctx2.
blake2s()argument order changed:3.
blake2s_init/update/finalsignatures unchanged — only the context struct name changed.Fix
This follows the existing compat layer patterns in the codebase:
src/compat/compat.h#define blake2s_state blake2s_ctxfor kernels >= 6.19 (handles all 5 struct declaration sites across noise.c and cookie.c)#define COMPAT_BLAKE2S_NEW_APIflag for call-site guardssrc/noise.cblake2s()call inwg_noise_init()with#ifdef COMPAT_BLAKE2S_NEW_APIsrc/cookie.cblake2s()calls incompute_mac1()andcompute_mac2()with#ifdef COMPAT_BLAKE2S_NEW_APIWhy AmneziaWG is affected (but not upstream WireGuard)
The upstream
wireguard-linux-compattargets kernels 3.10–5.5 only, since WireGuard was merged into mainline in Linux 5.6. Users on 6.19+ use the in-kernel WireGuard and don't need the out-of-tree module.AmneziaWG, however, adds traffic obfuscation features (junk packets, magic headers) that are not in mainline — so the out-of-tree module must compile on all kernel versions, including 6.19+. On kernels >= 5.6 where
include/crypto/blake2s.hexists, the module uses the kernel's blake2s rather than its bundled copy (seeKbuild.includeline 111), which means it's directly affected by API changes in that header.Testing
makebuild: Compiled successfully on kernel6.19.6-zen1-1-zen(Arch Linux, x86_64)dkms build amneziawg/1.0.0succeededmodprobe amneziawgloaded successfully,lsmodconfirms module active🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.