Skip to content

Commit 8c8d861

Browse files
author
me-no-dev
committed
IDF release/v4.0 b0f053d82
1 parent c2da050 commit 8c8d861

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+235
-492
lines changed

tools/sdk/include/config/sdkconfig.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CONFIG_SDK_PYTHON "python"
1111
#define CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES 1
1212
#define CONFIG_APP_COMPILE_TIME_DATE 1
13+
#define CONFIG_APP_RETRIEVE_LEN_ELF_SHA 16
1314
#define CONFIG_ENABLE_ARDUINO_DEPENDS 1
1415
#define CONFIG_AUTOSTART_ARDUINO 1
1516
#define CONFIG_ARDUINO_RUN_CORE1 1
@@ -155,6 +156,7 @@
155156
#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1
156157
#define CONFIG_ESP32_RTC_CLK_SRC_INT_RC 1
157158
#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024
159+
#define CONFIG_ESP32_RTC_XTAL_CAL_RETRY 1
158160
#define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000
159161
#define CONFIG_ESP32_XTAL_FREQ_AUTO 1
160162
#define CONFIG_ESP32_XTAL_FREQ 0
@@ -216,6 +218,7 @@
216218
#define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752
217219
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
218220
#define CONFIG_ESP32_WIFI_IRAM_OPT 1
221+
#define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1
219222
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1
220223
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20
221224
#define CONFIG_ESP32_PHY_MAX_TX_POWER 20
@@ -1987,5 +1990,5 @@
19871990
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
19881991
#endif
19891992

1990-
#define CONFIG_ARDUINO_IDF_COMMIT "fe67bedee"
1993+
#define CONFIG_ARDUINO_IDF_COMMIT "b0f053d82"
19911994
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.0"

tools/sdk/include/esp_wifi/esp_wifi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ typedef struct {
110110
int wifi_task_core_id; /**< WiFi Task Core ID */
111111
int beacon_max_len; /**< WiFi softAP maximum length of the beacon */
112112
int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */
113+
uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */
113114
int magic; /**< WiFi init magic number, it should be the last field */
114115
} wifi_init_config_t;
115116

@@ -156,6 +157,7 @@ typedef struct {
156157
#endif
157158

158159
extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
160+
extern uint64_t g_wifi_feature_caps;
159161

160162
#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
161163

@@ -189,6 +191,8 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
189191
#define WIFI_MGMT_SBUF_NUM 32
190192
#endif
191193

194+
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
195+
192196
#define WIFI_INIT_CONFIG_DEFAULT() { \
193197
.event_handler = &esp_event_send, \
194198
.osi_funcs = &g_wifi_osi_funcs, \
@@ -208,6 +212,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
208212
.wifi_task_core_id = WIFI_TASK_CORE_ID,\
209213
.beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \
210214
.mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \
215+
.feature_caps = g_wifi_feature_caps, \
211216
.magic = WIFI_INIT_CONFIG_MAGIC\
212217
};
213218

