]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Add support for RADIUS passphrase as the SAE password
authorMario Hros <git@reversity.org>
Sat, 19 Feb 2022 20:25:30 +0000 (21:25 +0100)
committerJouni Malinen <j@w1.fi>
Fri, 4 Mar 2022 10:25:14 +0000 (12:25 +0200)
Allow the first Tunnel-Password RADIUS entry to be used for SAE in
addition to the sae_password entries and wpa_passphrase parameters from
the static configuration file.

Signed-off-by: Mario Hros <git@reversity.org>
src/ap/ieee802_11.c

index 6140a492c88beb69f543984d40f245ec2e0130b7..bcefe57ed014fccd510d85694487d42f87bd2526 100644 (file)
@@ -498,6 +498,7 @@ static const char * sae_get_password(struct hostapd_data *hapd,
        struct sae_password_entry *pw;
        struct sae_pt *pt = NULL;
        const struct sae_pk *pk = NULL;
+       struct hostapd_sta_wpa_psk_short *psk = NULL;
 
        for (pw = hapd->conf->sae_passwords; pw; pw = pw->next) {
                if (!is_broadcast_ether_addr(pw->peer_addr) &&
@@ -519,6 +520,15 @@ static const char * sae_get_password(struct hostapd_data *hapd,
                pt = hapd->conf->ssid.pt;
        }
 
+       if (!password) {
+               for (psk = sta->psk; psk; psk = psk->next) {
+                       if (psk->is_passphrase) {
+                               password = psk->passphrase;
+                               break;
+                       }
+               }
+       }
+
        if (pw_entry)
                *pw_entry = pw;
        if (s_pt)