Skip to contentSkip to conversation

doc: add CONFIG_DRIVER_NONE to hostapd config

PATCH In review James Prestwood 2 participants 6 messages Dec 30, 2019 – Jan 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 doc: add CONFIG_DRIVER_NONE to hostapd config

This allows hostapd to be started as a standalone radius server

---
 doc/hostapd.config | 1 +
 1 file changed, 1 insertion(+)
doc/hostapd.config +1 -0
index cf88386e..2ad99b8a 100644
@@ -1,5 +1,6 @@
 CONFIG_DRIVER_HOSTAP=y
 CONFIG_DRIVER_NL80211=y
+CONFIG_DRIVER_NONE=y
 CONFIG_LIBNL32=y
 CONFIG_IAPP=y
 CONFIG_RSN_PREAUTH=y
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/5 test-runner: add special radius_server key

Some test cases require (at least with recent hostapd versions) a stand alone radius server. This is done using driver=none in the hostapd config file. For this use case hostapd does not need any radio since its not doing anything wireless related.

Now inside the hw.conf file, under the HOSTAPD group, you can specify a config file as the value to 'radius_server' key. This config file will be used without any associated radio when hostapd is started.

---
 tools/test-runner.c | 3 +++
 1 file changed, 3 insertions(+)
tools/test-runner.c +3 -0
index 71c5f14e..6a3a2932 100644
@@ -1398,6 +1398,9 @@ static bool configure_hostapd_instances(struct l_settings *hw_settings,
 			goto done;
 		}
 
