network/wireguard: refuse default key if all zero
Follow-up for fa724cd52c
We attempt to retrieve default key if eqzero(Wireguard.private_key),
but a all zero default key should be refused too.
This commit is contained in:
committed by
Lennart Poettering
parent
2b735c7d71
commit
53c75243af
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user