Skip to contentSkip to conversation

wireguard: disable in FIPS mode

PATCH Superseded Hangbin Liu 1 participant 2 messages Apr 7, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/wireguard/main.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireguard/main.c +4 -0
index 7a7d5f1a80fc..8a9aaea7623c 100644
@@ -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())
Signature · 1 line
2.26.3
#1 lore raw
Quoted 4 lines · Hangbin Liu

As the cryptos(BLAKE2S, Curve25519, CHACHA20POLY1305) in WireGuard are not FIPS certified, the WireGuard module should be disabled in FIPS mode.

Ondrej remind that I need to cc linux-crypto. I will resend the patch.

Thanks
Hangbin