fragattacks/src
Nils Nieuwejaar ba4f3224ae Allow remote RADIUS authentication with local VLAN management
The documentation in the hostapd.conf file says that the dynamic_vlan
variable is used to control whether VLAN assignments are accepted from a
RADIUS server. The implication seems to be that a static VLAN assignment
will come from the accept_mac_file if dynamic_vlan is set to 0, and a
dynamic assignment will come from the RADIUS server if dynamic_vlan is
set to 1. Instead, I'm seeing that the static settings from the
accept_mac_file are ignored if dynamic_vlan is set to 0, but used if
dynamic_vlan is set to 1. If dynamic_vlan is set to 1 and the RADIUS
server does not provide a VLAN, then the accept_mac_file assignment is
overridden and the STA is assigned to the default non-VLANed interface.

If my understanding of the expected behavior is correct, then I believe
the problem is in ap_sta_set_vlan(). That routine checks the
dynamic_vlan setting, but has no way of determining whether the incoming
vlan_desc is static (i.e., from accept_mac_file) or dynamic (i.e., from
a RADIUS server).

I've attached a patch that gets hostapd working as I believe it's meant
to, and updates the documentation to make the implicit behavior
explicit.

The functional changes are:

- hostapd_allowed_address() will always extract the vlan_id from the
  accept_macs file. It will not update the vlan_id from the RADIUS cache
  if dynamic_vlan is DISABLED.

- hostapd_acl_recv_radius() will not update the cached vlan_id if
  dynamic_vlan is DISABLED.

- ieee802_1x_receive_auth() will not update the vlan_id if dynamic_vlan
  is DISABLED.

More cosmetic:

Most of the delta is just moving code out of ieee802_1x_receive_auth()
into a new ieee802_1x_update_vlan() routine. While I initially did this
because the new DISABLED check introduced excessive indentation, it has
the added advantage of eliminating the vlan_description allocation and
os_memset() call for all DYNAMIC_VLAN_DISABLED configs.

I've done a couple rounds of review offline with Michael Braun (who has
done much of the work in this part of the code) and incorporated his
feedback.

If dynamic_vlan=0 (disabled), vlan assignments will be managed using the
local accept_mac_file ACL file, even if a RADIUS server is being used
for user authentication. This allows us to manage users and devices
independently.

Signed-off-by: Nils Nieuwejaar <nils.nieuwejaar@gmail.com>
2019-01-02 23:27:49 +02:00
..
ap Allow remote RADIUS authentication with local VLAN management 2019-01-02 23:27:49 +02:00
common Use a helper function for checking Extended Capabilities field 2019-01-02 18:13:19 +02:00
crypto crypto internal: Make MD4 PADDING array const 2019-01-02 17:26:57 +02:00
drivers vlan: Use new bridge ioctl() 2019-01-02 00:23:43 +02:00
eap_common EAP-pwd: Mask timing of PWE derivation 2018-05-28 22:15:15 +03:00
eap_peer EAP-pwd peer: Fix memory leak in eap_pwd_perform_confirm_exchange() 2018-10-16 12:11:32 +03:00
eap_server EAP: Make method and IMSI available from server structures 2018-12-14 15:56:16 +02:00
eapol_auth Add hostapd tls_flags parameter 2017-09-18 12:12:48 +03:00
eapol_supp eap_proxy: Fix memory leaks when using eap_peer_erp_init() 2018-09-21 21:34:08 +03:00
fst fst: Fix compile error in fst_ctrl_aux.h with C++ compilers 2018-05-21 17:47:03 +03:00
l2_packet wpa_supplicant: Don't reply to EAPOL if pkt_type is PACKET_OTHERHOST 2018-04-02 12:21:27 +03:00
p2p P2P: Continue P2P_WAIT_PEER_(IDLE/CONNECT) sequence on a listen cancel 2017-11-03 21:47:32 +02:00
pae mka: Log MI update failure in debug log 2018-12-31 01:09:02 +02:00
radius HS 2.0 server: RADIUS server support for SIM provisioning 2018-12-15 18:01:38 +02:00
rsn_supp OCV: Include and verify OCI in the FILS handshake 2018-12-17 15:50:12 +02:00
tls Use os_memdup() 2017-03-07 13:19:10 +02:00
utils eloop: Fix kqueue event deletion filter 2019-01-02 12:11:52 +02:00
wps WPS: Fix wps_validate_credential() argument type 2018-12-24 11:12:53 +02:00
lib.rules Add QUIET=1 option for make 2014-12-29 15:49:05 +02:00
Makefile FST: Add the Fast Session Transfer (FST) module 2015-07-16 18:26:15 +03:00