Skip to content
  • Thomas Haller's avatar
    wireguard: accept all-zero private-key, public-key and preshared-key · b680d64b
    Thomas Haller authored
    - For PSK, an all-zero PSK means to don't do symmetric encryption. As such,
      at first it seems a bit odd when the user sets
    
          - preshared-key-flags != "4 (not-required)"
    
          - preshared-key = AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
    
      Here the user indicates that a PSK is required, but then provides an
      all-zero PSK that effectively disables it. Still, we should not reject
      such a configuration. This has the benefit that it allos the user for
      being prompted for a PSK, only to disable it by entering the all-zero key.
    
    - For the private-key (and consequently the public-key), "public-key-flags=4"
      is rejected by libnm. A private key is always required for NetworkManager to
      configure the link. However, let's not care for all-zero keys either. If the user
      configures that, we just set that key. It's a valid setting as far as WireGuard
      (the kernel module) is concerned, so we shouldn't reject it.
    
    (cherry picked from commit 78dccb8b)
    b680d64b