17#include "../../core/misc/byteswap.h"
33 const unsigned char *tag_end) {
37 unsigned char *data = (
unsigned char *) tag_data;
51 if ((data +
sizeof(uint16_t)) > tag_end) {
54 uint16_t suite_count = *data;
58 data +=
sizeof(suite_count);
65 struct wifi_cipher_suite *cur_cipher_suite = NULL;
66 for (
int i = 0; i < suite_count; ++i) {
70 cur_cipher_suite = (
struct wifi_cipher_suite *) data;
77 if ((data +
sizeof(suite_count)) > tag_end) {
84 data +=
sizeof(suite_count);
91 for (
int i = 0; i < suite_count; ++i) {
95 cur_cipher_suite = (
struct wifi_cipher_suite *) data;
102 if (data > tag_end) {
316 const unsigned char *tag_end) {
320 unsigned char *data = ((
unsigned char *) tag_data);
331 if (data > tag_end) {
334 if ((data +
sizeof(uint16_t)) > tag_end) {
337 uint16_t suite_count = *data;
341 data +=
sizeof(suite_count);
348 struct wifi_cipher_suite *cur_cipher_suite = NULL;
349 for (
int i = 0; i < suite_count; ++i) {
350 if (data > tag_end) {
353 cur_cipher_suite = (
struct wifi_cipher_suite *) data;
360 if ((data +
sizeof(suite_count)) > tag_end) {
367 data +=
sizeof(suite_count);
374 for (
int i = 0; i < suite_count; ++i) {
375 if (data > tag_end) {
378 cur_cipher_suite = (
struct wifi_cipher_suite *) data;
680 *offset += strlen(
", ");
683 *offset += strlen(item);
#define LIBWIFI_AKM_SUITE_1X_FT_SHA384
#define AKM_SUITE_1X_FT_SHA384
#define AKM_SUITE_PSK_SHA256
#define CIPHER_SUITE_RESERVED
#define LIBWIFI_GROUP_CIPHER_SUITE_RESERVED
#define LIBWIFI_GROUP_CIPHER_SUITE_CCMP128
#define CIPHER_SUITE_WEP40
#define LIBWIFI_AKM_SUITE_1X_FT
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_RESERVED
#define CIPHER_SUITE_BIP_CMAC256
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_CMAC128
#define CIPHER_SUITE_GCMP256
#define LIBWIFI_AKM_SUITE_OWE
#define LIBWIFI_GROUP_CIPHER_SUITE_GCMP256
#define LIBWIFI_AKM_SUITE_FILS_SHA384_FT
#define CIPHER_SUITE_WEP104
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_TKIP
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_GCMP256
#define LIBWIFI_GROUP_CIPHER_SUITE_CCMP256
#define LIBWIFI_AKM_SUITE_1X_SUITEB_SHA256
#define LIBWIFI_MAX_CIPHER_SUITES
#define LIBWIFI_AKM_SUITE_FILS_SHA256_FT
#define LIBWIFI_GROUP_CIPHER_SUITE_TKIP
#define CIPHER_SUITE_NOTALLOWED
#define LIBWIFI_GROUP_CIPHER_SUITE_WEP104
#define AKM_SUITE_1X_SUITEB_SHA256
#define LIBWIFI_PAIRWISE_SUITE_GROUP
#define LIBWIFI_AKM_SUITE_PSK
#define AKM_PSK_SHA384_FT
#define LIBWIFI_AKM_SUITE_1X_SHA256
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_GMAC256
#define LIBWIFI_AKM_SUITE_PSK_SHA256
#define CIPHER_SUITE_BIP_CMAC128
#define AKM_SUITE_FILS_SHA384
#define CIPHER_SUITE_CCMP128
#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_CMAC256
#define LIBWIFI_AKM_SUITE_1X_SUITEB_SHA384
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_NOTALLOWED
#define CIPHER_SUITE_CCMP256
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_CCMP256
#define AKM_SUITE_1X_SUITEB_SHA384
#define LIBWIFI_AKM_SUITE_FILS_SHA256
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_WEP40
#define CIPHER_SUITE_BIP_GMAC256
#define CIPHER_SUITE_TKIP
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_CMAC256
#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_GMAC128
#define AKM_SUITE_AP_PEER
#define CIPHER_SUITE_GROUP
#define LIBWIFI_AKM_SUITE_SAE_FT
#define LIBWIFI_AKM_SUITE_SAE
#define LIBWIFI_AKM_SUITE_AP_PEER
#define LIBWIFI_GROUP_CIPHER_SUITE_WEP40
#define LIBWIFI_AKM_SUITE_FILS_SHA384
#define LIBWIFI_AKM_SUITE_RESERVED
#define LIBWIFI_AKM_SUITE_TDLS
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_GCMP128
#define LIBWIFI_AKM_SUITE_1X
#define AKM_SUITE_FILS_SHA384_FT
#define LIBWIFI_AKM_PSK_SHA384
#define CIPHER_SUITE_BIP_GMAC128
#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_CMAC128
#define LIBWIFI_GROUP_CIPHER_SUITE_NOTALLOWED
#define AKM_SUITE_RESERVED
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_WEP104
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_CCMP128
#define AKM_SUITE_FILS_SHA256_FT
#define LIBWIFI_AKM_PSK_SHA384_FT
#define AKM_SUITE_FILS_SHA256
#define LIBWIFI_AKM_SUITE_PSK_FT
#define AKM_SUITE_1X_SHA256
#define LIBWIFI_GROUP_CIPHER_SUITE_BIP_GMAC256
#define LIBWIFI_GROUP_CIPHER_SUITE_GCMP128
#define CIPHER_SUITE_GCMP128
#define LIBWIFI_PAIRWISE_CIPHER_SUITE_BIP_GMAC128
#define LIBWIFI_SECURITY_BUF_LEN
void _libwifi_add_sec_item(char *buf, int *offset, int *append, char *item)
Internal function for adding a formatted string to a buffer for use with libwifi_get_* security funct...
void libwifi_get_group_ciphers(struct libwifi_bss *bss, char *buf)
Enumerate the group ciphers (CCMP, GCMP128, etc) in a given libwifi_bss, formatted into the given buf...
void libwifi_enumerate_rsn_suites(struct libwifi_rsn_info *rsn_info, struct libwifi_bss *bss)
This function will enumerate over a supplied struct libwifi_rsn_info and write the following into a s...
void libwifi_get_security_type(struct libwifi_bss *bss, char *buf)
Enumerate the security types (WEP, WPA, WPA2, WPA3, etc) in a given libwifi_bss, formatted into the g...
int libwifi_get_wpa_info(struct libwifi_wpa_info *info, const unsigned char *tag_data, const unsigned char *tag_end)
Similar to libwifi_get_rsn_info, WPA Information is supplied via the raw tag data.
int libwifi_get_rsn_info(struct libwifi_rsn_info *info, const unsigned char *tag_data, const unsigned char *tag_end)
RSN Information is supplied via the raw tag data.
void libwifi_get_pairwise_ciphers(struct libwifi_bss *bss, char *buf)
Enumerate the pairwise ciphers (GROUP, CCMP, BIP_CMAC128, etc) in a given libwifi_bss,...
void libwifi_get_auth_key_suites(struct libwifi_bss *bss, char *buf)
Enumerate the auth key management suites in a given libwifi_bss, formatted into the given buffer.
void libwifi_enumerate_wpa_suites(struct libwifi_wpa_info *wpa_info, struct libwifi_bss *bss)
Similarly to libwifi_enumerate_wpa_suites, this function will enumerate over a supplied struct libwif...
libwifi Representation of a WPA or RSN cipher suite ┌────────────────────────┬────────────┐ │ OUI │ S...
libwifi Representation of a 802.11 RSN Information Element ┌───────────────────────────────────┐ │ Ve...
uint16_t rsn_capabilities
int num_pairwise_cipher_suites
int num_auth_key_mgmt_suites
struct libwifi_cipher_suite auth_key_mgmt_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite pairwise_cipher_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite group_cipher_suite
libwifi Representation of a Microsoft WPA Information Element ┌───────────────────────────────────┐ │...
struct libwifi_cipher_suite unicast_cipher_suites[LIBWIFI_MAX_CIPHER_SUITES]
struct libwifi_cipher_suite multicast_cipher_suite
uint16_t num_unicast_cipher_suites
struct libwifi_cipher_suite auth_key_mgmt_suites[LIBWIFI_MAX_CIPHER_SUITES]
uint16_t num_auth_key_mgmt_suites