hostapd/src
Patrick Steinhardt e680a51e94 ext_password: Implement new file-based backend
It was not easily possible to separate configuration of an interface and
credentials when using the configuration file instead of the control
interface or D-Bus interface for setting up the network profiles. This
makes it hard to distribute configuration across a set of nodes which
use wpa_supplicant without also having to store credentials in the same
file. While this can be solved via scripting, having a native way to
achieve this would be preferable.

Turns out there already is a framework to have external password
storages. It only had a single "test" backend though, which is kind of
an in-memory store which gets initialized with all passwords up front
and is mainly for testing purposes. This isn't really suitable for the
above use case: the backend cannot be initialized as part of the central
configuration given that it needs the credentials, and we want to avoid
scripting.

This commit thus extends the infrastructure to implement a new backend,
which instead uses a simple configuration file containing key-value
pairs. The file follows the format which wpa_supplicant.conf(5) uses:
empty lines and comments are ignored, while passwords can be specified
with simple `password-name=password-value` assignments.

With this new backend, splitting up credentials and configuration
becomes trivial:

    # /etc/wpa_supplicant/wpa_supplicant.conf
    ext_password_backend=file:/etc/wpa_supplicant/psk.conf

    network={
        ssid="foobar"
        psk=ext:foobar
    }

    # /etc/wpa_supplicant/psk.conf
    foobar=ecdabff9c80632ec6fcffc4a8875e95d45cf93376d3b99da6881298853dc686b

Alternative approaches would be to support including other configuration
files in the main configuration, such that common configuration and
network declarations including credentials are split up into separate
files. But the implementation would probably have been more complex
compared to reusing the already-existing framework for external password
backends.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2021-02-16 00:47:43 +02:00
..
ap HE: Fall back to 20 MHz on 2.4 GHz if 40 MHz is not supported 2021-02-15 18:27:10 +02:00
common Define FILS Discovery frame subfields 2021-02-14 11:13:20 +02:00
crypto wolfSSL: wolfSSL_use_PrivateKey_* correct return codes 2021-02-09 20:54:34 +02:00
drivers Sync with mac80211-next.git include/uapi/linux/nl80211.h 2021-02-15 17:36:20 +02:00
eap_common build: Make more library things common 2020-10-12 20:20:35 +03:00
eap_peer EAP-AKA: Check that ID message storing succeeds 2021-02-07 23:40:20 +02:00
eap_server build: Make more library things common 2020-10-12 20:20:35 +03:00
eapol_auth build: Make more library things common 2020-10-12 20:20:35 +03:00
eapol_supp build: Make more library things common 2020-10-12 20:20:35 +03:00
fst FST: Convert Boolean to C99 bool 2020-04-24 17:06:50 +03:00
l2_packet build: Make more library things common 2020-10-12 20:20:35 +03:00
p2p P2P: Add a maximum length limit for peer vendor IEs 2021-02-05 01:39:29 +02:00
pae MACsec: Convert Boolean to C99 bool 2020-04-24 17:06:50 +03:00
radius build: Make more library things common 2020-10-12 20:20:35 +03:00
rsn_supp RSN: Validate RSNXE match in EAPOL-Key msg 3/4 only when RSN is used 2021-02-06 12:09:30 +02:00
tls Fix couple more typos 2020-10-20 00:37:01 +03:00
utils ext_password: Implement new file-based backend 2021-02-16 00:47:43 +02:00
wps WPS: Reconfigure credentials on hostapd config reload 2021-02-06 17:15:31 +02:00
build.rules build: Rebuild libs all the time 2020-10-12 20:18:02 +03:00
lib.rules build: lib.rules: Add common-clean 2020-10-16 12:51:12 +03:00
Makefile build: Add a common-clean target 2020-10-10 12:48:41 +03:00
objs.mk build: Fix dependency file inclusion 2020-10-12 11:05:16 +03:00