*pos++ = WLAN_EID_FILS_INDICATION;
len = pos++;
/* TODO: B0..B2: Number of Public Key Identifiers */
- /* TODO: B3..B5: Number of Realm Identifiers */
+ if (hapd->conf->erp_domain) {
+ /* TODO: Support for setting multiple domain identifiers */
+ /* B3..B5: Number of Realm Identifiers */
+ fils_info |= BIT(3);
+ }
/* TODO: B6: FILS IP Address Configuration */
if (hapd->conf->fils_cache_id_set)
fils_info |= BIT(7);
os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
pos += ETH_ALEN;
}
+ if (hapd->conf->erp_domain) {
+ u16 hash;
+
+ hash = fils_domain_name_hash(hapd->conf->erp_domain);
+ WPA_PUT_LE16(pos, hash);
+ pos += 2;
+ }
*len = pos - len - 1;
#endif /* CONFIG_FILS */
#include "includes.h"
#include "common.h"
+#include "utils/crc32.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
return WPA_CIPHER_CCMP_256;
return WPA_CIPHER_CCMP;
}
+
+
+#ifdef CONFIG_FILS
+u16 fils_domain_name_hash(const char *domain)
+{
+ char buf[255], *wpos = buf;
+ const char *pos = domain;
+ size_t len;
+ u32 crc;
+
+ for (len = 0; len < sizeof(buf) && *pos; len++) {
+ if (isalpha(*pos) && isupper(*pos))
+ *wpos++ = tolower(*pos);
+ else
+ *wpos++ = *pos;
+ pos++;
+ }
+
+ crc = crc32((const u8 *) buf, len);
+ return crc & 0xffff;
+}
+#endif /* CONFIG_FILS */
int wpa_write_ciphers(char *start, char *end, int ciphers, const char *delim);
int wpa_select_ap_group_cipher(int wpa, int wpa_pairwise, int rsn_pairwise);
unsigned int wpa_mic_len(int akmp);
+u16 fils_domain_name_hash(const char *domain);
#endif /* WPA_COMMON_H */