diff mbox series

[v2] SAE: Add support for RADIUS passphrase

Message ID 20220219202530.3861654-1-git@reversity.org
State Accepted
Headers show
Series [v2] SAE: Add support for RADIUS passphrase | expand

Commit Message

Mario Hros Feb. 19, 2022, 8:25 p.m. UTC
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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jouni Malinen March 4, 2022, 4:30 p.m. UTC | #1
On Sat, Feb 19, 2022 at 09:25:30PM +0100, Mario Hros wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 6140a492c..bcefe57ed 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -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)