Skip to content

Commit

Permalink
pivot wolfcryptified build of wireguard.ko on make WOLFCRYPT=1 (as …
Browse files Browse the repository at this point in the history
…already for wireguard-tools); tweak compat.h to allow building on kernels >= 5.6.0.
  • Loading branch information
douzzer committed Oct 23, 2020
1 parent 34539f9 commit 4ea28b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ ccflags-$(if $(WIREGUARD_VERSION),y,) += -D'WIREGUARD_VERSION="$(WIREGUARD_VERSI

wireguard-y := main.o noise.o device.o peer.o timers.o queueing.o send.o receive.o socket.o peerlookup.o allowedips.o ratelimiter.o cookie.o netlink.o

# include $(src)/crypto/Kbuild.include
ifndef WOLFCRYPT
include $(src)/crypto/Kbuild.include
endif
include $(src)/compat/Kbuild.include

obj-$(if $(KBUILD_EXTMOD),m,$(CONFIG_WIREGUARD)) := wireguard.o

ccflags-y += -I$(src)/../../../../wolfssl -include $(src)/wolfcrypto_shim.h
ifdef WOLFCRYPT
ccflags-y += -DUSE_WOLFCRYPT -I$(src)/../../../../wolfssl -include $(src)/wolfcrypto_shim.h
wireguard-y += wolfcrypto_shim.o
KBUILD_EXTRA_SYMBOLS := $(src)/../../../../wolfssl/linuxkm/Module.symvers
endif
8 changes: 4 additions & 4 deletions src/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#error "WireGuard requires Linux >= 3.10"
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
#error "WireGuard has been merged into Linux >= 5.6 and therefore this compatibility module is no longer required."
#endif
/* #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
/* #error "WireGuard has been merged into Linux >= 5.6 and therefore this compatibility module is no longer required." */
/* #endif */

#if defined(ISRHEL7)
#include <linux/skbuff.h>
Expand Down Expand Up @@ -872,7 +872,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
#endif
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
#if !defined(USE_WOLFCRYPT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0))
#define blake2s_init zinc_blake2s_init
#define blake2s_init_key zinc_blake2s_init_key
#define blake2s_update zinc_blake2s_update
Expand Down

0 comments on commit 4ea28b7

Please sign in to comment.