From 583eb170f0b09d5f83a9a5d2a1924773077f6c5d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 4 Mar 2019 14:12:03 +0900 Subject: [PATCH] wireguard: do not log wireguard key It may be PrivateKey=. --- src/network/netdev/wireguard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c index 44e7aa6109..8286b47100 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -490,12 +490,13 @@ static int parse_wireguard_key(const char *unit, r = unbase64mem(rvalue, strlen(rvalue), &key, &len); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, - "Could not parse wireguard key \"%s\", ignoring assignment: %m", rvalue); + "Failed to decode wireguard key provided by %s=, ignoring assignment: %m", lvalue); return 0; } if (len != WG_KEY_LEN) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Wireguard key is too short, ignoring assignment: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, 0, + "Wireguard key provided by %s= has invalid length (%zu bytes), ignoring assignment.", + lvalue, len); return 0; }