libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
|
#include "../../core/frame/management/common.h"
#include "../../core/misc/security.h"
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | LIBWIFI_SECURITY_BUF_LEN 256 |
Functions | |
int | libwifi_get_rsn_info (struct libwifi_rsn_info *info, const unsigned char *tag_data, const unsigned char *tag_end) |
Get the RSN related information and store it in a libwifi_rsn_info. More... | |
void | libwifi_enumerate_rsn_suites (struct libwifi_rsn_info *rsn_info, struct libwifi_bss *bss) |
Enumerate the RSN cipher suites in a libwifi_rsn_info. More... | |
int | libwifi_get_wpa_info (struct libwifi_wpa_info *info, const unsigned char *tag_data, const unsigned char *tag_end) |
Get the WPA related information and store it in a libwifi_wpa_info. More... | |
void | libwifi_enumerate_wpa_suites (struct libwifi_wpa_info *wpa_info, struct libwifi_bss *bss) |
Enumerate the WPA cipher suites in a libwifi_wpa_info. More... | |
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 given buffer. More... | |
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 buffer. More... | |
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, formatted into the given buffer. More... | |
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. More... | |
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 functions. More... | |
#define LIBWIFI_SECURITY_BUF_LEN 256 |
Definition at line 24 of file security.h.
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 functions.
buf | A buffer of length LIBWIFI_SECURITY_BUF_LEN |
offset | A pointer to the current buffer offset variable |
append | A pointer to the append state variable |
item | A pointer to the string to append to the given buf |
Definition at line 677 of file security.c.
void libwifi_enumerate_rsn_suites | ( | struct libwifi_rsn_info * | rsn_info, |
struct libwifi_bss * | bss | ||
) |
Enumerate the RSN cipher suites in a libwifi_rsn_info.
This function can be used to fill a libwifi_bss struct with information related to the cipher suites and AKM suites in the specified libwifi_rsn_info.
rsn_info | A libwifi_rsn_info |
libwifi_bss | A libwifi_bss |
Enumerate the RSN cipher suites in a libwifi_rsn_info.
The bss->encryption_info field is a 64-bit wide bitmask. The larger length is required to accomodate the different types of cipher suites without having any overlap between group cipher and pairwise cipher.
Definition at line 123 of file security.c.
void libwifi_enumerate_wpa_suites | ( | struct libwifi_wpa_info * | wpa_info, |
struct libwifi_bss * | bss | ||
) |
Enumerate the WPA cipher suites in a libwifi_wpa_info.
This function can be used to fill a libwifi_bss struct with information related to the cipher suites and AKM suites in the specified libwifi_wpa_info.
wpa_info | A libwifi_wpa_info |
libwifi_bss | A libwifi_bss |
Enumerate the WPA cipher suites in a libwifi_wpa_info.
The bss->encryption_info field is a 64-bit wide bitmask. The larger length is required to accomodate the different types of cipher suites without having any overlap between group cipher and pairwise cipher.
Definition at line 399 of file security.c.
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.
bss | A libwifi_bss struct |
buf | A buffer of length LIBWIFI_SECURITY_BUF_LEN |
Definition at line 601 of file security.c.
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 buffer.
bss | A libwifi_bss struct |
buf | A buffer of length LIBWIFI_SECURITY_BUF_LEN |
Definition at line 494 of file security.c.
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, formatted into the given buffer.
bss | A libwifi_bss struct |
buf | A buffer of length LIBWIFI_SECURITY_BUF_LEN |
Definition at line 546 of file security.c.
int libwifi_get_rsn_info | ( | struct libwifi_rsn_info * | info, |
const unsigned char * | tag_data, | ||
const unsigned char * | tag_end | ||
) |
Get the RSN related information and store it in a libwifi_rsn_info.
This function will detect and enumerate cipher suites, and AKM suites, and the RSN capabilities from a specified RSN IE.
info | A libwifi_rsn_info |
tag_data | An RSN IE tag |
tag_end | The end of the specified RSN IE tag |
Get the RSN related information and store it in a libwifi_rsn_info.
The supplied data is then "walked" through as a pointer to extract the details of the tag and write them into a struct libwifi_rsn_info.
libwifi supports a maximum of 3 Pairwise Cipher Suites and 3 Auth Key Management Suites. The Version, Group Cipher Suite and Capabilities fields are all required.
Definition at line 32 of file security.c.
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 given buffer.
bss | A libwifi_bss struct |
buf | A buffer of length LIBWIFI_SECURITY_BUF_LEN |
Definition at line 469 of file security.c.
int libwifi_get_wpa_info | ( | struct libwifi_wpa_info * | info, |
const unsigned char * | tag_data, | ||
const unsigned char * | tag_end | ||
) |
Get the WPA related information and store it in a libwifi_wpa_info.
This function will detect and enumerate cipher suites and AKM suites from a specified WPA IE.
info | A libwifi_wpa_info |
tag_data | A WPA IE tag |
tag_end | The end of the specified WPA IE tag |
Get the WPA related information and store it in a libwifi_wpa_info.
The supplied data is then "walked" through as a pointer to extract the details of the tag and write them into a struct libwifi_wpa_info.
libwifi supports a maximum of 3 Unicast Cipher Suites and 3 Auth Key Management Suites. The Version and Multicast Cipher Suite fields are required.
Definition at line 315 of file security.c.