]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
wireguard: do not log wireguard key
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Mar 2019 05:12:03 +0000 (14:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Mar 2019 02:59:18 +0000 (11:59 +0900)
It may be PrivateKey=.

src/network/netdev/wireguard.c

index 44e7aa61098a2d56088443b30d07459308dd2dd2..8286b47100c6671be777d306363460dd59b49d41 100644 (file)
@@ -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;
         }