summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-09-11 21:49:00 +0200
committerLennart Poettering <lennart@poettering.net>2024-09-12 09:25:50 +0200
commit53c75243af0cbeac6517024fdaf15c65e5b258a8 (patch)
treef8c3fc2a00e2994f0ef231d1ed9cd8fc9877287a /src/network
parentresolvectl: rework StatusMode handling into a switch/case statement (diff)
downloadsystemd-53c75243af0cbeac6517024fdaf15c65e5b258a8.tar.xz
systemd-53c75243af0cbeac6517024fdaf15c65e5b258a8.zip
network/wireguard: refuse default key if all zero
Follow-up for fa724cd52c1335d6b3225b74c1a9c801389997ba We attempt to retrieve default key if eqzero(Wireguard.private_key), but a all zero default key should be refused too.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/netdev/wireguard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index f4b7045151..9715cf4034 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -1175,7 +1175,7 @@ static int wireguard_read_default_key_cred(NetDev *netdev, const char *filename)
"%s: No private key specified and default key cannot be parsed, "
"ignoring network device: %m",
filename);
- if (len != WG_KEY_LEN)
+ if (len != WG_KEY_LEN || memeqzero(key, len))
return log_netdev_error_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
"%s: No private key specified and default key is invalid. "
"Ignoring network device.",