mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-17 17:43:06 -05:00
Add support for advertising UTF-8 SSID extended capability
This field can be used to indicate that UTF-8 encoding is used in the SSID field. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
a8e93a1a01
commit
b93c8509cc
@ -1780,6 +1780,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
|
|||||||
bss->ssid.ssid_set = 1;
|
bss->ssid.ssid_set = 1;
|
||||||
}
|
}
|
||||||
os_free(str);
|
os_free(str);
|
||||||
|
} else if (os_strcmp(buf, "utf8_ssid") == 0) {
|
||||||
|
bss->ssid.utf8_ssid = atoi(pos) > 0;
|
||||||
} else if (os_strcmp(buf, "macaddr_acl") == 0) {
|
} else if (os_strcmp(buf, "macaddr_acl") == 0) {
|
||||||
bss->macaddr_acl = atoi(pos);
|
bss->macaddr_acl = atoi(pos);
|
||||||
if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED &&
|
if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED &&
|
||||||
|
@ -90,6 +90,9 @@ ssid=test
|
|||||||
#ssid2=74657374
|
#ssid2=74657374
|
||||||
#ssid2=P"hello\nthere"
|
#ssid2=P"hello\nthere"
|
||||||
|
|
||||||
|
# UTF-8 SSID: Whether the SSID is to be interpreted using UTF-8 encoding
|
||||||
|
#utf8_ssid=1
|
||||||
|
|
||||||
# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
|
# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
|
||||||
# Set as needed to indicate country in which device is operating.
|
# Set as needed to indicate country in which device is operating.
|
||||||
# This can limit available channels and transmit power.
|
# This can limit available channels and transmit power.
|
||||||
|
@ -51,7 +51,8 @@ typedef enum hostap_security_policy {
|
|||||||
struct hostapd_ssid {
|
struct hostapd_ssid {
|
||||||
u8 ssid[HOSTAPD_MAX_SSID_LEN];
|
u8 ssid[HOSTAPD_MAX_SSID_LEN];
|
||||||
size_t ssid_len;
|
size_t ssid_len;
|
||||||
int ssid_set;
|
unsigned int ssid_set:1;
|
||||||
|
unsigned int utf8_ssid:1;
|
||||||
|
|
||||||
char vlan[IFNAMSIZ + 1];
|
char vlan[IFNAMSIZ + 1];
|
||||||
secpolicy security_policy;
|
secpolicy security_policy;
|
||||||
|
@ -175,6 +175,8 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
|
|||||||
len = 4;
|
len = 4;
|
||||||
if (len < 3 && hapd->conf->wnm_sleep_mode)
|
if (len < 3 && hapd->conf->wnm_sleep_mode)
|
||||||
len = 3;
|
len = 3;
|
||||||
|
if (len < 7 && hapd->conf->ssid.utf8_ssid)
|
||||||
|
len = 7;
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return eid;
|
return eid;
|
||||||
|
|
||||||
@ -206,6 +208,18 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
|
|||||||
*pos |= 0x80; /* Bit 39 - TDLS Channel Switching Prohibited */
|
*pos |= 0x80; /* Bit 39 - TDLS Channel Switching Prohibited */
|
||||||
pos++;
|
pos++;
|
||||||
|
|
||||||
|
if (len < 6)
|
||||||
|
return pos;
|
||||||
|
*pos = 0x00;
|
||||||
|
pos++;
|
||||||
|
|
||||||
|
if (len < 7)
|
||||||
|
return pos;
|
||||||
|
*pos = 0x00;
|
||||||
|
if (hapd->conf->ssid.utf8_ssid)
|
||||||
|
*pos |= 0x01; /* Bit 48 - UTF-8 SSID */
|
||||||
|
pos++;
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user