[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210407104307.3731826-1-liuhangbin@gmail.com>
Date: Wed, 7 Apr 2021 18:43:07 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: netdev@...r.kernel.org
Cc: "Jason A . Donenfeld" <Jason@...c4.com>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCH net-next] wireguard: disable in FIPS mode
As the cryptos(BLAKE2S, Curve25519, CHACHA20POLY1305) in WireGuard are not
FIPS certified, the WireGuard module should be disabled in FIPS mode.
Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
---
drivers/net/wireguard/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireguard/main.c b/drivers/net/wireguard/main.c
index 7a7d5f1a80fc..8a9aaea7623c 100644
--- a/drivers/net/wireguard/main.c
+++ b/drivers/net/wireguard/main.c
@@ -12,6 +12,7 @@
#include <uapi/linux/wireguard.h>
+#include <linux/fips.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/genetlink.h>
@@ -21,6 +22,9 @@ static int __init mod_init(void)
{
int ret;
+ if (fips_enabled)
+ return -EOPNOTSUPP;
+
#ifdef DEBUG
if (!wg_allowedips_selftest() || !wg_packet_counter_selftest() ||
!wg_ratelimiter_selftest())
--
2.26.3
Powered by blists - more mailing lists