+		if (!strcmp(hostap_keys[i], "radius_server"))
+			continue;
+
 		for (wiphy_entry = l_queue_get_entries(wiphy_list);
 					wiphy_entry;
 					wiphy_entry = wiphy_entry->next,
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/5 auto-t: use stand alone radius server for testFILS

In reply to James Prestwood

This fixes the test with recent hostapd versions

---
 autotests/testFILS/hw.conf           |  1 +
 autotests/testFILS/radius.conf       | 15 +++++++++++++++
 autotests/testFILS/ssidFILS-256.conf |  8 --------
 autotests/testFILS/ssidFILS-384.conf |  6 ------
 4 files changed, 16 insertions(+), 14 deletions(-)
 create mode 100644 autotests/testFILS/radius.conf
autotests/testFILS/hw.conf +1 -0
index 0028b5f6..3b88f36f 100644
@@ -7,3 +7,4 @@ start_iwd=0
 [HOSTAPD]
 rad0=ssidFILS-256.conf
 rad1=ssidFILS-384.conf
+radius_server=radius.conf
autotests/testFILS/radius.conf new file +15 -0
new file mode 100644
index 00000000..4fcfdfff
@@ -0,0 +1,15 @@
+driver=none
+radius_server_clients=/tmp/certs/radius-clients.text
+radius_server_auth_port=1812
+eap_user_file=/tmp/pwd.eap_user
+eap_server=0
+eap_server_erp=1
+
+erp_send_reauth_start=1
+erp_domain=example.com
+fils_realm=example.com
+disable_pmksa_caching=1
+
+pwd_group=19
+wpa_group_rekey=30
+wpa_ptk_rekey=30
autotests/testFILS/ssidFILS-256.conf +0 -8
index b3f3139a..a5f70f3a 100644
@@ -14,16 +14,8 @@ auth_server_port=1812
 auth_server_shared_secret=secret
 nas_identifier=nas.w1.fi
 
-erp_send_reauth_start=1
-erp_domain=example.com
 fils_realm=example.com
 disable_pmksa_caching=1
 
-radius_server_clients=/tmp/certs/radius-clients.text
-radius_server_auth_port=1812
-eap_server=0
-eap_user_file=/tmp/pwd.eap_user
-eap_server_erp=1
-pwd_group=19
 wpa_group_rekey=30
 wpa_ptk_rekey=30
autotests/testFILS/ssidFILS-384.conf +0 -6
index 9a3a3059..613c37be 100644
@@ -14,14 +14,8 @@ auth_server_port=1812
 auth_server_shared_secret=secret
 nas_identifier=nas.w1.fi
 
-erp_send_reauth_start=1
-erp_domain=example.com
 fils_realm=example.com
 disable_pmksa_caching=1
 
-eap_server=0
-eap_user_file=/tmp/pwd.eap_user
-eap_server_erp=1
-pwd_group=19
 wpa_group_rekey=30
 wpa_ptk_rekey=30
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/5 auto-t: use stand alone radius server for testFT-FILS-SHA256

In reply to James Prestwood

This fixes the test with recent hostapd versions

---
 autotests/testFT-FILS-SHA256/ft-eap-ccmp-1.conf | 14 ++------------
 autotests/testFT-FILS-SHA256/ft-eap-ccmp-2.conf | 11 ++---------
 autotests/testFT-FILS-SHA256/hw.conf            |  1 +
 autotests/testFT-FILS-SHA256/radius.conf        | 15 +++++++++++++++
 4 files changed, 20 insertions(+), 21 deletions(-)
 create mode 100644 autotests/testFT-FILS-SHA256/radius.conf
autotests/testFT-FILS-SHA256/ft-eap-ccmp-1.conf +2 -12
index a55d90a2..1853ff70 100644
@@ -12,16 +12,9 @@ wpa=2
 wpa_key_mgmt=FT-EAP FILS-SHA256 FT-FILS-SHA256
 wpa_pairwise=CCMP
 ieee8021x=1
-eap_server=0
-eap_server_erp=1
-erp_domain=example.com
+
 fils_realm=example.com
-#eap_user_file=/tmp/certs/eap-user-tls.text
-eap_user_file=/tmp/pwd.eap_user
-pwd_group=19
-#ca_cert=/tmp/certs/cert-ca.pem
-#server_cert=/tmp/certs/cert-server.pem
-#private_key=/tmp/certs/cert-server-key.pem
+
 wpa_ptk_rekey=30
 wpa_group_rekey=80
 ieee80211w=1
@@ -43,9 +36,6 @@ ap_table_expiration_time=36000
 ap_table_max_size=10
 rrm_neighbor_report=1
 
-radius_server_clients=/tmp/certs/radius-clients.text
-radius_server_auth_port=1812
-
 auth_server_addr=127.0.0.1
 auth_server_port=1812
 auth_server_shared_secret=secret
autotests/testFT-FILS-SHA256/ft-eap-ccmp-2.conf +2 -9
index a7878264..24266ea9 100644
@@ -12,16 +12,9 @@ wpa=2
 wpa_key_mgmt=FT-FILS-SHA256
 wpa_pairwise=CCMP
 ieee8021x=1
-eap_server=0
-eap_server_erp=1
-erp_domain=example.com
+
 fils_realm=example.com
-#eap_user_file=/tmp/certs/eap-user-tls.text
-eap_user_file=/tmp/pwd.eap_user
-pwd_group=19
-#ca_cert=/tmp/certs/cert-ca.pem
-#server_cert=/tmp/certs/cert-server.pem
-#private_key=/tmp/certs/cert-server-key.pem
+
 wpa_ptk_rekey=30
 wpa_group_rekey=80
 ieee80211w=1
autotests/testFT-FILS-SHA256/hw.conf +1 -0
index 9ea4f110..b5c6757c 100644
@@ -7,3 +7,4 @@ iwd_config_dir=/tmp
 [HOSTAPD]
 rad0=ft-eap-ccmp-1.conf
 rad1=ft-eap-ccmp-2.conf
+radius_server=radius.conf
autotests/testFT-FILS-SHA256/radius.conf new file +15 -0
new file mode 100644
index 00000000..4fcfdfff
@@ -0,0 +1,15 @@
+driver=none
+radius_server_clients=/tmp/certs/radius-clients.text
+radius_server_auth_port=1812
+eap_user_file=/tmp/pwd.eap_user
+eap_server=0
+eap_server_erp=1
+
+erp_send_reauth_start=1
+erp_domain=example.com
+fils_realm=example.com
+disable_pmksa_caching=1
+
+pwd_group=19
+wpa_group_rekey=30
+wpa_ptk_rekey=30
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/5 auto-t: use stand alone radius server for testFT-FILS-SHA384

In reply to James Prestwood

This fixes the test with recent hostapd versions

---
 autotests/testFT-FILS-SHA384/ft-eap-ccmp-1.conf | 14 ++------------
 autotests/testFT-FILS-SHA384/ft-eap-ccmp-2.conf | 11 ++---------
 autotests/testFT-FILS-SHA384/hw.conf            |  1 +
 autotests/testFT-FILS-SHA384/radius.conf        | 15 +++++++++++++++
 4 files changed, 20 insertions(+), 21 deletions(-)
 create mode 100644 autotests/testFT-FILS-SHA384/radius.conf
autotests/testFT-FILS-SHA384/ft-eap-ccmp-1.conf +2 -12
index ae1d4bfe..61262c69 100644
@@ -12,16 +12,9 @@ wpa=2
 wpa_key_mgmt=FT-EAP FILS-SHA384 FT-FILS-SHA384
 wpa_pairwise=CCMP
 ieee8021x=1
-eap_server=0
-eap_server_erp=1
-erp_domain=example.com
+
 fils_realm=example.com
-#eap_user_file=/tmp/certs/eap-user-tls.text
-eap_user_file=/tmp/pwd.eap_user
-pwd_group=19
-#ca_cert=/tmp/certs/cert-ca.pem
-#server_cert=/tmp/certs/cert-server.pem
-#private_key=/tmp/certs/cert-server-key.pem
+
 wpa_ptk_rekey=30
 wpa_group_rekey=80
 ieee80211w=1
@@ -43,9 +36,6 @@ ap_table_expiration_time=36000
 ap_table_max_size=10
 rrm_neighbor_report=1
 
-radius_server_clients=/tmp/certs/radius-clients.text
-radius_server_auth_port=1812
-
 auth_server_addr=127.0.0.1
 auth_server_port=1812
 auth_server_shared_secret=secret
autotests/testFT-FILS-SHA384/ft-eap-ccmp-2.conf +2 -9
index 0c4deee8..8af73cbc 100644
@@ -12,16 +12,9 @@ wpa=2
 wpa_key_mgmt=FT-FILS-SHA384
 wpa_pairwise=CCMP
 ieee8021x=1
-eap_server=0
-eap_server_erp=1
-erp_domain=example.com
+
 fils_realm=example.com
-#eap_user_file=/tmp/certs/eap-user-tls.text
-eap_user_file=/tmp/pwd.eap_user
-pwd_group=19
-#ca_cert=/tmp/certs/cert-ca.pem
-#server_cert=/tmp/certs/cert-server.pem
-#private_key=/tmp/certs/cert-server-key.pem
+
 wpa_ptk_rekey=30
 wpa_group_rekey=80
 ieee80211w=1
autotests/testFT-FILS-SHA384/hw.conf +1 -0
index 9ea4f110..b5c6757c 100644
@@ -7,3 +7,4 @@ iwd_config_dir=/tmp
 [HOSTAPD]
 rad0=ft-eap-ccmp-1.conf
 rad1=ft-eap-ccmp-2.conf
+radius_server=radius.conf
autotests/testFT-FILS-SHA384/radius.conf new file +15 -0
new file mode 100644
index 00000000..4fcfdfff
@@ -0,0 +1,15 @@
+driver=none
+radius_server_clients=/tmp/certs/radius-clients.text
+radius_server_auth_port=1812
+eap_user_file=/tmp/pwd.eap_user
+eap_server=0
+eap_server_erp=1
+
+erp_send_reauth_start=1
+erp_domain=example.com
+fils_realm=example.com
+disable_pmksa_caching=1
+
+pwd_group=19
+wpa_group_rekey=30
+wpa_ptk_rekey=30
Signature · 1 line
2.17.1
#5 lore raw
In reply to James Prestwood

Hi James,

Quoted 5 lines · James Prestwood

This allows hostapd to be started as a standalone radius server

---
  doc/hostapd.config | 1 +
  1 file changed, 1 insertion(+)

All applied, thanks.

Regards,
-Denis