diff options
author | Jouni Malinen <j@w1.fi> | 2012-06-17 19:44:46 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-06-17 19:44:46 +0300 |
commit | 302fc0a3c77c96f06722dc09b00d792e7029ab5d (patch) | |
tree | 76d67b5e55b74c7d21a234beede353b2d2c9f6dd /src | |
parent | e58b5ffed7da3a9ee98b76d0c4c5f95d73e0c2f7 (diff) | |
download | external_wpa_supplicant_8_ti-302fc0a3c77c96f06722dc09b00d792e7029ab5d.zip external_wpa_supplicant_8_ti-302fc0a3c77c96f06722dc09b00d792e7029ab5d.tar.gz external_wpa_supplicant_8_ti-302fc0a3c77c96f06722dc09b00d792e7029ab5d.tar.bz2 |
RADIUS DAS: Support Chargeable-User-Identity with Disconnect-Request
Chargeable-User-Identity can now be used in Disconnect-Request to
identify the station to be disconnected.
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r-- | src/ap/hostapd.c | 11 | ||||
-rw-r--r-- | src/radius/radius_das.c | 6 | ||||
-rw-r--r-- | src/radius/radius_das.h | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 3f007ff..22c5e65 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -541,6 +541,17 @@ static struct sta_info * hostapd_das_find_sta(struct hostapd_data *hapd, } } + if (sta == NULL && attr->cui) { + for (sta = hapd->sta_list; sta; sta = sta->next) { + struct wpabuf *cui; + cui = ieee802_1x_get_radius_cui(sta->eapol_sm); + if (cui && wpabuf_len(cui) == attr->cui_len && + os_memcmp(wpabuf_head(cui), attr->cui, + attr->cui_len) == 0) + break; + } + } + if (sta == NULL && attr->user_name) { for (sta = hapd->sta_list; sta; sta = sta->next) { u8 *identity; diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c index a9fcb69..8ecfffc 100644 --- a/src/radius/radius_das.c +++ b/src/radius/radius_das.c @@ -97,6 +97,12 @@ static struct radius_msg * radius_das_disconnect(struct radius_das_data *das, attrs.acct_session_id_len = len; } + if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_CHARGEABLE_USER_IDENTITY, + &buf, &len, NULL) == 0) { + attrs.cui = buf; + attrs.cui_len = len; + } + res = das->disconnect(das->ctx, &attrs); switch (res) { case RADIUS_DAS_NAS_MISMATCH: diff --git a/src/radius/radius_das.h b/src/radius/radius_das.h index d0719ed..738b18b 100644 --- a/src/radius/radius_das.h +++ b/src/radius/radius_das.h @@ -23,6 +23,8 @@ struct radius_das_attrs { size_t user_name_len; const u8 *acct_session_id; size_t acct_session_id_len; + const u8 *cui; + size_t cui_len; }; struct radius_das_conf { |