[PATCH 01/14] wpa_supplicant: keep networks with an external PSK in the saved config

Angelo Compagnucci angelo.compagnucci at gmail.com
Mon Nov 23 06:24:35 PST 2026


When the configuration is written, WPA-PSK networks without a PSK or a
passphrase, and SAE networks without a password or a PMK, are skipped
as invalid. A network with psk=ext:<name> has none of these, because
its password is in the external password backend. SAE can use that
password too. So SAVE_CONFIG removed these networks from the
configuration file. Keep them.

Tested with driver none. WPA-PSK and SAE networks with psk=ext:<name>
stay in the file after SAVE_CONFIG.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci at gmail.com>
---
 wpa_supplicant/config_file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index b01134945..5ba415b66 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1966,11 +1966,11 @@ int wpa_config_write(const char *name, struct wpa_config *config)
 		    ssid->ro)
 			continue; /* do not save temporary networks */
 		if (wpa_key_mgmt_wpa_psk_no_sae(ssid->key_mgmt) &&
-		    !ssid->psk_set && !ssid->passphrase)
+		    !ssid->psk_set && !ssid->passphrase && !ssid->ext_psk)
 			continue; /* do not save invalid network */
 		if (wpa_key_mgmt_sae(ssid->key_mgmt) &&
 		    !ssid->passphrase && !ssid->sae_password &&
-		    !ssid->pmk_valid)
+		    !ssid->pmk_valid && !ssid->ext_psk)
 			continue; /* do not save invalid network */
 		fprintf(f, "\nnetwork={\n");
 		wpa_config_write_network(f, ssid, config);
-- 
2.53.0




More information about the Hostap mailing list