mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-05 14:56:32 +02:00
IDF release/v4.0 b0f053d82
This commit is contained in:
@ -110,6 +110,7 @@ typedef struct {
|
||||
int wifi_task_core_id; /**< WiFi Task Core ID */
|
||||
int beacon_max_len; /**< WiFi softAP maximum length of the beacon */
|
||||
int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */
|
||||
uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */
|
||||
int magic; /**< WiFi init magic number, it should be the last field */
|
||||
} wifi_init_config_t;
|
||||
|
||||
@ -156,6 +157,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
|
||||
extern uint64_t g_wifi_feature_caps;
|
||||
|
||||
#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
|
||||
|
||||
@ -189,6 +191,8 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
|
||||
#define WIFI_MGMT_SBUF_NUM 32
|
||||
#endif
|
||||
|
||||
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
|
||||
|
||||
#define WIFI_INIT_CONFIG_DEFAULT() { \
|
||||
.event_handler = &esp_event_send, \
|
||||
.osi_funcs = &g_wifi_osi_funcs, \
|
||||
@ -208,6 +212,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
|
||||
.wifi_task_core_id = WIFI_TASK_CORE_ID,\
|
||||
.beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \
|
||||
.mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \
|
||||
.feature_caps = g_wifi_feature_caps, \
|
||||
.magic = WIFI_INIT_CONFIG_MAGIC\
|
||||
};
|
||||
|
||||
|
@ -116,7 +116,7 @@ typedef int (*esp_aes_unwrap_t)(const unsigned char *kek, int n, const unsigned
|
||||
* @param mac Buffer for the hash (32 bytes).
|
||||
*
|
||||
*/
|
||||
typedef void (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem,
|
||||
typedef int (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem,
|
||||
const unsigned char *addr[], const int *len, unsigned char *mac);
|
||||
|
||||
/**
|
||||
@ -131,7 +131,7 @@ typedef void (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len,
|
||||
* @param buf_len Number of bytes of key to generate.
|
||||
*
|
||||
*/
|
||||
typedef void (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label,
|
||||
typedef int (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label,
|
||||
const unsigned char *data, int data_len, unsigned char *buf, int buf_len);
|
||||
|
||||
/**
|
||||
@ -315,6 +315,47 @@ typedef void * (*esp_aes_decrypt_init_t)(const unsigned char *key, unsigned int
|
||||
*/
|
||||
typedef void (*esp_aes_decrypt_deinit_t)(void *ctx);
|
||||
|
||||
/**
|
||||
* @brief One-Key CBC MAC (OMAC1) hash with AES-128 for MIC computation
|
||||
*
|
||||
* @key: 128-bit key for the hash operation
|
||||
* @data: Data buffer for which a MIC is computed
|
||||
* @data_len: Length of data buffer in bytes
|
||||
* @mic: Buffer for MIC (128 bits, i.e., 16 bytes)
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*/
|
||||
typedef int (*esp_omac1_aes_128_t)(const uint8_t *key, const uint8_t *data, size_t data_len,
|
||||
uint8_t *mic);
|
||||
|
||||
/**
|
||||
* @brief Decrypt data using CCMP (Counter Mode CBC-MAC Protocol OR
|
||||
* Counter Mode Cipher Block Chaining Message Authentication
|
||||
* Code Protocol) which is used in IEEE 802.11i RSN standard.
|
||||
* @tk: 128-bit Temporal Key for obtained during 4-way handshake
|
||||
* @hdr: Pointer to IEEE802.11 frame headeri needed for AAD
|
||||
* @data: Pointer to encrypted data buffer
|
||||
* @data_len: Encrypted data length in bytes
|
||||
* @decrypted_len: Length of decrypted data
|
||||
* Returns: Pointer to decrypted data on success, NULL on failure
|
||||
*/
|
||||
typedef uint8_t * (*esp_ccmp_decrypt_t)(const uint8_t *tk, const uint8_t *ieee80211_hdr,
|
||||
const uint8_t *data, size_t data_len, size_t *decrypted_len);
|
||||
|
||||
/**
|
||||
* @brief Encrypt data using CCMP (Counter Mode CBC-MAC Protocol OR
|
||||
* Counter Mode Cipher Block Chaining Message Authentication
|
||||
* Code Protocol) which is used in IEEE 802.11i RSN standard.
|
||||
* @tk: 128-bit Temporal Key for obtained during 4-way handshake
|
||||
* @frame: Pointer to IEEE802.11 frame including header
|
||||
* @len: Length of the frame including header
|
||||
* @hdrlen: Length of the header
|
||||
* @pn: Packet Number counter
|
||||
* @keyid: Key ID to be mentioned in CCMP Vector
|
||||
* @encrypted_len: Length of the encrypted frame including header
|
||||
*/
|
||||
typedef uint8_t * (*esp_ccmp_encrypt_t)(const uint8_t *tk, uint8_t *frame, size_t len, size_t hdrlen,
|
||||
uint8_t *pn, int keyid, size_t *encrypted_len);
|
||||
|
||||
/**
|
||||
* @brief The crypto callback function structure used when do station security connect.
|
||||
* The structure can be set as software crypto or the crypto optimized by ESP32
|
||||
@ -342,6 +383,9 @@ typedef struct {
|
||||
esp_aes_decrypt_t aes_decrypt;
|
||||
esp_aes_decrypt_init_t aes_decrypt_init;
|
||||
esp_aes_decrypt_deinit_t aes_decrypt_deinit;
|
||||
esp_omac1_aes_128_t omac1_aes_128;
|
||||
esp_ccmp_decrypt_t ccmp_decrypt;
|
||||
esp_ccmp_encrypt_t ccmp_encrypt;
|
||||
}wpa_crypto_funcs_t;
|
||||
|
||||
/**
|
||||
|
@ -56,6 +56,7 @@ typedef enum {
|
||||
WIFI_AUTH_WPA2_PSK, /**< authenticate mode : WPA2_PSK */
|
||||
WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */
|
||||
WIFI_AUTH_WPA2_ENTERPRISE, /**< authenticate mode : WPA2_ENTERPRISE */
|
||||
WIFI_AUTH_WPA3_PSK, /**< authenticate mode : WPA3_PSK */
|
||||
WIFI_AUTH_MAX
|
||||
} wifi_auth_mode_t;
|
||||
|
||||
@ -84,6 +85,8 @@ typedef enum {
|
||||
WIFI_REASON_802_1X_AUTH_FAILED = 23,
|
||||
WIFI_REASON_CIPHER_SUITE_REJECTED = 24,
|
||||
|
||||
WIFI_REASON_INVALID_PMKID = 53,
|
||||
|
||||
WIFI_REASON_BEACON_TIMEOUT = 200,
|
||||
WIFI_REASON_NO_AP_FOUND = 201,
|
||||
WIFI_REASON_AUTH_FAIL = 202,
|
||||
@ -134,6 +137,7 @@ typedef enum {
|
||||
WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */
|
||||
WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */
|
||||
WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */
|
||||
WIFI_CIPHER_TYPE_AES_CMAC128,/**< the cipher type is AES-CMAC-128 */
|
||||
WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */
|
||||
} wifi_cipher_type_t;
|
||||
|
||||
@ -199,6 +203,12 @@ typedef enum {
|
||||
WIFI_BW_HT40, /* Bandwidth is HT40 */
|
||||
} wifi_bandwidth_t;
|
||||
|
||||
/** Configuration structure for Protected Management Frame */
|
||||
typedef struct {
|
||||
bool capable; /**< Advertizes support for Protected Management Frame. Device will prefer to connect in PMF mode if other device also advertizes PMF capability. */
|
||||
bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */
|
||||
} wifi_pmf_config_t;
|
||||
|
||||
/** @brief Soft-AP configuration settings for the ESP32 */
|
||||
typedef struct {
|
||||
uint8_t ssid[32]; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */
|
||||
@ -222,6 +232,7 @@ typedef struct {
|
||||
uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */
|
||||
wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */
|
||||
wifi_scan_threshold_t threshold; /**< When sort_method is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */
|
||||
wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */
|
||||
} wifi_sta_config_t;
|
||||
|
||||
/** @brief Configuration data for ESP32 AP or STA.
|
||||
|
Reference in New Issue
Block a user