tools/sdk/include/esp_wifi/esp_wifi_crypto_types.h

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ typedef int (*esp_aes_unwrap_t)(const unsigned char *kek, int n, const unsigned
116116
* @param mac Buffer for the hash (32 bytes).
117117
*
118118
*/
119-
typedef void (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem,
119+
typedef int (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem,
120120
const unsigned char *addr[], const int *len, unsigned char *mac);
121121

122122
/**
@@ -131,7 +131,7 @@ typedef void (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len,
131131
* @param buf_len Number of bytes of key to generate.
132132
*
133133
*/
134-
typedef void (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label,
134+
typedef int (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label,
135135
const unsigned char *data, int data_len, unsigned char *buf, int buf_len);
136136

137137
/**
@@ -315,6 +315,47 @@ typedef void * (*esp_aes_decrypt_init_t)(const unsigned char *key, unsigned int
315315
*/
316316
typedef void (*esp_aes_decrypt_deinit_t)(void *ctx);
317317

318+
/**
319+
* @brief One-Key CBC MAC (OMAC1) hash with AES-128 for MIC computation
320+
*
321+
* @key: 128-bit key for the hash operation
322+
* @data: Data buffer for which a MIC is computed
323+
* @data_len: Length of data buffer in bytes
324+
* @mic: Buffer for MIC (128 bits, i.e., 16 bytes)
325+
* Returns: 0 on success, -1 on failure
326+
*/
327+
typedef int (*esp_omac1_aes_128_t)(const uint8_t *key, const uint8_t *data, size_t data_len,
328+
uint8_t *mic);
329+
330+
/**
331+
* @brief Decrypt data using CCMP (Counter Mode CBC-MAC Protocol OR
332+
* Counter Mode Cipher Block Chaining Message Authentication
333+
* Code Protocol) which is used in IEEE 802.11i RSN standard.
334+
* @tk: 128-bit Temporal Key for obtained during 4-way handshake
335+
* @hdr: Pointer to IEEE802.11 frame headeri needed for AAD
336+
* @data: Pointer to encrypted data buffer
337+
* @data_len: Encrypted data length in bytes
338+
* @decrypted_len: Length of decrypted data
339+
* Returns: Pointer to decrypted data on success, NULL on failure
340+
*/
341+
typedef uint8_t * (*esp_ccmp_decrypt_t)(const uint8_t *tk, const uint8_t *ieee80211_hdr,
342+
const uint8_t *data, size_t data_len, size_t *decrypted_len);
343+
344+
/**
345+
* @brief Encrypt data using CCMP (Counter Mode CBC-MAC Protocol OR
346+
* Counter Mode Cipher Block Chaining Message Authentication
347+
* Code Protocol) which is used in IEEE 802.11i RSN standard.
348+
* @tk: 128-bit Temporal Key for obtained during 4-way handshake
349+
* @frame: Pointer to IEEE802.11 frame including header
350+
* @len: Length of the frame including header
351+
* @hdrlen: Length of the header
352+
* @pn: Packet Number counter
353+
* @keyid: Key ID to be mentioned in CCMP Vector
354+
* @encrypted_len: Length of the encrypted frame including header
355+
*/
356+
typedef uint8_t * (*esp_ccmp_encrypt_t)(const uint8_t *tk, uint8_t *frame, size_t len, size_t hdrlen,
357+
uint8_t *pn, int keyid, size_t *encrypted_len);
358+
318359
/**
319360
* @brief The crypto callback function structure used when do station security connect.
320361
* The structure can be set as software crypto or the crypto optimized by ESP32
@@ -342,6 +383,9 @@ typedef struct {
342383
esp_aes_decrypt_t aes_decrypt;
343384
esp_aes_decrypt_init_t aes_decrypt_init;
344385
esp_aes_decrypt_deinit_t aes_decrypt_deinit;
386+
esp_omac1_aes_128_t omac1_aes_128;
387+
esp_ccmp_decrypt_t ccmp_decrypt;
388+
esp_ccmp_encrypt_t ccmp_encrypt;
345389
}wpa_crypto_funcs_t;
346390

347391
/**

tools/sdk/include/esp_wifi/esp_wifi_types.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ typedef enum {
5656
WIFI_AUTH_WPA2_PSK, /**< authenticate mode : WPA2_PSK */
5757
WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */
5858
WIFI_AUTH_WPA2_ENTERPRISE, /**< authenticate mode : WPA2_ENTERPRISE */
59+
WIFI_AUTH_WPA3_PSK, /**< authenticate mode : WPA3_PSK */
5960
WIFI_AUTH_MAX
6061
} wifi_auth_mode_t;
6162

@@ -84,6 +85,8 @@ typedef enum {
8485
WIFI_REASON_802_1X_AUTH_FAILED = 23,
8586
WIFI_REASON_CIPHER_SUITE_REJECTED = 24,
8687

88+
WIFI_REASON_INVALID_PMKID = 53,
89+
8790
WIFI_REASON_BEACON_TIMEOUT = 200,
8891
WIFI_REASON_NO_AP_FOUND = 201,
8992
WIFI_REASON_AUTH_FAIL = 202,
@@ -134,6 +137,7 @@ typedef enum {
134137
WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */
135138
WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */
136139
WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */
140+
WIFI_CIPHER_TYPE_AES_CMAC128,/**< the cipher type is AES-CMAC-128 */
137141
WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */
138142
} wifi_cipher_type_t;
139143

@@ -199,6 +203,12 @@ typedef enum {
199203
WIFI_BW_HT40, /* Bandwidth is HT40 */
200204
} wifi_bandwidth_t;
201205

206+
/** Configuration structure for Protected Management Frame */
207+
typedef struct {
208+
bool capable; /**< Advertizes support for Protected Management Frame. Device will prefer to connect in PMF mode if other device also advertizes PMF capability. */
209+
bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */
210+
} wifi_pmf_config_t;
211+
202212
/** @brief Soft-AP configuration settings for the ESP32 */
203213
typedef struct {
204214
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 {
222232
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. */
223233
wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */
224234
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. */
235+
wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */
225236
} wifi_sta_config_t;
226237

227238
/** @brief Configuration data for ESP32 AP or STA.

tools/sdk/include/wpa_supplicant/esp_supplicant/esp_wpa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdbool.h>
2020
#include "esp_err.h"
2121
#include "esp_wifi_crypto_types.h"
22+
#include "esp_wifi_types.h"
2223

2324
#ifdef __cplusplus
2425
extern "C" {
@@ -63,7 +64,6 @@ esp_err_t esp_supplicant_init(void);
6364
*/
6465
esp_err_t esp_supplicant_deinit(void);
6566

66-
6767
/**
6868
* @}
6969
*/

tools/sdk/include/wpa_supplicant/esp_wpa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdbool.h>
2020
#include "esp_err.h"
2121
#include "esp_wifi_crypto_types.h"
22+
#include "esp_wifi_types.h"
2223

2324
#ifdef __cplusplus
2425
extern "C" {
@@ -63,7 +64,6 @@ esp_err_t esp_supplicant_init(void);
6364
*/
6465
esp_err_t esp_supplicant_deinit(void);
6566

66-
6767
/**
6868
* @}
6969
*/

tools/sdk/include/wpa_supplicant/os.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ char * ets_strdup(const char *s);
228228
#ifndef os_memcmp
229229
#define os_memcmp(s1, s2, n) memcmp((s1), (s2), (n))
230230
#endif
231+
#ifndef os_memcmp_const
232+
#define os_memcmp_const(s1, s2, n) memcmp((s1), (s2), (n))
233+
#endif
234+
231235

232236
#ifndef os_strlen
233237
#define os_strlen(s) strlen(s)
@@ -274,6 +278,11 @@ char * ets_strdup(const char *s);
274278
#endif
275279
#endif
276280

281+
static inline int os_snprintf_error(size_t size, int res)
282+
{
283+
return res < 0 || (unsigned int) res >= size;
284+
}
285+
277286
/**
278287
* os_strlcpy - Copy a string with size bound and NUL-termination
279288
* @dest: Destination

tools/sdk/include/wpa_supplicant/supplicant_opt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@
2121
#define USE_MBEDTLS_CRYPTO 1
2222
#endif
2323

24+
#if CONFIG_WPA_TLS_V12
25+
#define CONFIG_TLSV12
26+
#endif
27+
2428
#endif /* _SUPPLICANT_OPT_H */

0 commit comments

Comments
 (0)