aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2014-02-20 10:18:40 -0800
committerDmitry Shmidt <dimitrysh@google.com>2014-02-20 10:18:40 -0800
commit13ca8d8ea51a1aa5e24c6c956473a11b0c7daed4 (patch)
tree7f4beaece38391e858e55616f3d79b00ea095129 /src/radius
parent73bb22fa892a8967f458db5459684617ac52c063 (diff)
downloadandroid_external_wpa_supplicant_8-13ca8d8ea51a1aa5e24c6c956473a11b0c7daed4.tar.gz
android_external_wpa_supplicant_8-13ca8d8ea51a1aa5e24c6c956473a11b0c7daed4.tar.bz2
android_external_wpa_supplicant_8-13ca8d8ea51a1aa5e24c6c956473a11b0c7daed4.zip
Cumulative patch from commit 848905b12abf2df650c43cb821d36a13246baacb
848905b Avoid undefined references with CONFIG_WPA_TRACE_BFD=y 9e38836 wpa_debug: Remove 2048 byte message length limit f667e03 P2P: Address few issues seen with P2P SD e9a6f18 TLS: Add tls_disable_tlsv1_1 and tls_disable_tlsv1_2 phase1 params cb10c7d RADIUS DAS: Add support for NAS identification attributes 0d7c5e1 RADIUS DAS: Remove PMKSA entry on Disconnect-Request d87a6ac WPS: Fix STA state validation when processing PutWLANResponse Change-Id: I4799cad2fe661db567eb3a92af2b3eefb7c96dab Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_das.c35
-rw-r--r--src/radius/radius_das.h7
2 files changed, 42 insertions, 0 deletions
diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c
index b2a27735..9655f4ce 100644
--- a/src/radius/radius_das.c
+++ b/src/radius/radius_das.c
@@ -38,11 +38,16 @@ static struct radius_msg * radius_das_disconnect(struct radius_das_data *das,
struct radius_msg *reply;
u8 allowed[] = {
RADIUS_ATTR_USER_NAME,
+ RADIUS_ATTR_NAS_IP_ADDRESS,
RADIUS_ATTR_CALLING_STATION_ID,
+ RADIUS_ATTR_NAS_IDENTIFIER,
RADIUS_ATTR_ACCT_SESSION_ID,
RADIUS_ATTR_EVENT_TIMESTAMP,
RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
RADIUS_ATTR_CHARGEABLE_USER_IDENTITY,
+#ifdef CONFIG_IPV6
+ RADIUS_ATTR_NAS_IPV6_ADDRESS,
+#endif /* CONFIG_IPV6 */
0
};
int error = 405;
@@ -67,6 +72,36 @@ static struct radius_msg * radius_das_disconnect(struct radius_das_data *das,
os_memset(&attrs, 0, sizeof(attrs));
+ if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_NAS_IP_ADDRESS,
+ &buf, &len, NULL) == 0) {
+ if (len != 4) {
+ wpa_printf(MSG_INFO, "DAS: Invalid NAS-IP-Address from %s:%d",
+ abuf, from_port);
+ error = 407;
+ goto fail;
+ }
+ attrs.nas_ip_addr = buf;
+ }
+
+#ifdef CONFIG_IPV6
+ if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_NAS_IPV6_ADDRESS,
+ &buf, &len, NULL) == 0) {
+ if (len != 16) {
+ wpa_printf(MSG_INFO, "DAS: Invalid NAS-IPv6-Address from %s:%d",
+ abuf, from_port);
+ error = 407;
+ goto fail;
+ }
+ attrs.nas_ipv6_addr = buf;
+ }
+#endif /* CONFIG_IPV6 */
+
+ if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_NAS_IDENTIFIER,
+ &buf, &len, NULL) == 0) {
+ attrs.nas_identifier = buf;
+ attrs.nas_identifier_len = len;
+ }
+
if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_CALLING_STATION_ID,
&buf, &len, NULL) == 0) {
if (len >= sizeof(tmp))
diff --git a/src/radius/radius_das.h b/src/radius/radius_das.h
index 738b18b0..e3ed5408 100644
--- a/src/radius/radius_das.h
+++ b/src/radius/radius_das.h
@@ -18,6 +18,13 @@ enum radius_das_res {
};
struct radius_das_attrs {
+ /* NAS identification attributes */
+ const u8 *nas_ip_addr;
+ const u8 *nas_identifier;
+ size_t nas_identifier_len;
+ const u8 *nas_ipv6_addr;
+
+ /* Session identification attributes */
const u8 *sta_addr;
const u8 *user_name;
size_t user_name_len;