* we recommend, so as the API in WPS default and WPA2 default.
*/
const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs = {
+ .size = sizeof(wpa_crypto_funcs_t),
+ .version = ESP_WIFI_CRYPTO_VERSION,
.aes_wrap = (esp_aes_wrap_t)fast_aes_wrap,
.aes_unwrap = (esp_aes_unwrap_t)fast_aes_unwrap,
.hmac_sha256_vector = (esp_hmac_sha256_vector_t)fast_hmac_sha256_vector,
};
const wps_crypto_funcs_t g_wifi_default_wps_crypto_funcs = {
+ .size = sizeof(wps_crypto_funcs_t),
+ .version = ESP_WIFI_CRYPTO_VERSION,
.aes_128_encrypt = (esp_aes_128_encrypt_t)fast_aes_128_cbc_encrypt,
.aes_128_decrypt = (esp_aes_128_decrypt_t)fast_aes_128_cbc_decrypt,
.crypto_mod_exp = (esp_crypto_mod_exp_t)fast_crypto_mod_exp,
* crypto_hash_finish, so do crypto_cipher.
*/
const wpa2_crypto_funcs_t g_wifi_default_wpa2_crypto_funcs = {
+ .size = sizeof(wpa2_crypto_funcs_t),
+ .version = ESP_WIFI_CRYPTO_VERSION,
.crypto_hash_init = (esp_crypto_hash_init_t)fast_crypto_hash_init,
.crypto_hash_update = (esp_crypto_hash_update_t)fast_crypto_hash_update,
.crypto_hash_finish = (esp_crypto_hash_finish_t)fast_crypto_hash_finish,
.eap_peer_blob_deinit = (esp_eap_peer_blob_deinit_t)eap_peer_blob_deinit,
.eap_peer_config_init = (esp_eap_peer_config_init_t)eap_peer_config_init,
.eap_peer_config_deinit = (esp_eap_peer_config_deinit_t)eap_peer_config_deinit,
+ .eap_peer_register_methods = (esp_eap_peer_register_methods_t)eap_peer_register_methods,
+ .eap_peer_unregister_methods = (esp_eap_peer_unregister_methods_t)eap_peer_unregister_methods,
.eap_deinit_prev_method = (esp_eap_deinit_prev_method_t)eap_deinit_prev_method,
.eap_peer_get_eap_method = (esp_eap_peer_get_eap_method_t)eap_peer_get_eap_method,
.eap_sm_abort = (esp_eap_sm_abort_t)eap_sm_abort,
extern "C" {
#endif
+#define ESP_WIFI_CRYPTO_VERSION 0x00000001
+
/*
* Enumeration for hash operations.
* When WPA2 is connecting, this enum is used to
* hardware.
*/
typedef struct {
+ uint32_t size;
+ uint32_t version;
esp_aes_wrap_t aes_wrap; /**< station connect function used when send EAPOL frame */
esp_aes_unwrap_t aes_unwrap; /**< station connect function used when decrypt key data */
esp_hmac_sha256_vector_t hmac_sha256_vector; /**< station connect function used when check MIC */
* hardware.
*/
typedef struct{
+ uint32_t size;
+ uint32_t version;
esp_aes_128_encrypt_t aes_128_encrypt; /**< function used to process message when do WPS */
esp_aes_128_decrypt_t aes_128_decrypt; /**< function used to process message when do WPS */
esp_crypto_mod_exp_t crypto_mod_exp; /**< function used to calculate public key and private key */
* hardware.
*/
typedef struct {
+ uint32_t size;
+ uint32_t version;
esp_crypto_hash_init_t crypto_hash_init; /**< function used to initialize a crypto_hash structure when use TLSV1 */
esp_crypto_hash_update_t crypto_hash_update; /**< function used to calculate hash data when use TLSV1 */
esp_crypto_hash_finish_t crypto_hash_finish; /**< function used to finish the hash calculate when use TLSV1 */
esp_eap_peer_blob_deinit_t eap_peer_blob_deinit;
esp_eap_peer_config_init_t eap_peer_config_init;
esp_eap_peer_config_deinit_t eap_peer_config_deinit;
+ esp_eap_peer_register_methods_t eap_peer_register_methods;
+ esp_eap_peer_unregister_methods_t eap_peer_unregister_methods;
esp_eap_deinit_prev_method_t eap_deinit_prev_method;
esp_eap_peer_get_eap_method_t eap_peer_get_eap_method;
esp_eap_sm_abort_t eap_sm_abort;
*/
esp_err_t esp_wifi_internal_osi_funcs_md5_check(const char *md5);
+/**
+ * @brief Check the MD5 values of the crypto types header files in IDF and WiFi library
+ *
+ * @attention 1. It is used for internal CI version check
+ *
+ * @return
+ * - ESP_OK : succeed
+ * - ESP_WIFI_INVALID_ARG : MD5 check fail
+ */
+esp_err_t esp_wifi_internal_crypto_funcs_md5_check(const char *md5);
+
/**
* @brief Allocate a chunk of memory for WiFi driver
*
-Subproject commit 13a07ae99e83c2781c1bfd322e131226c688a4e9
+Subproject commit 37f7289daf5aacbd4c789f9e01f451f5e3f45f76
extern esp_err_t wifi_osi_funcs_register(wifi_osi_funcs_t *osi_funcs);
status = wifi_osi_funcs_register(&g_wifi_osi_funcs);
if(status != ESP_OK) {
+ ESP_LOGE(TAG, "failed to register wifi os adapter, ret(%d)", status);
+ _lock_release(&s_phy_rf_init_lock);
return ESP_FAIL;
}
coex_bt_high_prio();
WIFI_OS_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_os_adapter.h | cut -c 1-7)\"
CFLAGS+=-DWIFI_OS_ADAPTER_MD5=$(WIFI_OS_ADAPTER_MD5_VAL)
+# Calculate MD5 value of header file esp_wifi_crypto_types.h
+WIFI_CRYPTO_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_crypto_types.h | cut -c 1-7)\"
+CFLAGS+=-DWIFI_CRYPTO_MD5=$(WIFI_CRYPTO_MD5_VAL)
+
+
test_tjpgd.o: test_tjpgd_logo.h
test_tjpgd_logo.h: $(COMPONENT_PATH)/logo.jpg
#include "esp_log.h"
#include "esp_wifi_internal.h"
-static const char* TAG = "test_os_adapter_md5";
+static const char* TAG = "test_header_files_md5";
TEST_CASE("wifi os adapter MD5","[wifi]")
{
ESP_LOGI(TAG, "test passed...");
}
+
+TEST_CASE("wifi crypto types MD5","[wifi]")
+{
+ const char *test_wifi_crypto_funcs_md5 = WIFI_CRYPTO_MD5;
+
+ ESP_LOGI(TAG, "test wifi crypto adapter MD5...");
+ TEST_ESP_OK(esp_wifi_internal_crypto_funcs_md5_check(test_wifi_crypto_funcs_md5));
+
+ ESP_LOGI(TAG, "test passed...");
+}
int eap_peer_ttls_register(void);
int eap_peer_mschapv2_register(void);
+void eap_peer_unregister_methods(void);
+int eap_peer_register_methods(void);
+
#endif /* EAP_METHODS_H */